[gimp] plug-ins: port GIMPressionist to GimpScaleEntry.
- From: Jehan <jehanp src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp] plug-ins: port GIMPressionist to GimpScaleEntry.
- Date: Sat, 31 Oct 2020 02:44:52 +0000 (UTC)
commit 52c3b9115bfb791eeb42affa022a3964925a0ab1
Author: Jehan <jehan girinstud io>
Date: Sat Oct 31 03:44:21 2020 +0100
plug-ins: port GIMPressionist to GimpScaleEntry.
plug-ins/gimpressionist/brush.c | 63 +++++++++--------
plug-ins/gimpressionist/color.c | 31 ++++-----
plug-ins/gimpressionist/general.c | 116 +++++++++++++++----------------
plug-ins/gimpressionist/gimpressionist.h | 5 ++
plug-ins/gimpressionist/orientation.c | 65 +++++++++--------
plug-ins/gimpressionist/orientmap.c | 86 +++++++++++------------
plug-ins/gimpressionist/paper.c | 46 ++++++------
plug-ins/gimpressionist/placement.c | 32 ++++-----
plug-ins/gimpressionist/size.c | 65 +++++++++--------
plug-ins/gimpressionist/sizemap.c | 59 ++++++++--------
plug-ins/gimpressionist/utils.c | 13 ++++
11 files changed, 286 insertions(+), 295 deletions(-)
---
diff --git a/plug-ins/gimpressionist/brush.c b/plug-ins/gimpressionist/brush.c
index f9a975342c..bc3325a5f2 100644
--- a/plug-ins/gimpressionist/brush.c
+++ b/plug-ins/gimpressionist/brush.c
@@ -39,8 +39,8 @@ static GtkWidget *brush_preview = NULL;
static GtkListStore *brush_list_store = NULL;
static GtkWidget *brush_list = NULL;
-static GtkAdjustment *brush_relief_adjust = NULL;
-static GtkAdjustment *brush_aspect_adjust = NULL;
+static GtkWidget *brush_relief_scale = NULL;
+static GtkWidget *brush_aspect_scale = NULL;
static GtkAdjustment *brush_gamma_adjust = NULL;
static gboolean brush_dont_update = FALSE;
@@ -55,8 +55,8 @@ brush_restore (void)
{
reselect (brush_list, pcvals.selected_brush);
gtk_adjustment_set_value (brush_gamma_adjust, pcvals.brushgamma);
- gtk_adjustment_set_value (brush_relief_adjust, pcvals.brush_relief);
- gtk_adjustment_set_value (brush_aspect_adjust, pcvals.brush_aspect);
+ gimp_scale_entry_set_value (GIMP_SCALE_ENTRY (brush_relief_scale), pcvals.brush_relief);
+ gimp_scale_entry_set_value (GIMP_SCALE_ENTRY (brush_aspect_scale), pcvals.brush_aspect);
}
void
@@ -147,7 +147,7 @@ brushdmenuselect (GtkWidget *widget,
}
gtk_adjustment_set_value (brush_gamma_adjust, 1.0);
- gtk_adjustment_set_value (brush_aspect_adjust, 0.0);
+ gimp_scale_entry_set_value (GIMP_SCALE_ENTRY (brush_aspect_scale), 0.0);
if (! gimp_drawable_mask_intersect (drawable, &x1, &y1, &w, &h))
return;
@@ -387,7 +387,7 @@ update_brush_preview (const gchar *fn)
gammatable[i] = i;
newheight = p.height *
- pow (10, gtk_adjustment_get_value (brush_aspect_adjust));
+ pow (10, gimp_scale_entry_get_value (GIMP_SCALE_ENTRY (brush_aspect_scale)));
sc = p.width > newheight ? p.width : newheight;
sc = 100.0 / sc;
@@ -463,7 +463,7 @@ brush_select (GtkTreeSelection *selection, gboolean force)
brush_dont_update = TRUE;
gtk_adjustment_set_value (brush_gamma_adjust, 1.0);
- gtk_adjustment_set_value (brush_aspect_adjust, 0.0);
+ gimp_scale_entry_set_value (GIMP_SCALE_ENTRY (brush_aspect_scale), 0.0);
brush_dont_update = FALSE;
if (brush)
@@ -500,9 +500,10 @@ brush_preview_size_allocate (GtkWidget *preview)
}
static void
-brush_asepct_adjust_cb (GtkAdjustment *a, gpointer data)
+brush_aspect_adjust_cb (GimpScaleEntry *scale,
+ gdouble *value)
{
- gimp_double_adjustment_update (a, data);
+ gimpressionist_scale_entry_update_double (scale, value);
update_brush_preview (pcvals.selected_brush);
}
@@ -608,33 +609,31 @@ create_brushpage (GtkNotebook *notebook)
gtk_box_pack_start (GTK_BOX (thispage), grid, FALSE, FALSE, 0);
gtk_widget_show (grid);
- brush_aspect_adjust =
- gimp_scale_entry_new (GTK_GRID (grid), 0, 0,
- _("Aspect ratio:"),
- 150, -1, pcvals.brush_aspect,
- -1.0, 1.0, 0.1, 0.1, 2,
- TRUE, 0, 0,
- _("Specifies the aspect ratio of the brush"),
- NULL);
+ brush_aspect_scale =
+ gimp_scale_entry_new2 (_("Aspect ratio:"), pcvals.brush_aspect, -1.0, 1.0, 2);
+ gimp_help_set_help_data (brush_aspect_scale,
+ _("Specifies the aspect ratio of the brush"),
+ NULL);
gtk_size_group_add_widget (group,
- GIMP_SCALE_ENTRY_LABEL (brush_aspect_adjust));
- g_signal_connect (brush_aspect_adjust, "value-changed",
- G_CALLBACK (brush_asepct_adjust_cb),
+ gimp_scale_entry_get_label (GIMP_SCALE_ENTRY (brush_aspect_scale)));
+ g_signal_connect (brush_aspect_scale, "value-changed",
+ G_CALLBACK (brush_aspect_adjust_cb),
&pcvals.brush_aspect);
-
- brush_relief_adjust =
- gimp_scale_entry_new (GTK_GRID (grid), 0, 1,
- _("Relief:"),
- 150, -1, pcvals.brush_relief,
- 0.0, 100.0, 1.0, 10.0, 1,
- TRUE, 0, 0,
- _("Specifies the amount of embossing to apply to the image (in percent)"),
- NULL);
+ gtk_grid_attach (GTK_GRID (grid), brush_aspect_scale, 0, 0, 3, 1);
+ gtk_widget_show (brush_aspect_scale);
+
+ brush_relief_scale =
+ gimp_scale_entry_new2 (_("Relief:"), pcvals.brush_relief, 0.0, 100.0, 1);
+ gimp_help_set_help_data (brush_relief_scale,
+ _("Specifies the amount of embossing to apply to the image (in percent)"),
+ NULL);
gtk_size_group_add_widget (group,
- GIMP_SCALE_ENTRY_LABEL (brush_relief_adjust));
- g_signal_connect (brush_relief_adjust, "value-changed",
- G_CALLBACK (gimp_double_adjustment_update),
+ gimp_scale_entry_get_label (GIMP_SCALE_ENTRY (brush_relief_scale)));
+ g_signal_connect (brush_relief_scale, "value-changed",
+ G_CALLBACK (gimpressionist_scale_entry_update_double),
&pcvals.brush_relief);
+ gtk_grid_attach (GTK_GRID (grid), brush_relief_scale, 0, 1, 3, 1);
+ gtk_widget_show (brush_relief_scale);
brush_select (selection, FALSE);
readdirintolist ("Brushes", view, pcvals.selected_brush);
diff --git a/plug-ins/gimpressionist/color.c b/plug-ins/gimpressionist/color.c
index 36d3d10e99..d489e9f1fa 100644
--- a/plug-ins/gimpressionist/color.c
+++ b/plug-ins/gimpressionist/color.c
@@ -30,8 +30,8 @@
#define NUMCOLORRADIO 2
-static GtkWidget *colorradio[NUMCOLORRADIO];
-static GtkAdjustment *colornoiseadjust = NULL;
+static GtkWidget *colorradio[NUMCOLORRADIO];
+static GtkWidget *colornoiseadjust = NULL;
void
color_restore (void)
@@ -39,8 +39,8 @@ color_restore (void)
gtk_toggle_button_set_active
(GTK_TOGGLE_BUTTON (colorradio[pcvals.color_type]), TRUE);
- gtk_adjustment_set_value (colornoiseadjust,
- pcvals.color_noise);
+ gimp_scale_entry_set_value (GIMP_SCALE_ENTRY (colornoiseadjust),
+ pcvals.color_noise);
}
int
@@ -53,7 +53,7 @@ void
create_colorpage (GtkNotebook *notebook)
{
GtkWidget *vbox;
- GtkWidget *label, *grid;
+ GtkWidget *label;
GtkWidget *frame;
label = gtk_label_new_with_mnemonic (_("Co_lor"));
@@ -83,22 +83,17 @@ create_colorpage (GtkNotebook *notebook)
gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, 0);
gtk_widget_show (frame);
- grid = gtk_grid_new ();
- gtk_grid_set_column_spacing (GTK_GRID (grid), 6);
- gtk_box_pack_start (GTK_BOX (vbox), grid, FALSE, FALSE, 0);
- gtk_widget_show (grid);
-
colornoiseadjust =
- gimp_scale_entry_new (GTK_GRID (grid), 0, 0,
- _("Color _noise:"),
- 100, -1, pcvals.color_noise,
- 0.0, 100.0, 1.0, 5.0, 0,
- TRUE, 0, 0,
- _("Adds random noise to the color"),
- NULL);
+ gimp_scale_entry_new2 (_("Color _noise:"), pcvals.color_noise, 0.0, 100.0, 0);
+ gimp_help_set_help_data (colornoiseadjust,
+ _("Adds random noise to the color"),
+ NULL);
g_signal_connect (colornoiseadjust, "value-changed",
- G_CALLBACK (gimp_double_adjustment_update),
+ G_CALLBACK (gimpressionist_scale_entry_update_double),
&pcvals.color_noise);
+ gtk_box_pack_start (GTK_BOX (vbox), colornoiseadjust, FALSE, FALSE, 6);
+ gtk_widget_show (colornoiseadjust);
+
color_restore ();
diff --git a/plug-ins/gimpressionist/general.c b/plug-ins/gimpressionist/general.c
index 4e874d9068..f55cc3eb23 100644
--- a/plug-ins/gimpressionist/general.c
+++ b/plug-ins/gimpressionist/general.c
@@ -35,16 +35,16 @@
#define NUMGENERALBGRADIO 4
-static GtkWidget *general_bg_radio[NUMGENERALBGRADIO];
-static GtkWidget *general_paint_edges = NULL;
-static GtkAdjustment *general_dark_edge_adjust = NULL;
-static GtkWidget *general_tileable;
-static GtkWidget *general_drop_shadow = NULL;
-static GtkWidget *general_color_button;
-static GtkAdjustment *general_shadow_adjust = NULL;
-static GtkAdjustment *general_shadow_depth = NULL;
-static GtkAdjustment *general_shadow_blur = NULL;
-static GtkAdjustment *dev_thresh_adjust = NULL;
+static GtkWidget *general_bg_radio[NUMGENERALBGRADIO];
+static GtkWidget *general_paint_edges = NULL;
+static GtkWidget *general_dark_edge_scale = NULL;
+static GtkWidget *general_tileable;
+static GtkWidget *general_drop_shadow = NULL;
+static GtkWidget *general_color_button;
+static GtkWidget *general_shadow_scale = NULL;
+static GtkWidget *general_shadow_depth = NULL;
+static GtkWidget *general_shadow_blur = NULL;
+static GtkWidget *dev_thresh_scale = NULL;
static int
normalize_bg (int n)
@@ -62,13 +62,13 @@ void
general_store (void)
{
pcvals.general_paint_edges = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (general_paint_edges));
- pcvals.general_dark_edge = gtk_adjustment_get_value (general_dark_edge_adjust);
+ pcvals.general_dark_edge = gimp_scale_entry_get_value (GIMP_SCALE_ENTRY (general_dark_edge_scale));
pcvals.general_tileable = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (general_tileable));
pcvals.general_drop_shadow = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (general_drop_shadow));
- pcvals.general_shadow_darkness = gtk_adjustment_get_value (general_shadow_adjust);
- pcvals.general_shadow_depth = gtk_adjustment_get_value (general_shadow_depth);
- pcvals.general_shadow_blur = gtk_adjustment_get_value (general_shadow_blur);
- pcvals.devthresh = gtk_adjustment_get_value (dev_thresh_adjust);
+ pcvals.general_shadow_darkness = gimp_scale_entry_get_value (GIMP_SCALE_ENTRY (general_shadow_scale));
+ pcvals.general_shadow_depth = gimp_scale_entry_get_value (GIMP_SCALE_ENTRY (general_shadow_depth));
+ pcvals.general_shadow_blur = gimp_scale_entry_get_value (GIMP_SCALE_ENTRY (general_shadow_blur));
+ pcvals.devthresh = gimp_scale_entry_get_value (GIMP_SCALE_ENTRY (dev_thresh_scale));
}
int
@@ -86,21 +86,21 @@ general_restore (void)
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (general_paint_edges),
pcvals.general_paint_edges);
- gtk_adjustment_set_value (general_dark_edge_adjust,
+ gimp_scale_entry_set_value (GIMP_SCALE_ENTRY (general_dark_edge_scale),
pcvals.general_dark_edge);
- gtk_adjustment_set_value (general_shadow_adjust,
+ gimp_scale_entry_set_value (GIMP_SCALE_ENTRY (general_shadow_scale),
pcvals.general_shadow_darkness);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (general_drop_shadow),
pcvals.general_drop_shadow);
- gtk_adjustment_set_value (general_shadow_depth,
+ gimp_scale_entry_set_value (GIMP_SCALE_ENTRY (general_shadow_depth),
pcvals.general_shadow_depth);
- gtk_adjustment_set_value (general_shadow_blur,
+ gimp_scale_entry_set_value (GIMP_SCALE_ENTRY (general_shadow_blur),
pcvals.general_shadow_blur);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (general_tileable),
pcvals.general_tileable);
gimp_color_button_set_color (GIMP_COLOR_BUTTON (general_color_button),
&pcvals.color);
- gtk_adjustment_set_value (dev_thresh_adjust,
+ gimp_scale_entry_set_value (GIMP_SCALE_ENTRY (dev_thresh_scale),
pcvals.devthresh);
}
@@ -234,50 +234,46 @@ create_generalpage (GtkNotebook *notebook)
gtk_box_pack_start (GTK_BOX (box1), grid, FALSE, FALSE, 0);
gtk_widget_show (grid);
- general_dark_edge_adjust =
- gimp_scale_entry_new (GTK_GRID (grid), 0, 0,
- _("Edge darken:"),
- 150, 6, pcvals.general_dark_edge,
- 0.0, 1.0, 0.01, 0.1, 2,
- TRUE, 0, 0,
- _("How much to \"darken\" the edges of each brush stroke"),
- NULL);
-
- general_shadow_adjust =
- gimp_scale_entry_new (GTK_GRID (grid), 0, 1,
- _("Shadow darken:"),
- 150, 6, pcvals.general_shadow_darkness,
- 0.0, 99.0, 0.1, 1, 2,
- TRUE, 0, 0,
- _("How much to \"darken\" the drop shadow"),
- NULL);
+ general_dark_edge_scale =
+ gimp_scale_entry_new2 (_("Edge darken:"), pcvals.general_dark_edge, 0.0, 1.0, 2);
+ gimp_help_set_help_data (general_dark_edge_scale,
+ _("How much to \"darken\" the edges of each brush stroke"),
+ NULL);
+ gtk_grid_attach (GTK_GRID (grid), general_dark_edge_scale, 0, 0, 3, 1);
+ gtk_widget_show (general_dark_edge_scale);
+
+ general_shadow_scale =
+ gimp_scale_entry_new2 (_("Shadow darken:"), pcvals.general_shadow_darkness, 0.0, 99.0, 2);
+ gimp_scale_entry_set_increments (GIMP_SCALE_ENTRY (general_shadow_scale), 0.1, 1.0);
+ gimp_help_set_help_data (general_shadow_scale,
+ _("How much to \"darken\" the drop shadow"),
+ NULL);
+ gtk_grid_attach (GTK_GRID (grid), general_shadow_scale, 0, 1, 3, 1);
+ gtk_widget_show (general_shadow_scale);
general_shadow_depth =
- gimp_scale_entry_new (GTK_GRID (grid), 0, 2,
- _("Shadow depth:"),
- 150, 6, pcvals.general_shadow_depth,
- 0, 99, 1, 5, 0,
- TRUE, 0, 0,
- _("The depth of the drop shadow, i.e. how far apart from the object it should be"),
- NULL);
+ gimp_scale_entry_new2 (_("Shadow depth:"), pcvals.general_shadow_depth, 0, 99, 0);
+ gimp_help_set_help_data (general_shadow_depth,
+ _("The depth of the drop shadow, i.e. how far apart from the object it should
be"),
+ NULL);
+ gtk_grid_attach (GTK_GRID (grid), general_shadow_depth, 0, 2, 3, 1);
+ gtk_widget_show (general_shadow_depth);
general_shadow_blur =
- gimp_scale_entry_new (GTK_GRID (grid), 0, 3,
- _("Shadow blur:"),
- 150, 6, pcvals.general_shadow_blur,
- 0, 99, 1, 5, 0,
- TRUE, 0, 0,
- _("How much to blur the drop shadow"),
- NULL);
-
- dev_thresh_adjust =
- gimp_scale_entry_new (GTK_GRID (grid), 0, 4,
- _("Deviation threshold:"),
- 150, 6, pcvals.devthresh,
- 0.0, 1.0, 0.01, 0.01, 2,
- TRUE, 0, 0,
- _("A bailout-value for adaptive selections"),
- NULL);
+ gimp_scale_entry_new2 (_("Shadow blur:"), pcvals.general_shadow_blur, 0, 99, 0);
+ gimp_help_set_help_data (general_shadow_blur,
+ _("How much to blur the drop shadow"),
+ NULL);
+ gtk_grid_attach (GTK_GRID (grid), general_shadow_blur, 0, 3, 3, 1);
+ gtk_widget_show (general_shadow_blur);
+
+ dev_thresh_scale =
+ gimp_scale_entry_new2 (_("Deviation threshold:"), pcvals.devthresh, 0.0, 1.0, 2);
+ gimp_help_set_help_data (dev_thresh_scale,
+ _("A bailout-value for adaptive selections"),
+ NULL);
+ gtk_grid_attach (GTK_GRID (grid), dev_thresh_scale, 0, 4, 3, 1);
+ gtk_widget_show (dev_thresh_scale);
gtk_notebook_append_page_menu (notebook, thispage, label, NULL);
}
diff --git a/plug-ins/gimpressionist/gimpressionist.h b/plug-ins/gimpressionist/gimpressionist.h
index ba944e06df..e9e36d522e 100644
--- a/plug-ins/gimpressionist/gimpressionist.h
+++ b/plug-ins/gimpressionist/gimpressionist.h
@@ -174,6 +174,11 @@ GtkWidget *create_radio_button (GtkWidget *box, int orient_type,
GtkWidget **buttons_array
);
+void gimpressionist_scale_entry_update_double (GimpScaleEntry *entry,
+ gdouble *value);
+void gimpressionist_scale_entry_update_int (GimpScaleEntry *entry,
+ gint *value);
+
#define CLAMP_UP_TO(x, max) (CLAMP((x),(0),(max-1)))
#endif /* #ifndef __GIMPRESSIONIST_H */
diff --git a/plug-ins/gimpressionist/orientation.c b/plug-ins/gimpressionist/orientation.c
index e344f7098d..19eeb886de 100644
--- a/plug-ins/gimpressionist/orientation.c
+++ b/plug-ins/gimpressionist/orientation.c
@@ -28,10 +28,10 @@
#include "libgimp/stdplugins-intl.h"
-static GtkWidget *orient_radio[NUMORIENTRADIO];
-static GtkAdjustment *orient_num_adjust = NULL;
-static GtkAdjustment *orient_first_adjust = NULL;
-static GtkAdjustment *orient_last_adjust = NULL;
+static GtkWidget *orient_radio[NUMORIENTRADIO];
+static GtkWidget *orient_num_adjust = NULL;
+static GtkWidget *orient_first_adjust = NULL;
+static GtkWidget *orient_last_adjust = NULL;
static void
@@ -49,12 +49,12 @@ void orientation_restore (void)
{
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (orient_radio[pcvals.orient_type]),
TRUE);
- gtk_adjustment_set_value (orient_num_adjust,
- pcvals.orient_num);
- gtk_adjustment_set_value (orient_first_adjust,
- pcvals.orient_first);
- gtk_adjustment_set_value (orient_last_adjust,
- pcvals.orient_last);
+ gimp_scale_entry_set_value (GIMP_SCALE_ENTRY (orient_num_adjust),
+ pcvals.orient_num);
+ gimp_scale_entry_set_value (GIMP_SCALE_ENTRY (orient_first_adjust),
+ pcvals.orient_first);
+ gimp_scale_entry_set_value (GIMP_SCALE_ENTRY (orient_last_adjust),
+ pcvals.orient_last);
}
static void
@@ -97,40 +97,37 @@ create_orientationpage (GtkNotebook *notebook)
gtk_widget_show (grid);
orient_num_adjust =
- gimp_scale_entry_new (GTK_GRID (grid), 0, 0,
- _("Directions:"),
- 150, -1, pcvals.orient_num,
- 1.0, 30.0, 1.0, 1.0, 0,
- TRUE, 0, 0,
- _("The number of directions (i.e. brushes) to use"),
- NULL);
+ gimp_scale_entry_new2 (_("Directions:"), pcvals.orient_num, 1.0, 30.0, 0);
+ gimp_help_set_help_data (orient_num_adjust,
+ _("The number of directions (i.e. brushes) to use"),
+ NULL);
g_signal_connect (orient_num_adjust, "value-changed",
- G_CALLBACK (gimp_int_adjustment_update),
+ G_CALLBACK (gimpressionist_scale_entry_update_int),
&pcvals.orient_num);
+ gtk_grid_attach (GTK_GRID (grid), orient_num_adjust, 0, 0, 3, 1);
+ gtk_widget_show (orient_num_adjust);
orient_first_adjust =
- gimp_scale_entry_new (GTK_GRID (grid), 0, 1,
- _("Start angle:"),
- 150, -1, pcvals.orient_first,
- 0.0, 360.0, 1.0, 10.0, 0,
- TRUE, 0, 0,
- _("The starting angle of the first brush to create"),
- NULL);
+ gimp_scale_entry_new2 (_("Start angle:"), pcvals.orient_first, 0.0, 360.0, 0);
+ gimp_help_set_help_data (orient_first_adjust,
+ _("The starting angle of the first brush to create"),
+ NULL);
g_signal_connect (orient_first_adjust, "value-changed",
- G_CALLBACK (gimp_double_adjustment_update),
+ G_CALLBACK (gimpressionist_scale_entry_update_double),
&pcvals.orient_first);
+ gtk_grid_attach (GTK_GRID (grid), orient_first_adjust, 0, 1, 3, 1);
+ gtk_widget_show (orient_first_adjust);
orient_last_adjust =
- gimp_scale_entry_new (GTK_GRID (grid), 0, 2,
- _("Angle span:"),
- 150, -1, pcvals.orient_last,
- 0.0, 360.0, 1.0, 10.0, 0,
- TRUE, 0, 0,
- _("The angle span of the first brush to create"),
- NULL);
+ gimp_scale_entry_new2 (_("Angle span:"), pcvals.orient_last, 0.0, 360.0, 0);
+ gimp_help_set_help_data (orient_last_adjust,
+ _("The angle span of the first brush to create"),
+ NULL);
g_signal_connect (orient_last_adjust, "value-changed",
- G_CALLBACK (gimp_double_adjustment_update),
+ G_CALLBACK (gimpressionist_scale_entry_update_double),
&pcvals.orient_last);
+ gtk_grid_attach (GTK_GRID (grid), orient_last_adjust, 0, 2, 3, 1);
+ gtk_widget_show (orient_last_adjust);
box2 = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 12);
gtk_box_pack_start (GTK_BOX (thispage), box2, FALSE, FALSE, 0);
diff --git a/plug-ins/gimpressionist/orientmap.c b/plug-ins/gimpressionist/orientmap.c
index 681b09deb5..2e8b30d6e8 100644
--- a/plug-ins/gimpressionist/orientmap.c
+++ b/plug-ins/gimpressionist/orientmap.c
@@ -44,10 +44,10 @@ static GtkWidget *add_button;
static GtkWidget *kill_button;
static GtkAdjustment *vector_preview_brightness_adjust = NULL;
-static GtkAdjustment *angle_adjust = NULL;
-static GtkAdjustment *strength_adjust = NULL;
-static GtkAdjustment *orient_map_str_exp_adjust = NULL;
-static GtkAdjustment *angle_offset_adjust = NULL;
+static GtkWidget *angle_adjust = NULL;
+static GtkWidget *strength_adjust = NULL;
+static GtkWidget *orient_map_str_exp_adjust = NULL;
+static GtkWidget *angle_offset_adjust = NULL;
static GtkWidget *vector_types[NUMVECTYPES];
static GtkWidget *orient_voronoi = NULL;
@@ -80,8 +80,8 @@ double get_direction (double x, double y, int from)
{
n = num_vectors;
vec = vector;
- angoff = gtk_adjustment_get_value (angle_offset_adjust);
- strexp = gtk_adjustment_get_value (orient_map_str_exp_adjust);
+ angoff = gimp_scale_entry_get_value (GIMP_SCALE_ENTRY (angle_offset_adjust));
+ strexp = gimp_scale_entry_get_value (GIMP_SCALE_ENTRY (orient_map_str_exp_adjust));
voronoi = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (orient_voronoi));
}
else
@@ -286,8 +286,8 @@ update_slides (void)
gint type;
adjignore = TRUE;
- gtk_adjustment_set_value (angle_adjust, vector[selectedvector].dir);
- gtk_adjustment_set_value (strength_adjust, vector[selectedvector].str);
+ gimp_scale_entry_set_value (GIMP_SCALE_ENTRY (angle_adjust), vector[selectedvector].dir);
+ gimp_scale_entry_set_value (GIMP_SCALE_ENTRY (strength_adjust), vector[selectedvector].str);
type = vector[selectedvector].type;
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (vector_types[type]), TRUE);
adjignore = FALSE;
@@ -388,7 +388,7 @@ angle_adjust_move_callback (GtkWidget *w, gpointer data)
{
if (adjignore)
return;
- vector[selectedvector].dir = gtk_adjustment_get_value (angle_adjust);
+ vector[selectedvector].dir = gimp_scale_entry_get_value (GIMP_SCALE_ENTRY (angle_adjust));
vector[selectedvector].dx =
sin (gimp_deg_to_rad (vector[selectedvector].dir));
vector[selectedvector].dy =
@@ -402,7 +402,7 @@ strength_adjust_move_callback (GtkWidget *w, gpointer data)
{
if (adjignore)
return;
- vector[selectedvector].str = gtk_adjustment_get_value (strength_adjust);
+ vector[selectedvector].str = gimp_scale_entry_get_value (GIMP_SCALE_ENTRY (strength_adjust));
update_vector_prev ();
update_orient_map_preview_prev ();
}
@@ -453,8 +453,8 @@ orient_map_response (GtkWidget *widget,
pcvals.orient_vectors[i] = vector[i];
pcvals.num_orient_vectors = num_vectors;
- pcvals.orient_strength_exponent = gtk_adjustment_get_value (orient_map_str_exp_adjust);
- pcvals.orient_angle_offset = gtk_adjustment_get_value (angle_offset_adjust);
+ pcvals.orient_strength_exponent = gimp_scale_entry_get_value (GIMP_SCALE_ENTRY
(orient_map_str_exp_adjust));
+ pcvals.orient_angle_offset = gimp_scale_entry_get_value (GIMP_SCALE_ENTRY (angle_offset_adjust));
pcvals.orient_voronoi = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (orient_voronoi));
}
};
@@ -490,10 +490,10 @@ update_orientmap_dialog (void)
init_vectors ();
- gtk_adjustment_set_value (orient_map_str_exp_adjust,
- pcvals.orient_strength_exponent);
- gtk_adjustment_set_value (angle_offset_adjust,
- pcvals.orient_angle_offset);
+ gimp_scale_entry_set_value (GIMP_SCALE_ENTRY (orient_map_str_exp_adjust),
+ pcvals.orient_strength_exponent);
+ gimp_scale_entry_set_value (GIMP_SCALE_ENTRY (angle_offset_adjust),
+ pcvals.orient_angle_offset);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (orient_voronoi),
pcvals.orient_voronoi);
@@ -665,48 +665,46 @@ create_orientmap_dialog (GtkWidget *parent)
gtk_widget_show (grid2);
angle_adjust =
- gimp_scale_entry_new (GTK_GRID (grid2), 0, 0,
- _("A_ngle:"),
- 150, 6, 0.0,
- 0.0, 360.0, 1.0, 10.0, 1,
- TRUE, 0, 0,
- _("Change the angle of the selected vector"),
- NULL);
+ gimp_scale_entry_new2 (_("A_ngle:"), 0.0, 0.0, 360.0, 1);
+ gimp_help_set_help_data (angle_adjust,
+ _("Change the angle of the selected vector"),
+ NULL);
g_signal_connect (angle_adjust, "value-changed",
G_CALLBACK (angle_adjust_move_callback), NULL);
+ gtk_grid_attach (GTK_GRID (grid2), angle_adjust, 0, 0, 3, 1);
+ gtk_widget_show (angle_adjust);
angle_offset_adjust =
- gimp_scale_entry_new (GTK_GRID (grid2), 0, 1,
- _("Ang_le offset:"),
- 150, 6, 0.0,
- 0.0, 360.0, 1.0, 10.0, 1,
- TRUE, 0, 0,
- _("Offset all vectors with a given angle"),
- NULL);
+ gimp_scale_entry_new2 (_("Ang_le offset:"), 0.0, 0.0, 360.0, 1);
+ gimp_help_set_help_data (angle_offset_adjust,
+ _("Offset all vectors with a given angle"),
+ NULL);
g_signal_connect (angle_offset_adjust, "value-changed",
G_CALLBACK (angle_offset_adjust_move_callback), NULL);
+ gtk_grid_attach (GTK_GRID (grid2), angle_offset_adjust, 0, 1, 3, 1);
+ gtk_widget_show (angle_offset_adjust);
strength_adjust =
- gimp_scale_entry_new (GTK_GRID (grid2), 0, 2,
- _("_Strength:"),
- 150, 6, 1.0,
- 0.1, 5.0, 0.1, 1.0, 1,
- TRUE, 0, 0,
- _("Change the strength of the selected vector"),
- NULL);
+ gimp_scale_entry_new2 (_("_Strength:"), 1.0, 0.1, 5.0, 1);
+ gimp_scale_entry_set_increments (GIMP_SCALE_ENTRY (strength_adjust), 0.1, 1.0);
+ gimp_help_set_help_data (strength_adjust,
+ _("Change the strength of the selected vector"),
+ NULL);
g_signal_connect (strength_adjust, "value-changed",
G_CALLBACK (strength_adjust_move_callback), NULL);
+ gtk_grid_attach (GTK_GRID (grid2), strength_adjust, 0, 2, 3, 1);
+ gtk_widget_show (strength_adjust);
orient_map_str_exp_adjust =
- gimp_scale_entry_new (GTK_GRID (grid2), 0, 3,
- _("S_trength exp.:"),
- 150, 6, 1.0,
- 0.1, 10.9, 0.1, 1.0, 1,
- TRUE, 0, 0,
- _("Change the exponent of the strength"),
- NULL);
+ gimp_scale_entry_new2 (_("S_trength exp.:"), 1.0, 0.1, 10.9, 1);
+ gimp_scale_entry_set_increments (GIMP_SCALE_ENTRY (orient_map_str_exp_adjust), 0.1, 1.0);
+ gimp_help_set_help_data (orient_map_str_exp_adjust,
+ _("Change the exponent of the strength"),
+ NULL);
g_signal_connect (orient_map_str_exp_adjust, "value-changed",
G_CALLBACK (strength_exponent_adjust_move_callback), NULL);
+ gtk_grid_attach (GTK_GRID (grid2), orient_map_str_exp_adjust, 0, 3, 3, 1);
+ gtk_widget_show (orient_map_str_exp_adjust);
gtk_widget_show (orient_map_window);
diff --git a/plug-ins/gimpressionist/paper.c b/plug-ins/gimpressionist/paper.c
index 795c4b9f5a..4cf6fad143 100644
--- a/plug-ins/gimpressionist/paper.c
+++ b/plug-ins/gimpressionist/paper.c
@@ -31,12 +31,12 @@
#include "libgimp/stdplugins-intl.h"
-static GtkWidget *paper_preview = NULL;
-static GtkWidget *paper_invert = NULL;
-static GtkWidget *paper_list = NULL;
-static GtkAdjustment *paper_relief_adjust = NULL;
-static GtkAdjustment *paper_scale_adjust = NULL;
-static GtkWidget *paper_overlay = NULL;
+static GtkWidget *paper_preview = NULL;
+static GtkWidget *paper_invert = NULL;
+static GtkWidget *paper_list = NULL;
+static GtkWidget *paper_relief_adjust = NULL;
+static GtkWidget *paper_scale_adjust = NULL;
+static GtkWidget *paper_overlay = NULL;
static void paper_update_preview (void)
{
@@ -109,8 +109,8 @@ void
paper_restore (void)
{
reselect (paper_list, pcvals.selected_paper);
- gtk_adjustment_set_value (paper_relief_adjust, pcvals.paper_relief);
- gtk_adjustment_set_value (paper_scale_adjust, pcvals.paper_scale);
+ gimp_scale_entry_set_value (GIMP_SCALE_ENTRY (paper_relief_adjust), pcvals.paper_relief);
+ gimp_scale_entry_set_value (GIMP_SCALE_ENTRY (paper_scale_adjust), pcvals.paper_scale);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (paper_invert), pcvals.paper_invert);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (paper_overlay), pcvals.paper_overlay);
}
@@ -188,28 +188,26 @@ create_paperpage (GtkNotebook *notebook)
gtk_widget_show (grid);
paper_scale_adjust =
- gimp_scale_entry_new (GTK_GRID (grid), 0, 0,
- _("Scale:"),
- 150, -1, pcvals.paper_scale,
- 3.0, 150.0, 1.0, 10.0, 1,
- TRUE, 0, 0,
- _("Specifies the scale of the texture (in percent of original file)"),
- NULL);
+ gimp_scale_entry_new2 (_("Scale:"), pcvals.paper_scale, 3.0, 150.0, 1);
+ gimp_help_set_help_data (paper_scale_adjust,
+ _("Specifies the scale of the texture (in percent of original file)"),
+ NULL);
g_signal_connect (paper_scale_adjust, "value-changed",
- G_CALLBACK (gimp_double_adjustment_update),
+ G_CALLBACK (gimpressionist_scale_entry_update_double),
&pcvals.paper_scale);
+ gtk_grid_attach (GTK_GRID (grid), paper_scale_adjust, 0, 0, 3, 1);
+ gtk_widget_show (paper_scale_adjust);
paper_relief_adjust =
- gimp_scale_entry_new (GTK_GRID (grid), 0, 1,
- _("Relief:"),
- 150, -1, pcvals.paper_relief,
- 0.0, 100.0, 1.0, 10.0, 1,
- TRUE, 0, 0,
- _("Specifies the amount of embossing to apply to the image (in percent)"),
- NULL);
+ gimp_scale_entry_new2 (_("Relief:"), pcvals.paper_relief, 0.0, 100.0, 1);
+ gimp_help_set_help_data (paper_relief_adjust,
+ _("Specifies the amount of embossing to apply to the image (in percent)"),
+ NULL);
g_signal_connect (paper_relief_adjust, "value-changed",
- G_CALLBACK (gimp_double_adjustment_update),
+ G_CALLBACK (gimpressionist_scale_entry_update_double),
&pcvals.paper_relief);
+ gtk_grid_attach (GTK_GRID (grid), paper_relief_adjust, 0, 1, 3, 1);
+ gtk_widget_show (paper_relief_adjust);
if (gtk_tree_model_get_iter_first (GTK_TREE_MODEL (paper_store_list), &iter))
diff --git a/plug-ins/gimpressionist/placement.c b/plug-ins/gimpressionist/placement.c
index 5973c03895..6333f385dd 100644
--- a/plug-ins/gimpressionist/placement.c
+++ b/plug-ins/gimpressionist/placement.c
@@ -30,9 +30,9 @@
#define NUM_PLACE_RADIO 2
-static GtkWidget *placement_radio[NUM_PLACE_RADIO];
-static GtkWidget *placement_center = NULL;
-static GtkAdjustment *brush_density_adjust = NULL;
+static GtkWidget *placement_radio[NUM_PLACE_RADIO];
+static GtkWidget *placement_center = NULL;
+static GtkWidget *brush_density_adjust = NULL;
void
place_restore (void)
@@ -41,8 +41,8 @@ place_restore (void)
(GTK_TOGGLE_BUTTON (placement_radio[pcvals.place_type]), TRUE);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (placement_center),
pcvals.placement_center);
- gtk_adjustment_set_value (brush_density_adjust,
- pcvals.brush_density);
+ gimp_scale_entry_set_value (GIMP_SCALE_ENTRY (brush_density_adjust),
+ pcvals.brush_density);
}
int
@@ -61,7 +61,7 @@ void
create_placementpage (GtkNotebook *notebook)
{
GtkWidget *vbox;
- GtkWidget *label, *tmpw, *grid, *frame;
+ GtkWidget *label, *tmpw, *frame;
label = gtk_label_new_with_mnemonic (_("Pl_acement"));
@@ -109,22 +109,16 @@ create_placementpage (GtkNotebook *notebook)
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (tmpw),
pcvals.placement_center);
- grid = gtk_grid_new ();
- gtk_grid_set_column_spacing (GTK_GRID (grid), 6);
- gtk_box_pack_start (GTK_BOX (vbox), grid, FALSE, FALSE, 0);
- gtk_widget_show (grid);
-
brush_density_adjust =
- gimp_scale_entry_new (GTK_GRID (grid), 0, 0,
- _("Stroke _density:"),
- 100, -1, pcvals.brush_density,
- 1.0, 50.0, 1.0, 5.0, 0,
- TRUE, 0, 0,
- _("The relative density of the brush strokes"),
- NULL);
+ gimp_scale_entry_new2 (_("Stroke _density:"), pcvals.brush_density, 1.0, 50.0, 0);
+ gimp_help_set_help_data (brush_density_adjust,
+ _("The relative density of the brush strokes"),
+ NULL);
g_signal_connect (brush_density_adjust, "value-changed",
- G_CALLBACK (gimp_double_adjustment_update),
+ G_CALLBACK (gimpressionist_scale_entry_update_double),
&pcvals.brush_density);
+ gtk_box_pack_start (GTK_BOX (vbox), brush_density_adjust, FALSE, FALSE, 6);
+ gtk_widget_show (brush_density_adjust);
gtk_notebook_append_page_menu (notebook, vbox, label, NULL);
}
diff --git a/plug-ins/gimpressionist/size.c b/plug-ins/gimpressionist/size.c
index 703a0ea891..dc6fae40d0 100644
--- a/plug-ins/gimpressionist/size.c
+++ b/plug-ins/gimpressionist/size.c
@@ -30,10 +30,10 @@
#define NUMSIZERADIO 8
-static GtkAdjustment *sizenumadjust = NULL;
-static GtkAdjustment *sizefirstadjust = NULL;
-static GtkAdjustment *sizelastadjust = NULL;
-static GtkWidget *sizeradio[NUMSIZERADIO];
+static GtkWidget *sizenumadjust = NULL;
+static GtkWidget *sizefirstadjust = NULL;
+static GtkWidget *sizelastadjust = NULL;
+static GtkWidget *sizeradio[NUMSIZERADIO];
static void
size_store (GtkWidget *wg, void *d)
@@ -58,12 +58,12 @@ void
size_restore (void)
{
size_type_restore ();
- gtk_adjustment_set_value (sizenumadjust,
- pcvals.size_num);
- gtk_adjustment_set_value (sizefirstadjust,
- pcvals.size_first);
- gtk_adjustment_set_value (sizelastadjust,
- pcvals.size_last);
+ gimp_scale_entry_set_value (GIMP_SCALE_ENTRY (sizenumadjust),
+ pcvals.size_num);
+ gimp_scale_entry_set_value (GIMP_SCALE_ENTRY (sizefirstadjust),
+ pcvals.size_first);
+ gimp_scale_entry_set_value (GIMP_SCALE_ENTRY (sizelastadjust),
+ pcvals.size_last);
}
static void
@@ -104,40 +104,37 @@ create_sizepage (GtkNotebook *notebook)
gtk_widget_show (grid);
sizenumadjust =
- gimp_scale_entry_new (GTK_GRID (grid), 0, 0,
- _("Size variants:"),
- 150, -1, pcvals.size_num,
- 1.0, 30.0, 1.0, 1.0, 0,
- TRUE, 0, 0,
- _("The number of sizes of brushes to use"),
- NULL);
+ gimp_scale_entry_new2 (_("Size variants:"), pcvals.size_num, 1.0, 30.0, 0);
+ gimp_help_set_help_data (sizenumadjust,
+ _("The number of sizes of brushes to use"),
+ NULL);
g_signal_connect (sizenumadjust, "value-changed",
- G_CALLBACK (gimp_int_adjustment_update),
+ G_CALLBACK (gimpressionist_scale_entry_update_int),
&pcvals.size_num);
+ gtk_grid_attach (GTK_GRID (grid), sizenumadjust, 0, 0, 3, 1);
+ gtk_widget_show (sizenumadjust);
sizefirstadjust =
- gimp_scale_entry_new (GTK_GRID (grid), 0, 1,
- _("Minimum size:"),
- 150, -1, pcvals.size_first,
- 0.0, 360.0, 1.0, 10.0, 0,
- TRUE, 0, 0,
- _("The smallest brush to create"),
- NULL);
+ gimp_scale_entry_new2 (_("Minimum size:"), pcvals.size_first, 0.0, 360.0, 0);
+ gimp_help_set_help_data (sizefirstadjust,
+ _("The smallest brush to create"),
+ NULL);
g_signal_connect (sizefirstadjust, "value-changed",
- G_CALLBACK (gimp_double_adjustment_update),
+ G_CALLBACK (gimpressionist_scale_entry_update_double),
&pcvals.size_first);
+ gtk_grid_attach (GTK_GRID (grid), sizefirstadjust, 0, 1, 3, 1);
+ gtk_widget_show (sizefirstadjust);
sizelastadjust =
- gimp_scale_entry_new (GTK_GRID (grid), 0, 2,
- _("Maximum size:"),
- 150, -1, pcvals.size_last,
- 0.0, 360.0, 1.0, 10.0, 0,
- TRUE, 0, 0,
- _("The largest brush to create"),
- NULL);
+ gimp_scale_entry_new2 (_("Maximum size:"), pcvals.size_last, 0.0, 360.0, 0);
+ gimp_help_set_help_data (sizelastadjust,
+ _("The largest brush to create"),
+ NULL);
g_signal_connect (sizelastadjust, "value-changed",
- G_CALLBACK (gimp_double_adjustment_update),
+ G_CALLBACK (gimpressionist_scale_entry_update_double),
&pcvals.size_last);
+ gtk_grid_attach (GTK_GRID (grid), sizelastadjust, 0, 2, 3, 1);
+ gtk_widget_show (sizelastadjust);
box2 = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 12);
gtk_box_pack_start (GTK_BOX (thispage), box2,FALSE,FALSE,0);
diff --git a/plug-ins/gimpressionist/sizemap.c b/plug-ins/gimpressionist/sizemap.c
index f76c5dc157..4a742092e9 100644
--- a/plug-ins/gimpressionist/sizemap.c
+++ b/plug-ins/gimpressionist/sizemap.c
@@ -46,9 +46,9 @@ static GtkWidget *kill_button;
static GtkAdjustment *smvectprevbrightadjust = NULL;
-static GtkAdjustment *sizadjust = NULL;
-static GtkAdjustment *smstradjust = NULL;
-static GtkAdjustment *smstrexpadjust = NULL;
+static GtkWidget *sizadjust = NULL;
+static GtkWidget *smstradjust = NULL;
+static GtkWidget *smstrexpadjust = NULL;
static GtkWidget *size_voronoi = NULL;
#define OMWIDTH 150
@@ -61,7 +61,7 @@ static double
getsiz_from_gui (double x, double y)
{
return getsiz_proto (x,y, numsmvect, smvector,
- gtk_adjustment_get_value (smstrexpadjust),
+ gimp_scale_entry_get_value (GIMP_SCALE_ENTRY (smstrexpadjust)),
gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (size_voronoi)));
}
@@ -181,8 +181,8 @@ static void
updatesmsliders (void)
{
smadjignore = TRUE;
- gtk_adjustment_set_value (sizadjust, smvector[selectedsmvector].siz);
- gtk_adjustment_set_value (smstradjust, smvector[selectedsmvector].str);
+ gimp_scale_entry_set_value (GIMP_SCALE_ENTRY (sizadjust), smvector[selectedsmvector].siz);
+ gimp_scale_entry_set_value (GIMP_SCALE_ENTRY (smstradjust), smvector[selectedsmvector].str);
smadjignore = FALSE;
}
@@ -278,7 +278,7 @@ angsmadjmove (GtkWidget *w, gpointer data)
{
if (!smadjignore)
{
- smvector[selectedsmvector].siz = gtk_adjustment_get_value (sizadjust);
+ smvector[selectedsmvector].siz = gimp_scale_entry_get_value (GIMP_SCALE_ENTRY (sizadjust));
updatesmvectorprev ();
updatesmpreviewprev ();
}
@@ -289,7 +289,7 @@ strsmadjmove (GtkWidget *w, gpointer data)
{
if (!smadjignore)
{
- smvector[selectedsmvector].str = gtk_adjustment_get_value (smstradjust);
+ smvector[selectedsmvector].str = gimp_scale_entry_get_value (GIMP_SCALE_ENTRY (smstradjust));
updatesmvectorprev ();
updatesmpreviewprev ();
}
@@ -321,7 +321,7 @@ smresponse (GtkWidget *widget,
pcvals.size_vectors[i] = smvector[i];
pcvals.num_size_vectors = numsmvect;
- pcvals.size_strength_exponent = gtk_adjustment_get_value (smstrexpadjust);
+ pcvals.size_strength_exponent = gimp_scale_entry_get_value (GIMP_SCALE_ENTRY (smstrexpadjust));
pcvals.size_voronoi = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (size_voronoi));
}
break;
@@ -505,37 +505,36 @@ create_sizemap_dialog (GtkWidget *parent)
gtk_widget_show (grid2);
sizadjust =
- gimp_scale_entry_new (GTK_GRID (grid2), 0, 0,
- _("_Size:"),
- 150, 6, 50.0,
- 0.0, 100.0, 1.0, 10.0, 1,
- TRUE, 0, 0,
- _("Change the angle of the selected smvector"),
- NULL);
+ gimp_scale_entry_new2 (_("_Size:"), 50.0, 0.0, 100.0, 1);
+ gimp_help_set_help_data (sizadjust,
+ _("Change the angle of the selected smvector"),
+ NULL);
g_signal_connect (sizadjust, "value-changed",
G_CALLBACK (angsmadjmove), NULL);
+ gtk_grid_attach (GTK_GRID (grid2), sizadjust, 0, 0, 3, 1);
+ gtk_widget_show (sizadjust);
smstradjust =
- gimp_scale_entry_new (GTK_GRID (grid2), 0, 1,
- _("S_trength:"),
- 150, 6, 1.0,
- 0.1, 5.0, 0.1, 0.5, 1,
- TRUE, 0, 0,
- _("Change the strength of the selected smvector"),
- NULL);
+ gimp_scale_entry_new2 (_("S_trength:"), 1.0, 0.1, 5.0, 1);
+ gimp_scale_entry_set_increments (GIMP_SCALE_ENTRY (smstradjust), 0.1, 0.5);
+ gimp_help_set_help_data (smstradjust,
+ _("Change the strength of the selected smvector"),
+ NULL);
g_signal_connect (smstradjust, "value-changed",
G_CALLBACK (strsmadjmove), NULL);
+ gtk_grid_attach (GTK_GRID (grid2), smstradjust, 0, 1, 3, 1);
+ gtk_widget_show (smstradjust);
smstrexpadjust =
- gimp_scale_entry_new (GTK_GRID (grid2), 0, 2,
- _("St_rength exp.:"),
- 150, 6, 1.0,
- 0.1, 10.9, 0.1, 0.5, 1,
- TRUE, 0, 0,
- _("Change the exponent of the strength"),
- NULL);
+ gimp_scale_entry_new2 (_("St_rength exp.:"), 1.0, 0.1, 10.9, 1);
+ gimp_scale_entry_set_increments (GIMP_SCALE_ENTRY (smstradjust), 0.1, 0.5);
+ gimp_help_set_help_data (smstrexpadjust,
+ _("Change the exponent of the strength"),
+ NULL);
g_signal_connect (smstrexpadjust, "value-changed",
G_CALLBACK (smstrexpsmadjmove), NULL);
+ gtk_grid_attach (GTK_GRID (grid2), smstrexpadjust, 0, 2, 3, 1);
+ gtk_widget_show (smstrexpadjust);
size_voronoi = tmpw = gtk_check_button_new_with_mnemonic ( _("_Voronoi"));
gtk_grid_attach (GTK_GRID (grid2), tmpw, 3, 0, 1, 1);
diff --git a/plug-ins/gimpressionist/utils.c b/plug-ins/gimpressionist/utils.c
index 90002e5226..bf2c606948 100644
--- a/plug-ins/gimpressionist/utils.c
+++ b/plug-ins/gimpressionist/utils.c
@@ -409,3 +409,16 @@ create_radio_button (GtkWidget *box,
return tmpw;
}
+void
+gimpressionist_scale_entry_update_double (GimpScaleEntry *entry,
+ gdouble *value)
+{
+ *value = gimp_scale_entry_get_value (entry);
+}
+
+void
+gimpressionist_scale_entry_update_int (GimpScaleEntry *entry,
+ gint *value)
+{
+ *value = (gint) gimp_scale_entry_get_value (entry);
+}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]