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

Layer operations
[MiniGUI-Lite specific functions]

Defines

Functions


Detailed Description

A client in MiniGUI-Lite can create a new layer or join an existed layer in order to get the visible desktop rectangle on the screen of it.

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, NULL);
    if (layer != INV_LAYER_HANDLE) {
        BringLayer2Topmost (layer);
        return 0;
    }

    if (JoinLayer ("vcongui", "vcongui", 0, 0, 486, 674) == INV_LAYER_HANDLE) {
        printf ("JoinLayer: invalid layer handle.\n");
        return 1;
    }

    ...

    return 0;
}


Define Documentation

#define NAME_DEF_LAYER   "mginit"
 

The default name of the layer.

Definition at line 389 of file minigui.h.

#define NAME_SELF_LAYER   ""
 

The name of the self layer.

Definition at line 455 of file minigui.h.

#define NAME_SELF_LAYER   ""
 

The name of the self layer.

Definition at line 455 of file minigui.h.

#define NAME_TOPMOST_LAYER   ""
 

The name of the topmost layer.

Definition at line 383 of file minigui.h.


Function Documentation

BOOL GUIAPI BringLayer2Topmost GHANDLE  handle  ) 
 

Brings a layer to be the topmost one.

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

Parameters:
handle The handle to the layer.
Returns:
TRUE on success, otherwise FALSE.
See also:
SetActiveClient

void GUIAPI GetDesktopRect int *  lx,
int *  ty,
int *  rx,
int *  by
 

Gets the desktop rectangle.

After joined to a layer, client can call this function to get the actual desktop rect of itself.

Parameters:
lx lx,ty,rx,by: The desktop rect will be returned through these pointers.
ty lx,ty,rx,by: The desktop rect will be returned through these pointers.
rx lx,ty,rx,by: The desktop rect will be returned through these pointers.
by lx,ty,rx,by: The desktop rect will be returned through these pointers.
See also:
JoinLayer

GHANDLE GUIAPI GetLayerInfo const char *  layer_name,
RECT max_rect,
int *  nr_clients,
BOOL is_topmost,
int *  cli_active
 

Gets information of a layer.

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_name The name of the layer.
max_rect The max desktop rect can be obtained will be returned through this pointer.
nr_clients The number of clients in the layer will be returned through this pointer.
is_topmost A boolean which indicates whether the layer is the topmost layer will be returned.
cli_active The identifier of the active client in the layer.
Returns:
Returns the handle to the layer on success, INV_LAYER_HANDLE on error.
See also:
JoinLayer

GHANDLE GUIAPI JoinLayer const char *  layer_name,
const char *  client_name,
int  lx,
int  ty,
int  rx,
int  by
 

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, a new layer will be created as well.

For the server of MiniGUI-Lite, this function will ignore the arguments of layer_name and client_name. The rectangle defines a region in the screen, which is exclusively used by the server, no client can output to this exclusive retangle.

The server usually calls SetDesktopRect macro, which is defined as the following:

 #define SetDesktopRect(lx, ty, rx, by) JoinLayer ("", "", lx, ty, rx, by)

Note that the server can define the exclusive retangle out of the actual screen range.

Parameters:
layer_name The name of the layer.
client_name The name of the client.
lx lx,ty,rx,by: The expected desktop rect of the client.
ty lx,ty,rx,by: The expected desktop rect of the client.
rx lx,ty,rx,by: The expected desktop rect of the client.
by lx,ty,rx,by: The expected desktop rect of the client.
Returns:
The handle to the layer on success, INV_LAYER_HANDLE on error.
See also:
GetLayerInfo, GetDesktopRect, ServerStartup

BOOL GUIAPI SetActiveClient int  active  ) 
 

Sets a client as the ative one.

This function sets the specified client active to be the active one. It also bring the layer in which the client lays to be the topmost as well.

Parameters:
active The identifier of the client.
Returns:
TRUE on success, otherwise FALSE.
See also:
BringLayer2Topmost


Generated on Mon Jun 26 13:54:32 2006 for MiniGUI V1.6.9 API Reference by  doxygen 1.4.2