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

MiniGUI provides some server-only functions for you to create a customized server for MiniGUI-Processes, i.e. mginit. More...

Data Structures

struct  _ZNODEINFO
 
struct  _ZNODEHEADER
 
struct  _CompositorOps
 
struct  _CombParamsFallback
 

Typedefs

typedef int(* ON_LOCK_CLIENT_REQ) (void)
 Type of client request lock callback. More...
 
typedef int(* ON_TRYLOCK_CLIENT_REQ) (void)
 Type of client request lock callback. More...
 
typedef void(* ON_UNLOCK_CLIENT_REQ) (void)
 Type of client request unlock callback. More...
 
typedef void(* ON_NEW_DEL_CLIENT) (int op, int cli)
 Type of client event callback. More...
 
typedef void(* ON_CHANGE_LAYER) (int op, MG_Layer *layer, MG_Client *client)
 Type of layer change event callback. More...
 
typedef void(* ON_ZNODE_OPERATION) (int op, int cli, int idx_znode)
 Type of z-node operation callback. More...
 
typedef struct _ZNODEINFO ZNODEINFO
 
typedef struct _ZNODEHEADER ZNODEHEADER
 
typedef struct _CompositorOps CompositorOps
 
typedef struct _CombParamsFallback COMBPARAMS_FALLBACK
 

Functions

MG_EXPORT BOOL GUIAPI ServerStartup (int nr_globals, int def_nr_highers, int def_nr_normals)
 Initializes the server of MiniGUI-Processes. More...
 
MG_EXPORT MG_Layer *GUIAPI ServerCreateLayer (const char *layer_name, int max_nr_highers, int max_nr_normals)
 Create a new layer from the server. More...
 
MG_EXPORT BOOL GUIAPI ServerSetTopmostLayer (MG_Layer *layer)
 Set topmost layer from the server. More...
 
MG_EXPORT BOOL GUIAPI ServerDeleteLayer (MG_Layer *layer)
 Delete a layer from the server. More...
 
MG_EXPORT int GUIAPI ServerGetTopmostZNodeOfType (MG_Layer *layer, DWORD type, int *cli)
 Get the topmost z-node in the specified layer for the specific window type from the server. More...
 
MG_EXPORT int GUIAPI ServerGetNextZNode (MG_Layer *layer, int idx_znode, int *cli)
 Get the next z-node in the specified layer from the server. More...
 
MG_EXPORT int GUIAPI ServerGetPrevZNode (MG_Layer *layer, int idx_znode, int *cli)
 Get the previous z-node in the specified layer from the server. More...
 
MG_EXPORT BOOL GUIAPI ServerGetZNodeInfo (MG_Layer *layer, int idx_znode, ZNODEINFO *znode_info)
 Get the z-node information in the specified layer from the server. More...
 
const MG_EXPORT ZNODEHEADER *GUIAPI ServerGetWinZNodeHeader (MG_Layer *layer, int idx_znode, void **priv_data, BOOL lock)
 Get the pointer to the z-node header of a specific window in the specified layer. More...
 
MG_EXPORT BOOL GUIAPI ServerReleaseWinZNodeHeader (MG_Layer *layer, int idx_znode)
 Release z-node header of a specific window in the specified layer. More...
 
MG_EXPORT int GUIAPI ServerGetPopupMenusCount (void)
 Get the number of popup menus shown on the screen. More...
 
MG_EXPORT BOOL GUIAPI ServerReleasePopupMenuZNodeHeader (int idx_znode)
 Release the lock of the z-node header of the specific popup menu. More...
 
MG_EXPORT BOOL GUIAPI ServerGetWinZNodeRegion (MG_Layer *layer, int idx_znode, DWORD rgn_ops, CLIPRGN *dst_rgn)
 Get the z-node region of a specific window in the specified layer. More...
 
MG_EXPORT BOOL GUIAPI ServerGetPopupMenuZNodeRegion (int idx_znode, DWORD rgn_ops, CLIPRGN *dst_rgn)
 Get the z-node region of a specific popup menu in the current layer. More...
 
