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

« back to all changes in this revision

Viewing changes to app/widgets/gimpmessagebox.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
 * gimpmessagebox.c
42
42
};
43
43
 
44
44
 
45
 
static void      gimp_message_box_class_init    (GimpMessageBoxClass   *klass);
46
 
 
47
45
static GObject * gimp_message_box_constructor   (GType                  type,
48
46
                                                 guint                  n_params,
49
47
                                                 GObjectConstructParam *params);
71
69
                                                 GtkAllocation  *allocation);
72
70
 
73
71
 
74
 
static GtkVBoxClass *parent_class = NULL;
75
 
 
76
 
 
77
 
GType
78
 
gimp_message_box_get_type (void)
79
 
{
80
 
  static GType box_type = 0;
81
 
 
82
 
  if (! box_type)
83
 
    {
84
 
      static const GTypeInfo box_info =
85
 
      {
86
 
        sizeof (GimpMessageBoxClass),
87
 
        (GBaseInitFunc) NULL,
88
 
        (GBaseFinalizeFunc) NULL,
89
 
        (GClassInitFunc) gimp_message_box_class_init,
90
 
        NULL,           /* class_finalize */
91
 
        NULL,           /* class_data     */
92
 
        sizeof (GimpMessageBox),
93
 
        0,              /* n_preallocs    */
94
 
        (GInstanceInitFunc) gimp_message_box_init
95
 
      };
96
 
 
97
 
      box_type = g_type_register_static (GTK_TYPE_VBOX,
98
 
                                         "GimpMessageBox",
99
 
                                         &box_info, 0);
100
 
    }
101
 
 
102
 
  return box_type;
103
 
}
 
72
G_DEFINE_TYPE (GimpMessageBox, gimp_message_box, GTK_TYPE_VBOX)
 
73
 
 
74
#define parent_class gimp_message_box_parent_class
 
75
 
104
76
 
105
77
static void
106
78
gimp_message_box_class_init (GimpMessageBoxClass *klass)
110
82
  GtkWidgetClass    *widget_class     = GTK_WIDGET_CLASS (klass);
111
83
  GtkContainerClass *container_class  = GTK_CONTAINER_CLASS (klass);
112
84
 
113
 
  parent_class = g_type_class_peek_parent (klass);
114
 
 
115
85
  object_class->constructor   = gimp_message_box_constructor;
116
86
  object_class->set_property  = gimp_message_box_set_property;
117
87
  object_class->get_property  = gimp_message_box_get_property;
127
97
  g_object_class_install_property (object_class, PROP_STOCK_ID,
128
98
                                   g_param_spec_string ("stock-id", NULL, NULL,
129
99
                                                        NULL,
130
 
                                                        G_PARAM_READWRITE |
 
100
                                                        GIMP_PARAM_READWRITE |
131
101
                                                        G_PARAM_CONSTRUCT_ONLY));
132
102
}
133
103
 
139
109
  gtk_box_set_spacing (GTK_BOX (box), 12);
140
110
  gtk_container_set_border_width (GTK_CONTAINER (box), 12);
141
111
 
 
112
  /*  Unset the focus chain to keep the labels from being in the focus
 
113
   *  chain.  Users of GimpMessageBox that add focusable widgets should
 
114
   *  either unset the focus chain or (better) explicitely set one.
 
115
   */
 
116
  gtk_container_set_focus_chain (GTK_CONTAINER (box), NULL);
 
117
 
142
118
  for (i = 0; i < 2; i++)
143
119
    {
144
120
      GtkWidget *label = g_object_new (GTK_TYPE_LABEL,
145
121
                                       "wrap",       TRUE,
146
122
                                       "selectable", TRUE,
147
 
                                       "can-focus",  FALSE,
148
123
                                       "xalign",     0.0,
149
124
                                       "yalign",     0.5,
150
125
                                       NULL);
403
378
gimp_message_box_new (const gchar *stock_id)
404
379
{
405
380
  return g_object_new (GIMP_TYPE_MESSAGE_BOX,
406
 
                       "stock_id",  stock_id,
 
381
                       "stock-id",  stock_id,
407
382
                       NULL);
408
383
}
409
384