QTools  5.9.3
QWin™ GUI Prototyping Toolkit

When developing embedded code for devices with non-trivial user interfaces, it often pays off to build a prototype (virtual prototype) of the embedded system of a PC. The strategy is called "dual targeting", because you develop software on one machine (e.g., Windows PC) and run it on a deeply embedded target, as well as on the PC. Dual targeting is the main strategy for avoiding the "target system bottleneck" in the agile embedded software development.

Please note that dual targeting does not mean that the embedded device has anything to do with the PC. Neither it means that the simulation must be cycle-exact with the embedded target CPU. Instead, dual targeting simply means that from day one, your embedded code (typically in C) is designed to run on at least two platforms: the final target hardware and your PC. All you really need for this is two C compilers: one for the PC and another for the embedded device.

QWin™ GUI Prototyping Toolkit

QWin™ is a free GUI toolkit for prototyping embedded systems on Windows in the C programming language, including building realistic embedded front panels consisting of LCD displays (both graphic and segmented), LEDs, buttons, knobs, sliders, etc. The implementation is based on the raw Win32 API to provide simple direct mapping to C for easy integration with your embedded code.

Example of a QWIN Prototype with graphic LCD, buttons, LEDs, and segmented display
The problem of building GUI prototypes of embedded devices on the desktop is very common, yet it seems that most developers try to use C#, .NET, VisualBasic or other such environments to build prototypes of their embedded devices. The main shortcoming of all such solutions is that they don't provide direct binding to C, which complicates the build process and the debugging of the C code on the host.

QWin™ Usage

QWin™ is included in the QTools™ Collection in the sub-directory qtools/qwin/ and consists of just two files: qwin_gui.h containing the interface and qwin_gui.c providing the implementation. You use QWin™ by including these files in your projects.

QWin™ Features

Currently QWin™ provides the following facilities:

  • Graphic displays (pixel-addressable) such as graphical LCDs, OLEDs, etc. with up to 24-bit color
  • Segmented displays such as segment LCDs, and segment LEDs with generic, custom bitmaps for the segments.
  • Owner-drawn buttons with custom “depressed” and “released” bitmaps and capable of generating separate events when depressed and when released. Additionally, the provided code shows how to handle input sources:
  • Keyboard events
  • Mouse move events and mouse-wheel events

QWin™ Documentation

QWin™ GUI Prototyping Toolkit is described in the Application Note: Application Note: QWIN GUI Kit for Prototyping Embedded Systems on Windows.

Application Note: QWIN GUI Kit for Prototyping Embedded Systems on Windows

Regarding the size and complexity of the “QWin™ GUI Toolkit“, the implementation of the aforementioned GUI elements takes only about 250 lines of C. The example with all sources of input and a lot of comments amounts to some 300 lines of C. The toolkit has been tested with the free MinGW compiler (included in the QTools™ Collection for Windows), the free Visual C++ Express, and the free ResEdit resource editor.

Next: QClean Code Whitespace Cleanup