MG_EXPORT BOOL GUIAPI ServerSetWinZNodePrivateData (MG_Layer *layer, int idx_znode, void *priv_data)
 Set the private data of the z-node of a specific window in the specified layer. More...
 
MG_EXPORT BOOL GUIAPI ServerSetPopupMenuZNodePrivateData (int idx_znode, void *priv_data)
 Set the private data of the z-node of the specific popup menu. More...
 
MG_EXPORT BOOL GUIAPI ServerDoZNodeOperation (MG_Layer *layer, int idx_znode, int op_code, void *op_data, BOOL notify)
 Does an operation on the z-node in the specified layer from the server. More...
 
MG_EXPORT BOOL GUIAPI ServerMoveClientToLayer (int cli, MG_Layer *dst_layer)
 Move a client to the specified layer. More...
 
MG_EXPORT int GUIAPI GetClientByPID (int pid)
 Returns the client identifier from PID of a client. More...
 
MG_EXPORT BOOL GUIAPI SetTopmostClient (int cli)
 Set topmost layer by a client identifier. More...
 
MG_EXPORT void GUIAPI DisableClientsOutput (void)
 Disable all clients output. More...
 
MG_EXPORT void GUIAPI UpdateTopmostLayer (const RECT *dirty_rc)
 Update topmost layer. More...
 
const MG_EXPORT CompositorOps *GUIAPI ServerGetCompositorOps (const char *name)
 Get the operations of a specific compositor. More...
 
MG_EXPORT BOOL GUIAPI ServerRegisterCompositor (const char *name, const CompositorOps *ops)
 Register a new compositor. More...
 
MG_EXPORT BOOL GUIAPI ServerUnregisterCompositor (const char *name)
 Un-register a new compositor. More...
 
const MG_EXPORT CompositorOps *GUIAPI ServerSelectCompositor (const char *name, CompositorCtxt **ctxt)
 Select a compositor as the current compositor. More...
 
const MG_EXPORT char *GUIAPI ServerGetCurrentCompositor (const CompositorOps **ops, CompositorCtxt **ctxt)
 Get the name and the context of the current compositor. More...
 
const CompositorOps__ex_compositor_get (const char *name, const CompositorOps *fallback_ops, int *version)
 

Variables

MG_EXPORT ON_LOCK_CLIENT_REQ OnLockClientReq
 Set to a function to lock a client request. More...
 
MG_EXPORT ON_TRYLOCK_CLIENT_REQ OnTrylockClientReq
 Set to a function to lock a client request. More...
 
MG_EXPORT ON_UNLOCK_CLIENT_REQ OnUnlockClientReq
 Set to a function to unlock a client request. More...
 
MG_EXPORT ON_NEW_DEL_CLIENT OnNewDelClient
 Set to a function to handle a comming in (going away) connection of client. More...
 
MG_EXPORT ON_CHANGE_LAYER OnChangeLayer
 Set to a function to handle events of layers. More...
 
MG_EXPORT ON_ZNODE_OPERATION OnZNodeOperation
 Set to a function to handle events of z-node. More...
 

Detailed Description

MiniGUI provides some server-only functions for you to create a customized server for MiniGUI-Processes, i.e. mginit.

Example:

/*
* This program which should be named "mginit" calls "ServerStartup"
* to start the server of MiniGUI-Processes.
*/
int MiniGUIMain (int args, const char* arg[])
{
if (!ServerStartup (0, 0, 0)) {
fprintf (stderr, "Can not the MiniGUI server: mginit.\n");
return 1;
}
if (!InitMiniGUIExt ()) {
fprintf (stderr, "Can not init mgext library.\n");
return 1;
}
/* Enter message loop */
while (GetMessage (&msg, HWND_DESKTOP)) {
}
MiniGUIExtCleanUp ();
return 0;
}

Typedef Documentation

◆ COMBPARAMS_FALLBACK

The combining parameters for the callback compositor.

◆ CompositorOps

typedef struct _CompositorOps CompositorOps

The struct type defines the operations for a compositor.

◆ ON_CHANGE_LAYER

typedef void(* ON_CHANGE_LAYER)(int op, MG_Layer *layer, MG_Client *client)

Type of layer change event callback.

