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
-
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/
-
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
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.
-
emWin (not free software)
-
C/PEG (not free software)
-
easyGUI (not free software)
-
Contiki, a whole RTOS, not just GUI
-
menuDesigner, GPL
-
EmbeddedGUI, LGPL
-
pwlib, GPLv2+
-
u8glib, New BSD License (3-clause)
-
µGUI, custom open source license (allows commercial use)