Add GimpPickButton implementation for Windows

Fixes https://gitlab.gnome.org/GNOME/gimp/-/issues/8506
This commit is contained in:
Luca Bacci
2022-10-07 17:51:32 +02:00
parent d1f173938a
commit 744115bac2
4 changed files with 1171 additions and 5 deletions

View File

@ -316,6 +316,8 @@ EXTRA_DIST = \
if PLATFORM_OSX_QUARTZ
libgimpwidgets_sources += gimppickbutton-quartz.c gimppickbutton-quartz.h
AM_CPPFLAGS += "-xobjective-c"
else if PLATFORM_WIN32
libgimpwidgets_sources += gimppickbutton-win32.c gimppickbutton-win32.h
else
libgimpwidgets_sources += \
gimppickbutton-default.c \

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,23 @@
/* LIBGIMP - The GIMP Library
* Copyright (C) 1995-1997 Peter Mattis and Spencer Kimball
*
* gimppickbutton-win32.h
* Copyright (C) 2022 Luca Bacci <luca.bacci@outlook.com>
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library. If not, see
* <https://www.gnu.org/licenses/>.
*/
/* Private header file which is not meant to be exported. */
#ifndef __GIMP_PICK_BUTTON_WIN32_H__
#define __GIMP_PICK_BUTTON_WIN32_H__
void _gimp_pick_button_win32_pick (GimpPickButton *button);
#endif /* __GIMP_PICK_BUTTON_WIN32_H__ */

View File

@ -34,12 +34,15 @@
#include "gimphelpui.h"
#include "gimpicons.h"
#include "gimppickbutton.h"
#if defined (GDK_WINDOWING_QUARTZ)
#include "gimppickbutton-quartz.h"
#elif defined (GDK_WINDOWING_WIN32)
#include "gimppickbutton-win32.h"
#else
#include "gimppickbutton-default.h"
#include "gimppickbutton-kwin.h"
#include "gimppickbutton-xdg.h"
#ifdef GDK_WINDOWING_QUARTZ
#include "gimppickbutton-quartz.h"
#endif
#include "libgimp/libgimp-intl.h"
@ -142,9 +145,11 @@ gimp_pick_button_dispose (GObject *object)
static void
gimp_pick_button_clicked (GtkButton *button)
{
#ifdef GDK_WINDOWING_QUARTZ
#if defined (GDK_WINDOWING_QUARTZ)
_gimp_pick_button_quartz_pick (GIMP_PICK_BUTTON (button));
#elif defined GDK_WINDOWING_X11
#elif defined (GDK_WINDOWING_WIN32)
_gimp_pick_button_win32_pick (GIMP_PICK_BUTTON (button));
#elif defined (GDK_WINDOWING_X11)
/* It's a bit weird as we use the default pick code both in first and
* last cases. It's because when running GIMP on X11 in particular,
* the portals don't return color space information. So the returned