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

« back to all changes in this revision

Viewing changes to app/display/gimpdisplayoptions.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
 * GimpDisplayOptions
26
26
#include "libgimpbase/gimpbase.h"
27
27
#include "libgimpmath/gimpmath.h"
28
28
#include "libgimpcolor/gimpcolor.h"
 
29
#include "libgimpconfig/gimpconfig.h"
29
30
 
30
31
#include "core/core-types.h"
31
32
#include "display-enums.h"
32
33
 
33
 
#include "config/gimpconfig.h"
34
 
#include "config/gimpconfig.h"
35
 
#include "config/gimpconfig-params.h"
36
34
#include "config/gimprc-blurbs.h"
37
35
 
38
36
#include "gimpdisplayoptions.h"
51
49
  PROP_SHOW_LAYER_BOUNDARY,
52
50
  PROP_SHOW_GUIDES,
53
51
  PROP_SHOW_GRID,
 
52
  PROP_SHOW_SAMPLE_POINTS,
54
53
  PROP_PADDING_MODE,
55
54
  PROP_PADDING_COLOR
56
55
};
57
56
 
58
57
 
59
 
static void  gimp_display_options_class_init    (GimpDisplayOptionsClass *klass);
60
 
static void  gimp_display_options_fs_class_init (GimpDisplayOptionsClass *klass);
61
 
static void  gimp_display_options_init          (GimpDisplayOptions      *options);
62
 
 
63
 
static void  gimp_display_options_set_property  (GObject      *object,
64
 
                                                guint         property_id,
65
 
                                                const GValue *value,
66
 
                                                GParamSpec   *pspec);
67
 
static void  gimp_display_options_get_property  (GObject      *object,
68
 
                                                guint         property_id,
69
 
                                                GValue       *value,
70
 
                                                GParamSpec   *pspec);
71
 
 
72
 
 
73
 
GType
74
 
gimp_display_options_get_type (void)
75
 
{
76
 
  static GType options_type = 0;
77
 
 
78
 
  if (! options_type)
79
 
    {
80
 
      static const GTypeInfo options_info =
81
 
      {
82
 
        sizeof (GimpDisplayOptionsClass),
83
 
        (GBaseInitFunc) NULL,
84
 
        (GBaseFinalizeFunc) NULL,
85
 
        (GClassInitFunc) gimp_display_options_class_init,
86
 
        NULL,           /* class_finalize */
87
 
        NULL,           /* class_data     */
88
 
        sizeof (GimpDisplayOptions),
89
 
        0,              /* n_preallocs    */
90
 
        (GInstanceInitFunc) gimp_display_options_init
91
 
      };
92
 
      static const GInterfaceInfo config_iface_info =
93
 
      {
94
 
        NULL,           /* iface_init     */
95
 
        NULL,           /* iface_finalize */
96
 
        NULL            /* iface_data     */
97
 
      };
98
 
 
99
 
      options_type = g_type_register_static (G_TYPE_OBJECT,
100
 
                                             "GimpDisplayOptions",
101
 
                                             &options_info, 0);
102
 
 
103
 
      g_type_add_interface_static (options_type, GIMP_TYPE_CONFIG,
104
 
                                   &config_iface_info);
105
 
    }
106
 
 
107
 
  return options_type;
108
 
}
109
 
 
110
 
GType
111
 
gimp_display_options_fullscreen_get_type (void)
112
 