See also
OnNewDelClient, OnChangeLayer

Definition at line 685 of file minigui.h.

◆ ON_LOCK_CLIENT_REQ

typedef void(* ON_LOCK_CLIENT_REQ)(void)

Type of client request lock callback.

See also
OnTrylockClientReq, OnLockClientReq, OnUnlockClientReq

Definition at line 613 of file minigui.h.

◆ ON_NEW_DEL_CLIENT

typedef void(* ON_NEW_DEL_CLIENT)(int op, int cli)

Type of client event callback.

See also
OnNewDelClient, OnChangeLayer

Definition at line 669 of file minigui.h.

◆ ON_TRYLOCK_CLIENT_REQ

typedef void(* ON_TRYLOCK_CLIENT_REQ)(void)

Type of client request lock callback.

See also
OnTrylockClientReq, OnLockClientReq, OnUnlockClientReq

Definition at line 621 of file minigui.h.

◆ ON_UNLOCK_CLIENT_REQ

typedef void(* ON_UNLOCK_CLIENT_REQ)(void)

Type of client request unlock callback.

See also
OnTrylockClientReq, OnLockClientReq, OnUnlockClientReq

Definition at line 629 of file minigui.h.

◆ ON_ZNODE_OPERATION

typedef void(* ON_ZNODE_OPERATION)(int op, int cli, int idx_znode)

Type of z-node operation callback.

See also
OnNewDelClient, OnChangeLayer, OnZNodeOperation

Definition at line 711 of file minigui.h.

◆ ZNODEHEADER

typedef struct _ZNODEHEADER ZNODEHEADER

Z-node header structure

◆ ZNODEINFO

typedef struct _ZNODEINFO ZNODEINFO

Z-node information structure

Function Documentation

◆ __ex_compositor_get()

const CompositorOps* __ex_compositor_get ( const char *  name,
const CompositorOps fallback_ops,
int *  version 
)

Implement this stub to return the compositor operations for a specific compositor name if you implement the compositor in a shared library.

Parameters
nameThe name of the compositor desired.
fallback_opsThe fallback operations.
versionThe version code for the operations of the compositor.
Note
The compositor should return the version code it follows through version argument. If the version code is not matched, MiniGUI will refuse to load the compositor. The current version code is defined by COMPSOR_OPS_VERSION.
Returns
The compositor operations for specific name, NULL for error.

◆ DisableClientsOutput()

void GUIAPI DisableClientsOutput ( void  )

Disable all clients output.

◆ GetClientByPID()

int GUIAPI GetClientByPID ( int  pid)

Returns the client identifier from PID of a client.

This function gets the identifier of the sepcified client from the PID of it.

Parameters
pidThe process ID of the client.
Returns
The client identifier on success, less than 0 on error.
Note
Server-only function.

◆ ServerCreateLayer()

MG_Layer *GUIAPI ServerCreateLayer ( const char *  layer_name,
int  max_nr_highers,
int  max_nr_normals 
)

Create a new layer from the server.

This function creates a new layer named by layer_name. 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. If there is already a layer named layer_name, the function will return the pointer to that layer.
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, NULL on error.
Note
Only call this function in the server of MiniGUI-Processes.
See also
ServerDeleteLayer, ServerStartup

◆ ServerDeleteLayer()

BOOL GUIAPI ServerDeleteLayer ( MG_Layer layer)

Delete a layer from the server.

This function deletes the specified layer layer.

Parameters
layerThe pointer to the layer.
Returns
TRUE on success, otherwise FALSE.
Note
Server-only function.
See also
ServerCreateLayer, JoinLayer, DeleteLayer

◆ ServerDoZNodeOperation()

BOOL GUIAPI ServerDoZNodeOperation ( MG_Layer layer,
int  idx_znode,
int  op_code,
void *  op_data,
BOOL  notify 
)

Does an operation on the z-node in the specified layer from the server.

This function does an operation upon the z-node in the specified layer layer from the server.

