X-Git-Url: https://vcs.maemo.org/git/?a=blobdiff_plain;f=src%2Fhildon-seekbar.c;h=0fe4fe4e720665add5d99d5778f6d5c40d13b197;hb=18690688d547892afa172e33eec9311c1bb5da2b;hp=d22a6241b482f0294e863cf93e1453cc3e1155a8;hpb=c97841e3e2c6fede88011f32d44d05acad92ed9c;p=hildon diff --git a/src/hildon-seekbar.c b/src/hildon-seekbar.c index d22a624..0fe4fe4 100644 --- a/src/hildon-seekbar.c +++ b/src/hildon-seekbar.c @@ -1,5 +1,5 @@ /* - * This file is part of hildon-libs + * This file is a part of hildon * * Copyright (C) 2005, 2006 Nokia Corporation, all rights reserved. * @@ -8,7 +8,7 @@ * 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 @@ -24,7 +24,7 @@ /** * 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, @@ -48,6 +48,7 @@ #include #include #include +#include "hildon-seekbar-private.h" static GtkScaleClass* parent_class = NULL; @@ -130,7 +131,12 @@ enum }; /** - * 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) @@ -180,8 +186,13 @@ hildon_seekbar_class_init (HildonSeekbarClass *seekbar_cla 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 */ @@ -189,6 +200,11 @@ hildon_seekbar_class_init (HildonSeekbarClass *seekbar_cla 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", @@ -198,6 +214,11 @@ hildon_seekbar_class_init (HildonSeekbarClass *seekbar_cla 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", @@ -402,7 +423,11 @@ hildon_seekbar_get_fraction (HildonSeekbar *seekbar) { 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 } /** @@ -426,13 +451,15 @@ hildon_seekbar_set_fraction (HildonSeekbar *seekbar, 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); @@ -483,7 +510,12 @@ hildon_seekbar_set_position (HildonSeekbar *seekbar, 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);