Пример #1
0
/**
 * _gtk_css_style_property_get_n_properties:
 *
 * Gets the number of style properties. This number can increase when new
 * theme engines are loaded. Shorthand properties are not included here.
 *
 * Returns: The number of style properties.
 **/
guint
_gtk_css_style_property_get_n_properties (void)
{
  if (G_UNLIKELY (gtk_css_style_property_class == NULL))
    {
      _gtk_style_property_init_properties ();
      g_assert (gtk_css_style_property_class);
    }

  return gtk_css_style_property_class->style_properties->len;
}
Пример #2
0
/**
 * _gtk_style_property_lookup:
 * @name: name of the property to lookup
 *
 * Looks up the CSS property with the given @name. If no such
 * property exists, %NULL is returned.
 *
 * Returns: (nullable) (transfer none): The property or %NULL if no
 *     property with the given name exists.
 **/
GtkStyleProperty *
_gtk_style_property_lookup (const char *name)
{
  GtkStylePropertyClass *klass;

  g_return_val_if_fail (name != NULL, NULL);

  _gtk_style_property_init_properties ();

  klass = g_type_class_peek (GTK_TYPE_STYLE_PROPERTY);

  return g_hash_table_lookup (klass->properties, name);
}
Пример #3
0
/**
 * _gtk_css_style_property_lookup_by_id:
 * @id: the id of the property
 *
 * Gets the style property with the given id. All style properties (but not
 * shorthand properties) are indexable by id so that it’s easy to use arrays
 * when doing style lookups.
 *
 * Returns: (transfer none): The style property with the given id
 **/
GtkCssStyleProperty *
_gtk_css_style_property_lookup_by_id (guint id)
{

  if (G_UNLIKELY (gtk_css_style_property_class == NULL))
    {
      _gtk_style_property_init_properties ();
      g_assert (gtk_css_style_property_class);
    }

  g_return_val_if_fail (id < gtk_css_style_property_class->style_properties->len, NULL);

  return g_ptr_array_index (gtk_css_style_property_class->style_properties, id);
}