[gtk+] Drop support for -gtk-gradient



commit d674e9c8fac5ab097e3c17a3c73dd21e7f63e7c1
Author: Matthias Clasen <mclasen redhat com>
Date:   Mon Nov 7 13:44:57 2016 -0500

    Drop support for -gtk-gradient
    
    The standard CSS radial-gradient can be used instead, and Adwaita
    and HighContrast have been ported over.

 gtk/Makefile.am                     |    2 -
 gtk/deprecated/Makefile.inc         |    3 -
 gtk/deprecated/gtkgradient.c        |  483 ---------------------------------
 gtk/deprecated/gtkgradient.h        |   65 -----
 gtk/deprecated/gtkgradientprivate.h |   38 ---
 gtk/gtk.h                           |    1 -
 gtk/gtkcssimage.c                   |    2 -
 gtk/gtkcssimagegradient.c           |  507 -----------------------------------
 gtk/gtkcssimagegradientprivate.h    |   59 ----
 gtk/gtkcssstylefuncs.c              |   56 ----
 gtk/gtkcssstylepropertyimpl.c       |    7 +-
 gtk/gtkstylecontext.c               |    1 -
 12 files changed, 2 insertions(+), 1222 deletions(-)
---
diff --git a/gtk/Makefile.am b/gtk/Makefile.am
index 3fa3e58..91cd99c 100644
--- a/gtk/Makefile.am
+++ b/gtk/Makefile.am
@@ -406,7 +406,6 @@ gtk_private_h_sources =             \
        gtkcssimagebuiltinprivate.h     \
        gtkcssimagecrossfadeprivate.h   \
        gtkcssimagefallbackprivate.h    \
-       gtkcssimagegradientprivate.h    \
        gtkcssimageiconthemeprivate.h   \
        gtkcssimagelinearprivate.h      \
        gtkcssimageradialprivate.h      \
@@ -676,7 +675,6 @@ gtk_base_c_sources =                \
        gtkcssimagebuiltin.c    \
        gtkcssimagecrossfade.c  \
        gtkcssimagefallback.c   \
-       gtkcssimagegradient.c   \
        gtkcssimageicontheme.c  \
        gtkcssimagelinear.c     \
        gtkcssimageradial.c     \
diff --git a/gtk/deprecated/Makefile.inc b/gtk/deprecated/Makefile.inc
index 1f28597..f8bedfe 100644
--- a/gtk/deprecated/Makefile.inc
+++ b/gtk/deprecated/Makefile.inc
@@ -1,11 +1,8 @@
 deprecated_h_sources =                         \
-       deprecated/gtkgradient.h        \
        deprecated/gtksymboliccolor.h
 
 deprecated_private_h_sources =                 \
-       deprecated/gtkgradientprivate.h         \
        deprecated/gtksymboliccolorprivate.h
 
 deprecated_c_sources =                         \
-       deprecated/gtkgradient.c        \
        deprecated/gtksymboliccolor.c
diff --git a/gtk/gtk.h b/gtk/gtk.h
index 3e4fb44..89b927b 100644
--- a/gtk/gtk.h
+++ b/gtk/gtk.h
@@ -242,7 +242,6 @@
 #include <gtk/gtkwindowgroup.h>
 
 #ifndef GTK_DISABLE_DEPRECATED
-#include <gtk/deprecated/gtkgradient.h>
 #include <gtk/deprecated/gtksymboliccolor.h>
 #endif /* GTK_DISABLE_DEPRECATED */
 
diff --git a/gtk/gtkcssimage.c b/gtk/gtkcssimage.c
index 3b9ff41..0f6c4e8 100644
--- a/gtk/gtkcssimage.c
+++ b/gtk/gtkcssimage.c
@@ -25,7 +25,6 @@
 
 /* for the types only */
 #include "gtk/gtkcssimagecrossfadeprivate.h"
-#include "gtk/gtkcssimagegradientprivate.h"
 #include "gtk/gtkcssimageiconthemeprivate.h"
 #include "gtk/gtkcssimagelinearprivate.h"
 #include "gtk/gtkcssimageradialprivate.h"
