Simplifies chooser widgets (e.g. GimpBrushSelect) by eliminating attributes (e.g. opacity) of chosen resource. See #8745, but this commit fixes that by first refactoring the code. Refactors GUI widgets (e.g. GimpBrushSelectButton and GimpBrushSelect etc.) Refactor by "Extract class" GimpResourceSelectButton from GimpBrushSelectButton etc. This moves common code into an inherited class (formerly called GimpSelectButton) but the subclasses still exist. The subclasses mainly just do drawing now. Refactor by "Extract module" GimpResourceSelect from GimpBrushSelect etc. Moves common code into one file, generic at runtime on type of GimpResource, that is, the new code dispatches on type i.e. switch statements. In the future, when core is changed some of that can be deleted. The files gimpbrushselect.[c,h] etc. are deleted. The module adapts the API from core to the API of callbacks to libgimp. Note that core is running the resource chooser (select) widgets remotely. Core is still calling back over the wire via PDB with more attributes than necessary. The new design gets the attributes from the resource themselves, instead of receiving them from core callback. The libgimp side adapts by discarding unneeded attributes. In the future, core (running choosers for plugins) can be simplified also. Fix gimp_prop_chooser_brush_new same as other resources. Finish changes, and clean style. Annotations
565 lines
13 KiB
Meson
565 lines
13 KiB
Meson
# Similarly to libgimpthumb/gimpthumb-enums.c, libgimp/gimpenums.c is
|
|
# not versionned so we don't use the mkenums_wrap.
|
|
# Moreover it is generated in 2 steps, first with common mkenums
|
|
# arguments, then concatenating with a "tail" file.
|
|
gimpenums_notail = custom_target('gimpenums.c.notail',
|
|
input : [ 'gimpenums.h', ],
|
|
output: [ 'gimpenums.c.notail', ],
|
|
command: [
|
|
gimp_mkenums,
|
|
'--fhead','#include "config.h"\n'
|
|
+ '#include <gio/gio.h>\n'
|
|
+ '#include <gegl.h>\n'
|
|
+ '#undef GIMP_DISABLE_DEPRECATED\n'
|
|
+ '#include "libgimpbase/gimpbase.h"\n'
|
|
+ '#include "libgimpbase/gimpbase-private.h"\n'
|
|
+ '#include "libgimpconfig/gimpconfigenums.h"\n'
|
|
+ '#include "gimpenums.h"\n',
|
|
'--fprod',
|
|
'/* enumerations from "@basename@" */',
|
|
'--vhead',
|
|
'GType\n'+
|
|
'@enum_name@_get_type (void)\n'+
|
|
'{\n'+
|
|
' static const G@Type@Value values[] =\n'+
|
|
' {',
|
|
'--vprod',
|
|
' { @VALUENAME@, "@VALUENAME@", "@valuenick@" },',
|
|
'--vtail',
|
|
' { 0, NULL, NULL }\n'+
|
|
' };\n',
|
|
'--dhead',
|
|
' static const Gimp@Type@Desc descs[] =\n'+
|
|
' {',
|
|
'--dprod',
|
|
' { @VALUENAME@, @valuedesc@, @valuehelp@ },'+
|
|
'@if (\'@valueabbrev@\' ne \'NULL\')@\n'+
|
|
' /* Translators: this is an abbreviated version of @valueudesc@.\n'+
|
|
' Keep it short. */\n'+
|
|
' { @VALUENAME@, @valueabbrev@, NULL },'+
|
|
'@endif@',
|
|
'--dtail',
|
|
libgimp_mkenums_dtails,
|
|
'@INPUT@',
|
|
],
|
|
capture: true,
|
|
)
|
|
|
|
gimpenums = custom_target('gimpenums.c',
|
|
input : [ gimpenums_notail, 'gimpenums.c.tail', ],
|
|
output: [ 'gimpenums.c', ],
|
|
command: [ 'cat', '@INPUT@' ],
|
|
capture: true,
|
|
)
|
|
|
|
gimpuimarshal = gnome.genmarshal('gimpuimarshal',
|
|
prefix: '_gimpui_marshal',
|
|
sources: 'gimpuimarshal.list',
|
|
install_header: false,
|
|
)
|
|
|
|
pdb_wrappers_sources = [
|
|
'gimp_pdb.c',
|
|
'gimpbrush_pdb.c',
|
|
'gimpbrushes_pdb.c',
|
|
'gimpbrushselect_pdb.c',
|
|
'gimpbuffer_pdb.c',
|
|
'gimpchannel_pdb.c',
|
|
'gimpcontext_pdb.c',
|
|
'gimpdebug_pdb.c',
|
|
'gimpdisplay_pdb.c',
|
|
'gimpdrawable_pdb.c',
|
|
'gimpdrawablecolor_pdb.c',
|
|
'gimpdrawableedit_pdb.c',
|
|
'gimpdynamics_pdb.c',
|
|
'gimpedit_pdb.c',
|
|
'gimpfile_pdb.c',
|
|
'gimpfloatingsel_pdb.c',
|
|
'gimpfont_pdb.c',
|
|
'gimpfonts_pdb.c',
|
|
'gimpfontselect_pdb.c',
|
|
'gimpgimprc_pdb.c',
|
|
'gimpgradient_pdb.c',
|
|
'gimpgradients_pdb.c',
|
|
'gimpgradientselect_pdb.c',
|
|
'gimphelp_pdb.c',
|
|
'gimpimage_pdb.c',
|
|
'gimpimagecolorprofile_pdb.c',
|
|
'gimpimageconvert_pdb.c',
|
|
'gimpimagegrid_pdb.c',
|
|
'gimpimageguides_pdb.c',
|
|
'gimpimagesamplepoints_pdb.c',
|
|
'gimpimageselect_pdb.c',
|
|
'gimpimagetransform_pdb.c',
|
|
'gimpimageundo_pdb.c',
|
|
'gimpitem_pdb.c',
|
|
'gimpitemtransform_pdb.c',
|
|
'gimplayer_pdb.c',
|
|
'gimpmessage_pdb.c',
|
|
'gimppainttools_pdb.c',
|
|
'gimppalette_pdb.c',
|
|
'gimppalettes_pdb.c',
|
|
'gimppaletteselect_pdb.c',
|
|
'gimppattern_pdb.c',
|
|
'gimppatterns_pdb.c',
|
|
'gimppatternselect_pdb.c',
|
|
'gimpprogress_pdb.c',
|
|
'gimpselection_pdb.c',
|
|
'gimptextlayer_pdb.c',
|
|
'gimptexttool_pdb.c',
|
|
'gimpvectors_pdb.c',
|
|
]
|
|
|
|
pdb_wrappers_headers = [
|
|
'gimp_pdb_headers.h',
|
|
'gimp_pdb.h',
|
|
'gimpbrush_pdb.h',
|
|
'gimpbrushes_pdb.h',
|
|
'gimpbrushselect_pdb.h',
|
|
'gimpbuffer_pdb.h',
|
|
'gimpchannel_pdb.h',
|
|
'gimpcontext_pdb.h',
|
|
'gimpdebug_pdb.h',
|
|
'gimpdisplay_pdb.h',
|
|
'gimpdrawable_pdb.h',
|
|
'gimpdrawablecolor_pdb.h',
|
|
'gimpdrawableedit_pdb.h',
|
|
'gimpdynamics_pdb.h',
|
|
'gimpedit_pdb.h',
|
|
'gimpfile_pdb.h',
|
|
'gimpfloatingsel_pdb.h',
|
|
'gimpfont_pdb.h',
|
|
'gimpfonts_pdb.h',
|
|
'gimpfontselect_pdb.h',
|
|
'gimpgimprc_pdb.h',
|
|
'gimpgradient_pdb.h',
|
|
'gimpgradients_pdb.h',
|
|
'gimpgradientselect_pdb.h',
|
|
'gimphelp_pdb.h',
|
|
'gimpimage_pdb.h',
|
|
'gimpimagecolorprofile_pdb.h',
|
|
'gimpimageconvert_pdb.h',
|
|
'gimpimagegrid_pdb.h',
|
|
'gimpimageguides_pdb.h',
|
|
'gimpimagesamplepoints_pdb.h',
|
|
'gimpimageselect_pdb.h',
|
|
'gimpimagetransform_pdb.h',
|
|
'gimpimageundo_pdb.h',
|
|
'gimpitem_pdb.h',
|
|
'gimpitemtransform_pdb.h',
|
|
'gimplayer_pdb.h',
|
|
'gimpmessage_pdb.h',
|
|
'gimppainttools_pdb.h',
|
|
'gimppalette_pdb.h',
|
|
'gimppalettes_pdb.h',
|
|
'gimppaletteselect_pdb.h',
|
|
'gimppattern_pdb.h',
|
|
'gimppatterns_pdb.h',
|
|
'gimppatternselect_pdb.h',
|
|
'gimpprogress_pdb.h',
|
|
'gimpselection_pdb.h',
|
|
'gimptextlayer_pdb.h',
|
|
'gimptexttool_pdb.h',
|
|
'gimpvectors_pdb.h',
|
|
]
|
|
|
|
libgimp_sources_introspectable = [
|
|
'gimp.c',
|
|
'gimpbatchprocedure.c',
|
|
'gimpchannel.c',
|
|
'gimpdisplay.c',
|
|
'gimpdrawable.c',
|
|
'gimpfileprocedure.c',
|
|
'gimpgimprc.c',
|
|
'gimpimage.c',
|
|
'gimpimagecolorprofile.c',
|
|
'gimpimagemetadata.c',
|
|
'gimpimagemetadata-save.c',
|
|
'gimpimageprocedure.c',
|
|
'gimpitem.c',
|
|
'gimplayer.c',
|
|
'gimplayermask.c',
|
|
'gimploadprocedure.c',
|
|
'gimpparamspecs.c',
|
|
'gimppdb.c',
|
|
'gimpplugin.c',
|
|
'gimpprocedure.c',
|
|
'gimpprocedureconfig.c',
|
|
'gimpprogress.c',
|
|
'gimpresource.c',
|
|
'gimpresourceselect.c',
|
|
'gimpresource-subclass.c',
|
|
'gimpsaveprocedure.c',
|
|
'gimpselection.c',
|
|
'gimptextlayer.c',
|
|
'gimpthumbnailprocedure.c',
|
|
'gimpvectors.c',
|
|
gimpenums,
|
|
pdb_wrappers_sources,
|
|
]
|
|
|
|
libgimp_sources = [
|
|
libgimp_sources_introspectable,
|
|
'gimp-debug.c',
|
|
'gimp-shm.c',
|
|
'gimpgpparams.c',
|
|
'gimpparamspecs-desc.c',
|
|
'gimppdb_pdb.c',
|
|
'gimppdbprocedure.c',
|
|
'gimppixbuf.c',
|
|
'gimpplugin_pdb.c',
|
|
'gimpunit_pdb.c',
|
|
'gimpunitcache.c',
|
|
'gimptilebackendplugin.c',
|
|
]
|
|
|
|
libgimp_headers_introspectable = [
|
|
# Order matters. Leave these headers at the top.
|
|
'gimp.h',
|
|
'gimptypes.h',
|
|
'gimpenums.h',
|
|
|
|
# Other headers
|
|
'gimpbatchprocedure.h',
|
|
'gimpchannel.h',
|
|
'gimpdisplay.h',
|
|
'gimpdrawable.h',
|
|
'gimpfileprocedure.h',
|
|
'gimpgimprc.h',
|
|
'gimpimage.h',
|
|
'gimpimagecolorprofile.h',
|
|
'gimpimagemetadata.h',
|
|
'gimpimageprocedure.h',
|
|
'gimpitem.h',
|
|
'gimplayer.h',
|
|
'gimplayermask.h',
|
|
'gimploadprocedure.h',
|
|
'gimpparamspecs.h',
|
|
'gimpparamspecs-resource.h',
|
|
'gimppdb.h',
|
|
'gimpplugin.h',
|
|
'gimpprocedure.h',
|
|
'gimpprocedureconfig.h',
|
|
'gimpprogress.h',
|
|
'gimpresource.h',
|
|
'gimpresourceselect.h',
|
|
'gimpresource-subclass.h',
|
|
'gimpsaveprocedure.h',
|
|
'gimpselection.h',
|
|
'gimptextlayer.h',
|
|
'gimpthumbnailprocedure.h',
|
|
'gimpvectors.h',
|
|
pdb_wrappers_headers,
|
|
]
|
|
|
|
libgimp_headers = [
|
|
libgimp_headers_introspectable,
|
|
'gimpprocedure-params.h',
|
|
]
|
|
|
|
libgimpui_sources_introspectable = [
|
|
'gimpaspectpreview.c',
|
|
'gimpbrushselectbutton.c',
|
|
'gimpdrawablepreview.c',
|
|
'gimpexport.c',
|
|
'gimpfontselectbutton.c',
|
|
'gimpgradientselectbutton.c',
|
|
'gimpimagecombobox.c',
|
|
'gimpitemcombobox.c',
|
|
'gimppaletteselectbutton.c',
|
|
'gimppatternselectbutton.c',
|
|
'gimpprocbrowserdialog.c',
|
|
'gimpproceduredialog.c',
|
|
'gimpprocview.c',
|
|
'gimpprogressbar.c',
|
|
'gimppropchooser.c',
|
|
'gimppropchooserfactory.c',
|
|
'gimpresourceselectbutton.c',
|
|
'gimpsaveproceduredialog.c',
|
|
'gimpui.c',
|
|
'gimpzoompreview.c',
|
|
]
|
|
|
|
libgimpui_sources = [
|
|
libgimpui_sources_introspectable,
|
|
gimpuimarshal,
|
|
]
|
|
|
|
libgimpui_headers_introspectable = [
|
|
# Order matters. Leave these headers at the top.
|
|
'gimpui.h',
|
|
'gimpuitypes.h',
|
|
|
|
# Other headers
|
|
'gimpaspectpreview.h',
|
|
'gimpbrushselectbutton.h',
|
|
'gimpdrawablepreview.h',
|
|
'gimpexport.h',
|
|
'gimpfontselectbutton.h',
|
|
'gimpgradientselectbutton.h',
|
|
'gimpimagecombobox.h',
|
|
'gimpitemcombobox.h',
|
|
'gimppaletteselectbutton.h',
|
|
'gimppatternselectbutton.h',
|
|
'gimpprocbrowserdialog.h',
|
|
'gimpproceduredialog.h',
|
|
'gimpprocview.h',
|
|
'gimpprogressbar.h',
|
|
'gimppropchooser.h',
|
|
'gimppropchooserfactory.h',
|
|
'gimpresourceselectbutton.h',
|
|
'gimpsaveproceduredialog.h',
|
|
'gimpzoompreview.h',
|
|
]
|
|
|
|
libgimp_introspectable = [
|
|
libgimp_sources_introspectable,
|
|
libgimp_headers_introspectable,
|
|
]
|
|
|
|
libgimpui_introspectable = [
|
|
libgimpui_sources_introspectable,
|
|
libgimpui_headers_introspectable,
|
|
]
|
|
|
|
|
|
libgimp = library('gimp-'+ gimp_api_version,
|
|
libgimp_sources,
|
|
include_directories: rootInclude,
|
|
dependencies: [
|
|
cairo,
|
|
gdk_pixbuf,
|
|
gegl,
|
|
gexiv2,
|
|
drmingw,
|
|
],
|
|
sources: [
|
|
pdbgen
|
|
],
|
|
c_args: [ '-DG_LOG_DOMAIN="LibGimp"', '-DGIMP_COMPILATION', ],
|
|
link_with: [
|
|
libgimpbase,
|
|
libgimpcolor,
|
|
libgimpconfig,
|
|
libgimpmodule,
|
|
],
|
|
vs_module_defs: 'gimp.def',
|
|
install: true,
|
|
version: so_version,
|
|
)
|
|
|
|
# Define an internal dependency for ease of reuse
|
|
libgimp_dep = declare_dependency(
|
|
dependencies: [
|
|
cairo,
|
|
gdk_pixbuf,
|
|
gegl,
|
|
],
|
|
link_with: [
|
|
libgimp,
|
|
libgimpbase,
|
|
libgimpcolor,
|
|
libgimpconfig,
|
|
libgimpmath,
|
|
libgimpmodule,
|
|
],
|
|
include_directories: rootInclude,
|
|
)
|
|
|
|
|
|
libgimpui = library('gimpui-'+ gimp_api_version,
|
|
libgimpui_sources,
|
|
dependencies: [
|
|
libgimp_dep,
|
|
gexiv2,
|
|
gtk3,
|
|
],
|
|
c_args: [ '-DG_LOG_DOMAIN="LibGimpUI"', '-DGIMP_COMPILATION', ],
|
|
link_with: [
|
|
libgimpwidgets,
|
|
],
|
|
vs_module_defs: 'gimpui.def',
|
|
install: true,
|
|
version: so_version,
|
|
)
|
|
|
|
# Define an internal dependency for ease of reuse
|
|
libgimpui_dep = declare_dependency(
|
|
dependencies: [
|
|
libgimp_dep,
|
|
gtk3,
|
|
],
|
|
link_with: [
|
|
libgimpui,
|
|
libgimpwidgets,
|
|
],
|
|
include_directories: rootInclude,
|
|
)
|
|
|
|
|
|
install_headers(
|
|
libgimp_headers,
|
|
libgimpui_headers_introspectable,
|
|
subdir: gimp_api_name / 'libgimp',
|
|
)
|
|
|
|
|
|
|
|
### GObject introspection
|
|
|
|
libgimp_introspectable_files = [
|
|
libgimp_introspectable,
|
|
libgimpbase_introspectable,
|
|
libgimpcolor_introspectable,
|
|
libgimpconfig_introspectable,
|
|
libgimpmath_introspectable,
|
|
libgimpmodule_introspectable,
|
|
'gimpparamspecs-body.c',
|
|
'gimpparamspecs-body-resource.c',
|
|
]
|
|
|
|
libgimpui_introspectable_files = [
|
|
libgimpui_introspectable,
|
|
libgimpwidgets_introspectable,
|
|
]
|
|
|
|
if meson.is_cross_build() and not get_option('can-crosscompile-gir')
|
|
have_gobject_introspection = false
|
|
gobject_introspection_warning = '\n '.join(['',
|
|
'GObject Introspection is disabled while cross-compiling because',
|
|
'GI tools do not manage to properly generate introspection data',
|
|
'while cross-compiling. Nevertheless we consider our introspected',
|
|
'API as a core component of GIMP, thus you are expected to build',
|
|
'this data natively.',
|
|
'To forcefully build with GObject Introspection, set:',
|
|
'-Dcan-crosscompile-gir=true'
|
|
])
|
|
warning(gobject_introspection_warning)
|
|
warnings += gobject_introspection_warning
|
|
else
|
|
have_gobject_introspection = true
|
|
libgimp_gir_includes = [
|
|
'Babl-0.1',
|
|
'cairo-1.0',
|
|
'GdkPixbuf-2.0',
|
|
'Gegl-0.4',
|
|
'Gio-2.0',
|
|
'GLib-2.0',
|
|
'GObject-2.0',
|
|
]
|
|
|
|
gir_args = [
|
|
'-DGIMP_COMPILATION',
|
|
'-DGIMP_BASE_COMPILATION',
|
|
'-DGIMP_COLOR_COMPILATION',
|
|
'-DGIMP_CONFIG_COMPILATION',
|
|
'-DGIMP_MATH_COMPILATION',
|
|
'-DGIMP_MODULE_COMPILATION',
|
|
'-DGIMP_THUMB_COMPILATION',
|
|
'-DGIMP_WIDGETS_COMPILATION',
|
|
'-DGIMP_DISABLE_DEPRECATED',
|
|
'--quiet',
|
|
]
|
|
|
|
libgimp_gir = gnome.generate_gir(
|
|
libgimp,
|
|
libgimpbase,
|
|
libgimpcolor,
|
|
libgimpconfig,
|
|
libgimpmath,
|
|
libgimpmodule,
|
|
|
|
sources: libgimp_introspectable_files,
|
|
nsversion: gimp_api_version,
|
|
namespace: 'Gimp',
|
|
identifier_prefix: 'Gimp',
|
|
symbol_prefix: 'gimp',
|
|
export_packages: 'gimp-' + gimp_api_version,
|
|
header: 'libgimp/gimp.h',
|
|
includes: libgimp_gir_includes,
|
|
extra_args: gir_args,
|
|
include_directories: rootInclude,
|
|
install: true,
|
|
)
|
|
|
|
libgimpui_gir = gnome.generate_gir(
|
|
libgimpui,
|
|
libgimpwidgets,
|
|
|
|
sources: libgimpui_introspectable_files,
|
|
nsversion: gimp_api_version,
|
|
namespace: 'GimpUi',
|
|
identifier_prefix: 'Gimp',
|
|
symbol_prefix: [ 'gimp_ui', 'gimp' ],
|
|
export_packages: 'gimp-ui-' + gimp_api_version,
|
|
header: 'libgimp/gimpui.h',
|
|
includes: [ libgimp_gir_includes, 'Gtk-3.0', libgimp_gir[0] ],
|
|
extra_args: gir_args,
|
|
include_directories: rootInclude,
|
|
install: true,
|
|
)
|
|
|
|
if have_vala
|
|
vapi_deps = [
|
|
'babl-0.1',
|
|
'cairo-1.0',
|
|
'gdk-pixbuf-2.0',
|
|
'gegl-0.4',
|
|
'gio-2.0',
|
|
'glib-2.0',
|
|
'gobject-2.0',
|
|
'gtk+-3.0',
|
|
]
|
|
|
|
libgimp_vapi = gnome.generate_vapi('gimp-' + gimp_api_version,
|
|
sources: libgimp_gir[0],
|
|
packages: vapi_deps,
|
|
install: true,
|
|
)
|
|
|
|
libgimpui_vapi = gnome.generate_vapi('gimp-ui-' + gimp_api_version,
|
|
sources: libgimpui_gir[0],
|
|
packages: vapi_deps + [ libgimp_vapi ],
|
|
install: true,
|
|
)
|
|
endif
|
|
endif
|
|
|
|
if have_python and not platform_windows and not platform_osx
|
|
# Verify .def files for Windows.
|
|
# Ironically we only check this on non-Windows platform, since the
|
|
# script expects .so libraries, and I'm not sure that the `nm` tool is
|
|
# available on Windows.
|
|
# On the other hand, it is how it always has been, since we used to
|
|
# only run this on dist step (which we historically run on a GNU/Linux
|
|
# machine). And it worked fine until now.
|
|
custom_target('check-def-files',
|
|
input: [
|
|
'../libgimpbase/gimpbase.def',
|
|
'../libgimpcolor/gimpcolor.def',
|
|
'../libgimpconfig/gimpconfig.def',
|
|
'../libgimp/gimp.def',
|
|
'../libgimp/gimpui.def',
|
|
'../libgimpmath/gimpmath.def',
|
|
'../libgimpmodule/gimpmodule.def',
|
|
'../libgimpthumb/gimpthumb.def',
|
|
'../libgimpwidgets/gimpwidgets.def',
|
|
],
|
|
depends: [
|
|
libgimpbase,
|
|
libgimpcolor,
|
|
libgimpconfig,
|
|
libgimp,
|
|
libgimpui,
|
|
libgimpmath,
|
|
libgimpmodule,
|
|
libgimpthumb,
|
|
libgimpwidgets
|
|
],
|
|
output: [ 'check-def-files', ],
|
|
command: [
|
|
python, meson.project_source_root() / 'tools' / 'defcheck.py', meson.project_source_root(),
|
|
],
|
|
build_by_default: true,
|
|
)
|
|
endif
|