도전2022

Embedded Linux Graphics Quick Reference Guide 본문

작업/리눅스

Embedded Linux Graphics Quick Reference Guide

hotdigi 2010. 4. 2. 14:40
http://www.linuxfordevices.com/c/a/Linux-For-Devices-Articles/Embedded-Linux-Graphics-Quick-Reference-Guide/



Embedded Linux Graphics Quick Reference Guide
By Rick Lehrbaum

Rate This Article: Add This Article To:

When you install Linux on a desktop PC, you normally choose from among a few "standard" graphics support components. You'll likely use the X Window system (XFree86 or ) as the display interface foundation (with associated Linux drivers to control the hardware), 

target="_blank">GNOME or KDE as a windowing environment, and one of several full-featured browsers such as FirefoxKonqueror, or Opera

But the typical desktop Linux "graphics stack" isn't well suited to embedded Linux applications. Embedded devices frequently have highly constrained resources and can afford neither the program storage space nor the memory footprint of desktop graphics software. For example, embedded devices may easily have as little as 2 to 16 MB of Flash disk from which to load programs, and 4 to 32 MB of RAM memory in which to run them. But the typical desktop graphics components are notorious resource hogs . . .
  • X Window System: 5MB RAM, 16MB disk
  • GNOME: 14MB RAM, 95MB disk
  • KDE: 11MB RAM, 96MB disk
  • Mozilla: 12MB RAM, 26MB disk
All that memory costs money, requires board space, and consumes power. Then too, embedded systems frequently have unique needs that can't be met by desktop graphics system components. These include the requirement for a customized look and feel, control over what functions are available to users, speed of loading, unusual display or input device characteristics, etc.

To satisfy the demands of the rapidly emerging embedded Linux marketplace, a growing number of graphics support projects and products have sprung up. Targeted environments run the full gamut -- including fixed, portable, and mobile systems -- and the applications range from hand-held consumer products like PDAs and cell phones, to medical instruments, factory automation, and commercial airlines cockpit displays.

With this in mind, LinuxDevices.com has created The Embedded Linux Graphics Quick Reference Guide. We intend to continually update this guide -- so be sure to check back frequently for the latest info.


Open source Embedded Linux Graphics System Software

Dillo -- Dillo is a very small (less than 300KB), fast, Open Source multi-platform web browser that's written completely in C and built on GTK+ libraries. Dillo's high efficiency and minimal library dependencies make it quite suitable for embedded apps. Dillo can be teamed up with an embedded webserver to completely eliminate the need for a window manager in an embedded device. -- details

DirectFB -- DirectFB is a thin library that provides developers with hardware graphics acceleration, input device handling and abstraction, integrated windowing system with support for translucent windows and multiple display layers on top of the Linux Framebuffer Device. It is a complete hardware abstraction layer with software fallbacks for every graphics operation that is not supported by the underlying hardware. -- details

The Familiar Project -- this open source PDA Linux project, which is an offshoot of the activities at handhelds.org, has collected together all of the key components of a complete Linux-based PDA computing platform. The Familiar distribution currently includes a Blackbox-based window manager, Agenda Computing's Fltk+ based PIM applications, an embedded Python implementation, system configuration and settings backup utilities, OpenSSH client and server, and a Debian-based ARM kernel. -- details

FBUI -- FBUI is a tiny GUI that resides inside the Linux kernel. The key concepts of FBUI are that firstly it is small; secondly that it is spartan, which is good; thirdly that it is just another driver; and fourthly that drivers belong in the kernel, not in userspace. details

GGI project -- the "General Graphics Interface" project is dedicated to development of fast, stable, open-source cross-platform multimedia API systems. Designed from the ground up with environments such as embedded systems in mind, GGI is fast, clean, abstract, dynamically modular and highly optimizeable. -- details

GPE Palmtop Environment -- this project aims to provide a Free Software GUI environment for palmtop/handheld computers running the GNU/Linux operating system. GPE uses the X Window System, and the GTK+ widget toolkit. -- details

GtkFB -- beginning with version 2.0, GTK+ will support rendering directly to the Linux framebuffer instead of using the X Window System. This is good for embedded systems and devices with limited resources, because it eliminates the overhead of an X server, while still taking advantage of the power of GTK+ and the large base of existing programs. -- details

handhelds.org PDA support -- want to create your own unique Linux PDA implementation? handhelds.org is for you! Early this year, Compaq created the Open Handheld Program, an initiative designed to stimulate innovation and research on handheld devices that resulted from the company's "Itsy" pocket computer project. To support this initiative, Compaq created handhelds.org -- a vendor neutral website dedicated to open source handheld development. Not surprisingly, Compaq's iPAQ PDA is used as the base platform for all these activities and, consequently, a iPAQ Linux port is available as freely available open source software. -- details

