gtk2/docs/reference/gtk/images/meson.build
Matthias Clasen a3ac414465 Generate screenshots on the fly
This commit adds a new meson option -Dupdate_screenshots=true.
When it is enabled, and -Dgtk_doc=true is also used, then the
build will generate images to include in the API docs from
ui files in docs/reference/gtk/images.

Note: we still keep a copy of the images in git, in order to
allow building without a display connection. To update the
images in git, the generated images need to be copied back
from the builddir to the srcdir.
2022-05-06 22:59:22 -04:00

92 lines
2.0 KiB
Meson

# 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