Commit Graph

26 Commits

Author SHA1 Message Date
Jehan dbbcfb16d5 app, libgimp*, pdb, plug-ins: GimpContext is now using only GeglColor.
- app: gimp_context_get_(foreground|background)() are now returning a GeglColor.
- libgimp: PDB functions named similarly in libgimp are returning a newly
  allocated GeglColor too.
- A few other PDB functions (the ones using these functions) were updated and
  their signature changed to use GeglColor too, when relevant. Plug-ins which
  use any of the changed libgimp functions were fixed.
- GimpContext: signals "(foreground|background)-changed" are now passing a
  GeglColor.
- libgimpconfig: new macro GIMP_CONFIG_PROP_COLOR using gegl_param_spec_color().
- GimpContext: properties "foreground" and "background" are now GeglParamColor
  properties.
- app: All code interacting with GimpContext objects were updated to receive a
  GeglColor (that they may still convert, or no, to GimpRGB for now).
- app: gimp_prop_gegl_color_button_new() was added as an alternative to
  gimp_prop_color_button_new() when the property is a GeglParamColor. Eventually
  the former should replace completely the latter.
- libgimpwidgets: gimp_prop_color_area_new() now works on GeglParamColor
  properties only.
- libgimp: gimp_procedure_dialog_get_widget() will generate a GimpColorArea for
  GeglTypeParamColor arguments.
2024-02-11 23:28:02 +01:00
Jehan 622d0da43e app, libgimpwidgets: allowing changing a dockable settings value while…
… blinking it.

This will be necessary to demo new features available only in some
situations. E.g. a new option in line art detection mode of bucket fill
would require said mode to be enabled.
2022-03-06 19:30:31 +01:00
Jehan 93021b19e1 app, libgimpwidgets: create private gimp_widget_set_identifier() API.
I add it in libgimpwidgets because we need to also use it on propwidgets
created from there, but it's actually only for core GUI usage, so it's
actually in a private part of the library.

Though it's actually doing quite a basic thing, it is nicer and more
foolproof than a manual g_object_set*() everywhere. Moreover it will be
nicer to grep.
2022-03-05 22:51:35 +01:00
Jehan efaf9e099e app, libgimp, libgimpwidgets: fix "Application icon missing" in tests.
When running tests, the data are not meant to be necessarily installed.
Therefore icons won't be found when calling gimp_widgets_init().

Add some special-casing to find them relatively to the install
directory.
2021-12-23 13:39:43 +01:00
Jehan 8ca232252a libgimpwidgets: fix incomplete relocatable build commit.
Commit 8025962a20 was meant to make the icon code work on relocatable
builds, yet I realize that the gdk_pixbuf_new_from_file() calls were
still using the DATAROOTDIR build-time macro. I had forgotten to update
these.

Also update a bit the error handling by adding a GError (for more
debugging info) and a newline for pretty-printing.
2021-07-07 20:20:31 +02:00
Jehan 4a00a993f2 libgimpwidgets: use g_printerr() instead of g_warning() for app icons.
Unit testing consider warnings as criticals and doesn't like when it
cannot find the installed application icons. To fix the `make check`,
just print the missing icon information to stderr, but don't make it a
GLib warning.
2021-07-06 18:51:16 +02:00
Jehan 8025962a20 libgimpwidgets: fix meson/mingw-w64 build and relocatable builds.
While passing the DATADIR macro works fine natively on Linux, it somehow
failed with the mingw-w64 build with a very weird error:

> <command-line>: error: expected identifier or '(' before string constant

I could not understand what it means, as the '-DDATADIR="/some/path"'
syntax is completely fine as far as I can see.
Anyway since I see that DATAROOTDIR is already defined in meson config.h
(but not in the autotools build, just the meson one!), and using
datarootdir instead of datadir seems to be just fine (actually maybe
even more appropriate when it comes to looking up the hicolor
application icons), I just switched to using it.

In the same time, I realized that my code using build-time macros won't
work for relocatable builds anyway. So this commit also adds a bit of
code path variant using gimp_installation_directory() in the case of
ENABLE_RELOCATABLE_RESOURCES code path.
2021-07-06 13:37:33 +02:00
Jehan 3598562472 app, libgimpwidgets: drop the thumbnail icon feature.
From years of discussions, it turns out that:
- The thumbnailed-Wilber icon replacing the generic icon of GIMP often
  makes the application harder to spot in the icon list of running
  processes.
- In single-window mode in particular, it makes even less sense as we
  just show the one active image anyway.
- Even in multi-window mode, nowadays many OSes or desktop group windows
  of a same application under one icon. So we end up with several image
  windows under a thumbnail only showing the top image. This happens in
  KDE, GNOME, Cinnamon and Windows at least apparently (as far as is
  being reported).
