EasyGUI  v0.1
Platform independent GUI Library
Visibility management

Visibility management functions. More...

Functions

uint8_t gui_widget_show (GUI_HANDLE_p h)
 Show widget from visible area. More...
 
uint8_t gui_widget_hide (GUI_HANDLE_p h)
 Hide widget from visible area. More...
 
uint8_t gui_widget_putonfront (GUI_HANDLE_p h)
 Put widget to front view and put it to focused state. More...
 
uint8_t gui_widget_gettransparency (GUI_HANDLE_p h)
 Get widget transparency value. More...
 
uint8_t gui_widget_settransparency (GUI_HANDLE_p h, uint8_t trans)
 Set transparency level to widget. More...
 

Detailed Description

Visibility management functions.

Widget transparency

Library support transparency setup on widget. For this, special blending function must be enabled (best if support on hardware).

image_transparent_buttons.png
Transparent of 0x80 on button over opaque button

When transparency on widget should be used, additional RAM is used:

\(\ size=WidgetVisibleWidth*WidgetVisibleHeight*BytesPerPixel\)

The additional RAM usage is used if widget has transparency and its children has also custom transparency. In this case, RAM used is for each widget separatelly and depends on number of tree length of widgets of transparency values.

Blending technique for transparency

Imagine this setup:

At some time, Widget1 has transparency = 0x80 (0.5) and Widget 3 has transparency = 0x40 (0.25)

Drawing process would go like this:

  1. Draw desktop widget on default drawing frame buffer
  2. Allocate memory for visible widget part for widget 1 and set RAM as drawing buffer
  3. Draw widget 1 on drawing buffer (allocated RAM)
  4. Draw widget 2 on drawing buffer (still allocated RAM of previous widget)
  5. Allocate memory for visible widget part for widget 3 and set RAM as drawing buffer
  6. Draw widget 3 on drawing buffer (latest allocated RAM of widget 3)
  7. With blending technique, merge widget 3 frame buffer with widget 1 frame buffer
  8. Set frame buffer back to widget 1 allocated RAM
  9. With blending technique, merge widget 1 frame buffer with desktop frame buffer
  10. Set frame buffer back to default drawing frame buffer

Function Documentation

uint8_t gui_widget_gettransparency ( GUI_HANDLE_p  h)

Get widget transparency value.

Note
Value between 0 and 0xFF is used:
  • 0x00: Widget is hidden
  • 0xFF: Widget is fully visible
  • between: Widget has transparency value
Parameters
[in,out]hWidget handle
Return values
Trasparencyvalue
See also
gui_widget_settransparency
uint8_t gui_widget_hide ( GUI_HANDLE_p  h)

Hide widget from visible area.

Parameters
[in,out]hWidget handle
Return values
1Widget was hidden ok
0Widget was not hidden
See also
gui_widget_show, gui_widget_putonfront
uint8_t gui_widget_putonfront ( GUI_HANDLE_p  h)

Put widget to front view and put it to focused state.

Parameters
[in,out]hWidget handle
Return values
1Widget was put ok
0Widget was not put
See also
gui_widget_hide
uint8_t gui_widget_settransparency ( GUI_HANDLE_p  h,
uint8_t  trans 
)

Set transparency level to widget.

Parameters
[in,out]hWidget handle
[in]transTransparency level, where 0x00 means hidden and 0xFF means totally visible widget
Return values
1Transparency set ok
0Transparency was not set
See also
gui_widget_gettransparency
uint8_t gui_widget_show ( GUI_HANDLE_p  h)

Show widget from visible area.

Parameters
[in,out]hWidget handle
Return values
1Text was shown ok
0Text was not shown
See also
gui_widget_hide