static GtkWidget * gimp_airbrush_options_gui (GimpToolOptions *tool_options) { GObject *config = G_OBJECT (tool_options); GtkWidget *vbox = gimp_paint_options_gui (tool_options); GtkWidget *table; table = gtk_table_new (2, 3, FALSE); gtk_table_set_col_spacing (GTK_TABLE (table), 0, 2); gtk_box_pack_start (GTK_BOX (vbox), table, FALSE, FALSE, 0); gtk_widget_show (table); gimp_prop_scale_entry_new (config, "rate", GTK_TABLE (table), 0, 0, _("Rate:"), 1.0, 1.0, 1, FALSE, 0.0, 0.0); gimp_prop_scale_entry_new (config, "pressure", GTK_TABLE (table), 0, 1, _("Pressure:"), 1.0, 1.0, 1, FALSE, 0.0, 0.0); return vbox; }
static GtkWidget * gimp_dodge_burn_options_gui (GimpToolOptions *tool_options) { GObject *config = G_OBJECT (tool_options); GtkWidget *vbox = gimp_paint_options_gui (tool_options); GtkWidget *table; GtkWidget *frame; gchar *str; /* the type (dodge or burn) */ str = g_strdup_printf (_("Type (%s)"), gimp_get_mod_string (GDK_CONTROL_MASK)); frame = gimp_prop_enum_radio_frame_new (config, "type", str, 0, 0); gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, 0); gtk_widget_show (frame); g_free (str); /* mode (highlights, midtones, or shadows) */ frame = gimp_prop_enum_radio_frame_new (config, "mode", _("Range"), 0, 0); gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, 0); gtk_widget_show (frame); /* the exposure scale */ table = gtk_table_new (1, 3, FALSE); gtk_table_set_col_spacings (GTK_TABLE (table), 2); gtk_box_pack_start (GTK_BOX (vbox), table, FALSE, FALSE, 0); gtk_widget_show (table); gimp_prop_scale_entry_new (config, "exposure", GTK_TABLE (table), 0, 0, _("Exposure:"), 1.0, 10.0, 1, FALSE, 0.0, 0.0); return vbox; }
GtkWidget * gimp_transform_options_gui (GimpToolOptions *tool_options) { GObject *config = G_OBJECT (tool_options); GimpTransformOptions *options = GIMP_TRANSFORM_OPTIONS (tool_options); GtkWidget *vbox = gimp_tool_options_gui (tool_options); GtkWidget *hbox; GtkWidget *label; GtkWidget *frame; GtkWidget *table; GtkWidget *combo; GtkWidget *button; const gchar *constrain = NULL; hbox = gimp_prop_enum_stock_box_new (config, "type", "gimp", 0, 0); gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0); gtk_widget_show (hbox); label = gtk_label_new (_("Transform:")); gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0); gtk_box_reorder_child (GTK_BOX (hbox), label, 0); gtk_widget_show (label); frame = gimp_prop_enum_radio_frame_new (config, "direction", _("Direction"), 0, 0); gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, 0); gtk_widget_show (frame); /* the interpolation menu */ frame = gimp_frame_new (_("Interpolation:")); gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, 0); gtk_widget_show (frame); combo = gimp_prop_enum_combo_box_new (config, "interpolation", 0, 0); gtk_container_add (GTK_CONTAINER (frame), combo); gtk_widget_show (combo); /* the clipping menu */ hbox = gtk_hbox_new (FALSE, 2); gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0); gtk_widget_show (hbox); frame = gimp_frame_new (_("Clipping:")); gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, 0); gtk_widget_show (frame); combo = gimp_prop_enum_combo_box_new (config, "clip", 0, 0); gtk_container_add (GTK_CONTAINER (frame), combo); gtk_widget_show (combo); /* the preview frame */ frame = gimp_frame_new (NULL); gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, 0); gtk_widget_show (frame); /* the preview type menu */ hbox = gtk_hbox_new (FALSE, 2); gtk_frame_set_label_widget (GTK_FRAME (frame), hbox); gtk_widget_show (hbox); label = gtk_label_new (_("Preview:")); gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0); gtk_widget_show (label); combo = gimp_prop_enum_combo_box_new (config, "preview-type", 0, 0); gtk_box_pack_start (GTK_BOX (hbox), combo, TRUE, TRUE, 0); gtk_widget_show (combo); /* the grid type menu */ button = gtk_vbox_new (FALSE, 6); gtk_container_add (GTK_CONTAINER (frame), button); gtk_widget_show (button); combo = gimp_prop_enum_combo_box_new (config, "grid-type", 0, 0); gtk_box_pack_start (GTK_BOX (button), combo, FALSE, FALSE, 0); gtk_widget_show (combo); /* the grid density scale */ table = gtk_table_new (1, 3, FALSE); gtk_table_set_col_spacing (GTK_TABLE (table), 1, 2); gtk_box_pack_start (GTK_BOX (button), table, FALSE, FALSE, 0); gtk_widget_show (table); gtk_widget_set_sensitive (button, options->preview_type == GIMP_TRANSFORM_PREVIEW_TYPE_GRID || options->preview_type == GIMP_TRANSFORM_PREVIEW_TYPE_IMAGE_GRID); g_signal_connect (config, "notify::preview-type", G_CALLBACK (gimp_transform_options_preview_notify), button); gimp_prop_scale_entry_new (config, "grid-size", GTK_TABLE (table), 0, 0, NULL, 1.0, 8.0, 0, FALSE, 0.0, 0.0); if (tool_options->tool_info->tool_type == GIMP_TYPE_ROTATE_TOOL) { constrain = (_("15 degrees (%s)")); } else if (tool_options->tool_info->tool_type == GIMP_TYPE_SCALE_TOOL) { constrain = (_("Keep aspect (%s)")); } if (constrain) { gchar *label = g_strdup_printf (constrain, gimp_get_mod_string (GDK_CONTROL_MASK)); button = gimp_prop_check_button_new (config, "constrain", label); gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0); gtk_widget_show (button); g_free (label); } return vbox; }
GtkWidget * gimp_blend_options_gui (GimpToolOptions *tool_options) { GObject *config = G_OBJECT (tool_options); GtkWidget *vbox = gimp_paint_options_gui (tool_options); GtkWidget *table; GtkWidget *frame; GtkWidget *combo; GtkWidget *button; table = g_object_get_data (G_OBJECT (vbox), GIMP_PAINT_OPTIONS_TABLE_KEY); /* the gradient */ button = gimp_prop_gradient_box_new (NULL, GIMP_CONTEXT (tool_options), 2, "gradient-view-type", "gradient-view-size", "gradient-reverse"); gimp_table_attach_aligned (GTK_TABLE (table), 0, 2, _("Gradient:"), 0.0, 0.5, button, 2, TRUE); /* the offset scale */ gimp_prop_scale_entry_new (config, "offset", GTK_TABLE (table), 0, 3, _("Offset:"), 1.0, 10.0, 1, FALSE, 0.0, 0.0); /* the gradient type menu */ combo = gimp_prop_enum_combo_box_new (config, "gradient-type", 0, 0); g_object_set (combo, "ellipsize", PANGO_ELLIPSIZE_END, NULL); gimp_enum_combo_box_set_stock_prefix (GIMP_ENUM_COMBO_BOX (combo), "gimp-gradient"); gimp_table_attach_aligned (GTK_TABLE (table), 0, 4, _("Shape:"), 0.0, 0.5, combo, 2, FALSE); /* the repeat option */ combo = gimp_prop_enum_combo_box_new (config, "gradient-repeat", 0, 0); g_object_set (combo, "ellipsize", PANGO_ELLIPSIZE_END, NULL); gimp_table_attach_aligned (GTK_TABLE (table), 0, 5, _("Repeat:"), 0.0, 0.5, combo, 2, FALSE); g_signal_connect (config, "notify::gradient-type", G_CALLBACK (blend_options_gradient_type_notify), combo); button = gimp_prop_check_button_new (config, "dither", _("Dithering")); gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0); gtk_widget_show (button); /* supersampling options */ table = gtk_table_new (2, 3, FALSE); gtk_table_set_col_spacings (GTK_TABLE (table), 2); gtk_table_set_row_spacings (GTK_TABLE (table), 1); frame = gimp_prop_expanding_frame_new (config, "supersample", _("Adaptive supersampling"), table, NULL); gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, 0); gtk_widget_show (frame); /* max depth scale */ gimp_prop_scale_entry_new (config, "supersample-depth", GTK_TABLE (table), 0, 0, _("Max depth:"), 1.0, 1.0, 0, FALSE, 0.0, 0.0); /* threshold scale */ gimp_prop_scale_entry_new (config, "supersample-threshold", GTK_TABLE (table), 0, 1, _("Threshold:"), 0.01, 0.1, 2, FALSE, 0.0, 0.0); return vbox; }
GtkWidget * gimp_ink_options_gui (GimpToolOptions *tool_options) { GObject *config = G_OBJECT (tool_options); GimpInkOptions *ink_options = GIMP_INK_OPTIONS (tool_options); GtkWidget *vbox = gimp_paint_options_gui (tool_options); GtkWidget *frame; GtkWidget *table; GtkWidget *blob_vbox; GtkWidget *hbox; GtkWidget *editor; GtkObject *adj; /* adjust sliders */ frame = gimp_frame_new (_("Adjustment")); gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, TRUE, 0); gtk_widget_show (frame); table = gtk_table_new (2, 3, FALSE); gtk_table_set_col_spacings (GTK_TABLE (table), 2); gtk_container_add (GTK_CONTAINER (frame), table); gtk_widget_show (table); /* size slider */ adj = gimp_prop_scale_entry_new (config, "size", GTK_TABLE (table), 0, 0, _("Size:"), 1.0, 2.0, 1, FALSE, 0.0, 0.0); gimp_scale_entry_set_logarithmic (adj, TRUE); /* angle adjust slider */ gimp_prop_scale_entry_new (config, "tilt-angle", GTK_TABLE (table), 0, 1, _("Angle:"), 1.0, 10.0, 1, FALSE, 0.0, 0.0); /* sens sliders */ frame = gimp_frame_new (_("Sensitivity")); gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, TRUE, 0); gtk_widget_show (frame); table = gtk_table_new (3, 3, FALSE); gtk_table_set_col_spacings (GTK_TABLE (table), 2); gtk_container_add (GTK_CONTAINER (frame), table); gtk_widget_show (table); /* size sens slider */ gimp_prop_scale_entry_new (config, "size-sensitivity", GTK_TABLE (table), 0, 0, _("Size:"), 0.01, 0.1, 1, FALSE, 0.0, 0.0); /* tilt sens slider */ gimp_prop_scale_entry_new (config, "tilt-sensitivity", GTK_TABLE (table), 0, 1, _("Tilt:"), 0.01, 0.1, 1, FALSE, 0.0, 0.0); /* velocity sens slider */ gimp_prop_scale_entry_new (config, "vel-sensitivity", GTK_TABLE (table), 0, 2, _("Speed:"), 0.01, 0.1, 1, FALSE, 0.0, 0.0); /* bottom hbox */ hbox = gtk_hbox_new (FALSE, 2); gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0); gtk_widget_show (hbox); /* Blob type radiobuttons */ frame = gimp_prop_enum_radio_frame_new (config, "blob-type", _("Type"), 0, 0); gtk_box_pack_start (GTK_BOX (hbox), frame, TRUE, TRUE, 0); gtk_widget_show (frame); { GtkWidget *frame_child = gtk_bin_get_child (GTK_BIN (frame)); GList *children; GList *list; GimpInkBlobType blob_type; children = gtk_container_get_children (GTK_CONTAINER (frame_child)); for (list = children, blob_type = GIMP_INK_BLOB_TYPE_ELLIPSE; list; list = g_list_next (list), blob_type++) { GtkWidget *radio = GTK_WIDGET (list->data); GtkWidget *blob; gtk_container_remove (GTK_CONTAINER (radio), gtk_bin_get_child (GTK_BIN (radio))); blob = blob_image_new (blob_type); gtk_container_add (GTK_CONTAINER (radio), blob); gtk_widget_show (blob); } g_list_free (children); } /* Blob shape widget */ frame = gimp_frame_new (_("Shape")); gtk_box_pack_start (GTK_BOX (hbox), frame, TRUE, TRUE, 0); gtk_widget_show (frame); blob_vbox = gtk_vbox_new (FALSE, 2); gtk_container_add (GTK_CONTAINER (frame), blob_vbox); gtk_widget_show (blob_vbox); frame = gtk_aspect_frame_new (NULL, 0.0, 0.5, 1.0, FALSE); gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_IN); gtk_box_pack_start (GTK_BOX (blob_vbox), frame, TRUE, TRUE, 0); gtk_widget_show (frame); editor = gimp_blob_editor_new (ink_options->blob_type, ink_options->blob_aspect, ink_options->blob_angle); gtk_widget_set_size_request (editor, 60, 60); gtk_container_add (GTK_CONTAINER (frame), editor); gtk_widget_show (editor); gimp_config_connect (config, G_OBJECT (editor), NULL); return vbox; }
GtkWidget * gimp_foreground_select_options_gui (GimpToolOptions *tool_options) { GObject *config = G_OBJECT (tool_options); GtkWidget *vbox = gimp_selection_options_gui (tool_options); GtkWidget *hbox; GtkWidget *button; GtkWidget *frame; GtkWidget *scale; GtkWidget *combo; GtkWidget *table; gchar *title; gint row = 0; GimpForegroundSelectOptions *options = GIMP_FOREGROUND_SELECT_OPTIONS (config); frame = gimp_prop_enum_radio_frame_new (config, "draw-mode", title, 0,0); gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, 0); gtk_widget_show (frame); hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 2); gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0); gtk_widget_show (hbox); /* stroke width */ scale = gimp_prop_spin_scale_new (config, "stroke-width", _("Stroke width"), 1.0, 10.0, 2); gimp_spin_scale_set_scale_limits (GIMP_SPIN_SCALE (scale), 1.0, 1000.0); gimp_spin_scale_set_gamma (GIMP_SPIN_SCALE (scale), 1.7); gtk_box_pack_start (GTK_BOX (hbox), scale, TRUE, TRUE, 0); gtk_widget_show (scale); button = gimp_stock_button_new (GIMP_STOCK_RESET, NULL); gtk_button_set_relief (GTK_BUTTON (button), GTK_RELIEF_NONE); gtk_image_set_from_stock (GTK_IMAGE (gtk_bin_get_child (GTK_BIN (button))), GIMP_STOCK_RESET, GTK_ICON_SIZE_MENU); gtk_box_pack_start (GTK_BOX (hbox), button, FALSE, FALSE, 0); gtk_widget_show (button); g_signal_connect (button, "clicked", G_CALLBACK (gimp_foreground_select_options_gui_reset_stroke_width), tool_options); gimp_help_set_help_data (button, _("Reset stroke width native size"), NULL); /* mask color */ frame = gimp_frame_new (_("Preview color:")); gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, 0); gtk_widget_show (frame); combo = gimp_prop_enum_combo_box_new (config, "mask-color", GIMP_RED_CHANNEL, GIMP_GRAY_CHANNEL); gtk_container_add (GTK_CONTAINER (frame), combo); gtk_widget_show (combo); /* engine */ frame = gimp_frame_new (_("Engine:")); gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, 0); gtk_widget_show (frame); combo = gimp_prop_enum_combo_box_new (config, "engine", 0, 0); gtk_container_add (GTK_CONTAINER (frame), combo); gtk_widget_show (combo); /* parameters */ table = gtk_table_new (3, 3, FALSE); gtk_table_set_col_spacings (GTK_TABLE (table), 2); gtk_table_set_row_spacings (GTK_TABLE (table), 2); gtk_box_pack_start (GTK_BOX (vbox), table, FALSE, FALSE, 0); gtk_widget_show (table); options->dynamic_widgets.levels = gimp_prop_scale_entry_new (config, "levels", GTK_TABLE (table), 0, row++, "Levels", 1, 1, 0, FALSE, 0, 0); options->dynamic_widgets.active_levels = gimp_prop_scale_entry_new (config, "active-levels", GTK_TABLE (table), 0, row++, "Act. Levels", 1, 1, 0, FALSE, 0, 0); options->dynamic_widgets.iterations = gimp_prop_scale_entry_new (config, "iterations", GTK_TABLE (table), 0, row++, "Iterations", 1, 1, 0, FALSE, 0, 0); g_signal_connect_object (config, "notify::engine", G_CALLBACK (gimp_foreground_select_notify_engine), NULL, 0); gimp_foreground_select_notify_engine(tool_options,NULL,NULL); return vbox; }