Parameters
layerThe pointer to the layer, NULL for the current topmost layer.
idx_znodeThe index of the z-node.
op_codeThe code of the operation, can be one of the following values:
  • ZNOP_MOVE2TOP
    Move the z-node to be the topmost one.
  • ZNOP_SETACTIVE
    Set the z-node to be the active one. Note that the operation can be applied only for a main window.
op_dataThe data of the operation, used to pass the data need by the operation. For example, if the operation is moving the z-node, op_data will be a pointer to a RECT structure, which contains the new position and size of the z-node. Not used currently, reserved for future use.
notifyWhether to notify the client about the change of the z-node.
Returns
TRUE on success, otherwise FALSE.
Note
Server-only function, and the operation can be applied only for a main window.
See also
ServerGetZNodeInfo

◆ ServerGetCompositorOps()

const MG_EXPORT CompositorOps* GUIAPI ServerGetCompositorOps ( const char *  name)

Get the operations of a specific compositor.

This function gets the operations of a specific compositor.

Parameters
nameThe name of the compositor. MiniGUI reserved fallback as the default compositor which is implemented in MiniGUI Core. You can use some operations of the default compositor as the corresponding operations for your own compositor.
Returns
The object represents the compositor operations; NULL for no such compositor registered.
Note
Only called by the server.
See also
ServerRegisterCompositor

Since 5.0.0.

◆ ServerGetCurrentCompositor()

const MG_EXPORT char* GUIAPI ServerGetCurrentCompositor ( const CompositorOps **  ops,
CompositorCtxt **  ctxt 
)

Get the name and the context of the current compositor.

This function gets the name and the context of the current compositor.

Parameters
opsThe buffer used to return the compositor operations.
ctxtThe buffer used to return the compositor context.
Returns
The name of the current compositor; NULL for error.
Note
Only called by the server.

Since 5.0.6.

◆ ServerGetNextZNode()

int GUIAPI ServerGetNextZNode ( MG_Layer layer,
int  idx_znode,
int *  cli 
)

Get the next z-node in the specified layer from the server.

This function gets the next z-node of the z-node specified by idx_znode, i.e., the z-node below it, in the specified layer layer from the server.

Parameters
layerThe pointer to the layer, NULL for the current topmost layer.
idx_znodeThe initial z-node. If the initial z-node index is less than or equal to zero, the function will return the index of the first (the topmost) z-node in the layer.
cliThe client identifier of the next z-node will be returned through this pointer. NULL is okay.
Returns
The index of the next z-node. Zero when the next z-node is the desktop; < 0 when error;
Note
Server-only function. Note that this function will not return the z-node of the desktop, and the desktop always has the index of z-node zero. Also note that you can use this function to travel all z-nodes from top to bottom.
See also
ServerGetZNodeInfo

◆ ServerGetPopupMenusCount()

int GUIAPI ServerGetPopupMenusCount ( void  )

Get the number of popup menus shown on the screen.

This function gets the number of popup menus shown currently on the screen.

Returns
The number of the popup menus shown.
Note
Server-only function.
See also
ServerGetPopupMenuZNodeHeader, ZNODEHEADER

Since 5.0.0

◆ ServerGetPopupMenuZNodeRegion()

BOOL GUIAPI ServerGetPopupMenuZNodeRegion ( int  idx_znode,
DWORD  rgn_ops,
CLIPRGN dst_rgn 
)

Get the z-node region of a specific popup menu in the current layer.

This function gets the region of the popup menu which uses the specific z-node index idx_znode in the specified layer layer.

Parameters
idx_znodeThe z-node index of the popup menu.
rgn_opsThe operation for the region of the popup menu z-node and the destination region given by the last argument. It can be one of the following values and OR'ed with RGN_OP_FLAG_ABS:
  • RGN_OP_SET
    Set the destination region with the region of the window z-node.
  • RGN_OP_INCLUDE
    Union the region of the window z-node with the destination region.
  • RGN_OP_EXCLUDE
    Subtract the region of the window z-node from the destination region. If RGN_OP_FLAG_ABS is set, the function will convert the region to the screen coordinate system.
dst_rgnThe pointer to the destination region.
Returns
TRUE for success, otherwise FALSE;
Note
Server-only function.
This function will add round corners to popup menus automatically when _MGSCHEMA_COMPOSITING is defined.
See also
ServerGetWinZNodeRegion

