]> err.no Git - libchamplain/commitdiff
Rename ChamplainViewEmbed to GtkChamplainEmbed
authorPierre-Luc Beaudoin <pierre-luc@pierlux.com>
Fri, 12 Jun 2009 04:34:58 +0000 (00:34 -0400)
committerPierre-Luc Beaudoin <pierre-luc@pierlux.com>
Fri, 12 Jun 2009 04:34:58 +0000 (00:34 -0400)
This removes the 2 view duality problem.  It also solves
issues where the ChamplainView would load data into clutter
before the stages even existed (giving OpenGl errors).

champlain-gtk/Makefile.am
champlain-gtk/champlain-gtk.h
champlain-gtk/champlain-view-embed.h [deleted file]
champlain-gtk/gtk-champlain-embed.c [moved from champlain-gtk/champlain-view-embed.c with 60% similarity]
champlain-gtk/gtk-champlain-embed.h [new file with mode: 0644]
demos/launcher-gtk.c
docs/reference-gtk/libchamplain-gtk-docs.sgml
docs/reference-gtk/libchamplain-gtk-sections.txt
docs/reference-gtk/libchamplain-gtk.types

index a6b4ed38ab6e409e18ba2bf2b4efaec31ab34d4d..b09a724f0773264c0db8726cbb4f19cccdf477f7 100644 (file)
@@ -13,24 +13,24 @@ lib_LTLIBRARIES = libchamplain-gtk-0.3.la
 libchamplain_gtk_0_3_la_SOURCES = \
        $(CHAMPLAIN_GTK_MARSHAL_LIST)            \
        $(BUILT_SOURCES)                        \
-       champlain-view-embed.c
+       gtk-champlain-embed.c
 
-noinst_HEADERS = champlain-view-embed.h
+noinst_HEADERS = gtk-champlain-embed.h
 
 libchamplain_gtk_0_3_la_LIBADD = $(GTK_DEPS_LIBS)
 
 champlain-gtk-marshal.h: $(CHAMPLAIN_GTK_MARSHAL_LIST)
-       @GLIB_GENMARSHAL@ --header --prefix=champlain_gtk_marshal $< > $(CHAMPLAIN_GTK_MARSHAL).h 
+       @GLIB_GENMARSHAL@ --header --prefix=champlain_gtk_marshal $< > $(CHAMPLAIN_GTK_MARSHAL).h
 
 champlain-gtk-marshal.c: $(CHAMPLAIN_GTK_MARSHAL_LIST)
        @GLIB_GENMARSHAL@ --body --prefix=champlain_gtk_marshal $< > $(CHAMPLAIN_GTK_MARSHAL).c
 
 libchamplain_includedir=$(includedir)/libchamplain-gtk-0.3/champlain-gtk
-libchamplain_include_HEADERS = champlain-gtk.h champlain-view-embed.h
+libchamplain_include_HEADERS = champlain-gtk.h gtk-champlain-embed.h
 
 libchamplain_gtk_0_3_la_LDFLAGS= -version-info $(LIBRARY_VERSION)
 
 AM_CPPFLAGS = $(GTK_DEPS_CFLAGS) -I$(top_srcdir) -DCHAMPLAIN_GTK_COMPILATION
-AM_LDFLAGS = $(GTK_DEPS_LIBS) -export-symbols-regex ^champlain_.*
+AM_LDFLAGS = $(GTK_DEPS_LIBS) -export-symbols-regex ^gtk_champlain_.*
 
 EXTRA_DIST = $(CHAMPLAIN_GTK_MARSHAL_LIST)
index 638d625a45c90424ca85663ffbeded2cc53e004b..aa77f00846c34544d8824b4b7122fda989224893 100644 (file)
@@ -21,7 +21,7 @@
 
 #define __CHAMPLAIN_GTK_CHAMPLAIN_GTK_H_INSIDE__
 
-#include <champlain-gtk/champlain-view-embed.h>
+#include <champlain-gtk/gtk-champlain-embed.h>
 
 #undef __CHAMPLAIN_GTK_CHAMPLAIN_GTK_H_INSIDE__
 
