2005-01-20 23:22:22 +00:00
|
|
|
// Berkeley Open Infrastructure for Network Computing
|
|
|
|
// http://boinc.berkeley.edu
|
|
|
|
// Copyright (C) 2005 University of California
|
2004-05-17 22:15:10 +00:00
|
|
|
//
|
2005-01-20 23:22:22 +00:00
|
|
|
// This is free software; you can redistribute it and/or
|
|
|
|
// modify it under the terms of the GNU Lesser General Public
|
|
|
|
// License as published by the Free Software Foundation;
|
|
|
|
// either version 2.1 of the License, or (at your option) any later version.
|
2004-04-10 09:11:03 +00:00
|
|
|
//
|
2005-01-20 23:22:22 +00:00
|
|
|
// This software is distributed in the hope that it will be useful,
|
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
|
|
// See the GNU Lesser General Public License for more details.
|
2004-05-17 22:15:10 +00:00
|
|
|
//
|
2005-01-20 23:22:22 +00:00
|
|
|
// To view the GNU Lesser General Public License visit
|
|
|
|
// http://www.gnu.org/copyleft/lesser.html
|
|
|
|
// or write to the Free Software Foundation, Inc.,
|
2007-10-09 11:35:47 +00:00
|
|
|
// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
2004-04-10 09:11:03 +00:00
|
|
|
|
2004-04-11 04:37:10 +00:00
|
|
|
#ifndef _BOINCGUIAPP_H_
|
|
|
|
#define _BOINCGUIAPP_H_
|
|
|
|
|
|
|
|
#if defined(__GNUG__) && !defined(__APPLE__)
|
|
|
|
#pragma interface "BOINCGUIApp.cpp"
|
|
|
|
#endif
|
|
|
|
|
2005-10-01 08:56:37 +00:00
|
|
|
#ifdef __WXMAC__
|
2005-08-13 22:17:35 +00:00
|
|
|
#include "mac/MacSysMenu.h" // Must be included before MainDocument.h
|
2005-03-25 12:23:30 +00:00
|
|
|
#endif
|
2004-04-10 09:11:03 +00:00
|
|
|
|
2006-06-23 08:20:08 +00:00
|
|
|
#define BOINC_ADVANCEDGUI 1
|
|
|
|
#define BOINC_SIMPLEGUI 2
|
|
|
|
|
2005-12-28 12:33:18 +00:00
|
|
|
|
2006-10-20 15:00:14 +00:00
|
|
|
class wxLogBOINC;
|
|
|
|
class CBOINCBaseFrame;
|
|
|
|
class CMainDocument;
|
|
|
|
class CTaskBarIcon;
|
|
|
|
class CSkinManager;
|
2005-12-28 12:33:18 +00:00
|
|
|
|
|
|
|
|
2005-04-10 19:01:23 +00:00
|
|
|
class CBOINCGUIApp : public wxApp {
|
2004-04-10 09:11:03 +00:00
|
|
|
DECLARE_DYNAMIC_CLASS(CBOINCGUIApp)
|
|
|
|
|
|
|
|
protected:
|
2006-06-23 08:20:08 +00:00
|
|
|
int OnExit();
|
2004-04-10 09:11:03 +00:00
|
|
|
|
2006-06-23 08:20:08 +00:00
|
|
|
void OnInitCmdLine(wxCmdLineParser &parser);
|
|
|
|
bool OnCmdLineParsed(wxCmdLineParser &parser);
|
2004-04-10 09:11:03 +00:00
|
|
|
|
2006-06-23 08:20:08 +00:00
|
|
|
void DetectDisplayInfo();
|
2004-11-17 09:27:06 +00:00
|
|
|
|
2006-06-23 08:20:08 +00:00
|
|
|
void InitSupportedLanguages();
|
2005-02-07 04:47:18 +00:00
|
|
|
|
2005-10-01 08:56:37 +00:00
|
|
|
#ifdef __WXMAC__
|
2006-11-22 09:51:59 +00:00
|
|
|
static OSErr QuitAppleEventHandler( const AppleEvent *appleEvt, AppleEvent* reply, UInt32 refcon );
|
2005-05-06 09:24:30 +00:00
|
|
|
#endif
|
2004-11-23 07:45:11 +00:00
|
|
|
|
2006-06-23 08:20:08 +00:00
|
|
|
int ClientLibraryStartup();
|
|
|
|
int ClientLibraryShutdown();
|
2004-12-14 02:50:16 +00:00
|
|
|
|
2006-06-23 08:20:08 +00:00
|
|
|
wxConfig* m_pConfig;
|
|
|
|
wxLocale* m_pLocale;
|
|
|
|
wxLogBOINC* m_pLog;
|
2004-05-21 06:27:15 +00:00
|
|
|
|
2006-10-20 15:00:14 +00:00
|
|
|
CSkinManager* m_pSkinManager;
|
2006-06-23 08:20:08 +00:00
|
|
|
CBOINCBaseFrame* m_pFrame;
|
|
|
|
CMainDocument* m_pDocument;
|
|
|
|
CTaskBarIcon* m_pTaskBarIcon;
|
2005-10-01 08:56:37 +00:00
|
|
|
#ifdef __WXMAC__
|
2006-06-23 08:20:08 +00:00
|
|
|
CMacSystemMenu* m_pMacSystemMenu;
|
2004-10-25 21:42:47 +00:00
|
|
|
#endif
|
2004-04-10 09:11:03 +00:00
|
|
|
|
2007-05-07 20:50:08 +00:00
|
|
|
wxString m_strBOINCMGRRootDirectory;
|
2007-11-30 18:52:41 +00:00
|
|
|
wxString m_strBOINCMGRDataDirectory;
|
2007-01-19 23:45:19 +00:00
|
|
|
wxString m_strBOINCArguments;
|
|
|
|
|
2006-11-03 15:18:19 +00:00
|
|
|
int m_iDisplayExitWarning;
|
2006-06-23 08:20:08 +00:00
|
|
|
|
|
|
|
bool m_bGUIVisible;
|
|
|
|
int m_iGUISelected;
|
2004-11-19 08:11:49 +00:00
|
|
|
|
2004-12-14 02:50:16 +00:00
|
|
|
#ifdef __WXMSW__
|
2006-06-23 08:20:08 +00:00
|
|
|
HINSTANCE m_hClientLibraryDll;
|
2004-12-14 02:50:16 +00:00
|
|
|
#endif
|
|
|
|
|
2005-02-07 04:47:18 +00:00
|
|
|
// The last value defined in the wxLanguage enum is wxLANGUAGE_USER_DEFINED.
|
|
|
|
// defined in: wx/intl.h
|
2006-06-23 08:20:08 +00:00
|
|
|
wxArrayString m_astrLanguages;
|
2005-02-07 04:47:18 +00:00
|
|
|
|
2004-04-10 09:11:03 +00:00
|
|
|
public:
|
|
|
|
|
2006-06-23 08:20:08 +00:00
|
|
|
wxString m_strDefaultWindowStation;
|
|
|
|
wxString m_strDefaultDesktop;
|
|
|
|
wxString m_strDefaultDisplay;
|
2005-02-15 06:32:43 +00:00
|
|
|
|
2006-06-23 08:20:08 +00:00
|
|
|
bool OnInit();
|
2004-04-10 09:11:03 +00:00
|
|
|
|
2006-06-23 08:20:08 +00:00
|
|
|
int UpdateSystemIdleDetection();
|
2005-01-07 07:32:23 +00:00
|
|
|
|
2006-06-23 08:20:08 +00:00
|
|
|
int StartBOINCScreensaverTest();
|
2006-05-02 09:31:04 +00:00
|
|
|
|
2006-10-25 14:09:47 +00:00
|
|
|
wxLocale* GetLocale() { return m_pLocale; }
|
2006-10-20 15:00:14 +00:00
|
|
|
CSkinManager* GetSkinManager() { return m_pSkinManager; }
|
2006-06-23 08:20:08 +00:00
|
|
|
CBOINCBaseFrame* GetFrame() { return m_pFrame; }
|
|
|
|
CMainDocument* GetDocument() { return m_pDocument; }
|
2008-01-30 06:09:34 +00:00
|
|
|
wxString GetArguments() { return m_strBOINCArguments; }
|
2007-11-30 18:52:41 +00:00
|
|
|
wxString GetRootDirectory() { return m_strBOINCMGRRootDirectory; }
|
|
|
|
wxString GetDataDirectory() { return m_strBOINCMGRDataDirectory; }
|
2006-08-12 00:31:55 +00:00
|
|
|
#if defined(__WXMSW__) || defined(__WXMAC__)
|
2006-06-23 08:20:08 +00:00
|
|
|
CTaskBarIcon* GetTaskBarIcon() { return m_pTaskBarIcon; }
|
2006-08-12 00:31:55 +00:00
|
|
|
#endif
|
2005-10-01 08:56:37 +00:00
|
|
|
#ifdef __WXMAC__
|
2006-06-23 08:20:08 +00:00
|
|
|
CMacSystemMenu* GetMacSystemMenu() { return m_pMacSystemMenu; }
|
2006-10-30 04:07:41 +00:00
|
|
|
int GetCurrentGUISelection() { return m_iGUISelected; }
|
2004-10-25 21:42:47 +00:00
|
|
|
#endif
|
2004-10-23 07:13:18 +00:00
|
|
|
|
2006-06-23 08:20:08 +00:00
|
|
|
wxArrayString& GetSupportedLanguages() { return m_astrLanguages; }
|
|
|
|
|
2006-11-03 15:18:19 +00:00
|
|
|
int GetDisplayExitWarning() { return m_iDisplayExitWarning; }
|
|
|
|
void SetDisplayExitWarning(int display) { m_iDisplayExitWarning = display; }
|
|
|
|
|
2006-10-30 03:41:32 +00:00
|
|
|
void FireReloadSkin();
|
|
|
|
|
2006-06-23 08:20:08 +00:00
|
|
|
bool SetActiveGUI(int iGUISelection, bool bShowWindow = true);
|
2006-11-03 15:18:19 +00:00
|
|
|
|
|
|
|
int ConfirmExit();
|
2004-04-10 09:11:03 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
DECLARE_APP(CBOINCGUIApp)
|
2004-04-11 04:37:10 +00:00
|
|
|
|
|
|
|
|
2004-04-11 05:09:18 +00:00
|
|
|
#endif
|
|
|
|
|