[gtkmm] Gtk::StyleContext, Widget, Window: Deprecate API which is deprecated in GTK+



commit ca3ea18360128efb2f969b16b81e7fb1852a50b8
Author: Kjell Ahlstedt <kjell ahlstedt bredband net>
Date:   Fri Feb 6 18:42:57 2015 +0100

    Gtk::StyleContext, Widget, Window: Deprecate API which is deprecated in GTK+
    
    * gtk/src/stylecontext.[ccg|hg]: Deprecate list_regions(), add_region(),
    remove_region(), has_region(), get_backgrount_color(), get_border_color(),
    invalidate().
    * gtk/src/widget.[ccg|hg]: Deprecate override_color(), unset_color(),
    override_background_color(), unset_background_color(), override_font(),
    unset_font(), override_symbolic_color(), unset_symbolic_color(),
    override_cursor(), unset_cursor().
    * gtk/src/window.hg: Deprecate property_has_resize_grip(),
    property_resize_grip_visible(), set/get_has_resize_grip(),
    get_resize_grip_is_visible(), get_resize_grip_area().

 gtk/src/stylecontext.ccg |    2 ++
 gtk/src/stylecontext.hg  |   29 ++++++++++++++++++++---------
 gtk/src/widget.ccg       |    2 ++
 gtk/src/widget.hg        |   30 +++++++++++++++++++++++++-----
 gtk/src/window.hg        |   12 ++++++------
 5 files changed, 55 insertions(+), 20 deletions(-)
---
diff --git a/gtk/src/stylecontext.ccg b/gtk/src/stylecontext.ccg
index 6bac053..8c60242 100644
--- a/gtk/src/stylecontext.ccg
+++ b/gtk/src/stylecontext.ccg
@@ -30,6 +30,7 @@ Gdk::RGBA StyleContext::get_color(StateFlags state) const
   return Gdk::RGBA(&crgba, true);
 }
 
+_DEPRECATE_IFDEF_START
 Gdk::RGBA StyleContext::get_background_color(StateFlags state) const
 {
   GdkRGBA crgba;
@@ -43,6 +44,7 @@ Gdk::RGBA StyleContext::get_border_color(StateFlags state) const
   gtk_style_context_get_border_color(const_cast<GtkStyleContext*>(gobj()), ((GtkStateFlags)(state)), &crgba);
   return Gdk::RGBA(&crgba, true);
 }
+_DEPRECATE_IFDEF_END
 
 Pango::FontDescription StyleContext::get_font(StateFlags state) const
 {
diff --git a/gtk/src/stylecontext.hg b/gtk/src/stylecontext.hg
index d570b06..94afeb0 100644
--- a/gtk/src/stylecontext.hg
+++ b/gtk/src/stylecontext.hg
@@ -161,11 +161,10 @@ public:
   _WRAP_METHOD(void remove_class(const Glib::ustring& class_name), gtk_style_context_remove_class)
   _WRAP_METHOD(bool has_class(const Glib::ustring& class_name), gtk_style_context_has_class)
 
-  _WRAP_METHOD(GList* list_regions (), gtk_style_context_list_regions)
-
-  _WRAP_METHOD(void add_region(const Glib::ustring& region_name, RegionFlags flags), 
gtk_style_context_add_region)
-  _WRAP_METHOD(void remove_region(const Glib::ustring& region_name), gtk_style_context_remove_region)
-  _WRAP_METHOD(bool has_region(const Glib::ustring& region_name, RegionFlags& flags_return), 
gtk_style_context_has_region)
+  _WRAP_METHOD(GList* list_regions(), gtk_style_context_list_regions, deprecated "There is no replacement.")
+  _WRAP_METHOD(void add_region(const Glib::ustring& region_name, RegionFlags flags), 
gtk_style_context_add_region, deprecated "There is no replacement.")
+  _WRAP_METHOD(void remove_region(const Glib::ustring& region_name), gtk_style_context_remove_region, 
deprecated "There is no replacement.")
+  _WRAP_METHOD(bool has_region(const Glib::ustring& region_name, RegionFlags& flags_return), 
gtk_style_context_has_region, deprecated "There is no replacement.")
 
   /** Gets the value of a style property
    * @param property_name The name of a style property.
@@ -204,20 +203,32 @@ public:
   _WRAP_METHOD(void push_animatable_region(gpointer region_id), gtk_style_context_push_animatable_region, 
deprecated "This function does nothing.")
   _WRAP_METHOD(void pop_animatable_region(), gtk_style_context_pop_animatable_region, deprecated "This 
function does nothing.")
 
-  //TODO: Documentation
+  /** Gets the foreground color for a given state.
+   *
+   * @newin{3,0}
+   *
+   * @param state State to retrieve the color for.
+   * @return The foreground color for the given state.
+   */
   Gdk::RGBA get_color(StateFlags state = (StateFlags)0) const;
   _IGNORE(gtk_style_context_get_color)
 
+_DEPRECATE_IFDEF_START
+  /** @deprecated Use render_background() instead.
+   */
   Gdk::RGBA get_background_color(StateFlags state = (StateFlags)0) const;
   _IGNORE(gtk_style_context_get_background_color)
 
+  /** @deprecated Use render_frame() instead.
+   */
   Gdk::RGBA  get_border_color(StateFlags state = (StateFlags)0) const;
   _IGNORE(gtk_style_context_get_border_color)
+_DEPRECATE_IFDEF_END
 
   /** Returns the font description for a given state.
-   * 
+   *
    * @newin{3,0}
-   * 
+   *
    * @param state State to retrieve the font for.
    * @return The Pango::FontDescription for the given state.
    */
@@ -233,7 +244,7 @@ public:
   Border get_margin (StateFlags state = (StateFlags)0) const;
   _IGNORE(gtk_style_context_get_margin)
 
-  _WRAP_METHOD(void invalidate(), gtk_style_context_invalidate)
+  _WRAP_METHOD(void invalidate(), gtk_style_context_invalidate, deprecated "Style contexts are invalidated 
automatically.")
   //TODO: _WRAP_METHOD(void reset_widgets(const Glib::RefPtr<Gdk::Screen>& screen), 
gtk_style_context_reset_widgets)
 
   _WRAP_METHOD(void set_background(const Glib::RefPtr<Gdk::Window>& window), 
gtk_style_context_set_background)
diff --git a/gtk/src/widget.ccg b/gtk/src/widget.ccg
index 61510c1..765e12f 100644
--- a/gtk/src/widget.ccg
+++ b/gtk/src/widget.ccg
@@ -711,6 +711,7 @@ Requisition Widget::get_requisition() const
 }
 #endif // GTKMM_DISABLE_DEPRECATED
 
