About this document
Table of Contents
Introduction to emWin
1.1 Purpose of this document
1.2 Requirements
1.2.1 Target system (hardware)
1.2.2 Development environment (compiler)
1.3 Features
1.4 Examples and demos
1.5 Starter kits
1.6 Screen and coordinates
1.7 How to connect the display to the micro controller
1.8 Data types
Getting Started
2.1 Recommended project structure
2.1.1 Subdirectories
2.1.2 Include directories
2.2 Adding emWin to the target program
2.3 Creating a library
2.3.1 Adapting the library batch files to a different system
2.4 C files to include in the project
2.5 Configuring emWin
2.6 Initializing emWin
2.7 Using emWin with target hardware
2.8 The "Hello world" example program
Simulation
3.1 Using the simulation
3.1.1 Using the simulation with the trial version of emWin
3.1.2 Using the simulation with the emWin source
3.1.3 Advanced features of the simulation
3.2 Device simulation
3.2.1 Generated frame view
3.2.2 Custom bitmap view
3.2.3 Window view
3.3 Device simulation API
3.4 Hardkey simulation
3.4.1 Hardkey simulation API
3.5 Integrating the emWin simulation into an existing simulation
3.5.1 Directory structure
3.5.2 Using the simulation library
3.5.3 Integration into the embOS Simulation
3.5.4 GUI simulation API
Viewer
4.1 Using the viewer
4.1.1 Using the simulation and the viewer
4.1.2 Using the viewer with virtual pages
4.1.3 Always on top
4.1.4 Open further windows of the display output
4.1.5 Zooming
4.1.6 Copy the output to the clipboard
4.1.7 Using the viewer with multiple displays
4.1.8 Using the viewer with multiple layers
Displaying Text
5.1 Basic routines
5.2 Text API
5.3 Routines to display text
5.4 Selecting text drawing modes
5.5 Selecting text alignment
5.6 Setting the current text position
5.7 Retrieving the current text position
5.8 Routines to clear a window or parts of it
Displaying Values
6.1 Value API
6.2 Displaying decimal values
6.3 Displaying floating point values
6.4 Displaying binary values
6.5 Displaying hexadecimal values
6.6 Version of emWin
2-D Graphic Library
7.1 Graphic API
7.2 Drawing modes
7.3 Query current client rectangle
7.4 Pen size
7.5 Basic drawing routines
7.6 Alpha blending
7.7 Drawing bitmaps
7.8 Drawing streamed bitmaps
7.9 Drawing lines
7.10 Drawing polygons
7.11 Drawing circles
7.12 Drawing ellipses
7.13 Drawing arcs
7.14 Drawing graphs
7.15 Drawing pie charts
7.16 Saving and restoring the GUI-context
7.17 Clipping
Displaying bitmap files
8.1 BMP file support
8.1.1 Supported formats
8.1.2 BMP file API
8.2 JPEG file support
8.2.1 Supported JPEG compression methods
8.2.2 Converting a JPEG file to C source
8.2.3 Displaying JPEG files
8.2.4 Memory usage
8.2.5 Progressive JPEG files
8.2.6 JPEG file API
8.3 GIF file support
8.3.1 Converting a GIF file to C source
8.3.2 Displaying GIF files
8.3.3 Memory usage
8.3.4 GIF file API
8.4 PNG file support
8.4.1 Converting a PNG file to C source
8.4.2 Displaying PNG files
8.4.3 Memory usage
8.4.4 PNG file API
8.5 Getting data with the ...Ex() functions
Bitmap Converter
9.1 What it does
9.2 Loading a bitmap
9.2.1 Supported input file formats
9.2.2 Loading from a file
9.2.3 Using the clipboard
9.3 Color conversion
9.4 Using a custom palette
9.4.1 Saving a palette file
9.4.2 Palette file format
9.4.3 Palette files for fixed palette modes
9.4.4 Converting a bitmap
9.5 Generating C files from bitmaps
9.5.1 Supported bitmap formats
9.5.2 Palette information
9.5.3 Transparency
9.5.4 Alpha blending
9.5.5 Selecting the best format
9.5.6 Saving the file
9.6 Generating C stream files
9.7 Compressed bitmaps
9.8 Creating animated sprites / cursors
9.9 Command line usage
9.9.1 Format for commands
9.9.2 Valid command line options
9.10 Example of a converted bitmap
Fonts
10.1 Introduction
10.2 Font types
10.3 Font formats
10.3.1 C file format
10.3.2 System Independent Font (SIF) format
10.3.3 External Bitmap Font (XBF) format
10.3.4 iType font engine support
10.3.5 TrueType Font (TTF) format
10.4 Converting a TTF file to C source
10.5 Declaring custom fonts
10.6 Selecting a font
10.7 Font API
10.8 C file related font functions
10.9 ’SIF’ file related font functions
10.10 ’TTF’ file related font functions
10.11 ’XBF’ file related font functions
10.12 Common font-related functions
10.13 Character sets
10.13.1 ASCII
10.13.2 ISO 8859-1 Western Latin character set
10.13.3 Unicode
10.14 Font Converter
10.14.1 Adding fonts
10.15 Standard fonts
10.15.1 Font identifier naming convention
10.15.2 Font file naming convention
10.15.3 Measurement, ROM-size and character set of fonts
10.15.4 Proportional fonts
10.15.5 Proportional fonts, framed
10.15.6 Monospaced fonts
10.15.7 Digit fonts (proportional)
10.15.8 Digit fonts (monospaced)
Font Converter
11.1 Requirements
11.2 Using the Font Converter
11.2.1 Creating an emWin font file from a Windows font
11.2.2 Font generation options dialog
11.2.3 Font Dialog
11.2.4 User Interface
11.3 Options
11.3.1 Saving the font
11.3.2 Modifying an existing C font file
11.3.3 Merging fonts with existing C font files
11.4 Pattern files
11.4.1 Creating pattern files using Notepad
11.4.2 Creating pattern files using the Font Converter
11.4.3 Enabling characters using a pattern file
11.5 Supported output modes
11.5.1 Standard mode
11.5.2 Antialiased modes
11.6 Command line options
11.6.1 Table of commands
11.6.2 Execution examples
11.7 Font Examples
11.7.1 Resulting C code, standard mode
11.8 Resulting C code, 2 bpp antialiased mode
11.9 Resulting C code, 4 bpp antialiased mode
11.10 Resulting C code, extended mode
Movies
12.1 Introduction
12.2 Requirements
12.3 Creating JPEG files with FFmpeg.exe
12.4 Creating an EMF file
12.5 Modifying the conversion result
12.6 Using JPEG2Movie
12.7 Movies API
Colors
13.1 Predefined colors
13.2 The color bar test routine
13.3 Fixed palette modes
13.4 Detailed fixed palette mode description
13.5 Application defined color conversion
13.6 Custom palette mode
13.7 Gamma correction
13.8 Color API
13.8.1 Basic color functions
13.8.2 Index & color conversion
Memory Devices
14.1 Using Memory Devices: an illustration
14.2 Supported color depth (bpp)
14.3 Memory Devices and the Window Manager
14.4 Memory Devices and multiple layers
14.5 Memory requirements
14.6 Performance
14.7 Basic functions
14.8 In order to be able to use Memory Devices...
14.9 Multi layer / multi display configurations
14.10 Configuration options
14.11 Memory device API
14.12 Basic functions
14.13 Banding Memory Device
14.14 Auto device object
14.15 Measurement device object
14.16 Animation functions
14.17 Animation functions (Window Manager required)
14.18 Blurring functions
14.19 Blurring and Blending functions (Window Manager required)
Execution Model: Single Task / Multitask
15.1 Supported execution models
15.2 Single task system (superloop)
15.2.1 Description
15.2.2 Superloop example (without emWin)
15.2.3 Advantages
15.2.4 Disadvantages
15.2.5 Using emWin
15.2.6 Superloop example (with emWin)
15.3 Multitask system: one task calling emWin
15.3.1 Description
15.3.2 Advantages
15.3.3 Disadvantages
15.3.4 Using emWin
15.4 Multitask system: multiple tasks calling emWin
15.4.1 Description
15.4.2 Advantages
15.4.3 Disadvantages
15.4.4 Using emWin
15.4.5 Recommendations
15.4.6 Example
15.5 Configuration functions for multitasking support
15.6 Configuration macros for multitasking support
15.7 Kernel interface API
15.7.1 Examples
The Window Manager (WM)
16.1 Description of terms
16.2 Callback mechanism, invalidation, rendering and keyboard input
16.2.1 Rendering without callbacks
16.2.2 Rendering using callbacks
16.2.3 Overwriting callback functions
16.2.4 Background window redrawing and callback
16.2.5 Invalidation
16.2.6 Rendering of transparent windows
16.2.7 Automatic use of memory devices
16.2.8 Automatic use of multiple frame buffers
16.2.9 Automatic use of display driver cache
16.2.10 Keyboard input
16.3 Motion support
16.3.1 Enabling motion support of the WM
16.3.2 Basic motion support for a window
16.3.3 Advanced motion support
16.4 ToolTips
16.4.1 How they work
16.4.2 Creating ToolTips
16.5 Messages
16.5.1 Message structure
16.5.2 List of messages
16.5.3 System-defined messages
16.5.4 Pointer input device (PID) messages
16.5.5 System-defined notification codes
16.5.6 Application-defined messages
16.6 Configuration options
16.7 WM API
16.7.1 Using the WM API functions
16.7.2 WM API: Basic functions
16.7.3 WM API: Motion support
16.7.4 WM API: ToolTip related functions
16.7.5 WM API: Memory device support (optional)
16.7.6 WM API: Timer related functions
16.7.7 WM API: Widget related functions
16.8 Example
Window Objects (Widgets)
17.1 Some basics
17.1.1 Available widgets
17.1.2 Custom widgets
17.1.3 Understanding the redrawing mechanism
17.1.4 How to use widgets
17.2 Configuration options
17.3 Widget IDs
17.4 General widget API
17.4.1 WM routines used for widgets
17.4.2 Common routines
17.4.3 User drawn widgets
17.5 BUTTON: Button widget
17.5.1 Configuration options
17.5.2 Predefined IDs
17.5.3 Notification codes
17.5.4 Keyboard reaction
17.5.5 BUTTON API
17.5.6 Examples
17.6 CHECKBOX: Checkbox widget
17.6.1 Configuration options
17.6.2 Predefined IDs
17.6.3 Notification codes
17.6.4 Keyboard reaction
17.6.5 CHECKBOX API
17.6.6 Example
17.7 DROPDOWN: Dropdown widget
17.7.1 Configuration options
17.7.2 Predefined IDs
17.7.3 Notification codes
17.7.4 Keyboard reaction
17.7.5 DROPDOWN API
17.7.6 Example
17.8 EDIT: Edit widget
17.8.1 Configuration options
17.8.2 Predefined IDs
17.8.3 Notification codes
17.8.4 Keyboard reaction
17.8.5 EDIT API
17.8.6 Examples
17.9 FRAMEWIN: Frame window widget
17.9.1 Structure of the frame window
17.9.2 Configuration options
17.9.3 Keyboard reaction
17.9.4 FRAMEWIN API
17.9.5 Example
17.10 GRAPH: Graph widget
17.10.1 Structure of the graph widget
17.10.2 Creating and deleting a graph widget
17.10.3 Drawing process
17.10.4 Supported types of curves
17.10.5 Configuration options
17.10.6 Predefined IDs
17.10.7 Keyboard reaction
17.10.8 GRAPH API
17.10.9 Examples
17.11 HEADER: Header widget
17.11.1 Configuration options
17.11.2 Notification codes
17.11.3 Keyboard reaction
17.11.4 HEADER API
17.11.5 Example
17.12 ICONVIEW: Icon view widget
17.12.1 Configuration options
17.12.2 Predefined IDs
17.12.3 Notification codes
17.12.4 Keyboard reaction
17.12.5 ICONVIEW API
17.12.6 Example
17.13 IMAGE: Image widget
17.13.1 Configuration options
17.13.2 Predefined IDs
17.13.3 Notification codes
17.13.4 IMAGE API
17.14 LISTBOX: List box widget
17.14.1 Configuration options
17.14.2 Predefined IDs
17.14.3 Notification codes
17.14.4 Keyboard reaction
17.14.5 LISTBOX API
17.14.6 Examples
17.15 LISTVIEW: Listview widget
17.15.1 Configuration options
17.15.2 Predefined IDs
17.15.3 Notification codes
17.15.4 Keyboard reaction
17.15.5 LISTVIEW API
17.15.6 Example
17.16 LISTWHEEL: Listwheel widget
17.16.1 Configuration options
17.16.2 Predefined IDs
17.16.3 Notification codes
17.16.4 Keyboard reaction
17.16.5 LISTWHEEL API
17.17 MENU: Menu widget
17.17.1 Menu messages
17.17.2 Data structures
17.17.3 Configuration options
17.17.4 Keyboard reaction
17.17.5 MENU API
17.17.6 Example
17.18 MULTIEDIT: Multi line text widget
17.18.1 Configuration options
17.18.2 Predefined IDs
17.18.3 Notification codes
17.18.4 Keyboard reaction
17.18.5 MULTIEDIT API
17.18.6 Example
17.19 MULTIPAGE: Multiple page widget
17.19.1 Configuration options
17.19.2 Predefined IDs
17.19.3 Notification codes
17.19.4 Keyboard reaction
17.19.5 MULTIPAGE API
17.19.6 Example
17.20 PROGBAR: Progress bar widget
17.20.1 Configuration options
17.20.2 Predefined IDs
17.20.3 Keyboard reaction
17.20.4 PROGBAR API
17.20.5 Examples
17.21 RADIO: Radio button widget
17.21.1 Configuration options
17.21.2 Predefined IDs
17.21.3 Notification codes
17.21.4 Keyboard reaction
17.21.5 RADIO API
17.21.6 Examples
17.22 SCROLLBAR: Scroll bar widget
17.22.1 Configuration options
17.22.2 Predefined IDs
17.22.3 Notification codes
17.22.4 Keyboard reaction
17.22.5 SCROLLBAR API
17.22.6 Example
17.23 SLIDER: Slider widget
17.23.1 Configuration options
17.23.2 Predefined IDs
17.23.3 Notification codes
17.23.4 Keyboard reaction
17.23.5 SLIDER API
17.23.6 Example
17.24 SPINBOX: Spinning box widget
17.24.1 Configuration options
17.24.2 Predefined IDs
17.24.3 Notification codes
17.24.4 Keyboard reaction
17.24.5 SPINBOX API
17.24.6 Example
17.25 TEXT: Text widget
17.25.1 Configuration options
17.25.2 Predefined IDs
17.25.3 Notification codes
17.25.4 Keyboard reaction
17.25.5 TEXT API
17.25.6 Examples
17.26 TREEVIEW: Treeview widget
17.26.1 Description of terms
17.26.2 Configuration options
17.26.3 Predefined IDs
17.26.4 Notification codes
17.26.5 Keyboard reaction
17.26.6 TREEVIEW API
17.26.7 Example
17.27 WINDOW: Window widget
17.27.1 Configuration options
17.27.2 Keyboard reaction
17.27.3 WINDOW API
Dialogs
18.1 Dialog basics
18.2 Creating a dialog
18.2.1 Resource table
18.2.2 Dialog procedure
18.3 Dialog API
18.4 Common dialogs
18.4.1 CALENDAR
18.4.2 CHOOSECOLOR
18.4.3 CHOOSEFILE
18.4.4 MESSAGEBOX
GUIBuilder
19.1 Introduction
19.2 Getting started
19.3 Creating a dialog
19.3.1 Selecting a parent widget
19.3.2 Resizing and positioning in the editor
19.3.3 Modifying the widget properties
19.3.4 Adding additional functions to a widget
19.3.5 Deleting a widget property
19.3.6 Deleting a widget
19.4 Saving the current dialog(s)
19.5 Output of the GUIBuilder
19.6 Modifying the C files
19.7 How to use the C files
Skinning
20.1 What is a ’skin’?
20.2 From using API functions to skinning
20.3 Skinnable widgets
20.4 Using a skin
20.4.1 Runtime configuration
20.4.2 Compile time configuration
20.5 Simple changes to the look of the ’Flex’ skin
20.6 Major changes to the look of the ’Flex’ skin
20.6.1 The skinning callback mechanism
20.6.2 Changing the look of the default skin
20.6.3 List of commands
20.7 General skinning API
20.8 BUTTON_SKIN_FLEX
20.8.1 Configuration structure
20.8.2 Configuration options
20.8.3 Skinning API
20.8.4 List of commands
20.9 CHECKBOX_SKIN_FLEX
20.9.1 Configuration structure
20.9.2 Configuration options
20.9.3 Skinning API
20.9.4 List of commands
20.10 DROPDOWN_SKIN_FLEX
20.10.1 Configuration structure
20.10.2 Configuration options
20.10.3 Skinning API
20.10.4 List of commands
20.11 FRAMEWIN_SKIN_FLEX
20.11.1 Configuration structure
20.11.2 Configuration options
20.11.3 Skinning API
20.11.4 List of commands
20.12 HEADER_SKIN_FLEX
20.12.1 Configuration structure
20.12.2 Configuration options
20.12.3 Skinning API
20.12.4 List of commands
20.13 MENU_SKIN_FLEX
20.13.1 Configuration structure
20.13.2 Configuration options
20.13.3 Skinning API
20.13.4 List of commands
20.14 MULTIPAGE_SKIN_FLEX
20.14.1 Configuration structure
20.14.2 Configuration options
20.14.3 Skinning API
20.14.4 List of commands
20.15 PROGBAR_SKIN_FLEX
20.15.1 Configuration structure
20.15.2 Configuration options
20.15.3 Skinning API
20.15.4 List of commands
20.16 RADIO_SKIN_FLEX
20.16.1 Configuration structure
20.16.2 Configuration options
20.16.3 Skinning API
20.16.4 List of commands
20.17 SCROLLBAR_SKIN_FLEX
20.17.1 Configuration structure
20.17.2 Configuration options
20.17.3 Skinning API
20.17.4 List of commands
20.18 SLIDER_SKIN_FLEX
20.18.1 Configuration structure
20.18.2 Configuration options
20.18.3 Skinning API
20.18.4 List of commands
20.19 SPINBOX_SKIN_FLEX
20.19.1 Configuration structure
20.19.2 Configuration options
20.19.3 Skinning API
20.19.4 List of commands
Multiple buffering
21.1 How it works
21.1.1 Double buffering
21.1.2 Triple buffering
21.2 Requirements
21.3 Limitations
21.4 Configuration
21.4.1 LCD_X_Config()
21.4.2 LCD_X_DisplayDriver()
21.5 Automatic use of multiple buffers with the WM
21.6 Multiple buffer API
Virtual screens / Virtual pages
22.1 Introduction
22.2 Requirements
22.3 Configuration
22.4 Examples
22.4.1 Basic example
22.4.2 Real time example using the Window Manager
22.4.3 Dialog example using the Window Manager
22.5 Virtual screen API
Multi layer / multi display support
23.1 Introduction
23.1.1 Selecting a layer for drawing operations
23.1.2 Selecting a layer for a window
23.2 Using multi layer support
23.2.1 Transparency
23.2.2 Alpha blending
23.2.3 Hardware cursors
23.2.4 Multi layer example
23.3 Using multi display support
23.3.1 Enabling multi display support
23.3.2 Run-time screen rotation
23.3.3 Multi display example
23.4 Configuring multi layer support
23.5 Configuring multi display support
23.6 Multi layer API
Pointer Input Devices
24.1 Description
24.2 Pointer input device API
24.3 Mouse driver
24.3.1 Generic mouse API
24.3.2 PS2 mouse driver
24.4 Touch screen driver
24.4.1 Generic touch screen API
24.4.2 The analog touch screen driver
24.5 Joystick input example
Keyboard Input
25.1 Description
25.1.1 Driver layer API
25.1.2 Application layer API
Sprites
26.1 Introduction
26.2 Sprite API
Cursors
27.1 Available cursors
27.2 Cursor API
Antialiasing
28.1 Introduction
28.1.1 Quality of antialiasing
28.1.2 Antialiased Fonts
28.1.3 High-resolution coordinates
28.2 Antialiasing API
28.3 Control functions
28.4 Drawing functions
28.5 Examples
Language Support
29.1 Unicode
29.1.1 UTF-8 encoding
29.1.2 Unicode characters
29.1.3 UTF-8 strings
29.1.4 Unicode API
29.2 Text- and language resource files
29.2.1 Unicode support
29.2.2 Loading files from RAM
29.2.3 Loading files from non addressable areas
29.2.4 Rules for CSV files
29.2.5 Rules for text files
29.2.6 Text- and language resource file API
29.3 Arabic support
29.3.1 Notation forms
29.3.2 Ligatures
29.3.3 Bidirectional text alignment
29.3.4 Requirements
29.3.5 How to enable Arabic support
29.3.6 Example
29.3.7 Font files used with Arabic text
29.4 Thai language support
29.4.1 Requirements
29.4.2 How to enable Thai support
29.4.3 Example
29.4.4 Font files used with Thai text
29.5 Shift JIS support
29.5.1 Creating Shift JIS fonts
Display drivers
30.1 Available display drivers
30.1.1 Driver file naming convention
30.1.2 Run-time configurable drivers
30.1.3 Compile-time configurable drivers
30.1.4 Available, but not yet migrated drivers
30.1.5 Special purpose drivers
30.2 CPU / Display controller interface
30.2.1 Direct interface
30.2.2 Indirect interface - Parallel bus
30.2.3 Indirect interface - 4 pin SPI
30.2.4 Indirect interface - 3 pin SPI
30.2.5 Indirect interface - I2C bus
30.3 Hardware interface configuration
30.3.1 Direct interface
30.3.2 Indirect interface
30.4 Non readable displays
30.5 Display orientation
30.5.1 Driver based configuration of display orientation
30.5.2 Function based configuration of display orientation
30.6 Display driver callback function
30.6.1 Commands passed to the callback function
30.7 Detailed display driver descriptions
30.7.1 GUIDRV_BitPlains
30.7.2 GUIDRV_DCache
30.7.3 GUIDRV_Dist
30.7.4 GUIDRV_FlexColor
30.7.5 GUIDRV_IST3088
30.7.6 GUIDRV_Lin
30.7.7 GUIDRV_S1D13748
30.7.8 GUIDRV_S1D13781
30.7.9 GUIDRV_S1D15G00
30.7.10 GUIDRV_SLin
30.7.11 GUIDRV_SPage
30.7.12 GUIDRV_SSD1926
30.7.13 GUIDRV_UC1698G
30.7.14 GUIDRV_CompactColor_16
30.7.15 GUIDRV_Fujitsu_16
30.7.16 GUIDRV_Page1bpp
30.7.17 GUIDRV_07X1
30.7.18 GUIDRV_1611
30.7.19 GUIDRV_6331
30.7.20 GUIDRV_7529
30.7.21 GUIDRV_Template - Template for a new driver
30.8 LCD layer and display driver API
30.8.1 Display driver API
30.8.2 LCD layer routines
VNC Server
31.1 Introduction
31.1.1 Requirements
31.1.2 Notes on this implementation
31.2 The VNC viewer
31.2.1 How to use the VNC viewer
31.3 emWin VNC server
31.3.1 Starting the emWin VNC server
31.3.2 How the server starts...
31.3.3 Integration of the VNC server on the target
31.4 Requirements
31.5 Configuration options
31.6 VNC Server API
Touch drivers
32.1 GUITDRV_ADS7846
Timing- and execution-related functions
33.1 Timing and execution API
33.2 Timer API
Performance and Resource Usage
34.1 Performance
34.1.1 Driver benchmark
34.1.2 Image drawing performance
34.2 Memory requirements
34.2.1 Memory requirements of the GUI components
34.2.2 Stack requirements
34.3 Memory requirements of example applications
Configuration
35.1 What needs to be configured?
35.2 Run-time- and compile-time configuration
35.3 Initialization process of emWin
35.4 Run-time configuration
35.4.1 Customizing GUIConf.c
35.4.2 Customizing LCDConf.c
35.4.3 Customizing GUI_X.c
35.5 Compile time configuration
35.5.1 Customizing GUIConf.h
35.5.2 Customizing LCDConf.h
35.6 Request available memory
Support
36.1 Problems with tool chain (compiler, linker)
36.1.1 Compiler crash
36.1.2 Compiler warnings
36.1.3 Compiler errors
36.1.4 Linker problems
36.2 Problems with hardware/driver
36.3 Problems with API functions
36.4 Problems with the performance
36.5 Contacting support
36.6 FAQ’s
Index