mGNCS API Reference  v1.2.0
A new control set and a new framework for MiniGUI apps
Data Structures | Macros | Typedefs | Enumerations | Functions
Resource Managerment

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 mMainWndncsCreateMainWindowIndirectFromID (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...
 

Detailed Description

Macro Definition Documentation

#define HPACKAGE_NULL   ((GHANDLE)0)

Null resource package handle.

Definition at line 64 of file mresmgr.h.

#define ncsLoadResPackage   ncsLoadResPackageFromFile

An alias of ncsLoadResPackageFromFile.

See also
ncsLoadResPackageFromFile

Definition at line 393 of file mresmgr.h.

#define NCSRM_ENCODING_LEN   16

The maximum length of encoding.

Definition at line 116 of file mresmgr.h.

#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

The system string id of default renderer.

Definition at line 92 of file mresmgr.h.

#define NCSRM_VENDOR_LEN   16

The maximum length of vendor.

Definition at line 110 of file mresmgr.h.

#define NCSRM_VERSION_LEN   4

The maximum length of resource package version.

Definition at line 104 of file mresmgr.h.

#define NCSRT_EXT_LEN   15

The maximum length of resource extension.

Definition at line 98 of file mresmgr.h.

Typedef Documentation

typedef GHANDLE HPACKAGE

Handle to resource package.

Definition at line 58 of file mresmgr.h.

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.

Structure defines the header of incore image resource.

Structure defines locale item information.

typedef struct _NCSRM_PROP NCSRM_PROP

Strucutre defines properties information.

Strucutre defines the header of renderer information.

typedef struct _NCSRM_RDRINFO NCSRM_RDRINFO

Strucutre defines window renderer information.

Structure defines the header of section.

Structure defines resouce type information.

Structure defines UI resource header.

Enumeration Type Documentation

Renderer resource type.

Enumerator
NCSRM_RDRTYPE_COLOR 

Color

NCSRM_RDRTYPE_METRIC 

Metric

NCSRM_RDRTYPE_IMAGE 

Image

NCSRM_RDRTYPE_FONT 

Font

NCSRM_RDRTYPE_BINARY 

Binary

NCSRM_RDRTYPE_STRING 

String

NCSRM_RDRTYPE_FILE 

File

NCSRM_RDRTYPE_TEXT 

Text

NCSRM_RDRTYPE_MAX 

Maximum value

Definition at line 301 of file mresmgr.h.

Function Documentation

int ncsAddRefResPackage ( HPACKAGE  package)

add the reference count for resource package

See also
ncsLoadResPackage
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.

Parameters
packageThe handle of resource package.
wndIdThe UI resource id.
ownerThe handle of parent window.
hIconThe handle of icon.
hMenuThe handle of menu.
handlersThe handler set.
connectsThe handler set of connect
user_dataThe user_data
Returns
window class on success, otherwise NULL.
void ncsFreeWndTemplate ( NCS_MNWND_TEMPLATE ptempl)

free the window template create by ncsGetWndTemplFromID

free the content of window template, but don't free itself

Parameters
ptemplthe template to be free
Returns
void
See also
ncsGetWndTemplFromID
int ncsGetBitmap ( HDC  hdc,
HPACKAGE  package,
Uint32  resId,
PBITMAP  pBitmap 
)

Load a device-dependent bitmap from resource id.

Parameters
hdcThe device context.
packageThe handle of resource package.
resIdThe resource id.
pBitmapThe pointer to the BITMAP object.
Returns
0 on success, otherwise failure.
const char * ncsGetDefaultLocale ( void  )

Get default locale information.

Returns
Locale value.
const char * ncsGetImageFileName ( HPACKAGE  package,
Uint32  resId 
)

Get the name of image file.

Parameters
packageThe handle of resource package.
resIdThe resource id.
Returns
string on success, otherwise NULL.
int ncsGetMyBitmap ( HPACKAGE  package,
Uint32  resId,
PMYBITMAP  myBmp,
RGB *  pal 
)

Load a device-independent bitmap from resource id.

Parameters
packageThe handle of resource package.
resIdThe resource id.
myBmpThe pointer to the MYBITMAP object.
palThe palette will be returned through this pointer.
Returns
0 on success, otherwise failure.
const char * ncsGetString ( HPACKAGE  package,
Uint32  resId 
)

Get string.

This function gets string according to the specified id resId.

Parameters
packageThe handle of resource package.
resIdThe string resource id.
Returns
string on success, otherwise NULL.
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.

Parameters
packageThe handler of resource package
wndIdThe window template id in resource
ptemplThe template buffer
handlersThe event handlers of window
Returns
If success, return TRUE, or Failed return FALSE
HPACKAGE ncsLoadResPackageFromFile ( const char *  fileName)

Load a resource package from resource package file.

Parameters
fileNameThe name of resource package.
Returns
Nonzero on success, otherwize HPACKAGE_NULL.
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.

Parameters
memThe memory address.
sizeThe size of memory.
Returns
Nonzero on success, otherwize HPACKAGE_NULL.
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.

Parameters
pBitmapThe BITMAP object.
See also
ncsGetBitmapFromID
void ncsReleaseMyBitmap ( PMYBITMAP  myBmp)

Releases a bitmap.

This function releases the specified MYBITMAP object myBmp.

Parameters
myBmpThe MYBITMAP object.
See also
ncsGetMyBitmapFromID
const char * ncsSetDefaultLocale ( char *  language,
char *  country 
)

Set default locale information.

Parameters
languageThe system language environment.
countryThe country environment.
Returns
Locale value.
BOOL ncsSetSysRdr ( HPACKAGE  package,
Uint32  rdrSetId 
)

Set system renderer.

This function set system renderer according to the specified renderer set id rdrSetId.

Parameters
packageThe handle of resource package.
rdrSetIdThe renderer set resource id.
Returns
TRUE on success, otherwise FALSE.
BOOL ncsSetWinRdr ( HWND  hWnd,
HPACKAGE  package,
Uint32  rdrId 
)

Set window renderer.

This function set window renderer according to the specified renderer id rdrId.

Parameters
hWndThe handle of window.
packageThe handle of resource package.
rdrIdThe renderer resource id.
Returns
TRUE on success, otherwise FALSE.
void ncsUnloadResPackage ( HPACKAGE  package)

Unload a resource package.

Parameters
packageThe handle of resource package.