Commit Graph

47 Commits

Author SHA1 Message Date
Luca Bacci d2dc2cb983 Add GimpPickButton implementation for Windows
Fixes https://gitlab.gnome.org/GNOME/gimp/-/issues/8506
2022-10-07 10:45:22 +00:00
Jehan 9b21688501 Issue #6778: Colorpicker (from Colors dockable) shows wrong color.
Actually our X11 implementation is right, and the implementation from
the Freedesktop portal is "as far as it can do", i.e. that we get the
returned RGB value, which is unfortunately in display space. And it
doesn't return any space information together (we don't even know which
display the color comes from, in multi-display setups).

Therefore let's check if we are running GIMP on X11 and if so, let's
call this implementation first.

See this report on xdg-desktop-portal to get proper space info:
https://github.com/flatpak/xdg-desktop-portal/issues/862
2022-08-18 21:42:39 +02:00
Niels De Graef e82f6d5b0f libgimpwidgets: Use Screenshot portal for picking
Freedesktop (XDG) portals are a collection of D-Bus APIs that work
across desktop environments, display servers and work within
containerized applications, like Flatpak. The internal implementation
can then choose to implement these in such a way that takes into account
security considerations, as well as making sure the user consents to
certain actions.

One such portal is the `Screenshot` portal, which contains a
`Screenshot()` method as well as `PickColor()`. We already use the
former for taking a screenshot, and this commit makes sure our color
picker also makes use of the latter.

By doing this, color picking is now possible on the major Wayland
compositors.

(Honestly, we should remove DE-specific backends like that of KWin, to
have less variation on the possible results of a color picking
operation).

Fixes https://gitlab.gnome.org/GNOME/gimp/-/issues/1074
2021-12-14 23:15:49 +01:00
Niels De Graef 4729fc8dec Use GIMP_TYPE_RGB instead of G_TYPE_POINTER
That way, bindings can set the correct signature for callbacks.
2020-05-06 10:36:33 +00: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
Ell 3b0040c043 app, libgimp*, modules: don't use g_type_class_add_private() ...
... and G_TYPE_INSTANCE_GET_PRIVATE()

g_type_class_add_private() and G_TYPE_INSTANCE_GET_PRIVATE() were
deprecated in GLib 2.58.  Instead, use
G_DEFINE_[ABSTRACT_]TYPE_WITH_PRIVATE(), and
G_ADD_PRIVATE[_DYNAMIC](), and the implictly-defined
foo_get_instance_private() functions, all of which are available in
the GLib versions we depend on.

This commit only covers types registered using one of the
G_DEFINE_FOO() macros (i.e., most types), but not types with a
custom registration function, of which we still have a few -- GLib
currently only provides a (non-deprecated) public API for adding a
private struct using the G_DEFINE_FOO() macros.

Note that this commit was 99% auto-generated (because I'm not
*that* crazy :), so if there are any style mismatches... we'll have
to live with them for now.
2018-09-18 14:39:56 -04:00
Michael Natterer 5f700549e7 Change the license URL from http://www.gnu.org/licenses/ to https:// 2018-07-11 23:29:46 +02:00
Michael Natterer 3d4ef455d2 libgimpwidgets: move all GimpPickButton members to a private struct 2018-05-20 21:06:28 +02:00
Michael Natterer 6e982cd0a4 libgimpwidgets: use g_object_ref()/unref() for GdkCursors
The are GObjects now.
2018-05-20 21:06:28 +02:00
Jehan ef6559b38f libgimpwidgets: add private headers for GimpPickButton implementations.
Though forward declarations of the implementations are ok, it is cleaner
to have proper header files for each variant (default, kwin, quartz
right now). Of course these new header files are not installed and must
be kept private for build only.
2017-12-09 00:05:08 +01:00
Jehan 06bbf3e436 Bug 780375 - Color picker won't pick on Wayland.
Add support for KWin API, for KDE on Wayland.
Unfortunately though, KWin's "pick" API seems to have failures, so I
fallback to the default color picking when this happens. This will still
not work on Wayland, but at least won't cause regression for color
picking on KDE/X11.
See also KDE bug: https://bugs.kde.org/show_bug.cgi?id=387720
2017-12-08 23:37:24 +01: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 30a86e38b8 libgimpwidgets: slightly redo how GimpPickButton calls its new backends
to make porting to GTK+ 3.x easier, for less diff to the gtk3-port
branch.
2015-10-06 23:44:36 +02:00
Kristian Rietveld e570eb0be4 Make gimp_pick_button_clicked properly private 2015-10-04 17:14:10 +02:00
Kristian Rietveld 0d88399eb8 Bug 753175 - color picker locks down the GUI
The common code relies on X11 pointer grabbing semantics, which does
not work well on OS X. An attempt using event taps also proved
problematic, in particular with regard to setting the mouse cursor.

