GtkWidget *
gimp_iscissors_options_gui (GimpToolOptions *tool_options)
{
  GObject   *config  = G_OBJECT (tool_options);
  GtkWidget *vbox    = gimp_selection_options_gui (tool_options);
  GtkWidget *button;

  button = gimp_prop_check_button_new (config, "interactive",
                                       _("Interactive boundary"));
  gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0);
  gtk_widget_show (button);

  return vbox;
}
Exemple #2
0
GtkWidget *
gimp_region_select_options_gui (GimpToolOptions *tool_options)
{
    GObject   *config  = G_OBJECT (tool_options);
    GtkWidget *vbox    = gimp_selection_options_gui (tool_options);
    GtkWidget *button;
    GtkWidget *scale;
    GtkWidget *combo;
    GType      tool_type;

    tool_type = tool_options->tool_info->tool_type;

    /*  the select transparent areas toggle  */
    button = gimp_prop_check_button_new (config, "select-transparent", NULL);
    gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0);
    gtk_widget_show (button);

    /*  the sample merged toggle  */
    button = gimp_prop_check_button_new (config, "sample-merged", NULL);
    gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0);
    gtk_widget_show (button);

    /*  the diagonal neighbors toggle  */
    if (tool_type == GIMP_TYPE_FUZZY_SELECT_TOOL)
    {
        button = gimp_prop_check_button_new (config, "diagonal-neighbors", NULL);
        gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0);
        gtk_widget_show (button);
    }

    /*  the threshold scale  */
    scale = gimp_prop_spin_scale_new (config, "threshold", NULL,
                                      1.0, 16.0, 1);
    gtk_box_pack_start (GTK_BOX (vbox), scale, FALSE, FALSE, 0);
    gtk_widget_show (scale);

    /*  the select criterion combo  */
    combo = gimp_prop_enum_combo_box_new (config, "select-criterion", 0, 0);
    gimp_int_combo_box_set_label (GIMP_INT_COMBO_BOX (combo), _("Select by"));
    gtk_box_pack_start (GTK_BOX (vbox), combo, TRUE, TRUE, 0);
    gtk_widget_show (combo);

    /*  the show mask toggle  */
    button = gimp_prop_check_button_new (config, "draw-mask", NULL);
    gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0);
    gtk_widget_show (button);

    return vbox;
}
GtkWidget *
gimp_region_select_options_gui (GimpToolOptions *tool_options)
{
  GObject   *config  = G_OBJECT (tool_options);
  GtkWidget *vbox    = gimp_selection_options_gui (tool_options);
  GtkWidget *button;
  GtkWidget *table;
  GtkWidget *scale;
  GtkWidget *combo;

  /*  the select transparent areas toggle  */
  button = gimp_prop_check_button_new (config, "select-transparent",
                                       _("Select transparent areas"));
  gtk_box_pack_start (GTK_BOX (vbox), 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 (vbox), 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 (vbox), scale, FALSE, FALSE, 0);
  gtk_widget_show (scale);

  /*  the select criterion combo  */
  table = gtk_table_new (1, 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);

  combo = gimp_prop_enum_combo_box_new (config, "select-criterion", 0, 0);
  gimp_table_attach_aligned (GTK_TABLE (table), 0, 1,
                             _("Select by:"), 0.0, 0.5,
                             combo, 2, FALSE);

  return vbox;
}
GtkWidget *
gimp_region_select_options_gui (GimpToolOptions *tool_options)
{
  GObject   *config  = G_OBJECT (tool_options);
  GtkWidget *vbox    = gimp_selection_options_gui (tool_options);
  GtkWidget *button;
  GtkWidget *scale;
  GtkWidget *combo;

  /*  the select transparent areas toggle  */
  button = gimp_prop_check_button_new (config, "select-transparent",
                                       _("Select transparent areas"));
  gtk_box_pack_start (GTK_BOX (vbox), 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 (vbox), 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 (vbox), scale, FALSE, FALSE, 0);
  gtk_widget_show (scale);

  /*  the select criterion combo  */
  combo = gimp_prop_enum_combo_box_new (config, "select-criterion", 0, 0);
  gimp_int_combo_box_set_label (GIMP_INT_COMBO_BOX (combo), _("Select by"));
  gtk_box_pack_start (GTK_BOX (vbox), combo, TRUE, TRUE, 0);
  gtk_widget_show (combo);

  /*  the show mask toggle  */
  button = gimp_prop_check_button_new (config, "draw-mask",
                                       _("Draw Mask"));
  gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0);
  gtk_widget_show (button);

  return vbox;
}
GtkWidget *
gimp_rectangle_select_options_gui (GimpToolOptions *tool_options)
{
  GObject   *config = G_OBJECT (tool_options);
  GtkWidget *vbox   = gimp_selection_options_gui (tool_options);

  /*  the round corners frame  */
  if (tool_options->tool_info->tool_type == GIMP_TYPE_RECTANGLE_SELECT_TOOL)
    {
      GtkWidget *frame;
      GtkWidget *scale;
      GtkWidget *toggle;

      scale = gimp_prop_spin_scale_new (config, "corner-radius",
                                        _("Radius"),
                                        1.0, 10.0, 1);

      frame = gimp_prop_expanding_frame_new (config, "round-corners",
                                             _("Rounded corners"),
                                             scale, NULL);
      gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, 0);
      gtk_widget_show (frame);

      toggle = GIMP_SELECTION_OPTIONS (tool_options)->antialias_toggle;

      g_object_bind_property (config, "round-corners",
                              toggle, "sensitive",
                              G_BINDING_SYNC_CREATE);
    }

  /*  the rectangle options  */
  {
    GtkWidget *vbox_rectangle;

    vbox_rectangle = gimp_rectangle_options_gui (tool_options);
    gtk_box_pack_start (GTK_BOX (vbox), vbox_rectangle, FALSE, FALSE, 0);
    gtk_widget_show (vbox_rectangle);
  }

  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;
}