Date post: | 08-Apr-2018 |
Category: |
Documents |
Upload: | rockymaxdeemann |
View: | 219 times |
Download: | 0 times |
of 125
8/7/2019 Blue Mug
1/125
Building an Embedded Linux PrototypeDevin Carraway, Chuck Groom
Blue Mug, Inc.
Contents copyright 2002 Blue Mug, Inc.
All rights reserved
Building an Embedded Linux Prototype p.1/2
8/7/2019 Blue Mug
2/125
Overvie
About Blue Mug, Inc.
Building an Embedded Linux Prototype p.2/2
8/7/2019 Blue Mug
3/125
Overvie
About Blue Mug, Inc.
Project
Building an Embedded Linux Prototype p.2/2
8/7/2019 Blue Mug
4/125
Overvie
About Blue Mug, Inc.
Project Hardware Selection
Building an Embedded Linux Prototype p.2/2
8/7/2019 Blue Mug
5/125
Overvie
About Blue Mug, Inc.
Project Hardware Selection
Low-level
Building an Embedded Linux Prototype p.2/2
8/7/2019 Blue Mug
6/125
Overvie
About Blue Mug, Inc.
Project Hardware Selection
Low-level
User Interface
Building an Embedded Linux Prototype p.2/2
8/7/2019 Blue Mug
7/125
Overvie
About Blue Mug, Inc.
Project Hardware Selection
Low-level
User Interface UI Design
Building an Embedded Linux Prototype p.2/2
8/7/2019 Blue Mug
8/125
Overvie
About Blue Mug, Inc.
Project Hardware Selection
Low-level
User Interface UI Design
Embeddable Linux GUIs
Building an Embedded Linux Prototype p.2/2
8/7/2019 Blue Mug
9/125
Overvie
About Blue Mug, Inc.
Project Hardware Selection
Low-level
User Interface UI Design
Embeddable Linux GUIs Modifying Gtk+
Building an Embedded Linux Prototype p.2/2
8/7/2019 Blue Mug
10/125
About U
Devin and Chuck are project engineers
We write specs, design products, and write code
Devin is... Linux master
Chuck is that user interface guy
Building an Embedded Linux Prototype p.3/2
8/7/2019 Blue Mug
11/125
About Blue Mug, Inc.
Building an Embedded Linux Prototype p.4/2
8/7/2019 Blue Mug
12/125
About Blue Mug, Inc.
Blue Mug creates software for mobile devices
Building an Embedded Linux Prototype p.4/2
8/7/2019 Blue Mug
13/125
About Blue Mug, Inc.
Blue Mug creates software for mobile devices
Building an Embedded Linux Prototype p.4/2
8/7/2019 Blue Mug
14/125
About Blue Mug, Inc.
Blue Mug creates software for mobile devices
Building an Embedded Linux Prototype p.4/2
8/7/2019 Blue Mug
15/125
About Blue Mug, Inc.
Blue Mug creates software for mobile devices
Located in Berkeley
About 18 employees, 90% engineers
Founded in 1999 (from Geoworks Mobile OSGroup)
Building an Embedded Linux Prototype p.4/2
8/7/2019 Blue Mug
16/125
About Blue Mug, Inc.
Blue Mug creates software for mobile devices
We like Linux and embedded Linux, from severalpoints of view:
Business: free, not a dead-end technology Developer: sane platform
Users: stable, doesnt suck
Building an Embedded Linux Prototype p.4/2
8/7/2019 Blue Mug
17/125
About Blue Mug, Inc.
Blue Mug creates software for mobile devices
But were not a Linux-only company
GEOS-SC OS
PalmOS RTOS
J2ME, BREW
Small embedded projects
Building an Embedded Linux Prototype p.4/2
8/7/2019 Blue Mug
18/125
The Projec
Our client asked us to create a prototype for a device:
Low-cost (
8/7/2019 Blue Mug
19/125
The Projec
Our client asked us to create a prototype for a device:
Low-cost (
8/7/2019 Blue Mug
20/125
The Projec
Our client asked us to create a prototype for a device:
Low-cost (
8/7/2019 Blue Mug
21/125
The Projec
Our client asked us to create a prototype for a device:
Low-cost (
8/7/2019 Blue Mug
22/125
The Projec
Our client asked us to create a prototype for a device:
Low-cost (
8/7/2019 Blue Mug
23/125
The Projec
Our client asked us to create a prototype for a device:
Low-cost (
8/7/2019 Blue Mug
24/125
Project Example Mockup
Building an Embedded Linux Prototype p.6/2
8/7/2019 Blue Mug
25/125
Hardware Selection
Which embeddable system-on-a-chip to use?
Building an Embedded Linux Prototype p.7/2
8/7/2019 Blue Mug
26/125
Hardware Selection
Which embeddable system-on-a-chip to use?
Considerations:
Performance
Price Power consumption
Building an Embedded Linux Prototype p.7/2
8/7/2019 Blue Mug
27/125
Hardware Selection
Which embeddable system-on-a-chip to use?
StrongARM, PPC use too much power, cost too much
Building an Embedded Linux Prototype p.7/2
8/7/2019 Blue Mug
28/125
Hardware Selection
Which embeddable system-on-a-chip to use?
MIPS, SH are struggling
Building an Embedded Linux Prototype p.7/2
8/7/2019 Blue Mug
29/125
Hardware Selection
Which embeddable system-on-a-chip to use?
ARM is cheap, low-power, reasonably fast.We choose the Cirrus Logic EP7211 board.
Building an Embedded Linux Prototype p.7/2
8/7/2019 Blue Mug
30/125
Hardware Selection
Which embeddable system-on-a-chip to use?
ARM is cheap, low-power, reasonably fast.We choose the Cirrus Logic EP7211 board.
75Mhz ARM7
Building an Embedded Linux Prototype p.7/2
8/7/2019 Blue Mug
31/125
Hardware Selection
Which embeddable system-on-a-chip to use?
ARM is cheap, low-power, reasonably fast.We choose the Cirrus Logic EP7211 board.
75Mhz ARM7
16Mb Flash, 16Mb RAM
Building an Embedded Linux Prototype p.7/2
8/7/2019 Blue Mug
32/125
Hardware Selection
Which embeddable system-on-a-chip to use?
ARM is cheap, low-power, reasonably fast.We choose the Cirrus Logic EP7211 board.
75Mhz ARM7
16Mb Flash, 16Mb RAM
Low-power (170mw)
Building an Embedded Linux Prototype p.7/2
8/7/2019 Blue Mug
33/125
Hardware Selection
Which embeddable system-on-a-chip to use?
ARM is cheap, low-power, reasonably fast.We choose the Cirrus Logic EP7211 board.
75Mhz ARM7
16Mb Flash, 16Mb RAM
Low-power (170mw)
Successor to PS7110 used in Psion Series 5, forwhich there is a Linux port.
Building an Embedded Linux Prototype p.7/2
8/7/2019 Blue Mug
34/125
System Overvie
Two 8Mb banks of Flash
Kernel in one bank Root file system in other bank (mounted
read-only)
/tmp in RAM User files, add-on apps in RAM
No swap!
Building an Embedded Linux Prototype p.8/2
8/7/2019 Blue Mug
35/125
Size/RAM issue
Size: 8Mb for all libraries, GUI, windowing system,and apps
Building an Embedded Linux Prototype p.9/2
8/7/2019 Blue Mug
36/125
Size/RAM issue
Size: 8Mb for all libraries, GUI, windowing system,and apps JFFS2 and cramfs (compressed file systems)
werent ready at the time
Building an Embedded Linux Prototype p.9/2
8/7/2019 Blue Mug
37/125
Size/RAM issue
Size: 8Mb for all libraries, GUI, windowing system,and apps JFFS2 and cramfs (compressed file systems)
werent ready at the time Could compile in Thumb (16-bit) instruction set
Building an Embedded Linux Prototype p.9/2
8/7/2019 Blue Mug
38/125
Size/RAM issue
Size: 8Mb for all libraries, GUI, windowing system,and apps JFFS2 and cramfs (compressed file systems)
werent ready at the time Could compile in Thumb (16-bit) instruction set
Size-for-speed Tricky; dynamic linking, c library...
Building an Embedded Linux Prototype p.9/2
8/7/2019 Blue Mug
39/125
Size/RAM issue
Size: 8Mb for all libraries, GUI, windowing system,and apps JFFS2 and cramfs (compressed file systems)
werent ready at the time Could compile in Thumb (16-bit) instruction set
Size-for-speed Tricky; dynamic linking, c library...
RAM usage
Building an Embedded Linux Prototype p.9/2
8/7/2019 Blue Mug
40/125
Size/RAM issue
Size: 8Mb for all libraries, GUI, windowing system,and apps JFFS2 and cramfs (compressed file systems)
werent ready at the time Could compile in Thumb (16-bit) instruction set
Size-for-speed Tricky; dynamic linking, c library...
RAM usage Could do XIP from RAM
Building an Embedded Linux Prototype p.9/2
8/7/2019 Blue Mug
41/125
Size/RAM issue
Size: 8Mb for all libraries, GUI, windowing system,and apps JFFS2 and cramfs (compressed file systems)
werent ready at the time Could compile in Thumb (16-bit) instruction set
Size-for-speed Tricky; dynamic linking, c library...
RAM usage Could do XIP from RAM Never ran out of RAM in testing
Building an Embedded Linux Prototype p.9/2
L L l OO
8/7/2019 Blue Mug
42/125
Low-Level: OO
Out of Memory What to do?
Building an Embedded Linux Prototype p.10/2
L L l OO
8/7/2019 Blue Mug
43/125
Low-Level: OO
Out of Memory What to do?
Difficult on desktop. Linux kills processes based onCPU usage, run time, and access to privileged I/Oresources.
Building an Embedded Linux Prototype p.10/2
L L l OO
8/7/2019 Blue Mug
44/125
Low-Level: OO
Out of Memory What to do?
Difficult on desktop. Linux kills processes based onCPU usage, run time, and access to privileged I/Oresources.
Easier on embedded system
Building an Embedded Linux Prototype p.10/2
L L l OO
8/7/2019 Blue Mug
45/125
Low-Level: OO
Out of Memory What to do?
Difficult on desktop. Linux kills processes based onCPU usage, run time, and access to privileged I/Oresources.
Easier on embedded system
Known set of processes (eg. BeOS kill thebrowser approach)
Tie into UI to display warning or errors
Require apps to be aware of low-memory
situationsBuilding an Embedded Linux Prototype p.10/2
Low-Level: Memory Mappin
8/7/2019 Blue Mug
46/125
Low-Level: Memory Mappin
EP7211 memory is non-contiguous
Building an Embedded Linux Prototype p.11/2
Low-Level: Memory Mappin
8/7/2019 Blue Mug
47/125
Low-Level: Memory Mappin
EP7211 memory is non-contiguous
Use kernel macros to map between actual andlinear presentation of memory
Building an Embedded Linux Prototype p.11/2
Low-Level: Which C Library
8/7/2019 Blue Mug
48/125
Low-Level: Which C Library
C library is almost as big as kernel. Which C library touse?
glibc: GNU C library, the standard
Building an Embedded Linux Prototype p.12/2
Low-Level: Which C Library
8/7/2019 Blue Mug
49/125
Low Level: Which C Library
C library is almost as big as kernel. Which C library touse?
glibc: GNU C library, the standard
sglibc: Patched glibc
Building an Embedded Linux Prototype p.12/2
Low-Level: Which C Library
8/7/2019 Blue Mug
50/125
Low Level: Which C Library
C library is almost as big as kernel. Which C library touse?
glibc: GNU C library, the standard
sglibc: Patched glibc
CLibc: Reduced-size, standard API
Building an Embedded Linux Prototype p.12/2
Low-Level: Which C Library
8/7/2019 Blue Mug
51/125
Low Level: Which C Library
C library is almost as big as kernel. Which C library touse?
glibc: GNU C library, the standard
sglibc: Patched glibc
CLibc: Reduced-size, standard API
Diet libc: Reduced-size, breaks API
Building an Embedded Linux Prototype p.12/2
Low-Level: Which C Library
8/7/2019 Blue Mug
52/125
Low Level: Which C Library
C library is almost as big as kernel. Which C library touse?
glibc: GNU C library, the standard
sglibc: Patched glibc
CLibc: Reduced-size, standard API
Diet libc: Reduced-size, breaks API
Start with GLibC, move to sglibc.
Building an Embedded Linux Prototype p.12/2
User Interface: Design Principles
8/7/2019 Blue Mug
53/125
g p
The user interface (UI) can mean the success orfailure of a consumer device
Building an Embedded Linux Prototype p.13/2
User Interface: Design Principles
8/7/2019 Blue Mug
54/125
g p
The user interface (UI) can mean the success orfailure of a consumer device
You cant have a general-purpose mobile deviceGUI; it must fit device particulars
Building an Embedded Linux Prototype p.13/2
User Interface: Design Principles
8/7/2019 Blue Mug
55/125
g p
The user interface (UI) can mean the success orfailure of a consumer device
You cant have a general-purpose mobile deviceGUI; it must fit device particulars
Good: Palm UI fits small-screen, stylus-centralorganizer
Building an Embedded Linux Prototype p.13/2
User Interface: Design Principles
8/7/2019 Blue Mug
56/125
g p
The user interface (UI) can mean the success orfailure of a consumer device
You cant have a general-purpose mobile deviceGUI; it must fit device particulars
Good: Palm UI fits small-screen, stylus-centralorganizer
Bad: WinCE UI presents entire desktop interface on
small screen
Building an Embedded Linux Prototype p.13/2
User Interface: User Goal
8/7/2019 Blue Mug
57/125
Always keep the users goals in mind.
Mobility = urgency
Building an Embedded Linux Prototype p.14/2
User Interface: User Goal
8/7/2019 Blue Mug
58/125
Always keep the users goals in mind.
Mobility = urgency Objective: get job done
Building an Embedded Linux Prototype p.14/2
User Interface: User Goal
8/7/2019 Blue Mug
59/125
Always keep the users goals in mind.
Mobility = urgency Objective: get job done
Technology: avoid unless necessary
Building an Embedded Linux Prototype p.14/2
User Interface: User Goal
8/7/2019 Blue Mug
60/125
Always keep the users goals in mind.
Mobility = urgency Objective: get job done
Technology: avoid unless necessary
Status notification: dont alert unless problem
Building an Embedded Linux Prototype p.14/2
User Interface: User Goal
8/7/2019 Blue Mug
61/125
Always keep the users goals in mind.
Mobility = urgency Objective: get job done
Technology: avoid unless necessary
Status notification: dont alert unless problem
Rich feature set: device feels unpredictable
Building an Embedded Linux Prototype p.14/2
User Interface: Given
8/7/2019 Blue Mug
62/125
Instant response to user interaction
Building an Embedded Linux Prototype p.15/2
User Interface: Given
8/7/2019 Blue Mug
63/125
Instant response to user interaction
Always-on app model
Building an Embedded Linux Prototype p.15/2
User Interface: Given
8/7/2019 Blue Mug
64/125
Instant response to user interaction
Always-on app model Primarily softkey control
Building an Embedded Linux Prototype p.15/2
8/7/2019 Blue Mug
65/125
User Interface: Given
8/7/2019 Blue Mug
66/125
Instant response to user interaction
Always-on app model
Primarily softkey control
No touchscreen
Cheap screen
Building an Embedded Linux Prototype p.15/2
User Interface: Given
8/7/2019 Blue Mug
67/125
Instant response to user interaction
Always-on app model
Primarily softkey control
No touchscreen
Cheap screen Small
Building an Embedded Linux Prototype p.15/2
User Interface: Given
8/7/2019 Blue Mug
68/125
Instant response to user interaction
Always-on app model
Primarily softkey control
No touchscreen
Cheap screen Small Grays cost power
Building an Embedded Linux Prototype p.15/2
User Interface: Given
8/7/2019 Blue Mug
69/125
Instant response to user interaction
Always-on app model
Primarily softkey control
No touchscreen
Cheap screen Small Grays cost power Low-contrast
Building an Embedded Linux Prototype p.15/2
User Interface: Given
8/7/2019 Blue Mug
70/125
Instant response to user interaction
Always-on app model
Primarily softkey control
No touchscreen
Cheap screen Small Grays cost power Low-contrast
Walk up and use interface
Building an Embedded Linux Prototype p.15/2
User Interface: Given
8/7/2019 Blue Mug
71/125
Instant response to user interaction
Always-on app model
Primarily softkey control
No touchscreen
Cheap screen Small Grays cost power Low-contrast
Walk up and use interface Borrow desktop elements as needed
Building an Embedded Linux Prototype p.15/2
User Interface: Given
8/7/2019 Blue Mug
72/125
Instant response to user interaction
Always-on app model
Primarily softkey control
No touchscreen
Cheap screen Small Grays cost power Low-contrast
Walk up and use interface Borrow desktop elements as needed Limit choices
Building an Embedded Linux Prototype p.15/2
User Interface: Our Design
8/7/2019 Blue Mug
73/125
(This is a conceptual mockup)
Building an Embedded Linux Prototype p.16/2
User Interface: Our Design
8/7/2019 Blue Mug
74/125
Use desktop GUI widgets with softkey control
Building an Embedded Linux Prototype p.16/2
User Interface: Our Design
8/7/2019 Blue Mug
75/125
Use desktop GUI widgets with softkey control
Building an Embedded Linux Prototype p.16/2
User Interface: Our Design
8/7/2019 Blue Mug
76/125
Use desktop GUI widgets with softkey control
Building an Embedded Linux Prototype p.16/2
User Interface: Our Design
8/7/2019 Blue Mug
77/125
Place options in menu. Hide menu to save screenspace, but indicate existence.
Building an Embedded Linux Prototype p.16/2
User Interface: Our Design
8/7/2019 Blue Mug
78/125
Menu bar includes time and battery.
Building an Embedded Linux Prototype p.16/2
User Interface: Our Design
8/7/2019 Blue Mug
79/125
Menu is modal and takes control of softkey bar. Otherwidgets are inactive.
Building an Embedded Linux Prototype p.16/2
User Interface: Other Elements
8/7/2019 Blue Mug
80/125
Other misc. design elements...
Softkeys vs. buttons.
Building an Embedded Linux Prototype p.17/2
8/7/2019 Blue Mug
81/125
User Interface: Other Elements
8/7/2019 Blue Mug
82/125
Other misc. design elements...
Softkeys vs. buttons. Softkeys can be stand-alone Use buttons when action affects pane.
Building an Embedded Linux Prototype p.17/2
User Interface: Other Elements
8/7/2019 Blue Mug
83/125
Other misc. design elements...
Softkeys vs. buttons. Softkeys can be stand-alone Use buttons when action affects pane.
Added indeterminate state to radio buttons,check boxes
Building an Embedded Linux Prototype p.17/2
User Interface: Other Elements
8/7/2019 Blue Mug
84/125
Other misc. design elements...
Softkeys vs. buttons. Softkeys can be stand-alone Use buttons when action affects pane.
Added indeterminate state to radio buttons,check boxes
Dialogs
Building an Embedded Linux Prototype p.17/2
8/7/2019 Blue Mug
85/125
8/7/2019 Blue Mug
86/125
User Interface: Embeddable Linu
GUI
8/7/2019 Blue Mug
87/125
How do we implement this interface?
Tweak existing UI. There are many possible LinuxUIs to pick between.
Building an Embedded Linux Prototype p.18/2
User Interface: Embeddable Linu
GUI
8/7/2019 Blue Mug
88/125
Criteria:
Completeness Size
Multiple apps can access framebuffer
Language (C, C++)
License
Building an Embedded Linux Prototype p.18/2
User Interface: Embeddable LinuGUI
8/7/2019 Blue Mug
89/125
Gtk+
Qt/e
FLTK
OpenGUI
MiniGUI PicoGUI
Microwindows
...
Building an Embedded Linux Prototype p.18/2
User Interface: Embeddable LinuGUI
8/7/2019 Blue Mug
90/125
Narrowed to Gtk+ or Qt/e
Building an Embedded Linux Prototype p.18/2
User Interface: Embeddable LinuGUI
8/7/2019 Blue Mug
91/125
Qt
KDE Desktop
Developed by TrollTech
C++ framework
Qt/E is reduced, runs on framebuffer QTopia app infrastructure
Pain to compile
Dual-license
Building an Embedded Linux Prototype p.18/2
User Interface: Embeddable LinuGUI
8/7/2019 Blue Mug
92/125
Gtk+
GNOME Desktop
Open source project
C
Developed on X; also Gtk+/fb LGPL
Building an Embedded Linux Prototype p.18/2
User Interface: Embeddable LinuGUI
8/7/2019 Blue Mug
93/125
Decided on Gtk+ running on X
Building an Embedded Linux Prototype p.18/2
User Interface: Embeddable LinuGUI
8/7/2019 Blue Mug
94/125
Decided on Gtk+ running on X
X Windows! Eek! Client-server windowing system
Network-transparent
20 years old
Widely regarded as bloated and archaic
Building an Embedded Linux Prototype p.18/2
User Interface: Embeddable LinuGUI
8/7/2019 Blue Mug
95/125
Decided on Gtk+ running on X
We like X X is stable
Network-transparency is helpful
TinyX
Building an Embedded Linux Prototype p.18/2
User Interface: Embeddable LinuGUI
8/7/2019 Blue Mug
96/125
Decided on Gtk+ running on X
Modified AEWM window manager Vertical title bars
Inter-app communication
Application-level awareness of modal dialogs
Building an Embedded Linux Prototype p.18/2
User Interface: Modifying Gtk+
8/7/2019 Blue Mug
97/125
Trim unnecessary widgets (eg. file dialog, colorselection)
Building an Embedded Linux Prototype p.19/2
User Interface: Modifying Gtk+
8/7/2019 Blue Mug
98/125
Trim unnecessary widgets (eg. file dialog, colorselection)
Widget sizing
Building an Embedded Linux Prototype p.19/2
User Interface: Modifying Gtk+
8/7/2019 Blue Mug
99/125
Trim unnecessary widgets (eg. file dialog, colorselection)
Widget sizing Widget drawing
Building an Embedded Linux Prototype p.19/2
User Interface: Modifying Gtk+
8/7/2019 Blue Mug
100/125
Trim unnecessary widgets (eg. file dialog, colorselection)
Widget sizing Widget drawing
GtkWindow (*)
Building an Embedded Linux Prototype p.19/2
User Interface: Modifying Gtk+
8/7/2019 Blue Mug
101/125
Trim unnecessary widgets (eg. file dialog, colorselection)
Widget sizing Widget drawing
GtkWindow (*) Font management (*)
Building an Embedded Linux Prototype p.19/2
User Interface: Modifying Gtk+
8/7/2019 Blue Mug
102/125
Trim unnecessary widgets (eg. file dialog, colorselection)
Widget sizing Widget drawing
GtkWindow (*) Font management (*)
Changes in-place, not sub-classed
Building an Embedded Linux Prototype p.19/2
User Interface: Modifying Gtk+
8/7/2019 Blue Mug
103/125
Trim unnecessary widgets (eg. file dialog, colorselection)
Widget sizing Widget drawing
GtkWindow (*) Font management (*)
2.9Mb footprint for Gtk+/X; this could be reduced to2.4Mb.
Building an Embedded Linux Prototype p.19/2
User Interface: GtkWindo
8/7/2019 Blue Mug
104/125
Application window talks to window manager
Building an Embedded Linux Prototype p.20/2
User Interface: GtkWindo
8/7/2019 Blue Mug
105/125
Application window talks to window manager
Application window has-a softkey bar
Building an Embedded Linux Prototype p.20/2
User Interface: GtkWindo
8/7/2019 Blue Mug
106/125
Application window talks to window manager
Application window has-a softkey bar Not nested within widget
Building an Embedded Linux Prototype p.20/2
User Interface: GtkWindo
A li i i d lk i d
8/7/2019 Blue Mug
107/125
Application window talks to window manager
Application window has-a softkey bar Not nested within widget
API to register softkeys on application window
Building an Embedded Linux Prototype p.20/2
User Interface: GtkWindo
A li ti i d t lk t i d
8/7/2019 Blue Mug
108/125
Application window talks to window manager
Application window has-a softkey bar Not nested within widget
API to register softkeys on application window
Scrolling full-screen window
Building an Embedded Linux Prototype p.20/2
User Interface: GtkWindo
A li ti i d t lk t i d
8/7/2019 Blue Mug
109/125
Application window talks to window manager
Application window has-a softkey bar Not nested within widget
API to register softkeys on application window
Scrolling full-screen window
Building an Embedded Linux Prototype p.20/2
User Interface: Fon
T h f t i t k Gtk
8/7/2019 Blue Mug
110/125
To change a font in stock Gtk+:
Clone widgets GtkStyle
Load a new X font, such as-adobe-helvetica-bold-r-normal-
12-*-*-*-p-*-iso8859-1
Building an Embedded Linux Prototype p.21/2
User Interface: Fon
To change a font in stock Gtk :
8/7/2019 Blue Mug
111/125
To change a font in stock Gtk+:
Clone widgets GtkStyle
Load a new X font, such as-adobe-helvetica-bold-r-normal-
12-*-*-*-p-*-iso8859-1
GtkStyle is fairly big, so this is expensive. And thedeveloper has to know the specific font name.
Building an Embedded Linux Prototype p.21/2
User Interface: Fon
We wrote API for requesting fonts by attribute relative
8/7/2019 Blue Mug
112/125
We wrote API for requesting fonts by attribute relativeto the base font.
Building an Embedded Linux Prototype p.21/2
User Interface: Fon
We wrote API for requesting fonts by attribute relative
8/7/2019 Blue Mug
113/125
We wrote API for requesting fonts by attribute relativeto the base font.
gtk widget set font bold (widget, TRUE);gtk widget set font enlarge (widget, 1);
Building an Embedded Linux Prototype p.21/2
User Interface: Fon
We wrote API for requesting fonts by attribute relative
8/7/2019 Blue Mug
114/125
We wrote API for requesting fonts by attribute relativeto the base font.
gtk widget set font bold (widget, TRUE);gtk widget set font enlarge (widget, 1);
We added a GdkFont * font to GtkWidget. Use
widget->font if possible, otherwise usewidget->style->font
Building an Embedded Linux Prototype p.21/2
User Interface: Fon
We wrote API for requesting fonts by attribute relative
8/7/2019 Blue Mug
115/125
We wrote API for requesting fonts by attribute relativeto the base font.
gtk widget set font bold (widget, TRUE);gtk widget set font enlarge (widget, 1);
We added a GdkFont * font to GtkWidget. Use
widget->font if possible, otherwise usewidget->style->font
You can request font changes even before Gtk+ knows
the base font.
Building an Embedded Linux Prototype p.21/2
User Interface: Performance
Slow launch times
8/7/2019 Blue Mug
116/125
Slow launch times
Building an Embedded Linux Prototype p.22/2
User Interface: Performance
Slow launch times
8/7/2019 Blue Mug
117/125
Slow launch times 2.4 seconds for most complicated app
Memory bandwidth bottleneck For now, display eye candy when app is
launched
In future, predictively launch applications
Building an Embedded Linux Prototype p.22/2
User Interface: Performance
Slow launch times
8/7/2019 Blue Mug
118/125
Slow launch times
Loading pixmaps
Building an Embedded Linux Prototype p.22/2
User Interface: Performance
Slow launch times
8/7/2019 Blue Mug
119/125
Slow launch times
Loading pixmaps XPM format is bulky Gtk+s XPM parser sucks Hack parser Hand post-rendered pixmaps to X server
Building an Embedded Linux Prototype p.22/2
User Interface: Performance
Slow launch times
8/7/2019 Blue Mug
120/125
Slow launch times
Loading pixmaps
Floating point calculations
Building an Embedded Linux Prototype p.22/2
User Interface: Performance
Slow launch times
8/7/2019 Blue Mug
121/125
Loading pixmaps
Floating point calculations Floating point calculations are expensive on
ARM Gtk+ uses floating points for widget positioning Integer math positioning gives a 3-12%
speedup
Building an Embedded Linux Prototype p.22/2
Conclusion
Were happy with our choice of Gtk+/X
8/7/2019 Blue Mug
122/125
ppy
Building an Embedded Linux Prototype p.23/2
Conclusion
Were happy with our choice of Gtk+/X
8/7/2019 Blue Mug
123/125
ppy
OSS made this project possible
Building an Embedded Linux Prototype p.23/2
Conclusion
Were happy with our choice of Gtk+/X
8/7/2019 Blue Mug
124/125
ppy
OSS made this project possible
Demo!
Building an Embedded Linux Prototype p.23/2
Conclusion
Were happy with our choice of Gtk+/X
8/7/2019 Blue Mug
125/125
OSS made this project possible
Demo!
Questions?
Building an Embedded Linux Prototype p.23/2