Commit Graph

101 Commits

Author SHA1 Message Date
Jehan afef78b62c plug-ins: g_object_[gs]et_data() in help-browser replaced with aux bytes arg. 2023-10-24 22:28:37 +02:00
Jehan 2b38a2df86 libgimp, plug-ins: rename gimp_procedure_new2() as gimp_procedure_new() and…
… remove the latter.

Now all GimpProcedure use this new implementation with use a config object.
2023-10-01 20:52:01 +02:00
Jehan 38ecbfc762 plug-ins: more plug-ins ported to gimp_procedure_new2(). 2023-10-01 20:52:01 +02:00
Zander Brown efabebd0bb help-browser: move menu to XML 2023-08-10 12:11:01 +00: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
Jehan bd94175c9a plug-ins: coding-style fixes.
While studying this code as base for the previous commit, I noticed various
coding style issues.
2023-01-27 01:48:33 +01: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 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 784f166815 plug-ins: clean up the patch !519 as per review.
Some coding style fixes, also one warning fix, and a lot of shuffling
around to reorganize the code. Basically removing the prototype listing
at the file start is a big error. This file is huge and without a
minimum of organization, it's a huge mess to understand what's what.

Basically a class file must always start by the class_init(), then the
init(), then the various object methods (constructed() or finalize() if
any, etc.), and possibly other parent classes' implementations. These
are the entry points, it's normal to start here (not from leaf
functions!).
Then we get the public functions which are other entry points (calls
from other parts of the code). And only after, private functions such as
signal or action callbacks, and utilities at the very end.

This requires a well organized prototype listing, which works as a menu,
and prevents the implementation order to depend on call order (this gets
us completely random order and imply usually that top functions are the
less important ones, such as utilities, just how it was before this
commit).

Anyway I'm not sure why I spent time on this because we deprecated this
plug-in, but if we still want to push nice updates (like MR !519), we
should at least do it well and clean. Also it's a good first example for
plug-in rewrite in modern no-GtkAction code.
2022-03-25 14:55:25 +01:00
Niels De Graef dddb23c6e5 help-browser: Rewrite without GtkAction
The initial attempt of this commit was to remove the `GtkAction` usage,
but grew a bit wider than that. The following happened:

* The dialog became a proper GObject, rather than being a big chunk of
  static variables that were hopefully initialized before you used them.
* The dialog now uses `GAction`s to implement actions, and converted
  some signal handlers to actions as well.
* The plug-in run procedure now uses `GtkApplication`. This is one hand
  necessary to be able to set accelerators for actions, but on the other
  hand is more future-proof, as GTK4 removes `gtk_main()`
2022-03-25 11:49:39 +00:00
Niels De Graef 8eb7f6df9e Remove GimpStringArray in favor of GStrv
GLib has a specific type of NULL-terminated string arrays:
`G_TYPE_STRV`, which is the `GType` of `char**` aka `GStrv`.

By using this type, we can avoid having a `GimpStringArray` which is a
bit cumbersome to use for both the C API, as well as bindings. By using
`GStrv`, we allow other languages to pass on string lists as they are
used to, while the bindings will make sure to do the right thing.

In the end, it makes the API a little bit simpler for everyone, and
reduces confusion for people who are used to working with string arrays
in other C/GLib based code (and not having 2 different types to denote
the same thing).

Related: https://gitlab.gnome.org/GNOME/gimp/-/issues/5919
2022-02-12 00:07:53 +00:00
Jehan a982809c5f configure, meson, plug-ins: unmaintain WebkitGTK-depending plug-ins.
This is an official way to declare these plug-ins as now
unmaintained/deprecated.
Relevant plug-ins are:

1) help-browser (Displaying the docs): nowadays every desktop machine
   has a browser. Let's just use whatever is the person's default
   browser.
2) web-page (Web screenshot): it looks to me like every browser has this
   feature by default now (I use it all the time in Firefox to get a
   full-page screenshot, never in GIMP), even on mobile, I am told. It's
   nice to have it in GIMP too, but not like absolutely necessary.

On the other hand:

1. It's a hell to build, with a lot of issues. We have regular issues on
   our Flatpak-s. We don't manage to build it on our CI (only locally
   apparently). Also it takes a crazy amount of time (like 90% of CI
   build-time would be webkit).
2. From what I gather, new versions don't work on Windows anymore. Even
   MSYS2 seems to have dropped the ball and don't try anymore.
   Basically we would have a feature disparity from GIMP 3.0 (most
   platform but Windows). We don't know when it will be resolved (if
   ever) as it's been like this for years.

