[gtk/redo-doc-images: 2/2] Generate screenshots on the fly
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/redo-doc-images: 2/2] Generate screenshots on the fly
- Date: Mon, 18 Apr 2022 19:54:54 +0000 (UTC)
commit a42766ef1b83b48dea1372e2e152cae0a30dc332
Author: Matthias Clasen <mclasen redhat com>
Date: Mon Apr 18 11:56:43 2022 -0400
Generate screenshots on the fly
This commit adds a new meson option -Dupdate_screenshots=true.
When it is enabled, and -Dgtk_doc=true is also used, then the
build will generate images to include in the API docs from
ui files in docs/reference/gtk/images.
Note: we still keep a copy of the images in git, in order to
allow building without a display connection. To update the
images in git, the generated images need to be copied back
from the builddir to the srcdir.
docs/reference/gtk/images/aboutdialog.ui | 17 ++++++++++
docs/reference/gtk/images/button.ui | 30 +++++++++++++++++
docs/reference/gtk/images/check-button.ui | 43 ++++++++++++++++++++++++
docs/reference/gtk/images/combo-box-entry.ui | 35 ++++++++++++++++++++
docs/reference/gtk/images/combo-box-text.ui | 33 +++++++++++++++++++
docs/reference/gtk/images/combo-box.ui | 49 ++++++++++++++++++++++++++++
docs/reference/gtk/images/drop-down.ui | 37 +++++++++++++++++++++
docs/reference/gtk/images/entry.ui | 34 +++++++++++++++++++
docs/reference/gtk/images/info-bar.ui | 40 +++++++++++++++++++++++
docs/reference/gtk/images/label.ui | 30 +++++++++++++++++
docs/reference/gtk/images/link-button.ui | 31 ++++++++++++++++++
docs/reference/gtk/images/menu-button.ui | 44 +++++++++++++++++++++++++
docs/reference/gtk/images/meson.build | 34 +++++++++++++++++++
docs/reference/gtk/images/password-entry.ui | 35 ++++++++++++++++++++
docs/reference/gtk/images/radio-button.ui | 44 +++++++++++++++++++++++++
docs/reference/gtk/images/search-bar.ui | 43 ++++++++++++++++++++++++
docs/reference/gtk/images/search-entry.ui | 34 +++++++++++++++++++
docs/reference/gtk/images/style.css | 8 +++++
docs/reference/gtk/images/switch.ui | 41 +++++++++++++++++++++++
docs/reference/gtk/images/toggle-button.ui | 45 +++++++++++++++++++++++++
docs/reference/gtk/meson.build | 16 ++++++++-
meson_options.txt | 5 +++
22 files changed, 727 insertions(+), 1 deletion(-)
---
diff --git a/docs/reference/gtk/images/aboutdialog.ui b/docs/reference/gtk/images/aboutdialog.ui
new file mode 100644
index 0000000000..00815af070
--- /dev/null
+++ b/docs/reference/gtk/images/aboutdialog.ui
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+ <object class="GtkAboutDialog">
+ <property name="program-name">GTK Code Demos</property>
+ <property name="version">4.8.0</property>
+ <property name="copyright">© 1997-2022 The GTK Team</property>
+ <property name="website">http://www.gtk.org</property>
+ <property name="comments">Program to demonstrate GTK functions.</property>
+ <property name="logo">gtk-logo.png</property>
+ <property name="title">About GTK Code Demos</property>
+ <property name="authors">Peter Mattis
+Spencer Kimball
+Josh MacDonald
+and many more…
+</property>
+ </object>
+</interface>
diff --git a/docs/reference/gtk/images/button.ui b/docs/reference/gtk/images/button.ui
new file mode 100644
index 0000000000..9ed81e1860
--- /dev/null
+++ b/docs/reference/gtk/images/button.ui
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+ <object class="GtkWindow">
+ <property name="decorated">0</property>
+ <property name="resizable">0</property>
+ <property name="default-width">280</property>
+ <property name="default-height">120</property>
+ <style>
+ <class name="nobackground"/>
+ </style>
+ <child>
+ <object class="GtkBox">
+ <style>
+ <class name="shadow"/>
+ <class name="background"/>
+ <class name="frame"/>
+ </style>
+ <child>
+ <object class="GtkButton">
+ <property name="hexpand">1</property>
+ <property name="vexpand">1</property>
+ <property name="halign">center</property>
+ <property name="valign">center</property>
+ <property name="label">Button</property>
+ </object>
+ </child>
+ </object>
+ </child>
+ </object>
+</interface>
diff --git a/docs/reference/gtk/images/check-button.ui b/docs/reference/gtk/images/check-button.ui
new file mode 100644
index 0000000000..5a1ad6dfc7
--- /dev/null
+++ b/docs/reference/gtk/images/check-button.ui
@@ -0,0 +1,43 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+ <object class="GtkWindow">
+ <property name="decorated">0</property>
+ <property name="resizable">0</property>
+ <property name="default-width">280</property>
+ <property name="default-height">120</property>
+ <style>
+ <class name="nobackground"/>
+ </style>
+ <child>
+ <object class="GtkBox">
+ <style>
+ <class name="shadow"/>
+ <class name="background"/>
+ <class name="frame"/>
+ </style>
+ <child>
+ <object class="GtkBox">
+ <property name="orientation">vertical</property>
+ <property name="spacing">3</property>
+ <property name="hexpand">1</property>
+ <property name="vexpand">1</property>
+ <property name="halign">center</property>
+ <property name="valign">center</property>
+ <child>
+ <object class="GtkCheckButton">
+ <property name="active">1</property>
+ <property name="label">Check Button</property>
+ </object>
+ </child>
+ <child>
+ <object class="GtkCheckButton">
+ <property name="active">0</property>
+ <property name="label">Check Button</property>
+ </object>
+ </child>
+ </object>
+ </child>
+ </object>
+ </child>
+ </object>
+</interface>
diff --git a/docs/reference/gtk/images/combo-box-entry.ui b/docs/reference/gtk/images/combo-box-entry.ui
new file mode 100644
index 0000000000..102f6a5c83
--- /dev/null
+++ b/docs/reference/gtk/images/combo-box-entry.ui
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+ <object class="GtkWindow">
+ <property name="decorated">0</property>
+ <property name="resizable">0</property>
+ <property name="default-width">280</property>
+ <property name="default-height">120</property>
+ <style>
+ <class name="nobackground"/>
+ </style>
+ <child>
+ <object class="GtkBox">
+ <style>
+ <class name="shadow"/>
+ <class name="background"/>
+ <class name="frame"/>
+ </style>
+ <child>
+ <object class="GtkComboBox">
+ <property name="hexpand">1</property>
+ <property name="vexpand">1</property>
+ <property name="halign">center</property>
+ <property name="valign">center</property>
+ <property name="has-entry">1</property>
+ <child internal-child="entry">
+ <object class="GtkEntry">
+ <property name="text">Combo Box Entry</property>
+ </object>
+ </child>
+ </object>
+ </child>
+ </object>
+ </child>
+ </object>
+</interface>
diff --git a/docs/reference/gtk/images/combo-box-text.ui b/docs/reference/gtk/images/combo-box-text.ui
new file mode 100644
index 0000000000..f2fff64fe7
--- /dev/null
+++ b/docs/reference/gtk/images/combo-box-text.ui
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+ <object class="GtkWindow">
+ <property name="decorated">0</property>
+ <property name="resizable">0</property>
+ <property name="default-width">280</property>
+ <property name="default-height">120</property>
+ <style>
+ <class name="nobackground"/>
+ </style>
+ <child>
+ <object class="GtkBox">
+ <style>
+ <class name="shadow"/>
+ <class name="background"/>
+ <class name="frame"/>
+ </style>
+ <child>
+ <object class="GtkComboBoxText">
+ <property name="hexpand">1</property>
+ <property name="vexpand">1</property>
+ <property name="halign">center</property>
+ <property name="valign">center</property>
+ <items>
+ <item>Combo Box Text</item>
+ </items>
+ <property name="active">0</property>
+ </object>
+ </child>
+ </object>
+ </child>
+ </object>
+</interface>
diff --git a/docs/reference/gtk/images/combo-box.ui b/docs/reference/gtk/images/combo-box.ui
new file mode 100644
index 0000000000..173ae3ecbd
--- /dev/null
+++ b/docs/reference/gtk/images/combo-box.ui
@@ -0,0 +1,49 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+ <object class="GtkWindow">
+ <property name="decorated">0</property>
+ <property name="resizable">0</property>
+ <property name="default-width">280</property>
+ <property name="default-height">120</property>
+ <style>
+ <class name="nobackground"/>
+ </style>
+ <child>
+ <object class="GtkBox">
+ <style>
+ <class name="shadow"/>
+ <class name="background"/>
+ <class name="frame"/>
+ </style>
+ <child>
+ <object class="GtkComboBox">
+ <property name="hexpand">1</property>
+ <property name="vexpand">1</property>
+ <property name="halign">center</property>
+ <property name="valign">center</property>
+ <property name="model">
+ <object class="GtkListStore">
+ <columns>
+ <column type="gchararray"/>
+ </columns>
+ <data>
+ <row>
+ <col id="0">Combo Box</col>
+ </row>
+ </data>
+ </object>
+ </property>
+ <child>
+ <object class="GtkCellRendererText">
+ </object>
+ <attributes>
+ <attribute name="text">0</attribute>
+ </attributes>
+ </child>
+ <property name="active">0</property>
+ </object>
+ </child>
+ </object>
+ </child>
+ </object>
+</interface>
diff --git a/docs/reference/gtk/images/drop-down.ui b/docs/reference/gtk/images/drop-down.ui
new file mode 100644
index 0000000000..9590ca353a
--- /dev/null
+++ b/docs/reference/gtk/images/drop-down.ui
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+ <object class="GtkWindow">
+ <property name="decorated">0</property>
+ <property name="resizable">0</property>
+ <property name="default-width">280</property>
+ <property name="default-height">120</property>
+ <style>
+ <class name="nobackground"/>
+ </style>
+ <child>
+ <object class="GtkBox">
+ <style>
+ <class name="shadow"/>
+ <class name="background"/>
+ <class name="frame"/>
+ </style>
+ <child>
+ <object class="GtkDropDown">
+ <property name="hexpand">1</property>
+ <property name="vexpand">1</property>
+ <property name="halign">center</property>
+ <property name="valign">center</property>
+ <property name="model">
+ <object class="GtkStringList">
+ <items>
+ <item>Drop Down</item>
+ <item>Almost a combo</item>
+ </items>
+ </object>
+ </property>
+ </object>
+ </child>
+ </object>
+ </child>
+ </object>
+</interface>
diff --git a/docs/reference/gtk/images/entry.ui b/docs/reference/gtk/images/entry.ui
new file mode 100644
index 0000000000..db7c22ecb6
--- /dev/null
+++ b/docs/reference/gtk/images/entry.ui
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+ <object class="GtkWindow">
+ <property name="decorated">0</property>
+ <property name="resizable">0</property>
+ <property name="default-width">280</property>
+ <property name="default-height">120</property>
+ <style>
+ <class name="nobackground"/>
+ </style>
+ <child>
+ <object class="GtkBox">
+ <style>
+ <class name="shadow"/>
+ <class name="background"/>
+ <class name="frame"/>
+ </style>
+ <child>
+ <object class="GtkEntry">
+ <property name="hexpand">1</property>
+ <property name="vexpand">1</property>
+ <property name="halign">fill</property>
+ <property name="valign">center</property>
+ <property name="text">Entry</property>
+ <property name="margin-start">10</property>
+ <property name="margin-end">10</property>
+ <property name="margin-top">10</property>
+ <property name="margin-bottom">10</property>
+ </object>
+ </child>
+ </object>
+ </child>
+ </object>
+</interface>
diff --git a/docs/reference/gtk/images/info-bar.ui b/docs/reference/gtk/images/info-bar.ui
new file mode 100644
index 0000000000..b4a784798e
--- /dev/null
+++ b/docs/reference/gtk/images/info-bar.ui
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+ <object class="GtkWindow">
+ <property name="decorated">0</property>
+ <property name="resizable">0</property>
+ <property name="default-width">280</property>
+ <property name="default-height">120</property>
+ <style>
+ <class name="nobackground"/>
+ </style>
+ <child>
+ <object class="GtkBox">
+ <style>
+ <class name="shadow"/>
+ <class name="background"/>
+ <class name="frame"/>
+ </style>
+ <child>
+ <object class="GtkInfoBar">
+ <property name="hexpand">1</property>
+ <property name="vexpand">1</property>
+ <property name="halign">fill</property>
+ <property name="valign">center</property>
+ <property name="margin-start">10</property>
+ <property name="margin-end">10</property>
+ <property name="margin-top">10</property>
+ <property name="margin-bottom">10</property>
+ <property name="show-close-button">1</property>
+ <property name="message-type">info</property>
+ <child>
+ <object class="GtkLabel">
+ <property name="label">Info Bar</property>
+ </object>
+ </child>
+ </object>
+ </child>
+ </object>
+ </child>
+ </object>
+</interface>
diff --git a/docs/reference/gtk/images/label.ui b/docs/reference/gtk/images/label.ui
new file mode 100644
index 0000000000..a1822964d9
--- /dev/null
+++ b/docs/reference/gtk/images/label.ui
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+ <object class="GtkWindow">
+ <property name="decorated">0</property>
+ <property name="resizable">0</property>
+ <property name="default-width">280</property>
+ <property name="default-height">120</property>
+ <style>
+ <class name="nobackground"/>
+ </style>
+ <child>
+ <object class="GtkBox">
+ <style>
+ <class name="shadow"/>
+ <class name="background"/>
+ <class name="frame"/>
+ </style>
+ <child>
+ <object class="GtkLabel">
+ <property name="hexpand">1</property>
+ <property name="vexpand">1</property>
+ <property name="halign">center</property>
+ <property name="valign">center</property>
+ <property name="label">Label</property>
+ </object>
+ </child>
+ </object>
+ </child>
+ </object>
+</interface>
diff --git a/docs/reference/gtk/images/link-button.ui b/docs/reference/gtk/images/link-button.ui
new file mode 100644
index 0000000000..3dce360662
--- /dev/null
+++ b/docs/reference/gtk/images/link-button.ui
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+ <object class="GtkWindow">
+ <property name="decorated">0</property>
+ <property name="resizable">0</property>
+ <property name="default-width">280</property>
+ <property name="default-height">120</property>
+ <style>
+ <class name="nobackground"/>
+ </style>
+ <child>
+ <object class="GtkBox">
+ <style>
+ <class name="shadow"/>
+ <class name="background"/>
+ <class name="frame"/>
+ </style>
+ <child>
+ <object class="GtkLinkButton">
+ <property name="hexpand">1</property>
+ <property name="vexpand">1</property>
+ <property name="halign">center</property>
+ <property name="valign">center</property>
+ <property name="label">Link Button</property>
+ <property name="uri">http://www.gtk.org</property>
+ </object>
+ </child>
+ </object>
+ </child>
+ </object>
+</interface>
diff --git a/docs/reference/gtk/images/menu-button.ui b/docs/reference/gtk/images/menu-button.ui
new file mode 100644
index 0000000000..8039dfc85c
--- /dev/null
+++ b/docs/reference/gtk/images/menu-button.ui
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+ <object class="GtkWindow">
+ <property name="decorated">0</property>
+ <property name="resizable">0</property>
+ <property name="default-width">280</property>
+ <property name="default-height">120</property>
+ <style>
+ <class name="nobackground"/>
+ </style>
+ <child>
+ <object class="GtkBox">
+ <style>
+ <class name="shadow"/>
+ <class name="background"/>
+ <class name="frame"/>
+ </style>
+ <child>
+ <object class="GtkBox">
+ <property name="orientation">vertical</property>
+ <property name="spacing">3</property>
+ <property name="hexpand">1</property>
+ <property name="vexpand">1</property>
+ <property name="halign">center</property>
+ <property name="valign">center</property>
+ <child>
+ <object class="GtkMenuButton">
+ <property name="icon-name">emblem-system-symbolic</property>
+ <property name="popover"><object class="GtkPopover"></object></property>
+ <property name="halign">center</property>
+ <property name="valign">center</property>
+ </object>
+ </child>
+ <child>
+ <object class="GtkLabel">
+ <property name="label">Menu Button</property>
+ </object>
+ </child>
+ </object>
+ </child>
+ </object>
+ </child>
+ </object>
+</interface>
diff --git a/docs/reference/gtk/images/meson.build b/docs/reference/gtk/images/meson.build
new file mode 100644
index 0000000000..91c88507a4
--- /dev/null
+++ b/docs/reference/gtk/images/meson.build
@@ -0,0 +1,34 @@
+ui_files = [
+ 'aboutdialog.ui',
+ 'button.ui',
+ 'check-button.ui',
+ 'combo-box.ui',
+ 'combo-box-entry.ui',
+ 'combo-box-text.ui',
+ 'drop-down.ui',
+ 'entry.ui',
+ 'info-bar.ui',
+ 'label.ui',
+ 'link-button.ui',
+ 'menu-button.ui',
+ 'password-entry.ui',
+ 'radio-button.ui',
+ 'search-bar.ui',
+ 'search-entry.ui',
+ 'switch.ui',
+ 'toggle-button.ui'
+]
+
+gtk_builder_tool = find_program('gtk4-builder-tool')
+
+if get_option('update_screenshots')
+ foreach file: ui_files
+ gtk_images += custom_target('@0@ gallery image'.format(file),
+ input: [file, 'style.css'],
+ output: file.replace('.ui', '.png'),
+ command: [ gtk_builder_tool, 'screenshot',
+ '--force',
+ '--css', '@INPUT1@',
+ '@INPUT0@', '@OUTPUT@' ])
+ endforeach
+endif
diff --git a/docs/reference/gtk/images/password-entry.ui b/docs/reference/gtk/images/password-entry.ui
new file mode 100644
index 0000000000..45ce835e4b
--- /dev/null
+++ b/docs/reference/gtk/images/password-entry.ui
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+ <object class="GtkWindow">
+ <property name="decorated">0</property>
+ <property name="resizable">0</property>
+ <property name="default-width">280</property>
+ <property name="default-height">120</property>
+ <style>
+ <class name="nobackground"/>
+ </style>
+ <child>
+ <object class="GtkBox">
+ <style>
+ <class name="shadow"/>
+ <class name="background"/>
+ <class name="frame"/>
+ </style>
+ <child>
+ <object class="GtkPasswordEntry">
+ <property name="hexpand">1</property>
+ <property name="vexpand">1</property>
+ <property name="halign">fill</property>
+ <property name="valign">center</property>
+ <property name="text">Entry</property>
+ <property name="show-peek-icon">1</property>
+ <property name="margin-start">10</property>
+ <property name="margin-end">10</property>
+ <property name="margin-top">10</property>
+ <property name="margin-bottom">10</property>
+ </object>
+ </child>
+ </object>
+ </child>
+ </object>
+</interface>
diff --git a/docs/reference/gtk/images/radio-button.ui b/docs/reference/gtk/images/radio-button.ui
new file mode 100644
index 0000000000..2c45704989
--- /dev/null
+++ b/docs/reference/gtk/images/radio-button.ui
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+ <object class="GtkWindow">
+ <property name="decorated">0</property>
+ <property name="resizable">0</property>
+ <property name="default-width">280</property>
+ <property name="default-height">120</property>
+ <style>
+ <class name="nobackground"/>
+ </style>
+ <child>
+ <object class="GtkBox">
+ <style>
+ <class name="shadow"/>
+ <class name="background"/>
+ <class name="frame"/>
+ </style>
+ <child>
+ <object class="GtkBox">
+ <property name="orientation">vertical</property>
+ <property name="spacing">3</property>
+ <property name="hexpand">1</property>
+ <property name="vexpand">1</property>
+ <property name="halign">center</property>
+ <property name="valign">center</property>
+ <child>
+ <object class="GtkCheckButton" id="radio1">
+ <property name="active">1</property>
+ <property name="label">Radio Button</property>
+ </object>
+ </child>
+ <child>
+ <object class="GtkCheckButton">
+ <property name="active">0</property>
+ <property name="label">Radio Button</property>
+ <property name="group">radio1</property>
+ </object>
+ </child>
+ </object>
+ </child>
+ </object>
+ </child>
+ </object>
+</interface>
diff --git a/docs/reference/gtk/images/search-bar.ui b/docs/reference/gtk/images/search-bar.ui
new file mode 100644
index 0000000000..53ef6c21f0
--- /dev/null
+++ b/docs/reference/gtk/images/search-bar.ui
@@ -0,0 +1,43 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+ <object class="GtkWindow">
+ <property name="decorated">0</property>
+ <property name="resizable">0</property>
+ <property name="default-width">280</property>
+ <property name="default-height">120</property>
+ <style>
+ <class name="nobackground"/>
+ </style>
+ <child>
+ <object class="GtkBox">
+ <style>
+ <class name="shadow"/>
+ <class name="background"/>
+ <class name="frame"/>
+ </style>
+ <child>
+ <object class="GtkBox">
+ <property name="orientation">vertical</property>
+ <property name="hexpand">1</property>
+ <property name="vexpand">1</property>
+ <child>
+ <object class="GtkSearchBar">
+ <property name="search-mode-enabled">1</property>
+ <property name="show-close-button">1</property>
+ <child>
+ <object class="GtkSearchEntry">
+ <property name="text">Search Bar</property>
+ </object>
+ </child>
+ </object>
+ </child>
+ <child>
+ <object class="GtkTextView">
+ </object>
+ </child>
+ </object>
+ </child>
+ </object>
+ </child>
+ </object>
+</interface>
diff --git a/docs/reference/gtk/images/search-entry.ui b/docs/reference/gtk/images/search-entry.ui
new file mode 100644
index 0000000000..07df349cf4
--- /dev/null
+++ b/docs/reference/gtk/images/search-entry.ui
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+ <object class="GtkWindow">
+ <property name="decorated">0</property>
+ <property name="resizable">0</property>
+ <property name="default-width">280</property>
+ <property name="default-height">120</property>
+ <style>
+ <class name="nobackground"/>
+ </style>
+ <child>
+ <object class="GtkBox">
+ <style>
+ <class name="shadow"/>
+ <class name="background"/>
+ <class name="frame"/>
+ </style>
+ <child>
+ <object class="GtkSearchEntry">
+ <property name="hexpand">1</property>
+ <property name="vexpand">1</property>
+ <property name="halign">fill</property>
+ <property name="valign">center</property>
+ <property name="placeholder-text">Search…</property>
+ <property name="margin-start">10</property>
+ <property name="margin-end">10</property>
+ <property name="margin-top">10</property>
+ <property name="margin-bottom">10</property>
+ </object>
+ </child>
+ </object>
+ </child>
+ </object>
+</interface>
diff --git a/docs/reference/gtk/images/style.css b/docs/reference/gtk/images/style.css
new file mode 100644
index 0000000000..148a682240
--- /dev/null
+++ b/docs/reference/gtk/images/style.css
@@ -0,0 +1,8 @@
+.nobackground {
+ background: none;
+}
+
+.shadow {
+ box-shadow: 0 3px 9px 1px rgba(0, 0, 0, 0.5);
+ margin: 20px;
+}
diff --git a/docs/reference/gtk/images/switch.ui b/docs/reference/gtk/images/switch.ui
new file mode 100644
index 0000000000..bc7136de18
--- /dev/null
+++ b/docs/reference/gtk/images/switch.ui
@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+ <object class="GtkWindow">
+ <property name="decorated">0</property>
+ <property name="resizable">0</property>
+ <property name="default-width">280</property>
+ <property name="default-height">120</property>
+ <style>
+ <class name="nobackground"/>
+ </style>
+ <child>
+ <object class="GtkBox">
+ <style>
+ <class name="shadow"/>
+ <class name="background"/>
+ <class name="frame"/>
+ </style>
+ <child>
+ <object class="GtkBox">
+ <property name="orientation">vertical</property>
+ <property name="spacing">3</property>
+ <property name="hexpand">1</property>
+ <property name="vexpand">1</property>
+ <property name="halign">center</property>
+ <property name="valign">center</property>
+ <child>
+ <object class="GtkSwitch">
+ <property name="active">1</property>
+ </object>
+ </child>
+ <child>
+ <object class="GtkSwitch">
+ <property name="active">0</property>
+ </object>
+ </child>
+ </object>
+ </child>
+ </object>
+ </child>
+ </object>
+</interface>
diff --git a/docs/reference/gtk/images/toggle-button.ui b/docs/reference/gtk/images/toggle-button.ui
new file mode 100644
index 0000000000..ff1a323aa8
--- /dev/null
+++ b/docs/reference/gtk/images/toggle-button.ui
@@ -0,0 +1,45 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+ <object class="GtkWindow">
+ <property name="decorated">0</property>
+ <property name="resizable">0</property>
+ <property name="default-width">280</property>
+ <property name="default-height">120</property>
+ <style>
+ <class name="nobackground"/>
+ </style>
+ <child>
+ <object class="GtkBox">
+ <style>
+ <class name="shadow"/>
+ <class name="background"/>
+ <class name="frame"/>
+ </style>
+ <child>
+ <object class="GtkBox">
+ <property name="orientation">horizontal</property>
+ <property name="hexpand">1</property>
+ <property name="vexpand">1</property>
+ <property name="halign">center</property>
+ <property name="valign">center</property>
+ <style>
+ <class name="linked"/>
+ </style>
+ <child>
+ <object class="GtkToggleButton">
+ <property name="active">1</property>
+ <property name="label">Toggle</property>
+ </object>
+ </child>
+ <child>
+ <object class="GtkToggleButton">
+ <property name="active">0</property>
+ <property name="label">Button</property>
+ </object>
+ </child>
+ </object>
+ </child>
+ </object>
+ </child>
+ </object>
+</interface>
diff --git a/docs/reference/gtk/meson.build b/docs/reference/gtk/meson.build
index a7af607b91..0b4c19a89a 100644
--- a/docs/reference/gtk/meson.build
+++ b/docs/reference/gtk/meson.build
@@ -27,6 +27,19 @@ expand_content_md_files = [
'visual_index.md'
]
+ui_files = [
+ 'ui/button.ui',
+ 'ui/aboutdialog.ui',
+ 'ui/switch.ui',
+ 'ui/toggle-button.ui'
+]
+
+gtk_images = []
+
+if get_option('update_screenshots')
+ subdir('images')
+endif
+
if get_option('gtk_doc')
gtk4_toml = configure_file(
input: 'gtk4.toml.in',
@@ -46,10 +59,11 @@ if get_option('gtk_doc')
'--add-include-path=@0@'.format(meson.current_build_dir() / '../../../gtk'),
'--config=@INPUT0@',
'--output-dir=@OUTPUT@',
+ '--content-dir=@0@'.format(meson.current_build_dir()),
'--content-dir=@0@'.format(meson.current_source_dir()),
'@INPUT1@',
],
- depends: [ gdk_gir[0], gsk_gir[0] ],
+ depends: [ gdk_gir[0], gsk_gir[0] ] + gtk_images,
depend_files: [ expand_content_md_files ],
build_by_default: true,
install: true,
diff --git a/meson_options.txt b/meson_options.txt
index bb2530d00a..2084ab86e1 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -85,6 +85,11 @@ option('gtk_doc',
value: false,
description : 'Build API reference and tools documentation')
+option('update_screenshots',
+ type: 'boolean',
+ value: false,
+ description : 'Regenerate screenshots for the documentation')
+
option('man-pages',
type: 'boolean',
value: false,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]