SlideShare a Scribd company logo
Embedded Linux Conference Europe Choosing free software graphical libraries for embedded devices Thomas Petazzoni Free Electrons http://free-electrons.com/
About this document This document is released under the terms of the Creative-Commons BY-SA 3.0 license: http://creativecommons.org/licenses/by-sa/3.0/ Documents updates can be found or described on http://free-electrons.com/pub/conferences/2008/elce/
Introduction Graphical interfaces are a major component of many embedded systems As usual, the free software and open source world offers a lot of choices to implement graphical interfaces Such a diversity makes it difficult to find one's way through all the available solutions This talk in the result of an investigation of the most popular graphical libraries, and describe them in terms of functionality, size, popularity, and ability to combine with other components, etc. Some solutions or details might have been missed, don't hesitate to share your knowledge and experience during the talk
Building and testing All of our tests have been made with Buildroot A filesystem builder for embedded systems http://buildroot.uclibc.org Many fixes contributed to get all the graphical libraries to build properly Size of libraries and components given in the talk correspond to the ARM, stripped version Basic tests made in Qemu Not very Ā« flashy Ā» We will soon release target filesystems that'll allow anyone to quickly try and test the different solutions
Ā« Low-level Ā» solutions
DirectFB Low-level graphical library Lines, rectangles, triangles drawing and filling Blitting, flipping Text drawing Windows and transparency Image loading and video display But also handles input event handling: mouse, keyboard, joystick, touchscreen, etc. Provides accelerated graphic operations on various hardware, more can be added in an easy way Integrated windowing infrastructure
DirectFB (2) Single-application by default, but multiple applications can share the framebuffer thanks to Ā« fusion Ā» Development and community: very active See also Denis Oliver Kropp talk, Ā« Open Integration Layer - DirectFB 2.0 Ā», tomorrow at 15:25 Denis is the main developer of DirectFB License: LGPL 2.1 http://www.directfb.org
DirectFB : size and dependencies Some of these dependencies are optional. This is a typical setup. Total: ~1.4m Utils zlib ~64k freetype ~380k libjpeg ~130k libpng ~130k libts ~6k Total: ~710k DirectFB library ~450k plugins ~200k Total: ~650k
DirectFB : architecture Harware Kernel FB driver DirectFB Application fbdev devmem /dev/ mem
DirectFB : usage Multimedia applications For example the Disko framework, for set-top box related applications Ā« Simple Ā» graphical applications Industrial control Device control with limited number of widgets Visualization applications As a lower layer for higher-level graphical libraries
DirectFB : usage
SDL A library originally designed for game development In addition to graphic display, also provides input event management, sound, CD-ROM audio, threads, timers, etc. Can work on top of X11, the framebuffer or DirectFB And DirectFB can work on top of SDL as well :-) The API is roughly the same level as the one of DirectFB Developed in C, C API, many bindings available Actively maintained DirectFB is probably more common in embedded systems, while SDL is more common for small desktop games License: LGPL http://www.libsdl.org/
X.org - KDrive Stand-alone simplified version of the X server, for embedded systems Formerly know as Tiny-X Kdrive is integrated in  the official X.org server Works on top of the Linux frame buffer, thanks to the Xfbdev variant of the server Real X server Fully supports the X11 protocol : drawing, input event handling, etc. Allows to use any existing X11 application or library Actively developed and maintained X11 license http://www.x.org
Kdrive : size and dependencies Total: 2.5m Total: 1.5m Total, without X toolkit: 5.4m Utils zlib ~64k fontconfig ~165k dbus lib: ~200k bin: ~350k freetype ~380k expat ~120k pixman ~130k libpng ~130k X server Xfbdev ~1.2m X libraries liblbxutil ~156k libsysfs ~27k libX11 ~920k libxcb ~300k libXfont ~380k Misc libs ~770k X toolkit (optional) libXaw6,7,8 ~900k libXt ~330k Fonts from a few kb to several mb
Kdrive : architecture Hardware Kernel FB driver X.org Kdrive server Application fbdev Toolkit Application
Kdrive : usage Can be directly programmed using Xlib / XCB Low-level graphic library Probably doesn't make sense since DirectFB is a more lightweight solution for an API of roughly the same level (no widgets) Or, usually used with a toolkit on top of it Gtk Qt Fltk WxEmbedded
Nano-X An alternative graphic system Various graphic back-ends, including Linux framebuffer Provides two programming APIs A Win32-like API A Xlib-like API, but not compatible with Xlib Requires specially designed widget toolkits Client/server model, with clients communicating with the server through an Unix socket. Optionally, a client can be directly linked with the server Lightweight
Nano-X Doesn't come with a widget library, but offers a window manager Relatively small user and developer base. No release since 2005, but some activity on the mailing-list, including the official maintainer. Probably not lively enough to provide a long-term maintenance guarantee Licensed under the Mozilla Public License Webpage:  http://www.microwindows.org/
Nano-X
Nano-X
Ā« High-level Ā» solutions
Gtk The famous toolkit, providing widget-based high-level APIs to develop graphical applications Standard API in C, but bindings exist for various languages: C++, Python, etc. Two GDK back-ends The classical Xorg back-end The DirectFB back-end, which removes the need for an Xorg server No windowing system, a lightweight window manager needed to run several applications. Possible solution: Matchbox. License: LGPL http://www.gtk.org Hardware Kernel DirectFB Gtk-DFB Hardware Kernel X.org Kdrive Gtk
Gtk-DFB : dependencies and size Total: ~9 MB Utils Gtk galaxy libgtk2 ~3.2m Image libraries libpng ~130k jpeg ~130k tiff ~320k libglib2 ~1.4m atk ~100k pango ~400k cairo ~350k directfb ~750k zlib ~64k fontconfig ~165k gettext ~510k libintl ~30k freetype ~365k expat ~120k pixman ~130k
Qt The other famous toolkit, providing widget-based high-level APIs to develop graphical applications Ā« Qt for Embedded Linux Ā», formerly known as Qtopia Core, is the version of Qt that runs on top of a frame buffer, on embedded devices. It includes a windowing system Ā« Qt Extended Ā», formerly known as Qtopia, extends Ā« Qt for Embedded Linux Ā» with useful components on embedded devices : communication, contents, application-specific and user experience components. Implemented in C++ the C++ library is required on the target system standard API in C++, but bindings are also available for other languages
Qt Works either on top of Framebuffer X11 DirectFB backend integrated in version 4.4, which allows to take advantage of the acceleration provided by DirectFB drivers Qt is more than just a graphical toolkit, it also offers a complete development framework: data structures, threads, network, databases, XML, etc. Very well documented GPL license, commercial licenses available for proprietary applications http://trolltech.com/products
Qt : size and dependencies Total: ~15.5 MB Qt galaxy QtCore ~2.6m QtTest ~64k QtGui ~8.6m QtNetwork ~740k QtScript ~1.1m QtXml ~290k Img plugins ~750k Fonts ~160k Libraries zlib ~64k freetype ~365k jpeg ~130k libpng ~130k libstdc++ ~675k
Qt
FLTK Another high-level toolkit, providing widget-level graphic programming, currently in version 2.x Written in C++, main programming API in C++ Designed with smallness in mind Designed to reduce size when statically linked, small memory consumption for each widget Core of the library, as included in an statically compiled hello world program: 82K. An example application which uses all widgets: 352K Works on top of Xlib Actively maintained, licensed under the LGPL A port of FLTK 1.x to DirectFB was made, available from DirectFB's git repository, but only maintained by a single person http://www.fltk.org
WxEmbedded Originally, WxWidgets is a library abstracting existing toolkits (Win32 native toolkit, Gtk2, etc.), allowing the creation of portable applications Depends on an underlying toolkit An internal toolkit, WxUniversal has been implemented. It allows to write WxWidgets applications without the need for an underlying toolkit. Works on top of various graphic back-ends X11 DirectFB Nano-X Xlib-like and Win32-like APIs Written in C++, C++ API, C++ library required
WxEmbedded Size 2.5 Mb of shared library size 1 Mb for a simple statically-linked example, but the size doesn't increase much for more complicated examples While WxWidgets is active and well-maintained, the amount of attention given to WxUniversal and WxEmbedded is much smaller Some widgets are not implemented, some graphic backends don't receive a lot of attention Licensed under the LGPL, with an exception giving more freedom on distribution of derived works in binary form WxEmbedded:  http://www.wxwidgets.org/docs/embedded.htm WxUniversal:  http://www.wxwidgets.org/about/wxuniv.htm
LiTE LiTE is a Toolbox Engine Designed exclusively for DirectFB Two layers Lite: low-level plumbing to ease the implementation of widgets Leck: implementation of the widgets Only very simple widgets available Limited user base Very small: only 43k + 36k in addition to a typical DirectFB installation. LGPL 2.1 http://www.directfb.org/wiki/index.php/LiTE:About
Other untested solutions MiniGUI Another toolkit, with several graphical backends including a frame buffer backend The GPL version is limited in functionalities, commercial versions available http://www.minigui.org/ Enlightenment foundation libraries See Gustavo Sverzut Barbieri talk, Ā« Rich GUI Without Pain Ā» today at 14:45 http://www.enlightenment.org/p.php?p=about/efl
Conclusion Low-level components: DirectFB, X.org, Nano-X High-level components: Gtk, Qt, Fltk, WxEmbedded, EFL, miniGUI There is a large number of solutions to develop graphical interfaces with free software libraries However, the size of the user and developer community and its vitality is one of the most important criteria when choosing a solution For that reason, DirectFB, X.org, Gtk and Qt seem to be most interesting solutions today
Questions ? What solutions are you using for your graphical interfaces ? What were your decision criteria ? Are you satisfied with the chosen solution ? The existing ones ? ?
Xynth Clutter Pigment

