[glibmm/gmmproc-refactor] Change names of some sections.



commit a263a614f43aa44ebcb8b5f1003717a665756842
Author: Krzesimir Nowak <qdlacz gmail com>
Date:   Wed Apr 18 00:29:25 2012 +0200

    Change names of some sections.
    
    CONTENTS sections are for data that were in the templates already.
    For stuff being purely generated use GENERATED sections.
    Some sections that are not going to be used are removed.
    Adapted the code to new names.

 tools/pm/Common/Output/BoxedType.pm        |    2 +-
 tools/pm/Common/Output/BoxedTypeStatic.pm  |    2 +-
 tools/pm/Common/Output/GError.pm           |    2 +-
 tools/pm/Common/Output/GObject.pm          |    4 ++--
 tools/pm/Common/Output/Generic.pm          |    2 +-
 tools/pm/Common/Output/Interface.pm        |    4 ++--
 tools/pm/Common/Output/OpaqueCopyable.pm   |    2 +-
 tools/pm/Common/Output/OpaqueRefcounted.pm |    2 +-
 tools/pm/Common/Output/Shared.pm           |    2 +-
 tools/pm/Common/Sections.pm                |   14 ++++----------
 10 files changed, 15 insertions(+), 21 deletions(-)
---
diff --git a/tools/pm/Common/Output/BoxedType.pm b/tools/pm/Common/Output/BoxedType.pm
index d15d242..245ebbb 100644
--- a/tools/pm/Common/Output/BoxedType.pm
+++ b/tools/pm/Common/Output/BoxedType.pm
@@ -148,7 +148,7 @@ sub _output_cc ($$$$$$$)
                     nl () .
                     nl ('} // namespace Glib') .
                     nl ();
-  my $section = Common::Output::Shared::get_section $wrap_parser, Common::Sections::CC_END;
+  my $section = Common::Output::Shared::get_section $wrap_parser, Common::Sections::CC_GENERATED;
 
   $section_manager->append_string_to_conditional ($code_string, $conditional, 0);
   $section_manager->push_section ($section);
diff --git a/tools/pm/Common/Output/BoxedTypeStatic.pm b/tools/pm/Common/Output/BoxedTypeStatic.pm
index ef9c565..ed5af28 100644
--- a/tools/pm/Common/Output/BoxedTypeStatic.pm
+++ b/tools/pm/Common/Output/BoxedTypeStatic.pm
@@ -127,7 +127,7 @@ sub _output_cc ($$$$)
                     nl ('} // namespace Glib') .
                     nl ();
   my $conditional = Common::Output::Shared::generate_conditional $wrap_parser;
-  my $section = Common::Output::Shared::get_section $wrap_parser, Common::Sections::CC_END;
+  my $section = Common::Output::Shared::get_section $wrap_parser, Common::Sections::CC_GENERATED;
 
   $section_manager->append_string_to_conditional ($code_string, $conditional, 0);
   $section_manager->push_section ($section);
diff --git a/tools/pm/Common/Output/GError.pm b/tools/pm/Common/Output/GError.pm
index 3dfba0d..8cbb092 100644
--- a/tools/pm/Common/Output/GError.pm
+++ b/tools/pm/Common/Output/GError.pm
@@ -102,7 +102,7 @@ sub _output_gerror_impl ($$$)
                     nl ('}') .
                     nl () .
                     Common::Output::Shared::close_namespaces $wrap_parser;
-  my $section = Common::Output::Shared::get_section $wrap_parser, Common::Sections::CC_END;
+  my $section = Common::Output::Shared::get_section $wrap_parser, Common::Sections::CC_GENERATED;
 
   $section_manager->append_string_to_section ($code_string, $section);
 }
diff --git a/tools/pm/Common/Output/GObject.pm b/tools/pm/Common/Output/GObject.pm
index 21f701a..6f4ad06 100644
--- a/tools/pm/Common/Output/GObject.pm
+++ b/tools/pm/Common/Output/GObject.pm
@@ -154,7 +154,7 @@ sub _output_p_h ($$$$$)
                     nl (Common::Output::Shared::doxy_skip_begin) .
                     nl ('  typedef ' . $full_cpp_type . ' CppObjectType;') .
                     nl ('  typedef ' . $c_type . ' BaseObjectType;');
-  my $section = Common::Output::Shared::get_section $wrap_parser, Common::Sections::P_H_CONTENTS;
+  my $section = Common::Output::Shared::get_section $wrap_parser, Common::Sections::P_H_GENERATED;
 
   $section_manager->push_section ($section);
   $section_manager->append_string ($code_string);
@@ -233,7 +233,7 @@ sub _output_cc ($$$$$$)
                     nl ();
   my $no_wrap_function_var = Common::Output::Shared::get_variable $wrap_parser, Common::Variables::NO_WRAP_FUNCTION;
   my $conditional = Common::Output::Shared::generate_conditional ($wrap_parser);
