[gtk+/wip/otte/gtk4: 85/127] widget: Remove deprecated style properties



commit ce1663d598c5407c6ec55155b34127da8fe3c35f
Author: Timm Bäder <mail baedert org>
Date:   Tue Oct 4 18:47:05 2016 +0200

    widget: Remove deprecated style properties

 gtk/gtkcsscustomproperty.c  |    2 +-
 gtk/gtkwidget.c             |  220 -------------------------------------------
 gtk/gtkwidget.h             |    4 -
 testsuite/gtk/cssprovider.c |    4 +-
 testsuite/gtk/treeview.c    |   14 +---
 5 files changed, 5 insertions(+), 239 deletions(-)
---
diff --git a/gtk/gtkcsscustomproperty.c b/gtk/gtkcsscustomproperty.c
index 59205dd..4a73c17 100644
--- a/gtk/gtkcsscustomproperty.c
+++ b/gtk/gtkcsscustomproperty.c
@@ -110,7 +110,7 @@ G_GNUC_BEGIN_IGNORE_DEPRECATIONS
       gdk_rgba_parse (&color, "pink");
       g_value_set_boxed (&value, &color);
     }
-  else if (pspec->value_type == g_type_from_name ("GdkColor"))
+  else if (pspec->value_type == GDK_TYPE_COLOR)
     {
       GdkColor color;
       gdk_color_parse ("pink", &color);
diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c
index 97b952b..d9be5b0 100644
--- a/gtk/gtkwidget.c
+++ b/gtk/gtkwidget.c
@@ -3366,93 +3366,6 @@ gtk_widget_class_init (GtkWidgetClass *klass)
                                 GTK_TYPE_WIDGET_HELP_TYPE,
                                 GTK_WIDGET_HELP_WHATS_THIS);
 