More Related Content

PDF
Managed DirectX
A. LE
Ā 
PPT
Prasentation Managed DirectX
A. LE
Ā 
PDF
Intel's Presentation in SIGGRAPH OpenCL BOF
Ofer Rosenberg
Ā 
PDF
GPU Ecosystem
Ofer Rosenberg
Ā 
DOCX
Wonho Park_20151209
Wonho Park
Ā 
PPTX
Embedded c c++ programming fundamentals master
Hossam Hassan
Ā 
PDF
Introduction to the Graphics Pipeline of the PS3
Slide_N
Ā 
PDF
OpenGL Based Testing Tool Architecture for Exascale Computing
CSCJournals
Ā 
Managed DirectX
A. LE
Ā 
Prasentation Managed DirectX
A. LE
Ā 
Intel's Presentation in SIGGRAPH OpenCL BOF
Ofer Rosenberg
Ā 
GPU Ecosystem
Ofer Rosenberg
Ā 
Wonho Park_20151209
Wonho Park
Ā 
Embedded c c++ programming fundamentals master
Hossam Hassan
Ā 
Introduction to the Graphics Pipeline of the PS3
Slide_N
Ā 
OpenGL Based Testing Tool Architecture for Exascale Computing
CSCJournals
Ā 

What's hot (20)

