[libchamplainmm] champlainmm-gtk: Split GtkChamplain namespace



commit 7c22ebcb442b639969fcd1e447c2c7411dbeb3ee
Author: Juan R. GarcĂ­a Blanco <juanrgar gmail com>
Date:   Sat Aug 2 13:38:50 2014 +0200

    champlainmm-gtk: Split GtkChamplain namespace

 champlain-gtk/champlainmm-gtk/init.cc     |    7 +++++--
 champlain-gtk/champlainmm-gtk/init.h      |    7 +++++--
 champlain-gtk/champlainmm-gtk/wrap_init.h |    6 +++++-
 champlain-gtk/src/Makefile.am             |    2 +-
 champlain-gtk/src/embed.ccg               |    4 ++++
 champlain-gtk/src/embed.hg                |   14 +++++++++-----
 demos/Makefile.am                         |    2 +-
 demos/embed-demo.cc                       |    4 ++--
 8 files changed, 32 insertions(+), 14 deletions(-)
---
diff --git a/champlain-gtk/champlainmm-gtk/init.cc b/champlain-gtk/champlainmm-gtk/init.cc
index bd5c7db..6b58c84 100644
--- a/champlain-gtk/champlainmm-gtk/init.cc
+++ b/champlain-gtk/champlainmm-gtk/init.cc
@@ -21,7 +21,9 @@
 #include <glibmm/init.h>
 #include <champlainmm/init.h>
 
-namespace GtkChamplain
+namespace Champlain
+{
+namespace Gtk
 {
 
 void init(int *argc, char **argv[])
@@ -38,4 +40,5 @@ void init(int *argc, char **argv[])
   }
 }
 
-} // namespace GtkChamplain
+} // namespace Gtk
+} // namespace Champlain
diff --git a/champlain-gtk/champlainmm-gtk/init.h b/champlain-gtk/champlainmm-gtk/init.h
index 01266cc..f33624c 100644
--- a/champlain-gtk/champlainmm-gtk/init.h
+++ b/champlain-gtk/champlainmm-gtk/init.h
@@ -19,13 +19,16 @@
 #ifndef _CHAMPLAINMM_GTK_INIT_H
 #define _CHAMPLAINMM_GTK_INIT_H
 
-namespace GtkChamplain
+namespace Champlain
+{
+namespace Gtk
 {
 
 /** Initialize champlainmm.
  */
 void init(int *argc, char **argv[]);
 
-} // namespace GtkChamplain
+} // namespace Gtk
+} // namespace Champlain
 
 #endif /* _CHAMPLAINMM_GTK_INIT_H */
diff --git a/champlain-gtk/champlainmm-gtk/wrap_init.h b/champlain-gtk/champlainmm-gtk/wrap_init.h
index 694498f..57ebfdf 100644
--- a/champlain-gtk/champlainmm-gtk/wrap_init.h
+++ b/champlain-gtk/champlainmm-gtk/wrap_init.h
@@ -19,6 +19,10 @@
 #ifndef LIBCHAMPLAINMMGTK_WRAP_INIT_H_INCLUDED
 #define LIBCHAMPLAINMMGTK_WRAP_INIT_H_INCLUDED
 
-namespace GtkChamplain { void wrap_init(); }
+namespace Champlain {
+namespace Gtk {
+void wrap_init();
+} // namespace Gtk
+} // namespace Champlain
 
 #endif /* !LIBCHAMPLAINMMGTK_WRAP_INIT_H_INCLUDED */
diff --git a/champlain-gtk/src/Makefile.am b/champlain-gtk/src/Makefile.am
index abd631f..812da67 100644
--- a/champlain-gtk/src/Makefile.am
+++ b/champlain-gtk/src/Makefile.am
@@ -16,7 +16,7 @@
 ## along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 binding_name    = champlainmm-gtk
-wrap_init_flags = --namespace=GtkChamplain --parent_dir=champlainmm-gtk
+wrap_init_flags = --namespace=Champlain --namespace=Gtk --parent_dir=champlainmm-gtk
 codegen_srcdir  = $(top_srcdir)/tools
 
 include $(srcdir)/filelist.am
diff --git a/champlain-gtk/src/embed.ccg b/champlain-gtk/src/embed.ccg
index 07bb35d..99e67de 100644
--- a/champlain-gtk/src/embed.ccg
+++ b/champlain-gtk/src/embed.ccg
@@ -17,7 +17,11 @@
  */
 
 #include <champlain-gtk/champlain-gtk.h>
