예제 #1
0
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;
}
예제 #2
0
static gboolean
gimp_levels_tool_initialize (GimpTool     *tool,
                             GimpDisplay  *display,
                             GError      **error)
{
  GimpLevelsTool *l_tool   = GIMP_LEVELS_TOOL (tool);
  GimpDrawable   *drawable = gimp_image_get_active_drawable (display->image);

  if (! drawable)
    return FALSE;

  if (gimp_drawable_is_indexed (drawable))
    {
      g_set_error (error, 0, 0,
                   _("Levels does not operate on indexed layers."));
      return FALSE;
    }

  if (! l_tool->hist)
    l_tool->hist = gimp_histogram_new ();

  levels_init (l_tool->levels);

  l_tool->channel = GIMP_HISTOGRAM_VALUE;
  l_tool->color   = gimp_drawable_is_rgb (drawable);
  l_tool->alpha   = gimp_drawable_has_alpha (drawable);

  if (l_tool->active_picker)
    gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (l_tool->active_picker),
                                  FALSE);

  GIMP_TOOL_CLASS (parent_class)->initialize (tool, display, error);

  gimp_int_combo_box_set_sensitivity (GIMP_INT_COMBO_BOX (l_tool->channel_menu),
                                      levels_menu_sensitivity, l_tool, NULL);

  gimp_int_combo_box_set_active (GIMP_INT_COMBO_BOX (l_tool->channel_menu),
                                 l_tool->channel);

  /* FIXME: hack */
  if (! l_tool->color)
    l_tool->channel = (l_tool->channel == GIMP_HISTOGRAM_ALPHA) ? 1 : 0;

  levels_update (l_tool, ALL);

  gimp_drawable_calculate_histogram (drawable, l_tool->hist);
  gimp_histogram_view_set_histogram (GIMP_HISTOGRAM_VIEW (l_tool->hist_view),
                                     l_tool->hist);

  return TRUE;
}
예제 #3
0
static void
save_dialog_version_changed (GtkComboBox *widget, SaveInfo *info)
{
    gint version;
    gimp_int_combo_box_get_active (GIMP_INT_COMBO_BOX (widget), &version);

    if (version >= 3) {
        g_object_set (G_OBJECT (info->ctl_lowres),
                      "sensitive", TRUE,
                      "active", info->lowres,
                      NULL);
        g_object_set (G_OBJECT (info->ctl_crc),
                      "sensitive", TRUE,
                      "active", info->crc,
                      NULL);
    } else {
        g_object_set (G_OBJECT (info->ctl_lowres),
                      "sensitive", FALSE,
                      "active", TRUE,
                      NULL);
        g_object_set (G_OBJECT (info->ctl_crc),
                      "sensitive", FALSE,
                      "active", FALSE,
                      NULL);
    }
}
예제 #4
0
파일: widgets.c 프로젝트: LebedevRI/gimp
static WidgetInfo *
create_int_combo_box (void)
{
  GtkWidget *vbox;
  GtkWidget *combo;
  GtkWidget *align;

  vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 6);
  align = gtk_alignment_new (0.5, 0.5, 0.5, 0.0);
  combo = gimp_int_combo_box_new ("Sobel",        1,
                                  "Prewitt",      2,
                                  "Gradient",     3,
                                  "Roberts",      4,
                                  "Differential", 5,
                                  "Laplace",      6,
                                  NULL);
  gimp_int_combo_box_set_active (GIMP_INT_COMBO_BOX (combo), 1);

  gtk_container_add (GTK_CONTAINER (align), combo);
  gtk_box_pack_start (GTK_BOX (vbox), align, TRUE, TRUE, 0);
  gtk_box_pack_start (GTK_BOX (vbox),
                      gtk_label_new ("Int Combo Box"), FALSE, FALSE, 0);

  return new_widget_info ("gimp-widget-int-combo-box", vbox, SMALL);
}
예제 #5
0
static void
ico_dialog_bpp_changed (GtkWidget *combo,
                        GObject   *hbox)
{
  GtkWidget   *dialog;
  gint32       layer;
  gint         layer_num;
  gint         bpp;
  IcoSaveInfo *info;

  dialog = gtk_widget_get_toplevel (combo);

  gimp_int_combo_box_get_active (GIMP_INT_COMBO_BOX (combo), &bpp);

  info = g_object_get_data (G_OBJECT (dialog), "save_info");
  g_assert (info);

  layer     = GPOINTER_TO_INT (g_object_get_data (hbox, "icon_layer"));
  layer_num = GPOINTER_TO_INT (g_object_get_data (hbox, "icon_layer_num"));

  /* Update vector entry for later when we're actually saving,
     and update the preview right away ... */
  info->depths[layer_num] = bpp;
  ico_dialog_update_icon_preview (dialog, layer, bpp);
}
예제 #6
0
void
combo_get_active (GtkWidget * combo, PreviewData * p_data,
		  gint32 * layer_ID_add, gboolean status,
		  GdkPixbuf ** pixbuf_add, SizeInfo * size_info)
{
  gimp_int_combo_box_get_active (GIMP_INT_COMBO_BOX (combo), layer_ID_add);
  if (status == TRUE)
    {
      if (*pixbuf_add)
        {
          g_object_unref (G_OBJECT (*pixbuf_add));
        }
      gimp_drawable_offsets (*layer_ID_add, &(size_info->x_off), &(size_info->y_off));

      size_info->x_off -= p_data->x_off;
      size_info->y_off -= p_data->y_off;

      size_info->width = gimp_drawable_width(*layer_ID_add);
      size_info->height = gimp_drawable_height(*layer_ID_add);

      size_info_scale(size_info, p_data->factor);

      *pixbuf_add = gimp_drawable_get_thumbnail(*layer_ID_add, size_info->width, size_info->height, GIMP_PIXBUF_KEEP_ALPHA);
    }
  preview_build_pixbuf (p_data);
  gtk_widget_queue_draw (p_data->area);
}
예제 #7
0
    operator int() const
    {
        gint value;
        gimp_int_combo_box_get_active(GIMP_INT_COMBO_BOX(this->gimpEnumComboBox), &value);

        return value;
    }