DOCX
Computer graphics workbook
Muhammadalizardari
Ā 
PPTX
Embedded system
ashraf eltholth
Ā 
PDF
Implementation of embedded arm9 platform using qt and open cv for human upper...
Krunal Patel
Ā 
PDF
J044084349
IJERA Editor
Ā 
PDF
How Do I Make That in QML?
ICS
Ā 
PDF
Newbie’s guide to_the_gpgpu_universe
Ofer Rosenberg
Ā 
PDF
clCaffe*: Unleashing the Power of Intel Graphics for Deep Learning Acceleration
IntelĀ® Software
Ā 
PPTX
Software hardware co-design using xilinx zynq soc
Hossam Hassan
Ā 
PDF
The GPGPU Continuum
Ofer Rosenberg
Ā 
PPTX
Architecting Solutions for the Manycore Future
Talbott Crowell
Ā 
PDF
PL-4043, Accelerating OpenVL for Heterogeneous Platforms, by Gregor Miller
AMD Developer Central
Ā 
PPTX
Beginning direct3d gameprogramming02_overviewofhalandcom_20160408_jintaeks
JinTaek Seo
Ā 
PDF
MM-4092, Optimizing FFMPEG and Handbrake Using OpenCL and Other AMD HW Capabi...
AMD Developer Central
Ā 
PDF
01 intro-bps-2011
mistercteam
Ā 
PDF
HIS 2017 Mark Batty-Industrial concurrency specification for C/C++
jamieayre
Ā 
PDF
A Common Backend for Hardware Acceleration of DSLs on FPGA
NECST Lab @ Politecnico di Milano
Ā 
PDF
Video and Image Processing for Finding Paint Defects using BeagleBone Black
IRJET Journal
Ā 
PDF
Scalability for All: Unreal Engine* 4 with Intel
IntelĀ® Software
Ā 
PDF
Why is EFL used on Tizen?
Ryo Jin
Ā 
PDF
Android presentation
Siva Ramakrishna kv
Ā 
Computer graphics workbook
Muhammadalizardari
Ā 
Embedded system
ashraf eltholth
Ā 
Implementation of embedded arm9 platform using qt and open cv for human upper...
Krunal Patel
Ā 
J044084349
IJERA Editor
Ā 
How Do I Make That in QML?
ICS
Ā 
Newbie’s guide to_the_gpgpu_universe
Ofer Rosenberg
Ā 
clCaffe*: Unleashing the Power of Intel Graphics for Deep Learning Acceleration
IntelĀ® Software
Ā 
Software hardware co-design using xilinx zynq soc
Hossam Hassan
Ā 
The GPGPU Continuum
Ofer Rosenberg
Ā 
Architecting Solutions for the Manycore Future
Talbott Crowell
Ā 
PL-4043, Accelerating OpenVL for Heterogeneous Platforms, by Gregor Miller
AMD Developer Central
Ā 
Beginning direct3d gameprogramming02_overviewofhalandcom_20160408_jintaeks
JinTaek Seo
Ā 
MM-4092, Optimizing FFMPEG and Handbrake Using OpenCL and Other AMD HW Capabi...
AMD Developer Central
Ā 
01 intro-bps-2011
mistercteam
Ā 
HIS 2017 Mark Batty-Industrial concurrency specification for C/C++
jamieayre
Ā 
A Common Backend for Hardware Acceleration of DSLs on FPGA
NECST Lab @ Politecnico di Milano
Ā 
Video and Image Processing for Finding Paint Defects using BeagleBone Black
IRJET Journal
Ā 
Scalability for All: Unreal Engine* 4 with Intel
IntelĀ® Software
Ā 
Why is EFL used on Tizen?
Ryo Jin
Ā 
Android presentation
Siva Ramakrishna kv
Ā 
Ad

