2012-01-02 09:21:57 +00:00
|
|
|
/* GTK - The GIMP Toolkit
|
|
|
|
* Copyright (C) 2010 Carlos Garnacho <carlosg@gnome.org>
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
2012-02-27 13:01:10 +00:00
|
|
|
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
2012-01-02 09:21:57 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include "config.h"
|
|
|
|
|
|
|
|
#include "gtkstylepropertyprivate.h"
|
|
|
|
|
2012-01-02 10:12:46 +00:00
|
|
|
#include <gobject/gvaluecollector.h>
|
2012-01-02 09:21:57 +00:00
|
|
|
#include <gdk-pixbuf/gdk-pixbuf.h>
|
|
|
|
#include <cairo-gobject.h>
|
2012-01-15 01:53:39 +00:00
|
|
|
#include <math.h>
|
2012-01-02 09:21:57 +00:00
|
|
|
|
|
|
|
#include "gtkcssparserprivate.h"
|
|
|
|
#include "gtkcssstylefuncsprivate.h"
|
|
|
|
#include "gtkcssstylepropertyprivate.h"
|
|
|
|
#include "gtkcsstypesprivate.h"
|
|
|
|
#include "gtkintl.h"
|
|
|
|
#include "gtkprivatetypebuiltins.h"
|
|
|
|
#include "gtkstylepropertiesprivate.h"
|
|
|
|
|
2012-01-15 01:53:39 +00:00
|
|
|
/* this is in case round() is not provided by the compiler,
|
|
|
|
* such as in the case of C89 compilers, like MSVC
|
|
|
|
*/
|
|
|
|
#include "fallback-c89.c"
|
|
|
|
|
2012-01-02 09:21:57 +00:00
|
|
|
/* the actual parsers we have */
|
|
|
|
#include "gtkanimationdescription.h"
|
|
|
|
#include "gtkbindings.h"
|
2012-03-30 01:09:26 +00:00
|
|
|
#include "gtkcssarrayvalueprivate.h"
|
2012-04-03 16:39:01 +00:00
|
|
|
#include "gtkcsscornervalueprivate.h"
|
2012-04-01 04:22:20 +00:00
|
|
|
#include "gtkcsseasevalueprivate.h"
|
2012-03-27 21:54:06 +00:00
|
|
|
#include "gtkcssimagegradientprivate.h"
|
|
|
|
#include "gtkcssimageprivate.h"
|
2012-03-29 00:58:32 +00:00
|
|
|
#include "gtkcssimagevalueprivate.h"
|
2012-03-28 06:19:53 +00:00
|
|
|
#include "gtkcssenumvalueprivate.h"
|
2012-03-27 22:04:29 +00:00
|
|
|
#include "gtkcssnumbervalueprivate.h"
|
2012-03-28 04:28:13 +00:00
|
|
|
#include "gtkcssrgbavalueprivate.h"
|
2012-04-03 13:15:24 +00:00
|
|
|
#include "gtkcssshadowsvalueprivate.h"
|
2012-03-30 01:09:26 +00:00
|
|
|
#include "gtkcssstringvalueprivate.h"
|
2012-01-14 01:38:42 +00:00
|
|
|
#include "gtksymboliccolorprivate.h"
|
2012-01-02 09:21:57 +00:00
|
|
|
#include "gtkthemingengine.h"
|
|
|
|
#include "gtktypebuiltins.h"
|
|
|
|
#include "gtkwin32themeprivate.h"
|
|
|
|
|
|
|
|
/*** REGISTRATION ***/
|
|
|
|
|
2012-04-02 06:47:11 +00:00
|
|
|
typedef enum {
|
2012-04-02 06:53:51 +00:00
|
|
|
GTK_STYLE_PROPERTY_INHERIT = (1 << 0),
|
|
|
|
GTK_STYLE_PROPERTY_ANIMATED = (1 << 1)
|
2012-04-02 06:47:11 +00:00
|
|
|
} GtkStylePropertyFlags;
|
|
|
|
|
2012-01-02 09:21:57 +00:00
|
|
|
static void
|
2012-01-14 16:12:57 +00:00
|
|
|
gtk_css_style_property_register (const char * name,
|
2012-03-31 03:28:58 +00:00
|
|
|
guint expected_id,
|
2012-01-14 16:12:57 +00:00
|
|
|
GType value_type,
|
|
|
|
GtkStylePropertyFlags flags,
|
|
|
|
GtkCssStylePropertyParseFunc parse_value,
|
|
|
|
GtkCssStylePropertyPrintFunc print_value,
|
|
|
|
GtkCssStylePropertyComputeFunc compute_value,
|
2012-03-27 21:54:06 +00:00
|
|
|
GtkCssStylePropertyQueryFunc query_value,
|
2012-03-28 04:20:47 +00:00
|
|
|
GtkCssStylePropertyAssignFunc assign_value,
|
2012-03-24 06:02:59 +00:00
|
|
|
GtkCssStylePropertyEqualFunc equal_func,
|
2012-03-27 02:58:15 +00:00
|
|
|
GtkCssValue * initial_value)
|
2012-01-02 09:21:57 +00:00
|
|
|
{
|
2012-01-02 17:05:06 +00:00
|
|
|
GtkCssStyleProperty *node;
|
2012-01-02 10:12:46 +00:00
|
|
|
|
2012-03-27 02:58:15 +00:00
|
|
|
g_assert (initial_value != NULL);
|
2012-03-27 13:58:22 +00:00
|
|
|
g_assert (parse_value != NULL);
|
2012-03-27 21:54:06 +00:00
|
|
|
g_assert (value_type == G_TYPE_NONE || query_value != NULL);
|
2012-03-28 04:20:47 +00:00
|
|
|
g_assert (value_type == G_TYPE_NONE || assign_value != NULL);
|
2012-03-06 13:16:32 +00:00
|
|
|
|
2012-01-14 16:12:57 +00:00
|
|
|
node = g_object_new (GTK_TYPE_CSS_STYLE_PROPERTY,
|
|
|
|
"value-type", value_type,
|
2012-04-02 06:53:51 +00:00
|
|
|
"animated", (flags & GTK_STYLE_PROPERTY_ANIMATED) ? TRUE : FALSE,
|
2012-01-14 16:12:57 +00:00
|
|
|
"inherit", (flags & GTK_STYLE_PROPERTY_INHERIT) ? TRUE : FALSE,
|
2012-03-06 13:16:32 +00:00
|
|
|
"initial-value", initial_value,
|
2012-01-14 16:12:57 +00:00
|
|
|
"name", name,
|
|
|
|
NULL);
|
|
|
|
|
2012-03-27 13:58:22 +00:00
|
|
|
node->parse_value = parse_value;
|
2012-01-14 16:12:57 +00:00
|
|
|
if (print_value)
|
|
|
|
node->print_value = print_value;
|
|
|
|
if (compute_value)
|
|
|
|
node->compute_value = compute_value;
|
2012-03-27 21:54:06 +00:00
|
|
|
node->query_value = query_value;
|
2012-03-28 04:20:47 +00:00
|
|
|
node->assign_value = assign_value;
|
2012-03-24 06:02:59 +00:00
|
|
|
if (equal_func)
|
|
|
|
node->equal_func = equal_func;
|
2012-01-02 10:12:46 +00:00
|
|
|
|
2012-03-06 13:16:32 +00:00
|
|
|
_gtk_css_value_unref (initial_value);
|
2012-03-31 03:28:58 +00:00
|
|
|
|
|
|
|
g_assert (_gtk_css_style_property_get_id (node) == expected_id);
|
2012-01-02 10:12:46 +00:00
|
|
|
}
|
|
|
|
|
2012-01-02 09:21:57 +00:00
|
|
|
/*** IMPLEMENTATIONS ***/
|
|
|
|
|
2012-03-27 21:54:06 +00:00
|
|
|
static void
|
|
|
|
query_simple (GtkCssStyleProperty *property,
|
|
|
|
const GtkCssValue *css_value,
|
|
|
|
GValue *value)
|
|
|
|
{
|
|
|
|
_gtk_css_value_init_gvalue (css_value, value);
|
|
|
|
}
|
|
|
|
|
2012-03-28 04:20:47 +00:00
|
|
|
static GtkCssValue *
|
|
|
|
assign_simple (GtkCssStyleProperty *property,
|
|
|
|
const GValue *value)
|
|
|
|
{
|
|
|
|
return _gtk_css_value_new_from_gvalue (value);
|
|
|
|
}
|
|
|
|
|
2012-03-27 21:54:06 +00:00
|
|
|
static void
|
|
|
|
query_length_as_int (GtkCssStyleProperty *property,
|
|
|
|
const GtkCssValue *css_value,
|
|
|
|
GValue *value)
|
|
|
|
{
|
|
|
|
g_value_init (value, G_TYPE_INT);
|
2012-03-27 22:04:29 +00:00
|
|
|
g_value_set_int (value, round (_gtk_css_number_value_get (css_value, 100)));
|
2012-03-27 21:54:06 +00:00
|
|
|
}
|
|
|
|
|
2012-03-28 04:20:47 +00:00
|
|
|
static GtkCssValue *
|
|
|
|
assign_length_from_int (GtkCssStyleProperty *property,
|
|
|
|
const GValue *value)
|
|
|
|
{
|
|
|
|
return _gtk_css_number_value_new (g_value_get_int (value), GTK_CSS_PX);
|
|
|
|
}
|
|
|
|
|
2012-03-30 01:51:25 +00:00
|
|
|
static void
|
|
|
|
query_length_as_double (GtkCssStyleProperty *property,
|
|
|
|
const GtkCssValue *css_value,
|
|
|
|
GValue *value)
|
|
|
|
{
|
|
|
|
g_value_init (value, G_TYPE_DOUBLE);
|
|
|
|
g_value_set_double (value, _gtk_css_number_value_get (css_value, 100));
|
|
|
|
}
|
|
|
|
|
|
|
|
static GtkCssValue *
|
|
|
|
assign_length_from_double (GtkCssStyleProperty *property,
|
|
|
|
const GValue *value)
|
|
|
|
{
|
|
|
|
return _gtk_css_number_value_new (g_value_get_double (value), GTK_CSS_PX);
|
|
|
|
}
|
|
|
|
|
2012-03-27 03:11:58 +00:00
|
|
|
static GtkCssValue *
|
|
|
|
color_parse (GtkCssStyleProperty *property,
|
|
|
|
GtkCssParser *parser,
|
|
|
|
GFile *base)
|
|
|
|
{
|
|
|
|
GtkSymbolicColor *symbolic;
|
|
|
|
|
|
|
|
if (_gtk_css_parser_try (parser, "currentcolor", TRUE))
|
|
|
|
{
|
|
|
|
symbolic = gtk_symbolic_color_ref (_gtk_symbolic_color_get_current_color ());
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
symbolic = _gtk_css_parser_read_symbolic_color (parser);
|
|
|
|
if (symbolic == NULL)
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
return _gtk_css_value_new_take_symbolic_color (symbolic);
|
|
|
|
}
|
|
|
|
|
2012-03-06 13:16:32 +00:00
|
|
|
static GtkCssValue *
|
2012-01-14 04:02:25 +00:00
|
|
|
color_compute (GtkCssStyleProperty *property,
|
|
|
|
GtkStyleContext *context,
|
2012-03-06 13:16:32 +00:00
|
|
|
GtkCssValue *specified)
|
2012-01-14 04:02:25 +00:00
|
|
|
{
|
2012-03-28 04:28:13 +00:00
|
|
|
return _gtk_css_rgba_value_compute_from_symbolic (specified,
|
|
|
|
_gtk_css_style_property_get_initial_value (property),
|
|
|
|
context,
|
|
|
|
FALSE);
|
|
|
|
}
|
2012-01-14 04:02:25 +00:00
|
|
|
|
2012-03-28 04:28:13 +00:00
|
|
|
static GtkCssValue *
|
|
|
|
color_property_compute (GtkCssStyleProperty *property,
|
|
|
|
GtkStyleContext *context,
|
|
|
|
GtkCssValue *specified)
|
|
|
|
{
|
|
|
|
GtkCssValue *value;
|
|
|
|
|
|
|
|
value = _gtk_css_rgba_value_compute_from_symbolic (specified,
|
|
|
|
_gtk_css_style_property_get_initial_value (property),
|
|
|
|
context,
|
|
|
|
TRUE);
|
|
|
|
_gtk_css_rgba_value_get_rgba (value);
|
|
|
|
return value;
|
|
|
|
}
|
2012-01-14 04:02:25 +00:00
|
|
|
|
2012-03-28 04:28:13 +00:00
|
|
|
static void
|
|
|
|
color_query (GtkCssStyleProperty *property,
|
|
|
|
const GtkCssValue *css_value,
|
|
|
|
GValue *value)
|
|
|
|
{
|
|
|
|
g_value_init (value, GDK_TYPE_RGBA);
|
|
|
|
g_value_set_boxed (value, _gtk_css_rgba_value_get_rgba (css_value));
|
|
|
|
}
|
|
|
|
|
|
|
|
static GtkCssValue *
|
|
|
|
color_assign (GtkCssStyleProperty *property,
|
|
|
|
const GValue *value)
|
|
|
|
{
|
|
|
|
return _gtk_css_rgba_value_new_from_rgba (g_value_get_boxed (value));
|
2012-01-14 04:02:25 +00:00
|
|
|
}
|
|
|
|
|
2012-03-26 15:24:02 +00:00
|
|
|
static GtkCssValue *
|
2012-04-03 07:49:37 +00:00
|
|
|
font_family_parse_one (GtkCssParser *parser)
|
2012-01-02 09:21:57 +00:00
|
|
|
{
|
|
|
|
char *name;
|
|
|
|
|
2012-04-03 07:49:37 +00:00
|
|
|
name = _gtk_css_parser_try_ident (parser, TRUE);
|
|
|
|
if (name)
|
|
|
|
{
|
|
|
|
GString *string = g_string_new (name);
|
|
|
|
g_free (name);
|
|
|
|
while ((name = _gtk_css_parser_try_ident (parser, TRUE)))
|
|
|
|
{
|
|
|
|
g_string_append_c (string, ' ');
|
|
|
|
g_string_append (string, name);
|
|
|
|
g_free (name);
|
|
|
|
}
|
|
|
|
name = g_string_free (string, FALSE);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
name = _gtk_css_parser_read_string (parser);
|
|
|
|
if (name == NULL)
|
|
|
|
return NULL;
|
|
|
|
}
|
2012-01-02 09:21:57 +00:00
|
|
|
|
2012-04-03 07:49:37 +00:00
|
|
|
return _gtk_css_string_value_new_take (name);
|
|
|
|
}
|
2012-01-02 09:21:57 +00:00
|
|
|
|
2012-04-03 07:49:37 +00:00
|
|
|
static GtkCssValue *
|
|
|
|
font_family_parse (GtkCssStyleProperty *property,
|
|
|
|
GtkCssParser *parser,
|
|
|
|
GFile *base)
|
|
|
|
{
|
|
|
|
return _gtk_css_array_value_parse (parser, font_family_parse_one, FALSE);
|
2012-01-02 09:21:57 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2012-03-30 01:09:26 +00:00
|
|
|
font_family_query (GtkCssStyleProperty *property,
|
|
|
|
const GtkCssValue *css_value,
|
|
|
|
GValue *value)
|
2012-01-02 09:21:57 +00:00
|
|
|
{
|
2012-03-30 01:09:26 +00:00
|
|
|
GPtrArray *array;
|
|
|
|
guint i;
|
|
|
|
|
|
|
|
array = g_ptr_array_new ();
|
2012-01-02 09:21:57 +00:00
|
|
|
|
2012-03-30 01:09:26 +00:00
|
|
|
for (i = 0; i < _gtk_css_array_value_get_n_values (css_value); i++)
|
2012-01-02 09:21:57 +00:00
|
|
|
{
|
2012-03-30 01:09:26 +00:00
|
|
|
g_ptr_array_add (array, g_strdup (_gtk_css_string_value_get (_gtk_css_array_value_get_nth (css_value, i))));
|
2012-01-02 09:21:57 +00:00
|
|
|
}
|
|
|
|
|
2012-03-30 01:09:26 +00:00
|
|
|
/* NULL-terminate */
|
|
|
|
g_ptr_array_add (array, NULL);
|
|
|
|
|
|
|
|
g_value_init (value, G_TYPE_STRV);
|
|
|
|
g_value_set_boxed (value, g_ptr_array_free (array, FALSE));
|
|
|
|
}
|
|
|
|
|
|
|
|
static GtkCssValue *
|
|
|
|
font_family_assign (GtkCssStyleProperty *property,
|
|
|
|
const GValue *value)
|
|
|
|
{
|
|
|
|
const char **names = g_value_get_boxed (value);
|
|
|
|
GtkCssValue *result;
|
|
|
|
GPtrArray *array;
|
|
|
|
|
|
|
|
array = g_ptr_array_new ();
|
|
|
|
|
|
|
|
for (names = g_value_get_boxed (value); *names; names++)
|
2012-01-02 09:21:57 +00:00
|
|
|
{
|
2012-03-30 01:09:26 +00:00
|
|
|
g_ptr_array_add (array, _gtk_css_string_value_new (*names));
|
2012-01-02 09:21:57 +00:00
|
|
|
}
|
2012-03-30 01:09:26 +00:00
|
|
|
|
2012-04-03 07:49:37 +00:00
|
|
|
result = _gtk_css_array_value_new_from_array ((GtkCssValue **) array->pdata, array->len);
|
2012-03-30 01:09:26 +00:00
|
|
|
g_ptr_array_free (array, TRUE);
|
|
|
|
return result;
|
2012-01-02 09:21:57 +00:00
|
|
|
}
|
|
|
|
|
2012-03-27 04:29:37 +00:00
|
|
|
static GtkCssValue *
|
|
|
|
parse_pango_style (GtkCssStyleProperty *property,
|
|
|
|
GtkCssParser *parser,
|
|
|
|
GFile *base)
|
|
|
|
{
|
2012-03-28 07:04:54 +00:00
|
|
|
GtkCssValue *value = _gtk_css_font_style_value_try_parse (parser);
|
|
|
|
|
|
|
|
if (value == NULL)
|
|
|
|
_gtk_css_parser_error (parser, "unknown value for property");
|
2012-03-27 04:29:37 +00:00
|
|
|
|
2012-03-28 07:04:54 +00:00
|
|
|
return value;
|
|
|
|
}
|
2012-03-27 04:29:37 +00:00
|
|
|
|
2012-03-28 07:04:54 +00:00
|
|
|
static void
|
|
|
|
query_pango_style (GtkCssStyleProperty *property,
|
|
|
|
const GtkCssValue *css_value,
|
|
|
|
GValue *value)
|
|
|
|
{
|
|
|
|
g_value_init (value, PANGO_TYPE_STYLE);
|
|
|
|
g_value_set_enum (value, _gtk_css_font_style_value_get (css_value));
|
|
|
|
}
|
|
|
|
|
|
|
|
static GtkCssValue *
|
|
|
|
assign_pango_style (GtkCssStyleProperty *property,
|
|
|
|
const GValue *value)
|
|
|
|
{
|
|
|
|
return _gtk_css_font_style_value_new (g_value_get_enum (value));
|
2012-03-27 04:29:37 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static GtkCssValue *
|
|
|
|
parse_pango_weight (GtkCssStyleProperty *property,
|
|
|
|
GtkCssParser *parser,
|
|
|
|
GFile *base)
|
|
|
|
{
|
2012-03-28 07:04:54 +00:00
|
|
|
GtkCssValue *value = _gtk_css_font_weight_value_try_parse (parser);
|
|
|
|
|
|
|
|
if (value == NULL)
|
|
|
|
_gtk_css_parser_error (parser, "unknown value for property");
|
2012-03-27 04:29:37 +00:00
|
|
|
|
2012-03-28 07:04:54 +00:00
|
|
|
return value;
|
|
|
|
}
|
2012-03-27 04:29:37 +00:00
|
|
|
|
2012-03-28 07:04:54 +00:00
|
|
|
static void
|
|
|
|
query_pango_weight (GtkCssStyleProperty *property,
|
|
|
|
const GtkCssValue *css_value,
|
|
|
|
GValue *value)
|
|
|
|
{
|
|
|
|
g_value_init (value, PANGO_TYPE_WEIGHT);
|
|
|
|
g_value_set_enum (value, _gtk_css_font_weight_value_get (css_value));
|
|
|
|
}
|
|
|
|
|
|
|
|
static GtkCssValue *
|
|
|
|
assign_pango_weight (GtkCssStyleProperty *property,
|
|
|
|
const GValue *value)
|
|
|
|
{
|
|
|
|
return _gtk_css_font_weight_value_new (g_value_get_enum (value));
|
2012-03-27 04:29:37 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static GtkCssValue *
|
|
|
|
parse_pango_variant (GtkCssStyleProperty *property,
|
|
|
|
GtkCssParser *parser,
|
|
|
|
GFile *base)
|
|
|
|
{
|
2012-03-28 07:04:54 +00:00
|
|
|
GtkCssValue *value = _gtk_css_font_variant_value_try_parse (parser);
|
|
|
|
|
|
|
|
if (value == NULL)
|
|
|
|
_gtk_css_parser_error (parser, "unknown value for property");
|
2012-03-27 04:29:37 +00:00
|
|
|
|
2012-03-28 07:04:54 +00:00
|
|
|
return value;
|
|
|
|
}
|
2012-03-27 04:29:37 +00:00
|
|
|
|
2012-03-28 07:04:54 +00:00
|
|
|
static void
|
|
|
|
query_pango_variant (GtkCssStyleProperty *property,
|
|
|
|
const GtkCssValue *css_value,
|
|
|
|
GValue *value)
|
|
|
|
{
|
|
|
|
g_value_init (value, PANGO_TYPE_VARIANT);
|
|
|
|
g_value_set_enum (value, _gtk_css_font_variant_value_get (css_value));
|
|
|
|
}
|
|
|
|
|
|
|
|
static GtkCssValue *
|
|
|
|
assign_pango_variant (GtkCssStyleProperty *property,
|
|
|
|
const GValue *value)
|
|
|
|
{
|
|
|
|
return _gtk_css_font_variant_value_new (g_value_get_enum (value));
|
2012-03-27 04:29:37 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static GtkCssValue *
|
|
|
|
parse_border_style (GtkCssStyleProperty *property,
|
|
|
|
GtkCssParser *parser,
|
|
|
|
GFile *base)
|
|
|
|
{
|
2012-03-28 06:19:53 +00:00
|
|
|
GtkCssValue *value = _gtk_css_border_style_value_try_parse (parser);
|
|
|
|
|
|
|
|
if (value == NULL)
|
|
|
|
_gtk_css_parser_error (parser, "unknown value for property");
|
2012-03-27 04:29:37 +00:00
|
|
|
|
2012-03-28 06:19:53 +00:00
|
|
|
return value;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
query_border_style (GtkCssStyleProperty *property,
|
|
|
|
const GtkCssValue *css_value,
|
|
|
|
GValue *value)
|
|
|
|
{
|
|
|
|
g_value_init (value, GTK_TYPE_BORDER_STYLE);
|
|
|
|
g_value_set_enum (value, _gtk_css_border_style_value_get (css_value));
|
|
|
|
}
|
2012-03-27 04:29:37 +00:00
|
|
|
|
2012-03-28 06:19:53 +00:00
|
|
|
static GtkCssValue *
|
|
|
|
assign_border_style (GtkCssStyleProperty *property,
|
|
|
|
const GValue *value)
|
|
|
|
{
|
|
|
|
return _gtk_css_border_style_value_new (g_value_get_enum (value));
|
2012-03-27 04:29:37 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static GtkCssValue *
|
|
|
|
parse_css_area (GtkCssStyleProperty *property,
|
|
|
|
GtkCssParser *parser,
|
|
|
|
GFile *base)
|
|
|
|
{
|
2012-03-30 00:19:39 +00:00
|
|
|
GtkCssValue *value = _gtk_css_area_value_try_parse (parser);
|
|
|
|
|
|
|
|
if (value == NULL)
|
|
|
|
_gtk_css_parser_error (parser, "unknown value for property");
|
2012-03-27 04:29:37 +00:00
|
|
|
|
2012-03-30 00:19:39 +00:00
|
|
|
return value;
|
2012-03-27 04:29:37 +00:00
|
|
|
}
|
|
|
|
|
2012-04-03 17:11:41 +00:00
|
|
|
static GtkCssValue *
|
|
|
|
bindings_value_parse_one (GtkCssParser *parser)
|
|
|
|
{
|
|
|
|
char *name;
|
|
|
|
|
|
|
|
name = _gtk_css_parser_try_ident (parser, TRUE);
|
|
|
|
if (name == NULL)
|
|
|
|
{
|
|
|
|
_gtk_css_parser_error (parser, "Not a valid binding name");
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (!gtk_binding_set_find (name))
|
|
|
|
{
|
|
|
|
_gtk_css_parser_error (parser, "No binding set named '%s'", name);
|
|
|
|
g_free (name);
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
return _gtk_css_string_value_new_take (name);
|
|
|
|
}
|
|
|
|
|
2012-03-26 15:24:02 +00:00
|
|
|
static GtkCssValue *
|
2012-01-02 17:05:06 +00:00
|
|
|
bindings_value_parse (GtkCssStyleProperty *property,
|
|
|
|
GtkCssParser *parser,
|
|
|
|
GFile *base)
|
2012-04-03 17:11:41 +00:00
|
|
|
{
|
|
|
|
return _gtk_css_array_value_parse (parser, bindings_value_parse_one, TRUE);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
bindings_value_query (GtkCssStyleProperty *property,
|
|
|
|
const GtkCssValue *css_value,
|
|
|
|
GValue *value)
|
2012-01-02 09:21:57 +00:00
|
|
|
{
|
|
|
|
GPtrArray *array;
|
2012-04-03 17:11:41 +00:00
|
|
|
guint i;
|
2012-01-02 09:21:57 +00:00
|
|
|
|
2012-04-03 17:11:41 +00:00
|
|
|
g_value_init (value, G_TYPE_PTR_ARRAY);
|
2012-01-02 09:21:57 +00:00
|
|
|
|
2012-04-03 17:11:41 +00:00
|
|
|
if (_gtk_css_array_value_get_n_values (css_value) == 0)
|
|
|
|
return;
|
2012-01-02 09:21:57 +00:00
|
|
|
|
2012-04-03 17:11:41 +00:00
|
|
|
array = g_ptr_array_new ();
|
2012-01-02 09:21:57 +00:00
|
|
|
|
2012-04-03 17:11:41 +00:00
|
|
|
for (i = 0; i < _gtk_css_array_value_get_n_values (css_value); i++)
|
|
|
|
{
|
|
|
|
GtkBindingSet *binding_set = gtk_binding_set_find (_gtk_css_string_value_get (_gtk_css_array_value_get_nth (css_value, i)));
|
2012-01-02 09:21:57 +00:00
|
|
|
|
|
|
|
g_ptr_array_add (array, binding_set);
|
|
|
|
}
|
|
|
|
|
2012-04-03 17:11:41 +00:00
|
|
|
g_value_take_boxed (value, array);
|
2012-01-02 09:21:57 +00:00
|
|
|
}
|
|
|
|
|
2012-04-03 17:11:41 +00:00
|
|
|
static GtkCssValue *
|
|
|
|
bindings_value_assign (GtkCssStyleProperty *property,
|
|
|
|
const GValue *value)
|
2012-01-02 09:21:57 +00:00
|
|
|
{
|
2012-04-03 17:11:41 +00:00
|
|
|
GPtrArray *binding_sets = g_value_get_boxed (value);
|
|
|
|
GtkCssValue **values, *result;
|
2012-01-02 09:21:57 +00:00
|
|
|
guint i;
|
|
|
|
|
2012-04-03 17:11:41 +00:00
|
|
|
if (binding_sets == NULL || binding_sets->len == 0)
|
|
|
|
return _gtk_css_array_value_new (NULL);
|
2012-01-02 09:21:57 +00:00
|
|
|
|
2012-04-03 17:11:41 +00:00
|
|
|
values = g_new (GtkCssValue *, binding_sets->len);
|
2012-01-02 09:21:57 +00:00
|
|
|
|
2012-04-03 17:11:41 +00:00
|
|
|
for (i = 0; i < binding_sets->len; i++)
|
|
|
|
{
|
|
|
|
GtkBindingSet *binding_set = g_ptr_array_index (binding_sets, i);
|
|
|
|
values[i] = _gtk_css_string_value_new (binding_set->set_name);
|
2012-01-02 09:21:57 +00:00
|
|
|
}
|
2012-04-03 17:11:41 +00:00
|
|
|
|
|
|
|
result = _gtk_css_array_value_new_from_array (values, binding_sets->len);
|
|
|
|
g_free (values);
|
|
|
|
return result;
|
2012-01-02 09:21:57 +00:00
|
|
|
}
|
|
|
|
|
2012-03-27 05:15:23 +00:00
|
|
|
static GtkCssValue *
|
|
|
|
shadow_value_parse (GtkCssStyleProperty *property,
|
|
|
|
GtkCssParser *parser,
|
|
|
|
GFile *base)
|
|
|
|
{
|
2012-04-03 13:15:24 +00:00
|
|
|
return _gtk_css_shadows_value_parse (parser);
|
2012-03-27 05:15:23 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static GtkCssValue *
|
|
|
|
shadow_value_compute (GtkCssStyleProperty *property,
|
|
|
|
GtkStyleContext *context,
|
|
|
|
GtkCssValue *specified)
|
|
|
|
{
|
2012-04-03 13:15:24 +00:00
|
|
|
return _gtk_css_shadows_value_compute (specified, context);
|
2012-03-27 05:15:23 +00:00
|
|
|
}
|
|
|
|
|
2012-03-26 15:24:02 +00:00
|
|
|
static GtkCssValue *
|
2012-01-02 17:05:06 +00:00
|
|
|
border_corner_radius_value_parse (GtkCssStyleProperty *property,
|
|
|
|
GtkCssParser *parser,
|
|
|
|
GFile *base)
|
2012-01-02 09:21:57 +00:00
|
|
|
{
|
2012-04-03 16:39:01 +00:00
|
|
|
return _gtk_css_corner_value_parse (parser);
|
2012-01-02 09:21:57 +00:00
|
|
|
}
|
|
|
|
|
2012-04-03 16:39:01 +00:00
|
|
|
static GtkCssValue *
|
|
|
|
border_corner_radius_value_compute (GtkCssStyleProperty *property,
|
|
|
|
GtkStyleContext *context,
|
|
|
|
GtkCssValue *specified)
|
2012-01-02 09:21:57 +00:00
|
|
|
{
|
2012-04-03 16:39:01 +00:00
|
|
|
return _gtk_css_corner_value_compute (specified, context);
|
2012-01-02 09:21:57 +00:00
|
|
|
}
|
|
|
|
|
2012-03-26 15:24:02 +00:00
|
|
|
static GtkCssValue *
|
2012-01-02 21:22:25 +00:00
|
|
|
css_image_value_parse (GtkCssStyleProperty *property,
|
|
|
|
GtkCssParser *parser,
|
|
|
|
GFile *base)
|
|
|
|
{
|
|
|
|
GtkCssImage *image;
|
|
|
|
|
|
|
|
if (_gtk_css_parser_try (parser, "none", TRUE))
|
|
|
|
image = NULL;
|
|
|
|
else
|
|
|
|
{
|
|
|
|
image = _gtk_css_image_new_parse (parser, base);
|
|
|
|
if (image == NULL)
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
2012-03-29 00:58:32 +00:00
|
|
|
return _gtk_css_image_value_new (image);
|
2012-01-02 21:22:25 +00:00
|
|
|
}
|
|
|
|
|
2012-03-06 13:16:32 +00:00
|
|
|
static GtkCssValue *
|
2012-01-02 21:22:25 +00:00
|
|
|
css_image_value_compute (GtkCssStyleProperty *property,
|
|
|
|
GtkStyleContext *context,
|
2012-03-06 13:16:32 +00:00
|
|
|
GtkCssValue *specified)
|
2012-01-02 21:22:25 +00:00
|
|
|
{
|
2012-04-07 19:32:39 +00:00
|
|
|
GtkCssImage *image, *computed;
|
|
|
|
|
2012-03-29 00:58:32 +00:00
|
|
|
image = _gtk_css_image_value_get_image (specified);
|
2012-01-02 21:22:25 +00:00
|
|
|
|
2012-04-07 19:32:39 +00:00
|
|
|
if (image == NULL)
|
|
|
|
return _gtk_css_value_ref (specified);
|
|
|
|
|
|
|
|
computed = _gtk_css_image_compute (image, context);
|
|
|
|
|
|
|
|
if (computed == image)
|
|
|
|
{
|
|
|
|
g_object_unref (computed);
|
|
|
|
return _gtk_css_value_ref (specified);
|
|
|
|
}
|
2012-01-02 21:22:25 +00:00
|
|
|
|
2012-03-29 00:58:32 +00:00
|
|
|
return _gtk_css_image_value_new (computed);
|
2012-01-02 21:22:25 +00:00
|
|
|
}
|
|
|
|
|
2012-03-27 21:54:06 +00:00
|
|
|
static void
|
|
|
|
css_image_value_query (GtkCssStyleProperty *property,
|
|
|
|
const GtkCssValue *css_value,
|
|
|
|
GValue *value)
|
|
|
|
{
|
2012-03-29 00:58:32 +00:00
|
|
|
GtkCssImage *image = _gtk_css_image_value_get_image (css_value);
|
2012-03-27 21:54:06 +00:00
|
|
|
cairo_pattern_t *pattern;
|
|
|
|
cairo_surface_t *surface;
|
|
|
|
cairo_matrix_t matrix;
|
|
|
|
|
|
|
|
g_value_init (value, CAIRO_GOBJECT_TYPE_PATTERN);
|
|
|
|
|
|
|
|
if (GTK_IS_CSS_IMAGE_GRADIENT (image))
|
|
|
|
g_value_set_boxed (value, GTK_CSS_IMAGE_GRADIENT (image)->pattern);
|
|
|
|
else if (image != NULL)
|
|
|
|
{
|
|
|
|
double width, height;
|
|
|
|
|
|
|
|
/* the 100, 100 is rather random */
|
|
|
|
_gtk_css_image_get_concrete_size (image, 0, 0, 100, 100, &width, &height);
|
|
|
|
surface = _gtk_css_image_get_surface (image, NULL, width, height);
|
|
|
|
pattern = cairo_pattern_create_for_surface (surface);
|
|
|
|
cairo_matrix_init_scale (&matrix, width, height);
|
|
|
|
cairo_pattern_set_matrix (pattern, &matrix);
|
|
|
|
cairo_surface_destroy (surface);
|
|
|
|
g_value_take_boxed (value, pattern);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-03-28 04:20:47 +00:00
|
|
|
static GtkCssValue *
|
|
|
|
css_image_value_assign (GtkCssStyleProperty *property,
|
|
|
|
const GValue *value)
|
|
|
|
{
|
|
|
|
g_warning ("FIXME: assigning images is not implemented");
|
2012-03-29 00:58:32 +00:00
|
|
|
return _gtk_css_image_value_new (NULL);
|
2012-03-28 04:20:47 +00:00
|
|
|
}
|
|
|
|
|
2012-03-27 07:05:47 +00:00
|
|
|
static GtkCssValue *
|
|
|
|
font_size_parse (GtkCssStyleProperty *property,
|
|
|
|
GtkCssParser *parser,
|
|
|
|
GFile *base)
|
|
|
|
{
|
|
|
|
gdouble d;
|
|
|
|
|
|
|
|
if (!_gtk_css_parser_try_double (parser, &d))
|
|
|
|
{
|
|
|
|
_gtk_css_parser_error (parser, "Expected a number");
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2012-03-30 01:51:25 +00:00
|
|
|
return _gtk_css_number_value_new (d, GTK_CSS_PX);
|
|
|
|
}
|
|
|
|
|
|
|
|
static GtkCssValue *
|
|
|
|
font_size_compute (GtkCssStyleProperty *property,
|
|
|
|
GtkStyleContext *context,
|
|
|
|
GtkCssValue *specified)
|
|
|
|
{
|
|
|
|
return _gtk_css_number_value_compute (specified, context);
|
2012-03-27 07:05:47 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static GtkCssValue *
|
|
|
|
outline_parse (GtkCssStyleProperty *property,
|
|
|
|
GtkCssParser *parser,
|
|
|
|
GFile *base)
|
|
|
|
{
|
2012-04-03 14:57:44 +00:00
|
|
|
return _gtk_css_number_value_parse (parser,
|
|
|
|
GTK_CSS_NUMBER_AS_PIXELS
|
|
|
|
| GTK_CSS_PARSE_LENGTH);
|
|
|
|
}
|
2012-03-27 07:05:47 +00:00
|
|
|
|
2012-04-03 14:57:44 +00:00
|
|
|
static GtkCssValue *
|
|
|
|
outline_compute (GtkCssStyleProperty *property,
|
|
|
|
GtkStyleContext *context,
|
|
|
|
GtkCssValue *specified)
|
|
|
|
{
|
|
|
|
return _gtk_css_number_value_compute (specified, context);
|
2012-03-27 07:05:47 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static GtkCssValue *
|
|
|
|
border_image_repeat_parse (GtkCssStyleProperty *property,
|
|
|
|
GtkCssParser *parser,
|
|
|
|
GFile *base)
|
|
|
|
{
|
|
|
|
GValue value = G_VALUE_INIT;
|
|
|
|
GtkCssValue *result;
|
|
|
|
|
|
|
|
g_value_init (&value, GTK_TYPE_CSS_BORDER_IMAGE_REPEAT);
|
|
|
|
if (!_gtk_css_style_parse_value (&value, parser, base))
|
|
|
|
{
|
|
|
|
g_value_unset (&value);
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
result = _gtk_css_value_new_from_gvalue (&value);
|
|
|
|
g_value_unset (&value);
|
|
|
|
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
|
|
|
static GtkCssValue *
|
|
|
|
border_image_slice_parse (GtkCssStyleProperty *property,
|
|
|
|
GtkCssParser *parser,
|
|
|
|
GFile *base)
|
|
|
|
{
|
|
|
|
GValue value = G_VALUE_INIT;
|
|
|
|
GtkCssValue *result;
|
|
|
|
|
|
|
|
g_value_init (&value, GTK_TYPE_BORDER);
|
|
|
|
if (!_gtk_css_style_parse_value (&value, parser, base))
|
|
|
|
{
|
|
|
|
g_value_unset (&value);
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
result = _gtk_css_value_new_from_gvalue (&value);
|
|
|
|
g_value_unset (&value);
|
|
|
|
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
|
|
|
static GtkCssValue *
|
|
|
|
border_image_width_parse (GtkCssStyleProperty *property,
|
|
|
|
GtkCssParser *parser,
|
|
|
|
GFile *base)
|
|
|
|
{
|
|
|
|
GValue value = G_VALUE_INIT;
|
|
|
|
GtkCssValue *result;
|
|
|
|
|
|
|
|
g_value_init (&value, GTK_TYPE_BORDER);
|
|
|
|
if (!_gtk_css_style_parse_value (&value, parser, base))
|
|
|
|
{
|
|
|
|
g_value_unset (&value);
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
result = _gtk_css_value_new_from_gvalue (&value);
|
|
|
|
g_value_unset (&value);
|
|
|
|
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
2012-04-01 04:22:20 +00:00
|
|
|
static GtkCssValue *
|
2012-04-03 07:49:37 +00:00
|
|
|
transition_property_parse_one (GtkCssParser *parser)
|
2012-04-01 04:22:20 +00:00
|
|
|
{
|
2012-04-03 07:49:37 +00:00
|
|
|
GtkCssValue *value;
|
2012-04-01 04:22:20 +00:00
|
|
|
|
2012-04-03 07:49:37 +00:00
|
|
|
value = _gtk_css_ident_value_try_parse (parser);
|
2012-04-01 04:22:20 +00:00
|
|
|
|
2012-04-03 07:49:37 +00:00
|
|
|
if (value == NULL)
|
|
|
|
{
|
|
|
|
_gtk_css_parser_error (parser, "Expected an identifier");
|
|
|
|
return NULL;
|
|
|
|
}
|
2012-04-01 04:22:20 +00:00
|
|
|
|
2012-04-03 07:49:37 +00:00
|
|
|
return value;
|
|
|
|
}
|
2012-04-01 04:22:20 +00:00
|
|
|
|
2012-04-03 07:49:37 +00:00
|
|
|
static GtkCssValue *
|
|
|
|
transition_property_parse (GtkCssStyleProperty *property,
|
|
|
|
GtkCssParser *parser,
|
|
|
|
GFile *base)
|
|
|
|
{
|
|
|
|
return _gtk_css_array_value_parse (parser, transition_property_parse_one, FALSE);
|
|
|
|
}
|
2012-04-01 04:22:20 +00:00
|
|
|
|
2012-04-03 07:49:37 +00:00
|
|
|
static GtkCssValue *
|
|
|
|
transition_time_parse_one (GtkCssParser *parser)
|
|
|
|
{
|
|
|
|
return _gtk_css_number_value_parse (parser, GTK_CSS_PARSE_TIME);
|
2012-04-01 04:22:20 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static GtkCssValue *
|
|
|
|
transition_time_parse (GtkCssStyleProperty *property,
|
|
|
|
GtkCssParser *parser,
|
|
|
|
GFile *base)
|
|
|
|
{
|
2012-04-03 07:49:37 +00:00
|
|
|
return _gtk_css_array_value_parse (parser, transition_time_parse_one, FALSE);
|
2012-04-01 04:22:20 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static GtkCssValue *
|
|
|
|
transition_timing_function_parse (GtkCssStyleProperty *property,
|
|
|
|
GtkCssParser *parser,
|
|
|
|
GFile *base)
|
|
|
|
{
|
2012-04-03 07:49:37 +00:00
|
|
|
return _gtk_css_array_value_parse (parser, _gtk_css_ease_value_parse, FALSE);
|
2012-04-01 04:22:20 +00:00
|
|
|
}
|
|
|
|
|
2012-03-27 07:05:47 +00:00
|
|
|
static GtkCssValue *
|
|
|
|
engine_parse (GtkCssStyleProperty *property,
|
|
|
|
GtkCssParser *parser,
|
|
|
|
GFile *base)
|
|
|
|
{
|
|
|
|
GtkThemingEngine *engine;
|
|
|
|
char *str;
|
|
|
|
|
|
|
|
if (_gtk_css_parser_try (parser, "none", TRUE))
|
|
|
|
return _gtk_css_value_new_from_theming_engine (gtk_theming_engine_load (NULL));
|
|
|
|
|
|
|
|
str = _gtk_css_parser_try_ident (parser, TRUE);
|
|
|
|
if (str == NULL)
|
|
|
|
{
|
|
|
|
_gtk_css_parser_error (parser, "Expected a valid theme name");
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
engine = gtk_theming_engine_load (str);
|
|
|
|
|
|
|
|
if (engine == NULL)
|
|
|
|
{
|
|
|
|
_gtk_css_parser_error (parser, "Theming engine '%s' not found", str);
|
|
|
|
g_free (str);
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
g_free (str);
|
|
|
|
|
|
|
|
return _gtk_css_value_new_from_theming_engine (engine);
|
|
|
|
}
|
|
|
|
|
|
|
|
static GtkCssValue *
|
|
|
|
transition_parse (GtkCssStyleProperty *property,
|
|
|
|
GtkCssParser *parser,
|
|
|
|
GFile *base)
|
|
|
|
{
|
|
|
|
GValue value = G_VALUE_INIT;
|
|
|
|
GtkCssValue *result;
|
|
|
|
|
|
|
|
g_value_init (&value, GTK_TYPE_ANIMATION_DESCRIPTION);
|
|
|
|
if (!_gtk_css_style_parse_value (&value, parser, base))
|
|
|
|
{
|
|
|
|
g_value_unset (&value);
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
result = _gtk_css_value_new_from_gvalue (&value);
|
|
|
|
g_value_unset (&value);
|
|
|
|
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
2012-03-26 15:24:02 +00:00
|
|
|
static GtkCssValue *
|
2012-01-17 15:41:14 +00:00
|
|
|
parse_margin (GtkCssStyleProperty *property,
|
|
|
|
GtkCssParser *parser,
|
|
|
|
GFile *base)
|
|
|
|
{
|
2012-03-27 22:04:29 +00:00
|
|
|
return _gtk_css_number_value_parse (parser,
|
|
|
|
GTK_CSS_NUMBER_AS_PIXELS
|
|
|
|
| GTK_CSS_PARSE_LENGTH);
|
2012-01-17 15:41:14 +00:00
|
|
|
}
|
|
|
|
|
2012-03-06 13:16:32 +00:00
|
|
|
static GtkCssValue *
|
2012-01-17 15:41:14 +00:00
|
|
|
compute_margin (GtkCssStyleProperty *property,
|
|
|
|
GtkStyleContext *context,
|
2012-03-06 13:16:32 +00:00
|
|
|
GtkCssValue *specified)
|
2012-01-17 15:41:14 +00:00
|
|
|
{
|
2012-03-27 22:04:29 +00:00
|
|
|
return _gtk_css_number_value_compute (specified, context);
|
2012-01-17 15:41:14 +00:00
|
|
|
}
|
|
|
|
|
2012-03-26 15:24:02 +00:00
|
|
|
static GtkCssValue *
|
2012-01-24 16:49:29 +00:00
|
|
|
parse_padding (GtkCssStyleProperty *property,
|
|
|
|
GtkCssParser *parser,
|
|
|
|
GFile *base)
|
|
|
|
{
|
2012-03-27 22:04:29 +00:00
|
|
|
return _gtk_css_number_value_parse (parser,
|
|
|
|
GTK_CSS_POSITIVE_ONLY
|
|
|
|
| GTK_CSS_NUMBER_AS_PIXELS
|
|
|
|
| GTK_CSS_PARSE_LENGTH);
|
2012-01-24 16:49:29 +00:00
|
|
|
}
|
|
|
|
|
2012-03-06 13:16:32 +00:00
|
|
|
static GtkCssValue *
|
2012-01-24 16:49:29 +00:00
|
|
|
compute_padding (GtkCssStyleProperty *property,
|
|
|
|
GtkStyleContext *context,
|
2012-03-06 13:16:32 +00:00
|
|
|
GtkCssValue *specified)
|
2012-01-24 16:49:29 +00:00
|
|
|
{
|
2012-03-27 22:04:29 +00:00
|
|
|
return _gtk_css_number_value_compute (specified, context);
|
2012-01-24 16:49:29 +00:00
|
|
|
}
|
|
|
|
|
2012-03-26 15:24:02 +00:00
|
|
|
static GtkCssValue *
|
2012-01-15 01:53:39 +00:00
|
|
|
parse_border_width (GtkCssStyleProperty *property,
|
|
|
|
GtkCssParser *parser,
|
|
|
|
GFile *base)
|
|
|
|
{
|
2012-03-27 22:04:29 +00:00
|
|
|
return _gtk_css_number_value_parse (parser,
|
|
|
|
GTK_CSS_POSITIVE_ONLY
|
|
|
|
| GTK_CSS_NUMBER_AS_PIXELS
|
|
|
|
| GTK_CSS_PARSE_LENGTH);
|
2012-01-15 01:53:39 +00:00
|
|
|
}
|
|
|
|
|
2012-03-06 13:16:32 +00:00
|
|
|
static GtkCssValue *
|
2012-01-06 21:25:05 +00:00
|
|
|
compute_border_width (GtkCssStyleProperty *property,
|
|
|
|
GtkStyleContext *context,
|
2012-03-06 13:16:32 +00:00
|
|
|
GtkCssValue *specified)
|
2012-01-06 21:25:05 +00:00
|
|
|
{
|
|
|
|
GtkBorderStyle border_style;
|
|
|
|
|
|
|
|
/* The -1 is magic that is only true because we register the style
|
|
|
|
* properties directly after the width properties.
|
|
|
|
*/
|
2012-03-31 03:42:28 +00:00
|
|
|
border_style = _gtk_css_border_style_value_get (_gtk_style_context_peek_property (context, _gtk_css_style_property_get_id (property) - 1));
|
2012-01-06 21:25:05 +00:00
|
|
|
|
2012-01-07 16:45:15 +00:00
|
|
|
if (border_style == GTK_BORDER_STYLE_NONE ||
|
|
|
|
border_style == GTK_BORDER_STYLE_HIDDEN)
|
2012-03-27 22:04:29 +00:00
|
|
|
return _gtk_css_number_value_new (0, GTK_CSS_PX);
|
2012-03-06 13:16:32 +00:00
|
|
|
else
|
2012-03-27 22:04:29 +00:00
|
|
|
return _gtk_css_number_value_compute (specified, context);
|
2012-01-06 21:25:05 +00:00
|
|
|
}
|
|
|
|
|
2012-03-26 15:24:02 +00:00
|
|
|
static GtkCssValue *
|
2012-01-05 01:48:32 +00:00
|
|
|
background_repeat_value_parse (GtkCssStyleProperty *property,
|
|
|
|
GtkCssParser *parser,
|
|
|
|
GFile *base)
|
|
|
|
{
|
|
|
|
int repeat, vertical;
|
|
|
|
|
|
|
|
if (!_gtk_css_parser_try_enum (parser, GTK_TYPE_CSS_BACKGROUND_REPEAT, &repeat))
|
|
|
|
{
|
|
|
|
_gtk_css_parser_error (parser, "Not a valid value");
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (repeat <= GTK_CSS_BACKGROUND_REPEAT_MASK)
|
|
|
|
{
|
|
|
|
if (_gtk_css_parser_try_enum (parser, GTK_TYPE_CSS_BACKGROUND_REPEAT, &vertical))
|
|
|
|
{
|
|
|
|
if (vertical >= GTK_CSS_BACKGROUND_REPEAT_MASK)
|
|
|
|
{
|
|
|
|
_gtk_css_parser_error (parser, "Not a valid 2nd value");
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
repeat |= vertical << GTK_CSS_BACKGROUND_REPEAT_SHIFT;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
repeat |= repeat << GTK_CSS_BACKGROUND_REPEAT_SHIFT;
|
|
|
|
}
|
|
|
|
|
2012-03-26 15:24:02 +00:00
|
|
|
return _gtk_css_value_new_from_enum (GTK_TYPE_CSS_BACKGROUND_REPEAT, repeat);
|
2012-01-05 01:48:32 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
background_repeat_value_print (GtkCssStyleProperty *property,
|
2012-03-26 04:46:29 +00:00
|
|
|
const GtkCssValue *value,
|
2012-01-05 01:48:32 +00:00
|
|
|
GString *string)
|
|
|
|
{
|
|
|
|
GEnumClass *enum_class;
|
|
|
|
GEnumValue *enum_value;
|
|
|
|
GtkCssBackgroundRepeat repeat;
|
|
|
|
|
2012-03-26 04:46:29 +00:00
|
|
|
repeat = _gtk_css_value_get_enum (value);
|
2012-01-05 01:48:32 +00:00
|
|
|
enum_class = g_type_class_ref (GTK_TYPE_CSS_BACKGROUND_REPEAT);
|
|
|
|
enum_value = g_enum_get_value (enum_class, repeat);
|
|
|
|
|
|
|
|
/* only triggers for 'repeat-x' and 'repeat-y' */
|
|
|
|
if (enum_value)
|
|
|
|
g_string_append (string, enum_value->value_nick);
|
|
|
|
else
|
|
|
|
{
|
|
|
|
enum_value = g_enum_get_value (enum_class, GTK_CSS_BACKGROUND_HORIZONTAL (repeat));
|
|
|
|
g_string_append (string, enum_value->value_nick);
|
|
|
|
|
|
|
|
if (GTK_CSS_BACKGROUND_HORIZONTAL (repeat) != GTK_CSS_BACKGROUND_VERTICAL (repeat))
|
|
|
|
{
|
|
|
|
enum_value = g_enum_get_value (enum_class, GTK_CSS_BACKGROUND_VERTICAL (repeat));
|
|
|
|
g_string_append (string, " ");
|
|
|
|
g_string_append (string, enum_value->value_nick);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
g_type_class_unref (enum_class);
|
|
|
|
}
|
|
|
|
|
2012-03-26 15:24:02 +00:00
|
|
|
static GtkCssValue *
|
2012-01-17 14:11:48 +00:00
|
|
|
background_size_parse (GtkCssStyleProperty *property,
|
|
|
|
GtkCssParser *parser,
|
|
|
|
GFile *base)
|
|
|
|
{
|
|
|
|
GtkCssBackgroundSize size = { GTK_CSS_NUMBER_INIT (0, GTK_CSS_PX), GTK_CSS_NUMBER_INIT (0, GTK_CSS_PX), FALSE, FALSE};
|
|
|
|
|
|
|
|
if (_gtk_css_parser_try (parser, "cover", TRUE))
|
|
|
|
size.cover = TRUE;
|
|
|
|
else if (_gtk_css_parser_try (parser, "contain", TRUE))
|
|
|
|
size.contain = TRUE;
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (_gtk_css_parser_try (parser, "auto", TRUE))
|
|
|
|
_gtk_css_number_init (&size.width, 0, GTK_CSS_PX);
|
|
|
|
else if (!_gtk_css_parser_read_number (parser,
|
|
|
|
&size.width,
|
|
|
|
GTK_CSS_POSITIVE_ONLY
|
|
|
|
| GTK_CSS_PARSE_PERCENT
|
|
|
|
| GTK_CSS_PARSE_LENGTH))
|
2012-03-26 15:24:02 +00:00
|
|
|
return NULL;
|
2012-01-17 14:11:48 +00:00
|
|
|
|
|
|
|
if (_gtk_css_parser_try (parser, "auto", TRUE))
|
|
|
|
_gtk_css_number_init (&size.height, 0, GTK_CSS_PX);
|
|
|
|
else if (_gtk_css_parser_has_number (parser))
|
|
|
|
{
|
|
|
|
if (!_gtk_css_parser_read_number (parser,
|
|
|
|
&size.height,
|
|
|
|
GTK_CSS_POSITIVE_ONLY
|
|
|
|
| GTK_CSS_PARSE_PERCENT
|
|
|
|
| GTK_CSS_PARSE_LENGTH))
|
2012-03-26 15:24:02 +00:00
|
|
|
return NULL;
|
2012-01-17 14:11:48 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
_gtk_css_number_init (&size.height, 0, GTK_CSS_PX);
|
|
|
|
}
|
|
|
|
|
2012-03-26 15:24:02 +00:00
|
|
|
return _gtk_css_value_new_from_background_size (&size);
|
2012-01-17 14:11:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
background_size_print (GtkCssStyleProperty *property,
|
2012-03-26 04:46:29 +00:00
|
|
|
const GtkCssValue *value,
|
2012-01-17 14:11:48 +00:00
|
|
|
GString *string)
|
|
|
|
{
|
2012-03-26 04:46:29 +00:00
|
|
|
const GtkCssBackgroundSize *size = _gtk_css_value_get_background_size (value);
|
2012-01-17 14:11:48 +00:00
|
|
|
|
|
|
|
if (size->cover)
|
|
|
|
g_string_append (string, "cover");
|
|
|
|
else if (size->contain)
|
|
|
|
g_string_append (string, "contain");
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (size->width.value == 0)
|
|
|
|
g_string_append (string, "auto");
|
|
|
|
else
|
|
|
|
_gtk_css_number_print (&size->width, string);
|
|
|
|
|
|
|
|
if (size->height.value != 0)
|
|
|
|
{
|
|
|
|
g_string_append (string, " ");
|
|
|
|
_gtk_css_number_print (&size->height, string);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-03-06 13:16:32 +00:00
|
|
|
static GtkCssValue *
|
2012-01-17 14:11:48 +00:00
|
|
|
background_size_compute (GtkCssStyleProperty *property,
|
|
|
|
GtkStyleContext *context,
|
2012-03-06 13:16:32 +00:00
|
|
|
GtkCssValue *specified)
|
2012-01-17 14:11:48 +00:00
|
|
|
{
|
2012-03-23 22:23:30 +00:00
|
|
|
const GtkCssBackgroundSize *ssize = _gtk_css_value_get_background_size (specified);
|
2012-01-17 14:11:48 +00:00
|
|
|
GtkCssBackgroundSize csize;
|
2012-03-06 13:16:32 +00:00
|
|
|
gboolean changed;
|
2012-01-17 14:11:48 +00:00
|
|
|
|
|
|
|
csize.cover = ssize->cover;
|
|
|
|
csize.contain = ssize->contain;
|
2012-03-06 13:16:32 +00:00
|
|
|
changed = _gtk_css_number_compute (&csize.width,
|
|
|
|
&ssize->width,
|
|
|
|
context);
|
|
|
|
changed |= _gtk_css_number_compute (&csize.height,
|
|
|
|
&ssize->height,
|
|
|
|
context);
|
|
|
|
if (changed)
|
|
|
|
return _gtk_css_value_new_from_background_size (&csize);
|
|
|
|
return _gtk_css_value_ref (specified);
|
2012-01-17 14:11:48 +00:00
|
|
|
}
|
|
|
|
|
2012-03-26 15:24:02 +00:00
|
|
|
static GtkCssValue *
|
2012-03-16 21:13:39 +00:00
|
|
|
background_position_parse (GtkCssStyleProperty *property,
|
|
|
|
GtkCssParser *parser,
|
|
|
|
GFile *base)
|
|
|
|
{
|
|
|
|
static const struct {
|
|
|
|
const char *name;
|
|
|
|
guint percentage;
|
|
|
|
gboolean horizontal;
|
|
|
|
gboolean vertical;
|
|
|
|
} names[] = {
|
|
|
|
{ "left", 0, TRUE, FALSE },
|
|
|
|
{ "right", 100, TRUE, FALSE },
|
|
|
|
{ "center", 50, TRUE, TRUE },
|
|
|
|
{ "top", 0, FALSE, TRUE },
|
|
|
|
{ "bottom", 100, FALSE, TRUE },
|
|
|
|
{ NULL , 0, TRUE, FALSE }, /* used for numbers */
|
|
|
|
{ NULL , 50, TRUE, TRUE } /* used for no value */
|
|
|
|
};
|
|
|
|
GtkCssBackgroundPosition pos;
|
|
|
|
GtkCssNumber *missing;
|
|
|
|
guint first, second;
|
|
|
|
|
|
|
|
for (first = 0; names[first].name != NULL; first++)
|
|
|
|
{
|
|
|
|
if (_gtk_css_parser_try (parser, names[first].name, TRUE))
|
|
|
|
{
|
|
|
|
if (names[first].horizontal)
|
|
|
|
{
|
|
|
|
_gtk_css_number_init (&pos.x, names[first].percentage, GTK_CSS_PERCENT);
|
|
|
|
missing = &pos.y;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
_gtk_css_number_init (&pos.y, names[first].percentage, GTK_CSS_PERCENT);
|
|
|
|
missing = &pos.x;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (names[first].name == NULL)
|
|
|
|
{
|
|
|
|
missing = &pos.y;
|
|
|
|
if (!_gtk_css_parser_read_number (parser,
|
|
|
|
&pos.x,
|
|
|
|
GTK_CSS_PARSE_PERCENT
|
|
|
|
| GTK_CSS_PARSE_LENGTH))
|
2012-03-26 15:24:02 +00:00
|
|
|
return NULL;
|
2012-03-16 21:13:39 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
for (second = 0; names[second].name != NULL; second++)
|
|
|
|
{
|
|
|
|
if (_gtk_css_parser_try (parser, names[second].name, TRUE))
|
|
|
|
{
|
|
|
|
_gtk_css_number_init (missing, names[second].percentage, GTK_CSS_PERCENT);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (names[second].name == NULL)
|
|
|
|
{
|
|
|
|
if (_gtk_css_parser_has_number (parser))
|
|
|
|
{
|
|
|
|
if (missing != &pos.y)
|
|
|
|
{
|
|
|
|
_gtk_css_parser_error (parser, "Invalid combination of values");
|
2012-03-26 15:24:02 +00:00
|
|
|
return NULL;
|
2012-03-16 21:13:39 +00:00
|
|
|
}
|
|
|
|
if (!_gtk_css_parser_read_number (parser,
|
|
|
|
missing,
|
|
|
|
GTK_CSS_PARSE_PERCENT
|
|
|
|
| GTK_CSS_PARSE_LENGTH))
|
2012-03-26 15:24:02 +00:00
|
|
|
return NULL;
|
2012-03-16 21:13:39 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
second++;
|
|
|
|
_gtk_css_number_init (missing, 50, GTK_CSS_PERCENT);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if ((names[first].horizontal && !names[second].vertical) ||
|
|
|
|
(!names[first].horizontal && !names[second].horizontal))
|
|
|
|
{
|
|
|
|
_gtk_css_parser_error (parser, "Invalid combination of values");
|
2012-03-26 15:24:02 +00:00
|
|
|
return NULL;
|
2012-03-16 21:13:39 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-03-26 15:24:02 +00:00
|
|
|
return _gtk_css_value_new_from_background_position (&pos);
|
2012-03-16 21:13:39 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
background_position_print (GtkCssStyleProperty *property,
|
2012-03-26 04:46:29 +00:00
|
|
|
const GtkCssValue *value,
|
2012-03-16 21:13:39 +00:00
|
|
|
GString *string)
|
|
|
|
{
|
2012-03-26 04:46:29 +00:00
|
|
|
const GtkCssBackgroundPosition *pos = _gtk_css_value_get_background_position (value);
|
2012-03-16 21:13:39 +00:00
|
|
|
static const GtkCssNumber center = GTK_CSS_NUMBER_INIT (50, GTK_CSS_PERCENT);
|
|
|
|
static const struct {
|
|
|
|
const char *x_name;
|
|
|
|
const char *y_name;
|
|
|
|
GtkCssNumber number;
|
|
|
|
} values[] = {
|
|
|
|
{ "left", "top", GTK_CSS_NUMBER_INIT (0, GTK_CSS_PERCENT) },
|
|
|
|
{ "right", "bottom", GTK_CSS_NUMBER_INIT (100, GTK_CSS_PERCENT) }
|
|
|
|
};
|
|
|
|
guint i;
|
|
|
|
|
|
|
|
if (_gtk_css_number_equal (&pos->x, ¢er))
|
|
|
|
{
|
|
|
|
if (_gtk_css_number_equal (&pos->y, ¢er))
|
|
|
|
{
|
|
|
|
g_string_append (string, "center");
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
for (i = 0; i < G_N_ELEMENTS (values); i++)
|
|
|
|
{
|
|
|
|
if (_gtk_css_number_equal (&pos->x, &values[i].number))
|
|
|
|
{
|
|
|
|
g_string_append (string, values[i].x_name);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (i == G_N_ELEMENTS (values))
|
|
|
|
_gtk_css_number_print (&pos->x, string);
|
|
|
|
|
|
|
|
if (_gtk_css_number_equal (&pos->y, ¢er))
|
|
|
|
return;
|
|
|
|
|
|
|
|
g_string_append_c (string, ' ');
|
|
|
|
}
|
|
|
|
|
|
|
|
for (i = 0; i < G_N_ELEMENTS (values); i++)
|
|
|
|
{
|
|
|
|
if (_gtk_css_number_equal (&pos->y, &values[i].number))
|
|
|
|
{
|
|
|
|
g_string_append (string, values[i].y_name);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (i == G_N_ELEMENTS (values))
|
|
|
|
{
|
|
|
|
if (_gtk_css_number_equal (&pos->x, ¢er))
|
|
|
|
g_string_append (string, "center ");
|
|
|
|
_gtk_css_number_print (&pos->y, string);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static GtkCssValue *
|
|
|
|
background_position_compute (GtkCssStyleProperty *property,
|
|
|
|
GtkStyleContext *context,
|
|
|
|
GtkCssValue *specified)
|
|
|
|
{
|
2012-03-23 22:23:30 +00:00
|
|
|
const GtkCssBackgroundPosition *spos = _gtk_css_value_get_background_position (specified);
|
2012-03-16 21:13:39 +00:00
|
|
|
GtkCssBackgroundPosition cpos;
|
|
|
|
gboolean changed;
|
|
|
|
|
|
|
|
changed = _gtk_css_number_compute (&cpos.x,
|
|
|
|
&spos->x,
|
|
|
|
context);
|
|
|
|
changed |= _gtk_css_number_compute (&cpos.y,
|
|
|
|
&spos->y,
|
|
|
|
context);
|
|
|
|
if (changed)
|
|
|
|
return _gtk_css_value_new_from_background_position (&cpos);
|
|
|
|
return _gtk_css_value_ref (specified);
|
|
|
|
}
|
|
|
|
|
2012-01-02 09:21:57 +00:00
|
|
|
/*** REGISTRATION ***/
|
|
|
|
|
2012-01-14 02:22:59 +00:00
|
|
|
static GtkSymbolicColor *
|
|
|
|
gtk_symbolic_color_new_rgba (double red,
|
|
|
|
double green,
|
|
|
|
double blue,
|
|
|
|
double alpha)
|
|
|
|
{
|
|
|
|
GdkRGBA rgba = { red, green, blue, alpha };
|
|
|
|
|
|
|
|
return gtk_symbolic_color_new_literal (&rgba);
|
|
|
|
}
|
|
|
|
|
2012-01-02 09:21:57 +00:00
|
|
|
void
|
|
|
|
_gtk_css_style_property_init_properties (void)
|
|
|
|
{
|
2012-01-17 14:11:48 +00:00
|
|
|
GtkCssBackgroundSize default_background_size = { GTK_CSS_NUMBER_INIT (0, GTK_CSS_PX), GTK_CSS_NUMBER_INIT (0, GTK_CSS_PX), FALSE, FALSE };
|
2012-03-16 21:13:39 +00:00
|
|
|
GtkCssBackgroundPosition default_background_position = { GTK_CSS_NUMBER_INIT (0, GTK_CSS_PERCENT), GTK_CSS_NUMBER_INIT (0, GTK_CSS_PERCENT)};
|
2012-01-02 10:27:54 +00:00
|
|
|
GtkBorder border_of_ones = { 1, 1, 1, 1 };
|
|
|
|
GtkCssBorderImageRepeat border_image_repeat = { GTK_CSS_REPEAT_STYLE_STRETCH, GTK_CSS_REPEAT_STYLE_STRETCH };
|
2012-01-02 09:21:57 +00:00
|
|
|
|
2012-01-03 02:37:13 +00:00
|
|
|
/* Initialize "color" and "font-size" first,
|
|
|
|
* so that when computing values later they are
|
|
|
|
* done first. That way, 'currentColor' and font
|
|
|
|
* sizes in em can be looked up properly */
|
2012-01-14 16:12:57 +00:00
|
|
|
gtk_css_style_property_register ("color",
|
2012-03-31 03:28:58 +00:00
|
|
|
GTK_CSS_PROPERTY_COLOR,
|
2012-01-02 10:54:13 +00:00
|
|
|
GDK_TYPE_RGBA,
|
2012-04-02 07:16:08 +00:00
|
|
|
GTK_STYLE_PROPERTY_INHERIT | GTK_STYLE_PROPERTY_ANIMATED,
|
2012-03-27 03:11:58 +00:00
|
|
|
color_parse,
|
2012-01-02 09:21:57 +00:00
|
|
|
NULL,
|
2012-03-28 04:28:13 +00:00
|
|
|
color_property_compute,
|
|
|
|
color_query,
|
|
|
|
color_assign,
|
2012-03-24 06:02:59 +00:00
|
|
|
NULL,
|
2012-03-27 02:58:15 +00:00
|
|
|
_gtk_css_value_new_take_symbolic_color (
|
|
|
|
gtk_symbolic_color_new_rgba (1, 1, 1, 1)));
|
2012-01-14 16:12:57 +00:00
|
|
|
gtk_css_style_property_register ("font-size",
|
2012-03-31 03:28:58 +00:00
|
|
|
GTK_CSS_PROPERTY_FONT_SIZE,
|
2012-01-03 02:37:13 +00:00
|
|
|
G_TYPE_DOUBLE,
|
2012-04-02 07:16:08 +00:00
|
|
|
GTK_STYLE_PROPERTY_INHERIT | GTK_STYLE_PROPERTY_ANIMATED,
|
2012-03-27 07:05:47 +00:00
|
|
|
font_size_parse,
|
2012-01-03 02:37:13 +00:00
|
|
|
NULL,
|
2012-03-30 01:51:25 +00:00
|
|
|
font_size_compute,
|
|
|
|
query_length_as_double,
|
|
|
|
assign_length_from_double,
|
2012-01-03 02:37:13 +00:00
|
|
|
NULL,
|
2012-03-30 01:51:25 +00:00
|
|
|
/* XXX: This should be 'normal' */
|
|
|
|
_gtk_css_number_value_new (10.0, GTK_CSS_PX));
|
2012-01-03 02:37:13 +00:00
|
|
|
|
|
|
|
/* properties that aren't referenced when computing values
|
|
|
|
* start here */
|
2012-01-14 16:12:57 +00:00
|
|
|
gtk_css_style_property_register ("background-color",
|
2012-03-31 03:28:58 +00:00
|
|
|
GTK_CSS_PROPERTY_BACKGROUND_COLOR,
|
2012-01-02 10:54:13 +00:00
|
|
|
GDK_TYPE_RGBA,
|
2012-04-02 07:16:08 +00:00
|
|
|
GTK_STYLE_PROPERTY_ANIMATED,
|
2012-03-27 03:11:58 +00:00
|
|
|
color_parse,
|
2012-01-02 09:21:57 +00:00
|
|
|
NULL,
|
2012-01-03 16:59:31 +00:00
|
|
|
color_compute,
|
2012-03-28 04:28:13 +00:00
|
|
|
color_query,
|
|
|
|
color_assign,
|
2012-03-24 06:02:59 +00:00
|
|
|
NULL,
|
2012-03-27 02:58:15 +00:00
|
|
|
_gtk_css_value_new_take_symbolic_color (
|
|
|
|
gtk_symbolic_color_new_rgba (0, 0, 0, 0)));
|
2012-01-02 09:21:57 +00:00
|
|
|
|
2012-01-14 16:12:57 +00:00
|
|
|
gtk_css_style_property_register ("font-family",
|
2012-03-31 03:28:58 +00:00
|
|
|
GTK_CSS_PROPERTY_FONT_FAMILY,
|
2012-01-02 10:54:13 +00:00
|
|
|
G_TYPE_STRV,
|
2012-01-02 09:21:57 +00:00
|
|
|
GTK_STYLE_PROPERTY_INHERIT,
|
|
|
|
font_family_parse,
|
2012-01-02 17:28:24 +00:00
|
|
|
NULL,
|
2012-03-24 06:02:59 +00:00
|
|
|
NULL,
|
2012-03-30 01:09:26 +00:00
|
|
|
font_family_query,
|
|
|
|
font_family_assign,
|
|
|
|
NULL,
|
2012-04-03 07:49:37 +00:00
|
|
|
_gtk_css_array_value_new (_gtk_css_string_value_new ("Sans")));
|
2012-01-14 16:12:57 +00:00
|
|
|
gtk_css_style_property_register ("font-style",
|
2012-03-31 03:28:58 +00:00
|
|
|
GTK_CSS_PROPERTY_FONT_STYLE,
|
2012-01-02 10:54:13 +00:00
|
|
|
PANGO_TYPE_STYLE,
|
2012-01-02 09:21:57 +00:00
|
|
|
GTK_STYLE_PROPERTY_INHERIT,
|
2012-03-27 04:29:37 +00:00
|
|
|
parse_pango_style,
|
2012-01-02 09:21:57 +00:00
|
|
|
NULL,
|
2012-01-02 17:28:24 +00:00
|
|
|
NULL,
|
2012-03-28 07:04:54 +00:00
|
|
|
query_pango_style,
|
|
|
|
assign_pango_style,
|
2012-03-24 06:02:59 +00:00
|
|
|
NULL,
|
2012-03-28 07:04:54 +00:00
|
|
|
_gtk_css_font_style_value_new (PANGO_STYLE_NORMAL));
|
2012-01-14 16:12:57 +00:00
|
|
|
gtk_css_style_property_register ("font-variant",
|
2012-03-31 03:28:58 +00:00
|
|
|
GTK_CSS_PROPERTY_FONT_VARIANT,
|
2012-01-02 10:54:13 +00:00
|
|
|
PANGO_TYPE_VARIANT,
|
2012-01-02 09:21:57 +00:00
|
|
|
GTK_STYLE_PROPERTY_INHERIT,
|
2012-03-27 04:29:37 +00:00
|
|
|
parse_pango_variant,
|
2012-01-02 09:21:57 +00:00
|
|
|
NULL,
|
2012-01-02 17:28:24 +00:00
|
|
|
NULL,
|
2012-03-28 07:04:54 +00:00
|
|
|
query_pango_variant,
|
|
|
|
assign_pango_variant,
|
2012-03-24 06:02:59 +00:00
|
|
|
NULL,
|
2012-03-28 07:04:54 +00:00
|
|
|
_gtk_css_font_variant_value_new (PANGO_VARIANT_NORMAL));
|
2012-01-14 16:12:57 +00:00
|
|
|
gtk_css_style_property_register ("font-weight",
|
2012-03-31 03:28:58 +00:00
|
|
|
GTK_CSS_PROPERTY_FONT_WEIGHT,
|
2012-01-02 10:54:13 +00:00
|
|
|
PANGO_TYPE_WEIGHT,
|
2012-01-02 09:21:57 +00:00
|
|
|
GTK_STYLE_PROPERTY_INHERIT,
|
2012-03-27 04:29:37 +00:00
|
|
|
parse_pango_weight,
|
2012-01-02 09:21:57 +00:00
|
|
|
NULL,
|
2012-01-02 17:28:24 +00:00
|
|
|
NULL,
|
2012-03-28 07:04:54 +00:00
|
|
|
query_pango_weight,
|
|
|
|
assign_pango_weight,
|
2012-03-24 06:02:59 +00:00
|
|
|
NULL,
|
2012-03-28 07:04:54 +00:00
|
|
|
_gtk_css_font_weight_value_new (PANGO_WEIGHT_NORMAL));
|
2012-01-02 09:21:57 +00:00
|
|
|
|
2012-01-14 16:12:57 +00:00
|
|
|
gtk_css_style_property_register ("text-shadow",
|
2012-03-31 03:28:58 +00:00
|
|
|
GTK_CSS_PROPERTY_TEXT_SHADOW,
|
2012-03-27 23:07:46 +00:00
|
|
|
G_TYPE_NONE,
|
2012-04-03 13:33:00 +00:00
|
|
|
GTK_STYLE_PROPERTY_INHERIT | GTK_STYLE_PROPERTY_ANIMATED,
|
2012-03-27 05:15:23 +00:00
|
|
|
shadow_value_parse,
|
2012-03-27 23:56:57 +00:00
|
|
|
NULL,
|
2012-03-27 05:15:23 +00:00
|
|
|
shadow_value_compute,
|
2012-03-27 23:07:46 +00:00
|
|
|
NULL,
|
2012-03-24 06:02:59 +00:00
|
|
|
NULL,
|
2012-03-28 04:20:47 +00:00
|
|
|
NULL,
|
2012-04-03 13:15:24 +00:00
|
|
|
_gtk_css_shadows_value_new_none ());
|
2012-01-02 09:21:57 +00:00
|
|
|
|
2012-01-14 16:12:57 +00:00
|
|
|
gtk_css_style_property_register ("icon-shadow",
|
2012-03-31 03:28:58 +00:00
|
|
|
GTK_CSS_PROPERTY_ICON_SHADOW,
|
2012-03-27 23:07:46 +00:00
|
|
|
G_TYPE_NONE,
|
2012-04-03 13:33:00 +00:00
|
|
|
GTK_STYLE_PROPERTY_INHERIT | GTK_STYLE_PROPERTY_ANIMATED,
|
2012-03-27 05:15:23 +00:00
|
|
|
shadow_value_parse,
|
2012-03-27 23:56:57 +00:00
|
|
|
NULL,
|
2012-03-27 05:15:23 +00:00
|
|
|
shadow_value_compute,
|
2012-03-27 23:07:46 +00:00
|
|
|
NULL,
|
2012-03-24 06:02:59 +00:00
|
|
|
NULL,
|
2012-03-28 04:20:47 +00:00
|
|
|
NULL,
|
2012-04-03 13:15:24 +00:00
|
|
|
_gtk_css_shadows_value_new_none ());
|
2012-01-02 09:21:57 +00:00
|
|
|
|
2012-01-14 16:12:57 +00:00
|
|
|
gtk_css_style_property_register ("box-shadow",
|
2012-03-31 03:28:58 +00:00
|
|
|
GTK_CSS_PROPERTY_BOX_SHADOW,
|
2012-03-27 23:07:46 +00:00
|
|
|
G_TYPE_NONE,
|
2012-04-03 13:33:00 +00:00
|
|
|
GTK_STYLE_PROPERTY_ANIMATED,
|
2012-03-27 05:15:23 +00:00
|
|
|
shadow_value_parse,
|
2012-03-27 23:56:57 +00:00
|
|
|
NULL,
|
2012-03-27 05:15:23 +00:00
|
|
|
shadow_value_compute,
|
2012-03-27 23:07:46 +00:00
|
|
|
NULL,
|
2012-03-24 06:02:59 +00:00
|
|
|
NULL,
|
2012-03-28 04:20:47 +00:00
|
|
|
NULL,
|
2012-04-03 13:15:24 +00:00
|
|
|
_gtk_css_shadows_value_new_none ());
|
2012-01-02 10:27:54 +00:00
|
|
|
|
2012-01-14 16:12:57 +00:00
|
|
|
gtk_css_style_property_register ("margin-top",
|
2012-03-31 03:28:58 +00:00
|
|
|
GTK_CSS_PROPERTY_MARGIN_TOP,
|
2012-01-02 10:54:13 +00:00
|
|
|
G_TYPE_INT,
|
2012-04-02 07:16:08 +00:00
|
|
|
GTK_STYLE_PROPERTY_ANIMATED,
|
2012-01-17 15:41:14 +00:00
|
|
|
parse_margin,
|
2012-01-02 10:27:54 +00:00
|
|
|
NULL,
|
2012-01-17 15:41:14 +00:00
|
|
|
compute_margin,
|
2012-03-27 21:54:06 +00:00
|
|
|
query_length_as_int,
|
2012-03-28 04:20:47 +00:00
|
|
|
assign_length_from_int,
|
2012-03-24 06:02:59 +00:00
|
|
|
NULL,
|
2012-03-27 22:04:29 +00:00
|
|
|
_gtk_css_number_value_new (0.0, GTK_CSS_PX));
|
2012-01-14 16:12:57 +00:00
|
|
|
gtk_css_style_property_register ("margin-left",
|
2012-03-31 03:28:58 +00:00
|
|
|
GTK_CSS_PROPERTY_MARGIN_LEFT,
|
2012-01-02 10:54:13 +00:00
|
|
|
G_TYPE_INT,
|
2012-04-02 07:16:08 +00:00
|
|
|
GTK_STYLE_PROPERTY_ANIMATED,
|
2012-01-17 15:41:14 +00:00
|
|
|
parse_margin,
|
2012-01-02 10:27:54 +00:00
|
|
|
NULL,
|
2012-01-17 15:41:14 +00:00
|
|
|
compute_margin,
|
2012-03-27 21:54:06 +00:00
|
|
|
query_length_as_int,
|
2012-03-28 04:20:47 +00:00
|
|
|
assign_length_from_int,
|
2012-03-24 06:02:59 +00:00
|
|
|
NULL,
|
2012-03-27 22:04:29 +00:00
|
|
|
_gtk_css_number_value_new (0.0, GTK_CSS_PX));
|
2012-01-14 16:12:57 +00:00
|
|
|
gtk_css_style_property_register ("margin-bottom",
|
2012-03-31 03:28:58 +00:00
|
|
|
GTK_CSS_PROPERTY_MARGIN_BOTTOM,
|
2012-01-02 10:54:13 +00:00
|
|
|
G_TYPE_INT,
|
2012-04-02 07:16:08 +00:00
|
|
|
GTK_STYLE_PROPERTY_ANIMATED,
|
2012-01-17 15:41:14 +00:00
|
|
|
parse_margin,
|
2012-01-02 10:27:54 +00:00
|
|
|
NULL,
|
2012-01-17 15:41:14 +00:00
|
|
|
compute_margin,
|
2012-03-27 21:54:06 +00:00
|
|
|
query_length_as_int,
|
2012-03-28 04:20:47 +00:00
|
|
|
assign_length_from_int,
|
2012-03-24 06:02:59 +00:00
|
|
|
NULL,
|
2012-03-27 22:04:29 +00:00
|
|
|
_gtk_css_number_value_new (0.0, GTK_CSS_PX));
|
2012-01-14 16:12:57 +00:00
|
|
|
gtk_css_style_property_register ("margin-right",
|
2012-03-31 03:28:58 +00:00
|
|
|
GTK_CSS_PROPERTY_MARGIN_RIGHT,
|
2012-01-02 10:54:13 +00:00
|
|
|
G_TYPE_INT,
|
2012-04-02 07:16:08 +00:00
|
|
|
GTK_STYLE_PROPERTY_ANIMATED,
|
2012-01-17 15:41:14 +00:00
|
|
|
parse_margin,
|
2012-01-02 10:27:54 +00:00
|
|
|
NULL,
|
2012-01-17 15:41:14 +00:00
|
|
|
compute_margin,
|
2012-03-27 21:54:06 +00:00
|
|
|
query_length_as_int,
|
2012-03-28 04:20:47 +00:00
|
|
|
assign_length_from_int,
|
2012-03-24 06:02:59 +00:00
|
|
|
NULL,
|
2012-03-27 22:04:29 +00:00
|
|
|
_gtk_css_number_value_new (0.0, GTK_CSS_PX));
|
2012-01-14 16:12:57 +00:00
|
|
|
gtk_css_style_property_register ("padding-top",
|
2012-03-31 03:28:58 +00:00
|
|
|
GTK_CSS_PROPERTY_PADDING_TOP,
|
2012-01-02 10:54:13 +00:00
|
|
|
G_TYPE_INT,
|
2012-04-02 07:16:08 +00:00
|
|
|
GTK_STYLE_PROPERTY_ANIMATED,
|
2012-01-24 16:49:29 +00:00
|
|
|
parse_padding,
|
2012-01-02 10:27:54 +00:00
|
|
|
NULL,
|
2012-01-24 16:49:29 +00:00
|
|
|
compute_padding,
|
2012-03-27 21:54:06 +00:00
|
|
|
query_length_as_int,
|
2012-03-28 04:20:47 +00:00
|
|
|
assign_length_from_int,
|
2012-03-24 06:02:59 +00:00
|
|
|
NULL,
|
2012-03-27 22:04:29 +00:00
|
|
|
_gtk_css_number_value_new (0.0, GTK_CSS_PX));
|
2012-01-14 16:12:57 +00:00
|
|
|
gtk_css_style_property_register ("padding-left",
|
2012-03-31 03:28:58 +00:00
|
|
|
GTK_CSS_PROPERTY_PADDING_LEFT,
|
2012-01-02 10:54:13 +00:00
|
|
|
G_TYPE_INT,
|
2012-04-02 07:16:08 +00:00
|
|
|
GTK_STYLE_PROPERTY_ANIMATED,
|
2012-01-24 16:49:29 +00:00
|
|
|
parse_padding,
|
2012-01-02 10:27:54 +00:00
|
|
|
NULL,
|
2012-01-24 16:49:29 +00:00
|
|
|
compute_padding,
|
2012-03-27 21:54:06 +00:00
|
|
|
query_length_as_int,
|
2012-03-28 04:20:47 +00:00
|
|
|
assign_length_from_int,
|
2012-03-24 06:02:59 +00:00
|
|
|
NULL,
|
2012-03-27 22:04:29 +00:00
|
|
|
_gtk_css_number_value_new (0.0, GTK_CSS_PX));
|
2012-01-14 16:12:57 +00:00
|
|
|
gtk_css_style_property_register ("padding-bottom",
|
2012-03-31 03:28:58 +00:00
|
|
|
GTK_CSS_PROPERTY_PADDING_BOTTOM,
|
2012-01-02 10:54:13 +00:00
|
|
|
G_TYPE_INT,
|
2012-04-02 07:16:08 +00:00
|
|
|
GTK_STYLE_PROPERTY_ANIMATED,
|
2012-01-24 16:49:29 +00:00
|
|
|
parse_padding,
|
2012-01-02 10:27:54 +00:00
|
|
|
NULL,
|
2012-01-24 16:49:29 +00:00
|
|
|
compute_padding,
|
2012-03-27 21:54:06 +00:00
|
|
|
query_length_as_int,
|
2012-03-28 04:20:47 +00:00
|
|
|
assign_length_from_int,
|
2012-03-24 06:02:59 +00:00
|
|
|
NULL,
|
2012-03-27 22:04:29 +00:00
|
|
|
_gtk_css_number_value_new (0.0, GTK_CSS_PX));
|
2012-01-14 16:12:57 +00:00
|
|
|
gtk_css_style_property_register ("padding-right",
|
2012-03-31 03:28:58 +00:00
|
|
|
GTK_CSS_PROPERTY_PADDING_RIGHT,
|
2012-01-02 10:54:13 +00:00
|
|
|
G_TYPE_INT,
|
2012-04-02 07:16:08 +00:00
|
|
|
GTK_STYLE_PROPERTY_ANIMATED,
|
2012-01-24 16:49:29 +00:00
|
|
|
parse_padding,
|
2012-01-02 10:27:54 +00:00
|
|
|
NULL,
|
2012-01-24 16:49:29 +00:00
|
|
|
compute_padding,
|
2012-03-27 21:54:06 +00:00
|
|
|
query_length_as_int,
|
2012-03-28 04:20:47 +00:00
|
|
|
assign_length_from_int,
|
2012-03-24 06:02:59 +00:00
|
|
|
NULL,
|
2012-03-27 22:04:29 +00:00
|
|
|
_gtk_css_number_value_new (0.0, GTK_CSS_PX));
|
2012-01-06 21:25:05 +00:00
|
|
|
/* IMPORTANT: compute_border_width() requires that the border-width
|
|
|
|
* properties be immeditaly followed by the border-style properties
|
|
|
|
*/
|
2012-01-14 16:12:57 +00:00
|
|
|
gtk_css_style_property_register ("border-top-style",
|
2012-03-31 03:28:58 +00:00
|
|
|
GTK_CSS_PROPERTY_BORDER_TOP_STYLE,
|
2012-01-06 21:25:05 +00:00
|
|
|
GTK_TYPE_BORDER_STYLE,
|
|
|
|
0,
|
2012-03-27 04:29:37 +00:00
|
|
|
parse_border_style,
|
2012-01-06 21:25:05 +00:00
|
|
|
NULL,
|
|
|
|
NULL,
|
2012-03-28 06:19:53 +00:00
|
|
|
query_border_style,
|
|
|
|
assign_border_style,
|
2012-03-24 06:02:59 +00:00
|
|
|
NULL,
|
2012-03-28 06:19:53 +00:00
|
|
|
_gtk_css_border_style_value_new (GTK_BORDER_STYLE_NONE));
|
2012-01-14 16:12:57 +00:00
|
|
|
gtk_css_style_property_register ("border-top-width",
|
2012-03-31 03:28:58 +00:00
|
|
|
GTK_CSS_PROPERTY_BORDER_TOP_WIDTH,
|
2012-01-02 10:54:13 +00:00
|
|
|
G_TYPE_INT,
|
2012-04-02 07:16:08 +00:00
|
|
|
GTK_STYLE_PROPERTY_ANIMATED,
|
2012-01-15 01:53:39 +00:00
|
|
|
parse_border_width,
|
2012-01-02 10:27:54 +00:00
|
|
|
NULL,
|
2012-01-06 21:25:05 +00:00
|
|
|
compute_border_width,
|
2012-03-27 21:54:06 +00:00
|
|
|
query_length_as_int,
|
2012-03-28 04:20:47 +00:00
|
|
|
assign_length_from_int,
|
2012-03-24 06:02:59 +00:00
|
|
|
NULL,
|
2012-03-27 22:04:29 +00:00
|
|
|
_gtk_css_number_value_new (0.0, GTK_CSS_PX));
|
2012-01-14 16:12:57 +00:00
|
|
|
gtk_css_style_property_register ("border-left-style",
|
2012-03-31 03:28:58 +00:00
|
|
|
GTK_CSS_PROPERTY_BORDER_LEFT_STYLE,
|
2012-01-06 21:25:05 +00:00
|
|
|
GTK_TYPE_BORDER_STYLE,
|
|
|
|
0,
|
2012-03-27 04:29:37 +00:00
|
|
|
parse_border_style,
|
2012-01-06 21:25:05 +00:00
|
|
|
NULL,
|
|
|
|
NULL,
|
2012-03-28 06:19:53 +00:00
|
|
|
query_border_style,
|
|
|
|
assign_border_style,
|
2012-03-24 06:02:59 +00:00
|
|
|
NULL,
|
2012-03-28 06:19:53 +00:00
|
|
|
_gtk_css_border_style_value_new (GTK_BORDER_STYLE_NONE));
|
2012-01-14 16:12:57 +00:00
|
|
|
gtk_css_style_property_register ("border-left-width",
|
2012-03-31 03:28:58 +00:00
|
|
|
GTK_CSS_PROPERTY_BORDER_LEFT_WIDTH,
|
2012-01-02 10:54:13 +00:00
|
|
|
G_TYPE_INT,
|
2012-04-02 07:16:08 +00:00
|
|
|
GTK_STYLE_PROPERTY_ANIMATED,
|
2012-01-15 01:53:39 +00:00
|
|
|
parse_border_width,
|
2012-01-02 10:27:54 +00:00
|
|
|
NULL,
|
2012-01-06 21:25:05 +00:00
|
|
|
compute_border_width,
|
2012-03-27 21:54:06 +00:00
|
|
|
query_length_as_int,
|
2012-03-28 04:20:47 +00:00
|
|
|
assign_length_from_int,
|
2012-03-24 06:02:59 +00:00
|
|
|
NULL,
|
2012-03-27 22:04:29 +00:00
|
|
|
_gtk_css_number_value_new (0.0, GTK_CSS_PX));
|
2012-01-14 16:12:57 +00:00
|
|
|
gtk_css_style_property_register ("border-bottom-style",
|
2012-03-31 03:28:58 +00:00
|
|
|
GTK_CSS_PROPERTY_BORDER_BOTTOM_STYLE,
|
2012-01-06 21:25:05 +00:00
|
|
|
GTK_TYPE_BORDER_STYLE,
|
|
|
|
0,
|
2012-03-27 04:29:37 +00:00
|
|
|
parse_border_style,
|
2012-01-06 21:25:05 +00:00
|
|
|
NULL,
|
|
|
|
NULL,
|
2012-03-28 06:19:53 +00:00
|
|
|
query_border_style,
|
|
|
|
assign_border_style,
|
2012-03-24 06:02:59 +00:00
|
|
|
NULL,
|
2012-03-28 06:19:53 +00:00
|
|
|
_gtk_css_border_style_value_new (GTK_BORDER_STYLE_NONE));
|
2012-01-14 16:12:57 +00:00
|
|
|
gtk_css_style_property_register ("border-bottom-width",
|
2012-03-31 03:28:58 +00:00
|
|
|
GTK_CSS_PROPERTY_BORDER_BOTTOM_WIDTH,
|
2012-01-02 10:54:13 +00:00
|
|
|
G_TYPE_INT,
|
2012-04-02 07:16:08 +00:00
|
|
|
GTK_STYLE_PROPERTY_ANIMATED,
|
2012-01-15 01:53:39 +00:00
|
|
|
parse_border_width,
|
2012-01-02 10:27:54 +00:00
|
|
|
NULL,
|
2012-01-06 21:25:05 +00:00
|
|
|
compute_border_width,
|
2012-03-27 21:54:06 +00:00
|
|
|
query_length_as_int,
|
2012-03-28 04:20:47 +00:00
|
|
|
assign_length_from_int,
|
2012-03-24 06:02:59 +00:00
|
|
|
NULL,
|
2012-03-27 22:04:29 +00:00
|
|
|
_gtk_css_number_value_new (0.0, GTK_CSS_PX));
|
2012-01-14 16:12:57 +00:00
|
|
|
gtk_css_style_property_register ("border-right-style",
|
2012-03-31 03:28:58 +00:00
|
|
|
GTK_CSS_PROPERTY_BORDER_RIGHT_STYLE,
|
2012-01-06 21:25:05 +00:00
|
|
|
GTK_TYPE_BORDER_STYLE,
|
|
|
|
0,
|
2012-03-27 04:29:37 +00:00
|
|
|
parse_border_style,
|
2012-01-06 21:25:05 +00:00
|
|
|
NULL,
|
|
|
|
NULL,
|
2012-03-28 06:19:53 +00:00
|
|
|
query_border_style,
|
|
|
|
assign_border_style,
|
2012-03-24 06:02:59 +00:00
|
|
|
NULL,
|
2012-03-28 06:19:53 +00:00
|
|
|
_gtk_css_border_style_value_new (GTK_BORDER_STYLE_NONE));
|
2012-01-14 16:12:57 +00:00
|
|
|
gtk_css_style_property_register ("border-right-width",
|
2012-03-31 03:28:58 +00:00
|
|
|
GTK_CSS_PROPERTY_BORDER_RIGHT_WIDTH,
|
2012-01-02 10:54:13 +00:00
|
|
|
G_TYPE_INT,
|
2012-04-02 07:16:08 +00:00
|
|
|
GTK_STYLE_PROPERTY_ANIMATED,
|
2012-01-15 01:53:39 +00:00
|
|
|
parse_border_width,
|
2012-01-02 10:27:54 +00:00
|
|
|
NULL,
|
2012-01-06 21:25:05 +00:00
|
|
|
compute_border_width,
|
2012-03-27 21:54:06 +00:00
|
|
|
query_length_as_int,
|
2012-03-28 04:20:47 +00:00
|
|
|
assign_length_from_int,
|
2012-03-24 06:02:59 +00:00
|
|
|
NULL,
|
2012-03-27 22:04:29 +00:00
|
|
|
_gtk_css_number_value_new (0.0, GTK_CSS_PX));
|
2012-01-02 09:21:57 +00:00
|
|
|
|
2012-01-14 16:12:57 +00:00
|
|
|
gtk_css_style_property_register ("border-top-left-radius",
|
2012-03-31 03:28:58 +00:00
|
|
|
GTK_CSS_PROPERTY_BORDER_TOP_LEFT_RADIUS,
|
2012-04-03 16:39:01 +00:00
|
|
|
G_TYPE_NONE,
|
2012-04-03 17:11:41 +00:00
|
|
|
GTK_STYLE_PROPERTY_ANIMATED,
|
2012-01-02 09:21:57 +00:00
|
|
|
border_corner_radius_value_parse,
|
2012-01-02 17:28:24 +00:00
|
|
|
NULL,
|
2012-04-03 16:39:01 +00:00
|
|
|
border_corner_radius_value_compute,
|
2012-03-24 06:02:59 +00:00
|
|
|
NULL,
|
2012-04-03 16:39:01 +00:00
|
|
|
NULL,
|
|
|
|
NULL,
|
|
|
|
_gtk_css_corner_value_new (_gtk_css_number_value_new (0, GTK_CSS_PX),
|
|
|
|
_gtk_css_number_value_new (0, GTK_CSS_PX)));
|
2012-01-14 16:12:57 +00:00
|
|
|
gtk_css_style_property_register ("border-top-right-radius",
|
2012-03-31 03:28:58 +00:00
|
|
|
GTK_CSS_PROPERTY_BORDER_TOP_RIGHT_RADIUS,
|
2012-04-03 16:39:01 +00:00
|
|
|
G_TYPE_NONE,
|
2012-04-03 17:11:41 +00:00
|
|
|
GTK_STYLE_PROPERTY_ANIMATED,
|
2012-01-02 09:21:57 +00:00
|
|
|
border_corner_radius_value_parse,
|
2012-01-02 17:28:24 +00:00
|
|
|
NULL,
|
2012-04-03 16:39:01 +00:00
|
|
|
border_corner_radius_value_compute,
|
2012-03-24 06:02:59 +00:00
|
|
|
NULL,
|
2012-04-03 16:39:01 +00:00
|
|
|
NULL,
|
|
|
|
NULL,
|
|
|
|
_gtk_css_corner_value_new (_gtk_css_number_value_new (0, GTK_CSS_PX),
|
|
|
|
_gtk_css_number_value_new (0, GTK_CSS_PX)));
|
2012-01-14 16:12:57 +00:00
|
|
|
gtk_css_style_property_register ("border-bottom-right-radius",
|
2012-03-31 03:28:58 +00:00
|
|
|
GTK_CSS_PROPERTY_BORDER_BOTTOM_RIGHT_RADIUS,
|
2012-04-03 16:39:01 +00:00
|
|
|
G_TYPE_NONE,
|
2012-04-03 17:11:41 +00:00
|
|
|
GTK_STYLE_PROPERTY_ANIMATED,
|
2012-01-02 09:21:57 +00:00
|
|
|
border_corner_radius_value_parse,
|
2012-01-02 17:28:24 +00:00
|
|
|
NULL,
|
2012-04-03 16:39:01 +00:00
|
|
|
border_corner_radius_value_compute,
|
2012-03-24 06:02:59 +00:00
|
|
|
NULL,
|
2012-04-03 16:39:01 +00:00
|
|
|
NULL,
|
|
|
|
NULL,
|
|
|
|
_gtk_css_corner_value_new (_gtk_css_number_value_new (0, GTK_CSS_PX),
|
|
|
|
_gtk_css_number_value_new (0, GTK_CSS_PX)));
|
2012-01-14 16:12:57 +00:00
|
|
|
gtk_css_style_property_register ("border-bottom-left-radius",
|
2012-03-31 03:28:58 +00:00
|
|
|
GTK_CSS_PROPERTY_BORDER_BOTTOM_LEFT_RADIUS,
|
2012-04-03 16:39:01 +00:00
|
|
|
G_TYPE_NONE,
|
2012-04-03 17:11:41 +00:00
|
|
|
GTK_STYLE_PROPERTY_ANIMATED,
|
2012-01-02 09:21:57 +00:00
|
|
|
border_corner_radius_value_parse,
|
2012-01-02 17:28:24 +00:00
|
|
|
NULL,
|
2012-04-03 16:39:01 +00:00
|
|
|
border_corner_radius_value_compute,
|
|
|
|
NULL,
|
|
|
|
NULL,
|
2012-03-24 06:02:59 +00:00
|
|
|
NULL,
|
2012-04-03 16:39:01 +00:00
|
|
|
_gtk_css_corner_value_new (_gtk_css_number_value_new (0, GTK_CSS_PX),
|
|
|
|
_gtk_css_number_value_new (0, GTK_CSS_PX)));
|
2012-01-02 09:21:57 +00:00
|
|
|
|
2012-01-14 16:12:57 +00:00
|
|
|
gtk_css_style_property_register ("outline-style",
|
2012-03-31 03:28:58 +00:00
|
|
|
GTK_CSS_PROPERTY_OUTLINE_STYLE,
|
2012-01-08 01:10:35 +00:00
|
|
|
GTK_TYPE_BORDER_STYLE,
|
|
|
|
0,
|
2012-03-27 04:29:37 +00:00
|
|
|
parse_border_style,
|
2012-01-08 01:10:35 +00:00
|
|
|
NULL,
|
|
|
|
NULL,
|
2012-03-28 06:19:53 +00:00
|
|
|
query_border_style,
|
|
|
|
assign_border_style,
|
2012-03-24 06:02:59 +00:00
|
|
|
NULL,
|
2012-03-28 06:19:53 +00:00
|
|
|
_gtk_css_border_style_value_new (GTK_BORDER_STYLE_NONE));
|
2012-01-14 16:12:57 +00:00
|
|
|
gtk_css_style_property_register ("outline-width",
|
2012-03-31 03:28:58 +00:00
|
|
|
GTK_CSS_PROPERTY_OUTLINE_WIDTH,
|
2012-01-08 01:10:35 +00:00
|
|
|
G_TYPE_INT,
|
2012-04-02 07:16:08 +00:00
|
|
|
GTK_STYLE_PROPERTY_ANIMATED,
|
2012-01-15 01:53:39 +00:00
|
|
|
parse_border_width,
|
2012-01-08 01:10:35 +00:00
|
|
|
NULL,
|
|
|
|
compute_border_width,
|
2012-03-27 21:54:06 +00:00
|
|
|
query_length_as_int,
|
2012-03-28 04:20:47 +00:00
|
|
|
assign_length_from_int,
|
2012-03-24 06:02:59 +00:00
|
|
|
NULL,
|
2012-03-27 22:04:29 +00:00
|
|
|
_gtk_css_number_value_new (0.0, GTK_CSS_PX));
|
2012-01-14 16:12:57 +00:00
|
|
|
gtk_css_style_property_register ("outline-offset",
|
2012-03-31 03:28:58 +00:00
|
|
|
GTK_CSS_PROPERTY_OUTLINE_OFFSET,
|
2012-01-08 01:10:35 +00:00
|
|
|
G_TYPE_INT,
|
|
|
|
0,
|
2012-03-27 07:05:47 +00:00
|
|
|
outline_parse,
|
2012-01-08 01:10:35 +00:00
|
|
|
NULL,
|
2012-04-03 14:57:44 +00:00
|
|
|
outline_compute,
|
|
|
|
query_length_as_int,
|
|
|
|
assign_length_from_int,
|
2012-01-08 01:10:35 +00:00
|
|
|
NULL,
|
2012-04-03 14:57:44 +00:00
|
|
|
_gtk_css_number_value_new (0.0, GTK_CSS_PX));
|
2012-01-08 01:10:35 +00:00
|
|
|
|
2012-01-14 16:12:57 +00:00
|
|
|
gtk_css_style_property_register ("background-clip",
|
2012-03-31 03:28:58 +00:00
|
|
|
GTK_CSS_PROPERTY_BACKGROUND_CLIP,
|
2012-03-30 00:19:39 +00:00
|
|
|
G_TYPE_NONE,
|
2012-01-02 10:27:54 +00:00
|
|
|
0,
|
2012-03-27 04:29:37 +00:00
|
|
|
parse_css_area,
|
2012-01-02 10:27:54 +00:00
|
|
|
NULL,
|
2012-01-02 17:28:24 +00:00
|
|
|
NULL,
|
2012-03-24 06:02:59 +00:00
|
|
|
NULL,
|
2012-03-30 00:19:39 +00:00
|
|
|
NULL,
|
|
|
|
NULL,
|
|
|
|
_gtk_css_area_value_new (GTK_CSS_AREA_BORDER_BOX));
|
2012-01-14 16:12:57 +00:00
|
|
|
gtk_css_style_property_register ("background-origin",
|
2012-03-31 03:28:58 +00:00
|
|
|
GTK_CSS_PROPERTY_BACKGROUND_ORIGIN,
|
2012-03-30 00:19:39 +00:00
|
|
|
G_TYPE_NONE,
|
2012-01-02 10:27:54 +00:00
|
|
|
0,
|
2012-03-27 04:29:37 +00:00
|
|
|
parse_css_area,
|
2012-01-02 10:27:54 +00:00
|
|
|
NULL,
|
2012-01-02 17:28:24 +00:00
|
|
|
NULL,
|
2012-03-24 06:02:59 +00:00
|
|
|
NULL,
|
2012-03-30 00:19:39 +00:00
|
|
|
NULL,
|
|
|
|
NULL,
|
|
|
|
_gtk_css_area_value_new (GTK_CSS_AREA_PADDING_BOX));
|
2012-01-17 14:11:48 +00:00
|
|
|
gtk_css_style_property_register ("background-size",
|
2012-03-31 03:28:58 +00:00
|
|
|
GTK_CSS_PROPERTY_BACKGROUND_SIZE,
|
2012-01-17 14:11:48 +00:00
|
|
|
G_TYPE_NONE,
|
|
|
|
0,
|
|
|
|
background_size_parse,
|
|
|
|
background_size_print,
|
|
|
|
background_size_compute,
|
2012-03-24 06:02:59 +00:00
|
|
|
NULL,
|
2012-03-27 21:54:06 +00:00
|
|
|
NULL,
|
2012-03-28 04:20:47 +00:00
|
|
|
NULL,
|
2012-03-27 02:58:15 +00:00
|
|
|
_gtk_css_value_new_from_background_size (&default_background_size));
|
2012-03-16 21:13:39 +00:00
|
|
|
gtk_css_style_property_register ("background-position",
|
2012-03-31 03:28:58 +00:00
|
|
|
GTK_CSS_PROPERTY_BACKGROUND_POSITION,
|
2012-03-16 21:13:39 +00:00
|
|
|
G_TYPE_NONE,
|
|
|
|
0,
|
|
|
|
background_position_parse,
|
|
|
|
background_position_print,
|
|
|
|
background_position_compute,
|
2012-03-24 06:02:59 +00:00
|
|
|
NULL,
|
2012-03-27 21:54:06 +00:00
|
|
|
NULL,
|
2012-03-28 04:20:47 +00:00
|
|
|
NULL,
|
2012-03-27 02:58:15 +00:00
|
|
|
_gtk_css_value_new_from_background_position (&default_background_position));
|
2012-01-02 10:27:54 +00:00
|
|
|
|
2012-01-14 16:12:57 +00:00
|
|
|
gtk_css_style_property_register ("border-top-color",
|
2012-03-31 03:28:58 +00:00
|
|
|
GTK_CSS_PROPERTY_BORDER_TOP_COLOR,
|
2012-01-02 10:54:13 +00:00
|
|
|
GDK_TYPE_RGBA,
|
2012-04-02 07:16:08 +00:00
|
|
|
GTK_STYLE_PROPERTY_ANIMATED,
|
2012-03-27 03:11:58 +00:00
|
|
|
color_parse,
|
2012-01-02 09:21:57 +00:00
|
|
|
NULL,
|
2012-01-03 16:59:31 +00:00
|
|
|
color_compute,
|
2012-03-28 04:28:13 +00:00
|
|
|
color_query,
|
|
|
|
color_assign,
|
2012-03-24 06:02:59 +00:00
|
|
|
NULL,
|
2012-03-27 02:58:15 +00:00
|
|
|
_gtk_css_value_new_take_symbolic_color (
|
|
|
|
gtk_symbolic_color_ref (
|
|
|
|
_gtk_symbolic_color_get_current_color ())));
|
2012-01-14 16:12:57 +00:00
|
|
|
gtk_css_style_property_register ("border-right-color",
|
2012-03-31 03:28:58 +00:00
|
|
|
GTK_CSS_PROPERTY_BORDER_RIGHT_COLOR,
|
2012-01-02 10:54:13 +00:00
|
|
|
GDK_TYPE_RGBA,
|
2012-04-02 07:16:08 +00:00
|
|
|
GTK_STYLE_PROPERTY_ANIMATED,
|
2012-03-27 03:11:58 +00:00
|
|
|
color_parse,
|
2012-01-02 09:21:57 +00:00
|
|
|
NULL,
|
2012-01-03 16:59:31 +00:00
|
|
|
color_compute,
|
2012-03-28 04:28:13 +00:00
|
|
|
color_query,
|
|
|
|
color_assign,
|
2012-03-24 06:02:59 +00:00
|
|
|
NULL,
|
2012-03-27 02:58:15 +00:00
|
|
|
_gtk_css_value_new_take_symbolic_color (
|
|
|
|
gtk_symbolic_color_ref (
|
|
|
|
_gtk_symbolic_color_get_current_color ())));
|
2012-01-14 16:12:57 +00:00
|
|
|
gtk_css_style_property_register ("border-bottom-color",
|
2012-03-31 03:28:58 +00:00
|
|
|
GTK_CSS_PROPERTY_BORDER_BOTTOM_COLOR,
|
2012-01-02 10:54:13 +00:00
|
|
|
GDK_TYPE_RGBA,
|
2012-04-02 07:16:08 +00:00
|
|
|
GTK_STYLE_PROPERTY_ANIMATED,
|
2012-03-27 03:11:58 +00:00
|
|
|
color_parse,
|
2012-01-02 09:21:57 +00:00
|
|
|
NULL,
|
2012-01-03 16:59:31 +00:00
|
|
|
color_compute,
|
2012-03-28 04:28:13 +00:00
|
|
|
color_query,
|
|
|
|
color_assign,
|
2012-03-24 06:02:59 +00:00
|
|
|
NULL,
|
2012-03-27 02:58:15 +00:00
|
|
|
_gtk_css_value_new_take_symbolic_color (
|
|
|
|
gtk_symbolic_color_ref (
|
|
|
|
_gtk_symbolic_color_get_current_color ())));
|
2012-01-14 16:12:57 +00:00
|
|
|
gtk_css_style_property_register ("border-left-color",
|
2012-03-31 03:28:58 +00:00
|
|
|
GTK_CSS_PROPERTY_BORDER_LEFT_COLOR,
|
2012-01-02 10:54:13 +00:00
|
|
|
GDK_TYPE_RGBA,
|
2012-04-02 07:16:08 +00:00
|
|
|
GTK_STYLE_PROPERTY_ANIMATED,
|
2012-03-27 03:11:58 +00:00
|
|
|
color_parse,
|
2012-01-08 01:10:35 +00:00
|
|
|
NULL,
|
|
|
|
color_compute,
|
2012-03-28 04:28:13 +00:00
|
|
|
color_query,
|
|
|
|
color_assign,
|
2012-03-24 06:02:59 +00:00
|
|
|
NULL,
|
2012-03-27 02:58:15 +00:00
|
|
|
_gtk_css_value_new_take_symbolic_color (
|
|
|
|
gtk_symbolic_color_ref (
|
|
|
|
_gtk_symbolic_color_get_current_color ())));
|
2012-01-14 16:12:57 +00:00
|
|
|
gtk_css_style_property_register ("outline-color",
|
2012-03-31 03:28:58 +00:00
|
|
|
GTK_CSS_PROPERTY_OUTLINE_COLOR,
|
2012-01-08 01:10:35 +00:00
|
|
|
GDK_TYPE_RGBA,
|
2012-04-02 07:16:08 +00:00
|
|
|
GTK_STYLE_PROPERTY_ANIMATED,
|
2012-03-27 03:11:58 +00:00
|
|
|
color_parse,
|
2012-01-02 09:21:57 +00:00
|
|
|
NULL,
|
2012-01-03 16:59:31 +00:00
|
|
|
color_compute,
|
2012-03-28 04:28:13 +00:00
|
|
|
color_query,
|
|
|
|
color_assign,
|
2012-03-24 06:02:59 +00:00
|
|
|
NULL,
|
2012-03-27 02:58:15 +00:00
|
|
|
_gtk_css_value_new_take_symbolic_color (
|
|
|
|
gtk_symbolic_color_ref (
|
|
|
|
_gtk_symbolic_color_get_current_color ())));
|
2012-01-02 09:21:57 +00:00
|
|
|
|
2012-01-14 16:12:57 +00:00
|
|
|
gtk_css_style_property_register ("background-repeat",
|
2012-03-31 03:28:58 +00:00
|
|
|
GTK_CSS_PROPERTY_BACKGROUND_REPEAT,
|
2011-12-21 16:43:31 +00:00
|
|
|
GTK_TYPE_CSS_BACKGROUND_REPEAT,
|
|
|
|
0,
|
2012-01-05 01:48:32 +00:00
|
|
|
background_repeat_value_parse,
|
|
|
|
background_repeat_value_print,
|
2011-12-21 16:43:31 +00:00
|
|
|
NULL,
|
2012-03-27 21:54:06 +00:00
|
|
|
query_simple,
|
2012-03-28 04:20:47 +00:00
|
|
|
assign_simple,
|
2012-03-24 06:02:59 +00:00
|
|
|
NULL,
|
2012-03-27 02:58:15 +00:00
|
|
|
_gtk_css_value_new_from_enum (GTK_TYPE_CSS_BACKGROUND_REPEAT,
|
|
|
|
GTK_CSS_BACKGROUND_REPEAT |
|
|
|
|
(GTK_CSS_BACKGROUND_REPEAT << GTK_CSS_BACKGROUND_REPEAT_SHIFT)));
|
2012-01-14 16:12:57 +00:00
|
|
|
gtk_css_style_property_register ("background-image",
|
2012-03-31 03:28:58 +00:00
|
|
|
GTK_CSS_PROPERTY_BACKGROUND_IMAGE,
|
2012-01-02 10:54:13 +00:00
|
|
|
CAIRO_GOBJECT_TYPE_PATTERN,
|
2012-04-02 07:16:08 +00:00
|
|
|
GTK_STYLE_PROPERTY_ANIMATED,
|
2012-01-02 21:22:25 +00:00
|
|
|
css_image_value_parse,
|
2012-03-29 00:58:32 +00:00
|
|
|
NULL,
|
2012-01-02 21:22:25 +00:00
|
|
|
css_image_value_compute,
|
2012-03-27 21:54:06 +00:00
|
|
|
css_image_value_query,
|
2012-03-28 04:20:47 +00:00
|
|
|
css_image_value_assign,
|
2012-03-24 06:02:59 +00:00
|
|
|
NULL,
|
2012-03-29 00:58:32 +00:00
|
|
|
_gtk_css_image_value_new (NULL));
|
2012-01-02 09:21:57 +00:00
|
|
|
|
2012-01-14 16:12:57 +00:00
|
|
|
gtk_css_style_property_register ("border-image-source",
|
2012-03-31 03:28:58 +00:00
|
|
|
GTK_CSS_PROPERTY_BORDER_IMAGE_SOURCE,
|
2012-01-02 10:54:13 +00:00
|
|
|
CAIRO_GOBJECT_TYPE_PATTERN,
|
2012-04-02 07:16:08 +00:00
|
|
|
GTK_STYLE_PROPERTY_ANIMATED,
|
2011-12-21 16:43:31 +00:00
|
|
|
css_image_value_parse,
|
2012-03-29 00:58:32 +00:00
|
|
|
NULL,
|
2011-12-21 16:43:31 +00:00
|
|
|
css_image_value_compute,
|
2012-03-27 21:54:06 +00:00
|
|
|
css_image_value_query,
|
2012-03-28 04:20:47 +00:00
|
|
|
css_image_value_assign,
|
2012-03-24 06:02:59 +00:00
|
|
|
NULL,
|
2012-03-29 00:58:32 +00:00
|
|
|
_gtk_css_image_value_new (NULL));
|
2012-01-14 16:12:57 +00:00
|
|
|
gtk_css_style_property_register ("border-image-repeat",
|
2012-03-31 03:28:58 +00:00
|
|
|
GTK_CSS_PROPERTY_BORDER_IMAGE_REPEAT,
|
2012-01-02 10:54:13 +00:00
|
|
|
GTK_TYPE_CSS_BORDER_IMAGE_REPEAT,
|
2012-01-02 10:27:54 +00:00
|
|
|
0,
|
2012-03-27 07:05:47 +00:00
|
|
|
border_image_repeat_parse,
|
2012-01-02 10:27:54 +00:00
|
|
|
NULL,
|
2012-01-02 17:28:24 +00:00
|
|
|
NULL,
|
2012-03-27 21:54:06 +00:00
|
|
|
query_simple,
|
2012-03-28 04:20:47 +00:00
|
|
|
assign_simple,
|
2012-03-24 06:02:59 +00:00
|
|
|
NULL,
|
2012-03-27 02:58:15 +00:00
|
|
|
_gtk_css_value_new_from_border_image_repeat (&border_image_repeat));
|
2012-01-02 10:27:54 +00:00
|
|
|
|
2012-01-14 02:22:59 +00:00
|
|
|
/* XXX: The initial value is wrong, it should be 100% */
|
2012-01-14 16:12:57 +00:00
|
|
|
gtk_css_style_property_register ("border-image-slice",
|
2012-03-31 03:28:58 +00:00
|
|
|
GTK_CSS_PROPERTY_BORDER_IMAGE_SLICE,
|
2012-01-02 10:54:13 +00:00
|
|
|
GTK_TYPE_BORDER,
|
2012-01-02 10:27:54 +00:00
|
|
|
0,
|
2012-03-27 07:05:47 +00:00
|
|
|
border_image_slice_parse,
|
2012-01-02 10:27:54 +00:00
|
|
|
NULL,
|
2012-01-02 17:28:24 +00:00
|
|
|
NULL,
|
2012-03-27 21:54:06 +00:00
|
|
|
query_simple,
|
2012-03-28 04:20:47 +00:00
|
|
|
assign_simple,
|
2012-03-24 06:02:59 +00:00
|
|
|
NULL,
|
2012-03-27 02:58:15 +00:00
|
|
|
_gtk_css_value_new_from_boxed (GTK_TYPE_BORDER, &border_of_ones));
|
2012-01-14 16:12:57 +00:00
|
|
|
gtk_css_style_property_register ("border-image-width",
|
2012-03-31 03:28:58 +00:00
|
|
|
GTK_CSS_PROPERTY_BORDER_IMAGE_WIDTH,
|
2012-01-02 10:54:13 +00:00
|
|
|
GTK_TYPE_BORDER,
|
2012-01-02 09:21:57 +00:00
|
|
|
0,
|
2012-03-27 07:05:47 +00:00
|
|
|
border_image_width_parse,
|
2012-01-02 09:21:57 +00:00
|
|
|
NULL,
|
2012-01-02 17:28:24 +00:00
|
|
|
NULL,
|
2012-03-27 21:54:06 +00:00
|
|
|
query_simple,
|
2012-03-28 04:20:47 +00:00
|
|
|
assign_simple,
|
2012-03-24 06:02:59 +00:00
|
|
|
NULL,
|
2012-03-27 02:58:15 +00:00
|
|
|
_gtk_css_value_new_from_boxed (GTK_TYPE_BORDER, NULL));
|
2012-04-01 04:22:20 +00:00
|
|
|
|
|
|
|
gtk_css_style_property_register ("transition-property",
|
|
|
|
GTK_CSS_PROPERTY_TRANSITION_PROPERTY,
|
|
|
|
G_TYPE_NONE,
|
|
|
|
0,
|
|
|
|
transition_property_parse,
|
|
|
|
NULL,
|
|
|
|
NULL,
|
|
|
|
NULL,
|
|
|
|
NULL,
|
|
|
|
NULL,
|
2012-04-03 07:49:37 +00:00
|
|
|
_gtk_css_array_value_new (_gtk_css_ident_value_new ("all")));
|
2012-04-01 04:22:20 +00:00
|
|
|
gtk_css_style_property_register ("transition-duration",
|
|
|
|
GTK_CSS_PROPERTY_TRANSITION_DURATION,
|
|
|
|
G_TYPE_NONE,
|
|
|
|
0,
|
|
|
|
transition_time_parse,
|
|
|
|
NULL,
|
|
|
|
NULL,
|
|
|
|
NULL,
|
|
|
|
NULL,
|
|
|
|
NULL,
|
2012-04-03 07:49:37 +00:00
|
|
|
_gtk_css_array_value_new (_gtk_css_number_value_new (0, GTK_CSS_S)));
|
2012-04-01 04:22:20 +00:00
|
|
|
gtk_css_style_property_register ("transition-timing-function",
|
|
|
|
GTK_CSS_PROPERTY_TRANSITION_TIMING_FUNCTION,
|
|
|
|
G_TYPE_NONE,
|
|
|
|
0,
|
|
|
|
transition_timing_function_parse,
|
|
|
|
NULL,
|
|
|
|
NULL,
|
|
|
|
NULL,
|
|
|
|
NULL,
|
|
|
|
NULL,
|
2012-04-03 07:49:37 +00:00
|
|
|
_gtk_css_array_value_new (
|
|
|
|
_gtk_css_ease_value_new_cubic_bezier (0.25, 0.1, 0.25, 1.0)));
|
2012-04-01 04:22:20 +00:00
|
|
|
gtk_css_style_property_register ("transition-delay",
|
|
|
|
GTK_CSS_PROPERTY_TRANSITION_DELAY,
|
|
|
|
G_TYPE_NONE,
|
|
|
|
0,
|
|
|
|
transition_time_parse,
|
|
|
|
NULL,
|
|
|
|
NULL,
|
|
|
|
NULL,
|
|
|
|
NULL,
|
|
|
|
NULL,
|
2012-04-03 07:49:37 +00:00
|
|
|
_gtk_css_array_value_new (_gtk_css_number_value_new (0, GTK_CSS_S)));
|
2012-04-01 04:22:20 +00:00
|
|
|
|
2012-01-14 16:12:57 +00:00
|
|
|
gtk_css_style_property_register ("engine",
|
2012-03-31 03:28:58 +00:00
|
|
|
GTK_CSS_PROPERTY_ENGINE,
|
2012-01-02 10:54:13 +00:00
|
|
|
GTK_TYPE_THEMING_ENGINE,
|
2012-01-02 10:27:54 +00:00
|
|
|
0,
|
2012-03-27 07:05:47 +00:00
|
|
|
engine_parse,
|
2012-01-02 10:27:54 +00:00
|
|
|
NULL,
|
2012-01-02 17:28:24 +00:00
|
|
|
NULL,
|
2012-03-27 21:54:06 +00:00
|
|
|
query_simple,
|
2012-03-28 04:20:47 +00:00
|
|
|
assign_simple,
|
2012-03-24 06:02:59 +00:00
|
|
|
NULL,
|
2012-03-27 02:58:15 +00:00
|
|
|
_gtk_css_value_new_from_theming_engine (gtk_theming_engine_load (NULL)));
|
2012-01-14 16:12:57 +00:00
|
|
|
gtk_css_style_property_register ("transition",
|
2012-03-31 03:28:58 +00:00
|
|
|
GTK_CSS_PROPERTY_TRANSITION,
|
2012-01-02 10:54:13 +00:00
|
|
|
GTK_TYPE_ANIMATION_DESCRIPTION,
|
2012-01-02 10:27:54 +00:00
|
|
|
0,
|
2012-03-27 07:05:47 +00:00
|
|
|
transition_parse,
|
2012-01-02 10:27:54 +00:00
|
|
|
NULL,
|
2012-01-02 17:28:24 +00:00
|
|
|
NULL,
|
2012-03-27 21:54:06 +00:00
|
|
|
query_simple,
|
2012-03-28 04:20:47 +00:00
|
|
|
assign_simple,
|
2012-03-24 06:02:59 +00:00
|
|
|
NULL,
|
2012-03-27 02:58:15 +00:00
|
|
|
_gtk_css_value_new_from_boxed (GTK_TYPE_ANIMATION_DESCRIPTION, NULL));
|
2012-01-02 09:21:57 +00:00
|
|
|
|
|
|
|
/* Private property holding the binding sets */
|
2012-01-14 16:12:57 +00:00
|
|
|
gtk_css_style_property_register ("gtk-key-bindings",
|
2012-03-31 03:28:58 +00:00
|
|
|
GTK_CSS_PROPERTY_GTK_KEY_BINDINGS,
|
2012-01-02 10:54:13 +00:00
|
|
|
G_TYPE_PTR_ARRAY,
|
2012-01-02 09:21:57 +00:00
|
|
|
0,
|
|
|
|
bindings_value_parse,
|
2012-01-02 17:28:24 +00:00
|
|
|
NULL,
|
2012-03-24 06:02:59 +00:00
|
|
|
NULL,
|
2012-04-03 17:11:41 +00:00
|
|
|
bindings_value_query,
|
|
|
|
bindings_value_assign,
|
|
|
|
NULL,
|
|
|
|
_gtk_css_array_value_new (NULL));
|
2012-01-02 09:21:57 +00:00
|
|
|
}
|
|
|
|
|