- Some platforms would just use only the OS-declared icon and not care
  about runtime-declared ones. This is apparently the case on macOS, and
  also on GNOME when the desktop file is seen by the desktop
  environment. So all our code about generating thumbnailed icon is
  wasted on these platform anyway.
- When intensively testing the current behavior, I had cases when the
  icon was not properly updated. We could of course investigate and fix
  the issues, but considering all the previous points, it might make
  more sense to simply drop the feature which is mostly useless, or
  worse bothersome, hence simplify the code greatly.
- Finally API to set icons from GdkPixbuf data has been removed in GTK4.
  So long term, trying to keep this whole machinery feels like just
  making our life difficult for a feature which all OSes seem to
  deprecate and which might not be possible anymore soon (or just get
  harder and harder to implement).

Note that I don't use gtk_window_set_default_icon_name() because it
would use the icon from our theme, yet so far we are not sure it makes
sense for the application icon which we probably always want to be the
same, whatever the chosen theme. Finally I just list various common icon
sizes because GTK API doesn't seem to be clever enough yet. I can't just
give it 1 SVG image (e.g. with gtk_window_set_default_icon_from_file())
and hope it does the resizing at the last minute. It turns out it
doesn't and we get an extra-small icon. So instead, let's generate
common sizes ourselves from the same SVG.
2021-07-06 11:21:37 +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
Jehan 0ac3cd01f0 libgimpwidgets: fix default icon.
gtk_window_set_default_icon_name() apparently isn't able to properly
fallback to symbolic or non-symbolic variant. So let's test both.
There is also gtk_window_set_icon_list() but it takes a list of pixbuf,
so I really doubt it is the best solution either. The proposed solution
is working ok for now, even though I feel it is again a bit hackish.
2018-05-30 23:52:24 +02:00
Ell e64e61ca58 libgimpwidgets: call babl_exit() when unloading
If the compiler supports destructors (which should cover at least
GCC and Clang), pair the call to babl_init() in gimp_widgets_init()
with a call to babl_exit() when the library in unloaded.  This is
important in particular since the babl fish cache is constructed/
updated upon the last matched call to babl_exit().
2017-05-31 22:14:45 -04:00
Michael Natterer 937900d618 Bug 783166 - Script-Fu color selector crashes
libgimpwidgets now needs an initialized babl if color selectors are
used, call babl_init() in gimp_widgets_init(). It can be safely called
redundantly.
2017-05-28 16:32:52 +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
Michael Natterer 71894bd787 libgimpwidgets: rename gimpstock.[ch] to gimpicons.[ch]
because stock is on its way out, so we better start renaming and
deprecating stuff sooner than later.
2015-12-12 20:44:46 +01:00
Michael Natterer f8a9f39466 libgimpwidgets: use gtk_window_set_default_icon_name()
instead of gtk_window_set_default_icon_list() which requires having
actual GdkPixbufs around. Move the 32x32 and 48x48 wilber images to
the icon theme, and remove all inline pixbuf generation stuff from
libgimpwidgets.
2015-03-29 21:00:11 +02:00
Michael Natterer fcfb7cf160 Use the new g_[s]list_free_full() instead of foreach() and free() 2011-03-07 17:11:28 +01:00
Michael Natterer 56994869cd libgimpwidgets: register descriptions for the GdkInputMode enum
so the combo box in the input dialog shows proper labels and
translations instead of GDK_MODE_FOO.
2010-06-11 09:53:08 +02:00
Michael Natterer d9b5207aa2 Change licence to GPLv3 (and to LGPLv3 for libgimp).
2009-01-17  Michael Natterer  <mitch@gimp.org>

	* all files with a GPL header and all COPYING files:

	Change licence to GPLv3 (and to LGPLv3 for libgimp).

	Cleaned up some copyright headers and regenerated the parsers in
	the ImageMap plugin.


svn path=/trunk/; revision=27913
2009-01-17 22:28:01 +00:00
Michael Natterer a446f3d7fb use the new tooltip API instead of the old deprecated one. Removed
2007-11-09  Michael Natterer  <mitch@gimp.org>

	* libgimpwidgets/gimphelpui.[ch]: use the new tooltip API instead
	of the old deprecated one. Removed _gimp_help_init(). Remember
	whether tooltips are enabled or not in a local variable that can
	only be altered at startup time and not after. The API now expects
	markup instead of plain text which might cause warnings and
	perhaps needs to be changed.

	* libgimpwidgets/gimpwidgets-private.c: don't call _gimp_help_init().

	* app/config/gimpguiconfig.c: made show-tooltips a
	GIMP_CONFIG_PARAM_RESTART property.

	* app/widgets/gimptoolbox-color-area.c: don't add the tooltip here...

	* app/widgets/gimptoolbox.c: ...but here (as for all other
	indicators). Also escape '&' properly because we now use markup.

	* app/tools/gimpselectionoptions.c
	* app/widgets/gimpeditor.c
	* app/widgets/gimpwidgets-utils.c: print modifiers and
	shortcuts in bold instead of in ().

	* app/widgets/gimpcontainertreeview.c: show tooltips on rows if
	gimp_viewable_get_description() returns a tip.

	* app/dialogs/preferences-dialog.c
	* plug-ins/jpeg/jpeg-save.c
	* plug-ins/MapObject/mapobject_ui.c
	* plug-ins/Lighting/lighting_ui.c
	* plug-ins/common/animationplay.c
	* plug-ins/common/warp.c: no need to add event boxes just to have
	tooltips, the new ones work on all widgets.