예제 #8
0
static gboolean
gimp_levels_tool_initialize (GimpTool     *tool,
                             GimpDisplay  *display,
                             GError      **error)
{
  GimpLevelsTool   *l_tool   = GIMP_LEVELS_TOOL (tool);
  GimpImage        *image    = gimp_display_get_image (display);
  GimpDrawable     *drawable = gimp_image_get_active_drawable (image);
  gdouble           scale_factor;
  gdouble           step_increment;
  gdouble           page_increment;
  gint              digits;

  if (! GIMP_TOOL_CLASS (parent_class)->initialize (tool, display, error))
    {
      return FALSE;
    }

  gimp_int_combo_box_set_sensitivity (GIMP_INT_COMBO_BOX (l_tool->channel_menu),
                                      levels_menu_sensitivity, drawable, NULL);

  gimp_drawable_calculate_histogram (drawable, l_tool->histogram);
  gimp_histogram_view_set_histogram (GIMP_HISTOGRAM_VIEW (l_tool->histogram_view),
                                     l_tool->histogram);

  if (gimp_drawable_get_component_type (drawable) == GIMP_COMPONENT_TYPE_U8)
    {
      scale_factor   = 255.0;
      step_increment = 1.0;
      page_increment = 8.0;
      digits         = 0;
    }
  else
    {
      scale_factor   = 100;
      step_increment = 0.01;
      page_increment = 1.0;
      digits         = 2;
    }

  gimp_prop_widget_set_factor (l_tool->low_input_spinbutton,
                               scale_factor, step_increment, page_increment,
                               digits);
  gimp_prop_widget_set_factor (l_tool->high_input_spinbutton,
                               scale_factor, step_increment, page_increment,
                               digits);
  gimp_prop_widget_set_factor (l_tool->low_output_spinbutton,
                               scale_factor, step_increment, page_increment,
                               digits);
  gimp_prop_widget_set_factor (l_tool->high_output_spinbutton,
                               scale_factor, step_increment, page_increment,
                               digits);

  gtk_adjustment_configure (l_tool->gamma_linear,
                            scale_factor / 2.0,
                            0, scale_factor, 0.1, 1.0, 0);

  return TRUE;
}
예제 #9
0
static void
callback_res_order_changed (GtkWidget * res_order, gpointer data)
{
    gint order;
    PreviewData *p_data = PREVIEW_DATA (data);
    gimp_int_combo_box_get_active (GIMP_INT_COMBO_BOX (res_order), &order);
    p_data->vals->res_order = order;
    callback_set_disc_warning (NULL, data);
}
예제 #10
0
파일: jpeg-save.c 프로젝트: frne/gimp
static void
load_gui_defaults (JpegSaveGui *pg)
{
  GtkAdjustment *restart_markers;

  load_defaults ();

#define SET_ACTIVE_BTTN(field) \
  gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (pg->field), jsvals.field)

  SET_ACTIVE_BTTN (optimize);
  SET_ACTIVE_BTTN (progressive);
  SET_ACTIVE_BTTN (use_orig_quality);
  SET_ACTIVE_BTTN (preview);
  SET_ACTIVE_BTTN (save_exif);
  SET_ACTIVE_BTTN (save_thumbnail);
  SET_ACTIVE_BTTN (save_xmp);
  SET_ACTIVE_BTTN (save_iptc);

