2022-08-01 19:08:35 +02:00
|
|
|
# Similarly to libgimpthumb/gimpthumb-enums.c, libgimp/gimpenums.c is
|
2024-12-27 17:57:33 +01:00
|
|
|
# not versioned so we don't use the mkenums_wrap.
|
2022-08-01 19:08:35 +02:00
|
|
|
# Moreover it is generated in 2 steps, first with common mkenums
|
|
|
|
# arguments, then concatenating with a "tail" file.
|
2017-11-01 14:27:13 +01:00
|
|
|
gimpenums_notail = custom_target('gimpenums.c.notail',
|
2023-08-30 15:52:47 +02:00
|
|
|
input : [ 'gimpenums.h', stamp_enumcode],
|
2017-11-01 14:27:13 +01:00
|
|
|
output: [ 'gimpenums.c.notail', ],
|
|
|
|
command: [
|
|
|
|
gimp_mkenums,
|
|
|
|
'--fhead','#include "config.h"\n'
|
|
|
|
+ '#include <gio/gio.h>\n'
|
|
|
|
+ '#include <gegl.h>\n'
|
|
|
|
+ '#include "libgimpbase/gimpbase.h"\n'
|
|
|
|
+ '#include "libgimpbase/gimpbase-private.h"\n'
|
|
|
|
+ '#include "libgimpconfig/gimpconfigenums.h"\n'
|
2023-08-30 15:52:47 +02:00
|
|
|
+ '#include "pdb/stamp-enumcode.h"\n'
|
2017-11-01 14:27:13 +01:00
|
|
|
+ '#include "gimpenums.h"\n',
|
2022-08-01 19:08:35 +02:00
|
|
|
'--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,
|
2023-08-30 15:52:47 +02:00
|
|
|
'@INPUT0@',
|
2017-11-01 14:27:13 +01:00
|
|
|
],
|
|
|
|
capture: true,
|
|
|
|
)
|
|
|
|
|
|
|
|
gimpenums = custom_target('gimpenums.c',
|
|
|
|
input : [ gimpenums_notail, 'gimpenums.c.tail', ],
|
|
|
|
output: [ 'gimpenums.c', ],
|
2025-04-17 15:22:26 -03:00
|
|
|
command: [python, '-c', 'import sys; [sys.stdout.write(open(f).read()) for f in sys.argv[1:]]','@INPUT@'],
|
2017-11-01 14:27:13 +01:00
|
|
|
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',
|
2024-11-25 04:38:39 +09:00
|
|
|
'gimpdrawablefilter_pdb.c',
|
2023-08-27 01:02:37 +02:00
|
|
|
'gimpdrawableselect_pdb.c',
|
2017-11-01 14:27:13 +01:00
|
|
|
'gimpdynamics_pdb.c',
|
|
|
|
'gimpedit_pdb.c',
|
2019-09-11 17:10:47 +02:00
|
|
|
'gimpfile_pdb.c',
|
2017-11-01 14:27:13 +01:00
|
|
|
'gimpfloatingsel_pdb.c',
|
2022-09-05 19:28:35 -04:00
|
|
|
'gimpfont_pdb.c',
|
2017-11-01 14:27:13 +01:00
|
|
|
'gimpfonts_pdb.c',
|
|
|
|
'gimpfontselect_pdb.c',
|
|
|
|
'gimpgimprc_pdb.c',
|
|
|
|
'gimpgradient_pdb.c',
|
|
|
|
'gimpgradients_pdb.c',
|
|
|
|
'gimpgradientselect_pdb.c',
|
app, libgimp, pdb, plug-ins: new GimpGroupLayer class in libgimp.
Also:
- renaming gimp_layer_group_new() to gimp_group_layer_new() in order to keep the
same name as in core code (i.e. GimpGroupLayer, not GimpLayerGroup).
- renaming gimp_image_merge_layer_group() to gimp_group_layer_merge()
- new functions: gimp_procedure_add_group_layer_argument(),
gimp_procedure_add_group_layer_aux_argument() and
gimp_procedure_add_group_layer_return_value().
This can be tested, e.g. in Python with these calls:
```py
i = Gimp.get_images()[0]
g = Gimp.GroupLayer.new(i, "hello")
i.insert_layer(g, None, 1)
g2 = Gimp.GroupLayer.new(i, "world")
i.insert_layer(g2, g, 1)
g.merge()
```
This was work started long ago, stored in an old stash which I finally
finish now! :-)
2024-07-06 17:24:11 +02:00
|
|
|
'gimpgrouplayer_pdb.c',
|
2017-11-01 14:27:13 +01:00
|
|
|
'gimphelp_pdb.c',
|
|
|
|
'gimpimage_pdb.c',
|
2025-02-06 14:55:27 -05:00
|
|
|
'gimpimageautocrop_pdb.c',
|
2017-11-01 14:27:13 +01:00
|
|
|
'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',
|
2024-07-08 23:39:51 +00:00
|
|
|
'gimppath_pdb.c',
|
2017-11-01 14:27:13 +01:00
|
|
|
'gimppattern_pdb.c',
|
|
|
|
'gimppatterns_pdb.c',
|
|
|
|
'gimppatternselect_pdb.c',
|
|
|
|
'gimpprogress_pdb.c',
|
2023-05-31 16:12:04 +02:00
|
|
|
'gimpresource_pdb.c',
|
2017-11-01 14:27:13 +01:00
|
|
|
'gimpselection_pdb.c',
|
|
|
|
'gimptextlayer_pdb.c',
|
|
|
|
'gimptexttool_pdb.c',
|
Issue #8900 and #9923: reimplementing GimpUnit as a proper class.
This fixes all our GObject Introspection issues with GimpUnit which was
both an enum and an int-derived type of user-defined units *completing*
the enum values. GIR clearly didn't like this!
Now GimpUnit is a proper class and units are unique objects, allowing to
compare them with an identity test (i.e. `unit == gimp_unit_pixel ()`
tells us if unit is the pixel unit or not), which makes it easy to use,
just like with int, yet adding also methods, making for nicer
introspected API.
As an aside, this also fixes #10738, by having all the built-in units
retrievable even if libgimpbase had not been properly initialized with
gimp_base_init().
I haven't checked in details how GIR works to introspect, but it looks
like it loads the library to inspect and runs functions, hence
triggering some CRITICALS because virtual methods (supposed to be
initialized with gimp_base_init() run by libgimp) are not set. This new
code won't trigger any critical because the vtable method are now not
necessary, at least for all built-in units.
Note that GimpUnit is still in libgimpbase. It could have been moved to
libgimp in order to avoid any virtual method table (since we need to
keep core and libgimp side's units in sync, PDB is required), but too
many libgimpwidgets widgets were already using GimpUnit. And technically
most of GimpUnit logic doesn't require PDB (only the creation/sync
part). This is one of the reasons why user-created GimpUnit list is
handled and stored differently from other types of objects.
Globally this simplifies the code a lot too and we don't need separate
implementations of various utils for core and libgimp, which means less
prone to errors.
2024-07-25 20:55:21 +02:00
|
|
|
'gimpunit_pdb.c',
|
2017-11-01 14:27:13 +01:00
|
|
|
]
|
|
|
|
|
|
|
|
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',
|
2024-11-25 04:38:39 +09:00
|
|
|
'gimpdrawablefilter_pdb.h',
|
2023-08-27 01:02:37 +02:00
|
|
|
'gimpdrawableselect_pdb.h',
|
2017-11-01 14:27:13 +01:00
|
|
|
'gimpdynamics_pdb.h',
|
|
|
|
'gimpedit_pdb.h',
|
2019-09-11 17:10:47 +02:00
|
|
|
'gimpfile_pdb.h',
|
2017-11-01 14:27:13 +01:00
|
|
|
'gimpfloatingsel_pdb.h',
|
2022-09-05 19:28:35 -04:00
|
|
|
'gimpfont_pdb.h',
|
2017-11-01 14:27:13 +01:00
|
|
|
'gimpfonts_pdb.h',
|
|
|
|
'gimpfontselect_pdb.h',
|
|
|
|
'gimpgimprc_pdb.h',
|
|
|
|
'gimpgradient_pdb.h',
|
|
|
|
'gimpgradients_pdb.h',
|
|
|
|
'gimpgradientselect_pdb.h',
|
app, libgimp, pdb, plug-ins: new GimpGroupLayer class in libgimp.
Also:
- renaming gimp_layer_group_new() to gimp_group_layer_new() in order to keep the
same name as in core code (i.e. GimpGroupLayer, not GimpLayerGroup).
- renaming gimp_image_merge_layer_group() to gimp_group_layer_merge()
- new functions: gimp_procedure_add_group_layer_argument(),
gimp_procedure_add_group_layer_aux_argument() and
gimp_procedure_add_group_layer_return_value().
This can be tested, e.g. in Python with these calls:
```py
i = Gimp.get_images()[0]
g = Gimp.GroupLayer.new(i, "hello")
i.insert_layer(g, None, 1)
g2 = Gimp.GroupLayer.new(i, "world")
i.insert_layer(g2, g, 1)
g.merge()
```
This was work started long ago, stored in an old stash which I finally
finish now! :-)
2024-07-06 17:24:11 +02:00
|
|
|
'gimpgrouplayer_pdb.h',
|
2017-11-01 14:27:13 +01:00
|
|
|
'gimphelp_pdb.h',
|
|
|
|
'gimpimage_pdb.h',
|
2025-02-06 14:55:27 -05:00
|
|
|
'gimpimageautocrop_pdb.h',
|
2017-11-01 14:27:13 +01:00
|
|
|
'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',
|
2024-07-08 23:39:51 +00:00
|
|
|
'gimppath_pdb.h',
|
2017-11-01 14:27:13 +01:00
|
|
|
'gimppattern_pdb.h',
|
|
|
|
'gimppatterns_pdb.h',
|
|
|
|
'gimppatternselect_pdb.h',
|
|
|
|
'gimpprogress_pdb.h',
|
2023-05-31 16:12:04 +02:00
|
|
|
'gimpresource_pdb.h',
|
2017-11-01 14:27:13 +01:00
|
|
|
'gimpselection_pdb.h',
|
|
|
|
'gimptextlayer_pdb.h',
|
|
|
|
'gimptexttool_pdb.h',
|
Issue #8900 and #9923: reimplementing GimpUnit as a proper class.
This fixes all our GObject Introspection issues with GimpUnit which was
both an enum and an int-derived type of user-defined units *completing*
the enum values. GIR clearly didn't like this!
Now GimpUnit is a proper class and units are unique objects, allowing to
compare them with an identity test (i.e. `unit == gimp_unit_pixel ()`
tells us if unit is the pixel unit or not), which makes it easy to use,
just like with int, yet adding also methods, making for nicer
introspected API.
As an aside, this also fixes #10738, by having all the built-in units
retrievable even if libgimpbase had not been properly initialized with
gimp_base_init().
I haven't checked in details how GIR works to introspect, but it looks
like it loads the library to inspect and runs functions, hence
triggering some CRITICALS because virtual methods (supposed to be
initialized with gimp_base_init() run by libgimp) are not set. This new
code won't trigger any critical because the vtable method are now not
necessary, at least for all built-in units.
Note that GimpUnit is still in libgimpbase. It could have been moved to
libgimp in order to avoid any virtual method table (since we need to
keep core and libgimp side's units in sync, PDB is required), but too
many libgimpwidgets widgets were already using GimpUnit. And technically
most of GimpUnit logic doesn't require PDB (only the creation/sync
part). This is one of the reasons why user-created GimpUnit list is
handled and stored differently from other types of objects.
Globally this simplifies the code a lot too and we don't need separate
implementations of various utils for core and libgimp, which means less
prone to errors.
2024-07-25 20:55:21 +02:00
|
|
|
'gimpunit_pdb.h',
|
2017-11-01 14:27:13 +01:00
|
|
|
]
|
|
|
|
|
|
|
|
libgimp_sources_introspectable = [
|
|
|
|
'gimp.c',
|
2022-04-16 17:09:21 +02:00
|
|
|
'gimpbatchprocedure.c',
|
libgimp, pdb: replacing gimp_brush_get_pixels() by gimp_brush_get_buffer()…
… and gimp_brush_get_mask().
gimp_brush_get_pixels() was a bit crappy, returning raw data with only
dimensions and bpp to go with (no color model/space, no bit depth…). So the
assumption is that we work with 8-bit per channel data, possibly with alpha
depending of number of channels as deduced from bpp, and very likely in sRGB
color space. It might be globally ok with many of the brush formats (and
historical brushes) but won't fare well as we improve brush capabilities.
- gimp_brush_get_pixels() is in fact made private.
- The 2 new functions are using this old PDB call _gimp_brush_get_pixels() to
construct buffers. This has some limitations, in particular that it returns
only 8-bit per channel sRGB data, but at least the signature won't change when
we will improve things in the future (so if some day, we pass fancy brushes in
high-bit depth, the method will stay the same).
- This new implementation also allows scaling down the brush (keeping aspect
ratio) which is useful when you need to fit a brush preview into a drawing
widget.
- Current implementation stores the buffers at native size in the libgimp's
GimpBrush object, hence save re-querying the core every time you need an
update. This can be improved as current implementation also means that you
don't get updates if the brush changed. This should handle most common use
cases for now, though.
- Also with this change, I move GimpBrush class implementation into its own
dedicated file.
2023-08-18 16:39:11 +02:00
|
|
|
'gimpbrush.c',
|
2017-11-01 14:27:13 +01:00
|
|
|
'gimpchannel.c',
|
|
|
|
'gimpdisplay.c',
|
|
|
|
'gimpdrawable.c',
|
2024-11-25 04:38:39 +09:00
|
|
|
'gimpdrawablefilter.c',
|
2024-11-28 01:07:23 +09:00
|
|
|
'gimpdrawablefilterconfig.c',
|
2024-05-06 18:38:12 +00:00
|
|
|
'gimpexportoptions.c',
|
2017-11-01 14:27:13 +01:00
|
|
|
'gimpfileprocedure.c',
|
2023-08-19 00:44:51 +02:00
|
|
|
'gimpfont.c',
|
2017-11-01 14:27:13 +01:00
|
|
|
'gimpgimprc.c',
|
2023-08-19 00:44:51 +02:00
|
|
|
'gimpgradient.c',
|
app, libgimp, pdb, plug-ins: new GimpGroupLayer class in libgimp.
Also:
- renaming gimp_layer_group_new() to gimp_group_layer_new() in order to keep the
same name as in core code (i.e. GimpGroupLayer, not GimpLayerGroup).
- renaming gimp_image_merge_layer_group() to gimp_group_layer_merge()
- new functions: gimp_procedure_add_group_layer_argument(),
gimp_procedure_add_group_layer_aux_argument() and
gimp_procedure_add_group_layer_return_value().
This can be tested, e.g. in Python with these calls:
```py
i = Gimp.get_images()[0]
g = Gimp.GroupLayer.new(i, "hello")
i.insert_layer(g, None, 1)
g2 = Gimp.GroupLayer.new(i, "world")
i.insert_layer(g2, g, 1)
g.merge()
```
This was work started long ago, stored in an old stash which I finally
finish now! :-)
2024-07-06 17:24:11 +02:00
|
|
|
'gimpgrouplayer.c',
|
2017-11-01 14:27:13 +01:00
|
|
|
'gimpimage.c',
|
|
|
|
'gimpimagecolorprofile.c',
|
2020-09-13 13:09:59 +02:00
|
|
|
'gimpimagemetadata.c',
|
2019-10-09 22:32:07 +02:00
|
|
|
'gimpimagemetadata-save.c',
|
2017-11-01 14:27:13 +01:00
|
|
|
'gimpimageprocedure.c',
|
|
|
|
'gimpitem.c',
|
|
|
|
'gimplayer.c',
|
|
|
|
'gimplayermask.c',
|
|
|
|
'gimploadprocedure.c',
|
2023-08-19 00:44:51 +02:00
|
|
|
'gimppalette.c',
|
2017-11-01 14:27:13 +01:00
|
|
|
'gimpparamspecs.c',
|
2024-07-12 06:16:25 +00:00
|
|
|
'gimppath.c',
|
2023-08-19 00:13:36 +02:00
|
|
|
'gimppattern.c',
|
2017-11-01 14:27:13 +01:00
|
|
|
'gimppdb.c',
|
|
|
|
'gimpplugin.c',
|
|
|
|
'gimpprocedure.c',
|
2024-06-07 03:05:04 +00:00
|
|
|
'gimpprocedure-params.c',
|
2019-09-20 12:31:11 +02:00
|
|
|
'gimpprocedureconfig.c',
|
2017-11-01 14:27:13 +01:00
|
|
|
'gimpprogress.c',
|
2022-09-05 19:28:35 -04:00
|
|
|
'gimpresource.c',
|
2024-04-20 03:08:57 +00:00
|
|
|
'gimpexportprocedure.c',
|
2017-11-01 14:27:13 +01:00
|
|
|
'gimpselection.c',
|
2022-09-30 16:21:47 +02:00
|
|
|
'gimptextlayer.c',
|
2017-11-01 14:27:13 +01:00
|
|
|
'gimpthumbnailprocedure.c',
|
app, libgimp, pdb: new GimpVectorLoadProcedure class.
It's still basic but will help to share code for support of various vector-able
formats, such as the logic for dimensioning them, but also the generated GUI.
Not only this, but we are paving the way for the link layers (though it'll be
after GIMP 3, we want plug-in procedures' API to stay stable) by giving a way
for a plug-in procedure to advertize a vector format support. This way, the core
will know when a source file is vector and can be directly reloaded at any
target size (right now, in my MR for link layers, the list of "vector" formats
is hardcoded, which is not reliable).
2024-04-22 23:11:37 +02:00
|
|
|
'gimpvectorloadprocedure.c',
|
2017-11-01 14:27:13 +01:00
|
|
|
gimpenums,
|
|
|
|
pdb_wrappers_sources,
|
|
|
|
]
|
|
|
|
|
|
|
|
libgimp_sources = [
|
|
|
|
libgimp_sources_introspectable,
|
|
|
|
'gimp-debug.c',
|
|
|
|
'gimp-shm.c',
|
|
|
|
'gimpgpparams.c',
|
2020-04-28 19:06:44 +02:00
|
|
|
'gimpparamspecs-desc.c',
|
2017-11-01 14:27:13 +01:00
|
|
|
'gimppdb_pdb.c',
|
|
|
|
'gimppdbprocedure.c',
|
|
|
|
'gimppixbuf.c',
|
|
|
|
'gimpplugin_pdb.c',
|
2024-09-29 02:14:30 +02:00
|
|
|
'gimpresourceselect.c',
|
2017-11-01 14:27:13 +01:00
|
|
|
'gimptilebackendplugin.c',
|
|
|
|
]
|
|
|
|
|
|
|
|
libgimp_headers_introspectable = [
|
2019-10-10 12:26:26 +02:00
|
|
|
# Order matters. Leave these headers at the top.
|
2017-11-01 14:27:13 +01:00
|
|
|
'gimp.h',
|
2019-10-10 12:26:26 +02:00
|
|
|
'gimptypes.h',
|
|
|
|
'gimpenums.h',
|
|
|
|
|
|
|
|
# Other headers
|
2022-04-16 17:09:21 +02:00
|
|
|
'gimpbatchprocedure.h',
|
libgimp, pdb: replacing gimp_brush_get_pixels() by gimp_brush_get_buffer()…
… and gimp_brush_get_mask().
gimp_brush_get_pixels() was a bit crappy, returning raw data with only
dimensions and bpp to go with (no color model/space, no bit depth…). So the
assumption is that we work with 8-bit per channel data, possibly with alpha
depending of number of channels as deduced from bpp, and very likely in sRGB
color space. It might be globally ok with many of the brush formats (and
historical brushes) but won't fare well as we improve brush capabilities.
- gimp_brush_get_pixels() is in fact made private.
- The 2 new functions are using this old PDB call _gimp_brush_get_pixels() to
construct buffers. This has some limitations, in particular that it returns
only 8-bit per channel sRGB data, but at least the signature won't change when
we will improve things in the future (so if some day, we pass fancy brushes in
high-bit depth, the method will stay the same).
- This new implementation also allows scaling down the brush (keeping aspect
ratio) which is useful when you need to fit a brush preview into a drawing
widget.
- Current implementation stores the buffers at native size in the libgimp's
GimpBrush object, hence save re-querying the core every time you need an
update. This can be improved as current implementation also means that you
don't get updates if the brush changed. This should handle most common use
cases for now, though.
- Also with this change, I move GimpBrush class implementation into its own
dedicated file.
2023-08-18 16:39:11 +02:00
|
|
|
'gimpbrush.h',
|
2017-11-01 14:27:13 +01:00
|
|
|
'gimpchannel.h',
|
|
|
|
'gimpdisplay.h',
|
|
|
|
'gimpdrawable.h',
|
2024-11-25 04:38:39 +09:00
|
|
|
'gimpdrawablefilter.h',
|
2024-11-28 01:07:23 +09:00
|
|
|
'gimpdrawablefilterconfig.h',
|
2024-05-06 18:38:12 +00:00
|
|
|
'gimpexportoptions.h',
|
2017-11-01 14:27:13 +01:00
|
|
|
'gimpfileprocedure.h',
|
2023-08-19 00:44:51 +02:00
|
|
|
'gimpfont.h',
|
2017-11-01 14:27:13 +01:00
|
|
|
'gimpgimprc.h',
|
2023-08-19 00:44:51 +02:00
|
|
|
'gimpgradient.h',
|
app, libgimp, pdb, plug-ins: new GimpGroupLayer class in libgimp.
Also:
- renaming gimp_layer_group_new() to gimp_group_layer_new() in order to keep the
same name as in core code (i.e. GimpGroupLayer, not GimpLayerGroup).
- renaming gimp_image_merge_layer_group() to gimp_group_layer_merge()
- new functions: gimp_procedure_add_group_layer_argument(),
gimp_procedure_add_group_layer_aux_argument() and
gimp_procedure_add_group_layer_return_value().
This can be tested, e.g. in Python with these calls:
```py
i = Gimp.get_images()[0]
g = Gimp.GroupLayer.new(i, "hello")
i.insert_layer(g, None, 1)
g2 = Gimp.GroupLayer.new(i, "world")
i.insert_layer(g2, g, 1)
g.merge()
```
This was work started long ago, stored in an old stash which I finally
finish now! :-)
2024-07-06 17:24:11 +02:00
|
|
|
'gimpgrouplayer.h',
|
2017-11-01 14:27:13 +01:00
|
|
|
'gimpimage.h',
|
|
|
|
'gimpimagecolorprofile.h',
|
2020-09-13 13:09:59 +02:00
|
|
|
'gimpimagemetadata.h',
|
2017-11-01 14:27:13 +01:00
|
|
|
'gimpimageprocedure.h',
|
2019-10-10 12:39:07 +02:00
|
|
|
'gimpitem.h',
|
2017-11-01 14:27:13 +01:00
|
|
|
'gimplayer.h',
|
|
|
|
'gimplayermask.h',
|
|
|
|
'gimploadprocedure.h',
|
2023-08-19 00:44:51 +02:00
|
|
|
'gimppalette.h',
|
2017-11-01 14:27:13 +01:00
|
|
|
'gimpparamspecs.h',
|
2024-07-12 06:16:25 +00:00
|
|
|
'gimppath.h',
|
2023-08-19 00:13:36 +02:00
|
|
|
'gimppattern.h',
|
2017-11-01 14:27:13 +01:00
|
|
|
'gimppdb.h',
|
|
|
|
'gimpplugin.h',
|
|
|
|
'gimpprocedure.h',
|
2024-06-07 03:05:04 +00:00
|
|
|
'gimpprocedure-params.h',
|
2019-09-20 12:31:11 +02:00
|
|
|
'gimpprocedureconfig.h',
|
2017-11-01 14:27:13 +01:00
|
|
|
'gimpprogress.h',
|
2022-09-05 19:28:35 -04:00
|
|
|
'gimpresource.h',
|
2024-04-20 03:08:57 +00:00
|
|
|
'gimpexportprocedure.h',
|
2017-11-01 14:27:13 +01:00
|
|
|
'gimpselection.h',
|
2022-09-30 16:21:47 +02:00
|
|
|
'gimptextlayer.h',
|
2017-11-01 14:27:13 +01:00
|
|
|
'gimpthumbnailprocedure.h',
|
2024-04-24 16:02:08 +02:00
|
|
|
'gimpvectorloadprocedure.h',
|
2019-09-14 23:24:35 +02:00
|
|
|
pdb_wrappers_headers,
|
2017-11-01 14:27:13 +01:00
|
|
|
]
|
|
|
|
|
|
|
|
libgimp_headers = [
|
|
|
|
libgimp_headers_introspectable,
|
|
|
|
]
|
|
|
|
|
|
|
|
libgimpui_sources_introspectable = [
|
|
|
|
'gimpaspectpreview.c',
|
2023-08-19 01:22:09 +02:00
|
|
|
'gimpbrushchooser.c',
|
2023-08-28 21:42:39 +02:00
|
|
|
'gimpdrawablechooser.c',
|
2017-11-01 14:27:13 +01:00
|
|
|
'gimpdrawablepreview.c',
|
2023-08-19 01:22:09 +02:00
|
|
|
'gimpfontchooser.c',
|
|
|
|
'gimpgradientchooser.c',
|
2017-11-01 14:27:13 +01:00
|
|
|
'gimpimagecombobox.c',
|
|
|
|
'gimpitemcombobox.c',
|
2023-08-19 01:22:09 +02:00
|
|
|
'gimppalettechooser.c',
|
|
|
|
'gimppatternchooser.c',
|
2017-11-01 14:27:13 +01:00
|
|
|
'gimpprocbrowserdialog.c',
|
2019-09-20 19:24:40 +02:00
|
|
|
'gimpproceduredialog.c',
|
2017-11-01 14:27:13 +01:00
|
|
|
'gimpprocview.c',
|
|
|
|
'gimpprogressbar.c',
|
2023-08-17 23:02:38 +02:00
|
|
|
'gimppropwidgets.c',
|
2023-08-19 01:22:09 +02:00
|
|
|
'gimpresourcechooser.c',
|
2024-04-20 03:08:57 +00:00
|
|
|
'gimpexportproceduredialog.c',
|
2017-11-01 14:27:13 +01:00
|
|
|
'gimpui.c',
|
|
|
|
'gimpzoompreview.c',
|
2024-04-23 22:27:26 +02:00
|
|
|
'gimpvectorloadproceduredialog.c',
|
2017-11-01 14:27:13 +01:00
|
|
|
]
|
|
|
|
|
|
|
|
libgimpui_sources = [
|
|
|
|
libgimpui_sources_introspectable,
|
|
|
|
gimpuimarshal,
|
2024-04-22 23:54:10 +02:00
|
|
|
|
|
|
|
# TODO: eventually move to libgimpwidgets.
|
|
|
|
'gimpresolutionentry-private.c'
|
2017-11-01 14:27:13 +01:00
|
|
|
]
|
|
|
|
|
|
|
|
libgimpui_headers_introspectable = [
|
2019-10-10 12:26:26 +02:00
|
|
|
# Order matters. Leave these headers at the top.
|
|
|
|
'gimpui.h',
|
|
|
|
'gimpuitypes.h',
|
|
|
|
|
|
|
|
# Other headers
|
2017-11-01 14:27:13 +01:00
|
|
|
'gimpaspectpreview.h',
|
2023-08-19 01:22:09 +02:00
|
|
|
'gimpbrushchooser.h',
|
2023-08-28 21:42:39 +02:00
|
|
|
'gimpdrawablechooser.h',
|
2017-11-01 14:27:13 +01:00
|
|
|
'gimpdrawablepreview.h',
|
2023-08-19 01:22:09 +02:00
|
|
|
'gimpfontchooser.h',
|
|
|
|
'gimpgradientchooser.h',
|
2017-11-01 14:27:13 +01:00
|
|
|
'gimpimagecombobox.h',
|
|
|
|
'gimpitemcombobox.h',
|
2023-08-19 01:22:09 +02:00
|
|
|
'gimppalettechooser.h',
|
|
|
|
'gimppatternchooser.h',
|
2017-11-01 14:27:13 +01:00
|
|
|
'gimpprocbrowserdialog.h',
|
2019-09-21 01:25:56 +02:00
|
|
|
'gimpproceduredialog.h',
|
2017-11-01 14:27:13 +01:00
|
|
|
'gimpprocview.h',
|
|
|
|
'gimpprogressbar.h',
|
2023-08-17 23:02:38 +02:00
|
|
|
'gimppropwidgets.h',
|
2023-08-19 01:22:09 +02:00
|
|
|
'gimpresourcechooser.h',
|
2024-04-20 03:08:57 +00:00
|
|
|
'gimpexportproceduredialog.h',
|
2024-04-24 16:02:08 +02:00
|
|
|
'gimpvectorloadproceduredialog.h',
|
2017-11-01 14:27:13 +01:00
|
|
|
'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: [
|
2022-12-26 22:22:37 +01:00
|
|
|
cairo,
|
|
|
|
gdk_pixbuf,
|
2020-05-11 06:34:31 +02:00
|
|
|
gegl,
|
|
|
|
gexiv2,
|
|
|
|
drmingw,
|
2024-04-26 01:07:59 +02:00
|
|
|
math,
|
2023-09-13 19:13:51 +02:00
|
|
|
pango,
|
|
|
|
pangoft2,
|
2017-11-01 14:27:13 +01:00
|
|
|
],
|
2022-03-27 22:07:32 +02:00
|
|
|
sources: [
|
|
|
|
pdbgen
|
|
|
|
],
|
2017-11-01 14:27:13 +01:00
|
|
|
c_args: [ '-DG_LOG_DOMAIN="LibGimp"', '-DGIMP_COMPILATION', ],
|
|
|
|
link_with: [
|
|
|
|
libgimpbase,
|
|
|
|
libgimpcolor,
|
|
|
|
libgimpconfig,
|
2021-08-04 00:55:29 +02:00
|
|
|
libgimpmodule,
|
2017-11-01 14:27:13 +01:00
|
|
|
],
|
|
|
|
vs_module_defs: 'gimp.def',
|
|
|
|
install: true,
|
|
|
|
version: so_version,
|
|
|
|
)
|
|
|
|
|
2020-05-11 06:34:31 +02:00
|
|
|
# Define an internal dependency for ease of reuse
|
|
|
|
libgimp_dep = declare_dependency(
|
2017-11-01 14:27:13 +01:00
|
|
|
dependencies: [
|
2020-05-11 06:34:31 +02:00
|
|
|
cairo,
|
|
|
|
gdk_pixbuf,
|
|
|
|
gegl,
|
2017-11-01 14:27:13 +01:00
|
|
|
],
|
|
|
|
link_with: [
|
|
|
|
libgimp,
|
|
|
|
libgimpbase,
|
|
|
|
libgimpcolor,
|
2019-09-21 01:25:56 +02:00
|
|
|
libgimpconfig,
|
2020-05-11 06:34:31 +02:00
|
|
|
libgimpmath,
|
2021-08-04 00:55:29 +02:00
|
|
|
libgimpmodule,
|
2020-05-11 06:34:31 +02:00
|
|
|
],
|
|
|
|
include_directories: rootInclude,
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
libgimpui = library('gimpui-'+ gimp_api_version,
|
|
|
|
libgimpui_sources,
|
|
|
|
dependencies: [
|
|
|
|
libgimp_dep,
|
|
|
|
gexiv2,
|
|
|
|
gtk3,
|
|
|
|
],
|
2024-08-13 18:16:39 +02:00
|
|
|
sources: [
|
|
|
|
pdbgen
|
|
|
|
],
|
2020-05-11 06:34:31 +02:00
|
|
|
c_args: [ '-DG_LOG_DOMAIN="LibGimpUI"', '-DGIMP_COMPILATION', ],
|
|
|
|
link_with: [
|
2017-11-01 14:27:13 +01:00
|
|
|
libgimpwidgets,
|
|
|
|
],
|
|
|
|
vs_module_defs: 'gimpui.def',
|
|
|
|
install: true,
|
|
|
|
version: so_version,
|
|
|
|
)
|
|
|
|
|
2020-05-11 06:34:31 +02:00
|
|
|
# Define an internal dependency for ease of reuse
|
|
|
|
libgimpui_dep = declare_dependency(
|
|
|
|
dependencies: [
|
|
|
|
libgimp_dep,
|
|
|
|
gtk3,
|
|
|
|
],
|
|
|
|
link_with: [
|
|
|
|
libgimpui,
|
|
|
|
libgimpwidgets,
|
|
|
|
],
|
|
|
|
include_directories: rootInclude,
|
|
|
|
)
|
|
|
|
|
2017-11-01 14:27:13 +01:00
|
|
|
|
|
|
|
install_headers(
|
|
|
|
libgimp_headers,
|
|
|
|
libgimpui_headers_introspectable,
|
|
|
|
subdir: gimp_api_name / 'libgimp',
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
### GObject introspection
|
|
|
|
|
2020-05-08 21:41:00 +02:00
|
|
|
libgimp_introspectable_files = [
|
2017-11-01 14:27:13 +01:00
|
|
|
libgimp_introspectable,
|
|
|
|
libgimpbase_introspectable,
|
|
|
|
libgimpcolor_introspectable,
|
|
|
|
libgimpconfig_introspectable,
|
|
|
|
libgimpmath_introspectable,
|
2021-08-03 15:54:49 +02:00
|
|
|
libgimpmodule_introspectable,
|
2023-05-31 16:12:04 +02:00
|
|
|
'gimpparamspecs-body.c'
|
2020-05-08 21:41:00 +02:00
|
|
|
]
|
|
|
|
|
|
|
|
libgimpui_introspectable_files = [
|
|
|
|
libgimpui_introspectable,
|
2017-11-01 14:27:13 +01:00
|
|
|
libgimpwidgets_introspectable,
|
|
|
|
]
|
|
|
|
|
2021-09-01 16:44:13 +02:00
|
|
|
if meson.is_cross_build() and not get_option('can-crosscompile-gir')
|
2020-10-18 00:34:02 +02:00
|
|
|
have_gobject_introspection = false
|
2019-09-22 19:51:07 +02:00
|
|
|
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',
|
2022-01-06 19:24:32 +01:00
|
|
|
'this data natively.',
|
|
|
|
'To forcefully build with GObject Introspection, set:',
|
|
|
|
'-Dcan-crosscompile-gir=true'
|
2019-09-22 19:51:07 +02:00
|
|
|
])
|
|
|
|
warning(gobject_introspection_warning)
|
|
|
|
warnings += gobject_introspection_warning
|
2023-02-22 13:42:59 +01:00
|
|
|
elif get_option('b_sanitize') != 'none'
|
|
|
|
have_gobject_introspection = false
|
|
|
|
gobject_introspection_warning = '\n '.join(['',
|
|
|
|
'GObject Introspection is disabled while building with a sanitizer.',
|
|
|
|
'See: https://gitlab.gnome.org/GNOME/gobject-introspection/-/issues/375'
|
|
|
|
])
|
|
|
|
warning(gobject_introspection_warning)
|
|
|
|
warnings += gobject_introspection_warning
|
2019-09-22 19:51:07 +02:00
|
|
|
else
|
2020-10-18 00:34:02 +02:00
|
|
|
have_gobject_introspection = true
|
2020-05-08 21:41:00 +02:00
|
|
|
libgimp_gir_includes = [
|
|
|
|
'Babl-0.1',
|
|
|
|
'cairo-1.0',
|
|
|
|
'GdkPixbuf-2.0',
|
|
|
|
'Gegl-0.4',
|
|
|
|
'Gio-2.0',
|
|
|
|
'GLib-2.0',
|
|
|
|
'GObject-2.0',
|
2023-09-13 19:13:51 +02:00
|
|
|
'Pango-1.0',
|
2020-05-08 21:41:00 +02:00
|
|
|
]
|
|
|
|
|
|
|
|
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',
|
|
|
|
'--quiet',
|
|
|
|
]
|
|
|
|
|
2019-09-22 19:51:07 +02:00
|
|
|
libgimp_gir = gnome.generate_gir(
|
|
|
|
libgimp,
|
|
|
|
libgimpbase,
|
|
|
|
libgimpcolor,
|
|
|
|
libgimpconfig,
|
|
|
|
libgimpmath,
|
2021-08-03 23:18:38 +02:00
|
|
|
libgimpmodule,
|
2017-11-01 14:27:13 +01:00
|
|
|
|
2020-05-08 21:41:00 +02:00
|
|
|
sources: libgimp_introspectable_files,
|
2019-09-22 19:51:07 +02:00
|
|
|
nsversion: gimp_api_version,
|
|
|
|
namespace: 'Gimp',
|
|
|
|
identifier_prefix: 'Gimp',
|
2020-05-08 21:41:00 +02:00
|
|
|
symbol_prefix: 'gimp',
|
|
|
|
export_packages: 'gimp-' + gimp_api_version,
|
2019-08-20 18:20:01 +02:00
|
|
|
header: 'libgimp/gimp.h',
|
2020-05-08 21:41:00 +02:00
|
|
|
includes: libgimp_gir_includes,
|
|
|
|
extra_args: gir_args,
|
|
|
|
include_directories: rootInclude,
|
|
|
|
install: true,
|
|
|
|
)
|
2017-11-01 14:27:13 +01:00
|
|
|
|
2020-05-08 21:41:00 +02:00
|
|
|
libgimpui_gir = gnome.generate_gir(
|
|
|
|
libgimpui,
|
|
|
|
libgimpwidgets,
|
2017-11-01 14:27:13 +01:00
|
|
|
|
2020-05-08 21:41:00 +02:00
|
|
|
sources: libgimpui_introspectable_files,
|
|
|
|
nsversion: gimp_api_version,
|
|
|
|
namespace: 'GimpUi',
|
|
|
|
identifier_prefix: 'Gimp',
|
2020-09-21 01:20:38 +02:00
|
|
|
symbol_prefix: [ 'gimp_ui', 'gimp' ],
|
2020-05-08 21:41:00 +02:00
|
|
|
export_packages: 'gimp-ui-' + gimp_api_version,
|
|
|
|
header: 'libgimp/gimpui.h',
|
2022-12-26 22:22:37 +01:00
|
|
|
includes: [ libgimp_gir_includes, 'Gtk-3.0', libgimp_gir[0] ],
|
2020-05-08 21:41:00 +02:00
|
|
|
extra_args: gir_args,
|
2019-09-22 19:51:07 +02:00
|
|
|
include_directories: rootInclude,
|
|
|
|
install: true,
|
|
|
|
)
|
2020-05-08 21:49:44 +02:00
|
|
|
|
2024-04-14 16:20:39 +02:00
|
|
|
if platform_osx
|
|
|
|
g_ir_compiler = find_program('g-ir-compiler')
|
|
|
|
gimp_exe_typelib = custom_target('macos-typelib.stamp',
|
|
|
|
output: [ 'macos-typelib.stamp' ],
|
|
|
|
command: [
|
|
|
|
'make-in-build-typelib.sh', libgimp_gir, libgimpui_gir,
|
|
|
|
meson.current_build_dir(), prefix, g_ir_compiler
|
|
|
|
],
|
|
|
|
build_by_default: true)
|
|
|
|
endif
|
|
|
|
|
2020-05-08 21:49:44 +02:00
|
|
|
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
|
2019-09-22 19:51:07 +02:00
|
|
|
endif
|
2022-07-31 20:03:12 +02:00
|
|
|
|
2024-08-09 01:01:58 +02:00
|
|
|
if not platform_windows and not platform_osx
|
2022-08-01 21:15:32 +02:00
|
|
|
# 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.
|
2022-07-31 20:03:12 +02:00
|
|
|
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: [
|
2022-08-31 01:07:27 +02:00
|
|
|
python, meson.project_source_root() / 'tools' / 'defcheck.py', meson.project_source_root(),
|
2022-07-31 20:03:12 +02:00
|
|
|
],
|
|
|
|
build_by_default: true,
|
|
|
|
)
|
|
|
|
endif
|