25
25
#include <stdlib.h>
29
27
#include <libgimp/gimp.h>
30
28
#include <libgimp/gimpui.h>
32
30
#include "libgimp/stdplugins-intl.h"
34
33
/*===========================================================================*/
36
35
/*===========================================================================*/
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"
41
40
/*===========================================================================*/
127
126
params_save_to_gimp (void)
129
gimp_set_data (PLUGIN_PROCEDURE_NAME, &p.params, sizeof p.params);
128
gimp_set_data (PLUG_IN_PROC, &p.params, sizeof p.params);
133
132
params_load_from_gimp (void)
135
gimp_get_data (PLUGIN_PROCEDURE_NAME, &p.params);
134
gimp_get_data (PLUG_IN_PROC, &p.params);
137
136
if (0 < p.params.division_x)
230
229
GtkWidget *frame;
231
230
GtkWidget *color_button;
233
gimp_ui_init ("papertile", TRUE);
232
gimp_ui_init (PLUG_IN_BINARY, TRUE);
235
dialog = gimp_dialog_new (_("Paper Tile"), "papertile",
234
dialog = gimp_dialog_new (_("Paper Tile"), PLUG_IN_BINARY,
237
gimp_standard_help_func, HELP_ID,
236
gimp_standard_help_func, PLUG_IN_PROC,
239
238
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
240
239
GTK_STOCK_OK, GTK_RESPONSE_OK,
243
gtk_dialog_set_alternative_button_order (GTK_DIALOG (dialog),
248
gimp_window_set_transient (GTK_WINDOW (dialog));
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);
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);
790
796
plugin_query (void)
792
static GimpParamDef args[] =
798
static const GimpParamDef args[] =
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)" }
808
gimp_install_procedure (PLUGIN_PROCEDURE_NAME,
809
"Cuts an image into paper tiles, and slides each "
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>",