MiniGUI API Reference (MiniGUI-Standalone)  v3.2.0
A mature and proven cross-platform GUI system for embedded and smart IoT devices
Data Structures | Macros | Typedefs | Functions
Look and Feel Renderer management functions

Data Structures

struct  _WINDOW_ELEMENT_ATTR
 
struct  _LFSCROLLBARINFO
 
struct  _SCROLLBARDATA
 
struct  _LFRDR_WINSTYLEINFO
 
struct  _LFRDR_TRACKBARINFO
 
struct  _WINDOW_ELEMENT_RENDERER
 
struct  _WINDOWINFO
 

Macros

#define WE_FONTS_NUMBER   4
 The number of window element font attributes. More...
 
#define WE_METRICS_NUMBER   6
 The number of window element metric attributes. More...
 
#define WE_COLORS_NUMBER   14
 The number of window element color attributes. More...
 
#define WE_ATTR_TYPE_RDR   0x5000
 The specific type for LF renderer. More...
 
#define SBS_DISABLED_LTUP   0x0100
 
#define SBS_DISABLED_BTDN   0x0200
 
#define SBS_HILITE_LTUP   0x0400
 
#define SBS_HILITE_BTDN   0x0800
 
#define SBS_HILITE_THUMB   0x0010
 
#define SBS_PRESSED_LTUP   0x0020
 
#define SBS_PRESSED_BTDN   0x0040
 
#define SBS_PRESSED_THUMB   0x0080
 
#define LEN_RENDERER_NAME   15
 The maximum length of a renderer name. More...
 

Typedefs

typedef struct _WINDOW_ELEMENT_ATTR WINDOW_ELEMENT_ATTR
 
typedef struct _LFSCROLLBARINFO LFSCROLLBARINFO
 
typedef struct _SCROLLBARDATA SCROLLBARDATA
 
typedef struct _LFRDR_WINSTYLEINFO LFRDR_WINSTYLEINFO
 
typedef struct _LFRDR_TRACKBARINFO LFRDR_TRACKBARINFO
 
typedef struct _WINDOW_ELEMENT_RENDERER WINDOW_ELEMENT_RENDERER
 
typedef struct _WINDOWINFO WINDOWINFO
 

Functions

static const WINDOWINFO *GUIAPI GetWindowInfo (HWND hWnd)
 Get the handle of window information. More...
 
MG_EXPORT BOOL GUIAPI InitWindowElementAttrs (PWERENDERER rdr)
 
MG_EXPORT DWORD GUIAPI GetWindowElementAttr (HWND hwnd, int we_attr_id)
 Get a window element data. More...
 
MG_EXPORT DWORD GUIAPI SetWindowElementAttr (HWND hwnd, int we_attr_id, DWORD we_attr)
 Set a new window element data specified by we_attr_id. More...
 
MG_EXPORT gal_pixel GUIAPI GetWindowElementPixelEx (HWND hwnd, HDC hdc, int we_attr_id)
 Get a window element gal_pixel color. More...
 
MG_EXPORT WINDOW_ELEMENT_RENDERER *GUIAPI GetWindowRendererFromName (const char *name)
 Get window renderer from name. More...
 
MG_EXPORT BOOL GUIAPI AddWindowElementRenderer (const char *name, const WINDOW_ELEMENT_RENDERER *we_rdr)
 Add a window element renderer to the system. More...
 
MG_EXPORT BOOL GUIAPI RemoveWindowElementRenderer (const char *name)
 Remove a window renderer from MiniGUI. More...
 
MG_EXPORT WINDOW_ELEMENT_RENDERER *GUIAPI GetDefaultWindowElementRenderer (void)
 Get the default window renderer. More...
 
MG_EXPORT const char *GUIAPI SetDefaultWindowElementRenderer (const char *name)
 Set a window element renderer as the default system renderer. More...
 
MG_EXPORT BOOL GUIAPI SetWindowElementRenderer (HWND hWnd, const char *werdr_name, const WINDOW_ELEMENT_ATTR *we_attrs)
 Set a window element renderer and window element attributes for window specified by hwnd. More...
 
MG_EXPORT BOOL InitRendererSystemIcon (const char *rdr_name, HICON *small_icon, HICON *large_icon)
 Initialize large and small system icons in the specified renderer rdr_name. More...
 
MG_EXPORT void TermRendererSystemIcon (HICON *small_icon, HICON *large_icon)
 Release large and small system icon resources. More...
 

Detailed Description

Macro Definition Documentation

#define LEN_RENDERER_NAME   15

The maximum length of a renderer name.

Definition at line 3692 of file window.h.

#define SBS_DISABLED_BTDN   0x0200

right or bottom arrow is in disabled state

Definition at line 3617 of file window.h.

#define SBS_DISABLED_LTUP   0x0100

left or up arrow is in disabled state

Definition at line 3614 of file window.h.

#define SBS_HILITE_BTDN   0x0800

