[glibmm/gmmproc-refactor: 20/23] Add some subclasses of generated modules.
- From: Krzesimir Nowak <krnowak src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glibmm/gmmproc-refactor: 20/23] Add some subclasses of generated modules.
- Date: Mon, 26 Sep 2011 13:16:44 +0000 (UTC)
commit d72079cac92f8508e63fe3f7f494f59887f0bb20
Author: Krzesimir Nowak <qdlacz gmail com>
Date: Mon Sep 26 14:58:53 2011 +0200
Add some subclasses of generated modules.
tools/pm/Gir/Handlers/Alias.pm | 66 +++++++++++++++++++++
tools/pm/Gir/Handlers/Bitfield.pm | 67 +++++++++++++++++++++
tools/pm/Gir/Handlers/Callback.pm | 72 +++++++++++++++++++++++
tools/pm/Gir/Handlers/Class.pm | 102 ++++++++++++++++++++++++++++++++
tools/pm/Gir/Handlers/Constant.pm | 62 ++++++++++++++++++++
tools/pm/Gir/Handlers/Enumeration.pm | 72 +++++++++++++++++++++++
tools/pm/Gir/Handlers/Function.pm | 72 +++++++++++++++++++++++
tools/pm/Gir/Handlers/Interface.pm | 92 +++++++++++++++++++++++++++++
tools/pm/Gir/Handlers/Namespace.pm | 106 ++++++++++++++++++++++++++++++++++
tools/pm/Gir/Handlers/Record.pm | 87 ++++++++++++++++++++++++++++
tools/pm/Gir/Handlers/Repository.pm | 102 +++++++++++++++++---------------
tools/pm/Gir/Handlers/TopLevel.pm | 65 ++++++++++++++------
tools/pm/Gir/Handlers/Union.pm | 87 ++++++++++++++++++++++++++++
13 files changed, 984 insertions(+), 68 deletions(-)
---
diff --git a/tools/pm/Gir/Handlers/Alias.pm b/tools/pm/Gir/Handlers/Alias.pm
new file mode 100644
index 0000000..555c622
--- /dev/null
+++ b/tools/pm/Gir/Handlers/Alias.pm
@@ -0,0 +1,66 @@
+## Copyright 2011 Krzesimir Nowak
+##
+## This program is free software; you can redistribute it and/or modify
+## it under the terms of the GNU General Public License as published by
+## the Free Software Foundation; either version 2 of the License, or
+## (at your option) any later version.
+##
+## This program is distributed in the hope that it will be useful,
+## but WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+## GNU General Public License for more details.
+##
+## You should have received a copy of the GNU General Public License
+## along with this program; if not, write to the Free Software
+## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
+##
+
+package Gir::Handlers::Alias;
+
+use strict;
+use warnings;
+
+use parent qw(Gir::Handlers::Generated::Alias);
+
+use Gir::Parser;
+
+##
+## private:
+##
+sub _doc_start_impl ($$$)
+{
+ my ($self, $parser, $params) = @_;
+}
+
+sub _type_start_impl ($$$)
+{
+ my ($self, $parser, $params) = @_;
+}
+
+sub _setup_subhandlers ($)
+{
+ my $self = shift;
+
+ $self->_set_subhandlers
+ ({
+ '*' => 'Gir::Handlers::Ignore'
+ });
+}
+
+##
+## public:
+##
+sub new ($)
+{
+ my $type = shift;
+ my $class = (ref ($type) or $type or 'Gir::Handlers::Alias');
+ my $self = $class->SUPER::new ();
+
+ $self->_set_end_ignores
+ ({
+ '*' => undef
+ });
+ return bless ($self, $class);
+}
+
+1; # indicate proper module load.
diff --git a/tools/pm/Gir/Handlers/Bitfield.pm b/tools/pm/Gir/Handlers/Bitfield.pm
new file mode 100644
index 0000000..44fa38c
--- /dev/null
+++ b/tools/pm/Gir/Handlers/Bitfield.pm
@@ -0,0 +1,67 @@
+## Copyright 2011 Krzesimir Nowak
+##
+## This program is free software; you can redistribute it and/or modify
+## it under the terms of the GNU General Public License as published by
+## the Free Software Foundation; either version 2 of the License, or
+## (at your option) any later version.
+##
+## This program is distributed in the hope that it will be useful,
+## but WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+## GNU General Public License for more details.
+##
+## You should have received a copy of the GNU General Public License
+## along with this program; if not, write to the Free Software
+## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
+##
+
+package Gir::Handlers::Bitfield;
+
+use strict;
+use warnings;
+
+use parent qw(Gir::Handlers::Generated::Bitfield);
+
+use Gir::Handlers::Ignore;
+use Gir::Parser;
+
+##
+## private:
+##
+sub _doc_start_impl ($$$)
+{
+ my ($self, $parser, $params) = @_;
+}
+
+sub _member_start_impl ($$$)
+{
+ my ($self, $parser, $params) = @_;
+}
+
+sub _setup_subhandlers ($)
+{
+ my $self = shift;
+
+ $self->_set_subhandlers
+ ({
+ '*' => 'Gir::Handlers::Ignore'
+ });
+}
+
+##
+## public:
+##
+sub new ($)
+{
+ my $type = shift;
+ my $class = (ref ($type) or $type or 'Gir::Handlers::Bitfield');
+ my $self = $class->SUPER::new ();
+
+ $self->_set_end_ignores
+ ({
+ '*' => undef
+ });
+ return bless ($self, $class);
+}
+
+1; # indicate proper module load.
diff --git a/tools/pm/Gir/Handlers/Callback.pm b/tools/pm/Gir/Handlers/Callback.pm
new file mode 100644
index 0000000..11fc43b
--- /dev/null
+++ b/tools/pm/Gir/Handlers/Callback.pm
@@ -0,0 +1,72 @@
+## Copyright 2011 Krzesimir Nowak
+##
+## This program is free software; you can redistribute it and/or modify
+## it under the terms of the GNU General Public License as published by
+## the Free Software Foundation; either version 2 of the License, or
+## (at your option) any later version.
+##
+## This program is distributed in the hope that it will be useful,
+## but WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+## GNU General Public License for more details.
+##
+## You should have received a copy of the GNU General Public License
+## along with this program; if not, write to the Free Software
+## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
+##
+
+package Gir::Handlers::Callback;
+
+use strict;
+use warnings;
+
+use parent qw(Gir::Handlers::Generated::Callback);
+
+use Gir::Handlers::Ignore;
+use Gir::Parser;
+
+##
+## private:
+##
+sub _doc_start_impl ($$$)
+{
+ my ($self, $parser, $params) = @_;
+}
+
+sub _parameters_start_impl ($$$)
+{
+ my ($self, $parser, $params) = @_;
+}
+
+sub _return_value_start_impl ($$$)
+{
+ my ($self, $parser, $params) = @_;
+}
+
+sub _setup_subhandlers ($)
+{
+ my $self = shift;
+
+ $self->_set_subhandlers
+ ({
+ '*' => 'Gir::Handlers::Ignore'
+ });
+}
+
+##
+## public:
+##
+sub new ($)
+{
+ my $type = shift;
+ my $class = (ref ($type) or $type or 'Gir::Handlers::Callback');
+ my $self = $class->SUPER::new ();
+
+ $self->_set_end_ignores
+ ({
+ '*' => undef
+ });
+ return bless ($self, $class);
+}
+
+1; # indicate proper module load.
diff --git a/tools/pm/Gir/Handlers/Class.pm b/tools/pm/Gir/Handlers/Class.pm
new file mode 100644
index 0000000..9d9f009
--- /dev/null
+++ b/tools/pm/Gir/Handlers/Class.pm
@@ -0,0 +1,102 @@
+## Copyright 2011 Krzesimir Nowak
+##
+## This program is free software; you can redistribute it and/or modify
+## it under the terms of the GNU General Public License as published by
+## the Free Software Foundation; either version 2 of the License, or
+## (at your option) any later version.
+##
+## This program is distributed in the hope that it will be useful,
+## but WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+## GNU General Public License for more details.
+##
+## You should have received a copy of the GNU General Public License
+## along with this program; if not, write to the Free Software
+## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
+##
+
+package Gir::Handlers::Class;
+
+use strict;
+use warnings;
+
+use parent qw(Gir::Handlers::Generated::Class);
+
+use Gir::Handlers::Ignore;
+use Gir::Parser;
+
+##
+## private:
+##
+sub _constructor_start_impl ($$$)
+{
+ my ($self, $parser, $params) = @_;
+}
+
+sub _doc_start_impl ($$$)
+{
+ my ($self, $parser, $params) = @_;
+}
+
+sub _field_start_impl ($$$)
+{
+ my ($self, $parser, $params) = @_;
+}
+
+sub _function_start_impl ($$$)
+{
+ my ($self, $parser, $params) = @_;
+}
+
+sub _glib_signal_start_impl ($$$)
+{
+ my ($self, $parser, $params) = @_;
+}
+
+sub _implements_start_impl ($$$)
+{
+ my ($self, $parser, $params) = @_;
+}
+
+sub _method_start_impl ($$$)
+{
+ my ($self, $parser, $params) = @_;
+}
+
+sub _property_start_impl ($$$)
+{
+ my ($self, $parser, $params) = @_;
+}
+
+sub _virtual_method_start_impl ($$$)
+{
+ my ($self, $parser, $params) = @_;
+}
+
+sub _setup_subhandlers ($)
+{
+ my $self = shift;
+
+ $self->_set_subhandlers
+ ({
+ '*' => 'Gir::Handlers::Ignore'
+ });
+}
+
+##
+## public:
+##
+sub new ($)
+{
+ my $type = shift;
+ my $class = (ref ($type) or $type or 'Gir::Handlers::Class');
+ my $self = $class->SUPER::new ();
+
+ $self->_set_end_ignores
+ ({
+ '*' => undef
+ });
+ return bless ($self, $class);
+}
+
+1; # indicate proper module load.
diff --git a/tools/pm/Gir/Handlers/Constant.pm b/tools/pm/Gir/Handlers/Constant.pm
new file mode 100644
index 0000000..c2d7922
--- /dev/null
+++ b/tools/pm/Gir/Handlers/Constant.pm
@@ -0,0 +1,62 @@
+## Copyright 2011 Krzesimir Nowak
+##
+## This program is free software; you can redistribute it and/or modify
+## it under the terms of the GNU General Public License as published by
+## the Free Software Foundation; either version 2 of the License, or
+## (at your option) any later version.
+##
+## This program is distributed in the hope that it will be useful,
+## but WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+## GNU General Public License for more details.
+##
+## You should have received a copy of the GNU General Public License
+## along with this program; if not, write to the Free Software
+## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
+##
+
+package Gir::Handlers::Constant;
+
+use strict;
+use warnings;
+
+use parent qw(Gir::Handlers::Generated::Constant);
+
+use Gir::Handlers::Ignore;
+use Gir::Parser;
+
+##
+## private:
+##
+sub _type_start_impl ($$$)
+{
+ my ($self, $parser, $params) = @_;
+}
+
+sub _setup_subhandlers ($)
+{
+ my $self = shift;
+
+ $self->_set_subhandlers
+ ({
+ '*' => 'Gir::Handlers::Ignore'
+ });
+}
+
+##
+## public:
+##
+sub new ($)
+{
+ my $type = shift;
+ my $class = (ref ($type) or $type or 'Gir::Handlers::Constant');
+ my $self = $class->SUPER::new ();
+
+ $self->_set_end_ignores
+ ({
+ 'type' => undef
+ });
+ return bless ($self, $class);
+}
+
+1; # indicate proper module load.
diff --git a/tools/pm/Gir/Handlers/Enumeration.pm b/tools/pm/Gir/Handlers/Enumeration.pm
new file mode 100644
index 0000000..46a174b
--- /dev/null
+++ b/tools/pm/Gir/Handlers/Enumeration.pm
@@ -0,0 +1,72 @@
+## Copyright 2011 Krzesimir Nowak
+##
+## This program is free software; you can redistribute it and/or modify
+## it under the terms of the GNU General Public License as published by
+## the Free Software Foundation; either version 2 of the License, or
+## (at your option) any later version.
+##
+## This program is distributed in the hope that it will be useful,
+## but WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+## GNU General Public License for more details.
+##
+## You should have received a copy of the GNU General Public License
+## along with this program; if not, write to the Free Software
+## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
+##
+
+package Gir::Handlers::Enumeration;
+
+use strict;
+use warnings;
+
+use parent qw(Gir::Handlers::Generated::Enumeration);
+
+use Gir::Handlers::Ignore;
+use Gir::Parser;
+
+##
+## private:
+##
+sub _doc_start_impl ($$$)
+{
+ my ($self, $parser, $params) = @_;
+}
+
+sub _function_start_impl ($$$)
+{
+ my ($self, $parser, $params) = @_;
+}
+
+sub _member_start_impl ($$$)
+{
+ my ($self, $parser, $params) = @_;
+}
+
+sub _setup_subhandlers ($)
+{
+ my $self = shift;
+
+ $self->_set_subhandlers
+ ({
+ '*' => 'Gir::Handlers::Ignore'
+ });
+}
+
+##
+## public:
+##
+sub new ($)
+{
+ my $type = shift;
+ my $class = (ref ($type) or $type or 'Gir::Handlers::Enumeration');
+ my $self = $class->SUPER::new ();
+
+ $self->_set_end_ignores
+ ({
+ '*' => undef
+ });
+ return bless ($self, $class);
+}
+
+1; # indicate proper module load.
diff --git a/tools/pm/Gir/Handlers/Function.pm b/tools/pm/Gir/Handlers/Function.pm
new file mode 100644
index 0000000..101f962
--- /dev/null
+++ b/tools/pm/Gir/Handlers/Function.pm
@@ -0,0 +1,72 @@
+## Copyright 2011 Krzesimir Nowak
+##
+## This program is free software; you can redistribute it and/or modify
+## it under the terms of the GNU General Public License as published by
+## the Free Software Foundation; either version 2 of the License, or
+## (at your option) any later version.
+##
+## This program is distributed in the hope that it will be useful,
+## but WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+## GNU General Public License for more details.
+##
+## You should have received a copy of the GNU General Public License
+## along with this program; if not, write to the Free Software
+## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
+##
+
+package Gir::Handlers::Function;
+
+use strict;
+use warnings;
+
+use parent qw(Gir::Handlers::Generated::Function);
+
+use Gir::Handlers::Ignore;
+use Gir::Parser;
+
+##
+## private:
+##
+sub _doc_start_impl ($$$)
+{
+ my ($self, $parser, $params) = @_;
+}
+
+sub _parameters_start_impl ($$$)
+{
+ my ($self, $parser, $params) = @_;
+}
+
+sub _return_value_start_impl ($$$)
+{
+ my ($self, $parser, $params) = @_;
+}
+
+sub _setup_subhandlers ($)
+{
+ my $self = shift;
+
+ $self->_set_subhandlers
+ ({
+ '*' => 'Gir::Handlers::Ignore'
+ });
+}
+
+##
+## public:
+##
+sub new ($)
+{
+ my $type = shift;
+ my $class = (ref ($type) or $type or 'Gir::Handlers::Function');
+ my $self = $class->SUPER::new ();
+
+ $self->_set_end_ignores
+ ({
+ '*' => undef
+ });
+ return bless ($self, $class);
+}
+
+1; # indicate proper module load.
diff --git a/tools/pm/Gir/Handlers/Interface.pm b/tools/pm/Gir/Handlers/Interface.pm
new file mode 100644
index 0000000..f814273
--- /dev/null
+++ b/tools/pm/Gir/Handlers/Interface.pm
@@ -0,0 +1,92 @@
+## Copyright 2011 Krzesimir Nowak
+##
+## This program is free software; you can redistribute it and/or modify
+## it under the terms of the GNU General Public License as published by
+## the Free Software Foundation; either version 2 of the License, or
+## (at your option) any later version.
+##
+## This program is distributed in the hope that it will be useful,
+## but WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+## GNU General Public License for more details.
+##
+## You should have received a copy of the GNU General Public License
+## along with this program; if not, write to the Free Software
+## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
+##
+
+package Gir::Handlers::Interface;
+
+use strict;
+use warnings;
+
+use parent qw(Gir::Handlers::Generated::Interface);
+
+use Gir::Handlers::Ignore;
+use Gir::Parser;
+
+##
+## private:
+##
+sub _doc_start_impl ($$$)
+{
+ my ($self, $parser, $params) = @_;
+}
+
+sub _function_start_impl ($$$)
+{
+ my ($self, $parser, $params) = @_;
+}
+
+sub _glib_signal_start_impl ($$$)
+{
+ my ($self, $parser, $params) = @_;
+}
+
+sub _method_start_impl ($$$)
+{
+ my ($self, $parser, $params) = @_;
+}
+
+sub _prerequisite_start_impl ($$$)
+{
+ my ($self, $parser, $params) = @_;
+}
+
+sub _property_start_impl ($$$)
+{
+ my ($self, $parser, $params) = @_;
+}
+
+sub _virtual_method_start_impl ($$$)
+{
+ my ($self, $parser, $params) = @_;
+}
+
+sub _setup_subhandlers ($)
+{
+ my $self = shift;
+
+ $self->_set_subhandlers
+ ({
+ '*' => 'Gir::Handlers::Ignore'
+ });
+}
+
+##
+## public:
+##
+sub new ($)
+{
+ my $type = shift;
+ my $class = (ref ($type) or $type or 'Gir::Handlers::Interface');
+ my $self = $class->SUPER::new ();
+
+ $self->_set_end_ignores
+ ({
+ '*' => undef
+ });
+ return bless ($self, $class);
+}
+
+1; # indicate proper module load.
diff --git a/tools/pm/Gir/Handlers/Namespace.pm b/tools/pm/Gir/Handlers/Namespace.pm
new file mode 100644
index 0000000..e0364a0
--- /dev/null
+++ b/tools/pm/Gir/Handlers/Namespace.pm
@@ -0,0 +1,106 @@
+## Copyright 2011 Krzesimir Nowak
+##
+## This program is free software; you can redistribute it and/or modify
+## it under the terms of the GNU General Public License as published by
+## the Free Software Foundation; either version 2 of the License, or
+## (at your option) any later version.
+##
+## This program is distributed in the hope that it will be useful,
+## but WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+## GNU General Public License for more details.
+##
+## You should have received a copy of the GNU General Public License
+## along with this program; if not, write to the Free Software
+## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
+##
+
+package Gir::Handlers::Namespace;
+
+use strict;
+use warnings;
+
+use parent qw(Gir::Handlers::Generated::Namespace);
+
+use Gir::Handlers::Alias;
+use Gir::Handlers::Bitfield;
+use Gir::Handlers::Callback;
+use Gir::Handlers::Class;
+use Gir::Handlers::Constant;
+use Gir::Handlers::Enumeration;
+use Gir::Handlers::Function;
+use Gir::Handlers::Interface;
+use Gir::Handlers::Record;
+use Gir::Handlers::Union;
+use Gir::Parser;
+
+##
+## private:
+##
+sub _alias_start_impl ($$$)
+{
+ my ($self, $parser, $params) = @_;
+}
+
+sub _bitfield_start_impl ($$$)
+{
+ my ($self, $parser, $params) = @_;
+}
+
+sub _callback_start_impl ($$$)
+{
+ my ($self, $parser, $params) = @_;
+}
+
+sub _class_start_impl ($$$)
+{
+ my ($self, $parser, $params) = @_;
+}
+
+sub _constant_start_impl ($$$)
+{
+ my ($self, $parser, $params) = @_;
+}
+
+sub _enumeration_start_impl ($$$)
+{
+ my ($self, $parser, $params) = @_;
+}
+
+sub _function_start_impl ($$$)
+{
+ my ($self, $parser, $params) = @_;
+}
+
+sub _interface_start_impl ($$$)
+{
+ my ($self, $parser, $params) = @_;
+}
+
+sub _record_start_impl ($$$)
+{
+ my ($self, $parser, $params) = @_;
+}
+
+sub _union_start_impl ($$$)
+{
+ my ($self, $parser, $params) = @_;
+}
+
+##
+## public:
+##
+sub new ($)
+{
+ my $type = shift;
+ my $class = (ref ($type) or $type or 'Gir::Handlers::Namespace');
+ my $self = $class->SUPER::new ();
+
+ $self->_set_end_ignores
+ ({
+ '*' => undef
+ });
+ return bless ($self, $class);
+}
+
+1; # indicate proper module load.
diff --git a/tools/pm/Gir/Handlers/Record.pm b/tools/pm/Gir/Handlers/Record.pm
new file mode 100644
index 0000000..ede22fb
--- /dev/null
+++ b/tools/pm/Gir/Handlers/Record.pm
@@ -0,0 +1,87 @@
+## Copyright 2011 Krzesimir Nowak
+##
+## This program is free software; you can redistribute it and/or modify
+## it under the terms of the GNU General Public License as published by
+## the Free Software Foundation; either version 2 of the License, or
+## (at your option) any later version.
+##
+## This program is distributed in the hope that it will be useful,
+## but WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+## GNU General Public License for more details.
+##
+## You should have received a copy of the GNU General Public License
+## along with this program; if not, write to the Free Software
+## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
+##
+
+package Gir::Handlers::Record;
+
+use strict;
+use warnings;
+
+use parent qw(Gir::Handlers::Generated::Record);
+
+use Gir::Handlers::Ignore;
+use Gir::Parser;
+
+##
+## private:
+##
+sub _constructor_start_impl ($$$)
+{
+ my ($self, $parser, $params) = @_;
+}
+
+sub _doc_start_impl ($$$)
+{
+ my ($self, $parser, $params) = @_;
+}
+
+sub _field_start_impl ($$$)
+{
+ my ($self, $parser, $params) = @_;
+}
+
+sub _function_start_impl ($$$)
+{
+ my ($self, $parser, $params) = @_;
+}
+
+sub _method_start_impl ($$$)
+{
+ my ($self, $parser, $params) = @_;
+}
+
+sub _union_start_impl ($$$)
+{
+ my ($self, $parser, $params) = @_;
+}
+
+sub _setup_subhandlers ($)
+{
+ my $self = shift;
+
+ $self->_set_subhandlers
+ ({
+ '*' => 'Gir::Handlers::Ignore'
+ });
+}
+
+##
+## public:
+##
+sub new ($)
+{
+ my $type = shift;
+ my $class = (ref ($type) or $type or 'Gir::Handlers::Record');
+ my $self = $class->SUPER::new ();
+
+ $self->_set_end_ignores
+ ({
+ '*' => undef
+ });
+ return bless ($self, $class);
+}
+
+1; # indicate proper module load.
diff --git a/tools/pm/Gir/Handlers/Repository.pm b/tools/pm/Gir/Handlers/Repository.pm
index baf34b7..80436a5 100644
--- a/tools/pm/Gir/Handlers/Repository.pm
+++ b/tools/pm/Gir/Handlers/Repository.pm
@@ -1,39 +1,68 @@
+## Copyright 2011 Krzesimir Nowak
+##
+## This program is free software; you can redistribute it and/or modify
+## it under the terms of the GNU General Public License as published by
+## the Free Software Foundation; either version 2 of the License, or
+## (at your option) any later version.
+##
+## This program is distributed in the hope that it will be useful,
+## but WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+## GNU General Public License for more details.
+##
+## You should have received a copy of the GNU General Public License
+## along with this program; if not, write to the Free Software
+## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
+##
+
package Gir::Handlers::Repository;
use strict;
use warnings;
-use parent qw(Gir::Handlers::Base);
+use parent qw(Gir::Handlers::Generated::Repository);
-use Gir::Handlers::Common;
use Gir::Handlers::Ignore;
use Gir::Handlers::Namespace;
-use Gir::Handlers::Store;
use Gir::Parser;
##
## private:
##
-sub _namespace_start ($$@)
+sub _include_start_impl ($$$)
+{
+ my ($self, $parser, $params) = @_;
+
+ $parser->parse_file ($params->{'name'} . '-' . $params->{'version'} . '.gir');
+}
+
+sub _namespace_start_impl ($$$)
{
- my ($self, $parser, @atts_vals) = @_;
- my $params = Gir::Handlers::Common::extract_values (['name', 'version', 'shared-library', 'c:identifier-prefixes', 'c:symbol-prefixes'], [], \ atts_vals, 'namespace');
+ my ($self, $parser, $params) = @_;
my $api = $parser->get_api ();
my $name = $params->{'name'};
- if ($api->has_namespace ($name))
- {
+ #if ($api->has_namespace ($name))
+ #{
# TODO: error? every gir probably should have different namespace, right?
- }
- $api->add_namespace ($name);
+ #}
+ #$api->add_namespace ($name);
+
+ my $state = $parser->get_current_state ();
+
+ print STDOUT 'Parsing ' . $state->get_parsed_file () . "\n";
+ $state->set_current_namespace ($name);
}
-sub _include_start ($$@)
+sub _setup_subhandlers ($)
{
- my ($self, $parser, @atts_vals) = @_;
- my $params = extract_values_warn (['name', 'version'], [], \ atts_vals, 'include');
+ my $self = shift;
- $parser->parse_file ($params->{'name'} . '-' . $params->{'version'});
+ $self->_set_subhandlers
+ ({
+ 'namespace' => 'Gir::Handlers::Namespace',
+ '*' => 'Gir::Handlers::Ignore'
+ });
}
##
@@ -43,41 +72,18 @@ sub new ($)
{
my $type = shift;
my $class = (ref ($type) or $type or 'Gir::Handlers::Repository');
- my $self = $class->SUPER->new ();
-
- $self->_set_handlers
- (
- Gir::Handlers::Store->new
- ({
- 'c:include' => \&Gir::Handlers::Common::start_ignore,
- 'implementation' => \&Gir::Handlers::Common::start_ignore,
- 'include' => \&_include_start,
- 'namespace' => \&_namespace_start,
- 'package' => \&Gir::Handlers::Common::start_ignore
- }),
- Gir::Handlers::Store->new
- ({
- 'c:include' => \&Gir::Handlers::Common::end_ignore,
- 'implementation' => \&Gir::Handlers::Common::end_ignore,
- 'include' => \&Gir::Handlers::Common::end_ignore,
- 'namespace' => \&Gir::Handlers::Common::end_ignore,
- 'package' => \&Gir::Handlers::Common::end_ignore
- })
- );
+ my $self = $class->SUPER::new ();
+ $self->_set_start_ignores
+ ({
+ 'c:include' => undef,
+ 'package' => undef
+ });
+ $self->_set_end_ignores
+ ({
+ '*' => undef
+ });
return bless ($self, $class);
}
-sub get_subhandlers_for ($$)
-{
- my ($self, $elem) = @_;
-
- if ($elem eq 'namespace')
- {
- return Gir::Handlers::Namespace->new ();
- }
- # rest is either ignored or has no children
- return Gir::Handlers::Ignore->new ();
-}
-
-1;
+1; # indicate proper module load.
diff --git a/tools/pm/Gir/Handlers/TopLevel.pm b/tools/pm/Gir/Handlers/TopLevel.pm
index 59fd9f6..fa4dacb 100644
--- a/tools/pm/Gir/Handlers/TopLevel.pm
+++ b/tools/pm/Gir/Handlers/TopLevel.pm
@@ -1,37 +1,62 @@
+## Copyright 2011 Krzesimir Nowak
+##
+## This program is free software; you can redistribute it and/or modify
+## it under the terms of the GNU General Public License as published by
+## the Free Software Foundation; either version 2 of the License, or
+## (at your option) any later version.
+##
+## This program is distributed in the hope that it will be useful,
+## but WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+## GNU General Public License for more details.
+##
+## You should have received a copy of the GNU General Public License
+## along with this program; if not, write to the Free Software
+## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
+##
+
package Gir::Handlers::TopLevel;
use strict;
use warnings;
-use parent qw(Gir::Handlers::Base);
+use parent qw(Gir::Handlers::Generated::TopLevel);
-use Gir::Handlers::Common;
use Gir::Handlers::Repository;
-use Gir::Handlers::Store;
##
-## public:
+## private:
##
-sub new ($)
+sub _gen_subhandlers ($$)
{
- my $type = shift;
- my $class = (ref ($type) or $type or 'Gir::Handlers::TopLevel');
- my $self = $class->SUPER->new ();
+ my (undef, $tags) = @_;
+ my %subhandlers = map { $_ => 'Gir::Handlers::' . Gir::Handlers::Generated::Common::Misc::module_from_tag ($_) } @{$tags};
- $self->_set_handlers
- (
- Gir::Handlers::Store->new ({ 'repository' => \&Gir::Handlers::Common::start_ignore }),
- Gir::Handlers::Store->new ({ 'repository' => \&Gir::Handlers::Common::end_ignore })
- );
-
- return bless ($self, $class);
+ return \%subhandlers;
}
-sub get_subhandlers_for ($$)
+##
+## public:
+##
+sub new ($)
{
- my ($self, $elem) = @_;
-
- return Gir::Handlers::Repository->new ();
+ my $type = shift;
+ my $class = (ref ($type) or $type or 'Gir::Handlers::TopLevel');
+ my $self = $class->SUPER::new ();
+
+ $self = bless ($self, $class);
+ $self->_set_generator (\&_gen_subhandlers);
+ $self->_setup_handlers ();
+ $self->_setup_subhandlers ();
+ $self->_set_start_ignores
+ ({
+ 'repository' => undef
+ });
+ $self->_set_end_ignores
+ ({
+ 'repository' => undef
+ });
+ return $self;
}
-1;
+1; # indicate proper module load.
diff --git a/tools/pm/Gir/Handlers/Union.pm b/tools/pm/Gir/Handlers/Union.pm
new file mode 100644
index 0000000..7ec1199
--- /dev/null
+++ b/tools/pm/Gir/Handlers/Union.pm
@@ -0,0 +1,87 @@
+## Copyright 2011 Krzesimir Nowak
+##
+## This program is free software; you can redistribute it and/or modify
+## it under the terms of the GNU General Public License as published by
+## the Free Software Foundation; either version 2 of the License, or
+## (at your option) any later version.
+##
+## This program is distributed in the hope that it will be useful,
+## but WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+## GNU General Public License for more details.
+##
+## You should have received a copy of the GNU General Public License
+## along with this program; if not, write to the Free Software
+## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
+##
+
+package Gir::Handlers::Union;
+
+use strict;
+use warnings;
+
+use parent qw(Gir::Handlers::Generated::Union);
+
+use Gir::Handlers::Ignore;
+use Gir::Parser;
+
+##
+## private:
+##
+sub _constructor_start_impl ($$$)
+{
+ my ($self, $parser, $params) = @_;
+}
+
+sub _doc_start_impl ($$$)
+{
+ my ($self, $parser, $params) = @_;
+}
+
+sub _field_start_impl ($$$)
+{
+ my ($self, $parser, $params) = @_;
+}
+
+sub _function_start_impl ($$$)
+{
+ my ($self, $parser, $params) = @_;
+}
+
+sub _method_start_impl ($$$)
+{
+ my ($self, $parser, $params) = @_;
+}
+
+sub _record_start_impl ($$$)
+{
+ my ($self, $parser, $params) = @_;
+}
+
+sub _setup_subhandlers ($)
+{
+ my $self = shift;
+
+ $self->_set_subhandlers
+ ({
+ '*' => 'Gir::Handlers::Ignore'
+ });
+}
+
+##
+## public:
+##
+sub new ($)
+{
+ my $type = shift;
+ my $class = (ref ($type) or $type or 'Gir::Handlers::Union');
+ my $self = $class->SUPER::new ();
+
+ $self->_set_end_ignores
+ ({
+ '*' => undef
+ });
+ return bless ($self, $class);
+}
+
+1; # indicate proper module load.
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]