[libchamplainmm] MapSourceDesc: implement constructor callback



commit af872ce0cbfb7f525cf5cd40cb44d1da153481f1
Author: Juan R. GarcĂ­a Blanco <juanrgar gmail com>
Date:   Sun Aug 10 19:29:29 2014 +0200

    MapSourceDesc: implement constructor callback

 champlain/src/map-source-desc.ccg |   15 +++++++++++++--
 1 files changed, 13 insertions(+), 2 deletions(-)
---
diff --git a/champlain/src/map-source-desc.ccg b/champlain/src/map-source-desc.ccg
index b0b1517..2d05109 100644
--- a/champlain/src/map-source-desc.ccg
+++ b/champlain/src/map-source-desc.ccg
@@ -16,13 +16,24 @@
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
+#include <champlain/champlain.h>
+
 namespace Champlain
 {
 
 static ChamplainMapSource* MapSource_constructor_callback(ChamplainMapSourceDesc* desc)
 {
-  // TODO
-  return NULL;
+  Champlain::MapSourceDesc::SlotMapSourceConstructor* the_slot = 
static_cast<Champlain::MapSourceDesc::SlotMapSourceConstructor*>(champlain_map_source_desc_get_data(desc));
+
+  try 
+  {
+    return Glib::unwrap((*the_slot)(Glib::wrap(desc)));
+  }
+  catch(...)
+  {
+    Glib::exception_handlers_invoke();
+    return 0;
+  }
 }
 
 } // namespace Champlain


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