[gnome-shell] [StThemeNode] Add transition-duration CSS property



commit d4a8c64d2249ffc6c30c069eddeac589621a4732
Author: Florian Müllner <fmuellner gnome org>
Date:   Sun May 30 23:06:37 2010 +0200

    [StThemeNode] Add transition-duration CSS property
    
    Add a CSS property to control style transitions.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=619025

 src/st/st-theme-node-private.h |    2 ++
 src/st/st-theme-node.c         |   28 ++++++++++++++++++++++++++++
 src/st/st-theme-node.h         |    2 ++
 3 files changed, 32 insertions(+), 0 deletions(-)
---
diff --git a/src/st/st-theme-node-private.h b/src/st/st-theme-node-private.h
index bd84ef7..1f9d1c3 100644
--- a/src/st/st-theme-node-private.h
+++ b/src/st/st-theme-node-private.h
@@ -36,6 +36,8 @@ struct _StThemeNode {
   int max_width;
   int max_height;
 
+  int transition_duration;
+
   char *background_image;
   StBorderImage *border_image;
   StShadow *shadow;
diff --git a/src/st/st-theme-node.c b/src/st/st-theme-node.c
index 5c4768a..d097da5 100644
--- a/src/st/st-theme-node.c
+++ b/src/st/st-theme-node.c
@@ -20,6 +20,7 @@ G_DEFINE_TYPE (StThemeNode, st_theme_node, G_TYPE_OBJECT)
 static void
 st_theme_node_init (StThemeNode *node)
 {
+  node->transition_duration = -1;
   _st_theme_node_init_drawing_state (node);
 }
 
@@ -1548,6 +1549,33 @@ st_theme_node_get_padding (StThemeNode *node,
   return node->padding[side];
 }
 
+/**
+ * st_theme_node_get_transition_duration:
+ * @node: an #StThemeNode
+ *
+ * Get the value of the transition-duration property, which
+ * specifies the transition time between the previous #StThemeNode
+ * and @node.
+ *
+ * Returns: the node's transition duration in milliseconds
+ */
+int
+st_theme_node_get_transition_duration (StThemeNode *node)
+{
+  gdouble value = 0.0;
+
+  g_return_val_if_fail (ST_IS_THEME_NODE (node), 0);
+
+  if (node->transition_duration > -1)
+    return node->transition_duration;
+
+  st_theme_node_get_double (node, "transition-duration", FALSE, &value);
+
+  node->transition_duration = (int)value;
+
+  return node->transition_duration;
+}
+
 StTextDecoration
 st_theme_node_get_text_decoration (StThemeNode *node)
 {
diff --git a/src/st/st-theme-node.h b/src/st/st-theme-node.h
index e560f87..2dfa2b2 100644
--- a/src/st/st-theme-node.h
+++ b/src/st/st-theme-node.h
@@ -141,6 +141,8 @@ int    st_theme_node_get_min_height    (StThemeNode  *node);
 int    st_theme_node_get_max_width     (StThemeNode  *node);
 int    st_theme_node_get_max_height    (StThemeNode  *node);
 
+int    st_theme_node_get_transition_duration (StThemeNode *node);
+
 StTextDecoration st_theme_node_get_text_decoration (StThemeNode *node);
 
 /* Font rule processing is pretty complicated, so we just hardcode it



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]