Viewers also liked (11)

ODP
CRAL MPS: Anatomia di un sistema GNU Linux
Paolo Sammicheli
Ā 
PPT
Presentation. OpenSolaris.
Ilya Tretyakov
Ā 
PPT
Ch3 gnu make
č‰¾é—ē§‘ęŠ€
Ā 
PDF
Cutest technology of them all - Forum Nokia Qt Webinar December 2009
Nokia
Ā 
PPT
Introduction To Opensource And GNU/Linux
Sheila Eiffert
Ā 
PPT
ppt on linux by MUKESH PATEL
neo_patel
Ā 
ODP
Introduction to Linux OS
Mohammed Safwat
Ā 
ODP
Linux Introduction (Commands)
anandvaidya
Ā 
ODP
An Introduction to Linux
anandvaidya
Ā 
PPTX
Linux.ppt
onu9
Ā 
PDF
3 Things Every Sales Team Needs to Be Thinking About in 2017
Drift
Ā 
CRAL MPS: Anatomia di un sistema GNU Linux
Paolo Sammicheli
Ā 
Presentation. OpenSolaris.
Ilya Tretyakov
Ā 
Ch3 gnu make
č‰¾é—ē§‘ęŠ€
Ā 
Cutest technology of them all - Forum Nokia Qt Webinar December 2009
Nokia
Ā 
Introduction To Opensource And GNU/Linux
Sheila Eiffert
Ā 
ppt on linux by MUKESH PATEL
neo_patel
Ā 
Introduction to Linux OS
Mohammed Safwat
Ā 
Linux Introduction (Commands)
anandvaidya
Ā 
An Introduction to Linux
anandvaidya
Ā 
Linux.ppt
onu9
Ā 
3 Things Every Sales Team Needs to Be Thinking About in 2017
Drift
Ā 
Ad

Similar to Graphical libraries (20)

