Miniwinwm Save

Open source embedded window manager with overlapped windows. This project is actively maintained and free support is provided via the website. New features can be added on request. Consultancy can provided for commercial use.

Project README

MiniWin Embedded Window Manager

MiniWin is a generic open source overlapped window manager for small embedded systems with a touch screen. It is written in compliant C99 and is easily portable. The hardware interface is separated out into a small hardware abstraction layer making the rest of the system re-targetable to a wide variety of processors. MiniWin will run easily on ARM Cortex M0 or above, PIC32 or Renesas RX processors. MiniWin has a simple easy to understand API giving access to fully overlapped windows. The standard look and feel is easy to customize to your needs. Included with MiniWin are two sets of standard controls in standard and large sizes and a growing library of standard dialogs windows. All code developed for MiniWin and MiniWin generated code is MISRA 2012 'required' compliant.

MiniWin News

MiniWin is being ported to a new hardware platform and RTOS - Renesas Synergy running ThreadX. This uses the PK-S5D9 development board with a built in touchscreen LCD. This process is under development and more projects and documentation update will follow.

Who is MiniWin for?

  • Open source projects that need a quick-start user interface
  • Small commercial products that do not have the budget to buy a window manager or the manpower to develop one
  • Hardware constrained devices that have limited resources but also have limited requirements
  • Student projects that can build on the supplied example code
  • Developers who want a quick-start user interface without the need for extensive driver development effort

Features

  • Written specifically for small embedded systems with a LCD display and a touch screen
  • Apart from a small hardware abstraction layer, platform independent
  • Supports multiple overlapped windows with Z ordering
  • Supports display rotation
  • Incorporates a flexible graphics library
  • Comes with a 2 sets of user interface controls - standard size for use with a touch screen and stylus, and large size for touch screen with finger input.
  • Includes a set of standard dialogs that need no further code written to use.
  • No dynamic memory used - all data structures allocated at compile time
  • Two different sized standard bitmapped fonts included - fixed width and proportional - and 4 further optional bitmapped fonts. Any bitmapped font can be plotted in 4 rotations.
  • TrueType font rendering support allowing you to to render justified, kerned, anti-aliased text on screen using a TrueType font of your choice.
  • A clean easy to use API
  • Comprehensive documentation and example code
  • Runs in bare metal systems or within a single thread of a RTOS.
  • Example projects showing FatFS (with USB host or SD interface), FreeRTOS integration, and TrueType font rendering.
  • Requires minimal memory.
  • Compiles without warning with GCC, clang, CL, XC32 or CC-RX
  • Doxygen documentation for every function and type
  • In-built touch screen calibration capability the first time the window manager is started.
  • Code generator to create all your windows and controls from a simple configuration file in JSON format.
  • Windows and Linux simulations allow for rapid user interface code development before hardware is available and without time consuming reflashing.

User Interface Controls

  • Button
  • Check box
  • List box with optional icons
  • Radio buttons
  • Menu bar
  • Text label
  • Progress bar
  • Horizontal scroll bar
  • Vertical scroll bar
  • Multi-directional arrow buttons
  • Numeric keypad
  • ASCII keyboard
  • TrueType text box with rendering of justified kerned anti-aliased text.
  • Multiple tabs
  • Expandable tree
These are the standard ones. You can easily add more.

MiniWin Windows

  • Optional title bar, menu bar, title and border
  • Overlapped with unique Z order
  • Movable
  • Resizable
  • Maximise, minimise, resize and close icons
  • Minimizable to icon on desktop
  • Customizable desktop colour or bitmap
  • Can have a single system modal window
  • Window-aware graphics library for drawing in a window
  • Standard or large sized features

Of course, you don't have to use overlapped windows at all. If you want fixed dedicated areas of the display with each area being responsive to user input and having its own message and paint functions, that's possible too. Any window can be created with no border or title bar, and like this it's fixed on the screen.

Standard Dialogs

MiniWin includes a collection of pre-defined standard dialogs. You don't have to do any window definition or coding to use these, just call the utility function to get it displayed. Each dialog can have its appearance controlled from the utility function parameters, for example the message to display in the message box dialogs and the text shown in the title bar.

  • Single button message box
  • Double button message box
  • Time chooser
  • Date chooser
  • Text entry dialog
  • Number entry dialog
  • File or folder chooser dialog

Quick Start Guide

See https://miniwinwm.wixsite.com/miniwinwm/quick-start-guide for a quick start guide using STM32CubeIDE.

Documentation

See https://github.com/miniwinwm/miniwinwm/blob/master/MiniWin/docs/MiniWin.pdf for extensive documentation.

Window Management API

See https://miniwinwm.wixsite.com/miniwinwm/window-management-api for an overview of the window management API.

Developer Utility Applications

MiniWin includes the following utility applications with source code which can be built for Windows or Linux from source:

  • Converter for monochrome bitmap files in .bmp format to C99 source code.
  • Converter for 24 bit colour bitmap files in .bmp format to C99 source code.
  • Converter for TrueType font files to run-length encoded C99 source file for a single point size
  • Code generator to create your window and control code from a JSON format configuration file.

