Re: Change GtkAdjustment to double
- From: Owen Taylor <otaylor redhat com>
- To: gtk-devel-list gnome org
- Subject: Re: Change GtkAdjustment to double
- Date: 17 Mar 2001 19:54:02 -0500
Owen Taylor <otaylor redhat com> writes:
> I'd like to go ahead and change GtkAdjustment to use doubles not
> floats.
>
> Yes, usually, it doesn't matter much, but the fact that 32-bit
> integers dont' have exact representation as doubles makes for
> a trap that simply don't need to have.
>
> Plus, almost everywhere else in GTK+ and and the standard C library,
> doubles are used as the generic floating-point-number representation.
>
> So, if you object, whine quickly! ;-)
Patch to do this attached.
It's basically a (manually done) s/float/double/ in gtk+/gtk,
with the exceptions:
- floats used to represent alignment 0.0 <-> 1.0 were left
untouched
- GtkCurve was left untouched.
Some of the changes are strictly speaking unnecessary (clearly
the progress of a progressbar doesn't need to be represented
by a double..)
But I thought it was better to eliminate inconsistency and
conversions rather than to try to squeeze the last few bytes
out.
Regards,
Owen
Index: gtkadjustment.c
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtkadjustment.c,v
retrieving revision 1.22
diff -u -r1.22 gtkadjustment.c
--- gtkadjustment.c 2001/03/16 20:12:39 1.22
+++ gtkadjustment.c 2001/03/18 00:50:20
@@ -105,12 +105,12 @@
}
GtkObject*
-gtk_adjustment_new (gfloat value,
- gfloat lower,
- gfloat upper,
- gfloat step_increment,
- gfloat page_increment,
- gfloat page_size)
+gtk_adjustment_new (gdouble value,
+ gdouble lower,
+ gdouble upper,
+ gdouble step_increment,
+ gdouble page_increment,
+ gdouble page_size)
{
GtkAdjustment *adjustment;
@@ -128,7 +128,7 @@
void
gtk_adjustment_set_value (GtkAdjustment *adjustment,
- gfloat value)
+ gdouble value)
{
g_return_if_fail (adjustment != NULL);
g_return_if_fail (GTK_IS_ADJUSTMENT (adjustment));
@@ -163,8 +163,8 @@
void
gtk_adjustment_clamp_page (GtkAdjustment *adjustment,
- gfloat lower,
- gfloat upper)
+ gdouble lower,
+ gdouble upper)
{
gboolean need_emission;
Index: gtkadjustment.h
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtkadjustment.h,v
retrieving revision 1.14
diff -u -r1.14 gtkadjustment.h
--- gtkadjustment.h 2001/03/15 19:02:22 1.14
+++ gtkadjustment.h 2001/03/18 00:50:20
@@ -52,12 +52,12 @@
{
GtkObject parent_instance;
- gfloat lower;
- gfloat upper;
- gfloat value;
- gfloat step_increment;
- gfloat page_increment;
- gfloat page_size;
+ gdouble lower;
+ gdouble upper;
+ gdouble value;
+ gdouble step_increment;
+ gdouble page_increment;
+ gdouble page_size;
};
struct _GtkAdjustmentClass
@@ -70,19 +70,19 @@
GtkType gtk_adjustment_get_type (void) G_GNUC_CONST;
-GtkObject* gtk_adjustment_new (gfloat value,
- gfloat lower,
- gfloat upper,
- gfloat step_increment,
- gfloat page_increment,
- gfloat page_size);
+GtkObject* gtk_adjustment_new (gdouble value,
+ gdouble lower,
+ gdouble upper,
+ gdouble step_increment,
+ gdouble page_increment,
+ gdouble page_size);
void gtk_adjustment_changed (GtkAdjustment *adjustment);
void gtk_adjustment_value_changed (GtkAdjustment *adjustment);
void gtk_adjustment_clamp_page (GtkAdjustment *adjustment,
- gfloat lower,
- gfloat upper);
+ gdouble lower,
+ gdouble upper);
void gtk_adjustment_set_value (GtkAdjustment *adjustment,
- gfloat value);
+ gdouble value);
#ifdef __cplusplus
}
Index: gtkclist.c
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtkclist.c,v
retrieving revision 1.189
diff -u -r1.189 gtkclist.c
--- gtkclist.c 2001/03/12 14:09:12 1.189
+++ gtkclist.c 2001/03/18 00:50:20
@@ -6960,7 +6960,7 @@
move_horizontal (GtkCList *clist,
gint diff)
{
- gfloat value;
+ gdouble value;
if (!clist->hadjustment)
return;
@@ -6975,7 +6975,7 @@
gint row,
gfloat align)
{
- gfloat value;
+ gdouble value;
if (!clist->vadjustment)
return;
Index: gtkhruler.c
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtkhruler.c,v
retrieving revision 1.19
diff -u -r1.19 gtkhruler.c
--- gtkhruler.c 2001/01/04 17:48:42 1.19
+++ gtkhruler.c 2001/03/18 00:50:20
@@ -141,11 +141,11 @@
gint xthickness;
gint ythickness;
gint length, ideal_length;
- gfloat lower, upper; /* Upper and lower limits, in ruler units */
- gfloat increment; /* Number of pixels per unit */
+ gdouble lower, upper; /* Upper and lower limits, in ruler units */
+ gdouble increment; /* Number of pixels per unit */
gint scale; /* Number of units per major unit */
- gfloat subd_incr;
- gfloat start, end, cur;
+ gdouble subd_incr;
+ gdouble start, end, cur;
gchar unit_str[32];
gint digit_height;
gint digit_offset;
@@ -199,7 +199,7 @@
if ((upper - lower) == 0)
return;
- increment = (gfloat) width / (upper - lower);
+ increment = (gdouble) width / (upper - lower);
/* determine the scale
* We calculate the text size as for the vruler instead of using
@@ -221,8 +221,8 @@
length = 0;
for (i = MAXIMUM_SUBDIVIDE - 1; i >= 0; i--)
{
- subd_incr = (gfloat) ruler->metric->ruler_scale[scale] /
- (gfloat) ruler->metric->subdivide[i];
+ subd_incr = (gdouble) ruler->metric->ruler_scale[scale] /
+ (gdouble) ruler->metric->subdivide[i];
if (subd_incr * fabs(increment) <= MINIMUM_INCR)
continue;
@@ -287,7 +287,7 @@
gint bs_width, bs_height;
gint xthickness;
gint ythickness;
- gfloat increment;
+ gdouble increment;
g_return_if_fail (ruler != NULL);
g_return_if_fail (GTK_IS_HRULER (ruler));
@@ -317,7 +317,7 @@
ruler->xsrc, ruler->ysrc,
bs_width, bs_height);
- increment = (gfloat) width / (ruler->upper - ruler->lower);
+ increment = (gdouble) width / (ruler->upper - ruler->lower);
x = ROUND ((ruler->position - ruler->lower) * increment) + (xthickness - bs_width) / 2 - 1;
y = (height + bs_height) / 2 + ythickness;
Index: gtklayout.c
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtklayout.c,v
retrieving revision 1.36
diff -u -r1.36 gtklayout.c
--- gtklayout.c 2001/03/09 13:28:25 1.36
+++ gtklayout.c 2001/03/18 00:50:20
@@ -269,11 +269,12 @@
}
static void
-gtk_layout_set_adjustment_upper (GtkAdjustment *adj, gfloat upper)
+gtk_layout_set_adjustment_upper (GtkAdjustment *adj,
+ gdouble upper)
{
if (upper != adj->upper)
{
- gfloat min = MAX (0., upper - adj->page_size);
+ gdouble min = MAX (0., upper - adj->page_size);
gboolean value_changed = FALSE;
adj->upper = upper;
Index: gtklist.c
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtklist.c,v
retrieving revision 1.56
diff -u -r1.56 gtklist.c
--- gtklist.c 2001/03/09 13:28:25 1.56
+++ gtklist.c 2001/03/18 00:50:20
@@ -582,7 +582,7 @@
(x > adj->value + adj->page_size &&
adj->value >= adj->upper - adj->page_size)))
{
- gfloat value;
+ gdouble value;
if (x < adj->value)
value = adj->value + (x - adj->value) / 2 - 1;
Index: gtkprogress.c
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtkprogress.c,v
retrieving revision 1.12
diff -u -r1.12 gtkprogress.c
--- gtkprogress.c 2001/03/16 20:12:40 1.12
+++ gtkprogress.c 2001/03/18 00:50:20
@@ -348,8 +348,8 @@
static gchar *
gtk_progress_build_string (GtkProgress *progress,
- gfloat value,
- gfloat percentage)
+ gdouble value,
+ gdouble percentage)
{
gchar buf[256] = { 0 };
gchar tmp[256] = { 0 };
@@ -493,9 +493,9 @@
void
gtk_progress_configure (GtkProgress *progress,
- gfloat value,
- gfloat min,
- gfloat max)
+ gdouble value,
+ gdouble min,
+ gdouble max)
{
GtkAdjustment *adj;
gboolean changed = FALSE;
@@ -523,7 +523,7 @@
void
gtk_progress_set_percentage (GtkProgress *progress,
- gfloat percentage)
+ gdouble percentage)
{
g_return_if_fail (progress != NULL);
g_return_if_fail (GTK_IS_PROGRESS (progress));
@@ -535,7 +535,7 @@
(progress->adjustment->upper - progress->adjustment->lower));
}
-gfloat
+gdouble
gtk_progress_get_current_percentage (GtkProgress *progress)
{
g_return_val_if_fail (progress != NULL, 0);
@@ -548,9 +548,9 @@
(progress->adjustment->upper - progress->adjustment->lower));
}
-gfloat
+gdouble
gtk_progress_get_percentage_from_value (GtkProgress *progress,
- gfloat value)
+ gdouble value)
{
g_return_val_if_fail (progress != NULL, 0);
g_return_val_if_fail (GTK_IS_PROGRESS (progress), 0);
@@ -568,7 +568,7 @@
void
gtk_progress_set_value (GtkProgress *progress,
- gfloat value)
+ gdouble value)
{
g_return_if_fail (progress != NULL);
g_return_if_fail (GTK_IS_PROGRESS (progress));
@@ -580,7 +580,7 @@
gtk_adjustment_set_value (progress->adjustment, value);
}
-gfloat
+gdouble
gtk_progress_get_value (GtkProgress *progress)
{
g_return_val_if_fail (progress != NULL, 0);
@@ -663,7 +663,7 @@
gchar *
gtk_progress_get_text_from_value (GtkProgress *progress,
- gfloat value)
+ gdouble value)
{
g_return_val_if_fail (progress != NULL, 0);
g_return_val_if_fail (GTK_IS_PROGRESS (progress), 0);
Index: gtkprogress.h
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtkprogress.h,v
retrieving revision 1.11
diff -u -r1.11 gtkprogress.h
--- gtkprogress.h 2001/03/16 20:12:40 1.11
+++ gtkprogress.h 2001/03/18 00:50:20
@@ -93,22 +93,22 @@
void gtk_progress_set_adjustment (GtkProgress *progress,
GtkAdjustment *adjustment);
void gtk_progress_configure (GtkProgress *progress,
- gfloat value,
- gfloat min,
- gfloat max);
+ gdouble value,
+ gdouble min,
+ gdouble max);
void gtk_progress_set_percentage (GtkProgress *progress,
- gfloat percentage);
+ gdouble percentage);
void gtk_progress_set_value (GtkProgress *progress,
- gfloat value);
-gfloat gtk_progress_get_value (GtkProgress *progress);
+ gdouble value);
+gdouble gtk_progress_get_value (GtkProgress *progress);
void gtk_progress_set_activity_mode (GtkProgress *progress,
gboolean activity_mode);
gchar* gtk_progress_get_current_text (GtkProgress *progress);
gchar* gtk_progress_get_text_from_value (GtkProgress *progress,
- gfloat value);
-gfloat gtk_progress_get_current_percentage (GtkProgress *progress);
-gfloat gtk_progress_get_percentage_from_value (GtkProgress *progress,
- gfloat value);
+ gdouble value);
+gdouble gtk_progress_get_current_percentage (GtkProgress *progress);
+gdouble gtk_progress_get_percentage_from_value (GtkProgress *progress,
+ gdouble value);
#endif /* GTK_DISABLE_DEPRECATED */
Index: gtkprogressbar.c
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtkprogressbar.c,v
retrieving revision 1.27
diff -u -r1.27 gtkprogressbar.c
--- gtkprogressbar.c 2001/02/17 17:21:21 1.27
+++ gtkprogressbar.c 2001/03/18 00:50:20
@@ -138,11 +138,11 @@
GTK_ARG_READWRITE,
ARG_DISCRETE_BLOCKS);
gtk_object_add_arg_type ("GtkProgressBar::fraction",
- GTK_TYPE_FLOAT,
+ GTK_TYPE_DOUBLE,
GTK_ARG_READWRITE,
ARG_FRACTION);
gtk_object_add_arg_type ("GtkProgressBar::pulse_step",
- GTK_TYPE_FLOAT,
+ GTK_TYPE_DOUBLE,
GTK_ARG_READWRITE,
ARG_PULSE_STEP);
gtk_object_add_arg_type ("GtkProgressBar::text",
@@ -204,10 +204,10 @@
gtk_progress_bar_set_discrete_blocks (pbar, GTK_VALUE_UINT (*arg));
break;
case ARG_FRACTION:
- gtk_progress_bar_set_fraction (pbar, GTK_VALUE_FLOAT (*arg));
+ gtk_progress_bar_set_fraction (pbar, GTK_VALUE_DOUBLE (*arg));
break;
case ARG_PULSE_STEP:
- gtk_progress_bar_set_pulse_step (pbar, GTK_VALUE_FLOAT (*arg));
+ gtk_progress_bar_set_pulse_step (pbar, GTK_VALUE_DOUBLE (*arg));
break;
case ARG_TEXT:
gtk_progress_bar_set_text (pbar, GTK_VALUE_STRING (*arg));
@@ -247,10 +247,10 @@
GTK_VALUE_UINT (*arg) = pbar->blocks;
break;
case ARG_FRACTION:
- GTK_VALUE_FLOAT (*arg) = gtk_progress_get_current_percentage (GTK_PROGRESS (pbar));
+ GTK_VALUE_DOUBLE (*arg) = gtk_progress_get_current_percentage (GTK_PROGRESS (pbar));
break;
case ARG_PULSE_STEP:
- GTK_VALUE_FLOAT (*arg) = pbar->pulse_fraction;
+ GTK_VALUE_DOUBLE (*arg) = pbar->pulse_fraction;
break;
case ARG_TEXT:
GTK_VALUE_STRING (*arg) = g_strdup (gtk_progress_bar_get_text (pbar));
@@ -377,7 +377,7 @@
gint in_block;
in_block = -1 + (gint)(gtk_progress_get_current_percentage (progress) *
- (gfloat)pbar->blocks);
+ (gdouble)pbar->blocks);
if (pbar->in_block != in_block)
{
@@ -515,7 +515,7 @@
gint i;
gint x;
gint y;
- gfloat percentage;
+ gdouble percentage;
gint size;
g_return_if_fail (progress != NULL);
@@ -804,7 +804,7 @@
**/
void
gtk_progress_bar_set_fraction (GtkProgressBar *pbar,
- gfloat fraction)
+ gdouble fraction)
{
g_return_if_fail (pbar != NULL);
g_return_if_fail (GTK_IS_PROGRESS_BAR (pbar));
@@ -885,7 +885,7 @@
**/
void
gtk_progress_bar_set_pulse_step (GtkProgressBar *pbar,
- gfloat fraction)
+ gdouble fraction)
{
g_return_if_fail (pbar != NULL);
g_return_if_fail (GTK_IS_PROGRESS_BAR (pbar));
@@ -897,7 +897,7 @@
void
gtk_progress_bar_update (GtkProgressBar *pbar,
- gfloat percentage)
+ gdouble percentage)
{
g_return_if_fail (pbar != NULL);
g_return_if_fail (GTK_IS_PROGRESS_BAR (pbar));
@@ -965,7 +965,7 @@
*
* Return value: a fraction from 0.0 to 1.0
**/
-gfloat
+gdouble
gtk_progress_bar_get_fraction (GtkProgressBar *pbar)
{
g_return_val_if_fail (GTK_IS_PROGRESS_BAR (pbar), 0);
@@ -981,7 +981,7 @@
*
* Return value: a fraction from 0.0 to 1.0
**/
-gfloat
+gdouble
gtk_progress_bar_get_pulse_step (GtkProgressBar *pbar)
{
g_return_val_if_fail (GTK_IS_PROGRESS_BAR (pbar), 0);
Index: gtkprogressbar.h
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtkprogressbar.h,v
retrieving revision 1.14
diff -u -r1.14 gtkprogressbar.h
--- gtkprogressbar.h 2001/02/17 17:21:21 1.14
+++ gtkprogressbar.h 2001/03/18 00:50:20
@@ -76,7 +76,7 @@
guint activity_step;
guint activity_blocks;
- gfloat pulse_fraction;
+ gdouble pulse_fraction;
guint activity_dir : 1;
};
@@ -121,16 +121,16 @@
void gtk_progress_bar_set_text (GtkProgressBar *pbar,
const gchar *text);
void gtk_progress_bar_set_fraction (GtkProgressBar *pbar,
- gfloat fraction);
+ gdouble fraction);
void gtk_progress_bar_set_pulse_step (GtkProgressBar *pbar,
- gfloat fraction);
+ gdouble fraction);
void gtk_progress_bar_set_orientation (GtkProgressBar *pbar,
GtkProgressBarOrientation orientation);
G_CONST_RETURN gchar* gtk_progress_bar_get_text (GtkProgressBar *pbar);
-gfloat gtk_progress_bar_get_fraction (GtkProgressBar *pbar);
-gfloat gtk_progress_bar_get_pulse_step (GtkProgressBar *pbar);
+gdouble gtk_progress_bar_get_fraction (GtkProgressBar *pbar);
+gdouble gtk_progress_bar_get_pulse_step (GtkProgressBar *pbar);
GtkProgressBarOrientation gtk_progress_bar_get_orientation (GtkProgressBar *pbar);
@@ -152,7 +152,7 @@
void gtk_progress_bar_set_activity_blocks (GtkProgressBar *pbar,
guint blocks);
void gtk_progress_bar_update (GtkProgressBar *pbar,
- gfloat percentage);
+ gdouble percentage);
#endif /* GTK_DISABLE_DEPRECATED */
Index: gtkrange.c
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtkrange.c,v
retrieving revision 1.46
diff -u -r1.46 gtkrange.c
--- gtkrange.c 2001/03/02 17:06:11 1.46
+++ gtkrange.c 2001/03/18 00:50:20
@@ -74,7 +74,7 @@
static void gtk_real_range_draw_slider (GtkRange *range);
static gint gtk_real_range_timer (GtkRange *range);
static gint gtk_range_scroll (GtkRange *range,
- gfloat jump_perc);
+ gdouble jump_perc);
static void gtk_range_add_timer (GtkRange *range);
static void gtk_range_remove_timer (GtkRange *range);
@@ -392,10 +392,10 @@
}
gint
-_gtk_range_trough_click (GtkRange *range,
- gint x,
- gint y,
- gfloat *jump_perc)
+_gtk_range_trough_click (GtkRange *range,
+ gint x,
+ gint y,
+ gdouble *jump_perc)
{
g_return_val_if_fail (range != NULL, GTK_TROUGH_NONE);
g_return_val_if_fail (GTK_IS_RANGE (range), GTK_TROUGH_NONE);
@@ -534,10 +534,10 @@
}
gint
-_gtk_range_default_htrough_click (GtkRange *range,
- gint x,
- gint y,
- gfloat *jump_perc)
+_gtk_range_default_htrough_click (GtkRange *range,
+ gint x,
+ gint y,
+ gdouble *jump_perc)
{
gint ythickness;
gint trough_width;
@@ -583,10 +583,10 @@
}
gint
-_gtk_range_default_vtrough_click (GtkRange *range,
- gint x,
- gint y,
- gfloat *jump_perc)
+_gtk_range_default_vtrough_click (GtkRange *range,
+ gint x,
+ gint y,
+ gdouble *jump_perc)
{
gint xthickness;
gint trough_width;
@@ -673,7 +673,7 @@
char buffer[64];
sprintf (buffer, "%0.*f", range->digits, range->adjustment->value);
- sscanf (buffer, "%f", &range->adjustment->value);
+ sscanf (buffer, "%lf", &range->adjustment->value);
}
if (old_value != range->adjustment->value)
@@ -741,7 +741,7 @@
char buffer[64];
sprintf (buffer, "%0.*f", range->digits, range->adjustment->value);
- sscanf (buffer, "%f", &range->adjustment->value);
+ sscanf (buffer, "%lf", &range->adjustment->value);
}
if (old_value != range->adjustment->value)
@@ -873,7 +873,7 @@
{
GtkRange *range;
gint trough_part;
- gfloat jump_perc;
+ gdouble jump_perc;
g_return_val_if_fail (GTK_IS_RANGE (widget), FALSE);
g_return_val_if_fail (event != NULL, FALSE);
@@ -1027,9 +1027,9 @@
if (GTK_WIDGET_REALIZED (range))
{
GtkAdjustment *adj = GTK_RANGE (range)->adjustment;
- gfloat new_value = adj->value + ((event->direction == GDK_SCROLL_UP) ?
- -adj->page_increment / 2:
- adj->page_increment / 2);
+ gdouble new_value = adj->value + ((event->direction == GDK_SCROLL_UP) ?
+ -adj->page_increment / 2:
+ adj->page_increment / 2);
new_value = CLAMP (new_value, adj->lower, adj->upper - adj->page_size);
gtk_adjustment_set_value (adj, new_value);
}
@@ -1356,10 +1356,10 @@
}
static gint
-gtk_range_scroll (GtkRange *range,
- gfloat jump_perc)
+gtk_range_scroll (GtkRange *range,
+ gdouble jump_perc)
{
- gfloat new_value;
+ gdouble new_value;
gint return_val;
GtkScrollType scroll_type;
Index: gtkrange.h
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtkrange.h,v
retrieving revision 1.14
diff -u -r1.14 gtkrange.h
--- gtkrange.h 2001/02/19 22:51:14 1.14
+++ gtkrange.h 2001/03/18 00:50:20
@@ -73,10 +73,10 @@
guint32 timer;
- gfloat old_value;
- gfloat old_lower;
- gfloat old_upper;
- gfloat old_page_size;
+ gdouble old_value;
+ gdouble old_lower;
+ gdouble old_upper;
+ gdouble old_page_size;
GtkAdjustment *adjustment;
};
@@ -105,7 +105,7 @@
gint (* trough_click) (GtkRange *range,
gint x,
gint y,
- gfloat *jump_perc);
+ gdouble *jump_perc);
gint (* trough_keys) (GtkRange *range,
GdkEventKey *key,
GtkScrollType *scroll,
@@ -138,18 +138,18 @@
gint _gtk_range_trough_click (GtkRange *range,
gint x,
gint y,
- gfloat *jump_perc);
+ gdouble *jump_perc);
void _gtk_range_default_hslider_update (GtkRange *range);
void _gtk_range_default_vslider_update (GtkRange *range);
gint _gtk_range_default_htrough_click (GtkRange *range,
gint x,
gint y,
- gfloat *jump_perc);
+ gdouble *jump_perc);
gint _gtk_range_default_vtrough_click (GtkRange *range,
gint x,
gint y,
- gfloat *jump_perc);
+ gdouble *jump_perc);
void _gtk_range_default_hmotion (GtkRange *range,
gint xdelta,
gint ydelta);
Index: gtkruler.c
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtkruler.c,v
retrieving revision 1.19
diff -u -r1.19 gtkruler.c
--- gtkruler.c 2000/07/26 11:32:45 1.19
+++ gtkruler.c 2001/03/18 00:50:20
@@ -107,13 +107,13 @@
class->draw_ticks = NULL;
class->draw_pos = NULL;
- gtk_object_add_arg_type ("GtkRuler::lower", GTK_TYPE_FLOAT,
+ gtk_object_add_arg_type ("GtkRuler::lower", GTK_TYPE_DOUBLE,
GTK_ARG_READWRITE, ARG_LOWER);
- gtk_object_add_arg_type ("GtkRuler::upper", GTK_TYPE_FLOAT,
+ gtk_object_add_arg_type ("GtkRuler::upper", GTK_TYPE_DOUBLE,
GTK_ARG_READWRITE, ARG_UPPER);
- gtk_object_add_arg_type ("GtkRuler::position", GTK_TYPE_FLOAT,
+ gtk_object_add_arg_type ("GtkRuler::position", GTK_TYPE_DOUBLE,
GTK_ARG_READWRITE, ARG_POSITION);
- gtk_object_add_arg_type ("GtkRuler::max_size", GTK_TYPE_FLOAT,
+ gtk_object_add_arg_type ("GtkRuler::max_size", GTK_TYPE_DOUBLE,
GTK_ARG_READWRITE, ARG_MAX_SIZE);
}
@@ -143,20 +143,20 @@
switch (arg_id)
{
case ARG_LOWER:
- gtk_ruler_set_range (ruler, GTK_VALUE_FLOAT (*arg), ruler->upper,
+ gtk_ruler_set_range (ruler, GTK_VALUE_DOUBLE (*arg), ruler->upper,
ruler->position, ruler->max_size);
break;
case ARG_UPPER:
- gtk_ruler_set_range (ruler, ruler->lower, GTK_VALUE_FLOAT (*arg),
+ gtk_ruler_set_range (ruler, ruler->lower, GTK_VALUE_DOUBLE (*arg),
ruler->position, ruler->max_size);
break;
case ARG_POSITION:
gtk_ruler_set_range (ruler, ruler->lower, ruler->upper,
- GTK_VALUE_FLOAT (*arg), ruler->max_size);
+ GTK_VALUE_DOUBLE (*arg), ruler->max_size);
break;
case ARG_MAX_SIZE:
gtk_ruler_set_range (ruler, ruler->lower, ruler->upper,
- ruler->position, GTK_VALUE_FLOAT (*arg));
+ ruler->position, GTK_VALUE_DOUBLE (*arg));
break;
}
}
@@ -171,16 +171,16 @@
switch (arg_id)
{
case ARG_LOWER:
- GTK_VALUE_FLOAT (*arg) = ruler->lower;
+ GTK_VALUE_DOUBLE (*arg) = ruler->lower;
break;
case ARG_UPPER:
- GTK_VALUE_FLOAT (*arg) = ruler->upper;
+ GTK_VALUE_DOUBLE (*arg) = ruler->upper;
break;
case ARG_POSITION:
- GTK_VALUE_FLOAT (*arg) = ruler->position;
+ GTK_VALUE_DOUBLE (*arg) = ruler->position;
break;
case ARG_MAX_SIZE:
- GTK_VALUE_FLOAT (*arg) = ruler->max_size;
+ GTK_VALUE_DOUBLE (*arg) = ruler->max_size;
break;
default:
arg->type = GTK_TYPE_INVALID;
@@ -203,10 +203,10 @@
void
gtk_ruler_set_range (GtkRuler *ruler,
- gfloat lower,
- gfloat upper,
- gfloat position,
- gfloat max_size)
+ gdouble lower,
+ gdouble upper,
+ gdouble position,
+ gdouble max_size)
{
g_return_if_fail (ruler != NULL);
g_return_if_fail (GTK_IS_RULER (ruler));
Index: gtkruler.h
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtkruler.h,v
retrieving revision 1.10
diff -u -r1.10 gtkruler.h
--- gtkruler.h 2001/02/03 01:09:40 1.10
+++ gtkruler.h 2001/03/18 00:50:20
@@ -73,13 +73,13 @@
gint slider_size;
/* The upper limit of the ruler (in points) */
- gfloat lower;
+ gdouble lower;
/* The lower limit of the ruler */
- gfloat upper;
+ gdouble upper;
/* The position of the mark on the ruler */
- gfloat position;
+ gdouble position;
/* The maximum size of the ruler */
- gfloat max_size;
+ gdouble max_size;
};
struct _GtkRulerClass
@@ -96,8 +96,8 @@
gchar *abbrev;
/* This should be points_per_unit. This is the size of the unit
* in 1/72nd's of an inch and has nothing to do with screen pixels */
- gfloat pixels_per_unit;
- gfloat ruler_scale[10];
+ gdouble pixels_per_unit;
+ gdouble ruler_scale[10];
gint subdivide[5]; /* five possible modes of subdivision */
};
@@ -106,10 +106,10 @@
void gtk_ruler_set_metric (GtkRuler *ruler,
GtkMetricType metric);
void gtk_ruler_set_range (GtkRuler *ruler,
- gfloat lower,
- gfloat upper,
- gfloat position,
- gfloat max_size);
+ gdouble lower,
+ gdouble upper,
+ gdouble position,
+ gdouble max_size);
void gtk_ruler_draw_ticks (GtkRuler *ruler);
void gtk_ruler_draw_pos (GtkRuler *ruler);
Index: gtkscale.c
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtkscale.c,v
retrieving revision 1.21
diff -u -r1.21 gtkscale.c
--- gtkscale.c 2000/07/26 11:32:46 1.21
+++ gtkscale.c 2001/03/18 00:50:20
@@ -274,7 +274,7 @@
PangoLayout *layout;
PangoRectangle logical_rect;
gchar buffer[128];
- gfloat value;
+ gdouble value;
gint digits;
gint i, j;
Index: gtkscrolledwindow.c
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtkscrolledwindow.c,v
retrieving revision 1.47
diff -u -r1.47 gtkscrolledwindow.c
--- gtkscrolledwindow.c 2001/03/09 13:28:25 1.47
+++ gtkscrolledwindow.c 2001/03/18 00:50:20
@@ -949,7 +949,7 @@
if (range && GTK_WIDGET_VISIBLE (range))
{
GtkAdjustment *adj = GTK_RANGE (range)->adjustment;
- gfloat new_value;
+ gdouble new_value;
if (event->direction == GDK_SCROLL_UP || event->direction == GDK_SCROLL_LEFT)
new_value = adj->value - adj->page_increment / 2;
Index: gtkspinbutton.c
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtkspinbutton.c,v
retrieving revision 1.52
diff -u -r1.52 gtkspinbutton.c
--- gtkspinbutton.c 2001/03/08 01:55:28 1.52
+++ gtkspinbutton.c 2001/03/18 00:50:20
@@ -111,15 +111,15 @@
GdkEventScroll *event);
static void gtk_spin_button_activate (GtkEntry *entry);
static void gtk_spin_button_snap (GtkSpinButton *spin_button,
- gfloat val);
+ gdouble val);
static void gtk_spin_button_insert_text (GtkEntry *entry,
const gchar *new_text,
gint new_text_length,
gint *position);
static void gtk_spin_button_real_spin (GtkSpinButton *spin_button,
- gfloat step);
+ gdouble step);
static gint gtk_spin_button_default_input (GtkSpinButton *spin_button,
- gfloat *new_val);
+ gdouble *new_val);
static gint gtk_spin_button_default_output (GtkSpinButton *spin_button);
@@ -198,7 +198,7 @@
GTK_ARG_READWRITE,
ARG_ADJUSTMENT);
gtk_object_add_arg_type ("GtkSpinButton::climb_rate",
- GTK_TYPE_FLOAT,
+ GTK_TYPE_DOUBLE,
GTK_ARG_READWRITE,
ARG_CLIMB_RATE);
gtk_object_add_arg_type ("GtkSpinButton::digits",
@@ -226,7 +226,7 @@
GTK_ARG_READWRITE,
ARG_SHADOW_TYPE);
gtk_object_add_arg_type ("GtkSpinButton::value",
- GTK_TYPE_FLOAT,
+ GTK_TYPE_DOUBLE,
GTK_ARG_READWRITE,
ARG_VALUE);
@@ -269,7 +269,7 @@
case ARG_CLIMB_RATE:
gtk_spin_button_configure (spin_button,
spin_button->adjustment,
- GTK_VALUE_FLOAT (*arg),
+ GTK_VALUE_DOUBLE (*arg),
spin_button->digits);
break;
case ARG_DIGITS:
@@ -294,7 +294,7 @@
gtk_spin_button_set_shadow_type (spin_button, GTK_VALUE_ENUM (*arg));
break;
case ARG_VALUE:
- gtk_spin_button_set_value (spin_button, GTK_VALUE_FLOAT (*arg));
+ gtk_spin_button_set_value (spin_button, GTK_VALUE_DOUBLE (*arg));
break;
default:
break;
@@ -316,7 +316,7 @@
GTK_VALUE_POINTER (*arg) = spin_button->adjustment;
break;
case ARG_CLIMB_RATE:
- GTK_VALUE_FLOAT (*arg) = spin_button->climb_rate;
+ GTK_VALUE_DOUBLE (*arg) = spin_button->climb_rate;
break;
case ARG_DIGITS:
GTK_VALUE_UINT (*arg) = spin_button->digits;
@@ -337,7 +337,7 @@
GTK_VALUE_ENUM (*arg) = spin_button->shadow_type;
break;
case ARG_VALUE:
- GTK_VALUE_FLOAT (*arg) = spin_button->adjustment->value;
+ GTK_VALUE_DOUBLE (*arg) = spin_button->adjustment->value;
break;
default:
arg->type = GTK_TYPE_INVALID;
@@ -931,7 +931,7 @@
if (spin->click_child == GTK_ARROW_UP &&
event->y <= widget->requisition.height / 2)
{
- gfloat diff;
+ gdouble diff;
diff = spin->adjustment->upper - spin->adjustment->value;
if (diff > EPSILON)
@@ -940,7 +940,7 @@
else if (spin->click_child == GTK_ARROW_DOWN &&
event->y > widget->requisition.height / 2)
{
- gfloat diff;
+ gdouble diff;
diff = spin->adjustment->value - spin->adjustment->lower;
if (diff > EPSILON)
@@ -1151,7 +1151,7 @@
if (event->state & GDK_CONTROL_MASK)
{
- gfloat diff = spin->adjustment->upper - spin->adjustment->value;
+ gdouble diff = spin->adjustment->upper - spin->adjustment->value;
if (diff > EPSILON)
gtk_spin_button_real_spin (spin, diff);
}
@@ -1163,7 +1163,7 @@
if (event->state & GDK_CONTROL_MASK)
{
- gfloat diff = spin->adjustment->value - spin->adjustment->lower;
+ gdouble diff = spin->adjustment->value - spin->adjustment->lower;
if (diff > EPSILON)
gtk_spin_button_real_spin (spin, -diff);
}
@@ -1195,10 +1195,10 @@
static void
gtk_spin_button_snap (GtkSpinButton *spin_button,
- gfloat val)
+ gdouble val)
{
- gfloat inc;
- gfloat tmp;
+ gdouble inc;
+ gdouble tmp;
inc = spin_button->adjustment->step_increment;
tmp = (val - spin_button->adjustment->lower) / inc;
@@ -1309,10 +1309,10 @@
static void
gtk_spin_button_real_spin (GtkSpinButton *spin_button,
- gfloat increment)
+ gdouble increment)
{
GtkAdjustment *adj;
- gfloat new_value = 0.0;
+ gdouble new_value = 0.0;
g_return_if_fail (spin_button != NULL);
g_return_if_fail (GTK_IS_SPIN_BUTTON (spin_button));
@@ -1352,7 +1352,7 @@
static gint
gtk_spin_button_default_input (GtkSpinButton *spin_button,
- gfloat *new_val)
+ gdouble *new_val)
{
gchar *err = NULL;
@@ -1385,7 +1385,7 @@
void
gtk_spin_button_configure (GtkSpinButton *spin_button,
GtkAdjustment *adjustment,
- gfloat climb_rate,
+ gdouble climb_rate,
guint digits)
{
g_return_if_fail (spin_button != NULL);
@@ -1404,7 +1404,7 @@
GtkWidget *
gtk_spin_button_new (GtkAdjustment *adjustment,
- gfloat climb_rate,
+ gdouble climb_rate,
guint digits)
{
GtkSpinButton *spin;
@@ -1490,7 +1490,7 @@
}
}
-gfloat
+gdouble
gtk_spin_button_get_value_as_float (GtkSpinButton *spin_button)
{
g_return_val_if_fail (spin_button != NULL, 0.0);
@@ -1502,7 +1502,7 @@
gint
gtk_spin_button_get_value_as_int (GtkSpinButton *spin_button)
{
- gfloat val;
+ gdouble val;
g_return_val_if_fail (spin_button != NULL, 0);
g_return_val_if_fail (GTK_IS_SPIN_BUTTON (spin_button), 0);
@@ -1516,7 +1516,7 @@
void
gtk_spin_button_set_value (GtkSpinButton *spin_button,
- gfloat value)
+ gdouble value)
{
g_return_if_fail (spin_button != NULL);
g_return_if_fail (GTK_IS_SPIN_BUTTON (spin_button));
@@ -1600,10 +1600,10 @@
void
gtk_spin_button_spin (GtkSpinButton *spin_button,
GtkSpinType direction,
- gfloat increment)
+ gdouble increment)
{
GtkAdjustment *adj;
- gfloat diff;
+ gdouble diff;
g_return_if_fail (spin_button != NULL);
g_return_if_fail (GTK_IS_SPIN_BUTTON (spin_button));
@@ -1670,7 +1670,7 @@
void
gtk_spin_button_update (GtkSpinButton *spin_button)
{
- gfloat val;
+ gdouble val;
gint error = 0;
gint return_val;
Index: gtkspinbutton.h
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtkspinbutton.h,v
retrieving revision 1.21
diff -u -r1.21 gtkspinbutton.h
--- gtkspinbutton.h 2000/09/07 18:07:57 1.21
+++ gtkspinbutton.h 2001/03/18 00:50:20
@@ -84,8 +84,8 @@
guint32 timer;
guint32 ev_time;
- gfloat climb_rate;
- gfloat timer_step;
+ gdouble climb_rate;
+ gdouble timer_step;
GtkSpinButtonUpdatePolicy update_policy;
@@ -105,7 +105,7 @@
GtkEntryClass parent_class;
gint (*input) (GtkSpinButton *spin_button,
- gfloat *new_value);
+ gdouble *new_value);
gint (*output) (GtkSpinButton *spin_button);
};
@@ -114,11 +114,11 @@
void gtk_spin_button_configure (GtkSpinButton *spin_button,
GtkAdjustment *adjustment,
- gfloat climb_rate,
+ gdouble climb_rate,
guint digits);
GtkWidget* gtk_spin_button_new (GtkAdjustment *adjustment,
- gfloat climb_rate,
+ gdouble climb_rate,
guint digits);
void gtk_spin_button_set_adjustment (GtkSpinButton *spin_button,
@@ -129,12 +129,12 @@
void gtk_spin_button_set_digits (GtkSpinButton *spin_button,
guint digits);
-gfloat gtk_spin_button_get_value_as_float (GtkSpinButton *spin_button);
+gdouble gtk_spin_button_get_value_as_float (GtkSpinButton *spin_button);
gint gtk_spin_button_get_value_as_int (GtkSpinButton *spin_button);
void gtk_spin_button_set_value (GtkSpinButton *spin_button,
- gfloat value);
+ gdouble value);
void gtk_spin_button_set_update_policy (GtkSpinButton *spin_button,
GtkSpinButtonUpdatePolicy policy);
@@ -144,7 +144,7 @@
void gtk_spin_button_spin (GtkSpinButton *spin_button,
GtkSpinType direction,
- gfloat increment);
+ gdouble increment);
void gtk_spin_button_set_wrap (GtkSpinButton *spin_button,
gboolean wrap);
Index: gtktext.c
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtktext.c,v
retrieving revision 1.96
diff -u -r1.96 gtktext.c
--- gtktext.c 2001/03/16 20:12:40 1.96
+++ gtktext.c 2001/03/18 00:50:20
@@ -4225,8 +4225,8 @@
gdk_window_get_size (text->text_area, NULL, &height);
- adj->step_increment = MIN (adj->upper, (float) SCROLL_PIXELS);
- adj->page_increment = MIN (adj->upper, height - (float) KEY_SCROLL_PIXELS);
+ adj->step_increment = MIN (adj->upper, SCROLL_PIXELS);
+ adj->page_increment = MIN (adj->upper, height - KEY_SCROLL_PIXELS);
adj->page_size = MIN (adj->upper, height);
adj->value = MIN (adj->value, adj->upper - adj->page_size);
adj->value = MAX (adj->value, 0.0);
@@ -4254,7 +4254,7 @@
text->first_cut_pixels = 0;
}
- text->vadj->value = (float) text->first_onscreen_ver_pixel;
+ text->vadj->value = text->first_onscreen_ver_pixel;
}
svdata->pixel_height += LINE_HEIGHT (*lp);
@@ -4300,13 +4300,13 @@
data.pixel_height = 0;
line_params_iterate (text, &mark, NULL, FALSE, &data, set_vertical_scroll_iterator);
- text->vadj->upper = (float) data.pixel_height;
+ text->vadj->upper = data.pixel_height;
orig_value = (gint) text->vadj->value;
gdk_window_get_size (text->text_area, NULL, &height);
- text->vadj->step_increment = MIN (text->vadj->upper, (float) SCROLL_PIXELS);
- text->vadj->page_increment = MIN (text->vadj->upper, height - (float) KEY_SCROLL_PIXELS);
+ text->vadj->step_increment = MIN (text->vadj->upper, SCROLL_PIXELS);
+ text->vadj->page_increment = MIN (text->vadj->upper, height - KEY_SCROLL_PIXELS);
text->vadj->page_size = MIN (text->vadj->upper, height);
text->vadj->value = MIN (text->vadj->value, text->vadj->upper - text->vadj->page_size);
text->vadj->value = MAX (text->vadj->value, 0.0);
@@ -4332,7 +4332,7 @@
static void
scroll_int (GtkText* text, gint diff)
{
- gfloat upper;
+ gdouble upper;
text->vadj->value += diff;
Index: gtktextview.c
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtktextview.c,v
retrieving revision 1.73
diff -u -r1.73 gtktextview.c
--- gtktextview.c 2001/03/07 21:55:00 1.73
+++ gtktextview.c 2001/03/18 00:50:20
@@ -1054,7 +1054,7 @@
}
static gboolean
-set_adjustment_clamped (GtkAdjustment *adj, gfloat val)
+set_adjustment_clamped (GtkAdjustment *adj, gdouble val)
{
/* We don't really want to clamp to upper; we want to clamp to
upper - page_size which is the highest value the scrollbar
@@ -1343,11 +1343,11 @@
}
static void
-gtk_text_view_set_adjustment_upper (GtkAdjustment *adj, gfloat upper)
+gtk_text_view_set_adjustment_upper (GtkAdjustment *adj, gdouble upper)
{
if (upper != adj->upper)
{
- gfloat min = MAX (0., upper - adj->page_size);
+ gdouble min = MAX (0., upper - adj->page_size);
gboolean value_changed = FALSE;
adj->upper = upper;
@@ -3662,7 +3662,7 @@
gtk_text_view_scroll_pages (GtkTextView *text_view,
gint count)
{
- gfloat newval;
+ gdouble newval;
GtkAdjustment *adj;
gint cursor_x_pos, cursor_y_pos;
GtkTextIter new_insert;
Index: gtktreeview.c
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtktreeview.c,v
retrieving revision 1.59
diff -u -r1.59 gtktreeview.c
--- gtktreeview.c 2001/03/16 23:22:46 1.59
+++ gtktreeview.c 2001/03/18 00:50:21
@@ -985,7 +985,7 @@
if (tree_view->priv->vadjustment->value + allocation->height > tree_view->priv->height)
gtk_adjustment_set_value (tree_view->priv->vadjustment,
- (gfloat) MAX (tree_view->priv->height - allocation->height, 0));
+ MAX (tree_view->priv->height - allocation->height, 0));
gtk_signal_emit_by_name (GTK_OBJECT (tree_view->priv->vadjustment), "changed");
@@ -2494,7 +2494,7 @@
/* Case 4. We have focus already. Move the cursor. */
if (direction == GTK_DIR_LEFT)
{
- gfloat val;
+ gdouble val;
val = tree_view->priv->hadjustment->value - tree_view->priv->hadjustment->page_size/2;
val = MAX (val, 0.0);
gtk_adjustment_set_value (GTK_ADJUSTMENT (tree_view->priv->hadjustment), val);
@@ -2506,7 +2506,7 @@
}
if (direction == GTK_DIR_RIGHT)
{
- gfloat val;
+ gdouble val;
val = tree_view->priv->hadjustment->value + tree_view->priv->hadjustment->page_size/2;
val = MIN (tree_view->priv->hadjustment->upper - tree_view->priv->hadjustment->page_size, val);
gtk_adjustment_set_value (GTK_ADJUSTMENT (tree_view->priv->hadjustment), val);
Index: gtkvruler.c
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtkvruler.c,v
retrieving revision 1.19
diff -u -r1.19 gtkvruler.c
--- gtkvruler.c 2001/01/04 17:48:43 1.19
+++ gtkvruler.c 2001/03/18 00:50:21
@@ -140,11 +140,11 @@
gint xthickness;
gint ythickness;
gint length, ideal_length;
- gfloat lower, upper; /* Upper and lower limits, in ruler units */
- gfloat increment; /* Number of pixels per unit */
+ gdouble lower, upper; /* Upper and lower limits, in ruler units */
+ gdouble increment; /* Number of pixels per unit */
gint scale; /* Number of units per major unit */
- gfloat subd_incr;
- gfloat start, end, cur;
+ gdouble subd_incr;
+ gdouble start, end, cur;
gchar unit_str[32];
gint digit_height;
gint digit_offset;
@@ -193,7 +193,7 @@
if ((upper - lower) == 0)
return;
- increment = (gfloat) width / (upper - lower);
+ increment = (gdouble) width / (upper - lower);
/* determine the scale
* use the maximum extents of the ruler to determine the largest
@@ -216,8 +216,8 @@
length = 0;
for (i = MAXIMUM_SUBDIVIDE - 1; i >= 0; i--)
{
- subd_incr = (gfloat) ruler->metric->ruler_scale[scale] /
- (gfloat) ruler->metric->subdivide[i];
+ subd_incr = (gdouble) ruler->metric->ruler_scale[scale] /
+ (gdouble) ruler->metric->subdivide[i];
if (subd_incr * fabs(increment) <= MINIMUM_INCR)
continue;
@@ -287,7 +287,7 @@
gint bs_width, bs_height;
gint xthickness;
gint ythickness;
- gfloat increment;
+ gdouble increment;
g_return_if_fail (ruler != NULL);
g_return_if_fail (GTK_IS_VRULER (ruler));
@@ -317,7 +317,7 @@
ruler->xsrc, ruler->ysrc,
bs_width, bs_height);
- increment = (gfloat) height / (ruler->upper - ruler->lower);
+ increment = (gdouble) height / (ruler->upper - ruler->lower);
x = (width + bs_width) / 2 + xthickness;
y = ROUND ((ruler->position - ruler->lower) * increment) + (ythickness - bs_height) / 2 - 1;
Index: testgtk.c
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/testgtk.c,v
retrieving revision 1.228
diff -u -r1.228 testgtk.c
--- testgtk.c 2001/03/08 17:13:11 1.228
+++ testgtk.c 2001/03/18 00:50:21
@@ -1501,7 +1501,7 @@
gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5);
gtk_box_pack_start (GTK_BOX (box5), label, FALSE, TRUE, 0);
- adj = (GtkAdjustment *) gtk_adjustment_new ((gfloat)DEFAULT_NUMBER_OF_ITEM, 1.0, 255.0, 1.0,
+ adj = (GtkAdjustment *) gtk_adjustment_new (DEFAULT_NUMBER_OF_ITEM, 1.0, 255.0, 1.0,
5.0, 0.0);
spinner = gtk_spin_button_new (adj, 0, 0);
gtk_box_pack_start (GTK_BOX (box5), spinner, FALSE, TRUE, 0);
@@ -1515,7 +1515,7 @@
gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5);
gtk_box_pack_start (GTK_BOX (box5), label, FALSE, TRUE, 0);
- adj = (GtkAdjustment *) gtk_adjustment_new ((gfloat)DEFAULT_RECURSION_LEVEL, 0.0, 255.0, 1.0,
+ adj = (GtkAdjustment *) gtk_adjustment_new (DEFAULT_RECURSION_LEVEL, 0.0, 255.0, 1.0,
5.0, 0.0);
spinner = gtk_spin_button_new (adj, 0, 0);
gtk_box_pack_start (GTK_BOX (box5), spinner, FALSE, TRUE, 0);
@@ -3626,8 +3637,8 @@
spin_button_time_output_func (GtkSpinButton *spin_button)
{
static gchar buf[6];
- gfloat hours;
- gfloat minutes;
+ gdouble hours;
+ gdouble minutes;
hours = spin_button->adjustment->value / 60.0;
minutes = (fabs(floor (hours) - hours) < 1e-5) ? 0.0 : 30;
@@ -3639,7 +3650,7 @@
static gint
spin_button_month_input_func (GtkSpinButton *spin_button,
- gfloat *new_val)
+ gdouble *new_val)
{
gint i;
static gchar *month[12] = { "January", "February", "March", "April",
@@ -3666,7 +3677,7 @@
*new_val = 0.0;
return GTK_INPUT_ERROR;
}
- *new_val = (gfloat) i;
+ *new_val = (gdouble) i;
return TRUE;
}
@@ -3689,14 +3700,14 @@
static gint
spin_button_hex_input_func (GtkSpinButton *spin_button,
- gfloat *new_val)
+ gdouble *new_val)
{
gchar *buf;
gchar *err;
- gfloat res;
+ gdouble res;
buf = gtk_entry_get_text (GTK_ENTRY (spin_button));
- res = (gfloat)(strtol(buf, &err, 16));
+ res = strtol(buf, &err, 16);
*new_val = res;
if (*err)
return GTK_INPUT_ERROR;
@@ -7970,7 +7981,7 @@
gint
progress_timeout (gpointer data)
{
- gfloat new_val;
+ gdouble new_val;
GtkAdjustment *adj;
adj = GTK_PROGRESS (data)->adjustment;
@@ -8736,9 +8747,9 @@
scroll_test_scroll (GtkWidget *widget, GdkEventScroll *event,
GtkAdjustment *adj)
{
- gfloat new_value = adj->value + ((event->direction == GDK_SCROLL_UP) ?
- -adj->page_increment / 2:
- adj->page_increment / 2);
+ gdouble new_value = adj->value + ((event->direction == GDK_SCROLL_UP) ?
+ -adj->page_increment / 2:
+ adj->page_increment / 2);
new_value = CLAMP (new_value, adj->lower, adj->upper - adj->page_size);
gtk_adjustment_set_value (adj, new_value);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]