Matchbox -- a small foot-print window manager and associated applications, designed specifically for resource-constrained X11-enabled devices such as handheld computers, PDA's, set-top boxes, and consumer devices where display size, storage, CPU bandwidth, and input mechanisms are limited. Matchbox includes a window manager, a panel, a desktop, a shared utility library, and a number of small panel applications. -- details

Microwindows -- an Open Source project aimed at bringing the features of modern graphical windowing environments to smaller devices and platforms. Microwindows applications can be built and tested on the Linux desktop, as well as cross-compiled for the target device. -- details

NxZilla (formerly nanozilla) -- a set of libraries that allow Mozilla to be used with a NanoX server from the Microwindows project. -- details

OpenGL ES -- a light-weight, royalty-free embedded graphics standard that provides graphics API profiles for a broad range of embedded systems and devices, including handheld wireless devices, automotive and avionics displays, and multimedia consumer devices such as advanced digital TVs, set-top boxes, and game consoles. -- details

OpenGUI -- a fast, 32-bit, high-Level C/C++ graphics & windowing library/GUI built upon a fast, low-level x86 asm graphics kernel. It is under LGPL license. OpenGUI provides 2D drawing primitives and an event-driven windowing API for easy application development. -- details

PicoGUI -- small, portable client/server GUI designed to work on many types of hardware including handheld computers. Like the X Window System, it has a flexible client-server architecture. Unlike X, however, fonts, bitmaps, widgets, and anything else the application needs are built directly into the server. This sacrifices a small decrease in flexibility for an increase in speed and a large decrease in size. -- details

Qt/Embedded -- provides a full graphics stack, from the hardware interface to a full GUI tookkit. Although the API is identical to the popular Qt/X11 and Qt/Windows products, Qt/Embedded is not based on X11 and therefore it has substantially reduced memory requirements. Memory demands can be tuned to the range of 800 KB to 3 MB in ROM (Intel x86). Qt/Embedded is available as open source software, under the GNU General Public License (GPL), or can be licensed on other terms from its originator, Trolltech. -- details

Simple DirectMedia Layer -- an open source cross-platform multimedia development API/library designed to provide fast access to the graphics framebuffer and audio device. SDL is currently being applied to a number of Embedded Linux implementations such as Microwindows. details

Tiny-X -- a small footprint X Window server implementation for embedded systems. It was developed by Keith Packard of the XFree86 Core Team, sponsored by SuSE. The goal was to create something that would work well in a small memory footprint and, importantly, be robust in near out-of-memory situations. Typical X servers based on Tiny-X can fit in less than 1MB on x86 CPUs. The project has since forked into several projects, including KDriveSmallX, and Integrated Tiny-X

ViewML -- a freely available, open source web browser targeted specifically at the embedded Linux platform. Currently, ViewML along with it's interface requires 2.1 MB of RAM, with a disk image of only 760K. -- details

WML Browser -- a project, sponsored by 5NINE to develop a browser which will allow any wireless device to have WAP functionality. It must support multiple protocol stacks (WAP 1.2.1, http), in differing environments, using differing input devices. The browser will work with framebuffer graphics. -- details

Xynth Windowing System -- a free software project to build a portable, embedded client-server windowing system. The Xynth Windowing System, released under the GPL, offers a lightweight GUI-capable windowing system usable in Linux-based embedded systems and devices, such as handhelds and set-top boxes. details


"Commercial" Embedded Linux Graphics System Software


Access: Netfront browser -- an embedded browser designed for information appliances with modest memory and CPU performance. It requires less than 1.3MB ROM and 2MB RAM, supports full HTML 3.2 and selected features from HTML 4.0, frames, JavaScript, cookies, Web-printing and multi-languages. Its modular and scalable architecture can be enhanced by application-specific modules and plug-ins. An independent user interface layer and design tool allows device manufacturers to create a unique look and feel for their product. -- details

ANT: Freesco browser -- a small memory footprint, standards-compliant JAVA based browser that enables OEMs to quickly and easily design a branded interface for Internet appliances. It is platform-independent, so it can be used with any hardware or operating system environment (including various implementations of Embedded Linux). -- details

Century Software: PIXIL PDA and Microwindows -- a complete PDA system including an operating environment, PIM applications, email client, web browser, and a set of multimedia applications. The Microwindows graphical windowing system (described above) is at the core of the PIXIL PDA solution. -- details