#undef SET_ACTIVE_BTTN

/*spin button stuff*/
  g_signal_handler_block (pg->use_restart_markers, pg->handler_id_restart);
  gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (pg->use_restart_markers),
                                jsvals.restart);
  restart_markers = GTK_ADJUSTMENT (pg->scale_data);
  gtk_adjustment_set_value (restart_markers, jsvals.restart);
  g_signal_handler_unblock (pg->use_restart_markers, pg->handler_id_restart);


  gtk_adjustment_set_value (GTK_ADJUSTMENT (pg->quality),
                            jsvals.quality);
  gtk_adjustment_set_value (GTK_ADJUSTMENT (pg->smoothing),
                            jsvals.smoothing);

  if (gimp_drawable_is_rgb (drawable_ID_global))
    {
      gimp_int_combo_box_set_active (GIMP_INT_COMBO_BOX (pg->subsmp),
                                     jsvals.subsmp);
    }

  gimp_int_combo_box_set_active (GIMP_INT_COMBO_BOX (pg->dct),
                                 jsvals.dct);
}
예제 #11
0
파일: jpeg-save.c 프로젝트: frne/gimp
static void
use_orig_qual_changed2 (GtkWidget *toggle,
                        GtkWidget *combo)
{
  /* the test is (orig_quality > 0), not (orig_subsmp > 0) - this is normal */
  if (jsvals.use_orig_quality && orig_quality > 0)
    {
      gimp_int_combo_box_set_active (GIMP_INT_COMBO_BOX (combo), orig_subsmp);
    }
}
예제 #12
0
/**
 * gimp_color_frame_set_mode:
 * @frame: The #GimpColorFrame.
 * @mode:  The new @mode.
 *
 * Sets the #GimpColorFrame's color @mode. Calling this function does
 * the same as selecting the @mode from the frame's #GtkOptionMenu.
 **/