ODP
Embedded Linux Multimedia
Caglar Dursun
Ā 
ODP
Some wonderful Linux softwares for daily use
arun.arwachin
Ā 
PPTX
libdash 2.0
Christopher Mueller
Ā 
PPTX
Curso de Desenvolvimento Mobile - Android - Stack
Jackson F. de A. Mafra
Ā 
PDF
Add the power of the Web to your embedded devices with WPE WebKit
Igalia
Ā 
PPT
An Introduction To Linux Development Environment
S. M. Hossein Hamidi
Ā 
PPTX
MinGw Compiler
Avnish Patel
Ā 
PDF
Rolling Your Own Embedded Linux Distribution
Emanuele Bonanni
Ā 
DOCX
Linux Implementation ProposalRichard JohnsonWhy Linux .docx
croysierkathey
Ā 
PPTX
A Tour of Open Source on the Mainframe
All Things Open
Ā 
PDF
Future of .NET - .NET on Non Windows Platforms
Aniruddha Chakrabarti
Ā 
PDF
Modern IoT and Embedded Linux Deployment - Berlin
Djalal Harouni
Ā 
PDF
Making a Headless Android Device
Patricia Aas
Ā 
PPTX
Intro to gui, cross platform and qt
Muhammad Sabry
Ā 
PPTX
OpenCL Overview Japan Virtual Open House Feb 2021
The Khronos Group Inc.
Ā 
PDF
Making a Headless Android Device (Oslo Embedded Meetup 2018)
Patricia Aas
Ā 
PPTX
Linux operating system ppt
Achyut Sinha
Ā 
PPT
Presentation1 linux os
alvarez khay-r m.
Ā 
PPT
Presentation1 linux os
joycoronado
Ā 
PPT
Presentation1 linux os
ruzzelarpon
Ā 
Embedded Linux Multimedia
Caglar Dursun
Ā 
Some wonderful Linux softwares for daily use
arun.arwachin
Ā 
libdash 2.0
Christopher Mueller
Ā 
Curso de Desenvolvimento Mobile - Android - Stack
Jackson F. de A. Mafra
Ā 
Add the power of the Web to your embedded devices with WPE WebKit
Igalia
Ā 
An Introduction To Linux Development Environment
S. M. Hossein Hamidi
Ā 
MinGw Compiler
Avnish Patel
Ā 
Rolling Your Own Embedded Linux Distribution
Emanuele Bonanni
Ā 
Linux Implementation ProposalRichard JohnsonWhy Linux .docx
croysierkathey
Ā 
A Tour of Open Source on the Mainframe
All Things Open
Ā 
Future of .NET - .NET on Non Windows Platforms
Aniruddha Chakrabarti
Ā 
Modern IoT and Embedded Linux Deployment - Berlin
Djalal Harouni
Ā 
Making a Headless Android Device
Patricia Aas
Ā 
Intro to gui, cross platform and qt
Muhammad Sabry
Ā 
OpenCL Overview Japan Virtual Open House Feb 2021
The Khronos Group Inc.
Ā 
Making a Headless Android Device (Oslo Embedded Meetup 2018)
Patricia Aas
Ā 
Linux operating system ppt
Achyut Sinha
Ā 
Presentation1 linux os
alvarez khay-r m.
Ā 
Presentation1 linux os
joycoronado
Ā 
Presentation1 linux os
ruzzelarpon
Ā 

Recently uploaded (20)

