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

« back to all changes in this revision

Viewing changes to app/core/gimpgrid.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
 * GimpGrid
26
26
#include <glib-object.h>
27
27
 
28
28
#include "libgimpbase/gimpbase.h"
29
 
#include "libgimpbase/gimplimits.h"
 
29
#include "libgimpconfig/gimpconfig.h"
30
30
 
31
31
#include "libgimpcolor/gimpcolor.h"
32
32
 
33
33
#include "core-types.h"
34
34
 
35
 
#include "config/gimpconfig.h"
36
 
#include "config/gimpconfig-params.h"
37
 
 
38
35
#include "gimpgrid.h"
39
36
 
40
37
#include "gimp-intl.h"
54
51
  PROP_OFFSET_UNIT
55
52
};
56
53
 
57
 
static void gimp_grid_class_init   (GimpGridClass *klass);
58
 
static void gimp_grid_finalize     (GObject       *object);
59
 
static void gimp_grid_get_property (GObject       *object,
60
 
                                    guint          property_id,
61
 
                                    GValue        *value,
62
 
                                    GParamSpec    *pspec);
63
 
static void gimp_grid_set_property (GObject       *object,
64
 
                                    guint          property_id,
65
 
                                    const GValue  *value,
66
 
                                    GParamSpec    *pspec);
67
 
 
68
 
 
69
 
static GimpObjectClass *parent_class = NULL;
70
 
 
71
 
 
72
 
GType
73
 
gimp_grid_get_type (void)
74
 
{
75
 
  static GType grid_type = 0;
76
 
 
77
 
  if (! grid_type)
78
 
    {
79
 
      static const GTypeInfo grid_info =
80
 
      {
81
 
        sizeof (GimpGridClass),
82
 
        (GBaseInitFunc) NULL,
83
 
        (GBaseFinalizeFunc) NULL,
84
 
        (GClassInitFunc) gimp_grid_class_init,
85
 
        NULL,           /* class_finalize */
86
 
        NULL,           /* class_data     */
87
 
        sizeof (GimpGrid),
88
 
        0,              /* n_preallocs    */
89
 
        NULL            /* instance_init  */
90
 
      };
91
 
      static const GInterfaceInfo grid_iface_info =
92
 
      {
93
 
        NULL,           /* iface_init     */
94
 
        NULL,           /* iface_finalize */
95
 
        NULL            /* iface_data     */
96
 
      };
97
 
 
98
 
      grid_type = g_type_register_static (GIMP_TYPE_OBJECT,
99
 
                                          "GimpGrid", &grid_info, 0);
100
 
 
101
 
      g_type_add_interface_static (grid_type, GIMP_TYPE_CONFIG,
102
 
                                   &grid_iface_info);
103
 
    }
104
 
 
105
 
  return grid_type;
106
 
}
 
54
 
 
55
static void   gimp_grid_get_property (GObject      *object,
 
56
                                      guint         property_id,
 
57
                                      GValue       *value,
 
58
                                      GParamSpec   *pspec);
 
59
static void   gimp_grid_set_property (GObject      *object,
 
60
                                      guint         property_id,
 
61
                                      const GValue *value,
 
62
                                      GParamSpec   *pspec);
 
63
 
 
64
 
 
65
G_DEFINE_TYPE_WITH_CODE (GimpGrid, gimp_grid, GIMP_TYPE_OBJECT,
 
66
                         G_IMPLEMENT_INTERFACE (GIMP_TYPE_CONFIG, NULL))
 
67
 
107
68
 
108
69
static void
109
70
gimp_grid_class_init (GimpGridClass *klass)
110
71
{
111
 
  GObjectClass *object_class;
 
72
  GObjectClass *object_class = G_OBJECT_CLASS (klass);
112
73
  GimpRGB       black;
113
74
  GimpRGB       white;
114
75
 
115
 
  object_class = G_OBJECT_CLASS (klass);
116
 
 
117
 
  parent_class = g_type_class_peek_parent (klass);
118
 
 
119
 
  object_class->finalize     = gimp_grid_finalize;
120
76
  object_class->get_property = gimp_grid_get_property;
121
77
  object_class->set_property = gimp_grid_set_property;
122
78
 
128
84
                                 N_("Line style used for the grid."),
129
85
                                 GIMP_TYPE_GRID_STYLE,
130
86
                                 GIMP_GRID_INTERSECTIONS,
131
 
                                 0);
 
87
                                 GIMP_PARAM_STATIC_STRINGS);
