Commit 1ea45f10 authored by Sven Neumann's avatar Sven Neumann Committed by Sven Neumann

plug-ins/common/checkerboard.c plug-ins/common/colorify.c

2004-05-18  Sven Neumann  <sven@gimp.org>

	* plug-ins/common/checkerboard.c
	* plug-ins/common/colorify.c
	* plug-ins/common/colortoalpha.c
	* plug-ins/common/compose.c
	* plug-ins/common/convmatrix.c
	* plug-ins/common/csource.c
	* plug-ins/common/cubism.c
	* plug-ins/common/decompose.c
	* plug-ins/common/deinterlace.c
	* plug-ins/common/depthmerge.c
	* plug-ins/common/despeckle.c
	* plug-ins/common/destripe.c
	* plug-ins/common/diffraction.c
	* plug-ins/common/displace.c: HIG-ified.
parent 3fb934b2
2004-05-18 Sven Neumann <sven@gimp.org>
* plug-ins/common/checkerboard.c
* plug-ins/common/colorify.c
* plug-ins/common/colortoalpha.c
* plug-ins/common/compose.c
* plug-ins/common/convmatrix.c
* plug-ins/common/csource.c
* plug-ins/common/cubism.c
* plug-ins/common/decompose.c
* plug-ins/common/deinterlace.c
* plug-ins/common/depthmerge.c
* plug-ins/common/despeckle.c
* plug-ins/common/destripe.c
* plug-ins/common/diffraction.c
* plug-ins/common/displace.c: HIG-ified.
2004-05-18 Michael Natterer <mitch@gimp.org>
Allow plug-ins to register menu icons. Fixes bug #120500.
......
......@@ -51,7 +51,7 @@ static void do_checkerboard_pattern (GimpDrawable *drawable);
static gint inblock (gint pos,
gint size);
static gboolean do_checkerboard_dialog (gint32 image_ID,
static gboolean checkerboard_dialog (gint32 image_ID,
GimpDrawable *drawable);
static void check_size_update_callback (GtkWidget *widget,
gpointer data);
......@@ -130,7 +130,7 @@ run (const gchar *name,
{
case GIMP_RUN_INTERACTIVE:
gimp_get_data ("plug_in_checkerboard", &cvals);
if (! do_checkerboard_dialog(image_ID, drawable))
if (! checkerboard_dialog (image_ID, drawable))
{
gimp_drawable_detach (drawable);
return;
......@@ -292,11 +292,10 @@ inblock (gint pos,
}
static gboolean
do_checkerboard_dialog (gint32 image_ID,
GimpDrawable *drawable)
checkerboard_dialog (gint32 image_ID,
GimpDrawable *drawable)
{
GtkWidget *dlg;
GtkWidget *frame;
GtkWidget *vbox;
GtkWidget *toggle;
GtkWidget *size_entry;
......@@ -325,15 +324,9 @@ do_checkerboard_dialog (gint32 image_ID,
height = gimp_drawable_height (drawable->drawable_id);
size = MIN (width, height);
/* parameter settings */
frame = gtk_frame_new (_("Parameter Settings"));
gtk_container_set_border_width (GTK_CONTAINER (frame), 6);
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dlg)->vbox), frame, TRUE, TRUE, 0);
gtk_widget_show (frame);
vbox = gtk_vbox_new (FALSE, 4);
gtk_container_set_border_width (GTK_CONTAINER (vbox), 4);
gtk_container_add (GTK_CONTAINER (frame), vbox);
vbox = gtk_vbox_new (FALSE, 12);
gtk_container_set_border_width (GTK_CONTAINER (vbox), 12);
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dlg)->vbox), vbox, TRUE, TRUE, 0);
gtk_widget_show (vbox);
toggle = gtk_check_button_new_with_mnemonic (_("_Psychobilly"));
......
......@@ -241,7 +241,6 @@ colorify_dialog (GimpRGB *color)
GtkWidget *dialog;
GtkWidget *label;
GtkWidget *button;
GtkWidget *frame;
GtkWidget *table;
GtkWidget *color_area;
gint i;
......@@ -258,17 +257,12 @@ colorify_dialog (GimpRGB *color)
NULL);
frame = gtk_frame_new (_("Color"));
gtk_container_set_border_width (GTK_CONTAINER (frame), 6);
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox),
frame, TRUE, TRUE, 0);
gtk_widget_show (frame);
table = gtk_table_new (2, 7, TRUE);
gtk_container_set_border_width (GTK_CONTAINER (table), 4);
gtk_container_add (GTK_CONTAINER (frame), table);
gtk_table_set_row_spacings (GTK_TABLE (table), 4);
gtk_table_set_col_spacings (GTK_TABLE (table), 4);
gtk_container_set_border_width (GTK_CONTAINER (table), 12);
gtk_table_set_row_spacings (GTK_TABLE (table), 6);
gtk_table_set_col_spacings (GTK_TABLE (table), 6);
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox),
table, TRUE, TRUE, 0);
gtk_widget_show (table);
label = gtk_label_new (_("Custom Color:"));
......
......@@ -310,8 +310,7 @@ static gboolean
colortoalpha_dialog (GimpDrawable *drawable)
{
GtkWidget *dlg;
GtkWidget *frame;
GtkWidget *table;
GtkWidget *hbox;
GtkWidget *button;
GtkWidget *label;
gboolean run;
......@@ -327,29 +326,19 @@ colortoalpha_dialog (GimpDrawable *drawable)
NULL);
frame = gtk_frame_new (_("Color"));
gtk_container_set_border_width (GTK_CONTAINER (frame), 6);
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dlg)->vbox),
frame, FALSE, FALSE, 0);
gtk_widget_show (frame);
table = gtk_table_new (1, 3, FALSE);
gtk_table_set_col_spacings (GTK_TABLE (table), 6);
gtk_container_set_border_width (GTK_CONTAINER (table), 4);
gtk_container_add (GTK_CONTAINER (frame), table);
gtk_widget_show (table);
hbox = gtk_hbox_new (FALSE, 6);
gtk_container_set_border_width (GTK_CONTAINER (hbox), 12);
gtk_widget_show (hbox);
label = gtk_label_new (_("From:"));
gtk_misc_set_alignment (GTK_MISC (label), 1.0, 0.5);
gtk_table_attach_defaults (GTK_TABLE(table), label, 0, 1, 0, 1);
gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0);
gtk_widget_show (label);
button = gimp_color_button_new (_("Color to Alpha Color Picker"),
PRV_WIDTH, PRV_HEIGHT,
&pvals.color,
GIMP_COLOR_AREA_FLAT);
gtk_table_attach (GTK_TABLE (table), button, 1, 2, 0, 1,
GTK_FILL, GTK_SHRINK, 0, 0) ;
gtk_box_pack_start (GTK_BOX (hbox), button, TRUE, TRUE, 0);
gtk_widget_show (button);
g_signal_connect (button, "color_changed",
......@@ -357,8 +346,7 @@ colortoalpha_dialog (GimpDrawable *drawable)
&pvals.color);
label = gtk_label_new (_("to Alpha"));
gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
gtk_table_attach_defaults (GTK_TABLE (table), label, 2, 3, 0, 1);
gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0);
gtk_widget_show (label);
gtk_widget_show (dlg);
......
......@@ -1098,17 +1098,16 @@ compose_dialog (const gchar *compose_type,
NULL);
/* parameter settings */
hbox = gtk_hbox_new (FALSE, 6);
gtk_container_set_border_width (GTK_CONTAINER (hbox), 6);
hbox = gtk_hbox_new (FALSE, 12);
gtk_container_set_border_width (GTK_CONTAINER (hbox), 12);
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dlg)->vbox), hbox, TRUE, TRUE, 0);
gtk_widget_show (hbox);
/* The left frame keeps the compose type toggles */
left_frame = gtk_frame_new (_("Compose Channels"));
left_frame = gimp_frame_new (_("Compose Channels"));
gtk_box_pack_start (GTK_BOX (hbox), left_frame, FALSE, FALSE, 0);
left_vbox = gtk_vbox_new (FALSE, 1);
gtk_container_set_border_width (GTK_CONTAINER (left_vbox), 2);
left_vbox = gtk_vbox_new (FALSE, 6);
gtk_container_add (GTK_CONTAINER (left_frame), left_vbox);
/* The right frame keeps the selection menues for images. */
......@@ -1116,16 +1115,15 @@ compose_dialog (const gchar *compose_type,
/* in the left frame is changed, fill in the right part first. */
/* Otherwise it can occur, that a non-existing label might be changed. */
right_frame = gtk_frame_new (_("Channel Representations"));
right_frame = gimp_frame_new (_("Channel Representations"));
gtk_box_pack_start (GTK_BOX (hbox), right_frame, TRUE, TRUE, 0);
right_vbox = gtk_vbox_new (FALSE, 0);
gtk_container_set_border_width (GTK_CONTAINER (right_vbox), 4);
right_vbox = gtk_vbox_new (FALSE, 6);
gtk_container_add (GTK_CONTAINER (right_frame), right_vbox);
table = gtk_table_new (MAX_COMPOSE_IMAGES, 3, FALSE);
gtk_table_set_row_spacings (GTK_TABLE (table), 2);
gtk_table_set_col_spacings (GTK_TABLE (table), 4);
gtk_table_set_row_spacings (GTK_TABLE (table), 6);
gtk_table_set_col_spacings (GTK_TABLE (table), 6);
gtk_box_pack_start (GTK_BOX (right_vbox), table, TRUE, TRUE, 0);
gtk_widget_show (table);
......@@ -1145,7 +1143,7 @@ compose_dialog (const gchar *compose_type,
gettext (compose_dsc[compose_idx].channel_name[j]) : NULL);
composeint.channel_label[j] = label = gtk_label_new (text);
gtk_misc_set_alignment (GTK_MISC (label), 1.0, 0.5);
gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
gtk_table_attach (GTK_TABLE (table), label, 1, 2, j, j+1,
GTK_FILL, GTK_FILL, 0, 0);
gtk_widget_show (label);
......
......@@ -106,10 +106,11 @@ static void run (const gchar *name,
gint *nreturn_vals,
GimpParam **return_vals);
static gint dialog (void);
static gboolean dialog (void);
static void doit (void);
static void check_config (void);
static void doit (void);
static void check_config (void);
GimpPlugInInfo PLUG_IN_INFO =
{
......@@ -309,7 +310,8 @@ run (const gchar *name,
gimp_displays_flush ();
if (run_mode == GIMP_RUN_INTERACTIVE)
gimp_set_data ("plug_in_convmatrix", &my_config, sizeof (my_config));
gimp_set_data ("plug_in_convmatrix",
&my_config, sizeof (my_config));
}
else
{
......@@ -623,13 +625,15 @@ doit (void)
static void
fprint (gfloat f,
gchar *buffer)
gchar *buffer,
gsize len)
{
gint i, t;
sprintf (buffer, "%.7f", f);
snprintf (buffer, len, "%.7f", f);
buffer[len - 1] = '\0';
for (t = 0; buffer[t] != '.'; t++);
for (t = 0; t < len - 1 && buffer[t] != '.'; t++);
i = t + 1;
......@@ -647,14 +651,13 @@ fprint (gfloat f,
static void
redraw_matrix (void)
{
gint x,y;
gint x, y;
gchar buffer[12];
for (y = 0; y < 5; y++)
for (x = 0; x < 5; x++)
{
fprint (my_config.matrix[x][y], buffer);
fprint (my_config.matrix[x][y], buffer, sizeof (buffer));
gtk_entry_set_text (GTK_ENTRY (my_widgets.matrix[x][y]), buffer);
}
}
......@@ -688,9 +691,10 @@ redraw_off_and_div (void)
{
gchar buffer[12];
fprint (my_config.divisor, buffer);
fprint (my_config.divisor, buffer, sizeof (buffer));
gtk_entry_set_text (GTK_ENTRY (my_widgets.divisor), buffer);
fprint (my_config.offset, buffer);
fprint (my_config.offset, buffer, sizeof (buffer));
gtk_entry_set_text (GTK_ENTRY (my_widgets.offset), buffer);
}
......@@ -852,7 +856,7 @@ my_bmode_callback (GtkWidget *widget,
my_config.bmode = GPOINTER_TO_INT (data) - 1;
}
static gint
static gboolean
dialog (void)
{
GtkWidget *dlg;
......@@ -863,9 +867,8 @@ dialog (void)
GtkWidget *button;
GtkWidget *box;
GtkWidget *inbox;
GtkWidget *yetanotherbox;
GtkWidget *vbox;
GtkWidget *frame;
gchar buffer[32];
gint x, y, i;
GSList *group;
......@@ -888,25 +891,24 @@ dialog (void)
G_CALLBACK (gtk_main_quit),
NULL);
main_hbox = gtk_hbox_new (FALSE, 4);
gtk_container_set_border_width (GTK_CONTAINER (main_hbox), 6);
main_hbox = gtk_hbox_new (FALSE, 12);
gtk_container_set_border_width (GTK_CONTAINER (main_hbox), 12);
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dlg)->vbox), main_hbox,
TRUE, TRUE, 0);
yetanotherbox = gtk_vbox_new (FALSE, 4);
gtk_box_pack_start (GTK_BOX (main_hbox), yetanotherbox, FALSE, FALSE, 0);
vbox = gtk_vbox_new (FALSE, 12);
gtk_box_pack_start (GTK_BOX (main_hbox), vbox, TRUE, TRUE, 0);
frame = gtk_frame_new (_("Matrix"));
gtk_box_pack_start (GTK_BOX (yetanotherbox), frame, FALSE, FALSE, 0);
frame = gimp_frame_new (_("Matrix"));
gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, 0);
inbox = gtk_vbox_new (FALSE, 6);
gtk_container_set_border_width (GTK_CONTAINER (inbox), 4);
inbox = gtk_vbox_new (FALSE, 12);
gtk_container_add (GTK_CONTAINER (frame), inbox);
table = gtk_table_new (5, 5, FALSE);
gtk_table_set_row_spacings (GTK_TABLE (table), 4);
gtk_table_set_col_spacings (GTK_TABLE (table), 4);
gtk_box_pack_start (GTK_BOX (inbox), table, FALSE, FALSE, 0);
gtk_box_pack_start (GTK_BOX (inbox), table, TRUE, TRUE, 0);
for (y = 0; y < 5; y++)
for (x = 0; x < 5; x++)
......@@ -915,7 +917,6 @@ dialog (void)
gtk_widget_set_size_request (entry, 40, -1);
gtk_table_attach (GTK_TABLE (table), entry, x, x+1, y, y+1,
GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0);
gtk_entry_set_text (GTK_ENTRY (entry), buffer);
gtk_widget_show (entry);
g_signal_connect (entry, "changed",
......@@ -929,11 +930,11 @@ dialog (void)
gtk_box_pack_start (GTK_BOX (inbox), box, FALSE, FALSE, 0);
table = gtk_table_new (1, 2, FALSE);
gtk_table_set_col_spacings (GTK_TABLE (table), 4);
gtk_table_set_col_spacings (GTK_TABLE (table), 6);
gtk_box_pack_start (GTK_BOX (box), table, TRUE, FALSE, 0);
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), 0.0, 0.5);
gtk_table_attach_defaults (GTK_TABLE (table), label, 0, 1, 0, 1);
gtk_widget_show (label);
......@@ -950,11 +951,11 @@ dialog (void)
gtk_widget_show (table);
table = gtk_table_new (1, 2, FALSE);
gtk_table_set_col_spacings (GTK_TABLE (table), 4);
gtk_table_set_col_spacings (GTK_TABLE (table), 6);
gtk_box_pack_start (GTK_BOX (box), table, TRUE, FALSE, 0);
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), 0.0, 0.5);
gtk_table_attach_defaults (GTK_TABLE (table), label, 0, 1, 0, 1);
gtk_widget_show (label);
......@@ -975,8 +976,8 @@ dialog (void)
gtk_widget_show (inbox);
gtk_widget_show (frame);
box = gtk_vbox_new (FALSE, 2);
gtk_box_pack_start (GTK_BOX (yetanotherbox), box, FALSE, FALSE, 0);
box = gtk_vbox_new (FALSE, 6);
gtk_box_pack_start (GTK_BOX (vbox), box, FALSE, FALSE, 0);
my_widgets.autoset = button =
gtk_check_button_new_with_mnemonic (_("A_utomatic"));
......@@ -999,16 +1000,15 @@ dialog (void)
&my_config.alpha_alg);
gtk_widget_show (box);
gtk_widget_show (yetanotherbox);
gtk_widget_show (vbox);
inbox = gtk_vbox_new (FALSE, 4);
inbox = gtk_vbox_new (FALSE, 12);
gtk_box_pack_start (GTK_BOX (main_hbox), inbox, FALSE, FALSE, 0);
frame = gtk_frame_new (_("Border"));
frame = gimp_frame_new (_("Border"));
gtk_box_pack_start (GTK_BOX (inbox), frame, FALSE, FALSE, 0);
box = gtk_vbox_new (FALSE, 1);
gtk_container_set_border_width (GTK_CONTAINER (box), 2);
box = gtk_vbox_new (FALSE, 2);
gtk_container_add (GTK_CONTAINER (frame), box);
group = NULL;
......@@ -1029,11 +1029,10 @@ dialog (void)
gtk_widget_show (box);
gtk_widget_show (frame);
frame=gtk_frame_new (_("Channels"));
frame = gimp_frame_new (_("Channels"));
gtk_box_pack_start (GTK_BOX (inbox), frame, FALSE, FALSE, 0);
box = gtk_vbox_new (FALSE, 1);
gtk_container_set_border_width (GTK_CONTAINER (box), 2);
box = gtk_vbox_new (FALSE, 2);
gtk_container_add (GTK_CONTAINER (frame), box);
for (i = 0; i < 5; i++)
......@@ -1052,7 +1051,7 @@ dialog (void)
&my_config.channels[i]);
}
gtk_widget_show(box);
gtk_widget_show (box);
gtk_widget_show (frame);
gtk_widget_show (inbox);
......
......@@ -643,14 +643,14 @@ run_save_dialog (Config *config)
NULL);
vbox = gtk_vbox_new (FALSE, 2);
gtk_container_set_border_width (GTK_CONTAINER (vbox), 6);
vbox = gtk_vbox_new (FALSE, 12);
gtk_container_set_border_width (GTK_CONTAINER (vbox), 12);
gtk_container_add (GTK_CONTAINER (GTK_DIALOG (dialog)->vbox), vbox);
gtk_widget_show (vbox);
table = gtk_table_new (2, 2, FALSE);
gtk_table_set_col_spacings (GTK_TABLE (table), 4);
gtk_table_set_row_spacings (GTK_TABLE (table), 4);
gtk_table_set_col_spacings (GTK_TABLE (table), 6);
gtk_table_set_row_spacings (GTK_TABLE (table), 6);
gtk_box_pack_start (GTK_BOX (vbox), table, FALSE, FALSE, 0);
gtk_widget_show (table);
......@@ -658,7 +658,7 @@ run_save_dialog (Config *config)
*/
prefixed_name = gtk_entry_new ();
gimp_table_attach_aligned (GTK_TABLE (table), 0, 0,
_("_Prefixed Name:"), 1.0, 0.5,
_("_Prefixed Name:"), 0.0, 0.5,
prefixed_name, 1, FALSE);
gtk_entry_set_text (GTK_ENTRY (prefixed_name),
config->prefixed_name ? config->prefixed_name : "");
......@@ -667,7 +667,7 @@ run_save_dialog (Config *config)
*/
centry = gtk_entry_new ();
gimp_table_attach_aligned (GTK_TABLE (table), 0, 1,
_("Co_mment:"), 1.0, 0.5,
_("Co_mment:"), 0.0, 0.5,
centry, 1, FALSE);
gtk_entry_set_text (GTK_ENTRY (centry),
config->comment ? config->comment : "");
......
......@@ -19,6 +19,7 @@
* You can contact the original The Gimp authors at gimp@xcf.berkeley.edu
* Speedups by Elliot Lee
*/
#include "config.h"
#include <stdlib.h>
......@@ -95,7 +96,7 @@ static gint polygon_extents (Polygon *poly,
gdouble *max_y);
static void polygon_reset (Polygon *poly);
static gint cubism_dialog (void);
static gboolean cubism_dialog (void);
/*
* Local variables
......@@ -241,12 +242,12 @@ run (const gchar *name,
gimp_drawable_detach (active_drawable);
}
static gint
static gboolean
cubism_dialog (void)
{
GtkWidget *dlg;
GtkWidget *vbox;
GtkWidget *toggle;
GtkWidget *frame;
GtkWidget *table;
GtkObject *scale_data;
gboolean run;
......@@ -262,33 +263,19 @@ cubism_dialog (void)
NULL);
/* parameter settings */
frame = gtk_frame_new (_("Parameter Settings"));
gtk_container_set_border_width (GTK_CONTAINER (frame), 6);
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dlg)->vbox), frame, TRUE, TRUE, 0);
gtk_widget_show (frame);
vbox = gtk_vbox_new (FALSE, 12);
gtk_container_set_border_width (GTK_CONTAINER (vbox), 12);
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dlg)->vbox), vbox, TRUE, TRUE, 0);
gtk_widget_show (vbox);
table = gtk_table_new (3, 3, FALSE);
gtk_table_set_col_spacings (GTK_TABLE (table), 4);
gtk_table_set_row_spacings (GTK_TABLE (table), 2);
table = gtk_table_new (2, 3, FALSE);
gtk_table_set_col_spacings (GTK_TABLE (table), 6);
gtk_table_set_row_spacings (GTK_TABLE (table), 6);
gtk_table_set_row_spacing (GTK_TABLE (table), 0, 4);
gtk_container_set_border_width (GTK_CONTAINER (table), 6);
gtk_container_add (GTK_CONTAINER (frame), table);
gtk_box_pack_start (GTK_BOX (vbox), table, FALSE, FALSE, 0);
gtk_widget_show (table);
toggle = gtk_check_button_new_with_mnemonic (_("_Use Background Color"));
gtk_table_attach (GTK_TABLE (table), toggle, 0, 3, 0, 1,
GTK_FILL, GTK_FILL, 0, 0);
gtk_widget_show (toggle);
g_signal_connect (toggle, "toggled",
G_CALLBACK (gimp_toggle_button_update),
&cvals.bg_color);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (toggle),
(cvals.bg_color == BG));
scale_data = gimp_scale_entry_new (GTK_TABLE (table), 0, 1,
scale_data = gimp_scale_entry_new (GTK_TABLE (table), 0, 0,
_("_Tile Size:"), SCALE_WIDTH, 5,
cvals.tile_size, 0.0, 100.0, 1.0, 10.0, 1,
TRUE, 0, 0,
......@@ -298,7 +285,7 @@ cubism_dialog (void)
&cvals.tile_size);
scale_data =
gimp_scale_entry_new (GTK_TABLE (table), 0, 2,
gimp_scale_entry_new (GTK_TABLE (table), 0, 1,
_("T_ile Saturation:"), SCALE_WIDTH, 5,
cvals.tile_saturation, 0.0, 10.0, 0.1, 1, 1,
TRUE, 0, 0,
......@@ -307,6 +294,17 @@ cubism_dialog (void)
G_CALLBACK (gimp_double_adjustment_update),
&cvals.tile_saturation);
toggle = gtk_check_button_new_with_mnemonic (_("_Use Background Color"));
gtk_box_pack_start (GTK_BOX (vbox), toggle, FALSE, FALSE, 0);
gtk_widget_show (toggle);
g_signal_connect (toggle, "toggled",
G_CALLBACK (gimp_toggle_button_update),
&cvals.bg_color);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (toggle),
(cvals.bg_color == BG));
gtk_widget_show (dlg);
run = (gimp_dialog_run (GIMP_DIALOG (dlg)) == GTK_RESPONSE_OK);
......
......@@ -99,12 +99,13 @@ static void extract_ycbcr709 (guchar *src, gint bpp, gint numpix, guchar **dst);
static void extract_ycbcr470f(guchar *src, gint bpp, gint numpix, guchar **dst);
static void extract_ycbcr709f(guchar *src, gint bpp, gint numpix, guchar **dst);
static gint decompose_dialog (void);
static gboolean decompose_dialog (void);
/* LAB colorspace constants */
const double Xn = 0.951;
const double Yn = 1.0;
const double Zn = 1.089;
static const gdouble Xn = 0.951;
static const gdouble Yn = 1.0;
static const gdouble Zn = 1.089;
/* Maximum number of new images generated by an extraction */
......@@ -1172,10 +1173,11 @@ extract_ycbcr709f (guchar *src,
}
static gint
static gboolean
decompose_dialog (void)
{
GtkWidget *dlg;
GtkWidget *main_vbox;
GtkWidget *toggle;
GtkWidget *frame;
GtkWidget *vbox;
......@@ -1194,13 +1196,17 @@ decompose_dialog (void)
NULL);
main_vbox = gtk_vbox_new (FALSE, 12);
gtk_container_set_border_width (GTK_CONTAINER (main_vbox), 12);
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dlg)->vbox), main_vbox,
TRUE, TRUE, 0);
gtk_widget_show (main_vbox);
/* parameter settings */
frame = gtk_frame_new (_("Extract Channels:"));
gtk_container_set_border_width (GTK_CONTAINER (frame), 6);
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dlg)->vbox), frame, TRUE, TRUE, 0);
frame = gimp_frame_new (_("Extract Channels"));
gtk_box_pack_start (GTK_BOX (main_vbox), frame, TRUE, TRUE, 0);
vbox = gtk_vbox_new (FALSE, 1);
gtk_container_set_border_width (GTK_CONTAINER (vbox), 2);
vbox = gtk_vbox_new (FALSE, 2);
gtk_container_add (GTK_CONTAINER (frame), vbox);
group = NULL;
......@@ -1226,7 +1232,7 @@ decompose_dialog (void)
}
toggle = gtk_check_button_new_with_label (_("Decompose to _Layers"));
gtk_box_pack_start (GTK_BOX (vbox), toggle, FALSE, FALSE, 0);
gtk_box_pack_start (GTK_BOX (main_vbox), toggle, FALSE, FALSE, 0);
g_signal_connect (toggle, "toggled",
G_CALLBACK (gimp_toggle_button_update),
&decovals.as_layers);
......
......@@ -53,7 +53,8 @@ static void run (const gchar *name,
static void deinterlace (GimpDrawable *drawable);
static gint deinterlace_dialog (void);
static gboolean deinterlace_dialog (void);
GimpPlugInInfo PLUG_IN_INFO =
{
......@@ -72,10 +73,10 @@ query (void)
{