[glibmm/gmmproc-refactor] Remove old conversions system.



commit 4f61a85b52be2c49e1e66ff80d16e422efad53b3
Author: Krzesimir Nowak <qdlacz gmail com>
Date:   Wed Jun 6 04:12:06 2012 +0200

    Remove old conversions system.

 tools/pm/Common/ConversionsStore.pm |  418 -----------------------------------
 tools/pm/Common/Scanner.pm          |  291 ------------------------
 tools/pm/Common/TypeInfoStore.pm    |  356 -----------------------------
 tools/pm/Common/WrapParser.pm       |   14 --
 4 files changed, 0 insertions(+), 1079 deletions(-)
---
diff --git a/tools/pm/Common/Scanner.pm b/tools/pm/Common/Scanner.pm
index 5c65c5e..f2c4cf7 100644
--- a/tools/pm/Common/Scanner.pm
+++ b/tools/pm/Common/Scanner.pm
@@ -235,282 +235,6 @@ sub _on_wrap_class_generic ($$$)
   }
 }
 
-sub _on_convert_enum ($$)
-{
-  my ($self, $args) = @_;
-  my $cpp_enum = $args->[0];
-  my $c_enum = $args->[1];
-  my $full_cpp_enum = $self->_make_full_type ($cpp_enum);
-  my $sub_types = Common::Shared::split_cpp_type_to_sub_types $full_cpp_enum;
-
-  foreach my $sub_type (@{$sub_types})
-  {
-    $self->push_conv($c_enum, $sub_type, 'static_cast< ' . $sub_type . ' >(##ARG##)', undef, undef);
-    $self->push_conv($sub_type, $c_enum, 'static_cast< ' . $c_enum . ' >(##ARG##)', undef, undef);
-  }
-}
-
-sub _generate_containers ($$$)
-{
-  my ($self, $c_class, $all_types) = @_;
-  my $arg = '##ARG##';
-  my @list_sub_types = ('Glib::ListHandle', 'ListHandle');
-  my @slist_sub_types = ('Glib::SListHandle', 'SListHandle');
-  my @array_sub_types = ('Glib::ArrayHandle', 'ArrayHandle');
-  my @vector_sub_types = ('std::vector', 'vector');
-  my @ownerships = ('Glib::OWNERSHIP_NONE', 'Glib::OWNERSHIP_SHALLOW', 'Glib::OWNERSHIP_DEEP');
-  my $handle_to_c = '(' . $arg . ').data()';
-  my @c_array_types = ($c_class . '**', 'const ' . $c_class . '**', $c_class . '* const*', 'const ' . $c_class . '* const*');
-
-  foreach my $list_sub_type (@list_sub_types)
-  {
-    my @list_member_types = map { $list_sub_type . '< ' . $_ . ' >'} @{$all_types};
-
-    push @list_member_types, (map { $_ . '&' } @list_member_types);
-
-    my @const_list_member_types = map { 'const ' . $_ } @list_member_types;
-    my $glist = 'GList*';
-    my $const_glist = 'const ' . $glist;
-    my $cc_handle_to_c = 'const_cast< ' . $glist . ' >(' . $handle_to_c . ')';
-
-    foreach my $list_type (@list_member_types)
-    {
-      my @to_cxx = map { $list_type . '(' . $arg . ', ' . $_ . ')' } @ownerships;
-      my @to_cxx_cc = map { $list_type . '(const_cast< ' . $glist . ' >(' . $arg . '), ' . $_ . ')' } @ownerships;
-
-      $self->push_conv ($list_type, $glist, $handle_to_c, undef, undef);
-      $self->push_conv ($list_type, $const_glist, $handle_to_c, undef, undef);
-      $self->push_conv ($glist, $list_type, @to_cxx[0 .. 2]);
-      $self->push_conv ($const_glist, $list_type, @to_cxx_cc[0 .. 2]);
-    }
-    foreach my $list_type (@const_list_member_types)
-    {
-      my @to_cxx = map { $list_type . '(' . $arg . ', ' . $_ . ')' } @ownerships;
-
-      $self->push_conv ($list_type, $glist, $cc_handle_to_c, undef, undef);
-      $self->push_conv ($list_type, $const_glist, $handle_to_c, undef, undef);
-      $self->push_conv ($glist, $list_type, @to_cxx[0 .. 2]);
-      $self->push_conv ($const_glist, $list_type, @to_cxx[0 .. 2]);
-    }
-  }
-  foreach my $slist_sub_type (@slist_sub_types)
-  {
-    my @slist_member_types = map { $slist_sub_type . '< ' . $_ . ' >' } ${all_types};
-
-    push @slist_member_types, (map { $_ . '&' } @slist_member_types);
-
-    my @const_slist_member_types = map { 'const ' . $_ } @slist_member_types;
-    my $gslist = 'GSList*';
-    my $const_gslist = 'const ' . $gslist;
-    my $cc_handle_to_c = 'const_cast< ' . $gslist . ' >(' . $handle_to_c . ')';
-
-    foreach my $slist_type (@slist_member_types)
-    {
-      my @to_cxx = map { $slist_type . '(' . $arg . ', ' . $_ . ')' } @ownerships;
-      my @to_cxx_cc = map { $slist_type . '(const_cast< ' . $gslist . ' >(' . $arg . '), ' . $_ . ')' } @ownerships;
-
-      $self->push_conv ($slist_type, $gslist, $handle_to_c, undef, undef);
-      $self->push_conv ($slist_type, $const_gslist, $handle_to_c, undef, undef);
-      $self->push_conv ($gslist, $slist_type, @to_cxx[0 .. 2]);
-      $self->push_conv ($const_gslist, $slist_type, @to_cxx_cc[0 .. 2]);
-    }
-    foreach my $slist_type (@const_slist_member_types)
-    {
-      my @to_cxx = map { $slist_type . '(' . $arg . ', ' . $_ . ')' } @ownerships;
-
-      $self->push_conv ($slist_type, $gslist, $cc_handle_to_c, undef, undef);
-      $self->push_conv ($slist_type, $const_gslist, $handle_to_c, undef, undef);
-      $self->push_conv ($gslist, $slist_type, @to_cxx[0 .. 2]);
-      $self->push_conv ($const_gslist, $slist_type, @to_cxx[0 .. 2]);
-    }
-  }
-  foreach my $array_sub_type (@array_sub_types)
-  {
-    my @array_member_types = map { $array_sub_type . '< ' . $_ . ' >' } @{$all_types};
-
-    push @array_member_types, (map { $_ . '&' } @array_member_types);
-    push @array_member_types, (map { 'const ' . $_ } @array_member_types);
-    foreach my $array_type (@array_member_types)
-    {
-      my @to_cxx_cc = map { $array_type . '(const_cast< const ' . $array_type . '::CType* >(' . $arg . '), ' . $_ . ')' } @ownerships;
-
-      foreach my $c_array_type (@c_array_types)
-      {
-        my $cc_handle_to_c = 'const_cast< ' . $c_array_type . ' >(' . $handle_to_c . ')';
-
-        $self->push_conv ($array_type, $c_array_type, $cc_handle_to_c, undef, undef);
-        $self->push_conv ($c_array_type, $array_type, @to_cxx_cc[0 .. 2]);
-      }
-    }
-  }
-  foreach my $member_type (@{$all_types})
-  {
-    my @array_to_vectors = map { 'Glib::ArrayHandler< ' . $member_type . ' >::array_to_vector(const_cast< const Glib::ArrayHandler< ' . $member_type . ' >::CType* >(' . $arg . '), ' . $_ . ')' } @ownerships;
-    my $vector_to_array = 'Glib::ArrayHandler< ' . $member_type . ' >::vector_to_array(' . $arg . ').data()';
-    my @glist_to_vectors = map { 'Glib::ListHandler< ' . $member_type . ' >::list_to_vector(const_cast< GList* >(##ARG##), ' . $_ . ')' } @ownerships;
-    my $vector_to_glist = 'Glib::ListHandler< ' . $member_type . ' >::vector_to_list(' . $arg . ').data()';
-    my @gslist_to_vectors = map { 'Glib::SListHandler< ' . $member_type . ' >::slist_to_vector(const_cast< GSList* >(##ARG##), ' . $_ . ')' } @ownerships;
-    my $vector_to_gslist = 'Glib::SListHandler< ' . $member_type . ' >::vector_to_slist(' . $arg . ').data()';
-
-    foreach my $vector_sub_type (@vector_sub_types)
-    {
-      my $full_vector_type = $vector_sub_type . '< ' . $member_type . ' >';
-      my @full_vector_types = ($full_vector_type, $full_vector_type . '&');
-
-      push @full_vector_types, (map { 'const ' . $_ } @full_vector_types);
-      foreach my $vector_type (@full_vector_types)
-      {
-        foreach my $c_array_type (@c_array_types)
-        {
-          my $cc_vector_to_array = 'const_cast< ' . $c_array_type . ' >(' . $vector_to_array . ')';
-
-          $self->push_conv ($vector_type, $c_array_type, $cc_vector_to_array, undef, undef);
-          $self->push_conv ($c_array_type, $vector_type, @array_to_vectors[0 .. 2]);
-        }
-        foreach my $c_glist_type ('GList*', 'const GList*')
-        {
-          my $cc_vector_to_glist = 'const_cast< ' . $c_glist_type . ' >(' . $vector_to_glist . ')';
-
-          $self->push_conv ($vector_type, $c_glist_type, $cc_vector_to_glist, undef, undef);
-          $self->push_conv ($c_glist_type, $vector_type, @glist_to_vectors[0 .. 2]);
-        }
-        foreach my $c_gslist_type ('GSList*', 'const GSList*')
-        {
-          my $cc_vector_to_gslist = 'const_cast< ' . $c_gslist_type . ' >(' . $vector_to_gslist . ')';
-
-          $self->push_conv ($vector_type, $c_gslist_type, $cc_vector_to_gslist, undef, undef);
-          $self->push_conv ($c_gslist_type, $vector_type, @gslist_to_vectors[0 .. 2]);
-        }
-      }
-    }
-  }
-}
-
-sub _on_convert_class ($$)
-{
-  my ($self, $args) = @_;
-  my $c_class = $args->[1];
-  my $full_cpp_class = $self->_make_full_type (undef);
-  my $sub_types = Common::Shared::split_cpp_type_to_sub_types $full_cpp_class;
-  my $c_class_ptr = $c_class . '*';
-  my $const_c_class_ptr = 'const ' . $c_class_ptr;
-  my $arg = '##ARG##';
-  my $glib_unwrap = 'Glib::unwrap(' . $arg . ')';
-  my $cc_glib_unwrap = 'const_cast< ' . $c_class_ptr . ' >(' . $glib_unwrap . ')';
-  my $glib_unwrap_copy = 'Glib::unwrap_copy(' . $arg . ')';
-  my $cc_glib_unwrap_copy = 'const_cast< ' . $c_class_ptr . ' >(' . $glib_unwrap_copy . ')';
-  my $glib_unwrap_ref = 'Glib::unwrap(&' . $arg . ')';
-  my $cc_glib_unwrap_ref = 'const_cast< ' . $c_class_ptr . ' >(' . $glib_unwrap_ref . ')';
-  my $glib_unwrap_ref_copy = 'Glib::unwrap_copy(&' . $arg . ')';
-  my $cc_glib_unwrap_ref_copy = 'const_cast< ' . $c_class_ptr . ' >(' . $glib_unwrap_ref_copy . ')';
-  my $glib_wrap = 'Glib::wrap(' . $arg . ', false)';
-  my $glib_wrap_cc = 'Glib::wrap(const_cast< ' . $c_class_ptr . ' >(' . $arg . ', false))';
-  my $glib_wrap_copy = 'Glib::wrap(' . $arg . ', true)';
-  my $glib_wrap_copy_cc = 'Glib::wrap(const_cast< ' . $c_class_ptr . ' >(' . $arg . ', true))';
-  my $glib_wrap_ref = '*Glib::wrap(' . $arg . ', false)';
-  my $glib_wrap_ref_cc = '*Glib::wrap(const_cast< ' . $c_class_ptr . ' >(' . $arg . ', false)';
-  my $glib_wrap_ref_copy = '*Glib::wrap(' . $arg . ', true)';
-  my $glib_wrap_ref_copy_cc = '*Glib::wrap(const_cast< ' . $c_class_ptr . ' >(' . $arg . ', true)';
-
-  foreach my $sub_type (@{$sub_types})
-  {
-    my $const_sub_type = 'const ' . $sub_type;
-
-    foreach my $non_const_cxx_sub_type ($sub_type, $sub_type . '&')
-    {
-      foreach my $c_class_type ($c_class_ptr, $const_c_class_ptr)
-      {
-        $self->push_conv ($non_const_cxx_sub_type, $c_class_type, $glib_unwrap_ref, undef, $glib_unwrap_ref_copy);
-      }
-      $self->push_conv ($c_class_ptr, $non_const_cxx_sub_type, $glib_wrap_ref, undef, $glib_wrap_ref_copy);
-      $self->push_conv ($const_c_class_ptr, $non_const_cxx_sub_type, $glib_wrap_ref_cc, undef, $glib_wrap_ref_copy_cc);
-    }
-    foreach my $const_cxx_sub_type ($const_sub_type, $const_sub_type . '&')
-    {
-      foreach my $c_class_type ($c_class_ptr, $const_c_class_ptr)
-      {
-        $self->push_conv ($c_class_type, $const_cxx_sub_type, $glib_wrap_ref, undef, $glib_wrap_ref_copy);
-      }
-      $self->push_conv ($const_cxx_sub_type, $c_class_ptr, $cc_glib_unwrap_ref, undef, $cc_glib_unwrap_ref_copy);
-      $self->push_conv ($const_cxx_sub_type, $const_c_class_ptr, $glib_unwrap_ref, undef, $glib_unwrap_ref_copy);
-    }
-
-    my $sub_type_ptr = $sub_type . '*';
-    my $const_sub_type_ptr = $const_sub_type . '*';
-
-    foreach my $c_class_type ($c_class_ptr, $const_c_class_ptr)
-    {
-      $self->push_conf($sub_type_ptr, $c_class_type, $glib_unwrap, undef, $glib_unwrap_copy);
-    }
-    $self->push_conv($c_class_ptr, $sub_type_ptr, $glib_wrap, undef, $glib_wrap_copy);
-    $self->push_conv($const_c_class_ptr, $sub_type_ptr, $glib_wrap_cc, undef, $glib_wrap_copy_cc);
-
-    foreach my $c_class_type ($c_class_ptr, $const_c_class_ptr)
-    {
-      $self->push_conv ($c_class_type, $const_sub_type_ptr, $glib_wrap, undef, $glib_wrap_copy);
-    }
-    $self->push_conv ($const_sub_type_ptr, $c_class_ptr, $cc_glib_unwrap, undef, $cc_glib_unwrap_copy);
-    $self->push_conv ($const_sub_type_ptr, $const_c_class_ptr, $glib_unwrap, undef, $glib_unwrap_copy);
-  }
-
-  my $gen_flags = Common::Shared::GEN_NORMAL | Common::Shared::GEN_REF | Common::Shared::GEN_PTR | Common::Shared::GEN_CONST;
-  my $gen_types = Common::Shared::gen_cpp_types ([$full_cpp_class], $gen_flags);
-
-  $self->_generate_containers ($c_class, $gen_types);
-}
-
-sub _on_convert_reffed_class ($$)
-{
-  my ($self, $args) = @_;
-  my $c_class = $args->[1];
-  my $full_cpp_class = $self->_make_full_type (undef);
-  my $sub_types = Common::Shared::split_cpp_type_to_sub_types $full_cpp_class;
-  my $glib_ref_ptr_type = 'Glib::RefPtr';
-  my $ref_sub_types = Common::Shared::split_cpp_type_to_sub_types $glib_ref_ptr_type;
-  my $c_class_ptr = $c_class . '*';
-  my $const_c_class_ptr = 'const ' . $c_class_ptr;
-  my $arg = '##ARG##';
-  my $glib_unwrap = 'Glib::unwrap(' . $arg . ')';
-  my $cc_glib_unwrap = 'const_cast< ' . $c_class_ptr . ' >(' . $glib_unwrap . ')';
-  my $glib_unwrap_copy = 'Glib::unwrap_copy(' . $arg . ')';
-  my $cc_glib_unwrap_copy = 'const_cast< ' . $c_class_ptr . ' >(' . $glib_unwrap_copy . ')';
-  my $glib_wrap = 'Glib::wrap(' . $arg . ', false)';
-  my $glib_wrap_cc = 'Glib::wrap(const_cast< ' . $c_class_ptr . ' >(' . $arg . ', false))';
-  my $glib_wrap_copy = 'Glib::wrap(' . $arg . ', true)';
-  my $glib_wrap_copy_cc = 'Glib::wrap(const_cast< ' . $c_class_ptr . ' >(' . $arg . ', true))';
-
-  foreach my $sub_type (@{$sub_types})
-  {
-    foreach my $ref_sub_type (@{$ref_sub_types})
-    {
-      my $refptr_type = $ref_sub_type . '< ' . $sub_type . ' >';
-      my $refptr_const_type = $ref_sub_type . '< const ' . $sub_type . ' >';
-      my $const_refptr_type = 'const ' . $ref_sub_type . '< ' . $sub_type . ' >';
-      my $const_refptr_const_type = 'const ' . $ref_sub_type . '< const ' . $sub_type . ' >';
-
-      foreach my $xxx_refptr_type ($refptr_type, $const_refptr_type, $refptr_type . '&', $const_refptr_type . '&')
-      {
-        $self->push_conv ($xxx_refptr_type, $c_class_ptr, $glib_unwrap, undef, $glib_unwrap_copy);
-        $self->push_conv ($xxx_refptr_type, $const_c_class_ptr, $glib_unwrap, undef, $glib_unwrap_copy);
-        $self->push_conv ($c_class_ptr, $xxx_refptr_type, $glib_wrap, undef, $glib_wrap_copy);
-        $self->push_conv ($const_c_class_ptr, $xxx_refptr_type, $glib_wrap_cc, undef, $glib_wrap_copy_cc);
-      }
-      foreach my $xxx_refptr_const_type ($refptr_const_type, $const_refptr_const_type, $refptr_const_type . '&', $const_refptr_const_type . '&')
-      {
-        $self->push_conv ($xxx_refptr_const_type, $c_class_ptr, $cc_glib_unwrap, undef, $cc_glib_unwrap_copy);
-        $self->push_conv ($xxx_refptr_const_type, $const_c_class_ptr, $glib_unwrap, undef, $glib_unwrap_copy);
-        $self->push_conv ($c_class_ptr, $xxx_refptr_const_type, $glib_wrap, undef, $glib_wrap_copy);
-        $self->push_conv ($const_c_class_ptr, $xxx_refptr_const_type, $glib_wrap, undef, $glib_wrap_copy);
-      }
-    }
-  }
-
-  my $gen_flags = Common::Shared::GEN_NORMAL | Common::Shared::GEN_REF | Common::Shared::GEN_CONST;
-  my $gen_types = Common::Shared::gen_cpp_types ([$glib_ref_ptr_type, $full_cpp_class], $gen_flags);
-
-  $self->_generate_containers ($c_class, $gen_types);
-}
-
 ###
 ###
 ###
@@ -942,19 +666,4 @@ sub get_tuples ($)
   return $self->{'tuples'};
 }
 
-sub get_conversions ($)
-{
-  my ($self) = @_;
-
-  return $self->{'conversions'};
-}
-
-sub push_conv ($$$$$$)
-{
-  my ($self, $from, $to, $none, $shallow, $full) = @_;
-  my $conversions = $self->get_conversions;
-
-  push @{$conversions}, [$from, $to, $none, $shallow, $full];
-}
-
 1; # indicate proper module load.
diff --git a/tools/pm/Common/WrapParser.pm b/tools/pm/Common/WrapParser.pm
index c7030d2..a90183e 100644
--- a/tools/pm/Common/WrapParser.pm
+++ b/tools/pm/Common/WrapParser.pm
@@ -2653,13 +2653,6 @@ sub new ($$$$$$)
   return $self;
 }
 
-sub get_type_info_store ($)
-{
-  my ($self) = @_;
-
-  return $self->{'type_info_store'};
-}
-
 sub get_type_info_local ($)
 {
   my ($self) = @_;
@@ -2677,13 +2670,6 @@ sub get_number ($)
   return $number;
 }
 
-sub get_conversions_store ($)
-{
-  my ($self) = @_;
-
-  return $self->{'conversions_store'};
-}
-
 sub generate_first_class_number ($)
 {
   my ($self) = @_;



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