This patch implements a fully separate code for use on OS X platforms.
It works by simply overlaying the desktop with big transparent windows
on which the mouse cursor is set and motion events are captured. Evil,
but it works.
2015-10-04 16:27:17 +02:00
Michael Natterer 7c36f94f7f cursors,app,libgimpwidgets: include cursors using GResource
instead of deprecated inline pixbufs. Require on gdk-pixbuf >= 2.30.8.
2015-04-14 22:55:10 +02:00
Michael Natterer 79bd9c60de libgimpwidgets: mostly port from stock IDs to icon names
Add some new API and deprecate old one.
2014-05-07 21:32:09 +02:00
Michael Natterer f489ef2c5a libgimpwidets: don't pick transparent colors in gimp_pick_button_pick()
Full opacity in gimp_rgba_set_uchar() is 255, not 1.0.
2013-11-16 22:53:16 +01:00
Michael Natterer 5466caa064 libgimpwidgets: return an opaque color from gimp_pick_button_pick()'s OSX code
and fiddle with whitespace a bit.
2013-10-11 22:52:38 +02:00
Daniel Sabo e6ed0a4c50 Use the Quartz core graphics API to implement gimp_pick_button_pick when building with GDK Quartz.
Signed-off-by: Clayton Walker <clayton.m.walker@gmail.com>
2013-10-11 13:57:49 -06:00
Michael Natterer c6ba0ffbdf app/cursors/libgimpwidgets: bye bye stone age B&W bitmap cursors 2012-08-26 22:53:04 +02:00
Michael Natterer 3ad73b3658 libgimpcolor: add GdkPixbuf <-> GeglBuffer utility functions
and update tons of includes in libgimp and app.
2012-05-03 03:37:20 +02:00
Michael Natterer 3e119c5af7 libgimpcolor: add gimp_rgb[a]_set,get_pixel()
which converts from/to any pixel format using Babl. Added tons of
includes and CFLAGS now that libgimpcolor publically uses Babl.
2012-05-02 17:50:43 +02:00
Michael Natterer d272159194 libgimpwidgets: use gdk_cairo_set_source_window() instead of source_pixmap() 2011-04-22 00:44:32 +02:00
Michael Natterer 7e6c026790 Globally use GDK_KEY_foo, remove the compat defines from widgets-enums.h 2011-04-11 23:43:03 +02:00
Michael Natterer 84274e2230 libgimpwidgets: implement GObject::dispose() instead of GtkObject::destroy() 2010-10-15 02:34:29 +02:00
Michael Natterer d62c287fce libgimpwidgets: remove the pixbuf inline data garbage from GimpPickButton
Instead, generate a proper header for inclusion in cursors/.
2010-09-13 02:16:18 +02:00
Michael Natterer fb53ac6c3a plug-ins: create the GimpPickButton from pixbuf inline data
instead of using GdkBitmap functions.
2010-09-12 02:44:00 +02:00
Michael Natterer 10574e8f22 libgimpwidgets: port GimpPickButton color picking to cairo 2010-08-08 16:10:14 +02:00
Michael Natterer 1f7ff98c45 libgimpwidgets: move docs from template files to inline comments
but leave the template file for gimpstock there because its contents
would be too much for gimpstock.h.
2010-07-05 18:01:28 +02:00
Michael Natterer 3795f9b9c5 libgimpwidgets/gimpchainbutton.c libgimpwidgets/gimpcolorarea.c
2009-03-22  Michael Natterer  <mitch@gimp.org>

	* libgimpwidgets/gimpchainbutton.c
	* libgimpwidgets/gimpcolorarea.c
	* libgimpwidgets/gimpcolorbutton.c
	* libgimpwidgets/gimpcolorscale.c
	* libgimpwidgets/gimpcolorselect.c
	* libgimpwidgets/gimpdialog.c
	* libgimpwidgets/gimphelpui.c
	* libgimpwidgets/gimpmemsizeentry.c
	* libgimpwidgets/gimpoffsetarea.c
	* libgimpwidgets/gimppickbutton.c
	* libgimpwidgets/gimppixmap.c
	* libgimpwidgets/gimppreview.c
	* libgimpwidgets/gimppreviewarea.c
	* libgimpwidgets/gimpruler.c
	* libgimpwidgets/gimpscrolledpreview.c
	* libgimpwidgets/gimpwidgets.c: use accessors for various members
	of GTK+ structures that don't exist any longer when GSEAL_ENABLE
	is defined.