{
113
 
  static GType options_type = 0;
114
 
 
115
 
  if (! options_type)
116
 
    {
117
 
      static const GTypeInfo options_info =
118
 
      {
119
 
        sizeof (GimpDisplayOptionsClass),
120
 
        (GBaseInitFunc) NULL,
121
 
        (GBaseFinalizeFunc) NULL,
122
 
        (GClassInitFunc) gimp_display_options_fs_class_init,
123
 
        NULL,           /* class_finalize */
124
 
        NULL,           /* class_data     */
125
 
        sizeof (GimpDisplayOptions),
126
 
        0,              /* n_preallocs    */
127
 
        NULL            /* instance_init  */
128
 
      };
129
 
      static const GInterfaceInfo config_iface_info =
130
 
      {
131
 
        NULL,           /* iface_init     */
132
 
        NULL,           /* iface_finalize */
133
 
        NULL            /* iface_data     */
134
 
      };
135
 
 
136
 
      options_type = g_type_register_static (GIMP_TYPE_DISPLAY_OPTIONS,
137
 
                                             "GimpDisplayOptionsFullscreen",
138
 
                                             &options_info, 0);
139
 
 
140
 
      g_type_add_interface_static (options_type, GIMP_TYPE_CONFIG,
141
 
                                   &config_iface_info);
142
 
    }
143
 
 
144
 
  return options_type;
145
 
}
 
58
static void   gimp_display_options_set_property (GObject      *object,
 
59
                                                 guint         property_id,
 
60
                                                 const GValue *value,
 
61
                                                 GParamSpec   *pspec);
 
62
static void   gimp_display_options_get_property (GObject      *object,
 
63
                                                 guint         property_id,
 
64
                                                 GValue       *value,
 
65
                                                 GParamSpec   *pspec);
 
66
 
 
67
 
 
68
G_DEFINE_TYPE_WITH_CODE (GimpDisplayOptions,
 
69
                         gimp_display_options,
 
70
                         G_TYPE_OBJECT,
 
71
                         G_IMPLEMENT_INTERFACE (GIMP_TYPE_CONFIG, NULL))
 
72
 
 
73
typedef struct _GimpDisplayOptions      GimpDisplayOptionsFullscreen;
 
74
typedef struct _GimpDisplayOptionsClass GimpDisplayOptionsFullscreenClass;
 
75
 
 
76
#define gimp_display_options_fullscreen_init gimp_display_options_init
 
77
 
 
78
G_DEFINE_TYPE_WITH_CODE (GimpDisplayOptionsFullscreen,
 
79
                         gimp_display_options_fullscreen,
 
80
                         GIMP_TYPE_DISPLAY_OPTIONS,
 
81
                         G_IMPLEMENT_INTERFACE (GIMP_TYPE_CONFIG, NULL))
 
82
 
146
83
 
147
84
static void
148
85
gimp_display_options_class_init (GimpDisplayOptionsClass *klass)
158
95
  GIMP_CONFIG_INSTALL_PROP_BOOLEAN (object_class, PROP_SHOW_MENUBAR,
159
96
                                    "show-menubar", SHOW_MENUBAR_BLURB,
160
97
                                    TRUE,
161
 
                                    0);
 
98
                                    GIMP_PARAM_STATIC_STRINGS);
162
99
  GIMP_CONFIG_INSTALL_PROP_BOOLEAN (object_class, PROP_SHOW_RULERS,
163
100
                                    "show-rulers", SHOW_RULERS_BLURB,
164
101
                                    TRUE,
165
 
                                    0);
 
102
                                    GIMP_PARAM_STATIC_STRINGS);
166
103
  GIMP_CONFIG_INSTALL_PROP_BOOLEAN (object_class, PROP_SHOW_SCROLLBARS,
167
104
                                    "show-scrollbars", SHOW_SCROLLBARS_BLURB,
168
105
                                    TRUE,
169
 
                                    0);
 
106
                                    GIMP_PARAM_STATIC_STRINGS);
170
107
  GIMP_CONFIG_INSTALL_PROP_BOOLEAN (object_class, PROP_SHOW_STATUSBAR,
171
108
                                    "show-statusbar", SHOW_STATUSBAR_BLURB,
172
109
                                    TRUE,
173
 
                                    0);
 
110
                                    GIMP_PARAM_STATIC_STRINGS);