void
gimp_color_frame_set_mode (GimpColorFrame     *frame,
                           GimpColorFrameMode  mode)
{
  g_return_if_fail (GIMP_IS_COLOR_FRAME (frame));

  gimp_int_combo_box_set_active (GIMP_INT_COMBO_BOX (frame->menu), mode);

  g_object_notify (G_OBJECT (frame), "mode");
}
예제 #13
0
static void
gimp_color_frame_menu_callback (GtkWidget      *widget,
                                GimpColorFrame *frame)
{
  gint value;

  if (gimp_int_combo_box_get_active (GIMP_INT_COMBO_BOX (widget), &value))
    {
      frame->frame_mode = value;
      gimp_color_frame_update (frame);
    }
}
예제 #14
0
static void dialog_marked_cb(GtkWidget *widget, gpointer data)
{
	GimpDrawable **drawable = data;
	gint32 marked_id;

	gimp_int_combo_box_get_active(GIMP_INT_COMBO_BOX(widget), &marked_id);

	if (marked_id != colorizevals.marked_id) {
		gimp_drawable_detach(*drawable);
		colorizevals.marked_id = marked_id;
		*drawable = gimp_drawable_get(marked_id);
	}
}
예제 #15
0
static void
gimp_brush_select_mode_update (GtkWidget       *widget,
                               GimpBrushSelect *select)
{
  gint paint_mode;

  if (gimp_int_combo_box_get_active (GIMP_INT_COMBO_BOX (widget),
                                     &paint_mode))
    {
      gimp_context_set_paint_mode (GIMP_PDB_DIALOG (select)->context,
                                   (GimpLayerModeEffects) paint_mode);
    }
}
예제 #16
0
static void
cm_combo_callback (GtkWidget    *widget,
                   CmParamsType *mix)
{
  gint value;

  if (gimp_int_combo_box_get_active (GIMP_INT_COMBO_BOX (widget), &value))
    {
      mix->output_channel = value;

      cm_set_adjusters (mix);
    }
}
예제 #17
0
static void
webx_indexed_target_changed (WebxIndexedTarget *indexed)
{
  gtk_widget_set_sensitive (GTK_WIDGET (indexed->remove_unused_w), TRUE);

  if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (indexed->reuse_pal_w)))
    {
      if (!gimp_drawable_is_indexed (global_drawable_ID))
        { /* no user palette */
          gtk_widget_set_sensitive (indexed->reuse_pal_w, FALSE);
          gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (indexed->make_pal_w),
                                        TRUE);
        }
      else
        {
          gtk_widget_set_sensitive (indexed->reuse_pal_w, TRUE);
          gtk_widget_set_sensitive (indexed->remove_unused_w, FALSE);
          indexed->palette_type = GIMP_REUSE_PALETTE;
        }
    }

  if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (indexed->make_pal_w)))
    {
      indexed->palette_type = GIMP_MAKE_PALETTE;
      gtk_widget_set_sensitive (indexed->num_colors_w, TRUE);
      gtk_widget_set_sensitive (indexed->remove_unused_w, FALSE);
    }
  else
    {
      gtk_widget_set_sensitive (indexed->num_colors_w, FALSE);
    }

  if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (indexed->web_pal_w)))
    {
      indexed->palette_type = GIMP_WEB_PALETTE;
    }

  if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (indexed->bw_pal_w)))
    {
      indexed->palette_type = GIMP_MONO_PALETTE;
    }

  gimp_int_combo_box_get_active (GIMP_INT_COMBO_BOX (indexed->dither_type_w),
                                 &indexed->dither_type);
  indexed->num_colors = gtk_spin_button_get_value_as_int (GTK_SPIN_BUTTON (indexed->num_colors_w));

  indexed->remove_unused = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (indexed->remove_unused_w));
  indexed->alpha_dither = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (indexed->alpha_dither_w));

  webx_target_changed (WEBX_TARGET (indexed));
}
예제 #18
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;
}
예제 #19
0
static void
cm_update_ui (CmParamsType *mix)
{
  gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (mix->monochrome_toggle),
                                mix->monochrome);

  gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (mix->preserve_luminosity_toggle),
                                mix->preserve_luminosity);

  gimp_int_combo_box_set_active (GIMP_INT_COMBO_BOX (mix->combo),
                                 mix->output_channel);

  cm_set_adjusters (mix);

  gimp_preview_invalidate (GIMP_PREVIEW (preview));
}
예제 #20
0
static void
print_size_info_center_changed (GtkWidget *combo)
{
  gint value;

  if (gimp_int_combo_box_get_active (GIMP_INT_COMBO_BOX (combo), &value))
    {
      info.data->center = value;

      print_size_info_update_offsets ();

      if (info.preview)
        print_preview_set_image_offsets (PRINT_PREVIEW (info.preview),
                                         info.data->offset_x,
                                         info.data->offset_y);
    }
}
예제 #21
0
파일: jpeg-save.c 프로젝트: frne/gimp
static void
subsampling_changed (GtkWidget *combo,
                     GtkObject *entry)
{
  gint value;

  gimp_int_combo_box_get_active (GIMP_INT_COMBO_BOX (combo), &value);

  jsvals.subsmp = value;

  /*  smoothing is not supported with nonstandard sampling ratios  */
  gimp_scale_entry_set_sensitive (entry,
                                  jsvals.subsmp != JPEG_SUBSAMPLING_2x1_1x1_1x1 &&
                                  jsvals.subsmp != JPEG_SUBSAMPLING_1x2_1x1_1x1);

  make_preview ();
}
예제 #22
0
void
rcm_combo_callback (GtkWidget *widget,
                    gpointer   data)
{
  gint value;

  gimp_int_combo_box_get_active (GIMP_INT_COMBO_BOX (widget), &value);

  Current.reduced = rcm_reduce_image (Current.drawable, Current.mask,
                                      MAX_PREVIEW_SIZE, value);

  gtk_widget_set_size_request (Current.Bna->before,
                               Current.reduced->width,
                               Current.reduced->height);
  gtk_widget_set_size_request (Current.Bna->after,
                               Current.reduced->width,
                               Current.reduced->height);
}
예제 #23
0
static void
gimp_brush_select_mode_changed (GimpContext          *context,
                                GimpLayerModeEffects  paint_mode,
                                GimpBrushSelect      *select)
{
  g_signal_handlers_block_by_func (select->paint_mode_menu,
                                   gimp_brush_select_mode_update,
                                   select);

  gimp_int_combo_box_set_active (GIMP_INT_COMBO_BOX (select->paint_mode_menu),
                                 paint_mode);

  g_signal_handlers_unblock_by_func (select->paint_mode_menu,
                                     gimp_brush_select_mode_update,
                                     select);

  gimp_pdb_dialog_run_callback (GIMP_PDB_DIALOG (select), FALSE);
}
예제 #24
0
파일: widgets.c 프로젝트: LebedevRI/gimp
static WidgetInfo *
create_enum_combo_box (void)
{
  GtkWidget *vbox;
  GtkWidget *combo;
  GtkWidget *align;

  vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 6);
  align = gtk_alignment_new (0.5, 0.5, 0.5, 0.0);
  combo = gimp_enum_combo_box_new (GIMP_TYPE_CHANNEL_TYPE);
  gimp_int_combo_box_set_active (GIMP_INT_COMBO_BOX (combo), GIMP_BLUE_CHANNEL);
  gtk_container_add (GTK_CONTAINER (align), combo);
  gtk_box_pack_start (GTK_BOX (vbox), align, TRUE, TRUE, 0);
  gtk_box_pack_start (GTK_BOX (vbox),
                      gtk_label_new ("Enum Combo Box"), FALSE, FALSE, 0);

  return new_widget_info ("gimp-widget-enum-combo-box", vbox, SMALL);
}
예제 #25
0
static void
levels_channel_callback (GtkWidget      *widget,
                         GimpLevelsTool *tool)
{
  gint value;

  if (gimp_int_combo_box_get_active (GIMP_INT_COMBO_BOX (widget), &value))
    {
      tool->channel = value;
      gimp_histogram_view_set_channel (GIMP_HISTOGRAM_VIEW (tool->hist_view),
                                       tool->channel);

      /* FIXME: hack */
      if (! tool->color)
        tool->channel = (tool->channel == GIMP_HISTOGRAM_ALPHA) ? 1 : 0;

      levels_update (tool, ALL);
    }
}
예제 #26
0
/* ----------------------------
 * p_selectionComboCallback
 * ----------------------------
 *
 */
