Commit 537890aa authored by Sven Neumann's avatar Sven Neumann Committed by Sven Neumann

plug-ins/imagemap/imap_circle.c plug-ins/imagemap/imap_cmd_gimp_guides.c

2004-10-25  Sven Neumann  <sven@gimp.org>

	* plug-ins/imagemap/imap_circle.c
	* plug-ins/imagemap/imap_cmd_gimp_guides.c
	* plug-ins/imagemap/imap_cmd_guides.c
	* plug-ins/imagemap/imap_default_dialog.[ch]
	* plug-ins/imagemap/imap_edit_area_info.c
	* plug-ins/imagemap/imap_grid.c
	* plug-ins/imagemap/imap_main.c
	* plug-ins/imagemap/imap_misc.c
	* plug-ins/imagemap/imap_polygon.c
	* plug-ins/imagemap/imap_preferences.c
	* plug-ins/imagemap/imap_rectangle.c
	* plug-ins/imagemap/imap_selection.c
	* plug-ins/imagemap/imap_source.c
	* plug-ins/imagemap/imap_toolbar.c
	* plug-ins/imagemap/imap_tools.c: reviewed for HIG
	compliance. Various other minor fixes. Closes bug #150004.
parent 1cea4942
2004-10-25 Sven Neumann <sven@gimp.org>
* plug-ins/imagemap/imap_circle.c
* plug-ins/imagemap/imap_cmd_gimp_guides.c
* plug-ins/imagemap/imap_cmd_guides.c
* plug-ins/imagemap/imap_default_dialog.[ch]
* plug-ins/imagemap/imap_edit_area_info.c
* plug-ins/imagemap/imap_grid.c
* plug-ins/imagemap/imap_main.c
* plug-ins/imagemap/imap_misc.c
* plug-ins/imagemap/imap_polygon.c
* plug-ins/imagemap/imap_preferences.c
* plug-ins/imagemap/imap_rectangle.c
* plug-ins/imagemap/imap_selection.c
* plug-ins/imagemap/imap_source.c
* plug-ins/imagemap/imap_toolbar.c
* plug-ins/imagemap/imap_tools.c: reviewed for HIG
compliance. Various other minor fixes. Closes bug #150004.
2004-10-25 Kevin Cozens <kcozens@cvs.gimp.org>
* plug-ins/script-fu/scripts/test-sphere.scm: Added parameter
......@@ -21,6 +40,7 @@
2004-10-25 Sven Neumann <sven@gimp.org>
* configure.in:
* app/Makefile.am
* tools/Makefile.am: bumped version to 2.2.0-pre1, set app version
to 2.2, reset other versions to 2.0. Changed library versioning so
......
......@@ -52,11 +52,11 @@ static gpointer circle_create_info_widget(GtkWidget *frame);
static void circle_fill_info_tab(Object_t *obj, gpointer data);
static void circle_set_initial_focus(Object_t *obj, gpointer data);
static void circle_update(Object_t* obj, gpointer data);
static void circle_write_csim(Object_t* obj, gpointer param,
static void circle_write_csim(Object_t* obj, gpointer param,
OutputFunc_t output);
static void circle_write_cern(Object_t* obj, gpointer param,
static void circle_write_cern(Object_t* obj, gpointer param,
OutputFunc_t output);
static void circle_write_ncsa(Object_t* obj, gpointer param,
static void circle_write_ncsa(Object_t* obj, gpointer param,
OutputFunc_t output);
static const gchar* circle_get_stock_icon_name(void);
......@@ -161,13 +161,13 @@ move_sash(Object_t *obj, gint dx, gint dy)
circle->r = (rx > ry) ? rx : ry;
}
static void
static void
circle_resize(Object_t *obj, gint percentage_x, gint percentage_y)
{
Circle_t *circle = ObjectToCircle(obj);
circle->x = circle->x * percentage_x / 100;
circle->y = circle->y * percentage_y / 100;
circle->r = circle->r * ((percentage_x < percentage_y)
circle->r = circle->r * ((percentage_x < percentage_y)
? percentage_x : percentage_y) / 100;
}
......@@ -194,7 +194,7 @@ circle_point_is_on(Object_t *obj, gint x, gint y)
return x * x + y * y <= circle->r * circle->r;
}
static void
static void
circle_get_dimensions(Object_t *obj, gint *x, gint *y,
gint *width, gint *height)
{
......@@ -256,36 +256,35 @@ circle_create_info_widget(GtkWidget *frame)
table = gtk_table_new(3, 3, FALSE);
gtk_container_add(GTK_CONTAINER(frame), table);
gtk_container_set_border_width(GTK_CONTAINER(table), 0);
gtk_table_set_row_spacings(GTK_TABLE(table), 6);
gtk_table_set_col_spacings(GTK_TABLE(table), 6);
gtk_widget_show(table);
label = create_label_in_table(table, 0, 0, _("Center _x:"));
props->x = create_spin_button_in_table(table, label, 0, 1, 1, 0,
props->x = create_spin_button_in_table(table, label, 0, 1, 1, 0,
max_width - 1);
g_signal_connect(props->x, "value_changed",
g_signal_connect(props->x, "value_changed",
G_CALLBACK (x_changed_cb), (gpointer) props);
create_label_in_table(table, 0, 2, _("pixels"));
label = create_label_in_table(table, 1, 0, _("Center _y:"));
props->y = create_spin_button_in_table(table, label, 1, 1, 1, 0,
props->y = create_spin_button_in_table(table, label, 1, 1, 1, 0,
max_height - 1);
g_signal_connect(props->y, "value_changed",
g_signal_connect(props->y, "value_changed",
G_CALLBACK (y_changed_cb), (gpointer) props);
create_label_in_table(table, 1, 2, _("pixels"));
label = create_label_in_table(table, 2, 0, _("_Radius:"));
props->r = create_spin_button_in_table(table, label, 2, 1, 1, 1, G_MAXINT);
g_signal_connect(props->r, "value_changed",
g_signal_connect(props->r, "value_changed",
G_CALLBACK (r_changed_cb), (gpointer) props);
create_label_in_table(table, 2, 2, _("pixels"));
return props;
}
static void
static void
circle_fill_info_tab(Object_t *obj, gpointer data)
{
Circle_t *circle = ObjectToCircle(obj);
......@@ -297,14 +296,14 @@ circle_fill_info_tab(Object_t *obj, gpointer data)
gtk_spin_button_set_value(GTK_SPIN_BUTTON(props->r), circle->r);
}
static void
static void
circle_set_initial_focus(Object_t *obj, gpointer data)
{
CircleProperties_t *props = (CircleProperties_t*) data;
gtk_widget_grab_focus(props->x);
}
static void
static void
circle_update(Object_t* obj, gpointer data)
{
Circle_t *circle = ObjectToCircle(obj);
......
......@@ -89,7 +89,7 @@ gimp_guides_ok_cb(gpointer data)
hguides = NULL;
if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(param->lower_border)))
hguides = g_slist_append(hguides,
hguides = g_slist_append(hguides,
GINT_TO_POINTER(gimp_image_height(image_ID)));
url = gtk_entry_get_text(GTK_ENTRY(param->url));
......@@ -101,7 +101,7 @@ gimp_guides_ok_cb(gpointer data)
while (guide_num > 0) {
gint position = gimp_image_get_guide_position(image_ID, guide_num);
if (gimp_image_get_guide_orientation(image_ID, guide_num)
if (gimp_image_get_guide_orientation(image_ID, guide_num)
== GIMP_ORIENTATION_HORIZONTAL) {
hguides = g_slist_insert_sorted(hguides, GINT_TO_POINTER(position),
guide_sort_func);
......@@ -116,11 +116,11 @@ gimp_guides_ok_cb(gpointer data)
subcommand_start(_("Use Gimp Guides"));
for (hg = hguides; hg && hg->next;
for (hg = hguides; hg && hg->next;
hg = (all) ? hg->next : hg->next->next) {
gint y = GPOINTER_TO_INT(hg->data);
gint height = GPOINTER_TO_INT(hg->next->data) - y;
for (vg = vguides; vg && vg->next;
for (vg = vguides; vg && vg->next;
vg = (all) ? vg->next : vg->next->next) {
gint x = GPOINTER_TO_INT(vg->data);
gint width = GPOINTER_TO_INT(vg->next->data) - x;
......@@ -143,7 +143,7 @@ make_gimp_guides_dialog(void)
DefaultDialog_t *dialog;
GtkWidget *table, *frame, *hbox, *vbox;
GtkWidget *label;
dialog = data->dialog = make_default_dialog(_("Use Gimp Guides"));
default_dialog_set_ok_cb(dialog, gimp_guides_ok_cb, data);
table = default_dialog_add_table(dialog, 3, 2);
......@@ -152,11 +152,11 @@ make_gimp_guides_dialog(void)
gtk_widget_show(frame);
gtk_table_attach_defaults(GTK_TABLE(table), frame, 0, 1, 0, 1);
hbox = gtk_hbox_new(FALSE, 1);
hbox = gtk_hbox_new(FALSE, 12);
gtk_container_add(GTK_CONTAINER(frame), hbox);
gtk_widget_show(hbox);
data->alternate =
data->alternate =
gtk_radio_button_new_with_mnemonic_from_widget(NULL, _("Al_ternate"));
gtk_box_pack_start(GTK_BOX(hbox), data->alternate, TRUE, TRUE, 0);
gtk_widget_show(data->alternate);
......@@ -190,19 +190,20 @@ make_gimp_guides_dialog(void)
gtk_container_add(GTK_CONTAINER(vbox), data->lower_border);
gtk_widget_show(data->lower_border);
hbox = gtk_hbox_new(FALSE, 1);
gtk_container_set_border_width(GTK_CONTAINER(hbox), 10);
hbox = gtk_hbox_new (FALSE, 6);
gtk_table_attach_defaults(GTK_TABLE(table), hbox, 0, 2, 2, 3);
gtk_widget_show(hbox);
label = gtk_label_new_with_mnemonic(_("_Base URL:"));
gtk_widget_show(label);
gtk_container_add(GTK_CONTAINER(hbox), label);
gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0);
data->url = gtk_entry_new();
gtk_container_add(GTK_CONTAINER(hbox), data->url);
gtk_widget_show(data->url);
gtk_label_set_mnemonic_widget (GTK_LABEL (label), data->url);
return data;
}
......@@ -247,7 +248,7 @@ gimp_guides_command_new(ObjectList_t *list, GimpDrawable *drawable)
GimpGuidesCommand_t *command = g_new(GimpGuidesCommand_t, 1);
command->list = list;
command->drawable = drawable;
return command_init(&command->parent, _("Use Gimp Guides"),
return command_init(&command->parent, _("Use Gimp Guides"),
&gimp_guides_command_class);
}
......
......@@ -110,7 +110,7 @@ recalc_bounds(GtkWidget *widget, gpointer data)
bounds = g_strdup_printf (_("Resulting Guide Bounds: %d,%d to %d,%d (%d areas)"),
left, top, left + bound_w, top + bound_h, rows * cols);
if (left + bound_w > get_image_width() ||
if (left + bound_w > get_image_width() ||
top + bound_h > get_image_height())
{
gtk_dialog_set_response_sensitive (GTK_DIALOG (param->dialog->dialog),
......@@ -127,94 +127,99 @@ recalc_bounds(GtkWidget *widget, gpointer data)
}
static GuidesDialog_t*
make_guides_dialog()
make_guides_dialog (void)
{
GuidesDialog_t *data = g_new(GuidesDialog_t, 1);
DefaultDialog_t *dialog;
GtkWidget *table;
GtkWidget *label;
GtkWidget *hbox;
dialog = data->dialog = make_default_dialog(_("Create Guides"));
default_dialog_set_ok_cb(dialog, guides_ok_cb, data);
label = gtk_label_new(
_("Guides are pre-defined rectangles covering the image. You define\n"
"them by their width, height, and spacing from each other. This\n"
"allows you to rapidly create the most common image map type -\n"
default_dialog_set_ok_cb (dialog, guides_ok_cb, data);
label = gtk_label_new (
_("Guides are pre-defined rectangles covering the image. You define "
"them by their width, height, and spacing from each other. This "
"allows you to rapidly create the most common image map type - "
"image collection of \"thumbnails\", suitable for navigation bars."));
gtk_label_set_justify(GTK_LABEL(label), GTK_JUSTIFY_LEFT);
gtk_container_set_border_width(
GTK_CONTAINER(GTK_DIALOG(dialog->dialog)->vbox), 10);
gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog->dialog)->vbox), label,
TRUE, TRUE, 10);
gtk_widget_show(label);
data->image_dimensions = gtk_label_new("");
gtk_container_add(GTK_CONTAINER(GTK_DIALOG(dialog->dialog)->vbox),
data->image_dimensions);
gtk_widget_show(data->image_dimensions);
data->guide_bounds = gtk_label_new("");
gtk_container_add(GTK_CONTAINER(GTK_DIALOG(dialog->dialog)->vbox),
data->guide_bounds);
gtk_widget_show(data->guide_bounds);
gtk_label_set_line_wrap (GTK_LABEL (label), TRUE);
gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_LEFT);
gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
gtk_box_pack_start (GTK_BOX (dialog->vbox), label, FALSE, FALSE, 0);
gtk_widget_show (label);
table = default_dialog_add_table(dialog, 4, 4);
data->image_dimensions = gtk_label_new ("");
gtk_misc_set_alignment (GTK_MISC (data->image_dimensions), 0.0, 0.5);
gtk_box_pack_start (GTK_BOX (dialog->vbox),
data->image_dimensions, FALSE, FALSE, 0);
gtk_widget_show (data->image_dimensions);
label = create_label_in_table(table, 0, 0, _("_Width:"));
data->width = create_spin_button_in_table(table, label, 0, 1, 32, 1, 100);
g_signal_connect(data->width, "changed",
G_CALLBACK(recalc_bounds), (gpointer) data);
data->guide_bounds = gtk_label_new ("");
gtk_misc_set_alignment (GTK_MISC (data->guide_bounds), 0.0, 0.5);
gtk_box_pack_start (GTK_BOX (dialog->vbox),
data->guide_bounds, FALSE, FALSE, 0);
gtk_widget_show (data->guide_bounds);
table = default_dialog_add_table (dialog, 4, 4);
label = create_label_in_table (table, 0, 0, _("_Width:"));
data->width = create_spin_button_in_table (table, label, 0, 1, 32, 1, 100);
g_signal_connect (data->width, "changed",
G_CALLBACK(recalc_bounds), (gpointer) data);
label = create_label_in_table(table, 0, 2, _("_Left Start at:"));
data->left = create_spin_button_in_table(table, label, 0, 3, 0, 0, 100);
g_signal_connect(data->left, "changed",
G_CALLBACK(recalc_bounds), (gpointer) data);
data->left = create_spin_button_in_table (table, label, 0, 3, 0, 0, 100);
g_signal_connect (data->left, "changed",
G_CALLBACK(recalc_bounds), (gpointer) data);
label = create_label_in_table(table, 1, 0, _("_Height:"));
data->height = create_spin_button_in_table(table, label, 1, 1, 32, 1, 100);
g_signal_connect(data->height, "changed",
G_CALLBACK(recalc_bounds), (gpointer) data);
data->height = create_spin_button_in_table (table, label, 1, 1, 32, 1, 100);
g_signal_connect (data->height, "changed",
G_CALLBACK(recalc_bounds), (gpointer) data);
label = create_label_in_table(table, 1, 2, _("_Top Start at:"));
data->top = create_spin_button_in_table(table, label, 1, 3, 0, 0, 100);
g_signal_connect(data->top, "changed",
G_CALLBACK(recalc_bounds), (gpointer) data);
label = create_label_in_table (table, 1, 2, _("_Top Start at:"));
data->top = create_spin_button_in_table (table, label, 1, 3, 0, 0, 100);
g_signal_connect (data->top, "changed",
G_CALLBACK(recalc_bounds), (gpointer) data);
label = create_label_in_table(table, 2, 0, _("_Horz. Spacing:"));
data->horz_spacing = create_spin_button_in_table(table, label, 2, 1, 0, 0,
100);
g_signal_connect(data->horz_spacing, "changed",
G_CALLBACK(recalc_bounds), (gpointer) data);
label = create_label_in_table (table, 2, 0, _("_Horz. Spacing:"));
data->horz_spacing = create_spin_button_in_table (table, label, 2, 1, 0, 0,
100);
g_signal_connect (data->horz_spacing, "changed",
G_CALLBACK(recalc_bounds), (gpointer) data);
label = create_label_in_table(table, 2, 2, _("_No. Across:"));
data->no_across = create_spin_button_in_table(table, label, 2, 3, 0, 0,
data->no_across = create_spin_button_in_table(table, label, 2, 3, 0, 0,
100);
g_signal_connect(data->no_across, "changed",
G_CALLBACK(recalc_bounds), (gpointer) data);
g_signal_connect (data->no_across, "changed",
G_CALLBACK(recalc_bounds), (gpointer) data);
label = create_label_in_table(table, 3, 0, _("_Vert. Spacing:"));
data->vert_spacing = create_spin_button_in_table(table, label, 3, 1, 0, 0,
data->vert_spacing = create_spin_button_in_table(table, label, 3, 1, 0, 0,
100);
g_signal_connect(data->vert_spacing, "changed",
G_CALLBACK(recalc_bounds), (gpointer) data);
g_signal_connect (data->vert_spacing, "changed",
G_CALLBACK(recalc_bounds), (gpointer) data);
label = create_label_in_table(table, 3, 2, _("No. _Down:"));
data->no_down = create_spin_button_in_table(table, label, 3, 3, 0, 0, 100);
g_signal_connect(data->no_down, "changed",
G_CALLBACK(recalc_bounds), (gpointer) data);
data->no_down = create_spin_button_in_table (table, label, 3, 3, 0, 0, 100);
g_signal_connect (data->no_down, "changed",
G_CALLBACK(recalc_bounds), (gpointer) data);
hbox = gtk_hbox_new (FALSE, 6);
gtk_container_add (GTK_CONTAINER (dialog->vbox), hbox);
gtk_widget_show(hbox);
hbox = gtk_hbox_new(FALSE, 1);
gtk_container_set_border_width(GTK_CONTAINER(hbox), 10);
gtk_container_add(GTK_CONTAINER(GTK_DIALOG(dialog->dialog)->vbox), hbox);
label = gtk_label_new_with_mnemonic(_("Base _URL:"));
gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0);
gtk_widget_show(label);
gtk_container_add(GTK_CONTAINER(hbox), label);
data->base_url = gtk_entry_new();
gtk_container_add(GTK_CONTAINER(hbox), data->base_url);
data->base_url = gtk_entry_new ();
gtk_container_add (GTK_CONTAINER(hbox), data->base_url);
gtk_widget_show(data->base_url);
gtk_widget_show(hbox);
gtk_label_set_mnemonic_widget (GTK_LABEL (label), data->base_url);
return data;
}
......@@ -229,7 +234,7 @@ init_guides_dialog(GuidesDialog_t *dialog, ObjectList_t *list)
get_image_height());
gtk_label_set_text(GTK_LABEL(dialog->image_dimensions), dimension);
g_free (dimension);
gtk_label_set_text(GTK_LABEL(dialog->guide_bounds),
gtk_label_set_text(GTK_LABEL(dialog->guide_bounds),
_("Resulting Guide Bounds: 0,0 to 0,0 (0 areas)"));
gtk_widget_grab_focus(dialog->width);
}
......
......@@ -94,7 +94,9 @@ make_default_dialog (const gchar *title)
data->dialog = gimp_dialog_new (title, "imagemap",
NULL, 0,
gimp_standard_help_func, "plug-in-imagemap",
/* gimp_standard_help_func,
"plug-in-imagemap", */
gimp_standard_help_func, NULL,
NULL);
data->apply = gtk_dialog_add_button (GTK_DIALOG (data->dialog),
......@@ -113,6 +115,12 @@ make_default_dialog (const gchar *title)
G_CALLBACK (gtk_widget_destroyed),
&data->dialog);
data->vbox = gtk_vbox_new (FALSE, 12);
gtk_container_set_border_width (GTK_CONTAINER (data->vbox), 12);
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (data->dialog)->vbox), data->vbox,
TRUE, TRUE, 0);
gtk_widget_show (data->vbox);
return data;
}
......@@ -150,8 +158,8 @@ void
default_dialog_set_label(DefaultDialog_t *dialog, gchar *text)
{
GtkWidget *label = gtk_label_new(text);
gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog->dialog)->vbox), label,
TRUE, TRUE, 5);
gtk_box_pack_start (GTK_BOX (dialog->vbox), label, TRUE, TRUE, 0);
gtk_widget_show(label);
}
......@@ -159,10 +167,12 @@ GtkWidget*
default_dialog_add_table(DefaultDialog_t *dialog, gint rows, gint cols)
{
GtkWidget *table = gtk_table_new(rows, cols, FALSE);
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_container_add(GTK_CONTAINER(GTK_DIALOG(dialog->dialog)->vbox), table);
gtk_container_add (GTK_CONTAINER(dialog->vbox), table);
gtk_widget_show(table);
return table;
}
......@@ -24,12 +24,13 @@
#ifndef _IMAP_DEFAULT_DIALOG_H
#define _IMAP_DEFAULT_DIALOG_H
typedef struct {
typedef struct
{
GtkWidget *dialog;
GtkWidget *vbox;
GtkWidget *ok;
GtkWidget *apply;
GtkWidget *cancel;
GtkWidget *help;
void (*ok_cb)(gpointer);
gpointer ok_cb_data;
void (*apply_cb)(gpointer);
......@@ -41,10 +42,10 @@ typedef struct {
DefaultDialog_t *make_default_dialog(const gchar *title);
void default_dialog_set_ok_cb(DefaultDialog_t *dialog, void (*ok_cb)(gpointer),
gpointer ok_cb_data);
void default_dialog_set_apply_cb(DefaultDialog_t *dialog,
void default_dialog_set_apply_cb(DefaultDialog_t *dialog,
void (*apply_cb)(gpointer),
gpointer apply_cb_data);
void default_dialog_set_cancel_cb(DefaultDialog_t *dialog,
void default_dialog_set_cancel_cb(DefaultDialog_t *dialog,
void (*ok_cb)(gpointer),
gpointer ok_cb_data);
void default_dialog_show(DefaultDialog_t *dialog);
......@@ -53,7 +54,7 @@ void default_dialog_hide_apply_button(DefaultDialog_t *dialog);
void default_dialog_hide_help_button(DefaultDialog_t *dialog);
void default_dialog_set_title(DefaultDialog_t *dialog, const gchar *title);
void default_dialog_set_label(DefaultDialog_t *dialog, gchar *text);
GtkWidget *default_dialog_add_table(DefaultDialog_t *dialog, gint rows,
GtkWidget *default_dialog_add_table(DefaultDialog_t *dialog, gint rows,
gint cols);
#endif /* _IMAP_DEFAULT_DIALOG_H */
......@@ -189,7 +189,7 @@ create_link_tab(AreaInfoDialog_t *dialog, GtkWidget *notebook)
GSList *group;
table = gtk_table_new(11, 1, FALSE);
gtk_container_set_border_width(GTK_CONTAINER(table), 10);
gtk_container_set_border_width(GTK_CONTAINER(table), 12);
gtk_table_set_row_spacings(GTK_TABLE(table), 6);
gtk_widget_show(table);
......@@ -304,7 +304,7 @@ create_info_tab(AreaInfoDialog_t *dialog, GtkWidget *notebook)
Object_t *obj = dialog->obj;
vbox = gtk_vbox_new(FALSE, 1);
gtk_container_set_border_width(GTK_CONTAINER(vbox), 10);
gtk_container_set_border_width(GTK_CONTAINER(vbox), 12);
gtk_widget_show(vbox);
frame = gimp_frame_new(_("Dimensions"));
......@@ -333,7 +333,7 @@ create_java_script_tab(AreaInfoDialog_t *dialog, GtkWidget *notebook)
table = gtk_table_new(11, 1, FALSE);
gtk_box_pack_start(GTK_BOX(vbox), table, FALSE, FALSE, 0);
gtk_container_set_border_width(GTK_CONTAINER(table), 10);
gtk_container_set_border_width(GTK_CONTAINER(table), 12);
gtk_table_set_row_spacings(GTK_TABLE(table), 6);
gtk_widget_show(table);
......@@ -454,7 +454,7 @@ create_edit_area_info_dialog(Object_t *obj)
default_dialog_set_cancel_cb(data->dialog, edit_area_cancel_cb, data);
data->notebook = notebook = gtk_notebook_new();
gtk_container_set_border_width(GTK_CONTAINER(notebook), 10);
gtk_container_set_border_width(GTK_CONTAINER(notebook), 12);
g_signal_connect_after(notebook, "switch_page",
G_CALLBACK(switch_page), (gpointer) data);
......
......@@ -120,7 +120,7 @@ type_toggled_cb(GtkWidget *widget, gpointer data)
static void
toggle_preview_cb(GtkWidget *widget, GridDialog_t *param)
{
param->enable_preview =
param->enable_preview =
gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget));
redraw_preview();
}
......@@ -197,49 +197,49 @@ create_grid_settings_dialog()
GtkWidget *hbox;
GtkWidget *button;
GtkWidget *chain_button;
data->dialog = dialog = make_default_dialog(_("Grid Settings"));
default_dialog_set_ok_cb(dialog, grid_settings_ok_cb, (gpointer) data);
main_table = default_dialog_add_table(dialog, 4, 2);
data->snap = gtk_check_button_new_with_mnemonic(_("_Snap-To Grid Enabled"));
g_signal_connect(data->snap, "toggled",
g_signal_connect(data->snap, "toggled",
G_CALLBACK (snap_toggled_cb), data);
gtk_table_attach_defaults(GTK_TABLE(main_table), data->snap, 0, 1, 0, 1);
gtk_widget_show(data->snap);
data->type_frame = frame = gimp_frame_new(_("Grid Visibility and Type"));
gtk_widget_show(frame);
gtk_table_attach_defaults(GTK_TABLE(main_table), frame, 0, 2, 1, 2);
hbox = gtk_hbox_new(FALSE, 1);
hbox = gtk_hbox_new(FALSE, 6);
gtk_container_add(GTK_CONTAINER(frame), hbox);
gtk_widget_show(hbox);
button = gtk_radio_button_new_with_mnemonic_from_widget(NULL, _("_Hidden"));
data->hidden = button;
g_signal_connect(button, "toggled",
g_signal_connect(button, "toggled",
G_CALLBACK (type_toggled_cb), (gpointer) GRID_HIDDEN);
gtk_box_pack_start(GTK_BOX(hbox), button, TRUE, TRUE, 0);
gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 0);
gtk_widget_show(button);
button = gtk_radio_button_new_with_mnemonic_from_widget(
GTK_RADIO_BUTTON(button), _("_Lines"));
data->lines = button;
g_signal_connect(button, "toggled",
g_signal_connect(button, "toggled",
G_CALLBACK (type_toggled_cb), (gpointer) GRID_LINES);
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(button), TRUE);
gtk_box_pack_start(GTK_BOX(hbox), button, TRUE, TRUE, 0);
gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 0);
gtk_widget_show(button);
button = gtk_radio_button_new_with_mnemonic_from_widget(
GTK_RADIO_BUTTON(button), _("C_rosses"));
data->crosses = button;
g_signal_connect(button, "toggled",
G_CALLBACK (type_toggled_cb),
g_signal_connect(button, "toggled",
G_CALLBACK (type_toggled_cb),
(gpointer) GRID_CROSSES);
gtk_box_pack_start(GTK_BOX(hbox), button, TRUE, TRUE, 0);
gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 0);
gtk_widget_show(button);
data->granularity_frame = frame = gimp_frame_new(_("Grid Granularity"));
gtk_table_attach_defaults(GTK_TABLE(main_table), frame, 0, 1, 2, 3);
table = gtk_table_new(2, 4, FALSE);
......@@ -249,13 +249,13 @@ create_grid_settings_dialog()
label = create_label_in_table(table, 0, 0, _("_Width"));
data->width = create_spin_button_in_table(table, label, 0, 1, 15, 1, 100);
g_signal_connect(data->width, "value_changed",
g_signal_connect(data->width, "value_changed",
G_CALLBACK (width_changed_cb), (gpointer) data);
create_label_in_table(table, 0, 3, _("pixels"));
label = create_label_in_table(table, 1, 0, _("_Height"));
data->height = create_spin_button_in_table(table, label, 1, 1, 15, 1, 100);
g_signal_connect(data->height, "value_changed",
g_signal_connect(data->height, "value_changed",
G_CALLBACK (height_changed_cb), (gpointer) data);
create_label_in_table(table, 1, 3, _("pixels"));
......@@ -266,7 +266,7 @@ create_grid_settings_dialog()
gtk_widget_show(table);
gtk_widget_show(frame);
data->offset_frame = frame = gimp_frame_new(_("Grid Offset"));
gtk_table_attach_defaults(GTK_TABLE(main_table), frame, 1, 2, 2, 3);
table = gtk_table_new(2, 3, FALSE);
......@@ -276,12 +276,12 @@ create_grid_settings_dialog()
label = create_label_in_table(table, 0, 2, _("pixels from l_eft"));
data->left = create_spin_button_in_table(table, label, 0, 0, 0, 0, 100);
g_signal_connect(data->left, "value_changed",
g_signal_connect(data->left, "value_changed",
G_CALLBACK (left_changed_cb), (gpointer) data);
label = create_label_in_table(table, 1, 2, _("pixels from _top"));
data->top = create_spin_button_in_table(table, label, 1, 0, 0, 0, 100);
g_signal_connect(data->top, "value_changed",
g_signal_connect(data->top, "value_changed",
G_CALLBACK (top_changed_cb), (gpointer) data);
chain_button = gimp_chain_button_new(GIMP_CHAIN_RIGHT);
......@@ -289,9 +289,9 @@ create_grid_settings_dialog()
gtk_table_attach_defaults(GTK_TABLE(table), chain_button, 1, 2, 0, 2);
gtk_widget_show(chain_button);
data->preview = create_check_button_in_table(main_table, 3, 0,
data->preview = create_check_button_in_table(main_table, 3, 0,
_("_Preview"));
g_signal_connect(data->preview, "toggled",
g_signal_connect(data->preview, "toggled",
G_CALLBACK (toggle_preview_cb), (gpointer) data);
gtk_widget_show(data->preview);
......@@ -348,7 +348,7 @@ draw_crosses(GdkWindow *window, GdkGC* gc, gint width, gint height)
for (x = grid_left; x < width; x += grid_width) {
for (y = grid_top; y < height; y += grid_height) {
draw_line(window, gc, x - 3, y, x + 3, y);
draw_line(window, gc, x, y - 3, x, y + 3);
draw_line(window, gc, x, y - 3, x, y + 3);
}
}
}
......@@ -359,7 +359,7 @@ draw_grid(GtkWidget *preview)
if (grid_snap && grid_type != GRID_HIDDEN) {
gint width = preview_get_width(preview);
gint height = preview_get_height(preview);
if (!grid_gc) {
grid_gc = gdk_gc_new(preview->window);
......@@ -369,7 +369,7 @@ draw_grid(GtkWidget *preview)
if (grid_type == GRID_LINES)
draw_lines(preview->window, grid_gc, width, height);
else
draw_crosses(preview->window, preview->style->black_gc, width,
draw_crosses(preview->window, preview->style->black_gc, width,
height);
}
}
......@@ -385,18 +385,18 @@ toggle_grid(void)
static gint
grid_nearest_x(gint x)
{
return grid_left + (x - grid_left + grid_width / 2) / grid_width
return grid_left + (x - grid_left + grid_width / 2) / grid_width
* grid_width;
}
static gint
grid_nearest_y(gint y)
{
return grid_top + (y - grid_top + grid_height / 2) / grid_height
return grid_top + (y - grid_top + grid_height / 2) / grid_height
* grid_height;
}
void
void
round_to_grid(gint *x, gint *y)
{
if (grid_snap) {
......@@ -408,13 +408,13 @@ round_to_grid(gint *x, gint *y)
gboolean
grid_near_x(gint x)