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
|
|
|
|
* License along with this library; if not, write to the
|
|
|
|
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
|
|
|
* Boston, MA 02111-1307, USA.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#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>
|
|
|
|
|
|
|
|
#include "gtkcssparserprivate.h"
|
|
|
|
#include "gtkcssstylefuncsprivate.h"
|
|
|
|
#include "gtkcssstylepropertyprivate.h"
|
|
|
|
#include "gtkcsstypesprivate.h"
|
|
|
|
#include "gtkintl.h"
|
|
|
|
#include "gtkprivatetypebuiltins.h"
|
|
|
|
#include "gtkstylepropertiesprivate.h"
|
|
|
|
|
|
|
|
/* the actual parsers we have */
|
|
|
|
#include "gtkanimationdescription.h"
|
|
|
|
#include "gtkbindings.h"
|
2012-01-02 21:22:25 +00:00
|
|
|
#include "gtkcssimageprivate.h"
|
2012-01-02 09:21:57 +00:00
|
|
|
#include "gtkgradient.h"
|
|
|
|
#include "gtkshadowprivate.h"
|
|
|
|
#include "gtkthemingengine.h"
|
|
|
|
#include "gtktypebuiltins.h"
|
|
|
|
#include "gtkwin32themeprivate.h"
|
|
|
|
|
|
|
|
/*** REGISTRATION ***/
|
|
|
|
|
|
|
|
static void
|
2012-01-02 17:28:24 +00:00
|
|
|
_gtk_style_property_register (const char * name,
|
|
|
|
GType value_type,
|
|
|
|
GtkStylePropertyFlags flags,
|
|
|
|
GtkCssStylePropertyParseFunc parse_value,
|
|
|
|
GtkCssStylePropertyPrintFunc print_value,
|
|
|
|
GtkCssStylePropertyComputeFunc compute_value,
|
|
|
|
const GValue * initial_value)
|
2012-01-02 09:21:57 +00:00
|
|
|
{
|
2012-01-02 17:05:06 +00:00
|
|
|
GtkCssStyleProperty *node;
|
2012-01-02 09:21:57 +00:00
|
|
|
|
|
|
|
node = g_object_new (GTK_TYPE_CSS_STYLE_PROPERTY,
|
|
|
|
"inherit", (flags & GTK_STYLE_PROPERTY_INHERIT) ? TRUE : FALSE,
|
|
|
|
"initial-value", initial_value,
|
2012-01-02 10:54:13 +00:00
|
|
|
"name", name,
|
|
|
|
"value-type", value_type,
|
2012-01-02 09:21:57 +00:00
|
|
|
NULL);
|
2012-01-02 17:05:06 +00:00
|
|
|
|
|
|
|
if (parse_value)
|
|
|
|
node->parse_value = parse_value;
|
|
|
|
if (print_value)
|
|
|
|
node->print_value = print_value;
|
2012-01-02 17:28:24 +00:00
|
|
|
if (compute_value)
|
|
|
|
node->compute_value = compute_value;
|
2012-01-02 09:21:57 +00:00
|
|
|
}
|
|
|
|
|
2012-01-02 10:12:46 +00:00
|
|
|
static void
|
2012-01-02 17:28:24 +00:00
|
|
|
gtk_style_property_register (const char * name,
|
|
|
|
GType value_type,
|
|
|
|
GtkStylePropertyFlags flags,
|
|
|
|
GtkCssStylePropertyParseFunc parse_value,
|
|
|
|
GtkCssStylePropertyPrintFunc print_value,
|
|
|
|
GtkCssStylePropertyComputeFunc compute_value,
|
2012-01-02 10:12:46 +00:00
|
|
|
...)
|
|
|
|
{
|
|
|
|
GValue initial_value = G_VALUE_INIT;
|
|
|
|
char *error = NULL;
|
|
|
|
va_list args;
|
|
|
|
|
2012-01-02 17:28:24 +00:00
|
|
|
va_start (args, compute_value);
|
2012-01-02 10:54:13 +00:00
|
|
|
G_VALUE_COLLECT_INIT (&initial_value, value_type,
|
2012-01-02 10:12:46 +00:00
|
|
|
args, 0, &error);
|
|
|
|
if (error)
|
|
|
|
{
|
2012-01-02 10:54:13 +00:00
|
|
|
g_error ("property `%s' initial value is broken: %s", name, error);
|
2012-01-02 10:12:46 +00:00
|
|
|
g_value_unset (&initial_value);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
va_end (args);
|
|
|
|
|
2012-01-02 17:28:24 +00:00
|
|
|
_gtk_style_property_register (name,
|
|
|
|
value_type,
|
|
|
|
flags,
|
|
|
|
parse_value,
|
|
|
|
print_value,
|
|
|
|
compute_value,
|
|
|
|
&initial_value);
|
2012-01-02 10:12:46 +00:00
|
|
|
|
|
|
|
g_value_unset (&initial_value);
|
|
|
|
}
|
|
|
|
|
2012-01-02 09:21:57 +00:00
|
|
|
/*** HELPERS ***/
|
|
|
|
|
|
|
|
static void
|
|
|
|
string_append_double (GString *string,
|
|
|
|
double d)
|
|
|
|
{
|
|
|
|
char buf[G_ASCII_DTOSTR_BUF_SIZE];
|
|
|
|
|
|
|
|
g_ascii_dtostr (buf, sizeof (buf), d);
|
|
|
|
g_string_append (string, buf);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
string_append_string (GString *str,
|
|
|
|
const char *string)
|
|
|
|
{
|
|
|
|
gsize len;
|
|
|
|
|
|
|
|
g_string_append_c (str, '"');
|
|
|
|
|
|
|
|
do {
|
|
|
|
len = strcspn (string, "\"\n\r\f");
|
|
|
|
g_string_append (str, string);
|
|
|
|
string += len;
|
|
|
|
switch (*string)
|
|
|
|
{
|
|
|
|
case '\0':
|
|
|
|
break;
|
|
|
|
case '\n':
|
|
|
|
g_string_append (str, "\\A ");
|
|
|
|
break;
|
|
|
|
case '\r':
|
|
|
|
g_string_append (str, "\\D ");
|
|
|
|
break;
|
|
|
|
case '\f':
|
|
|
|
g_string_append (str, "\\C ");
|
|
|
|
break;
|
|
|
|
case '\"':
|
|
|
|
g_string_append (str, "\\\"");
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
g_assert_not_reached ();
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
} while (*string);
|
|
|
|
|
|
|
|
g_string_append_c (str, '"');
|
|
|
|
}
|
|
|
|
|
|
|
|
/*** IMPLEMENTATIONS ***/
|
|
|
|
|
|
|
|
static gboolean
|
2012-01-02 17:05:06 +00:00
|
|
|
font_family_parse (GtkCssStyleProperty *property,
|
|
|
|
GValue *value,
|
|
|
|
GtkCssParser *parser,
|
|
|
|
GFile *base)
|
2012-01-02 09:21:57 +00:00
|
|
|
{
|
|
|
|
GPtrArray *names;
|
|
|
|
char *name;
|
|
|
|
|
|
|
|
/* We don't special case generic families. Pango should do
|
|
|
|
* that for us */
|
|
|
|
|
|
|
|
names = g_ptr_array_new ();
|
|
|
|
|
|
|
|
do {
|
|
|
|
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)
|
|
|
|
{
|
|
|
|
g_ptr_array_free (names, TRUE);
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
g_ptr_array_add (names, name);
|
|
|
|
} while (_gtk_css_parser_try (parser, ",", TRUE));
|
|
|
|
|
|
|
|
/* NULL-terminate array */
|
|
|
|
g_ptr_array_add (names, NULL);
|
|
|
|
g_value_set_boxed (value, g_ptr_array_free (names, FALSE));
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2012-01-02 17:05:06 +00:00
|
|
|
font_family_value_print (GtkCssStyleProperty *property,
|
|
|
|
const GValue *value,
|
|
|
|
GString *string)
|
2012-01-02 09:21:57 +00:00
|
|
|
{
|
|
|
|
const char **names = g_value_get_boxed (value);
|
|
|
|
|
|
|
|
if (names == NULL || *names == NULL)
|
|
|
|
{
|
|
|
|
g_string_append (string, "none");
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
string_append_string (string, *names);
|
|
|
|
names++;
|
|
|
|
while (*names)
|
|
|
|
{
|
|
|
|
g_string_append (string, ", ");
|
|
|
|
string_append_string (string, *names);
|
|
|
|
names++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static gboolean
|
2012-01-02 17:05:06 +00:00
|
|
|
bindings_value_parse (GtkCssStyleProperty *property,
|
|
|
|
GValue *value,
|
|
|
|
GtkCssParser *parser,
|
|
|
|
GFile *base)
|
2012-01-02 09:21:57 +00:00
|
|
|
{
|
|
|
|
GPtrArray *array;
|
|
|
|
GtkBindingSet *binding_set;
|
|
|
|
char *name;
|
|
|
|
|
|
|
|
array = g_ptr_array_new ();
|
|
|
|
|
|
|
|
do {
|
|
|
|
name = _gtk_css_parser_try_ident (parser, TRUE);
|
|
|
|
if (name == NULL)
|
|
|
|
{
|
|
|
|
_gtk_css_parser_error (parser, "Not a valid binding name");
|
|
|
|
g_ptr_array_free (array, TRUE);
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
binding_set = gtk_binding_set_find (name);
|
|
|
|
|
|
|
|
if (!binding_set)
|
|
|
|
{
|
|
|
|
_gtk_css_parser_error (parser, "No binding set named '%s'", name);
|
|
|
|
g_free (name);
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
|
|
|
g_ptr_array_add (array, binding_set);
|
|
|
|
g_free (name);
|
|
|
|
}
|
|
|
|
while (_gtk_css_parser_try (parser, ",", TRUE));
|
|
|
|
|
|
|
|
g_value_take_boxed (value, array);
|
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2012-01-02 17:05:06 +00:00
|
|
|
bindings_value_print (GtkCssStyleProperty *property,
|
|
|
|
const GValue *value,
|
|
|
|
GString *string)
|
2012-01-02 09:21:57 +00:00
|
|
|
{
|
|
|
|
GPtrArray *array;
|
|
|
|
guint i;
|
|
|
|
|
|
|
|
array = g_value_get_boxed (value);
|
|
|
|
|
|
|
|
for (i = 0; i < array->len; i++)
|
|
|
|
{
|
|
|
|
GtkBindingSet *binding_set = g_ptr_array_index (array, i);
|
|
|
|
|
|
|
|
if (i > 0)
|
|
|
|
g_string_append (string, ", ");
|
|
|
|
g_string_append (string, binding_set->set_name);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static gboolean
|
2012-01-02 17:05:06 +00:00
|
|
|
border_corner_radius_value_parse (GtkCssStyleProperty *property,
|
|
|
|
GValue *value,
|
|
|
|
GtkCssParser *parser,
|
|
|
|
GFile *base)
|
2012-01-02 09:21:57 +00:00
|
|
|
{
|
|
|
|
GtkCssBorderCornerRadius corner;
|
|
|
|
|
|
|
|
if (!_gtk_css_parser_try_double (parser, &corner.horizontal))
|
|
|
|
{
|
|
|
|
_gtk_css_parser_error (parser, "Expected a number");
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
else if (corner.horizontal < 0)
|
|
|
|
goto negative;
|
|
|
|
|
|
|
|
if (!_gtk_css_parser_try_double (parser, &corner.vertical))
|
|
|
|
corner.vertical = corner.horizontal;
|
|
|
|
else if (corner.vertical < 0)
|
|
|
|
goto negative;
|
|
|
|
|
|
|
|
g_value_set_boxed (value, &corner);
|
|
|
|
return TRUE;
|
|
|
|
|
|
|
|
negative:
|
|
|
|
_gtk_css_parser_error (parser, "Border radius values cannot be negative");
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2012-01-02 17:05:06 +00:00
|
|
|
border_corner_radius_value_print (GtkCssStyleProperty *property,
|
|
|
|
const GValue *value,
|
|
|
|
GString *string)
|
2012-01-02 09:21:57 +00:00
|
|
|
{
|
|
|
|
GtkCssBorderCornerRadius *corner;
|
|
|
|
|
|
|
|
corner = g_value_get_boxed (value);
|
|
|
|
|
|
|
|
if (corner == NULL)
|
|
|
|
{
|
|
|
|
g_string_append (string, "none");
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
string_append_double (string, corner->horizontal);
|
|
|
|
if (corner->horizontal != corner->vertical)
|
|
|
|
{
|
|
|
|
g_string_append_c (string, ' ');
|
|
|
|
string_append_double (string, corner->vertical);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-01-02 21:22:25 +00:00
|
|
|
static gboolean
|
|
|
|
css_image_value_parse (GtkCssStyleProperty *property,
|
|
|
|
GValue *value,
|
|
|
|
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;
|
|
|
|
}
|
|
|
|
|
|
|
|
g_value_unset (value);
|
|
|
|
g_value_init (value, GTK_TYPE_CSS_IMAGE);
|
|
|
|
g_value_take_object (value, image);
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
css_image_value_print (GtkCssStyleProperty *property,
|
|
|
|
const GValue *value,
|
|
|
|
GString *string)
|
|
|
|
{
|
|
|
|
GtkCssImage *image = g_value_get_object (value);
|
|
|
|
|
|
|
|
if (image)
|
|
|
|
_gtk_css_image_print (image, string);
|
|
|
|
else
|
|
|
|
g_string_append (string, "none");
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
css_image_value_compute (GtkCssStyleProperty *property,
|
|
|
|
GValue *computed,
|
|
|
|
GtkStyleContext *context,
|
|
|
|
const GValue *specified)
|
|
|
|
{
|
|
|
|
GtkCssImage *image = g_value_get_object (specified);
|
|
|
|
|
|
|
|
if (image)
|
|
|
|
image = _gtk_css_image_compute (image, context);
|
|
|
|
|
|
|
|
g_value_init (computed, GTK_TYPE_CSS_IMAGE);
|
|
|
|
g_value_take_object (computed, image);
|
|
|
|
}
|
|
|
|
|
2012-01-02 09:21:57 +00:00
|
|
|
/*** REGISTRATION ***/
|
|
|
|
|
|
|
|
#define rgba_init(rgba, r, g, b, a) G_STMT_START{ \
|
|
|
|
(rgba)->red = (r); \
|
|
|
|
(rgba)->green = (g); \
|
|
|
|
(rgba)->blue = (b); \
|
|
|
|
(rgba)->alpha = (a); \
|
|
|
|
}G_STMT_END
|
|
|
|
void
|
|
|
|
_gtk_css_style_property_init_properties (void)
|
|
|
|
{
|
|
|
|
GValue value = { 0, };
|
|
|
|
char *default_font_family[] = { "Sans", NULL };
|
|
|
|
GdkRGBA rgba;
|
|
|
|
GtkCssBorderCornerRadius no_corner_radius = { 0, };
|
2012-01-02 10:27:54 +00:00
|
|
|
GtkBorder border_of_ones = { 1, 1, 1, 1 };
|
|
|
|
GtkCssBackgroundRepeat background_repeat = { GTK_CSS_BACKGROUND_REPEAT_STYLE_REPEAT };
|
|
|
|
GtkCssBorderImageRepeat border_image_repeat = { GTK_CSS_REPEAT_STYLE_STRETCH, GTK_CSS_REPEAT_STYLE_STRETCH };
|
2012-01-02 09:21:57 +00:00
|
|
|
|
|
|
|
/* note that gtk_style_properties_register_property() calls this function,
|
|
|
|
* so make sure we're sanely inited to avoid infloops */
|
|
|
|
|
|
|
|
rgba_init (&rgba, 1, 1, 1, 1);
|
2012-01-02 10:54:13 +00:00
|
|
|
gtk_style_property_register ("color",
|
|
|
|
GDK_TYPE_RGBA,
|
2012-01-02 09:21:57 +00:00
|
|
|
GTK_STYLE_PROPERTY_INHERIT,
|
|
|
|
NULL,
|
|
|
|
NULL,
|
2012-01-02 17:28:24 +00:00
|
|
|
NULL,
|
2012-01-02 10:12:46 +00:00
|
|
|
&rgba);
|
2012-01-02 09:21:57 +00:00
|
|
|
rgba_init (&rgba, 0, 0, 0, 0);
|
2012-01-02 10:54:13 +00:00
|
|
|
gtk_style_property_register ("background-color",
|
|
|
|
GDK_TYPE_RGBA,
|
2012-01-02 09:21:57 +00:00
|
|
|
0,
|
|
|
|
NULL,
|
|
|
|
NULL,
|
2012-01-02 17:28:24 +00:00
|
|
|
NULL,
|
2012-01-02 10:12:46 +00:00
|
|
|
&rgba);
|
2012-01-02 09:21:57 +00:00
|
|
|
|
2012-01-02 10:54:13 +00:00
|
|
|
gtk_style_property_register ("font-family",
|
|
|
|
G_TYPE_STRV,
|
2012-01-02 09:21:57 +00:00
|
|
|
GTK_STYLE_PROPERTY_INHERIT,
|
|
|
|
font_family_parse,
|
|
|
|
font_family_value_print,
|
2012-01-02 17:28:24 +00:00
|
|
|
NULL,
|
2012-01-02 10:12:46 +00:00
|
|
|
default_font_family);
|
2012-01-02 10:54:13 +00:00
|
|
|
gtk_style_property_register ("font-style",
|
|
|
|
PANGO_TYPE_STYLE,
|
2012-01-02 09:21:57 +00:00
|
|
|
GTK_STYLE_PROPERTY_INHERIT,
|
|
|
|
NULL,
|
|
|
|
NULL,
|
2012-01-02 17:28:24 +00:00
|
|
|
NULL,
|
2012-01-02 10:12:46 +00:00
|
|
|
PANGO_STYLE_NORMAL);
|
2012-01-02 10:54:13 +00:00
|
|
|
gtk_style_property_register ("font-variant",
|
|
|
|
PANGO_TYPE_VARIANT,
|
2012-01-02 09:21:57 +00:00
|
|
|
GTK_STYLE_PROPERTY_INHERIT,
|
|
|
|
NULL,
|
|
|
|
NULL,
|
2012-01-02 17:28:24 +00:00
|
|
|
NULL,
|
2012-01-02 10:12:46 +00:00
|
|
|
PANGO_VARIANT_NORMAL);
|
2012-01-02 09:21:57 +00:00
|
|
|
/* xxx: need to parse this properly, ie parse the numbers */
|
2012-01-02 10:54:13 +00:00
|
|
|
gtk_style_property_register ("font-weight",
|
|
|
|
PANGO_TYPE_WEIGHT,
|
2012-01-02 09:21:57 +00:00
|
|
|
GTK_STYLE_PROPERTY_INHERIT,
|
|
|
|
NULL,
|
|
|
|
NULL,
|
2012-01-02 17:28:24 +00:00
|
|
|
NULL,
|
2012-01-02 10:12:46 +00:00
|
|
|
PANGO_WEIGHT_NORMAL);
|
2012-01-02 10:54:13 +00:00
|
|
|
gtk_style_property_register ("font-size",
|
|
|
|
G_TYPE_DOUBLE,
|
2012-01-02 09:21:57 +00:00
|
|
|
GTK_STYLE_PROPERTY_INHERIT,
|
|
|
|
NULL,
|
|
|
|
NULL,
|
2012-01-02 17:28:24 +00:00
|
|
|
NULL,
|
2012-01-02 10:12:46 +00:00
|
|
|
10.0);
|
2012-01-02 09:21:57 +00:00
|
|
|
|
2012-01-02 10:54:13 +00:00
|
|
|
gtk_style_property_register ("text-shadow",
|
|
|
|
GTK_TYPE_SHADOW,
|
2012-01-02 09:21:57 +00:00
|
|
|
GTK_STYLE_PROPERTY_INHERIT,
|
|
|
|
NULL,
|
|
|
|
NULL,
|
2012-01-02 17:28:24 +00:00
|
|
|
NULL,
|
2012-01-02 09:21:57 +00:00
|
|
|
NULL);
|
|
|
|
|
2012-01-02 10:54:13 +00:00
|
|
|
gtk_style_property_register ("icon-shadow",
|
|
|
|
GTK_TYPE_SHADOW,
|
2012-01-02 09:21:57 +00:00
|
|
|
GTK_STYLE_PROPERTY_INHERIT,
|
|
|
|
NULL,
|
|
|
|
NULL,
|
2012-01-02 17:28:24 +00:00
|
|
|
NULL,
|
2012-01-02 09:21:57 +00:00
|
|
|
NULL);
|
|
|
|
|
2012-01-02 10:54:13 +00:00
|
|
|
gtk_style_property_register ("box-shadow",
|
|
|
|
GTK_TYPE_SHADOW,
|
2012-01-02 10:27:54 +00:00
|
|
|
0,
|
|
|
|
NULL,
|
|
|
|
NULL,
|
2012-01-02 17:28:24 +00:00
|
|
|
NULL,
|
2012-01-02 10:27:54 +00:00
|
|
|
NULL);
|
|
|
|
|
2012-01-02 10:54:13 +00:00
|
|
|
gtk_style_property_register ("margin-top",
|
|
|
|
G_TYPE_INT,
|
2012-01-02 10:27:54 +00:00
|
|
|
0,
|
|
|
|
NULL,
|
|
|
|
NULL,
|
2012-01-02 17:28:24 +00:00
|
|
|
NULL,
|
2012-01-02 10:27:54 +00:00
|
|
|
0);
|
2012-01-02 10:54:13 +00:00
|
|
|
gtk_style_property_register ("margin-left",
|
|
|
|
G_TYPE_INT,
|
2012-01-02 10:27:54 +00:00
|
|
|
0,
|
|
|
|
NULL,
|
|
|
|
NULL,
|
2012-01-02 17:28:24 +00:00
|
|
|
NULL,
|
2012-01-02 10:27:54 +00:00
|
|
|
0);
|
2012-01-02 10:54:13 +00:00
|
|
|
gtk_style_property_register ("margin-bottom",
|
|
|
|
G_TYPE_INT,
|
2012-01-02 10:27:54 +00:00
|
|
|
0,
|
|
|
|
NULL,
|
|
|
|
NULL,
|
2012-01-02 17:28:24 +00:00
|
|
|
NULL,
|
2012-01-02 10:27:54 +00:00
|
|
|
0);
|
2012-01-02 10:54:13 +00:00
|
|
|
gtk_style_property_register ("margin-right",
|
|
|
|
G_TYPE_INT,
|
2012-01-02 10:27:54 +00:00
|
|
|
0,
|
|
|
|
NULL,
|
|
|
|
NULL,
|
2012-01-02 17:28:24 +00:00
|
|
|
NULL,
|
2012-01-02 10:27:54 +00:00
|
|
|
0);
|
2012-01-02 10:54:13 +00:00
|
|
|
gtk_style_property_register ("padding-top",
|
|
|
|
G_TYPE_INT,
|
2012-01-02 10:27:54 +00:00
|
|
|
0,
|
|
|
|
NULL,
|
|
|
|
NULL,
|
2012-01-02 17:28:24 +00:00
|
|
|
NULL,
|
2012-01-02 10:27:54 +00:00
|
|
|
0);
|
2012-01-02 10:54:13 +00:00
|
|
|
gtk_style_property_register ("padding-left",
|
|
|
|
G_TYPE_INT,
|
2012-01-02 10:27:54 +00:00
|
|
|
0,
|
|
|
|
NULL,
|
|
|
|
NULL,
|
2012-01-02 17:28:24 +00:00
|
|
|
NULL,
|
2012-01-02 10:27:54 +00:00
|
|
|
0);
|
2012-01-02 10:54:13 +00:00
|
|
|
gtk_style_property_register ("padding-bottom",
|
|
|
|
G_TYPE_INT,
|
2012-01-02 10:27:54 +00:00
|
|
|
0,
|
|
|
|
NULL,
|
|
|
|
NULL,
|
2012-01-02 17:28:24 +00:00
|
|
|
NULL,
|
2012-01-02 10:27:54 +00:00
|
|
|
0);
|
2012-01-02 10:54:13 +00:00
|
|
|
gtk_style_property_register ("padding-right",
|
|
|
|
G_TYPE_INT,
|
2012-01-02 10:27:54 +00:00
|
|
|
0,
|
|
|
|
NULL,
|
|
|
|
NULL,
|
2012-01-02 17:28:24 +00:00
|
|
|
NULL,
|
2012-01-02 10:27:54 +00:00
|
|
|
0);
|
2012-01-02 10:54:13 +00:00
|
|
|
gtk_style_property_register ("border-top-width",
|
|
|
|
G_TYPE_INT,
|
2012-01-02 10:27:54 +00:00
|
|
|
0,
|
|
|
|
NULL,
|
|
|
|
NULL,
|
2012-01-02 17:28:24 +00:00
|
|
|
NULL,
|
2012-01-02 10:27:54 +00:00
|
|
|
0);
|
2012-01-02 10:54:13 +00:00
|
|
|
gtk_style_property_register ("border-left-width",
|
|
|
|
G_TYPE_INT,
|
2012-01-02 10:27:54 +00:00
|
|
|
0,
|
|
|
|
NULL,
|
|
|
|
NULL,
|
2012-01-02 17:28:24 +00:00
|
|
|
NULL,
|
2012-01-02 10:27:54 +00:00
|
|
|
0);
|
2012-01-02 10:54:13 +00:00
|
|
|
gtk_style_property_register ("border-bottom-width",
|
|
|
|
G_TYPE_INT,
|
2012-01-02 10:27:54 +00:00
|
|
|
0,
|
|
|
|
NULL,
|
|
|
|
NULL,
|
2012-01-02 17:28:24 +00:00
|
|
|
NULL,
|
2012-01-02 10:27:54 +00:00
|
|
|
0);
|
2012-01-02 10:54:13 +00:00
|
|
|
gtk_style_property_register ("border-right-width",
|
|
|
|
G_TYPE_INT,
|
2012-01-02 10:27:54 +00:00
|
|
|
0,
|
|
|
|
NULL,
|
|
|
|
NULL,
|
2012-01-02 17:28:24 +00:00
|
|
|
NULL,
|
2012-01-02 10:27:54 +00:00
|
|
|
0);
|
2012-01-02 09:21:57 +00:00
|
|
|
|
2012-01-02 10:54:13 +00:00
|
|
|
gtk_style_property_register ("border-top-left-radius",
|
|
|
|
GTK_TYPE_CSS_BORDER_CORNER_RADIUS,
|
2012-01-02 09:21:57 +00:00
|
|
|
0,
|
|
|
|
border_corner_radius_value_parse,
|
|
|
|
border_corner_radius_value_print,
|
2012-01-02 17:28:24 +00:00
|
|
|
NULL,
|
2012-01-02 10:12:46 +00:00
|
|
|
&no_corner_radius);
|
2012-01-02 10:54:13 +00:00
|
|
|
gtk_style_property_register ("border-top-right-radius",
|
|
|
|
GTK_TYPE_CSS_BORDER_CORNER_RADIUS,
|
2012-01-02 09:21:57 +00:00
|
|
|
0,
|
|
|
|
border_corner_radius_value_parse,
|
|
|
|
border_corner_radius_value_print,
|
2012-01-02 17:28:24 +00:00
|
|
|
NULL,
|
2012-01-02 10:12:46 +00:00
|
|
|
&no_corner_radius);
|
2012-01-02 10:54:13 +00:00
|
|
|
gtk_style_property_register ("border-bottom-right-radius",
|
|
|
|
GTK_TYPE_CSS_BORDER_CORNER_RADIUS,
|
2012-01-02 09:21:57 +00:00
|
|
|
0,
|
|
|
|
border_corner_radius_value_parse,
|
|
|
|
border_corner_radius_value_print,
|
2012-01-02 17:28:24 +00:00
|
|
|
NULL,
|
2012-01-02 10:12:46 +00:00
|
|
|
&no_corner_radius);
|
2012-01-02 10:54:13 +00:00
|
|
|
gtk_style_property_register ("border-bottom-left-radius",
|
|
|
|
GTK_TYPE_CSS_BORDER_CORNER_RADIUS,
|
2012-01-02 09:21:57 +00:00
|
|
|
0,
|
|
|
|
border_corner_radius_value_parse,
|
|
|
|
border_corner_radius_value_print,
|
2012-01-02 17:28:24 +00:00
|
|
|
NULL,
|
2012-01-02 10:12:46 +00:00
|
|
|
&no_corner_radius);
|
2012-01-02 09:21:57 +00:00
|
|
|
|
2012-01-02 10:54:13 +00:00
|
|
|
gtk_style_property_register ("border-style",
|
|
|
|
GTK_TYPE_BORDER_STYLE,
|
2012-01-02 10:27:54 +00:00
|
|
|
0,
|
|
|
|
NULL,
|
|
|
|
NULL,
|
2012-01-02 17:28:24 +00:00
|
|
|
NULL,
|
2012-01-02 10:27:54 +00:00
|
|
|
GTK_BORDER_STYLE_NONE);
|
2012-01-02 10:54:13 +00:00
|
|
|
gtk_style_property_register ("background-clip",
|
|
|
|
GTK_TYPE_CSS_AREA,
|
2012-01-02 10:27:54 +00:00
|
|
|
0,
|
|
|
|
NULL,
|
|
|
|
NULL,
|
2012-01-02 17:28:24 +00:00
|
|
|
NULL,
|
2012-01-02 10:27:54 +00:00
|
|
|
GTK_CSS_AREA_BORDER_BOX);
|
|
|
|
|
2012-01-02 10:54:13 +00:00
|
|
|
gtk_style_property_register ("background-origin",
|
|
|
|
GTK_TYPE_CSS_AREA,
|
2012-01-02 10:27:54 +00:00
|
|
|
0,
|
|
|
|
NULL,
|
|
|
|
NULL,
|
2012-01-02 17:28:24 +00:00
|
|
|
NULL,
|
2012-01-02 10:27:54 +00:00
|
|
|
GTK_CSS_AREA_PADDING_BOX);
|
|
|
|
|
2012-01-02 09:21:57 +00:00
|
|
|
g_value_init (&value, GTK_TYPE_CSS_SPECIAL_VALUE);
|
|
|
|
g_value_set_enum (&value, GTK_CSS_CURRENT_COLOR);
|
2012-01-02 10:54:13 +00:00
|
|
|
_gtk_style_property_register ("border-top-color",
|
|
|
|
GDK_TYPE_RGBA,
|
2012-01-02 09:21:57 +00:00
|
|
|
0,
|
|
|
|
NULL,
|
|
|
|
NULL,
|
2012-01-02 17:28:24 +00:00
|
|
|
NULL,
|
2012-01-02 09:21:57 +00:00
|
|
|
&value);
|
2012-01-02 10:54:13 +00:00
|
|
|
_gtk_style_property_register ("border-right-color",
|
|
|
|
GDK_TYPE_RGBA,
|
2012-01-02 09:21:57 +00:00
|
|
|
0,
|
|
|
|
NULL,
|
|
|
|
NULL,
|
2012-01-02 17:28:24 +00:00
|
|
|
NULL,
|
2012-01-02 09:21:57 +00:00
|
|
|
&value);
|
2012-01-02 10:54:13 +00:00
|
|
|
_gtk_style_property_register ("border-bottom-color",
|
|
|
|
GDK_TYPE_RGBA,
|
2012-01-02 09:21:57 +00:00
|
|
|
0,
|
|
|
|
NULL,
|
|
|
|
NULL,
|
2012-01-02 17:28:24 +00:00
|
|
|
NULL,
|
2012-01-02 09:21:57 +00:00
|
|
|
&value);
|
2012-01-02 10:54:13 +00:00
|
|
|
_gtk_style_property_register ("border-left-color",
|
|
|
|
GDK_TYPE_RGBA,
|
2012-01-02 09:21:57 +00:00
|
|
|
0,
|
|
|
|
NULL,
|
|
|
|
NULL,
|
2012-01-02 17:28:24 +00:00
|
|
|
NULL,
|
2012-01-02 09:21:57 +00:00
|
|
|
&value);
|
|
|
|
g_value_unset (&value);
|
|
|
|
|
2012-01-02 21:22:25 +00:00
|
|
|
g_value_init (&value, GTK_TYPE_CSS_IMAGE);
|
|
|
|
_gtk_style_property_register ("background-image",
|
2012-01-02 10:54:13 +00:00
|
|
|
CAIRO_GOBJECT_TYPE_PATTERN,
|
2012-01-02 10:27:54 +00:00
|
|
|
0,
|
2012-01-02 21:22:25 +00:00
|
|
|
css_image_value_parse,
|
|
|
|
css_image_value_print,
|
|
|
|
css_image_value_compute,
|
|
|
|
&value);
|
|
|
|
g_value_unset (&value);
|
2012-01-02 10:54:13 +00:00
|
|
|
gtk_style_property_register ("background-repeat",
|
|
|
|
GTK_TYPE_CSS_BACKGROUND_REPEAT,
|
2012-01-02 10:27:54 +00:00
|
|
|
0,
|
|
|
|
NULL,
|
|
|
|
NULL,
|
2012-01-02 17:28:24 +00:00
|
|
|
NULL,
|
2012-01-02 10:27:54 +00:00
|
|
|
&background_repeat);
|
2012-01-02 09:21:57 +00:00
|
|
|
|
2012-01-02 10:54:13 +00:00
|
|
|
gtk_style_property_register ("border-image-source",
|
|
|
|
CAIRO_GOBJECT_TYPE_PATTERN,
|
2012-01-02 10:27:54 +00:00
|
|
|
0,
|
|
|
|
NULL,
|
|
|
|
NULL,
|
2012-01-02 17:28:24 +00:00
|
|
|
NULL,
|
2012-01-02 10:27:54 +00:00
|
|
|
NULL);
|
2012-01-02 10:54:13 +00:00
|
|
|
gtk_style_property_register ("border-image-repeat",
|
|
|
|
GTK_TYPE_CSS_BORDER_IMAGE_REPEAT,
|
2012-01-02 10:27:54 +00:00
|
|
|
0,
|
|
|
|
NULL,
|
|
|
|
NULL,
|
2012-01-02 17:28:24 +00:00
|
|
|
NULL,
|
2012-01-02 10:27:54 +00:00
|
|
|
&border_image_repeat);
|
|
|
|
|
|
|
|
/* XXX: The initial vaue is wrong, it should be 100% */
|
2012-01-02 10:54:13 +00:00
|
|
|
gtk_style_property_register ("border-image-slice",
|
|
|
|
GTK_TYPE_BORDER,
|
2012-01-02 10:27:54 +00:00
|
|
|
0,
|
|
|
|
NULL,
|
|
|
|
NULL,
|
2012-01-02 17:28:24 +00:00
|
|
|
NULL,
|
2012-01-02 10:27:54 +00:00
|
|
|
&border_of_ones);
|
2012-01-02 10:54:13 +00:00
|
|
|
gtk_style_property_register ("border-image-width",
|
|
|
|
GTK_TYPE_BORDER,
|
2012-01-02 09:21:57 +00:00
|
|
|
0,
|
|
|
|
NULL,
|
|
|
|
NULL,
|
2012-01-02 17:28:24 +00:00
|
|
|
NULL,
|
2012-01-02 10:12:46 +00:00
|
|
|
NULL);
|
2012-01-02 10:54:13 +00:00
|
|
|
gtk_style_property_register ("engine",
|
|
|
|
GTK_TYPE_THEMING_ENGINE,
|
2012-01-02 10:27:54 +00:00
|
|
|
0,
|
|
|
|
NULL,
|
|
|
|
NULL,
|
2012-01-02 17:28:24 +00:00
|
|
|
NULL,
|
2012-01-02 10:27:54 +00:00
|
|
|
gtk_theming_engine_load (NULL));
|
2012-01-02 10:54:13 +00:00
|
|
|
gtk_style_property_register ("transition",
|
|
|
|
GTK_TYPE_ANIMATION_DESCRIPTION,
|
2012-01-02 10:27:54 +00:00
|
|
|
0,
|
|
|
|
NULL,
|
|
|
|
NULL,
|
2012-01-02 17:28:24 +00:00
|
|
|
NULL,
|
2012-01-02 10:27:54 +00:00
|
|
|
NULL);
|
2012-01-02 09:21:57 +00:00
|
|
|
|
|
|
|
/* Private property holding the binding sets */
|
2012-01-02 10:54:13 +00:00
|
|
|
gtk_style_property_register ("gtk-key-bindings",
|
|
|
|
G_TYPE_PTR_ARRAY,
|
2012-01-02 09:21:57 +00:00
|
|
|
0,
|
|
|
|
bindings_value_parse,
|
|
|
|
bindings_value_print,
|
2012-01-02 17:28:24 +00:00
|
|
|
NULL,
|
2012-01-02 09:21:57 +00:00
|
|
|
NULL);
|
|
|
|
}
|
|
|
|
|