Several Commonly Used Embedded Linux GUIs and Their Characteristics

Publisher:码梦小子Latest update time:2012-05-19 Source: OFweek Keywords:Linux  GUI  Embedded Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

With the rapid development of Internet and network and their continuous expansion to the home field, the integration trend of consumer electronics , computers and communications (3C) has become increasingly obvious, and embedded systems have once again become a hot spot for research and application. Embedded real-time Linux operating system is being widely adopted due to its low price, powerful functions and easy portability, becoming an emerging force. Now, with the rapid popularization of WAP mobile phones, PDAs, set-top boxes, and DVD/VCD players, users have put forward higher requirements for the GUI of these handheld devices, hoping to see a gorgeous and beautiful GUI like PC. GUI has become a bridge for communication between people and machines. The demand for GUI in embedded systems is getting higher and higher, and all of this requires a lightweight, low-resource, high-performance, high-reliability, configurable and beautiful GUI support.

1 Java graphical interface tools

Java technology is a great technology for servers, personal computers and embedded systems. Due to its cross-platform features, Java has been very successful in servers and desktops. However, in terms of GUI, Java has only very limited features to build graphical user interfaces. The idea is to use a platform-independent Java application program interface packaged to different operating systems to develop native graphical user interfaces, called the Abstract Window Tool (AWT). Only common components such as file fields, text areas, selection boxes, radio buttons, list boxes and buttons are supported by AWT, and the graphics and image features are very limited, that is, enough to build simple applets. Recognizing the need for more advanced graphical user interface components and graphics capabilities, Sun developed Swing, Java 2D, Java 3D, image input/output, and Java Advanced Graphics (JAI). Swing is a standard API (application program interface) for building Java graphical interfaces, and some AWT classes are based on Swing. It has a complete set of components from buttons to file fields, tables, trees and document editors. These components do not rely on native components of the operating system, but are drawn using primitive graphics like lines, rectangles, and text. This kind of painting represents a look-and-feel plug-in, which can imitate the local look and feel. SWT is developed based on Java. Its design concept is to maximize the API of the operating system's graphical components. That is to say, as long as the operating system provides the corresponding graphical components, SWT simply uses JNI technology to call them. Only for those components that are not provided in the operating system, SWT will make a simulated implementation by itself. In addition, SWT also provides direct access to the local graphical user interface of the operating system. Therefore, Java applications based on SWT have local graphical user interfaces and can be integrated with other local applications and components. Using the SWT development kit, the advantages of the Java language itself, such as simplicity, cross-platform, and reliability, are gradually being integrated into the development of graphical interface applications. Another door to success for the Java language is gradually opening.

2 Architecture of SWT+GtkFB Graphics System

2.1 Architecture of the SWT+GtkFB Graphics System

2.1.1 SWT

SWT is at the top of the system structure. It is a high-level function library required for designing graphical interfaces, along with AWT and Swing in Java. SWT has also improved some issues of AWT and Swing, and has now developed into a set of graphics component function libraries that are independent of the operating system. Appropriate simulation is used in the generation of components. The original operating system is used for basic components, and simulation technology is used for more complex components. Java applications based on SWT have local graphical user interfaces and can be integrated with other local applications and components.

SWT is an advanced graphics component library developed based on Java language. As shown in Figure 2, SWT directly calls the native-side GtkFB through JNI (Java Native Inter RF ace) technology on the Java side to use the operating system resources. JNI technology allows SWT programs to cooperate with native-side codes written in other languages ​​and integrate them together; on the other hand, it allows SWT code running in JVM (JAVA virtual machine) to call GtkFB library functions or other programs; in addition, using InvocatiON API, the Java virtual machine can be embedded in the native-side application. The JNI interface is bidirectional, equivalent to a bridge and a link, which connects the SWT code and the native-side GtkFB code.

2.1.2 Gtk Library

As shown in Figure 1, GTK uses several connection libraries, such as the Glib library for basic data types, which consists of five parts: basic classes, core application support classes, practical function classes, data classes, and object system classes.

Pango is a full-featured framework for the layout and display of internationalized text . Pango can handle text that is not arranged from left to right, and can easily manage complex languages, and even handle letters that take different forms depending on the usage environment. For example, it supports bidirectional text, and users can mix left-to-right text and right-to-left text; there are also plug-ins for determining the shape of various complex texts (such as Arabic and Tamil). Pango is not only internationalized, but the Pango library can also handle the display of anti-aliased fonts very well with the support of Xft and XRender.