174
111
  GIMP_CONFIG_INSTALL_PROP_BOOLEAN (object_class, PROP_SHOW_SELECTION,
175
112
                                    "show-selection", SHOW_SELECTION_BLURB,
176
113
                                    TRUE,
177
 
                                    0);
 
114
                                    GIMP_PARAM_STATIC_STRINGS);
178
115
  GIMP_CONFIG_INSTALL_PROP_BOOLEAN (object_class, PROP_SHOW_LAYER_BOUNDARY,
179
116
                                    "show-layer-boundary", SHOW_LAYER_BOUNDARY_BLURB,
180
117
                                    TRUE,
181
 
                                    0);
 
118
                                    GIMP_PARAM_STATIC_STRINGS);
182
119
  GIMP_CONFIG_INSTALL_PROP_BOOLEAN (object_class, PROP_SHOW_GUIDES,
183
120
                                    "show-guides", SHOW_GUIDES_BLURB,
184
121
                                    TRUE,
185
 
                                    0);
 
122
                                    GIMP_PARAM_STATIC_STRINGS);
186
123
  GIMP_CONFIG_INSTALL_PROP_BOOLEAN (object_class, PROP_SHOW_GRID,
187
124
                                    "show-grid", SHOW_GRID_BLURB,
188
125
                                    FALSE,
189
 
                                    0);
 
126
                                    GIMP_PARAM_STATIC_STRINGS);
 
127
  GIMP_CONFIG_INSTALL_PROP_BOOLEAN (object_class, PROP_SHOW_SAMPLE_POINTS,
 
128
                                    "show-sample-points", SHOW_SAMPLE_POINTS_BLURB,
 
129
                                    TRUE,
 
130
                                    GIMP_PARAM_STATIC_STRINGS);
190
131
  GIMP_CONFIG_INSTALL_PROP_ENUM (object_class, PROP_PADDING_MODE,
191
132
                                 "padding-mode", CANVAS_PADDING_MODE_BLURB,
192
133
                                 GIMP_TYPE_CANVAS_PADDING_MODE,
193
134
                                 GIMP_CANVAS_PADDING_MODE_DEFAULT,
194
 
                                 0);
 
135
                                 GIMP_PARAM_STATIC_STRINGS);
195
136
  GIMP_CONFIG_INSTALL_PROP_RGB (object_class, PROP_PADDING_COLOR,
196
137
                                "padding-color", CANVAS_PADDING_COLOR_BLURB,
197
 
                                &white,
198
 
                                0);
 
138
                                FALSE, &white,
 
139
                                GIMP_PARAM_STATIC_STRINGS);
199
140
}
200
141
 
201
142
static void
202
 
gimp_display_options_fs_class_init (GimpDisplayOptionsClass *klass)
 
143
gimp_display_options_fullscreen_class_init (GimpDisplayOptionsFullscreenClass *klass)
203
144
{
204
145
  GObjectClass *object_class = G_OBJECT_CLASS (klass);
205
146
  GimpRGB       black;
212
153
  GIMP_CONFIG_INSTALL_PROP_BOOLEAN (object_class, PROP_SHOW_MENUBAR,
213
154
                                    "show-menubar", SHOW_MENUBAR_BLURB,
214
155
                                    FALSE,
215
 
                                    0);
 
156
                                    GIMP_PARAM_STATIC_STRINGS);
216
157
  GIMP_CONFIG_INSTALL_PROP_BOOLEAN (object_class, PROP_SHOW_RULERS,
217
158
                                    "show-rulers", SHOW_RULERS_BLURB,
218
159
                                    FALSE,
219
 
                                    0);
 
160
                                    GIMP_PARAM_STATIC_STRINGS);
220
161
  GIMP_CONFIG_INSTALL_PROP_BOOLEAN (object_class, PROP_SHOW_SCROLLBARS,
221
162
                                    "show-scrollbars", SHOW_SCROLLBARS_BLURB,
222
163
                                    FALSE,
223
 
                                    0);
 