svn path=/trunk/; revision=24093
2007-11-09 11:17:00 +00:00
Sven Neumann ca8ef2e312 desktop/Makefile.am removed.
2006-03-29  Sven Neumann  <sven@gimp.org>

        * desktop/Makefile.am
        * desktop/gimp.png: removed.

        * desktop/16x16/gimp.png
        * desktop/22x22/gimp.png
        * desktop/24x24/gimp.png
        * desktop/32x32/gimp.png
        * desktop/48x48/gimp.png
        * desktop/64x64/gimp.png
        * desktop/scalable/gimp.svg: new application icons in different
        sizes, contributed by Jakub Steiner.

        * themes/Default/images/Makefile.am
        * themes/Default/images/stock-wilber-32.png
        * themes/Default/images/stock-wilber-48.png: removed.

        * libgimpwidgets/Makefile.am
        * libgimpwidgets/wilber-16.png
        * libgimpwidgets/wilber-32.png
        * libgimpwidgets/wilber-48.png
        * libgimpwidgets/wilber-64.png: new window icons, identical to the
        new application icons.

        * libgimpwidgets/gimpwidgets-private.c: use the new window icons.
2006-03-29 11:59:51 +00:00
Sven Neumann 031f10b41d updated year in copyright.
2005-08-18  Sven Neumann  <sven@gimp.org>

	* app/dialogs/user-install-dialog.c: updated year in copyright.

	* libgimpwidgets/gimpwidgets-private.c (gimp_widgets_init):
	register the default window icons in descending sizes.
2005-08-18 17:39:27 +00:00
Michael Natterer 5221d4daa6 libgimpbase/Makefile.am libgimpbase/gimpbase-private.[ch] new files
2003-11-15  Michael Natterer  <mitch@gimp.org>

	* libgimpbase/Makefile.am
	* libgimpbase/gimpbase-private.[ch]
	* libgimpbase/gimpunit.c: new files implementing GimpUnitVTable
	(formerly known as GimpWidgetsVTable). Now the unit functions
	finally live in the same library as their header declarations.

	* libgimpbase/gimpunit.h: removed comment about being a header for
	two different files.

	* libgimpwidgets/gimpwidgets-private.[ch]: removed
	GimpWidgetsVTable.

	* libgimpwidgets/gimpsizeentry.c
	* libgimpwidgets/gimpunitmenu.c
	* libgimpwidgets/gimpwidgets.c: use normal gimp_unit functions
	again.

	* libgimp/gimpui.c
	* app/gui/gui.c: removed GimpWidgetVTable stuff.

	* libgimp/Makefile.am
	* libgimp/gimpunitcache.[ch]: new files.

	* libgimp/gimpunit.c: removed (moved to gimpunitcache.c).

	* libgimp/gimp.c (gimp_main): initialize GimpUnitVTable using the
	gimp_unit_cache functions.

	* app/Makefile.am
	* app/units.[ch]: new files implementing GimpUnitVTable.

	* app/libgimp_glue.[ch]: removed.

	* app/app_procs.[ch]: made "the_gimp" a static variable. Call
	units_init().

	* app/main.c: changed accordingly.