Since 5.0.0

◆ ServerGetPrevZNode()

int GUIAPI ServerGetPrevZNode ( MG_Layer layer,
int  idx_znode,
int *  cli 
)

Get the previous z-node in the specified layer from the server.

This function gets the previous z-node of the z-node specified by idx_znode, i.e., the z-node above it, in the specified layer layer from the server.

Parameters
layerThe pointer to the layer, NULL for the current topmost layer.
idx_znodeThe initial z-node. If the initial z-node index is less than or equal to zero, the function will return the index of the last (the bottommost) z-node in the layer.
cliThe client identifier of the next z-node will be returned through this pointer. NULL is okay.
Returns
The index of the previous z-node. Zero when there is no z-node; < 0 when error;
Note
Server-only function. Note that this function will not return the z-node of the desktop, and the desktop always has the index of z-node zero. Also note that you can use this function to travel all z-nodes from bottom to top.
See also
ServerGetZNodeInfo

Since 5.0.0

◆ ServerGetTopmostZNodeOfType()

int GUIAPI ServerGetTopmostZNodeOfType ( MG_Layer layer,
DWORD  type,
int *  cli 
)

Get the topmost z-node in the specified layer for the specific window type from the server.

This function gets the topmost z-node of the type specified by type in the specified layer layer from the server.

Parameters
layerThe pointer to the layer, NULL for the current topmost layer.
typeThe window type, can be one of the following values:
  • ZOF_TYPE_TOOLTIP
  • ZOF_TYPE_GLOBAL
  • ZOF_TYPE_SCREENLOCK
  • ZOF_TYPE_DOCKER
  • ZOF_TYPE_HIGHER
  • ZOF_TYPE_NORMAL
  • ZOF_TYPE_LAUNCHER
cliThe client identifier of the topmost z-node will be returned through this pointer. NULL is okay.
Returns
The index of the topmost z-node of the specified type. Zero when there is no z-node in the level; < 0 when error.
Note
Server-only function. Note that this function will not return the z-node of the desktop, and the desktop always has the z-node index of zero.
See also
ServerGetZNodeInfo

◆ ServerGetWinZNodeHeader()

const ZNODEHEADER *GUIAPI ServerGetWinZNodeHeader ( MG_Layer layer,
int  idx_znode,
void **  priv_data,
BOOL  lock 
)

Get the pointer to the z-node header of a specific window in the specified layer.

This function gets the pointer to the z-node header of the window which uses the specific z-node index idx_znode in the specified layer layer.

Parameters
layerThe pointer to the layer, NULL for the current topmost layer.
idx_znodeThe index of the z-node.
priv_dataThe buffer to return the private data of the z-node; can be NULL.
lockWhether to lock the shared surface.
Returns
The pointer to the z-node header; NULL on error.
Note
This is the fast version of ServerGetZNodeInfo.
Under compositing schema, this function will lock the shared surface of this z-node if the argument lock is TRUE. You should call ServerReleaseWinZNodeHeader to release the lock.
Server-only function.
See also
ServerGetZNodeInfo, ServerReleaseWinZNodeHeader, ZNODEHEADER

Since 5.0.0

◆ ServerGetWinZNodeRegion()

BOOL GUIAPI ServerGetWinZNodeRegion ( MG_Layer layer,
int  idx_znode,
DWORD  rgn_ops,
CLIPRGN dst_rgn 
)

Get the z-node region of a specific window in the specified layer.

This function gets the region of the window which uses the specific z-node index idx_znode in the specified layer layer.

Parameters
layerThe pointer to the layer, NULL for the current topmost layer.
idx_znodeThe index of the z-node.
rgn_opsThe operation for the region of the window z-node and the destination region given by the last argument. It can be one of the following values and OR'ed with RGN_OP_FLAG_ABS:
  • RGN_OP_SET
    Set the destination region with the region of the window z-node.
  • RGN_OP_INCLUDE
    Union the region of the window z-node with the destination region.
  • RGN_OP_EXCLUDE
    Subtract the region of the window z-node from the destination region. If RGN_OP_FLAG_ABS is set, the function will convert the region to the screen coordinate system.