+#include <champlainmm/view.h>
 
+namespace Champlain
+{
 namespace Gtk
 {
 } // namespace Gtk
+} // namespace Champlain
diff --git a/champlain-gtk/src/embed.hg b/champlain-gtk/src/embed.hg
index 6396b52..83e5e8b 100644
--- a/champlain-gtk/src/embed.hg
+++ b/champlain-gtk/src/embed.hg
@@ -22,7 +22,10 @@
 _DEFS(champlainmm-gtk,champlain-gtk)
 _PINCLUDE(gtkmm/private/alignment_p.h)
 
-namespace GtkChamplain
+namespace Champlain
+{
+
+namespace Gtk
 {
 
 /** A Gtk+ Widget that embeds a Champlain::View.
@@ -33,17 +36,18 @@ namespace GtkChamplain
  *
  * newin{0,4}
  */
-class Embed : public Gtk::Alignment
+class Embed : public ::Gtk::Alignment
 {
-  _CLASS_GTKOBJECT(Embed, GtkChamplainEmbed, GTK_CHAMPLAIN_EMBED, Gtk::Alignment, GtkAlignment)
+  _CLASS_GTKOBJECT(Embed, GtkChamplainEmbed, GTK_CHAMPLAIN_EMBED, ::Gtk::Alignment, GtkAlignment)
 
 public:
   _CTOR_DEFAULT
 
 #m4 _CONVERSION(`ChamplainView*', `Glib::RefPtr<Champlain::View>', `Glib::wrap($3)')
-  _WRAP_METHOD(Glib::RefPtr<Champlain::View> get_view(), gtk_champlain_embed_get_view)
-  _WRAP_METHOD(Glib::RefPtr<const Champlain::View> get_view() const, gtk_champlain_embed_get_view, 
constversion)
+  _WRAP_METHOD(Glib::RefPtr<Champlain::View> get_view(), gtk_champlain_embed_get_view, refreturn)
+  _WRAP_METHOD(Glib::RefPtr<const Champlain::View> get_view() const, gtk_champlain_embed_get_view, 
refreturn, constversion)
 
   _WRAP_PROPERTY("champlain-view", Glib::RefPtr<Champlain::View>)
 };
 } // namespace Gtk
+} // namespace Champlain
diff --git a/demos/Makefile.am b/demos/Makefile.am
index 7ec6f5f..2b0399d 100644
--- a/demos/Makefile.am
+++ b/demos/Makefile.am
@@ -31,6 +31,6 @@ local_includes = -I$(top_builddir) $(champlainmm_gtk_includes) $(champlainmm_inc
 local_ldadd    = $(champlainmm_gtk_ldadd) $(champlainmm_ldadd)
 
 AM_CPPFLAGS = $(local_includes) $(CHAMPLAINMM_GTK_CFLAGS) $(CHAMPLAINMM_CFLAGS)
-AM_CXXFLAGS = $(CHAMPLAINMM_GTK_WXXFLAGS) $(CHAMPLAINMM_WXXFLAGS) -DGLIBMM_DISABLE_DEPRECATED 
-DGIOMM_DISABLE_DEPRECATED -DGTKMM_DISABLE_DEPRECATED -DGDKMM_DISABLE_DEPRECATED
+AM_CXXFLAGS = $(CHAMPLAINMM_GTK_WXXFLAGS) $(CHAMPLAINMM_WXXFLAGS)
 
 embed_demo_LDADD = $(CHAMPLAINMM_GTK_LIBS) $(CHAMPLAINMM_LIBS) $(local_ldadd)
diff --git a/demos/embed-demo.cc b/demos/embed-demo.cc
index 4f493f3..830360c 100644
--- a/demos/embed-demo.cc
+++ b/demos/embed-demo.cc
@@ -31,7 +31,7 @@ private:
   Gtk::HeaderBar m_header_bar;
   Gtk::Grid m_grid;
   Gtk::SearchEntry m_search_entry;
-  GtkChamplain::Embed m_champlain_embed;
+  Champlain::Gtk::Embed m_champlain_embed;
 };
 
 EmbedDemoWindow::EmbedDemoWindow()
@@ -63,7 +63,7 @@ EmbedDemoWindow::~EmbedDemoWindow()
 
 int main(int argc, char *argv[])
 {
-  GtkChamplain::init(&argc, &argv);
+  Champlain::Gtk::init(&argc, &argv);
 
   Glib::RefPtr<Gtk::Application> app = Gtk::Application::create(argc, argv, "org.libchamplainmm.demo");
 


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