Pango also supports various graphics formats such as libpng, libj peg , libtiff and FreeType for Framebuffer port. In fact, GTK provides three connection libraries: gdk-pixbuf, gdk and gtk. Gdk-pixbuf allows us to do related image work, gdk is the abstract layer of the window drawing system, most of the framebuffer related work is completed here, and gtk is a high-level application program interface.

ATK (Accessibility Toolkit) Accessibility Toolkit. GTK makes full use of ATK to make it possible for people with disabilities (such as low vision or limited mobility) to interact with GTK applications.

2.1.3 How GtkFB works

DirectFB accesses graphics hardware devices through the kernel interface provided by the operating system, namely the frame buffer device (FrameBuffer). FrameBuffer is actually a piece of hardware that serves as a bridge between the graphics card and the software. The Linux kernel opens it up so that the user's program can access the graphics card through block memory. For example, setting the display resolution and number of colors, accessing the display memory area, etc. Different Linux needs to provide drivers for different display hardware FrameBuffers . This means that DirectFB needs to run on FramBuffer, but the Linux kernel provides FrameBuffer drivers for common chips.

When an application connects to GtkFB, it calls gtk_init(), as shown in Figure 3. At this time, GtkFB starts Linux's Framebiffer, sets the resolution and number of colors, and then turns on peripherals such as the keyboard and mouse (PDA turns on the keys and touch screen). Then it reads the fonts from a specific directory, and finally initializes the window and event management. GtkFB can support 8, 16, 24, and 32bpp framebuffers.

To perform a specific graphics operation, the DirectFB chipset driver will access the graphics device's memory-mapped I/O ports and pass the command to the graphics card's acceleration engine. The actual hardware acceleration is done entirely in user space.

2.2 Advantages of SWT+GtkFB Graphics System

2.2.1 Small memory consumption, fast running speed, especially suitable for embedded products

Since GtkFB runs directly on FrameBufer and skips the X system, it saves some resources of X Server, which significantly improves memory consumption and running speed. In addition, the JNI technology used has greatly improved the program running speed and event response, which can meet the real-time application occasions with strict time requirements.

2.2.2 Good system stability

The key to the stability of SWT is its design concept. SWT maximizes the graphics component API of the operating system, that is, as long as the operating system provides the corresponding graphics components, SWT only uses JNI technology to call them. Only for those components that are not provided by the operating system, SWT will do a simulation implementation. It can be seen that the stability of SWT performance depends largely on the stability of the graphics components of the corresponding operating system.

2.2.3 Easy to port and share

The SWT API is exactly the same as the desktop version, so the code can be easily ported and shared between desktop and embedded devices.

2.2.4 Small and configurable

SWT uses the LGPL licensing method. Users are free and even encouraged to modify the source code to make it better meet their needs. It is easy to tailor specific SWT+GtkFB according to user needs. According to the LGPL license, users need to publish the modified source code, but users do not have to publish the source code of self-sufficient applications.

2.2.5 Easy to develop

SWT is developed based on Java language, and has the characteristics of Java language, such as platform independence, object-oriented, portability, security, etc. Users can easily develop widgets that meet their needs based on the widgets (components) provided by SWT, and easily use these widgets to build applications.

3 Implementation of SWT+GtkFB Graphics System

3.1 Preliminary preparation

To compile and install SWT+GtkFB in Linux, first go to http://www.gtk.org/download to download the following packages: pkg-config, glib2.x; atk, pango, DirectFB, gtk+2.x. Then go to http://www.eclipse.org/download to download swt.tgr.gz.

The next step is to create two directories, SWT and GTK, in the /home/XXX/ directory and set the environment variables as follows:

export SWT_HOME=/home/XXX/SWTexport SWT_HOME=/home/XXX/GTKexport PKG_CONFIG_PATH=$GTK_HOME /lib/pkgconfigexport LD_LIBRARY_PATH=$GTK_HOME/lib;$LD_LIBRARY_PATHIn addition, add "/home/XXX/GTK/bin" to the system environment variable PATH.

3.2 Compile and install Gtk+2.0

3.2.1 Compile and install pkg-config

tar zxvf glib-2.0.6.tar.gz -C $GTK_HOME/src

cd $GTK HOME/src/glib-2.0.6

. /configure --prefix=$GTK_HOME

make

make install

3.2.2 Compile and install atk

tar zxvf atk-1.0.1.tar.gz -C $GTK_HOME/src

