forked from AuroraMiddleware/gtk
0092a08dfc
This adds a small demo of using OpenGL shaders, it renders a quad over the entire widget with a custom fragment shader. The coordinates and the uniform names are compatible with the ones on shadertoy.com (although some features, like texture inputs are missing currently). The default shader in the demo is https://www.shadertoy.com/view/wsjBD3 which is CC0, so it is redistributable by Gtk+ (most other shaders are CC-BY-NC-SA which isn't obviously compatible). I also added a set of buttons loading a few other CC0 shaders I found.
179 lines
4.5 KiB
Meson
179 lines
4.5 KiB
Meson
# These should be in the order you want them to appear in the
|
|
# demo app, which means alphabetized by demo title, not filename
|
|
demos = files([
|
|
'application_demo.c',
|
|
'assistant.c',
|
|
'builder.c',
|
|
'clipboard.c',
|
|
'combobox.c',
|
|
'constraints.c',
|
|
'constraints2.c',
|
|
'constraints3.c',
|
|
'css_accordion.c',
|
|
'css_basics.c',
|
|
'css_blendmodes.c',
|
|
'css_multiplebgs.c',
|
|
'css_pixbufs.c',
|
|
'css_shadows.c',
|
|
'cursors.c',
|
|
'dialog.c',
|
|
'drawingarea.c',
|
|
'dropdown.c',
|
|
'dnd.c',
|
|
'editable_cells.c',
|
|
'entry_completion.c',
|
|
'entry_undo.c',
|
|
'expander.c',
|
|
'filtermodel.c',
|
|
'fishbowl.c',
|
|
'fixed.c',
|
|
'fontrendering.c',
|
|
'gears.c',
|
|
'gestures.c',
|
|
'glarea.c',
|
|
'headerbar.c',
|
|
'hypertext.c',
|
|
'iconscroll.c',
|
|
'iconview.c',
|
|
'iconview_edit.c',
|
|
'images.c',
|
|
'infobar.c',
|
|
'layoutmanager.c',
|
|
'layoutmanager2.c',
|
|
'links.c',
|
|
'listbox.c',
|
|
'listbox2.c',
|
|
'flowbox.c',
|
|
'list_store.c',
|
|
'listview_applauncher.c',
|
|
'listview_clocks.c',
|
|
'listview_colors.c',
|
|
'listview_filebrowser.c',
|
|
'listview_minesweeper.c',
|
|
'listview_settings.c',
|
|
'listview_weather.c',
|
|
'listview_words.c',
|
|
'markup.c',
|
|
'overlay.c',
|
|
'overlay2.c',
|
|
'paint.c',
|
|
'paintable.c',
|
|
'paintable_animated.c',
|
|
'paintable_mediastream.c',
|
|
'panes.c',
|
|
'password_entry.c',
|
|
'peg_solitaire.c',
|
|
'pickers.c',
|
|
'printing.c',
|
|
'revealer.c',
|
|
'rotated_text.c',
|
|
'scale.c',
|
|
'search_entry.c',
|
|
'search_entry2.c',
|
|
'shadertoy.c',
|
|
'shortcuts.c',
|
|
'shortcut_triggers.c',
|
|
'sidebar.c',
|
|
'sizegroup.c',
|
|
'sliding_puzzle.c',
|
|
'spinbutton.c',
|
|
'spinner.c',
|
|
'stack.c',
|
|
'tabs.c',
|
|
'tagged_entry.c',
|
|
'textmask.c',
|
|
'textundo.c',
|
|
'textview.c',
|
|
'textscroll.c',
|
|
'themes.c',
|
|
'theming_style_classes.c',
|
|
'transparent.c',
|
|
'tree_store.c',
|
|
'video_player.c',
|
|
])
|
|
|
|
gtkdemo_deps = [ libgtk_dep, ]
|
|
|
|
extra_demo_sources = files(['main.c',
|
|
'fontify.c',
|
|
'gtkfishbowl.c',
|
|
'fontplane.c',
|
|
'gtkgears.c',
|
|
'gtkshadertoy.c',
|
|
'puzzlepiece.c',
|
|
'bluroverlay.c',
|
|
'demoimage.c',
|
|
'demotaggedentry.c',
|
|
'demochild.c',
|
|
'demolayout.c',
|
|
'demowidget.c',
|
|
'demo2layout.c',
|
|
'singular_value_decomposition.c',
|
|
'four_point_transform.c',
|
|
'demo2widget.c'])
|
|
|
|
if harfbuzz_dep.found() and pangoft_dep.found()
|
|
demos += files('font_features.c')
|
|
extra_demo_sources += files(['script-names.c', 'language-names.c'])
|
|
gtkdemo_deps += [ harfbuzz_dep, epoxy_dep ]
|
|
endif
|
|
|
|
if os_unix
|
|
demos += files('pagesetup.c')
|
|
endif
|
|
|
|
gtkdemo_args = [ '-DGDK_DISABLE_DEPRECATED', '-DGTK_DISABLE_DEPRECATED', ]
|
|
|
|
demos_h = custom_target('gtk4 demo header',
|
|
output: 'demos.h',
|
|
input: demos,
|
|
command: [ find_program('geninclude.py'), '@OUTPUT@', '@INPUT@' ])
|
|
|
|
gtkdemo_resources = gnome.compile_resources('gtkdemo_resources',
|
|
'demo.gresource.xml',
|
|
source_dir: '.')
|
|
|
|
demo_cflags = []
|
|
foreach flag: common_cflags
|
|
if flag not in ['-Werror=missing-prototypes', '-Werror=missing-declarations', '-fvisibility=hidden']
|
|
demo_cflags += flag
|
|
endif
|
|
endforeach
|
|
|
|
executable('gtk4-demo',
|
|
demos, demos_h, extra_demo_sources, gtkdemo_resources,
|
|
c_args: gtkdemo_args + demo_cflags,
|
|
dependencies: gtkdemo_deps,
|
|
include_directories: confinc,
|
|
gui_app: true,
|
|
link_args: extra_demo_ldflags,
|
|
install: true)
|
|
|
|
executable('gtk4-demo-application',
|
|
'application.c', gtkdemo_resources,
|
|
c_args: gtkdemo_args + common_cflags,
|
|
dependencies: gtkdemo_deps,
|
|
include_directories: confinc,
|
|
gui_app: true,
|
|
link_args: extra_demo_ldflags,
|
|
install: true)
|
|
|
|
# icons
|
|
icontheme_dir = join_paths(gtk_datadir, 'icons/hicolor')
|
|
|
|
foreach size: ['scalable', 'symbolic']
|
|
install_subdir('data/' + size,
|
|
install_dir: icontheme_dir
|
|
)
|
|
endforeach
|
|
|
|
# desktop file
|
|
install_data('org.gtk.Demo4.desktop', install_dir: gtk_applicationsdir)
|
|
|
|
# GSettings
|
|
install_data('org.gtk.Demo4.gschema.xml', install_dir: gtk_schemasdir)
|
|
gnome.compile_schemas()
|
|
|
|
# appdata
|
|
install_data('org.gtk.Demo4.appdata.xml', install_dir: gtk_appdatadir)
|