Commit Graph

422 Commits

Author SHA1 Message Date
Alx Sa 8709e91999 plug-ins: Make GFig menus translatable
Based on the IMAP port in !1031, this moves the menu code to a separate file
so that gettext can access it for translation.
2023-08-09 16:17:00 +00:00
Alx Sa 624ae512fc plug-ins: Fix typo in gfig-arc
Resolves #5742.
The check is for a horizontal line (where the Y coordinate
would be the same for all three points), but the X axis was
checked instead due to a copy/paste error.
2023-07-11 15:25:39 +00:00
Michael Natterer 5acdaac8e0 libgimp: remove getters and setters from GimpResourceSelectButton subclasses 2023-05-31 17:18:19 +02:00
Michael Natterer 9638102418 Introduce a global ID space for GimpData/GimpResource objects
Much like for images and items. Change the PDB to transmit IDs
instead of names for brush, pattern etc. and refactor a whole
lot of libgimp code to deal with it.

	modified:   libgimp/gimpplugin-private.h
2023-05-31 16:12:04 +02:00
Michael Natterer 26dce72d2c Remove autotools 2023-05-27 00:03:52 +02:00
Simon Budig d16734a4e4 plug-ins: fix some glib related deprecations 2023-05-20 21:46:17 +02:00
Anders Jonsson 7c4ad8aed7 plug-ins: typo and spacing fixes 2023-03-26 19:20:48 +00:00
Alx Sa 3df39dee91 plug-ins: Re-add toggle behavior from GAction port
When porting IFS-Compose and GFig to GAction, I originally created
all icons as GtkToolButtons. However, the toggle buttons no longer 
appeared "pressed in" when selected.

This is fixed by creating those as GtkToggleToolButtons instead.
A lingering UIManager object was removed from IFS Compose as well.
2023-02-24 03:25:08 +00:00
Alx Sa 38c031e01d plug-ins: Port GFig to GAction/GMenuModel
Because of how many actions can change the sensitivity of "undo" options
most of the plug-in files had to be edited to pass GimpGfig to them.
2023-02-04 23:16:24 -05:00
lloyd konneker e00f2d7f50 Fix plugins to use new GimpResource. 2023-01-14 17:43:26 +01:00
lloyd konneker d59a7af38c libgimp: API refactor GUI for GimpResource
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
2023-01-14 16:38:40 +00:00
lloyd konneker d720375e97 2.99 libgimp: add GimpResource, GimpBrush, GimpPropWidgetBrush
So procedures can declare args and GimpProcedureDialog show chooser
widgets

Fix so is no error dialog on id_is_valid for resources

Palette.pdb changes and testing

Memory mgt changes

Gradient pdb

Font and Pattern tests

Test  brush, palette

Cleanup, remove generator

Rebase, edit docs, install test-dialog.py

Whitespace, and fix failed distcheck

Fix some clang-format, fix fail distcheck

Fix distcheck

Cleanup from review Jehan
2023-01-14 12:58:05 +00:00
Jehan ca230cb770 meson: fix warnings of deprecated features.
Now that we bumped our meson requirement, meson is complaining about
several features now deprecated even in the minimum required meson
version:

s/meson.source_root/meson.project_source_root/ to fix:

> WARNING: Project targets '>=0.56.0' but uses feature deprecated since '0.56.0': meson.source_root. use meson.project_source_root() or meson.global_source_root() instead.

s/meson.build_root/meson.project_build_root/ to fix:

> WARNING: Project targets '>=0.56.0' but uses feature deprecated since '0.56.0': meson.build_root. use meson.project_build_root() or meson.global_build_root() instead.

Fixing using path() on xdg_email and python ExternalProgram variables:

> WARNING: Project targets '>=0.56.0' but uses feature deprecated since '0.55.0': ExternalProgram.path. use ExternalProgram.full_path() instead

s/get_pkgconfig_variable *(\([^)]*\))/get_variable(pkgconfig: \1)/ to
fix:

> WARNING: Project targets '>=0.56.0' but uses feature deprecated since '0.56.0': dependency.get_pkgconfig_variable. use dependency.get_variable(pkgconfig : ...) instead
2022-08-31 01:29:37 +02:00
Jehan df074bfe09 plug-ins: label and documentation of plug-ins localized plug-in side.
This is the consequence of previous commit. Plug-ins' label and
documentation are now localized before sending these data to GIMP core.
In other words, we replace N_() macros with basic gettext calls.
2022-07-05 12:23:51 +02:00
Jehan 18c37f7084 plug-ins, libgimp: override set_i18n() for all our core plug-ins.
Hence avoiding the stderr messages. These are going to be localized with
centrally installed catalogs "gimp*-std-plugins", "gimp*-script-fu" and
"gimp*-python".

We now handle core plug-in localizations differently and in particular,
with kind of a reverse logic:

