User manual

Graphics Quick Reference Guide 9
GOL Layer
GOL Layer Description
void GOLInit()
This function initializes the object layer, primitive
layer and display driver layer. Creates a default
style scheme with default settings.
WORD GOLDraw()
Renders all widgets that needs to be rendered on
the active list.
WORD GOLDrawCallback()
Function implemented in the application. Function
called by GOLDraw() to allow application dened
rendering.
void GOLRedraw(OBJ_HEADER pObj)
Sets the drawing states of the widget to be
redrawn on the next GOLDraw().
void GOLRedrawRec(
SHORT left,
SHORT top,
SHORT right,
SHORT bottom)
Marks all widgets in the active list intersected by
the given rectangular area.
WORD IsObjUpdated(OBJ_HEADER pObj)
Tests if the widget is pending to be redrawn.
Returns a non zero if pending and zero if not.
void GOLDrawComplete(OBJ_HEADER pObj)
Resets the drawing states of the widget.
void GOLAddObject(OBJ_HEADER pObj)
Adds the widget to the end of the active list.
void GOLFree()
Frees up the memory used by the current active
list. Active list becomes empty.
OBJ_HEADER *GOLFindObject(WORD ID)
Returns the pointer to the widget in the active list
with the given ID.
BOOL GOLDeleteObject(OBJ_HEADER pObj)
Deletes a widget from the current active list.
BOOL GOLDeleteObjectByID(WORD ID)
Deletes a widget from the current active list.
GOL_OBJ_TYPE GetObjType(OBJ_HEADER pObj)
Returns the widget type of the specied widget.
WORD GetObjID(OBJ_HEADER pObj)
Returns the object ID of the specied widget.
OBJ_HEADER *GetObjNext(OBJ_HEADER pObj)
Returns the pointer to the next widget right after
the specied widget in the active list.
void GOLNewList()
Starts a new but empty list of widgets. Use
GOLAddObjects() to populate the list.
OBJ_HEADER *GOLGetList()
Returns the pointer to the current active list.
void GOLSetList(OBJ_HEADER pObjList)
Sets the active list to the pointer specied by
pObjList.
void GOLSetFocus(OBJ_HEADER pObj)
Sets the widget pObj to be focused.
OBJ_HEADER *GOLGetFocus()
Returns the pointer to the currently focused widget
in the active list.
WORD GOLCanBeFocused(OBJ_HEADER pObj)
Returns a non-zero if the widget can be focused.
OBJ_HEADER *GOLGetFocusNext()
Returns the pointer of the next widget that can be
focused in the active list.
OBJ_HEADER *GOLGetFocusPrev()
Returns the pointer of the previous widget that can
be focused in the active list.
GOL Layer Description
GOLPanelDraw(
SHORT left,
SHORT top,
SHORT right,
SHORT bottom,
SHORT radius,
GFX_COLOR faceClr,
GFX_COLOR embossLtClr,
GFX_COLOR embossDkClr,
void *pBitmap,
WORD embossSize)
Sets up the parameters to draw a panel. Use this API to set
up GOLPanelDrawTsk() and GOLTwoTonePanelDrawTask().
WORD GOLPanelDrawTsk()
Renders a panel with the parameters set by
GOLPanelDraw().
WORD GOLTwoTonePanelDrawTsk()
Renders a two tone panel with the parameters set by
GOLPanelDraw().
WORD GetState(
OBJ_HEADER *pObj,
WORD stateBits)
Returns the current value of the state bits of the widget.
void SetState(
OBJ_HEADER *pObj,
WORD stateBits)
Sets the state bit(s) of the widget.
void ClrState(
OBJ_HEADER *pObj,
WORD stateBits)
Clears the state bit(s) of the widget.
void GOLMsg(GOL_MSG *pMsg)
Process the GOL_MSG and checks which widget is
affected by the message. For each affected widget,
GOLMsgCallback() is called for the application to have an
opportunity to customize the reaction to the message and
cancel or call the default reaction to the message.
WORD GOLMsgCallback(
WORD objMsg,
OBJ_HEADER * pObj,
GOL_MSG * pMsg)
Function implemented in the application. Function called
by GOLMsg() to allow application to implement its own
interpretation of messages and customize widget behavior.
GOL_SCHEME * GOLCreateScheme()
Creates a style scheme object with application dened styles
or using graphics library assigned default styles.
void GOLSetScheme(
OBJ_HEADER *pObj,
GOL_SCHEME *pScheme)
Sets the GOL_SCHEME to be used for the widget.
GOL_SCHEME *GOLSetScheme(
OBJ_HEADER *pObj)
Gets the GOL_SCHEME used by the widget.
GOL_SCHEME *GOLGetSchemeDefault()
Returns the pointer to the default scheme created when
GOLInit() is called.
GFX_COLOR RGBConvert(
WORD red,
WORD green,
WORD blue)
Converts 8-8-8 RGB color data to color format set by
COLOR_DEPTH.
Microchip Graphics Library Quick Reference Guide