Commit 608837cc authored by Maurits Rijk's avatar Maurits Rijk

Enable mnemonics (#80804) and some work to get imagemap plug-in up-to-date.

parent 9f632962
2002-06-01 Maurits Rijk <lpeek.mrijk@consunet.nl>
* plug-ins/imagemap/imap_preferences.[ch]
* plug-ins/imagemap/imap_table.c: enable mnemonics
* plug-ins/imagemap/imap_grid.[ch]: Add mnemonics to dialog and added
option to couple Width/Height and Left/Top offset in grid with
GimpChainButton.
* plug-ins/imagemap/imap_tools.c (make_tools)
* plug-ins/imagemap/imap_selection.c (make_selection_toolbar)
* plug-ins/imagemap/imap_toolbar.c (make_toolbar): set style to only
show icons (GTK_TOOLBAR_ICONS).
* plug-ins/imagemap/imap_object.[ch] (object_on_button_press): event
function now returns boolean value.
* plug-ins/imagemap/imap_main.c (dialog): removed some obsolete code
that caused strange startup size of plug-in.
2002-06-01 Maurits Rijk <lpeek.mrijk@consunet.nl>
* plug-ins/common/convmatrix.c: enable mnemonics and removed some
global variables.
* plug-ins/mosaic/mosaic.c (mosaic_dialog):
* plug-ins/common/nova.c (nova_center_create)
* plug-ins/common/nlfilt.c (mw_preview_new)
* plug-ins/common/noisify.c (noisify_dialog)
* plug-ins/common/borderaverage.c (borderaverage_dialog): enable
mnemonics
2002-05-31 Maurits Rijk <lpeek.mrijk@consunet.nl>
* plug-ins/common/borderaverage.c (borderaverage_dialog)
* plug-ins/common/blur.c (blur_dialog): enable mnemonics
2002-05-31 Jakub Steiner <jimmac@ximian.com> 2002-05-31 Jakub Steiner <jimmac@ximian.com>
* themes/Default/images/tools/stock-tool-blend-22.png: make it * themes/Default/images/tools/stock-tool-blend-22.png: make it
......
...@@ -598,6 +598,7 @@ blur_dialog (void) ...@@ -598,6 +598,7 @@ blur_dialog (void)
GtkWidget *dlg; GtkWidget *dlg;
GtkWidget *frame; GtkWidget *frame;
GtkWidget *table; GtkWidget *table;
GtkWidget *label;
GtkWidget *seed_hbox; GtkWidget *seed_hbox;
GtkObject *adj; GtkObject *adj;
...@@ -643,15 +644,17 @@ blur_dialog (void) ...@@ -643,15 +644,17 @@ blur_dialog (void)
seed_hbox = gimp_random_seed_new (&pivals.blur_seed, seed_hbox = gimp_random_seed_new (&pivals.blur_seed,
&pivals.seed_type, &pivals.seed_type,
SEED_TIME, SEED_USER); SEED_TIME, SEED_USER);
gimp_table_attach_aligned (GTK_TABLE (table), 0, 0, label = gimp_table_attach_aligned (GTK_TABLE (table), 0, 0,
_("Random Seed:"), 1.0, 0.5, _("_Random Seed:"), 1.0, 0.5,
seed_hbox, 1, TRUE); seed_hbox, 1, TRUE);
gtk_label_set_mnemonic_widget (GTK_LABEL (label),
GIMP_RANDOM_SEED_SPINBUTTON (seed_hbox));
/* /*
* Randomization percentage label & scale (1 to 100) * Randomization percentage label & scale (1 to 100)
*/ */
adj = gimp_scale_entry_new (GTK_TABLE (table), 0, 1, adj = gimp_scale_entry_new (GTK_TABLE (table), 0, 1,
_("Randomization %:"), SCALE_WIDTH, 0, _("R_andomization %:"), SCALE_WIDTH, 0,
pivals.blur_pct, 1.0, 100.0, 1.0, 10.0, 0, pivals.blur_pct, 1.0, 100.0, 1.0, 10.0, 0,
TRUE, 0, 0, TRUE, 0, 0,
_("Percentage of pixels to be filtered"), NULL); _("Percentage of pixels to be filtered"), NULL);
...@@ -663,7 +666,7 @@ blur_dialog (void) ...@@ -663,7 +666,7 @@ blur_dialog (void)
* Repeat count label & scale (1 to 100) * Repeat count label & scale (1 to 100)
*/ */
adj = gimp_scale_entry_new (GTK_TABLE (table), 0, 2, adj = gimp_scale_entry_new (GTK_TABLE (table), 0, 2,
_("Repeat:"), SCALE_WIDTH, 0, _("R_epeat:"), SCALE_WIDTH, 0,
pivals.blur_rcount, 1.0, 100.0, 1.0, 10.0, 0, pivals.blur_rcount, 1.0, 100.0, 1.0, 10.0, 0,
TRUE, 0, 0, TRUE, 0, 0,
_("Number of times to apply filter"), NULL); _("Number of times to apply filter"), NULL);
......
...@@ -399,7 +399,7 @@ borderaverage_dialog (void) ...@@ -399,7 +399,7 @@ borderaverage_dialog (void)
gtk_container_add (GTK_CONTAINER (frame), hbox); gtk_container_add (GTK_CONTAINER (frame), hbox);
gtk_widget_show (hbox); gtk_widget_show (hbox);
label = gtk_label_new (_("Thickness:")); label = gtk_label_new_with_mnemonic (_("_Thickness:"));
gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0); gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0);
gtk_widget_show (label); gtk_widget_show (label);
...@@ -407,6 +407,7 @@ borderaverage_dialog (void) ...@@ -407,6 +407,7 @@ borderaverage_dialog (void)
0, 256, 1, 5, 0, 0, 0); 0, 256, 1, 5, 0, 0, 0);
gtk_box_pack_start (GTK_BOX (hbox), spinbutton, FALSE, FALSE, 0); gtk_box_pack_start (GTK_BOX (hbox), spinbutton, FALSE, FALSE, 0);
gtk_widget_show (spinbutton); gtk_widget_show (spinbutton);
gtk_label_set_mnemonic_widget (GTK_LABEL (label), spinbutton);
g_signal_connect (G_OBJECT (adj), "value_changed", g_signal_connect (G_OBJECT (adj), "value_changed",
G_CALLBACK (gimp_int_adjustment_update), G_CALLBACK (gimp_int_adjustment_update),
...@@ -421,7 +422,7 @@ borderaverage_dialog (void) ...@@ -421,7 +422,7 @@ borderaverage_dialog (void)
gtk_container_add (GTK_CONTAINER (frame), hbox); gtk_container_add (GTK_CONTAINER (frame), hbox);
gtk_widget_show (hbox); gtk_widget_show (hbox);
label = gtk_label_new (_("Bucket Size:")); label = gtk_label_new_with_mnemonic (_("_Bucket Size:"));
gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0); gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0);
gtk_widget_show (label); gtk_widget_show (label);
...@@ -442,6 +443,7 @@ borderaverage_dialog (void) ...@@ -442,6 +443,7 @@ borderaverage_dialog (void)
NULL); NULL);
gtk_box_pack_start (GTK_BOX (hbox), menu, FALSE, FALSE, 0); gtk_box_pack_start (GTK_BOX (hbox), menu, FALSE, FALSE, 0);
gtk_widget_show (menu); gtk_widget_show (menu);
gtk_label_set_mnemonic_widget (GTK_LABEL (label), menu);
gtk_widget_show (dlg); gtk_widget_show (dlg);
......
...@@ -78,22 +78,22 @@ typedef enum ...@@ -78,22 +78,22 @@ typedef enum
MIRROR MIRROR
} BorderMode; } BorderMode;
GimpDrawable *drawable; static GimpDrawable *drawable;
gchar * const channel_labels[] = static gchar * const channel_labels[] =
{ {
N_("Grey"), N_("Gr_ey"),
N_("Red"), N_("Re_d"),
N_("Green"), N_("_Green"),
N_("Blue"), N_("_Blue"),
N_("Alpha") N_("_Alpha")
}; };
gchar * const bmode_labels[] = static gchar * const bmode_labels[] =
{ {
N_("Extend"), N_("E_xtend"),
N_("Wrap"), N_("_Wrap"),
N_("Crop") N_("Cro_p")
}; };
/* Declare local functions. */ /* Declare local functions. */
...@@ -117,9 +117,8 @@ GimpPlugInInfo PLUG_IN_INFO = ...@@ -117,9 +117,8 @@ GimpPlugInInfo PLUG_IN_INFO =
run, /* run_proc */ run, /* run_proc */
}; };
gint bytes; static gint bytes;
gint sx1, sy1, sx2, sy2; static gint run_flag = 0;
gint run_flag = 0;
typedef struct typedef struct
{ {
...@@ -132,7 +131,7 @@ typedef struct ...@@ -132,7 +131,7 @@ typedef struct
gint autoset; gint autoset;
} config; } config;
const config default_config = static const config default_config =
{ {
{ {
{ 0.0, 0.0, 0.0, 0.0, 0.0 }, { 0.0, 0.0, 0.0, 0.0, 0.0 },
...@@ -149,7 +148,7 @@ const config default_config = ...@@ -149,7 +148,7 @@ const config default_config =
0 /* autoset */ 0 /* autoset */
}; };
config my_config; static config my_config;
struct struct
{ {
...@@ -503,6 +502,7 @@ doit (void) ...@@ -503,6 +502,7 @@ doit (void)
GimpPixelRgn srcPR, destPR; GimpPixelRgn srcPR, destPR;
gint width, height, row, col; gint width, height, row, col;
gint w, h, i; gint w, h, i;
gint sx1, sy1, sx2, sy2;
gint x1, x2, y1, y2; gint x1, x2, y1, y2;
guchar *destrow[3]; guchar *destrow[3];
guchar *srcrow[5]; guchar *srcrow[5];
...@@ -918,7 +918,7 @@ dialog (void) ...@@ -918,7 +918,7 @@ dialog (void)
gtk_table_set_col_spacings (GTK_TABLE (table), 4); gtk_table_set_col_spacings (GTK_TABLE (table), 4);
gtk_box_pack_start (GTK_BOX (box), table, TRUE, FALSE, 0); gtk_box_pack_start (GTK_BOX (box), table, TRUE, FALSE, 0);
label = gtk_label_new (_("Divisor:")); label = gtk_label_new_with_mnemonic (_("D_ivisor:"));
gtk_misc_set_alignment (GTK_MISC (label), 1.0, 0.5); gtk_misc_set_alignment (GTK_MISC (label), 1.0, 0.5);
gtk_table_attach_defaults (GTK_TABLE (table), label, 0, 1, 0, 1); gtk_table_attach_defaults (GTK_TABLE (table), label, 0, 1, 0, 1);
gtk_widget_show (label); gtk_widget_show (label);
...@@ -927,6 +927,7 @@ dialog (void) ...@@ -927,6 +927,7 @@ dialog (void)
gtk_widget_set_size_request (entry, 40, -1); gtk_widget_set_size_request (entry, 40, -1);
gtk_table_attach_defaults (GTK_TABLE (table), entry, 1, 2, 0, 1); gtk_table_attach_defaults (GTK_TABLE (table), entry, 1, 2, 0, 1);
gtk_widget_show (entry); gtk_widget_show (entry);
gtk_label_set_mnemonic_widget (GTK_LABEL (label), entry);
g_signal_connect (G_OBJECT (entry), "changed", g_signal_connect (G_OBJECT (entry), "changed",
G_CALLBACK (entry_callback), G_CALLBACK (entry_callback),
...@@ -938,7 +939,7 @@ dialog (void) ...@@ -938,7 +939,7 @@ dialog (void)
gtk_table_set_col_spacings (GTK_TABLE (table), 4); gtk_table_set_col_spacings (GTK_TABLE (table), 4);
gtk_box_pack_start (GTK_BOX (box), table, TRUE, FALSE, 0); gtk_box_pack_start (GTK_BOX (box), table, TRUE, FALSE, 0);
label = gtk_label_new (_("Offset:")); label = gtk_label_new_with_mnemonic (_("O_ffset:"));
gtk_misc_set_alignment (GTK_MISC (label), 1.0, 0.5); gtk_misc_set_alignment (GTK_MISC (label), 1.0, 0.5);
gtk_table_attach_defaults (GTK_TABLE (table), label, 0, 1, 0, 1); gtk_table_attach_defaults (GTK_TABLE (table), label, 0, 1, 0, 1);
gtk_widget_show (label); gtk_widget_show (label);
...@@ -947,6 +948,7 @@ dialog (void) ...@@ -947,6 +948,7 @@ dialog (void)
gtk_widget_set_size_request (entry, 40, -1); gtk_widget_set_size_request (entry, 40, -1);
gtk_table_attach_defaults (GTK_TABLE (table), entry, 1, 2, 0, 1); gtk_table_attach_defaults (GTK_TABLE (table), entry, 1, 2, 0, 1);
gtk_widget_show (entry); gtk_widget_show (entry);
gtk_label_set_mnemonic_widget (GTK_LABEL (label), entry);
g_signal_connect (G_OBJECT (entry), "changed", g_signal_connect (G_OBJECT (entry), "changed",
G_CALLBACK (entry_callback), G_CALLBACK (entry_callback),
...@@ -963,7 +965,7 @@ dialog (void) ...@@ -963,7 +965,7 @@ dialog (void)
gtk_box_pack_start (GTK_BOX (yetanotherbox), box, FALSE, FALSE, 0); gtk_box_pack_start (GTK_BOX (yetanotherbox), box, FALSE, FALSE, 0);
my_widgets.autoset = button = my_widgets.autoset = button =
gtk_check_button_new_with_label (_("Automatic")); gtk_check_button_new_with_mnemonic (_("A_utomatic"));
gtk_box_pack_start (GTK_BOX (box), button, TRUE, FALSE, 0); gtk_box_pack_start (GTK_BOX (box), button, TRUE, FALSE, 0);
gtk_widget_show (button); gtk_widget_show (button);
...@@ -972,7 +974,7 @@ dialog (void) ...@@ -972,7 +974,7 @@ dialog (void)
&my_config.autoset); &my_config.autoset);
my_widgets.alpha_alg = button = my_widgets.alpha_alg = button =
gtk_check_button_new_with_label (_("Alpha-weighting")); gtk_check_button_new_with_mnemonic (_("A_lpha-weighting"));
if (my_config.alpha_alg == -1) if (my_config.alpha_alg == -1)
gtk_widget_set_sensitive (button, FALSE); gtk_widget_set_sensitive (button, FALSE);
gtk_box_pack_start (GTK_BOX (box), button, TRUE, FALSE, 0); gtk_box_pack_start (GTK_BOX (box), button, TRUE, FALSE, 0);
...@@ -1001,7 +1003,7 @@ dialog (void) ...@@ -1001,7 +1003,7 @@ dialog (void)
for (i = 0; i < 3; i++) for (i = 0; i < 3; i++)
{ {
my_widgets.bmode[i] = button = my_widgets.bmode[i] = button =
gtk_radio_button_new_with_label (group, gettext (bmode_labels[i])); gtk_radio_button_new_with_mnemonic (group, gettext (bmode_labels[i]));
group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (button)); group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (button));
gtk_box_pack_start (GTK_BOX (box), button, FALSE, FALSE, 0); gtk_box_pack_start (GTK_BOX (box), button, FALSE, FALSE, 0);
gtk_widget_show (button); gtk_widget_show (button);
...@@ -1025,7 +1027,7 @@ dialog (void) ...@@ -1025,7 +1027,7 @@ dialog (void)
for (i = 0; i < 5; i++) for (i = 0; i < 5; i++)
{ {
my_widgets.channels[i] = button = my_widgets.channels[i] = button =
gtk_check_button_new_with_label (gettext (channel_labels[i])); gtk_check_button_new_with_mnemonic (gettext (channel_labels[i]));
if (my_config.channels[i] < 0) if (my_config.channels[i] < 0)
gtk_widget_set_sensitive (button, FALSE); gtk_widget_set_sensitive (button, FALSE);
......
...@@ -607,7 +607,7 @@ mosaic_dialog (void) ...@@ -607,7 +607,7 @@ mosaic_dialog (void)
gtk_container_set_border_width (GTK_CONTAINER (toggle_vbox), 2); gtk_container_set_border_width (GTK_CONTAINER (toggle_vbox), 2);
gtk_container_add (GTK_CONTAINER (frame), toggle_vbox); gtk_container_add (GTK_CONTAINER (frame), toggle_vbox);
toggle = gtk_check_button_new_with_label (_("Antialiasing")); toggle = gtk_check_button_new_with_mnemonic (_("_Antialiasing"));
gtk_box_pack_start (GTK_BOX (toggle_vbox), toggle, FALSE, FALSE, 0); gtk_box_pack_start (GTK_BOX (toggle_vbox), toggle, FALSE, FALSE, 0);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (toggle), mvals.antialiasing); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (toggle), mvals.antialiasing);
gtk_widget_show (toggle); gtk_widget_show (toggle);
...@@ -616,7 +616,7 @@ mosaic_dialog (void) ...@@ -616,7 +616,7 @@ mosaic_dialog (void)
G_CALLBACK (gimp_toggle_button_update), G_CALLBACK (gimp_toggle_button_update),
&mvals.antialiasing); &mvals.antialiasing);
toggle = gtk_check_button_new_with_label ( _("Color Averaging")); toggle = gtk_check_button_new_with_mnemonic ( _("Co_lor Averaging"));
gtk_box_pack_start (GTK_BOX (toggle_vbox), toggle, FALSE, FALSE, 0); gtk_box_pack_start (GTK_BOX (toggle_vbox), toggle, FALSE, FALSE, 0);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (toggle), gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (toggle),
mvals.color_averaging); mvals.color_averaging);
...@@ -626,7 +626,7 @@ mosaic_dialog (void) ...@@ -626,7 +626,7 @@ mosaic_dialog (void)
G_CALLBACK (gimp_toggle_button_update), G_CALLBACK (gimp_toggle_button_update),
&mvals.color_averaging); &mvals.color_averaging);
toggle = gtk_check_button_new_with_label ( _("Allow Tile splitting")); toggle = gtk_check_button_new_with_mnemonic ( _("Allo_w Tile splitting"));
gtk_box_pack_start (GTK_BOX (toggle_vbox), toggle, FALSE, FALSE, 0); gtk_box_pack_start (GTK_BOX (toggle_vbox), toggle, FALSE, FALSE, 0);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (toggle), gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (toggle),
mvals.tile_allow_split); mvals.tile_allow_split);
...@@ -636,7 +636,7 @@ mosaic_dialog (void) ...@@ -636,7 +636,7 @@ mosaic_dialog (void)
G_CALLBACK (gimp_toggle_button_update), G_CALLBACK (gimp_toggle_button_update),
&mvals.tile_allow_split); &mvals.tile_allow_split);
toggle = gtk_check_button_new_with_label ( _("Pitted Surfaces")); toggle = gtk_check_button_new_with_mnemonic ( _("_Pitted Surfaces"));
gtk_box_pack_start (GTK_BOX (toggle_vbox), toggle, FALSE, FALSE, 0); gtk_box_pack_start (GTK_BOX (toggle_vbox), toggle, FALSE, FALSE, 0);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (toggle), gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (toggle),
(mvals.tile_surface == ROUGH)); (mvals.tile_surface == ROUGH));
...@@ -646,7 +646,7 @@ mosaic_dialog (void) ...@@ -646,7 +646,7 @@ mosaic_dialog (void)
G_CALLBACK (gimp_toggle_button_update), G_CALLBACK (gimp_toggle_button_update),
&mvals.tile_surface); &mvals.tile_surface);
toggle = gtk_check_button_new_with_label ( _("FG/BG Lighting")); toggle = gtk_check_button_new_with_mnemonic ( _("_FG/BG Lighting"));
gtk_box_pack_start (GTK_BOX (toggle_vbox), toggle, FALSE, FALSE, 0); gtk_box_pack_start (GTK_BOX (toggle_vbox), toggle, FALSE, FALSE, 0);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (toggle), gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (toggle),
(mvals.grout_color == FG_BG)); (mvals.grout_color == FG_BG));
...@@ -665,11 +665,11 @@ mosaic_dialog (void) ...@@ -665,11 +665,11 @@ mosaic_dialog (void)
G_CALLBACK (gimp_radio_button_update), G_CALLBACK (gimp_radio_button_update),
&mvals.tile_type, (gpointer) mvals.tile_type, &mvals.tile_type, (gpointer) mvals.tile_type,
_("Squares"), _("_Squares"),
(gpointer) SQUARES, NULL, (gpointer) SQUARES, NULL,
_("Hexagons"), _("He_xagons"),
(gpointer) HEXAGONS, NULL, (gpointer) HEXAGONS, NULL,
_("Octagons & Squares"), _("Oc_tagons & Squares"),
(gpointer) OCTAGONS, NULL, (gpointer) OCTAGONS, NULL,
NULL); NULL);
...@@ -690,7 +690,7 @@ mosaic_dialog (void) ...@@ -690,7 +690,7 @@ mosaic_dialog (void)
gtk_container_add (GTK_CONTAINER (frame), table); gtk_container_add (GTK_CONTAINER (frame), table);
scale_data = gimp_scale_entry_new (GTK_TABLE (table), 0, 0, scale_data = gimp_scale_entry_new (GTK_TABLE (table), 0, 0,
_("Tile Size:"), SCALE_WIDTH, 0, _("T_ile Size:"), SCALE_WIDTH, 0,
mvals.tile_size, 5.0, 100.0, 1.0, 10.0, 1, mvals.tile_size, 5.0, 100.0, 1.0, 10.0, 1,
TRUE, 0, 0, TRUE, 0, 0,
NULL, NULL); NULL, NULL);
...@@ -699,7 +699,7 @@ mosaic_dialog (void) ...@@ -699,7 +699,7 @@ mosaic_dialog (void)
&mvals.tile_size); &mvals.tile_size);
scale_data = gimp_scale_entry_new (GTK_TABLE (table), 0, 1, scale_data = gimp_scale_entry_new (GTK_TABLE (table), 0, 1,
_("Tile Height:"), SCALE_WIDTH, 0, _("Tile _Height:"), SCALE_WIDTH, 0,
mvals.tile_height, 1.0, 50.0, 1.0, 10.0, 1, mvals.tile_height, 1.0, 50.0, 1.0, 10.0, 1,
TRUE, 0, 0, TRUE, 0, 0,
NULL, NULL); NULL, NULL);
...@@ -708,7 +708,7 @@ mosaic_dialog (void) ...@@ -708,7 +708,7 @@ mosaic_dialog (void)
&mvals.tile_height); &mvals.tile_height);
scale_data = gimp_scale_entry_new (GTK_TABLE (table), 0, 2, scale_data = gimp_scale_entry_new (GTK_TABLE (table), 0, 2,
_("Tile Spacing:"), SCALE_WIDTH, 0, _("Til_e Spacing:"), SCALE_WIDTH, 0,
mvals.tile_spacing, 1.0, 50.0, 1.0, 10.0, 1, mvals.tile_spacing, 1.0, 50.0, 1.0, 10.0, 1,
TRUE, 0, 0, TRUE, 0, 0,
NULL, NULL); NULL, NULL);
...@@ -717,7 +717,7 @@ mosaic_dialog (void) ...@@ -717,7 +717,7 @@ mosaic_dialog (void)
&mvals.tile_spacing); &mvals.tile_spacing);
scale_data = gimp_scale_entry_new (GTK_TABLE (table), 0, 3, scale_data = gimp_scale_entry_new (GTK_TABLE (table), 0, 3,
_("Tile Neatness:"), SCALE_WIDTH, 0, _("Tile _Neatness:"), SCALE_WIDTH, 0,
mvals.tile_neatness, mvals.tile_neatness,
0.0, 1.0, 0.10, 0.1, 2, 0.0, 1.0, 0.10, 0.1, 2,
TRUE, 0, 0, TRUE, 0, 0,
...@@ -727,7 +727,7 @@ mosaic_dialog (void) ...@@ -727,7 +727,7 @@ mosaic_dialog (void)
&mvals.tile_neatness); &mvals.tile_neatness);
scale_data = gimp_scale_entry_new (GTK_TABLE (table), 0, 4, scale_data = gimp_scale_entry_new (GTK_TABLE (table), 0, 4,
_("Light Direction:"), SCALE_WIDTH, 0, _("Light _Direction:"), SCALE_WIDTH, 0,
mvals.light_dir, 0.0, 360.0, 1.0, 15.0, 1, mvals.light_dir, 0.0, 360.0, 1.0, 15.0, 1,
TRUE, 0, 0, TRUE, 0, 0,
NULL, NULL); NULL, NULL);
...@@ -736,7 +736,7 @@ mosaic_dialog (void) ...@@ -736,7 +736,7 @@ mosaic_dialog (void)
&mvals.light_dir); &mvals.light_dir);
scale_data = gimp_scale_entry_new (GTK_TABLE (table), 0, 5, scale_data = gimp_scale_entry_new (GTK_TABLE (table), 0, 5,
_("Color Variation:"), SCALE_WIDTH, 0, _("Color _Variation:"), SCALE_WIDTH, 0,
mvals.color_variation, mvals.color_variation,
0.0, 1.0, 0.01, 0.1, 2, 0.0, 1.0, 0.01, 0.1, 2,
TRUE, 0, 0, TRUE, 0, 0,
......
...@@ -576,7 +576,7 @@ mw_preview_new (GtkWidget *parent, ...@@ -576,7 +576,7 @@ mw_preview_new (GtkWidget *parent,
gtk_container_add (GTK_CONTAINER (pframe), preview); gtk_container_add (GTK_CONTAINER (pframe), preview);
gtk_widget_show (preview); gtk_widget_show (preview);
button = gtk_check_button_new_with_label (_("_Do Preview")); button = gtk_check_button_new_with_mnemonic (_("_Do Preview"));
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), do_preview); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), do_preview);
gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0); gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0);
gtk_widget_show (button); gtk_widget_show (button);
......
...@@ -405,11 +405,8 @@ noisify (GimpDrawable *drawable, ...@@ -405,11 +405,8 @@ noisify (GimpDrawable *drawable,
gtk_widget_queue_draw (preview); gtk_widget_queue_draw (preview);
if(even) g_free(even);
g_free(even); g_free(odd);
if(odd)
g_free(odd);
} }
else else
...@@ -538,7 +535,7 @@ noisify_dialog (GimpDrawable *drawable, ...@@ -538,7 +535,7 @@ noisify_dialog (GimpDrawable *drawable,
gtk_container_set_border_width (GTK_CONTAINER (table), 4); gtk_container_set_border_width (GTK_CONTAINER (table), 4);
gtk_container_add (GTK_CONTAINER (frame), table); gtk_container_add (GTK_CONTAINER (frame), table);
toggle = gtk_check_button_new_with_label (_("_Independent")); toggle = gtk_check_button_new_with_mnemonic (_("_Independent"));
gtk_table_attach (GTK_TABLE (table), toggle, 0, 3, 0, 1, GTK_FILL, 0, 0, 0); gtk_table_attach (GTK_TABLE (table), toggle, 0, 3, 0, 1, GTK_FILL, 0, 0, 0);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (toggle), nvals.independent); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (toggle), nvals.independent);
gtk_widget_show (toggle); gtk_widget_show (toggle);
......
...@@ -702,7 +702,7 @@ nova_center_create (GimpDrawable *drawable) ...@@ -702,7 +702,7 @@ nova_center_create (GimpDrawable *drawable)
gtk_widget_show (frame); gtk_widget_show (frame);
check = gtk_check_button_new_with_label (_("S_how Cursor")); check = gtk_check_button_new_with_mnemonic (_("S_how Cursor"));
gtk_table_attach (GTK_TABLE (table), check, 0, 4, 2, 3, gtk_table_attach (GTK_TABLE (table), check, 0, 4, 2, 3,
GTK_EXPAND | GTK_FILL, GTK_FILL, 0, 0); GTK_EXPAND | GTK_FILL, GTK_FILL, 0, 0);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (check), show_cursor); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (check), show_cursor);
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
* *
* Generates clickable image maps. * Generates clickable image maps.
* *
* Copyright (C) 1998-1999 Maurits Rijk lpeek.mrijk@consunet.nl * Copyright (C) 1998-2002 Maurits Rijk lpeek.mrijk@consunet.nl
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
...@@ -25,7 +25,8 @@ ...@@ -25,7 +25,8 @@
#include <gtk/gtk.h> #include <gtk/gtk.h>
#include "libgimp/gimp.h" #include <libgimp/gimp.h>
#include <libgimp/gimpui.h>
#include "imap_grid.h" #include "imap_grid.h"
#include "imap_main.h" #include "imap_main.h"
...@@ -39,6 +40,27 @@ ...@@ -39,6 +40,27 @@
typedef enum {GRID_HIDDEN, GRID_LINES, GRID_CROSSES} GridType_t; typedef enum {GRID_HIDDEN, GRID_LINES, GRID_CROSSES} GridType_t;
typedef struct {
DefaultDialog_t *dialog;
GtkWidget *type_frame;
GtkWidget *granularity_frame;
GtkWidget *offset_frame;
GtkWidget *snap;
GtkWidget *width;
GtkWidget *height;
GtkWidget *chain_width_height;
GtkWidget *left;
GtkWidget *top;
GtkWidget *chain_left_top;
GtkWidget *hidden;
GtkWidget *lines;
GtkWidget *crosses;
GtkWidget *preview;
gboolean enable_preview;
} GridDialog_t;
static GdkGC *grid_gc; static GdkGC *grid_gc;
static gboolean grid_snap = FALSE; static gboolean grid_snap = FALSE;
static gint grid_width = 15; static gint grid_width = 15;
...@@ -114,25 +136,53 @@ grid_assign_value(GtkWidget *widget, gpointer data, gint *value) ...@@ -114,25 +136,53 @@ grid_assign_value(GtkWidget *widget, gpointer data, gint *value)
static void static void
width_changed_cb(GtkWidget *widget, gpointer data) width_changed_cb(GtkWidget *widget, gpointer data)
{ {
GridDialog_t *dialog = (GridDialog_t*) data;
grid_assign_value(widget, data, &grid_width); grid_assign_value(widget, data, &grid_width);
if (gimp_chain_button_get_active(
GIMP_CHAIN_BUTTON(dialog->chain_width_height))) {
gint value = gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(widget));
gtk_spin_button_set_value(GTK_SPIN_BUTTON(dialog->height), value);
}
} }
static void static void
height_changed_cb(GtkWidget *widget, gpointer data) height_changed_cb(GtkWidget *widget, gpointer data)
{ {
GridDialog_t *dialog = (GridDialog_t*) data;
grid_assign_value(widget, data, &grid_height); grid_assign_value(widget, data, &grid_height);
if (gimp_chain_button_get_active(
GIMP_CHAIN_BUTTON(dialog->chain_width_height))) {
gint value = gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(widget));
gtk_spin_button_set_value(GTK_SPIN_BUTTON(dialog->width), value);
}