Commit d32d2a01 authored by Sven Neumann's avatar Sven Neumann Committed by Sven Neumann

plug-ins/common/aa.c plug-ins/common/align_layers.c

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

	* plug-ins/common/aa.c
	* plug-ins/common/align_layers.c
	* plug-ins/common/animationplay.c
	* plug-ins/common/apply_lens.c: HIG-ified.
parent 6f1f65d5
2004-05-18 Sven Neumann <sven@gimp.org>
* plug-ins/common/aa.c
* plug-ins/common/align_layers.c
* plug-ins/common/animationplay.c
* plug-ins/common/apply_lens.c: HIG-ified.
2004-05-18 Michael Natterer <mitch@gimp.org>
* app/core/gimptoolinfo.c: made the "visible" property serializable.
......
......@@ -363,10 +363,9 @@ type_dialog (gint selected)
/* file save type */
frame = gimp_frame_new (_("Data Formatting"));
gtk_container_set_border_width (GTK_CONTAINER (frame), 12);
gtk_box_pack_start (GTK_BOX(GTK_DIALOG(dlg)->vbox), frame, TRUE, TRUE, 0);
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dlg)->vbox), frame, TRUE, TRUE, 0);
toggle_vbox = gtk_vbox_new (FALSE, 2);
gtk_container_set_border_width (GTK_CONTAINER(toggle_vbox), 4);
toggle_vbox = gtk_vbox_new (FALSE, 6);
gtk_container_add (GTK_CONTAINER (frame), toggle_vbox);
group = NULL;
......
......@@ -394,7 +394,6 @@ static int
align_layers_dialog (void)
{
GtkWidget *dlg;
GtkWidget *frame;
GtkWidget *table;
GtkWidget *combo;
GtkWidget *toggle;
......@@ -412,16 +411,12 @@ align_layers_dialog (void)
NULL);
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, FALSE, FALSE, 0);
gtk_widget_show (frame);
table = gtk_table_new (7, 3, FALSE);
gtk_table_set_col_spacings (GTK_TABLE (table), 4);
gtk_table_set_row_spacings (GTK_TABLE (table), 2);
gtk_container_set_border_width (GTK_CONTAINER (table), 4);
gtk_container_add (GTK_CONTAINER (frame), table);
gtk_table_set_col_spacings (GTK_TABLE (table), 6);
gtk_table_set_row_spacings (GTK_TABLE (table), 6);
gtk_container_set_border_width (GTK_CONTAINER (table), 12);
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dlg)->vbox), table,
FALSE, FALSE, 0);
gtk_widget_show (table);
combo = gimp_int_combo_box_new (_("None"), H_NONE,
......@@ -437,8 +432,8 @@ align_layers_dialog (void)
&VALS.h_style);
gimp_table_attach_aligned (GTK_TABLE (table), 0, 0,
_("_Horizontal Style:"), 1.0, 0.5,
combo, 1, FALSE);
_("_Horizontal Style:"), 0.0, 0.5,
combo, 2, FALSE);
combo = gimp_int_combo_box_new (_("Left Edge"), H_BASE_LEFT,
......@@ -452,8 +447,8 @@ align_layers_dialog (void)
&VALS.h_base);
gimp_table_attach_aligned (GTK_TABLE (table), 0, 1,
_("Ho_rizontal Base:"), 1.0, 0.5,
combo, 1, FALSE);
_("Ho_rizontal Base:"), 0.0, 0.5,
combo, 2, FALSE);
combo = gimp_int_combo_box_new (_("None"), V_NONE,
_("Collect"), V_COLLECT,
......@@ -468,8 +463,8 @@ align_layers_dialog (void)
&VALS.v_style);
gimp_table_attach_aligned (GTK_TABLE (table), 0, 2,
_("_Vertical Style:"), 1.0, 0.5,
combo, 1, FALSE);
_("_Vertical Style:"), 0.0, 0.5,
combo, 2, FALSE);
combo = gimp_int_combo_box_new (_("Top Edge"), V_BASE_TOP,
_("Center"), V_BASE_CENTER,
......@@ -482,13 +477,22 @@ align_layers_dialog (void)
&VALS.v_base);
gimp_table_attach_aligned (GTK_TABLE (table), 0, 3,
_("Ver_tical Base:"), 1.0, 0.5,
combo, 1, FALSE);
_("Ver_tical Base:"), 0.0, 0.5,
combo, 2, FALSE);
adj = gimp_scale_entry_new (GTK_TABLE (table), 0, 4,
_("_Grid Size:"), SCALE_WIDTH, 0,
VALS.grid_size, 0, 200, 1, 10, 0,
TRUE, 0, 0,
NULL, NULL);
g_signal_connect (adj, "value_changed",
G_CALLBACK (gimp_int_adjustment_update),
&VALS.grid_size);
toggle = gtk_check_button_new_with_mnemonic
(_("_Ignore the Bottom Layer even if Visible"));
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (toggle), VALS.ignore_bottom);
gtk_table_attach_defaults (GTK_TABLE (table), toggle, 0, 2, 4, 5);
gtk_table_attach_defaults (GTK_TABLE (table), toggle, 0, 3, 5, 6);
gtk_widget_show (toggle);
g_signal_connect (toggle, "toggled",
......@@ -499,22 +503,13 @@ align_layers_dialog (void)
(_("_Use the (Invisible) Bottom Layer as the Base"));
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (toggle),
VALS.base_is_bottom_layer);
gtk_table_attach_defaults (GTK_TABLE (table), toggle, 0, 2, 5, 6);
gtk_table_attach_defaults (GTK_TABLE (table), toggle, 0, 3, 6, 7);
gtk_widget_show (toggle);
g_signal_connect (toggle, "toggled",
G_CALLBACK (gimp_toggle_button_update),
&VALS.base_is_bottom_layer);
adj = gimp_scale_entry_new (GTK_TABLE (table), 0, 6,
_("_Grid Size:"), SCALE_WIDTH, 0,
VALS.grid_size, 0, 200, 1, 10, 0,
TRUE, 0, 0,
NULL, NULL);
g_signal_connect (adj, "value_changed",
G_CALLBACK (gimp_int_adjustment_update),
&VALS.grid_size);
gtk_widget_show (dlg);
run = (gimp_dialog_run (GIMP_DIALOG (dlg)) == GTK_RESPONSE_OK);
......
......@@ -495,139 +495,105 @@ build_dialog (GimpImageBaseType basetype,
G_CALLBACK (window_response),
NULL);
{
/* The 'playback' half of the dialog */
if (total_frames > 1)
windowname = g_strconcat (_("Playback:"), " ",imagename, NULL);
else
windowname = g_strdup (imagename);
frame = gtk_frame_new (windowname);
g_free (windowname);
gtk_container_set_border_width (GTK_CONTAINER (frame), 3);
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dlg)->vbox),
frame, TRUE, TRUE, 0);
{
hbox = gtk_hbox_new (FALSE, 5);
gtk_container_set_border_width (GTK_CONTAINER (hbox), 3);
gtk_container_add (GTK_CONTAINER (frame), hbox);
/* The 'playback' half of the dialog */
if (total_frames > 1)
windowname = g_strconcat (_("Playback:"), " ",imagename, NULL);
else
windowname = g_strdup (imagename);
{
vbox = gtk_vbox_new (FALSE, 5);
gtk_container_set_border_width (GTK_CONTAINER (vbox), 3);
gtk_container_add (GTK_CONTAINER (hbox), vbox);
frame = gimp_frame_new (windowname);
{
hbox2 = gtk_hbox_new (FALSE, 0);
gtk_container_set_border_width (GTK_CONTAINER (hbox2), 0);
gtk_box_pack_start (GTK_BOX (vbox), hbox2, TRUE, TRUE, 0);
{
psbutton = gtk_toggle_button_new_with_label ( _("Play/Stop"));
g_signal_connect (psbutton, "toggled",
G_CALLBACK (playstop_callback), NULL);
gtk_box_pack_start (GTK_BOX (hbox2), psbutton, TRUE, TRUE, 0);
gtk_widget_show (psbutton);
button = gtk_button_new_with_label ( _("Rewind"));
g_signal_connect (button, "clicked",
G_CALLBACK (rewind_callback), NULL);
gtk_box_pack_start (GTK_BOX (hbox2), button, TRUE, TRUE, 0);
gtk_widget_show (button);
button = gtk_button_new_with_label ( _("Step"));
g_signal_connect (button, "clicked",
G_CALLBACK (step_callback), NULL);
gtk_box_pack_start (GTK_BOX (hbox2), button, TRUE, TRUE, 0);
gtk_widget_show (button);
}
/* If there aren't multiple frames, playback controls make no
sense */
/* if (total_frames<=1) gtk_widget_set_sensitive (hbox2, FALSE);
gtk_widget_show(hbox2);*/
if (total_frames>1)
gtk_widget_show(hbox2);
hbox2 = gtk_hbox_new (TRUE, 0);
gtk_container_set_border_width (GTK_CONTAINER (hbox2), 0);
gtk_box_pack_start (GTK_BOX (vbox), hbox2, FALSE, FALSE, 0);
{
frame2 = gtk_frame_new (NULL);
gtk_frame_set_shadow_type (GTK_FRAME (frame2), GTK_SHADOW_IN);
gtk_box_pack_start (GTK_BOX (hbox2), frame2, FALSE, FALSE, 0);
g_free (windowname);
{
eventbox = gtk_event_box_new();
gtk_container_add (GTK_CONTAINER (frame2), GTK_WIDGET (eventbox));
{
drawing_area = gtk_drawing_area_new ();
gtk_widget_set_size_request (drawing_area, width, height);
gtk_container_add (GTK_CONTAINER (eventbox),
GTK_WIDGET (drawing_area));
gtk_widget_show (drawing_area);
}
gtk_widget_show(eventbox);
gtk_widget_set_events (eventbox,
gtk_widget_get_events (eventbox)
| GDK_BUTTON_PRESS_MASK);
}
gtk_widget_show(frame2);
}
gtk_widget_show(hbox2);
gtk_container_set_border_width (GTK_CONTAINER (frame), 12);
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dlg)->vbox),
frame, TRUE, TRUE, 0);
gtk_widget_show (frame);
hbox = gtk_hbox_new (FALSE, 6);
gtk_container_add (GTK_CONTAINER (frame), hbox);
gtk_widget_show (hbox);
vbox = gtk_vbox_new (FALSE, 6);
gtk_container_add (GTK_CONTAINER (hbox), vbox);
gtk_widget_show (vbox);
hbox2 = gtk_hbox_new (FALSE, 0);
gtk_box_pack_start (GTK_BOX (vbox), hbox2, TRUE, TRUE, 0);
if (total_frames > 1)
gtk_widget_show (hbox2);
psbutton = gtk_toggle_button_new_with_label ( _("Play/Stop"));
g_signal_connect (psbutton, "toggled",
G_CALLBACK (playstop_callback), NULL);
gtk_box_pack_start (GTK_BOX (hbox2), psbutton, TRUE, TRUE, 0);
gtk_widget_show (psbutton);
button = gtk_button_new_with_label ( _("Rewind"));
g_signal_connect (button, "clicked",
G_CALLBACK (rewind_callback), NULL);
gtk_box_pack_start (GTK_BOX (hbox2), button, TRUE, TRUE, 0);
gtk_widget_show (button);
button = gtk_button_new_with_label ( _("Step"));
g_signal_connect (button, "clicked",
G_CALLBACK (step_callback), NULL);
gtk_box_pack_start (GTK_BOX (hbox2), button, TRUE, TRUE, 0);
gtk_widget_show (button);
hbox2 = gtk_hbox_new (TRUE, 0);
gtk_box_pack_start (GTK_BOX (vbox), hbox2, FALSE, FALSE, 0);
gtk_widget_show (hbox2);
frame2 = gtk_frame_new (NULL);
gtk_frame_set_shadow_type (GTK_FRAME (frame2), GTK_SHADOW_IN);
gtk_box_pack_start (GTK_BOX (hbox2), frame2, FALSE, FALSE, 0);
gtk_widget_show (frame2);
eventbox = gtk_event_box_new();
gtk_widget_add_events (eventbox, GDK_BUTTON_PRESS_MASK);
gtk_container_add (GTK_CONTAINER (frame2), GTK_WIDGET (eventbox));
gtk_widget_show (eventbox);
drawing_area = gtk_drawing_area_new ();
gtk_widget_set_size_request (drawing_area, width, height);
gtk_container_add (GTK_CONTAINER (eventbox), GTK_WIDGET (drawing_area));
gtk_widget_show (drawing_area);
progress = GTK_PROGRESS_BAR (gtk_progress_bar_new ());
gtk_box_pack_start (GTK_BOX (vbox), GTK_WIDGET (progress), TRUE, TRUE, 0);
if (total_frames > 1)
gtk_widget_show (GTK_WIDGET (progress));
gtk_widget_show (dlg);
progress = GTK_PROGRESS_BAR (gtk_progress_bar_new ());
/* let's get into shape. */
shape_window = gtk_window_new (GTK_WINDOW_POPUP);
gtk_box_pack_start (GTK_BOX (vbox), GTK_WIDGET (progress),
TRUE, TRUE, 0);
if (total_frames>1)
gtk_widget_show (GTK_WIDGET (progress));
}
gtk_widget_show(vbox);
shape_drawing_area = gtk_drawing_area_new ();
gtk_widget_set_size_request (shape_drawing_area, width, height);
gtk_container_add (GTK_CONTAINER (shape_window), shape_drawing_area);
gtk_widget_show (shape_drawing_area);
gtk_widget_add_events (shape_drawing_area, GDK_BUTTON_PRESS_MASK);
gtk_widget_realize (shape_window);
}
gtk_widget_show(hbox);
gdk_window_set_back_pixmap (shape_window->window, NULL, 0);
}
gtk_widget_show(frame);
cursor = gdk_cursor_new_for_display (gtk_widget_get_display (shape_window),
GDK_CENTER_PTR);
gdk_window_set_cursor(shape_window->window, cursor);
gdk_cursor_unref (cursor);
}
gtk_widget_show(dlg);
g_signal_connect (shape_window, "button_press_event",
G_CALLBACK (shape_pressed),NULL);
g_signal_connect (shape_window, "button_release_event",
G_CALLBACK (shape_released),NULL);
g_signal_connect (shape_window, "motion_notify_event",
G_CALLBACK (shape_motion),NULL);
icon_pos = g_new (CursorOffset, 1);
g_object_set_data (G_OBJECT (shape_window), "cursor-offset", icon_pos);
/* let's get into shape. */
shape_window = gtk_window_new (GTK_WINDOW_POPUP);
{
shape_drawing_area = gtk_drawing_area_new ();
{
gtk_widget_set_size_request (shape_drawing_area, width, height);
gtk_container_add (GTK_CONTAINER (shape_window), shape_drawing_area);
}
gtk_widget_show (shape_drawing_area);
gtk_widget_set_events (shape_drawing_area,
gtk_widget_get_events (shape_drawing_area)
| GDK_BUTTON_PRESS_MASK);
gtk_widget_realize (shape_window);
gdk_window_set_back_pixmap(shape_window->window, NULL, 0);
cursor = gdk_cursor_new_for_display (gtk_widget_get_display (shape_window),
GDK_CENTER_PTR);
gdk_window_set_cursor(shape_window->window, cursor);
gdk_cursor_unref (cursor);
g_signal_connect (shape_window, "button_press_event",
G_CALLBACK (shape_pressed),NULL);
g_signal_connect (shape_window, "button_release_event",
G_CALLBACK (shape_released),NULL);
g_signal_connect (shape_window, "motion_notify_event",
G_CALLBACK (shape_motion),NULL);
icon_pos = g_new (CursorOffset, 1);
g_object_set_data (G_OBJECT (shape_window), "cursor-offset", icon_pos);
}
/* gtk_widget_show (shape_window);*/
g_signal_connect (eventbox, "button_press_event",
......@@ -642,20 +608,18 @@ build_dialog (GimpImageBaseType basetype,
root_win = gdk_get_default_root_window ();
}
static void
do_playback (void)
{
int i;
width = gimp_image_width(image_id);
height = gimp_image_height(image_id);
width = gimp_image_width (image_id);
height = gimp_image_height (image_id);
layers = gimp_image_get_layers (image_id, &total_frames);
imagetype = gimp_image_base_type(image_id);
imagetype = gimp_image_base_type (image_id);
if (imagetype == GIMP_INDEXED)
palette = gimp_image_get_cmap(image_id, &ncolours);
palette = gimp_image_get_cmap (image_id, &ncolours);
else if (imagetype == GIMP_GRAY)
{
/* This is a bit sick, until this plugin ever gets
......
......@@ -51,16 +51,16 @@
/* Declare local functions.
*/
static void query (void);
static void run (const gchar *name,
gint nparams,
const GimpParam *param,
gint *nreturn_vals,
GimpParam **return_vals);
static void query (void);
static void run (const gchar *name,
gint nparams,
const GimpParam *param,
gint *nreturn_vals,
GimpParam **return_vals);
static void drawlens (GimpDrawable *drawable);
static void drawlens (GimpDrawable *drawable);
static gboolean lens_dialog (GimpDrawable *drawable);
static gint lens_dialog (GimpDrawable *drawable);
GimpPlugInInfo PLUG_IN_INFO =
{
......@@ -341,7 +341,7 @@ drawlens (GimpDrawable *drawable)
gimp_drawable_update (drawable->drawable_id, x1, y1, x2 - x1, y2 - y1);
}
static gint
static gboolean
lens_dialog (GimpDrawable *drawable)
{
GtkWidget *dlg;
......@@ -364,7 +364,7 @@ lens_dialog (GimpDrawable *drawable)
NULL);
vbox = gtk_vbox_new (FALSE, 2);
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);
......@@ -406,7 +406,7 @@ lens_dialog (GimpDrawable *drawable)
&lvals.set_transparent);
}
hbox = gtk_hbox_new (FALSE, 4);
hbox = gtk_hbox_new (FALSE, 6);
gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0);
label = gtk_label_new_with_mnemonic (_("_Lens Refraction Index:"));
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment