[glibmm/gmmproc-refactor] Partially implement NORMAL type conversions.



commit 49ca761396e7f5dbc5149f8c9e011a108212646b
Author: Krzesimir Nowak <qdlacz gmail com>
Date:   Thu Jul 12 18:16:44 2012 +0200

    Partially implement NORMAL type conversions.

 tools/pm/Common/TypeInfo/Convertors/Normal.pm |   32 +++++++++++++++++++++++-
 1 files changed, 30 insertions(+), 2 deletions(-)
---
diff --git a/tools/pm/Common/TypeInfo/Convertors/Normal.pm b/tools/pm/Common/TypeInfo/Convertors/Normal.pm
index fdedc10..ef92519 100644
--- a/tools/pm/Common/TypeInfo/Convertors/Normal.pm
+++ b/tools/pm/Common/TypeInfo/Convertors/Normal.pm
@@ -22,10 +22,38 @@ package Common::TypeInfo::Convertors::Normal;
 
 use strict;
 use warnings;
+use v5.12;
 
-sub convert ($$$$$$)
+sub convert
 {
-# TODO: Implement it.
+  my ($tiglobal, $from_details, $to_details, $transfer, $subst, $conversion_type) = @_;
+
+  given ($conversion_type)
+  {
+    when (Common::TypeInfo::Global::C_CXX ())
+    {
+      if ($from_details->match_sigil (['*']) and $to_details->match_sigil (['']))
+      {
+          return join ('', 'Glib::wrap(', $subst, ', ', (($transfer > Common::TypeInfo::Common::TRANSFER_NONE) ? 'true' : 'false'), ')');
+      }
+    }
+    when (Common::TypeInfo::Global::CXX_C ())
+    {
+      if ($from_details->match_sigil (['&']) and $to_details->match_sigil (['*']))
+      {
+        return join ('', 'Glib::unwrap', (($transfer > Common::TypeInfo::Common::TRANSFER_NONE) ? '' : '_copy'), '(', $subst, ')');
+      }
+    }
+    when (Common::TypeInfo::Global::C_CXX_CONTAINER ())
+    {
+
+    }
+    when (Common::TypeInfo::Global::CXX_C_CONTAINER ())
+    {
+
+    }
+  }
+
   return undef;
 }
 



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