[gtk+/wip/otte/gtk4: 120/127] API: Remove GtkStyleProperties
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/wip/otte/gtk4: 120/127] API: Remove GtkStyleProperties
- Date: Sat, 8 Oct 2016 03:42:49 +0000 (UTC)
commit d73da42de8147f3deb8cfdf081965ce0c382bdde
Author: Benjamin Otte <otte redhat com>
Date: Fri Oct 7 04:58:35 2016 +0200
API: Remove GtkStyleProperties
docs/reference/gtk/gtk3-sections.txt | 28 --
gtk/deprecated/Makefile.inc | 2 -
gtk/deprecated/gtkgradient.c | 62 ---
gtk/deprecated/gtkgradient.h | 14 +-
gtk/deprecated/gtkstyleproperties.c | 790 ----------------------------------
gtk/deprecated/gtkstyleproperties.h | 120 -----
gtk/deprecated/gtksymboliccolor.c | 5 +-
gtk/deprecated/gtksymboliccolor.h | 4 +-
gtk/gtk-autocleanups.h | 1 -
gtk/gtk.h | 1 -
gtk/gtkcsscustompropertyprivate.h | 4 +
gtk/gtkcssstylefuncs.c | 4 +-
gtk/gtkstyleprovider.c | 32 --
gtk/gtkstyleprovider.h | 10 +-
14 files changed, 12 insertions(+), 1065 deletions(-)
---
diff --git a/docs/reference/gtk/gtk3-sections.txt b/docs/reference/gtk/gtk3-sections.txt
index 41e4590..c7038fe 100644
--- a/docs/reference/gtk/gtk3-sections.txt
+++ b/docs/reference/gtk/gtk3-sections.txt
@@ -5645,34 +5645,6 @@ gtk_style_provider_get_type
</SECTION>
<SECTION>
-<FILE>gtkstyleproperties</FILE>
-<TITLE>GtkStyleProperties</TITLE>
-GtkStyleProperties
-gtk_style_properties_clear
-gtk_style_properties_get
-gtk_style_properties_get_property
-gtk_style_properties_get_valist
-gtk_style_properties_lookup_color
-gtk_style_properties_lookup_property
-gtk_style_properties_map_color
-gtk_style_properties_merge
-gtk_style_properties_new
-GtkStylePropertyParser
-gtk_style_properties_register_property
-gtk_style_properties_unset_property
-<SUBSECTION Standard>
-GTK_TYPE_STYLE_PROPERTIES
-GTK_IS_STYLE_PROPERTIES
-GTK_IS_STYLE_PROPERTIES_CLASS
-GTK_STYLE_PROPERTIES
-GTK_STYLE_PROPERTIES_CLASS
-GTK_STYLE_PROPERTIES_GET_CLASS
-<SUBSECTION Private>
-GtkStylePropertiesPrivate
-gtk_style_properties_get_type
-</SECTION>
-
-<SECTION>
<FILE>gtkstylecontext</FILE>
<TITLE>GtkStyleContext</TITLE>
<SUBSECTION>
diff --git a/gtk/deprecated/Makefile.inc b/gtk/deprecated/Makefile.inc
index 8136ef1..4cc0f9c 100644
--- a/gtk/deprecated/Makefile.inc
+++ b/gtk/deprecated/Makefile.inc
@@ -7,7 +7,6 @@ deprecated_h_sources = \
deprecated/gtkradioaction.h \
deprecated/gtkrecentaction.h \
deprecated/gtkstock.h \
- deprecated/gtkstyleproperties.h \
deprecated/gtksymboliccolor.h \
deprecated/gtktable.h \
deprecated/gtktoggleaction.h \
@@ -26,7 +25,6 @@ deprecated_c_sources = \
deprecated/gtkradioaction.c \
deprecated/gtkrecentaction.c \
deprecated/gtkstock.c \
- deprecated/gtkstyleproperties.c \
deprecated/gtksymboliccolor.c \
deprecated/gtktable.c \
deprecated/gtktoggleaction.c \
diff --git a/gtk/deprecated/gtkgradient.c b/gtk/deprecated/gtkgradient.c
index a1a3a6c..2e682c7 100644
--- a/gtk/deprecated/gtkgradient.c
+++ b/gtk/deprecated/gtkgradient.c
@@ -23,7 +23,6 @@
#include "gtkcsscolorvalueprivate.h"
#include "gtkcssrgbavalueprivate.h"
#include "gtkstylecontextprivate.h"
-#include "gtkstyleproperties.h"
#include "gtksymboliccolorprivate.h"
/**
@@ -241,67 +240,6 @@ gtk_gradient_unref (GtkGradient *gradient)
}
}
-/**
- * gtk_gradient_resolve:
- * @gradient: a #GtkGradient
- * @props: #GtkStyleProperties to use when resolving named colors
- * @resolved_gradient: (out): return location for the resolved pattern
- *
- * If @gradient is resolvable, @resolved_gradient will be filled in
- * with the resolved gradient as a cairo_pattern_t, and %TRUE will
- * be returned. Generally, if @gradient can’t be resolved, it is
- * due to it being defined on top of a named color that doesn't
- * exist in @props.
- *
- * Returns: %TRUE if the gradient has been resolved
- *
- * Since: 3.0
- *
- * Deprecated: 3.8: #GtkGradient is deprecated.
- **/
-gboolean
-gtk_gradient_resolve (GtkGradient *gradient,
- GtkStyleProperties *props,
- cairo_pattern_t **resolved_gradient)
-{
- cairo_pattern_t *pattern;
- guint i;
-
- g_return_val_if_fail (gradient != NULL, FALSE);
- g_return_val_if_fail (GTK_IS_STYLE_PROPERTIES (props), FALSE);
- g_return_val_if_fail (resolved_gradient != NULL, FALSE);
-
- if (gradient->radius0 == 0 && gradient->radius1 == 0)
- pattern = cairo_pattern_create_linear (gradient->x0, gradient->y0,
- gradient->x1, gradient->y1);
- else
- pattern = cairo_pattern_create_radial (gradient->x0, gradient->y0,
- gradient->radius0,
- gradient->x1, gradient->y1,
- gradient->radius1);
-
- for (i = 0; i < gradient->stops->len; i++)
- {
- ColorStop *stop;
- GdkRGBA color;
-
- stop = &g_array_index (gradient->stops, ColorStop, i);
-
- if (!gtk_symbolic_color_resolve (stop->color, props, &color))
- {
- cairo_pattern_destroy (pattern);
- return FALSE;
- }
-
- cairo_pattern_add_color_stop_rgba (pattern, stop->offset,
- color.red, color.green,
- color.blue, color.alpha);
- }
-
- *resolved_gradient = pattern;
- return TRUE;
-}
-
cairo_pattern_t *
_gtk_gradient_resolve_full (GtkGradient *gradient,
GtkStyleProviderPrivate *provider,
diff --git a/gtk/deprecated/gtkgradient.h b/gtk/deprecated/gtkgradient.h
index e0d3e34..c6e870f 100644
--- a/gtk/deprecated/gtkgradient.h
+++ b/gtk/deprecated/gtkgradient.h
@@ -23,12 +23,12 @@
#endif
#include <gdk/gdk.h>
-#include <gtk/gtkstylecontext.h>
-#include <gtk/deprecated/gtkstyleproperties.h>
#include <gtk/deprecated/gtksymboliccolor.h>
G_BEGIN_DECLS
+typedef struct _GtkGradient GtkGradient;
+
#define GTK_TYPE_GRADIENT (gtk_gradient_get_type ())
GDK_DEPRECATED_IN_3_8
@@ -58,16 +58,6 @@ GDK_DEPRECATED_IN_3_8
void gtk_gradient_unref (GtkGradient *gradient);
GDK_DEPRECATED_IN_3_8
-gboolean gtk_gradient_resolve (GtkGradient *gradient,
- GtkStyleProperties *props,
- cairo_pattern_t **resolved_gradient);
-GDK_DEPRECATED_IN_3_8
-cairo_pattern_t *
- gtk_gradient_resolve_for_context
- (GtkGradient *gradient,
- GtkStyleContext *context);
-
-GDK_DEPRECATED_IN_3_8
char * gtk_gradient_to_string (GtkGradient *gradient);
G_END_DECLS
diff --git a/gtk/deprecated/gtksymboliccolor.c b/gtk/deprecated/gtksymboliccolor.c
index 6ed2292..4190337 100644
--- a/gtk/deprecated/gtksymboliccolor.c
+++ b/gtk/deprecated/gtksymboliccolor.c
@@ -25,7 +25,6 @@
#include "gtkhslaprivate.h"
#include "gtkstylepropertyprivate.h"
#include "gtksymboliccolorprivate.h"
-#include "gtkstyleproperties.h"
#include "gtkintl.h"
#include "gtkwin32themeprivate.h"
@@ -292,7 +291,6 @@ gtk_symbolic_color_unref (GtkSymbolicColor *color)
**/
gboolean
gtk_symbolic_color_resolve (GtkSymbolicColor *color,
- GtkStyleProperties *props,
GdkRGBA *resolved_color)
{
GdkRGBA pink = { 1.0, 0.5, 0.5, 1.0 };
@@ -300,11 +298,10 @@ gtk_symbolic_color_resolve (GtkSymbolicColor *color,
g_return_val_if_fail (color != NULL, FALSE);
g_return_val_if_fail (resolved_color != NULL, FALSE);
- g_return_val_if_fail (props == NULL || GTK_IS_STYLE_PROPERTIES (props), FALSE);
current = _gtk_css_rgba_value_new_from_rgba (&pink);
v = _gtk_css_color_value_resolve (color->value,
- GTK_STYLE_PROVIDER_PRIVATE (props),
+ NULL,
current,
NULL);
_gtk_css_value_unref (current);
diff --git a/gtk/deprecated/gtksymboliccolor.h b/gtk/deprecated/gtksymboliccolor.h
index 8beded6..992dfa2 100644
--- a/gtk/deprecated/gtksymboliccolor.h
+++ b/gtk/deprecated/gtksymboliccolor.h
@@ -23,10 +23,11 @@
#endif
#include <gdk/gdk.h>
-#include <gtk/deprecated/gtkstyleproperties.h>
G_BEGIN_DECLS
+typedef struct _GtkSymbolicColor GtkSymbolicColor;
+
#define GTK_TYPE_SYMBOLIC_COLOR (gtk_symbolic_color_get_type ())
GDK_DEPRECATED_IN_3_8
@@ -60,7 +61,6 @@ char * gtk_symbolic_color_to_string (GtkSymbolicColor *color);
GDK_DEPRECATED_IN_3_8
gboolean gtk_symbolic_color_resolve (GtkSymbolicColor *color,
- GtkStyleProperties *props,
GdkRGBA *resolved_color);
G_END_DECLS
diff --git a/gtk/gtk-autocleanups.h b/gtk/gtk-autocleanups.h
index 0b1c230..ea47ba0 100644
--- a/gtk/gtk-autocleanups.h
+++ b/gtk/gtk-autocleanups.h
@@ -159,7 +159,6 @@ G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkStack, g_object_unref)
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkStackSwitcher, g_object_unref)
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkStatusbar, g_object_unref)
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkStyleContext, g_object_unref)
-G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkStyleProperties, g_object_unref)
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkStyleProvider, g_object_unref)
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkSwitch, g_object_unref)
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkTextBuffer, g_object_unref)
diff --git a/gtk/gtk.h b/gtk/gtk.h
index 9eef211..04132bf 100644
--- a/gtk/gtk.h
+++ b/gtk/gtk.h
@@ -252,7 +252,6 @@
#include <gtk/deprecated/gtkradioaction.h>
#include <gtk/deprecated/gtkrecentaction.h>
#include <gtk/deprecated/gtkstock.h>
-#include <gtk/deprecated/gtkstyleproperties.h>
#include <gtk/deprecated/gtksymboliccolor.h>
#include <gtk/deprecated/gtktable.h>
#include <gtk/deprecated/gtktoggleaction.h>
diff --git a/gtk/gtkcsscustompropertyprivate.h b/gtk/gtkcsscustompropertyprivate.h
index ed3ad08..2b5fd80 100644
--- a/gtk/gtkcsscustompropertyprivate.h
+++ b/gtk/gtkcsscustompropertyprivate.h
@@ -34,6 +34,10 @@ G_BEGIN_DECLS
typedef struct _GtkCssCustomProperty GtkCssCustomProperty;
typedef struct _GtkCssCustomPropertyClass GtkCssCustomPropertyClass;
+typedef gboolean (* GtkStylePropertyParser) (const gchar *string,
+ GValue *value,
+ GError **error);
+
struct _GtkCssCustomProperty
{
GtkCssStyleProperty parent;
diff --git a/gtk/gtkcssstylefuncs.c b/gtk/gtkcssstylefuncs.c
index 0a379ea..00c3f53 100644
--- a/gtk/gtkcssstylefuncs.c
+++ b/gtk/gtkcssstylefuncs.c
@@ -146,7 +146,7 @@ rgba_value_parse (GtkCssParser *parser,
if (symbolic == NULL)
return FALSE;
- if (gtk_symbolic_color_resolve (symbolic, NULL, &rgba))
+ if (gtk_symbolic_color_resolve (symbolic, &rgba))
{
g_value_set_boxed (value, &rgba);
gtk_symbolic_color_unref (symbolic);
@@ -234,7 +234,7 @@ color_value_parse (GtkCssParser *parser,
if (symbolic == NULL)
return FALSE;
- if (gtk_symbolic_color_resolve (symbolic, NULL, &rgba))
+ if (gtk_symbolic_color_resolve (symbolic, &rgba))
{
GdkColor color;
diff --git a/gtk/gtkstyleprovider.c b/gtk/gtkstyleprovider.c
index a52d38d..a604340 100644
--- a/gtk/gtkstyleprovider.c
+++ b/gtk/gtkstyleprovider.c
@@ -55,38 +55,6 @@ gtk_style_provider_iface_init (gpointer g_iface)
}
/**
- * gtk_style_provider_get_style:
- * @provider: a #GtkStyleProvider
- * @path: #GtkWidgetPath to query
- *
- * Returns the style settings affecting a widget defined by @path, or %NULL if
- * @provider doesn’t contemplate styling @path.
- *
- * Returns: (nullable) (transfer full): a #GtkStyleProperties containing the
- * style settings affecting @path
- *
- * Since: 3.0
- *
- * Deprecated: 3.8: Will always return %NULL for all GTK-provided style providers
- * as the interface cannot correctly work the way CSS is specified.
- **/
-GtkStyleProperties *
-gtk_style_provider_get_style (GtkStyleProvider *provider,
- GtkWidgetPath *path)
-{
- GtkStyleProviderIface *iface;
-
- g_return_val_if_fail (GTK_IS_STYLE_PROVIDER (provider), NULL);
-
- iface = GTK_STYLE_PROVIDER_GET_IFACE (provider);
-
- if (!iface->get_style)
- return NULL;
-
- return iface->get_style (provider, path);
-}
-
-/**
* gtk_style_provider_get_style_property:
* @provider: a #GtkStyleProvider
* @path: #GtkWidgetPath to query
diff --git a/gtk/gtkstyleprovider.h b/gtk/gtkstyleprovider.h
index cebee70..6d5d085 100644
--- a/gtk/gtkstyleprovider.h
+++ b/gtk/gtkstyleprovider.h
@@ -22,9 +22,8 @@
#error "Only <gtk/gtk.h> can be included directly."
#endif
-#include <glib-object.h>
+#include <gdk/gdk.h>
#include <gtk/gtkenums.h>
-#include <gtk/deprecated/gtkstyleproperties.h>
#include <gtk/gtktypes.h>
G_BEGIN_DECLS
@@ -101,9 +100,6 @@ struct _GtkStyleProviderIface
/*< public >*/
- GtkStyleProperties * (* get_style) (GtkStyleProvider *provider,
- GtkWidgetPath *path);
-
gboolean (* get_style_property) (GtkStyleProvider *provider,
GtkWidgetPath *path,
GtkStateFlags state,
@@ -114,10 +110,6 @@ struct _GtkStyleProviderIface
GDK_AVAILABLE_IN_ALL
GType gtk_style_provider_get_type (void) G_GNUC_CONST;
-GDK_DEPRECATED_IN_3_8
-GtkStyleProperties *gtk_style_provider_get_style (GtkStyleProvider *provider,
- GtkWidgetPath *path);
-
GDK_AVAILABLE_IN_ALL
gboolean gtk_style_provider_get_style_property (GtkStyleProvider *provider,
GtkWidgetPath *path,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]