@@ -418,7 +417,6 @@ gtk_css_image_get_parser_type (GtkCssParser *parser)
     GType (* type_func) (void);
   } image_types[] = {
     { "url", _gtk_css_image_url_get_type },
-    { "-gtk-gradient", _gtk_css_image_gradient_get_type },
     { "-gtk-icontheme", _gtk_css_image_icon_theme_get_type },
     { "-gtk-scaled", _gtk_css_image_scaled_get_type },
     { "-gtk-recolor", _gtk_css_image_recolor_get_type },
diff --git a/gtk/gtkcssstylefuncs.c b/gtk/gtkcssstylefuncs.c
index 301b052..bd1e839 100644
--- a/gtk/gtkcssstylefuncs.c
+++ b/gtk/gtkcssstylefuncs.c
@@ -28,7 +28,6 @@
 #include <cairo-gobject.h>
 
 #include "gtkcsscolorvalueprivate.h"
-#include "gtkcssimagegradientprivate.h"
 #include "gtkcssprovider.h"
 #include "gtkcssrgbavalueprivate.h"
 #include "gtkcsstypesprivate.h"
@@ -37,7 +36,6 @@
 #include "gtktypebuiltins.h"
 #include "gtkcsswin32sizevalueprivate.h"
 
-#include "deprecated/gtkgradientprivate.h"
 #include "deprecated/gtksymboliccolorprivate.h"
 
 /* this is in case round() is not provided by the compiler, 
@@ -476,40 +474,6 @@ border_value_print (const GValue *value, GString *string)
 }
 
 static gboolean 
-gradient_value_parse (GtkCssParser *parser,
-                      GValue       *value)
-{
-  GtkGradient *gradient;
-
-  gradient = _gtk_gradient_parse (parser);
-  if (gradient == NULL)
-    return FALSE;
-
-  g_value_take_boxed (value, gradient);
-  return TRUE;
-}
-
-static void
-gradient_value_print (const GValue *value,
-                      GString      *string)
-{
-  GtkGradient *gradient = g_value_get_boxed (value);
-
-  G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
-
-  if (gradient == NULL)
-    g_string_append (string, "none");
-  else
-    {
-      char *s = gtk_gradient_to_string (gradient);
-      g_string_append (string, s);
-      g_free (s);
-    }
-
-  G_GNUC_END_IGNORE_DEPRECATIONS;
-}
-
-static gboolean 
 pattern_value_parse (GtkCssParser *parser,
                      GValue       *value)
 {
@@ -517,17 +481,6 @@ pattern_value_parse (GtkCssParser *parser,
     {
       /* nothing to do here */
     }
-  else if (_gtk_css_parser_begins_with (parser, '-'))
-    {
-      g_value_unset (value);
-
-      G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
-
-      g_value_init (value, GTK_TYPE_GRADIENT);
-      return gradient_value_parse (parser, value);
-
-      G_GNUC_END_IGNORE_DEPRECATIONS;
-    }
   else
     {
       GError *error = NULL;
@@ -778,15 +731,6 @@ gtk_css_style_funcs_init (void)
   register_conversion_function (GTK_TYPE_BORDER,
                                 border_value_parse,
                                 border_value_print);
-
-  G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
-
-  register_conversion_function (GTK_TYPE_GRADIENT,
-                                gradient_value_parse,
-                                gradient_value_print);
-
-  G_GNUC_END_IGNORE_DEPRECATIONS;
-
   register_conversion_function (CAIRO_GOBJECT_TYPE_PATTERN,
                                 pattern_value_parse,
                                 pattern_value_print);
diff --git a/gtk/gtkcssstylepropertyimpl.c b/gtk/gtkcssstylepropertyimpl.c
index 0282b50..3571d68 100644
--- a/gtk/gtkcssstylepropertyimpl.c
+++ b/gtk/gtkcssstylepropertyimpl.c
@@ -47,7 +47,6 @@
 #include "gtkcssiconthemevalueprivate.h"
 #include "gtkcssimageprivate.h"
 #include "gtkcssimagebuiltinprivate.h"
-#include "gtkcssimagegradientprivate.h"
 #include "gtkcssimagevalueprivate.h"
 #include "gtkcssinitialvalueprivate.h"
 #include "gtkcssenumvalueprivate.h"
@@ -607,12 +606,10 @@ css_image_value_query (GtkCssStyleProperty *property,
   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)
+  if (image != NULL)
     {
       double width, height;
 
diff --git a/gtk/gtkstylecontext.c b/gtk/gtkstylecontext.c
index 150d404..6b2eb19 100644
--- a/gtk/gtkstylecontext.c
+++ b/gtk/gtkstylecontext.c
@@ -55,7 +55,6 @@
 #include "gtkwidgetpath.h"
 #include "gtkwidgetprivate.h"
 
-#include "deprecated/gtkgradientprivate.h"
 #include "deprecated/gtksymboliccolorprivate.h"
 
 #include "fallback-c89.c"


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]