Espial: Espial Suite -- a complete, 100% Java application layer that sits independently from the operating system and JVM on the upper layer of a device stack and has been used extensively with Linux. Espial Suites include the following applications: Espial DeviceTop graphical OSGi client, Espial Escape web browser, Espial Ebox email client, and Espial Espresso lightweight GUI toolkit.

Feynman Software: MiniGUI -- [Oct. 26, 2005] -- a dual-licensed (GPL or commercially licensable) project to create a small windowing system support library for embedded systems and devices, which offers the equivalent window management functions of Win32 APIs. -- Details here (article), here(link), and here (news).

Fluffy Spider: FancyPants -- [Oct. 26, 2005] -- This commercial graphics framework from Australian ISV Fluffy Spider is a set of lightweight special effects software for user interfaces (UIs). FancyPants supports skinning, overlays, and fancy effects, and targets media-centric consumer and mobile devices, such as POS (point-of-sales/service) systems, set-top boxes, and mobile phones. Details herehere, and here

NetClue: Clue WBC browser -- a compact, modular, and platform independent 100% Java browser. Clue WBC supports Unicode for international characters, smooth scrolling, streamline parsing and display, web printing, customizable user-interface, and is WAP compliant. Other features include support for HTML 4.0, XML, HTTP 1.0 and 1.1, CSS, DOM, cookies, JavaScript, Java Applets. -- details

Swell Software: LinuxPEG -- LinuxPEG is an embedded GUI library and development toolkit designed specifically for embedded systems. The LinuxPEG library is designed to run on any Linux distribution and its development tools run in the X11 development environment. LinuxPEG, which is available under license, is small footprint, completely ROMable, includes full C++ source code, and is royalty fee. -- details

Trolltech: Qtopia and Qt/Embedded -- Qtopia is a mobile device window environment and application suite for PDAs, palmtop computers, Internet appliances, and similar devices. Qtopia is based on Qt/Embedded (described above), and includes PIM applications, Internet clients, entertainment and games, utilities, and more. Qtopia/PDA is available in commercial or open source licenses, while Qtopia Phone Edition is commercial-only. -- details





Linux RAD/GUI Development

Kylix 
Rapid Application Development (RAD), GUI Development for Linux from Borland
Linux GUI Development
Presentation Outline

Background on GUI Development
Overview of Kylix
Demo GUI Tools
Demo Delphi
Demo Kylix
Linux GUI Development
Kylix
RAD/GUI tool for Linux
Port of Delphi for Windows 
Runs on Linux
Builds, compiles native Linux applications
Cross platform – Windows/Linux

GUI Dev Background
Windows 3.0 – 1990
Generates Messages
Basic, COBOL, C
All Text
Visual Basic – 1991
First GUI Dev Tool
Event Handlers – code that runs before or after an Event
Draw window instead of code it
Most widely used language
GUI Dev Background
Other GUI Dev Tools
PowerBuilder
Visual Age
Digitalk, ParcPlace Smalltalk
Forte  ( now at Sun)
Visual C++
Borland C++
Borland Delphi
Borland C++Builder
--------------------------
Visual Café  - Java
JBuilder  - Java

Linux Developement
GNU Linux Toolkit
GCC
Compiles C, C++, Objective C, Fortran
Handles Front-ends for Pascal, Modula-3, Ada
Distributed with Linux
Perl, Shell scripting
Linux Developement
Qt Class Library
C++
Cross Platform 
Qt/Windows
Qt/X11 (Linux, Solaris, HPUX, AIX, etc)
Qt/Mac
GPL – Free for non-commercial apps
Qt was used to build KDE
from Trolltech in Norway
www.trolltech.com


