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.
This commit is contained in:
Michael Natterer 2015-10-06 23:44:36 +02:00
parent 1debefb20f
commit 30a86e38b8
3 changed files with 25 additions and 14 deletions

View File

@ -54,7 +54,7 @@ static void gimp_pick_button_pick (GdkScreen *screen,
gint y_root,
GimpPickButton *button);
void _gimp_pick_button_clicked (GtkButton *gtk_button);
void _gimp_pick_button_default_pick (GimpPickButton *button);
static GdkCursor *
@ -226,14 +226,13 @@ gimp_pick_button_pick (GdkScreen *screen,
/* entry point to this file, called from gimppickbutton.c */
void
_gimp_pick_button_clicked (GtkButton *gtk_button)
_gimp_pick_button_default_pick (GimpPickButton *button)
{
GimpPickButton *button = GIMP_PICK_BUTTON (gtk_button);
GtkWidget *widget;
guint32 timestamp;
if (! button->cursor)
button->cursor = make_cursor (gtk_widget_get_display (GTK_WIDGET (gtk_button)));
button->cursor = make_cursor (gtk_widget_get_display (GTK_WIDGET (button)));
if (! button->grab_widget)
{

View File

@ -34,7 +34,7 @@
#endif
void _gimp_pick_button_clicked (GtkButton *gtk_button);
void _gimp_pick_button_quartz_pick (GimpPickButton *button);
@interface GimpPickWindowController : NSObject
@ -400,9 +400,8 @@ void _gimp_pick_button_clicked (GtkButton *gtk_button);
/* entry point to this file, called from gimppickbutton.c */
void
_gimp_pick_button_clicked (GtkButton *gtk_button)
_gimp_pick_button_quartz_pick (GimpPickButton *button)
{
GimpPickButton *button = GIMP_PICK_BUTTON (gtk_button);
GimpPickWindowController *controller;
NSAutoreleasePool *pool;

View File

@ -50,12 +50,15 @@ enum
LAST_SIGNAL
};
/* entry point to gimppickbutton-{default,quartz}.c */
extern void _gimp_pick_button_clicked (GtkButton *gtk_button);
/* entry points to gimppickbutton-{default,quartz}.c */
void _gimp_pick_button_default_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);
G_DEFINE_TYPE (GimpPickButton, gimp_pick_button, GTK_TYPE_BUTTON)
#define parent_class gimp_pick_button_parent_class
@ -88,7 +91,7 @@ gimp_pick_button_class_init (GimpPickButtonClass* klass)
object_class->dispose = gimp_pick_button_dispose;
button_class->clicked = _gimp_pick_button_clicked;
button_class->clicked = gimp_pick_button_clicked;
klass->color_picked = NULL;
}
@ -129,6 +132,16 @@ gimp_pick_button_dispose (GObject *object)
G_OBJECT_CLASS (parent_class)->dispose (object);
}
static void
gimp_pick_button_clicked (GtkButton *button)
{
#ifdef GDK_WINDOWING_QUARTZ
_gimp_pick_button_quartz_pick (GIMP_PICK_BUTTON (button));
#else
_gimp_pick_button_default_pick (GIMP_PICK_BUTTON (button));
#endif
}
/* public functions */