mresmgr.h
Go to the documentation of this file.00001
00026 #ifndef _MGUI_RESMANAGER_H
00027 #define _MGUI_RESMANAGER_H
00028
00029 #ifdef __cplusplus
00030 extern "C" {
00031 #endif
00032
00042 typedef unsigned int HPACKAGE;
00043
00048 #define HPACKAGE_NULL 0
00049
00050 #define NCSRT_MASK 0x0FFF
00051
00052 #define NCSRT_STRING 0x0001
00053 #define NCSRT_TEXT 0x0002
00054 #define NCSRT_IMAGE 0x0004
00055 #define NCSRT_UI 0x0008
00056 #define NCSRT_RDRSET 0x0010
00057 #define NCSRT_RDR 0x0020
00058 #define NCSRT_BINARY 0x0040
00059
00064 #define NCSRM_SYSSTR_BASEID 1
00065
00070 #define NCSRM_SYSSTR_MAXID 128
00071
00076 #define NCSRM_SYSSTR_DEFRDR (NCSRT_STRING << 16) |NCSRM_SYSSTR_BASEID
00077
00082 #define NCSRT_EXT_LEN 15
00083
00088 #define NCSRM_VERSION_LEN 4
00089
00094 #define NCSRM_VENDOR_LEN 16
00095
00100 #define NCSRM_ENCODING_LEN 16
00101
00103 typedef struct _NCSRM_HEADER
00104 {
00106 Uint32 magic;
00107
00109 char package_version[NCSRM_VERSION_LEN];
00110
00112 char format_version[NCSRM_VERSION_LEN];
00113
00114 char char_encoding[NCSRM_ENCODING_LEN];
00115
00117 char vendor[NCSRM_VENDOR_LEN];
00118
00120 Uint32 nr_sect;
00121 }NCSRM_HEADER;
00122
00124 typedef struct _NCSRM_TYPEITEM
00125 {
00142 Uint32 type;
00143
00145 Uint32 filename_id;
00146
00150 Uint32 offset;
00151 }NCSRM_TYPEITEM;
00152
00154 typedef struct _NCSRM_IDITEM
00155 {
00157 Uint32 id;
00158
00160 Uint32 filename_id;
00161
00163 Uint32 offset;
00164
00165 }NCSRM_IDITEM;
00166
00168 typedef struct _NCSRM_WINHEADER
00169 {
00171 Uint32 class_id;
00172
00174 Uint32 wnd_id;
00175
00177 Uint32 serial_num;
00178
00180 Uint32 caption_id;
00181
00183 Uint32 rdr_id;
00184
00185
00187 Sint32 x;
00188
00190 Sint32 y;
00191
00193 Uint32 w;
00194
00196 Uint32 h;
00197
00199 DWORD style;
00200
00202 DWORD ex_style;
00203
00205 DWORD bk_color;
00206
00208 Uint32 font_id;
00209
00212 Uint32 size;
00213
00215 Uint32 offset_props;
00216
00218 Uint32 offset_ctrls;
00219
00221 Uint32 nr_props;
00222
00224 Uint32 nr_ctrls;
00225
00227 Uint32 offset_adddata;
00228
00230 Uint32 size_adddata;
00231 }NCSRM_WINHEADER;
00232
00233
00235 typedef struct _NCSRM_SECTHEADER
00236 {
00238 Uint32 sect_size;
00239
00241 Uint32 size_maps;
00242 }NCSRM_SECTHEADER;
00243
00245 typedef struct _NCSRM_DEFLOCALE_INFO
00246 {
00248 char language[4];
00250 char country[4];
00251 }NCSRM_DEFLOCALE_INFO;
00252
00254 typedef struct _NCSRM_LOCALEITEM
00255 {
00257 char language[4];
00259 char country[4];
00260
00262 Uint32 filename_id;
00263
00265 Uint32 offset;
00266 }NCSRM_LOCALEITEM;
00267
00269 typedef struct _NCSRM_INCORE_IMAGE
00270 {
00272 int size;
00273
00275 char ext[NCSRT_EXT_LEN + 1];
00276
00278 void *data;
00279 }NCSRM_INCORE_IMAGE;
00280
00285 enum ncsRMRdrResType
00286 {
00288 NCSRM_RDRTYPE_COLOR = 0,
00290 NCSRM_RDRTYPE_METRIC,
00292 NCSRM_RDRTYPE_IMAGE,
00294 NCSRM_RDRTYPE_FONT,
00296 NCSRM_RDRTYPE_BINARY,
00298 NCSRM_RDRTYPE_STRING,
00300 NCSRM_RDRTYPE_FILE,
00302 NCSRM_RDRTYPE_TEXT,
00304 NCSRM_RDRTYPE_MAX,
00305 };
00306
00310 typedef struct _NCSRM_RDRINFO
00311 {
00313 Uint32 id;
00315 Uint32 value;
00316 }NCSRM_RDRINFO;
00317
00321 typedef struct _NCSRM_RDRHEADER
00322 {
00324 Uint32 rdrname_id;
00326 Uint32 clsname_id;
00327 }NCSRM_RDRHEADER;
00328
00332 typedef struct _NCSRM_PROP
00333 {
00335 Sint32 type;
00337 Sint32 id;
00339 DWORD value;
00340 } NCSRM_PROP;
00341
00351 MGNCS_EXPORT const char* ncsSetDefaultLocale (char* language, char* country);
00352
00359 MGNCS_EXPORT const char* ncsGetDefaultLocale(void);
00360
00369 MGNCS_EXPORT HPACKAGE ncsLoadResPackageFromFile (const char* fileName);
00370
00377 #define ncsLoadResPackage ncsLoadResPackageFromFile
00378
00385 MGNCS_EXPORT int ncsAddRefResPackage(HPACKAGE package);
00386
00393 MGNCS_EXPORT void ncsUnloadResPackage (HPACKAGE package);
00394
00406 MGNCS_EXPORT HPACKAGE ncsLoadResPackageFromMem (const void* mem, int size);
00407
00417 MGNCS_EXPORT const char* ncsGetImageFileName (HPACKAGE package, Uint32 resId);
00418
00431 MGNCS_EXPORT int ncsGetBitmap(HDC hdc, HPACKAGE package, Uint32 resId, PBITMAP pBitmap);
00432
00444 MGNCS_EXPORT void ncsReleaseBitmap (PBITMAP pBitmap);
00445
00458 MGNCS_EXPORT int ncsGetMyBitmap(HPACKAGE package, Uint32 resId,
00459 PMYBITMAP myBmp, RGB* pal);
00460
00471 MGNCS_EXPORT void ncsReleaseMyBitmap (PMYBITMAP myBmp);
00472
00484 MGNCS_EXPORT const char* ncsGetString (HPACKAGE package, Uint32 resId);
00485
00498 MGNCS_EXPORT BOOL ncsSetSysRdr(HPACKAGE package, Uint32 rdrSetId);
00499
00513 MGNCS_EXPORT BOOL ncsSetWinRdr(HWND hWnd, HPACKAGE package, Uint32 rdrId);
00514
00515 typedef struct _NCS_EVENT_HANDLER_INFO
00516 {
00517 int id;
00518 NCS_EVENT_HANDLER *handler;
00519 }NCS_EVENT_HANDLER_INFO;
00520
00543 MGNCS_EXPORT mMainWnd* ncsCreateMainWindowIndirectFromID (HPACKAGE package,
00544 Uint32 wndId, HWND owner, HICON hIcon,
00545 HMENU hMenu, NCS_EVENT_HANDLER_INFO* handlers,
00546 NCS_EVENT_CONNECT_INFO *connects,
00547 DWORD user_data);
00548
00549 #ifdef _MGNCSCTRL_DIALOGBOX
00550
00571 MGNCS_EXPORT int ncsCreateModalDialogFromID (HPACKAGE package, Uint32 dlgId,
00572 HWND owner, HICON hIcon, HMENU hMenu,
00573 NCS_EVENT_HANDLER_INFO* handlers, NCS_EVENT_CONNECT_INFO *connects);
00574 #endif
00575
00576
00592 MGNCS_EXPORT BOOL ncsGetWndTemplFromID(HPACKAGE package, Uint32 wndId, \
00593 NCS_MNWND_TEMPLATE * ptempl,
00594 NCS_EVENT_HANDLER_INFO* handlers);
00595
00608 MGNCS_EXPORT void ncsFreeWndTemplate(NCS_MNWND_TEMPLATE *ptempl);
00609
00610
00612 #ifdef __cplusplus
00613 }
00614 #endif
00615
00616 #endif