Now why we are keeping the code around instead of just removing
everything is that the topic tree in the help browser is useful and
comfortable to use. Ideally we should get some equivalent to help
browsing the help efficiently in the web docs as well (so basically
menus, web search and alike?). So I am told to keep the code around at
least for now to see if we can figure something out or improve the
situation.
Except for this point, we can consider the WebkitGTK plug-ins as
deprecated from GIMP 3.0 on.
2021-12-22 18:59:07 +01:00
Niels De Graef 5992a42231 gimpthrobber: Get rid of g_type_class_add_private()
It's deprecated.
2020-05-12 21:35:54 +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
Niels De Graef 878804fb01 Cleanup GObject signal marshallers
* Don't generate our own marshallers if they are available in GLib
  already
* Don't set the c_marshaller parameter in `g_signal_new()` if it's a
  default marshaller provided by GLib. See commit message of commit
  39e4aa3c57 on why this is the case.
2020-04-01 21:20:01 +00: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
Jehan 642e47efaa plug-ins: fix warning.
Fix the following warning for missing case values:
> enumeration value ‘WEBKIT_LOAD_REDIRECTED’ not handled in switch
(same for WEBKIT_LOAD_COMMITTED)
2019-09-17 11:21:19 +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 02d06bb354 plug-ins: help and help-browser don't need libgimp class porting. 2019-08-28 15:08:10 +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
Michael Natterer 4cb4b3ef3a plug-ins: port all plug-ins to the new macros 2019-08-20 01:03:38 +02:00
Michael Natterer 9cabc8c8d0 libgimp, plug-ins: use the new macros everwhere
Except for gimp_param_spec_string() which is on its way back to the
core.
2019-08-19 10:02:07 +02:00
Michael Natterer 5a09523214 Remove GIMP_TYPE_INT32 and GimpParamSpecInt32
Use gint and GParamSpecInt instead.
2019-08-15 14:04:56 +02:00
Michael Natterer 0491f653fa plug-ins: port help-browser to GimpPlugIn 2019-08-13 00:38:02 +02:00
luz.paz ac282f2045 Misc. typos
Found via `codespell`
2018-10-19 15:30:27 +00:00
Michael Natterer bab75b7365 Change a bazillion URLs to https://
Including all user-visible link and links called from code, like
the help pages.
2018-07-14 14:19:27 +02:00
Michael Natterer 5f700549e7 Change the license URL from http://www.gnu.org/licenses/ to https:// 2018-07-11 23:29:46 +02:00
Adrian Perez de Castro 9fae08595d plug-ins: help-browser Web view does not need a scrolled window
In WebKitGTK+ 2.x the WebKitWebView widget handles scrolling itself
and does not need to be contained inside a GtkScrolledWindow.
2018-07-07 13:00:23 +00:00
Adrian Perez de Castro d34f46b3c4 plug-ins: port help-browser to WebKitGTK+ 2
This is the minimum set of changes needed to update help-browser to the
WebKitGTK+ 2 API. Fortunately, the plug-in did not use parts of the old
API which would have been difficult to port (DOM bindings, for example),
and therefore the code translates quite well to the new API. The main
differences are:

- WebKitWebFrame is gone, most of its methods are now in WebKitWebView.
- Searching for text inside Web pages has to be done now through the
  WebKitFindController object.
- Checking whether there is selected text that can be copied now goes
  through WebKitEditorState.
- The WebKitWebView::title-changed signal is no more, the callback is
  connected to notify::title instead.
- The load-started and load-finished pair of signals are now merged
  into WebKitWebView::load-changed.
- There are no methods to zoom a WebKitWebView in and out, instead
  the zoom-level property is set. The updated code ensures that the
  zoom lovel stays inside the [0.1, 10.0] range.
- Page visit history now goes through WebKitBackForwardList.

The updated plug-in was successfully built in tested with WebKitGTK+
version 2.20.3.
2018-06-25 23:54:56 +00:00
Jehan 870ca6334d plug-ins: install plug-ins in subfolder.
I am going to forbid plug-ins from being installed directly in the root
of the plug-ins/ directory. They will have to be installed in a
subdirectory named the same as the entry point binary.
This may seem useless for our core plug-ins which are nearly all
self-contained in single binaries, but this is actually a necessary
restriction to eliminate totally the DLL hell issue on Windows. Moving
core plug-ins in subfolders is only a necessary consequence for it.
2018-05-20 21:06:35 +02:00
Michael Natterer 6c8cf7876a Replace lots of deprecated gtk_menu_popup(), only GimpUIManager left 2018-05-20 21:06:30 +02:00
Michael Natterer ce2cd374ee Replace gdk_cursor_unref() with g_object_unref() 2018-05-20 21:06:28 +02:00
Michael Natterer dda54c1df8 Deprecate stock items for good and change all icon defines to GIMP_ICON_*
Try to sort all GIMP_ICON_* defines into FDO categories like in
https://specifications.freedesktop.org/icon-naming-spec/latest/ar01s04.html

