mGNCS API Reference
v1.2.0
A new control set and a new framework for MiniGUI apps
|
Data Structures | |
struct | _NCSRM_HEADER |
struct | _NCSRM_TYPEITEM |
struct | _NCSRM_IDITEM |
struct | _NCSRM_WINHEADER |
struct | _NCSRM_SECTHEADER |
struct | _NCSRM_DEFLOCALE_INFO |
struct | _NCSRM_LOCALEITEM |
struct | _NCSRM_INCORE_IMAGE |
struct | _NCSRM_RDRINFO |
struct | _NCSRM_RDRHEADER |
struct | _NCSRM_PROP |
Macros | |
#define | HPACKAGE_NULL ((GHANDLE)0) |
Null resource package handle. More... | |
#define | NCSRM_SYSSTR_BASEID 1 |
Base value of system string id. More... | |
#define | NCSRM_SYSSTR_DEFRDR (NCSRT_STRING << 16) |NCSRM_SYSSTR_BASEID |
The system string id of default renderer. More... | |
#define | NCSRT_EXT_LEN 15 |
The maximum length of resource extension. More... | |
#define | NCSRM_VERSION_LEN 4 |
The maximum length of resource package version. More... | |
#define | NCSRM_VENDOR_LEN 16 |
The maximum length of vendor. More... | |
#define | NCSRM_ENCODING_LEN 16 |
The maximum length of encoding. More... | |
#define | ncsLoadResPackage ncsLoadResPackageFromFile |
An alias of ncsLoadResPackageFromFile. More... | |
Typedefs | |
typedef GHANDLE | HPACKAGE |
Handle to resource package. More... | |
typedef struct _NCSRM_HEADER | NCSRM_HEADER |
typedef struct _NCSRM_TYPEITEM | NCSRM_TYPEITEM |
typedef struct _NCSRM_IDITEM | NCSRM_IDITEM |
typedef struct _NCSRM_WINHEADER | NCSRM_WINHEADER |
typedef struct _NCSRM_SECTHEADER | NCSRM_SECTHEADER |
typedef struct _NCSRM_DEFLOCALE_INFO | NCSRM_DEFLOCALE_INFO |
typedef struct _NCSRM_LOCALEITEM | NCSRM_LOCALEITEM |
typedef struct _NCSRM_INCORE_IMAGE | NCSRM_INCORE_IMAGE |
typedef struct _NCSRM_RDRINFO | NCSRM_RDRINFO |
typedef struct _NCSRM_RDRHEADER | NCSRM_RDRHEADER |
typedef struct _NCSRM_PROP | NCSRM_PROP |
Enumerations |
Functions | |
MGNCS_EXPORT const char * | ncsSetDefaultLocale (char *language, char *country) |
Set default locale information. More... | |
MGNCS_EXPORT const char * | ncsGetDefaultLocale (void) |
Get default locale information. More... | |
MGNCS_EXPORT HPACKAGE | ncsLoadResPackageFromFile (const char *fileName) |
Load a resource package from resource package file. More... | |
MGNCS_EXPORT int | ncsAddRefResPackage (HPACKAGE package) |
add the reference count for resource package More... | |
MGNCS_EXPORT void | ncsUnloadResPackage (HPACKAGE package) |
Unload a resource package. More... | |
MGNCS_EXPORT HPACKAGE | ncsLoadResPackageFromMem (const void *mem, int size) |
Load a resource package from memory. User get the information of incore resource package by getIncoreResPackInfo firstly, then call this function to load resource package. More... | |
MGNCS_EXPORT const char * | ncsGetImageFileName (HPACKAGE package, Uint32 resId) |
Get the name of image file. More... | |
MGNCS_EXPORT int | ncsGetBitmap (HDC hdc, HPACKAGE package, Uint32 resId, PBITMAP pBitmap) |
Load a device-dependent bitmap from resource id. More... | |
MGNCS_EXPORT void | ncsReleaseBitmap (PBITMAP pBitmap) |
Releases a bitmap. More... | |
MGNCS_EXPORT int | ncsGetMyBitmap (HPACKAGE package, Uint32 resId, PMYBITMAP myBmp, RGB *pal) |
Load a device-independent bitmap from resource id. More... | |
MGNCS_EXPORT void | ncsReleaseMyBitmap (PMYBITMAP myBmp) |
Releases a bitmap. More... | |
MGNCS_EXPORT const char * | ncsGetString (HPACKAGE package, Uint32 resId) |
Get string. More... | |
MGNCS_EXPORT BOOL | ncsSetSysRdr (HPACKAGE package, Uint32 rdrSetId) |
Set system renderer. More... | |
MGNCS_EXPORT BOOL | ncsSetWinRdr (HWND hWnd, HPACKAGE package, Uint32 rdrId) |
Set window renderer. More... | |
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. More... | |
MGNCS_EXPORT BOOL | ncsGetWndTemplFromID (HPACKAGE package, Uint32 wndId, NCS_MNWND_TEMPLATE *ptempl, NCS_EVENT_HANDLER_INFO *handlers) |
get the window template from package More... | |
MGNCS_EXPORT void | ncsFreeWndTemplate (NCS_MNWND_TEMPLATE *ptempl) |
free the window template create by ncsGetWndTemplFromID More... | |
#define HPACKAGE_NULL ((GHANDLE)0) |
#define ncsLoadResPackage ncsLoadResPackageFromFile |
An alias of ncsLoadResPackageFromFile.
#define NCSRM_ENCODING_LEN 16 |
#define NCSRM_SYSSTR_BASEID 1 |
Base value of system string id.
Maximum value of system string id.
#define NCSRM_SYSSTR_DEFRDR (NCSRT_STRING << 16) |NCSRM_SYSSTR_BASEID |
#define NCSRM_VERSION_LEN 4 |
#define NCSRT_EXT_LEN 15 |
typedef struct _NCSRM_DEFLOCALE_INFO NCSRM_DEFLOCALE_INFO |
Structure defines default locale information.
typedef struct _NCSRM_HEADER NCSRM_HEADER |
Structure defines MiniGUI resource package header.
typedef struct _NCSRM_IDITEM NCSRM_IDITEM |
Structure defines resource ID item information.
typedef struct _NCSRM_INCORE_IMAGE NCSRM_INCORE_IMAGE |
Structure defines the header of incore image resource.
typedef struct _NCSRM_LOCALEITEM NCSRM_LOCALEITEM |
Structure defines locale item information.
typedef struct _NCSRM_PROP NCSRM_PROP |
Strucutre defines properties information.
typedef struct _NCSRM_RDRHEADER NCSRM_RDRHEADER |
Strucutre defines the header of renderer information.
typedef struct _NCSRM_RDRINFO NCSRM_RDRINFO |
Strucutre defines window renderer information.
typedef struct _NCSRM_SECTHEADER NCSRM_SECTHEADER |
Structure defines the header of section.
typedef struct _NCSRM_TYPEITEM NCSRM_TYPEITEM |
Structure defines resouce type information.
typedef struct _NCSRM_WINHEADER NCSRM_WINHEADER |
Structure defines UI resource header.
enum ncsRMRdrResType |
int ncsAddRefResPackage | ( | HPACKAGE | package | ) |
add the reference count for resource package
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.
This function create main window according to UI resource ID, parent handle, and other informations.
package | The handle of resource package. |
wndId | The UI resource id. |
owner | The handle of parent window. |
hIcon | The handle of icon. |
hMenu | The handle of menu. |
handlers | The handler set. |
connects | The handler set of connect |
user_data | The user_data |
void ncsFreeWndTemplate | ( | NCS_MNWND_TEMPLATE * | ptempl | ) |
free the window template create by ncsGetWndTemplFromID
free the content of window template, but don't free itself
ptempl | the template to be free |
int ncsGetBitmap | ( | HDC | hdc, |
HPACKAGE | package, | ||
Uint32 | resId, | ||
PBITMAP | pBitmap | ||
) |
Load a device-dependent bitmap from resource id.
hdc | The device context. |
package | The handle of resource package. |
resId | The resource id. |
pBitmap | The pointer to the BITMAP object. |
const char * ncsGetDefaultLocale | ( | void | ) |
Get default locale information.
const char * ncsGetImageFileName | ( | HPACKAGE | package, |
Uint32 | resId | ||
) |
Get the name of image file.
package | The handle of resource package. |
resId | The resource id. |
int ncsGetMyBitmap | ( | HPACKAGE | package, |
Uint32 | resId, | ||
PMYBITMAP | myBmp, | ||
RGB * | pal | ||
) |
Load a device-independent bitmap from resource id.
package | The handle of resource package. |
resId | The resource id. |
myBmp | The pointer to the MYBITMAP object. |
pal | The palette will be returned through this pointer. |
const char * ncsGetString | ( | HPACKAGE | package, |
Uint32 | resId | ||
) |
Get string.
This function gets string according to the specified id resId.
package | The handle of resource package. |
resId | The string resource id. |
BOOL ncsGetWndTemplFromID | ( | HPACKAGE | package, |
Uint32 | wndId, | ||
NCS_MNWND_TEMPLATE * | ptempl, | ||
NCS_EVENT_HANDLER_INFO * | handlers | ||
) |
get the window template from package
This function get the info from package. It will create the memory to save the children controls and properties.
package | The handler of resource package |
wndId | The window template id in resource |
ptempl | The template buffer |
handlers | The event handlers of window |
HPACKAGE ncsLoadResPackageFromFile | ( | const char * | fileName | ) |
Load a resource package from resource package file.
fileName | The name of resource package. |
HPACKAGE ncsLoadResPackageFromMem | ( | const void * | mem, |
int | size | ||
) |
Load a resource package from memory. User get the information of incore resource package by getIncoreResPackInfo firstly, then call this function to load resource package.
mem | The memory address. |
size | The size of memory. |
void ncsReleaseBitmap | ( | PBITMAP | pBitmap | ) |
Releases a bitmap.
This function unloads the specified bitmap pBitmap. It will free the private pixel format and the bits of the bitmap.
pBitmap | The BITMAP object. |
void ncsReleaseMyBitmap | ( | PMYBITMAP | myBmp | ) |
Releases a bitmap.
This function releases the specified MYBITMAP object myBmp.
myBmp | The MYBITMAP object. |
const char * ncsSetDefaultLocale | ( | char * | language, |
char * | country | ||
) |
Set default locale information.
language | The system language environment. |
country | The country environment. |
BOOL ncsSetSysRdr | ( | HPACKAGE | package, |
Uint32 | rdrSetId | ||
) |
Set system renderer.
This function set system renderer according to the specified renderer set id rdrSetId.
package | The handle of resource package. |
rdrSetId | The renderer set resource id. |
BOOL ncsSetWinRdr | ( | HWND | hWnd, |
HPACKAGE | package, | ||
Uint32 | rdrId | ||
) |
Set window renderer.
This function set window renderer according to the specified renderer id rdrId.
hWnd | The handle of window. |
package | The handle of resource package. |
rdrId | The renderer resource id. |
void ncsUnloadResPackage | ( | HPACKAGE | package | ) |
Unload a resource package.
package | The handle of resource package. |