| 1 |
#ifndef PLATFORMLAYER_H |
| 2 |
#define PLATFORMLAYER_H |
| 3 |
|
| 4 |
/////////////////////////////////////////////////// |
| 5 |
// constants |
| 6 |
/////////////////////////////////////////////////// |
| 7 |
|
| 8 |
#define BOOKMARK_MENU_POS 2 |
| 9 |
#define NUM_BOOKMARK_SUBMENU_DEFAULT 3 |
| 10 |
|
| 11 |
#define CTXMENU_DIR 1 |
| 12 |
#define CTXMENU_FILE 2 |
| 13 |
#define CTXMENU_USEASSOC 4 |
| 14 |
#define CTXMENU_ENABLEEXTAPP 8 |
| 15 |
|
| 16 |
/////////////////////////////////////////////////// |
| 17 |
// Platform abstruction |
| 18 |
/////////////////////////////////////////////////// |
| 19 |
|
| 20 |
class PlatformLayer { |
| 21 |
protected: |
| 22 |
HWND hMainWnd; |
| 23 |
public: |
| 24 |
PlatformLayer(); |
| 25 |
virtual ~PlatformLayer(); |
| 26 |
|
| 27 |
BOOL Init(HWND h); |
| 28 |
|
| 29 |
virtual void Create(HWND hWnd, HINSTANCE hInst) = 0; |
| 30 |
|
| 31 |
static HMENU LoadContextMenu(DWORD nFlg); |
| 32 |
}; |
| 33 |
|
| 34 |
/////////////////////////////////////////////////// |
| 35 |
/////////////////////////////////////////////////// |
| 36 |
// helper function/classes |
| 37 |
/////////////////////////////////////////////////// |
| 38 |
/////////////////////////////////////////////////// |
| 39 |
|
| 40 |
void SetAppIcon(HINSTANCE hInst, HWND hWnd); |
| 41 |
|
| 42 |
/////////////////////////////////////////////////// |
| 43 |
// menu related |
| 44 |
/////////////////////////////////////////////////// |
| 45 |
|
| 46 |
struct MenuMsgRes { |
| 47 |
int iPos; |
| 48 |
int iMenuID; |
| 49 |
int iExtOpt; |
| 50 |
int iMsgID; |
| 51 |
MenuMsgRes *pSubMenu; |
| 52 |
}; |
| 53 |
|
| 54 |
void AddMenuItemByMsgRes(HMENU hMenu, MenuMsgRes *pRes); |
| 55 |
void OverrideMenuTitle(HMENU hMenu, MenuMsgRes *pRes, int nNumRes); |
| 56 |
|
| 57 |
#if defined(PLATFORM_WIN32) |
| 58 |
#include "Win32Platform.h" |
| 59 |
#endif |
| 60 |
#if defined(PLATFORM_PKTPC) |
| 61 |
#include "PocketPCPlatform.h" |
| 62 |
#endif |
| 63 |
#if defined(PLATFORM_WM5) |
| 64 |
#include "WM5Platform.h" |
| 65 |
#endif |
| 66 |
#if defined(PLATFORM_PSPC) |
| 67 |
#include "PsPCPlatform.h" |
| 68 |
#endif |
| 69 |
#if defined(PLATFORM_HPC) |
| 70 |
#include "HPCPlatform.h" |
| 71 |
#endif |
| 72 |
#if defined(PLATFORM_BE500) |
| 73 |
#include "LagendaPlatform.h" |
| 74 |
#endif |
| 75 |
|
| 76 |
#endif |