Drivers and Examples

MiniWin comes with all source for the window manager, graphics library and user interface components. It also comes with 8 example projects - a simple getting started example, a non-overlapped fixed windows example, an example that integrates a USB pen drive or SD card to read and show text and image files, an example integrated with FreeRTOS, a TrueType font demonstration, an example showing root window capabilities, a project showing usage of all MiniWin's user interface components and a project that interfaces with a video camera showing a video stream in a MiniWin window. MiniWin comes with 14 HAL layer samples:

  • STM32F4DISCOVERY board using an ILI9341 driven QVGA LCD with touch screen
  • STM32F429I-DISC1 board with built in QVGA LCD with touch screen
  • ESP32 based DevKitC board using an ILI9341 driven QVGA LCD with touch screen built using ESP32-IDF
  • ESP32 based DevKitC board using an ILI9341 driven QVGA LCD with touch screen built using Arduino IDE
  • NXP 54628 board with built in WQVGA LCD and touch screen
  • Renesas Envision Kit board running RX65N processor with built in WQVGA LCD with touch screen built with CC-RX
  • Renesas Envision Kit board running RX65N processor with built in WQVGA LCD with touch screen built with GCC-RX
  • Renesas Synergy PK-S5D9 development board with built in QVGA LCD with touch screen
  • Microchip PIC32MX board using an ILI9341 driven QVGA LCD with touch screen
  • Microchip PIC32MZ board using an ILI9341 driven QVGA LCD with touch screen
  • Raspberry Pi Zero W board using an ILI9341 driven QVGA LCD with touch screen
  • Raspberry Pi Pico board using an ILI9341 driven QVGA LCD with touch screen
  • Arduino Due board with Atmel ATSAM3X8E processor using an ILI9341 driven QVGA LCD with touch screen built with Atmel Studio
  • Linux simulator built with GCC or clang
  • Windows simulator built with GCC or clang under MSYS2
  • Windows simulator built with Microsoft Visual Studio CL
Sample simulation projects are built using standalone gmake makefiles with GCC or clang for Windows and Linux or Microsoft Visual Studio CL compiler via nmake makefiles for Windows. Eclipse project files are provided for the Windows and Linux simulation projects. Build/project files are provided for all examples.

MiniWin has the ability to debug on Windows or Linux running the simulators. Develop your embedded part of your application on target, but do the user interface development part on the simulators on Windows or Linux. This allows much quicker debugging than flashing to target every time you make a change.

Graphics Library

MiniWin comes with a standard graphics library supporting the normal lines, bitmapped and TrueType font rendering, bitmaps and shapes as well as polygon and shape rotation. It includes simple patterned lines and texture fills.

All graphics library drawing routines are window aware - you do not have to worry about where your window is, if it is overlapped or partly off screen. You just draw to a window's client area regardless using the client area as your frame of reference. MiniWin performs all window offset translations and clipping required. You will never end up drawing outside of your window or scribbling somewhere you shouldn't.

Customisability

Because MiniWin is open source its look and feel is fully customisable. Don't like the look of a user interface component? Simple. Modify its paint function and draw it how you want it to look.

Window Paint Algorithm

MiniWin uses a paint algorithm that is optimised for use on a system without any off-screen shadow buffers for its windows, i.e. all writes to the display memory via the graphics library are shown immediately on the display. To avoid flickering each part of the display is written to only once for each repaint request regardless of how overlapped the windows are. The paint algorithm used is the singly-combined sorted intersections algorithm.

Source Tree

The source code tree is quite complicated so is explained here:

Arduino: This contains project files and application code specific to example applications that run on Arduino boards (currently ESP32 based DevKitC) and are built using the Arduino IDE. Under this folder is a sub-folder for each targeted Arduino board, DevKitC, and under each of this a further sub-folder for each application example. In these folders are a setup.bat file which must be run before the Arduino IDE is started, hardware configuration code needed by the example application in the app folder, and the Arduino IDE .ino file. When the setup.bat file is run a src directory is created that creates hard links to the source and header files in the MiniWin folder structure. This src folder can be safely deleted as it only contains links created by the setup.bat file.

Atmel: This contains project files and application code specific to example applications that run on Microchip/Atmel processors and are built using the Microchip/Atmel Studio. Under this folder are sub-folders for each targeted processor (ATSAM3X8E). Under these folders are further sub-folder for each application example. In these folders are Microchip/Atmel Studio project files, the required BSP for that application and under the src folder source files that are both application and hardware variant specific.

Renesas: This contains project files and application code specific to example applications that run on Renesas processors (currently RX65N) and are built using the Renesas e2 Studio IDE and the Renesas RX-CC or GCC-RX compilers. Under this folder is a sub-folder for each targeted Renesas processor/compiler, RX65N or RX65N_GCC, and under each of these a further sub-folder for each application example. In these folders are e2 Studio project files and the start-up code for that application. Under the src folder are source files that are both application and hardware variant specific. In the root folder for each RX-CC compiler project is a .scfg file used to configure the hardware.