right or bottom arrow is in hilited state

Definition at line 3623 of file window.h.

#define SBS_HILITE_LTUP   0x0400

left or up arrow is in hilited state

Definition at line 3620 of file window.h.

#define SBS_HILITE_THUMB   0x0010

thumb is in hilite state as cursor is in the area of thumb

Definition at line 3626 of file window.h.

#define SBS_PRESSED_BTDN   0x0040

right or bottom arrow is in pressed state

Definition at line 3632 of file window.h.

#define SBS_PRESSED_LTUP   0x0020

left or up arrow is in pressed state

Definition at line 3629 of file window.h.

#define SBS_PRESSED_THUMB   0x0080

thumb is in pressed state as left button presses it

Definition at line 3635 of file window.h.

#define WE_ATTR_TYPE_RDR   0x5000

The specific type for LF renderer.

Definition at line 3494 of file window.h.

#define WE_COLORS_NUMBER   14

The number of window element color attributes.

Definition at line 3373 of file window.h.

#define WE_FONTS_NUMBER   4

The number of window element font attributes.

Definition at line 3361 of file window.h.

#define WE_METRICS_NUMBER   6

The number of window element metric attributes.

Definition at line 3367 of file window.h.

Typedef Documentation

The scrollbar information structure. Used by draw_scrollbar and get_scrollbar_rect renderer function.

The window style information structure. Used by calc_we_metrics renderer function.

The scrollbar information structure in look and feel.

typedef struct _SCROLLBARDATA SCROLLBARDATA

The scrollbar data construction for scrollbar control.

The window element attributes structure.

The window element renderer structure.

typedef struct _WINDOWINFO WINDOWINFO

The window information structure.

Function Documentation

BOOL GUIAPI AddWindowElementRenderer ( const char *  name,
const WINDOW_ELEMENT_RENDERER we_rdr 
)

Add a window element renderer to the system.

This function adds a new window renderer to MiniGUI system.

Parameters
nameThe renderer name.
we_rdrThe pointer to a new renderer.
Returns
TRUE for success, FALSE for failure.

Referenced by GetWindowInfo().

WINDOW_ELEMENT_RENDERER *GUIAPI GetDefaultWindowElementRenderer ( void  )

Get the default window renderer.

This function gets the default window renderer in MiniGUI.

Returns
the pointer to the default renderer.
Note
The prototype had changed since MiniGUI v3.2; the old one returns a const value.

Referenced by GetWindowInfo().

DWORD GUIAPI GetWindowElementAttr ( HWND  hwnd,
int  we_attr_id 
)

Get a window element data.

This function gets a window element data which is identified by we_attr_id.

Parameters
hwndThe handle to the window.
we_attr_idThe window element id number, can be one of the following values:
  • WE_FONT_CAPTION
    The caption font.
  • WE_FONT_MENU
    The menu font. Used by menu and listbox.
  • WE_FONT_MESSAGEBOX
    The messagebox font. Resevered.
  • WE_FONT_TOOLTIP
    The tooltip font. Used by tooltip window.
  • WE_METRICS_CAPTION
    The caption size.
  • WE_METRICS_CAPTION_BUTTON
    The caption button size.
  • WE_METRICS_MENU
    The menu size.
  • WE_METRICS_WND_BORDER
    The border size.
  • WE_METRICS_SCROLLBAR
    The scrollbar size.
  • WE_FGC_ACTIVE_CAPTION
    The active caption foreground color.
  • WE_BGCA_ACTIVE_CAPTION
    The active caption background color A.
  • WE_BGCB_ACTIVE_CAPTION
    The active caption background color B.
  • WE_FGC_MENU
    The menu foreground color.
  • WE_BGC_MENU
    The menu background color.
  • WE_FGC_MESSAGEBOX
    The messagebox foreground color. Reserved.
  • WE_FGC_TOOLTIP
    The tooltip foreground color. Only used by tooltip window.
  • WE_BGC_TOOLTIP
    The tooltip background color. Only used by tooltip window.
  • WE_FGC_ACTIVE_WND_BORDER
    The active border foreground color.
  • WE_FGC_INACTIVE_WND_BORDER
    The inactive border foreground color.
  • WE_FGC_INACTIVE_CAPTION
    The inactive caption foreground color.
  • WE_BGCA_INACTIVE_CAPTION
    The inactive caption background color A.
  • WE_BGCB_INACTIVE_CAPTION
    The inactive caption background color B.
  • WE_FGC_WINDOW
    The window foreground color. Used by window and control.
  • WE_BGC_WINDOW
    The window background color. Used by window and control.
  • WE_FGC_THREED_BODY
    The 3dbox foreground color. Mainly used by drawing 3dbox object, such as dialog and button, etc.
  • WE_MAINC_THREED_BODY
    The 3dbox background color. Mainly used by drawing menubar, dialog, header and button, etc.
  • WE_FGC_SELECTED_ITEM
    The selected item foreground color. Used by menu and control.
  • WE_BGC_SELECTED_ITEM
    The selected item background color. Used by menu and control.
  • WE_BGC_SELECTED_LOSTFOCUS
    The lostfocus selected item background color. Only Used by mledit.
  • WE_FGC_DISABLED_ITEM
    The disabled item foreground color. Used by menu and control.
  • WE_BGC_DISABLED_ITEM
    The disabled item background color. Used by menu and control.
  • WE_FGC_HIGHLIGHT_ITEM
    The highlight item foreground color. Used by menu and control.
  • WE_BGC_HIGHLIGHT_ITEM
    The highlight item background color. Used by menu and control.
  • WE_FGC_SIGNIFICANT_ITEM
    The significant item foreground color. Used by listbox.
  • WE_BGC_SIGNIFICANT_ITEM
    The significant item background color. Used by listbox.
  • WE_BGC_DESKTOP
    The desktop background color. Only used by desktop.