- We don't consider "gimp*-std-plugins" to be the default catalog
  anymore. It made sense in the old world where we would consider the
  core plug-ins to be the most important and numerous ones. But we want
  to push a world where people are even more encouraged to develop their
  own plug-ins. These won't use the standard catalog anymore (because
  there are nearly no reasons that the strings are the same, it's only a
  confusing logic). So let's explicitly set the standard catalogs with
  DEFINE_STD_SET_I18N macro (which maps to a different catalog for
  script-fu plug-ins).
- Doing something similar for Python plug-ins which have again their own
  catalog.
- Getting rid of the INIT_I18N macro since now all the locale domain
  binding is done automatically by libgimp when using the set_i18n()
  method infrastructure.
2022-06-05 01:57:02 +02:00
Jehan 27dea4f7f7 plug-ins: various g_file_get_path() replaced by g_file_peek_path().
As explained in previous commits, the _peek_ call is advantageous
because:
- It is less bug-prone as we don't have to handle freeing the string. In
  all the cases I changed, I even spotted at least 2 cases where we were
  leaking a string (in file-mng, `temp_file_name` is never freed; and we
  were also leaking in an error case of gfig).
- As a consequence of the previous point: simpler code with less lines.
- In local file cases, the _peek_ variant does not even need to allocate
  an additional string.
- In other case, if we query several times the path, it is allocated
  once and cached so it stays efficient.
- When possible, working on the GFile rather than on a path string may
  be more robust. For instance I changed one g_unlink() into a
  g_file_delete(). Actually most reading/writing should be done with the
  GIO API when possible, but I didn't want to change too much code
  logics on this commit.
2021-10-01 18:47:30 +02:00
Jehan df723aca28 plug-ins: use GimpChannelOps in gfig rather than using a custom…
… SelectionType enum which lists anyway the same.

Fixes various warnings:

> warning: implicit conversion from ‘SelectionType’ to ‘GimpChannelOps’
2021-04-06 17:27:08 +02:00
Jehan ca8bc2bc1d app, libgimp, pdb, plug-ins: more functions moved to get|set().
The gimp_drawable_type() is an issue though as gimp_drawable_get_type()
is already defined as a common GObject API.
Though I'm actually wondering if GimpImageType is well called. Rather
than Type, shouldn't we go with ColorModel?

sed -i 's/\<gimp_drawable_bpp\>/gimp_drawable_get_bpp/g' "$@"
sed -i 's/\<gimp_drawable_width\>/gimp_drawable_get_width/g' "$@"
sed -i 's/\<gimp_drawable_height\>/gimp_drawable_get_height/g' "$@"
sed -i 's/\<gimp_drawable_offsets\>/gimp_drawable_get_offsets/g' "$@"
2021-04-06 14:34:31 +02:00
Jehan 931b9fb539 plug-ins: fix all remaining GimpImageProcedure to new run() API. 2021-04-04 01:40:00 +02:00
Jehan 63d6d770c4 plug-ins: replace gimp_parasite_data*() with gimp_parasite_get_data().
Similarly to the previous commit, it is not only about using the new
API. I also make sure we do not assume that parasite data is
nul-terminated. In many places, we were just assuming so because these
were supposed to be parasite our code set. Yet these are data input
contained in files which can be wrong for any reason (corrupted file,
bugs, other scripts/plug-ins editing these parasites…). So instead of
assuming string parasites are always correctly formatted, I make sure
they are nul-terminated by passing them through g_strndup() when
necessary.
2021-01-30 00:20:34 +01:00
Rafał Mikrut 3e35fe4d80 Cppcheck fixes 2020-11-05 19:42:14 +00:00
Jehan d95f417719 app, libgimpwidgets, modules, plug-ins: code changes after GimpScaleEntry…
… reclassing as GimpLabelSpin subclass.
2020-11-05 18:06:52 +01:00
Jehan b3c0ba061b app, libgimpwidgets, modules, plug-ins: finishing GimpScaleEntry port.
Renaming the temporary function gimp_scale_entry_new2() into
gimp_scale_entry_new() now that the original code is entirely gone. This
is now a fully-fledged widget with a nice and proper introspectable API.
2020-11-01 02:46:20 +01:00
Jehan 7ebd19636c plug-ins, modules: more port to GimpScaleEntry. 2020-10-31 02:07:35 +01:00
Jehan 7462945360 plug-ins: fix a type warning.
Since obj->type_data is also int anyway, multiplying by a double value
is unneeded anyway. So let's just make an integer multiplication.
Fixes the following warning:
> warning: using integer absolute value function ‘abs’ when argument is
> of floating point type ‘double’ [-Wabsolute-value]
2020-10-24 02:58:38 +02:00
Elad Shahar 0a611bd8ad Issue #5069: Gfig uses the Stroke color for filling instead of the fill color 2020-07-12 21:43:44 +02:00
Niels De Graef ae34e778fc meson: Use libgimp(ui)_dep in plug-ins meson files
This gives a big cleanup in the meson.build files of the plug-ins.