diff --git a/champlain-gtk/champlain-view-embed.h b/champlain-gtk/champlain-view-embed.h
deleted file mode 100644 (file)
index 5c3e94a..0000000
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * Copyright (C) 2008 Pierre-Luc Beaudoin <pierre-luc@pierlux.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
- */
-#if !defined (__CHAMPLAIN_GTK_CHAMPLAIN_GTK_H_INSIDE__) && !defined (CHAMPLAIN_GTK_COMPILATION)
-#error "Only <champlain/champlain.h> can be included directly."
-#endif
-
-#ifndef CHAMPLAIN_VIEW_EMBED_H
-#define CHAMPLAIN_VIEW_EMBED_H
-
-#include <gtk/gtk.h>
-#include <champlain/champlain.h>
-
-#define CHAMPLAIN_TYPE_VIEW_EMBED     (champlain_view_embed_get_type())
-#define CHAMPLAIN_VIEW_EMBED(obj)     (G_TYPE_CHECK_INSTANCE_CAST((obj), CHAMPLAIN_TYPE_VIEW_EMBED, ChamplainViewEmbed))
-#define CHAMPLAIN_VIEW_EMBED_CLASS(klass)  (G_TYPE_CHECK_CLASS_CAST((klass),  CHAMPLAIN_TYPE_VIEW_EMBED, ChamplainViewEmbedClass))
-#define CHAMPLAIN_IS_VIEW_EMBED(obj)  (G_TYPE_CHECK_INSTANCE_TYPE((obj), CHAMPLAIN_TYPE_VIEW_EMBED))
-#define CHAMPLAIN_IS_VIEW_EMBED_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass),  CHAMPLAIN_TYPE_VIEW_EMBED))
-#define CHAMPLAIN_VIEW_EMBED_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS((obj),  CHAMPLAIN_TYPE_VIEW_EMBED, ChamplainViewEmbedClass))
-
-typedef struct _ChamplainViewEmbedPrivate ChamplainViewEmbedPrivate;
-
-
-struct _ChamplainViewEmbed
-{
-  GtkAlignment bin;
-
-  ChamplainViewEmbedPrivate *priv;
-};
-
-struct _ChamplainViewEmbedClass
-{
-  GtkAlignmentClass parent_class;
-
-};
-
-typedef struct _ChamplainViewEmbed ChamplainViewEmbed;
-
-typedef struct _ChamplainViewEmbedClass ChamplainViewEmbedClass;
-
-GType champlain_view_embed_get_type (void);
-
-GtkWidget *champlain_view_embed_new ();
-
-ChamplainView *champlain_view_embed_get_view (ChamplainViewEmbed* embed);
-void champlain_view_embed_set_view (ChamplainViewEmbed* embed, ChamplainView *view);
-
-#endif
similarity index 60%
rename from champlain-gtk/champlain-view-embed.c
rename to champlain-gtk/gtk-champlain-embed.c
index 3e20918353bfde5f44eed8046fe9443b6550fac5..fea26c1a27daec473d6e78d7de8057c07322a822 100644 (file)
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
+/**
+ * SECTION:gtk-champlain-embed
+ * @short_description: A Gtk+ Widget that embeds a #ChamplainView
+ *
+ * Since #ChamplainView is a #ClutterActor, you cannot embed it directly
+ * into a Gtk+ application.  This widget solves this problem.  It creates
+ * the #ChamplainView for you, you can get it with
+ * #gtk_champlain_embed_get_view.
+ */
 #include "config.h"
 
-#include <champlain-view-embed.h>
 #include <champlain/champlain.h>
 
 #include <gtk/gtk.h>
 #include <clutter/clutter.h>
 #include <clutter-gtk/gtk-clutter-embed.h>
 
+#include "gtk-champlain-embed.h"
+
 enum
 {
   /* normal signals */
@@ -37,11 +47,11 @@ enum
   PROP_VIEW
 };
 
-//static guint champlain_view_embed_embed_signals[LAST_SIGNAL] = { 0, };
+//static guint gtk_champlain_embed_embed_signals[LAST_SIGNAL] = { 0, };
 
