source: x/lib/gtk4.xml@ 1e361b35

12.0 12.1 ken/TL2024 ken/tuningfonts lazarus plabs/newcss python3.11 rahul/power-profiles-daemon renodr/vulkan-addition trunk xry111/llvm18
Last change on this file since 1e361b35 was 1e361b35, checked in by Xi Ruoyao <xry111@…>, 9 months ago

gtk-{3,4}: Use dbus-run-session for testing

If a dbus session address is not available, some tests will fail.

Not sure about gtk-2.

  • Property mode set to 100644
File size: 17.6 KB
Line 
1<?xml version="1.0" encoding="ISO-8859-1"?>
2<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
3 "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
4 <!ENTITY % general-entities SYSTEM "../../general.ent">
5 %general-entities;
6
7 <!ENTITY gtk4-download-http "&gnome-download-http;/gtk/&gtk4-minor;/gtk-&gtk4-version;.tar.xz">
8 <!ENTITY gtk4-download-ftp "&gnome-download-ftp;/gtk/&gtk4-minor;/gtk-&gtk4-version;.tar.xz">
9 <!ENTITY gtk4-md5sum "69372ddb998c125c3a04c44b8c68b339">
10 <!ENTITY gtk4-size "16 MB">
11 <!ENTITY gtk4-buildsize "562 MB (with docs; add 29 MB for tests)">
12 <!ENTITY gtk4-time "1.3 SBU (using parallelism=4; with docs; add 0.6 SBU for tests)">
13]>
14
15<sect1 id="gtk4" xreflabel="GTK-&gtk4-version;">
16 <?dbhtml filename="gtk4.html"?>
17
18 <title>GTK-&gtk4-version;</title>
19
20 <indexterm zone="gtk4">
21 <primary sortas="a-gtk4">GTK-4</primary>
22 </indexterm>
23
24 <sect2 role="package">
25 <title>Introduction to GTK 4</title>
26
27 <para>
28 The <application>GTK 4</application> package contains libraries used for
29 creating graphical user interfaces for applications.
30 </para>
31
32 &lfs120_checked;
33
34 <bridgehead renderas="sect3">Package Information</bridgehead>
35 <itemizedlist spacing="compact">
36 <listitem>
37 <para>
38 Download (HTTP): <ulink url="&gtk4-download-http;"/>
39 </para>
40 </listitem>
41 <listitem>
42 <para>
43 Download (FTP): <ulink url="&gtk4-download-ftp;"/>
44 </para>
45 </listitem>
46 <listitem>
47 <para>
48 Download MD5 sum: &gtk4-md5sum;
49 </para>
50 </listitem>
51 <listitem>
52 <para>
53 Download size: &gtk4-size;
54 </para>
55 </listitem>
56 <listitem>
57 <para>
58 Estimated disk space required: &gtk4-buildsize;
59 </para>
60 </listitem>
61 <listitem>
62 <para>
63 Estimated build time: &gtk4-time;
64 </para>
65 </listitem>
66 </itemizedlist>
67
68 <bridgehead renderas="sect3">GTK 4 Dependencies</bridgehead>
69
70 <bridgehead renderas="sect4">Required</bridgehead>
71 <para role="required">
72 <xref linkend="fribidi"/>,
73 <xref linkend="gdk-pixbuf"/>,
74 <xref linkend="graphene"/>,
75 <xref linkend="iso-codes"/>,
76 <xref linkend="libepoxy"/>,
77 <xref linkend="libxkbcommon"/>,
78 <xref linkend="pango"/>,
79 <xref linkend="pygobject3"/>, and
80 <xref linkend="wayland-protocols"/>
81 </para>
82
83 <bridgehead renderas="sect4">Recommended</bridgehead>
84 <para role="recommended">
85 <xref linkend="adwaita-icon-theme"/> (default for some gtk4 settings keys),
86 <xref linkend="gst10-plugins-bad"/>,
87 <xref role='runtime' linkend="gst10-plugins-good"/> (runtime,
88 built with <xref role='nodep' linkend='libvpx'/>),
89 <xref linkend="hicolor-icon-theme"/> (needed for tests and for defaults), and
90 <xref linkend="librsvg"/>
91 </para>
92
93 <bridgehead renderas="sect4">Recommended (Required if building GNOME)</bridgehead>
94 <para role="recommended">
95 <xref linkend="gobject-introspection"/>
96 </para>
97
98 <bridgehead renderas="sect4">Optional</bridgehead>
99 <para role="optional">
100 <xref linkend="colord"/>,
101 <xref linkend="cups"/>,
102 <xref linkend="docutils"/>,
103 <xref linkend="ffmpeg"/> (built with
104 <xref role='nodep' linkend='libvpx'/>),
105 <xref linkend="gi-docgen"/>,
106 <xref role="runtime" linkend="highlight"/>
107 (runtime, only used by <command>gtk4-demo</command> for syntax
108 highlighting of demo source code),
109 <xref linkend="libcloudproviders"/>,
110 <xref linkend="sassc"/>,
111 <xref linkend="tracker3"/>,
112 <ulink url="https://github.com/OpenPrinting/cpdb-libs">cpdb</ulink>, and
113 <ulink url="https://vulkan.lunarg.com/sdk/home">vulkan</ulink>
114 </para>
115
116 </sect2>
117
118 <sect2 role="installation">
119 <title>Installation of GTK 4</title>
120
121 <para>
122 First, make some changes from upstream:
123 </para>
124
125<screen><userinput>sed -e '/glib-object.h/a #include &lt;gdk/gdk.h&gt;' \
126 -e '/ gtk_printer_option/i GDK_AVAILABLE_IN_ALL' \
127 -e '/\*gtk_printer_option/i GDK_AVAILABLE_IN_ALL' \
128 -i.orig gtk/print/gtkprinteroptionprivate.h</userinput></screen>
129
130 <para>
131 Install <application>GTK 4</application> by running the following
132 commands:
133 </para>
134
135<screen><userinput>mkdir build &amp;&amp;
136cd build &amp;&amp;
137
138meson setup --prefix=/usr \
139 --buildtype=release \
140 -Dbroadway-backend=true \
141 -Dintrospection=enabled \
142 .. &amp;&amp;
143ninja</userinput></screen>
144
145 <para>
146 If you have <xref linkend='gi-docgen'/> installed and wish to build
147 the API documentation for this package, issue:
148 </para>
149
150<screen remap='doc'><userinput>sed "s@'doc'@&amp; / 'gtk-&gtk4-version;'@" -i ../docs/reference/meson.build &amp;&amp;
151meson configure -Dgtk_doc=true &amp;&amp;
152ninja</userinput></screen>
153
154 <para>
155 To run the tests, issue: <command>dbus-run-session meson test --setup
156 x11</command>. If you are in a Wayland session, replace x11 with wayland.
157 Nine tests are known to fail if
158 <ulink url="https://gitlab.gnome.org/GNOME/cantarell-fonts">Cantrell fonts</ulink>
159 are not installed. Many tests will fail if
160 <filename>~/.config/gtk-4.0/settings.ini</filename> exists and gtk-modules
161 is not commented out.
162 On systems with NVIDIA graphics cards, the tests may take significantly
163 longer than the advertised test time.
164 </para>
165<!-- [pierre]: 4.6.0, wayland: 727 ok; 2 Expected Fail; 1 Fail; 1 Skipped
166 [bdubbs]: 4.6.3, x11, 724 OK, 2 Expected Fail, 12 Fail. 1 Skipped
167 [pierre]: 4.6.6, wayland, 738 OK, 2 Expected Fail, 1 Fail. 1 Skipped
168 [pierre]: 4.6.7, wayland, 737 OK, 2 Expected Fail, 1 Fail. 1 Skipped. 1 Timeout
169 [bdubbs]: 4.6.7, x11, 758 OK, 2 Expected Fail, 9 Fail. 1 Skipped. 1 Timeout
170 [pierre]: 4.8.1, wayland, 765 OK, 2 Expected Fail, 2 Fail. 1 Skipped
171 [bdubbs]: 4.8.2, x11, 753 OK, 2 Expected Fail, 14 Fail. 1 Skipped
172 [pierre]: 4.8.3, wayland, 760 OK, 2 Expected Fail, 5 Fail. 3 Skipped
173 [bdubbs]: 4.10.0, x11, 701 OK, 0 Expected Fail, 15 Fail. 1 Skipped, 2 Timeout
174 above over ssh
175 [bdubbs]: 4.10.0, x11, 712 OK, 0 Expected Fail, 6 Fail. 1 Skipped, 0 Timeout
176 above on native x11
177 [bdubbs]: 4.12.0, x11, 1453 OK, 0 Expected Fail, 9 Fail. 5 Skipped, 0 Timeout
178 above on native x11
179-->
180
181 <para>
182 Now, as the <systemitem class="username">root</systemitem> user:
183 </para>
184
185<screen role="root"><userinput>ninja install</userinput></screen>
186 </sect2>
187
188 <sect2 role="commands">
189 <title>Command Explanations</title>
190
191 <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
192 href="../../xincludes/meson-buildtype-release.xml"/>
193
194 <para>
195 <parameter>-Dbroadway-backend=true</parameter>: This switch enables the
196 HTML5 GDK backend.
197 </para>
198
199 <para>
200 <parameter>-Dintrospection=enabled</parameter>: This switch enables
201 using <xref linkend='gobject-introspection'/> to generate GIR bindings
202 of this packages. These bindings are required by GNOME.
203 </para>
204
205 <para>
206 <option>-Dcloudproviders=enabled</option>: Use this switch if you have
207 <xref linkend="libcloudproviders" role="nodep"/> installed and wish to
208 enable support for cloud providers in a file chooser window.
209 </para>
210
211 <para>
212 <option>-Dsysprof=enabled</option>: Use this switch if you have
213 <xref linkend="sysprof"/> installed and wish to enable tracing support for
214 GTK4-based applications.
215 </para>
216
217 <para>
218 <option>-Dtracker=enabled</option>: Use this switch if you have
219 <xref linkend="tracker3"/> installed and wish to use search functionality
220 when running a file chooser.
221 </para>
222
223 <para>
224 <option>-Dcolord=enabled</option>: Use this switch if you have
225 <xref linkend="colord"/> installed and wish to use colord with the CUPS
226 printing backend.
227 </para>
228
229 <para>
230 <option>-Dman-pages=true</option>: Use this switch if you have
231 <xref linkend='docutils'/> installed and wish to generate the man
232 pages.
233 </para>
234
235 </sect2>
236
237 <sect2 role="configuration">
238 <title>Configuring GTK 4</title>
239
240 <sect3 id="gtk4-config">
241 <title>Config Files</title>
242 <para>
243 <filename>~/.config/gtk-4.0/settings.ini</filename> and
244 <filename>/usr/share/gtk-4.0/settings.ini</filename>
245 </para>
246
247 <indexterm zone="gtk4 gtk4-config">
248 <primary sortas="e-AA.home-gtk4-settings.ini">~/.config/gtk-4.0/settings.ini</primary>
249 </indexterm>
250
251 <indexterm zone="gtk4 gtk4-config">
252 <primary
253 sortas="e-usr-share-path-settings.ini">/usr/share/gtk-4.0/settings.ini</primary>
254 </indexterm>
255 </sect3>
256
257 <sect3><title>Configuration Information</title>
258
259 <para>
260 <application>GTK 4</application> themes change the way a
261 <application>GTK 4</application> application looks. An icon theme can
262 be used to change the icons that appear on the application's toolbar.
263 If you have installed a <application>GTK 4</application> theme (e.g.
264 the Adwaita theme built in <application>GTK 4</application>),
265 an icon theme (such as <xref linkend="oxygen-icons5"/>) and/or a font
266 (<xref linkend="dejavu-fonts"/>), you can set your preferences in
267 <filename>~/.config/gtk-4.0/settings.ini</filename>, or the default
268 system-wide configuration file (as the
269 <systemitem class="username">root</systemitem> user), in
270 <filename>/usr/share/gtk-4.0/settings.ini</filename>. For the local
271 user, an example is:
272 </para>
273
274<screen><userinput>mkdir -pv ~/.config/gtk-4.0
275cat &gt; ~/.config/gtk-4.0/settings.ini &lt;&lt; "EOF"
276<literal>[Settings]
277gtk-theme-name = <replaceable>Adwaita</replaceable>
278gtk-icon-theme-name = <replaceable>oxygen</replaceable>
279gtk-font-name = <replaceable>DejaVu Sans 12</replaceable>
280gtk-cursor-theme-size = <replaceable>18</replaceable>
281gtk-xft-antialias = <replaceable>1</replaceable>
282gtk-xft-hinting = <replaceable>1</replaceable>
283gtk-xft-hintstyle = <replaceable>hintslight</replaceable>
284gtk-xft-rgba = <replaceable>rgb</replaceable>
285gtk-cursor-theme-name = <replaceable>Adwaita</replaceable></literal>
286EOF</userinput></screen>
287
288 <para>
289 There are many settings keys, some with default values. You can find
290 them at <ulink
291 url="https://developer.gnome.org/gtk4/stable/GtkSettings.html">Settings:
292 GTK 4 Reference Manual</ulink>.
293 </para>
294
295 </sect3>
296 </sect2>
297
298 <sect2 role="content">
299 <title>Contents</title>
300
301 <segmentedlist>
302 <segtitle>Installed Programs</segtitle>
303 <segtitle>Installed Libraries</segtitle>
304 <segtitle>Installed Directories</segtitle>
305
306 <seglistitem>
307 <seg>
308 gtk4-broadwayd,
309 gtk4-builder-tool,
310 gtk4-demo,
311 gtk4-demo-application,
312 gtk4-encode-symbolic-svg,
313 gtk4-icon-browser,
314 gtk4-launch,
315 gtk4-node-editor,
316 gtk4-print-editor,
317 gtk4-query-settings,
318 gtk4-update-icon-cache, and
319 gtk4-widget-factory
320 </seg>
321 <seg>
322 libgtk-4.so
323 </seg>
324 <seg>
325 /usr/include/gtk-4.0,
326 /usr/lib/gtk-4.0, and
327 /usr/share/gtk-4.0
328 </seg>
329 </seglistitem>
330 </segmentedlist>
331
332 <variablelist>
333 <bridgehead renderas="sect3">Short Descriptions</bridgehead>
334 <?dbfo list-presentation="list"?>
335 <?dbhtml list-presentation="table"?>
336
337 <varlistentry id="gtk4-broadwayd">
338 <term><command>gtk4-broadwayd</command></term>
339 <listitem>
340 <para>
341 provides support for displaying GTK 4 applications in a web
342 browser using HTML5 and web sockets
343 </para>
344 <indexterm zone="gtk4 gtk4-broadwayd">
345 <primary sortas="b-gtk4-broadwayd">gtk4-broadwayd</primary>
346 </indexterm>
347 </listitem>
348 </varlistentry>
349
350 <varlistentry id="gtk4-builder-tool">
351 <term><command>gtk4-builder-tool</command></term>
352 <listitem>
353 <para>
354 performs various operations on GtkBuilder .ui files
355 </para>
356 <indexterm zone="gtk4 gtk4-builder-tool">
357 <primary sortas="b-gtk4-builder-tool">gtk4-builder-tool</primary>
358 </indexterm>
359 </listitem>
360 </varlistentry>
361
362 <varlistentry id="gtk4-demo">
363 <term><command>gtk4-demo</command></term>
364 <listitem>
365 <para>
366 is a simple program that demonstrates some of the tasks that can be
367 done with GTK 4
368 </para>
369 <indexterm zone="gtk4 gtk4-demo">
370 <primary sortas="b-gtk4-demo">gtk4-demo</primary>
371 </indexterm>
372 </listitem>
373 </varlistentry>
374
375 <varlistentry id="gtk4-demo-application">
376 <term><command>gtk4-demo-application</command></term>
377 <listitem>
378 <para>
379 is a simple GTK 4 application which is useful for testing
380 </para>
381 <indexterm zone="gtk4 gtk4-demo-application">
382 <primary sortas="b-gtk4-demo-application">gtk4-demo-application</primary>
383 </indexterm>
384 </listitem>
385 </varlistentry>
386
387 <varlistentry id="gtk4-encode-symbolic-svg">
388 <term><command>gtk4-encode-symbolic-svg</command></term>
389 <listitem>
390 <para>
391 converts symbolic SVG icons into special PNG files. GTK 4 can load
392 and recolor these PNGs, just like original SVGs, but loading them
393 is much faster
394 </para>
395 <indexterm zone="gtk4 gtk4-encode-symbolic-svg">
396 <primary sortas="b-gtk4-encode-symbolic-svg">gtk4-encode-symbolic-svg</primary>
397 </indexterm>
398 </listitem>
399 </varlistentry>
400
401 <varlistentry id="gtk4-icon-browser">
402 <term><command>gtk4-icon-browser</command></term>
403 <listitem>
404 <para>
405 is a utility to explore the icons in the current icon theme. It
406 shows icons in various sizes, their symbolic variants when
407 available, as well as a description of the icon and its context
408 </para>
409 <indexterm zone="gtk4 gtk4-icon-browser">
410 <primary sortas="b-gtk4-icon-browser">gtk4-icon-browser</primary>
411 </indexterm>
412 </listitem>
413 </varlistentry>
414
415 <varlistentry id="gtk4-launch">
416 <term><command>gtk4-launch</command></term>
417 <listitem>
418 <para>
419 launches an application using the given name. The name should match
420 the application .desktop file name (as seen in
421 <filename class="directory">/usr/share/applications</filename>),
422 with or without the '.desktop' extension
423 </para>
424 <indexterm zone="gtk4 gtk-launch">
425 <primary sortas="b-gtk4-launch">gtk4-launch</primary>
426 </indexterm>
427 </listitem>
428 </varlistentry>
429
430 <varlistentry id="gtk4-node-editor">
431 <term><command>gtk4-node-editor</command></term>
432 <listitem>
433 <para>
434 is a utility to show and edit render node files. Such render
435 node files can be obtained e.g. from the GTK inspector
436 </para>
437 <indexterm zone="gtk4 gtk4-node-editor">
438 <primary sortas="b-gtk4-node-editor">gtk4-node-editor</primary>
439 </indexterm>
440 </listitem>
441 </varlistentry>
442
443 <varlistentry id="gtk4-print-editor">
444 <term><command>gtk4-print-editor</command></term>
445 <listitem>
446 <para>
447 is a simple program to demonstrate printing using GTK 4
448 applications
449 </para>
450 <indexterm zone="gtk4 gtk4-print-editor">
451 <primary sortas="b-gtk4-print-editor">gtk4-print-editor</primary>
452 </indexterm>
453 </listitem>
454 </varlistentry>
455
456 <varlistentry id="gtk4-query-settings">
457 <term><command>gtk4-query-settings</command></term>
458 <listitem>
459 <para>
460 provides a complete listing of all settings related to GTK 4
461 </para>
462 <indexterm zone="gtk4 gtk4-query-settings">
463 <primary sortas="b-gtk4-query-settings">gtk4-query-settings</primary>
464 </indexterm>
465 </listitem>
466 </varlistentry>
467
468 <varlistentry id="gtk4-update-icon-cache">
469 <term><command>gtk4-update-icon-cache</command></term>
470 <listitem>
471 <para>
472 is an icon theme caching utility that creates mmap()able cache
473 files for icon themes
474 </para>
475 <indexterm zone="gtk4 gtk4-update-icon-cache">
476 <primary sortas="b-gtk4-update-icon-cache">gtk4-update-icon-cache</primary>
477 </indexterm>
478 </listitem>
479 </varlistentry>
480
481 <varlistentry id="gtk4-widget-factory">
482 <term><command>gtk4-widget-factory</command></term>
483 <listitem>
484 <para>
485 is a program to view GTK 4 themes and widgets
486 </para>
487 <indexterm zone="gtk4 gtk4-widget-factory">
488 <primary sortas="b-gtk4-widget-factory">gtk4-widget-factory</primary>
489 </indexterm>
490 </listitem>
491 </varlistentry>
492
493 <varlistentry id="libgtk-4">
494 <term><filename class="libraryfile">libgtk-4.so</filename></term>
495 <listitem>
496 <para>
497 contains functions that provide an API to implement graphical user
498 interfaces
499 </para>
500 <indexterm zone="gtk4 libgtk-4">
501 <primary sortas="c-libgtk-4">libgtk-4.so</primary>
502 </indexterm>
503 </listitem>
504 </varlistentry>
505 </variablelist>
506 </sect2>
507</sect1>
Note: See TracBrowser for help on using the repository browser.