-  my $section = Common::Output::Shared::get_section $wrap_parser, Common::Sections::CC_END;
+  my $section = Common::Output::Shared::get_section $wrap_parser, Common::Sections::CC_GENERATED;
 
   $section_manager->append_string_to_conditional ($code_string, $conditional, 0);
   $section_manager->push_section ($section);
diff --git a/tools/pm/Common/Output/Generic.pm b/tools/pm/Common/Output/Generic.pm
index 8ec865f..9d43560 100644
--- a/tools/pm/Common/Output/Generic.pm
+++ b/tools/pm/Common/Output/Generic.pm
@@ -33,7 +33,7 @@ sub output ($$$)
   my ($wrap_parser, $c_type, $cpp_type) = @_;
   my $section_manager = $wrap_parser->get_section_manager;
   my $main_section = $wrap_parser->get_main_section;
-  my $cc_end_section = Common::Output::Shared::get_section $wrap_parser, Common::Sections::CC_END;
+  my $cc_end_section = Common::Output::Shared::get_section $wrap_parser, Common::Sections::CC_GENERATED;
   my $cc_namespace_section = Common::Output::Shared::get_section $wrap_parser, Common::Sections::CC_NAMESPACE;
   my $code_string = nl ('public:') .
                     nl (Common::Output::Shared::doxy_skip_begin) .
diff --git a/tools/pm/Common/Output/Interface.pm b/tools/pm/Common/Output/Interface.pm
index a4b9b15..5233fd7 100644
--- a/tools/pm/Common/Output/Interface.pm
+++ b/tools/pm/Common/Output/Interface.pm
@@ -163,7 +163,7 @@ sub _output_p_h ($$$$)
                     nl ('  // Callbacks (default signal handlers):') .
                     nl ('  // These will call the *_impl member methods, which will then call the existing default signal callbacks, if any.') .
                     nl ('  // You could prevent the original default signal handlers being called by overriding the *_impl method.');
-  my $section = Common::Output::Shared::get_section $wrap_parser, Common::Sections::P_H_CONTENTS;
+  my $section = Common::Output::Shared::get_section $wrap_parser, Common::Sections::P_H_GENERATED;
 
   $section_manager->push_section ($section);
   $section_manager->append_string ($code_string);
@@ -191,7 +191,7 @@ sub _output_cc ($$$$$$)
   my $conditional = Common::Output::Shared::generate_conditional $wrap_parser;
   my $no_wrap_function_var = Common::Output::Shared::get_variable $wrap_parser, Common::Variables::NO_WRAP_FUNCTION;
   my $complete_cpp_type = Common::Output::Shared::get_complete_cpp_type $wrap_parser;
-  my $section = Common::Output::Shared::get_section $wrap_parser, Common::Sections::CC_END;
+  my $section = Common::Output::Shared::get_section $wrap_parser, Common::Sections::CC_GENERATED;
   my $code_string = nl ('namespace Glib') .
                     nl ('{') .
                     nl () .
diff --git a/tools/pm/Common/Output/OpaqueCopyable.pm b/tools/pm/Common/Output/OpaqueCopyable.pm
index 2a0884f..fbc2a9c 100644
--- a/tools/pm/Common/Output/OpaqueCopyable.pm
+++ b/tools/pm/Common/Output/OpaqueCopyable.pm
@@ -92,7 +92,7 @@ sub _output_cc ($$$$$$)
   my $full_cpp_type = Common::Output::Shared::get_full_cpp_type $wrap_parser;
   my $code_string = nl ($full_cpp_type . '::' . $cpp_type . '()') .
                     nl (':');
-  my $section = Common::Output::Shared::get_section $wrap_parser, Common::Sections::CC_END;
+  my $section = Common::Output::Shared::get_section $wrap_parser, Common::Sections::CC_GENERATED;
 
   if (defined $new_func and $new_func ne '' and $new_func ne 'NONE')
   {
diff --git a/tools/pm/Common/Output/OpaqueRefcounted.pm b/tools/pm/Common/Output/OpaqueRefcounted.pm
index 36889fb..70e7b65 100644
--- a/tools/pm/Common/Output/OpaqueRefcounted.pm
+++ b/tools/pm/Common/Output/OpaqueRefcounted.pm
@@ -94,7 +94,7 @@ sub _output_cc ($$$$$)
   my ($wrap_parser, $c_type, $new_func, $ref_func, $unref_func) = @_;
   my $section_manager = $wrap_parser->get_section_manager;
   my $full_cpp_type = Common::Output::Shared::get_full_cpp_type $wrap_parser;
-  my $section = Common::Output::Shared::get_section $wrap_parser, Common::Sections::CC_END;
+  my $section = Common::Output::Shared::get_section $wrap_parser, Common::Sections::CC_GENERATED;
   my $code_string = nl ('/* Why reinterpret_cast< ' . $full_cpp_type . '* >(gobject) is needed:') .
                     nl (' *') .
                     nl (' * A ' . $full_cpp_type . ' instance is in fact always a ' . $c_type . ' instance.') .
diff --git a/tools/pm/Common/Output/Shared.pm b/tools/pm/Common/Output/Shared.pm
index 276fc8e..9a8e89f 100644
--- a/tools/pm/Common/Output/Shared.pm
+++ b/tools/pm/Common/Output/Shared.pm
@@ -281,7 +281,7 @@ sub output_enum_gtype_func_cc ($$$)
                       nl () .
                       nl ('} // namespace Glib') .
                       nl ();
-    my $section = get_section $wrap_parser, Common::Sections::CC_END;
+    my $section = get_section $wrap_parser, Common::Sections::CC_GENERATED;
 
     $section_manager->append_string_to_section ($code_string, $section);
   }
