GtkWidget * gimp_clone_options_gui (GimpToolOptions *tool_options) { GObject *config = G_OBJECT (tool_options); GtkWidget *vbox = gimp_paint_options_gui (tool_options); GtkWidget *frame; GtkWidget *combo; GtkWidget *source_vbox; GtkWidget *button; GtkWidget *hbox; /* the source frame */ frame = gimp_frame_new (NULL); gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, 0); gtk_widget_show (frame); /* the source type menu */ combo = gimp_prop_enum_combo_box_new (config, "clone-type", 0, 0); gimp_int_combo_box_set_label (GIMP_INT_COMBO_BOX (combo), _("Source")); g_object_set (combo, "ellipsize", PANGO_ELLIPSIZE_END, NULL); gtk_frame_set_label_widget (GTK_FRAME (frame), combo); gtk_widget_show (combo); source_vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0); gtk_container_add (GTK_CONTAINER (frame), source_vbox); gtk_widget_show (source_vbox); button = gimp_prop_check_button_new (config, "sample-merged", NULL); gtk_box_pack_start (GTK_BOX (source_vbox), button, FALSE, FALSE, 0); g_object_bind_property_full (config, "clone-type", button, "visible", G_BINDING_SYNC_CREATE, gimp_clone_options_sync_source, NULL, GINT_TO_POINTER (GIMP_CLONE_IMAGE), NULL); hbox = gimp_prop_pattern_box_new (NULL, GIMP_CONTEXT (tool_options), NULL, 2, "pattern-view-type", "pattern-view-size"); gtk_box_pack_start (GTK_BOX (source_vbox), hbox, FALSE, FALSE, 0); g_object_bind_property_full (config, "clone-type", hbox, "visible", G_BINDING_SYNC_CREATE, gimp_clone_options_sync_source, NULL, GINT_TO_POINTER (GIMP_CLONE_PATTERN), NULL); combo = gimp_prop_enum_combo_box_new (config, "align-mode", 0, 0); gimp_int_combo_box_set_label (GIMP_INT_COMBO_BOX (combo), _("Alignment")); g_object_set (combo, "ellipsize", PANGO_ELLIPSIZE_END, NULL); gtk_box_pack_start (GTK_BOX (vbox), combo, TRUE, TRUE, 0); gtk_widget_show (combo); return vbox; }
static GtkWidget * gimp_perspective_clone_options_gui (GimpToolOptions *tool_options) { GObject *config = G_OBJECT (tool_options); GtkWidget *vbox; GtkWidget *paint_options; GtkWidget *frame; GtkWidget *mode; GtkWidget *button; GtkWidget *hbox; GtkWidget *label; GtkWidget *combo; vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 6); paint_options = gimp_paint_options_gui (tool_options); /* radio buttons to set if you are modifying perspe plane or painting */ mode = gimp_prop_enum_radio_box_new (config, "clone-mode", 0, 0); gtk_box_pack_start (GTK_BOX (vbox), mode, FALSE, FALSE, 0); gtk_widget_show (mode); gtk_box_pack_start (GTK_BOX (vbox), paint_options, FALSE, FALSE, 0); gtk_widget_show (paint_options); frame = gimp_prop_enum_radio_frame_new (config, "clone-type", _("Source"), 0, 0); gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, 0); gtk_widget_show (frame); button = gimp_prop_check_button_new (config, "sample-merged", _("Sample merged")); gimp_enum_radio_frame_add (GTK_FRAME (frame), button, GIMP_IMAGE_CLONE, TRUE); hbox = gimp_prop_pattern_box_new (NULL, GIMP_CONTEXT (tool_options), NULL, 2, "pattern-view-type", "pattern-view-size"); gimp_enum_radio_frame_add (GTK_FRAME (frame), hbox, GIMP_PATTERN_CLONE, TRUE); hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 2); gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0); gtk_widget_show (hbox); label = gtk_label_new (_("Alignment:")); gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0); gtk_widget_show (label); combo = gimp_prop_enum_combo_box_new (config, "align-mode", 0, 0); gtk_box_pack_start (GTK_BOX (hbox), combo, TRUE, TRUE, 0); gtk_widget_show (combo); return vbox; }
static GtkWidget * gimp_clone_options_gui (GimpToolOptions *tool_options) { GObject *config = G_OBJECT (tool_options); GtkWidget *vbox = gimp_paint_options_gui (tool_options); GtkWidget *frame; GtkWidget *button; GtkWidget *hbox; GtkWidget *table; GtkWidget *combo; frame = gimp_prop_enum_radio_frame_new (config, "clone-type", _("Source"), 0, 0); gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, 0); gtk_widget_show (frame); button = gimp_prop_check_button_new (config, "sample-merged", _("Sample merged")); gimp_enum_radio_frame_add (GTK_FRAME (frame), button, GIMP_IMAGE_CLONE, TRUE); hbox = gimp_prop_pattern_box_new (NULL, GIMP_CONTEXT (tool_options), NULL, 2, "pattern-view-type", "pattern-view-size"); gimp_enum_radio_frame_add (GTK_FRAME (frame), hbox, GIMP_PATTERN_CLONE, TRUE); table = gtk_table_new (1, 2, 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); combo = gimp_prop_enum_combo_box_new (config, "align-mode", 0, 0); gimp_table_attach_aligned (GTK_TABLE (table), 0, 0, _("Alignment:"), 0.0, 0.5, combo, 1, FALSE); return vbox; }
GtkWidget * gimp_bucket_fill_options_gui (GimpToolOptions *tool_options) { GObject *config = G_OBJECT (tool_options); GtkWidget *vbox = gimp_paint_options_gui (tool_options); GtkWidget *vbox2; GtkWidget *frame; GtkWidget *hbox; GtkWidget *button; GtkWidget *scale; GtkWidget *combo; gchar *str; GdkModifierType toggle_mask; toggle_mask = gimp_get_toggle_behavior_mask (); /* fill type */ str = g_strdup_printf (_("Fill Type (%s)"), gimp_get_mod_string (toggle_mask)), frame = gimp_prop_enum_radio_frame_new (config, "fill-mode", str, 0, 0); g_free (str); gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, 0); gtk_widget_show (frame); hbox = gimp_prop_pattern_box_new (NULL, GIMP_CONTEXT (tool_options), NULL, 2, "pattern-view-type", "pattern-view-size"); gimp_enum_radio_frame_add (GTK_FRAME (frame), hbox, GIMP_PATTERN_BUCKET_FILL, TRUE); /* fill selection */ str = g_strdup_printf (_("Affected Area (%s)"), gimp_get_mod_string (GDK_SHIFT_MASK)); frame = gimp_prop_boolean_radio_frame_new (config, "fill-selection", str, _("Fill whole selection"), _("Fill similar colors")); g_free (str); gtk_box_reorder_child (GTK_BOX (gtk_bin_get_child (GTK_BIN (frame))), g_object_get_data (G_OBJECT (frame), "radio-button"), 1); gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, 0); gtk_widget_show (frame); frame = gimp_frame_new (_("Finding Similar Colors")); gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, 0); gtk_widget_show (frame); g_object_bind_property (config, "fill-selection", frame, "sensitive", G_BINDING_SYNC_CREATE | G_BINDING_INVERT_BOOLEAN); vbox2 = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0); gtk_container_add (GTK_CONTAINER (frame), vbox2); gtk_widget_show (vbox2); /* the fill transparent areas toggle */ button = gimp_prop_check_button_new (config, "fill-transparent", _("Fill transparent areas")); gtk_box_pack_start (GTK_BOX (vbox2), button, FALSE, FALSE, 0); gtk_widget_show (button); /* the sample merged toggle */ button = gimp_prop_check_button_new (config, "sample-merged", _("Sample merged")); gtk_box_pack_start (GTK_BOX (vbox2), button, FALSE, FALSE, 0); gtk_widget_show (button); /* the threshold scale */ scale = gimp_prop_spin_scale_new (config, "threshold", _("Threshold"), 1.0, 16.0, 1); gtk_box_pack_start (GTK_BOX (vbox2), scale, FALSE, FALSE, 0); gtk_widget_show (scale); /* the fill criterion combo */ combo = gimp_prop_enum_combo_box_new (config, "fill-criterion", 0, 0); gimp_int_combo_box_set_label (GIMP_INT_COMBO_BOX (combo), _("Fill by")); gtk_box_pack_start (GTK_BOX (vbox2), combo, FALSE, FALSE, 0); gtk_widget_show (combo); return vbox; }