cd $GTK_HOME/src/atk-1.0.1

. /configure --prefix=$GTK_HOME

make

make install

3.2.3 Compile and install pango, Direct FB, gtk+2.0, swt-forgtk2.2

The steps are similar to the installation of atk.

4 Application Prospects of Embedded Linux GUI

Embedded Linux GUI has many application areas, including home appliance market, commercial market, industrial and automation market, defense market, communication market, etc. For example, in the communication market, mobile phones, video phones, set-top boxes, etc. may become the operating platform of embedded Linux. A humanized user interface is the key factor to win consumers. Therefore, embedded Linux graphics system will play a more important role.

In the next few years, embedded Linux GUI will develop in the following directions: First, lightweight and low resource consumption. It is not desirable to build on a large and cumbersome operating system and GUI that consumes a lot of system resources. Second, high performance and high reliability. In particular, industrial real-time control systems have very high requirements for real-time performance, and have higher requirements for GUI than embedded systems. Third, configurability. We must clearly realize that embedded systems are customized devices, and their requirements for GUI vary. Some systems only require some graphics functions, while some systems require complete GUI support. Therefore, GUI must also be customizable.

Keywords:Linux  GUI  Embedded Reference address:Several Commonly Used Embedded Linux GUIs and Their Characteristics

Previous article:Low-cost compact fluorescent lamp ballast design
Next article:Design and implementation of indoor temperature control system based on ARM

Recommended ReadingLatest update time:2024-11-16 15:29

Linux-2.6.39 porting on Tiny6410 - Peripheral driver porting
Linux kernel version number: linux 2.6.39 Cross-compilation tool: arm-linux-gcc 4.5.1 Linux kernel download: www.kernel.org Development board: Friendly Arm Tiny6410 LCD: Friendly Arm S70 1. Transplant LED driver Open arch/arm/mach-s3c64xx/mach-mini641
[Microcontroller]
Data Communication between ARM Processor and DSP under Embedded Linux
The development trend of industrial measurement and control systems in the past 20 years is: decentralized control and centralized management, standardization and openness. Industrial measurement and control systems have shifted from traditional centralized measurement and control systems to networked distribut
[Microcontroller]
Data Communication between ARM Processor and DSP under Embedded Linux
Implementation of touch screen driver in Linux (1) - based on s3c6410 processor
These articles are mainly about touch screen drivers in Linux, based on the s3c6410 processor. This article is mainly about the implementation of touch screen devices as platform devices, as well as the source code analysis of the corresponding probe function and remove function. 1. Loading and unloading functions o
[Microcontroller]
Implementation of touch screen driver in Linux (1) - based on s3c6410 processor
Wireless meteorological data communication system based on ARM microprocessor and Linux
Automatic weather station data collectors are generally designed based on single-chip microcomputers or PC/104 bus controllers, and have the characteristics of good compatibility with PCs, low power consumption, and compact size. However, how to design an automatic weather station data collector with powerful function
[Microcontroller]
Wireless meteorological data communication system based on ARM microprocessor and Linux
arm-linux learning (1) lighting up the first LED program
1. Learn the Gpio schematic diagram Wiring diagram of LED and development board, Summarize: nled1—— GPF4 nled2—— GPF5 nled4——– GPF6 2. Register Two registers are used here, one is the port control register: GPACON-GPJCON, and the other is the port data register GPADAT-GPJDAT Here we can see that the address of
[Microcontroller]
arm-linux learning (1) lighting up the first LED program
Linux driver learning (3)--synchronization, semaphores and spin locks
In a driver, when multiple threads access the same resource at the same time (global variables in a driver are a typical shared resource), a "race state" may occur, so we must perform concurrency control on shared resources. The most common methods for solving concurrency control in the Linux kernel are spin locks a
[Microcontroller]
OK6410A Development Board (VIII) 123 linux-5.11 OK6410A Memory access interface for developers in rootfs
Memory-related file systems If we want to use files in rootfs to observe memory or change memory behavior The file system to which the file to be observed belongs is the kernel file system // "Linux real file system classification" in https://blog.csdn.net/u011011827/article/details/119322870 The related file systems
[Microcontroller]
ARM-Linux s3c2440 UART Analysis (Part 4)
After registration is complete, how are the device and driver connected? It turns out that the device connection has been made during driver_register() registration. The serial port is a platform device. The device registration is completed in the system framework setup_arch(), and the device registration precedes t
[Microcontroller]
Latest Power Management Articles
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号