diff --git a/tools/pm/Common/Sections.pm b/tools/pm/Common/Sections.pm
index 3f08914..01350fe 100644
--- a/tools/pm/Common/Sections.pm
+++ b/tools/pm/Common/Sections.pm
@@ -35,22 +35,16 @@ use constant
   'CC' => ['SECTION_CC', Common::Constants::FILE ()], # main implementation section
   'P_H' => ['SECTION_P_H', Common::Constants::FILE ()], # main private header section
   'DEV_NULL' => ['SECTION_DEV_NULL', Common::Constants::FILE ()], # everything put into this section goes to /dev/null
-  'H_CONTENTS' => ['SECTION_H_CONTENTS', Common::Constants::FILE ()],
-  'CC_CONTENTS' => ['SECTION_CC_CONTENTS', Common::Constants::FILE ()],
-  'P_H_CONTENTS' => ['SECTION_P_H_CONTENTS', Common::Constants::FILE ()],
+  'H_CONTENTS' => ['SECTION_H_CONTENTS', Common::Constants::FILE ()], #  for code in header template
+  'CC_CONTENTS' => ['SECTION_CC_CONTENTS', Common::Constants::FILE ()], # for code in source header
+  'P_H_GENERATED' => ['SECTION_P_H_GENERATED', Common::Constants::FILE ()],
+  'CC_GENERATED_INCLUDES' => ['SECTION_CC_GENERATED_INCLUDES', Common::Constants::FILE ()],
   'CC_UNNAMED_NAMESPACE' => ['SECTION_UNNAMED_NAMESPACE', Common::Constants::FILE ()], # blablabla
   'H_BEGIN' => ['SECTION_HEADER_BEGIN', Common::Constants::FILE ()], # SECTION_HEADER_FIRST
-  'HEADER1' => ['SECTION_HEADER1', Common::Constants::FILE ()], # TODO: check if needed, use better name, H_FOO
-  'HEADER2' => ['SECTION_HEADER2', Common::Constants::FILE ()], # TODO: check if needed, use better name, H_FOO
-  'HEADER3' => ['SECTION_HEADER3', Common::Constants::FILE ()], # TODO: check if needed, use better name, H_FOO
   'CC_PRE_INCLUDES' => ['SECTION_CC_PRE_INCLUDES', Common::Constants::FILE ()],
   'CC_INCLUDES' => ['SECTION_CC_INCLUDES', Common::Constants::FILE ()],
-  'CC_CUSTOM' => ['SECTION_CC_CUSTOM', Common::Constants::FILE ()], # TODO: check if needed, SECTION_SRC_CUSTOM
   'CC_GENERATED' => ['SECTION_CC_GENERATED', Common::Constants::FILE ()], # TODO: check if needed, SECTION_CC_GENERATED
-  'CC_END' => ['SECTION_CC_END', Common::Constants::FILE ()],
   'CC_NAMESPACE' => ['SECTION_CC_NAMESPACE', Common::Constants::NAMESPACE ()],
-  'CLASS1' => ['SECTION_CLASS1', Common::Constants::CLASS ()], # TODO: check if needed, use better name, CC_FOO
-  'CLASS2' => ['SECTION_CLASS2', Common::Constants::CLASS ()], # TODO: check if needed, use better name, CC_FOO
   'P_CC_IMPLEMENTS_INTERFACES' => ['SECTION_P_CC_IMPLEMENTS_INTERFACES', Common::Constants::CLASS ()],
   'H_VFUNCS' => ['SECTION_H_VFUNCS', Common::Constants::CLASS ()],
   'H_VFUNCS_CPP_WRAPPER' => ['SECTION_H_VFUNCS_CPP_WRAPPER', Common::Constants::CLASS ()], # TODO: probably not needed.



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