mGNCS API Reference  v1.2.0
A new control set and a new framework for MiniGUI apps
mresmgr.h
Go to the documentation of this file.
1 
42 #ifndef _MGUI_RESMANAGER_H
43  #define _MGUI_RESMANAGER_H
44 
45 #ifdef __cplusplus
46 extern "C" {
47 #endif /* __cplusplus */
48 
58 typedef GHANDLE HPACKAGE;
59 
64 #define HPACKAGE_NULL ((GHANDLE)0)
65 
66 #define NCSRT_MASK 0x0FFF
67 
68 #define NCSRT_STRING 0x0001
69 #define NCSRT_TEXT 0x0002
70 #define NCSRT_IMAGE 0x0004
71 #define NCSRT_UI 0x0008
72 #define NCSRT_RDRSET 0x0010
73 #define NCSRT_RDR 0x0020
74 #define NCSRT_BINARY 0x0040
75 
80 #define NCSRM_SYSSTR_BASEID 1
81 
86 #define NCSRM_SYSSTR_MAXID 128
87 
92 #define NCSRM_SYSSTR_DEFRDR (NCSRT_STRING << 16) |NCSRM_SYSSTR_BASEID
93 
98 #define NCSRT_EXT_LEN 15
99 
104 #define NCSRM_VERSION_LEN 4
105 
110 #define NCSRM_VENDOR_LEN 16
111 
116 #define NCSRM_ENCODING_LEN 16
117 
119 typedef struct _NCSRM_HEADER
120 {
122  Uint32 magic;
123 
126 
129 
130  char char_encoding[NCSRM_ENCODING_LEN];
131 
134 
136  Uint32 nr_sect;
137 }NCSRM_HEADER;
138 
140 typedef struct _NCSRM_TYPEITEM
141 {
158  Uint32 type;
159 
161  Uint32 filename_id;
162 
166  Uint32 offset;
168 
170 typedef struct _NCSRM_IDITEM
171 {
173  Uint32 id;
174 
176  Uint32 filename_id;
177 
179  Uint32 offset;
180 
181 }NCSRM_IDITEM;
182 
184 typedef struct _NCSRM_WINHEADER
185 {
187  Uint32 class_id;
188 
190  Uint32 wnd_id;
191 
193  Uint32 serial_num;
194 
196  Uint32 caption_id;
197 
199  Uint32 rdr_id;
200 
201 
203  Sint32 x;
204 
206  Sint32 y;
207 
209  Uint32 w;
210 
212  Uint32 h;
213 
215  DWORD32 style;
216 
218  DWORD32 ex_style;
219 
221  DWORD32 bk_color;
222 
224  Uint32 font_id;
225 
228  Uint32 size;
229 
231  Uint32 offset_props;
232 
234  Uint32 offset_ctrls;
235 
237  Uint32 nr_props;
238 
240  Uint32 nr_ctrls;
241 
244 
246  Uint32 size_adddata;
248 
249 
251 typedef struct _NCSRM_SECTHEADER
252 {
254  Uint32 sect_size;
255 
257  Uint32 size_maps;
259 
261 typedef struct _NCSRM_DEFLOCALE_INFO
262 {
264  char language[4];
266  char country[4];
268 
270 typedef struct _NCSRM_LOCALEITEM
271 {
273  char language[4];
275  char country[4];
276 
278  Uint32 filename_id;
279 
281  Uint32 offset;
283 
285 typedef struct _NCSRM_INCORE_IMAGE
286 {
288  Uint32 size;
289 
291  char ext[NCSRT_EXT_LEN + 1];
292 
294  void *data;
296 
302 {
321 };
322 
326 typedef struct _NCSRM_RDRINFO
327 {
329  Uint32 id;
331  Uint32 value;
333 
337 typedef struct _NCSRM_RDRHEADER
338 {
340  Uint32 rdrname_id;
342  Uint32 clsname_id;
344 
348 typedef struct _NCSRM_PROP
349 {
351  Sint32 type;
353  Sint32 id;
355  DWORD32 value;
356 } NCSRM_PROP;
357 
367 MGNCS_EXPORT const char* ncsSetDefaultLocale (char* language, char* country);
368 
375 MGNCS_EXPORT const char* ncsGetDefaultLocale(void);
376 
385 MGNCS_EXPORT HPACKAGE ncsLoadResPackageFromFile (const char* fileName);
386 
393 #define ncsLoadResPackage ncsLoadResPackageFromFile
394 
401 MGNCS_EXPORT int ncsAddRefResPackage(HPACKAGE package);
402 
409 MGNCS_EXPORT void ncsUnloadResPackage (HPACKAGE package);
410 
422 MGNCS_EXPORT HPACKAGE ncsLoadResPackageFromMem (const void* mem, int size);
423 
433 MGNCS_EXPORT const char* ncsGetImageFileName (HPACKAGE package, Uint32 resId);
434 
447 MGNCS_EXPORT int ncsGetBitmap(HDC hdc, HPACKAGE package, Uint32 resId, PBITMAP pBitmap);
448 
460 MGNCS_EXPORT void ncsReleaseBitmap (PBITMAP pBitmap);
461 
474 MGNCS_EXPORT int ncsGetMyBitmap(HPACKAGE package, Uint32 resId,
475  PMYBITMAP myBmp, RGB* pal);
476 
487 MGNCS_EXPORT void ncsReleaseMyBitmap (PMYBITMAP myBmp);
488 
500 MGNCS_EXPORT const char* ncsGetString (HPACKAGE package, Uint32 resId);
501 
514 MGNCS_EXPORT BOOL ncsSetSysRdr(HPACKAGE package, Uint32 rdrSetId);
515 
529 MGNCS_EXPORT BOOL ncsSetWinRdr(HWND hWnd, HPACKAGE package, Uint32 rdrId);
530 
531 typedef struct _NCS_EVENT_HANDLER_INFO
532 {
533  int id;
534  NCS_EVENT_HANDLER *handler;
535 }NCS_EVENT_HANDLER_INFO;
536 
559 MGNCS_EXPORT mMainWnd* ncsCreateMainWindowIndirectFromID (HPACKAGE package,
560  Uint32 wndId, HWND owner, HICON hIcon,
561  HMENU hMenu, NCS_EVENT_HANDLER_INFO* handlers,
562  NCS_EVENT_CONNECT_INFO *connects,
563  DWORD user_data);
564 
565 #ifdef _MGNCSCTRL_DIALOGBOX
566 
587 MGNCS_EXPORT int ncsCreateModalDialogFromID (HPACKAGE package, Uint32 dlgId,
588  HWND owner, HICON hIcon, HMENU hMenu,
589  NCS_EVENT_HANDLER_INFO* handlers, NCS_EVENT_CONNECT_INFO *connects);
590 #endif
591 
592 
608 MGNCS_EXPORT BOOL ncsGetWndTemplFromID(HPACKAGE package, Uint32 wndId, \
609  NCS_MNWND_TEMPLATE * ptempl,
610  NCS_EVENT_HANDLER_INFO* handlers);
611 
624 MGNCS_EXPORT void ncsFreeWndTemplate(NCS_MNWND_TEMPLATE *ptempl);
625 
626 
628 #ifdef __cplusplus
629 }
630 #endif /* __cplusplus */
631 
632 #endif /* _MGUI_RESMANAGER_H */
Uint32 sect_size
Definition: mresmgr.h:254
MGNCS_EXPORT const char * ncsSetDefaultLocale(char *language, char *country)
Set default locale information.
Uint32 type
Definition: mresmgr.h:158
ncsRMRdrResType
Renderer resource type.
Definition: mresmgr.h:301
struct _NCSRM_LOCALEITEM NCSRM_LOCALEITEM
struct _NCSRM_SECTHEADER NCSRM_SECTHEADER
Sint32 type
Definition: mresmgr.h:351
Uint32 class_id
Definition: mresmgr.h:187
struct _NCSRM_RDRINFO NCSRM_RDRINFO
#define NCSRT_EXT_LEN
The maximum length of resource extension.
Definition: mresmgr.h:98
MGNCS_EXPORT BOOL ncsGetWndTemplFromID(HPACKAGE package, Uint32 wndId, NCS_MNWND_TEMPLATE *ptempl, NCS_EVENT_HANDLER_INFO *handlers)
get the window template from package
MGNCS_EXPORT const char * ncsGetString(HPACKAGE package, Uint32 resId)
Get string.
define the memders of mMainWnd, inherit from mPanel
struct _NCSRM_RDRHEADER NCSRM_RDRHEADER
Uint32 magic
Definition: mresmgr.h:122
MGNCS_EXPORT BOOL ncsSetSysRdr(HPACKAGE package, Uint32 rdrSetId)
Set system renderer.
struct _NCSRM_WINHEADER NCSRM_WINHEADER
MGNCS_EXPORT HPACKAGE ncsLoadResPackageFromMem(const void *mem, int size)
Load a resource package from memory. User get the information of incore resource package by getIncore...
Uint32 size_maps
Definition: mresmgr.h:257
#define NCSRM_VENDOR_LEN
The maximum length of vendor.
Definition: mresmgr.h:110
GHANDLE HPACKAGE
Handle to resource package.
Definition: mresmgr.h:58
Uint32 nr_ctrls
Definition: mresmgr.h:240
MGNCS_EXPORT HPACKAGE ncsLoadResPackageFromFile(const char *fileName)
Load a resource package from resource package file.
Uint32 caption_id
Definition: mresmgr.h:196
Uint32 offset_ctrls
Definition: mresmgr.h:234
Uint32 offset
Definition: mresmgr.h:166
Uint32 nr_props
Definition: mresmgr.h:237
Uint32 wnd_id
Definition: mresmgr.h:190
struct _NCSRM_INCORE_IMAGE NCSRM_INCORE_IMAGE
DWORD32 bk_color
Definition: mresmgr.h:221
MGNCS_EXPORT BOOL ncsSetWinRdr(HWND hWnd, HPACKAGE package, Uint32 rdrId)
Set window renderer.
char vendor[NCSRM_VENDOR_LEN]
Definition: mresmgr.h:133
Uint32 font_id
Definition: mresmgr.h:224
MGNCS_EXPORT const char * ncsGetImageFileName(HPACKAGE package, Uint32 resId)
Get the name of image file.
MGNCS_EXPORT void ncsReleaseMyBitmap(PMYBITMAP myBmp)
Releases a bitmap.
Uint32 rdrname_id
Definition: mresmgr.h:340
Uint32 offset
Definition: mresmgr.h:179
MGNCS_EXPORT void ncsFreeWndTemplate(NCS_MNWND_TEMPLATE *ptempl)
free the window template create by ncsGetWndTemplFromID
MGNCS_EXPORT int ncsGetMyBitmap(HPACKAGE package, Uint32 resId, PMYBITMAP myBmp, RGB *pal)
Load a device-independent bitmap from resource id.
struct _NCSRM_HEADER NCSRM_HEADER
#define NCSRM_ENCODING_LEN
The maximum length of encoding.
Definition: mresmgr.h:116
struct _NCSRM_DEFLOCALE_INFO NCSRM_DEFLOCALE_INFO
Uint32 filename_id
Definition: mresmgr.h:161
#define NCSRM_VERSION_LEN
The maximum length of resource package version.
Definition: mresmgr.h:104
Uint32 id
Definition: mresmgr.h:329
Uint32 filename_id
Definition: mresmgr.h:278
DWORD32 ex_style
Definition: mresmgr.h:218
struct _NCSRM_PROP NCSRM_PROP
struct _NCSRM_IDITEM NCSRM_IDITEM
Uint32 offset_adddata
Definition: mresmgr.h:243
DWORD32 value
Definition: mresmgr.h:355
Uint32 serial_num
Definition: mresmgr.h:193
struct _NCSRM_TYPEITEM NCSRM_TYPEITEM
Uint32 id
Definition: mresmgr.h:173
DWORD32 style
Definition: mresmgr.h:215
MGNCS_EXPORT mMainWnd * ncsCreateMainWindowIndirectFromID(HPACKAGE package, Uint32 wndId, HWND owner, HICON hIcon, HMENU hMenu, NCS_EVENT_HANDLER_INFO *handlers, NCS_EVENT_CONNECT_INFO *connects, DWORD user_data)
Create main window.
Uint32 clsname_id
Definition: mresmgr.h:342
Uint32 rdr_id
Definition: mresmgr.h:199
Sint32 id
Definition: mresmgr.h:353
MGNCS_EXPORT int ncsGetBitmap(HDC hdc, HPACKAGE package, Uint32 resId, PBITMAP pBitmap)
Load a device-dependent bitmap from resource id.
Uint32 nr_sect
Definition: mresmgr.h:136
Uint32 size_adddata
Definition: mresmgr.h:246
Uint32 offset_props
Definition: mresmgr.h:231
char format_version[NCSRM_VERSION_LEN]
Definition: mresmgr.h:128
MGNCS_EXPORT void ncsUnloadResPackage(HPACKAGE package)
Unload a resource package.
Uint32 value
Definition: mresmgr.h:331
Uint32 filename_id
Definition: mresmgr.h:176
char package_version[NCSRM_VERSION_LEN]
Definition: mresmgr.h:125
MGNCS_EXPORT const char * ncsGetDefaultLocale(void)
Get default locale information.
MGNCS_EXPORT void ncsReleaseBitmap(PBITMAP pBitmap)
Releases a bitmap.
MGNCS_EXPORT int ncsAddRefResPackage(HPACKAGE package)
add the reference count for resource package