-#define CHAMPLAIN_VIEW_EMBED_GET_PRIVATE(obj)    (G_TYPE_INSTANCE_GET_PRIVATE((obj), CHAMPLAIN_TYPE_VIEW_EMBED, ChamplainViewEmbedPrivate))
+#define GTK_CHAMPLAIN_EMBED_GET_PRIVATE(obj)    (G_TYPE_INSTANCE_GET_PRIVATE((obj), GTK_CHAMPLAIN_TYPE_EMBED, GtkChamplainEmbedPrivate))
 
-struct _ChamplainViewEmbedPrivate
+struct _GtkChamplainEmbedPrivate
 {
   GtkWidget *clutter_embed;
   ChamplainView *view;
@@ -54,32 +64,32 @@ struct _ChamplainViewEmbedPrivate
 };
 
 
-static void champlain_view_embed_get_property(GObject *object, guint prop_id,
+static void gtk_champlain_embed_get_property (GObject *object, guint prop_id,
     GValue *value, GParamSpec *pspec);
-static void champlain_view_embed_set_property(GObject *object, guint prop_id,
+static void gtk_champlain_embed_set_property (GObject *object, guint prop_id,
     const GValue *value, GParamSpec *pspec);
-static void champlain_view_embed_finalize (GObject *object);
-static void champlain_view_embed_class_init (ChamplainViewEmbedClass *klass);
-static void champlain_view_embed_init (ChamplainViewEmbed *view);
+static void gtk_champlain_embed_finalize (GObject *object);
+static void gtk_champlain_embed_class_init (GtkChamplainEmbedClass *klass);
+static void gtk_champlain_embed_init (GtkChamplainEmbed *view);
 static void view_size_allocated_cb (GtkWidget *widget,
-    GtkAllocation *allocation, ChamplainViewEmbed *view);
+    GtkAllocation *allocation, GtkChamplainEmbed *view);
 static gboolean mouse_button_cb (GtkWidget *widget, GdkEventButton *event,
-    ChamplainViewEmbed *view);
+    GtkChamplainEmbed *view);
 static void view_size_allocated_cb (GtkWidget *widget,
-    GtkAllocation *allocation, ChamplainViewEmbed *view);
+    GtkAllocation *allocation, GtkChamplainEmbed *view);
 static void view_realize_cb (GtkWidget *widget,
-    ChamplainViewEmbed *view);
+    GtkChamplainEmbed *view);
 
-G_DEFINE_TYPE (ChamplainViewEmbed, champlain_view_embed, GTK_TYPE_ALIGNMENT);
+G_DEFINE_TYPE (GtkChamplainEmbed, gtk_champlain_embed, GTK_TYPE_ALIGNMENT);
 
 static void
