diff options
Diffstat (limited to 'docs/release/src/osd/winui/treeview.h')
-rw-r--r-- | docs/release/src/osd/winui/treeview.h | 134 |
1 files changed, 49 insertions, 85 deletions
diff --git a/docs/release/src/osd/winui/treeview.h b/docs/release/src/osd/winui/treeview.h index 7c95e1d2220..a61ee62fd0d 100644 --- a/docs/release/src/osd/winui/treeview.h +++ b/docs/release/src/osd/winui/treeview.h @@ -1,34 +1,12 @@ +// license:BSD-3-Clause // For licensing and usage information, read docs/release/winui_license.txt -//**************************************************************************** -// NOTE: ifdef MESS doesn't work here + #ifndef WINUI_TREEVIEW_H #define WINUI_TREEVIEW_H -/* corrections for commctrl.h */ - -#if defined(__GNUC__) -/* fix warning: cast does not match function type */ -#undef TreeView_InsertItem -#define TreeView_InsertItem(w,i) (HTREEITEM)(LRESULT)(int)SendMessage((w),TVM_INSERTITEM,0,(LPARAM)(LPTV_INSERTSTRUCT)(i)) - -#undef TreeView_SetImageList -#define TreeView_SetImageList(w,h,i) (HIMAGELIST)(LRESULT)(int)SendMessage((w),TVM_SETIMAGELIST,i,(LPARAM)(HIMAGELIST)(h)) - -#undef TreeView_GetNextItem -#define TreeView_GetNextItem(w,i,c) (HTREEITEM)(LRESULT)(int)SendMessage((w),TVM_GETNEXTITEM,c,(LPARAM)(HTREEITEM)(i)) - -#undef TreeView_HitTest -#define TreeView_HitTest(hwnd, lpht) \ - (HTREEITEM)(LRESULT)(int)SNDMSG((hwnd), TVM_HITTEST, 0, (LPARAM)(LPTV_HITTESTINFO)(lpht)) - -/* fix wrong return type */ -#undef TreeView_Select -#define TreeView_Select(w,i,c) (BOOL)(int)SendMessage((w),TVM_SELECTITEM,c,(LPARAM)(HTREEITEM)(i)) - -#undef TreeView_EditLabel -#define TreeView_EditLabel(w, i) SNDMSG(w,TVM_EDITLABEL,0,(LPARAM)(i)) - -#endif /* defined(__GNUC__) */ +#define MAX_EXTRA_FOLDERS 256 +#define MAX_EXTRA_SUBFOLDERS 256 +#define ICON_MAX std::size(treeIconNames) #include "bitmask.h" #include <stdint.h> #include "emu_opts.h" @@ -39,16 +17,16 @@ typedef struct { - const char *m_lpTitle; // Folder Title - const char *short_name; // for saving in the .ini - UINT m_nFolderId; // ID - UINT m_nIconId; // if >= 0, resource id of icon (IDI_xxx), otherwise index in image list - DWORD m_dwUnset; // Excluded filters - DWORD m_dwSet; // Implied filters - BOOL m_process; // 1 = process only if rebuilding the cache - void (*m_pfnCreateFolders)(int parent_index); // Constructor for special folders - BOOL (*m_pfnQuery)(uint32_t nDriver); // Query function - BOOL m_bExpectedResult; // Expected query result + const char *m_lpTitle; // Folder Title + const char *short_name; // for saving in the .ini + UINT m_nFolderId; // ID + UINT m_nIconId; // if >= 0, resource id of icon (IDI_xxx), otherwise index in image list + DWORD m_dwUnset; // Excluded filters + DWORD m_dwSet; // Implied filters + BOOL m_process; // (not used yet) + void (*m_pfnCreateFolders)(int parent_index); // Constructor for special folders + BOOL (*m_pfnQuery)(uint32_t nDriver); // Query function + BOOL m_bExpectedResult; // Expected query result OPTIONS_TYPE m_opttype = OPTIONS_MAX; // Has an ini file (vector.ini, etc) } FOLDERDATA, *LPFOLDERDATA; @@ -64,38 +42,15 @@ typedef struct typedef const FILTER_ITEM *LPCFILTER_ITEM; -/*************************************************************************** - Functions to build builtin folder lists - ***************************************************************************/ - -void CreateManufacturerFolders(int parent_index); -void CreateYearFolders(int parent_index); -void CreateSourceFolders(int parent_index); -void CreateScreenFolders(int parent_index); -void CreateResolutionFolders(int parent_index); -void CreateFPSFolders(int parent_index); -void CreateBIOSFolders(int parent_index); -void CreateCPUFolders(int parent_index); -void CreateSoundFolders(int parent_index); -void CreateOrientationFolders(int parent_index); -void CreateDeficiencyFolders(int parent_index); -void CreateDumpingFolders(int parent_index); - -/***************************************************************************/ - -#define MAX_EXTRA_FOLDERS 256 -#define MAX_EXTRA_SUBFOLDERS 256 - /* TreeView structures */ enum { FOLDER_NONE = 0, FOLDER_ALLGAMES, FOLDER_AVAILABLE, + FOLDER_ARCADE, FOLDER_BIOS, FOLDER_CLONES, - FOLDER_COMPUTER, - FOLDER_CONSOLE, FOLDER_CPU, FOLDER_DEFICIENCY, FOLDER_DUMPING, @@ -152,8 +107,8 @@ typedef enum typedef struct { - LPSTR m_lpTitle; // String contains the folder name - LPTSTR m_lptTitle; // String contains the folder name as TCHAR* + char *m_lpTitle; // String contains the folder name + wchar_t *m_lptTitle; // String contains the folder name as wchar_t* UINT m_nFolderId; // Index / Folder ID number int m_nParent; // Parent folder index in treeFolders[] int m_nIconId; // negative icon index into the ImageList, or IDI_xxx resource id @@ -163,52 +118,61 @@ typedef struct typedef struct { - char m_szTitle[64]; // Folder Title - UINT m_nFolderId; // ID - int m_nParent; // Parent Folder index in treeFolders[] - DWORD m_dwFlags; // Flags - Customisable and Filters - int m_nIconId; // negative icon index into the ImageList, or IDI_xxx resource id - int m_nSubIconId; // negative icon index into the ImageList, or IDI_xxx resource id + char m_szTitle[64]; // Folder Title + UINT m_nFolderId; // ID + int m_nParent; // Parent Folder index in treeFolders[] + DWORD m_dwFlags; // Flags - Customizable and Filters + int m_nIconId; // negative icon index into the ImageList, or IDI_xxx resource id + int m_nSubIconId; // negative icon index into the ImageList, or IDI_xxx resource id } EXFOLDERDATA, *LPEXFOLDERDATA; +typedef struct +{ + int nResourceID; + const char* lpName; +} TREEICON; + void FreeFolders(void); void ResetFilters(void); void InitTree(LPCFOLDERDATA lpFolderData, LPCFILTER_ITEM lpFilterList); void SetCurrentFolder(LPTREEFOLDER lpFolder); UINT GetCurrentFolderID(void); - LPTREEFOLDER GetCurrentFolder(void); int GetNumFolders(void); LPTREEFOLDER GetFolder(UINT nFolder); LPTREEFOLDER GetFolderByID(UINT nID); LPTREEFOLDER GetFolderByName(int nParentId, const char *pszFolderName); - void AddGame(LPTREEFOLDER lpFolder, UINT nGame); void RemoveGame(LPTREEFOLDER lpFolder, UINT nGame); int FindGame(LPTREEFOLDER lpFolder, int nGame); - void ResetWhichGamesInFolders(void); - LPCFOLDERDATA FindFilter(DWORD folderID); - -BOOL GameFiltered(int nGame, DWORD dwFlags); -BOOL GetParentFound(int nGame); - +bool GameFiltered(int nGame, DWORD dwFlags); +bool GetParentFound(int nGame); LPCFILTER_ITEM GetFilterList(void); - -void SetTreeIconSize(HWND hWnd, BOOL bLarge); -BOOL GetTreeIconSize(void); - +void SetTreeIconSize(HWND hWnd, bool bLarge); +bool GetTreeIconSize(void); void GetFolders(TREEFOLDER ***folders,int *num_folders); -BOOL TryRenameCustomFolder(LPTREEFOLDER lpFolder,const char *new_name); +bool TryRenameCustomFolder(LPTREEFOLDER lpFolder,const char *new_name); void AddToCustomFolder(LPTREEFOLDER lpFolder,int driver_index); void RemoveFromCustomFolder(LPTREEFOLDER lpFolder,int driver_index); - HIMAGELIST GetTreeViewIconList(void); int GetTreeViewIconIndex(int icon_id); - void ResetTreeViewFolders(void); void SelectTreeViewFolder(int folder_id); -#endif /* TREEVIEW_H */ +void CreateManufacturerFolders(int parent_index); +void CreateYearFolders(int parent_index); +void CreateSourceFolders(int parent_index); +void CreateScreenFolders(int parent_index); +void CreateResolutionFolders(int parent_index); +void CreateFPSFolders(int parent_index); +void CreateBIOSFolders(int parent_index); +void CreateCPUFolders(int parent_index); +void CreateSoundFolders(int parent_index); +void CreateOrientationFolders(int parent_index); +void CreateDeficiencyFolders(int parent_index); +void CreateDumpingFolders(int parent_index); + +#endif |