gimp r26966 - in trunk: . plug-ins/script-fu
- From: mitch svn gnome org
- To: svn-commits-list gnome org
- Subject: gimp r26966 - in trunk: . plug-ins/script-fu
- Date: Wed, 17 Sep 2008 08:46:25 +0000 (UTC)
Author: mitch
Date: Wed Sep 17 08:46:25 2008
New Revision: 26966
URL: http://svn.gnome.org/viewvc/gimp?rev=26966&view=rev
Log:
2008-09-17 Michael Natterer <mitch gimp org>
* plug-ins/script-fu/script-fu-interface.c (script_fu_interface):
fix indentation.
Modified:
trunk/ChangeLog
trunk/plug-ins/script-fu/script-fu-interface.c
Modified: trunk/plug-ins/script-fu/script-fu-interface.c
==============================================================================
--- trunk/plug-ins/script-fu/script-fu-interface.c (original)
+++ trunk/plug-ins/script-fu/script-fu-interface.c Wed Sep 17 08:46:25 2008
@@ -109,7 +109,7 @@
*/
static SFInterface *sf_interface = NULL; /* there can only be at most
- * oneinteractive interface
+ * one interactive interface
*/
static GimpPDBStatusType sf_status = GIMP_PDB_SUCCESS;
@@ -305,255 +305,255 @@
label_text = g_strdup_printf (_("%s:"), gettext (script->arg_labels[i]));
switch (script->arg_types[i])
- {
- case SF_IMAGE:
- case SF_DRAWABLE:
- case SF_LAYER:
- case SF_CHANNEL:
- case SF_VECTORS:
- switch (script->arg_types[i])
- {
- case SF_IMAGE:
- widget = gimp_image_combo_box_new (NULL, NULL);
- ID_ptr = &script->arg_values[i].sfa_image;
- break;
-
- case SF_DRAWABLE:
- widget = gimp_drawable_combo_box_new (NULL, NULL);
- ID_ptr = &script->arg_values[i].sfa_drawable;
- break;
-
- case SF_LAYER:
- widget = gimp_layer_combo_box_new (NULL, NULL);
- ID_ptr = &script->arg_values[i].sfa_layer;
- break;
-
- case SF_CHANNEL:
- widget = gimp_channel_combo_box_new (NULL, NULL);
- ID_ptr = &script->arg_values[i].sfa_channel;
- break;
-
- case SF_VECTORS:
- widget = gimp_vectors_combo_box_new (NULL, NULL);
- ID_ptr = &script->arg_values[i].sfa_vectors;
- break;
-
- default:
- menu = NULL;
- break;
- }
+ {
+ case SF_IMAGE:
+ case SF_DRAWABLE:
+ case SF_LAYER:
+ case SF_CHANNEL:
+ case SF_VECTORS:
+ switch (script->arg_types[i])
+ {
+ case SF_IMAGE:
+ widget = gimp_image_combo_box_new (NULL, NULL);
+ ID_ptr = &script->arg_values[i].sfa_image;
+ break;
+
+ case SF_DRAWABLE:
+ widget = gimp_drawable_combo_box_new (NULL, NULL);
+ ID_ptr = &script->arg_values[i].sfa_drawable;
+ break;
+
+ case SF_LAYER:
+ widget = gimp_layer_combo_box_new (NULL, NULL);
+ ID_ptr = &script->arg_values[i].sfa_layer;
+ break;
+
+ case SF_CHANNEL:
+ widget = gimp_channel_combo_box_new (NULL, NULL);
+ ID_ptr = &script->arg_values[i].sfa_channel;
+ break;
+
+ case SF_VECTORS:
+ widget = gimp_vectors_combo_box_new (NULL, NULL);
+ ID_ptr = &script->arg_values[i].sfa_vectors;
+ break;
+
+ default:
+ menu = NULL;
+ break;
+ }
gimp_int_combo_box_connect (GIMP_INT_COMBO_BOX (widget), *ID_ptr,
G_CALLBACK (gimp_int_combo_box_get_active),
ID_ptr);
- break;
+ break;
- case SF_COLOR:
- left_align = TRUE;
- widget = gimp_color_button_new (_("Script-Fu Color Selection"),
- COLOR_SAMPLE_WIDTH,
- COLOR_SAMPLE_HEIGHT,
- &script->arg_values[i].sfa_color,
- GIMP_COLOR_AREA_FLAT);
-
- gimp_color_button_set_update (GIMP_COLOR_BUTTON (widget), TRUE);
-
- g_signal_connect (widget, "color-changed",
- G_CALLBACK (gimp_color_button_get_color),
- &script->arg_values[i].sfa_color);
- break;
+ case SF_COLOR:
+ left_align = TRUE;
+ widget = gimp_color_button_new (_("Script-Fu Color Selection"),
+ COLOR_SAMPLE_WIDTH,
+ COLOR_SAMPLE_HEIGHT,
+ &script->arg_values[i].sfa_color,
+ GIMP_COLOR_AREA_FLAT);
+
+ gimp_color_button_set_update (GIMP_COLOR_BUTTON (widget), TRUE);
+
+ g_signal_connect (widget, "color-changed",
+ G_CALLBACK (gimp_color_button_get_color),
+ &script->arg_values[i].sfa_color);
+ break;
- case SF_TOGGLE:
- g_free (label_text);
- label_text = NULL;
- widget =
- gtk_check_button_new_with_mnemonic (gettext (script->arg_labels[i]));
- gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (widget),
- script->arg_values[i].sfa_toggle);
-
- g_signal_connect (widget, "toggled",
- G_CALLBACK (gimp_toggle_button_update),
- &script->arg_values[i].sfa_toggle);
- break;
+ case SF_TOGGLE:
+ g_free (label_text);
+ label_text = NULL;
+ widget =
+ gtk_check_button_new_with_mnemonic (gettext (script->arg_labels[i]));
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (widget),
+ script->arg_values[i].sfa_toggle);
- case SF_VALUE:
- case SF_STRING:
- widget = gtk_entry_new ();
- gtk_widget_set_size_request (widget, TEXT_WIDTH, -1);
- gtk_entry_set_activates_default (GTK_ENTRY (widget), TRUE);
+ g_signal_connect (widget, "toggled",
+ G_CALLBACK (gimp_toggle_button_update),
+ &script->arg_values[i].sfa_toggle);
+ break;
- gtk_entry_set_text (GTK_ENTRY (widget),
- script->arg_values[i].sfa_value);
- break;
+ case SF_VALUE:
+ case SF_STRING:
+ widget = gtk_entry_new ();
+ gtk_widget_set_size_request (widget, TEXT_WIDTH, -1);
+ gtk_entry_set_activates_default (GTK_ENTRY (widget), TRUE);
- case SF_TEXT:
- {
- GtkWidget *view;
- GtkTextBuffer *buffer;
+ gtk_entry_set_text (GTK_ENTRY (widget),
+ script->arg_values[i].sfa_value);
+ break;
- widget = gtk_scrolled_window_new (NULL, NULL);
- gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (widget),
- GTK_SHADOW_IN);
- gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (widget),
- GTK_POLICY_AUTOMATIC,
- GTK_POLICY_AUTOMATIC);
- gtk_widget_set_size_request (widget, TEXT_WIDTH, -1);
+ case SF_TEXT:
+ {
+ GtkWidget *view;
+ GtkTextBuffer *buffer;
- view = gtk_text_view_new ();
- gtk_container_add (GTK_CONTAINER (widget), view);
- gtk_widget_show (view);
+ widget = gtk_scrolled_window_new (NULL, NULL);
+ gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (widget),
+ GTK_SHADOW_IN);
+ gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (widget),
+ GTK_POLICY_AUTOMATIC,
+ GTK_POLICY_AUTOMATIC);
+ gtk_widget_set_size_request (widget, TEXT_WIDTH, -1);
+
+ view = gtk_text_view_new ();
+ gtk_container_add (GTK_CONTAINER (widget), view);
+ gtk_widget_show (view);
- buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (view));
- gtk_text_view_set_editable (GTK_TEXT_VIEW (view), TRUE);
+ buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (view));
+ gtk_text_view_set_editable (GTK_TEXT_VIEW (view), TRUE);
- gtk_text_buffer_set_text (buffer,
- script->arg_values[i].sfa_value, -1);
+ gtk_text_buffer_set_text (buffer,
+ script->arg_values[i].sfa_value, -1);
- label_yalign = 0.0;
- }
- break;
+ label_yalign = 0.0;
+ }
+ break;
- case SF_ADJUSTMENT:
- switch (script->arg_defaults[i].sfa_adjustment.type)
- {
- case SF_SLIDER:
- script->arg_values[i].sfa_adjustment.adj = (GtkAdjustment *)
- gimp_scale_entry_new (GTK_TABLE (sf_interface->table),
- 0, row,
- label_text, SLIDER_WIDTH, -1,
- script->arg_values[i].sfa_adjustment.value,
- script->arg_defaults[i].sfa_adjustment.lower,
- script->arg_defaults[i].sfa_adjustment.upper,
- script->arg_defaults[i].sfa_adjustment.step,
- script->arg_defaults[i].sfa_adjustment.page,
- script->arg_defaults[i].sfa_adjustment.digits,
- TRUE, 0.0, 0.0,
- NULL, NULL);
+ case SF_ADJUSTMENT:
+ switch (script->arg_defaults[i].sfa_adjustment.type)
+ {
+ case SF_SLIDER:
+ script->arg_values[i].sfa_adjustment.adj = (GtkAdjustment *)
+ gimp_scale_entry_new (GTK_TABLE (sf_interface->table),
+ 0, row,
+ label_text, SLIDER_WIDTH, -1,
+ script->arg_values[i].sfa_adjustment.value,
+ script->arg_defaults[i].sfa_adjustment.lower,
+ script->arg_defaults[i].sfa_adjustment.upper,
+ script->arg_defaults[i].sfa_adjustment.step,
+ script->arg_defaults[i].sfa_adjustment.page,
+ script->arg_defaults[i].sfa_adjustment.digits,
+ TRUE, 0.0, 0.0,
+ NULL, NULL);
gtk_entry_set_activates_default (GIMP_SCALE_ENTRY_SPINBUTTON (script->arg_values[i].sfa_adjustment.adj), TRUE);
- break;
+ break;
- default:
- g_warning ("unexpected adjustment type: %d",
- script->arg_defaults[i].sfa_adjustment.type);
- /* fallthrough */
-
- case SF_SPINNER:
- left_align = TRUE;
- widget =
- gimp_spin_button_new (&adj,
- script->arg_values[i].sfa_adjustment.value,
- script->arg_defaults[i].sfa_adjustment.lower,
- script->arg_defaults[i].sfa_adjustment.upper,
- script->arg_defaults[i].sfa_adjustment.step,
- script->arg_defaults[i].sfa_adjustment.page,
- 0, 0,
- script->arg_defaults[i].sfa_adjustment.digits);
- gtk_entry_set_activates_default (GTK_ENTRY (widget), TRUE);
- script->arg_values[i].sfa_adjustment.adj = GTK_ADJUSTMENT (adj);
- break;
- }
+ default:
+ g_warning ("unexpected adjustment type: %d",
+ script->arg_defaults[i].sfa_adjustment.type);
+ /* fallthrough */
+
+ case SF_SPINNER:
+ left_align = TRUE;
+ widget =
+ gimp_spin_button_new (&adj,
+ script->arg_values[i].sfa_adjustment.value,
+ script->arg_defaults[i].sfa_adjustment.lower,
+ script->arg_defaults[i].sfa_adjustment.upper,
+ script->arg_defaults[i].sfa_adjustment.step,
+ script->arg_defaults[i].sfa_adjustment.page,
+ 0, 0,
+ script->arg_defaults[i].sfa_adjustment.digits);
+ gtk_entry_set_activates_default (GTK_ENTRY (widget), TRUE);
+ script->arg_values[i].sfa_adjustment.adj = GTK_ADJUSTMENT (adj);
+ break;
+ }
g_signal_connect (script->arg_values[i].sfa_adjustment.adj,
"value-changed",
G_CALLBACK (gimp_double_adjustment_update),
&script->arg_values[i].sfa_adjustment.value);
- break;
+ break;
- case SF_FILENAME:
- case SF_DIRNAME:
- if (script->arg_types[i] == SF_FILENAME)
- widget = gtk_file_chooser_button_new (_("Script-Fu File Selection"),
- GTK_FILE_CHOOSER_ACTION_OPEN);
+ case SF_FILENAME:
+ case SF_DIRNAME:
+ if (script->arg_types[i] == SF_FILENAME)
+ widget = gtk_file_chooser_button_new (_("Script-Fu File Selection"),
+ GTK_FILE_CHOOSER_ACTION_OPEN);
else
widget = gtk_file_chooser_button_new (_("Script-Fu Folder Selection"),
GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER);
- if (script->arg_values[i].sfa_file.filename)
- gtk_file_chooser_set_filename (GTK_FILE_CHOOSER (widget),
+ if (script->arg_values[i].sfa_file.filename)
+ gtk_file_chooser_set_filename (GTK_FILE_CHOOSER (widget),
script->arg_values[i].sfa_file.filename);
- g_signal_connect (widget, "selection-changed",
- G_CALLBACK (script_fu_file_callback),
- &script->arg_values[i].sfa_file);
- break;
+ g_signal_connect (widget, "selection-changed",
+ G_CALLBACK (script_fu_file_callback),
+ &script->arg_values[i].sfa_file);
+ break;
- case SF_FONT:
- widget = gimp_font_select_button_new (_("Script-Fu Font Selection"),
- script->arg_values[i].sfa_font);
- g_signal_connect_swapped (widget, "font-set",
- G_CALLBACK (script_fu_font_callback),
- &script->arg_values[i].sfa_font);
- break;
+ case SF_FONT:
+ widget = gimp_font_select_button_new (_("Script-Fu Font Selection"),
+ script->arg_values[i].sfa_font);
+ g_signal_connect_swapped (widget, "font-set",
+ G_CALLBACK (script_fu_font_callback),
+ &script->arg_values[i].sfa_font);
+ break;
- case SF_PALETTE:
- widget = gimp_palette_select_button_new (_("Script-Fu Palette Selection"),
- script->arg_values[i].sfa_palette);
- g_signal_connect_swapped (widget, "palette-set",
- G_CALLBACK (script_fu_palette_callback),
- &script->arg_values[i].sfa_palette);
- break;
+ case SF_PALETTE:
+ widget = gimp_palette_select_button_new (_("Script-Fu Palette Selection"),
+ script->arg_values[i].sfa_palette);
+ g_signal_connect_swapped (widget, "palette-set",
+ G_CALLBACK (script_fu_palette_callback),
+ &script->arg_values[i].sfa_palette);
+ break;
- case SF_PATTERN:
- left_align = TRUE;
- widget = gimp_pattern_select_button_new (_("Script-Fu Pattern Selection"),
- script->arg_values[i].sfa_pattern);
- g_signal_connect_swapped (widget, "pattern-set",
- G_CALLBACK (script_fu_pattern_callback),
- &script->arg_values[i].sfa_pattern);
- break;
+ case SF_PATTERN:
+ left_align = TRUE;
+ widget = gimp_pattern_select_button_new (_("Script-Fu Pattern Selection"),
+ script->arg_values[i].sfa_pattern);
+ g_signal_connect_swapped (widget, "pattern-set",
+ G_CALLBACK (script_fu_pattern_callback),
+ &script->arg_values[i].sfa_pattern);
+ break;
- case SF_GRADIENT:
- left_align = TRUE;
- widget = gimp_gradient_select_button_new (_("Script-Fu Gradient Selection"),
- script->arg_values[i].sfa_gradient);
- g_signal_connect_swapped (widget, "gradient-set",
- G_CALLBACK (script_fu_gradient_callback),
- &script->arg_values[i].sfa_gradient);
- break;
+ case SF_GRADIENT:
+ left_align = TRUE;
+ widget = gimp_gradient_select_button_new (_("Script-Fu Gradient Selection"),
+ script->arg_values[i].sfa_gradient);
+ g_signal_connect_swapped (widget, "gradient-set",
+ G_CALLBACK (script_fu_gradient_callback),
+ &script->arg_values[i].sfa_gradient);
+ break;
- case SF_BRUSH:
- left_align = TRUE;
- widget = gimp_brush_select_button_new (_("Script-Fu Brush Selection"),
- script->arg_values[i].sfa_brush.name,
- script->arg_values[i].sfa_brush.opacity,
- script->arg_values[i].sfa_brush.spacing,
- script->arg_values[i].sfa_brush.paint_mode);
- g_signal_connect_swapped (widget, "brush-set",
- G_CALLBACK (script_fu_brush_callback),
- &script->arg_values[i].sfa_brush);
- break;
+ case SF_BRUSH:
+ left_align = TRUE;
+ widget = gimp_brush_select_button_new (_("Script-Fu Brush Selection"),
+ script->arg_values[i].sfa_brush.name,
+ script->arg_values[i].sfa_brush.opacity,
+ script->arg_values[i].sfa_brush.spacing,
+ script->arg_values[i].sfa_brush.paint_mode);
+ g_signal_connect_swapped (widget, "brush-set",
+ G_CALLBACK (script_fu_brush_callback),
+ &script->arg_values[i].sfa_brush);
+ break;
- case SF_OPTION:
- widget = gtk_combo_box_new_text ();
- for (list = script->arg_defaults[i].sfa_option.list;
- list;
- list = g_slist_next (list))
- {
- gtk_combo_box_append_text (GTK_COMBO_BOX (widget),
- gettext ((const gchar *) list->data));
- }
+ case SF_OPTION:
+ widget = gtk_combo_box_new_text ();
+ for (list = script->arg_defaults[i].sfa_option.list;
+ list;
+ list = g_slist_next (list))
+ {
+ gtk_combo_box_append_text (GTK_COMBO_BOX (widget),
+ gettext ((const gchar *) list->data));
+ }
- gtk_combo_box_set_active (GTK_COMBO_BOX (widget),
- script->arg_values[i].sfa_option.history);
+ gtk_combo_box_set_active (GTK_COMBO_BOX (widget),
+ script->arg_values[i].sfa_option.history);
- g_signal_connect (widget, "changed",
- G_CALLBACK (script_fu_combo_callback),
- &script->arg_values[i].sfa_option);
- break;
+ g_signal_connect (widget, "changed",
+ G_CALLBACK (script_fu_combo_callback),
+ &script->arg_values[i].sfa_option);
+ break;
- case SF_ENUM:
- widget = gimp_enum_combo_box_new (g_type_from_name (script->arg_defaults[i].sfa_enum.type_name));
+ case SF_ENUM:
+ widget = gimp_enum_combo_box_new (g_type_from_name (script->arg_defaults[i].sfa_enum.type_name));
- gimp_int_combo_box_set_active (GIMP_INT_COMBO_BOX (widget),
- script->arg_values[i].sfa_enum.history);
+ gimp_int_combo_box_set_active (GIMP_INT_COMBO_BOX (widget),
+ script->arg_values[i].sfa_enum.history);
- g_signal_connect (widget, "changed",
- G_CALLBACK (gimp_int_combo_box_get_active),
- &script->arg_values[i].sfa_enum.history);
- break;
+ g_signal_connect (widget, "changed",
+ G_CALLBACK (gimp_int_combo_box_get_active),
+ &script->arg_values[i].sfa_enum.history);
+ break;
- case SF_DISPLAY:
- break;
- }
+ case SF_DISPLAY:
+ break;
+ }
if (widget)
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]