cssdeclaration: Add API to query name + value
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user