[glibmm/gmmproc-refactor: 174/174] Merge branch 'master' into gmmproc-refactor



commit ca69596be2b7313c317568bc67d5c307f78e7066
Merge: 90acf10 23036b5
Author: Krzesimir Nowak <qdlacz gmail com>
Date:   Thu Sep 1 16:47:15 2011 +0200

    Merge branch 'master' into gmmproc-refactor
    
    Conflicts:
    	tools/generate_wrap_init.pl.in
    	tools/gmmproc.in
    	tools/pm/Common/Output.pm
    	tools/pm/Common/WrapParser.pm
    	tools/pm/Function.pm
    	tools/pm/FunctionBase.pm
    	tools/pm/GtkDefs.pm

 .gitignore                                         |    4 +
 ChangeLog                                          | 1372 +-
 MSVC_Net2005/giomm/giomm.vcproj                    |  180 +
 MSVC_Net2005/glibmm/glibmm.vcproj                  |   32 +
 MSVC_Net2008/giomm/giomm.vcproj                    |  176 +
 MSVC_Net2008/glibmm/glibmm.vcproj                  |   32 +
 MSVC_Net2010/giomm/giomm.vcxproj                   |   44 +
 MSVC_Net2010/giomm/giomm.vcxproj.filters           |  132 +
 MSVC_Net2010/glibmm.sln                            |  390 +-
 MSVC_Net2010/glibmm/glibmm.vcxproj                 |    8 +
 MSVC_Net2010/glibmm/glibmm.vcxproj.filters         |   24 +
 NEWS                                               |  332 +-
 configure.ac                                       |   17 +-
 docs/Makefile.am                                   |    5 +-
 examples/Makefile.am                               |   20 +-
 examples/dbus/busserver.cc                         |  202 -
 .../dbus/{userbus.cc => client_bus_listnames.cc}   |   23 +-
 examples/dbus/peer.cc                              |  348 -
 examples/dbus/server_without_bus.cc                |  207 +
 examples/dbus/session_bus_service.cc               |  172 +
 examples/options/main.cc                           |  113 +-
 gio/giomm.h                                        |    6 +-
 gio/src/actiongroup.hg                             |    5 +-
 gio/src/appinfo.ccg                                |   51 +
 gio/src/appinfo.hg                                 |  101 +-
 gio/src/application.ccg                            |   36 +-
 gio/src/application.hg                             |   38 +-
 gio/src/applicationcommandline.hg                  |   34 +-
 gio/src/bufferedinputstream.hg                     |   12 +-
 gio/src/bufferedoutputstream.hg                    |   12 +-
 gio/src/credentials.hg                             |    2 +-
 gio/src/datainputstream.hg                         |    4 +-
 gio/src/dbusauthobserver.ccg                       |    5 +
 gio/src/dbusauthobserver.hg                        |   19 +-
 gio/src/dbusconnection.ccg                         |  600 +-
 gio/src/dbusconnection.hg                          |  649 +-
 gio/src/dbuserror.ccg                              |   25 -
 gio/src/dbuserror.hg                               |   58 +-
 gio/src/dbuserrorutils.ccg                         |   50 +
 gio/src/dbuserrorutils.hg                          |   75 +
 gio/src/dbusinterfacevtable.ccg                    |  172 +
 gio/src/dbusinterfacevtable.hg                     |  169 +
 gio/src/dbusintrospection.ccg                      |   28 +
 gio/src/dbusintrospection.hg                       |   73 +-
 gio/src/dbusmessage.ccg                            |   14 +-
 gio/src/dbusmessage.hg                             |   66 +-
 gio/src/dbusmethodinvocation.ccg                   |    9 +-
 gio/src/dbusmethodinvocation.hg                    |   57 +-
 gio/src/dbusownname.ccg                            |    6 +-
 gio/src/dbusownname.hg                             |   17 +-
 gio/src/dbusproxy.ccg                              |  176 +-
 gio/src/dbusproxy.hg                               |  196 +-
 gio/src/dbusserver.ccg                             |   62 +-
 gio/src/dbusserver.hg                              |   83 +-
 gio/src/dbussubtreevtable.ccg                      |  183 +
 gio/src/dbussubtreevtable.hg                       |  178 +
 gio/src/dbusutils.ccg                              |    2 +-
 gio/src/dbusutils.hg                               |    2 +-
 gio/src/dbuswatchname.ccg                          |   12 +-
 gio/src/dbuswatchname.hg                           |   18 +-
 gio/src/desktopappinfo.hg                          |    2 +-
 gio/src/emblem.hg                                  |   17 +-
 gio/src/emblemedicon.ccg                           |    6 +
 gio/src/emblemedicon.hg                            |   36 +-
 gio/src/error.hg                                   |    2 -
 gio/src/file.hg                                    |   48 +-
 gio/src/fileinfo.hg                                |   36 +-
 gio/src/filelist.am                                |    6 +-
 gio/src/fileoutputstream.hg                        |    2 +-
 gio/src/filterinputstream.hg                       |    4 +-
 gio/src/filteroutputstream.hg                      |    5 +-
 gio/src/gio_docs.xml                               |35561 ++++++++-------
 gio/src/gio_methods.defs                           |12734 +++--
 gio/src/gio_methods.defs.patch                     |   66 +
 gio/src/gio_others.defs                            |   14 +-
 gio/src/gio_signals.defs                           |  279 +-
 gio/src/gio_signals.defs.patch                     |   40 +
 gio/src/gio_vfuncs.defs                            |   11 +
 gio/src/memoryoutputstream.hg                      |    4 +-
 gio/src/proxy.hg                                   |   14 +-
 gio/src/proxyaddress.hg                            |    6 +-
 gio/src/proxyresolver.ccg                          |    5 +-
 gio/src/proxyresolver.hg                           |   42 +-
 gio/src/resolver.hg                                |   86 +-
 gio/src/seekable.hg                                |    4 +-
 gio/src/settings.ccg                               |    5 +
 gio/src/settings.hg                                |   23 +-
 gio/src/settingsbackend.hg                         |   66 -
 gio/src/socket.hg                                  |    4 +-
 gio/src/socketaddressenumerator.hg                 |   27 +-
 gio/src/socketclient.hg                            |   72 +-
 gio/src/socketcontrolmessage.hg                    |    3 +-
 gio/src/themedicon.hg                              |   16 +-
 gio/src/unixcredentialsmessage.hg                  |    1 +
 gio/src/unixfdlist.hg                              |    1 +
 gio/src/unixfdmessage.hg                           |    3 +-
 glib/glibmm-uninstalled.pc.in                      |    1 -
 glib/glibmm.h                                      |    2 +
 glib/glibmm.pc.in                                  |    1 -
 .../glibmm/arrayhandle.cc                          |   25 +-
 glib/glibmm/arrayhandle.h                          |  242 +-
 glib/glibmm/filelist.am                            |    3 +
 glib/glibmm/listhandle.h                           |   12 +-
 glib/glibmm/miscutils.cc                           |   66 +-
 glib/glibmm/miscutils.h                            |  120 +
 glib/glibmm/refptr.h                               |    3 +-
 glib/glibmm/slisthandle.h                          |   10 +-
 glib/glibmm/stringutils.cc                         |    2 +-
 glib/glibmm/vectorutils.cc                         |   76 +
 glib/glibmm/vectorutils.h                          |  991 +
 glib/src/balancedtree.hg                           |  209 +-
 glib/src/date.hg                                   |   87 +-
 .../settingsbackend.ccg => glib/src/datetime.ccg   |   13 +-
 glib/src/datetime.hg                               |  123 +
 glib/src/filelist.am                               |    6 +-
 glib/src/fileutils.ccg                             |    3 +-
 glib/src/glib_docs.xml                             |49517 +++++++++++---------
 glib/src/glib_enums.defs                           |  120 +-
 glib/src/glib_extra_objects.defs                   |   22 +-
 glib/src/glib_functions.defs                       |  802 +-
 glib/src/glib_functions.defs.patch                 |  163 +
 glib/src/gobject_enums.defs                        |   31 +-
 glib/src/gobject_functions.defs                    |  237 +-
 glib/src/iochannel.ccg                             |    5 +-
 glib/src/markup.ccg                                |    2 +-
 glib/src/optioncontext.hg                          |    9 +-
 glib/src/optionentry.hg                            |    8 +-
 glib/src/optiongroup.ccg                           |  330 +-
 glib/src/optiongroup.hg                            |   19 +
 .../settingsbackend.ccg => glib/src/timezone.ccg   |   10 +-
 glib/src/timezone.hg                               |   72 +
 glib/src/variant.ccg                               |  202 +-
 glib/src/variant.hg                                |  386 +-
 glib/src/variantiter.hg                            |    2 +-
 glib/src/varianttype.ccg                           |   50 +-
 glib/src/varianttype.hg                            |   96 +-
 tests/Makefile.am                                  |   65 +-
 tests/giomm_asyncresult_sourceobject/main.cc       |   29 +-
 tests/giomm_ioerror/main.cc                        |   23 +-
 tests/giomm_ioerror_and_iodbuserror/main.cc        |   76 +
 tests/giomm_simple/main.cc                         |   23 +-
 tests/glibmm_bool_arrayhandle/main.cc              |   97 +
 tests/glibmm_bool_vector/main.cc                   |   89 +
 tests/glibmm_btree/main.cc                         |    4 +-
 tests/glibmm_buildfilename/main.cc                 |   44 +
 tests/glibmm_date/main.cc                          |   13 +-
 tests/glibmm_nodetree/main.cc                      |    6 +-
 tests/glibmm_null_containerhandle/main.cc          |   43 +
 tests/glibmm_null_vectorutils/main.cc              |   41 +
 tests/glibmm_refptr_sigc_bind/main.cc              |   68 +
 tests/glibmm_ustring_compose/main.cc               |   24 +-
 tests/glibmm_ustring_format/main.cc                |    2 +-
 tests/glibmm_value/main.cc                         |    2 +-
 tests/glibmm_valuearray/main.cc                    |   25 +-
 tests/glibmm_variant/main.cc                       |  233 +-
 tests/glibmm_vector/main.cc                        |  589 +
 tools/Makefile.am                                  |    7 +
 tools/defs_gen/definitions.py                      |  575 +
 tools/defs_gen/defsparser.py                       |  153 +
 tools/defs_gen/docextract.py                       |  461 +
 tools/defs_gen/docextract_to_xml.py                |  142 +
 tools/defs_gen/h2def.py                            |  631 +
 tools/defs_gen/scmexpr.py                          |  143 +
 tools/extra_defs_gen/generate_defs_gio.cc          |   13 +-
 tools/extra_defs_gen/generate_defs_glib.cc         |   14 +-
 tools/extra_defs_gen/generate_extra_defs.cc        |    6 +-
 tools/generate_wrap_init.pl.in                     |  156 +-
 tools/m4/base.m4                                   |    7 +-
 tools/m4/class_gobject.m4                          |    1 +
 tools/m4/class_interface.m4                        |    2 +-
 tools/m4/class_shared.m4                           |    6 +
 tools/m4/convert_base.m4                           |   21 +
 tools/m4/convert_gio.m4                            |   49 +-
 tools/m4/convert_glib.m4                           |   44 +-
 tools/m4/gerror.m4                                 |    2 +
 tools/m4/list.m4                                   |    2 +-
 tools/m4/method.m4                                 |   43 +-
 tools/m4/signal.m4                                 |    2 +-
 tools/m4/vfunc.m4                                  |    2 +-
 tools/pm/Common/DocsParser.pm                      |   22 +-
 tools/pm/Common/Output.pm                          |  488 +-
 tools/pm/Common/WrapParser.pm                      |   53 +-
 tools/pm/FunctionBase.pm                           |   78 +-
 tools/pm/GtkDefs.pm                                |   28 +-
 184 files changed, 67820 insertions(+), 47294 deletions(-)
