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

« back to all changes in this revision

Viewing changes to plug-ins/common/glasstile.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:
42
42
 
43
43
#include <string.h>
44
44
 
45
 
#include <gtk/gtk.h>
46
 
 
47
45
#include <libgimp/gimp.h>
48
46
#include <libgimp/gimpui.h>
49
47
 
50
48
#include "libgimp/stdplugins-intl.h"
51
49
 
 
50
 
 
51
#define PLUG_IN_PROC   "plug-in-glasstile"
 
52
#define PLUG_IN_BINARY "glasstile"
 
53
 
 
54
 
52
55
/* --- Typedefs --- */
53
56
typedef struct
54
57
{
86
89
 
87
90
 
88
91
/* --- Variables --- */
89
 
GimpPlugInInfo PLUG_IN_INFO =
 
92
const GimpPlugInInfo PLUG_IN_INFO =
90
93
{
91
94
  NULL,    /* init_proc */
92
95
  NULL,    /* quit_proc */
110
113
static void
111
114
query (void)
112
115
{
113
 
  static GimpParamDef args[] =
 
116
  static const GimpParamDef args[] =
114
117
  {
115
 
    { GIMP_PDB_INT32,    "run_mode", "Interactive, non-interactive" },
 
118
    { GIMP_PDB_INT32,    "run-mode", "Interactive, non-interactive" },
116
119
    { GIMP_PDB_IMAGE,    "image",    "Input image (unused)"         },
117
120
    { GIMP_PDB_DRAWABLE, "drawable", "Input drawable"               },
118
121
    { GIMP_PDB_INT32,    "tilex",    "Tile width (10 - 50)"         },
119
122
    { GIMP_PDB_INT32,    "tiley",    "Tile height (10 - 50)"        }
120
123
  };
121
124
 
122
 
  gimp_install_procedure ("plug_in_glasstile",
123
 
                          "Divide the image into square glassblocks",
 
125
  gimp_install_procedure (PLUG_IN_PROC,
 
126
                          N_("Simulate distortion caused by square glass tiles"),
124
127
                          "Divide the image into square glassblocks in "
125
128
                          "which the image is refracted.",
126
129
                          "Karl-Johan Andersson", /* Author */
132
135
                          G_N_ELEMENTS (args), 0,
133
136
                          args, NULL);
134
137
 
135
 
  gimp_plugin_menu_register ("plug_in_glasstile",
136
 
                             "<Image>/Filters/Glass Effects");
 
138
  gimp_plugin_menu_register (PLUG_IN_PROC,
 
139
                             "<Image>/Filters/Light and Shadow/Glass");
137
140
}
138
141
 
139
142
static void
166
169
    {
167
170
    case GIMP_RUN_INTERACTIVE:
168
171
      /*  Possibly retrieve data  */
169
 
      gimp_get_data ("plug_in_glasstile", &gtvals);
 
172
      gimp_get_data (PLUG_IN_PROC, &gtvals);
170
173
 
171
174
      /*  First acquire information with a dialog  */
172
175
      if (! glasstile_dialog (drawable))
193
196
 
194
197
    case GIMP_RUN_WITH_LAST_VALS:
195
198
      /*  Possibly retrieve data  */
196
 
      gimp_get_data ("plug_in_glasstile", &gtvals);
 
199
      gimp_get_data (PLUG_IN_PROC, &gtvals);
197
200
      break;
198
201
 
199
202
    default:
206
209
      if (gimp_drawable_is_rgb (drawable->drawable_id) ||
207
210
          gimp_drawable_is_gray (drawable->drawable_id))
208
211
        {
209
 
          gimp_progress_init (_("Glass Tile..."));
 
212
          gimp_progress_init (_("Glass Tile"));
210
213
 
211
214
          glasstile (drawable, NULL);
212
215
 
215
218
          /*  Store data  */
216
219
          if (run_mode == GIMP_RUN_INTERACTIVE)
217
220
            {
218
 
              gimp_set_data ("plug_in_glasstile", &gtvals,
219
 
                             sizeof (GlassValues));
 
221
              gimp_set_data (PLUG_IN_PROC, &gtvals, sizeof (GlassValues));
220
222
            }
221
223
        }
222
224
      else
245
247
  gv->gval = &gtvals;
246
248
  gtvals.constrain = TRUE;
247
249
 
248
 
  gimp_ui_init ("glasstile", TRUE);
 
250
  gimp_ui_init (PLUG_IN_BINARY, TRUE);
249
251
 
250
 
  dialog = gimp_dialog_new (_("Glass Tile"), "glasstile",
 
252
  dialog = gimp_dialog_new (_("Glass Tile"), PLUG_IN_BINARY,
251
253
                            NULL, 0,
252
 
                            gimp_standard_help_func, "plug-in-glasstile",
 
254
                            gimp_standard_help_func, PLUG_IN_PROC,
253
255
 
254
256
                            GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
255
257
                            GTK_STOCK_OK,     GTK_RESPONSE_OK,
256
258
 
257
259
                            NULL);
258
260
 
 
261
  gtk_dialog_set_alternative_button_order (GTK_DIALOG (dialog),
 
262
                                           GTK_RESPONSE_OK,
 
263
                                           GTK_RESPONSE_CANCEL,
 
264
                                           -1);
 
265
 
 
266
  gimp_window_set_transient (GTK_WINDOW (dialog));
 
267
 
259
268
  main_vbox = gtk_vbox_new (FALSE, 12);
260
269
  gtk_container_set_border_width (GTK_CONTAINER (main_vbox), 12);
261
270
  gtk_container_add (GTK_CONTAINER (GTK_DIALOG (dialog)->vbox), main_vbox);
283
292
                                   TRUE, 0, 0,
284
293
                                   NULL, NULL);
285
294
 
286
 
  g_signal_connect (gv->xadj, "value_changed",
 
295
  g_signal_connect (gv->xadj, "value-changed",
287
296
                    G_CALLBACK (glasstile_size_changed),
288
297
                    gv);
289
 
  g_signal_connect_swapped (gv->xadj, "value_changed",
 
298
  g_signal_connect_swapped (gv->xadj, "value-changed",
290
299
                            G_CALLBACK (gimp_preview_invalidate),
291
300
                            preview);
292
301
 
297
306
                                   TRUE, 0, 0,
298
307
                                   NULL, NULL);
299
308
 
300
 
  g_signal_connect (gv->yadj, "value_changed",
 
309
  g_signal_connect (gv->yadj, "value-changed",
301
310
                    G_CALLBACK (glasstile_size_changed),
302
311
                    gv);
303
 
  g_signal_connect_swapped (gv->yadj, "value_changed",
 
312
  g_signal_connect_swapped (gv->yadj, "value-changed",
304
313
                            G_CALLBACK (gimp_preview_invalidate),
305
314
                            preview);
306
315