svn path=/trunk/; revision=28190
2009-03-22 15:42:42 +00: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
Sven Neumann 6ebcf700d1 removed erroneous semicolon after G_DEFINE_TYPE macros.
2006-05-15  Sven Neumann  <sven@gimp.org>

	* app/*/*.c:
	* lib*/*.c: removed erroneous semicolon after G_DEFINE_TYPE macros.
2006-05-15 09:46:31 +00:00
Sven Neumann f2df31a50e converted tabs to spaces.
2006-04-12  Sven Neumann  <sven@gimp.org>

	* libgimp*/gimp*.[ch]: converted tabs to spaces.
2006-04-12 10:53:28 +00:00
Sven Neumann 37da566934 app/core/gimpcontext.c app/core/gimpimage.c app/paint-funcs/paint-funcs.c
2006-04-06  Sven Neumann  <sven@gimp.org>

	* app/core/gimpcontext.c
	* app/core/gimpimage.c
	* app/paint-funcs/paint-funcs.c
	* app/widgets/gimpcontrollerkeyboard.c
	* app/widgets/gimpcontrollerwheel.c
	* app/widgets/gimpcursor.c
	* app/widgets/gimpdockable.c
	* app/widgets/gimpdockbook.c
	* app/widgets/gimpdockseparator.c
	* libgimp/gimpbrushselect.c
	* libgimp/gimpfontselect.c
	* libgimp/gimpgradientselect.c
	* libgimp/gimppaletteselect.c
	* libgimp/gimppatternselect.c
	* libgimpwidgets/gimpchainbutton.c
	* libgimpwidgets/gimpcolorscales.c
	* libgimpwidgets/gimpcolorselect.c
	* libgimpwidgets/gimppickbutton.c
	* libgimpwidgets/gimpstock.c: sprinkled some const qualifiers.
