widget: Add gtk_widget_get_css_name() API

This commit is contained in:
Benjamin Otte 2020-02-14 20:25:00 +01:00
parent ad23ce23ad
commit 264967b764
3 changed files with 21 additions and 0 deletions

View File

@ -4189,6 +4189,7 @@ gtk_widget_insert_after
gtk_widget_set_layout_manager
gtk_widget_get_layout_manager
gtk_widget_should_layout
gtk_widget_get_css_name
gtk_widget_add_css_class
gtk_widget_remove_css_class
gtk_widget_has_css_class

View File

@ -13102,6 +13102,24 @@ gtk_widget_class_query_action (GtkWidgetClass *widget_class,
return FALSE;
}
/**
* gtk_widget_get_css_name:
* @self: a #GtkWidget
*
* Returns the CSS name that is used for @self.
*
* Returns: the CSS name
**/
const char *
gtk_widget_get_css_name (GtkWidget *self)
{
GtkWidgetPrivate *priv = gtk_widget_get_instance_private (self);
g_return_val_if_fail (GTK_IS_WIDGET (self), NULL);
return g_quark_to_string (gtk_css_node_get_name (priv->cssnode));
}
/**
* gtk_widget_add_css_class:
* @widget: a #GtkWidget

View File

@ -971,6 +971,8 @@ void gtk_widget_snapshot_child (GtkWidget *widget,
GDK_AVAILABLE_IN_ALL
gboolean gtk_widget_should_layout (GtkWidget *widget);
GDK_AVAILABLE_IN_ALL
const char * gtk_widget_get_css_name (GtkWidget *self) G_GNUC_PURE;
GDK_AVAILABLE_IN_ALL
void gtk_widget_add_css_class (GtkWidget *widget,
const char *css_class);
GDK_AVAILABLE_IN_ALL