#!/usr/bin/perl -w

#
# Since the machine this script is installed on, mintzer, uses an old version 
# of dot, i need to copy over the generated .dot file to setzer and run
# manually:
# $ dot -Tpng Misc.dot > misc.png
# $ dot -Tcmap Misc.dot > misc.map
#
# then I have to ':r misc.map' into misc.html manually, too.
#

use strict;

#use lib "/home/wxwindows/perllibs/local/share/perl/5.6.1/";
#use lib "/home/wxwindows/perllibs/local/lib/perl/5.6.1/";

use XML::LibXML::XPathContext;
use XML::LibXML;

# color/fontcolor/fillcolor
# in h,s,v, #rrggbb or white black red  green  blue  yellow  magenta  cyan burlywood
my %colouring;
my %colournodeswithparent;
$colournodeswithparent{wxObject} = ",style=filled,fillcolor=green";
#$colournodeswithparent{wxWindow} = ",style=filled,fillcolor=yellow";
#$colournodeswithparent{wxControl} = ",style=filled,fillcolor=yellow";

my %splitclasses;
$splitclasses{wxWindow} = 1;
$splitclasses{wxCommandEvent} = 1;
#$splitclasses{wxDialog} = 1;
$splitclasses{wxControl} = 1;
$splitclasses{wxFrame} = 1;

#require "/home/wxwindows/cgi-bin/wiki/wxkeywords.pl";
#my %classlinks = wxclasslist();

my $parser = XML::LibXML->new();
my $classes = $parser->parse_file("../../classes.xml");
my $xc = XML::LibXML::XPathContext->new($classes);

  my $nodelist = $xc->find("/classes/class");

  foreach my $node ($nodelist->get_nodelist) {
    my @attributes = $node->getAttributes;
    foreach my $attr (@attributes) {
      if ($attr->getName() eq 'name') {
        my $classname = $attr->nodeValue();
	my $result = `grep $classname wxposter.svg`;
	if ($result =~ /^\s*$/s) {
	  print "$classname not found\n";
	}
      }
    }
  }