static void
p_selectionComboCallback (GtkWidget *widget)
{
  gint idValue;

  if(gap_debug)
  {
    printf("p_selectionComboCallback START\n");
  }

  gimp_int_combo_box_get_active (GIMP_INT_COMBO_BOX (widget), &idValue);

  if(gap_debug)
  {
    printf("p_selectionComboCallback idValue:%d\n", idValue);
  }
  glob_vals.alt_selection = idValue;

}  /* end p_selectionComboCallback */
void dialogStopPathChangedCallback(GtkWidget *widget, PlugInVals *vals) {
	gint value;
#ifdef DEBUG
	g_warning("dialogStopPathChangedCallback");
#endif
	if (GTK_WIDGET_SENSITIVE(widget)) {
	//if (gtk_widget_get_sensitive(widget)) {
		if (gimp_int_combo_box_get_active(GIMP_INT_COMBO_BOX(widget),&value)) {
			vals->stop_path_id = value;

		} else {
			vals->stop_path_id = -1;
		}
	} else {
		vals->stop_path_id = -1;
	}
	update_stop_path(vals);
	renderPreview(vals);
}
예제 #28
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;

  /*  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;
}
void dialogMaskChangedCallback(GtkWidget *widget, PlugInVals *vals) {
	gint value;
#ifdef DEBUG
	g_warning("dialogMaskChangedCallback");
#endif

	if (GTK_WIDGET_SENSITIVE(widget)) {
	//if (gtk_widget_get_sensitive(widget)) {
		if (gimp_int_combo_box_get_active(GIMP_INT_COMBO_BOX(widget),&value)) {
			vals->mask_drawable_id = value;
		} else {
			vals->mask_drawable_id = -1;

		}
	} else {
		vals->mask_drawable_id = gimp_image_get_selection(gimp_drawable_get_image(vals->image_drawable_id));
	}
	update_mask(vals);
	renderPreview(vals);
}
예제 #30
0
static gboolean
gimp_curves_tool_initialize (GimpTool     *tool,
                             GimpDisplay  *display,
                             GError      **error)
{
  GimpCurvesTool *c_tool   = GIMP_CURVES_TOOL (tool);
  GimpImage      *image    = gimp_display_get_image (display);
  GimpDrawable   *drawable = gimp_image_get_active_drawable (image);
  GimpHistogram  *histogram;

  if (! GIMP_TOOL_CLASS (parent_class)->initialize (tool, display, error))
    {
      return FALSE;
    }

  /*  always pick colors  */
  gimp_color_tool_enable (GIMP_COLOR_TOOL (tool),
                          GIMP_COLOR_TOOL_GET_OPTIONS (tool));

  gimp_int_combo_box_set_sensitivity (GIMP_INT_COMBO_BOX (c_tool->channel_menu),
                                      curves_menu_sensitivity, drawable, NULL);

  histogram = gimp_histogram_new (TRUE);
  gimp_drawable_calculate_histogram (drawable, histogram);
  gimp_histogram_view_set_background (GIMP_HISTOGRAM_VIEW (c_tool->graph),
                                      histogram);
  g_object_unref (histogram);

  if (gimp_drawable_get_precision (drawable) == GIMP_PRECISION_U8)
    {
      gimp_curve_view_set_range_x (GIMP_CURVE_VIEW (c_tool->graph), 0, 255);
      gimp_curve_view_set_range_y (GIMP_CURVE_VIEW (c_tool->graph), 0, 255);
    }
  else
    {
      gimp_curve_view_set_range_x (GIMP_CURVE_VIEW (c_tool->graph), 0.0, 1.0);
      gimp_curve_view_set_range_y (GIMP_CURVE_VIEW (c_tool->graph), 0.0, 1.0);
    }

  return TRUE;
}