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.,
|
|
|
|
// 59 Temple Place, Suite 330, Boston, MA 02111-1307 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-02-01 00:54:06 +00:00
|
|
|
#include "LogBOINC.h"
|
2004-04-11 04:12:44 +00:00
|
|
|
#include "MainFrame.h"
|
2005-04-15 09:04:15 +00:00
|
|
|
|
|
|
|
#include "BOINCTaskBar.h" // Must be included before MainDocument.h
|
2005-03-25 12:23:30 +00:00
|
|
|
#ifdef __APPLE__
|
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
|
|
|
|
2005-04-15 09:04:15 +00:00
|
|
|
#include "MainDocument.h"
|
|
|
|
|
|
|
|
|
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:
|
2004-04-11 04:37:10 +00:00
|
|
|
int OnExit();
|
2004-04-10 09:11:03 +00:00
|
|
|
|
|
|
|
void OnInitCmdLine(wxCmdLineParser &parser);
|
|
|
|
bool OnCmdLineParsed(wxCmdLineParser &parser);
|
|
|
|
|
2005-02-15 06:32:43 +00:00
|
|
|
void DetectDisplayInfo();
|
2004-11-17 09:27:06 +00:00
|
|
|
|
2005-02-07 04:47:18 +00:00
|
|
|
void InitSupportedLanguages();
|
|
|
|
|
2004-11-23 07:45:11 +00:00
|
|
|
bool IsBOINCCoreRunning();
|
|
|
|
void StartupBOINCCore();
|
|
|
|
void ShutdownBOINCCore();
|
2005-05-06 09:24:30 +00:00
|
|
|
#ifdef __APPLE__
|
|
|
|
bool ProcessExists(pid_t thePID);
|
|
|
|
#endif
|
2004-11-23 07:45:11 +00:00
|
|
|
|
2005-06-24 10:49:42 +00:00
|
|
|
int StartupSystemIdleDetection();
|
|
|
|
int ShutdownSystemIdleDetection();
|
2004-12-14 02:50:16 +00:00
|
|
|
|
2004-05-21 06:27:15 +00:00
|
|
|
wxConfig* m_pConfig;
|
2005-02-01 00:54:06 +00:00
|
|
|
wxLocale* m_pLocale;
|
|
|
|
wxLogBOINC* m_pLog;
|
2004-05-21 06:27:15 +00:00
|
|
|
|
2004-04-10 09:11:03 +00:00
|
|
|
CMainFrame* m_pFrame;
|
|
|
|
CMainDocument* m_pDocument;
|
2004-10-23 07:13:18 +00:00
|
|
|
CTaskBarIcon* m_pTaskBarIcon;
|
2005-03-25 12:23:30 +00:00
|
|
|
#ifdef __APPLE__
|
|
|
|
CMacSystemMenu* m_pMacSystemMenu;
|
2004-10-25 21:42:47 +00:00
|
|
|
#endif
|
2004-04-10 09:11:03 +00:00
|
|
|
|
2004-11-23 07:45:11 +00:00
|
|
|
bool m_bBOINCStartedByManager;
|
2004-11-19 08:11:49 +00:00
|
|
|
bool m_bFrameVisible;
|
|
|
|
|
2005-06-24 10:49:42 +00:00
|
|
|
int m_lBOINCCoreProcessId;
|
2004-11-23 07:45:11 +00:00
|
|
|
|
2004-12-14 02:50:16 +00:00
|
|
|
#ifdef __WXMSW__
|
2005-01-06 22:25:53 +00:00
|
|
|
HANDLE m_hBOINCCoreProcess;
|
2005-01-07 07:32:23 +00:00
|
|
|
HINSTANCE m_hIdleDetectionDll;
|
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
|
2005-06-28 15:55:59 +00:00
|
|
|
wxArrayString m_astrLanguages;
|
2005-02-07 04:47:18 +00:00
|
|
|
|
2004-04-10 09:11:03 +00:00
|
|
|
public:
|
|
|
|
|
2005-02-17 19:53:41 +00:00
|
|
|
std::string m_strDefaultWindowStation;
|
|
|
|
std::string m_strDefaultDesktop;
|
|
|
|
std::string m_strDefaultDisplay;
|
2005-02-15 06:32:43 +00:00
|
|
|
|
2004-04-10 09:11:03 +00:00
|
|
|
bool OnInit();
|
|
|
|
|
2005-04-10 19:01:23 +00:00
|
|
|
int UpdateSystemIdleDetection();
|
2005-01-07 07:32:23 +00:00
|
|
|
|
2005-04-10 19:01:23 +00:00
|
|
|
CMainFrame* GetFrame() { return m_pFrame; }
|
|
|
|
CMainDocument* GetDocument() { return m_pDocument; }
|
|
|
|
CTaskBarIcon* GetTaskBarIcon() { return m_pTaskBarIcon; }
|
2005-03-25 12:23:30 +00:00
|
|
|
#ifdef __APPLE__
|
2005-04-10 19:01:23 +00:00
|
|
|
CMacSystemMenu* GetMacSystemMenu() { return m_pMacSystemMenu; }
|
2004-10-25 21:42:47 +00:00
|
|
|
#endif
|
2004-10-23 07:13:18 +00:00
|
|
|
|
2005-06-28 15:55:59 +00:00
|
|
|
wxArrayString& GetSupportedLanguages() { return m_astrLanguages; }
|
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
|
|
|
|
|