diff --git a/docs/reference/gtk/images/aboutdialog.png b/docs/reference/gtk/images/aboutdialog.png index e4a8d88020..91a4ebfc2f 100644 Binary files a/docs/reference/gtk/images/aboutdialog.png and b/docs/reference/gtk/images/aboutdialog.png differ diff --git a/docs/reference/gtk/images/aboutdialog.ui b/docs/reference/gtk/images/aboutdialog.ui new file mode 100644 index 0000000000..651caf83f6 --- /dev/null +++ b/docs/reference/gtk/images/aboutdialog.ui @@ -0,0 +1,16 @@ + + + + GTK Code Demos + 4.8.0 + © 1997-2022 The GTK Team + Program to demonstrate GTK functions + gtk-logo.png + About GTK Code Demos + Peter Mattis +Spencer Kimball +Josh MacDonald +and many more… + + + diff --git a/docs/reference/gtk/images/action-bar.png b/docs/reference/gtk/images/action-bar.png index 54382c99ab..9a2595fc8a 100644 Binary files a/docs/reference/gtk/images/action-bar.png and b/docs/reference/gtk/images/action-bar.png differ diff --git a/docs/reference/gtk/images/action-bar.ui b/docs/reference/gtk/images/action-bar.ui new file mode 100644 index 0000000000..3af2a6ba88 --- /dev/null +++ b/docs/reference/gtk/images/action-bar.ui @@ -0,0 +1,47 @@ + + + + 0 + 0 + 280 + 120 + + + + + + + vertical + 1 + 1 + + + 1 + + + + + + + object-select-symbolic + + + + + call-start-symbolic + + + + + + + + + + diff --git a/docs/reference/gtk/images/appchooserbutton.png b/docs/reference/gtk/images/appchooserbutton.png index 50c28900ed..c74914e467 100644 Binary files a/docs/reference/gtk/images/appchooserbutton.png and b/docs/reference/gtk/images/appchooserbutton.png differ diff --git a/docs/reference/gtk/images/appchooserbutton.ui b/docs/reference/gtk/images/appchooserbutton.ui new file mode 100644 index 0000000000..cb8dfc29db --- /dev/null +++ b/docs/reference/gtk/images/appchooserbutton.ui @@ -0,0 +1,43 @@ + + + + 0 + 0 + 280 + 120 + + + + + + + vertical + 3 + 1 + 1 + center + center + + + text/plain + center + center + + + + + Application Button + + + + + + + + diff --git a/docs/reference/gtk/images/appchooserdialog.png b/docs/reference/gtk/images/appchooserdialog.png index 83dd660567..afa9286273 100644 Binary files a/docs/reference/gtk/images/appchooserdialog.png and b/docs/reference/gtk/images/appchooserdialog.png differ diff --git a/docs/reference/gtk/images/appchooserdialog.ui b/docs/reference/gtk/images/appchooserdialog.ui new file mode 100644 index 0000000000..f355ae2db8 --- /dev/null +++ b/docs/reference/gtk/images/appchooserdialog.ui @@ -0,0 +1,8 @@ + + + + image/png + 200 + 300 + + diff --git a/docs/reference/gtk/images/assistant.png b/docs/reference/gtk/images/assistant.png index d13d12da2a..7a993677af 100644 Binary files a/docs/reference/gtk/images/assistant.png and b/docs/reference/gtk/images/assistant.png differ diff --git a/docs/reference/gtk/images/assistant.ui b/docs/reference/gtk/images/assistant.ui new file mode 100644 index 0000000000..11c3b70d12 --- /dev/null +++ b/docs/reference/gtk/images/assistant.ui @@ -0,0 +1,30 @@ + + + + 0 + 300 + 140 + Assistant + + + Assistant page + 1 + + + Assistant + + + + + + + confirm + + + You sure? + + + + + + diff --git a/docs/reference/gtk/images/box.png b/docs/reference/gtk/images/box.png index 77a04a5948..3713886bff 100644 Binary files a/docs/reference/gtk/images/box.png and b/docs/reference/gtk/images/box.png differ diff --git a/docs/reference/gtk/images/box.ui b/docs/reference/gtk/images/box.ui new file mode 100644 index 0000000000..75e5c4a8b7 --- /dev/null +++ b/docs/reference/gtk/images/box.ui @@ -0,0 +1,96 @@ + + + + 0 + 0 + 280 + 120 + + + + + + + 10 + 10 + 10 + 10 + vertical + 3 + + + horizontal + 1 + + + + horizontal + 4 + center + center + + + + center + + + + + + center + + + + + + + + + + + + + vertical + 4 + center + center + + + + center + + + + + + center + + + + + + + + + + + + + + + center + Horizontal and Vertical Boxes + + + + + + + + diff --git a/docs/reference/gtk/images/button.png b/docs/reference/gtk/images/button.png index 93135534e4..ce8f7998fb 100644 Binary files a/docs/reference/gtk/images/button.png and b/docs/reference/gtk/images/button.png differ 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 @@ + + + + 0 + 0 + 280 + 120 + + + + + + + 1 + 1 + center + center + Button + + + + + + diff --git a/docs/reference/gtk/images/calendar.png b/docs/reference/gtk/images/calendar.png index 7c1f63ffcf..93a29bfbf6 100644 Binary files a/docs/reference/gtk/images/calendar.png and b/docs/reference/gtk/images/calendar.png differ diff --git a/docs/reference/gtk/images/calendar.ui b/docs/reference/gtk/images/calendar.ui new file mode 100644 index 0000000000..5e0651ee9e --- /dev/null +++ b/docs/reference/gtk/images/calendar.ui @@ -0,0 +1,44 @@ + + + + 0 + 0 + + + + + + + vertical + 3 + 1 + 1 + center + center + 10 + 10 + 10 + 10 + + + center + center + + + + + Calendar + + + + + + + + diff --git a/docs/reference/gtk/images/centerbox.png b/docs/reference/gtk/images/centerbox.png index 0ad57fc938..e00e2dd635 100644 Binary files a/docs/reference/gtk/images/centerbox.png and b/docs/reference/gtk/images/centerbox.png differ diff --git a/docs/reference/gtk/images/centerbox.ui b/docs/reference/gtk/images/centerbox.ui new file mode 100644 index 0000000000..9d5973f70e --- /dev/null +++ b/docs/reference/gtk/images/centerbox.ui @@ -0,0 +1,63 @@ + + + + 0 + 0 + 280 + 120 + + + + + + + 10 + 10 + 20 + 20 + vertical + 3 + + + horizontal + 1 + 1 + fill + + + + center + + + + + + center + + + + + + center + + + + + + + center + Center Box + + + + + + + + diff --git a/docs/reference/gtk/images/check-button.png b/docs/reference/gtk/images/check-button.png index 5206587fe5..f60a4881b1 100644 Binary files a/docs/reference/gtk/images/check-button.png and b/docs/reference/gtk/images/check-button.png differ 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 @@ + + + + 0 + 0 + 280 + 120 + + + + + + + vertical + 3 + 1 + 1 + center + center + + + 1 + Check Button + + + + + 0 + Check Button + + + + + + + + diff --git a/docs/reference/gtk/images/color-button.png b/docs/reference/gtk/images/color-button.png index 0a576c1f7b..a71f03e9ba 100644 Binary files a/docs/reference/gtk/images/color-button.png and b/docs/reference/gtk/images/color-button.png differ diff --git a/docs/reference/gtk/images/color-button.ui b/docs/reference/gtk/images/color-button.ui new file mode 100644 index 0000000000..a3894ece10 --- /dev/null +++ b/docs/reference/gtk/images/color-button.ui @@ -0,0 +1,43 @@ + + + + 0 + 0 + 280 + 120 + + + + + + + vertical + 3 + 1 + 1 + center + center + + + #1e90ff + center + center + + + + + Color Button + + + + + + + + diff --git a/docs/reference/gtk/images/colorchooser.png b/docs/reference/gtk/images/colorchooser.png index 4b5e060059..beba6249b2 100644 Binary files a/docs/reference/gtk/images/colorchooser.png and b/docs/reference/gtk/images/colorchooser.png differ diff --git a/docs/reference/gtk/images/colorchooser.ui b/docs/reference/gtk/images/colorchooser.ui new file mode 100644 index 0000000000..9e7cbeb2d6 --- /dev/null +++ b/docs/reference/gtk/images/colorchooser.ui @@ -0,0 +1,6 @@ + + + + Color Chooser Dialog + + diff --git a/docs/reference/gtk/images/combo-box-entry.png b/docs/reference/gtk/images/combo-box-entry.png index ff030cee8d..d21c0879c9 100644 Binary files a/docs/reference/gtk/images/combo-box-entry.png and b/docs/reference/gtk/images/combo-box-entry.png differ 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 @@ + + + + 0 + 0 + 280 + 120 + + + + + + + 1 + 1 + center + center + 1 + + + Combo Box Entry + + + + + + + + diff --git a/docs/reference/gtk/images/combo-box-text.png b/docs/reference/gtk/images/combo-box-text.png index 6c24e0ae65..959374debf 100644 Binary files a/docs/reference/gtk/images/combo-box-text.png and b/docs/reference/gtk/images/combo-box-text.png differ 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 @@ + + + + 0 + 0 + 280 + 120 + + + + + + + 1 + 1 + center + center + + Combo Box Text + + 0 + + + + + + diff --git a/docs/reference/gtk/images/combo-box.png b/docs/reference/gtk/images/combo-box.png index 6376f71676..59feb96f88 100644 Binary files a/docs/reference/gtk/images/combo-box.png and b/docs/reference/gtk/images/combo-box.png differ 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 @@ + + + + 0 + 0 + 280 + 120 + + + + + + + 1 + 1 + center + center + + + + + + + + Combo Box + + + + + + + + + 0 + + + 0 + + + + + + diff --git a/docs/reference/gtk/images/dialog.png b/docs/reference/gtk/images/dialog.png index 4e56521564..ae6fa233b3 100644 Binary files a/docs/reference/gtk/images/dialog.png and b/docs/reference/gtk/images/dialog.png differ diff --git a/docs/reference/gtk/images/dialog.ui b/docs/reference/gtk/images/dialog.ui new file mode 100644 index 0000000000..9477b6960a --- /dev/null +++ b/docs/reference/gtk/images/dialog.ui @@ -0,0 +1,30 @@ + + + + 0 + 280 + 120 + Dialog + + + Cancel + + + + + Accept + + + + + Content + 1 + center + + + + button_ok + button_cancel + + + diff --git a/docs/reference/gtk/images/drawingarea-content.png b/docs/reference/gtk/images/drawingarea-content.png new file mode 100644 index 0000000000..b9265681e9 Binary files /dev/null and b/docs/reference/gtk/images/drawingarea-content.png differ diff --git a/docs/reference/gtk/images/drawingarea.png b/docs/reference/gtk/images/drawingarea.png index 7ab304522b..40392fe803 100644 Binary files a/docs/reference/gtk/images/drawingarea.png and b/docs/reference/gtk/images/drawingarea.png differ diff --git a/docs/reference/gtk/images/drawingarea.ui b/docs/reference/gtk/images/drawingarea.ui new file mode 100644 index 0000000000..e41ba3f7e4 --- /dev/null +++ b/docs/reference/gtk/images/drawingarea.ui @@ -0,0 +1,49 @@ + + + + 0 + 0 + + + + + + + vertical + 3 + 1 + 1 + fill + center + 10 + 10 + + + 10 + 10 + + + drawingarea-content.png + center + center + + + + + + + Drawing Area + + + + + + + + diff --git a/docs/reference/gtk/images/drop-down.png b/docs/reference/gtk/images/drop-down.png index 55b0acf23e..c230b27815 100644 Binary files a/docs/reference/gtk/images/drop-down.png and b/docs/reference/gtk/images/drop-down.png differ 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 @@ + + + + 0 + 0 + 280 + 120 + + + + + + + 1 + 1 + center + center + + + + Drop Down + Almost a combo + + + + + + + + + diff --git a/docs/reference/gtk/images/editable-label.png b/docs/reference/gtk/images/editable-label.png index a6b11bfd57..bedeb02b76 100644 Binary files a/docs/reference/gtk/images/editable-label.png and b/docs/reference/gtk/images/editable-label.png differ diff --git a/docs/reference/gtk/images/editable-label.ui b/docs/reference/gtk/images/editable-label.ui new file mode 100644 index 0000000000..8e4c5d98bd --- /dev/null +++ b/docs/reference/gtk/images/editable-label.ui @@ -0,0 +1,50 @@ + + + + 0 + 0 + 280 + 120 + editable2 + + + + + + + vertical + 12 + 1 + 1 + center + center + + + Editable Label + + + + + + + + + Editable Label + 1 + + + + + + + + + diff --git a/docs/reference/gtk/images/emojichooser.png b/docs/reference/gtk/images/emojichooser.png index e68b9ce3b4..e5ad579bea 100644 Binary files a/docs/reference/gtk/images/emojichooser.png and b/docs/reference/gtk/images/emojichooser.png differ diff --git a/docs/reference/gtk/images/emojichooser.ui b/docs/reference/gtk/images/emojichooser.ui new file mode 100644 index 0000000000..044a6d510f --- /dev/null +++ b/docs/reference/gtk/images/emojichooser.ui @@ -0,0 +1,6 @@ + + + + 0 + + diff --git a/docs/reference/gtk/images/entry.png b/docs/reference/gtk/images/entry.png index 8032301d9e..b23b053044 100644 Binary files a/docs/reference/gtk/images/entry.png and b/docs/reference/gtk/images/entry.png differ 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 @@ + + + + 0 + 0 + 280 + 120 + + + + + + + 1 + 1 + fill + center + Entry + 10 + 10 + 10 + 10 + + + + + + diff --git a/docs/reference/gtk/images/expander.png b/docs/reference/gtk/images/expander.png index 4b9548fcf1..c60dce6e1e 100644 Binary files a/docs/reference/gtk/images/expander.png and b/docs/reference/gtk/images/expander.png differ diff --git a/docs/reference/gtk/images/expander.ui b/docs/reference/gtk/images/expander.ui new file mode 100644 index 0000000000..1bb45c5799 --- /dev/null +++ b/docs/reference/gtk/images/expander.ui @@ -0,0 +1,34 @@ + + + + 0 + 0 + 280 + 120 + + + + + + + Expander + 1 + center + center + + + Hidden Content + + + + + + + + diff --git a/docs/reference/gtk/images/flow-box.png b/docs/reference/gtk/images/flow-box.png index e4c6e6f428..fac59ffc22 100644 Binary files a/docs/reference/gtk/images/flow-box.png and b/docs/reference/gtk/images/flow-box.png differ diff --git a/docs/reference/gtk/images/flow-box.ui b/docs/reference/gtk/images/flow-box.ui new file mode 100644 index 0000000000..9968897635 --- /dev/null +++ b/docs/reference/gtk/images/flow-box.ui @@ -0,0 +1,66 @@ + + + + 0 + 0 + 280 + + + + + vertical + 3 + 1 + 1 + + + 2 + 2 + browse + + + Child One + + + + + Child Two + + + + + + + horizontal + 6 + + + Child Three + + + + + 1 + + + + + + + + + + + Flow Box + + + + + + diff --git a/docs/tools/folder.png b/docs/reference/gtk/images/folder.png similarity index 100% rename from docs/tools/folder.png rename to docs/reference/gtk/images/folder.png diff --git a/docs/reference/gtk/images/font-button.png b/docs/reference/gtk/images/font-button.png index b5805c8d6b..a60e093f69 100644 Binary files a/docs/reference/gtk/images/font-button.png and b/docs/reference/gtk/images/font-button.png differ diff --git a/docs/reference/gtk/images/font-button.ui b/docs/reference/gtk/images/font-button.ui new file mode 100644 index 0000000000..03a5234e75 --- /dev/null +++ b/docs/reference/gtk/images/font-button.ui @@ -0,0 +1,43 @@ + + + + 0 + 0 + 280 + 120 + + + + + + + vertical + 3 + 1 + 1 + center + center + + + Sans Serif 10 + center + center + + + + + Font Button + + + + + + + + diff --git a/docs/reference/gtk/images/fontchooser.png b/docs/reference/gtk/images/fontchooser.png index f0127431e5..71ee87bf9e 100644 Binary files a/docs/reference/gtk/images/fontchooser.png and b/docs/reference/gtk/images/fontchooser.png differ diff --git a/docs/reference/gtk/images/fontchooser.ui b/docs/reference/gtk/images/fontchooser.ui new file mode 100644 index 0000000000..9ffdd8009b --- /dev/null +++ b/docs/reference/gtk/images/fontchooser.ui @@ -0,0 +1,8 @@ + + + + 200 + 300 + Font Chooser Dialog + + diff --git a/docs/reference/gtk/images/frame.png b/docs/reference/gtk/images/frame.png index b413869bf4..4c886890fc 100644 Binary files a/docs/reference/gtk/images/frame.png and b/docs/reference/gtk/images/frame.png differ diff --git a/docs/reference/gtk/images/frame.ui b/docs/reference/gtk/images/frame.ui new file mode 100644 index 0000000000..9591db2dbd --- /dev/null +++ b/docs/reference/gtk/images/frame.ui @@ -0,0 +1,34 @@ + + + + 0 + 0 + 280 + 120 + + + + + + + 10 + 10 + 10 + 10 + 1 + 1 + fill + fill + Frame + + + + + + diff --git a/docs/reference/gtk/images/glarea-content.png b/docs/reference/gtk/images/glarea-content.png new file mode 100644 index 0000000000..dc6367fe5c Binary files /dev/null and b/docs/reference/gtk/images/glarea-content.png differ diff --git a/docs/reference/gtk/images/glarea.png b/docs/reference/gtk/images/glarea.png index 50bf77c062..750dde8fdf 100644 Binary files a/docs/reference/gtk/images/glarea.png and b/docs/reference/gtk/images/glarea.png differ diff --git a/docs/reference/gtk/images/glarea.ui b/docs/reference/gtk/images/glarea.ui new file mode 100644 index 0000000000..aa9b40dcd5 --- /dev/null +++ b/docs/reference/gtk/images/glarea.ui @@ -0,0 +1,54 @@ + + + + 0 + 0 + 280 + 150 + + + + + + + vertical + 3 + 1 + 1 + fill + center + 10 + 10 + + + 10 + 10 + + + + glarea-content.png + center + center + + + + + + + GL Area + + + + + + + + diff --git a/docs/tools/gnome.png b/docs/reference/gtk/images/gnome.png similarity index 100% rename from docs/tools/gnome.png rename to docs/reference/gtk/images/gnome.png diff --git a/docs/reference/gtk/images/grid.png b/docs/reference/gtk/images/grid.png index 8f83c4c118..ae3722d1d3 100644 Binary files a/docs/reference/gtk/images/grid.png and b/docs/reference/gtk/images/grid.png differ diff --git a/docs/reference/gtk/images/grid.ui b/docs/reference/gtk/images/grid.ui new file mode 100644 index 0000000000..113f1a4bb4 --- /dev/null +++ b/docs/reference/gtk/images/grid.ui @@ -0,0 +1,101 @@ + + + + 0 + 0 + + + + + + + 10 + 10 + 20 + 20 + vertical + 3 + + + 4 + 4 + center + center + + + + center + + 0 + 0 + + + + + + + center + + 1 + 0 + + + + + + + center + + 0 + 1 + + + + + + + center + + 1 + 1 + + + + + + + + 2 + 0 + + + + + + + + 0 + 2 + + + + + + + + center + Grid + + + + + + + + diff --git a/docs/reference/gtk/images/headerbar.png b/docs/reference/gtk/images/headerbar.png index 53148e8be8..8034875674 100644 Binary files a/docs/reference/gtk/images/headerbar.png and b/docs/reference/gtk/images/headerbar.png differ diff --git a/docs/reference/gtk/images/headerbar.ui b/docs/reference/gtk/images/headerbar.ui new file mode 100644 index 0000000000..66e7048c7e --- /dev/null +++ b/docs/reference/gtk/images/headerbar.ui @@ -0,0 +1,23 @@ + + + + 0 + 220 + 150 + Header Bar + + + + + bookmark-new-symbolic + + + + + + + 0 + + + + diff --git a/docs/reference/gtk/images/icon-view.png b/docs/reference/gtk/images/icon-view.png index ef9d5b91b5..677918234f 100644 Binary files a/docs/reference/gtk/images/icon-view.png and b/docs/reference/gtk/images/icon-view.png differ diff --git a/docs/reference/gtk/images/icon-view.ui b/docs/reference/gtk/images/icon-view.ui new file mode 100644 index 0000000000..5d19025104 --- /dev/null +++ b/docs/reference/gtk/images/icon-view.ui @@ -0,0 +1,71 @@ + + + + + + + + + + One + folder.png + + + Two + gnome.png + + + + + 0 + 0 + + + + + + + 10 + 10 + 10 + 10 + vertical + 3 + + + + never + never + 1 + + + 1 + 1 + store + 0 + 1 + horizontal + 0 + + + + + + + Icon View + + + + + + + + diff --git a/docs/reference/gtk/images/image.png b/docs/reference/gtk/images/image.png index 36250b869b..e3fc27c4a5 100644 Binary files a/docs/reference/gtk/images/image.png and b/docs/reference/gtk/images/image.png differ diff --git a/docs/reference/gtk/images/image.ui b/docs/reference/gtk/images/image.ui new file mode 100644 index 0000000000..1c8793be90 --- /dev/null +++ b/docs/reference/gtk/images/image.ui @@ -0,0 +1,44 @@ + + + + 0 + 0 + 280 + 120 + + + + + + + vertical + 3 + 1 + 1 + center + center + + + applications-graphics + large + center + center + + + + + Image + + + + + + + + diff --git a/docs/reference/gtk/images/info-bar.png b/docs/reference/gtk/images/info-bar.png index d25cc5dd5b..95665a5e8f 100644 Binary files a/docs/reference/gtk/images/info-bar.png and b/docs/reference/gtk/images/info-bar.png differ 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 @@ + + + + 0 + 0 + 280 + 120 + + + + + + + 1 + 1 + fill + center + 10 + 10 + 10 + 10 + 1 + info + + + Info Bar + + + + + + + + diff --git a/docs/reference/gtk/images/label.png b/docs/reference/gtk/images/label.png index 77d35ab9c3..ecc10f13cb 100644 Binary files a/docs/reference/gtk/images/label.png and b/docs/reference/gtk/images/label.png differ 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 @@ + + + + 0 + 0 + 280 + 120 + + + + + + + 1 + 1 + center + center + Label + + + + + + diff --git a/docs/reference/gtk/images/levelbar.png b/docs/reference/gtk/images/levelbar.png index 7fe38f1b1a..3aa8b22d29 100644 Binary files a/docs/reference/gtk/images/levelbar.png and b/docs/reference/gtk/images/levelbar.png differ diff --git a/docs/reference/gtk/images/levelbar.ui b/docs/reference/gtk/images/levelbar.ui new file mode 100644 index 0000000000..469e76034a --- /dev/null +++ b/docs/reference/gtk/images/levelbar.ui @@ -0,0 +1,45 @@ + + + + 0 + 0 + 280 + 120 + + + + + + + vertical + 3 + 1 + 1 + 10 + 10 + fill + center + + + 0.3333 + 1 + fill + + + + + Level Bar + + + + + + + + diff --git a/docs/reference/gtk/images/link-button.png b/docs/reference/gtk/images/link-button.png index 8d1cc35371..6f860356ef 100644 Binary files a/docs/reference/gtk/images/link-button.png and b/docs/reference/gtk/images/link-button.png differ 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 @@ + + + + 0 + 0 + 280 + 120 + + + + + + + 1 + 1 + center + center + Link Button + http://www.gtk.org + + + + + + diff --git a/docs/reference/gtk/images/list-and-tree.png b/docs/reference/gtk/images/list-and-tree.png index 83132b9a20..af0a7a2e62 100644 Binary files a/docs/reference/gtk/images/list-and-tree.png and b/docs/reference/gtk/images/list-and-tree.png differ diff --git a/docs/reference/gtk/images/list-and-tree.ui b/docs/reference/gtk/images/list-and-tree.ui new file mode 100644 index 0000000000..aa290bb7bb --- /dev/null +++ b/docs/reference/gtk/images/list-and-tree.ui @@ -0,0 +1,81 @@ + + + + + + + + + + + Line One + False + A + + + Line Two + True + B + + Line Three + False + C + + + + + + 0 + 0 + 280 + 120 + + + + + 1 + 1 + store + + + List + + + + 0 + + + + + + + and + + + + 1 + + + + + + + Tree + + + + 2 + + + + + 0 + 0 + + + + diff --git a/docs/reference/gtk/images/list-box.png b/docs/reference/gtk/images/list-box.png index f79efd0d88..b299b2fd31 100644 Binary files a/docs/reference/gtk/images/list-box.png and b/docs/reference/gtk/images/list-box.png differ diff --git a/docs/reference/gtk/images/list-box.ui b/docs/reference/gtk/images/list-box.ui new file mode 100644 index 0000000000..18b3983207 --- /dev/null +++ b/docs/reference/gtk/images/list-box.ui @@ -0,0 +1,96 @@ + + + + 0 + 0 + 280 + 120 + + + + + vertical + 3 + 1 + 1 + + + single + + + 0 + + + 1 + center + List Box + + + + + + + horizontal + 10 + + + 1 + Line One + 0 + + + + + 1 + + + + + + + horizontal + 10 + + + 1 + Line Two + 0 + + + + + 2 + + + + + + + horizontal + 10 + + + Line Three + 0 + + + + + 1 + end + + + + + + + + + + diff --git a/docs/reference/gtk/images/media-controls.png b/docs/reference/gtk/images/media-controls.png index 41f228c3f3..9d894a14f0 100644 Binary files a/docs/reference/gtk/images/media-controls.png and b/docs/reference/gtk/images/media-controls.png differ diff --git a/docs/reference/gtk/images/media-controls.ui b/docs/reference/gtk/images/media-controls.ui new file mode 100644 index 0000000000..480012231c --- /dev/null +++ b/docs/reference/gtk/images/media-controls.ui @@ -0,0 +1,51 @@ + + + + 0 + 0 + 280 + 120 + + + + + + + 0 + file:///home/mclasen/Sources/gtk-master/docs/reference/gtk/images/gtk-logo.webm + + + + + vertical + 3 + 1 + 1 + center + center + + + center + center + + video + + + + + + Media Controls + + + + + + + + diff --git a/docs/reference/gtk/images/menu-button.png b/docs/reference/gtk/images/menu-button.png index cf397582af..ca9a7d362b 100644 Binary files a/docs/reference/gtk/images/menu-button.png and b/docs/reference/gtk/images/menu-button.png differ 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 @@ + + + + 0 + 0 + 280 + 120 + + + + + + + vertical + 3 + 1 + 1 + center + center + + + emblem-system-symbolic + + center + center + + + + + Menu Button + + + + + + + + diff --git a/docs/reference/gtk/images/menu.png b/docs/reference/gtk/images/menu.png index d6096a5b8a..e33fc44149 100644 Binary files a/docs/reference/gtk/images/menu.png and b/docs/reference/gtk/images/menu.png differ diff --git a/docs/reference/gtk/images/menu.ui b/docs/reference/gtk/images/menu.ui new file mode 100644 index 0000000000..12bc173a60 --- /dev/null +++ b/docs/reference/gtk/images/menu.ui @@ -0,0 +1,38 @@ + + + +
+ + Style +
+ + Item + +
+
+ + Transition + misc.toggle-visibility + +
+
+ + Inspector + + + About + text.redo + +
+
+ + + + 0 + model + center + center + + + +
diff --git a/docs/reference/gtk/images/menubar.png b/docs/reference/gtk/images/menubar.png index 237ffb6ce4..1c30bd7108 100644 Binary files a/docs/reference/gtk/images/menubar.png and b/docs/reference/gtk/images/menubar.png differ diff --git a/docs/reference/gtk/images/menubar.ui b/docs/reference/gtk/images/menubar.ui new file mode 100644 index 0000000000..7c42da8237 --- /dev/null +++ b/docs/reference/gtk/images/menubar.ui @@ -0,0 +1,54 @@ + + + + + File + + + Edit + + + View + + + + 0 + 0 + 280 + 120 + + + + + + + vertical + 3 + 1 + 1 + center + center + + + model + center + center + + + + + Menu Bar + + + + + + + + diff --git a/docs/reference/gtk/images/meson.build b/docs/reference/gtk/images/meson.build new file mode 100644 index 0000000000..d3bff0ce3f --- /dev/null +++ b/docs/reference/gtk/images/meson.build @@ -0,0 +1,91 @@ +# commented-out ui files need more work + +ui_files = [ + 'aboutdialog.ui', + 'action-bar.ui', + 'appchooserbutton.ui', + 'appchooserdialog.ui', + 'assistant.ui', + 'box.ui', + 'button.ui', + 'calendar.ui', + 'centerbox.ui', + 'check-button.ui', + 'colorchooser.ui', + 'color-button.ui', + 'combo-box.ui', + 'combo-box-entry.ui', + 'combo-box-text.ui', + 'dialog.ui', + 'drawingarea.ui', + 'drop-down.ui', + 'editable-label.ui', + 'emojichooser.ui', + 'entry.ui', + 'expander.ui', + 'flow-box.ui', + 'fontchooser.ui', + 'font-button.ui', + 'frame.ui', + 'glarea.ui', + 'grid.ui', + 'headerbar.ui', + 'icon-view.ui', + 'image.ui', + 'info-bar.ui', + 'label.ui', + 'levelbar.ui', + 'link-button.ui', + 'list-box.ui', + 'list-and-tree.ui', + 'media-controls.ui', + 'menu.ui', + 'menubar.ui', + 'menu-button.ui', + 'messagedialog.ui', + 'multiline-text.ui', + 'notebook.ui', + 'overlay.ui', + 'pagesetupdialog.ui', + 'panes.ui', + 'password-entry.ui', + 'picture.ui', + 'popover.ui', + 'printdialog.ui', + 'progressbar.ui', + 'radio-button.ui', + 'scales.ui', + 'scrollbar.ui', + 'scrolledwindow.ui', + 'search-bar.ui', + 'search-entry.ui', + 'separator.ui', + 'shortcuts-window.ui', + 'sidebar.ui', + 'spinbutton.ui', + 'spinner.ui', + 'stack.ui', + 'stackswitcher.ui', + 'statusbar.ui', + 'switch.ui', + 'toggle-button.ui', + 'video.ui', + 'volumebutton.ui', + 'window.ui', + 'windowcontrols.ui', +] + +gtk_builder_tool = find_program('gtk4-builder-tool') + +if get_option('update_screenshots') + foreach ui_file: ui_files + png_file = ui_file.replace('.ui', '.png') + gtk_images += custom_target('@0@ from @1@'.format(png_file, ui_file), + input: [ui_file, 'style.css'], + output: png_file, + command: [ gtk_builder_tool, 'screenshot', + '--force', + '--css', '@INPUT1@', + '@INPUT0@', '@OUTPUT@' ]) + endforeach +endif diff --git a/docs/reference/gtk/images/messagedialog.png b/docs/reference/gtk/images/messagedialog.png index 5b5870f7d9..b6d6a16856 100644 Binary files a/docs/reference/gtk/images/messagedialog.png and b/docs/reference/gtk/images/messagedialog.png differ diff --git a/docs/reference/gtk/images/messagedialog.ui b/docs/reference/gtk/images/messagedialog.ui new file mode 100644 index 0000000000..3637d2be3d --- /dev/null +++ b/docs/reference/gtk/images/messagedialog.ui @@ -0,0 +1,19 @@ + + + + 0 + 280 + 120 + edit-copy + Message Dialog + With secondary text + + + Ok + + + + button_ok + + + diff --git a/docs/reference/gtk/images/multiline-text.png b/docs/reference/gtk/images/multiline-text.png index fd64964a29..3ba454bbfe 100644 Binary files a/docs/reference/gtk/images/multiline-text.png and b/docs/reference/gtk/images/multiline-text.png differ diff --git a/docs/reference/gtk/images/multiline-text.ui b/docs/reference/gtk/images/multiline-text.ui new file mode 100644 index 0000000000..8a40f395d7 --- /dev/null +++ b/docs/reference/gtk/images/multiline-text.ui @@ -0,0 +1,44 @@ + + + + 0 + 0 + 280 + 120 + + + + + + + 10 + 10 + 10 + 10 + + + 1 + 1 + + + Multiline +Text + + + + + 0 + + + + + + + + diff --git a/docs/reference/gtk/images/notebook.png b/docs/reference/gtk/images/notebook.png index 3dd1d3cc5d..18d898ee3f 100644 Binary files a/docs/reference/gtk/images/notebook.png and b/docs/reference/gtk/images/notebook.png differ diff --git a/docs/reference/gtk/images/notebook.ui b/docs/reference/gtk/images/notebook.ui new file mode 100644 index 0000000000..22c4d51a2d --- /dev/null +++ b/docs/reference/gtk/images/notebook.ui @@ -0,0 +1,58 @@ + + + + 0 + 0 + 280 + 120 + + + + + 1 + 1 + + + Content + center + center + + + + + Tab + + + + + Content + center + center + + + + + Tab + + + + + Content + center + center + + + + + Tab + + + + + + diff --git a/docs/reference/gtk/images/overlay.png b/docs/reference/gtk/images/overlay.png index e61605a95c..730db88a46 100644 Binary files a/docs/reference/gtk/images/overlay.png and b/docs/reference/gtk/images/overlay.png differ diff --git a/docs/reference/gtk/images/overlay.ui b/docs/reference/gtk/images/overlay.ui new file mode 100644 index 0000000000..f6717eeb7a --- /dev/null +++ b/docs/reference/gtk/images/overlay.ui @@ -0,0 +1,70 @@ + + + + 0 + 0 + 280 + 200 + + + + + + + vertical + 3 + 10 + 10 + 10 + 10 + + + + + + + + + start + center + + + Overlay + + + + + + + 1 + 1 + center + center + Content + + + + + + + + + Overlay + + + + + + + + diff --git a/docs/reference/gtk/images/pagesetupdialog.png b/docs/reference/gtk/images/pagesetupdialog.png index efc11b83b9..ef1ae452f2 100644 Binary files a/docs/reference/gtk/images/pagesetupdialog.png and b/docs/reference/gtk/images/pagesetupdialog.png differ diff --git a/docs/reference/gtk/images/pagesetupdialog.ui b/docs/reference/gtk/images/pagesetupdialog.ui new file mode 100644 index 0000000000..fc8999a69a --- /dev/null +++ b/docs/reference/gtk/images/pagesetupdialog.ui @@ -0,0 +1,6 @@ + + + + Page Setup Dialog + + diff --git a/docs/reference/gtk/images/panes.png b/docs/reference/gtk/images/panes.png index e5e5b0801c..e648f61703 100644 Binary files a/docs/reference/gtk/images/panes.png and b/docs/reference/gtk/images/panes.png differ diff --git a/docs/reference/gtk/images/panes.ui b/docs/reference/gtk/images/panes.ui new file mode 100644 index 0000000000..e6bc172acc --- /dev/null +++ b/docs/reference/gtk/images/panes.ui @@ -0,0 +1,84 @@ + + + + 0 + 0 + + + + + + + 10 + 10 + 10 + 10 + vertical + 3 + + + horizontal + 1 + 12 + + + + vertical + 96 + 96 + + + + + + + + + 0 + 0 + 0 + 0 + + + + + + horizontal + 96 + 96 + + + + + + + + + 0 + 0 + 0 + 0 + + + + + + + + center + Horizontal and Vertical +Panes + + + + + + + + diff --git a/docs/reference/gtk/images/password-entry.png b/docs/reference/gtk/images/password-entry.png index a87c73b184..151f7d1447 100644 Binary files a/docs/reference/gtk/images/password-entry.png and b/docs/reference/gtk/images/password-entry.png differ 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 @@ + + + + 0 + 0 + 280 + 120 + + + + + + + 1 + 1 + fill + center + Entry + 1 + 10 + 10 + 10 + 10 + + + + + + diff --git a/docs/reference/gtk/images/picture.png b/docs/reference/gtk/images/picture.png index 8f2a50cce8..36670d0e57 100644 Binary files a/docs/reference/gtk/images/picture.png and b/docs/reference/gtk/images/picture.png differ diff --git a/docs/reference/gtk/images/picture.ui b/docs/reference/gtk/images/picture.ui new file mode 100644 index 0000000000..de69f7a27e --- /dev/null +++ b/docs/reference/gtk/images/picture.ui @@ -0,0 +1,46 @@ + + + + 0 + 0 + 280 + 120 + + + + + + + vertical + 3 + 1 + 1 + center + center + 10 + 10 + + + applications-graphics.png + 1 + center + center + + + + + Picture + + + + + + + + diff --git a/docs/reference/gtk/images/popover.png b/docs/reference/gtk/images/popover.png index b66e6967a0..df9314b1bb 100644 Binary files a/docs/reference/gtk/images/popover.png and b/docs/reference/gtk/images/popover.png differ diff --git a/docs/reference/gtk/images/popover.ui b/docs/reference/gtk/images/popover.ui new file mode 100644 index 0000000000..e0403f3e86 --- /dev/null +++ b/docs/reference/gtk/images/popover.ui @@ -0,0 +1,16 @@ + + + + 180 + 180 + center + 0 + + + center + center + Popover + + + + diff --git a/docs/reference/gtk/images/printdialog.png b/docs/reference/gtk/images/printdialog.png index 9a536b1654..323778c72c 100644 Binary files a/docs/reference/gtk/images/printdialog.png and b/docs/reference/gtk/images/printdialog.png differ diff --git a/docs/reference/gtk/images/printdialog.ui b/docs/reference/gtk/images/printdialog.ui new file mode 100644 index 0000000000..c5d3cf3f79 --- /dev/null +++ b/docs/reference/gtk/images/printdialog.ui @@ -0,0 +1,8 @@ + + + + 505 + 305 + Print Dialog + + diff --git a/docs/reference/gtk/images/progressbar.png b/docs/reference/gtk/images/progressbar.png index 8399c3dd18..c44840d464 100644 Binary files a/docs/reference/gtk/images/progressbar.png and b/docs/reference/gtk/images/progressbar.png differ diff --git a/docs/reference/gtk/images/progressbar.ui b/docs/reference/gtk/images/progressbar.ui new file mode 100644 index 0000000000..90a858c5d2 --- /dev/null +++ b/docs/reference/gtk/images/progressbar.ui @@ -0,0 +1,42 @@ + + + + 0 + 0 + 280 + 120 + + + + + + + vertical + 3 + 1 + 1 + center + center + + + 0.5 + 1 + + + + + Progress Bar + + + + + + + + diff --git a/docs/reference/gtk/images/radio-button.png b/docs/reference/gtk/images/radio-button.png index 065ccda6e6..9c205c6ec5 100644 Binary files a/docs/reference/gtk/images/radio-button.png and b/docs/reference/gtk/images/radio-button.png differ 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 @@ + + + + 0 + 0 + 280 + 120 + + + + + + + vertical + 3 + 1 + 1 + center + center + + + 1 + Radio Button + + + + + 0 + Radio Button + radio1 + + + + + + + + diff --git a/docs/reference/gtk/images/scales.png b/docs/reference/gtk/images/scales.png index f03325e247..c4c191bcd7 100644 Binary files a/docs/reference/gtk/images/scales.png and b/docs/reference/gtk/images/scales.png differ diff --git a/docs/reference/gtk/images/scales.ui b/docs/reference/gtk/images/scales.ui new file mode 100644 index 0000000000..324ca4a596 --- /dev/null +++ b/docs/reference/gtk/images/scales.ui @@ -0,0 +1,74 @@ + + + + 0 + 0 + + + + + + + 10 + 10 + 10 + 10 + vertical + 3 + + + horizontal + 1 + 12 + + + + horizontal + 96 + 96 + + + 0 + 100 + 50 + + + + + + + + vertical + 96 + 96 + + + 0 + 100 + 50 + + + + + + + + + + center + Horizontal and Vertical +Scales + + + + + + + + diff --git a/docs/reference/gtk/images/scrollbar.png b/docs/reference/gtk/images/scrollbar.png index 6fb1052f09..c475be552a 100644 Binary files a/docs/reference/gtk/images/scrollbar.png and b/docs/reference/gtk/images/scrollbar.png differ diff --git a/docs/reference/gtk/images/scrollbar.ui b/docs/reference/gtk/images/scrollbar.ui new file mode 100644 index 0000000000..9ee32a9520 --- /dev/null +++ b/docs/reference/gtk/images/scrollbar.ui @@ -0,0 +1,45 @@ + + + + 0 + 0 + 280 + 120 + + + + + + + vertical + 3 + 1 + 1 + center + center + + + 1 + 200 + fill + 10 + 10 + + + + + Scrollbar + + + + + + + + diff --git a/docs/reference/gtk/images/scrolledwindow.png b/docs/reference/gtk/images/scrolledwindow.png index 49bf1f6d7b..a09e504f44 100644 Binary files a/docs/reference/gtk/images/scrolledwindow.png and b/docs/reference/gtk/images/scrolledwindow.png differ diff --git a/docs/reference/gtk/images/scrolledwindow.ui b/docs/reference/gtk/images/scrolledwindow.ui new file mode 100644 index 0000000000..bf4bb5676e --- /dev/null +++ b/docs/reference/gtk/images/scrolledwindow.ui @@ -0,0 +1,31 @@ + + + + 0 + 0 + 280 + 120 + + + + never + always + 0 + + 1 + 1 + + + ScrolledWindow + center + center + + + + + + diff --git a/docs/reference/gtk/images/search-bar.png b/docs/reference/gtk/images/search-bar.png index b82d4a181b..60845837c1 100644 Binary files a/docs/reference/gtk/images/search-bar.png and b/docs/reference/gtk/images/search-bar.png differ 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 @@ + + + + 0 + 0 + 280 + 120 + + + + + + + vertical + 1 + 1 + + + 1 + 1 + + + Search Bar + + + + + + + + + + + + + + diff --git a/docs/reference/gtk/images/search-entry.png b/docs/reference/gtk/images/search-entry.png index 4ecdbfe8c4..1462a01ef7 100644 Binary files a/docs/reference/gtk/images/search-entry.png and b/docs/reference/gtk/images/search-entry.png differ 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 @@ + + + + 0 + 0 + 280 + 120 + + + + + + + 1 + 1 + fill + center + Search… + 10 + 10 + 10 + 10 + + + + + + diff --git a/docs/reference/gtk/images/separator.png b/docs/reference/gtk/images/separator.png index b76ec870ab..fed07a41de 100644 Binary files a/docs/reference/gtk/images/separator.png and b/docs/reference/gtk/images/separator.png differ diff --git a/docs/reference/gtk/images/separator.ui b/docs/reference/gtk/images/separator.ui new file mode 100644 index 0000000000..133a1ab888 --- /dev/null +++ b/docs/reference/gtk/images/separator.ui @@ -0,0 +1,61 @@ + + + + 0 + 0 + 280 + 120 + + + + + + + vertical + 3 + 1 + 1 + center + center + 10 + 10 + 10 + 10 + + + 10 + center + + + 100 + horizontal + center + + + + + 100 + vertical + + + + + + + Horizontal and Vertical +Separators + center + + + + + + + + diff --git a/docs/reference/gtk/images/shortcuts-window.png b/docs/reference/gtk/images/shortcuts-window.png index 3cc9cb0c5b..86978b6efb 100644 Binary files a/docs/reference/gtk/images/shortcuts-window.png and b/docs/reference/gtk/images/shortcuts-window.png differ diff --git a/docs/tools/shortcuts-boxes.ui b/docs/reference/gtk/images/shortcuts-window.ui similarity index 100% rename from docs/tools/shortcuts-boxes.ui rename to docs/reference/gtk/images/shortcuts-window.ui diff --git a/docs/reference/gtk/images/sidebar.png b/docs/reference/gtk/images/sidebar.png index ae504af6fa..f36f6df772 100644 Binary files a/docs/reference/gtk/images/sidebar.png and b/docs/reference/gtk/images/sidebar.png differ diff --git a/docs/reference/gtk/images/sidebar.ui b/docs/reference/gtk/images/sidebar.ui new file mode 100644 index 0000000000..8bb39cb00f --- /dev/null +++ b/docs/reference/gtk/images/sidebar.ui @@ -0,0 +1,57 @@ + + + + 0 + 0 + + + + + horizontal + 1 + 1 + + + stack + + + + + 120 + 120 + + + page1 + Page 1 + + + center + center + Sidebar + + + + + + + page2 + Page 2 + + + 0 + + + + + + + + + + diff --git a/docs/reference/gtk/images/spinbutton.png b/docs/reference/gtk/images/spinbutton.png index bcb1b5566d..fa4375fd82 100644 Binary files a/docs/reference/gtk/images/spinbutton.png and b/docs/reference/gtk/images/spinbutton.png differ diff --git a/docs/reference/gtk/images/spinbutton.ui b/docs/reference/gtk/images/spinbutton.ui new file mode 100644 index 0000000000..1e24b18176 --- /dev/null +++ b/docs/reference/gtk/images/spinbutton.ui @@ -0,0 +1,49 @@ + + + + 0 + 0 + 280 + 120 + + + + + + + vertical + 3 + 1 + 1 + center + center + + + + + 0 + 100 + 0 + + + center + center + + + + + Spin Button + + + + + + + + diff --git a/docs/reference/gtk/images/spinner.png b/docs/reference/gtk/images/spinner.png index f74deb7f41..9351841c79 100644 Binary files a/docs/reference/gtk/images/spinner.png and b/docs/reference/gtk/images/spinner.png differ diff --git a/docs/reference/gtk/images/spinner.ui b/docs/reference/gtk/images/spinner.ui new file mode 100644 index 0000000000..206aa81230 --- /dev/null +++ b/docs/reference/gtk/images/spinner.ui @@ -0,0 +1,43 @@ + + + + 0 + 0 + 280 + 120 + + + + + + + vertical + 3 + 1 + 1 + center + center + + + 1 + center + center + + + + + Spinner + + + + + + + + diff --git a/docs/reference/gtk/images/stack.png b/docs/reference/gtk/images/stack.png index 8b71d8e97a..48c445b35d 100644 Binary files a/docs/reference/gtk/images/stack.png and b/docs/reference/gtk/images/stack.png differ diff --git a/docs/reference/gtk/images/stack.ui b/docs/reference/gtk/images/stack.ui new file mode 100644 index 0000000000..e81f3acf73 --- /dev/null +++ b/docs/reference/gtk/images/stack.ui @@ -0,0 +1,63 @@ + + + + 0 + 0 + 280 + 120 + + + + + vertical + 1 + 1 + + + stack + + + + + 120 + 120 + + + page1 + Page 1 + + + 0 + + + + + + + page2 + Page 2 + + + 0 + + + + + + + + + 3 + Stack + + + + + + diff --git a/docs/reference/gtk/images/stackswitcher.png b/docs/reference/gtk/images/stackswitcher.png index 7ffe6dfcd7..ee51c3626b 100644 Binary files a/docs/reference/gtk/images/stackswitcher.png and b/docs/reference/gtk/images/stackswitcher.png differ diff --git a/docs/reference/gtk/images/stackswitcher.ui b/docs/reference/gtk/images/stackswitcher.ui new file mode 100644 index 0000000000..8ef282232b --- /dev/null +++ b/docs/reference/gtk/images/stackswitcher.ui @@ -0,0 +1,63 @@ + + + + 0 + 0 + 280 + 120 + + + + + vertical + 1 + 1 + + + stack + + + + + 120 + 120 + + + page1 + Page 1 + + + 0 + + + + + + + page2 + Page 2 + + + 0 + + + + + + + + + 3 + Stack Switcher + + + + + + diff --git a/docs/reference/gtk/images/statusbar.png b/docs/reference/gtk/images/statusbar.png index 32add6dd07..1d41a1a86e 100644 Binary files a/docs/reference/gtk/images/statusbar.png and b/docs/reference/gtk/images/statusbar.png differ diff --git a/docs/reference/gtk/images/statusbar.ui b/docs/reference/gtk/images/statusbar.ui new file mode 100644 index 0000000000..c888303b9c --- /dev/null +++ b/docs/reference/gtk/images/statusbar.ui @@ -0,0 +1,42 @@ + + + + 0 + 0 + 280 + 120 + + + + + vertical + 3 + + + 10 + Status Bar + + + + + 1 + 1 + end + + + Hold on… + start + + + + + + + + diff --git a/docs/reference/gtk/images/style.css b/docs/reference/gtk/images/style.css new file mode 100644 index 0000000000..039dd5258b --- /dev/null +++ b/docs/reference/gtk/images/style.css @@ -0,0 +1,18 @@ +.nobackground { + background: none; +} + +.shadow { + box-shadow: 0 3px 9px 1px rgba(0, 0, 0, 0.5); + margin: 20px; +} + +.black { + background: black; +} + +.small-button { + min-width: 16px; + min-height: 16px; + padding: 0; +} diff --git a/docs/reference/gtk/images/switch.png b/docs/reference/gtk/images/switch.png index b714d48f3b..73b95ab075 100644 Binary files a/docs/reference/gtk/images/switch.png and b/docs/reference/gtk/images/switch.png differ 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 @@ + + + + 0 + 0 + 280 + 120 + + + + + + + vertical + 3 + 1 + 1 + center + center + + + 1 + + + + + 0 + + + + + + + + diff --git a/docs/reference/gtk/images/toggle-button.png b/docs/reference/gtk/images/toggle-button.png index a6e2377d1b..01cdda398c 100644 Binary files a/docs/reference/gtk/images/toggle-button.png and b/docs/reference/gtk/images/toggle-button.png differ 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 @@ + + + + 0 + 0 + 280 + 120 + + + + + + + horizontal + 1 + 1 + center + center + + + + 1 + Toggle + + + + + 0 + Button + + + + + + + + diff --git a/docs/reference/gtk/images/video.png b/docs/reference/gtk/images/video.png index 4230baaaa4..2ce75a38e7 100644 Binary files a/docs/reference/gtk/images/video.png and b/docs/reference/gtk/images/video.png differ diff --git a/docs/reference/gtk/images/video.ui b/docs/reference/gtk/images/video.ui new file mode 100644 index 0000000000..8dcee64df8 --- /dev/null +++ b/docs/reference/gtk/images/video.ui @@ -0,0 +1,47 @@ + + + + 0 + 0 + 280 + 120 + + + + + + + vertical + 3 + 1 + 1 + center + center + 10 + 10 + + + 1 + 128 + center + center + file:///home/mclasen/Sources/gtk-master/docs/reference/gtk/images/gtk-logo.webm + + + + + Video + + + + + + + + diff --git a/docs/reference/gtk/images/volumebutton.png b/docs/reference/gtk/images/volumebutton.png index ff484bd158..0b8031f4f1 100644 Binary files a/docs/reference/gtk/images/volumebutton.png and b/docs/reference/gtk/images/volumebutton.png differ diff --git a/docs/reference/gtk/images/volumebutton.ui b/docs/reference/gtk/images/volumebutton.ui new file mode 100644 index 0000000000..db46723818 --- /dev/null +++ b/docs/reference/gtk/images/volumebutton.ui @@ -0,0 +1,43 @@ + + + + 0 + 0 + 280 + 120 + + + + + + + vertical + 3 + 1 + 1 + center + center + + + 33 + center + center + + + + + Volume Button + + + + + + + + diff --git a/docs/reference/gtk/images/window.png b/docs/reference/gtk/images/window.png index 106f3ca62e..b760542753 100644 Binary files a/docs/reference/gtk/images/window.png and b/docs/reference/gtk/images/window.png differ diff --git a/docs/reference/gtk/images/window.ui b/docs/reference/gtk/images/window.ui new file mode 100644 index 0000000000..31db76ddab --- /dev/null +++ b/docs/reference/gtk/images/window.ui @@ -0,0 +1,9 @@ + + + + 0 + 280 + 120 + Window + + diff --git a/docs/reference/gtk/images/windowcontrols.png b/docs/reference/gtk/images/windowcontrols.png index 0720d3b196..5407cfece7 100644 Binary files a/docs/reference/gtk/images/windowcontrols.png and b/docs/reference/gtk/images/windowcontrols.png differ diff --git a/docs/reference/gtk/images/windowcontrols.ui b/docs/reference/gtk/images/windowcontrols.ui new file mode 100644 index 0000000000..45986e70c3 --- /dev/null +++ b/docs/reference/gtk/images/windowcontrols.ui @@ -0,0 +1,44 @@ + + + + 0 + 1 + 280 + 120 + + + + + + + vertical + 3 + 1 + 1 + center + center + + + end + :minimize,maximize,close + center + center + + + + + Window Controls + + + + + + + + diff --git a/docs/reference/gtk/meson.build b/docs/reference/gtk/meson.build index a7af607b91..f0b0882e44 100644 --- a/docs/reference/gtk/meson.build +++ b/docs/reference/gtk/meson.build @@ -27,6 +27,10 @@ expand_content_md_files = [ 'visual_index.md' ] +gtk_images = [] + +subdir('images') + if get_option('gtk_doc') gtk4_toml = configure_file( input: 'gtk4.toml.in', @@ -46,10 +50,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/docs/tools/README.shooter b/docs/tools/README.shooter deleted file mode 100644 index bd06cb435b..0000000000 --- a/docs/tools/README.shooter +++ /dev/null @@ -1,13 +0,0 @@ -The doc shooter is used to take screenshots of widgets for the GTK -reference manuals. We use these images for both the headers of the -images, and for the visual index of GNOME images. They aren't part of -the docs build. Instead, the images are taken, and then copied by hand -into gtk/docs/reference/gtk/images/ - -Ideally, the images should be taken once a release, and all images -should be updated at the same time. A simple theme should be used to -take the screenshots, and in the future, we may include a gtkrc file in -this directory for the shooter to use. Currently, all shots are -constrained to the same width. Care should be taken when adding new -widgets to keep this constraint. - diff --git a/docs/tools/gtk-logo.png b/docs/tools/gtk-logo.png deleted file mode 100644 index 28e546b965..0000000000 Binary files a/docs/tools/gtk-logo.png and /dev/null differ diff --git a/docs/tools/meson.build b/docs/tools/meson.build deleted file mode 100644 index d9a9afb359..0000000000 --- a/docs/tools/meson.build +++ /dev/null @@ -1,17 +0,0 @@ -if get_option('gtk_doc') - doc_shooter_resources = gnome.compile_resources('shooter_resources', - 'shooter.gresource.xml', - source_dir: '.') - - doc_shooter_sources = [ - 'shooter.c', - 'shadow.c', - 'widgets.c', - '../../tests/gtkgears.c', - ] - - doc_shooter = executable('doc-shooter', - doc_shooter_sources, doc_shooter_resources, - include_directories: [ confinc, gdkinc, gtkinc, testinc, ], - dependencies: libgtk_dep) -endif diff --git a/docs/tools/shadow.c b/docs/tools/shadow.c deleted file mode 100644 index 20dfdbca13..0000000000 --- a/docs/tools/shadow.c +++ /dev/null @@ -1,152 +0,0 @@ -#include "shadow.h" -#include - -#define BLUR_RADIUS 5 -#define SHADOW_OFFSET (BLUR_RADIUS * 4 / 5) -#define SHADOW_OPACITY 0.75 - -typedef struct { - int size; - double *data; -} ConvFilter; - -static double -gaussian (double x, double y, double r) -{ - return ((1 / (2 * M_PI * r)) * - exp ((- (x * x + y * y)) / (2 * r * r))); -} - -static ConvFilter * -create_blur_filter (int radius) -{ - ConvFilter *filter; - int x, y; - double sum; - - filter = g_new0 (ConvFilter, 1); - filter->size = radius * 2 + 1; - filter->data = g_new (double, filter->size * filter->size); - - sum = 0.0; - - for (y = 0 ; y < filter->size; y++) - { - for (x = 0 ; x < filter->size; x++) - { - sum += filter->data[y * filter->size + x] = gaussian (x - (filter->size >> 1), - y - (filter->size >> 1), - radius); - } - } - - for (y = 0; y < filter->size; y++) - { - for (x = 0; x < filter->size; x++) - { - filter->data[y * filter->size + x] /= sum; - } - } - - return filter; - -} - -static GdkPixbuf * -create_shadow (GdkPixbuf *src) -{ - int x, y, i, j; - int width, height; - GdkPixbuf *dest; - static ConvFilter *filter = NULL; - int src_rowstride, dest_rowstride; - int src_bpp, dest_bpp; - - guchar *src_pixels, *dest_pixels; - - if (!filter) - filter = create_blur_filter (BLUR_RADIUS); - - width = gdk_pixbuf_get_width (src) + BLUR_RADIUS * 2 + SHADOW_OFFSET; - height = gdk_pixbuf_get_height (src) + BLUR_RADIUS * 2 + SHADOW_OFFSET; - - dest = gdk_pixbuf_new (gdk_pixbuf_get_colorspace (src), - gdk_pixbuf_get_has_alpha (src), - gdk_pixbuf_get_bits_per_sample (src), - width, height); - gdk_pixbuf_fill (dest, 0); - src_pixels = gdk_pixbuf_get_pixels (src); - src_rowstride = gdk_pixbuf_get_rowstride (src); - src_bpp = gdk_pixbuf_get_has_alpha (src) ? 4 : 3; - - dest_pixels = gdk_pixbuf_get_pixels (dest); - dest_rowstride = gdk_pixbuf_get_rowstride (dest); - dest_bpp = gdk_pixbuf_get_has_alpha (dest) ? 4 : 3; - - for (y = 0; y < height; y++) - { - for (x = 0; x < width; x++) - { - int sumr = 0, sumg = 0, sumb = 0, suma = 0; - - for (i = 0; i < filter->size; i++) - { - for (j = 0; j < filter->size; j++) - { - int src_x, src_y; - - src_y = -(BLUR_RADIUS + SHADOW_OFFSET) + y - (filter->size >> 1) + i; - src_x = -(BLUR_RADIUS + SHADOW_OFFSET) + x - (filter->size >> 1) + j; - - if (src_y < 0 || src_y > gdk_pixbuf_get_height (src) || - src_x < 0 || src_x > gdk_pixbuf_get_width (src)) - continue; - - sumr += src_pixels [src_y * src_rowstride + - src_x * src_bpp + 0] * - filter->data [i * filter->size + j]; - sumg += src_pixels [src_y * src_rowstride + - src_x * src_bpp + 1] * - filter->data [i * filter->size + j]; - - sumb += src_pixels [src_y * src_rowstride + - src_x * src_bpp + 2] * - filter->data [i * filter->size + j]; - - if (src_bpp == 4) - suma += src_pixels [src_y * src_rowstride + - src_x * src_bpp + 3] * - filter->data [i * filter->size + j]; - - - } - } - - if (dest_bpp == 4) - dest_pixels [y * dest_rowstride + - x * dest_bpp + 3] = suma * SHADOW_OPACITY; - - } - } - - return dest; -} - -GdkPixbuf * -add_shadow (GdkPixbuf *src) -{ - GdkPixbuf *dest; - - dest = create_shadow (src); - - gdk_pixbuf_composite (src, dest, - BLUR_RADIUS, BLUR_RADIUS, - gdk_pixbuf_get_width (src), - gdk_pixbuf_get_height (src), - BLUR_RADIUS, BLUR_RADIUS, 1.0, 1.0, - GDK_INTERP_NEAREST, 255); - - g_object_unref (src); - - return dest; -} diff --git a/docs/tools/shadow.h b/docs/tools/shadow.h deleted file mode 100644 index cb87c504b7..0000000000 --- a/docs/tools/shadow.h +++ /dev/null @@ -1,8 +0,0 @@ -#ifndef __SHADOW_H__ -#define __SHADOW_H__ - -#include - -GdkPixbuf *add_shadow (GdkPixbuf *src); - -#endif /* __SHADOW_H__ */ diff --git a/docs/tools/shooter.c b/docs/tools/shooter.c deleted file mode 100644 index 81bc0a02f1..0000000000 --- a/docs/tools/shooter.c +++ /dev/null @@ -1,199 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "widgets.h" -#include "shadow.h" - -static GdkPixbuf * -add_border (GdkPixbuf *pixbuf) -{ - GdkPixbuf *retval; - - retval = gdk_pixbuf_new (GDK_COLORSPACE_RGB, TRUE, 8, - gdk_pixbuf_get_width (pixbuf) + 2, - gdk_pixbuf_get_height (pixbuf) + 2); - - /* Fill with solid black */ - gdk_pixbuf_fill (retval, 0xFF); - gdk_pixbuf_copy_area (pixbuf, - 0, 0, - gdk_pixbuf_get_width (pixbuf), - gdk_pixbuf_get_height (pixbuf), - retval, 1, 1); - - g_object_unref (pixbuf); - - return retval; -} - -static GMainLoop *loop; - -static gboolean -quit_when_idle (gpointer loop) -{ - g_main_loop_quit (loop); - - return G_SOURCE_REMOVE; -} - -static void -draw_paintable (GdkPaintable *paintable, - gpointer out_surface) -{ - GtkSnapshot *snapshot; - GskRenderNode *node; - cairo_surface_t *surface; - cairo_t *cr; - - snapshot = gtk_snapshot_new (); - gdk_paintable_snapshot (paintable, - snapshot, - gdk_paintable_get_intrinsic_width (paintable), - gdk_paintable_get_intrinsic_height (paintable)); - node = gtk_snapshot_free_to_node (snapshot); - - /* If the window literally draws nothing, we assume it hasn't been mapped yet and as such - * the invalidations were only side effects of resizes. - */ - if (node == NULL) - return; - - surface = cairo_image_surface_create (CAIRO_FORMAT_ARGB32, - gdk_paintable_get_intrinsic_width (paintable), - gdk_paintable_get_intrinsic_height (paintable)); - - cr = cairo_create (surface); - gsk_render_node_draw (node, cr); - cairo_destroy (cr); - gsk_render_node_unref (node); - - g_signal_handlers_disconnect_by_func (paintable, draw_paintable, out_surface); - - *(cairo_surface_t **) out_surface = surface; - - g_idle_add (quit_when_idle, loop); -} - -static cairo_surface_t * -snapshot_widget (GtkWidget *widget) -{ - GdkPaintable *paintable; - cairo_surface_t *surface; - - g_assert (gtk_widget_get_realized (widget)); - - loop = g_main_loop_new (NULL, FALSE); - - /* We wait until the widget is drawn for the first time. - * - * We also use an inhibit mechanism, to give module functions a chance - * to delay the snapshot. - */ - paintable = gtk_widget_paintable_new (widget); - g_signal_connect (paintable, "invalidate-contents", G_CALLBACK (draw_paintable), &surface); - g_main_loop_run (loop); - - g_main_loop_unref (loop); - g_object_unref (paintable); - gtk_window_destroy (GTK_WINDOW (gtk_widget_get_root (widget))); - - return surface; -} - -static gboolean -quit_cb (gpointer data) -{ - *(gboolean *)data = TRUE; - g_main_context_wakeup (NULL); - return G_SOURCE_REMOVE; -} - -int -main (int argc, char **argv) -{ - GList *toplevels, *node; - - gtk_init (); - - toplevels = get_all_widgets (); - - for (node = toplevels; node; node = node->next) - { - WidgetInfo *info; - char *filename; - cairo_surface_t *surface; - GdkPixbuf *pixbuf; - GtkWidget *widget; - - info = node->data; - - gtk_widget_show (info->window); - - if (info->no_focus) - { - gtk_root_set_focus (GTK_ROOT (info->window), NULL); - gdk_clipboard_set_content (gdk_display_get_primary_clipboard (gdk_display_get_default ()), - NULL); - } - - if (info->snapshot_popover) - { - GtkWidget *button = gtk_window_get_child (GTK_WINDOW (info->window)); - - gtk_menu_button_popup (GTK_MENU_BUTTON (button)); - widget = GTK_WIDGET (gtk_menu_button_get_popover (GTK_MENU_BUTTON (button))); - } - else - { - widget = info->window; - } - - if (info->wait > 0) - { - gboolean quit = FALSE; - - g_timeout_add (info->wait, quit_cb, &quit); - - while (!quit) - g_main_context_iteration (NULL, TRUE); - } - - surface = snapshot_widget (widget); - - pixbuf = gdk_pixbuf_get_from_surface (surface, 0, 0, - cairo_image_surface_get_width (surface), - cairo_image_surface_get_height (surface)); - - if (!info->include_decorations) - pixbuf = add_border (pixbuf); - - pixbuf = add_shadow (pixbuf); - - filename = g_strdup_printf ("./%s.png", info->name); - - gdk_pixbuf_save (pixbuf, filename, "png", NULL, NULL); - g_free (filename); - - g_object_unref (pixbuf); - cairo_surface_destroy (surface); - } - - return 0; -} diff --git a/docs/tools/shooter.gresource.xml b/docs/tools/shooter.gresource.xml deleted file mode 100644 index 67385b6bd8..0000000000 --- a/docs/tools/shooter.gresource.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - shortcuts-boxes.ui - - diff --git a/docs/tools/widgets.c b/docs/tools/widgets.c deleted file mode 100644 index 474cdd3bbe..0000000000 --- a/docs/tools/widgets.c +++ /dev/null @@ -1,2221 +0,0 @@ -#include "config.h" - -#define GDK_DISABLE_DEPRECATION_WARNINGS -#undef GTK_DISABLE_DEPRECATED - -#include -#include -#include -#include -#include "widgets.h" -#include "gtkgears.h" - -#define SMALL_WIDTH 240 -#define SMALL_HEIGHT 75 -#define MEDIUM_WIDTH 240 -#define MEDIUM_HEIGHT 165 -#define LARGE_WIDTH 240 -#define LARGE_HEIGHT 240 - -static WidgetInfo * -new_widget_info (const char *name, - GtkWidget *widget, - WidgetSize size) -{ - WidgetInfo *info; - - info = g_new0 (WidgetInfo, 1); - info->name = g_strdup (name); - info->size = size; - if (GTK_IS_WINDOW (widget)) - { - info->window = widget; - gtk_window_set_resizable (GTK_WINDOW (info->window), FALSE); - info->include_decorations = TRUE; - } - else if (GTK_IS_POPOVER (widget)) - { - GtkWidget *button; - - info->snapshot_popover = TRUE; - info->window = gtk_window_new (); - gtk_window_set_default_size (GTK_WINDOW (info->window), 200, 200); - gtk_window_set_decorated (GTK_WINDOW (info->window), FALSE); - info->include_decorations = TRUE; - button = gtk_menu_button_new (); - gtk_menu_button_set_popover (GTK_MENU_BUTTON (button), widget); - gtk_window_set_child (GTK_WINDOW (info->window), button); - } - else - { - info->window = gtk_window_new (); - gtk_window_set_decorated (GTK_WINDOW (info->window), FALSE); - info->include_decorations = FALSE; - gtk_window_set_child (GTK_WINDOW (info->window), widget); - } - info->no_focus = TRUE; - - switch (size) - { - case SMALL: - gtk_widget_set_size_request (info->window, 240, 75); - break; - case MEDIUM: - gtk_widget_set_size_request (info->window, 240, 165); - break; - case LARGE: - gtk_widget_set_size_request (info->window, 240, 240); - break; - default: - break; - } - - return info; -} - -static void -add_margin (GtkWidget *widget) -{ - gtk_widget_set_margin_start (widget, 10); - gtk_widget_set_margin_end (widget, 10); - gtk_widget_set_margin_top (widget, 10); - gtk_widget_set_margin_bottom (widget, 10); -} - -static WidgetInfo * -create_button (void) -{ - GtkWidget *widget; - - widget = gtk_button_new_with_mnemonic ("_Button"); - gtk_widget_set_halign (widget, GTK_ALIGN_CENTER); - gtk_widget_set_valign (widget, GTK_ALIGN_CENTER); - add_margin (widget); - - return new_widget_info ("button", widget, SMALL); -} - -static WidgetInfo * -create_switch (void) -{ - GtkWidget *widget; - GtkWidget *sw; - - widget = gtk_box_new (GTK_ORIENTATION_VERTICAL, 3); - sw = gtk_switch_new (); - gtk_switch_set_active (GTK_SWITCH (sw), TRUE); - gtk_box_append (GTK_BOX (widget), sw); - sw = gtk_switch_new (); - gtk_box_append (GTK_BOX (widget), sw); - - gtk_widget_set_halign (widget, GTK_ALIGN_CENTER); - gtk_widget_set_valign (widget, GTK_ALIGN_CENTER); - - return new_widget_info ("switch", widget, SMALL); -} - -static WidgetInfo * -create_toggle_button (void) -{ - GtkWidget *widget; - GtkWidget *button; - - widget = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0); - gtk_box_set_homogeneous (GTK_BOX (widget), TRUE); - gtk_widget_add_css_class (widget, "linked"); - button = gtk_toggle_button_new_with_label ("Toggle"); - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), TRUE); - gtk_box_append (GTK_BOX (widget), button); - button = gtk_toggle_button_new_with_label ("Button"); - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), FALSE); - gtk_box_append (GTK_BOX (widget), button); - gtk_widget_set_halign (widget, GTK_ALIGN_CENTER); - gtk_widget_set_valign (widget, GTK_ALIGN_CENTER); - - return new_widget_info ("toggle-button", widget, SMALL); -} - -static WidgetInfo * -create_check_button (void) -{ - GtkWidget *widget; - GtkWidget *button; - - widget = gtk_box_new (GTK_ORIENTATION_VERTICAL, 3); - gtk_widget_set_halign (widget, GTK_ALIGN_CENTER); - gtk_widget_set_valign (widget, GTK_ALIGN_CENTER); - - button = gtk_check_button_new_with_mnemonic ("_Check Button"); - gtk_check_button_set_active (GTK_CHECK_BUTTON (button), TRUE); - gtk_box_append (GTK_BOX (widget), button); - - button = gtk_check_button_new_with_mnemonic ("_Check Button"); - gtk_box_append (GTK_BOX (widget), button); - - return new_widget_info ("check-button", widget, SMALL); -} - -static WidgetInfo * -create_radio_button (void) -{ - GtkWidget *widget; - GtkWidget *button; - GtkWidget *group; - - widget = gtk_box_new (GTK_ORIENTATION_VERTICAL, 3); - gtk_widget_set_halign (widget, GTK_ALIGN_CENTER); - gtk_widget_set_valign (widget, GTK_ALIGN_CENTER); - - button = gtk_check_button_new_with_mnemonic ("Radio Button"); - gtk_check_button_set_active (GTK_CHECK_BUTTON (button), TRUE); - gtk_box_append (GTK_BOX (widget), button); - group = button; - - button = gtk_check_button_new_with_mnemonic ("Radio Button"); - gtk_box_append (GTK_BOX (widget), button); - gtk_check_button_set_group (GTK_CHECK_BUTTON (button), GTK_CHECK_BUTTON (group)); - - return new_widget_info ("radio-button", widget, SMALL); -} - -static WidgetInfo * -create_link_button (void) -{ - GtkWidget *widget; - - widget = gtk_link_button_new_with_label ("http://www.gtk.org", "Link Button"); - gtk_widget_set_halign (widget, GTK_ALIGN_CENTER); - gtk_widget_set_valign (widget, GTK_ALIGN_CENTER); - - return new_widget_info ("link-button", widget, MEDIUM); -} - -static WidgetInfo * -create_menu_button (void) -{ - GtkWidget *widget; - GtkWidget *menu; - GtkWidget *vbox; - - widget = gtk_menu_button_new (); - gtk_menu_button_set_icon_name (GTK_MENU_BUTTON (widget), "emblem-system-symbolic"); - menu = gtk_popover_new (); - gtk_menu_button_set_popover (GTK_MENU_BUTTON (widget), menu); - - vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 3); - gtk_box_append (GTK_BOX (vbox), widget); - gtk_widget_set_halign (widget, GTK_ALIGN_CENTER); - gtk_widget_set_valign (widget, GTK_ALIGN_CENTER); - - gtk_box_append (GTK_BOX (vbox), gtk_label_new ("Menu Button")); - - add_margin (vbox); - - return new_widget_info ("menu-button", vbox, SMALL); -} - -#define G_TYPE_TEST_PERMISSION (g_test_permission_get_type ()) -#define G_TEST_PERMISSION(inst) (G_TYPE_CHECK_INSTANCE_CAST ((inst), \ - G_TYPE_TEST_PERMISSION, \ - GTestPermission)) -#define G_IS_TEST_PERMISSION(inst) (G_TYPE_CHECK_INSTANCE_TYPE ((inst), \ - G_TYPE_TEST_PERMISSION)) - -typedef struct _GTestPermission GTestPermission; -typedef struct _GTestPermissionClass GTestPermissionClass; - -struct _GTestPermission -{ - GPermission parent; - - gboolean success; -}; - -struct _GTestPermissionClass -{ - GPermissionClass parent_class; -}; - -G_DEFINE_TYPE (GTestPermission, g_test_permission, G_TYPE_PERMISSION) - -static void -g_test_permission_init (GTestPermission *test) -{ - g_permission_impl_update (G_PERMISSION (test), FALSE, TRUE, TRUE); -} - -static void -g_test_permission_class_init (GTestPermissionClass *class) -{ -} - -static WidgetInfo * -create_lockbutton (void) -{ - GtkWidget *vbox; - GtkWidget *widget; - - widget = gtk_lock_button_new (g_object_new (G_TYPE_TEST_PERMISSION, NULL)); - - vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 3); - gtk_box_append (GTK_BOX (vbox), widget); - gtk_box_append (GTK_BOX (vbox), gtk_label_new ("Lock Button")); - gtk_widget_set_halign (vbox, GTK_ALIGN_CENTER); - gtk_widget_set_valign (vbox, GTK_ALIGN_CENTER); - - return new_widget_info ("lock-button", vbox, SMALL); -} - -static WidgetInfo * -create_entry (void) -{ - GtkWidget *widget; - - widget = gtk_entry_new (); - gtk_widget_set_halign (widget, GTK_ALIGN_FILL); - gtk_widget_set_valign (widget, GTK_ALIGN_CENTER); - gtk_editable_set_text (GTK_EDITABLE (widget), "Entry"); - gtk_editable_set_position (GTK_EDITABLE (widget), -1); - - add_margin (widget); - - return new_widget_info ("entry", widget, SMALL); -} - -static WidgetInfo * -create_password_entry (void) -{ - GtkWidget *widget; - - widget = gtk_password_entry_new (); - gtk_password_entry_set_show_peek_icon (GTK_PASSWORD_ENTRY (widget), TRUE); - gtk_widget_set_halign (widget, GTK_ALIGN_FILL); - gtk_widget_set_valign (widget, GTK_ALIGN_CENTER); - gtk_editable_set_text (GTK_EDITABLE (widget), "Entry"); - gtk_editable_set_position (GTK_EDITABLE (widget), -1); - - add_margin (widget); - - return new_widget_info ("password-entry", widget, SMALL); -} - -static WidgetInfo * -create_search_entry (void) -{ - GtkWidget *widget; - - widget = gtk_search_entry_new (); - gtk_widget_set_halign (widget, GTK_ALIGN_FILL); - gtk_widget_set_valign (widget, GTK_ALIGN_CENTER); - g_object_set (widget, "placeholder-text", "Search…", NULL); - - add_margin (widget); - - return new_widget_info ("search-entry", widget, SMALL); -} - -static WidgetInfo * -create_label (void) -{ - GtkWidget *widget; - - widget = gtk_label_new ("Label"); - gtk_widget_set_halign (widget, GTK_ALIGN_CENTER); - gtk_widget_set_valign (widget, GTK_ALIGN_CENTER); - - return new_widget_info ("label", widget, SMALL); -} - -static WidgetInfo * -create_combo_box_entry (void) -{ - GtkWidget *widget; - GtkWidget *child; - GtkTreeModel *model; - - model = (GtkTreeModel *)gtk_list_store_new (1, G_TYPE_STRING); - widget = g_object_new (GTK_TYPE_COMBO_BOX, - "has-entry", TRUE, - "model", model, - "entry-text-column", 0, - NULL); - g_object_unref (model); - - child = gtk_combo_box_get_child (GTK_COMBO_BOX (widget)); - gtk_editable_set_text (GTK_EDITABLE (child), "Combo Box Entry"); - gtk_widget_set_halign (widget, GTK_ALIGN_CENTER); - gtk_widget_set_valign (widget, GTK_ALIGN_CENTER); - - return new_widget_info ("combo-box-entry", widget, SMALL); -} - -static WidgetInfo * -create_combo_box (void) -{ - GtkWidget *widget; - GtkCellRenderer *cell; - GtkListStore *store; - - widget = gtk_combo_box_new (); - gtk_cell_layout_clear (GTK_CELL_LAYOUT (widget)); - cell = gtk_cell_renderer_text_new (); - gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (widget), cell, FALSE); - gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (widget), cell, "text", 0, NULL); - - store = gtk_list_store_new (1, G_TYPE_STRING); - gtk_list_store_insert_with_values (store, NULL, -1, 0, "Combo Box", -1); - gtk_combo_box_set_model (GTK_COMBO_BOX (widget), GTK_TREE_MODEL (store)); - - gtk_combo_box_set_active (GTK_COMBO_BOX (widget), 0); - gtk_widget_set_halign (widget, GTK_ALIGN_CENTER); - gtk_widget_set_valign (widget, GTK_ALIGN_CENTER); - - return new_widget_info ("combo-box", widget, SMALL); -} - -static WidgetInfo * -create_combo_box_text (void) -{ - GtkWidget *widget; - - widget = gtk_combo_box_text_new (); - - gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (widget), "Combo Box Text"); - gtk_combo_box_set_active (GTK_COMBO_BOX (widget), 0); - gtk_widget_set_halign (widget, GTK_ALIGN_CENTER); - gtk_widget_set_valign (widget, GTK_ALIGN_CENTER); - - return new_widget_info ("combo-box-text", widget, SMALL); -} - -static WidgetInfo * -create_drop_down (void) -{ - GtkWidget *widget; - - widget = gtk_drop_down_new_from_strings ((const char * const []){"Drop Down", "Almost a combo", NULL}); - - gtk_widget_set_halign (widget, GTK_ALIGN_CENTER); - gtk_widget_set_valign (widget, GTK_ALIGN_CENTER); - - return new_widget_info ("drop-down", widget, SMALL); -} - -static WidgetInfo * -create_info_bar (void) -{ - GtkWidget *widget; - WidgetInfo *info; - - widget = gtk_info_bar_new (); - gtk_info_bar_set_show_close_button (GTK_INFO_BAR (widget), TRUE); - gtk_info_bar_set_message_type (GTK_INFO_BAR (widget), GTK_MESSAGE_INFO); - gtk_info_bar_add_child (GTK_INFO_BAR (widget), gtk_label_new ("Info Bar")); - - gtk_widget_set_halign (widget, GTK_ALIGN_FILL); - gtk_widget_set_valign (widget, GTK_ALIGN_CENTER); - - add_margin (widget); - - info = new_widget_info ("info-bar", widget, SMALL); - - return info; -} - -static WidgetInfo * -create_search_bar (void) -{ - GtkWidget *widget; - GtkWidget *entry; - WidgetInfo *info; - GtkWidget *view; - GtkWidget *box; - - box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0); - widget = gtk_search_bar_new (); - - entry = gtk_search_entry_new (); - gtk_editable_set_text (GTK_EDITABLE (entry), "Search Bar"); - gtk_search_bar_set_child (GTK_SEARCH_BAR (widget), entry); - - gtk_search_bar_set_show_close_button (GTK_SEARCH_BAR (widget), TRUE); - gtk_search_bar_set_search_mode (GTK_SEARCH_BAR (widget), TRUE); - - gtk_box_append (GTK_BOX (box), widget); - - view = gtk_text_view_new (); - gtk_box_append (GTK_BOX (box), view); - - info = new_widget_info ("search-bar", box, SMALL); - - return info; -} - -static WidgetInfo * -create_action_bar (void) -{ - GtkWidget *widget; - GtkWidget *button; - WidgetInfo *info; - GtkWidget *view; - GtkWidget *box; - - box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0); - view = gtk_text_view_new (); - gtk_text_view_set_cursor_visible (GTK_TEXT_VIEW (view), FALSE); - gtk_box_append (GTK_BOX (box), view); - - widget = gtk_action_bar_new (); - - button = gtk_button_new_from_icon_name ("object-select-symbolic"); - gtk_action_bar_pack_start (GTK_ACTION_BAR (widget), button); - button = gtk_button_new_from_icon_name ("call-start-symbolic"); - gtk_action_bar_pack_start (GTK_ACTION_BAR (widget), button); - g_object_set (gtk_widget_get_parent (button), - "margin-start", 6, - "margin-end", 6, - "margin-top", 6, - "margin-bottom", 6, - "spacing", 6, - NULL); - - gtk_box_append (GTK_BOX (box), widget); - - info = new_widget_info ("action-bar", box, SMALL); - - return info; -} - -static WidgetInfo * -create_text_view (void) -{ - GtkWidget *widget; - GtkWidget *text_view; - - widget = gtk_frame_new (NULL); - text_view = gtk_text_view_new (); - gtk_frame_set_child (GTK_FRAME (widget), text_view); - gtk_text_buffer_set_text (gtk_text_view_get_buffer (GTK_TEXT_VIEW (text_view)), - "Multiline\nText\n\n", -1); - gtk_text_view_set_cursor_visible (GTK_TEXT_VIEW (text_view), FALSE); - gtk_widget_set_size_request (text_view, 100, -1); - - add_margin (widget); - - return new_widget_info ("multiline-text", widget, MEDIUM); -} - -static WidgetInfo * -create_tree_view (void) -{ - GtkWidget *widget; - GtkWidget *tree_view; - GtkTreeStore *store; - GtkTreeIter iter; - WidgetInfo *info; - - widget = gtk_frame_new (NULL); - store = gtk_tree_store_new (3, G_TYPE_STRING, G_TYPE_BOOLEAN, G_TYPE_STRING); - gtk_tree_store_append (store, &iter, NULL); - gtk_tree_store_set (store, &iter, 0, "Line One", 1, FALSE, 2, "A", -1); - gtk_tree_store_append (store, &iter, NULL); - gtk_tree_store_set (store, &iter, 0, "Line Two", 1, TRUE, 2, "B", -1); - gtk_tree_store_append (store, &iter, &iter); - gtk_tree_store_set (store, &iter, 0, "Line Three", 1, FALSE, 2, "C", -1); - - tree_view = gtk_tree_view_new_with_model (GTK_TREE_MODEL (store)); - gtk_tree_view_set_enable_tree_lines (GTK_TREE_VIEW (tree_view), TRUE); - gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW (tree_view), - 0, "List", - gtk_cell_renderer_text_new (), - "text", 0, NULL); - gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW (tree_view), - 1, "and", - gtk_cell_renderer_toggle_new (), - "active", 1, NULL); - gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW (tree_view), - 2, "Tree", - g_object_new (GTK_TYPE_CELL_RENDERER_TEXT, "xalign", 0.5, NULL), - "text", 2, NULL); - gtk_tree_view_expand_all (GTK_TREE_VIEW (tree_view)); - gtk_frame_set_child (GTK_FRAME (widget), tree_view); - - info = new_widget_info ("list-and-tree", widget, MEDIUM); - info->no_focus = FALSE; - - return info; -} - -static WidgetInfo * -create_icon_view (void) -{ - GtkWidget *widget; - GtkWidget *vbox; - GtkWidget *icon_view; - GtkListStore *list_store; - GtkTreeIter iter; - GdkPixbuf *pixbuf; - WidgetInfo *info; - GtkWidget *sw; - - widget = gtk_frame_new (NULL); - list_store = gtk_list_store_new (2, G_TYPE_STRING, GDK_TYPE_PIXBUF); - gtk_list_store_append (list_store, &iter); - pixbuf = gdk_pixbuf_new_from_file ("folder.png", NULL); - gtk_list_store_set (list_store, &iter, 0, "One", 1, pixbuf, -1); - gtk_list_store_append (list_store, &iter); - pixbuf = gdk_pixbuf_new_from_file ("gnome.png", NULL); - gtk_list_store_set (list_store, &iter, 0, "Two", 1, pixbuf, -1); - - icon_view = gtk_icon_view_new (); - - gtk_icon_view_set_item_orientation (GTK_ICON_VIEW (icon_view), GTK_ORIENTATION_HORIZONTAL); - gtk_icon_view_set_row_spacing (GTK_ICON_VIEW (icon_view), 0); - - gtk_icon_view_set_model (GTK_ICON_VIEW (icon_view), GTK_TREE_MODEL (list_store)); - gtk_icon_view_set_text_column (GTK_ICON_VIEW (icon_view), 0); - gtk_icon_view_set_pixbuf_column (GTK_ICON_VIEW (icon_view), 1); - - sw = gtk_scrolled_window_new (); - gtk_scrolled_window_set_child (GTK_SCROLLED_WINDOW (sw), icon_view); - - gtk_frame_set_child (GTK_FRAME (widget), sw); - - gtk_widget_set_size_request (widget, 96, 128); - - vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 3); - gtk_box_append (GTK_BOX (vbox), widget); - gtk_box_append (GTK_BOX (vbox), gtk_label_new ("Icon View")); - - add_margin (vbox); - - info = new_widget_info ("icon-view", vbox, MEDIUM); - info->no_focus = FALSE; - - return info; -} - -static WidgetInfo * -create_color_button (void) -{ - GtkWidget *vbox; - GtkWidget *picker; - GdkRGBA color; - - vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 3); - color.red = 0x1e<<8; - color.green = 0x90<<8; - color.blue = 0xff<<8; - color.alpha = 0xffff; - picker = gtk_color_button_new_with_rgba (&color); - gtk_widget_set_halign (picker, GTK_ALIGN_CENTER); - gtk_widget_set_valign (picker, GTK_ALIGN_CENTER); - gtk_box_append (GTK_BOX (vbox), picker); - gtk_box_append (GTK_BOX (vbox), gtk_label_new ("Color Button")); - - add_margin (vbox); - - return new_widget_info ("color-button", vbox, SMALL); -} - -static WidgetInfo * -create_font_button (void) -{ - GtkWidget *vbox; - GtkWidget *picker; - - vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 3); - picker = gtk_font_button_new_with_font ("Sans Serif 10"); - gtk_widget_set_halign (picker, GTK_ALIGN_CENTER); - gtk_widget_set_valign (picker, GTK_ALIGN_CENTER); - gtk_box_append (GTK_BOX (vbox), picker); - gtk_box_append (GTK_BOX (vbox), gtk_label_new ("Font Button")); - - add_margin (vbox); - - return new_widget_info ("font-button", vbox, SMALL); -} - -static WidgetInfo * -create_editable_label (void) -{ - GtkWidget *vbox; - GtkWidget *widget; - - vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 12); - widget = gtk_editable_label_new ("Editable Label"); - gtk_box_append (GTK_BOX (vbox), widget); - gtk_box_append (GTK_BOX (vbox), gtk_separator_new (GTK_ORIENTATION_HORIZONTAL)); - widget = gtk_editable_label_new ("Editable Label"); - gtk_editable_label_start_editing (GTK_EDITABLE_LABEL (widget)); - gtk_widget_add_css_class (widget, "frame"); - gtk_box_append (GTK_BOX (vbox), widget); - - gtk_widget_set_valign (vbox, GTK_ALIGN_CENTER); - - add_margin (vbox); - - return new_widget_info ("editable-label", vbox, SMALL); -} - -static WidgetInfo * -create_separator (void) -{ - GtkWidget *hbox; - GtkWidget *vbox; - GtkWidget *widget; - - vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 3); - hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 10); - gtk_widget_set_halign (hbox, GTK_ALIGN_CENTER); - widget = gtk_separator_new (GTK_ORIENTATION_HORIZONTAL); - gtk_widget_set_size_request (widget, 100, -1); - gtk_widget_set_valign (widget, GTK_ALIGN_CENTER); - gtk_box_append (GTK_BOX (hbox), widget); - widget = gtk_separator_new (GTK_ORIENTATION_VERTICAL); - gtk_widget_set_size_request (widget, -1, 100); - gtk_box_append (GTK_BOX (hbox), widget); - gtk_box_append (GTK_BOX (vbox), hbox); - gtk_box_append (GTK_BOX (vbox), g_object_new (GTK_TYPE_LABEL, - "label", "Horizontal and Vertical\nSeparators", - "justify", GTK_JUSTIFY_CENTER, - NULL)); - add_margin (vbox); - - return new_widget_info ("separator", vbox, MEDIUM); -} - -static WidgetInfo * -create_panes (void) -{ - GtkWidget *hbox; - GtkWidget *vbox; - GtkWidget *pane; - GtkWidget *frame; - - vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 3); - hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 12); - gtk_box_set_homogeneous (GTK_BOX (hbox), TRUE); - pane = gtk_paned_new (GTK_ORIENTATION_HORIZONTAL); - - frame = gtk_frame_new (""); - gtk_paned_set_start_child (GTK_PANED (pane), frame); - gtk_paned_set_resize_start_child (GTK_PANED (pane), FALSE); - gtk_paned_set_shrink_start_child (GTK_PANED (pane), FALSE); - - frame = gtk_frame_new (""); - gtk_paned_set_end_child (GTK_PANED (pane), frame); - gtk_paned_set_resize_end_child (GTK_PANED (pane), FALSE); - gtk_paned_set_shrink_end_child (GTK_PANED (pane), FALSE); - - gtk_widget_set_size_request (pane, 96, 96); - - gtk_box_append (GTK_BOX (hbox), pane); - pane = gtk_paned_new (GTK_ORIENTATION_VERTICAL); - - frame = gtk_frame_new (""); - gtk_paned_set_start_child (GTK_PANED (pane), frame); - gtk_paned_set_resize_start_child (GTK_PANED (pane), FALSE); - gtk_paned_set_shrink_start_child (GTK_PANED (pane), FALSE); - - frame = gtk_frame_new (""); - gtk_paned_set_end_child (GTK_PANED (pane), frame); - gtk_paned_set_resize_end_child (GTK_PANED (pane), FALSE); - gtk_paned_set_shrink_end_child (GTK_PANED (pane), FALSE); - - gtk_widget_set_size_request (pane, 96, 96); - - gtk_box_append (GTK_BOX (hbox), pane); - - gtk_box_append (GTK_BOX (vbox), hbox); - gtk_box_append (GTK_BOX (vbox), g_object_new (GTK_TYPE_LABEL, - "label", "Horizontal and Vertical\nPanes", - "justify", GTK_JUSTIFY_CENTER, - NULL)); - - add_margin (vbox); - - return new_widget_info ("panes", vbox, MEDIUM); -} - -static WidgetInfo * -create_frame (void) -{ - GtkWidget *widget; - - widget = gtk_frame_new ("Frame"); - gtk_widget_set_size_request (widget, 96, 96); - - add_margin (widget); - - return new_widget_info ("frame", widget, MEDIUM); -} - -static WidgetInfo * -create_window (void) -{ - WidgetInfo *info; - GtkWidget *widget; - - widget = gtk_window_new (); - info = new_widget_info ("window", widget, MEDIUM); - info->include_decorations = TRUE; - gtk_window_set_title (GTK_WINDOW (info->window), "Window"); - - return info; -} - -static WidgetInfo * -create_filesel (void) -{ - WidgetInfo *info; - GtkWidget *widget; - - widget = gtk_file_chooser_dialog_new ("File Chooser Dialog", - NULL, - GTK_FILE_CHOOSER_ACTION_OPEN, - "Cancel", GTK_RESPONSE_CANCEL, - "Open", GTK_RESPONSE_ACCEPT, - NULL); - gtk_window_set_default_size (GTK_WINDOW (widget), 505, 305); - - info = new_widget_info ("filechooser", widget, ASIS); - info->include_decorations = TRUE; - - return info; -} - -static WidgetInfo * -create_print_dialog (void) -{ - WidgetInfo *info; - GtkWidget *widget; - - widget = gtk_print_unix_dialog_new ("Print Dialog", NULL); - gtk_widget_set_size_request (widget, 505, 350); - info = new_widget_info ("printdialog", widget, ASIS); - info->include_decorations = TRUE; - - return info; -} - -static WidgetInfo * -create_page_setup_dialog (void) -{ - WidgetInfo *info; - GtkWidget *widget; - GtkPageSetup *page_setup; - GtkPrintSettings *settings; - - page_setup = gtk_page_setup_new (); - settings = gtk_print_settings_new (); - widget = gtk_page_setup_unix_dialog_new ("Page Setup Dialog", NULL); - gtk_page_setup_unix_dialog_set_page_setup (GTK_PAGE_SETUP_UNIX_DIALOG (widget), - page_setup); - gtk_page_setup_unix_dialog_set_print_settings (GTK_PAGE_SETUP_UNIX_DIALOG (widget), - settings); - - info = new_widget_info ("pagesetupdialog", widget, ASIS); - info->include_decorations = TRUE; - - return info; -} - -static WidgetInfo * -create_message_dialog (void) -{ - GtkWidget *widget; - - widget = gtk_message_dialog_new (NULL, - 0, - GTK_MESSAGE_INFO, - GTK_BUTTONS_OK, - NULL); - gtk_window_set_icon_name (GTK_WINDOW (widget), "edit-copy"); - gtk_message_dialog_set_markup (GTK_MESSAGE_DIALOG (widget), "Message Dialog"); - gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (widget), "%s", "With secondary text"); - return new_widget_info ("messagedialog", widget, ASIS); -} - -static WidgetInfo * -create_dialog (void) -{ - GtkWidget *widget; - GtkWidget *content; - GtkWidget *label; - - widget = g_object_new (GTK_TYPE_DIALOG, "use-header-bar", TRUE, NULL); - gtk_window_set_title (GTK_WINDOW (widget), "Dialog"); - - gtk_dialog_add_button (GTK_DIALOG (widget), "Accept", GTK_RESPONSE_OK); - gtk_dialog_add_button (GTK_DIALOG (widget), "Cancel", GTK_RESPONSE_CANCEL); - - gtk_dialog_set_default_response (GTK_DIALOG (widget), GTK_RESPONSE_OK); - - content = gtk_dialog_get_content_area (GTK_DIALOG (widget)); - label = gtk_label_new ("Content"); - g_object_set (label, - "margin-start", 20, - "margin-end", 20, - "margin-top", 20, - "margin-bottom", 20, - NULL); - gtk_widget_set_hexpand (label, TRUE); - gtk_widget_set_halign (label, GTK_ALIGN_CENTER); - gtk_box_append (GTK_BOX (content), label); - - return new_widget_info ("dialog", widget, ASIS); -} - -static WidgetInfo * -create_about_dialog (void) -{ - GtkWidget *widget; - const char *authors[] = { - "Peter Mattis", - "Spencer Kimball", - "Josh MacDonald", - "and many more...", - NULL - }; - GFile *file; - GdkTexture *logo; - - file = g_file_new_for_path ("docs/tools/gtk-logo.png"); - logo = gdk_texture_new_from_file (file, NULL); - - widget = gtk_about_dialog_new (); - g_object_set (widget, - "program-name", "GTK Code Demos", - "version", PACKAGE_VERSION, - "copyright", "© 1997-2021 The GTK Team", - "website", "http://www.gtk.org", - "comments", "Program to demonstrate GTK functions.", - "logo", logo, - "title", "About GTK Code Demos", - "authors", authors, - NULL); - - g_object_unref (logo); - g_object_unref (file); - - return new_widget_info ("aboutdialog", widget, ASIS); -} - -static WidgetInfo * -create_notebook (void) -{ - GtkWidget *widget; - - widget = gtk_notebook_new (); - - gtk_notebook_append_page (GTK_NOTEBOOK (widget), - gtk_label_new ("Notebook"), - NULL); - gtk_notebook_append_page (GTK_NOTEBOOK (widget), - gtk_label_new ("Notebook"), - NULL); - gtk_notebook_append_page (GTK_NOTEBOOK (widget), - gtk_label_new ("Notebook"), - NULL); - - return new_widget_info ("notebook", widget, MEDIUM); -} - -static WidgetInfo * -create_progressbar (void) -{ - GtkWidget *vbox; - GtkWidget *widget; - - widget = gtk_progress_bar_new (); - gtk_progress_bar_set_fraction (GTK_PROGRESS_BAR (widget), 0.5); - - vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 3); - gtk_widget_set_halign (widget, GTK_ALIGN_FILL); - gtk_widget_set_valign (widget, GTK_ALIGN_CENTER); - gtk_box_append (GTK_BOX (vbox), widget); - gtk_box_append (GTK_BOX (vbox), gtk_label_new ("Progress Bar")); - - add_margin (vbox); - - return new_widget_info ("progressbar", vbox, SMALL); -} - -static WidgetInfo * -create_level_bar (void) -{ - GtkWidget *vbox; - GtkWidget *widget; - - widget = gtk_level_bar_new (); - gtk_level_bar_set_value (GTK_LEVEL_BAR (widget), 0.333); - - vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 3); - gtk_box_append (GTK_BOX (vbox), widget); - gtk_box_append (GTK_BOX (vbox), gtk_label_new ("Level Bar")); - - add_margin (vbox); - - return new_widget_info ("levelbar", vbox, SMALL); -} - -static WidgetInfo * -create_scrolledwindow (void) -{ - GtkWidget *scrolledwin, *label; - - scrolledwin = gtk_scrolled_window_new (); - gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolledwin), - GTK_POLICY_NEVER, GTK_POLICY_ALWAYS); - gtk_scrolled_window_set_overlay_scrolling (GTK_SCROLLED_WINDOW (scrolledwin), FALSE); - label = gtk_label_new ("Scrolled Window"); - - gtk_scrolled_window_set_child (GTK_SCROLLED_WINDOW (scrolledwin), label); - - return new_widget_info ("scrolledwindow", scrolledwin, MEDIUM); -} - -static WidgetInfo * -create_scrollbar (void) -{ - GtkWidget *widget; - GtkWidget *vbox; - - widget = gtk_scrollbar_new (GTK_ORIENTATION_HORIZONTAL, NULL); - gtk_widget_set_size_request (widget, 100, -1); - - vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 3); - gtk_widget_set_halign (widget, GTK_ALIGN_FILL); - gtk_widget_set_valign (widget, GTK_ALIGN_CENTER); - gtk_box_append (GTK_BOX (vbox), widget); - gtk_box_append (GTK_BOX (vbox), gtk_label_new ("Scrollbar")); - - add_margin (vbox); - - return new_widget_info ("scrollbar", vbox, SMALL); -} - -static WidgetInfo * -create_spinbutton (void) -{ - GtkWidget *widget; - GtkWidget *vbox; - - widget = gtk_spin_button_new_with_range (0.0, 100.0, 1.0); - - vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 3); - gtk_widget_set_halign (widget, GTK_ALIGN_FILL); - gtk_widget_set_valign (widget, GTK_ALIGN_CENTER); - gtk_box_append (GTK_BOX (vbox), widget); - gtk_box_append (GTK_BOX (vbox), gtk_label_new ("Spin Button")); - - add_margin (vbox); - - return new_widget_info ("spinbutton", vbox, SMALL); -} - -static WidgetInfo * -create_statusbar (void) -{ - WidgetInfo *info; - GtkWidget *widget; - GtkWidget *vbox; - - vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0); - gtk_box_append (GTK_BOX (vbox), - gtk_label_new ("Status Bar")); - widget = gtk_statusbar_new (); - gtk_widget_set_halign (widget, GTK_ALIGN_FILL); - gtk_statusbar_push (GTK_STATUSBAR (widget), 0, "Hold on..."); - - gtk_box_append (GTK_BOX (vbox), widget); - - add_margin (vbox); - - info = new_widget_info ("statusbar", vbox, SMALL); - - return info; -} - -static WidgetInfo * -create_scales (void) -{ - GtkWidget *hbox; - GtkWidget *vbox; - GtkWidget *widget; - - vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 3); - hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0); - gtk_box_set_homogeneous (GTK_BOX (hbox), TRUE); - widget = gtk_scale_new_with_range (GTK_ORIENTATION_HORIZONTAL, 0.0, 100.0, 1.0); - gtk_scale_set_draw_value (GTK_SCALE (widget), FALSE); - gtk_range_set_value (GTK_RANGE (widget), 50.); - gtk_widget_set_size_request (widget, 100, -1); - gtk_box_append (GTK_BOX (hbox), widget); - widget = gtk_scale_new_with_range (GTK_ORIENTATION_VERTICAL, 0.0, 100.0, 1.0); - gtk_scale_set_draw_value (GTK_SCALE (widget), FALSE); - gtk_widget_set_size_request (widget, -1, 100); - gtk_range_set_value (GTK_RANGE (widget), 50.); - gtk_box_append (GTK_BOX (hbox), widget); - gtk_box_append (GTK_BOX (vbox), hbox); - gtk_box_append (GTK_BOX (vbox), - g_object_new (GTK_TYPE_LABEL, - "label", "Horizontal and Vertical\nScales", - "justify", GTK_JUSTIFY_CENTER, - NULL)); - add_margin (vbox); - - return new_widget_info ("scales", vbox, MEDIUM);} - -static WidgetInfo * -create_image (void) -{ - GtkWidget *widget; - GtkWidget *vbox; - - widget = gtk_image_new_from_icon_name ("applications-graphics"); - gtk_image_set_icon_size (GTK_IMAGE (widget), GTK_ICON_SIZE_LARGE); - gtk_widget_set_halign (widget, GTK_ALIGN_CENTER); - gtk_widget_set_valign (widget, GTK_ALIGN_CENTER); - - vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 3); - gtk_box_append (GTK_BOX (vbox), widget); - gtk_box_append (GTK_BOX (vbox), gtk_label_new ("Image")); - - add_margin (vbox); - - return new_widget_info ("image", vbox, SMALL); -} - -static WidgetInfo * -create_picture (void) -{ - GtkWidget *widget; - GtkWidget *vbox; - GtkIconTheme *theme; - GdkPaintable *paintable; - GtkWidget *box; - - theme = gtk_icon_theme_get_for_display (gdk_display_get_default ()); - paintable = GDK_PAINTABLE (gtk_icon_theme_lookup_icon (theme, - "applications-graphics", - NULL, - 48, 1, GTK_TEXT_DIR_LTR, - 0)); - - widget = gtk_picture_new_for_paintable (paintable); - gtk_picture_set_can_shrink (GTK_PICTURE (widget), TRUE); - gtk_widget_set_halign (widget, GTK_ALIGN_CENTER); - gtk_widget_set_valign (widget, GTK_ALIGN_CENTER); - - box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0); - gtk_box_append (GTK_BOX (box), g_object_new (GTK_TYPE_IMAGE, "hexpand", TRUE, NULL)); - gtk_box_append (GTK_BOX (box), widget); - gtk_box_append (GTK_BOX (box), g_object_new (GTK_TYPE_IMAGE, "hexpand", TRUE, NULL)); - vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 3); - gtk_box_append (GTK_BOX (vbox), box); - gtk_box_append (GTK_BOX (vbox), gtk_label_new ("Picture")); - - add_margin (vbox); - - return new_widget_info ("picture", vbox, SMALL); -} - -static WidgetInfo * -create_video (void) -{ - GtkWidget *widget; - GtkWidget *vbox; - WidgetInfo *info; - - widget = gtk_video_new_for_filename ("demos/gtk-demo/gtk-logo.webm"); - gtk_video_set_autoplay (GTK_VIDEO (widget), TRUE); - - gtk_widget_set_halign (widget, GTK_ALIGN_FILL); - gtk_widget_set_valign (widget, GTK_ALIGN_FILL); - - vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 3); - gtk_box_append (GTK_BOX (vbox), widget); - gtk_box_append (GTK_BOX (vbox), gtk_label_new ("Video")); - - add_margin (vbox); - - info = new_widget_info ("video", vbox, MEDIUM); - info->wait = 2000; - - return info; -} - -static WidgetInfo * -create_media_controls (void) -{ - GtkWidget *widget; - GtkWidget *vbox; - GtkMediaStream *stream; - WidgetInfo *info; - - stream = gtk_media_file_new_for_filename ("demos/gtk-demo/gtk-logo.webm"); - gtk_media_stream_play (stream); - widget = gtk_media_controls_new (stream); - gtk_widget_set_size_request (widget, 210, -1); - gtk_widget_set_halign (widget, GTK_ALIGN_CENTER); - gtk_widget_set_valign (widget, GTK_ALIGN_CENTER); - - vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 3); - gtk_box_append (GTK_BOX (vbox), widget); - gtk_box_append (GTK_BOX (vbox), gtk_label_new ("Media Controls")); - - add_margin (vbox); - - info = new_widget_info ("media-controls", vbox, SMALL); - info->wait = 2000; - - return info; -} - -static WidgetInfo * -create_spinner (void) -{ - GtkWidget *widget; - GtkWidget *vbox; - - widget = gtk_spinner_new (); - gtk_widget_set_size_request (widget, 24, 24); - gtk_spinner_start (GTK_SPINNER (widget)); - - vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 3); - gtk_widget_set_halign (widget, GTK_ALIGN_CENTER); - gtk_widget_set_valign (widget, GTK_ALIGN_CENTER); - gtk_box_append (GTK_BOX (vbox), widget); - gtk_box_append (GTK_BOX (vbox), gtk_label_new ("Spinner")); - - add_margin (vbox); - - return new_widget_info ("spinner", vbox, SMALL); -} - -static WidgetInfo * -create_volume_button (void) -{ - GtkWidget *widget, *vbox; - - widget = gtk_volume_button_new (); - gtk_scale_button_set_value (GTK_SCALE_BUTTON (widget), 33); - - vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 3); - gtk_widget_set_halign (widget, GTK_ALIGN_CENTER); - gtk_widget_set_valign (widget, GTK_ALIGN_CENTER); - gtk_box_append (GTK_BOX (vbox), widget); - gtk_box_append (GTK_BOX (vbox), gtk_label_new ("Volume Button")); - - return new_widget_info ("volumebutton", vbox, SMALL); -} - -static WidgetInfo * -create_assistant (void) -{ - GtkWidget *widget; - GtkWidget *page1, *page2; - WidgetInfo *info; - - widget = gtk_assistant_new (); - gtk_window_set_title (GTK_WINDOW (widget), "Assistant"); - - page1 = gtk_label_new ("Assistant"); - gtk_widget_set_size_request (page1, 300, 140); - gtk_assistant_prepend_page (GTK_ASSISTANT (widget), page1); - gtk_assistant_set_page_title (GTK_ASSISTANT (widget), page1, "Assistant page"); - gtk_assistant_set_page_complete (GTK_ASSISTANT (widget), page1, TRUE); - - page2 = gtk_label_new (NULL); - gtk_assistant_append_page (GTK_ASSISTANT (widget), page2); - gtk_assistant_set_page_type (GTK_ASSISTANT (widget), page2, GTK_ASSISTANT_PAGE_CONFIRM); - - info = new_widget_info ("assistant", widget, ASIS); - info->include_decorations = TRUE; - - return info; -} - -static WidgetInfo * -create_appchooserbutton (void) -{ - GtkWidget *picker; - GtkWidget *vbox; - - vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 3); - picker = gtk_app_chooser_button_new ("text/plain"); - gtk_widget_set_halign (picker, GTK_ALIGN_CENTER); - gtk_widget_set_valign (picker, GTK_ALIGN_CENTER); - gtk_box_append (GTK_BOX (vbox), picker); - gtk_box_append (GTK_BOX (vbox), gtk_label_new ("Application Button")); - - add_margin (vbox); - - return new_widget_info ("appchooserbutton", vbox, SMALL); -} - -static WidgetInfo * -create_appchooserdialog (void) -{ - WidgetInfo *info; - GtkWidget *widget; - - widget = gtk_app_chooser_dialog_new_for_content_type (NULL, 0, "image/png"); - gtk_window_set_default_size (GTK_WINDOW (widget), 200, 300); - - info = new_widget_info ("appchooserdialog", widget, ASIS); - info->include_decorations = TRUE; - - return info; -} - -static WidgetInfo * -create_fontchooserdialog (void) -{ - WidgetInfo *info; - GtkWidget *widget; - - widget = gtk_font_chooser_dialog_new ("Font Chooser Dialog", NULL); - gtk_window_set_default_size (GTK_WINDOW (widget), 200, 300); - info = new_widget_info ("fontchooser", widget, ASIS); - info->include_decorations = TRUE; - - return info; -} - -static WidgetInfo * -create_colorchooserdialog (void) -{ - WidgetInfo *info; - GtkWidget *widget; - - widget = gtk_color_chooser_dialog_new ("Color Chooser Dialog", NULL); - info = new_widget_info ("colorchooser", widget, ASIS); - info->include_decorations = TRUE; - - return info; -} - -static WidgetInfo * -create_headerbar (void) -{ - GtkWidget *window; - GtkWidget *bar; - GtkWidget *view; - GtkWidget *button; - - window = gtk_window_new (); - gtk_window_set_title (GTK_WINDOW (window), "Header Bar"); - view = gtk_text_view_new (); - gtk_text_view_set_cursor_visible (GTK_TEXT_VIEW (view), FALSE); - gtk_widget_set_size_request (window, 220, 150); - gtk_window_set_child (GTK_WINDOW (window), view); - bar = gtk_header_bar_new (); - gtk_window_set_titlebar (GTK_WINDOW (window), bar); - button = gtk_button_new (); - gtk_button_set_child (GTK_BUTTON (button), gtk_image_new_from_icon_name ("bookmark-new-symbolic")); - gtk_header_bar_pack_end (GTK_HEADER_BAR (bar), button); - - return new_widget_info ("headerbar", window, ASIS); -} - -static WidgetInfo * -create_stack (void) -{ - GtkWidget *stack; - GtkWidget *switcher; - GtkWidget *vbox; - GtkWidget *view; - - stack = gtk_stack_new (); - gtk_widget_set_margin_top (stack, 10); - gtk_widget_set_margin_bottom (stack, 10); - gtk_widget_set_size_request (stack, 120, 120); - view = gtk_text_view_new (); - gtk_stack_add_titled (GTK_STACK (stack), view, "page1", "Page 1"); - view = gtk_text_view_new (); - gtk_stack_add_titled (GTK_STACK (stack), view, "page2", "Page 2"); - - switcher = gtk_stack_switcher_new (); - gtk_stack_switcher_set_stack (GTK_STACK_SWITCHER (switcher), GTK_STACK (stack)); - gtk_widget_set_halign (switcher, GTK_ALIGN_CENTER); - - vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0); - - gtk_box_append (GTK_BOX (vbox), switcher); - gtk_box_append (GTK_BOX (vbox), stack); - gtk_box_append (GTK_BOX (vbox), - gtk_label_new ("Stack")); - - return new_widget_info ("stack", vbox, ASIS); -} - -static WidgetInfo * -create_stack_switcher (void) -{ - GtkWidget *stack; - GtkWidget *switcher; - GtkWidget *vbox; - GtkWidget *view; - - stack = gtk_stack_new (); - gtk_widget_set_margin_top (stack, 10); - gtk_widget_set_margin_bottom (stack, 10); - gtk_widget_set_size_request (stack, 120, 120); - view = gtk_text_view_new (); - gtk_stack_add_titled (GTK_STACK (stack), view, "page1", "Page 1"); - view = gtk_text_view_new (); - gtk_stack_add_titled (GTK_STACK (stack), view, "page2", "Page 2"); - - switcher = gtk_stack_switcher_new (); - gtk_stack_switcher_set_stack (GTK_STACK_SWITCHER (switcher), GTK_STACK (stack)); - gtk_widget_set_halign (switcher, GTK_ALIGN_CENTER); - - vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0); - - gtk_box_append (GTK_BOX (vbox), switcher); - gtk_box_append (GTK_BOX (vbox), stack); - gtk_box_append (GTK_BOX (vbox), - gtk_label_new ("Stack Switcher")); - - return new_widget_info ("stackswitcher", vbox, ASIS); -} - -static WidgetInfo * -create_sidebar (void) -{ - GtkWidget *stack; - GtkWidget *sidebar; - GtkWidget *hbox; - GtkWidget *view; - GtkWidget *frame; - - stack = gtk_stack_new (); - gtk_widget_set_size_request (stack, 120, 120); - view = gtk_label_new ("Sidebar"); - gtk_widget_add_css_class (view, "view"); - gtk_widget_set_halign (view, GTK_ALIGN_FILL); - gtk_widget_set_valign (view, GTK_ALIGN_FILL); - gtk_widget_set_hexpand (view, TRUE); - gtk_stack_add_titled (GTK_STACK (stack), view, "page1", "Page 1"); - view = gtk_text_view_new (); - gtk_stack_add_titled (GTK_STACK (stack), view, "page2", "Page 2"); - - sidebar = gtk_stack_sidebar_new (); - gtk_stack_sidebar_set_stack (GTK_STACK_SIDEBAR (sidebar), GTK_STACK (stack)); - - frame = gtk_frame_new (NULL); - hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0); - - gtk_box_append (GTK_BOX (hbox), sidebar); - gtk_box_append (GTK_BOX (hbox), gtk_separator_new (GTK_ORIENTATION_VERTICAL)); - gtk_box_append (GTK_BOX (hbox), stack); - gtk_frame_set_child (GTK_FRAME (frame), hbox); - - return new_widget_info ("sidebar", frame, MEDIUM); -} - -static WidgetInfo * -create_list_box (void) -{ - GtkWidget *widget; - GtkWidget *list; - GtkWidget *row; - GtkWidget *button; - WidgetInfo *info; - - widget = gtk_frame_new (NULL); - - list = gtk_list_box_new (); - gtk_list_box_set_selection_mode (GTK_LIST_BOX (list), GTK_SELECTION_BROWSE); - row = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 10); - button = gtk_label_new ("List Box"); - gtk_widget_set_hexpand (button, TRUE); - gtk_widget_set_halign (button, GTK_ALIGN_CENTER); - gtk_box_append (GTK_BOX (row), button); - gtk_list_box_insert (GTK_LIST_BOX (list), row, -1); - row = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 10); - gtk_box_append (GTK_BOX (row), gtk_label_new ("Line One")); - button = gtk_check_button_new (); - gtk_check_button_set_active (GTK_CHECK_BUTTON (button), TRUE); - gtk_widget_set_hexpand (button, TRUE); - gtk_widget_set_halign (button, GTK_ALIGN_END); - gtk_box_append (GTK_BOX (row), button); - gtk_list_box_insert (GTK_LIST_BOX (list), row, -1); - gtk_list_box_select_row (GTK_LIST_BOX (list), GTK_LIST_BOX_ROW (gtk_widget_get_parent (row))); - row = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 10); - gtk_box_append (GTK_BOX (row), gtk_label_new ("Line Two")); - button = gtk_button_new_with_label ("2"); - gtk_widget_set_hexpand (button, TRUE); - gtk_widget_set_halign (button, GTK_ALIGN_END); - gtk_box_append (GTK_BOX (row), button); - gtk_list_box_insert (GTK_LIST_BOX (list), row, -1); - row = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 10); - gtk_box_append (GTK_BOX (row), gtk_label_new ("Line Three")); - button = gtk_entry_new (); - gtk_widget_set_hexpand (button, TRUE); - gtk_widget_set_halign (button, GTK_ALIGN_END); - gtk_box_append (GTK_BOX (row), button); - gtk_list_box_insert (GTK_LIST_BOX (list), row, -1); - - gtk_frame_set_child (GTK_FRAME (widget), list); - - info = new_widget_info ("list-box", widget, MEDIUM); - info->no_focus = FALSE; - - return info; -} - -static WidgetInfo * -create_flow_box (void) -{ - GtkWidget *widget; - GtkWidget *box; - GtkWidget *vbox; - GtkWidget *child; - GtkWidget *button; - WidgetInfo *info; - - widget = gtk_frame_new (NULL); - - box = gtk_flow_box_new (); - gtk_flow_box_set_min_children_per_line (GTK_FLOW_BOX (box), 2); - gtk_flow_box_set_max_children_per_line (GTK_FLOW_BOX (box), 2); - gtk_flow_box_set_selection_mode (GTK_FLOW_BOX (box), GTK_SELECTION_BROWSE); - button = gtk_label_new ("Child One"); - gtk_flow_box_insert (GTK_FLOW_BOX (box), button, -1); - button = gtk_button_new_with_label ("Child Two"); - gtk_flow_box_insert (GTK_FLOW_BOX (box), button, -1); - child = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6); - gtk_box_append (GTK_BOX (child), gtk_label_new ("Child Three")); - button = gtk_check_button_new (); - gtk_check_button_set_active (GTK_CHECK_BUTTON (button), TRUE); - gtk_box_append (GTK_BOX (child), button); - gtk_flow_box_insert (GTK_FLOW_BOX (box), child, -1); - gtk_flow_box_select_child (GTK_FLOW_BOX (box), - GTK_FLOW_BOX_CHILD (gtk_widget_get_parent (child))); - - gtk_frame_set_child (GTK_FRAME (widget), box); - - vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0); - - gtk_box_append (GTK_BOX (vbox), widget); - gtk_box_append (GTK_BOX (vbox), gtk_label_new ("Flow Box")); - info = new_widget_info ("flow-box", vbox, ASIS); - info->no_focus = FALSE; - - return info; -} - -static WidgetInfo * -create_gl_area (void) -{ - GtkWidget *vbox; - WidgetInfo *info; - GtkWidget *widget; - GtkWidget *gears; - GtkCssProvider *provider; - - widget = gtk_frame_new (NULL); - gears = gtk_gears_new (); - gtk_widget_add_css_class (gears, "velvet"); - gtk_widget_set_size_request (gears, 96, 96); - gtk_frame_set_child (GTK_FRAME (widget), gears); - - provider = gtk_css_provider_new (); - gtk_css_provider_load_from_data (provider, ".velvet { background: black; }", -1); - gtk_style_context_add_provider (gtk_widget_get_style_context (gears), GTK_STYLE_PROVIDER (provider), 800); - g_object_unref (provider); - - vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 3); - gtk_widget_set_halign (widget, GTK_ALIGN_FILL); - gtk_widget_set_valign (widget, GTK_ALIGN_FILL); - gtk_box_append (GTK_BOX (vbox), widget); - gtk_box_append (GTK_BOX (vbox), gtk_label_new ("GL Area")); - - add_margin (vbox); - - info = new_widget_info ("glarea", vbox, MEDIUM); - - return info; -} - -static WidgetInfo * -create_window_controls (void) -{ - GtkWidget *controls; - GtkWidget *vbox; - - controls = gtk_window_controls_new (GTK_PACK_END); - gtk_window_controls_set_decoration_layout (GTK_WINDOW_CONTROLS (controls), - ":minimize,maximize,close"); - vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 3); - gtk_widget_set_halign (controls, GTK_ALIGN_CENTER); - gtk_widget_set_valign (controls, GTK_ALIGN_CENTER); - gtk_box_append (GTK_BOX (vbox), controls); - gtk_box_append (GTK_BOX (vbox), gtk_label_new ("Window Controls")); - - add_margin (vbox); - - return new_widget_info ("windowcontrols", vbox, SMALL); -} - -static WidgetInfo * -create_calendar (void) -{ - GtkWidget *widget; - GtkWidget *vbox; - - widget = gtk_calendar_new (); - - vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 3); - gtk_widget_set_halign (widget, GTK_ALIGN_CENTER); - gtk_widget_set_valign (widget, GTK_ALIGN_CENTER); - gtk_box_append (GTK_BOX (vbox), widget); - gtk_box_append (GTK_BOX (vbox), gtk_label_new ("Calendar")); - - add_margin (vbox); - - return new_widget_info ("calendar", vbox, MEDIUM); -} - -static WidgetInfo * -create_emojichooser (void) -{ - GtkWidget *widget; - WidgetInfo *info; - - widget = gtk_emoji_chooser_new (); - g_object_set (widget, "autohide", FALSE, NULL); - - info = new_widget_info ("emojichooser", widget, ASIS); - info->wait = 2000; - - return info; -} - -static WidgetInfo * -create_expander (void) -{ - GtkWidget *widget; - - widget = gtk_expander_new ("Expander"); - gtk_expander_set_child (GTK_EXPANDER (widget), gtk_label_new ("Hidden Content")); - gtk_widget_set_halign (widget, GTK_ALIGN_CENTER); - gtk_widget_set_valign (widget, GTK_ALIGN_CENTER); - - return new_widget_info ("expander", widget, SMALL); -} - -static void -mapped_cb (GtkWidget *widget) -{ - gtk_widget_child_focus (widget, GTK_DIR_RIGHT); -} - -static WidgetInfo * -create_menu_bar (void) -{ - GtkWidget *widget; - GtkWidget *vbox; - GMenu *menu, *menu1; - GMenuItem *item; - - menu = g_menu_new (); - menu1 = g_menu_new (); - item = g_menu_item_new ("Item", "action"); - g_menu_append_item (menu1, item); - g_menu_append_submenu (menu, "File", G_MENU_MODEL (menu1)); - g_object_unref (item); - g_object_unref (menu1); - menu1 = g_menu_new (); - item = g_menu_item_new ("Item", "action"); - g_menu_append_item (menu1, item); - g_menu_append_submenu (menu, "Edit", G_MENU_MODEL (menu1)); - g_object_unref (item); - g_object_unref (menu1); - menu1 = g_menu_new (); - item = g_menu_item_new ("Item", "action"); - g_menu_append_item (menu1, item); - g_menu_append_submenu (menu, "View", G_MENU_MODEL (menu1)); - g_object_unref (item); - g_object_unref (menu1); - - widget = gtk_popover_menu_bar_new_from_model (G_MENU_MODEL (menu)); - - g_object_unref (menu); - - vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 6); - gtk_widget_set_halign (widget, GTK_ALIGN_CENTER); - gtk_widget_set_valign (widget, GTK_ALIGN_CENTER); - gtk_box_append (GTK_BOX (vbox), widget); - gtk_box_append (GTK_BOX (vbox), gtk_label_new ("Menu Bar")); - - add_margin (vbox); - - g_signal_connect (widget, "map", G_CALLBACK (mapped_cb), NULL); - - return new_widget_info ("menubar", vbox, SMALL); -} - -static WidgetInfo * -create_popover (void) -{ - GtkWidget *widget; - GtkWidget *child; - WidgetInfo *info; - - widget = gtk_popover_new (); - gtk_widget_set_size_request (widget, 180, 180); - gtk_widget_set_halign (widget, GTK_ALIGN_CENTER); - g_object_set (widget, "autohide", FALSE, NULL); - child = gtk_label_new ("Popover"); - gtk_widget_set_halign (child, GTK_ALIGN_CENTER); - gtk_widget_set_valign (child, GTK_ALIGN_CENTER); - gtk_popover_set_child (GTK_POPOVER (widget), child); - - info = new_widget_info ("popover", widget, ASIS); - info->wait = 100; - - return info; -} - -static WidgetInfo * -create_menu (void) -{ - GtkWidget *widget; - GMenu *menu, *menu1; - GMenuItem *item; - GSimpleActionGroup *group; - GSimpleAction *action; - GtkEventController *controller; - GtkShortcut *shortcut; - - menu = g_menu_new (); - menu1 = g_menu_new (); - item = g_menu_item_new ("Item", "action"); - g_menu_append_item (menu1, item); - g_menu_append_submenu (menu, "Style", G_MENU_MODEL (menu1)); - g_object_unref (item); - g_object_unref (menu1); - item = g_menu_item_new ("Transition", "menu.transition"); - g_menu_append_item (menu, item); - g_object_unref (item); - - menu1 = g_menu_new (); - item = g_menu_item_new ("Inspector", "menu.inspector"); - g_menu_append_item (menu1, item); - g_object_unref (item); - item = g_menu_item_new ("About", "menu.about"); - g_menu_append_item (menu1, item); - g_object_unref (item); - g_menu_append_section (menu, NULL, G_MENU_MODEL (menu1)); - g_object_unref (menu1); - - widget = gtk_popover_menu_new_from_model (G_MENU_MODEL (menu)); - - g_object_unref (menu); - - group = g_simple_action_group_new (); - action = g_simple_action_new_stateful ("transition", NULL, g_variant_new_boolean (TRUE)); - g_action_map_add_action (G_ACTION_MAP (group), G_ACTION (action)); - g_object_unref (action); - action = g_simple_action_new ("inspector", NULL); - g_action_map_add_action (G_ACTION_MAP (group), G_ACTION (action)); - g_object_unref (action); - action = g_simple_action_new ("about", NULL); - g_action_map_add_action (G_ACTION_MAP (group), G_ACTION (action)); - g_object_unref (action); - - gtk_widget_insert_action_group (widget, "menu", G_ACTION_GROUP (group)); - - g_object_unref (group); - - g_object_set (widget, "autohide", FALSE, NULL); - - controller = gtk_shortcut_controller_new (); - shortcut = gtk_shortcut_new (gtk_keyval_trigger_new (GDK_KEY_F1, 0), - gtk_named_action_new ("menu.about")); - gtk_shortcut_controller_add_shortcut (GTK_SHORTCUT_CONTROLLER (controller), shortcut); - - gtk_widget_add_controller (widget, controller); - - return new_widget_info ("menu", widget, ASIS); -} - -static WidgetInfo * -create_shortcuts_window (void) -{ - GtkBuilder *builder; - GtkWidget *overlay; - - builder = gtk_builder_new_from_resource ("/shortcuts-boxes.ui"); - overlay = GTK_WIDGET (gtk_builder_get_object (builder, "shortcuts-boxes")); - g_object_set (overlay, "view-name", "display", NULL); - g_object_ref (overlay); - g_object_unref (builder); - - return new_widget_info ("shortcuts-window", overlay, ASIS); -} - -static void -oval_path (cairo_t *cr, - double xc, double yc, - double xr, double yr) -{ - cairo_save (cr); - - cairo_translate (cr, xc, yc); - cairo_scale (cr, 1.0, yr / xr); - cairo_move_to (cr, xr, 0.0); - cairo_arc (cr, - 0, 0, - xr, - 0, 2 * G_PI); - cairo_close_path (cr); - - cairo_restore (cr); -} - -static void -fill_checks (cairo_t *cr, - int x, int y, - int width, int height) -{ - int i, j; - -#define CHECK_SIZE 16 - - cairo_rectangle (cr, x, y, width, height); - cairo_set_source_rgb (cr, 0.4, 0.4, 0.4); - cairo_fill (cr); - - /* Only works for CHECK_SIZE a power of 2 */ - j = x & (-CHECK_SIZE); - - for (; j < height; j += CHECK_SIZE) - { - i = y & (-CHECK_SIZE); - for (; i < width; i += CHECK_SIZE) - if ((i / CHECK_SIZE + j / CHECK_SIZE) % 2 == 0) - cairo_rectangle (cr, i, j, CHECK_SIZE, CHECK_SIZE); - } - - cairo_set_source_rgb (cr, 0.7, 0.7, 0.7); - cairo_fill (cr); - -#undef CHECK_SIZE -} - -static void -draw_3circles (cairo_t *cr, - double xc, double yc, - double radius, - double alpha) -{ - double subradius = radius * (2 / 3. - 0.1); - - cairo_set_source_rgba (cr, 1., 0., 0., alpha); - oval_path (cr, - xc + radius / 3. * cos (G_PI * (0.5)), - yc - radius / 3. * sin (G_PI * (0.5)), - subradius, subradius); - cairo_fill (cr); - - cairo_set_source_rgba (cr, 0., 1., 0., alpha); - oval_path (cr, - xc + radius / 3. * cos (G_PI * (0.5 + 2/.3)), - yc - radius / 3. * sin (G_PI * (0.5 + 2/.3)), - subradius, subradius); - cairo_fill (cr); - - cairo_set_source_rgba (cr, 0., 0., 1., alpha); - oval_path (cr, - xc + radius / 3. * cos (G_PI * (0.5 + 4/.3)), - yc - radius / 3. * sin (G_PI * (0.5 + 4/.3)), - subradius, subradius); - cairo_fill (cr); -} - -static void -groups_draw (GtkDrawingArea *darea, - cairo_t *cr, - int width, - int height, - gpointer data) -{ - cairo_surface_t *overlay, *punch, *circles; - cairo_t *overlay_cr, *punch_cr, *circles_cr; - - /* Fill the background */ - double radius = 0.5 * (width < height ? width : height) - 10; - double xc = width / 2.; - double yc = height / 2.; - - overlay = cairo_surface_create_similar (cairo_get_target (cr), - CAIRO_CONTENT_COLOR_ALPHA, - width, height); - - punch = cairo_surface_create_similar (cairo_get_target (cr), - CAIRO_CONTENT_ALPHA, - width, height); - - circles = cairo_surface_create_similar (cairo_get_target (cr), - CAIRO_CONTENT_COLOR_ALPHA, - width, height); - - fill_checks (cr, 0, 0, width, height); - - /* Draw a black circle on the overlay - */ - overlay_cr = cairo_create (overlay); - cairo_set_source_rgb (overlay_cr, 0., 0., 0.); - oval_path (overlay_cr, xc, yc, radius, radius); - cairo_fill (overlay_cr); - - /* Draw 3 circles to the punch surface, then cut - * that out of the main circle in the overlay - */ - punch_cr = cairo_create (punch); - draw_3circles (punch_cr, xc, yc, radius, 1.0); - cairo_destroy (punch_cr); - - cairo_set_operator (overlay_cr, CAIRO_OPERATOR_DEST_OUT); - cairo_set_source_surface (overlay_cr, punch, 0, 0); - cairo_paint (overlay_cr); - - /* Now draw the 3 circles in a subgroup again - * at half intensity, and use OperatorAdd to join up - * without seams. - */ - circles_cr = cairo_create (circles); - - cairo_set_operator (circles_cr, CAIRO_OPERATOR_OVER); - draw_3circles (circles_cr, xc, yc, radius, 0.5); - cairo_destroy (circles_cr); - - cairo_set_operator (overlay_cr, CAIRO_OPERATOR_ADD); - cairo_set_source_surface (overlay_cr, circles, 0, 0); - cairo_paint (overlay_cr); - - cairo_destroy (overlay_cr); - - cairo_set_source_surface (cr, overlay, 0, 0); - cairo_paint (cr); - - cairo_surface_destroy (overlay); - cairo_surface_destroy (punch); - cairo_surface_destroy (circles); -} - - -static WidgetInfo * -create_drawing_area (void) -{ - GtkWidget *vbox; - WidgetInfo *info; - GtkWidget *widget; - GtkWidget *da; - - widget = gtk_frame_new (NULL); - da = gtk_drawing_area_new (); - gtk_widget_set_size_request (da, 96, 96); - gtk_drawing_area_set_draw_func (GTK_DRAWING_AREA (da), groups_draw, NULL, NULL); - gtk_frame_set_child (GTK_FRAME (widget), da); - - vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 6); - gtk_widget_set_halign (widget, GTK_ALIGN_FILL); - gtk_widget_set_valign (widget, GTK_ALIGN_FILL); - - gtk_box_append (GTK_BOX (vbox), widget); - gtk_box_append (GTK_BOX (vbox), gtk_label_new ("Drawing Area")); - - add_margin (vbox); - - info = new_widget_info ("drawingarea", vbox, MEDIUM); - - return info; -} - -static WidgetInfo * -create_box (void) -{ - GtkWidget *hbox; - GtkWidget *vbox; - GtkWidget *widget; - - vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 3); - hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 40); - gtk_widget_set_margin_top (hbox, 20); - gtk_widget_set_margin_bottom (hbox, 20); - gtk_widget_set_halign (hbox, GTK_ALIGN_CENTER); - widget = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 4); - for (int i = 0; i < 2; i++) - { - GtkWidget *button = gtk_button_new (); - gtk_widget_add_css_class (button, "small"); - gtk_widget_set_halign (button, GTK_ALIGN_CENTER); - gtk_widget_set_valign (button, GTK_ALIGN_CENTER); - gtk_box_append (GTK_BOX (widget), button); - } - gtk_box_append (GTK_BOX (widget), gtk_label_new ("⋯")); - gtk_widget_set_halign (widget, GTK_ALIGN_CENTER); - gtk_widget_set_valign (widget, GTK_ALIGN_CENTER); - gtk_box_append (GTK_BOX (hbox), widget); - widget = gtk_box_new (GTK_ORIENTATION_VERTICAL, 4); - for (int i = 0; i < 2; i++) - { - GtkWidget *button = gtk_button_new (); - gtk_widget_add_css_class (button, "small"); - gtk_widget_set_halign (button, GTK_ALIGN_CENTER); - gtk_widget_set_valign (button, GTK_ALIGN_CENTER); - gtk_box_append (GTK_BOX (widget), button); - } - gtk_box_append (GTK_BOX (widget), gtk_label_new ("⋮")); - gtk_widget_set_halign (widget, GTK_ALIGN_CENTER); - gtk_widget_set_valign (widget, GTK_ALIGN_CENTER); - gtk_box_append (GTK_BOX (hbox), widget); - gtk_box_append (GTK_BOX (vbox), hbox); - gtk_box_append (GTK_BOX (vbox), g_object_new (GTK_TYPE_LABEL, - "label", "Horizontal and Vertical Boxes", - "justify", GTK_JUSTIFY_CENTER, - NULL)); - add_margin (vbox); - - return new_widget_info ("box", vbox, MEDIUM); -} - -static WidgetInfo * -create_center_box (void) -{ - GtkWidget *vbox; - GtkWidget *widget; - GtkWidget *button; - - vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 3); - widget = gtk_center_box_new (); - gtk_widget_set_margin_top (widget, 10); - gtk_widget_set_margin_bottom (widget, 10); - gtk_widget_set_margin_start (widget, 20); - gtk_widget_set_margin_end (widget, 20); - gtk_widget_set_halign (widget, GTK_ALIGN_FILL); - gtk_widget_set_valign (widget, GTK_ALIGN_CENTER); - - button = gtk_button_new (); - gtk_widget_add_css_class (button, "small"); - gtk_widget_set_halign (button, GTK_ALIGN_CENTER); - gtk_widget_set_valign (button, GTK_ALIGN_CENTER); - gtk_center_box_set_start_widget (GTK_CENTER_BOX (widget), button); - - button = gtk_button_new (); - gtk_widget_add_css_class (button, "small"); - gtk_widget_set_halign (button, GTK_ALIGN_CENTER); - gtk_widget_set_valign (button, GTK_ALIGN_CENTER); - gtk_center_box_set_center_widget (GTK_CENTER_BOX (widget), button); - - button = gtk_button_new (); - gtk_widget_add_css_class (button, "small"); - gtk_widget_set_halign (button, GTK_ALIGN_CENTER); - gtk_widget_set_valign (button, GTK_ALIGN_CENTER); - gtk_center_box_set_end_widget (GTK_CENTER_BOX (widget), button); - - gtk_box_append (GTK_BOX (vbox), widget); - gtk_box_append (GTK_BOX (vbox), g_object_new (GTK_TYPE_LABEL, - "label", "Center Box", - "justify", GTK_JUSTIFY_CENTER, - NULL)); - add_margin (vbox); - - return new_widget_info ("centerbox", vbox, SMALL); -} - -static WidgetInfo * -create_grid (void) -{ - GtkWidget *vbox; - GtkWidget *widget; - GtkWidget *button; - - vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 3); - widget = gtk_grid_new (); - gtk_grid_set_row_spacing (GTK_GRID (widget), 4); - gtk_grid_set_column_spacing (GTK_GRID (widget), 4); - gtk_widget_set_margin_top (widget, 20); - gtk_widget_set_margin_bottom (widget, 20); - gtk_widget_set_margin_start (widget, 20); - gtk_widget_set_margin_end (widget, 20); - gtk_widget_set_halign (widget, GTK_ALIGN_CENTER); - gtk_widget_set_valign (widget, GTK_ALIGN_CENTER); - - button = gtk_button_new (); - gtk_widget_add_css_class (button, "small"); - gtk_widget_set_halign (button, GTK_ALIGN_CENTER); - gtk_widget_set_valign (button, GTK_ALIGN_CENTER); - gtk_grid_attach (GTK_GRID (widget), button, 0, 0, 1, 1); - - button = gtk_button_new (); - gtk_widget_add_css_class (button, "small"); - gtk_widget_set_halign (button, GTK_ALIGN_CENTER); - gtk_widget_set_valign (button, GTK_ALIGN_CENTER); - gtk_grid_attach (GTK_GRID (widget), button, 0, 1, 1, 1); - - button = gtk_button_new (); - gtk_widget_add_css_class (button, "small"); - gtk_widget_set_halign (button, GTK_ALIGN_CENTER); - gtk_widget_set_valign (button, GTK_ALIGN_CENTER); - gtk_grid_attach (GTK_GRID (widget), button, 1, 0, 1, 1); - - button = gtk_button_new (); - gtk_widget_add_css_class (button, "small"); - gtk_widget_set_halign (button, GTK_ALIGN_CENTER); - gtk_widget_set_valign (button, GTK_ALIGN_CENTER); - gtk_grid_attach (GTK_GRID (widget), button, 1, 1, 1, 1); - - gtk_grid_attach (GTK_GRID (widget), gtk_label_new ("⋯"), 2, 0, 1, 1); - gtk_grid_attach (GTK_GRID (widget), gtk_label_new ("⋮"), 0, 2, 1, 1); - - gtk_box_append (GTK_BOX (vbox), widget); - gtk_box_append (GTK_BOX (vbox), g_object_new (GTK_TYPE_LABEL, - "label", "Grid", - "justify", GTK_JUSTIFY_CENTER, - NULL)); - add_margin (vbox); - - return new_widget_info ("grid", vbox, MEDIUM); -} - -static WidgetInfo * -create_overlay (void) -{ - GtkWidget *vbox; - WidgetInfo *info; - GtkWidget *widget; - GtkWidget *overlay; - GtkWidget *label; - GtkWidget *child; - - widget = gtk_frame_new (NULL); - overlay = gtk_overlay_new (); - gtk_widget_add_css_class (widget, "view"); - label = gtk_label_new ("Content"); - gtk_widget_set_vexpand (label, TRUE); - gtk_frame_set_child (GTK_FRAME (widget), overlay); - gtk_overlay_set_child (GTK_OVERLAY (overlay), label); - - child = gtk_frame_new (NULL); - gtk_widget_add_css_class (child, "app-notification"); - gtk_frame_set_child (GTK_FRAME (child), gtk_label_new ("Overlay")); - gtk_widget_set_valign (child, GTK_ALIGN_START); - gtk_widget_set_halign (child, GTK_ALIGN_CENTER); - gtk_overlay_add_overlay (GTK_OVERLAY (overlay), child); - - vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 6); - gtk_widget_set_halign (widget, GTK_ALIGN_FILL); - gtk_widget_set_valign (widget, GTK_ALIGN_FILL); - - gtk_box_append (GTK_BOX (vbox), widget); - gtk_box_append (GTK_BOX (vbox), gtk_label_new ("Overlay")); - - add_margin (vbox); - - info = new_widget_info ("overlay", vbox, MEDIUM); - - return info; -} - -GList * -get_all_widgets (void) -{ - GList *retval = NULL; - GtkCssProvider *provider; - - provider = gtk_css_provider_new (); - gtk_css_provider_load_from_data (provider, - "button.small {\n" - " min-width: 16px;\n" - " min-height: 16px;\n" - " padding: 0;\n" - "}", -1); - gtk_style_context_add_provider_for_display (gdk_display_get_default (), - GTK_STYLE_PROVIDER (provider), - 800); - - retval = g_list_prepend (retval, create_search_bar ()); - retval = g_list_prepend (retval, create_action_bar ()); - retval = g_list_prepend (retval, create_list_box()); - retval = g_list_prepend (retval, create_flow_box()); - retval = g_list_prepend (retval, create_headerbar ()); - retval = g_list_prepend (retval, create_stack ()); - retval = g_list_prepend (retval, create_stack_switcher ()); - retval = g_list_prepend (retval, create_spinner ()); - retval = g_list_prepend (retval, create_about_dialog ()); - retval = g_list_prepend (retval, create_button ()); - retval = g_list_prepend (retval, create_check_button ()); - retval = g_list_prepend (retval, create_radio_button ()); - retval = g_list_prepend (retval, create_color_button ()); - retval = g_list_prepend (retval, create_combo_box ()); - retval = g_list_prepend (retval, create_combo_box_entry ()); - retval = g_list_prepend (retval, create_combo_box_text ()); - retval = g_list_prepend (retval, create_dialog ()); - retval = g_list_prepend (retval, create_entry ()); - retval = g_list_prepend (retval, create_font_button ()); - retval = g_list_prepend (retval, create_frame ()); - retval = g_list_prepend (retval, create_icon_view ()); - retval = g_list_prepend (retval, create_image ()); - retval = g_list_prepend (retval, create_label ()); - retval = g_list_prepend (retval, create_link_button ()); - retval = g_list_prepend (retval, create_message_dialog ()); - retval = g_list_prepend (retval, create_notebook ()); - retval = g_list_prepend (retval, create_panes ()); - retval = g_list_prepend (retval, create_progressbar ()); - retval = g_list_prepend (retval, create_scales ()); - retval = g_list_prepend (retval, create_scrolledwindow ()); - retval = g_list_prepend (retval, create_scrollbar ()); - retval = g_list_prepend (retval, create_separator ()); - retval = g_list_prepend (retval, create_spinbutton ()); - retval = g_list_prepend (retval, create_statusbar ()); - retval = g_list_prepend (retval, create_text_view ()); - retval = g_list_prepend (retval, create_toggle_button ()); - retval = g_list_prepend (retval, create_tree_view ()); - retval = g_list_prepend (retval, create_window ()); - retval = g_list_prepend (retval, create_filesel ()); - retval = g_list_prepend (retval, create_assistant ()); - retval = g_list_prepend (retval, create_page_setup_dialog ()); - retval = g_list_prepend (retval, create_print_dialog ()); - retval = g_list_prepend (retval, create_volume_button ()); - retval = g_list_prepend (retval, create_switch ()); - retval = g_list_prepend (retval, create_appchooserbutton ()); - retval = g_list_prepend (retval, create_appchooserdialog ()); - retval = g_list_prepend (retval, create_lockbutton ()); - retval = g_list_prepend (retval, create_fontchooserdialog ()); - retval = g_list_prepend (retval, create_colorchooserdialog ()); - retval = g_list_prepend (retval, create_menu_button ()); - retval = g_list_prepend (retval, create_search_entry ()); - retval = g_list_prepend (retval, create_level_bar ()); - retval = g_list_prepend (retval, create_info_bar ()); - retval = g_list_prepend (retval, create_gl_area ()); - retval = g_list_prepend (retval, create_sidebar ()); - retval = g_list_prepend (retval, create_video ()); - retval = g_list_prepend (retval, create_media_controls ()); - retval = g_list_prepend (retval, create_picture ()); - retval = g_list_prepend (retval, create_password_entry ()); - retval = g_list_prepend (retval, create_editable_label ()); - retval = g_list_prepend (retval, create_drop_down ()); - retval = g_list_prepend (retval, create_window_controls ()); - retval = g_list_prepend (retval, create_calendar ()); - retval = g_list_prepend (retval, create_emojichooser ()); - retval = g_list_prepend (retval, create_expander ()); - retval = g_list_prepend (retval, create_menu_bar ()); - retval = g_list_prepend (retval, create_popover ()); - retval = g_list_prepend (retval, create_menu ()); - retval = g_list_prepend (retval, create_shortcuts_window ()); - retval = g_list_prepend (retval, create_drawing_area ()); - retval = g_list_prepend (retval, create_box ()); - retval = g_list_prepend (retval, create_center_box ()); - retval = g_list_prepend (retval, create_grid ()); - retval = g_list_prepend (retval, create_overlay ()); - - return retval; -} diff --git a/docs/tools/widgets.h b/docs/tools/widgets.h deleted file mode 100644 index 3ef1d61dce..0000000000 --- a/docs/tools/widgets.h +++ /dev/null @@ -1,29 +0,0 @@ -#ifndef __WIDGETS_H__ -#define __WIDGETS_H__ - -#include - - -typedef enum -{ - SMALL, - MEDIUM, - LARGE, - ASIS -} WidgetSize; - -typedef struct WidgetInfo -{ - GtkWidget *window; - char *name; - gboolean no_focus; - gboolean include_decorations; - gboolean snapshot_popover; - guint wait; - WidgetSize size; -} WidgetInfo; - -GList *get_all_widgets (void); - - -#endif /* __WIDGETS_H__ */ diff --git a/gtk/gtklistitemwidget.c b/gtk/gtklistitemwidget.c index 56f807cf70..959d56fb4d 100644 --- a/gtk/gtklistitemwidget.c +++ b/gtk/gtklistitemwidget.c @@ -485,20 +485,27 @@ gtk_list_item_widget_update (GtkListItemWidget *self, gboolean selected) { GtkListItemWidgetPrivate *priv = gtk_list_item_widget_get_instance_private (self); + gboolean was_selected; + + was_selected = priv->selected; if (priv->list_item) gtk_list_item_factory_update (priv->factory, self, position, item, selected); else gtk_list_item_widget_default_update (self, NULL, position, item, selected); - if (selected) - gtk_widget_set_state_flags (GTK_WIDGET (self), GTK_STATE_FLAG_SELECTED, FALSE); - else - gtk_widget_unset_state_flags (GTK_WIDGET (self), GTK_STATE_FLAG_SELECTED); + /* don't look at selected variable, it's not reentrancy safe */ + if (was_selected != priv->selected) + { + if (priv->selected) + gtk_widget_set_state_flags (GTK_WIDGET (self), GTK_STATE_FLAG_SELECTED, FALSE); + else + gtk_widget_unset_state_flags (GTK_WIDGET (self), GTK_STATE_FLAG_SELECTED); - gtk_accessible_update_state (GTK_ACCESSIBLE (self), - GTK_ACCESSIBLE_STATE_SELECTED, selected, - -1); + gtk_accessible_update_state (GTK_ACCESSIBLE (self), + GTK_ACCESSIBLE_STATE_SELECTED, priv->selected, + -1); + } } void @@ -559,7 +566,7 @@ gtk_list_item_widget_default_update (GtkListItemWidget *self, GtkListItemWidgetPrivate *priv = gtk_list_item_widget_get_instance_private (self); /* FIXME: It's kinda evil to notify external objects from here... */ - + if (g_set_object (&priv->item, item)) notify_item = TRUE; diff --git a/meson.build b/meson.build index 8076d3eb41..6c28a62683 100644 --- a/meson.build +++ b/meson.build @@ -894,7 +894,6 @@ endif subdir('po') subdir('po-properties') -subdir('docs/tools') subdir('docs/reference') if not meson.is_cross_build() 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,