-champlain_view_embed_get_property (GObject *object,
+gtk_champlain_embed_get_property (GObject *object,
                                    guint prop_id,
                                    GValue *value,
                                    GParamSpec *pspec)
 {
-  ChamplainViewEmbed *embed = CHAMPLAIN_VIEW_EMBED(object);
-  ChamplainViewEmbedPrivate *priv = embed->priv;
+  GtkChamplainEmbed *embed = GTK_CHAMPLAIN_EMBED (object);
+  GtkChamplainEmbedPrivate *priv = embed->priv;
 
   switch(prop_id)
     {
@@ -87,56 +97,48 @@ champlain_view_embed_get_property (GObject *object,
         g_value_set_object (value, priv->view);
         break;
       default:
-        G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
+        G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
     }
 }
 
 static void
-champlain_view_embed_set_property (GObject *object,
+gtk_champlain_embed_set_property (GObject *object,
                                    guint prop_id,
                                    const GValue *value,
                                    GParamSpec *pspec)
 {
-  ChamplainViewEmbed *embed = CHAMPLAIN_VIEW_EMBED(object);
-  ChamplainViewEmbedPrivate *priv = embed->priv;
+  //GtkChamplainEmbed *embed = GTK_CHAMPLAIN_EMBED (object);
+  //GtkChamplainEmbedPrivate *priv = embed->priv;
 
   switch(prop_id)
   {
-    case PROP_VIEW:
-      {
-        ChamplainView *view;
-
-        view = g_value_get_object (value);
-        champlain_view_embed_set_view (CHAMPLAIN_VIEW_EMBED (object), view);
-        break;
-      }
     default:
-      G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
+      G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
   }
 }
 
 static void
-champlain_view_embed_finalize (GObject *object)
+gtk_champlain_embed_finalize (GObject *object)
 {
-  ChamplainViewEmbed *embed = CHAMPLAIN_VIEW_EMBED (object);
-  ChamplainViewEmbedPrivate *priv = embed->priv;
+  GtkChamplainEmbed *embed = GTK_CHAMPLAIN_EMBED (object);
+  GtkChamplainEmbedPrivate *priv = embed->priv;
 
   g_object_unref (priv->view);
-  G_OBJECT_CLASS (champlain_view_embed_parent_class)->finalize (object);
+  G_OBJECT_CLASS (gtk_champlain_embed_parent_class)->finalize (object);
 }
 
 static void
-champlain_view_embed_class_init (ChamplainViewEmbedClass *klass)
+gtk_champlain_embed_class_init (GtkChamplainEmbedClass *klass)
 {
-  g_type_class_add_private (klass, sizeof (ChamplainViewEmbedPrivate));
+  g_type_class_add_private (klass, sizeof (GtkChamplainEmbedPrivate));
 
   GObjectClass *object_class = G_OBJECT_CLASS (klass);
-  object_class->finalize = champlain_view_embed_finalize;
-  object_class->get_property = champlain_view_embed_get_property;
-  object_class->set_property = champlain_view_embed_set_property;
+  object_class->finalize = gtk_champlain_embed_finalize;
+  object_class->get_property = gtk_champlain_embed_get_property;
+  object_class->set_property = gtk_champlain_embed_set_property;
 
   /**
-  * ChamplainViewEmbed:champlain-view:
+  * GtkChamplainEmbed:champlain-view:
   *
   * The #ChamplainView to embed in the Gtk+ widget.
   *
@@ -148,16 +150,36 @@ champlain_view_embed_class_init (ChamplainViewEmbedClass *klass)
          "Champlain view",
          "The ChamplainView to embed into the Gtk+ widget",
          CHAMPLAIN_TYPE_VIEW,
-         CHAMPLAIN_PARAM_READWRITE));
+         G_PARAM_READABLE));
+}
+
+void
+set_view (GtkChamplainEmbed* embed,
+    ChamplainView *view)
+{
+  GtkChamplainEmbedPrivate *priv = embed->priv;
+  ClutterActor *stage;
+
+  if (priv->view != NULL)
+    {
+      g_object_unref (priv->view);
+      clutter_container_remove_actor (CLUTTER_CONTAINER (stage), CLUTTER_ACTOR (priv->view));
+    }
+
+  priv->view = g_object_ref (view);
+  champlain_view_set_size (priv->view, priv->width, priv->height);
+
+  stage = gtk_clutter_embed_get_stage (GTK_CLUTTER_EMBED (priv->clutter_embed));
+  clutter_container_add_actor (CLUTTER_CONTAINER (stage), CLUTTER_ACTOR (priv->view));
 }
 
 static void
-champlain_view_embed_init (ChamplainViewEmbed *embed)
+gtk_champlain_embed_init (GtkChamplainEmbed *embed)
 {
   ClutterColor stage_color = { 0x34, 0x39, 0x39, 0xff };
   ClutterActor *stage;
 
-  ChamplainViewEmbedPrivate *priv = CHAMPLAIN_VIEW_EMBED_GET_PRIVATE (embed);
+  GtkChamplainEmbedPrivate *priv = GTK_CHAMPLAIN_EMBED_GET_PRIVATE (embed);
   embed->priv = priv;
 
   priv->clutter_embed = gtk_clutter_embed_new ();
@@ -183,7 +205,8 @@ champlain_view_embed_init (ChamplainViewEmbed *embed)
   priv->cursor_hand_closed = gdk_cursor_new(GDK_FLEUR);
 
   priv->view = NULL;
-  champlain_view_embed_set_view (embed, champlain_view_new ());
+  set_view (embed, CHAMPLAIN_VIEW (champlain_view_new ()));
+
   // Setup stage
   stage = gtk_clutter_embed_get_stage (GTK_CLUTTER_EMBED (priv->clutter_embed));
   clutter_stage_set_color (CLUTTER_STAGE (stage), &stage_color);
@@ -193,9 +216,9 @@ champlain_view_embed_init (ChamplainViewEmbed *embed)
 
 static void
 view_realize_cb (GtkWidget *widget,
-    ChamplainViewEmbed *view)
+    GtkChamplainEmbed *view)
 {
-  ChamplainViewEmbedPrivate *priv = view->priv;
+  GtkChamplainEmbedPrivate *priv = view->priv;
 
   // Setup mouse cursor to a hand
   gdk_window_set_cursor (priv->clutter_embed->window, priv->cursor_hand_open);
@@ -204,9 +227,9 @@ view_realize_cb (GtkWidget *widget,
 static void
 view_size_allocated_cb (GtkWidget *widget,
                         GtkAllocation *allocation,
-                        ChamplainViewEmbed *view)
+                        GtkChamplainEmbed *view)
 {
-  ChamplainViewEmbedPrivate *priv = view->priv;
+  GtkChamplainEmbedPrivate *priv = view->priv;
 
   if (priv->view != NULL)
     champlain_view_set_size (priv->view, allocation->width, allocation->height);
@@ -218,9 +241,9 @@ view_size_allocated_cb (GtkWidget *widget,
 static gboolean
 mouse_button_cb (GtkWidget *widget,
                  GdkEventButton *event,
-                 ChamplainViewEmbed *view)
+                 GtkChamplainEmbed *view)
 {
-  ChamplainViewEmbedPrivate *priv = view->priv;
+  GtkChamplainEmbedPrivate *priv = view->priv;
 
   if (event->type == GDK_BUTTON_PRESS)
     gdk_window_set_cursor( priv->clutter_embed->window, priv->cursor_hand_closed);
@@ -231,46 +254,31 @@ mouse_button_cb (GtkWidget *widget,
 }
 
 /**
- * champlain_view_embed_new:
- * @mode: a #ChamplainView, the map view to embed
- * Returns a new #ChamplainViewEmbed ready to be used as a #GtkWidget.
+ * gtk_champlain_embed_new:
  *
- * Since: 0.2.1
+ * Return value: a new #GtkChamplainEmbed ready to be used as a #GtkWidget.
+ *
+ * Since: 0.4
  */
 GtkWidget *
-champlain_view_embed_new ()
+gtk_champlain_embed_new ()
 {
-  return g_object_new (CHAMPLAIN_TYPE_VIEW_EMBED, NULL);
+  return g_object_new (GTK_CHAMPLAIN_TYPE_EMBED, NULL);
 }
 
+/**
+ * gtk_champlain_embed_get_view:
+ * @mode: a #ChamplainView, the map view to embed
+ *
+ * Return value: a #ChamplainView ready to be used
+ *
+ * Since: 0.4
+ */
 ChamplainView *
-champlain_view_embed_get_view (ChamplainViewEmbed* embed)
+gtk_champlain_embed_get_view (GtkChamplainEmbed* embed)
 {
-  g_return_val_if_fail(CHAMPLAIN_IS_VIEW_EMBED(embed), NULL);
+  g_return_val_if_fail (GTK_CHAMPLAIN_IS_EMBED(embed), NULL);
 
-  ChamplainViewEmbedPrivate *priv = embed->priv;
+  GtkChamplainEmbedPrivate *priv = embed->priv;
   return priv->view;
 }
-
-void
-champlain_view_embed_set_view (ChamplainViewEmbed* embed,
-    ChamplainView *view)
-{
-  g_return_if_fail (CHAMPLAIN_IS_VIEW_EMBED(embed));
-  g_return_if_fail (CHAMPLAIN_IS_VIEW (view));
-
-  ChamplainViewEmbedPrivate *priv = embed->priv;
-  ClutterActor *stage;
-
-  if (priv->view != NULL)
-    {
-      g_object_unref (priv->view);
-      clutter_container_remove_actor (CLUTTER_CONTAINER (stage), CLUTTER_ACTOR (priv->view));
-    }
-
-  priv->view = g_object_ref (view);
-  champlain_view_set_size (priv->view, priv->width, priv->height);
-
-  stage = gtk_clutter_embed_get_stage (GTK_CLUTTER_EMBED (priv->clutter_embed));
-  clutter_container_add_actor (CLUTTER_CONTAINER (stage), CLUTTER_ACTOR (priv->view));
-}
diff --git a/champlain-gtk/gtk-champlain-embed.h b/champlain-gtk/gtk-champlain-embed.h
new file mode 100644 (file)
index 0000000..4f719d2
--- /dev/null
@@ -0,0 +1,65 @@
+/*
+ * Copyright (C) 2008 Pierre-Luc Beaudoin <pierre-luc@pierlux.com>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#if !defined (__CHAMPLAIN_GTK_CHAMPLAIN_GTK_H_INSIDE__) && !defined (CHAMPLAIN_GTK_COMPILATION)
+#error "Only <champlain/champlain.h> can be included directly."
+#endif
+
+#ifndef GTK_CHAMPLAIN_EMBED_H
+#define GTK_CHAMPLAIN_EMBED_H
+
+#include <gtk/gtk.h>
+#include <champlain/champlain.h>
+
+#define GTK_CHAMPLAIN_TYPE_EMBED     (gtk_champlain_embed_get_type())
+#define GTK_CHAMPLAIN_EMBED(obj)     (G_TYPE_CHECK_INSTANCE_CAST((obj), GTK_CHAMPLAIN_TYPE_EMBED, GtkChamplainEmbed))
+#define GTK_CHAMPLAIN_EMBED_CLASS(klass)  (G_TYPE_CHECK_CLASS_CAST((klass),  GTK_CHAMPLAIN_TYPE_EMBED, GtkChamplainEmbedClass))
+#define GTK_CHAMPLAIN_IS_EMBED(obj)  (G_TYPE_CHECK_INSTANCE_TYPE((obj), GTK_CHAMPLAIN_TYPE_EMBED))
+#define GTK_CHAMPLAIN_IS_EMBED_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass),  GTK_CHAMPLAIN_TYPE_EMBED))
+#define GTK_CHAMPLAIN_EMBED_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS((obj),  GTK_CHAMPLAIN_TYPE_EMBED, GtkChamplainEmbedClass))
+
+typedef struct _GtkChamplainEmbedPrivate GtkChamplainEmbedPrivate;
+
+typedef struct _GtkChamplainEmbed GtkChamplainEmbed;
+
+typedef struct _GtkChamplainEmbedClass GtkChamplainEmbedClass;
+
+struct _GtkChamplainEmbed
+{
+  GtkAlignment bin;
+
+  GtkChamplainEmbedPrivate *priv;
+};
+
+struct _GtkChamplainEmbedClass
+{
+  GtkAlignmentClass parent_class;
+
+};
+
+GType gtk_champlain_embed_get_type (void);
+
+GtkWidget *gtk_champlain_embed_new ();
+ChamplainView *gtk_champlain_embed_get_view (GtkChamplainEmbed* embed);
+
+/* DEPRECATED API */
+GtkWidget *champlain_view_embed_new (ChamplainView *view) G_GNUC_DEPRECATED;
+ChamplainView *champlain_view_embed_get_view (GtkChamplainEmbed* embed) G_GNUC_DEPRECATED;
+void champlain_view_embed_set_view (GtkChamplainEmbed *embed, ChamplainView *view) G_GNUC_DEPRECATED;
+
+#endif
index 545f96bc644ee7fef316f8671906815d01b16644..bbeb670cd6b98f2ce02b954d0653e127c6654a32 100644 (file)
@@ -183,7 +183,7 @@ main (int argc,
 {
   GtkWidget *window;
   GtkWidget *widget, *vbox, *bbox, *button, *viewport;
-  ClutterActor *view;
+  ChamplainView *view;
   ChamplainLayer *layer;
 
   g_thread_init (NULL);
@@ -207,13 +207,13 @@ main (int argc,
 
   vbox = gtk_vbox_new(FALSE, 10);
 
-  widget = champlain_view_embed_new ();
-  view = champlain_view_embed_get_view (CHAMPLAIN_VIEW_EMBED (widget));
+  widget = gtk_champlain_embed_new ();
+  view = gtk_champlain_embed_get_view (GTK_CHAMPLAIN_EMBED (widget));
 
   g_object_set (G_OBJECT (view), "scroll-mode", CHAMPLAIN_SCROLL_MODE_KINETIC,
       "zoom-level", 5, NULL);
-  layer = create_marker_layer (CHAMPLAIN_VIEW (view));
-  champlain_view_add_layer(CHAMPLAIN_VIEW (view), layer);
+  layer = create_marker_layer (view);
+  champlain_view_add_layer(view, layer);
   clutter_actor_hide (CLUTTER_ACTOR (layer));
 
   polygon = champlain_polygon_new ();
@@ -231,7 +231,7 @@ main (int argc,
   champlain_view_add_polygon (CHAMPLAIN_VIEW (view), polygon);
   champlain_polygon_hide (polygon);
 
-  gtk_widget_set_size_request(widget, 640, 480);
+  gtk_widget_set_size_request (widget, 640, 480);
 
   bbox =  gtk_hbox_new (FALSE, 10);
   button = gtk_button_new_from_stock (GTK_STOCK_ZOOM_IN);
index 5358797caeb2411b6bc7d5c423481d3714dd09a8..28fb85ff6b4ddf2889db89d68ee08d2d24ff3977 100644 (file)
@@ -15,6 +15,6 @@
 
   <chapter>
     <title>I. API Reference</title>
-    <xi:include href="xml/champlainviewembed.xml"/>
+    <xi:include href="xml/gtk-champlain-embed.xml"/>
   </chapter>
 </book>
index a04f9c26f79fbd036a0f995afb151a1b87dc0ac1..ca8aa2a1b9cf09123e4d1e2d5b92f9e8dd64f563 100644 (file)
@@ -1,19 +1,15 @@
 <SECTION>
-<FILE>champlainviewembed</FILE>
-<TITLE>ChamplainViewEmbed</TITLE>
-champlain_view_embed_new
-champlain_view_embed_get_view
+<FILE>gtk-champlain-embed</FILE>
+<TITLE>GtkChamplainEmbed</TITLE>
+gtk_champlain_embed_new
+gtk_champlain_embed_get_view
 <SUBSECTION Standard>
-CHAMPLAIN_VIEW_EMBED
-CHAMPLAIN_IS_VIEW_EMBED
-CHAMPLAIN_TYPE_VIEW_EMBED
-champlain_view_embed_get_type
-CHAMPLAIN_VIEW_EMBED_CLASS
-CHAMPLAIN_IS_VIEW_EMBED_CLASS
-CHAMPLAIN_VIEW_EMBED_GET_CLASS
+GtkChamplainEmbed
+GTK_CHAMPLAIN_EMBED
+GTK_CHAMPLAIN_IS_EMBED
+CHAMPLAIN_TYPE_EMBED
+gtk_champlain_embed_get_type
+GTK_CHAMPLAIN_EMBED_CLASS
+GTK_CHAMPLAIN_IS_EMBED_CLASS
+GTK_CHAMPLAIN_EMBED_GET_CLASS
 </SECTION>
-
-<SECTION>
-<FILE>champlain-gtk-marshal</FILE>
-</SECTION>
-
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..1a1e0575adbafefbb3796f96a3ae6ff855895f4b 100644 (file)
@@ -0,0 +1 @@
+gtk_champlain_embed_get_type