[gtkmm] Fix build with --disable-deprecated-api.



commit f9c8fde938e74b4a07e0b3fb31aed93722183458
Author: Kjell Ahlstedt <kjell ahlstedt bredband net>
Date:   Sun Jul 7 19:08:13 2013 +0200

    Fix build with --disable-deprecated-api.
    
    * gtk/gtkmm/wrap_init.h: Define GDK_DISABLE_DEPRECATION_WARNINGS
    unconditionally.
    * gtk/src/application.hg: Make gmmproc add  "typedef struct _GtkWindow
    GtkWindow;" early in application.cc.
    * gtk/src/colorbutton.[hg|ccg]: Make deprecated constructors deprecated also
    in colorbutton.cc.
    * gtk/src/menubutton.hg: Deprecate unset_menu() instead of unset_popup().
    * gtk/src/filelist.am: Move table.hg to gtkmm_files_deprecated_hg.

 gtk/gtkmm/wrap_init.h   |    2 --
 gtk/src/application.hg  |    5 +++++
 gtk/src/colorbutton.ccg |   10 ++++++++++
 gtk/src/colorbutton.hg  |    5 ++++-
 gtk/src/filelist.am     |    2 +-
 gtk/src/menubutton.hg   |    4 ++--
 6 files changed, 22 insertions(+), 6 deletions(-)
---
diff --git a/gtk/gtkmm/wrap_init.h b/gtk/gtkmm/wrap_init.h
index 92a125c..a2f66c7 100644
--- a/gtk/gtkmm/wrap_init.h
+++ b/gtk/gtkmm/wrap_init.h
@@ -29,9 +29,7 @@ namespace Gtk
 // putting it here requires a change in generate_wrap_init.pl.
 // It's required because some gtk_*_get_type() functions are deprecated, but
 // their .h files have not been moved to the gtk+/gtk/deprecated directory.
-#ifndef GTKMM_DISABLE_DEPRECATED
 #define GDK_DISABLE_DEPRECATION_WARNINGS 1
-#endif
 
 void wrap_init();
 
diff --git a/gtk/src/application.hg b/gtk/src/application.hg
index f15d2de..aad46dd 100644
--- a/gtk/src/application.hg
+++ b/gtk/src/application.hg
@@ -27,6 +27,11 @@ _CONFIGINCLUDE(gtkmmconfig.h)
 _DEFS(gtkmm,gtk)
 _PINCLUDE(giomm/private/application_p.h)
 
+#m4 _PUSH(SECTION_CC_PRE_INCLUDES)
+// Needed before gtkmm/private/application_p.h is included.
+typedef struct _GtkWindow GtkWindow;
+#m4 _POP()
+
 namespace Gtk
 {
 
diff --git a/gtk/src/colorbutton.ccg b/gtk/src/colorbutton.ccg
index 8ab58b7..4257685 100644
--- a/gtk/src/colorbutton.ccg
+++ b/gtk/src/colorbutton.ccg
@@ -23,6 +23,16 @@ namespace Gtk
 {
 
 #ifndef GTKMM_DISABLE_DEPRECATED
+ColorButton::ColorButton(const Gdk::Color& color)
+:
+  // Mark this class as non-derived to allow C++ vfuncs to be skipped.
+  Glib::ObjectBase(0),
+  Gtk::Button(Glib::ConstructParams(colorbutton_class_.init(), "color", (color).gobj(), 
static_cast<char*>(0)))
+{
+}
+#endif //GTKMM_DISABLE_DEPRECATED
+
+#ifndef GTKMM_DISABLE_DEPRECATED
 
 Gdk::Color ColorButton::get_color() const
 {
diff --git a/gtk/src/colorbutton.hg b/gtk/src/colorbutton.hg
index f2117da..62ea334 100644
--- a/gtk/src/colorbutton.hg
+++ b/gtk/src/colorbutton.hg
@@ -62,6 +62,8 @@ public:
   _CTOR_DEFAULT()
   _IGNORE(gtk_color_button_new)
 
+  // _WRAP_CTOR does not take a 'deprecated' parameter.
+  // _WRAP_CTOR(ColorButton(const Gdk::Color& color), gtk_color_button_new_with_color)
 #ifndef GTKMM_DISABLE_DEPRECATED
   /** Creates a new color button with a predefined color.
    *
@@ -74,7 +76,8 @@ public:
    * @newin{2,4}
    * @deprecated "Use the constructor that takes a Gdk::RGBA instead."
    */
-  _WRAP_CTOR(ColorButton(const Gdk::Color& color), gtk_color_button_new_with_color)
+   explicit ColorButton(const Gdk::Color& color);
+   _IGNORE(gtk_color_button_new_with_color)
 #endif //GTKMM_DISABLE_DEPRECATED
 
   /** Creates a new color button with a predefined color.
diff --git a/gtk/src/filelist.am b/gtk/src/filelist.am
index f90e120..81a6e93 100644
--- a/gtk/src/filelist.am
+++ b/gtk/src/filelist.am
@@ -147,7 +147,6 @@ gtkmm_files_any_hg =                \
        stylecontext.hg         \
        styleprovider.hg        \
        switch.hg               \
-       table.hg                \
        targetlist.hg           \
        textattributes.hg       \
        textbuffer.hg           \
@@ -212,6 +211,7 @@ gtkmm_files_deprecated_hg = \
        radioaction.hg          \
        recentaction.hg         \
        stockitem.hg            \
+       table.hg                \
        tearoffmenuitem.hg      \
        toggleaction.hg         \
        uimanager.hg
diff --git a/gtk/src/menubutton.hg b/gtk/src/menubutton.hg
index 395145b..8bde0ce 100644
--- a/gtk/src/menubutton.hg
+++ b/gtk/src/menubutton.hg
@@ -46,11 +46,13 @@ public:
   _WRAP_METHOD(void set_menu(Menu& popup), gtk_menu_button_set_popup, deprecated "Use set_popup() instead.")
   _IGNORE(gtk_menu_button_set_menu)
 
+_DEPRECATE_IFDEF_START
   /** Disables the button.
    *
    * @deprecated Use unset_popup() instead.
    */
   void unset_menu();
+_DEPRECATE_IFDEF_END
 
   _WRAP_METHOD(Menu* get_menu(), gtk_menu_button_get_popup, deprecated "Use get_popup() instead.")
   _WRAP_METHOD(const Menu* get_menu() const, gtk_menu_button_get_popup, constversion, deprecated "Use 
get_popup() instead.")
@@ -58,11 +60,9 @@ public:
 
   _WRAP_METHOD(void set_popup(Menu& popup), gtk_menu_button_set_popup)
 
-_DEPRECATE_IFDEF_START
   /** Disables the button.
    */
   void unset_popup();
-_DEPRECATE_IFDEF_END
 
   _WRAP_METHOD(Menu* get_popup(), gtk_menu_button_get_popup)
   _WRAP_METHOD(const Menu* get_popup() const, gtk_menu_button_get_popup, constversion)


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