diff --git a/parser/Atk.metadata b/parser/Atk.metadata
deleted file mode 100644
index bb1f17e50..000000000
--- a/parser/Atk.metadata
+++ /dev/null
@@ -1,28 +0,0 @@
-
-
-
-
-
-
- GetDocument
-
-
-
- name
- GetTheDocument
-
-
-
-
-
- SetDocument
-
-
-
- name
- SetTheDocument
-
-
-
-
-
diff --git a/parser/Gdk.metadata b/parser/Gdk.metadata
deleted file mode 100644
index d78bd433e..000000000
--- a/parser/Gdk.metadata
+++ /dev/null
@@ -1,110 +0,0 @@
-
-
-
-
-
-
- gdk_pixbuf_new_from_file
-
-
-
- preferred
- 1
-
-
-
-
-
-
-
- Write
-
-
-
- const-guchar*
- array
- 1
-
-
-
-
-
-
-
- gdk_pixmap_new
-
-
-
- GdkWindow*
- null_ok
- 1
-
-
-
-
-
-
-
-
-
-
-
- parent
- GdkDrawable
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- RenderThresholdAlpha
- RenderToDrawable
- RenderToDrawableAlpha
- RenderPixmapAndMaskForColormap
- RenderPixmapAndMask
- GetFromDrawable
- GetFromImage
-
-
-
- library
- gdk-x11-2.0
-
-
-
-
-
-
-
- GetPointer
-
-
-
- gint*
- pass_as
- out
-
-
-
-
-
- GetPointer
-
-
-
- GdkModifierType*
- pass_as
- out
-
-
-
-
-
diff --git a/parser/Gnome.metadata b/parser/Gnome.metadata
deleted file mode 100644
index 9314b7020..000000000
--- a/parser/Gnome.metadata
+++ /dev/null
@@ -1,229 +0,0 @@
-
-
-
-
-
-
- ClearPrompt
-
-
-
- name
- PromptCleared
-
-
-
-
-
- Connect
-
-
-
- name
- Connected
-
-
-
-
-
- Disconnect
-
-
-
- name
- Disconnected
-
-
-
-
-
- Back
-
-
-
- name
- BackClicked
-
-
-
-
-
- Finish
-
-
-
- name
- FinishClicked
-
-
-
-
-
- Cancel
-
-
-
- name
- CancelClicked
-
-
-
-
-
- Next
-
-
-
- name
- NextClicked
-
-
-
-
-
- Prepare
-
-
-
- name
- Prepared
-
-
-
-
-
- FocusIcon
-
-
-
- name
- IconFocused
-
-
-
-
-
- GtkEntry
-
-
-
- name
- GetGtkEntry
-
-
-
-
-
- Activate
-
-
-
- name
- Activated
-
-
-
-
-
- SelectIcon
-
-
-
- name
- IconSelected
-
-
-
-
-
- UnselectIcon
-
-
-
- name
- IconUnselected
-
-
-
-
-
- Activate
-
-
-
- name
- Activated
-
-
-
-
-
- Event
-
-
-
- name
- CanvasEvent
-
-
-
-
-
-
-
- GnomeEntry
- GtkEntry
-
-
- PickDialog
-
-
-
- hidden
- 1
-
-
-
-
-
-
-
- gnome_about_new
-
-
-
- const-gchar**
- array
- 1
-
-
-
-
-
-
-
- gnome_icon_list_new
-
-
-
- GtkAdjustment*
- null_ok
- 1
-
-
-
-
-
- gnome_icon_list_set_hadjustment
- gnome_icon_list_set_vadjustment
-
-
-
- GtkAdjustment*
- null_ok
- 1
-
-
-
-
-
diff --git a/parser/Gtk.metadata b/parser/Gtk.metadata
deleted file mode 100644
index cf99bc6dd..000000000
--- a/parser/Gtk.metadata
+++ /dev/null
@@ -1,1805 +0,0 @@
-
-
-
-
-
-
- GetIterAtLineOffset
- GetIterAtLineIndex
- GetIterAtOffset
- GetIterAtLine
- GetStartIter
- GetEndIter
- GetBounds
- GetIterAtMark
- GetIterAtChildAnchor
- GetSelectionBounds
-
-
- GetIterAtLine
-
-
- GetIterAtLocation
- GetLineAtY
-
-
-
- GtkTextIter*
- pass_as
- out
-
-
-
-
-
- InsertText
-
-
-
- gint*
- pass_as
- out
-
-
-
-
-
- Append
- Insert
- InsertAfter
- InsertBefore
- Prepend
- Remove
-
-
-
- iter
- pass_as
- out
-
-
-
-
-
- ConvertChildIterToIter
-
-
-
- sort_iter
- pass_as
- out
-
-
-
-
-
- GetIter
- GetIterFirst
- GetIterFromString
- IterChildren
- IterNext
- IterNthChild
- IterParent
-
-
-
- iter
- pass_as
- out
-
-
-
-
-
- ConvertIterToChildIter
-
-
-
- child_iter
- pass_as
- out
-
-
-
-
-
- GetSelected
-
-
-
- iter
- pass_as
- out
-
-
-
-
-
- Append
- Insert
- InsertAfter
- InsertBefore
- Prepend
- Remove
-
-
-
- iter
- pass_as
- out
-
-
-
-
-
-
-
- gtk_tree_store_newv
-
-
-
- va_type
- length_param
-
-
-
-
-
- gtk_list_store_newv
-
-
-
- va_type
- length_param
-
-
-
-
-
-
-
- GetSelections
-
-
-
- array
- 1
-
-
-
-
-
-
-
-
- gtk_button_new_with_mnemonic
-
-
- gtk_check_button_new_with_mnemonic
-
-
- gtk_radio_button_new_with_mnemonic
-
-
- gtk_toggle_button_new_with_mnemonic
-
-
- gtk_label_new
-
-
- gtk_menu_item_new_with_mnemonic
-
-
- gtk_check_menu_item_new_with_mnemonic
-
-
- gtk_radio_menu_item_new_with_mnemonic
-
-
- gtk_image_menu_item_new_with_mnemonic
-
-
-
- preferred
- 1
-
-
-
-
-
-
-
- GetEditable
-
-
-
- name
- GetIsEditable
-
-
-
-
-
- SetEditable
-
-
-
- name
- SetIsEditable
-
-
-
-
-
- Add
-
-
-
- name
- Added
-
-
-
-
-
- Remove
-
-
-
- name
- Removed
-
-
-
-
-
- InsertText
-
-
-
- name
- TextInserted
-
-
-
-
-
- DeleteText
-
-
-
- name
- TextDeleted
-
-
-
-
-
- DeleteSurrounding
-
-
-
- name
- SurroundingDeleted
-
-
-
-
-
- Show
-
-
-
- name
- Shown
-
-
-
-
-
- Hide
-
-
-
- name
- Hidden
-
-
-
-
-
- Map
-
-
-
- name
- Mapped
-
-
-
-
-
- Unmap
-
-
-
- name
- Unmapped
-
-
-
-
-
- Realize
-
-
-
- name
- Realized
-
-
-
-
-
- Unrealize
-
-
-
- name
- Unrealized
-
-
-
-
-
- GrabFocus
-
-
-
- name
- FocusGrabbed
-
-
-
-
-
- Focus
-
-
-
- name
- Focused
-
-
-
-
-
- SizeAllocate
-
-
-
- name
- SizeAllocated
-
-
-
-
-
- MnemonicActivate
-
-
-
- name
- MnemonicActivated
-
-
-
-
-
- SizeRequest
-
-
-
- name
- SizeRequested
-
-
-
-
-
- ChildNotify
-
-
-
- name
- ChildNotified
-
-
-
-
-
- ShowHelp
-
-
-
- name
- HelpShown
-
-
-
-
-
- Event
-
-
- Event
-
-
-
- name
- ProcessEvent
-
-
-
-
-
- InsertPixbuf
-
-
-
- name
- PixbufInserted
-
-
-
-
-
- ApplyTag
-
-
-
- name
- TagApplied
-
-
-
-
-
- RemoveTag
-
-
-
- name
- TagRemoved
-
-
-
-
-
- InsertChildAnchor
-
-
-
- name
- ChildAnchorInserted
-
-
-
-
-
- RemoveChildAnchor
-
-
-
- name
- ChildAnchorRemoved
-
-
-
-
-
- GetInsert
-
-
-
- name
- GetInsertMark
-
-
-
-
-
- Select
-
-
-
- name
- Selected
-
-
-
-
-
- Deselect
-
-
-
- name
- Deselected
-
-
-
-
-
- Toggle
-
-
-
- name
- Toggled
-
-
-
-
-
- SelectChild
-
-
-
- name
- ChildSelected
-
-
-
-
-
- UnselectChild
-
-
-
- name
- ChildUnselected
-
-
-
-
-
- SelectRow
-
-
-
- name
- RowSelected
-
-
-
-
-
- UnselectRow
-
-
-
- name
- RowUnselected
-
-
-
-
-
-
- SelectChild
-
-
-
- name
- ChildSelected
-
-
-
-
-
- UnselectChild
-
-
-
- name
- ChildUnselected
-
-
-
-
-
-
- StartQuery
-
-
-
- name
- QueryStarted
-
-
-
-
-
- StopQuery
-
-
-
- name
- QueryStopped
-
-
-
-
-
- Collapse
-
-
-
- name
- Collapsed
-
-
-
-
-
- Expand
-
-
-
- name
- Expanded
-
-
-
-
-
- SetFocusChild
-
-
-
- name
- FocusChildSet
-
-
-
-
-
- PasteClipboard
-
-
-
- name
- ClipboardPasted
-
-
-
-
-
- CutClipboard
-
-
-
- name
- ClipboardCut
-
-
-
-
-
- CopyClipboard
-
-
-
- name
- ClipboardCopied
-
-
-
-
-
- PasteClipboard
-
-
-
- name
- ClipboardPasted
-
-
-
-
-
- CutClipboard
-
-
-
- name
- ClipboardCut
-
-
-
-
-
- CopyClipboard
-
-
-
- name
- ClipboardCopied
-
-
-
-
-
- Activate
-
-
- Activate
-
-
- Activate
-
-
- Activate
-
-
-
- name
- Activated
-
-
-
-
-
- Deactivate
-
-
-
- name
- Deactivated
-
-
-
-
-
- Deactivate
-
-
-
- name
- Deactivated
-
-
-
-
-
- ToggleSizeRequest
-
-
-
- name
- ToggleSizeRequested
-
-
-
-
-
- ToggleSizeAllocate
-
-
-
- name
- ToggleSizeAllocated
-
-
-
-
-
- RemoveWidget
-
-
-
- name
- WidgetRemoved
-
-
-
-
-
- SizeAllocate
-
-
-
- name
- SizeAllocated
-
-
-
-
-
- MnemonicActivate
-
-
-
- name
- MnemonicActivated
-
-
-
-
-
- SizeRequest
-
-
-
- name
- SizeRequested
-
-
-
-
-
- ChildNotify
-
-
-
- name
- ChildNotified
-
-
-
-
-
- Toggled
-
-
-
- name
- Toggle
-
-
-
-
-
- Pressed
-
-
-
- name
- Press
-
-
-
-
-
- Clicked
-
-
-
- name
- Click
-
-
-
-
-
- Released
-
-
-
- name
- Release
-
-
-
-
-
- Enter
-
-
-
- name
- Entered
-
-
-
-
-
- Leave
-
-
-
- name
- Left
-
-
-
-
-
- Deactivate
-
-
-
- name
- Deactivated
-
-
-
-
-
- RemoveWidget
-
-
-
- name
- WidgetRemoved
-
-
-
-
-
- EditingDone
-
-
-
- name
- FinishEditing
-
-
-
-
-
- ActivateDefault
-
-
-
- name
- DefaultActivated
-
-
-
-
-
- ActivateFocus
-
-
-
- name
- FocusActivated
-
-
-
-
-
- Changed
-
-
-
- name
- Change
-
-
-
-
-
- Changed
-
-
-
- name
- Change
-
-
-
-
-
-
- ValueChanged
-
-
-
- name
- ChangeValue
-
-
-
-
-
- Destroy
-
-
-
- name
- Destroyed
-
-
-
-
-
- RowActivated
-
-
-
- name
- ActivateRow
-
-
-
-
-
- RowExpanded
-
-
-
- name
- RowExpand
-
-
-
-
-
- RowDeleted
-
-
-
- name
- EmitRowDeleted
-
-
-
-
-
- RowHasChildToggled
-
-
-
- name
- EmitRowHasChildToggled
-
-
-
-
-
- RowInserted
-
-
-
- name
- EmitRowInserted
-
-
-
-
-
- RowChanged
-
-
-
- name
- EmitRowChanged
-
-
-
-
-
- RowsReordered
-
-
-
- name
- EmitRowsReordered
-
-
-
-
-
- SortColumnChanged
-
-
-
- name
- ChangeSortColumn
-
-
-
-
-
- Response
-
-
-
- name
- Respond
-
-
-
-
-
- EndUserAction
-
-
-
- name
- UserActionEnded
-
-
-
-
-
- BeginUserAction
-
-
-
- name
- UserActionBegun
-
-
-
-
-
- Toggled
-
-
-
- name
- Toggle
-
-
-
-
-
- CheckResize
-
-
-
- name
- ResizeChecked
-
-
-
-
-
- Clicked
-
-
-
- name
- Click
-
-
-
-
-
- RowMove
-
-
-
- name
- RowMoved
-
-
-
-
-
- SelectAll
-
-
-
- name
- AllSelected
-
-
-
-
-
- UndoSelection
-
-
-
- name
- SelectionUndone
-
-
-
-
-
- UnselectAll
-
-
-
- name
- AllUnselected
-
-
-
-
-
- SetScrollAdjustments
-
-
- SetScrollAdjustments
-
-
- SetScrollAdjustments
-
-
- SetScrollAdjustments
-
-
- SetScrollAdjustments
-
-
- SetScrollAdjustments
-
-
-
- name
- ScrollAdjustmentsSet
-
-
-
-
-
- Command
-
-
-
- name
- OnCommand
-
-
-
-
-
-
-
- Destroyed
-
-
-
- hidden
- 1
-
-
-
-
-
-
-
- PackStartDefaults
-
-
-
- name
- PackStart
-
-
-
-
-
- PackEndDefaults
-
-
-
- name
- PackEnd
-
-
-
-
-
- AttachDefaults
-
-
-
- name
- Attach
-
-
-
-
-
-
-
-
-
- disabledefaultconstructor
- 1
-
-
-
-
-
-
-
- SetPixmap
-
-
-
- GdkBitmap*
- null_ok
- 1
-
-
-
-
-
- InsertNode
-
-
-
- GdkPixmap*
- null_ok
- 1
-
-
-
-
-
- InsertNode
-
-
-
- GdkBitmap*
- null_ok
- 1
-
-
-
-
-
- Move
-
-
-
- GtkCTreeNode*
- null_ok
- 1
-
-
-
-
-
- NodeSetPixmap
-
-
-
- GdkBitmap*
- null_ok
- 1
-
-
-
-
-
- NodeSetPixtext
-
-
-
- GdkBitmap*
- null_ok
- 1
-
-
-
-
-
- SetNodeInfo
-
-
-
- GdkPixmap*
- null_ok
- 1
-
-
-
-
-
- SetNodeInfo
-
-
-
- GdkBitmap*
- null_ok
- 1
-
-
-
-
-
- gtk_dialog_new_with_buttons
-
-
-
- GtkWindow*
- null_ok
- 1
-
-
-
-
-
- gtk_hscale_new
-
-
-
- GtkAdjustment*
- null_ok
- 1
-
-
-
-
-
- gtk_hscrollbar_new
-
-
-
- GtkAdjustment*
- null_ok
- 1
-
-
-
-
-
- SetFromPixmap
-
-
-
- GdkBitmap*
- null_ok
- 1
-
-
-
-
-
- gtk_item_factory_new
-
-
-
- GtkAccelGroup*
- null_ok
- 1
-
-
-
-
-
- gtk_layout_new
-
-
-
- GtkAdjustment*
- null_ok
- 1
-
-
-
-
-
- SetHadjustment
-
-
-
- GtkAdjustment*
- null_ok
- 1
-
-
-
-
-
- SetVadjustment
-
-
-
- GtkAdjustment*
- null_ok
- 1
-
-
-
-
-
- gtk_message_dialog_new
-
-
-
- GtkWindow*
- null_ok
- 1
-
-
-
-
-
- gtk_pixmap_new
-
-
-
- GdkBitmap*
- null_ok
- 1
-
-
-
-
-
- Set
-
-
-
- GdkBitmap*
- null_ok
- 1
-
-
-
-
-
- gtk_progress_bar_new_with_adjustment
-
-
-
- GtkAdjustment*
- null_ok
- 1
-
-
-
-
-
- gtk_scrolled_window_new
-
-
-
- GtkAdjustment*
- null_ok
- 1
-
-
-
-
-
- Configure
-
-
-
- GtkAdjustment*
- null_ok
- 1
-
-
-
-
-
- gtk_spin_button_new
-
-
-
- GtkAdjustment*
- null_ok
- 1
-
-
-
-
-
- gtk_text_buffer_new
-
-
-
- GtkTextTagTable*
- null_ok
- 1
-
-
-
-
-
- ForwardToTagToggle
-
-
-
- GtkTextTag*
- null_ok
- 1
-
-
-
-
-
- BackwardToTagToggle
-
-
-
- GtkTextTag*
- null_ok
- 1
-
-
-
-
-
- AppendItem
-
-
-
- gpointer
- null_ok
- 1
-
-
-
-
-
- gtk_tree_view_new_with_model
-
-
-
- GtkTreeModel*
- null_ok
- 1
-
-
-
-
-
- SetModel
-
-
-
- GtkTreeModel*
- null_ok
- 1
-
-
-
-
-
- gtk_viewport_new
-
-
-
- GtkAdjustment*
- null_ok
- 1
-
-
-
-
-
- SetHadjustment
-
-
-
- GtkAdjustment*
- null_ok
- 1
-
-
-
-
-
- SetVadjustment
-
-
-
- GtkAdjustment*
- null_ok
- 1
-
-
-
-
-
- gtk_vscale_new
-
-
-
- GtkAdjustment*
- null_ok
- 1
-
-
-
-
-
- gtk_vscrollbar_new
-
-
-
- GtkAdjustment*
- null_ok
- 1
-
-
-
-
-
- SetScrollAdjustments
-
-
-
- GtkAdjustment*
- null_ok
- 1
-
-
-
-
-
- SetStyle
-
-
-
- GtkStyle*
- null_ok
- 1
-
-
-
-
-
- SetSubmenu
-
-
-
- GtkWidget*
- null_ok
- 1
-
-
-
-
-
- gtk_radio_menu_item_new_with_label
-
-
-
- GSList*
- null_ok
- 1
-
-
-
-
-
- gtk_radio_button_new
-
-
-
- GSList*
- null_ok
- 1
-
-
-
-
-
- gtk_radio_button_new_with_label
-
-
-
- GSList*
- null_ok
- 1
-
-
-
-
-
- gtk_radio_button_new_with_mnemonic
-
-
-
- GSList*
- null_ok
- 1
-
-
-
-
diff --git a/parser/Metadata.pm b/parser/Metadata.pm
deleted file mode 100644
index b5db63481..000000000
--- a/parser/Metadata.pm
+++ /dev/null
@@ -1,278 +0,0 @@
-#
-# Metadata.pm: Adds additional properties to a GApi tree.
-#
-# Author: Rachel Hestilow
-#
-# 2002 Rachel Hestilow
-##############################################################
-
-package GAPI::Metadata;
-
-use XML::LibXML;
-
-sub new {
- my $namespace = $_[1];
- my $file = "$namespace.metadata";
- my $self = {};
- @{$self->{rules}} = ();
- $self->{metadata} = $namespace;
- bless $self;
- $self->load ($file);
- return $self;
-}
-
-sub parseClass {
- my ($node, $classes) = @_;
- my %methods = ();
- my %signals = ();
- my @attrs = $node->attributes;
- my $class_name = $attrs[0]->value;
- ${$classes}{$class_name} = [\%methods, \%signals];
-
- for ($method_node = $node->firstChild; $method_node != undef; $method_node = $method_node->nextSibling ()) {
- if ($method_node->nodeName eq "method" or $method_node->nodeName eq "constructor") {
- $methods{$method_node->firstChild->nodeValue} = 1;
- } elsif ($method_node->nodeName eq "signal") {
- $signals{$method_node->firstChild->nodeValue} = 1;
- }
- }
-}
-
-sub parseData {
- my $node = $_[0];
- my @data = ();
- for ($data_node = $node->firstChild; $data_node != undef; $data_node = $data_node->nextSibling ()) {
- next if $data_node->nodeName ne "attribute";
- my @attrs = $data_node->attributes;
- my $target = $attrs[0]->value;
- my ($filter_level, $filter_value, $attr_name, $attr_value);
- my $directives = "";
- for ($attr_node = $data_node->firstChild; $attr_node != undef; $attr_node = $attr_node->nextSibling ()) {
- if ($attr_node->nodeName eq "filter") {
- my @filter_attrs = $attr_node->attributes;
- $filter_level = $filter_attrs[0]->value;
- $filter_value = $attr_node->firstChild->nodeValue;
- } elsif ($attr_node->nodeName eq "name") {
- $attr_name = $attr_node->firstChild->nodeValue;
- } elsif ($attr_node->nodeName eq "value") {
- $attr_value = $attr_node->firstChild->nodeValue;
- } elsif ($attr_node->nodeName eq "delete") {
- $directives = "delete";
- }
- }
- my @data_attr = ("attribute", $target, "filter", $filter_level, $filter_value, $attr_name, $attr_value, $directives);
- push @data, \@data_attr;
- }
-
- return @data;
-}
-
-sub load {
- my ($self, $file) = @_;
- my $parser = new XML::LibXML;
- my $doc = $parser->parse_file($file);
- my $root = $doc->documentElement;
- for ($rule_node = $root->firstChild; $rule_node != undef; $rule_node = $rule_node->nextSibling ()) {
- next if $rule_node->nodeName ne "rule";
- my %classes = ();
- my @data;
- for ($node = $rule_node->firstChild; $node != undef; $node = $node->nextSibling ()) {
- if ($node->nodeName eq "class") {
- parseClass ($node, \%classes);
- } elsif ($node->nodeName eq "data") {
- @data = parseData ($node);
- }
- }
-
- push @{$self->{rules}}, [\%classes, \@data];
- }
-}
-
-sub fixupParams {
- my ($method_node, $data_list_ref) = @_;
- my ($params_node, $node);
-
- foreach $data (@$data_list_ref) {
- if ($$data[1] eq "method" or $$data[1] eq "signal") {
- $method_node->setAttribute ($$data[5], $$data[6]);
- next;
- }
-
- for ($node = $method_node->firstChild; $node; $node = $node->nextSibling ()) {
- if ($node->nodeName eq "parameters") {
- $params_node = $node;
- last;
- } elsif ($node->nodeName eq "return-type" and $$data[1] eq "return") {
- $node->setAttribute ($$data[5], $$data[6]);
- last;
- }
- }
- next if not $params_node;
- if ($$data[1] eq "parameters") {
- $params_node->setAttribute ($$data[5], $$data[6]);
- next;
- }
-
-
- for ($node = $params_node->firstChild; $node; $node = $node->nextSibling ()) {
- my $param_type;
- my $param_name;
-
- foreach $attr ($node->attributes) {
- if ($attr->name eq "type") {
- $param_type = $attr->value;
- } elsif ($attr->name eq "name") {
- $param_name = $attr->value;
- }
- }
-
- if ($$data[3] eq "type") {
- if ($param_type eq $$data[4]) {
- $node->setAttribute ($$data[5], $$data[6]);
- }
- } elsif ($$data[3] eq "name") {
- if ($param_name eq $$data[4]) {
- $node->setAttribute ($$data[5], $$data[6]);
- }
- }
- }
- }
-}
-
-sub myGetChildrenByTagName {
- my ($node, $tagname) = @_;
- my ($child);
- my (@nodes) = ();
- for ($child = $node->firstChild; $child; $child = $child->nextSibling ()) {
- if ($child->nodeName eq $tagname) {
- push @nodes, $child;
- }
- }
- return @nodes;
-}
-
-sub addClassData {
- my ($doc, $node, $class, $data_list_ref) = @_;
-
- foreach $data (@$data_list_ref) {
- if ($$data[1] eq "class") {
- if ($$data[7] eq "delete") {
- my $parent = $node->parentNode;
- $parent->removeChild ($node);
- return;
- }
- # my copy of XML::LibXML doesn't have this method.
- #my @nodes = $node->getChildrenByTagName ($$data[5]);
- my @nodes = myGetChildrenByTagName ($node, $$data[5]);
-
- if (0 == scalar @nodes) {
- $node->setAttribute ($$data[5], $$data[6]);
- }
- next;
- }
- }
-}
-
-sub fixupNamespace {
- my ($self, $doc, $ns_node) = @_;
- my $node;
- foreach $rule (@{$self->{rules}}) {
- my ($classes_ref, $data_list_ref) = @$rule;
- for ($node = $ns_node->firstChild; $node; $node = $node->nextSibling ()) {
- next if not ($node->nodeName eq "object" or $node->nodeName eq "interface" or $node->nodeName eq "struct" or $node->nodeName eq "boxed");
- my $class, $methods_ref, $attr;
- foreach $attr ($node->attributes) {
- if ($attr->name eq "cname") {
- $class = $attr->value;
- last;
- }
- }
-
- my %classes = %$classes_ref;
- $methods_ref = $classes{$class}[0];
- $signals_ref = $classes{$class}[1];
-
- if ({%$classes_ref}->{$class}) {
- addClassData ($doc, $node, $class, $data_list_ref);
- }
-
- next if not ($methods_ref or $signals_ref);
-
- for ($method_node = $node->firstChild; $method_node; $method_node = $method_node->nextSibling ()) {
- next if not ($method_node->nodeName eq "method" or $method_node->nodeName eq "constructor");
- my $method;
- foreach $attr ($method_node->attributes) {
- if (($attr->name eq "name" and $method_node->nodeName eq "method") or ($attr->name eq "cname" and $method_node->nodeName eq "constructor")) {
- $method = $attr->value;
- last;
- }
- }
- next if not ${%$methods_ref}{$method};
-
- fixupParams ($method_node, $data_list_ref);
- }
-
- for ($signal_node = $node->firstChild; $signal_node; $signal_node = $signal_node->nextSibling ()) {
- next if $signal_node->nodeName ne "signal";
- my $signal;
- foreach $attr ($signal_node->attributes) {
- if ($attr->name eq "name") {
- $signal = $attr->value;
- last;
- }
- }
- next if not ${$signals_ref}{$signal};
-
- fixupParams ($signal_node, $data_list_ref);
- }
-
- }
- }
-}
-
-sub fixup {
- my $doc = $_[0];
- my ($api_node, $ns_node);
- my $metadata = undef;
-
- $api_node = $doc->documentElement;
- return if not ($api_node and $api_node->nodeName eq "api");
- for ($ns_node = $api_node->firstChild; $ns_node; $ns_node = $ns_node->nextSibling ()) {
- next if $ns_node->nodeName ne "namespace";
- next if not $ns_node->attributes;
- my @attrs = $ns_node->attributes;
- next if not @attrs;
- my $namespace = $attrs[0]->value;
- if (-f "$namespace.metadata") {
- if (not ($metadata and $metadata->{namespace} eq $namespace)) {
- $metadata = new GAPI::Metadata ($namespace);
- }
- $metadata->fixupNamespace ($doc, $ns_node);
- }
- }
-}
-
-sub output {
- my $self = $_[0];
- $rule_num = 0;
- foreach $rule (@{$self->{rules}}) {
- print "Rule #$rule_num:\n";
- my ($classes_ref, $data_list_ref) = @$rule;
- my %classes = %$classes_ref;
- my @data_list = @$data_list_ref;
- foreach $class (keys (%classes)) {
- print "\tClass $class:\n";
- foreach $method (keys %{$classes{$class}}) {
- print "\t\tMethod $method\n";
- }
- }
- print "\tData:\n";
- foreach $data (@data_list) {
- printf "\t\tAdd an %s to all %s of %s %s: %s=%s\n",
- $$data[0], $$data[1], $$data[3], $$data[4], $$data[5], $$data[6];
- }
- $rule_num++;
- }
-}
-
-1;