dst_rgnThe pointer to the destination region.
Returns
TRUE for success, otherwise FALSE;
Note
Server-only function.
See also
ServerGetPopupMenuZNodeRegion

Since 5.0.0

◆ ServerGetZNodeInfo()

BOOL GUIAPI ServerGetZNodeInfo ( MG_Layer layer,
int  idx_znode,
ZNODEINFO znode_info 
)

Get the z-node information in the specified layer from the server.

This function copies the z-node information of a window which uses the specific z-node index idx_znode in the specified layer layer from the server.

Parameters
layerThe pointer to the layer, NULL for the current topmost layer.
idx_znodeThe index of the z-node.
znode_infoThe information of the requested z-node will be returned through this structure.
Returns
TRUE on success, otherwise FALSE.
Note
Server-only function.
See also
ServerGetNextZNode, ZNODEINFO

◆ ServerMoveClientToLayer()

BOOL GUIAPI ServerMoveClientToLayer ( int  cli,
MG_Layer dst_layer 
)

Move a client to the specified layer.

This function moves a client specified by cli to other layer specified dst_layer.

Parameters
cliThe identifier of the client.
dst_layerThe pointer to the destination layer.
Returns
TRUE on success, otherwise FALSE.
Note
Server-only function. 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
MoveToLayer

Since 5.0.0.

◆ ServerRegisterCompositor()

MG_EXPORT BOOL GUIAPI ServerRegisterCompositor ( const char *  name,
const CompositorOps ops 
)

Register a new compositor.

This function registers a new compositor.

Parameters
nameThe name of the compositor.
opsThe new compositor object.
Returns
TRUE for success; otherwize (duplicated or no enough space) FALSE.
Note
Only called by the server.
See also
ServerUnregisterCompositor

Since 5.0.0.

◆ ServerReleasePopupMenuZNodeHeader()

BOOL GUIAPI ServerReleasePopupMenuZNodeHeader ( int  idx_znode)

Release the lock of the z-node header of the specific popup menu.

This function releases the lock of the z-node header of the specific popup menu which is currently shown on the current layer.

Parameters
idx_znodeThe index of the popup menu. 0 means the first popup menu.
Returns
TRUE on success, otherwise FALSE.
Note
Server-only function.
Under compositing schema, this function will release the lock of the shared surface of this z-node. You should call ServerReleasePopupMenuZNodeHeader to release the lock.
See also
ServerGetPopupMenusCount, ServerReleasePopupMenuZNodeHeader, ZNODEHEADER

Since 5.0.0

◆ ServerReleaseWinZNodeHeader()

void GUIAPI ServerReleaseWinZNodeHeader ( MG_Layer layer,
int  idx_znode 
)

Release z-node header of a specific window in the specified layer.

This function releases the z-node header of the window which uses the specific z-node index idx_znode in the specified layer layer.

Parameters
layerThe pointer to the layer, NULL for the current topmost layer.
idx_znodeThe index of the z-node.
Returns
TRUE for success, otherwise FALSE;
Note
Under compositing schema, this function will release the shared surface of this z-node locked by ServerGetWinZNodeHeader to release the lock.
Server-only function.
See also
ServerGetWinZNodeHeader

Since 5.0.0

◆ ServerSelectCompositor()

const MG_EXPORT CompositorOps* GUIAPI ServerSelectCompositor ( const char *  name,
CompositorCtxt **  ctxt 
)

Select a compositor as the current compositor.

This function selects a compositor as the current compositor and returns the compositor operations. It also destroies the old compositor object if there is old one.

Parameters
nameThe name of the compositor. If the argument is NULL, this function will return the current compositor. Use COMPSOR_NAME_DEFAULT when you want to refer to the default compositor.
ctxtThe buffer used to return the compositor context.
Returns
The pointer to the compositor operations; NULL for error.
Note
Only called by the server.

Since 5.0.0.

◆ ServerSetPopupMenuZNodePrivateData()

BOOL GUIAPI ServerSetPopupMenuZNodePrivateData ( int  idx_znode,
void *  priv_data 
)

