bool Client::SetResolution (const int w, const int h) { SDL_DisplayMode mode; SDL_SetWindowSize (mainWindow, w, h); if (SDL_GetWindowDisplayMode (mainWindow, &mode) < 0) { SetError ("Error getting display mode: %s", SDL_GetError ()); return false; } mode.w = w; mode.h = h; if (SDL_SetWindowDisplayMode (mainWindow, &mode) < 0) { SetError ("Error setting display to %d x %d %s", w, h, SDL_GetError ()); return false; } if (fullscreen) // need to switch to windowed to take effect { if (!SetFullScreen (false)) return false; if (!SetFullScreen (true)) return false; } SaveSetting (settingsPath.c_str (), SCREENWIDTH_SETTING, w); SaveSetting (settingsPath.c_str (), SCREENHEIGHT_SETTING, h); return true; }
void cWindow::SetOriginalRes( const cDimension& pDimension ) { mOriginalResolution = pDimension; if (!mWindowMode) { SetFullScreen(); SetFullScreen(); } else SetWindowSize( mWindow_Multiplier ); }
HRESULT FMPlayerDShow::Start() { HRESULT hr = E_FAIL; CComQIPtr<IFilterGraph> pFilterGraph = m_FilterGraph; if (pFilterGraph == NULL) return E_FAIL; m_MediaEvent = pFilterGraph; m_pBV = pFilterGraph; BOOL bIsFullScreen = IsFullScreen(); SetParentWnd(m_hWndParent); if (bIsFullScreen) SetFullScreen(TRUE); if (m_MediaControl != NULL) { hr = SeekPosition(m_Offset); m_Offset = 0; } return hr; }
/***************************************************************************** * VideoWindow::_SetToSettings *****************************************************************************/ void VideoWindow::_SetToSettings() { // adjust dimensions uint32_t mode = RESIZE_100; switch (fSettings->VideoSize()) { case VideoSettings::SIZE_50: mode = RESIZE_50; break; case VideoSettings::SIZE_200: mode = RESIZE_200; break; case VideoSettings::SIZE_100: case VideoSettings::SIZE_OTHER: default: break; } bool fullscreen = IsFullScreen(); // remember settings _SetVideoSize(mode); // because this will reset settings // the fullscreen status is reflected in the settings, // but not yet in the windows state if (fullscreen) SetFullScreen(true); if (fSettings->HasFlags(VideoSettings::FLAG_ON_TOP_ALL)) fCachedFeel = B_FLOATING_ALL_WINDOW_FEEL; else fCachedFeel = B_NORMAL_WINDOW_FEEL; SetFeel(fCachedFeel); }
BOOL CMiniPieFrame::PreTranslateMessage(MSG* pMsg) { if(CFrameWindowImpl<CMiniPieFrame>::PreTranslateMessage(pMsg)) return TRUE; if((pMsg->message < WM_KEYFIRST || pMsg->message > WM_KEYLAST) && (pMsg->message < WM_MOUSEFIRST || pMsg->message > WM_MOUSELAST)) return FALSE; if (m_bFullScreen && pMsg->message == WM_KEYUP && (pMsg->wParam == VK_F1 || pMsg->wParam == VK_F2)) SetFullScreen(false); HWND hWndCtl = ::GetFocus(); if(IsChild(hWndCtl)) { // find a direct child of the dialog from the window that has focus while(::GetParent(hWndCtl) != m_hWnd) hWndCtl = ::GetParent(hWndCtl); // give control a chance to translate this message if(::SendMessage(hWndCtl, WM_FORWARDMSG, 0, (LPARAM)pMsg) != 0) return TRUE; } return FALSE; }
void GlSpectrumAnalyzerWindow::MessageReceived(BMessage *message) { switch(message->what) { case 'file': { const char *oldname = name; const char *newname = message->FindString("name"); name = strdup(newname?newname:""); free((void*)oldname); } break; case GO_FULLSCREEN: SetFullScreen( !IsFullScreen() ); // ResizeBy(0,0); needResize = true; break; case B_KEY_DOWN: { const char *bytes = message->FindString( "bytes" ); if (bytes[0] == B_ESCAPE && bytes[1] == '\0') PostMessage(B_QUIT_REQUESTED); else BDirectGLWindow::MessageReceived(message); } break; default: BDirectGLWindow::MessageReceived(message); break; } }
void GX_BDirectWindow::MessageReceived(BMessage *msg) { switch(msg->what) { case MSG_SYSAPPLICATION_CLOSE: printf("Close thread BDirectWindow\n"); g_pApp->Kill(); break; case MSG_SYSAPPLICATION_OPEN: printf("Resume thread BDirectWindow\n"); resume_thread(m_DrawThread); break; case MSG_SYSAPPLICATION_SWITCHFS: printf("Toggle fullscreen BDirectWindow\n"); SetFullScreen(!IsFullScreen()); break; default: g_pApp->WindowMessage(msg); BDirectWindow::MessageReceived(msg); break; } }
void VSCMainWindows::SetupConnections() { connect(m_pMainArea, SIGNAL(tabCloseRequested(int)), this, SLOT(MainCloseTab(int))); connect(m_pDeviceList, SIGNAL(SurveillanceClicked()), this, SLOT(AddSurveillance())); connect(m_pDeviceList, SIGNAL(CameraAddClicked()), this, SLOT(AddCamera())); connect(m_pDeviceList, SIGNAL(PlaybackClicked()), this, SLOT(AddPlayback())); connect(m_pDeviceList, SIGNAL(SearchClicked()), this, SLOT(Search())); connect(m_pDeviceList, SIGNAL(RecorderClicked()), this, SLOT(AddRecorder())); connect(m_pDeviceList, SIGNAL(SiteAddClicked()), this, SLOT(AddSite())); connect(m_pDeviceList, SIGNAL(CameraEditClicked(int)), this, SLOT(EditCamera(int))); connect(m_pDeviceList, SIGNAL(CameraDeleteClicked(int)), this, SLOT(DeleteCamera(int))); connect(m_pDeviceList, SIGNAL(SiteEditClicked(int)), this, SLOT(EditSite(int))); connect(m_pDeviceList, SIGNAL(SiteDeleteClicked(int)), this, SLOT(DeleteSite(int))); /* Disk edit */ connect(m_pDeviceList, SIGNAL(DiskEditClicked()), this, SLOT(EditDisk())); //connect(this, SIGNAL(CameraDeleted()), m_pDeviceList, SLOT(CameraTreeUpdated())); connect(m_pToolBar->ui.pbFullScreen, SIGNAL(clicked()), this, SLOT(SetFullScreen())); connect(m_pToolBar->ui.pbAbout, SIGNAL(clicked()), this, SLOT(about())); connect(m_pToolBar->ui.pbAlarm, SIGNAL(clicked()), this, SLOT(AddEvent())); connect(m_pToolBar->ui.pbSetting, SIGNAL(clicked()), this, SLOT(Setting())); connect(m_pEventThread, SIGNAL(EventNotifyNoParam()), m_pToolBar, SLOT(NewAlarm())); }
bool CWinSystemMirGLContext::CreateNewWindow(const std::string& name, bool fullScreen, RESOLUTION_INFO& res, PHANDLE_EVENT_FUNC userFunction) { if (!m_pGLContext.CreateDisplay(m_connection, EGL_OPENGL_BIT, EGL_OPENGL_API)) { return false; } m_pixel_format = mir_connection_get_egl_pixel_format(m_connection, m_pGLContext.m_eglDisplay, m_pGLContext.m_eglConfig); CWinSystemMir::CreateNewWindow(name, fullScreen, res, userFunction); if (!m_pGLContext.CreateSurface(m_window)) { return false; } if (!m_pGLContext.CreateContext()) { return false; } return SetFullScreen(fullScreen, res, false); }
bool CWinSystemX11::CreateNewWindow(const std::string& name, bool fullScreen, RESOLUTION_INFO& res, PHANDLE_EVENT_FUNC userFunction) { if(!SetFullScreen(fullScreen, res, false)) return false; m_bWindowCreated = true; return true; }
void MainWindow::LeaveCustomView() { CustomView = false; /* quick hack to force SetFullScreen() to update the MapWindow */ FullScreen = !FullScreen; SetFullScreen(!FullScreen); }
VSCMainWindows::VSCMainWindows(ClientFactory &pFactory, QWidget *parent) : m_pFactory(pFactory), QMainWindow(parent), m_VidIdx(VSC_VID_IDX_LAST) { ui.setupUi(this); #ifdef WIN32 setStyleSheet(QString::fromUtf8("font: 10pt \"\345\276\256\350\275\257\351\233\205\351\273\221\";")); #endif m_pToolBar = new VSCToolBar(this); SetupToolBar(); VSCLoading *loading = new VSCLoading(NULL); loading->show(); QDesktopWidget *desktop = QApplication::desktop(); QRect rect = desktop->screenGeometry(0); loading->setGeometry(rect.width()/2, rect.height()/2, 64, 64); QCoreApplication::processEvents(); //QDockWidget *m_pDockDevicelist = new QDockWidget(tr("Devices"), this); m_pDockDevicelist = new QDockWidget(m_parent); m_pDockDevicelist->setFeatures(QDockWidget::DockWidgetMovable); //m_pDockDevicelist->setAllowedAreas(Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea); m_pDockDevicelist->setAllowedAreas(Qt::LeftDockWidgetArea); m_pDockDevicelist->setTitleBarWidget(new QWidget(m_parent)); m_pVidList = new VSCVidList(m_pDockDevicelist); m_pDockDevicelist->setWidget(m_pVidList); /* Show the Live default */ m_pVidLive = new VSCVidLive(m_pFactory, this); m_pVidConf = new VSCVidInf(m_pFactory, this);//TODO m_pVidPb = new VSCVidInf(m_pFactory, this);//TODO ShowVidLive(); delete loading; setWindowTitle(QApplication::translate("VSCMainWindowsClass", VE_INFO, 0)); connect(m_pToolBar->ui.pbFullScreen, SIGNAL(clicked()), this, SLOT(SetFullScreen())); connect(m_pToolBar->ui.pbAbout, SIGNAL(clicked()), this, SLOT(about())); connect(m_pToolBar->ui.pbUser, SIGNAL(clicked()), this, SLOT(UserStatus())); connect(m_pToolBar->ui.pbVidLive, SIGNAL(clicked()), this, SLOT(ShowVidLive())); connect(m_pToolBar->ui.pbVidLiveView, SIGNAL(clicked()), m_pVidLive, SLOT(SlotNewLiveView())); connect(m_pToolBar->ui.pbEmap, SIGNAL(clicked()), m_pVidLive, SLOT(SlotNewEmap())); connect(m_pToolBar->ui.pbVidPb, SIGNAL(clicked()), this, SLOT(ShowVidPb())); connect(m_pToolBar->ui.pbVidConf, SIGNAL(clicked()), this, SLOT(ShowVidConf())); }
BOOL CALLBACK NetDetailsDialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) { BOOL fRetVal = FALSE; WPARAM wCmdId; switch (uMsg) { case WM_INITDIALOG: OnInitNetDetailsDialog(hwndDlg); SetFullScreen(hwndDlg); fRetVal = TRUE; break; case WM_CLOSE: DestroyWindow(hwndDlg); fRetVal = FALSE; break; case WM_DESTROY: PostQuitMessage(0); fRetVal = FALSE; break; case WM_COMMAND: wCmdId = LOWORD(wParam); switch (wCmdId) { case IDCANCEL: case IDOK: DestroyWindow(hwndDlg); break; default: break; } fRetVal = FALSE; break; default: fRetVal = FALSE; break; } return fRetVal; } // NetDetailsDialogProc
/* FUNCTION: MainWindow :: MessageReceived ARGUMENTS: message RETURN: n/a DESCRIPTION: Called by BeOS */ void MainWindow :: MessageReceived(BMessage *message) { switch (message->what) { case MSG_FULLSCREEN: SetFullScreen(!IsFullScreen()); break; /* TODO - Due to a bug when creating a 2nd BGLView in Haiku, I've decided to spawn a new window instead of creating a new BGLView (and using AddChild(new_view) / RemoveChild(old_view). Under Zeta, there is no problem replacing the current view with a new view. */ case MSG_SHAPE_BOOK: new MainWindow(BRect(50, 50, 400+50, 300+50), BOOK); break; case MSG_SHAPE_CUBE: new MainWindow(BRect(50, 50, 400+50, 300+50), CUBE); break; case MSG_SHAPE_SPHERE: new MainWindow(BRect(50, 50, 400+50, 300+50), SPHERE); break; case MSG_OPTION_WIREFRAME: fOptionWireframe = !fOptionWireframe; fCurrentView->ToggleWireframe(fOptionWireframe); break; case 'DATA': // user drag/dropped file from Tracker { BPoint point; message->FindPoint("_drop_point_", &point); BRect frame = Frame(); point.x -= frame.left; point.y -= frame.top; entry_ref aRef; message->FindRef("refs", &aRef); fCurrentView->DragDrop(&aRef, point.x, point.y); break; } default: BDirectWindow::MessageReceived(message); break; } }
LRESULT CALLBACK WndProc(HWND hWnd, UINT iMsg, WPARAM wParam, LPARAM lParam) { static HBITMAP hBit; PAINTSTRUCT ps; HGDIOBJ hOld; HDC hMemDC; RECT rt; switch (iMsg) { case WM_CREATE: hBit = LoadBitmap(GetModuleHandle(NULL), MAKEINTRESOURCE(101)); ShowCursor(FALSE); SetFullScreen(hWnd); return 0; case WM_PAINT: BeginPaint(hWnd, &ps); GetClientRect(hWnd, &rt); hMemDC = CreateCompatibleDC(ps.hdc); hOld = SelectObject(hMemDC, hBit); StretchBlt(ps.hdc, 0, 0, rt.right, rt.bottom, hMemDC, 0, 0, 640, 480, SRCCOPY); SelectObject(hMemDC, hOld); DeleteDC(hMemDC); EndPaint(hWnd, &ps); return 0; #ifdef TEST case WM_RBUTTONDOWN: DestroyWindow(hWnd); return 0; #endif case WM_SYSKEYDOWN: case WM_SYSKEYUP: case WM_SYSCOMMAND: return 0; case WM_ACTIVATE: if (LOWORD(wParam) == WA_INACTIVE) SetActiveWindow(hWnd); return 0; case WM_DESTROY: DeleteObject(hBit); PostQuitMessage(0); return 0; } return DefWindowProc(hWnd, iMsg, wParam, lParam); }
void VSCMainWindows::SetupConnections() { connect(m_pMainArea, SIGNAL(tabCloseRequested(int)), this, SLOT(MainCloseTab(int))); connect(m_pDeviceList, SIGNAL(SurveillanceClicked()), this, SLOT(AddSurveillance())); connect(m_pDeviceList, SIGNAL(CameraAddClicked()), this, SLOT(AddCamera())); connect(m_pDeviceList, SIGNAL(EmapClicked()), this, SLOT(AddEmap())); connect(m_pDeviceList, SIGNAL(DminingClicked()), this, SLOT(AddDmining())); connect(m_pDeviceList, SIGNAL(SearchClicked()), this, SLOT(Search())); connect(m_pDeviceList, SIGNAL(RecorderClicked()), this, SLOT(AddRecorder())); connect(m_pDeviceList, SIGNAL(CameraEditClicked(int)), this, SLOT(EditCamera(int))); connect(m_pDeviceList, SIGNAL(CameraDeleteClicked(int)), this, SLOT(DeleteCamera(int))); /* VIPC */ connect(m_pDeviceList, SIGNAL(VIPCAddClicked()), this, SLOT(AddVIPC())); connect(m_pDeviceList, SIGNAL(VIPCEditClicked(int)), this, SLOT(EditVIPC(int))); connect(m_pDeviceList, SIGNAL(VIPCDeleteClicked(int)), this, SLOT(DeleteVIPC(int))); /* Camera Group */ connect(m_pDeviceList, SIGNAL(VGroupAddClicked()), this, SLOT(AddVGroup())); connect(m_pDeviceList, SIGNAL(VGroupEditClicked(int)), this, SLOT(EditVGroup(int))); connect(m_pDeviceList, SIGNAL(VGroupDeleteClicked(int)), this, SLOT(DeleteVGroup(int))); connect(m_pDeviceList, SIGNAL(VGroupMapClicked()), this, SLOT(MapVGroup())); /* Disk edit */ connect(m_pDeviceList, SIGNAL(DiskEditClicked()), this, SLOT(EditDisk())); /* View */ connect(m_pDeviceList, SIGNAL(ViewDeleteClicked(int)), this, SLOT(DeleteView(int))); /* VMS */ connect(m_pDeviceList, SIGNAL(VMSDeleteClicked(int)), this, SLOT(DeleteVMS(int))); //connect(this, SIGNAL(CameraDeleted()), m_pDeviceList, SLOT(CameraTreeUpdated())); connect(m_pToolBar->ui.pbFullScreen, SIGNAL(clicked()), this, SLOT(SetFullScreen())); connect(m_pToolBar->ui.pbAbout, SIGNAL(clicked()), this, SLOT(about())); connect(m_pToolBar->ui.pbAlarm, SIGNAL(clicked()), this, SLOT(AddEvent())); connect(m_pToolBar->ui.pbSetting, SIGNAL(clicked()), this, SLOT(Setting())); connect(m_pToolBar->ui.pbUser, SIGNAL(clicked()), this, SLOT(UserStatus())); connect(m_pEventThread, SIGNAL(EventNotifyNoParam()), m_pToolBar, SLOT(NewAlarm())); }
// // FUNCIÓN: InitInstance(HINSTANCE, int) // PROPÓSITO: guardar el identificador de instancia y crear la ventana principal // COMENTARIOS: // En esta función, se guarda el identificador de instancia en una variable común y // se crea y muestra la ventana principal del programa. // BOOL CMSWindow::InitInstance() { RECT windowRect = {0, 0, Width, Height}; // Define Our Window Coordinates DWORD windowStyle = WS_OVERLAPPEDWINDOW; // Define Our Window Style DWORD windowExtendedStyle = WS_EX_APPWINDOW; // Define The Window's Extended Style // quick fullscreen mode if (quickFullScreen) { ShowCursor(TRUE); // Turn Off The Cursor windowStyle = WS_POPUP; // Set The WindowStyle To WS_POPUP (Popup Window) windowExtendedStyle |= WS_EX_TOPMOST; // Set The Extended Window Style To WS_EX_TOPMOST } // (Top Window Covering Everything Else) // fullscreen mode else if (FullScreen) // Fullscreen Requested, Try Changing Video Modes { SetFullScreen(); ShowCursor(TRUE); // Turn On The Cursor windowStyle = WS_POPUP; // Set The WindowStyle To WS_POPUP (Popup Window) windowExtendedStyle |= WS_EX_TOPMOST; // Set The Extended Window Style To WS_EX_TOPMOST } // Window mode else // If Fullscreen Was Not Selected AdjustWindowRectEx(&windowRect, windowStyle, 0, windowExtendedStyle);// Adjust Window, Account For Window Borders hWnd = CreateWindowEx(windowExtendedStyle, // Extended Style Name, // Class Name Title, // Window Title windowStyle, // Window Style LeftUpX, LeftUpY, // Window X,Y Position windowRect.right - windowRect.left, // Window Width windowRect.bottom - windowRect.top, // Window Height HWND_DESKTOP, // Desktop Is Window's Parent 0, // No Menu hInstance, // Pass The Window Instance NULL); if (!hWnd) { return FALSE; } return TRUE; }
void cWindow::WindowIncrease() { if (!mWindowMode) return; // Once we reach the max window size, go to full screen if (!CanChangeToMultiplier(mWindow_Multiplier + 1)) { SetFullScreen(); mWindowMode = false; return; } if (!mWindowMode) return; SetWindowSize(mWindow_Multiplier + 1); }
BOOL CALLBACK IPv6QuickCfgDialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) { BOOL fRetVal = FALSE; HRESULT hr = S_OK; switch (uMsg) { case WM_INITDIALOG: InitListView(hwndDlg); RefreshIPv6CfgDialog(hwndDlg); SetFullScreen(hwndDlg); SetTimer(hwndDlg, 1, IPQC_RFSH_TIMEOUT, NULL); fRetVal = TRUE; break; case WM_TIMER: RefreshIPv6CfgDialog(hwndDlg); fRetVal = FALSE; break; case WM_COMMAND: switch ( LOWORD(wParam) ) { case IDCANCEL: DestroyWindow(GetParent(hwndDlg)); break; default: break; } fRetVal = FALSE; break; case WM_DESTROY: bListViewInit = FALSE; break; default: fRetVal = FALSE; } return fRetVal; } // IPQuickCfgDialogProc
bool csGraphics2D::SetOption (int id, csVariant* value) { if (value->GetType () != config_options[id].type) return false; switch (id) { case 0: ChangeDepth (value->GetLong ()); break; case 1: SetFullScreen (value->GetBool ()); break; case 2: { const char* buf = value->GetString (); int wres, hres; if (sscanf (buf, "%dx%d", &wres, &hres) == 2) Resize (wres, hres); break; } default: return false; } return true; }
void CApp::MainThread(){ // シーンコントローラーにSceneFactoryを渡してやる CSceneControl sc(smart_ptr<CSceneFactory>(new Cf3SceneFactory(this),true)); int scene = FIRST_SCENE; // テストじゃないかな? { CLineParser l; l.SetLine(CAppInitializer::GetCmdLine()); if (l.IsMatch("TEST")) { scene = GAME_SCENE; CGameScene::m_bTest = true; l.GetStr(m_StageFileName); m_StageFileName += ".f3s"; l.GetNum(CGameScene::m_nStage); CGameScene::m_bVisibleHit = l.IsMatch("VISIBLEHIT"); }ef(l.IsMatch("REPLAY")) { scene = REPLAY_SCENE; l.GetStr(m_StageFileName); m_StageFileName += ".f3r"; }ef(l.IsMatch("RECORD")) { CReplayScene::record = true; m_Setting.m_FullScreen = false; scene = REPLAY_SCENE; l.GetStr(m_StageFileName); m_StageFileName += ".f3r"; } } sc.JumpScene(scene); // 準備完了まで著作権表示 m_Backup.CreateSurface(320, 240); SetFullScreen(m_Setting.m_FullScreen!=0); { CTextDIB32 tx; int w,h; tx.GetFont()->SetText("TokioSoft"); tx.GetFont()->SetSize(32); tx.GetFont()->SetColor(0xffffff); tx.GetFont()->SetBackColor(0x303030); tx.UpdateText(); tx.GetSize(w,h); GetDIB()->Blt(&tx,160-w/2,120-h/2); m_Draw.OnDraw(NULL,false); } // で、準備 CFPSTimer& t = *(m_FPS = new CFPSTimer); CFPSLayer l(&t); t.SetFPS((m_Setting.m_TimeMaster&&m_Setting.m_FPS)?m_Setting.m_FPS:40); m_BGM = new CBGMBase; m_BGMMode = BGMM_NONE; ChangeBGM((BGMMode)m_Setting.m_BGMMode); f3Input.Init(m_Setting.m_Key); Cf3Map::SetEffect(m_Setting.m_DrawMethod); Cf3MapObjectMain::SetInput(&KeyInput); ResourceManager.Init(); while (IsThreadValid()) { if (m_Setting.m_Background||GetForegroundWindow()==GetMyApp()->GetHWnd()) { if (m_Setting.m_Background>=2||GetForegroundWindow()==GetMyApp()->GetHWnd()) f3Input.Input(); if (f3Input.GetKeyPushed(F3KEY_EXIT)) break; // BGMの操作 if (m_AutoDraw) { if (f3Input.GetKeyPushed(F3KEY_BGMNONE)) ChangeBGM(BGMM_NONE); if (f3Input.GetKeyPushed(F3KEY_BGMDEF )) ChangeBGM(BGMM_DEFAULT); if (f3Input.GetKeyPushed(F3KEY_BGMUSER)) ChangeBGM(BGMM_USER); } m_BGM->Update(); // CPlaneBaseじゃなくてCDIB32を使って呼び出す(これでCDIB32の全ての機能が使える) if (sc.OnDraw(GetDIB())) break; if (m_AutoDraw) { l.Enable(f3Input.GetKeyPressed(F3KEY_FPS)); m_Draw.OnDraw(); if (f3Input.GetKeyPushed(F3KEY_CAPTURE)) ScreenCapture(); if (m_AVI) m_AVI->Write(GetDIB()); } } t.WaitFrame(); } ResourceManager.Quit(); }
void NativePlayerWnd::ProcessFSCommand( char* cmd, char* args ) { if ( StrEqual(cmd, "quit") ) { // Quit ExitApp(); } else if ( StrEqual(cmd, "fullscreen") ) { SetFullScreen( IsTrue(args) != 0 ); } else if ( StrEqual(cmd, "allowscale") ) { SetScaleMode( IsTrue(args) ); } else if ( StrEqual(cmd, "exec") ) { // make sure we don't pass any parameters // to the app we want to spawn. We don't want // anybody to do "del *.*" int len = strlen(args) + 1; char *tmpString = new char[len]; if ( tmpString == 0 ) return; for ( int i = 0; i < len; i++ ) { tmpString[i] = args[i]; if ( tmpString[i] == ' ' ) { tmpString[i] = 0; break; } } ExecSystem( tmpString ); delete [] tmpString; } else if ( StrEqual(cmd, "showmenu") ) { // Toggle the full screen flags /* showMenu = IsTrue(args); HMENU hMenu = GetMenu( hwnd ); if (!showMenu) { if (hMenu) { // Save and clear the menu bar savedMenu = hMenu; SetMenu( hwnd, 0); } } else { SetMenu( hwnd, savedMenu ); } */ } else { flash->command(cmd, args); } }
BOOL CALLBACK IPQuickCfgDialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) { BOOL fRetVal = FALSE; HRESULT hr = S_OK; WPARAM wCmdId; SystrayIcon *pSysIcon = NULL; TCHAR szRenew[STRING_BUFFER_MAX]; HWND hPropSheet; switch (uMsg) { case WM_INITDIALOG: SetFullScreen(hwndDlg); SetTimer(hwndDlg, 1, IPQC_RFSH_TIMEOUT, NULL); fRetVal = TRUE; break; case WM_TIMER: RefreshIPCfgDialog(hwndDlg, FALSE); fRetVal = FALSE; break; case WM_COMMAND: wCmdId = LOWORD(wParam); switch (wCmdId) { case IDC_WZCQCFG_DETAILS: // Get the systray icon struct DEBUGMSG(ZONE_MISC, (TEXT("NetUIQC - Details button event"))); WZCQCFG_LOCK; hr = GetDeviceSystrayIcon(GetParent(hwndDlg), &pSysIcon); if (SUCCEEDED(hr) && pSysIcon) { BOOL fPortrait = (GetSystemMetrics(SM_CXSCREEN) < GetSystemMetrics(SM_CYSCREEN))? TRUE:FALSE; HWND hDlg; hDlg = CreateDialog(v_hInst, MAKEINTRESOURCE(fPortrait?IDD_NETDETAILS_N:IDD_NETDETAILS_W), pSysIcon->hPropSheet, NetDetailsDialogProc); if(hDlg) { hPropSheet = pSysIcon->hPropSheet; EnableWindow(hPropSheet, FALSE); WZCQCFG_UNLOCK; WZCMiniMsgPump(hDlg); WZCQCFG_LOCK; // Since critical section was unlocked, we must check the window is still valid. if(IsWindow(hPropSheet)) EnableWindow(hPropSheet, TRUE); } } WZCQCFG_UNLOCK; break; case IDC_WZCQCFG_RENEW: // Renew button pushed DEBUGMSG(ZONE_MISC, (TEXT("NetUIQC - Renew button event"))); hr = RefreshIPCfgDialog(hwndDlg, TRUE); if (FAILED(hr)) { LoadString(v_hInst, IDS_QC_IPRENEWERR, szRenew, sizeof(szRenew)/sizeof(szRenew[0])); NetMsgBox(hwndDlg, NMB_FL_OK | NMB_FL_EXCLAIM, szRenew); } break; case IDCANCEL: DestroyWindow(GetParent(hwndDlg)); break; default: break; } fRetVal = 0; break; default: fRetVal = FALSE; } return fRetVal; } // IPQuickCfgDialogProc
bool CWinSystemEGL::CreateNewWindow(const CStdString& name, bool fullScreen, RESOLUTION_INFO& res, PHANDLE_EVENT_FUNC userFunction) { #if defined(EMPOWER) && defined(HAS_OPENKODE) KDboolean b; KDDisplayModeNV mode; KDint desktopSize[2] = { res.iWidth, res.iHeight }; #endif #ifdef _WIN32 EGL_BASE_CLASS::CreateNewWindow(name, fullScreen, res, userFunction); #endif m_nWidth = res.iWidth; m_nHeight = res.iHeight; m_bFullScreen = fullScreen; EGLBoolean eglStatus; EGLint configCount; EGLConfig* configList = NULL; #if defined(EMPOWER) && defined(HAS_OPENKODE) //CLog::Log(LOGDEBUG, "NV: GetDisplay"); m_kdDisplay = kdGetDisplayNV(KD_DEFAULT_DISPLAY_NV, KD_NULL); if (!m_kdDisplay) { CLog::Log(LOGERROR, "Could not obtain KDDisplayNV pointer"); return false; } b = KD_FALSE; //CLog::Log(LOGDEBUG, "NV: SetDisplayProperty"); kdSetDisplayPropertybvNV(m_kdDisplay, KD_DISPLAYPROPERTY_ENABLED_NV, &b); kdReleaseDisplayNV(m_kdDisplay); // MZL: enable HDMI display //CLog::Log(LOGDEBUG, "NV: SetDisplayPropertybyNV"); kdSetDisplayPropertybvNV(m_kdDisplay, KD_DISPLAYPROPERTY_ENABLED_NV, &b); m_kdDisplay = kdGetDisplayNV("Tegra:HDMI0", KD_NULL); if (!m_kdDisplay) { CLog::Log(LOGERROR, "Could not obtain KDDisplayNV pointer"); return false; } b = KD_TRUE; kdSetDisplayPropertybvNV(m_kdDisplay, KD_DISPLAYPROPERTY_ENABLED_NV, &b); kdSetDisplayPropertycvNV(m_kdDisplay, KD_DISPLAYPROPERTY_DESKTOP_NAME_NV, KD_DEFAULT_DESKTOP_NV); mode.width = res.iWidth; mode.height = res.iHeight; mode.refresh = 60; //CLog::Log(LOGDEBUG, "NV: SetDisplayPropertyNV"); if (kdSetDisplayModeNV(m_kdDisplay, &mode, KD_DISPLAY_PROTOCOL_AUTOMATIC_NV)) { CLog::Log(LOGERROR, "Could not set display mode\n"); return false; } //CLog::Log(LOGDEBUG, "NV: GetDesktopNV"); m_kdDesktop = kdGetDesktopNV(KD_DEFAULT_DESKTOP_NV, KD_NULL); if (!m_kdDesktop) { CLog::Log(LOGERROR, "Could not obtain KDDesktopNV pointer"); return false; } //CLog::Log(LOGDEBUG, "NV: SetDesktopivNV"); if (kdSetDesktopPropertyivNV(m_kdDesktop, KD_DESKTOPPROPERTY_SIZE_NV, desktopSize)) { CLog::Log(LOGERROR, "Could not set desktop size"); return false; } #endif #ifdef HAS_X11 m_x11Display = XOpenDisplay(NULL); if (!m_x11Display) { CLog::Log(LOGERROR, "Could not open X11"); return false; } XSetErrorHandler(ApplicationErrorHandler) ; #endif //CLog::Log(LOGDEBUG, "eglGetDisplay"); #if defined(HAS_OPENKODE) || defined(HAS_GDL) m_display = eglGetDisplay(EGL_DEFAULT_DISPLAY); #elif defined(_WIN32) m_display = eglGetDisplay(m_hDC); #elif defined(HAS_X11) m_display = eglGetDisplay((EGLNativeDisplayType) m_x11Display); #endif if (m_display == EGL_NO_DISPLAY) { CLog::Log(LOGERROR, "EGL failed to obtain display"); return false; } //CLog::Log(LOGDEBUG, "eglInitialize"); if (!eglInitialize(m_display, 0, 0)) { CLog::Log(LOGERROR, "EGL failed to initialize"); return false; } EGLint configAttrs[] = { EGL_RED_SIZE, 8, EGL_GREEN_SIZE, 8, EGL_BLUE_SIZE, 8, EGL_DEPTH_SIZE, 16, EGL_STENCIL_SIZE, 8, EGL_SAMPLE_BUFFERS, 0, EGL_SAMPLES, 0, EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT, EGL_NONE }; // Find out how many configurations suit our needs //CLog::Log(LOGDEBUG, "eglChooseConfig"); eglStatus = eglChooseConfig(m_display, configAttrs, NULL, 0, &configCount); if (!eglStatus || !configCount) { CLog::Log(LOGERROR, "EGL failed to return any matching configurations"); return false; } // Allocate room for the list of matching configurations configList = (EGLConfig*)malloc(configCount * sizeof(EGLConfig)); if (!configList) { CLog::Log(LOGERROR, "kdMalloc failure obtaining configuration list"); return false; } // Obtain the configuration list from EGL eglStatus = eglChooseConfig(m_display, configAttrs, configList, configCount, &configCount); if (!eglStatus || !configCount) { CLog::Log(LOGERROR, "EGL failed to populate configuration list"); return false; } // Select an EGL configuration that matches the native window m_config = configList[0]; EGLint* attribList = NULL; #ifdef EMPOWER EGLint windowAttrs[3]; int windowIndex = 0; windowAttrs[windowIndex++] = EGL_RENDER_BUFFER; windowAttrs[windowIndex++] = EGL_BACK_BUFFER; windowAttrs[windowIndex++] = EGL_NONE; attribList = windowAttrs; #endif #ifdef HAS_OPENKODE //CLog::Log(LOGDEBUG, "KD: kdCreateWindow"); m_kdWindow = kdCreateWindow(m_display, m_config, KD_NULL); if (!m_kdWindow) { CLog::Log(LOGERROR, "Error creating native window"); return false; } //CLog::Log(LOGDEBUG, "KD: kdRealizeWindow"); if (kdRealizeWindow(m_kdWindow, &m_nativeWindow)) { CLog::Log(LOGERROR, "Could not realize native window"); return false; } #elif defined HAS_X11 int screen = DefaultScreen(m_x11Display); XSetWindowAttributes windowAttributes; windowAttributes.colormap = DefaultColormap(m_x11Display, screen); windowAttributes.border_pixel = 0; windowAttributes.event_mask = ExposureMask | VisibilityChangeMask | KeyPressMask | KeyReleaseMask | ButtonPressMask | ButtonReleaseMask | PointerMotionMask | StructureNotifyMask | SubstructureNotifyMask | FocusChangeMask; m_nativeWindow = (NativeWindowType) XCreateWindow( m_x11Display, RootWindow(m_x11Display, screen), 0, 0, // x/y position of top-left outside corner of the window res.iWidth, res.iHeight, // Width and height of window 0, // Border width DefaultDepth(m_x11Display, screen), InputOutput, DefaultVisual(m_x11Display, screen), CWBorderPixel | CWColormap | CWEventMask, &windowAttributes ); XSetStandardProperties(m_x11Display, (Window) m_nativeWindow, name, name, None, NULL, 0, NULL); Atom wmDeleteMessage = XInternAtom(m_x11Display, "WM_DELETE_WINDOW", False); XSetWMProtocols(m_x11Display, (Window) m_nativeWindow, &wmDeleteMessage, 1); if (fullScreen && !SetFullScreen(fullScreen, res, false)) { return false; } XMapRaised(m_x11Display, (Window) m_nativeWindow); #endif #ifdef _WIN32 m_nativeWindow = m_hWnd; DEVMODE dm; ZeroMemory(&dm, sizeof(dm)); dm.dmSize = sizeof(dm); EnumDisplaySettingsEx(NULL, ENUM_CURRENT_SETTINGS, &dm, 0); m_nLeft = (dm.dmPelsWidth / 2) - (m_nWidth / 2); m_nTop = (dm.dmPelsHeight / 2) - (m_nHeight / 2); RECT rc; rc.left = m_nLeft; rc.top = m_nTop; rc.right = rc.left + m_nWidth; rc.bottom = rc.top + m_nHeight; AdjustWindowRect( &rc, WS_OVERLAPPEDWINDOW, false ); SetWindowPos(m_hWnd, 0, rc.left, rc.top, 0, 0, SWP_NOSIZE); #endif #if defined(HAS_GDL) m_nativeWindow = (NativeWindowType)GDL_GRAPHICS_PLANE; #endif m_surface = eglCreateWindowSurface(m_display, m_config, m_nativeWindow, attribList); if (!m_surface) { CLog::Log(LOGERROR, "EGL couldn't create window"); return false; } #ifdef CANMORE eglStatus = eglBindAPI(EGL_OPENGL_ES_API); if (!eglStatus) { CLog::Log(LOGERROR, "EGL failed to bind API"); return false; } #endif EGLint contextAttrs[] = { EGL_CONTEXT_CLIENT_VERSION, 2, EGL_NONE }; // Create an EGL context //CLog::Log(LOGDEBUG, "eglCreateContext"); m_context = eglCreateContext(m_display, m_config, NULL, contextAttrs); if (!m_context) { CLog::Log(LOGERROR, "EGL couldn't create context"); return false; } // Make the context and surface current for rendering eglStatus = eglMakeCurrent(m_display, m_surface, m_surface, m_context); if (!eglStatus) { CLog::Log(LOGERROR, "EGL couldn't make context/surface current"); return false; } free(configList); eglSwapInterval(m_display, 0); m_bWindowCreated = true; CLog::Log(LOGINFO, "Window creation complete"); return true; }
/***************************************************************************** * VideoWindow::ToggleFullScreen *****************************************************************************/ void VideoWindow::ToggleFullScreen() { SetFullScreen(!IsFullScreen()); }
LRESULT CMiniPieFrame::OnFullScreen(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/) { SetFullScreen(!m_bFullScreen ); return TRUE; }
VSCMainWindows::VSCMainWindows(ClientFactory &pFactory, QWidget *parent) : m_pFactory(pFactory), QMainWindow(parent), m_VidIdx(VSC_VID_IDX_LAST), m_pMainView(NULL), m_pDashBoard(NULL), m_pEventConsole(NULL) { ui.setupUi(this); #ifdef WIN32 setStyleSheet(QString::fromUtf8("font: 10pt \"\345\276\256\350\275\257\351\233\205\351\273\221\";")); #endif m_pToolBar = new VSCToolBar(this); SetupToolBar(); VSCLoading *loading = new VSCLoading(NULL); loading->show(); QDesktopWidget *desktop = QApplication::desktop(); QRect rect = desktop->screenGeometry(0); loading->setGeometry(rect.width()/2, rect.height()/2, 64, 64); QCoreApplication::processEvents(); //QDockWidget *m_pDockDevicelist = new QDockWidget(tr("Devices"), this); m_pDockDevicelist = new QDockWidget(this); m_pDockDevicelist->setFeatures(QDockWidget::DockWidgetMovable); m_pDockDevicelist->setAllowedAreas(Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea); //m_pDockDevicelist->setAllowedAreas(Qt::LeftDockWidgetArea); m_pDockDevicelist->setTitleBarWidget(new QWidget(this)); m_pVidList = new VSCVidList(m_pDockDevicelist); m_pDockDevicelist->setWidget(m_pVidList); addDockWidget(Qt::LeftDockWidgetArea, m_pDockDevicelist); //addDockWidget(Qt::RightDockWidgetArea, m_pDockDevicelist); m_pMainArea = new QTabWidget(this); m_pMainArea->setTabsClosable(true); m_pMainArea->setMovable(true); setCentralWidget(m_pMainArea); connect(m_pMainArea, SIGNAL(tabCloseRequested(int)), this, SLOT(MainCloseTab(int))); /* Show the Live default */ m_pVidLive = new VSCVidLive(m_pFactory, *m_pMainArea, this); m_pMainView = m_pVidLive->GetMainView(); m_pVidConf = new VSCVidConf(m_pFactory, *m_pMainArea, this); m_pVidPb = new VSCVidSearchPB(m_pFactory, *m_pMainArea, this); /* First hide all */ m_pToolBar->ui.pbVidEventSearch->hide(); m_pToolBar->ui.pbVidMotionSearch->hide(); m_pVidLive->VidHide(); m_pVidConf->VidHide(); m_pVidPb->VidHide(); ShowVidLive(); delete loading; setWindowTitle(QApplication::translate("VSCMainWindowsClass", VE_INFO, 0)); connect(m_pToolBar->ui.pbFullScreen, SIGNAL(clicked()), this, SLOT(SetFullScreen())); //connect(m_pToolBar->ui.pbAbout, SIGNAL(clicked()), this, SLOT(ShowAbout())); connect(m_pToolBar->ui.pbAbout, SIGNAL(clicked()), this, SLOT(about())); connect(m_pToolBar->ui.pbUser, SIGNAL(clicked()), this, SLOT(UserStatus())); connect(m_pToolBar->ui.pbVidLive, SIGNAL(clicked()), this, SLOT(ShowVidLive())); connect(m_pToolBar->ui.pbVidLiveView, SIGNAL(clicked()), m_pVidLive, SLOT(SlotNewLiveView())); connect(m_pToolBar->ui.pbVidPb, SIGNAL(clicked()), m_pVidLive, SLOT(SlotNewLivePB())); connect(m_pToolBar->ui.pbVidSearch, SIGNAL(clicked()), this, SLOT(ShowVidPb())); connect(m_pToolBar->ui.pbVidEventSearch, SIGNAL(clicked()), m_pVidPb, SLOT(SlotNewEventSearch())); connect(m_pToolBar->ui.pbVidMotionSearch, SIGNAL(clicked()), m_pVidPb, SLOT(SlotNewMotionSearch())); connect(m_pToolBar->ui.pbVidPb, SIGNAL(clicked()), m_pVidLive, SLOT(SlotNewLivePB())); connect(m_pToolBar->ui.pbVidConf, SIGNAL(clicked()), this, SLOT(ShowVidConf())); connect(m_pToolBar->ui.pbVidDashBoard, SIGNAL(clicked()), this, SLOT(ShowDashBoard())); connect(m_pToolBar->ui.pbAlarm, SIGNAL(clicked()), this, SLOT(ShowEventConsole())); connect(&(m_pFactory.GetStorFactory()), SIGNAL(SignalEvent1()), m_pToolBar, SLOT(NewAlarm())); m_pEventConsole = new VSCEventConsole(m_pFactory, this); m_pEventConsole->hide(); }
//------------------------------------- // Switches the window to fullscreen and back // rv - bool, true if in fullscreen bool CRendererOpenGL::SwitchFullScreen() { SetFullScreen( !m_bFullScreen ); return m_bFullScreen; }