-  /**
-   * GtkWidget:interior-focus:
-   *
-   * The "interior-focus" style property defines whether
-   * to draw the focus indicator inside widgets.
-   *
-   * Deprecated: 3.14: use the outline CSS properties instead.
-   */
-  gtk_widget_class_install_style_property (klass,
-                                          g_param_spec_boolean ("interior-focus",
-                                                                P_("Interior Focus"),
-                                                                P_("Whether to draw the focus indicator 
inside widgets"),
-                                                                TRUE,
-                                                                GTK_PARAM_READABLE | G_PARAM_DEPRECATED));
-  /**
-   * GtkWidget:focus-line-width:
-   *
-   * The "focus-line-width" style property defines the width,
-   * in pixels, of the focus indicator line
-   *
-   * Deprecated: 3.14: use the outline-width and padding CSS properties instead.
-   */
-  gtk_widget_class_install_style_property (klass,
-                                          g_param_spec_int ("focus-line-width",
-                                                            P_("Focus linewidth"),
-                                                            P_("Width, in pixels, of the focus indicator 
line"),
-                                                            0, G_MAXINT, 1,
-                                                            GTK_PARAM_READABLE | G_PARAM_DEPRECATED));
-  /**
-   * GtkWidget:focus-line-pattern:
-   *
-   * The "focus-line-pattern" style property defines the dash pattern used to
-   * draw the focus indicator. The character values are interpreted as pixel
-   * widths of alternating on and off segments of the line.
-   *
-   * Deprecated: 3.14: use the outline-style CSS property instead.
-   */
-  gtk_widget_class_install_style_property (klass,
-                                          g_param_spec_string ("focus-line-pattern",
-                                                               P_("Focus line dash pattern"),
-                                                               P_("Dash pattern used to draw the focus 
indicator. The character values are interpreted as pixel widths of alternating on and off segments of the 
line."),
-                                                               "\1\1",
-                                                               GTK_PARAM_READABLE | G_PARAM_DEPRECATED));
-  /**
-   * GtkWidget:focus-padding:
-   *
-   * The "focus-padding" style property defines the width, in pixels,
-   * between focus indicator and the widget 'box'.
-   *
-   * Deprecated: 3.14: use the outline-offset CSS properties instead.
-   */
-  gtk_widget_class_install_style_property (klass,
-                                          g_param_spec_int ("focus-padding",
-                                                            P_("Focus padding"),
-                                                            P_("Width, in pixels, between focus indicator 
and the widget 'box'"),
-                                                            0, G_MAXINT, 1,
-                                                            GTK_PARAM_READABLE | G_PARAM_DEPRECATED));
-G_GNUC_BEGIN_IGNORE_DEPRECATIONS
-  /**
-   * GtkWidget:cursor-color:
-   *
-   * The color with which to draw the insertion cursor in entries and
-   * text views.
-   *
-   * Deprecated: 3.20: Use the caret-color CSS property
-   */
-  gtk_widget_class_install_style_property (klass,
-                                          g_param_spec_boxed ("cursor-color",
-                                                              P_("Cursor color"),
-                                                              P_("Color with which to draw insertion 
cursor"),
-                                                              GDK_TYPE_COLOR,
-                                                              GTK_PARAM_READABLE|G_PARAM_DEPRECATED));
-  /**
-   * GtkWidget:secondary-cursor-color:
-   *
-   * The color with which to draw the secondary insertion cursor in entries and
-   * text views when editing mixed right-to-left and left-to-right text.
-   *
-   * Deprecated: 3.20: Use the -gtk-secondary-caret-color CSS property
-   */
-  gtk_widget_class_install_style_property (klass,
-                                          g_param_spec_boxed ("secondary-cursor-color",
-                                                              P_("Secondary cursor color"),
-                                                              P_("Color with which to draw the secondary 
insertion cursor when editing mixed right-to-left and left-to-right text"),
-                                                              GDK_TYPE_COLOR,
-                                                              GTK_PARAM_READABLE|G_PARAM_DEPRECATED));
-G_GNUC_END_IGNORE_DEPRECATIONS
   gtk_widget_class_install_style_property (klass,
                                           g_param_spec_float ("cursor-aspect-ratio",
                                                               P_("Cursor line aspect ratio"),
@@ -3467,95 +3380,6 @@ G_GNUC_END_IGNORE_DEPRECATIONS
                                                                  FALSE,
                                                                  GTK_PARAM_READABLE));
 
-G_GNUC_BEGIN_IGNORE_DEPRECATIONS
-  /**
-   * GtkWidget:link-color:
-   *
-   * The "link-color" style property defines the color of unvisited links.
-   *
-   * Since: 2.10
-   *
-   * Deprecated: 3.12: Links now use a separate state flags for selecting
-   *     different theming, this style property is ignored
-   */
-  gtk_widget_class_install_style_property (klass,
-                                          g_param_spec_boxed ("link-color",
-                                                              P_("Unvisited Link Color"),
-                                                              P_("Color of unvisited links"),
-                                                              GDK_TYPE_COLOR,
-                                                              GTK_PARAM_READABLE|G_PARAM_DEPRECATED));
-
-  /**
-   * GtkWidget:visited-link-color:
-   *
-   * The "visited-link-color" style property defines the color of visited links.
-   *
-   * Since: 2.10
-   *
-   * Deprecated: 3.12: Links now use a separate state flags for selecting
-   *     different theming, this style property is ignored
-   */
-  gtk_widget_class_install_style_property (klass,
-                                          g_param_spec_boxed ("visited-link-color",
-                                                              P_("Visited Link Color"),
-                                                              P_("Color of visited links"),
-                                                              GDK_TYPE_COLOR,
-                                                              GTK_PARAM_READABLE|G_PARAM_DEPRECATED));
-G_GNUC_END_IGNORE_DEPRECATIONS
-
-  /**
-   * GtkWidget:wide-separators:
-   *
-   * The "wide-separators" style property defines whether separators have
-   * configurable width and should be drawn using a box instead of a line.
-   *
-   * Since: 2.10
-   *
-   * Deprecated: 3.20: Use CSS properties on the separator elements to style
-   *   separators; the value of this style property is ignored.
-   */
-  gtk_widget_class_install_style_property (klass,
-                                           g_param_spec_boolean ("wide-separators",
-                                                                 P_("Wide Separators"),
-                                                                 P_("Whether separators have configurable 
width and should be drawn using a box instead of a line"),
-                                                                 FALSE,
-                                                                 GTK_PARAM_READABLE|G_PARAM_DEPRECATED));
-
-  /**
-   * GtkWidget:separator-width:
-   *
-   * The "separator-width" style property defines the width of separators.
-   * This property only takes effect if the "wide-separators" style property is %TRUE.
-   *
-   * Since: 2.10
-   *
-   * Deprecated: 3.20: Use the standard min-width CSS property on the separator
-   *   elements to size separators; the value of this style property is ignored.
-   */
-  gtk_widget_class_install_style_property (klass,
-                                           g_param_spec_int ("separator-width",
-                                                             P_("Separator Width"),
-                                                             P_("The width of separators if wide-separators 
is TRUE"),
-                                                             0, G_MAXINT, 0,
-                                                             GTK_PARAM_READABLE|G_PARAM_DEPRECATED));
-
-  /**
-   * GtkWidget:separator-height:
-   *
-   * The "separator-height" style property defines the height of separators.
-   * This property only takes effect if the "wide-separators" style property is %TRUE.
-   *
-   * Since: 2.10
-   *
-   * Deprecated: 3.20: Use the standard min-height CSS property on the separator
-   *   elements to size separators; the value of this style property is ignored.
-   */
-  gtk_widget_class_install_style_property (klass,
-                                           g_param_spec_int ("separator-height",
-                                                             P_("Separator Height"),
-                                                             P_("The height of separators if 
\"wide-separators\" is TRUE"),
-                                                             0, G_MAXINT, 0,
-                                                             GTK_PARAM_READABLE|G_PARAM_DEPRECATED));
 
   /**
    * GtkWidget:scroll-arrow-hlength:
@@ -9689,50 +9513,6 @@ gtk_widget_override_symbolic_color (GtkWidget     *widget,
   _gtk_modifier_style_map_color (style, name, color);
 }
 
-/**
- * gtk_widget_override_cursor:
- * @widget: a #GtkWidget
- * @cursor: (allow-none): the color to use for primary cursor (does not need to be
- *     allocated), or %NULL to undo the effect of previous calls to
- *     of gtk_widget_override_cursor().
- * @secondary_cursor: (allow-none): the color to use for secondary cursor (does not
- *     need to be allocated), or %NULL to undo the effect of previous
- *     calls to of gtk_widget_override_cursor().
- *
- * Sets the cursor color to use in a widget, overriding the
- * cursor-color and secondary-cursor-color
- * style properties. All other style values are left untouched.
- * See also gtk_widget_modify_style().
- *
- * Note that the underlying properties have the #GdkColor type,
- * so the alpha value in @primary and @secondary will be ignored.
- *
- * Since: 3.0
- *
- * Deprecated: 3.16: This function is not useful in the context of CSS-based
- *   rendering. If you wish to change the color used to render the primary
- *   and secondary cursors you should use a custom CSS style, through an
- *   application-specific #GtkStyleProvider and a CSS style class.
- */
-void
-gtk_widget_override_cursor (GtkWidget     *widget,
-                            const GdkRGBA *cursor,
-                            const GdkRGBA *secondary_cursor)
-{
-  GtkModifierStyle *style;
-
-  g_return_if_fail (GTK_IS_WIDGET (widget));
-
-  style = _gtk_widget_get_modifier_properties (widget);
-  _gtk_modifier_style_set_color_property (style,
-                                          GTK_TYPE_WIDGET,
-                                          "cursor-color", cursor);
-  _gtk_modifier_style_set_color_property (style,
-                                          GTK_TYPE_WIDGET,
-                                          "secondary-cursor-color",
-                                          secondary_cursor);
-}
-
 static void
 gtk_widget_real_direction_changed (GtkWidget        *widget,
                                    GtkTextDirection  previous_direction)
diff --git a/gtk/gtkwidget.h b/gtk/gtkwidget.h
index 8d546cc..4a8e04e 100644
--- a/gtk/gtkwidget.h
+++ b/gtk/gtkwidget.h
@@ -1148,10 +1148,6 @@ GDK_DEPRECATED_IN_3_16
 void         gtk_widget_override_symbolic_color   (GtkWidget     *widget,
                                                    const gchar   *name,
                                                    const GdkRGBA *color);
-GDK_DEPRECATED_IN_3_16
-void         gtk_widget_override_cursor           (GtkWidget       *widget,
-                                                   const GdkRGBA   *cursor,
-                                                   const GdkRGBA   *secondary_cursor);
 
 GDK_AVAILABLE_IN_ALL
 void       gtk_widget_reset_style       (GtkWidget      *widget);
diff --git a/testsuite/gtk/cssprovider.c b/testsuite/gtk/cssprovider.c
index 413c750..8510784 100644
--- a/testsuite/gtk/cssprovider.c
+++ b/testsuite/gtk/cssprovider.c
@@ -33,10 +33,10 @@ test_section_in_style_property (void)
   provider = gtk_css_provider_new ();
   g_signal_connect (provider, "parsing-error",
                     G_CALLBACK (assert_section_is_not_null), NULL);
-  gtk_css_provider_load_from_data (provider, "* { -GtkWidget-interior-focus: random garbage goes here; }", 
-1, NULL);
+  gtk_css_provider_load_from_data (provider, "* { -GtkWidget-window-dragging: random garbage goes here; }", 
-1, NULL);
 
   widget_class = g_type_class_ref (GTK_TYPE_WIDGET);
-  pspec = gtk_widget_class_find_style_property (widget_class, "interior-focus");
+  pspec = gtk_widget_class_find_style_property (widget_class, "window-dragging");
   g_assert (pspec);
   path = gtk_widget_path_new ();
   gtk_widget_path_append_type (path, GTK_TYPE_WIDGET);
diff --git a/testsuite/gtk/treeview.c b/testsuite/gtk/treeview.c
index 0f301d8..b439dc3 100644
--- a/testsuite/gtk/treeview.c
+++ b/testsuite/gtk/treeview.c
@@ -177,8 +177,7 @@ test_row_separator_height_func (GtkTreeModel *model,
 static void
 test_row_separator_height (void)
 {
-  int focus_pad, separator_height, height;
-  gboolean wide_separators;
+  int height;
   GtkTreeIter iter;
   GtkTreePath *path;
   GtkListStore *store;
@@ -220,16 +219,7 @@ test_row_separator_height (void)
                                path, NULL, &cell_rect);
   gtk_tree_path_free (path);
 
-  gtk_widget_style_get (tree_view,
-                        "focus-padding", &focus_pad,
-                        "wide-separators", &wide_separators,
-                        "separator-height", &separator_height,
-                        NULL);
-
-  if (wide_separators)
-    height = separator_height;
-  else
-    height = 2;
+  height = 2;
 
   g_assert_cmpint (rect.height, ==, height);
   g_assert_cmpint (cell_rect.height, ==, height);


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