/*
- * This file is part of hildon-libs
+ * This file is a part of hildon
*
* Copyright (C) 2005, 2006 Nokia Corporation, all rights reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
* as published by the Free Software Foundation; version 2.1 of
- * the License.
+ * the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
/**
* SECTION:hildon-seekbar
- * @short_description: A widget used to identify a place from a content
+ * @short_description: A widget used to identify a place from a content.
*
* HildonSeekbar allows seeking in media with a range widget. It
* supports for setting or getting the length (total time) of the media,
#include <gtk/gtkadjustment.h>
#include <gtk/gtktoolbar.h>
#include <gdk/gdkkeysyms.h>
+#include "hildon-seekbar-private.h"
static GtkScaleClass* parent_class = NULL;
};
/**
- * Initialises, and returns the type of a hildon seekbar.
+ * hildon_seekbar_get_type:
+ *
+ * Initializes, and returns the type of a hildon seekbar.
+ *
+ * @Returns : GType of #HildonSeekbar
+ *
*/
GType G_GNUC_CONST
hildon_seekbar_get_type (void)
object_class->set_property = hildon_seekbar_set_property;
object_class->get_property = hildon_seekbar_get_property;
+ /**
+ * HildonSeekbar:total-time:
+ *
+ * Total playing time of this media file.
+ */
g_object_class_install_property (object_class, PROP_TOTAL_TIME,
- g_param_spec_double ("total_time",
+ g_param_spec_double ("total-time",
"total time",
"Total playing time of this media file",
0, /* min value */
0, /* default */
G_PARAM_READWRITE));
+ /**
+ * HildonSeekbar:position:
+ *
+ * Current position in this media file.
+ */
g_object_class_install_property (object_class, PROP_POSITION,
g_param_spec_double ("position",
"position",
0, /* default */
G_PARAM_READWRITE));
+ /**
+ * HildonSeekbar:fraction:
+ *
+ * Current fraction related to the progress indicator.
+ */
g_object_class_install_property (object_class, PROP_FRACTION,
g_param_spec_double ("fraction",
"Fraction",
{
g_return_val_if_fail (HILDON_IS_SEEKBAR (seekbar), 0);
- return osso_gtk_range_get_stream_position (GTK_RANGE(seekbar));
+#ifdef MAEMO_GTK
+ return gtk_range_get_fill_level (GTK_RANGE (seekbar));
+#else
+ return 0;
+#endif
}
/**
fraction >= range->adjustment->lower);
/* Set to show stream indicator. */
- g_object_set (G_OBJECT (seekbar), "stream_indicator", TRUE, NULL);
+ g_object_set (G_OBJECT (seekbar), "show-fill-level", TRUE, NULL);
fraction = CLAMP (fraction, range->adjustment->lower,
range->adjustment->upper);
+#ifdef MAEMO_GTK
/* Update stream position of range widget */
- osso_gtk_range_set_stream_position (range, fraction);
+ gtk_range_set_fill_level (range, fraction);
+#endif
if (fraction < hildon_seekbar_get_position(seekbar))
hildon_seekbar_set_position(seekbar, fraction);
value = floor (adj->value);
if (time != value) {
value = (time < adj->upper) ? time : adj->upper;
- if (value <= osso_gtk_range_get_stream_position (range)) {
+
+#ifdef MAEMO_GTK
+ if (value <= gtk_range_get_fill_level (range)) {
+#else
+ if (value) {
+#endif
adj->value = value;
gtk_adjustment_value_changed (adj);