PPTX
New ThousandEyes Product Innovations: Cisco Live June 2025
ThousandEyes
Ā 
PPTX
cloud computing vai.pptx for the project
vaibhavdobariyal79
Ā 
PDF
How Open Source Changed My Career by abdelrahman ismail
a0m0rajab1
Ā 
PDF
Trying to figure out MCP by actually building an app from scratch with open s...
Julien SIMON
Ā 
PDF
Software Development Methodologies in 2025
KodekX
Ā 
PPTX
The-Ethical-Hackers-Imperative-Safeguarding-the-Digital-Frontier.pptx
sujalchauhan1305
Ā 
PDF
Economic Impact of Data Centres to the Malaysian Economy
flintglobalapac
Ā 
PDF
Data_Analytics_vs_Data_Science_vs_BI_by_CA_Suvidha_Chaplot.pdf
CA Suvidha Chaplot
Ā 
PPTX
Introduction to Flutter by Ayush Desai.pptx
ayushdesai204
Ā 
PPTX
What-is-the-World-Wide-Web -- Introduction
tonifi9488
Ā 
PDF
GDG Cloud Munich - Intro - Luiz Carneiro - #BuildWithAI - July - Abdel.pdf
Luiz Carneiro
Ā 
PDF
Oracle AI Vector Search- Getting Started and what's new in 2025- AIOUG Yatra ...
Sandesh Rao
Ā 
PDF
Automating ArcGIS Content Discovery with FME: A Real World Use Case
Safe Software
Ā 
PPTX
IT Runs Better with ThousandEyes AI-driven Assurance
ThousandEyes
Ā 
PDF
MASTERDECK GRAPHSUMMIT SYDNEY (Public).pdf
Neo4j
Ā 
PDF
CIFDAQ's Market Wrap : Bears Back in Control?
CIFDAQ
Ā 
PDF
SparkLabs Primer on Artificial Intelligence 2025
SparkLabs Group
Ā 
PDF
Responsible AI and AI Ethics - By Sylvester Ebhonu
Sylvester Ebhonu
Ā 
PDF
Accelerating Oracle Database 23ai Troubleshooting with Oracle AHF Fleet Insig...
Sandesh Rao
Ā 
PPTX
AI in Daily Life: How Artificial Intelligence Helps Us Every Day
vanshrpatil7
Ā 
New ThousandEyes Product Innovations: Cisco Live June 2025
ThousandEyes
Ā 
cloud computing vai.pptx for the project
vaibhavdobariyal79
Ā 
How Open Source Changed My Career by abdelrahman ismail
a0m0rajab1
Ā 
Trying to figure out MCP by actually building an app from scratch with open s...
Julien SIMON
Ā 
Software Development Methodologies in 2025
KodekX
Ā 
The-Ethical-Hackers-Imperative-Safeguarding-the-Digital-Frontier.pptx
sujalchauhan1305
Ā 
Economic Impact of Data Centres to the Malaysian Economy
flintglobalapac
Ā 
Data_Analytics_vs_Data_Science_vs_BI_by_CA_Suvidha_Chaplot.pdf
CA Suvidha Chaplot
Ā 
Introduction to Flutter by Ayush Desai.pptx
ayushdesai204
Ā 
What-is-the-World-Wide-Web -- Introduction
tonifi9488
Ā 
GDG Cloud Munich - Intro - Luiz Carneiro - #BuildWithAI - July - Abdel.pdf
Luiz Carneiro
Ā 
Oracle AI Vector Search- Getting Started and what's new in 2025- AIOUG Yatra ...
Sandesh Rao
Ā 
Automating ArcGIS Content Discovery with FME: A Real World Use Case
Safe Software
Ā 
IT Runs Better with ThousandEyes AI-driven Assurance
ThousandEyes
Ā 
MASTERDECK GRAPHSUMMIT SYDNEY (Public).pdf
Neo4j
Ā 
CIFDAQ's Market Wrap : Bears Back in Control?
CIFDAQ
Ā 
SparkLabs Primer on Artificial Intelligence 2025
SparkLabs Group
Ā 
Responsible AI and AI Ethics - By Sylvester Ebhonu
Sylvester Ebhonu
Ā 
Accelerating Oracle Database 23ai Troubleshooting with Oracle AHF Fleet Insig...
Sandesh Rao
Ā 
AI in Daily Life: How Artificial Intelligence Helps Us Every Day
vanshrpatil7
Ā 

