[gtksourceviewmm] CompletionItem: Fix the build with --enable-warnings=fatal.



commit 9dba65c4fc8d15e72719f8e26d70f8bdcd06bfb1
Author: Murray Cumming <murrayc murrayc com>
Date:   Sat Jul 11 21:53:35 2015 +0200

    CompletionItem: Fix the build with --enable-warnings=fatal.
    
    Our (now deprecated) API uses the deprecated Gtk::StockID.

 gtksourceview/src/completionitem.ccg |    4 ++++
 gtksourceview/src/completionitem.hg  |   14 ++++++++++++++
 2 files changed, 18 insertions(+), 0 deletions(-)
---
diff --git a/gtksourceview/src/completionitem.ccg b/gtksourceview/src/completionitem.ccg
index 28552e2..c55a985 100644
--- a/gtksourceview/src/completionitem.ccg
+++ b/gtksourceview/src/completionitem.ccg
@@ -18,6 +18,8 @@
  */
 
 #include <gtksourceview/gtksourcecompletionitem.h>
+#include <gtkmm/stock.h>
+#include <gtk/gtk.h>
 
 namespace Gsv
 {
@@ -30,6 +32,7 @@ CompletionItem::CompletionItem(const Markup& markup, const Glib::ustring& text,
   _CONSTRUCT("markup", markup.get_c_str(), "text", text.c_str(), "icon", Glib::unwrap(icon), "info", 
(info.empty() ? 0 : info.c_str()))
 {}
 
+G_GNUC_BEGIN_IGNORE_DEPRECATIONS
 CompletionItem::CompletionItem(const Glib::ustring& label, const Glib::ustring& text, const Gtk::StockID& 
stock, const Glib::ustring& info) :
   _CONSTRUCT("text", text.c_str(), "info", (info.empty() ? 0 : info.c_str()))
 {
@@ -66,5 +69,6 @@ CompletionItem::CompletionItem(const Glib::ustring& label, const Glib::ustring&
     g_object_unref(icon);
   }
 }
+G_GNUC_END_IGNORE_DEPRECATIONS
 
 } // namespace Gsv
diff --git a/gtksourceview/src/completionitem.hg b/gtksourceview/src/completionitem.hg
index dcc65a6..832ae94 100644
--- a/gtksourceview/src/completionitem.hg
+++ b/gtksourceview/src/completionitem.hg
@@ -25,6 +25,20 @@
 _DEFS(gtksourceviewmm,gtksourceview)
 _PINCLUDE(glibmm/private/object_p.h)
 
+#m4 _PUSH(SECTION_CC_PRE_INCLUDES)
+//Avoid warnings when we use deprecated gtkmm API in our deprecated wrappers:
+#include <glibmm.h>
+#undef GTKMM_DISABLE_DEPRECATED
+#undef GTK_DISABLE_DEPRECATED
+#define GTK_DISABLE_DEPRECATION_WARNINGS 1
+#m4 _POP()
+
+#ifndef DOXYGEN_SHOULD_SKIP_THIS
+namespace Gtk {
+  //deprecated
+  class StockID;
+} //namespace Gtk
+#endif //#ifndef DOXYGEN_SHOULD_SKIP_THIS
 
 namespace Gsv
 {


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