Commit 489c376b authored by Owen Taylor's avatar Owen Taylor Committed by Owen Taylor

Handle quoting of / with \; properly handle __ in paths, quote " and \n in

Mon Mar 19 15:53:36 2001  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkitemfactory.c gtk/testgtk.c: Handle quoting of / with \; properly
	handle __ in paths, quote " and \n in gtk_item_factory_dump_items().

	* gtk/gtkadjustment.[ch] gtk/gtkclist.c gtk/gtkhruler.c gtk/gtklayout.c
	  gtk/gtklist.c gtk/gtkprogress.[ch] gtk/gtkprogressbar.[ch] gtk/gtkrange.[ch]
	  gtk/gtkruler.[ch] gtk/gtkscale.c gtk/gtkscrolledwindow.c gtk/gtkspinbutton.[ch]
	  gtk/gtktext.c gtk/gtktextview.c gtk/gtkvruler.c gtk/testgtk.c:
	Change float to double everywhere with the exception of 0<->1.0 alignment
	and GtkCurve.
parent c5f68d25
Mon Mar 19 15:53:36 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkitemfactory.c gtk/testgtk.c: Handle quoting of / with \; properly
handle __ in paths, quote " and \n in gtk_item_factory_dump_items().
* gtk/gtkadjustment.[ch] gtk/gtkclist.c gtk/gtkhruler.c gtk/gtklayout.c
gtk/gtklist.c gtk/gtkprogress.[ch] gtk/gtkprogressbar.[ch] gtk/gtkrange.[ch]
gtk/gtkruler.[ch] gtk/gtkscale.c gtk/gtkscrolledwindow.c gtk/gtkspinbutton.[ch]
gtk/gtktext.c gtk/gtktextview.c gtk/gtkvruler.c gtk/testgtk.c:
Change float to double everywhere with the exception of 0<->1.0 alignment
and GtkCurve.
2001-03-19 Tor Lillqvist <tml@iki.fi>
* gdk/win32/gdkdrawable-win32.c
......
Mon Mar 19 15:53:36 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkitemfactory.c gtk/testgtk.c: Handle quoting of / with \; properly
handle __ in paths, quote " and \n in gtk_item_factory_dump_items().
* gtk/gtkadjustment.[ch] gtk/gtkclist.c gtk/gtkhruler.c gtk/gtklayout.c
gtk/gtklist.c gtk/gtkprogress.[ch] gtk/gtkprogressbar.[ch] gtk/gtkrange.[ch]
gtk/gtkruler.[ch] gtk/gtkscale.c gtk/gtkscrolledwindow.c gtk/gtkspinbutton.[ch]
gtk/gtktext.c gtk/gtktextview.c gtk/gtkvruler.c gtk/testgtk.c:
Change float to double everywhere with the exception of 0<->1.0 alignment
and GtkCurve.
2001-03-19 Tor Lillqvist <tml@iki.fi>
* gdk/win32/gdkdrawable-win32.c
......
Mon Mar 19 15:53:36 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkitemfactory.c gtk/testgtk.c: Handle quoting of / with \; properly
handle __ in paths, quote " and \n in gtk_item_factory_dump_items().
* gtk/gtkadjustment.[ch] gtk/gtkclist.c gtk/gtkhruler.c gtk/gtklayout.c
gtk/gtklist.c gtk/gtkprogress.[ch] gtk/gtkprogressbar.[ch] gtk/gtkrange.[ch]
gtk/gtkruler.[ch] gtk/gtkscale.c gtk/gtkscrolledwindow.c gtk/gtkspinbutton.[ch]
gtk/gtktext.c gtk/gtktextview.c gtk/gtkvruler.c gtk/testgtk.c:
Change float to double everywhere with the exception of 0<->1.0 alignment
and GtkCurve.
2001-03-19 Tor Lillqvist <tml@iki.fi>
* gdk/win32/gdkdrawable-win32.c
......
Mon Mar 19 15:53:36 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkitemfactory.c gtk/testgtk.c: Handle quoting of / with \; properly
handle __ in paths, quote " and \n in gtk_item_factory_dump_items().
* gtk/gtkadjustment.[ch] gtk/gtkclist.c gtk/gtkhruler.c gtk/gtklayout.c
gtk/gtklist.c gtk/gtkprogress.[ch] gtk/gtkprogressbar.[ch] gtk/gtkrange.[ch]
gtk/gtkruler.[ch] gtk/gtkscale.c gtk/gtkscrolledwindow.c gtk/gtkspinbutton.[ch]
gtk/gtktext.c gtk/gtktextview.c gtk/gtkvruler.c gtk/testgtk.c:
Change float to double everywhere with the exception of 0<->1.0 alignment
and GtkCurve.
2001-03-19 Tor Lillqvist <tml@iki.fi>
* gdk/win32/gdkdrawable-win32.c
......
Mon Mar 19 15:53:36 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkitemfactory.c gtk/testgtk.c: Handle quoting of / with \; properly
handle __ in paths, quote " and \n in gtk_item_factory_dump_items().
* gtk/gtkadjustment.[ch] gtk/gtkclist.c gtk/gtkhruler.c gtk/gtklayout.c
gtk/gtklist.c gtk/gtkprogress.[ch] gtk/gtkprogressbar.[ch] gtk/gtkrange.[ch]
gtk/gtkruler.[ch] gtk/gtkscale.c gtk/gtkscrolledwindow.c gtk/gtkspinbutton.[ch]
gtk/gtktext.c gtk/gtktextview.c gtk/gtkvruler.c gtk/testgtk.c:
Change float to double everywhere with the exception of 0<->1.0 alignment
and GtkCurve.
2001-03-19 Tor Lillqvist <tml@iki.fi>
* gdk/win32/gdkdrawable-win32.c
......
Mon Mar 19 15:53:36 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkitemfactory.c gtk/testgtk.c: Handle quoting of / with \; properly
handle __ in paths, quote " and \n in gtk_item_factory_dump_items().
* gtk/gtkadjustment.[ch] gtk/gtkclist.c gtk/gtkhruler.c gtk/gtklayout.c
gtk/gtklist.c gtk/gtkprogress.[ch] gtk/gtkprogressbar.[ch] gtk/gtkrange.[ch]
gtk/gtkruler.[ch] gtk/gtkscale.c gtk/gtkscrolledwindow.c gtk/gtkspinbutton.[ch]
gtk/gtktext.c gtk/gtktextview.c gtk/gtkvruler.c gtk/testgtk.c:
Change float to double everywhere with the exception of 0<->1.0 alignment
and GtkCurve.
2001-03-19 Tor Lillqvist <tml@iki.fi>
* gdk/win32/gdkdrawable-win32.c
......
Mon Mar 19 15:53:36 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkitemfactory.c gtk/testgtk.c: Handle quoting of / with \; properly
handle __ in paths, quote " and \n in gtk_item_factory_dump_items().
* gtk/gtkadjustment.[ch] gtk/gtkclist.c gtk/gtkhruler.c gtk/gtklayout.c
gtk/gtklist.c gtk/gtkprogress.[ch] gtk/gtkprogressbar.[ch] gtk/gtkrange.[ch]
gtk/gtkruler.[ch] gtk/gtkscale.c gtk/gtkscrolledwindow.c gtk/gtkspinbutton.[ch]
gtk/gtktext.c gtk/gtktextview.c gtk/gtkvruler.c gtk/testgtk.c:
Change float to double everywhere with the exception of 0<->1.0 alignment
and GtkCurve.
2001-03-19 Tor Lillqvist <tml@iki.fi>
* gdk/win32/gdkdrawable-win32.c
......
......@@ -105,12 +105,12 @@ gtk_adjustment_init (GtkAdjustment *adjustment)
}
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 @@ gtk_adjustment_new (gfloat value,
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 @@ gtk_adjustment_value_changed (GtkAdjustment *adjustment)
void
gtk_adjustment_clamp_page (GtkAdjustment *adjustment,
gfloat lower,
gfloat upper)
gdouble lower,
gdouble upper)
{
gboolean need_emission;
......
......@@ -52,12 +52,12 @@ struct _GtkAdjustment
{
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 @@ struct _GtkAdjustmentClass
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
}
......
......@@ -6960,7 +6960,7 @@ static void
move_horizontal (GtkCList *clist,
gint diff)
{
gfloat value;
gdouble value;
if (!clist->hadjustment)
return;
......@@ -6975,7 +6975,7 @@ move_vertical (GtkCList *clist,
gint row,
gfloat align)
{
gfloat value;
gdouble value;
if (!clist->vadjustment)
return;
......
......@@ -141,11 +141,11 @@ gtk_hruler_draw_ticks (GtkRuler *ruler)
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 @@ gtk_hruler_draw_ticks (GtkRuler *ruler)
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 @@ gtk_hruler_draw_ticks (GtkRuler *ruler)
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 @@ gtk_hruler_draw_pos (GtkRuler *ruler)
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 @@ gtk_hruler_draw_pos (GtkRuler *ruler)
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;
......
......@@ -723,6 +723,37 @@ gtk_item_factory_path_from_widget (GtkWidget *widget)
return gtk_object_get_data_by_id (GTK_OBJECT (widget), quark_item_path);
}
static gchar *
item_factory_escape_path (const gchar *path)
{
GString *str = g_string_new (NULL);
while (*path)
{
gchar c = *path;
switch (c)
{
case '\n':
g_string_append (str, "\\n");
break;
case '\r':
g_string_append (str, "\\r");
break;
case '"':
case '\\':
g_string_append_c (str, '\\');
/* Fall through */
default:
g_string_append_c (str, c);
}
path++;
}
return g_string_free (str, FALSE);
}
static void
gtk_item_factory_foreach (gpointer hash_key,
gpointer value,
......@@ -731,6 +762,7 @@ gtk_item_factory_foreach (gpointer hash_key,
GtkItemFactoryItem *item;
GtkIFDumpData *data;
gchar *string;
gchar *path;
gchar *name;
gchar comment_prefix[2] = "\000\000";
......@@ -742,14 +774,16 @@ gtk_item_factory_foreach (gpointer hash_key,
comment_prefix[0] = gtk_item_factory_class->cpair_comment_single[0];
path = item_factory_escape_path (hash_key);
name = gtk_accelerator_name (item->accelerator_key, item->accelerator_mods);
string = g_strconcat (item->modified ? "" : comment_prefix,
"(menu-path \"",
hash_key,
path,
"\" \"",
name,
"\")",
NULL);
g_free (path);
g_free (name);
data->print_func (data->func_data, string);
......@@ -942,6 +976,60 @@ gtk_item_factory_get_item_by_action (GtkItemFactory *ifactory,
return GTK_IS_ITEM (widget) ? widget : NULL;
}
static char *
item_factory_find_separator_r (char *path)
{
gchar *result = NULL;
gboolean escaped = FALSE;
while (*path)
{
if (escaped)
escaped = FALSE;
else
{
if (*path == '\\')
escaped = TRUE;
else if (*path == '/')
result = path;
}
path++;
}
return result;
}
static char *
item_factory_unescape_label (const char *label)
{
char *new = g_malloc (strlen (label) + 1);
char *p = new;
gboolean escaped = FALSE;
while (*label)
{
if (escaped)
{
*p++ = *label;
escaped = FALSE;
}
else
{
if (*label == '\\')
escaped = TRUE;
else
*p++ = *label;
}
label++;
}
*p = '\0';
return new;
}
static gboolean
gtk_item_factory_parse_path (GtkItemFactory *ifactory,
gchar *str,
......@@ -951,14 +1039,21 @@ gtk_item_factory_parse_path (GtkItemFactory *ifactory,
{
gchar *translation;
gchar *p, *q;
*path = g_strdup (str);
/* FIXME: This does not handle __ correctly !!! */
p = q = *path;
while (*p)
{
if (*p != '_')
if (*p == '_')
{
if (p[1] == '_')
{
p++;
*q++ = '_';
}
}
else
{
*q++ = *p;
}
......@@ -967,7 +1062,7 @@ gtk_item_factory_parse_path (GtkItemFactory *ifactory,
*q = 0;
*parent_path = g_strdup (*path);
p = strrchr (*parent_path, '/');
p = item_factory_find_separator_r (*parent_path);
if (!p)
{
g_warning ("GtkItemFactory: invalid entry path `%s'", str);
......@@ -980,13 +1075,13 @@ gtk_item_factory_parse_path (GtkItemFactory *ifactory,
else
translation = str;
p = strrchr (translation, '/');
p = item_factory_find_separator_r (translation);
if (p)
p++;
else
p = translation;
*item = g_strdup (p);
*item = item_factory_unescape_label (p);
return TRUE;
}
......@@ -1077,7 +1172,7 @@ gtk_item_factory_create_item (GtkItemFactory *ifactory,
gchar *ppath, *p;
ppath = g_strdup (entry->path);
p = strrchr (ppath, '/');
p = item_factory_find_separator_r (ppath);
g_return_if_fail (p != NULL);
*p = 0;
pentry.path = ppath;
......
......@@ -269,11 +269,12 @@ gtk_layout_move (GtkLayout *layout,
}
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;
......
......@@ -582,7 +582,7 @@ gtk_list_motion_notify (GtkWidget *widget,
(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;
......
......@@ -348,8 +348,8 @@ gtk_progress_value_changed (GtkAdjustment *adjustment,
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 @@ gtk_progress_set_adjustment (GtkProgress *progress,
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 @@ gtk_progress_configure (GtkProgress *progress,
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 @@ gtk_progress_set_percentage (GtkProgress *progress,
(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 @@ gtk_progress_get_current_percentage (GtkProgress *progress)
(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 @@ gtk_progress_get_percentage_from_value (GtkProgress *progress,
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_progress_set_value (GtkProgress *progress,
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 @@ gtk_progress_get_current_text (GtkProgress *progress)
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);
......
......@@ -93,22 +93,22 @@ void gtk_progress_set_format_string (GtkProgress *progress,
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 */
......
......@@ -138,11 +138,11 @@ gtk_progress_bar_class_init (GtkProgressBarClass *class)
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_arg (GtkObject *object,
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_progress_bar_get_arg (GtkObject *object,
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 @@ gtk_progress_bar_real_update (GtkProgress *progress)
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 @@ gtk_progress_bar_paint (GtkProgress *progress)
gint i;
gint x;
gint y;
gfloat percentage;
gdouble percentage;
gint size;
g_return_if_fail (progress != NULL);
......@@ -804,7 +804,7 @@ gtk_progress_bar_paint (GtkProgress *progress)
**/
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 @@ gtk_progress_bar_set_text (GtkProgressBar *pbar,
**/
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 @@ gtk_progress_bar_set_pulse_step (GtkProgressBar *pbar,
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 @@ gtk_progress_bar_get_text (GtkProgressBar *pbar)
*
* 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 @@ gtk_progress_bar_get_fraction (GtkProgressBar *pbar)
*
* 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);
......
......@@ -76,7 +76,7 @@ struct _GtkProgressBar
guint activity_step;
guint activity_blocks;
gfloat pulse_fraction;
gdouble pulse_fraction;
guint activity_dir : 1;
};
......@@ -121,16 +121,16 @@ void gtk_progress_bar_pulse (GtkProgressBar *pbar);
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_step (GtkProgressBar *pbar,
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 */
......
......@@ -74,7 +74,7 @@ static void gtk_real_range_draw_trough (GtkRange *range);
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 @@ _gtk_range_slider_update (GtkRange *range)
}
gint
_gtk_range_trough_click (GtkRange *range,
gint x,
gint y,
gfloat *jump_perc)
_gtk_range_trough_click (GtkRange *range,
gint x,
gint y,