Graphical libraries

  • 1. Embedded Linux Conference Europe Choosing free software graphical libraries for embedded devices Thomas Petazzoni Free Electrons http://free-electrons.com/
  • 2. About this document This document is released under the terms of the Creative-Commons BY-SA 3.0 license: http://creativecommons.org/licenses/by-sa/3.0/ Documents updates can be found or described on http://free-electrons.com/pub/conferences/2008/elce/
  • 3. Introduction Graphical interfaces are a major component of many embedded systems As usual, the free software and open source world offers a lot of choices to implement graphical interfaces Such a diversity makes it difficult to find one's way through all the available solutions This talk in the result of an investigation of the most popular graphical libraries, and describe them in terms of functionality, size, popularity, and ability to combine with other components, etc. Some solutions or details might have been missed, don't hesitate to share your knowledge and experience during the talk
  • 4. Building and testing All of our tests have been made with Buildroot A filesystem builder for embedded systems http://buildroot.uclibc.org Many fixes contributed to get all the graphical libraries to build properly Size of libraries and components given in the talk correspond to the ARM, stripped version Basic tests made in Qemu Not very Ā« flashy Ā» We will soon release target filesystems that'll allow anyone to quickly try and test the different solutions
  • 6. DirectFB Low-level graphical library Lines, rectangles, triangles drawing and filling Blitting, flipping Text drawing Windows and transparency Image loading and video display But also handles input event handling: mouse, keyboard, joystick, touchscreen, etc. Provides accelerated graphic operations on various hardware, more can be added in an easy way Integrated windowing infrastructure
  • 7. DirectFB (2) Single-application by default, but multiple applications can share the framebuffer thanks to Ā« fusion Ā» Development and community: very active See also Denis Oliver Kropp talk, Ā« Open Integration Layer - DirectFB 2.0 Ā», tomorrow at 15:25 Denis is the main developer of DirectFB License: LGPL 2.1 http://www.directfb.org
  • 8. DirectFB : size and dependencies Some of these dependencies are optional. This is a typical setup. Total: ~1.4m Utils zlib ~64k freetype ~380k libjpeg ~130k libpng ~130k libts ~6k Total: ~710k DirectFB library ~450k plugins ~200k Total: ~650k
  • 9. DirectFB : architecture Harware Kernel FB driver DirectFB Application fbdev devmem /dev/ mem
  • 10. DirectFB : usage Multimedia applications For example the Disko framework, for set-top box related applications Ā« Simple Ā» graphical applications Industrial control Device control with limited number of widgets Visualization applications As a lower layer for higher-level graphical libraries
  • 12. SDL A library originally designed for game development In addition to graphic display, also provides input event management, sound, CD-ROM audio, threads, timers, etc. Can work on top of X11, the framebuffer or DirectFB And DirectFB can work on top of SDL as well :-) The API is roughly the same level as the one of DirectFB Developed in C, C API, many bindings available Actively maintained DirectFB is probably more common in embedded systems, while SDL is more common for small desktop games License: LGPL http://www.libsdl.org/
  • 13. X.org - KDrive Stand-alone simplified version of the X server, for embedded systems Formerly know as Tiny-X Kdrive is integrated in the official X.org server Works on top of the Linux frame buffer, thanks to the Xfbdev variant of the server Real X server Fully supports the X11 protocol : drawing, input event handling, etc. Allows to use any existing X11 application or library Actively developed and maintained X11 license http://www.x.org
  • 14. Kdrive : size and dependencies Total: 2.5m Total: 1.5m Total, without X toolkit: 5.4m Utils zlib ~64k fontconfig ~165k dbus lib: ~200k bin: ~350k freetype ~380k expat ~120k pixman ~130k libpng ~130k X server Xfbdev ~1.2m X libraries liblbxutil ~156k libsysfs ~27k libX11 ~920k libxcb ~300k libXfont ~380k Misc libs ~770k X toolkit (optional) libXaw6,7,8 ~900k libXt ~330k Fonts from a few kb to several mb
  • 15. Kdrive : architecture Hardware Kernel FB driver X.org Kdrive server Application fbdev Toolkit Application
  • 16. Kdrive : usage Can be directly programmed using Xlib / XCB Low-level graphic library Probably doesn't make sense since DirectFB is a more lightweight solution for an API of roughly the same level (no widgets) Or, usually used with a toolkit on top of it Gtk Qt Fltk WxEmbedded
  • 17. Nano-X An alternative graphic system Various graphic back-ends, including Linux framebuffer Provides two programming APIs A Win32-like API A Xlib-like API, but not compatible with Xlib Requires specially designed widget toolkits Client/server model, with clients communicating with the server through an Unix socket. Optionally, a client can be directly linked with the server Lightweight
  • 18. Nano-X Doesn't come with a widget library, but offers a window manager Relatively small user and developer base. No release since 2005, but some activity on the mailing-list, including the official maintainer. Probably not lively enough to provide a long-term maintenance guarantee Licensed under the Mozilla Public License Webpage: http://www.microwindows.org/
  • 21. Ā« High-level Ā» solutions
  • 22. Gtk The famous toolkit, providing widget-based high-level APIs to develop graphical applications Standard API in C, but bindings exist for various languages: C++, Python, etc. Two GDK back-ends The classical Xorg back-end The DirectFB back-end, which removes the need for an Xorg server No windowing system, a lightweight window manager needed to run several applications. Possible solution: Matchbox. License: LGPL http://www.gtk.org Hardware Kernel DirectFB Gtk-DFB Hardware Kernel X.org Kdrive Gtk
  • 23. Gtk-DFB : dependencies and size Total: ~9 MB Utils Gtk galaxy libgtk2 ~3.2m Image libraries libpng ~130k jpeg ~130k tiff ~320k libglib2 ~1.4m atk ~100k pango ~400k cairo ~350k directfb ~750k zlib ~64k fontconfig ~165k gettext ~510k libintl ~30k freetype ~365k expat ~120k pixman ~130k
  • 24. Qt The other famous toolkit, providing widget-based high-level APIs to develop graphical applications Ā« Qt for Embedded Linux Ā», formerly known as Qtopia Core, is the version of Qt that runs on top of a frame buffer, on embedded devices. It includes a windowing system Ā« Qt Extended Ā», formerly known as Qtopia, extends Ā« Qt for Embedded Linux Ā» with useful components on embedded devices : communication, contents, application-specific and user experience components. Implemented in C++ the C++ library is required on the target system standard API in C++, but bindings are also available for other languages
  • 25. Qt Works either on top of Framebuffer X11 DirectFB backend integrated in version 4.4, which allows to take advantage of the acceleration provided by DirectFB drivers Qt is more than just a graphical toolkit, it also offers a complete development framework: data structures, threads, network, databases, XML, etc. Very well documented GPL license, commercial licenses available for proprietary applications http://trolltech.com/products
  • 26. Qt : size and dependencies Total: ~15.5 MB Qt galaxy QtCore ~2.6m QtTest ~64k QtGui ~8.6m QtNetwork ~740k QtScript ~1.1m QtXml ~290k Img plugins ~750k Fonts ~160k Libraries zlib ~64k freetype ~365k jpeg ~130k libpng ~130k libstdc++ ~675k
  • 27. Qt
  • 28. FLTK Another high-level toolkit, providing widget-level graphic programming, currently in version 2.x Written in C++, main programming API in C++ Designed with smallness in mind Designed to reduce size when statically linked, small memory consumption for each widget Core of the library, as included in an statically compiled hello world program: 82K. An example application which uses all widgets: 352K Works on top of Xlib Actively maintained, licensed under the LGPL A port of FLTK 1.x to DirectFB was made, available from DirectFB's git repository, but only maintained by a single person http://www.fltk.org
  • 29. WxEmbedded Originally, WxWidgets is a library abstracting existing toolkits (Win32 native toolkit, Gtk2, etc.), allowing the creation of portable applications Depends on an underlying toolkit An internal toolkit, WxUniversal has been implemented. It allows to write WxWidgets applications without the need for an underlying toolkit. Works on top of various graphic back-ends X11 DirectFB Nano-X Xlib-like and Win32-like APIs Written in C++, C++ API, C++ library required
  • 30. WxEmbedded Size 2.5 Mb of shared library size 1 Mb for a simple statically-linked example, but the size doesn't increase much for more complicated examples While WxWidgets is active and well-maintained, the amount of attention given to WxUniversal and WxEmbedded is much smaller Some widgets are not implemented, some graphic backends don't receive a lot of attention Licensed under the LGPL, with an exception giving more freedom on distribution of derived works in binary form WxEmbedded: http://www.wxwidgets.org/docs/embedded.htm WxUniversal: http://www.wxwidgets.org/about/wxuniv.htm
  • 31. LiTE LiTE is a Toolbox Engine Designed exclusively for DirectFB Two layers Lite: low-level plumbing to ease the implementation of widgets Leck: implementation of the widgets Only very simple widgets available Limited user base Very small: only 43k + 36k in addition to a typical DirectFB installation. LGPL 2.1 http://www.directfb.org/wiki/index.php/LiTE:About
  • 32. Other untested solutions MiniGUI Another toolkit, with several graphical backends including a frame buffer backend The GPL version is limited in functionalities, commercial versions available http://www.minigui.org/ Enlightenment foundation libraries See Gustavo Sverzut Barbieri talk, Ā« Rich GUI Without Pain Ā» today at 14:45 http://www.enlightenment.org/p.php?p=about/efl
  • 33. Conclusion Low-level components: DirectFB, X.org, Nano-X High-level components: Gtk, Qt, Fltk, WxEmbedded, EFL, miniGUI There is a large number of solutions to develop graphical interfaces with free software libraries However, the size of the user and developer community and its vitality is one of the most important criteria when choosing a solution For that reason, DirectFB, X.org, Gtk and Qt seem to be most interesting solutions today
  • 34. Questions ? What solutions are you using for your graphical interfaces ? What were your decision criteria ? Are you satisfied with the chosen solution ? The existing ones ? ?