Based on the Linux Master 2 exam syllabusReport an error
| Layer | What is said at this layer | Job |
|---|---|---|
| Application | "Put an 'OK' button here" | Decides what to show |
| Toolkit (GTK+ · Qt) | "A button is a rounded rectangle with text, and the color changes when pressed" | Builds the look and behavior of widgets |
| Low-level library (Xlib · XCB) | "A rectangle at coordinates (10,20), with text inside" | Converts drawing instructions into X protocol messages and sends them |
| X server | (Draws on the screen as received) | Handles the actual screen output and input devices |
| Item | Xlib | XCB |
|---|---|---|
| Full name | X Library | X protocol C-language Binding |
| Appeared | Traditional, old | A later replacement |
| Layer | A library wrapping the X protocol | Thinner — closer to the X server |
| Communication | Mainly synchronous | Asynchronous |
| Size | Heavy | Light |
The answer to the question "Which is the low-level X client library closest to the X server?" is XCB. Qt, GTK+, and FLTK are toolkits in a layer above that, so they cannot be the answer.
Xlib (synchronous) XCB (asynchronous)
sends request 1 sends request 1
… waits until the reply arrives sends request 2
receives reply 1 sends request 3
sends request 2 … does other work
… waits receives replies 1 · 2 · 3 when needed
receives reply 2| Confusing phrasing | Correct answer |
|---|---|
| The library closest to the X server, the lowest-level one | XCB |
| The traditional, oldest low-level library | Xlib |
| "Made to replace Xlib" | XCB |
| The asynchronous one | XCB |
| The one that provides widgets | A toolkit (GTK+ · Qt …) — neither of the two |
xterm, xclock) were built on top of it.These are libraries that build widgets such as buttons, menus, and checkboxes.
| Toolkit | Full name · origin | Language | Used by |
|---|---|---|---|
| GTK+ | GIMP Toolkit | C | GNOME, GIMP, Xfce |
| Qt | (pronounced "cute") | C++ | KDE, VLC |
| FLTK | Fast Light Toolkit | C++ | Lightweight programs |
| Motif | — | C | CDE, traditional commercial Unix |
| Tk | The graphical part of Tcl/Tk | Tcl | For scripts |
| XForms | — | C | An old toolkit |
| Pair | What they share |
|---|---|
| Xlib ↔ XCB | Both are low-level libraries |
| GTK+ ↔ Qt | Both are representative toolkits |
| GNOME ↔ Xfce | Both are desktop environments that use GTK+ |
| KDE ↔ Qt | KDE is built with Qt |
It is asked in the form "the one of a different kind from the rest". For example, among
Xlib · XCB · GTK+, GTK+ is a toolkit so it is different, and amongGTK+ · Qt · FLTK · XCB, XCB is a low-level library so it is different.
| Item | GTK+ | Qt |
|---|---|---|
| Language | C | C++ |
| Origin | Developed to build GIMP | Norway's Trolltech |
| Representative desktops | GNOME, Xfce, LXDE | KDE, LXQt |
| Representative programs | GIMP, Firefox | VLC, Krita |
1996 KDE starts chose Qt — but at the time Qt was not under a free software license
│
1997 GNOME starts raised the banner of "a completely free desktop" and chose GTK+
│
after Qt was also released under GPL · LGPL — the license problem was resolved but the two camps remained| Item | GTK+ | Qt |
|---|---|---|
| License | LGPL | Offered under GPL · LGPL together with a commercial license |
| Changes of its maker | GIMP developers → GNOME project | Trolltech → Nokia → today's The Qt Company |
| Where it runs | Linux-centered, also supports Windows and macOS | Broadly across Linux, Windows, macOS, even mobile |
| Name notation | From recent versions, the + is dropped and it is written GTK | — |
GTK+. It is the same as GTK.| Program | Kind | Toolkit |
|---|---|---|
| GIMP | Image editor | GTK+ (the starting point of this toolkit) |
| gedit · Nautilus | GNOME's editor · file manager | GTK+ |
| Firefox (Linux version) | Web browser | GTK+ |
| Dolphin · Konsole · Kate | KDE's file manager · terminal · editor | Qt |
| VLC · Krita | Video player · drawing tool | Qt |
xterm · xclock · xeyes | Basic X programs | No toolkit; Xlib · Xt · Athena widgets |
application
│
┌────┴──────────────────────────┐
│ toolkit │ GTK+(C) · Qt(C++) · FLTK · Motif · Tk
└────┬──────────────────────────┘
│
┌────┴──────────────────────────┐
│ low-level library │ Xlib · XCB ← XCB is further down
└────┬──────────────────────────┘
│ X protocol
▼
X server| Toolkit | One thing to remember | Names that come with it |
|---|---|---|
| FLTK | Aims to be small and fast. Read as "full tick" | Fast Light Toolkit |
| Motif | The standard of the commercial Unix era. Built on top of Xt | CDE, OpenMotif, LessTif |
| Tk | Paired with the scripting language Tcl. Python's tkinter uses this too | Tcl/Tk |
| XForms | An old lightweight toolkit. Xfce was originally built with this | — |
| Name | Layer | Why it is easy to get wrong |
|---|---|---|
| XCB | Low-level library | An unfamiliar name, mistaken for a toolkit |
| Xlib | Low-level library | Mistaken for part of the X server — it is on the client side |
| GTK+ | Toolkit | Confused with GNOME (a desktop environment) |
| Qt | Toolkit | Confused with KDE (a desktop environment) |
| FLTK · Motif · Tk | Toolkit | The names are unfamiliar |
| GIMP | Application | Mistaken for a toolkit because of "GIMP Toolkit" |
| GNOME · KDE | Desktop environment | Layers get mixed up when memorized as a bundle with toolkits |
| X11 | Protocol version | Mistaken for a library name |
| X.org Server | X server | — |
XCB → Xlib → toolkit (GTK+, Qt) → application.| Memory hook | Content |
|---|---|
| A name starting with X is a lower layer | Xlib and XCB are low-level libraries (but XForms is a toolkit) |
| A name ending in tk/TK is a toolkit | GTK+, FLTK, Tk — short for toolkit |
| C is G, C++ is Q | GTK+ = C = GNOME, Qt = C++ = KDE |
| CB is C Binding | XCB = X protocol C-language Binding |
Tomorrow we cover the distinctions among the window manager · display manager · desktop environment that sit on top of this.
Click a choice to reveal the answer and explanation.
Question 1
Which is the low-level X client library closest to the X server?
Question 2
Which programming language was used to write the GTK+ toolkit?
Question 3
Which toolkit is the foundation of the KDE desktop environment?
Question 4
Which of the following is in a different layer from the other three?
Question 5
Which program gave its name to the GTK+ toolkit?