Lines Matching refs:window

22  * windows.  Typically, one window is handled by Chromium while any
144 void stubDestroyWindow( GLint con, GLint window )
147 crHashtableSearch(stub.windowTable, (unsigned int) window);
176 crHashtableDelete(stub.windowTable, window, crFree);
183 * Create a new _Chromium_ window, not GLX, WGL or CGL.
205 /* Ask the head SPU for the initial window size */
315 /*@todo this will create new pixmap for window every call*/
618 InstantiateNativeContext( WindowInfo *window, ContextInfo *context )
621 context->hglrc = stub.wsInterface.wglCreateContext( window->drawable );
680 context->glxContext = stub.wsInterface.glXCreateContext( window->dpy,
689 * Utility functions to get window size and titlebar text.
694 stubGetWindowGeometry(const WindowInfo *window, int *x, int *y,
699 if (!window->drawable || !window->hWnd) {
704 if (window->hWnd!=WindowFromDC(window->drawable))
706 crWarning("Window(%i) DC is no longer valid", window->spuWindow);
710 if (!GetClientRect(window->hWnd, &rect))
712 crWarning("GetClientRect failed for %p", window->hWnd);
719 if (!ClientToScreen( window->hWnd, (LPPOINT) &rect ))
721 crWarning("ClientToScreen failed for %p", window->hWnd);
730 GetWindowTitle( const WindowInfo *window, char *title )
733 if (window->hWnd)
734 GetWindowText(window->hWnd, title, 100);
740 GetCursorPosition(WindowInfo *window, int pos[2])
749 // apparently the "window" parameter passed to this
750 // function contains the native window information
751 HWND NATIVEhwnd = window->hWnd;
753 if (NATIVEhwnd!=WindowFromDC(window->drawable))
755 crWarning("Window(%i) DC is no longer valid", window->spuWindow);
759 // get the native window's height and width
760 stubGetWindowGeometry(window, &x, &y, &NativeWidth, &NativeHeight);
762 // get the spu window's height and width
763 stub.spu->dispatch_table.GetChromiumParametervCR(GL_WINDOW_SIZE_CR, window->spuWindow, GL_INT, 2, size);
767 // get the ratio of the size of the native window to the cr window
787 // make sure these coordinates are relative to the native window,
808 stubGetWindowGeometry( const WindowInfo *window, int *x, int *y, unsigned int *w, unsigned int *h )
812 if( !window ||
813 !window->connection ||
814 !window->drawable ||
815 CGSGetWindowBounds( window->connection, window->drawable, rect ) != noErr )
829 GetWindowTitle( const WindowInfo *window, char *title )
831 /* XXX \todo Darwin window Title */
837 GetCursorPosition( const WindowInfo *window, int pos[2] )
843 CGSGetScreenRectForWindow( window->connection, window->drawable, window_rect );
854 stubGetWindowGeometry(WindowInfo *window, int *x, int *y, unsigned int *w, unsigned int *h)
860 dpy = stubGetWindowDisplay(window);
865 if (window && dpy)
870 if (!window
872 || !window->drawable
873 || !XGetGeometry(dpy, window->drawable, &root, x, y, w, h, &border, &depth)
874 || !XTranslateCoordinates(dpy, window->drawable, root, 0, 0, x, y, &child))
876 crWarning("Failed to get windows geometry for %p, try xwininfo", window);
881 if (window && dpy)
888 GetWindowTitleHelper( Display *dpy, Window window, GLboolean recurseUp )
892 if (!XFetchName(dpy, window, &name))
898 /* This window has no name, try the parent */
902 stat = XQueryTree( dpy, window, &root, &parent,
904 if (!stat || window == root)
908 window = parent;
918 GetWindowTitle( const WindowInfo *window, char *title )
920 char *t = GetWindowTitleHelper(window->dpy, window->drawable, GL_TRUE);
932 *Return current cursor position in local window coords.
935 GetCursorPosition(WindowInfo *window, int pos[2] )
942 XLOCK(window->dpy);
944 Bool q = XQueryPointer(window->dpy, window->drawable, &root, &child,
948 stubGetWindowGeometry( window, &x, &y, &w, &h );
956 XUNLOCK(window->dpy);
970 stubCheckUseChromium( WindowInfo *window )
975 /* If the provided window is CHROMIUM, we're clearly intended
978 if (window->type == CHROMIUM)
984 GetWindowTitle(window, title);
986 crDebug("GL faker: Ignoring freeglut menu window");
991 /* If the user's specified a window count for Chromium, see if
992 * this window satisfies that criterium.
997 crDebug("Using native GL, app window doesn't meet match_window_count");
1002 /* If the user's specified a window list to ignore, see if this
1003 * window satisfies that criterium.
1010 crDebug("Ignore window ID %d, using native GL", stub.matchChromiumWindowID[i]);
1016 /* If the user's specified a minimum window size for Chromium, see if
1017 * this window satisfies that criterium.
1021 stubGetWindowGeometry( window, &x, &y, &w, &h );
1025 /* Check for maximum sized window now too */
1037 crDebug("Using native GL, app window doesn't meet minimum_window_size");
1041 /* If the user's specified a window title for Chromium, see if this
1042 * window satisfies that criterium.
1063 GetWindowTitle( window, title );
1077 crDebug("Using native GL, app window title doesn't match match_window_title string (\"%s\" != \"%s\")", title, stub.matchWindowTitle);
1086 /* User hasn't specified a width/height or window title.
1087 * We'll use chromium for this window (and context) if no other is.
1102 because GL context is already released from DC and actual guest window
1157 stubMakeCurrent( WindowInfo *window, ContextInfo *context )
1165 if (!context || !window) {
1185 if (stubCheckUseChromium(window)) {
1198 if (window->spuWindow == -1)
1200 /*crDebug("(1)stubMakeCurrent ctx=%p(%i) window=%p(%i)", context, context->spuContext, window, window->spuWindow);*/
1201 window->spuWindow = stub.spu->dispatch_table.VBoxWindowCreate(spuConnection, window->dpyName, context->visBits );
1203 window->u32ClientID = stub.spu->dispatch_table.VBoxPackGetInjectID(spuConnection);
1211 if (!InstantiateNativeContext(window, context))
1232 retVal = (GLboolean) stub.wsInterface.wglMakeCurrent( window->drawable, context->hglrc );
1235 retVal = ( stub.wsInterface.CGLSetSurface(context->cglc, window->connection, window->drawable, window->surface) == noErr );
1238 retVal = (GLboolean) stub.wsInterface.glXMakeCurrent( window->dpy, window->drawable, context->glxContext );
1248 /*if (context->currentDrawable && context->currentDrawable != window)
1249 crDebug("Rebinding context %p to a different window", context);*/
1251 if (window->type == NATIVE) {
1252 crWarning("Can't rebind a chromium context to a native window\n");
1256 if (window->spuWindow == -1)
1258 /*crDebug("(2)stubMakeCurrent ctx=%p(%i) window=%p(%i)", context, context->spuContext, window, window->spuWindow);*/
1259 window->spuWindow = stub.spu->dispatch_table.VBoxWindowCreate(
1265 window->dpyName, context->visBits );
1267 window->u32ClientID = stub.spu->dispatch_table.VBoxPackGetInjectID(
1299 if (window->spuWindow != (GLint)window->drawable)
1300 stub.spu->dispatch_table.MakeCurrent( window->spuWindow, (GLint) window->drawable, context->spuContext );
1302 stub.spu->dispatch_table.MakeCurrent( window->spuWindow, 0, /* native window handle */ context->spuContext );
1308 window->type = context->type;
1309 window->pOwner = context;
1310 context->currentDrawable = window;
1332 if (!window->width && window->type == CHROMIUM) {
1333 /* One time window setup */
1337 stubGetWindowGeometry( window, &x, &y, &winW, &winH );
1339 /* If we're not using GLX/WGL (no app window) we'll always get
1344 window->width = winW;
1345 window->height = winH;
1347 if (stubIsWindowVisible(window))
1351 stub.spuDispatch.WindowSize( window->spuWindow, winW, winH );
1353 stub.spuDispatch.WindowPosition(window->spuWindow, x, y);
1359 stub.spu->dispatch_table.WindowVisibleRegion(window->spuWindow, 0, NULL);
1363 /* Update window mapping state.
1368 if (stub.trackWindowVisibility && window->type == CHROMIUM && window->drawable) {
1369 const int mapped = stubIsWindowVisible(window);
1370 if (mapped != window->mapped) {
1371 crDebug("Dispatched: WindowShow(%i, %i)", window->spuWindow, mapped);
1372 stub.spu->dispatch_table.WindowShow(window->spuWindow, mapped);
1373 window->mapped = mapped;
1418 stubSwapBuffers(WindowInfo *window, GLint flags)
1420 if (!window)
1423 /* Determine if this window is being rendered natively or through
1427 if (window->type == NATIVE) {
1428 /*printf("*** Swapping native window %d\n", (int) drawable);*/
1430 (void) stub.wsInterface.wglSwapBuffers( window->drawable );
1436 stub.wsInterface.glXSwapBuffers( window->dpy, window->drawable );
1439 else if (window->type == CHROMIUM) {
1441 /*printf("*** Swapping chromium window %d\n", (int) drawable);*/
1444 GetCursorPosition(window, pos);
1447 stub.spu->dispatch_table.SwapBuffers( window->spuWindow, flags );
1450 crDebug("Calling SwapBuffers on a window we haven't seen before (no-op).");