summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2013-04-21 21:31:29 -0400
committerMatthias Clasen <mclasen@redhat.com>2013-04-21 21:31:29 -0400
commit4013783361146d3e595e354825819834e3decd91 (patch)
tree48a728c18e2eaf63ec8e61e7f5d01e9daca24c6f
parent4bb2226ae9033835314b35fd80090ca487c7b103 (diff)
downloadgtk+-stack.tar.gz
Make transition-duration unsignedstack
The code doesn't deal with negative durations, so better don't allow them.
-rw-r--r--gtk/gtkstack.c10
-rw-r--r--gtk/gtkstack.h4
2 files changed, 7 insertions, 7 deletions
diff --git a/gtk/gtkstack.c b/gtk/gtkstack.c
index c1d7f99dae..5cd929a0dc 100644
--- a/gtk/gtkstack.c
+++ b/gtk/gtkstack.c
@@ -103,7 +103,7 @@ struct _GtkStackPrivate {
gboolean homogeneous;
GtkStackTransitionType transition_type;
- gint transition_duration;
+ guint transition_duration;
GtkStackChildInfo *last_visible_child;
cairo_surface_t *last_visible_surface;
@@ -216,7 +216,7 @@ gtk_stack_get_property (GObject *object,
g_value_set_string (value, gtk_stack_get_visible_child_name (stack));
break;
case PROP_TRANSITION_DURATION:
- g_value_set_int (value, gtk_stack_get_transition_duration (stack));
+ g_value_set_uint (value, gtk_stack_get_transition_duration (stack));
break;
case PROP_TRANSITION_TYPE:
g_value_set_enum (value, gtk_stack_get_transition_type (stack));
@@ -247,7 +247,7 @@ gtk_stack_set_property (GObject *object,
gtk_stack_set_visible_child_name (stack, g_value_get_string (value));
break;
case PROP_TRANSITION_DURATION:
- gtk_stack_set_transition_duration (stack, g_value_get_int (value));
+ gtk_stack_set_transition_duration (stack, g_value_get_uint (value));
break;
case PROP_TRANSITION_TYPE:
gtk_stack_set_transition_type (stack, g_value_get_enum (value));
@@ -1101,7 +1101,7 @@ gtk_stack_get_homogeneous (GtkStack *stack)
*
* Since: 3.10
*/
-gint
+guint
gtk_stack_get_transition_duration (GtkStack *stack)
{
g_return_val_if_fail (GTK_IS_STACK (stack), 0);
@@ -1123,7 +1123,7 @@ gtk_stack_get_transition_duration (GtkStack *stack)
*/
void
gtk_stack_set_transition_duration (GtkStack *stack,
- gint transition_duration)
+ guint transition_duration)
{
g_return_if_fail (GTK_IS_STACK (stack));
diff --git a/gtk/gtkstack.h b/gtk/gtkstack.h
index a0136e7ace..46c73671c9 100644
--- a/gtk/gtkstack.h
+++ b/gtk/gtkstack.h
@@ -79,8 +79,8 @@ void gtk_stack_set_homogeneous (GtkStack
gboolean homogeneous);
gboolean gtk_stack_get_homogeneous (GtkStack *stack);
void gtk_stack_set_transition_duration (GtkStack *stack,
- gint transition_duration);
-gint gtk_stack_get_transition_duration (GtkStack *stack);
+ guint transition_duration);
+guint gtk_stack_get_transition_duration (GtkStack *stack);
void gtk_stack_set_transition_type (GtkStack *stack,
GtkStackTransitionType transition_type);
GtkStackTransitionType gtk_stack_get_transition_type (GtkStack *stack);