+_DEPRECATE_IFDEF_START
 void Widget::unset_color(StateFlags state)
 {
    gtk_widget_override_color(gobj(), ((GtkStateFlags)(state)), 0);
@@ -735,6 +736,7 @@ void Widget::unset_cursor()
 {
   gtk_widget_override_cursor(gobj(), 0, 0);
 }
+_DEPRECATE_IFDEF_END
 
 void Widget::transform_cairo_context_to_window(const Cairo::RefPtr<Cairo::Context>& cr, const 
Glib::RefPtr<const Gdk::Window>& window)
 {
diff --git a/gtk/src/widget.hg b/gtk/src/widget.hg
index 3dbc95b..bb10594 100644
--- a/gtk/src/widget.hg
+++ b/gtk/src/widget.hg
@@ -409,51 +409,71 @@ public:
     gtk_widget_modify_style, gtk_widget_get_modifier_style,
     gtk_widget_reset_rc_styles) //deprecated broadly in favour of StyleContext.;
 
-  _WRAP_METHOD(void override_color(const Gdk::RGBA& color{.}, StateFlags state{.} = STATE_FLAG_NORMAL), 
gtk_widget_override_color)
+  _WRAP_METHOD(void override_color(const Gdk::RGBA& color{.}, StateFlags state{.} = STATE_FLAG_NORMAL), 
gtk_widget_override_color,
+               deprecated "Use a custom style provider and style classes instead.")
 
+_DEPRECATE_IFDEF_START
   /** Undoes the effect of previous calls to override_color().
    *
    * @newin{3,0}
+   * @deprecated Use a custom style provider and style classes instead.
    *
    * @param state The state for which to use the color of the user's theme.
    */
   void unset_color(StateFlags state = STATE_FLAG_NORMAL);
+_DEPRECATE_IFDEF_END
 
-  _WRAP_METHOD(void override_background_color(const Gdk::RGBA& color{.}, StateFlags state{.} = 
STATE_FLAG_NORMAL), gtk_widget_override_background_color)
+  _WRAP_METHOD(void override_background_color(const Gdk::RGBA& color{.}, StateFlags state{.} = 
STATE_FLAG_NORMAL), gtk_widget_override_background_color,
+               deprecated "Use a custom style provider and style classes instead.")
 
+_DEPRECATE_IFDEF_START
   /** Undoes the effect of previous calls to override_background_color().
    *
    * @newin{3,0}
+   * @deprecated Use a custom style provider and style classes instead.
    *
    * @param state The state for which to use the background color of the user's theme.
    */
   void unset_background_color(StateFlags state = STATE_FLAG_NORMAL);
+_DEPRECATE_IFDEF_END
 
-  _WRAP_METHOD(void override_font(const Pango::FontDescription& font_desc), gtk_widget_override_font)
+  _WRAP_METHOD(void override_font(const Pango::FontDescription& font_desc), gtk_widget_override_font,
+               deprecated "Use a custom style provider and style classes instead.")
 
+_DEPRECATE_IFDEF_START
   /** Undoes the effect of previous calls to override_font().
    *
    * @newin{3,0}
+   * @deprecated Use a custom style provider and style classes instead.
    */
   void unset_font();
+_DEPRECATE_IFDEF_END
 
-  _WRAP_METHOD(void override_symbolic_color(const Glib::ustring& name, const Gdk::RGBA& color), 
gtk_widget_override_symbolic_color)
+  _WRAP_METHOD(void override_symbolic_color(const Glib::ustring& name, const Gdk::RGBA& color), 
gtk_widget_override_symbolic_color,
+               deprecated "Use a custom style provider and style classes instead.")
 
+_DEPRECATE_IFDEF_START
   /** Undoes the effect of previous calls to override_symbolic_color().
    *
    * @newin{3,0}
+   * @deprecated Use a custom style provider and style classes instead.
    *
    * @param name The name of the symbolic color to fetch from the user's theme.
    */
   void unset_symbolic_color(const Glib::ustring& name);
+_DEPRECATE_IFDEF_END
 
-  _WRAP_METHOD(void override_cursor(const Gdk::RGBA& cursor, const Gdk::RGBA& secondary_cursor), 
gtk_widget_override_cursor)
+  _WRAP_METHOD(void override_cursor(const Gdk::RGBA& cursor, const Gdk::RGBA& secondary_cursor), 
gtk_widget_override_cursor,
+               deprecated "Use a custom style provider and style classes instead.")
 
+_DEPRECATE_IFDEF_START
   /** Undoes the effect of previous calls to override_cursor().
    *
    * @newin{3,0}
+   * @deprecated Use a custom style provider and style classes instead.
    */
   void unset_cursor();
+_DEPRECATE_IFDEF_END
 
   _IGNORE(gtk_widget_modify_fg, gtk_widget_modify_bg, gtk_widget_modify_font, gtk_widget_modify_text,
      gtk_widget_modify_base, gtk_widget_modify_cursor) //deprecated
diff --git a/gtk/src/window.hg b/gtk/src/window.hg
index ac329a8..8c25be0 100644
--- a/gtk/src/window.hg
+++ b/gtk/src/window.hg
@@ -109,8 +109,8 @@ public:
 #endif //#GLIBMM_PROPERTIES_ENABLED
 #endif // GTKMM_DISABLE_DEPRECATED
 
-  _WRAP_PROPERTY("has-resize-grip", bool)
-  _WRAP_PROPERTY("resize-grip-visible", bool)
+  _WRAP_PROPERTY("has-resize-grip", bool, deprecated "Resize grips have been removed.")
+  _WRAP_PROPERTY("resize-grip-visible", bool, deprecated "Resize grips have been removed.")
   _WRAP_PROPERTY("urgency_hint", bool)
   _WRAP_PROPERTY("accept-focus", bool)
   _WRAP_PROPERTY("focus-on-map", bool)
@@ -389,11 +389,11 @@ dnl
    */
   void unset_application();
 
-  _WRAP_METHOD(void set_has_resize_grip(bool value = true), gtk_window_set_has_resize_grip)
-  _WRAP_METHOD(bool get_has_resize_grip() const, gtk_window_get_has_resize_grip)
+  _WRAP_METHOD(void set_has_resize_grip(bool value = true), gtk_window_set_has_resize_grip, deprecated 
"Resize grips have been removed.")
+  _WRAP_METHOD(bool get_has_resize_grip() const, gtk_window_get_has_resize_grip, deprecated "Resize grips 
have been removed.")
 
-  _WRAP_METHOD(bool get_resize_grip_is_visible() const, gtk_window_resize_grip_is_visible)
-  _WRAP_METHOD(bool get_resize_grip_area(Gdk::Rectangle& rect) const, gtk_window_get_resize_grip_area)
+  _WRAP_METHOD(bool get_resize_grip_is_visible() const, gtk_window_resize_grip_is_visible, deprecated 
"Resize grips have been removed.")
+  _WRAP_METHOD(bool get_resize_grip_area(Gdk::Rectangle& rect) const, gtk_window_get_resize_grip_area, 
deprecated "Resize grips have been removed.")
 
   _WRAP_METHOD(void set_keep_above(bool setting = true), gtk_window_set_keep_above)
   _WRAP_METHOD(void set_keep_below(bool setting = true), gtk_window_set_keep_below)


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