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

« back to all changes in this revision

Viewing changes to app/widgets/gimpcolorpanel.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:
1
 
/* The GIMP -- an image manipulation program
 
1
/* GIMP - The GNU Image Manipulation Program
2
2
 * Copyright (C) 1995 Spencer Kimball and Peter Mattis
3
3
 *
4
4
 * This program is free software; you can redistribute it and/or modify
34
34
 
35
35
/*  local function prototypes  */
36
36
 
37
 
static void       gimp_color_panel_class_init    (GimpColorPanelClass  *klass);
38
 
static void       gimp_color_panel_init          (GimpColorPanel       *panel);
39
 
 
40
37
static void       gimp_color_panel_destroy         (GtkObject          *object);
41
38
static gboolean   gimp_color_panel_button_press    (GtkWidget          *widget,
42
39
                                                    GdkEventButton     *bevent);
50
47
                                                    GimpColorPanel     *panel);
51
48
 
52
49
 
53
 
static GimpColorButtonClass *parent_class = NULL;
54
 
 
55
 
 
56
 
GType
57
 
gimp_color_panel_get_type (void)
58
 
{
59
 
  static GType panel_type = 0;
60
 
 
61
 
  if (! panel_type)
62
 
    {
63
 
      static const GTypeInfo panel_info =
64
 
      {
65
 
        sizeof (GimpColorPanelClass),
66
 
        NULL,           /* base_init */
67
 
        NULL,           /* base_finalize */
68
 
        (GClassInitFunc) gimp_color_panel_class_init,
69
 
        NULL,           /* class_finalize */
70
 
        NULL,           /* class_data */
71
 
        sizeof (GimpColorPanel),
72
 
        0,              /* n_preallocs */
73
 
        (GInstanceInitFunc) gimp_color_panel_init,
74
 
      };
75
 
 
76
 
      panel_type = g_type_register_static (GIMP_TYPE_COLOR_BUTTON,
77
 
                                           "GimpColorPanel",
78
 
                                           &panel_info, 0);
79
 
    }
80
 
 
81
 
  return panel_type;
82
 
}
 
50
G_DEFINE_TYPE (GimpColorPanel, gimp_color_panel, GIMP_TYPE_COLOR_BUTTON)
 
51
 
 
52
#define parent_class gimp_color_panel_parent_class
 
53
 
83
54
 
84
55
static void
85
56
gimp_color_panel_class_init (GimpColorPanelClass *klass)
89
60
  GtkButtonClass       *button_class       = GTK_BUTTON_CLASS (klass);
90
61
  GimpColorButtonClass *color_button_class = GIMP_COLOR_BUTTON_CLASS (klass);
91
62
 
92
 
  parent_class = g_type_class_peek_parent (klass);
93
 
 
94
63
  object_class->destroy               = gimp_color_panel_destroy;
 
64
 
95
65
  widget_class->button_press_event    = gimp_color_panel_button_press;
 
66
 
96
67
  button_class->clicked               = gimp_color_panel_clicked;
 
68
 
97
69
  color_button_class->color_changed   = gimp_color_panel_color_changed;
98
70
  color_button_class->get_action_type = gimp_color_panel_get_action_type;
99
71
}
140
112
 
141
113
      action = gtk_action_group_get_action (group,
142
114
                                            "color-button-use-foreground");
143
 
      g_object_set (action, "visible", color_panel->context != NULL, NULL);
 
115
      gtk_action_set_visible (action, color_panel->context != NULL);
144
116
 
145
117
      action = gtk_action_group_get_action (group,
146
118
                                            "color-button-use-background");
147
 
      g_object_set (action, "visible", color_panel->context != NULL, NULL);
 
119
      gtk_action_set_visible (action, color_panel->context != NULL);
148
120
 
149
121
      if (color_panel->context)
150
122
        {
185
157
  if (! panel->color_dialog)
186
158
    {
187
159
      panel->color_dialog =
188
 
        gimp_color_dialog_new (NULL,
 
160
        gimp_color_dialog_new (NULL, panel->context,
189
161
                               GIMP_COLOR_BUTTON (button)->title,
190
162
                               NULL, NULL,
191
163
                               GTK_WIDGET (button),
217
189
 
218
190
GtkWidget *
219
191
gimp_color_panel_new (const gchar       *title,
220
 
                      const GimpRGB     *color,
221
 
                      GimpColorAreaType  type,
222
 
                      gint               width,
223
 
                      gint               height)
 
192
                      const GimpRGB     *color,
 
193
                      GimpColorAreaType  type,
 
194
                      gint               width,
 
195
                      gint               height)
224
196
{
225
197
  GimpColorPanel *panel;
226
198