Main Page | Modules | Alphabetical List | Data Structures | Directories | File List | Data Fields | Globals | Related Pages

Server-only operations
[MiniGUI-Processes specific functions]

Defines

Typedefs

Functions

Variables


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)) {
        DispatchMessage (&msg);
    }

    MiniGUIExtCleanUp ();

    return 0;
}

Define Documentation

#define LCO_ACTIVE_CHANGED   6
 

The active client has changed, the client will be the active one.

See also:
OnChangeLayer

Definition at line 553 of file minigui.h.

#define LCO_DEL_CLIENT   2
 

Disconnecting a new client from the server.

See also:
OnNewDelClient

Definition at line 508 of file minigui.h.

#define LCO_DEL_LAYER   2
 

Deleting a new layer.

See also:
OnChangeLayer

Definition at line 529 of file minigui.h.

#define LCO_JOIN_CLIENT   3
 

Joining a client to the layer.

See also:
OnChangeLayer

Definition at line 535 of file minigui.h.

#define LCO_NEW_CLIENT   1
 

Connecting a new client to the server.

See also:
OnNewDelClient

Definition at line 502 of file minigui.h.

#define LCO_NEW_LAYER   1
 

Creating a new layer.

See also:
OnChangeLayer

Definition at line 523 of file minigui.h.

#define LCO_REMOVE_CLIENT   4
 

Removing a client from the layer.

See also:
OnChangeLayer

Definition at line 541 of file minigui.h.

#define LCO_TOPMOST_CHANGED   5
 

The topmost layer has changed, the layer will be the topmost one.

See also:
OnChangeLayer

Definition at line 547 of file minigui.h.


Typedef Documentation

typedef void(* ON_CHANGE_LAYER)(int op,
 

Type of layer change event callback.

MG_Layer* layer, MG_Client* client)

See also:
OnNewDelClient, OnChangeLayer

Definition at line 562 of file minigui.h.

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

Type of client event callback.

See also:
OnNewDelClient, OnChangeLayer

Definition at line 516 of file minigui.h.


Function Documentation

void GUIAPI DisableClientsOutput void   ) 
 

Disable all clients output.

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:
pid The process ID of the client.
Returns:
The client identifier on success, less than 0 on error.
Note:
Server-only function.

MG_Layer *GUIAPI ServerCreateLayer const char *  layer_name,
int  max_nr_topmosts,
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 topmost frame objects (max_nr_topmosts) and the maximal number of normal frame objects (max_nr_normals) in the new layer. Passing zero to max_nr_topmosts 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_name The name of the layer. If there is already a layer named layer_name, the function will return the pointer to the layer.
max_nr_topmosts The maximal number of topmost z-order nodes in the new layer.
max_nr_normals The maximal number of normal z-order nodes in 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

BOOL GUIAPI ServerDeleteLayer MG_Layer layer  ) 
 

Delete a layer from the server.

This functions deletes the specified layer layer.

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

BOOL GUIAPI ServerSetTopmostLayer MG_Layer layer  ) 
 

Sets topmost layer from the server.

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

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

BOOL GUIAPI ServerStartup int  nr_globals,
int  def_nr_topmosts,
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_globals The number of the global z-order nodes. All z-order nodes created by mginit are global ones.
def_nr_topmosts The maximal number of the topmost z-order nodes in the default layer. It is also the default number of topmost z-order nodes of a new layer.
def_nr_normals The maximal number of normal global z-order nodes in the new layer. It is also the default number of normal z-order nodes of a new layer.
Returns:
TRUE on success, otherwise FALSE.
Note:
Server-only function, i.e. only can be called by mginit.

BOOL GUIAPI SetTopmostClient int  cli  ) 
 

Sets 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:
cli The identifier of the client.
Returns:
TRUE on success, otherwise FALSE.
Note:
Server-only function.
See also:
ServerSetTopmostLayer, SetTopmostLayer

void GUIAPI UpdateTopmostLayer const RECT dirty_rc  ) 
 

Update topmost layer.

Parameters:
dirty_rc The refresh region.


Variable Documentation

ON_CHANGE_LAYER OnChangeLayer
 

Sets 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

ON_NEW_DEL_CLIENT OnNewDelClient
 

Sets 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


Generated on Mon Jun 26 14:21:38 2006 for MiniGUI V2.0.3 API Reference by  doxygen 1.4.2