[gtk+/wip/otte/tokenizer: 44/78] cssdeclaration: Add API to query name + value
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/wip/otte/tokenizer: 44/78] cssdeclaration: Add API to query name + value
- Date: Fri, 25 Nov 2016 22:35:24 +0000 (UTC)
commit b2c070551b3a404c32c756fa8fc27f25b47d2a05
Author: Benjamin Otte <otte redhat com>
Date: Mon Mar 21 17:51:00 2016 +0100
cssdeclaration: Add API to query name + value
gtk/gtkcssdeclaration.c | 25 +++++++++++++++++++++++++
gtk/gtkcssdeclarationprivate.h | 7 ++++++-
gtk/gtkcssstyledeclarationprivate.h | 2 ++
3 files changed, 33 insertions(+), 1 deletions(-)
---
diff --git a/gtk/gtkcssdeclaration.c b/gtk/gtkcssdeclaration.c
index c95f2da..0782cfa 100644
--- a/gtk/gtkcssdeclaration.c
+++ b/gtk/gtkcssdeclaration.c
@@ -116,3 +116,28 @@ gtk_css_declaration_new_parse (GtkCssStyleDeclaration *style,
return decl;
}
+
+const char *
+gtk_css_declaration_get_name (GtkCssDeclaration *decl)
+{
+ GtkCssDeclarationPrivate *priv;
+
+ g_return_val_if_fail (GTK_IS_CSS_DECLARATION (decl), NULL);
+
+ priv = gtk_css_declaration_get_instance_private (decl);
+
+ return _gtk_style_property_get_name (priv->prop);
+}
+
+GtkCssValue *
+gtk_css_declaration_get_value (GtkCssDeclaration *decl)
+{
+ GtkCssDeclarationPrivate *priv;
+
+ g_return_val_if_fail (GTK_IS_CSS_DECLARATION (decl), NULL);
+
+ priv = gtk_css_declaration_get_instance_private (decl);
+
+ return priv->value;
+}
+
diff --git a/gtk/gtkcssdeclarationprivate.h b/gtk/gtkcssdeclarationprivate.h
index ad7ef78..ffb6c25 100644
--- a/gtk/gtkcssdeclarationprivate.h
+++ b/gtk/gtkcssdeclarationprivate.h
@@ -22,6 +22,8 @@
#include "gtk/gtkcssstyledeclarationprivate.h"
+#include "gtk/gtkcssvalueprivate.h"
+
G_BEGIN_DECLS
#define GTK_TYPE_CSS_DECLARATION (gtk_css_declaration_get_type ())
@@ -31,7 +33,7 @@ G_BEGIN_DECLS
#define GTK_IS_CSS_DECLARATION_CLASS(obj) (G_TYPE_CHECK_CLASS_TYPE (obj, GTK_TYPE_CSS_DECLARATION))
#define GTK_CSS_DECLARATION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_CSS_DECLARATION,
GtkCssDeclarationClass))
-typedef struct _GtkCssDeclaration GtkCssDeclaration;
+/* typedef struct _GtkCssDeclaration GtkCssDeclaration; */
typedef struct _GtkCssDeclarationClass GtkCssDeclarationClass;
struct _GtkCssDeclaration
@@ -49,6 +51,9 @@ GType gtk_css_declaration_get_type (void) G_GNUC_CO
GtkCssDeclaration * gtk_css_declaration_new_parse (GtkCssStyleDeclaration *style,
GtkCssTokenSource *source);
+const char * gtk_css_declaration_get_name (GtkCssDeclaration *decl);
+GtkCssValue * gtk_css_declaration_get_value (GtkCssDeclaration *decl);
+
G_END_DECLS
diff --git a/gtk/gtkcssstyledeclarationprivate.h b/gtk/gtkcssstyledeclarationprivate.h
index a6303e7..0db1e5b 100644
--- a/gtk/gtkcssstyledeclarationprivate.h
+++ b/gtk/gtkcssstyledeclarationprivate.h
@@ -31,6 +31,8 @@ G_BEGIN_DECLS
#define GTK_IS_CSS_STYLE_DECLARATION_CLASS(obj) (G_TYPE_CHECK_CLASS_TYPE (obj,
GTK_TYPE_CSS_STYLE_DECLARATION))
#define GTK_CSS_STYLE_DECLARATION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj),
GTK_TYPE_CSS_STYLE_DECLARATION, GtkCssStyleDeclarationClass))
+typedef struct _GtkCssDeclaration GtkCssDeclaration;
+
typedef struct _GtkCssStyleDeclaration GtkCssStyleDeclaration;
typedef struct _GtkCssStyleDeclarationClass GtkCssStyleDeclarationClass;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]