Set the private data of the z-node of the specific popup menu.

This function sets the private data of the z-node header of the specific popup menu which is currently shown on the current layer.

Parameters
idx_znodeThe index of the popup menu. 0 means the first popup menu.
priv_dataThe private data.
Returns
TRUE on success, otherwise FALSE;
Note
Server-only function.
See also
ServerGetPopupMenuZNodeHeader, ServerSetWinZNodePrivateData

Since 5.0.0

◆ ServerSetTopmostLayer()

BOOL GUIAPI ServerSetTopmostLayer ( MG_Layer layer)

Set topmost layer from the server.

This function sets the specified layer layer to be the topmost layer.

Parameters
layerThe pointer to the layer.
Returns
TRUE on success, otherwise FALSE.
Note
Server-only function.
See also
SetTopmostClient, SetTopmostLayer

◆ ServerSetWinZNodePrivateData()

BOOL GUIAPI ServerSetWinZNodePrivateData ( MG_Layer layer,
int  idx_znode,
void *  priv_data 
)

Set the private data of the z-node of a specific window in the specified layer.

This function sets the private data of the z-node header of the window which uses the specific z-node index idx_znode in the specified layer layer.

Parameters
layerThe pointer to the layer, NULL for the current topmost layer.
idx_znodeThe index of the z-node.
priv_dataThe private data.
Returns
TRUE on success, otherwise FALSE;
Note
Server-only function.
See also
ServerGetWinZNodeHeader, ServerSetPopupMenuZNodePrivateData

Since 5.0.0

◆ ServerStartup()

BOOL GUIAPI ServerStartup ( int  nr_globals,
int  def_nr_highers,
int  def_nr_normals 
)

Initializes the server of MiniGUI-Processes.

This function initializes the server, i.e. mginit. It creates the shared resource, the listening socket, the default layer, and other internal objects. Your costomized mginit program should call this function before calling any other function.

Note that the default layer created by the server called "mginit" (NAME_DEF_LAYER).

Parameters
nr_globalsThe number of the z-nodes in the global level. All z-nodes created by mginit are global ones.
def_nr_highersThe maximal number of the z-nodes in the higher level of the default layer. It is also the default number of the z-nodes in the higher level of a new layer.
def_nr_normalsThe maximal number of the z-nodes in the normal level of the default layer. It is also the default number of the z-nodes in the normal level of a new layer.
Returns
TRUE on success, otherwise FALSE.
Note
Server-only function, i.e. only can be called by mginit.

◆ ServerUnregisterCompositor()

MG_EXPORT BOOL GUIAPI ServerUnregisterCompositor ( const char *  name)

Un-register a new compositor.

This function un-registers a compositor.

Parameters
nameThe name of the compositor.
Returns
The object represents the compositor implementation.
Note
Only called by the server.
See also
ServerRegisterCompositor

Since 5.0.0.

◆ SetTopmostClient()

BOOL GUIAPI SetTopmostClient ( int  cli)

Set topmost layer by a client identifier.

This function sets the topmost layer by the specified client identifier cli. It will bring the layer contains the client to be the topmost one.

Parameters
cliThe identifier of the client.
Returns
TRUE on success, otherwise FALSE.
Note
Server-only function.
See also
ServerSetTopmostLayer, SetTopmostLayer

◆ UpdateTopmostLayer()

void GUIAPI UpdateTopmostLayer ( const RECT dirty_rc)

Update topmost layer.

Parameters
dirty_rcThe refresh region.

Variable Documentation

◆ OnChangeLayer

ON_CHANGE_LAYER OnChangeLayer

Set to a function to handle events of layers.

When a layer is changing, MiniGUI will call this function to tell you the event and the layer or the client which leads to the event. The event could be one of the following:

  • LCO_NEW_LAYER
    A new layer is creating.
  • LCO_DEL_LAYER
    A new layer is deleting.
  • LCO_JOIN_CLIENT
    A client is joining to the layer.
  • LCO_REMOVE_CLIENT
    A client is removing from the layer.
  • LCO_TOPMOST_CHANGED
    The topmost layer changed, the layer will be the topmost one.
  • LCO_ACTIVE_CHANGED
    The active client changed, the client will be the active one.

