3#include "DefinitionsGUI.h"
15 class CGUIPropertyMenuBase;
20 class CGUIPaneExampleSNAP;
21 class CGUIPaneViewGraph;
23 class CGUIMenuItemFixedViewPlacementSet;
25 class CGUIMenuItemBase;
29 typedef struct sMenuItemPredefinedExpandSetting
31 sMenuItemPredefinedExpandSetting() :
32 m_strMenuItemFullPath(L
""),
35 m_bAllowToLoad(true) {}
37 sMenuItemPredefinedExpandSetting(
38 const Base::CFLString<wchar_t>& strMenuItemFullPath,
39 bool bExpand,
bool bRecursive,
bool bAllowToLoad) :
40 m_strMenuItemFullPath(strMenuItemFullPath),
42 m_bRecursive(bRecursive),
43 m_bAllowToLoad(bAllowToLoad) {}
45 sMenuItemPredefinedExpandSetting(sMenuItemPredefinedExpandSetting& rhs) :
46 m_strMenuItemFullPath(rhs.m_strMenuItemFullPath),
47 m_bExpand(rhs.m_bExpand),
48 m_bRecursive(rhs.m_bRecursive),
49 m_bAllowToLoad(rhs.m_bAllowToLoad) {}
51 ~sMenuItemPredefinedExpandSetting() {}
52 Base::CFLString<wchar_t> m_strMenuItemFullPath;
57 SMenuItemPredefinedExpandSetting;
59 class FL_EXPORT CGUIManager :
public Base::CFLBase
62 CGUIManager(
const CGUIManager& rh);
65 virtual ~CGUIManager();
67 static bool PreInitialize();
68 static bool Initialize();
69 static bool IsInitialized();
70 static bool PreTerminate();
71 static bool IsPreTerminated();
72 static bool Terminate();
74 static bool PeekAndPump();
90 static const CResult SetConfigurationPath(
const Base::CFLString<wchar_t>& strPath);
102 static Base::CFLString<wchar_t> GetConfigurationPath();
118 static const CResult SetExamplesSNAPPath(
const Base::CFLString<wchar_t>& strPath);
130 static Base::CFLString<wchar_t> GetExamplesSNAPPath();
140 static uint32_t GetValidResourceId();
154 static const CResult AddChargedResourceId(uint32_t u32ResourceID);
168 static const CResult ReleaseChargedResourceId(uint32_t i32ResourceID);
178 static int64_t GetMenuItemCount();
201 static const CResult RegisterMenu(
const CGUIPropertyMenuBase& pmb,
const Base::CFLString<wchar_t>& strName,
const Base::CFLString<wchar_t>& strPath,
bool bAllowMultiInstance =
true,
bool bSetGlobalModel =
false);
226 static const CResult RegisterMenu(
const CGUIPropertyMenuBase& pmb,
const Base::CFLString<wchar_t>& strName,
const Base::CFLString<wchar_t>& strInsertPositionFullPath, EInsertPosition eInsertAt,
bool bAllowMultiInstance,
bool bSetGlobalModel);
243 static const CResult UnregisterMenu(
const Base::CFLString<wchar_t>& flsFullPath);
258 static bool AddMenuItem(CGUIMenuItemBase* pItem);
277 static bool AddMenuItem(CGUIMenuItemBase* pMI,
bool bAllowMultiInstance,
bool bSetGlobalModel =
false);
298 static bool InsertMenuItem(CGUIMenuItemBase* pItem, CGUIMenuItemBase* pItemPosition, EInsertPosition eInsertAt = EInsertPosition_After);
323 static bool InsertMenuItem(CGUIMenuItemBase* pItem, CGUIMenuItemBase* pItemPosition, EInsertPosition eInsertAt,
bool bAllowMultiInstance,
bool bSetGlobalModel =
false);
336 static bool DeleteMenuItem(CGUIMenuItemBase* pItem);
349 static bool DeleteMenuItem(
const Base::CFLString<wchar_t>& flsFullPath);
364 static CGUIMenuItemBase* GetMenuItem(int64_t i64Index);
383 static CGUIMenuItemBase* GetMenuItem(
const Base::CFLString<wchar_t>& flsName,
const Base::CFLString<wchar_t>& flsPath);
400 static CGUIMenuItemBase* GetMenuItem(
const Base::CFLString<wchar_t>& flsFullPath);
417 static const CResult GetMenuItemChildren(CGUIMenuItemBase* pItem, std::vector<CGUIMenuItemBase*>& vctChildItems);
434 static const CResult GetMenuItemChildren(
const Base::CFLString<wchar_t>& flsPath, std::vector<CGUIMenuItemBase*>& vctChildItems);
448 static CGUIMenuItemFixedViewPlacementSet* GetMenuItemFixedViewPlacementSet(Base::CFLString<wchar_t> flstrName);
462 static CGUIMenuItemFixedViewPlacementSet* GetMenuItemFixedViewPlacementSet(int64_t i64FvpSetIndex);
474 static void PushBackFixedViewPlacementSet(CGUIMenuItemFixedViewPlacementSet* pFvpSet);
486 static void EraseFixedViewPlacementSet(CGUIMenuItemFixedViewPlacementSet* pFvpSet);
508 static bool RegisterTreeItem(
const wchar_t* pWcsName,
const wchar_t* pWcsPath,
void* pData, ETreeItemIcon eIcon = ETreeItemIcon_DocEmpty);
520 static bool UnregisterTreeItem(
const wchar_t* pWcsFullPath);
532 static bool UnregisterTreeItem(
void* pData);
546 static bool RenameTreeItem(
void* pData,
const wchar_t* pWcsNewName);
558 static bool IsThereTreeItem(
void* pData);
572 static bool SortTreeItem(ESortOrder eSortOrder = ESortOrder_Ascending);
590 static bool SortTreeItem(CGUIMenuItemBase* pItem, ESortOrder eSortOrder = ESortOrder_Ascending);
604 static bool CancelSortTreeItem(CGUIMenuItemBase* pItem =
nullptr);
638 static void PreInitializePaneVisibility(
bool bShowPaneMenu =
true,
bool bShowPaneLog =
false,
bool bShowPaneCode =
false,
bool bShowPaneExampleSNAP =
true,
bool bShowPaneColorTable =
false,
bool bShowPaneViewGraph =
false,
bool bShowPaneSheet =
false);
670 static void GetPreInitializedPaneVisibility(
bool& bShowPaneMenu,
bool& bShowPaneLog,
bool& bShowPaneCode,
bool& bShowPaneExampleSNAP,
bool& bShowPaneColorTable,
bool& bShowPaneViewGraph,
bool& bShowPaneSheet);
684 static void ModifyPaneCreationOnInitialize(EPaneType ePaneTypeRemove, EPaneType ePaneTypeAdd = EPaneType_MainPane);
698 static void SetPaneCreationOnInitialize(EPaneType ePaneType,
bool bCreate);
710 static EPaneType GetPaneCreationSetting();
718 static void BeginWaitCursor();
726 static void EndWaitCursor();
742 static const CResult AddFontSetting(Base::CFLString<wchar_t> strPaneClassName);
756 static const CResult LoadFontSetting();
774 static const CResult WriteFontSetting(Base::CFLString<wchar_t> strPaneClassName, CFont* pFont);
789 static const CResult LoadFixedViewPlacementSetting(
const wchar_t* pWcsFileNameWithPath =
nullptr);
808 static const CResult ImportFixedViewPlacementSet(
const wchar_t* pWcsFileNameWithPath =
nullptr,
bool bOverwrite =
true,
bool bApply =
false);
822 static const CResult WriteFixedViewPlacementSetting(
const wchar_t* pWcsFileNameWithPath =
nullptr);
834 static const CResult LoadThemeSetting();
848 static const CResult WriteThemeSetting(
int nValue);
870 static const CResult AddPredefinedMenuItemExpandSetting(
const Base::CFLString<wchar_t>& strMenuItemFullPath,
bool bExpand,
bool bRecursive,
bool bAllowToLoad);
892 static const CResult GetPredefinedMenuItemExpandSetting(
const Base::CFLString<wchar_t>& strMenuItemFullPath,
bool& bExpand,
bool& bRecursive,
bool& bAllowToLoad);
906 static const CResult LoadMenuItemExpandSetting();
924 static const CResult LoadMenuItemExpandSetting(
const Base::CFLString<wchar_t>& strMenuItemFullPath,
bool& bExpand);
942 static const CResult WriteMenuItemExpandSetting(
const Base::CFLString<wchar_t>& strMenuItemFullPath,
bool bExpand);
956 static const CResult LoadExampleSNAPExpandSetting();
974 static const CResult LoadExampleSNAPExpandSetting(
const Base::CFLString<wchar_t>& strExampleSNAPFullPath,
bool& bExpand);
992 static const CResult WriteExampleSNAPExpandSetting(
const Base::CFLString<wchar_t>& strExampleSNAPFullPath,
bool bExpand);
1006 static const CResult LoadWorkingPane();
1025 static const CResult WriteWorkingPane(
const CGUIMenuItemBase* pMenuItem,
bool bExist);
1038 static const CResult WriteWorkingPanes();
1052 static const CResult WriteLastFocusedWorkingPane();
1066 static const CResult LoadFavoriteMenuItemSetting();
1086 static const CResult WriteFavoriteMenuItemSetting(CGUIMenuItemBase* pMenuItem,
bool bDelete,
bool bDeleteProfile =
false);
1100 static const CResult WriteFavoriteMenuItemSetting();
1114 static const CResult LoadFavoriteExampleSNAPSetting();
1134 static const CResult WriteFavoriteExampleSNAPSetting(CGUIMenuItemBase* pExampleSNAP,
bool bDelete,
bool bDeleteProfile =
false);
1148 static const CResult WriteFavoriteExampleSNAPSetting();
1158 static bool IsLoadingFavoriteMenu();
1168 static bool IsLoadingMenuItemExpand();
1178 static bool IsLoadingExampleSNAPExpand();
1188 static bool IsLoadingFixedViewPlacement();
1200 static bool EnableMenuItemSNAPObject(
bool bEnable);
1210 static bool IsMenuItemSNAPObjectEnabled();
1222 static const CResult ReloadOpenedPanePropertiesAll();
1234 static CGUIMainFrame* GetMainFrame();
1251 static const CResult OpenURL(
const Base::CFLString<wchar_t>& strURL);
1268 static const CResult GetMenuItemPropertyOfVisiblePane(std::set<CGUIMenuItemProperty*>& setPMenuItemProperty);
1296 static const CResult SetRegistrySubKeyName(
const Base::CFLString<wchar_t>& strSubKeyName);
1313 static const CResult SetAppTitle(
const Base::CFLString<wchar_t>& strAppTitle);
1326 static Base::CFLString<wchar_t> GetAppTitle();
1343 static void SetMenuItemRootPath(
const Base::CFLString<wchar_t>& strRoot);
1356 static Base::CFLString<wchar_t> GetMenuItemRootName();
1371 static void SetMenuItemRootIcon(ETreeItemIcon eRootIcon = ETreeItemIcon_FLImaging);
1386 static ETreeItemIcon GetMenuItemRootIcon();
1397 static void EnableWriteWorkingPanesOnTerminate(
bool bEnable);
1408 static bool IsWriteWorkingPanesOnTerminateEnabled();
1425 static const CResult EnsureDirectoryExists(
const Base::CFLString<wchar_t>& strDirPath);
1440 static void SetMainFrameBackgroundImagePadding(int32_t i32PaddingX, int32_t i32PaddingY);
1455 static void GetMainFrameBackgroundImagePadding(int32_t& i32PaddingX, int32_t& i32PaddingY);
1470 static void SetMainFrameBackgroundImageIntervalSpacing(int32_t i32IntervalSpacingX, int32_t i32IntervalSpacingY);
1485 static void GetMainFrameBackgroundImageIntervalSpacing(int32_t& i32IntervalSpacingX, int32_t& i32IntervalSpacingY);
1498 static void SetMainFrameBackgroundColor(COLORREF clr);
1511 static COLORREF GetMainFrameBackgroundColor();
1524 static void SetMainFrameBackgroundImage(
const wchar_t* pWcsImagePath);
1539 static void SetMainFrameBackgroundImageLayout(EBackgroundImageLayout eMode = EBackgroundImageLayout_Tile);
1567 static void SetMainFrameAppIcon(
const wchar_t* pWcsIconPath);
1580 static void SetMainFrameMenuBarLogoImage(
const wchar_t* pWcsMenuBarLogoImagePath);
1593 static void ShowMainFrameMenuBarLogo(
bool bShow);
1606 static bool IsMainFrameMenuBarLogoVisible();
1608 static void RunOnMainThread(
const std::function<
void(
void*)>& lmdFunction,
void* pVResult,
const void* pVCaller);
1609 static void RunOnMainThreadPostMessage(
const std::function<
void(
void*)>& lmdFunction,
void* pVResult,
const void* pVCaller);
1610 static DWORD GetMainThreadID();
1612 static bool EnterDllResource();
1613 static bool LeaveDllResource();
1615 static const Base::CFLString<wchar_t> GetModuleFileName();
1617 static bool IsSwitchingViewTab();
1618 static void SetSwitchingViewTab(
bool bSet);
1620 static HINSTANCE GetDllResource();
1622 static CGUIViewImageBase* GetCallerView(
const CFLBase* pCaller);
1624 static const CResult InitializeAfxInstanceHandle();
1626 DeclareGetClassType();
1629 virtual void OnReceiveBroadcast(
const Base::CBroadcastMessage* pMessage)
override;
1630 static bool PumpMessage();
1631 static bool OnIdle(LONG lCount);
1632 static const CResult InternalSetMenuItemName(CGUIMenuItemBase* pItem,
const Base::CFLString<wchar_t>& strName);
1633 static const CResult InternalSetMenuItemPath(CGUIMenuItemBase* pItem,
const Base::CFLString<wchar_t>& strPath);
1634 static const CResult InternalInitializeTreeContainerMenuItem();
1635 static const CResult InternalInitializeTreeContainerMenuItemExampleSNAP();
1638 static CGUIManager* GetObject();
1640 Base::CFLString<wchar_t> m_strConfigurationPath;
1641 Base::CFLString<wchar_t> m_strExamplesSNAPPath;
1642 Base::CFLString<wchar_t> m_strAppTitle;
1643 Base::CFLString<wchar_t> m_strRoot;
1644 ETreeItemIcon m_eRootIcon;
1646 bool m_bInitialized;
1647 bool m_bPreTerminate;
1649 bool m_bPreInitPaneMenuVisibility;
1650 bool m_bPreInitPaneLogVisibility;
1651 bool m_bPreInitPaneCodeVisibility;
1652 bool m_bPreInitPaneExampleSNAPVisibility;
1653 bool m_bPreInitPaneColorTableVisibility;
1654 bool m_bPreInitPaneViewGraphVisibility;
1655 bool m_bPreInitPaneSheetVisibility;
1656 bool m_bEnableMenuItemSNAPObject;
1658 bool m_bLoadFixedViewPlacementSetting;
1659 bool m_bLoadThemeSetting;
1660 bool m_bLoadWorkingPane;
1661 bool m_bLoadFavoriteMenuItemSetting;
1662 bool m_bLoadMenuItemExpandSetting;
1663 bool m_bLoadFavoriteExampleSNAPSetting;
1664 bool m_bLoadExampleSNAPExpandSetting;
1665 bool m_bLoadFontSetting;
1667 bool m_bEnableWriteWorkingPanes;
1669 bool m_bNowLoadingFavoriteMenu;
1670 bool m_bNowLoadingFavoriteExampleSNAP;
1671 bool m_bNowLoadingMenuItemExpand;
1672 bool m_bNowLoadingExampleSNAPExpand;
1673 bool m_bNowLoadingFixedViewPlacement;
1674 bool m_bNowSwitchingViewTab;
1676 std::stack<HINSTANCE>& m_stackResources;
1677 std::deque<CGUIMenuItemBase*>& m_deqMenuItems;
1678 std::unordered_map<uint32_t, CGUIMenuItemBase*>& m_mapFullPathHashAndMenuItems;
1679 std::map<uint32_t, bool>& m_mapResourceIdChargedStatus;
1680 std::vector<CGUIMenuItemFixedViewPlacementSet*>& m_vctMenuItemFvpSet;
1681 std::set<Base::CFLString<wchar_t>>& m_setPaneName;
1682 std::vector<SMenuItemPredefinedExpandSetting*>& m_vctMenuItemPredefinedExpandSetting;
1685 CRuntimeClass* m_pRtiOrg;
1686 DWORD m_dwMainThreadID;
1690 Base::TPoint<int32_t> m_tpMainFrameBgPadding;
1691 bool m_bMainFrameBgPaddingDirty;
1692 Base::TPoint<int32_t> m_tpMainFrameBgIntervalSpacing;
1693 bool m_bMainFrameBgIntervalSpacingDirty;
1695 COLORREF m_clrMainFrameBg;
1696 bool m_bMainFrameBgColorDirty;
1699 bool m_bMainFrameBgImageLayoutDirty;
1701 Base::CFLString<wchar_t> m_strMainFrameBgImagePath;
1702 bool m_bMainFrameBgImageDirty;
1704 Base::CFLString<wchar_t> m_strMainFrameAppIconPath;
1705 bool m_bMainFrameAppIconDirty;
1707 Base::CFLString<wchar_t> m_strMainFrameMenuBarLogoImagePath;
1708 bool m_bMainFrameMenuBarLogoImageDirty;
1709 bool m_bShowMainFrameMenuBarLogo;
1710 bool m_bMainFrameMenuBarLogoVisibilityDirty;
1712 friend class CGUIMenuItemBase;
A class on a set of fixed view positions.
Definition GUIFixedViewPlacementSet.h:30
A class of view base.
Definition GUIViewImageBase.h:43
Definition D2DObject.h:12
EBackgroundImageLayout
Enumeration for specifying how the background image is arranged.
Definition DefinitionsGUI.h:11673
EPaneType
Pane type.
Definition DefinitionsGUI.h:9428