dlls/winemac.drv/window.c
/***********************************************************************
 *              macdrv_create_win_data
 *
 * Create a Mac data window structure for an existing window.
 */
macdrv_create_win_data
Create a Mac data window structure for an existing window.
macdrv_create_win_data Create a Mac data window structure for an existing window .
static struct macdrv_win_data *macdrv_create_win_data(HWND hwnd, const RECT *window_rect,
                                                      const RECT *client_rect)
{
    struct macdrv_win_data *data;
    HWND parent;
    if (GetWindowThreadProcessId(hwnd, NULL) != GetCurrentThreadId()) return NULL;
    if (!(parent = GetAncestor(hwnd, GA_PARENT)))  
    {
        macdrv_init_thread_data();
        return NULL;
    }
    if (parent != GetDesktopWindow() && !GetAncestor(parent, GA_PARENT)) return NULL;
    if (!(data = alloc_win_data(hwnd))) return NULL;
    data->whole_rect = data->window_rect = *window_rect;
    data->client_rect = *client_rect;
    if (parent == GetDesktopWindow())
    {
        create_cocoa_window(data);
        TRACE("win %p/%p window %s whole %s client %s\n",
               hwnd, data->cocoa_window, wine_dbgstr_rect(&data->window_rect),
               wine_dbgstr_rect(&data->whole_rect), wine_dbgstr_rect(&data->client_rect));
    }
    return data;
}
static struct macdrv_win_data * macdrv_create_win_data ( HWND hwnd , const RECT * window_rect , const RECT * client_rect ) { struct macdrv_win_data * data ; HWND parent ; if ( GetWindowThreadProcessId ( hwnd , NULL ) != GetCurrentThreadId ( ) ) return NULL ; if ( ! ( parent = GetAncestor ( hwnd , GA_PARENT ) ) ) { macdrv_init_thread_data ( ) ; return NULL ; } if ( parent != GetDesktopWindow ( ) && ! GetAncestor ( parent , GA_PARENT ) ) return NULL ; if ( ! ( data = alloc_win_data ( hwnd ) ) ) return NULL ; data -> whole_rect = data -> window_rect = * window_rect ; data -> client_rect = * client_rect ; if ( parent == GetDesktopWindow ( ) ) { create_cocoa_window ( data ) ; TRACE ( " \n " , hwnd , data -> cocoa_window , wine_dbgstr_rect ( & data -> window_rect ) , wine_dbgstr_rect ( & data -> whole_rect ) , wine_dbgstr_rect ( & data -> client_rect ) ) ; } return data ; }
macdrv_create_win_data
 Create a Mac data window structure for an existing window.
macdrv_create_win_data Create a Mac data window structure for an existing window .
/* desktop */ /* don't create win data for HWND_MESSAGE windows */