[libchamplainmm] MapSourceDesc: Update constructor
- From: Juan R. Garcia Blanco <juanrgar src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libchamplainmm] MapSourceDesc: Update constructor
- Date: Sat, 26 Jul 2014 09:16:08 +0000 (UTC)
commit c0a8cf16be3e2953c87b7f3773c6ddc946ea2e2f
Author: Juan R. GarcĂa Blanco <juanrgar gmail com>
Date: Mon Jul 21 21:58:13 2014 +0200
MapSourceDesc: Update constructor
* champlain/src/map-source-desc.ccg: Add
ChamplainMapSourceDescConstructor wrapper.
* champlain/src/map-source-desc.hg: Wrap MapSourceDesc::create
static method using WRAP_METHOD.
champlain/src/map-source-desc.ccg | 29 +++++-------------------
champlain/src/map-source-desc.hg | 44 ++++++++++++++++++++----------------
tools/m4/convert_libchamplain.m4 | 1 +
3 files changed, 31 insertions(+), 43 deletions(-)
---
diff --git a/champlain/src/map-source-desc.ccg b/champlain/src/map-source-desc.ccg
index 4f5fabb..268af16 100644
--- a/champlain/src/map-source-desc.ccg
+++ b/champlain/src/map-source-desc.ccg
@@ -18,27 +18,10 @@
namespace Champlain
{
- Glib::RefPtr<MapSourceDesc> MapSourceDesc::create(const std::string& id,
- const Glib::ustring& name,
- const Glib::ustring& license,
- const Glib::ustring& license_uri,
- guint min_zoom_level,
- guint max_zoom_level,
- guint tile_size,
- MapProjection projection,
- const Glib::ustring& uri_format,
- const SlotMapSourceConstructor& constructor)
- {
- Glib::RefPtr<MapSourceDesc> map_source_desc(new MapSourceDesc(id,
- name,
- license,
- license_uri,
- min_zoom_level,
- max_zoom_level,
- tile_size,
- projection,
- uri_format,
- constructor));
- return map_source_desc;
- }
+
+static ChamplainMapSource* MapSource_constructor_callback(ChamplainMapSourceDesc* desc)
+{
+ // TODO
+}
+
} // namespace Champlain
diff --git a/champlain/src/map-source-desc.hg b/champlain/src/map-source-desc.hg
index 3813fc5..6d2c928 100644
--- a/champlain/src/map-source-desc.hg
+++ b/champlain/src/map-source-desc.hg
@@ -35,28 +35,32 @@ public:
typedef sigc::slot<Glib::RefPtr<MapSource>, Glib::RefPtr<MapSourceDesc> > SlotMapSourceConstructor;
protected:
- MapSourceDesc(const std::string& id,
- const Glib::ustring& name,
- const Glib::ustring& license,
- const Glib::ustring& license_uri,
- guint min_zoom_level,
- guint max_zoom_level,
- guint tile_size,
- MapProjection projection,
- const Glib::ustring& uri_format,
- const SlotMapSourceConstructor& constructor);
+
+ explicit MapSourceDesc(const std::string& id,
+ const Glib::ustring& name,
+ const Glib::ustring& license,
+ const Glib::ustring& license_uri,
+ guint min_zoom_level,
+ guint max_zoom_level,
+ guint tile_size,
+ MapProjection projection,
+ const Glib::ustring& uri_format,
+ const SlotMapSourceConstructor& constructor);
public:
- static Glib::RefPtr<MapSourceDesc> create(const std::string& id,
- const Glib::ustring& name,
- const Glib::ustring& license,
- const Glib::ustring& license_uri,
- guint min_zoom_level,
- guint max_zoom_level,
- guint tile_size,
- MapProjection projection,
- const Glib::ustring& uri_format,
- const SlotMapSourceConstructor& constructor);
+
+ _WRAP_METHOD(static Glib::RefPtr<MapSourceDesc> create(const std::string& id,
+ const Glib::ustring& name,
+ const Glib::ustring& license,
+ const Glib::ustring& license_uri,
+ guint min_zoom_level,
+ guint max_zoom_level,
+ guint tile_size,
+ MapProjection projection,
+ const Glib::ustring& uri_format,
+ const SlotMapSourceConstructor& constructor),
+ champlain_map_source_desc_new_full,
+ slot_name constructor, slot_callback MapSource_constructor_callback)
_WRAP_METHOD(std::string get_id() const, champlain_map_source_desc_get_id)
_WRAP_METHOD(Glib::ustring get_name() const, champlain_map_source_desc_get_name)
diff --git a/tools/m4/convert_libchamplain.m4 b/tools/m4/convert_libchamplain.m4
index adab7b1..7a98dc9 100644
--- a/tools/m4/convert_libchamplain.m4
+++ b/tools/m4/convert_libchamplain.m4
@@ -41,6 +41,7 @@ _CONVERSION(`ChamplainMapSource*',`Glib::RefPtr<const MapSource>',`Glib::wrap($3
_CONVERSION(`const Glib::RefPtr<MapSource>&',`ChamplainMapSource*',__CONVERT_REFPTR_TO_P)
# MapSourceDesc
+_CONVERSION(`ChamplainMapSourceDesc*',`Glib::RefPtr<MapSourceDesc>',`Glib::wrap($3)')
_CONVERSION(`GSList*',`Glib::SListHandle<const MapSourceDesc *>',__FL2H_SHALLOW)
# MapSourceFactory
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]