Add defines for all icons we override, rename some icons to their FDO
standard names, and mark the ones we duplicate with a comment so we
don't forget to rename those to standard names in 3.0.
2017-03-05 16:01:59 +01:00
Jehan d967219925 plug-ins: tab cleaning. 2017-02-01 01:59:45 +01:00
Jehan 6c674e973c app, libgimp*, plug-ins, icons: revert icon names into freedesktop...
... standard icon names and GTK+ icon names as second choice.
We should only use GIMP specific icon names as last resort, when there
is no standard or GTK+ names dedicated to the function.
This is made possible thanks to commit 3cc77b0.

s/gimp-document-recent/document-open-recent/
s/gimp-indent/format-indent-more/
s/gimp-next/go-next/
s/gimp-previous/go-previous/
s/gimp-save/document-save/
s/gimp-save-as/document-save-as/
s/gimp-revert/document-revert/
s/gimp-open/document-open/
s/gimp-document-recent/document-open-recent/
s/gimp-quit/window-close/ ou s/gimp-quit/application-exit/
s/gimp-warning/dialog-warning/
s/gimp-edit-clear/edit-clear/

s/gimp-justify-.*/gtk-justify-.*/
s/gimp-font/gtk-select-font/
s/gimp-color-palette/gtk-select-color/
s/gimp-cancel/gtk-cancel/
2016-09-03 15:49:29 +02:00
klausstaedtler 37c3c01cf1 icons: Bug 759904
add
gimp-next
gimp-previous


patch
gimpcolordisplayeditor.c
gimpcontrollerlist.c
dialog.c
tips-dialog.c
gimpicons.c
gimpicons.h
2016-06-10 13:50:44 +02:00
Michael Natterer 47ef3be145 Initialize GValues with G_VALUE_INIT instead of { 0, } 2016-03-26 15:59:26 +01:00
Michael Natterer c90bcccd3a plug-ins: use gtk_window_set_icon_name() in the help browser
instead of loading all icons from the theme manually and setting them
as icon_list-.
2015-03-29 21:42:03 +02:00
Michael Natterer a54b1ca12c plug-ins: port help-browser to icon names 2014-05-12 00:17:57 +02:00
Michael Natterer af8cebc2f7 plug-ins: only include "libgimp/gimp.h" and "libgimp/gimpui.h" 2013-11-01 22:13:05 +01:00
Michael Natterer ec786816bb */Makefile.am: merge INCLUDES into AM_CPPFLAGS
automake-1.13 finally warns about this anachronism.
2013-06-05 20:48:37 +02:00
Michael Muré 9966bcfd13 remove now useless and deprecated g_thread_init
Warning

g_thread_init has been deprecated since version 2.32 and should not be used in newly-written code. This function is no longer necessary. The GLib threading system is automatically initialized at the start of your program.
2012-05-03 20:44:07 +09:00
Øyvind Kolås d1ced11415 plug-ins: add GEGL_CFLAGS to many Makefile.am's 2012-05-02 17:46:08 +02:00
Michael Natterer 899c35e4df plug-ins: fix coding style in the last commit 2012-01-09 20:49:45 +01:00
Ulf-D. Ehlert fd66a38dd6 Bug 653907 - Help-browser fails to sort top-level items
Sort help-browser items by a new attribute "sort", if available (to be
provided by the "gimp-help.xml" file).
2012-01-09 20:04:28 +01:00
Michael Natterer 79a4f71884 configure: depend on webkitgtk >= 1.6.1
because old versions use deprecated GLib stuff in their headers.
Don't #undef G_DISABLE_DEPRECATED in help-browser and web-page.
2011-12-01 11:26:11 +01:00
Mukund Sivaraman 9ab50f28e3 help-browser: Delete dead variable and assignment 2011-10-10 09:57:58 +05:30
Mukund Sivaraman fc3f59872d help-browser: Remove dead assignment (and variable) 2011-10-03 19:10:55 +05:30