2006-04-06 12:43:58 +00:00
Michael Natterer 33ae55f873 libgimp/*.c libgimpconfig/*.c libgimpmodule/*.c libgimpthumb/*.c port to
2005-12-20  Michael Natterer  <mitch@gimp.org>

	* libgimp/*.c
	* libgimpconfig/*.c
	* libgimpmodule/*.c
	* libgimpthumb/*.c
	* libgimpwidgets/*.c: port to G_DEFINE_TYPE() and friends. Some
	related cleanup.
2005-12-20 20:35:23 +00:00
Sven Neumann 3ca90a182e Use the canonical form for signal names in lots of places (but by far not
2005-05-27  Sven Neumann  <sven@gimp.org>

	* (lots of files): Use the canonical form for signal names in lots
	of places (but by far not all).
2005-05-27 13:05:26 +00:00
Sven Neumann 45a7f5e459 libgimpwidgets/gimpcolorbutton.c libgimpwidgets/gimpcolornotebook.c
2004-07-13  Sven Neumann  <sven@gimp.org>

	* libgimpwidgets/gimpcolorbutton.c
	* libgimpwidgets/gimpcolornotebook.c
	* libgimpwidgets/gimpcolorscale.c
	* libgimpwidgets/gimpcolorscales.c
	* libgimpwidgets/gimpcolorselect.c
	* libgimpwidgets/gimpcolorselection.c
	* libgimpwidgets/gimpframe.c
	* libgimpwidgets/gimppickbutton.c
	* libgimpwidgets/gimpunitmenu.c: some code review and cosmetics.
2004-07-13 14:55:16 +00:00
Sven Neumann 9f25f8608b adapt the arrow key velocity to the display scale factor. Please test and
2004-07-07  Sven Neumann  <sven@gimp.org>

	* app/tools/gimpeditselectiontool.c
	(gimp_edit_selection_tool_key_press): adapt the arrow key velocity
	to the display scale factor. Please test and complain if you
	dislike this behaviour.

	* themes/Default/images/Makefile.am
	* themes/Default/images/stock-color-pick-from-screen-16.png: new
	icon drawn by Jimmac.

	* libgimpwidgets/gimpstock.[ch]: register the new icon.

	* libgimpwidgets/gimppickbutton.c: use it for the screen color
	picker instead of reusing the color picker tool icon.
2004-07-06 22:58:33 +00:00
Sven Neumann 9c2ac01ec2 applied patch from Philip Lafleur that fixes color picking for XInput
2004-05-27  Sven Neumann  <sven@gimp.org>

	* libgimpwidgets/gimppickbutton.c: applied patch from Philip
	Lafleur that fixes color picking for XInput devices (bug #143166).
2004-05-27 15:12:31 +00:00
Sven Neumann 9257adae0a code cleanup, no changes.
2004-02-08  Sven Neumann  <sven@gimp.org>

	* libgimpwidgets/gimppickbutton.c: code cleanup, no changes.
2004-02-08 15:47:20 +00:00
Sven Neumann c590c6aa15 app/display/gimpdisplayshell-callbacks.c
2003-10-28  Sven Neumann  <sven@gimp.org>

	* app/display/gimpdisplayshell-callbacks.c
	* app/display/gimpdisplayshell-layer-select.c
	* app/widgets/gimpcontainerpopup.c
	* app/widgets/gimphistogramview.c
	* app/widgets/gimpnavigationpreview.c
	* libgimpwidgets/gimpcolorselect.c
	* libgimpwidgets/gimpoffsetarea.c
	* libgimpwidgets/gimppickbutton.c: use multihead safe variants of
	the unsafe functions gdk_pointer_ungrab(), gdk_keyboard_ungrab()
	and gdk_device_get_core_pointer().

	* plug-ins/libgck/gck/gck.h
	* plug-ins/libgck/gck/gckcolor.c: made libgck multi-head safe.

	* plug-ins/Lighting/lighting_ui.c
	* plug-ins/MapObject/mapobject_preview.c
	* plug-ins/MapObject/mapobject_ui.c: changed accordingly.

	* plug-ins/common/animationplay.c
	* plug-ins/common/curve_bend.c
	* plug-ins/gfig/gfig.c
	* plug-ins/imagemap/imap_preview.c: use multihead safe GDK API.
2003-10-29 20:57:21 +00:00
Sven Neumann 180aacb96b fixed color picking from other screens.
2003-08-19  Sven Neumann  <sven@gimp.org>

	* libgimpwidgets/gimppickbutton.c: fixed color picking from other
	screens.
2003-08-18 23:21:44 +00:00
Manish Singh 1a44f2126c cleanup, removed unecessary G_OBJECT() casts. Should do the same for
2003-01-05  Manish Singh  <yosh@gimp.org>

        * many files in app, modules and libgimp*: cleanup, removed unecessary
        G_OBJECT() casts. Should do the same for plug-ins, when more of them
        get undeprecated.
2003-01-05 22:07:10 +00:00
Sven Neumann 50c8c56fe0 libgimpwidgets/gimpchainbutton.[ch] libgimpwidgets/gimpcolorarea.[ch]
2003-01-05  Sven Neumann  <sven@gimp.org>

        * libgimpwidgets/gimpchainbutton.[ch]
        * libgimpwidgets/gimpcolorarea.[ch]
        * libgimpwidgets/gimpcolorbutton.[ch]
        * libgimpwidgets/gimpdialog.c
        * libgimpwidgets/gimpfileselection.[ch]
        * libgimpwidgets/gimpoffsetarea.c
        * libgimpwidgets/gimppickbutton.c
        * libgimpwidgets/gimpquerybox.c
        * libgimpwidgets/gimpwidgets.c: added more API documentation.
        Declared gimp_scale_entry_new_internal() as static.

        * libgimpwidgets/gimpwidgets.def: changed accordingly.
2003-01-05 15:41:23 +00:00
Michael Natterer d506e559df new GtkButton subclass implementing the pick-from-everywhere eyedropper
2002-11-04  Michael Natterer  <mitch@gimp.org>

	* libgimpwidgets/gimppickbutton.[ch]: new GtkButton subclass
	implementing the pick-from-everywhere eyedropper known from
	GtkColorSel. Code shamelessly stolen from there.

	* libgimpwidgets/Makefile.am
	* libgimpwidgets/gimpwidgets.h
	* libgimpwidgets/gimpwidgetstypes.h: changed accordingly.
2002-11-04 22:56:41 +00:00