Linux Development
Qt Class Libray
Qwidget base class
Event Handlers
  mousePressEvent (QMouseEvent &);
  mouseMove Event (…
  mousePressEvent (…
  enterEvent (…
Class QMouseEvent : public Qevent {
 public:
   int x();
   int y();
   int button();
   int state();
Linux Development
Open Source IDE’s
KDevelop – www.kdevelop.org
KDE Studio – www.thekompany.com/projects/kdestudio
Code Crusader – www.newplanetsoftware.com
VDK Builder – vdkbuilder.sourceforge.net
Source-Navigator – sources.redhat.com/sourcenav
Delphi Background
Borland’s Delphi =
Pascal, plus
Borland’s implementation of OO in Pascal, plus
GUI  IDE, plus
Visual Component Library (VCL)
              - encapsulates Windows controls

Delphi
Pascal
Pascal dev by Niklas Wirth (Swiss, 1970)
Versions: U of C San Diego, Borland
Borland’s Turbo Pascal 1.0 - ?
Turbo Pascal 3.0 for DOS - 1985
Object Extensions to Pascal 5.5 - ?
Turbo Pascal for Windows - 1991
Delphi - OO Pascal – 1995
polymorphism, inheritance, encapsulation
http://www.engin.umd.umich.edu/CIS/course.des/cis400/index.html
http://www.emsps.com/oldtools/borpasv.htm
Delphi
GUI Integrated Development Environment
Based on Visual Basic model
Delphi
IDE
project manager
keeps track of all source files for a project
code editor
code completion
GUI form designer
integrated debugger
watch variables
change variables
breakpoints
step through code
Kylix
Port of Delphi to Linux
OO Pascal
Delphi IDE
native Linux compiler
Class Library - CLX
Object wrappers for Qt widgets
Borland chose Qt over GTK+
Delphi’s VCL re-engineered to CLX
Kylix
Class Libraries
CLX is to Kylix
VCL is to Delphi, C++Builder
MFC is to Visual C++
Qt is to KDE
GTK is to GNOME
CLX runs on Linux and Windows
Delphi
VCL Class Library
Object wrappers for Windows Controls

TObject
  |
TControl  __
  |                 |
TForm       TButton
Kylix
CLX Class Library
Object wrappers for Qt Widgets

TObject
  |
TControl  __
  |                 |
TForm       Tbutton

CLX also in Delphi 6, and C++Bldr for cross platform
Kylix
Pascal Language
Source File = Unit
Units -> compile, link -> executable
code - .pas file
form - .dfm file
     ( each form has a .pas file )
Kylix
Pascal Language
Data types
Integer – 2147483648 to 2147483647
Cardinal  0 to 4,294,967,785
Byte         0 to 255
Double     floating point
Currency  
Arrays –
MyArray : array[0..10] of Integer; // fixed
MyArray : array of Integer;     // dynamic
SetLength(MyArray, length);  // allocates memory for dynamic array
MyArray[length-1] := 1,024   // assignment
Kylix
Pascal Language
String – dynamic
Concat, Copy, Delete, Insert, Length, Pos, SetLength
Pointers
Exceptions
Try-except (same as try-catch in java, c++)
File IO
function – returns value
procedure – no return value
Kylix
Pascal Language - function

function Factorial(Number : Cardinal):  Int64;
var
  N : Cardinal;
begin
  Result := 1;
  for N := 2 to Number do
    Result := Result * N;
end;
Kylix
Pascal Language – class definition
type
 TAccount = class
  private
   fNumber : Cardinal;
   fBalance : Currency;
  public
   procedure WithDraw(Amount : Currency);
  end;

TSavingsAccount = class (TAccount)
  private
   fReturnCheck : Boolean
  end;
TCertificateof Deposit = class(TSavingsAccount)
  private 
   fTerm : Cardinal;
  end;
Kylix
Pascal Language – use classes

var
  CD1, CD2 : TAccount;
begin
  CD1 := TCertificateofDeposit.Create;
  CD2 := TCertificateofDeposit.Create;
  …
  CD1.WithDraw(100.00);
  …
  …

  CD1.Free;
  CD2.Free;
end;
Kylix
Pascal Language – Records and Arrays
type
  PersonType = record
    LastName  : String[10];
    FirstName  : String[10]; 
    EmployeeNumber  : Integer;
  end;  { Persontype }

MyArrayType = array [1..5]  of PersonType;

var
  PersonArray  :  MyArrayType;
begin
  PersonArray[1].FirstName := ‘Donald’;
  PersonArray[1].LastName := ‘Duck’;
  …

Kylix
Pascal Language – Components and Arrays
var
  ButtonArray : array of TButton;
  i, Num : integer;
begin 
  Num :=0;
  for i := 0 to Self.ComponentCount –1 do       // ‘Self’ same as ‘this’ in C++
  if Self.Components[i] is TButton then 
    begin
      Inc(Num);
      SetLength(ButtonArray, Num);
      ButtonArray[Num-1] := TButton(Components[i]);
    end;
end;
Kylix
Pascal Language – Comparison
Pascal…
var
  i :  Integer;
begin
  i := 1;

C++…
 int  i;
 i = 1;

Perl…
my $i;
$i = 1;
Kylix
Pascal Language – Comparison
Kylix
Pascal Language – Comparison

Pascal…
 while i < 100 do  Inc(i);

C++…
 while (i < 100)   i++;
 
Perl…
 while ($i < 100) { $i++;}

Kylix
Pascal Language – Comparison
Pascal…
 for i := 0 to 100 do  begin
   if  i = 50 then Break;
   end;

C++…
 for( i = 0; i <= 100; i++)
   if( i == 50) break;
 
Perl…
 for( $i = 0; $ i <= 100; $i++)  {
  if( $i == 50) last;  
  }

Kylix
Qt
access to all Qt Widget public Events and Properties
Libc
access to all ‘libc’ functions
Kylix
GUI Applications
Database Applications
Console Applications
Web Server Applications
Kylix
Linux Multiprocessing apps
separate memory, communicate via file system
Linux Multithreading apps
same memory, share resources
TThread base class
Kylix
GUI Applications - (CLX TForm class)
Form1.Canvas.Brush.Color := clRed;
or                          := RGB(255, 0, 0);
Form1.Canvas.Rectangle(10, 10, 100, 100);
Form1.Canvas.Pen.color := clBlack;
Form1.Canvas.Pen.Width := 2;
Form1.Canvas.MoveTo(0, 20);   // draw line
Form1.Canvas.LineTo(60, 20);   // draw line
Form1.Canvas.Font.Name := ‘Arial’;
Form1.Canvas.Font.Size := 24;
Form1.Canvas.TextOut(30,1, ‘Hello World’);  // write text


Kylix
Database Applications
db : TClientDataSet
db.FileName := ‘/xxx/nnn/yyy’;
db.Open;
db.Locate(‘EmpNum’, ‘124433’, []);
mystring := db.FieldValues[‘LastName’];

Kylix
Database Applications
db : TSQLDataSet
db.CommandText := ‘select * from ….’;
db.Open;

Kylix
Database Applications
data aware controls
automatically fill in data value from database
automatically update data value to database
controls can be ‘Active’ while building form
Kylix
Web Applications

-  raw CGI
     or

- TWebApplication
       |
  TCGIApplication

Kylix
Kylix Versions
Kylix 1, 2, 3  (I am using 2)
Kylix 1, 2 – Delphi (Pascal)
Kylix 3 – add C++ Builder (C++)

Kylix Enterprise -  Web, Middleware objects, Database objects
Kylix Professional -  Database objects
Kylix Open Edition – Build open source apps licensed under GNU General Public License
Kylix
Technical Requirements – Kylix 2
Pentium 400 Mhz ( I am using 366 Mhz)
128MB RAM ( I am using 192MB)
175MB disk space
Red Hat 6.2 or higher (I am using 7.2, Kernel 2.4.7)
SuSE 7.0 or higher
Kylix
Kylix Download
http://www.borland.com/products/downloads/download_kylix.html#
Kylix 3 currently available
Kylix 2  ??
Kylix
FreeCLX Project
Open Source CLX Class Library
available at SourceForge.net
includes BaseCLX, VisualCLX, and DataCLX classes (brings full functionality to  Kylix Open Edition ?)
lack of detailed information on FreeCLX
Kylix
Bibliography
“Visual Basic Bible”, Smith, Whistler, & Marquis
“Delphi in a Nutshell”, Ray Lischer, O’Reilly
“Linux Programming Unleashed”, Kurt Wall, SAMS
“Object Pascal Language Guide”, Borland Delphi 3 Documentation
“Teach Yourself Delphi in 21 Days”, Osier, Grobman, & Batson, SAMS
“Kylix: The Professional Developer’s Guide and Reference”, Jon Shemitz, Apress
“Mastering Kylix 2”, Cantu & Barbini, SYBEX
“Borland Kylix Developer’s Guide”, Calvert, Calvert, Kaster, & Swart, SAMS
“In the Trenches”, by Dale Fuller, LINUX Magazine, January 2002
Product Review of Kylix 2, LINUX Magazine, May 2002
“Kylix vs. gcc Development” http://community.borland.com/article/0,1410,28555,00.html
“Technical Overview of the Kylix Compiler” http://community.borland.com/article/0,1410,28561,00.html
“Apache Development with Kylix” http://community.borland.com/article/0,1410,28556,00.html 
Kylix and Qt, excerpts form Kylix newsgroup http://community.borland.com/article/0,1410,21850,00.html
Kylix newsgroup – “borland.public.kylix,non-technical”

Kylix
product demo…




'작업 > 리눅스' 카테고리의 다른 글

시스템 콜 관련  (0) 2010.05.03
LINUX System Call Quick Reference  (0) 2010.04.06
KVM  (0) 2010.03.24
리눅스용 개발 도구  (0) 2010.03.23
gcc coverage  (0) 2010.03.22