It's also quite a bit more maintainable, since anything that changes in
libgimp's dependencies, linkage, ... doesn't have to be copy-pasted into
each plug-in.
2020-05-11 07:01:37 +02:00
luz.paz 36f620012d Fix typos
Found via codespell v1.17.0.dev0  
```
codespell -q 3 -S ./ChangeLog*,*.po,./.git,./NEWS* -L als,ang,ba,chello,daa,doubleclick,foto,hist,iff,inport,klass,mut,nd,ower,paeth,params,pard,pevent,sinc,thru,tim,uint
```
2020-05-04 08:55:48 -04:00
Michael Natterer 452924dbe9 Issue #5009 - Possible array overrun in d_draw_ellipse
Change while() to go from 0..360 instead of 0..361 so the code passes
automated tests. The code never ran into this situation but the change
is a small improvement anyway.
2020-05-02 16:52:18 +02:00
Jehan f6dd30f3a8 plug-ins: fix more abs().
I am comparing absolute value of 2 double computation results. Might as
well just use fabs() instead of truncating both values to int.
Fixes the following:
> warning: using integer absolute value function ‘abs’ when argument is
> of floating point type ‘double’ [-Wabsolute-value]
2020-04-14 00:12:45 +02:00
Michael Schumacher 1f149b15ab plug-ins: correctly renaming plug-ins/gfig/gfig-examples/smily to smiley 2019-12-21 00:18:56 +00:00
luz.paz 2a1713c008 plug-ins: rename plug-ins/gfig/gfig-examples/simily to smiley
+ renamed `plug-ins/gfig/gfig-examples/simily` to `plug-ins/gfig/gfig-examples/smiley`  
+ updated make files  
+ corrected typo
2019-12-19 20:28:00 -05:00
Michael Natterer 876199a03f devel-docs, libgimp: update some .gitignore files 2019-11-19 20:40:22 +01:00
Michael Natterer 1bca89163d libgimpbase: remove gimp_personal_rc_file()
and port its remaining users to gimp_directory_file().
2019-09-21 18:08:13 +02:00
Michael Natterer df8d5b02ae libgimp, plug-ins: remove the "preview" parameter from gimp_ui_init()
It's dead since a looong time.
2019-09-20 19:56:00 +02:00
Michael Natterer 6468fa06c7 pdb, plug-ins: change gimp_temp_name() to gimp_temp_file() 2019-09-11 22:32:44 +02:00
Félix Piédallu 65eff6f150 Meson port. 2019-09-11 16:42:04 +02:00
Michael Natterer 8a78203aed Properly prefix the values of enum GimpPDBProcType
to be GIMP_PDB_PROC_TYPE_PLUGIN, _EXTENSION etc.
2019-08-30 12:52:28 +02:00
Jehan 883fbd7b65 plug-ins: fixing automake warnings about source in subdirectories.
This fixes:
> warning: source file 'images/imagemap-icon-images.c' is in a subdirectory,
> but option 'subdir-objects' is disabled
And similar warnings.
2019-08-22 22:36:50 +02:00
Félix Piédallu 211e5f51a5 plug-ins: do not #include c autogenerated sources 2019-08-22 18:45:31 +02:00
Jehan 962e8b995e plug-ins: port gfig to GimpImage|Drawable. 2019-08-22 15:54:36 +02:00
Jehan e0d50aa121 plug-ins: keep building all plug-ins with old API.
Build existing plug-ins with -DGIMP_DEPRECATED_REPLACE_NEW_API.
We will port the plug-ins one at a time to the new GimpImage API.
2019-08-22 15:54:36 +02:00
Jehan 045d03a3de plug-ins: some very minor style (alignment) fixes. 2019-08-18 22:37:31 +02:00
Michael Natterer 15019fef52 plug-ins: port many plug-ins from GimpProcedure to GimpImageProcedure
Also move the call to set_icon_name() after set_menu_label(), all
ported plug-ins should look the same so we are a good example for copy
and paste ;)
2019-08-18 13:45:58 +02:00
Michael Natterer 0b5f5bf70a plug-ins: port gfig to GimpPlugIn 2019-08-14 12:58:27 +02:00
Jehan ee4e9bfee5 plug-ins: missing backslash broke EXTRA_DIST.
Because of this, EXTRA_DIST was empty, hence images and XML resource
file were missing from the distributed files.
2019-07-28 23:47:05 +02:00
Michael Natterer 3a453fa918 plug-ins: gfig-icons.c doesn't need an i18n include any longer 2019-07-21 16:52:24 +02:00
Jehan a7a7cd7710 plug-ins: fix VPATH build.
XML files need to be found by the tools when the build is out of the
source tree.
2019-07-21 13:15:14 +02:00
Michael Natterer 91f27dfc02 plug-ins: replace stock icons in gfig by a resource 2019-07-20 16:27:32 +02:00
luz.paz 386587736f Misc. typo fixes
Found via `codespell`
2018-09-16 18:49:18 -04:00