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

« back to all changes in this revision

Viewing changes to app/tools/gimpmagnifyoptions.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
20
20
 
21
21
#include <gtk/gtk.h>
22
22
 
 
23
#include "libgimpconfig/gimpconfig.h"
23
24
#include "libgimpwidgets/gimpwidgets.h"
24
25
 
25
26
#include "tools-types.h"
26
27
 
27
 
#include "config/gimpconfig-params.h"
28
28
#include "config/gimpdisplayconfig.h"
29
29
 
30
30
#include "core/gimp.h"
31
31
#include "core/gimptoolinfo.h"
32
32
 
33
 
#include "widgets/gimppropwidgets.h"
34
33
#include "widgets/gimpwidgets-utils.h"
35
34
 
36
35
#include "gimpmagnifyoptions.h"
48
47
};
49
48
 
50
49
 
51
 
static void   gimp_magnify_options_class_init (GimpMagnifyOptionsClass *klass);
52
 
 
53
50
static void   gimp_magnify_options_set_property (GObject         *object,
54
51
                                                 guint            property_id,
55
52
                                                 const GValue    *value,
62
59
static void   gimp_magnify_options_reset        (GimpToolOptions *tool_options);
63
60
 
64
61
 
65
 
static GimpToolOptionsClass *parent_class = NULL;
66
 
 
67
 
 
68
 
GType
69
 
gimp_magnify_options_get_type (void)
70
 
{
71
 
  static GType type = 0;
72
 
 
73
 
  if (! type)
74
 
    {
75
 
      static const GTypeInfo info =
76
 
      {
77
 
        sizeof (GimpMagnifyOptionsClass),
78
 
        (GBaseInitFunc) NULL,
79
 
        (GBaseFinalizeFunc) NULL,
80
 
        (GClassInitFunc) gimp_magnify_options_class_init,
81
 
        NULL,           /* class_finalize */
82
 
        NULL,           /* class_data     */
83
 
        sizeof (GimpMagnifyOptions),
84
 
        0,              /* n_preallocs    */
85
 
        (GInstanceInitFunc) NULL
86
 
      };
87
 
 
88
 
      type = g_type_register_static (GIMP_TYPE_TOOL_OPTIONS,
89
 
                                     "GimpMagnifyOptions",
90
 
                                     &info, 0);
91
 
    }
92
 
 
93
 
  return type;
94
 
}
 
62
G_DEFINE_TYPE (GimpMagnifyOptions, gimp_magnify_options,
 
63
               GIMP_TYPE_TOOL_OPTIONS)
 
64
 
 
65
#define parent_class gimp_magnify_options_parent_class
 
66
 
95
67
 
96
68
static void
97
69
gimp_magnify_options_class_init (GimpMagnifyOptionsClass *klass)
99
71
  GObjectClass         *object_class  = G_OBJECT_CLASS (klass);
100
72
  GimpToolOptionsClass *options_class = GIMP_TOOL_OPTIONS_CLASS (klass);
101
73
 
102
 
  parent_class = g_type_class_peek_parent (klass);
103
 
 
104
74
  object_class->set_property = gimp_magnify_options_set_property;
105
75
  object_class->get_property = gimp_magnify_options_get_property;
106
76
 
109
79
  GIMP_CONFIG_INSTALL_PROP_BOOLEAN (object_class, PROP_AUTO_RESIZE,
110
80
                                    "auto-resize", NULL,
111
81
                                    FALSE,
112
 
                                    0);
 
82
                                    GIMP_PARAM_STATIC_STRINGS);
113
83
  GIMP_CONFIG_INSTALL_PROP_ENUM (object_class, PROP_ZOOM_TYPE,
114
84
                                 "zoom-type", NULL,
115
85
                                 GIMP_TYPE_ZOOM_TYPE,
116
86
                                 GIMP_ZOOM_IN,
117
 
                                 0);
 
87
                                 GIMP_PARAM_STATIC_STRINGS);
118
88
  GIMP_CONFIG_INSTALL_PROP_DOUBLE (object_class, PROP_THRESHOLD,
119
89
                                   "threshold", NULL,
120
 
                                   1.0, 15.0, 5.0,
121
 
                                   0);
 
90
                                   1.0, 15.0, 8.0,
 
91
                                   GIMP_PARAM_STATIC_STRINGS);
 
92
}
 
93
 
 
94
static void
 
95
gimp_magnify_options_init (GimpMagnifyOptions *options)
 
96
{
122
97
}
123
98
 
124
99
static void
190
165
gimp_magnify_options_gui (GimpToolOptions *tool_options)
191
166
{
192
167
  GObject   *config = G_OBJECT (tool_options);
193
 
  GtkWidget *vbox;
 
168
  GtkWidget *vbox   = gimp_tool_options_gui (tool_options);
194
169
  GtkWidget *frame;
195
 
  GtkWidget *table;
196
170
  GtkWidget *button;
197
171
  gchar     *str;
198
172
 
199
 
  vbox = gimp_tool_options_gui (tool_options);
200
 
 
201
173
  /*  the auto_resize toggle button  */
202
174
  button = gimp_prop_check_button_new (config, "auto-resize",
203
175
                                       _("Auto-resize window"));
205
177
  gtk_widget_show (button);
206
178
 
207
179
  /*  tool toggle  */
208
 
  str = g_strdup_printf (_("Tool Toggle  %s"),
 
180
  str = g_strdup_printf (_("Tool Toggle  (%s)"),
209
181
                         gimp_get_mod_string (GDK_CONTROL_MASK));
210
182
 
211
183
  frame = gimp_prop_enum_radio_frame_new (config, "zoom-type",
215
187
 
216
188
  g_free (str);
217
189
 
218
 
  /*  window threshold */
219
 
  table = gtk_table_new (1, 3, FALSE);
220
 
  gtk_table_set_col_spacings (GTK_TABLE (table), 2);
221
 
  gtk_box_pack_start (GTK_BOX (vbox), table, FALSE, FALSE, 0);
222
 
  gtk_widget_show (table);
223
 
 
224
 
  gimp_prop_scale_entry_new (config, "threshold",
225
 
                             GTK_TABLE (table), 0, 0,
226
 
                             _("Threshold:"),
227
 
                             1.0, 3.0, 1,
228
 
                             FALSE, 0.0, 0.0);
229
 
 
230
190
  return vbox;
231
191
}