2003-11-15 22:53:28 +00:00
Michael Natterer e34358d8c3 added new API gimp_color_button_[get|set]_update() which configures the
2003-11-11  Michael Natterer  <mitch@gimp.org>

	* libgimpwidgets/gimpcolorbutton.[ch]: added new API
	gimp_color_button_[get|set]_update() which configures the button
	to emit "color_changed" continuously while the color in the color
	selection dialog is being changed. Fixes bug #90091.

	Renamed GimpColorButton struct member
	"GtkItemFactory *item_factory" to a /*< private >*/ member named
	"gpointer popup_menu". This is ugly but fixes bug #125115,

	* app/display/gimpdisplayshell-callbacks.c
	* app/display/gimpdisplayshell.c
	* app/widgets/gimpcolorpanel.c: changed accordingly.

	* libgimpwidgets/gimpcolorbutton.c: use a GimpColorSelection
	with a handmade GimpDialog instead of GtkColorSelectionDialog.

	Enabled module loading for plug-ins so the color selection
	can show the color selectors which are implemented in modules:

	* libgimpwidgets/gimpwidgets-private.[ch]: added
	GimpEnsureModlesFunc which can be called by modules users.

	* app/gui/gui.c (gui_libs_init): pass NULL as
	GimpEnsureModulesFunc since the core loads the modules itself.

	* libgimp/gimpui.c (gimp_ui_init): pass new private function
	gimp_ensure_modules() which will load the modules upon first
	invocation.

	* libgimp/Makefile.am: link libgimpui against libgimpmodule.

	* libgimpwidgets/gimpcolorselection.c: call
	_gimp_ensure_modules_func() if it is non-NULL so color selector
	modules are available for plug-ins.

	* tools/pdbgen/pdb/gimprc.pdb: added new PDB wrapper
	gimp_get_module_load_inhibit().

	* app/pdb/gimprc_cmds.c
	* app/pdb/internal_procs.c
	* libgimp/gimpgimprc_pdb.[ch]: regenerated.
2003-11-11 17:55:45 +00:00
Michael Natterer ac2b6c8702 changed again to take no paramaters and use _gimp_standard_help_func from
2003-05-25  Michael Natterer  <mitch@gimp.org>

	* libgimpwidgets/gimphelpui.[ch] (_gimp_help_init): changed again
	to take no paramaters and use _gimp_standard_help_func from
	gimpwidgets-private.

	* libgimpwidgets/gimpwidgets-private.[ch]: removed the palette
	functions from GimpWidgetVTable. Instead, pass them as
	GimpGetColorFunc to gimp_widgets_init() and make them available as
	_gimp_get_foreground_func and _gimp_get_background_func.

	* libgimpwidgets/gimpcolorbutton.c
	* libgimp/gimpui.c: changed accordingly.

	* app/libgimp_glue.[ch]: removed the palette functions.

	* app/gui/gui.c: added gui_get_foreground_func() and
	gui_get_background_func() and pass them to gimp_widgets_init().
2003-05-25 14:23:43 +00:00
Michael Natterer 253ed7092b added a GimpHelpFunc parameter to _gimp_help_init(). Implement
2003-05-25  Michael Natterer  <mitch@gimp.org>

	* libgimpwidgets/gimphelpui.[ch]: added a GimpHelpFunc parameter to
	_gimp_help_init(). Implement gimp_standard_help_func() here and
	use the function pointer passed to _gimp_help_init().

	* libgimpwidgets/gimpwidgets-private.[ch]: removed
	standard_help_func from GimpWidgetsVTable. Require it as paramater
	to gimp_widgets_init() and pass it to _gimp_help_init().

	* libgimpwidgets/gimpunitmenu.c: use gimp_standard_help_func
	directly again.

	* app/libgimp_glue.[ch]: removed gimp_standard_help_func().

	* libgimp/Makefile.am
	* libgimp/gimphelp.c: removed this file (containing
	gimp_standard_help_func()).

	* app/gui/gui.c: added private gimp_help_func() and pass it to
	gimp_widgets_init().

	* libgimp/gimpui.c: added private gimp_ui_help_func() and pass it
	to gimp_widgets_init().
2003-05-25 12:13:57 +00:00
Sven Neumann 62dffea661 libgimpwidgets/Makefile.am new files. Moved gimp_widgets_init() here and
2003-05-23  Sven Neumann  <sven@gimp.org>

	* libgimpwidgets/Makefile.am
	* libgimpwidgets/gimpwidgets-private.[ch]: new files. Moved
	gimp_widgets_init() here and added a vtable parameter. The vtable
	has entries for all the symbols that are either provided by libgimp
	or gimp itself depending on who is using the library.

	* libgimpwidgets/libgimp-glue.c: removed this file that uses to
	provide a Win32 only hack that is now not needed any longer.

	* libgimpwidgets/gimpcolorbutton.c
	* libgimpwidgets/gimphelpui.c
	* libgimpwidgets/gimpsizeentry.c
	* libgimpwidgets/gimpunitmenu.c
	* libgimpwidgets/gimpwidgets.[ch]: don't call the offending
	functions directly, but use the vtable entries. This is ugly but
	the ugliness is restricted to our code. There are plans to clean
	this up further... (Fixes #113410 once more.)

	* app/gui/gui.c (gui_libs_init)
	* libgimp/gimpui.c (gimp_ui_init): initialize libgimpwidgets with
	the proper vtable.
2003-05-23 18:27:05 +00:00