Returns
If succeed, return the window element data; otherwise return -1.
See also
SetWindowElementAttr

Referenced by GetWindowInfo().

gal_pixel GUIAPI GetWindowElementPixelEx ( HWND  hwnd,
HDC  hdc,
int  we_attr_id 
)

Get a window element gal_pixel color.

This function gets a window element gal_pixel color which is identified by we_attr_id and hdc.

Parameters
hwndThe handle to the window.
hdcThe device context. If -1, it will return pixel value according to window handle hwnd; otherwise return pixel value according to pixel format in hdc.
we_attr_idThe window element id number.
Returns
If succeed, return the window element pixel color data; otherwise return -1.
See also
GetWindowElementAttr

Referenced by GetWindowInfo().

const WINDOWINFO *GUIAPI GetWindowInfo ( HWND  hWnd)
inlinestatic
WINDOW_ELEMENT_RENDERER *GUIAPI GetWindowRendererFromName ( const char *  name)

Get window renderer from name.

Parameters
nameThe renderer name.

This function gets window renderer from the specified name name, which is case-insensitive.

Returns
The pointer to the window renderer for success, NULL for failure.
Note
The prototype had changed since MiniGUI v3.2; the old one returns a const value.

Referenced by GetWindowInfo().

BOOL GUIAPI InitRendererSystemIcon ( const char *  rdr_name,
HICON large_icon,
HICON small_icon 
)

Initialize large and small system icons in the specified renderer rdr_name.

Parameters
rdr_nameThe renderer name.
large_iconThe pointer to large system icons.
small_iconThe pointer to small system icons.
Returns
TRUE for success, FALSE for failure.

Referenced by GetWindowInfo().

BOOL GUIAPI InitWindowElementAttrs ( PWERENDERER  rdr)

This function initializes window element attributes of the specified renderer rdr according to the appropriate section in configuration file.

Parameters
rdrThe pointer to the specified renderer.
Returns
If succeed, return TRUE; otherwise return FALSE.

Referenced by GetWindowInfo().

BOOL BOOL GUIAPI RemoveWindowElementRenderer ( const char *  name)

Remove a window renderer from MiniGUI.

This function only removes a window renderer named by name.

Parameters
nameThe renderer name.
Returns
TRUE for success, FALSE for failure.

Referenced by GetWindowInfo().

const char *GUIAPI SetDefaultWindowElementRenderer ( const char *  name)

Set a window element renderer as the default system renderer.

This function sets a window element renderer as the default system renderer.

Parameters
nameThe renderer name.
Returns
the old renderer's name for success, NULL for failure.

Referenced by GetWindowInfo().

DWORD GUIAPI SetWindowElementAttr ( HWND  hwnd,
int  we_attr_id,
DWORD  we_attr 
)

Set a new window element data specified by we_attr_id.

This function sets a new window element data we_attr to MiniGUI, which is identified by we_attr_id.

Parameters
hwndThe handle to the window.
we_attr_idThe window element id.
we_attrThe new window element data.
Returns
If succeed, return the old window element data; otherwise return -1.
See also
GetWindowElementAttr

Referenced by GetWindowInfo().

BOOL GUIAPI SetWindowElementRenderer ( HWND  hwnd,
const char *  werdr_name,
const WINDOW_ELEMENT_ATTR we_attrs 
)

Set a window element renderer and window element attributes for window specified by hwnd.

This function sets the window handled by hWnd to use a different window element renderer OR'ed window element attributes and updates window in time.

Parameters
hwndThe handle to the window.
werdr_nameThe renderer name.
we_attrsThe pointer to new window element attributes.
Returns
TRUE for success, FALSE for failure.

Referenced by GetWindowInfo().

void GUIAPI TermRendererSystemIcon ( HICON large_icon,
HICON small_icon 
)

Release large and small system icon resources.

Parameters
large_iconThe pointer to large system icons.
small_iconThe pointer to small system icons.
See also
InitRendererSystemIcon

Referenced by GetWindowInfo().