132
88
  GIMP_CONFIG_INSTALL_PROP_RGB (object_class, PROP_FGCOLOR,
133
89
                                "fgcolor",
134
90
                                N_("The foreground color of the grid."),
135
 
                                &black,
136
 
                                0);
 
91
                                TRUE, &black,
 
92
                                GIMP_PARAM_STATIC_STRINGS);
137
93
  GIMP_CONFIG_INSTALL_PROP_RGB (object_class, PROP_BGCOLOR,
138
94
                                "bgcolor",
139
95
                                N_("The background color of the grid; "
140
96
                                   "only used in double dashed line style."),
141
 
                                &white,
142
 
                                0);
 
97
                                TRUE, &white,
 
98
                                GIMP_PARAM_STATIC_STRINGS);
143
99
  GIMP_CONFIG_INSTALL_PROP_DOUBLE (object_class, PROP_XSPACING,
144
 
                                   "xspacing",
 
100
                                   "xspacing",
145
101
                                   N_("Horizontal spacing of grid lines."),
146
 
                                   1.0, GIMP_MAX_IMAGE_SIZE, 10.0,
147
 
                                   0);
 
102
                                   1.0, GIMP_MAX_IMAGE_SIZE, 32.0,
 
103
                                   GIMP_PARAM_STATIC_STRINGS);
148
104
  GIMP_CONFIG_INSTALL_PROP_DOUBLE (object_class, PROP_YSPACING,
149
 
                                   "yspacing",
 
105
                                   "yspacing",
150
106
                                   N_("Vertical spacing of grid lines."),
151
 
                                   1.0, GIMP_MAX_IMAGE_SIZE, 10.0,
152
 
                                   0);
 
107
                                   1.0, GIMP_MAX_IMAGE_SIZE, 32.0,
 
108
                                   GIMP_PARAM_STATIC_STRINGS);
153
109
  GIMP_CONFIG_INSTALL_PROP_UNIT (object_class, PROP_SPACING_UNIT,
154
 
                                 "spacing-unit", NULL,
155
 
                                 FALSE, FALSE, GIMP_UNIT_INCH,
156
 
                                 0);
 
110
                                 "spacing-unit", NULL,
 
111
                                 FALSE, FALSE, GIMP_UNIT_INCH,
 
112
                                 GIMP_PARAM_STATIC_STRINGS);
157
113
  GIMP_CONFIG_INSTALL_PROP_DOUBLE (object_class, PROP_XOFFSET,
158
 
                                   "xoffset",
 
114
                                   "xoffset",
159
115
                                   N_("Horizontal offset of the first grid "
160
116
                                      "line; this may be a negative number."),
161
 
                                   - GIMP_MAX_IMAGE_SIZE,
 
117
                                   - GIMP_MAX_IMAGE_SIZE,
162
118
                                   GIMP_MAX_IMAGE_SIZE, 0.0,
163
 
                                   0);
 
119
                                   GIMP_PARAM_STATIC_STRINGS);
164
120
  GIMP_CONFIG_INSTALL_PROP_DOUBLE (object_class, PROP_YOFFSET,
165
 
                                   "yoffset",
 
121
                                   "yoffset",
166
122
                                   N_("Vertical offset of the first grid "
167
123
                                      "line; this may be a negative number."),
168
 
                                   - GIMP_MAX_IMAGE_SIZE,
 
124
                                   - GIMP_MAX_IMAGE_SIZE,
169
125
                                   GIMP_MAX_IMAGE_SIZE, 0.0,
170
 
                                   0);
 
126
                                   GIMP_PARAM_STATIC_STRINGS);
171
127
  GIMP_CONFIG_INSTALL_PROP_UNIT (object_class, PROP_OFFSET_UNIT,
172
 
                                 "offset-unit", NULL,
173
 
                                 FALSE, FALSE, GIMP_UNIT_INCH,
174
 
                                 0);
 
128
                                 "offset-unit", NULL,
 
129
                                 FALSE, FALSE, GIMP_UNIT_INCH,
 
130
                                 GIMP_PARAM_STATIC_STRINGS);
175
131
}
176
132
 
177
133
static void
178
 
gimp_grid_finalize (GObject *object)
 
134
gimp_grid_init (GimpGrid *grid)
179
135
{
180
 
  G_OBJECT_CLASS (parent_class)->finalize (object);
181
136
}
182
137
 
183
 
 
184
138
static void
185
139
gimp_grid_get_property (GObject      *object,
186
140
                        guint         property_id,