---
diff --cc tools/pm/Common/WrapParser.pm
index 4f7c010,f31f16d..5ad4a81
--- a/tools/pm/Common/WrapParser.pm
+++ b/tools/pm/Common/WrapParser.pm
@@@ -1181,20 -1182,34 +1182,34 @@@ sub on_wrap_vfunc($
  
    my $refreturn = 0;
    my $refreturn_ctype = 0;
+   my $custom_vfunc = 0;
+   my $custom_vfunc_callback = 0;
    my $ifdef = "";
  
-   # Extra ref needed?
-   while($#args >= 2) # If the optional ref/err arguments are there.
+   while($#args >= 2) # If optional arguments are there.
    {
 -    my $argRef = string_trim(pop @args);
 +    my $argRef = Util::string_trim(pop @args);
  
+     # Extra ref needed?
      if($argRef eq "refreturn")
-       { $refreturn = 1; }
+     {
+       $refreturn = 1;
+     }
      elsif($argRef eq "refreturn_ctype")
-       { $refreturn_ctype = 1; }
-   elsif($argRef =~ /^ifdef(.*)/) #If ifdef is at the start.
+     {
+       $refreturn_ctype = 1;
+     }
+     elsif($argRef eq "custom_vfunc")
+     {
+       $custom_vfunc = 1;
+     }
+     elsif($argRef eq "custom_vfunc_callback")
+     {
+       $custom_vfunc_callback = 1;
+     }
+     elsif($argRef =~ /^ifdef(.*)/) #If ifdef is at the start.
      {
 -    	$ifdef = $1;
 +      $ifdef = $1;
      }
    }
  
diff --cc tools/pm/FunctionBase.pm
index bca5473,0a0ba19..c990d02
--- a/tools/pm/FunctionBase.pm
+++ b/tools/pm/FunctionBase.pm
@@@ -127,30 -37,82 +127,36 @@@ sub set_c_name ($$
  # comma-delimited argument types.
  sub args_types_only($)
  {
 -  my ($self) = @_;
 +  my $self = shift;
  
 -  my $param_types = $$self{param_types};
 -  return join(", ", @$param_types);
 +  return join(", ", @{$self->{$g_p_t}});
  }
  
- # $string args_names_only($)
+ # $string args_names_only(int index = 0)
+ # Gets the args names.  The optional index specifies which argument
+ # list should be used out of the possible combination of arguments based on
+ # whether any arguments are optional.  index = 0 ==> all the names.
  sub args_names_only($)
  {
 -  my ($self, $index) = @_;
 +  my $self = shift;
  
 -  $index = 0 unless defined($index);
 -
 -  my $param_names = $$self{param_names};
 -  my $possible_args_list = $$self{possible_args_list};
 -  my @out;
 -
 -  my @arg_indices;
 -
 -  if(defined($possible_args_list))
 -  {
 -    @arg_indices = split(" ", @$possible_args_list[$index]);
 -  }
 -  else
 -  {
 -    @arg_indices = (0   $param_names - 1);
 -  }
 -
 -  for (my $i = 0; $i < @arg_indices; $i++)
 -  {
 -    push(@out, $$param_names[$arg_indices[$i]]);
 -  }
 -  return join(", ", @out);
 +  return join(", ", @{$self->{$g_p_n}});
  }
  
- # $string args_types_and_names($)
+ # $string args_types_and_names(int index = 0)
+ # Gets the args types and names.  The optional index specifies which argument
+ # list should be used out of the possible combination of arguments based on
+ # whether any arguments are optional.  index = 0 ==> all the types and names.
  sub args_types_and_names($)
  {
 -  my ($self, $index) = @_;
 -
 -  $index = 0 unless defined($index);
 -
 -  my $i;
 -
 -  my $param_names = $$self{param_names};
 -  my $param_types = $$self{param_types};
 -  my $possible_args_list = $$self{possible_args_list};
 +  my $self = shift;
 +  my $param_types = $self->{$g_p_t};
 +  my $param_names = $self->{$g_p_n};
    my @out;
  
 -  #debugging:
 -  #if($#$param_types)
 -  #{
 -  #  return "NOARGS";
 -  #}
 -
 -  my @arg_indices;
 -
 -  if(defined($possible_args_list))
 -  {
 -    @arg_indices = split(" ", @$possible_args_list[$index]);
 -  }
 -  else
 +  for (my $i = 0; $i < @{$param_types}; ++$i)
    {
 -    @arg_indices = (0   $param_names - 1);
 -  }
 -
 -  for ($i = 0; $i < @arg_indices; $i++)
 -  {
 -    my $str = sprintf("%s %s", $$param_types[$arg_indices[$i]],
 -      $$param_names[$arg_indices[$i]]);
 +    my $str = $param_typessprintf("%s %s", $$param_types[$i], $$param_names[$i]);
      push(@out, $str);
    }
  
@@@ -264,26 -225,49 +270,45 @@@ sub dump($
    print "</function>\n\n";
  }
  
+ # $string args_types_and_names_with_default_values(int index = 0)
+ # Gets the args types and names with default values.  The optional index
+ # specifies which argument list should be used out of the possible
+ # combination of arguments based on whether any arguments are optional.
+ # index = 0 ==> all the types and names.
  sub args_types_and_names_with_default_values($)
  {
 -  my ($self, $index) = @_;
 -
 -  $index = 0 unless defined $index;
 +  my $self = shift;
  
    my $i;
  
    my $param_names = $$self{param_names};
    my $param_types = $$self{param_types};
    my $param_default_values = $$self{param_default_values};
+   my $possible_args_list = $$self{possible_args_list};
    my @out;
  
 -  my @arg_indices;
 -
 -  if(defined($possible_args_list))
 +  for ($i = 0; $i < $#$param_types + 1; $i++)
    {
-     my $str = sprintf("%s %s", $$param_types[$i], $$param_names[$i]);
+     @arg_indices = split(" ", @$possible_args_list[$index]);
+   }
+   else
+   {
+     @arg_indices = (0   $param_names - 1);
+   }
+ 
+   for ($i = 0; $i < @arg_indices; $i++)
+   {
+     my $str = sprintf("%s %s", $$param_types[$arg_indices[$i]],
+       $$param_names[$arg_indices[$i]]);
  
-     if(defined($$param_default_values[$i]))
+ 
+     if(defined($$param_default_values[$arg_indices[$i]]))
      {
-       if($$param_default_values[$i] ne "")
+       my $default_value = $$param_default_values[$arg_indices[$i]];
+ 
+       if($default_value ne "")
        {
-         $str .= " = " . $$param_default_values[$i];
+         $str .= " = " . $default_value;
        }
      }
  
@@@ -293,4 -277,46 +318,45 @@@
    return join(", ", @out);
  }
  
+ # $string get_declaration(int index = 0)
+ # Gets the function declaration (this includes the default values of the
+ # args).  The optional index specifies which argument list should be used out
+ # of the possible combination of arguments based on whether any arguments are
+ # optional.  index = 0 ==> all the types and names.
+ sub get_declaration($)
+ {
+   my ($self, $index) = @_;
+ 
+   $index = 0 unless defined $index;
+   my $out = "";
+ 
+   $out = "static " if($$self{static});
+   $out = $out . "$$self{rettype} " if($$self{rettype});
+   $out = $out . $$self{name} . "(" .
+     $self->args_types_and_names_with_default_values($index) . ")";
+   $out = $out . " const" if $$self{const};
+   $out = $out . ";";
+ 
+   return $out;
+ }
+ 
+ # int get_num_possible_args_list();
+ # Returns the number of possible argument list based on whether some args are
+ # optional.
+ sub get_num_possible_args_list()
+ {
+   my ($self) = @_;
+ 
+   my $possible_args_list = $$self{possible_args_list};
+ 
+   if(defined($possible_args_list))
+   {
+     return @$possible_args_list;
+   }
+   else
+   {
+     return 1;
+   }
+ }
+ 
  1; # indicate proper module load.
 -
diff --cc tools/pm/GtkDefs.pm
index 17f9629,2111d50..4eb9872
--- a/tools/pm/GtkDefs.pm
+++ b/tools/pm/GtkDefs.pm
@@@ -17,9 -17,9 +17,10 @@@
  # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
  #
  package GtkDefs;
 +
  use strict;
  use warnings;
+ use open IO => ":utf8";
  
  use Util;
  use Enum;
@@@ -72,20 -184,16 +71,24 @@@ sub split_tokens($
    my $backslash = 0;
    # index of first opening paren - beginning of a new token.
    my $begin_token = 0;
 +  # current line number
 +  my $line_number = 1;
 +  # current token line number
 +  my $token_line_number = 1;
  
-   for (my $index = 0; $index < $len; ++$index)
+   # Isolate characters with special significance for the token split.
 -  my @substrings = split(/([\\"'()])/, $token_string);
++  my @substrings = split(/([\\"'()\n])/, $token_string);
+ 
+   my $index = -1;
+   for my $substring (@substrings)
    {
-     my $char = substr ($token_string, $index, 1);
+     $index++;
      # if we are inside double quotes.
 -    if ($inside_dquotes)
 +    if ($char eq "\n")
 +    {
 +      ++$line_number;
 +    }
 +    elsif ($inside_dquotes)
      {
        # if prevous char was backslash, then current char is not important -
        # we are still inside double or double/single quotes anyway.
@@@ -152,11 -259,8 +155,10 @@@
        $parens--;
        unless ($parens)
        {
-         my $token_len = $index + 1 - $begin_token;
-         my $token = substr ($token_string, $begin_token, $token_len);
+         my $token = join('', @substrings[$begin_token .. $index]);
 -        push(@tokens, $token);
 +
 +        $token =~ s/\s+/ /g;
 +        push (@{$tokens_a_r}, { $g_l_n => $token_line_number, $g_t => $token });
        }
      }
      # do nothing on other chars.



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