~ubuntu-branches/ubuntu/jaunty/gimp/jaunty-security

« back to all changes in this revision

Viewing changes to libgimpwidgets/gimppickbutton.c

  • Committer: Bazaar Package Importer
  • Author(s): Daniel Holbach
  • Date: 2007-05-02 16:33:03 UTC
  • mfrom: (1.1.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20070502163303-bvzhjzbpw8qglc4y
Tags: 2.3.16-1ubuntu1
* Resynchronized with Debian, remaining Ubuntu changes:
  - debian/rules: i18n magic.
* debian/control.in:
  - Maintainer: Ubuntu Core Developers <ubuntu-devel@lists.ubuntu.com>
* debian/patches/02_help-message.patch,
  debian/patches/03_gimp.desktop.in.in.patch,
  debian/patches/10_dont_show_wizard.patch: updated.
* debian/patches/04_composite-signedness.patch,
  debian/patches/05_add-letter-spacing.patch: dropped, used upstream.

Show diffs side-by-side

added added

removed removed

Lines of Context:
40
40
};
41
41
 
42
42
 
43
 
static void       gimp_pick_button_class_init    (GimpPickButtonClass *klass);
44
 
static void       gimp_pick_button_init          (GimpPickButton      *editor);
45
 
 
46
43
static void       gimp_pick_button_destroy       (GtkObject      *object);
47
44
 
48
45
static void       gimp_pick_button_clicked       (GtkButton      *button);
66
63
                                                  GimpPickButton *button);
67
64
 
68
65
 
69
 
static guint   pick_button_signals[LAST_SIGNAL] = { 0 };
70
 
 
71
 
static GtkButtonClass *parent_class = NULL;
72
 
 
73
 
 
74
 
GType
75
 
gimp_pick_button_get_type (void)
76
 
{
77
 
  static GType button_type = 0;
78
 
 
79
 
  if (! button_type)
80
 
    {
81
 
      static const GTypeInfo button_info =
82
 
      {
83
 
        sizeof (GimpPickButtonClass),
84
 
        (GBaseInitFunc) NULL,
85
 
        (GBaseFinalizeFunc) NULL,
86
 
        (GClassInitFunc) gimp_pick_button_class_init,
87
 
        NULL,           /* class_finalize */
88
 
        NULL,           /* class_data     */
89
 
        sizeof (GimpPickButton),
90
 
        0,              /* n_preallocs    */
91
 
        (GInstanceInitFunc) gimp_pick_button_init,
92
 
      };
93
 
 
94
 
      button_type = g_type_register_static (GTK_TYPE_BUTTON,
95
 
                                            "GimpPickButton",
96
 
                                            &button_info, 0);
97
 
    }
98
 
 
99
 
  return button_type;
100
 
}
 
66
G_DEFINE_TYPE (GimpPickButton, gimp_pick_button, GTK_TYPE_BUTTON)
 
67
 
 
68
#define parent_class gimp_pick_button_parent_class
 
69
 
 
70
static guint pick_button_signals[LAST_SIGNAL] = { 0 };
 
71
 
101
72
 
102
73
static void
103
74
gimp_pick_button_class_init (GimpPickButtonClass* klass)
105
76
  GtkObjectClass *object_class = GTK_OBJECT_CLASS (klass);
106
77
  GtkButtonClass *button_class = GTK_BUTTON_CLASS (klass);
107
78
 
108
 
  parent_class = g_type_class_peek_parent (klass);
109
 
 
110
79
  pick_button_signals[COLOR_PICKED] =
111
 
    g_signal_new ("color_picked",
112
 
                  G_TYPE_FROM_CLASS (klass),
113
 
                  G_SIGNAL_RUN_FIRST,
114
 
                  G_STRUCT_OFFSET (GimpPickButtonClass, color_picked),
115
 
                  NULL, NULL,
116
 
                  g_cclosure_marshal_VOID__POINTER,
117
 
                  G_TYPE_NONE, 1,
 
80
    g_signal_new ("color-picked",
 
81
                  G_TYPE_FROM_CLASS (klass),
 
82
                  G_SIGNAL_RUN_FIRST,
 
83
                  G_STRUCT_OFFSET (GimpPickButtonClass, color_picked),
 
84
                  NULL, NULL,
 
85
                  g_cclosure_marshal_VOID__POINTER,
 
86
                  G_TYPE_NONE, 1,
118
87
                  G_TYPE_POINTER);
119
88
 
120
89
  object_class->destroy = gimp_pick_button_destroy;
188
157
#define DROPPER_X_HOT    2
189
158
#define DROPPER_Y_HOT   16
190
159
 
191
 
static guchar dropper_bits[] =
 
160
static const guchar dropper_bits[] =
192
161
{
193
162
  0xff, 0x8f, 0x01, 0xff, 0x77, 0x01, 0xff, 0xfb, 0x00, 0xff, 0xf8, 0x00,
194
163
  0x7f, 0xff, 0x00, 0xff, 0x7e, 0x01, 0xff, 0x9d, 0x01, 0xff, 0xd8, 0x01,
197
166
  0xff, 0xff, 0x01
198
167
};
199
168
 
200
 
static guchar dropper_mask[] =
 
169
static const guchar dropper_mask[] =
201
170
{
202
171
  0x00, 0x70, 0x00, 0x00, 0xf8, 0x00, 0x00, 0xfc, 0x01, 0x00, 0xff, 0x01,
203
172
  0x80, 0xff, 0x01, 0x00, 0xff, 0x00, 0x00, 0x7f, 0x00, 0x80, 0x3f, 0x00,
209
178
static GdkCursor *
210
179
make_cursor (void)
211
180
{
212
 
  GdkCursor *cursor;
213
 
  GdkColor   bg = { 0, 0xffff, 0xffff, 0xffff };
214
 
  GdkColor   fg = { 0, 0x0000, 0x0000, 0x0000 };
 
181
  GdkCursor      *cursor;
 
182
  const GdkColor  bg = { 0, 0xffff, 0xffff, 0xffff };
 
183
  const GdkColor  fg = { 0, 0x0000, 0x0000, 0x0000 };
215
184
 
216
185
  GdkPixmap *pixmap =
217
186
    gdk_bitmap_create_from_data (NULL,
277
246
 
278
247
  gtk_grab_add (widget);
279
248
 
280
 
  g_signal_connect (widget, "button_press_event",
 
249
  g_signal_connect (widget, "button-press-event",
281
250
                    G_CALLBACK (gimp_pick_button_mouse_press),
282
251
                    button);
283
 
  g_signal_connect (widget, "key_press_event",
 
252
  g_signal_connect (widget, "key-press-event",
284
253
                    G_CALLBACK (gimp_pick_button_key_press),
285
254
                    button);
286
255
}
292
261
{
293
262
  if (event->type == GDK_BUTTON_PRESS && event->button == 1)
294
263
    {
295
 
      g_signal_connect (invisible, "motion_notify_event",
 
264
      g_signal_connect (invisible, "motion-notify-event",
296
265
                        G_CALLBACK (gimp_pick_button_mouse_motion),
297
266
                        button);
298
 
      g_signal_connect (invisible, "button_release_event",
 
267
      g_signal_connect (invisible, "button-release-event",
299
268
                        G_CALLBACK (gimp_pick_button_mouse_release),
300
269
                        button);
301
270