Espressif: This contains project files and application code specific to example applications that run on ESP32 processors and are built using the ESP supplied IDF build system. Under this folder is a sub-folder for each targeted ESP32 development board (DevKitC). Under this folder is a further sub-folder for each application example. In these folders are the main and the component CMake files, the SDK configuration file for that application and under the main folder source files that are both application and hardware variant specific.

NXP: This contains project files, BSP and application code specific to example applications that run on NXP processors and are built using the NXP MCUXpresso IDE. Under this folder is a sub-folder for each targeted NXP processor (LPC54628). Under this folder are further sub-folder for each application example. In these folders are MCUXpresso project files, the required BSP for that application and under the src folder source files that are both application and hardware variant specific.

ST: This contains project files, BSP and application code specific to example applications that run on ST processors and are built using the STM32CubeIDE. Under this folder are 2 sub-folders for each targeted processor (STM32F407 ands STM32F429). Under these folders are further sub-folder for each application example. In these folders are STM32CubeIDE project files, the required BSP for that application and under the src folder source files that are both application and hardware variant specific.

Microchip: This contains project files and application code specific to example applications that run on Microchip processors and are built using the MPLAB X. Under this folder are 2 sub-folders for each targeted processor (PIC32MX470F512H and PIC32MZ2048EFM100). Under these folders are further sub-folder for each application example. In these folders are MPLAB X project files, the required BSP for that application and under the src folder source files that are both application and hardware variant specific.

RaspberryPi: This contains project files and application code specific to example applications that run on Raspberry Pi boards and are built using make and GCC natively on the Raspberry Pi. Under this folder are sub-folders for each targeted board (Zero W and Pico). Under this folder is a further sub-folder for each application example. This contains project files that are built using make and GCC. In Raspberry Pi OS GCC will always be available.

Simulation: This contains project files for example applications that are built to run on a computer as a simulation rather than on embedded hardware. Under this folder are sub-folders for each targeted simulation platform (Windows and Linux). Under these folders are further sub-folder for each application example. These sub-folders each contain a makefile/nmakefile to build the example application using GCC/Visual Studio CL.

MiniWin: This contains the MiniWin embedded window manager source code which is common to all example applications for all platforms and processors. It contains the following sub-folders:

bitmaps: Bitmaps and their C99 file encodings used by MiniWin
dialogs: Standard dialogs provided by MiniWin
docs: All documentation
gl: The graphics library incorporated in MiniWin including fonts
templates: Templates of required application files
ui: Standard user interface controls. User code can add to this for further controls if required
hal: Source files common to all hal implementations and then further source files in sub-folder for different currently supported platforms and processors. Each set of drivers for a particular target builds only for that target. Other different target files compile to nothing through the use of #defines.

In addition the following source files are in the MiniWin folder:

calibrate.h/c: Third party touch screen calibration routines
miniwin_debug.h/c: Implementation of assert functionality, debug build only
miniwin_message_queue.h/c: Simple message queue code for MiniWin messages
miniwin_settings.h/c: Simple non-volatile storage routines for settings
miniwin_touch.h/c: Interface between touch driver code under hal and the touch client code in MiniWin
miniwin_tree_container.h/c: Tree container storage utility
miniwin_utilities.h/c: Generic utility routines
miniwin.h/c: The main window manager code

MiniWinTest_Common: This contains application source files for the comprehensive MiniWinTest example that are common to all platform/processor variants.

MiniWinSimple_Common: This contains the application example source files described later in this document.

MiniWinFixedWindows_Common: As above but for the fixed windows example project.

MiniWinRoot_Common: As above but for the root window example project.

MiniWinFile_Common: As above but for the file example project.

MiniWinTTFonts_Common: As above but for the TrueType font rendering example project.

MiniWinFreeRTOS: As above but for the FreeRTOS integration example project.

MiniWinCamera: As above but for the video camera integration example project.

Tools: This contains the utility applications that are part of MiniWin that are built for Linux or Windows using GCC. This folder contains the following sub-folders:

BMPConv24Colour: This is a command line utility for converting a Windows 24 bit per pixel .bmp file to a 3 bytes per per pixel C99 source file. It uses EasyBMP.

BMPConvMono: This is a command line utility for converting a Windows 2 bit per pixel .bmp file to an 8 pixels per byte C99 source file. It uses EasyBMP.

CodeGen: This contains the MiniWin code generator utility. It is described later in this document.

FontEncoder: This is a command line utility for converting a TrueType font file to a run-length encoded C99 source file. It comes as part of the mcufonts library.

EasyBMP: This is source code for a third party Windows .bmp file handling library. It is used by the utility applications, not MiniWin.

Open Source Agenda is not affiliated with "Miniwinwm" Project. README Source: miniwinwm/miniwinwm

Open Source Agenda Badge

Open Source Agenda Rating