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.
This commit is contained in:
Jehan 2017-12-08 23:57:09 +01:00
parent 06bbf3e436
commit ef6559b38f
8 changed files with 91 additions and 18 deletions

View File

@ -293,10 +293,14 @@ EXTRA_DIST = \
if PLATFORM_OSX_QUARTZ
libgimpwidgets_sources += gimppickbutton-quartz.c
libgimpwidgets_sources += gimppickbutton-quartz.c gimppickbutton-quartz.h
AM_CPPFLAGS += "-xobjective-c"
else
libgimpwidgets_sources += gimppickbutton-default.c gimppickbutton-kwin.c
libgimpwidgets_sources += \
gimppickbutton-default.c \
gimppickbutton-default.h \
gimppickbutton-kwin.c \
gimppickbutton-kwin.h
endif

View File

@ -35,6 +35,7 @@
#include "gimphelpui.h"
#include "gimpicons.h"
#include "gimppickbutton.h"
#include "gimppickbutton-default.h"
#include "gimpwidgetsutils.h"
#include "cursors/gimp-color-picker-cursors.c"
@ -60,8 +61,6 @@ static void gimp_pick_button_pick (GdkScreen *screen,
gint y_root,
GimpPickButton *button);
void _gimp_pick_button_default_pick (GimpPickButton *button);
static GdkCursor *
make_cursor (GdkDisplay *display)

View File

@ -0,0 +1,25 @@
/* LIBGIMP - The GIMP Library
* Copyright (C) 1995-1997 Peter Mattis and Spencer Kimball
*
* gimppickbutton-default.h
* Copyright (C) 2017 Jehan <jehan@gimp.org>
*
* 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
* <http://www.gnu.org/licenses/>.
*/
/* Private header file which is not meant to be exported. */
#ifndef __GIMP_PICK_BUTTON_DEFAULT_H__
#define __GIMP_PICK_BUTTON_DEFAULT_H__
void _gimp_pick_button_default_pick (GimpPickButton *button);
#endif /* __GIMP_PICK_BUTTON_DEFAULT_H__ */

View File

@ -23,14 +23,11 @@
#include "gimpwidgetstypes.h"
#include "gimppickbutton.h"
#include "gimppickbutton-default.h"
#include "gimppickbutton-kwin.h"
#include "libgimp/libgimp-intl.h"
void _gimp_pick_button_default_pick (GimpPickButton *button);
gboolean _gimp_pick_button_kwin_available (void);
void _gimp_pick_button_kwin_pick (GimpPickButton *button);
gboolean
_gimp_pick_button_kwin_available (void)
{

View File

@ -0,0 +1,25 @@
/* LIBGIMP - The GIMP Library
* Copyright (C) 1995-1997 Peter Mattis and Spencer Kimball
*
* gimppickbutton-kwin.h
* Copyright (C) 2017 Jehan <jehan@gimp.org>
*
* 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
* <http://www.gnu.org/licenses/>.
*/
/* Private header file which is not meant to be exported. */
#ifndef __GIMP_PICK_BUTTON_KWIN_H__
#define __GIMP_PICK_BUTTON_KWIN_H__
gboolean _gimp_pick_button_kwin_available (void);
void _gimp_pick_button_kwin_pick (GimpPickButton *button);
#endif /* __GIMP_PICK_BUTTON_KWIN_H__ */

View File

@ -24,6 +24,7 @@
#include "gimpwidgetstypes.h"
#include "gimppickbutton.h"
#include "gimppickbutton-quartz.h"
#include "cursors/gimp-color-picker-cursors.c"
@ -34,9 +35,6 @@
#endif
void _gimp_pick_button_quartz_pick (GimpPickButton *button);
@interface GimpPickWindowController : NSObject
{
GimpPickButton *button;

View File

@ -0,0 +1,25 @@
/* LIBGIMP - The GIMP Library
* Copyright (C) 1995-1997 Peter Mattis and Spencer Kimball
*
* gimppickbutton-quartz.h
* Copyright (C) 2017 Jehan <jehan@gimp.org>
*
* 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
* <http://www.gnu.org/licenses/>.
*/
/* Private header file which is not meant to be exported. */
#ifndef __GIMP_PICK_BUTTON_QUARTZ_H__
#define __GIMP_PICK_BUTTON_QUARTZ_H__
void _gimp_pick_button_quartz_pick (GimpPickButton *button);
#endif /* __GIMP_PICK_BUTTON_QUARTZ_H__ */

View File

@ -30,6 +30,12 @@
#include "gimphelpui.h"
#include "gimpicons.h"
#include "gimppickbutton.h"
#include "gimppickbutton-default.h"
#include "gimppickbutton-kwin.h"
#ifdef GDK_WINDOWING_QUARTZ
#include "gimppickbutton-quartz.h"
#endif
#include "libgimp/libgimp-intl.h"
@ -50,12 +56,6 @@ enum
LAST_SIGNAL
};
/* entry points to gimppickbutton-{default,kwin,quartz}.c */
void _gimp_pick_button_default_pick (GimpPickButton *button);
gboolean _gimp_pick_button_kwin_available (void);
void _gimp_pick_button_kwin_pick (GimpPickButton *button);
void _gimp_pick_button_quartz_pick (GimpPickButton *button);
static void gimp_pick_button_dispose (GObject *object);
static void gimp_pick_button_clicked (GtkButton *button);