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

« back to all changes in this revision

Viewing changes to plug-ins/common/papertile.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:
24
24
 
25
25
#include <stdlib.h>
26
26
 
27
 
#include <gtk/gtk.h>
28
 
 
29
27
#include <libgimp/gimp.h>
30
28
#include <libgimp/gimpui.h>
31
29
 
32
30
#include "libgimp/stdplugins-intl.h"
33
31
 
 
32
 
34
33
/*===========================================================================*/
35
34
/* DEFINES                                                                   */
36
35
/*===========================================================================*/
37
36
 
38
 
#define PLUGIN_PROCEDURE_NAME "plug_in_papertile"
39
 
#define HELP_ID               "plug-in-papertile"
 
37
#define PLUG_IN_PROC   "plug-in-papertile"
 
38
#define PLUG_IN_BINARY "papertile"
40
39
 
41
40
/*===========================================================================*/
42
41
/* TYPES                                                                     */
126
125
static void
127
126
params_save_to_gimp (void)
128
127
{
129
 
  gimp_set_data (PLUGIN_PROCEDURE_NAME, &p.params, sizeof p.params);
 
128
  gimp_set_data (PLUG_IN_PROC, &p.params, sizeof p.params);
130
129
}
131
130
 
132
131
static void
133
132
params_load_from_gimp (void)
134
133
{
135
 
  gimp_get_data (PLUGIN_PROCEDURE_NAME, &p.params);
 
134
  gimp_get_data (PLUG_IN_PROC, &p.params);
136
135
 
137
136
  if (0 < p.params.division_x)
138
137
    {
230
229
  GtkWidget *frame;
231
230
  GtkWidget *color_button;
232
231
 
233
 
  gimp_ui_init ("papertile", TRUE);
 
232
  gimp_ui_init (PLUG_IN_BINARY, TRUE);
234
233
 
235
 
  dialog = gimp_dialog_new (_("Paper Tile"), "papertile",
 
234
  dialog = gimp_dialog_new (_("Paper Tile"), PLUG_IN_BINARY,
236
235
                            NULL, 0,
237
 
                            gimp_standard_help_func, HELP_ID,
 
236
                            gimp_standard_help_func, PLUG_IN_PROC,
238
237
 
239
238
                            GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
240
239
                            GTK_STOCK_OK,     GTK_RESPONSE_OK,
241
240
 
242
241
                            NULL);
243
242
 
 
243
  gtk_dialog_set_alternative_button_order (GTK_DIALOG (dialog),
 
244
                                           GTK_RESPONSE_OK,
 
245
                                           GTK_RESPONSE_CANCEL,
 
246
                                           -1);
 
247
 
 
248
  gimp_window_set_transient (GTK_WINDOW (dialog));
 
249
 
244
250
  main_hbox = gtk_hbox_new (FALSE, 12);
245
251
  gtk_container_set_border_width (GTK_CONTAINER (main_hbox), 12);
246
252
  gtk_container_add (GTK_CONTAINER (GTK_DIALOG (dialog)->vbox), main_hbox);
266
272
  gimp_table_attach_aligned (GTK_TABLE (table), 0, 0,
267
273
                             _("_X:"), 0.0, 0.5,
268
274
                             button, 1, TRUE);
269
 
  g_signal_connect (w.division_x_adj, "value_changed",
 
275
  g_signal_connect (w.division_x_adj, "value-changed",
270
276
                    G_CALLBACK (division_x_adj_changed),
271
277
                    NULL);
272
278
 
275
281
  gimp_table_attach_aligned (GTK_TABLE (table), 0, 1,
276
282
                             _("_Y:"), 0.0, 0.5,
277
283
                             button, 1, TRUE);
278
 
  g_signal_connect (w.division_y_adj, "value_changed",
 
284
  g_signal_connect (w.division_y_adj, "value-changed",
279
285
                    G_CALLBACK (division_y_adj_changed),
280
286
                    NULL);
281
287
 
286
292
  gimp_table_attach_aligned (GTK_TABLE (table), 0, 2,
287
293
                             _("_Size:"), 0.0, 0.5,
288
294
                             button, 1, TRUE);
289
 
  g_signal_connect (w.tile_size_adj, "value_changed",
 
295
  g_signal_connect (w.tile_size_adj, "value-changed",
290
296
                    G_CALLBACK (tile_size_adj_changed),
291
297
                    NULL);
292
298
 
336
342
  gimp_table_attach_aligned (GTK_TABLE (table), 0, 0,
337
343
                             _("_Max (%):"), 0.0, 0.5,
338
344
                             button, 1, TRUE);
339
 
  g_signal_connect (adjustment, "value_changed",
 
345
  g_signal_connect (adjustment, "value-changed",
340
346
                    G_CALLBACK (gimp_double_adjustment_update),
341
347
                    &p.params.move_max_rate);
342
348
 
385
391
                            p.params.background_type == BACKGROUND_TYPE_COLOR);
386
392
  g_object_set_data (G_OBJECT (button), "set_sensitive", color_button);
387
393
 
388
 
  g_signal_connect (color_button, "color_changed",
 
394
  g_signal_connect (color_button, "color-changed",
389
395
                    G_CALLBACK (gimp_color_button_get_color),
390
396
                    &p.params.background_color);
391
397
 
524
530
 
525
531
  overlap = p.drawable_has_alpha ? overlap_RGBA : overlap_RGB;
526
532
 
527
 
  gimp_progress_init (_("Paper Tile..."));
 
533
  gimp_progress_init (_("Paper Tile"));
528
534
 
529
535
  gimp_drawable_mask_bounds (p.drawable->drawable_id,
530
536
                             &p.selection.x0, &p.selection.y0,
789
795
static void
790
796
plugin_query (void)
791
797
{
792
 
  static GimpParamDef     args[]            =
 
798
  static const GimpParamDef args[] =
793
799
  {
794
 
    { GIMP_PDB_INT32,    "run_mode",         "run mode"                         },
795
 
    { GIMP_PDB_IMAGE,    "image",            "input image"                      },
796
 
    { GIMP_PDB_DRAWABLE, "drawable",         "input drawable"                   },
797
 
    { GIMP_PDB_INT32,    "tile_size",        "tile size (pixels)"               },
798
 
    { GIMP_PDB_FLOAT,    "move_max",         "max move rate (%)"                },
799
 
    { GIMP_PDB_INT32,    "fractional_type",  "0:Background 1:Ignore 2:Force"    },
800
 
    { GIMP_PDB_INT32,    "wrap_around",      "wrap around (bool)"               },
801
 
    { GIMP_PDB_INT32,    "centering",        "centering (bool)"                 },
802
 
    { GIMP_PDB_INT32,    "background_type",
803
 
      "0:Transparent 1:Inverted 2:Image? 3:FG 4:BG 5:Color"                  },
804
 
    { GIMP_PDB_INT32,    "background_color", "background color (for bg-type 5)" },
805
 
    { GIMP_PDB_INT32,    "background_alpha", "opacity (for bg-type 5)"          }
 
800
    { GIMP_PDB_INT32,    "run-mode",         "run mode"                       },
 
801
    { GIMP_PDB_IMAGE,    "image",            "input image"                    },
 
802
    { GIMP_PDB_DRAWABLE, "drawable",         "input drawable"                 },
 
803
    { GIMP_PDB_INT32,    "tile-size",        "tile size (pixels)"             },
 
804
    { GIMP_PDB_FLOAT,    "move-max",         "max move rate (%)"              },
 
805
    { GIMP_PDB_INT32,    "fractional-type",  "0:Background 1:Ignore 2:Force"  },
 
806
    { GIMP_PDB_INT32,    "wrap-around",      "wrap around (bool)"             },
 
807
    { GIMP_PDB_INT32,    "centering",        "centering (bool)"               },
 
808
    { GIMP_PDB_INT32,    "background-type",  "0:Transparent 1:Inverted 2:Image? 3:FG 4:BG 5:Color"                  },
 
809
    { GIMP_PDB_INT32,    "background-color", "background color (for bg-type 5)" },
 
810
    { GIMP_PDB_INT32,    "background-alpha", "opacity (for bg-type 5)"        }
806
811
  };
807
812
 
808
 
  gimp_install_procedure (PLUGIN_PROCEDURE_NAME,
809
 
                          "Cuts an image into paper tiles, and slides each "
810
 
                          "paper tile.",
 
813
  gimp_install_procedure (PLUG_IN_PROC,
 
814
                          N_("Cut image into paper tiles, and slide them"),
811
815
                          "This plug-in cuts an image into paper tiles and "
812
816
                          "slides each paper tile.",
813
817
                          "Hirotsuna Mizuno <s1041150@u-aizu.ac.jp>",
819
823
                          G_N_ELEMENTS (args), 0,
820
824
                          args, NULL);
821
825
 
822
 
  gimp_plugin_menu_register (PLUGIN_PROCEDURE_NAME, "<Image>/Filters/Map");
 
826
  gimp_plugin_menu_register (PLUG_IN_PROC, "<Image>/Filters/Map");
823
827
}
824
828
 
825
829
static void
905
909
  }
906
910
}
907
911
 
908
 
GimpPlugInInfo PLUG_IN_INFO =
 
912
const GimpPlugInInfo PLUG_IN_INFO =
909
913
{
910
914
  NULL,
911
915
  NULL,