The event will be passed through the argument of op, and the pointers to the relevant layer and client will be passed through the argument of layer and client respectively.

Note
Only available for the server of MiniGUI-Processes.
See also
ON_NEW_DEL_CLIENT, mgClients

◆ OnLockClientReq

ON_LOCK_CLIENT_REQ OnLockClientReq

Set to a function to lock a client request.

Note
Only available for the client of MiniGUI-Processes.
See also
ON_LOCK_CLIENT_REQ

◆ OnNewDelClient

ON_NEW_DEL_CLIENT OnNewDelClient

Set to a function to handle a comming in (going away) connection of client.

When a client is connecting to or disconnecting from the server, MiniGUI will call this function to tell you the event and the client identifier. The event could be one of the following:

  • LCO_NEW_CLIENT
    A new client is connecting to the server.
  • LCO_DEL_CLIENT
    A new client is disconnecting from the server.

The event will be passed through the argument of op, and the client identifier will be passed through the argument of cli. You can get the information of the client by accessing mgClients with cli.

Note
Only available for the server of MiniGUI-Processes.
See also
ON_NEW_DEL_CLIENT, mgClients

◆ OnTrylockClientReq

ON_TRYLOCK_CLIENT_REQ OnTrylockClientReq

Set to a function to lock a client request.

Note
Only available for the client of MiniGUI-Processes.
See also
ON_TRYLOCK_CLIENT_REQ

◆ OnUnlockClientReq

ON_UNLOCK_CLIENT_REQ OnUnlockClientReq

Set to a function to unlock a client request.

Note
Only available for the client of MiniGUI-Processes.
See also
ON_UNLOCK_CLIENT_REQ

◆ OnZNodeOperation

ON_ZNODE_OPERATION OnZNodeOperation

Set to a function to handle events of z-node.

After the server does an operation on a z-node, MiniGUI will call this function to tell you the event and the layer, the client, and the z-node which leads to the event.

The event could be one of the following:

  • ZNOP_ALLOCATE
    The z-node has been created.
  • ZNOP_FREE
    The z-node has been destroyed.
  • ZNOP_MOVE2TOP
    The z-node has been moved to be the topmost one.
  • ZNOP_SHOW
    The z-node has been shown.
  • ZNOP_HIDE
    The z-node has been hidden.
  • ZNOP_MOVEWIN
    The z-node has been moved or its size has changed.
  • ZNOP_SETACTIVE
    The z-node has been set to be the active one.
  • ZNOP_ENABLEWINDOW
    The z-node is disabled or enabled.
  • ZNOP_STARTDRAG
    Start to drag the z-node.
  • ZNOP_CANCELDRAG
    Cancel to drag the z-node.
  • ZNOP_CHANGECAPTION
    The caption of the z-node has changed.
  • ZNOP_REGIONCHANGED
    The region (mask rectangles) of the z-node has changed.
  • ZNOP_COMPOSITINGCHANGED
    The compositing type or the argument of the z-node has changed.

The event will be passed through the argument of op; the pointers to the layer, the identifier of the client, and the index of the z-node will be passed through the argument of layer, cli, and idx_znode respectively.

Note
Only available for the server of MiniGUI-Processes.
See also
ON_ZNODE_OPERATION, ServerGetZNodeInfo, mgClients
HWND_DESKTOP
#define HWND_DESKTOP
Desktop window handle.
Definition: window.h:6742
MiniGUIMain
#define MiniGUIMain
The main entry of a MiniGUI application.
Definition: minigui.h:2540
ServerStartup
MG_EXPORT BOOL GUIAPI ServerStartup(int nr_globals, int def_nr_highers, int def_nr_normals)
Initializes the server of MiniGUI-Processes.
GetMessage
static BOOL GUIAPI GetMessage(PMSG pMsg, HWND hWnd)
Get a message from the message queue of a main window.
Definition: window.h:3240
DispatchMessage
MG_EXPORT LRESULT GUIAPI DispatchMessage(PMSG pMsg)
Dispatches a message to the window's callback procedure.