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-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
|
|
|
|
2005-04-15 09:04:15 +00:00
|
|
|
#include "MainDocument.h"
|
|
|
|
|
|
|
|
|
2005-12-28 12:33:18 +00:00
|
|
|
class CBrandingScheme : public wxObject {
|
|
|
|
private:
|
|
|
|
bool m_bIsBranded;
|
|
|
|
wxString m_strApplicationName;
|
|
|
|
wxIcon m_iconApplicationIcon;
|
|
|
|
wxBitmap m_bitmapApplicationLogo;
|
|
|
|
wxString m_strCompanyName;
|
|
|
|
wxString m_strCompanyWebsite;
|
|
|
|
wxString m_strProjectName;
|
2006-01-19 12:22:22 +00:00
|
|
|
bool m_bDefaultTabSpecified;
|
|
|
|
int m_iDefaultTab;
|
2006-01-15 12:10:42 +00:00
|
|
|
wxString m_strAPWizardTitle;
|
2006-01-04 13:14:14 +00:00
|
|
|
wxBitmap m_bitmapAPWizardLogo;
|
2006-01-15 12:10:42 +00:00
|
|
|
wxString m_strAPWizardAccountInfoText;
|
|
|
|
wxString m_strAPWizardCompletionTitle;
|
2006-01-19 12:22:22 +00:00
|
|
|
wxString m_strAPWizardCompletionBrandedMessage;
|
2006-01-15 12:10:42 +00:00
|
|
|
wxString m_strAPWizardCompletionMessage;
|
|
|
|
wxString m_strAMWizardTitle;
|
2006-01-04 13:14:14 +00:00
|
|
|
wxBitmap m_bitmapAMWizardLogo;
|
2006-02-01 12:18:10 +00:00
|
|
|
wxString m_strAMWizardAccountInfoText;
|
2006-01-06 10:50:59 +00:00
|
|
|
wxString m_strAMWizardAttachMessage;
|
2006-01-23 11:30:25 +00:00
|
|
|
wxString m_strExitMessage;
|
2005-12-28 12:33:18 +00:00
|
|
|
|
|
|
|
public:
|
|
|
|
bool IsBranded() { return m_bIsBranded; }
|
|
|
|
wxString GetApplicationName() { return m_strApplicationName; }
|
|
|
|
wxIcon* GetApplicationIcon() { return &m_iconApplicationIcon; }
|
|
|
|
wxBitmap* GetApplicationLogo() { return &m_bitmapApplicationLogo; }
|
|
|
|
wxString GetCompanyName() { return m_strCompanyName; }
|
|
|
|
wxString GetCompanyWebsite() { return m_strCompanyWebsite; }
|
|
|
|
wxString GetProjectName() { return m_strProjectName; }
|
2006-01-19 12:22:22 +00:00
|
|
|
bool IsDefaultTabSpecified() { return m_bDefaultTabSpecified; }
|
|
|
|
int GetDefaultTab() { return m_iDefaultTab; }
|
2006-01-15 12:10:42 +00:00
|
|
|
wxString GetAPWizardTitle() { return m_strAPWizardTitle; }
|
2006-01-04 13:14:14 +00:00
|
|
|
wxBitmap* GetAPWizardLogo() { return &m_bitmapAPWizardLogo; }
|
2006-01-15 12:10:42 +00:00
|
|
|
wxString GetAPWizardAccountInfoText() { return m_strAPWizardAccountInfoText; }
|
|
|
|
wxString GetAPWizardCompletionTitle() { return m_strAPWizardCompletionTitle; }
|
2006-01-19 12:22:22 +00:00
|
|
|
wxString GetAPWizardCompletionBrandedMessage() { return m_strAPWizardCompletionBrandedMessage; }
|
2006-01-15 12:10:42 +00:00
|
|
|
wxString GetAPWizardCompletionMessage() { return m_strAPWizardCompletionMessage; }
|
|
|
|
wxString GetAMWizardTitle() { return m_strAMWizardTitle; }
|
2006-01-04 13:14:14 +00:00
|
|
|
wxBitmap* GetAMWizardLogo() { return &m_bitmapAMWizardLogo; }
|
2006-02-01 12:18:10 +00:00
|
|
|
wxString GetAMWizardAccountInfoText() { return m_strAMWizardAccountInfoText; }
|
2006-01-06 10:50:59 +00:00
|
|
|
wxString GetAMWizardSuccessMessage() { return m_strAMWizardAttachMessage; }
|
2006-01-23 11:30:25 +00:00
|
|
|
wxString GetExitMessage() { return m_strExitMessage; }
|
2005-12-28 12:33:18 +00:00
|
|
|
|
|
|
|
bool OnInit( wxConfigBase* pConfig );
|
|
|
|
};
|
|
|
|
|
|
|
|
|
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-10-01 08:56:37 +00:00
|
|
|
#ifdef __WXMAC__
|
2005-05-06 09:24:30 +00:00
|
|
|
bool ProcessExists(pid_t thePID);
|
|
|
|
#endif
|
2004-11-23 07:45:11 +00:00
|
|
|
|
2006-01-23 08:47:05 +00:00
|
|
|
int ClientLibraryStartup();
|
|
|
|
int ClientLibraryShutdown();
|
2004-12-14 02:50:16 +00:00
|
|
|
|
2005-12-28 12:33:18 +00:00
|
|
|
wxConfig* m_pConfig;
|
|
|
|
wxLocale* m_pLocale;
|
|
|
|
wxLogBOINC* m_pLog;
|
2004-05-21 06:27:15 +00:00
|
|
|
|
2005-12-28 12:33:18 +00:00
|
|
|
CBrandingScheme* m_pBranding;
|
|
|
|
CMainFrame* m_pFrame;
|
|
|
|
CMainDocument* m_pDocument;
|
2005-10-01 08:56:37 +00:00
|
|
|
#if defined(__WXMSW__) || defined(__WXMAC__)
|
2005-12-28 12:33:18 +00:00
|
|
|
CTaskBarIcon* m_pTaskBarIcon;
|
2005-10-01 08:56:37 +00:00
|
|
|
#endif
|
|
|
|
#ifdef __WXMAC__
|
2005-12-28 12:33:18 +00:00
|
|
|
CMacSystemMenu* m_pMacSystemMenu;
|
2004-10-25 21:42:47 +00:00
|
|
|
#endif
|
2004-04-10 09:11:03 +00:00
|
|
|
|
2005-12-28 12:33:18 +00:00
|
|
|
bool m_bBOINCStartedByManager;
|
|
|
|
bool m_bFrameVisible;
|
2004-11-19 08:11:49 +00:00
|
|
|
|
2005-12-28 12:33:18 +00:00
|
|
|
int m_lBOINCCoreProcessId;
|
2004-11-23 07:45:11 +00:00
|
|
|
|
2004-12-14 02:50:16 +00:00
|
|
|
#ifdef __WXMSW__
|
2005-12-28 12:33:18 +00:00
|
|
|
HANDLE m_hBOINCCoreProcess;
|
2006-01-23 08:47:05 +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
|
2005-12-28 12:33:18 +00:00
|
|
|
wxArrayString m_astrLanguages;
|
2005-02-07 04:47:18 +00:00
|
|
|
|
2004-04-10 09:11:03 +00:00
|
|
|
public:
|
|
|
|
|
2006-03-23 01:17:07 +00:00
|
|
|
wxString m_strDefaultWindowStation;
|
|
|
|
wxString m_strDefaultDesktop;
|
|
|
|
wxString m_strDefaultDisplay;
|
2005-02-15 06:32:43 +00:00
|
|
|
|
2004-04-10 09:11:03 +00:00
|
|
|
bool OnInit();
|
|
|
|
|
2006-01-23 21:48:45 +00:00
|
|
|
int IsNetworkAlive(long* lpdwFlags);
|
2006-01-23 08:47:05 +00:00
|
|
|
int IsNetworkAlwaysOnline();
|
2005-12-28 12:33:18 +00:00
|
|
|
int UpdateSystemIdleDetection();
|
2005-01-07 07:32:23 +00:00
|
|
|
|
2006-05-02 09:31:04 +00:00
|
|
|
int StartBOINCScreensaverTest();
|
|
|
|
|
2005-12-28 12:33:18 +00:00
|
|
|
CBrandingScheme* GetBrand() { return m_pBranding; }
|
2005-04-10 19:01:23 +00:00
|
|
|
CMainFrame* GetFrame() { return m_pFrame; }
|
|
|
|
CMainDocument* GetDocument() { return m_pDocument; }
|
2005-10-01 08:56:37 +00:00
|
|
|
#if defined(__WXMSW__) || defined(__WXMAC__)
|
2005-04-10 19:01:23 +00:00
|
|
|
CTaskBarIcon* GetTaskBarIcon() { return m_pTaskBarIcon; }
|
2005-10-01 08:56:37 +00:00
|
|
|
#endif
|
|
|
|
#ifdef __WXMAC__
|
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
|
|
|
|
|