/**
      \brief Retrieve info from window, needed for accel layer
*/
void UI_getWindowInfo(void *draw, GUI_WindowInfo *xinfo)
{
        GdkWindow *win;
        GtkWidget *widget=(GtkWidget *)draw;
          
        win = gtk_widget_get_parent_window(widget);

#ifdef __WIN32
		xinfo->display = (void*)GDK_WINDOW_HWND(widget->window);
#elif defined(__APPLE__)
		int windowWidth, windowHeight;
		int x, y;

		gdk_drawable_get_size(win, &windowWidth, &windowHeight);
		gdk_window_get_position(widget->window, &x, &y);

		xinfo->display = 0;
		xinfo->window = getMainNSWindow();
		xinfo->x = x;
		xinfo->y = windowHeight - (y + lastH);
		xinfo->width = lastW;
		xinfo->height = lastH;
#else
		xinfo->window = GDK_WINDOW_XWINDOW(widget->window);
		xinfo->display = GDK_WINDOW_XDISPLAY(win);
#endif
}
Esempio n. 2
0
/**
      \brief Retrieve info from window, needed for accel layer
*/
void UI_getWindowInfo(void *draw, GUI_WindowInfo *xinfo)
{
		GdkWindow *win, *parentWin;
		GtkWidget *widget=(GtkWidget *)draw;

		win = gtk_widget_get_window(widget);
		parentWin = gtk_widget_get_parent_window(widget);

#ifdef _WIN32
		xinfo->display = (void*)GDK_WINDOW_HWND(win);
#elif defined(__APPLE__)
		xinfo->display = 0;
		xinfo->window = getMainNSWindow();
#else
		xinfo->systemWindowId = GDK_WINDOW_XID(win);
		xinfo->display = GDK_WINDOW_XDISPLAY(parentWin);
#endif

		int windowWidth, windowHeight;
		int x, y;

		windowWidth = gdk_window_get_width(parentWin);
		windowHeight = gdk_window_get_height(parentWin);
		gdk_window_get_position(win, &x, &y);

		xinfo->x = x;
		xinfo->y = windowHeight - (y + lastH);
		xinfo->width = lastW;
		xinfo->height = lastH;
}
Esempio n. 3
0
void getMainWindowHandles(long int *handle,long int *nativeHandle)
{
    *handle = (long int)guiRootWindow;

#ifdef _WIN32
    *nativeHandle = (long int)gtk_widget_get_window(guiRootWindow);
#elif defined(__APPLE__)
    *nativeHandle = (long int)getMainNSWindow();
#else
    *nativeHandle = (long int)gtk_widget_get_window(guiRootWindow);
#endif
}