static void ROM_UnsetVideoMode(_THIS, SDL_Surface *current) { /* Free the current window, if any */ if ( SDL_Window != nil ) { GWorldPtr memworld; /* Handle OpenGL support */ Mac_GL_Quit(this); memworld = (GWorldPtr)GetWRefCon(SDL_Window); if ( memworld != nil ) { UnlockPixels(GetGWorldPixMap(memworld)); DisposeGWorld(memworld); } if ( (current->flags & SDL_FULLSCREEN) == SDL_FULLSCREEN ) { #if USE_QUICKTIME EndFullScreen(fullscreen_ctx, nil); SDL_Window = nil; #else ROM_ShowMenuBar(this); #endif } } current->pixels = NULL; current->flags &= ~(SDL_HWSURFACE|SDL_FULLSCREEN); }
void VLCWindowsManager::ToggleFullScreen() { if( IsFullScreen() ) { EndFullScreen(); } else { StartFullScreen(); } }
void cvSetModeWindow_CARBON( const char* name, double prop_value)//Yannick Verdie { OSStatus err = noErr; CV_FUNCNAME( "cvSetModeWindow_QT" ); __BEGIN__; CvWindow* window; if(!name) CV_ERROR( CV_StsNullPtr, "NULL name string" ); window = icvFindWindowByName( name ); if( !window ) CV_ERROR( CV_StsNullPtr, "NULL window" ); if(window->flags & CV_WINDOW_AUTOSIZE)//if the flag CV_WINDOW_AUTOSIZE is set EXIT; if (window->status==CV_WINDOW_FULLSCREEN && prop_value==CV_WINDOW_NORMAL) { err = EndFullScreen(window->restoreState,0); if (err != noErr) fprintf(stdout,"Error EndFullScreen\n"); window->window = window->oldwindow; ShowWindow( window->window ); window->status=CV_WINDOW_NORMAL; EXIT; } if (window->status==CV_WINDOW_NORMAL && prop_value==CV_WINDOW_FULLSCREEN) { GDHandle device; err = GetWindowGreatestAreaDevice(window->window, kWindowTitleBarRgn, &device, NULL); if (err != noErr) fprintf(stdout,"Error GetWindowGreatestAreaDevice\n"); HideWindow(window->window); window->oldwindow = window->window; err = BeginFullScreen(&(window->restoreState), device, 0, 0, &window->window, 0, fullScreenAllowEvents | fullScreenDontSwitchMonitorResolution); if (err != noErr) fprintf(stdout,"Error BeginFullScreen\n"); window->status=CV_WINDOW_FULLSCREEN; EXIT; } __END__; }
static void leave_full_screen(void) { if(amFullScreen) { EndFullScreen(fullScreenRestore, 0); theWindow = oldWindow; ShowWindow(theWindow); amFullScreen = 0; window_resized(); Rectangle rect = { { 0, 0 }, { bounds.size.width, bounds.size.height } }; wmtrack(0, rect.max.x, rect.max.y, 0); drawqlock(); flushmemscreen(rect); drawqunlock(); } }
void x_full_screen(int do_full) { #if 0 WindowRef new_window; short width, height; OSErr ret; width = 640; height = 480; if(do_full && (g_mac_fullscreen_state == 0)) { g_main_window_saved = g_main_window; GetWindowBounds(g_main_window, kWindowContentRgn, &g_main_window_saved_rect); ret = BeginFullScreen(&g_mac_fullscreen_state, 0, &width, &height, &new_window, 0, 0); printf("Ret beginfullscreen: %d\n", (int)ret); printf("New width: %d, new height: %d\n", width, height); if(ret == noErr) { g_main_window = new_window; } else { g_mac_fullscreen_state = 0; } } else if(!do_full && (g_mac_fullscreen_state != 0)) { ret = EndFullScreen(g_mac_fullscreen_state, 0); printf("ret endfullscreen: %d\n", (int)ret); g_main_window = g_main_window_saved; g_mac_fullscreen_state = 0; //InitCursor(); SetWindowBounds(g_main_window, kWindowContentRgn, &g_main_window_saved_rect); } update_main_window_size(); ShowWindow(g_main_window); BringToFront(g_main_window); update_window(); #endif }