MiniGUI API Reference (MiniGUI-Processes)  v5.0.6
A mature and proven cross-platform GUI system for embedded and smart IoT devices
Functions

A client in MiniGUI-Processes can create a new layer or join an existed layer. More...

Functions

MG_EXPORT GHANDLE GUIAPI JoinLayer (const char *layer_name, const char *client_name, int max_nr_highers, int max_nr_normals)
 Joins to a layer. More...
 
MG_EXPORT GHANDLE GUIAPI GetLayerInfo (const char *layer_name, int *nr_clients, BOOL *is_topmost, int *cli_active)
 Get information of a layer by a client. More...
 
MG_EXPORT BOOL GUIAPI SetTopmostLayer (BOOL handle_name, GHANDLE layer_handle, const char *layer_name)
 Brings a layer to be the topmost one. More...
 
MG_EXPORT BOOL GUIAPI DeleteLayer (BOOL handle_name, GHANDLE layer_handle, const char *layer_name)
 Deletes a specific layer. More...
 
MG_EXPORT BOOL GUIAPI MoveToLayer (BOOL handle_name, GHANDLE layer_handle, const char *layer_name)
 Move current client to the specified layer. More...
 

Detailed Description

A client in MiniGUI-Processes can create a new layer or join an existed layer.

Example:

/*
* This program tries to create a new layer named "vcongui" if
* there is no such layer. If there is already a layer named "vcongui",
* this program brings the layer to be the topmost one.
*/
int MiniGUIMain (int args, const char* arg[])
{
GHANDLE layer;
layer = GetLayerInfo ("vcongui", NULL, NULL, NULL);
if (layer != INV_LAYER_HANDLE) {
return 0;
}
if (JoinLayer ("vcongui", "vcongui", 0, 0) == INV_LAYER_HANDLE) {
printf ("JoinLayer: invalid layer handle.\n");
return 1;
}
...
return 0;
}

Function Documentation

◆ DeleteLayer()

BOOL GUIAPI DeleteLayer ( BOOL  handle_name,
GHANDLE  layer_handle,
const char *  layer_name 
)

Deletes a specific layer.

Parameters
handle_nameThe way specifing the layer; TRUE for handle of the layer, FALSE for name.
layer_handleThe handle to the layer.
layer_nameThe name of the layer. You can use NAME_SELF_LAYER to specify the layer to which the calling client belongs.
Returns
TRUE for success, FALSE on error.
Note
Only call this function in clients of MiniGUI-Processes.
See also
JoinLayer

◆ GetLayerInfo()

GHANDLE GUIAPI GetLayerInfo ( const char *  layer_name,
int *  nr_clients,
BOOL is_topmost,
int *  cli_active 
)

Get information of a layer by a client.

You can get the information of a layer through this function. The information will be returned through the pointer arguments if the specific pointer is not NULL.

Parameters
layer_nameThe name of the layer. You can use NAME_SELF_LAYER to specify the layer the calling client belongs to.
nr_clientsThe number of clients in the layer will be returned through this pointer.
is_topmostA boolean which indicates whether the layer is the topmost layer will be returned.
cli_activeThe identifier of the active client in the layer.
Returns
Returns the handle to the layer on success, INV_LAYER_HANDLE on error.
Note
Only call this function in clients of MiniGUI-Processes.
See also
JoinLayer

◆ JoinLayer()

GHANDLE GUIAPI JoinLayer ( const char *  layer_name,
const char *  client_name,
int  max_nr_highers,
int  max_nr_normals 
)

Joins to a layer.

This function should be called by clients before calling any other MiniGUI functions. You can call GetLayerInfo to get the layer information. If the layer to be joined does not exist, the server, i.e. mginit, will try to create a new one. If you passed a NULL pointer or a null string for layer_name, the client will join to the default layer.

If the client want to create a new layer, you should specify the maximal number of z-nodes in the higher level (max_nr_highers) and the maximal number of z-nodes in the normal level (max_nr_normals) of the new layer. Passing zero to max_nr_highers and max_nr_normals will use the default values, and the default values are specified by ServerStartup.

Note that the server will create a default layer named "mginit".

Parameters
layer_nameThe name of the layer. You can use NAME_TOPMOST_LAYER to specify the current topmost layer.
client_nameThe name of the client.
max_nr_highersThe maximal number of z-nodes in the higher level of the new layer.
max_nr_normalsThe maximal number of z-nodes in the normal level of the new layer.
Returns
The handle to the layer on success, INV_LAYER_HANDLE on error.
Note
Only call this function in clients of MiniGUI-Processes.
See also
GetLayerInfo, ServerStartup, ServerCreateLayer

◆ MoveToLayer()

BOOL GUIAPI MoveToLayer ( BOOL  handle_name,
GHANDLE  layer_handle,
const char *  layer_name 
)

Move current client to the specified layer.

This function moves the current client to other layer specified handle or layer_name.

Parameters
handle_nameThe way specifing the layer; TRUE for handle of the layer, FALSE for name.
layer_handleThe handle to the layer.
layer_nameThe name of the layer.
Returns
TRUE on success, otherwise FALSE.
Note
Only one client which has no any window can be moved.
The client which created a fixed main window (a main window acts as the screen lock, the docker, or the launcher) will be moved to the topmost layer automatically.
See also
ServerMoveClientToLayer

Since 5.0.0.

◆ SetTopmostLayer()

BOOL GUIAPI SetTopmostLayer ( BOOL  handle_name,
GHANDLE  layer_handle,
const char *  layer_name 
)

Brings a layer to be the topmost one.

This function brings the specified layer handle to be the topmost layer.

Parameters
handle_nameThe way specifing the layer; TRUE for handle of the layer, FALSE for name.
layer_handleThe handle to the layer.
layer_nameThe name of the layer. You can use NAME_SELF_LAYER to specify the layer to which the calling client belongs.
Returns
TRUE on success, otherwise FALSE.
Note
Only call this function in clients of MiniGUI-Processes.
NULL
#define NULL
A value indicates null pointer.
Definition: common.h:369
JoinLayer
MG_EXPORT GHANDLE GUIAPI JoinLayer(const char *layer_name, const char *client_name, int max_nr_highers, int max_nr_normals)
Joins to a layer.
GHANDLE
PVOID GHANDLE
General handle.
Definition: common.h:402
MiniGUIMain
#define MiniGUIMain
The main entry of a MiniGUI application.
Definition: minigui.h:2540
GetLayerInfo
MG_EXPORT GHANDLE GUIAPI GetLayerInfo(const char *layer_name, int *nr_clients, BOOL *is_topmost, int *cli_active)
Get information of a layer by a client.
INV_LAYER_HANDLE
#define INV_LAYER_HANDLE
Invalid handle value of the layer.
Definition: minigui.h:271
SetTopmostLayer
MG_EXPORT BOOL GUIAPI SetTopmostLayer(BOOL handle_name, GHANDLE layer_handle, const char *layer_name)
Brings a layer to be the topmost one.
TRUE
#define TRUE
TRUE value, defined as 1 by MiniGUI.
Definition: common.h:358