Abstraction Layer API

Principle

The MicroUI implementation for MicroEJ requires an Abstraction Layer implementation. This Abstraction Layer implementation finalizes the MicroUI implementation started with the static initialization step (see Static Initialization) for a given VEE Port.

The Abstraction Layer implementation consists in a set of headers files to implement in C to target the hardware drivers. Some functions are mandatory, others are not. Some other headers files are also available to call UI engines internal functions.

For the simulator, some Front Panel interfaces and classes allow to specify the simulated VEE Port characteristics.

Embedded VEE Port

MicroUI Abstraction Layer

MicroUI Embedded Abstraction Layer API

The specification of header files names is:

  • Name starts with LLUI_.
  • Second part name refers the UI engine: DISPLAY, INPUT, LED.
  • Files whose name ends with _impl list functions to implement over hardware.
  • Files whose name has no suffix list internal UI engines functions.

There are some exceptions :

  • LLUI_PAINTER_impl.h and LLDW_PAINTER_impl.h list a subpart of UI Graphics Engine functions to implement (all MicroUI native drawing methods).
  • ui_drawing_soft.h and dw_drawing_soft.h list all drawing methods implemented by the Graphics Engine.
  • microui_constants.h is the file generated by the MicroUI Static Initializer (see Static Initialization).

The MicroUI C module provides a default implementation of the UI Pack Abstraction Layer API:

  • LLUI_PAINTER_impl.c and LLDW_PAINTER_impl.c manage the synchronization with the Graphics Engine and redirect all drawings to ui_drawing.h and ui_image_drawing.h.
  • ui_drawing.h and ui_image_drawing.h list all drawing methods the VEE Port can implement.
  • ui_drawing.c and ui_image_drawing.c are the default implementation of ui_drawing.h and ui_image_drawing.h that redirects all drawings to ui_drawing_soft.h and dw_drawing_soft.h.

The BSP has to implement LLUI_xxx header files and optionally ui_drawing.h and ui_image_drawing.h (to draw using a GPU and/or to draw in a custom BufferedImage).

All header files and their aims are described in next UI engines chapters: LED, Input and Display.

Simulator

MicroUI Abstraction Layer

MicroUI Simulator Abstraction Layer API

In the simulator the three UI engines are grouped in a mock called Front Panel. The Front Panel comes with a set of classes and interfaces which are the equivalent of headers file (*.h) of Embedded VEE Port.

The specification of class names is:

  • Package are the same than the MicroUI library (ej.microui.display, ej.microui.event, ej.microui.led).
  • Name start with LLUI.
  • The second part of the name refers the UI engine: Display, Input, Led.
  • Files whose name ends with Impl list methods to implement like in the embedded VEE Port.
  • Files whose name has no suffix list internal UI engine functions.

There are some exceptions :

  • LLUIPainter.java and LLDWPainter.java list a subpart of UI Graphics Engine functions (all MicroUI native drawing methods).
  • UIDrawing.java and DWDrawing.java list all drawing methods the VEE Port can implement (and already implemented by the Graphics Engine).
  • EventXXX list methods to create input events compatible with MicroUI implementation.

All files and their aims are described in Simulation.