2008-08-06 18:36:30 +00:00
|
|
|
// This file is part of BOINC.
|
2006-10-18 09:02:36 +00:00
|
|
|
// http://boinc.berkeley.edu
|
2008-08-06 18:36:30 +00:00
|
|
|
// Copyright (C) 2008 University of California
|
2006-10-18 09:02:36 +00:00
|
|
|
//
|
2008-08-06 18:36:30 +00:00
|
|
|
// BOINC 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 3 of the License, or (at your option) any later version.
|
2006-10-18 09:02:36 +00:00
|
|
|
//
|
2008-08-06 18:36:30 +00:00
|
|
|
// BOINC is distributed in the hope that it will be useful,
|
2006-10-18 09:02:36 +00:00
|
|
|
// 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.
|
|
|
|
//
|
2008-08-06 18:36:30 +00:00
|
|
|
// You should have received a copy of the GNU Lesser General Public License
|
|
|
|
// along with BOINC. If not, see <http://www.gnu.org/licenses/>.
|
2006-10-18 09:02:36 +00:00
|
|
|
|
2017-04-08 06:54:49 +00:00
|
|
|
#ifndef BOINC_SKINMANAGER_H
|
|
|
|
#define BOINC_SKINMANAGER_H
|
2006-10-18 09:02:36 +00:00
|
|
|
|
|
|
|
#if defined(__GNUG__) && !defined(__APPLE__)
|
|
|
|
#pragma interface "SkinManager.cpp"
|
|
|
|
#endif
|
|
|
|
|
2014-12-11 14:18:47 +00:00
|
|
|
#include "miofile.h"
|
2006-10-18 09:02:36 +00:00
|
|
|
|
2015-04-09 10:44:29 +00:00
|
|
|
enum {
|
|
|
|
BKGD_ANCHOR_HORIZ_LEFT,
|
|
|
|
BKGD_ANCHOR_HORIZ_CENTER,
|
|
|
|
BKGD_ANCHOR_HORIZ_RIGHT
|
|
|
|
};
|
|
|
|
|
|
|
|
enum {
|
|
|
|
BKGD_ANCHOR_VERT_TOP,
|
|
|
|
BKGD_ANCHOR_VERT_CENTER,
|
|
|
|
BKGD_ANCHOR_VERT_BOTTOM
|
|
|
|
};
|
|
|
|
|
2006-10-18 09:02:36 +00:00
|
|
|
class CSkinItem : public wxObject
|
|
|
|
{
|
|
|
|
DECLARE_DYNAMIC_CLASS( CSkinItem )
|
|
|
|
|
|
|
|
public:
|
|
|
|
CSkinItem();
|
|
|
|
~CSkinItem();
|
|
|
|
|
|
|
|
static wxColour ParseColor(wxString strColor);
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
class CSkinImage : public CSkinItem
|
|
|
|
{
|
|
|
|
DECLARE_DYNAMIC_CLASS( CSkinImage )
|
|
|
|
|
|
|
|
public:
|
|
|
|
CSkinImage();
|
|
|
|
~CSkinImage();
|
|
|
|
|
|
|
|
void Clear();
|
|
|
|
int Parse(MIOFILE& in);
|
|
|
|
|
2006-10-29 09:30:29 +00:00
|
|
|
wxBitmap* GetBitmap();
|
|
|
|
wxColour* GetBackgroundColor();
|
2015-04-09 10:44:29 +00:00
|
|
|
int GetHorizontalAnchor() { return m_iAnchorHorizontal; }
|
|
|
|
int GetVerticalAnchor() { return m_iAnchorVertical; }
|
2006-10-18 09:02:36 +00:00
|
|
|
|
2006-10-29 09:30:29 +00:00
|
|
|
bool SetDefaults(
|
|
|
|
wxString strComponentName,
|
|
|
|
const char** ppDefaultImage
|
|
|
|
);
|
|
|
|
|
|
|
|
bool SetDefaults(
|
|
|
|
wxString strComponentName,
|
|
|
|
const char** ppDefaultImage,
|
2015-04-09 10:44:29 +00:00
|
|
|
wxString strBackgroundColor,
|
|
|
|
int horizontalAnchor = BKGD_ANCHOR_HORIZ_LEFT,
|
|
|
|
int verticalAnchor = BKGD_ANCHOR_VERT_TOP
|
2006-10-29 09:30:29 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
bool Validate();
|
2006-10-18 09:02:36 +00:00
|
|
|
|
|
|
|
private:
|
2006-10-29 09:30:29 +00:00
|
|
|
wxString m_strComponentName;
|
|
|
|
wxString m_strDesiredBitmap;
|
|
|
|
wxString m_strDesiredBackgroundColor;
|
|
|
|
const char** m_ppDefaultBitmap;
|
|
|
|
wxString m_strDefaultBackgroundColor;
|
|
|
|
wxBitmap m_bmpBitmap;
|
|
|
|
wxColour m_colBackgroundColor;
|
2015-04-09 10:44:29 +00:00
|
|
|
// Anchors are used only by m_BackgroundImage and m_DialogBackgroundImage
|
|
|
|
int m_iAnchorHorizontal;
|
|
|
|
int m_iAnchorVertical;
|
2006-10-29 09:30:29 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
class CSkinIcon : public CSkinItem
|
|
|
|
{
|
|
|
|
DECLARE_DYNAMIC_CLASS( CSkinIcon )
|
|
|
|
|
|
|
|
public:
|
|
|
|
CSkinIcon();
|
|
|
|
~CSkinIcon();
|
|
|
|
|
|
|
|
void Clear();
|
|
|
|
int Parse(MIOFILE& in);
|
2014-02-14 21:05:42 +00:00
|
|
|
int Parse32(MIOFILE& in);
|
2006-10-29 09:30:29 +00:00
|
|
|
|
2014-02-14 21:05:42 +00:00
|
|
|
wxIconBundle* GetIcon();
|
2006-10-29 09:30:29 +00:00
|
|
|
|
|
|
|
bool SetDefaults(
|
|
|
|
wxString strComponentName,
|
2014-02-14 21:05:42 +00:00
|
|
|
wxString strIcon
|
|
|
|
);
|
|
|
|
|
|
|
|
bool SetDefaults(
|
|
|
|
wxString strComponentName,
|
|
|
|
const char** m_ppIcon,
|
|
|
|
const char** m_ppIcon32
|
2006-10-29 09:30:29 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
bool Validate();
|
|
|
|
|
|
|
|
private:
|
|
|
|
wxString m_strComponentName;
|
|
|
|
wxString m_strDesiredIcon;
|
|
|
|
wxString m_strDesiredTransparencyMask;
|
2014-02-14 21:05:42 +00:00
|
|
|
wxIconBundle m_icoDefaultIcon;
|
|
|
|
wxString m_strDesiredIcon32;
|
|
|
|
wxString m_strDesiredTransparencyMask32;
|
|
|
|
wxIconBundle m_icoDefaultIcon32;
|
|
|
|
wxIconBundle m_icoIcon;
|
2006-10-18 09:02:36 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2011-10-25 12:11:26 +00:00
|
|
|
// Default opacity for Simple View white panels
|
|
|
|
// is 60% (153 on a scale of 0 - 255).
|
|
|
|
#define MAX_OPACITY 255
|
|
|
|
#define DEFAULT_OPACITY 153
|
|
|
|
|
2006-10-18 09:02:36 +00:00
|
|
|
class CSkinSimple : public CSkinItem
|
|
|
|
{
|
|
|
|
DECLARE_DYNAMIC_CLASS( CSkinSimple )
|
|
|
|
|
|
|
|
public:
|
|
|
|
CSkinSimple();
|
|
|
|
~CSkinSimple();
|
|
|
|
|
|
|
|
void Clear();
|
|
|
|
int Parse(MIOFILE& in);
|
|
|
|
|
2006-10-29 09:30:29 +00:00
|
|
|
bool InitializeDelayedValidation();
|
2006-10-18 09:02:36 +00:00
|
|
|
|
2006-10-20 15:00:14 +00:00
|
|
|
CSkinImage* GetBackgroundImage() { return &m_BackgroundImage; }
|
2011-10-18 04:58:05 +00:00
|
|
|
CSkinImage* GetDialogBackgroundImage() { return &m_DialogBackgroundImage; }
|
|
|
|
CSkinImage* GetProjectImage() { return &m_ProjectImage; }
|
2006-10-20 15:00:14 +00:00
|
|
|
wxColour GetStaticLineColor() { return m_StaticLineColor; }
|
2013-05-08 21:20:57 +00:00
|
|
|
wxColour GetNoticeAlertColor() { return m_NoticeAlertColor; }
|
2006-10-20 15:00:14 +00:00
|
|
|
CSkinImage* GetWorkunitAnimationImage() { return &m_WorkunitAnimationImage; }
|
2011-10-18 04:58:05 +00:00
|
|
|
CSkinImage* GetWorkunitRunningImage() { return &m_WorkunitRunningImage; }
|
|
|
|
CSkinImage* GetWorkunitSuspendedImage() { return &m_WorkunitSuspendedImage; }
|
|
|
|
CSkinImage* GetWorkunitWaitingImage() { return &m_WorkunitWaitingImage; }
|
2011-10-25 12:11:26 +00:00
|
|
|
int GetPanelOpacity() { return m_iPanelOpacity; }
|
2006-10-20 15:00:14 +00:00
|
|
|
|
2006-10-18 09:02:36 +00:00
|
|
|
private:
|
|
|
|
CSkinImage m_BackgroundImage;
|
2011-10-18 04:58:05 +00:00
|
|
|
CSkinImage m_DialogBackgroundImage;
|
|
|
|
CSkinImage m_ProjectImage;
|
2006-10-18 09:02:36 +00:00
|
|
|
wxColour m_StaticLineColor;
|
2013-05-08 21:20:57 +00:00
|
|
|
wxColour m_NoticeAlertColor;
|
2006-10-18 09:02:36 +00:00
|
|
|
CSkinImage m_WorkunitAnimationImage;
|
2011-10-18 04:58:05 +00:00
|
|
|
CSkinImage m_WorkunitRunningImage;
|
|
|
|
CSkinImage m_WorkunitSuspendedImage;
|
|
|
|
CSkinImage m_WorkunitWaitingImage;
|
2011-10-25 12:11:26 +00:00
|
|
|
int m_iPanelOpacity;
|
2006-10-18 09:02:36 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
class CSkinAdvanced : public CSkinItem
|
|
|
|
{
|
|
|
|
DECLARE_DYNAMIC_CLASS( CSkinAdvanced )
|
|
|
|
|
|
|
|
public:
|
|
|
|
CSkinAdvanced();
|
|
|
|
~CSkinAdvanced();
|
|
|
|
|
|
|
|
void Clear();
|
|
|
|
int Parse(MIOFILE& in);
|
|
|
|
|
2006-10-29 09:30:29 +00:00
|
|
|
bool InitializeDelayedValidation();
|
|
|
|
|
2014-02-14 21:05:42 +00:00
|
|
|
wxString GetApplicationName();
|
|
|
|
wxString GetApplicationShortName();
|
2018-08-29 14:00:31 +00:00
|
|
|
wxString GetApplicationHelpName();
|
2014-02-14 21:05:42 +00:00
|
|
|
wxIconBundle* GetApplicationIcon();
|
|
|
|
wxIconBundle* GetApplicationDisconnectedIcon();
|
|
|
|
wxIconBundle* GetApplicationSnoozeIcon();
|
|
|
|
wxBitmap* GetApplicationLogo();
|
|
|
|
wxString GetOrganizationName();
|
|
|
|
wxString GetOrganizationWebsite();
|
|
|
|
wxString GetOrganizationHelpUrl();
|
2018-12-28 14:50:57 +00:00
|
|
|
wxString GetOrganizationReportBugUrl();
|
2014-02-14 21:05:42 +00:00
|
|
|
int GetDefaultTab();
|
|
|
|
wxString GetExitMessage();
|
|
|
|
bool IsBranded();
|
2006-10-18 09:02:36 +00:00
|
|
|
|
|
|
|
private:
|
2014-02-14 21:05:42 +00:00
|
|
|
bool m_bIsBranded;
|
|
|
|
wxString m_strApplicationName;
|
|
|
|
wxString m_strApplicationShortName;
|
2018-08-29 14:00:31 +00:00
|
|
|
wxString m_strApplicationHelpName;
|
2014-02-14 21:05:42 +00:00
|
|
|
CSkinIcon m_iconApplicationIcon;
|
|
|
|
CSkinIcon m_iconApplicationIcon32;
|
|
|
|
CSkinIcon m_iconApplicationDisconnectedIcon;
|
|
|
|
CSkinIcon m_iconApplicationSnoozeIcon;
|
|
|
|
wxBitmap m_bitmapApplicationLogo;
|
|
|
|
wxString m_strOrganizationName;
|
|
|
|
wxString m_strOrganizationWebsite;
|
|
|
|
wxString m_strOrganizationHelpUrl;
|
2018-12-28 14:50:57 +00:00
|
|
|
wxString m_strOrganizationReportBugUrl;
|
2014-02-14 21:05:42 +00:00
|
|
|
bool m_bDefaultTabSpecified;
|
|
|
|
int m_iDefaultTab;
|
|
|
|
wxString m_strExitMessage;
|
2006-10-18 09:02:36 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2006-10-20 15:00:14 +00:00
|
|
|
class CSkinWizardATP : public CSkinItem
|
|
|
|
{
|
|
|
|
DECLARE_DYNAMIC_CLASS( CSkinWizardATP )
|
|
|
|
|
|
|
|
public:
|
|
|
|
CSkinWizardATP();
|
|
|
|
~CSkinWizardATP();
|
|
|
|
|
|
|
|
void Clear();
|
|
|
|
int Parse(MIOFILE& in);
|
|
|
|
|
2006-10-29 09:30:29 +00:00
|
|
|
bool InitializeDelayedValidation();
|
2006-10-20 15:00:14 +00:00
|
|
|
|
|
|
|
wxString GetWizardTitle() { return m_strTitle; }
|
|
|
|
|
|
|
|
private:
|
|
|
|
wxString m_strTitle;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
class CSkinWizardATAM : public CSkinItem
|
|
|
|
{
|
|
|
|
DECLARE_DYNAMIC_CLASS( CSkinWizardATAM )
|
|
|
|
|
|
|
|
public:
|
|
|
|
CSkinWizardATAM();
|
|
|
|
~CSkinWizardATAM();
|
|
|
|
|
|
|
|
void Clear();
|
|
|
|
int Parse(MIOFILE& in);
|
|
|
|
|
2006-10-29 09:30:29 +00:00
|
|
|
bool InitializeDelayedValidation();
|
2006-10-20 15:00:14 +00:00
|
|
|
|
|
|
|
wxString GetAccountInfoMessage() { return m_strAccountInfoMessage; }
|
|
|
|
|
2018-07-04 04:49:11 +00:00
|
|
|
wxString GetWizardTitle() { return m_strTitle; }
|
|
|
|
|
2006-10-20 15:00:14 +00:00
|
|
|
private:
|
|
|
|
wxString m_strAccountInfoMessage;
|
2018-07-04 04:49:11 +00:00
|
|
|
wxString m_strTitle;
|
2006-10-20 15:00:14 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
class CSkinWizards : public CSkinItem
|
|
|
|
{
|
|
|
|
DECLARE_DYNAMIC_CLASS( CSkinWizards )
|
|
|
|
|
|
|
|
public:
|
|
|
|
CSkinWizards();
|
|
|
|
~CSkinWizards();
|
|
|
|
|
|
|
|
void Clear();
|
|
|
|
int Parse(MIOFILE& in);
|
|
|
|
|
2006-10-29 09:30:29 +00:00
|
|
|
bool InitializeDelayedValidation();
|
2006-10-20 15:00:14 +00:00
|
|
|
|
|
|
|
CSkinWizardATP* GetWizardATP() { return &m_AttachToProjectWizard; }
|
|
|
|
CSkinWizardATAM* GetWizardATAM() { return &m_AttachToAccountManagerWizard; }
|
|
|
|
|
|
|
|
private:
|
|
|
|
CSkinWizardATP m_AttachToProjectWizard;
|
|
|
|
CSkinWizardATAM m_AttachToAccountManagerWizard;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
class CSkinManager : public CSkinItem
|
|
|
|
{
|
|
|
|
DECLARE_DYNAMIC_CLASS( CSkinManager )
|
|
|
|
|
|
|
|
public:
|
|
|
|
CSkinManager();
|
2009-01-30 09:25:35 +00:00
|
|
|
CSkinManager(bool debugSkins);
|
2006-10-20 15:00:14 +00:00
|
|
|
~CSkinManager();
|
|
|
|
|
2011-03-10 10:25:54 +00:00
|
|
|
bool ReloadSkin(wxString strSkin);
|
2006-10-25 14:09:47 +00:00
|
|
|
|
|
|
|
wxArrayString& GetCurrentSkins();
|
|
|
|
wxString GetDefaultSkinName();
|
|
|
|
wxString GetSelectedSkin() { return m_strSelectedSkin; }
|
|
|
|
|
|
|
|
wxString ConstructSkinFileName();
|
|
|
|
wxString ConstructSkinPath();
|
|
|
|
wxString GetSkinFileName();
|
|
|
|
wxString GetSkinsLocation();
|
2006-10-20 15:00:14 +00:00
|
|
|
|
|
|
|
CSkinSimple* GetSimple() { return &m_SimpleSkin; }
|
|
|
|
CSkinAdvanced* GetAdvanced() { return &m_AdvancedSkin; }
|
|
|
|
CSkinWizards* GetWizards() { return &m_WizardsSkin; }
|
|
|
|
|
|
|
|
private:
|
|
|
|
CSkinSimple m_SimpleSkin;
|
|
|
|
CSkinAdvanced m_AdvancedSkin;
|
|
|
|
CSkinWizards m_WizardsSkin;
|
|
|
|
|
2006-10-25 14:09:47 +00:00
|
|
|
wxArrayString m_astrSkins;
|
|
|
|
wxString m_strSelectedSkin;
|
|
|
|
|
2006-10-20 15:00:14 +00:00
|
|
|
void Clear();
|
|
|
|
int Parse(MIOFILE& in, wxString strDesiredLocale);
|
|
|
|
|
2006-10-29 09:30:29 +00:00
|
|
|
bool InitializeDelayedValidation();
|
2006-10-20 15:00:14 +00:00
|
|
|
};
|
|
|
|
|
2006-10-18 09:02:36 +00:00
|
|
|
#endif
|