Skip to content

bjornfor/fgui

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

fgui - GUI toolkit for microcontrollers

Warning
fgui is pre-alpha software.

fgui is a small GUI toolkit written in C. It is designed to run on very small embedded systems, i.e. 8-bit microcontrollers and up, while still providing an easy to use API.

fgui widgets are placed in a tree structure and input events propagate from the currently focused widget and all the way up to the root widget. If a widget signals that it has handled the event, the propagation stops. Widgets that support user callbacks also support a userdata pointer.

To use fgui, the application must initialize its display device and supply an implementation of this function:

fgui_set_pixel(uint16_t x, uint16_t y, uint32_t color)

Then include fgui.h and explore the API. Basic drawing primitives such as line and rectangle are located in fgui_primitives.h. Font drawing is in fgui_font.h and the widgets are located in fgui_<widget>.h. fgui is object-oriented and fgui_widget.h is the base "class" for all widgets.

fgui comes with an SDL demo program, try it:

$ cd fgui
$ mkdir build
$ cd build
$ cmake ..
$ cmake --build .
$ ./demo/fgui_demo

Features

  • basic drawing primitives:

    • line

    • rectangle (empty + filled)

    • circle (empty + filled)

    • triangle (only empty)

  • monospaced font drawing

  • widgets:

    • label

    • push button - supports "on click" callback

    • lineedit - single line text input

    • combobox - supports "item changed" callback

  • no dynamic memory allocation

  • example/demo program using fgui with SDL, http://www.libsdl.org/

Planned features

  • widgets:

    • hierarchical menu (submenus and actions)

  • widget coordinates relative to parent

  • make parent widgets draw their children (currently all widgets must be drawn manually by the application)

  • clipping (widgets should not draw anything outside their border)

  • input validators (for textedit)

  • multi-tap input method

License

fgui is released under the MIT open source license. See LICENSE.txt or go to http://www.opensource.org/licenses/MIT for full license text.

About

GUI toolkit for microcontrollers

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published