164
                                    GIMP_PARAM_STATIC_STRINGS);
224
165
  GIMP_CONFIG_INSTALL_PROP_BOOLEAN (object_class, PROP_SHOW_STATUSBAR,
225
166
                                    "show-statusbar", SHOW_STATUSBAR_BLURB,
226
167
                                    FALSE,
227
 
                                    0);
 
168
                                    GIMP_PARAM_STATIC_STRINGS);
228
169
  GIMP_CONFIG_INSTALL_PROP_BOOLEAN (object_class, PROP_SHOW_SELECTION,
229
170
                                    "show-selection", SHOW_SELECTION_BLURB,
230
171
                                    FALSE,
231
 
                                    0);
 
172
                                    GIMP_PARAM_STATIC_STRINGS);
232
173
  GIMP_CONFIG_INSTALL_PROP_BOOLEAN (object_class, PROP_SHOW_LAYER_BOUNDARY,
233
174
                                    "show-layer-boundary", SHOW_LAYER_BOUNDARY_BLURB,
234
175
                                    FALSE,
235
 
                                    0);
 
176
                                    GIMP_PARAM_STATIC_STRINGS);
236
177
  GIMP_CONFIG_INSTALL_PROP_BOOLEAN (object_class, PROP_SHOW_GUIDES,
237
178
                                    "show-guides", SHOW_GUIDES_BLURB,
238
179
                                    FALSE,
239
 
                                    0);
 
180
                                    GIMP_PARAM_STATIC_STRINGS);
240
181
  GIMP_CONFIG_INSTALL_PROP_BOOLEAN (object_class, PROP_SHOW_GRID,
241
182
                                    "show-grid", SHOW_GRID_BLURB,
242
183
                                    FALSE,
243
 
                                    0);
 
184
                                    GIMP_PARAM_STATIC_STRINGS);
 
185
  GIMP_CONFIG_INSTALL_PROP_BOOLEAN (object_class, PROP_SHOW_SAMPLE_POINTS,
 
186
                                    "show-sample-points", SHOW_SAMPLE_POINTS_BLURB,
 
187
                                    FALSE,
 
188
                                    GIMP_PARAM_STATIC_STRINGS);
244
189
  GIMP_CONFIG_INSTALL_PROP_ENUM (object_class, PROP_PADDING_MODE,
245
190
                                 "padding-mode", CANVAS_PADDING_MODE_BLURB,
246
191
                                 GIMP_TYPE_CANVAS_PADDING_MODE,
247
192
                                 GIMP_CANVAS_PADDING_MODE_CUSTOM,
248
 
                                 0);
 
193
                                 GIMP_PARAM_STATIC_STRINGS);
249
194
  GIMP_CONFIG_INSTALL_PROP_RGB (object_class, PROP_PADDING_COLOR,
250
195
                                "padding-color", CANVAS_PADDING_COLOR_BLURB,
251
 
                                &black,
252
 
                                0);
 
196
                                FALSE, &black,
 
197
                                GIMP_PARAM_STATIC_STRINGS);
253
198
}
254
199
 
255
200
static void
292
237
    case PROP_SHOW_GRID:
293
238
      options->show_grid = g_value_get_boolean (value);
294
239
      break;
 
240
    case PROP_SHOW_SAMPLE_POINTS:
 
241
      options->show_sample_points = g_value_get_boolean (value);
 
242
      break;
295
243
    case PROP_PADDING_MODE:
296
244
      options->padding_mode = g_value_get_enum (value);
297
245
      break;
339
287
    case PROP_SHOW_GRID:
340
288
      g_value_set_boolean (value, options->show_grid);
341
289
      break;
 
290
    case PROP_SHOW_SAMPLE_POINTS:
 
291
      g_value_set_boolean (value, options->show_sample_points);
 
292
      break;
342
293
    case PROP_PADDING_MODE:
343
294
      g_value_set_enum (value, options->padding_mode);
344
295
      break;