dlls/winemac.drv/window.c
/**********************************************************************
 *              create_cocoa_window
 *
 * Create the whole Mac window for a given window
 */
create_cocoa_window
Create the whole Mac window for a given window
create_cocoa_window Create the whole Mac window for a given window
static void create_cocoa_window(struct macdrv_win_data *data)
{
    struct macdrv_thread_data *thread_data = macdrv_init_thread_data();
    WCHAR text[1024];
    struct macdrv_window_features wf;
    CGRect frame;
    DWORD style, ex_style;
    HRGN win_rgn;
    COLORREF key;
    BYTE alpha;
    DWORD layered_flags;
    if ((win_rgn = CreateRectRgn(0, 0, 0, 0)) &&
        GetWindowRgn(data->hwnd, win_rgn) == ERROR)
    {
        DeleteObject(win_rgn);
        win_rgn = 0;
    }
    data->shaped = (win_rgn != 0);
    style = GetWindowLongW(data->hwnd, GWL_STYLE);
    ex_style = GetWindowLongW(data->hwnd, GWL_EXSTYLE);
    data->whole_rect = data->window_rect;
    macdrv_window_to_mac_rect(data, style, &data->whole_rect);
    memset(&wf, 0, sizeof(wf));
    get_cocoa_window_features(data, style, ex_style, &wf);
    frame = cgrect_from_rect(data->whole_rect);
    constrain_window_frame(&frame);
    TRACE("creating %p window %s whole %s client %s\n", data->hwnd, wine_dbgstr_rect(&data->window_rect),
          wine_dbgstr_rect(&data->whole_rect), wine_dbgstr_rect(&data->client_rect));
    data->cocoa_window = macdrv_create_cocoa_window(&wf, frame, data->hwnd, thread_data->queue);
    if (!data->cocoa_window) goto done;
    set_cocoa_window_properties(data);
    if (!InternalGetWindowText(data->hwnd, text, sizeof(text)/sizeof(WCHAR))) text[0] = 0;
    macdrv_set_cocoa_window_title(data->cocoa_window, text, strlenW(text));
    if (win_rgn) sync_window_region(data, win_rgn);
    if (!GetLayeredWindowAttributes(data->hwnd, &key, &alpha, &layered_flags)) layered_flags = 0;
    sync_window_opacity(data, key, alpha, FALSE, layered_flags);
done:
    if (win_rgn) DeleteObject(win_rgn);
}
static void create_cocoa_window ( struct macdrv_win_data * data ) { struct macdrv_thread_data * thread_data = macdrv_init_thread_data ( ) ; WCHAR text [ 1024 ] ; struct macdrv_window_features wf ; CGRect frame ; DWORD style , ex_style ; HRGN win_rgn ; COLORREF key ; BYTE alpha ; DWORD layered_flags ; if ( ( win_rgn = CreateRectRgn ( 0 , 0 , 0 , 0 ) ) && GetWindowRgn ( data -> hwnd , win_rgn ) == ERROR ) { DeleteObject ( win_rgn ) ; win_rgn = 0 ; } data -> shaped = ( win_rgn != 0 ) ; style = GetWindowLongW ( data -> hwnd , GWL_STYLE ) ; ex_style = GetWindowLongW ( data -> hwnd , GWL_EXSTYLE ) ; data -> whole_rect = data -> window_rect ; macdrv_window_to_mac_rect ( data , style , & data -> whole_rect ) ; memset ( & wf , 0 , sizeof ( wf ) ) ; get_cocoa_window_features ( data , style , ex_style , & wf ) ; frame = cgrect_from_rect ( data -> whole_rect ) ; constrain_window_frame ( & frame ) ; TRACE ( " \n " , data -> hwnd , wine_dbgstr_rect ( & data -> window_rect ) , wine_dbgstr_rect ( & data -> whole_rect ) , wine_dbgstr_rect ( & data -> client_rect ) ) ; data -> cocoa_window = macdrv_create_cocoa_window ( & wf , frame , data -> hwnd , thread_data -> queue ) ; if ( ! data -> cocoa_window ) goto done ; set_cocoa_window_properties ( data ) ; if ( ! InternalGetWindowText ( data -> hwnd , text , sizeof ( text ) / sizeof ( WCHAR ) ) ) text [ 0 ] = 0 ; macdrv_set_cocoa_window_title ( data -> cocoa_window , text , strlenW ( text ) ) ; if ( win_rgn ) sync_window_region ( data , win_rgn ) ; if ( ! GetLayeredWindowAttributes ( data -> hwnd , & key , & alpha , & layered_flags ) ) layered_flags = 0 ; sync_window_opacity ( data , key , alpha , FALSE , layered_flags ) ; done : if ( win_rgn ) DeleteObject ( win_rgn ) ; }
create_cocoa_window
 Create the whole Mac window for a given window
create_cocoa_window Create the whole Mac window for a given window
/* set the window text */ /* set the window region */ /* set the window opacity */