From: Duncan C. <dun...@us...> - 2005-01-27 23:10:27
|
Update of /cvsroot/gtk2hs/gtk2hs/tools/apiGen In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20648/tools/apiGen Modified Files: ApiGen.hs Makefile atk-sources.xml gapi2xml.pl gapi_pp.pl gdk-sources.xml glade-sources.xml gnomecanvas-sources.xml gtk-sources.xml pango-sources.xml Log Message: Sync up with the latest version of the gapi tools from the mono/gtk# project. Minor updates to the ApiGen necessary to work with the updated gapi tools. Use later versions of Gtk+ and related libs, now at 2.4.14 rather than 2.2.2. This should now all build easily for other people. It's now all automated and does not require configuring / building gtk+ docs etc (so no problems with not having the very latest version of glib/gtk etc installed on your machine). Index: gapi_pp.pl =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/tools/apiGen/gapi_pp.pl,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- gapi_pp.pl 6 Jan 2005 01:02:22 -0000 1.1 +++ gapi_pp.pl 27 Jan 2005 23:10:15 -0000 1.2 @@ -8,7 +8,7 @@ # # Copyright (c) 2001 Mike Kestner # Copyright (c) 2003 Martin Willemoes Hansen -# Copyright (c) 2003 Novell, Inc. +# Copyright (c) 2003-2004 Novell, Inc. # # This program is free software; you can redistribute it and/or # modify it under the terms of version 2 of the GNU General Public @@ -25,8 +25,8 @@ # Boston, MA 02111-1307, USA. $private_regex = "^#if.*(ENABLE_BACKEND|ENABLE_ENGINE)"; -$eatit_regex = "^#if.*(__cplusplus|DEBUG|DISABLE_(DEPRECATED|COMPAT)|ENABLE_BROKEN|COMPILATION)"; -$ignoreit_regex = '^\s+\*|#ident|#\s*include|#\s*else|#\s*endif|#\s*undef|G_(BEGIN|END)_DECLS|extern|GDKVAR|GTKVAR|GTKMAIN_C_VAR|GTKTYPEUTILS_VAR|VARIABLE|GTKTYPEBUILTIN'; +$eatit_regex = "^#if.*(__cplusplus|DEBUG|DISABLE_COMPAT|ENABLE_BROKEN)"; +$ignoreit_regex = '^\s+\*|#ident|#error|#\s*include|#\s*else|#\s*undef|G_(BEGIN|END)_DECLS|GDKVAR|GTKVAR|GTKMAIN_C_VAR|GTKTYPEUTILS_VAR|VARIABLE|GTKTYPEBUILTIN'; foreach $arg (@ARGV) { if (-d $arg && -e $arg) { @@ -50,6 +50,8 @@ open(INFILE, $fname) || die "Could open $fname\n"; $braces = 0; + $deprecated = -1; + $ifdeflevel = 0; $prepend = ""; while ($line = <INFILE>) { $braces++ if ($line =~ /{/ and $line !~ /}/); @@ -57,8 +59,8 @@ next if ($line =~ /$ignoreit_regex/); - $line =~ s/\/\*.*?\*\///g; - + $line =~ s/\/\*[^<].*?\*\///g; + next if ($line !~ /\S/); $line = $prepend . $line; @@ -75,10 +77,10 @@ $def =~ s/\\\n//g; print $def; } - } elsif ($line =~ /^\s*\/\*/) { + } elsif ($line =~ /^\s*\/\*[^<]/) { while ($line !~ /\*\//) {$line = <INFILE>;} - } elsif ($line =~ /^#ifndef\s+\w+_H_*\b/) { - while ($line !~ /#define/) {$line = <INFILE>;} + } elsif ($line =~ /^extern/) { + while ($line !~ /;/) {$line = <INFILE>;} } elsif ($line =~ /$private_regex/) { $nested = 0; while ($line = <INFILE>) { @@ -107,7 +109,19 @@ } } } elsif ($line =~ /^#\s*ifn?\s*\!?def/) { - #warn "Ignored #if:\n$line"; + $ifdeflevel++; + #print "#ifn?def ($ifdeflevel): $line\n"; + if ($line =~ /#ifndef.*DISABLE_DEPRECATED/) { + $deprecated = $ifdeflevel; + } elsif ($line =~ /#if !defined.*DISABLE_DEPRECATED/) { + $deprecated = $ifdeflevel; + } + } elsif ($line =~ /^#\s*endif/) { + #print "#endif ($ifdeflevel): $line\n"; + if ($deprecated == $ifdeflevel) { + $deprecated = -1; + } + $ifdeflevel--; } elsif ($line =~ /typedef struct\s*\{/) { my $first_line = $line; my @lines = (); @@ -130,6 +144,9 @@ print "};\n"; } elsif ($line =~ /^enum\s+\{/) { while ($line !~ /^};/) {$line = <INFILE>;} + } elsif ($line =~ /^(typedef\s+)?union/) { + next if ($line =~ /^typedef\s+union\s+\w+\s+\w+;/); + while ($line !~ /^};/) {$line = <INFILE>;} } elsif ($line =~ /(\s+)union\s*{/) { # this is a hack for now, but I need it for the fields to work $indent = $1; @@ -141,8 +158,12 @@ $do_print = 0; } } else { - if ($braces or $line =~ /;/) { - print $line; + if ($braces or $line =~ /;|\/\*/) { + if ($deprecated == -1) { + print $line; + } else { + print "deprecated$line"; + } } else { $prepend = $line; $prepend =~ s/\n/ /g; @@ -168,12 +189,15 @@ } while ($line = <INFILE>) { - #next if ($line !~ /^(struct|\w+_class_init)|g_boxed_type_register_static/); - next if ($line !~ /^(struct|\w+_class_init|\w+_base_init|\w+_get_type)/); + next if ($line !~ /^(struct|\w+_class_init|\w+_base_init|\w+_get_type\b)/); if ($line =~ /^struct/) { # need some of these to parse out parent types print "private"; + if ($line =~ /;/) { + print $line; + next; + } } $comment = 0; Index: gapi2xml.pl =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/tools/apiGen/gapi2xml.pl,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- gapi2xml.pl 6 Jan 2005 01:02:22 -0000 1.1 +++ gapi2xml.pl 27 Jan 2005 23:10:15 -0000 1.2 @@ -84,18 +84,18 @@ $types{$3} = $1 . $2; } elsif ($line =~ /typedef\s+enum\s+(\w+)\s+(\w+);/) { $etypes{$1} = $2; - } elsif ($line =~ /^(typedef\s+)?\benum\b/) { + } elsif ($line =~ /^((deprecated)?typedef\s+)?\benum\b/) { $edef = $line; while ($line = <STDIN>) { $edef .= $line; - last if ($line =~ /^}\s*(\w+)?;/); + last if ($line =~ /^(deprecated)?}\s*(\w+)?;/); } $edef =~ s/\n\s*//g; $edef =~ s|/\*.*?\*/||g; if ($edef =~ /typedef.*}\s*(\w+);/) { $ename = $1; - } elsif ($edef =~ /^enum\s+(\w+)\s*{/) { - $ename = $1; + } elsif ($edef =~ /^(deprecated)?enum\s+(\w+)\s*{/) { + $ename = $2; } else { print "Unexpected enum format\n$edef"; next; @@ -111,15 +111,15 @@ $fdef .= $line; $fdef =~ s/\n\s+//g; $fpdefs{$fname} = $fdef; - } elsif ($line =~ /^(private)?struct\s+(\w+)/) { + } elsif ($line =~ /^(private|deprecated)?struct\s+(\w+)/) { next if ($line =~ /;/); $sname = $2; $sdef = $line; while ($line = <STDIN>) { $sdef .= $line; - last if ($line =~ /^}/); + last if ($line =~ /^(deprecated)?}/); } - $sdef =~ s!/\*.*?(\*/|\n)!!g; + $sdef =~ s!/\*[^<].*?(\*/|\n)!!g; $sdef =~ s/\n\s*//g; $sdefs{$sname} = $sdef; } elsif ($line =~ /^(\w+)_(class|base)_init\b/) { @@ -149,8 +149,8 @@ last if ($line =~ /^}/); } $typefuncs{lc($class)} = $pedef; - } elsif ($line =~ /^(const|G_CONST_RETURN)?\s*\w+\s*\**\s*(\w+)\s*\(/) { - $fname = $2; + } elsif ($line =~ /^(deprecated)?(const|G_CONST_RETURN)?\s*(struct\s+)?\w+\s*\**\s*(\w+)\s*\(/) { + $fname = $4; $fdef = ""; while ($line !~ /;/) { $fdef .= $line; @@ -186,12 +186,14 @@ $boxdefs{$1} = $line; } elsif ($line =~ /^BUILTIN\s*\{\s*\"(\w+)\".*GTK_TYPE_(ENUM|FLAGS)/) { # ignoring these for now. - } elsif ($line =~ /^\#define/) { + } elsif ($line =~ /^(deprecated)?\#define/) { my $test_ns = uc ($ns); - if ($line =~ /\#define\s+(\w+)\s+\"(.*)\"/) { + if ($line =~ /^deprecated\#define\s+(\w+)\s+\"(.*)\"/) { + $defines{"deprecated$1"} = $2; + } elsif ($line =~ /\#define\s+(\w+)\s+\"(.*)\"/) { $defines{$1} = $2; } - } else { + } elsif ($line !~ /\/\*/) { print $line; } } @@ -207,6 +209,10 @@ $cname = $etypes{$cname} if (exists($etypes{$cname})); $enums{lc($cname)} = $cname; $enum_elem = addNameElem($ns_elem, 'enum', $cname, $ns); + if ($def =~ /^deprecated/) { + $enum_elem->setAttribute("deprecated", "1"); + $def =~ s/deprecated//g; + } if ($def =~ /=\s*1\s*<<\s*\d+/) { $enum_elem->setAttribute('type', "flags"); } else { @@ -214,6 +220,7 @@ } $def =~ /\{(.*)\}/; @vals = split(/,\s*/, $1); + $vals[0] =~ s/^\s+//; @v0 = split(/_/, $vals[0]); if (@vals > 1) { $done = 0; @@ -257,7 +264,7 @@ ############################################################## foreach $cbname (sort(keys(%fpdefs))) { - next if ($cbname !~ /$ns/); + next if ($cbname =~ /^_/); $cbcnt++; $fdef = $cb = $fpdefs{$cbname}; $cb_elem = addNameElem($ns_elem, 'callback', $cbname, $ns); @@ -289,9 +296,10 @@ $classdef = $sdefs{$1} if ($ifacetype =~ /struct\s+(\w+)/); if ($initfunc) { - parseInitFunc($iface_el, $initfunc, 0); + parseInitFunc($iface_el, $initfunc); } else { warn "Don't have an init func for $inst.\n" if $debug; + addVirtualMethods ($classdef, $iface_el); } } @@ -312,7 +320,8 @@ $instdef = $classdef = ""; $instdef = $sdefs{$1} if ($insttype =~ /struct\s+(\w+)/); $classdef = $sdefs{$1} if ($classtype =~ /struct\s+(\w+)/); - $instdef =~ s/\s+(\*+)/\1 /g; + $classdef =~ s/deprecated//g; + $instdef =~ s/\s+(\*+)([^\/])/\1 \2/g; warn "Strange Class $inst\n" if (!$instdef && $debug); $classcnt++; @@ -320,15 +329,21 @@ $elem_table{lc($inst)} = $obj_el; + # Check if the object is deprecated + if ($instdef =~ /^deprecatedstruct/) { + $obj_el->setAttribute("deprecated", "1"); + $instdef =~ s/deprecated//g; + } + # Extract parent and fields from the struct if ($instdef =~ /^struct/) { $instdef =~ /\{(.*)\}/; $fieldstr = $1; - $fieldstr =~ s|/\*.*?\*/||g; + $fieldstr =~ s|/\*[^<].*?\*/||g; @fields = split(/;/, $fieldstr); - $fields[0] =~ /(\w+)/; - $obj_el->setAttribute('parent', "$1"); - addFieldElems($obj_el, @fields[1..$#fields]); + addFieldElems($obj_el, 'private', @fields); + $obj_el->setAttribute('parent', $obj_el->firstChild->getAttribute('type')); + $obj_el->removeChild($obj_el->firstChild); } elsif ($instdef =~ /privatestruct/) { # just get the parent for private structs $instdef =~ /\{\s*(\w+)/; @@ -337,7 +352,7 @@ # Get the props from the class_init func. if ($initfunc) { - parseInitFunc($obj_el, $initfunc, 1); + parseInitFunc($obj_el, $initfunc); } else { warn "Don't have an init func for $inst.\n" if $debug; } @@ -388,6 +403,11 @@ $struct_el = addNameElem($ns_elem, 'struct', $key, $ns); } + if ($def =~ /^deprecated/) { + $struct_el->setAttribute("deprecated", "1"); + $def =~ s/deprecated//g; + } + $elem_table{lc($key)} = $struct_el; $def =~ s/\s+/ /g; @@ -395,7 +415,7 @@ $struct_el->setAttribute('opaque', 'true'); } else { $def =~ /\{(.+)\}/; - addFieldElems($struct_el, split(/;/, $1)); + addFieldElems($struct_el, 'public', split(/;/, $1)); } } @@ -447,13 +467,18 @@ $scnt = keys(%sdefs); $fcnt = keys(%fdefs); $tcnt = keys(%types); print "structs: $scnt enums: $ecnt callbacks: $cbcnt\n"; print "funcs: $fcnt types: $tcnt classes: $classcnt\n"; -print "props: $propcnt signals: $sigcnt\n\n"; +print "props: $propcnt childprops: $childpropcnt signals: $sigcnt\n\n"; sub addFieldElems { - my ($parent, @fields) = @_; + my ($parent, $defaultaccess, @fields) = @_; + my $access = $defaultaccess; foreach $field (@fields) { + if ($field =~ m!^/\*< (public|private) >.*\*/(.*)$!) { + $access = $1; + $field = $2; + } next if ($field !~ /\S/); $field =~ s/\s+(\*+)/\1 /g; $field =~ s/(\w+)\s+const /const \1 /g; @@ -461,7 +486,7 @@ $field =~ s/struct /struct\-/g; $field =~ s/.*\*\///g; next if ($field !~ /\S/); - + if ($field =~ /(\S+\s+\*?)\(\*\s*(.+)\)\s*\((.*)\)/) { $elem = addNameElem($parent, 'callback', $2); addReturnElem($elem, $1); @@ -470,15 +495,19 @@ my $type = $1 . $2; $symb = $3; foreach $tok (split (/,\s*/, $symb)) { if ($tok =~ /(\w+)\s*\[(.*)\]/) { - $elem = addNameElem($parent, 'field', $1); + $elem = addNameElem($parent, 'field', $1, ""); $elem->setAttribute('array_len', "$2"); } elsif ($tok =~ /(\w+)\s*\:\s*(\d+)/) { - $elem = addNameElem($parent, 'field', $1); + $elem = addNameElem($parent, 'field', $1, ""); $elem->setAttribute('bits', "$2"); } else { - $elem = addNameElem($parent, 'field', $tok); + $elem = addNameElem($parent, 'field', $tok, ""); } $elem->setAttribute('type', "$type"); + + if ($access ne $defaultaccess) { + $elem->setAttribute('access', "$access"); + } } } else { die "$field\n"; @@ -518,12 +547,20 @@ next if (!$obj_el); $mdef = delete $fdefs{$mname}; - + if ($mname =~ /$prefix(new)/) { - $el = addNameElem($obj_el, 'constructor', $mname); + $el = addNameElem($obj_el, 'constructor', $mname); + if ($mdef =~ /^deprecated/) { + $el->setAttribute("deprecated", "1"); + $mdef =~ s/deprecated//g; + } $drop_1st = 0; } else { $el = addNameElem($obj_el, 'method', $mname, $prefix, $prepend); + if ($mdef =~ /^deprecated/) { + $el->setAttribute("deprecated", "1"); + $mdef =~ s/deprecated//g; + } $mdef =~ /(.*?)\w+\s*\(/; addReturnElem($el, $1); $mdef =~ /\(\s*(const)?\s*(\w+)/; @@ -544,6 +581,13 @@ { my ($el, $mdef, $drop_1st) = @_; + $fmt_args = 0; + + if ($mdef =~ /G_GNUC_PRINTF.*\((\d+,\s*\d+)\s*\)/) { + $fmt_args = $1; + $mdef =~ s/\s*G_GNUC_PRINTF.*\)//; + } + if (($mdef =~ /\((.*)\)/) && ($1 ne "void")) { @parms = (); $parm = ""; @@ -569,6 +613,15 @@ if (@parms > 0) { addParamsElem($el, @parms); } + + if ($fmt_args != 0) { + $fmt_args =~ /(\d+),\s*(\d+)/; + $fmt = $1; $args = $2; + ($params_el, @junk) = $el->getElementsByTagName ("parameters"); + (@params) = $params_el->getElementsByTagName ("parameter"); + $params[$fmt-1]->setAttribute ("printf_format", "true"); + $params[$args-1]->setAttribute ("printf_format_args", "true"); + } } } @@ -619,7 +672,7 @@ } if ($cnt == 1) { $mdef = delete $fdefs{$mname}; - + if (!$global_el) { $global_el = $doc->createElement('class'); $global_el->setAttribute('name', "Global"); @@ -627,6 +680,10 @@ $ns_elem->appendChild($global_el); } $el = addNameElem($global_el, 'method', $mname, $ns_prefix); + if ($mdef =~ /^deprecated/) { + $el->setAttribute("deprecated", "1"); + $mdef =~ s/deprecated//g; + } $mdef =~ /(.*?)\w+\s*\(/; addReturnElem($el, $1); $el->setAttribute("shared", "true"); @@ -640,8 +697,12 @@ for ($j = 0; $j < $cnt; $j++) { $mdef = delete $fdefs{$mnames[$i+$j]}; - + $el = addNameElem($class_el, 'method', $mnames[$i+$j], $prefix); + if ($mdef =~ /^deprecated/) { + $el->setAttribute("deprecated", "1"); + $mdef =~ s/deprecated//g; + } $mdef =~ /(.*?)\w+\s*\(/; addReturnElem($el, $1); $el->setAttribute("shared", "true"); @@ -660,7 +721,7 @@ my $elem = $doc->createElement($type); $node->appendChild($elem); - if ($prefix) { + if (defined $prefix) { my $match; if ($cname =~ /$prefix(\w+)/) { $match = $1; @@ -742,7 +803,7 @@ sub addPropElem { - my ($spec, $node) = @_; + my ($spec, $node, $is_child) = @_; my ($name, $mode, $docs); $spec =~ /g_param_spec_(\w+)\s*\((.*)\s*\)\s*\)/; my $type = $1; @@ -757,7 +818,7 @@ $mode = $params[$#params]; - if ($type =~ /boolean|float|double|^u?int|pointer/) { + if ($type =~ /boolean|float|double|^u?int|pointer|unichar/) { $type = "g$type"; } elsif ($type =~ /string/) { $type = "gchar*"; @@ -773,7 +834,7 @@ $type = StudlyCaps(lc($type)); } - $prop_elem = $doc->createElement('property'); + $prop_elem = $doc->createElement($is_child ? "childprop" : "property"); $node->appendChild($prop_elem); $prop_elem->setAttribute('name', StudlyCaps($name)); $prop_elem->setAttribute('cname', $name); @@ -852,13 +913,13 @@ return $class; } - if ($class =~ /;\s*(G_CONST_RETURN)?\s*(\S+\s*\**)\s*\(\*\s*$method\)\s*\((.*?)\);/) { + if ($class =~ /;\s*(G_CONST_RETURN\s+)?(\w+\s*\**)\s*\(\*\s*$method\)\s*\((.*?)\);/) { $ret = $2; $parms = $3; addReturnElem($sig_elem, $ret); if ($parms && ($parms ne "void")) { addParamsElem($sig_elem, split(/,/, $parms)); } - $class =~ s/;\s*(G_CONST_RETURN)?\s*\S+\s*\**\s*\(\*\s*$method\)\s*\(.*?\);/;/; + $class =~ s/;\s*(G_CONST_RETURN\s+)?\w+\s*\**\s*\(\*\s*$method\)\s*\(.*?\);/;/; } else { die "$method $class"; } @@ -870,9 +931,10 @@ { my ($class, $node) = @_; $class =~ s/\n\s*//g; + $class =~ s/\/\*.*?\*\///g; - while ($class =~ /;\s*(\S+\s*\**)\s*\(\*\s*(\w+)\)\s*\((.*?)\);/) { - $ret = $1; $cname = $2; $parms = $3; + while ($class =~ /;\s*(G_CONST_RETURN\s+)?(\S+\s*\**)\s*\(\*\s*(\w+)\)\s*\((.*?)\);/) { + $ret = $1 . $2; $cname = $3; $parms = $4; if ($cname !~ /reserved/) { $vm_elem = $doc->createElement('virtual_method'); $node->appendChild($vm_elem); @@ -883,7 +945,7 @@ addParamsElem($vm_elem, split(/,/, $parms)); } } - $class =~ s/;\s*\S+\s*\**\s*\(\*\s*\w+\)\s*\(.*?\);//; + $class =~ s/;\s*(G_CONST_RETURN\s+)?\S+\s*\**\s*\(\*\s*\w+\)\s*\(.*?\);/;/; } } @@ -902,7 +964,7 @@ sub parseInitFunc { - my ($obj_el, $initfunc, $is_obj) = @_; + my ($obj_el, $initfunc) = @_; my @init_lines = split (/\n/, $initfunc); @@ -918,8 +980,15 @@ do { $prop .= $init_lines[++$linenum]; } until ($init_lines[$linenum] =~ /\)\s*;/); - addPropElem ($prop, $obj_el); + addPropElem ($prop, $obj_el, 0); $propcnt++; + } elsif ($line =~ /gtk_container_class_install_child_property/) { + my $prop = $line; + do { + $prop .= $init_lines[++$linenum]; + } until ($init_lines[$linenum] =~ /\)\s*;/); + addPropElem ($prop, $obj_el, 1); + $childpropcnt++; } elsif ($line =~ /\bg.*_signal_new/) { my $sig = $line; do { @@ -931,9 +1000,7 @@ $linenum++; } - if ($is_obj) { - addVirtualMethods ($classdef, $obj_el); - } + addVirtualMethods ($classdef, $obj_el); } sub parseTypeFunc Index: pango-sources.xml =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/tools/apiGen/pango-sources.xml,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- pango-sources.xml 26 Jan 2005 12:13:28 -0000 1.2 +++ pango-sources.xml 27 Jan 2005 23:10:15 -0000 1.3 @@ -2,16 +2,16 @@ <api filename="pango-api.xml"> <library name="pango"> <namespace name="Pango"> - <dir>pango-1.2.3/pango</dir> - <exclude>pango-1.2.3/pango/pangox-fontcache.c</exclude> - <exclude>pango-1.2.3/pango/pangox-fontmap.c</exclude> - <exclude>pango-1.2.3/pango/pangox-private.h</exclude> - <exclude>pango-1.2.3/pango/pangox.h</exclude> - <exclude>pango-1.2.3/pango/pangox.c</exclude> - <exclude>pango-1.2.3/pango/pangoxft.h</exclude> - <exclude>pango-1.2.3/pango/pangoxft-font.h</exclude> - <exclude>pango-1.2.3/pango/pangoxft-fontmap.h</exclude> - <exclude>pango-1.2.3/pango/pangoxft-private.h</exclude> + <dir>pango-1.4.1/pango</dir> + <exclude>pango-1.4.1/pango/pangox-fontcache.c</exclude> + <exclude>pango-1.4.1/pango/pangox-fontmap.c</exclude> + <exclude>pango-1.4.1/pango/pangox-private.h</exclude> + <exclude>pango-1.4.1/pango/pangox.h</exclude> + <exclude>pango-1.4.1/pango/pangox.c</exclude> + <exclude>pango-1.4.1/pango/pangoxft.h</exclude> + <exclude>pango-1.4.1/pango/pangoxft-font.h</exclude> + <exclude>pango-1.4.1/pango/pangoxft-fontmap.h</exclude> + <exclude>pango-1.4.1/pango/pangoxft-private.h</exclude> </namespace> </library> </api> Index: glade-sources.xml =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/tools/apiGen/glade-sources.xml,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- glade-sources.xml 26 Jan 2005 12:13:28 -0000 1.2 +++ glade-sources.xml 27 Jan 2005 23:10:15 -0000 1.3 @@ -2,7 +2,7 @@ <api filename="glade-api.xml"> <library name="glade"> <namespace name="Glade"> - <dir>libglade-2.0.0/glade</dir> + <dir>libglade-2.3.6/glade</dir> </namespace> </library> </api> Index: gtk-sources.xml =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/tools/apiGen/gtk-sources.xml,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- gtk-sources.xml 26 Jan 2005 12:13:28 -0000 1.2 +++ gtk-sources.xml 27 Jan 2005 23:10:15 -0000 1.3 @@ -2,7 +2,74 @@ <api filename="gtk-api.xml"> <library name="gtk"> <namespace name="Gtk"> - <dir>gtk+-2.2.2/gtk</dir> + <dir>gtk+-2.4.14/gtk</dir> + <!-- Internal stuff --> + <exclude>gtk+-2.4.14/gtk/gtkfilechooserdefault.c</exclude> + <exclude>gtk+-2.4.14/gtk/gtkfilechooserdefault.h</exclude> + <exclude>gtk+-2.4.14/gtk/gtkfilechooserentry.c</exclude> + <exclude>gtk+-2.4.14/gtk/gtkfilechooserentry.h</exclude> + <exclude>gtk+-2.4.14/gtk/gtkfilechooserutils.c</exclude> + <exclude>gtk+-2.4.14/gtk/gtkfilechooserutils.h</exclude> + <exclude>gtk+-2.4.14/gtk/gtkfilesystem.c</exclude> + <exclude>gtk+-2.4.14/gtk/gtkfilesystem.h</exclude> + <exclude>gtk+-2.4.14/gtk/gtkfilesystemmodel.c</exclude> + <exclude>gtk+-2.4.14/gtk/gtkfilesystemmodel.h</exclude> + <exclude>gtk+-2.4.14/gtk/gtkfilesystemunix.c</exclude> + <exclude>gtk+-2.4.14/gtk/gtkfilesystemunix.h</exclude> + <exclude>gtk+-2.4.14/gtk/gtkfilesystemwin32.c</exclude> + <exclude>gtk+-2.4.14/gtk/gtkfilesystemwin32.h</exclude> + <exclude>gtk+-2.4.14/gtk/gtkiconcache.c</exclude> + <exclude>gtk+-2.4.14/gtk/gtkiconcache.h</exclude> + <exclude>gtk+-2.4.14/gtk/gtkiconthemeparser.h</exclude> + <exclude>gtk+-2.4.14/gtk/gtkpathbar.c</exclude> + <exclude>gtk+-2.4.14/gtk/gtkpathbar.h</exclude> + <exclude>gtk+-2.4.14/gtk/gtkrbtree.c</exclude> + <exclude>gtk+-2.4.14/gtk/gtkrbtree.h</exclude> + <exclude>gtk+-2.4.14/gtk/gtksequence.c</exclude> + <exclude>gtk+-2.4.14/gtk/gtksequence.h</exclude> + <exclude>gtk+-2.4.14/gtk/gtktextbtree.c</exclude> + <exclude>gtk+-2.4.14/gtk/gtktextbtree.h</exclude> + <exclude>gtk+-2.4.14/gtk/gtktextsegment.c</exclude> + <exclude>gtk+-2.4.14/gtk/gtktextsegment.h</exclude> + <exclude>gtk+-2.4.14/gtk/gtktexttypes.c</exclude> + <exclude>gtk+-2.4.14/gtk/gtktexttypes.h</exclude> + <exclude>gtk+-2.4.14/gtk/gtktextutil.c</exclude> + <exclude>gtk+-2.4.14/gtk/gtktextutil.h</exclude> + <exclude>gtk+-2.4.14/gtk/gtkthemes.c</exclude> + <exclude>gtk+-2.4.14/gtk/gtkthemes.h</exclude> + <exclude>gtk+-2.4.14/gtk/gtktreedatalist.c</exclude> + <exclude>gtk+-2.4.14/gtk/gtktreedatalist.h</exclude> + <exclude>gtk+-2.4.14/gtk/gtkwindow-decorate.c</exclude> + <exclude>gtk+-2.4.14/gtk/gtkwindow-decorate.h</exclude> + <exclude>gtk+-2.4.14/gtk/gtkxembed.h</exclude> + <exclude>gtk+-2.4.14/gtk/xembed.h</exclude> + <!-- Exclude all pre gtk+-2.2 deprecated widgets --> + <!-- on second thoughts don't exclude them + <exclude>gtk+-2.4.14/gtk/gtkclist.c</exclude> + <exclude>gtk+-2.4.14/gtk/gtkclist.h</exclude> + <exclude>gtk+-2.4.14/gtk/gtkctree.c</exclude> + <exclude>gtk+-2.4.14/gtk/gtkctree.h</exclude> + <exclude>gtk+-2.4.14/gtk/gtklist.c</exclude> + <exclude>gtk+-2.4.14/gtk/gtklist.h</exclude> + <exclude>gtk+-2.4.14/gtk/gtklistitem.c</exclude> + <exclude>gtk+-2.4.14/gtk/gtklistitem.h</exclude> + <exclude>gtk+-2.4.14/gtk/gtkoldeditable.c</exclude> + <exclude>gtk+-2.4.14/gtk/gtkoldeditable.h</exclude> + <exclude>gtk+-2.4.14/gtk/gtkpixmap.c</exclude> + <exclude>gtk+-2.4.14/gtk/gtkpixmap.h</exclude> + <exclude>gtk+-2.4.14/gtk/gtkpreview.c</exclude> + <exclude>gtk+-2.4.14/gtk/gtkpreview.h</exclude> + <exclude>gtk+-2.4.14/gtk/gtkprogress.c</exclude> + <exclude>gtk+-2.4.14/gtk/gtkprogress.h</exclude> + <exclude>gtk+-2.4.14/gtk/gtktext.c</exclude> + <exclude>gtk+-2.4.14/gtk/gtktext.h</exclude> + <exclude>gtk+-2.4.14/gtk/gtktipsquery.c</exclude> + <exclude>gtk+-2.4.14/gtk/gtktipsquery.h</exclude> + <exclude>gtk+-2.4.14/gtk/gtktree.c</exclude> + <exclude>gtk+-2.4.14/gtk/gtktree.h</exclude> + <exclude>gtk+-2.4.14/gtk/gtktreeitem.c</exclude> + <exclude>gtk+-2.4.14/gtk/gtktreeitem.h</exclude> + --> </namespace> </library> </api> Index: Makefile =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/tools/apiGen/Makefile,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- Makefile 26 Jan 2005 12:13:28 -0000 1.2 +++ Makefile 27 Jan 2005 23:10:15 -0000 1.3 @@ -9,21 +9,16 @@ @echo " other options. However, you may wish to first edit this" @echo " Makefile to change which versions of the source code you get." @echo - @echo "make prep-gtk-docs" - @echo " This configures and compiles gtk+ and builds the DocBook xml" - @echo " files necessary for the next stage. You should only have to" - @echo " do this once." - @echo @echo "make gtk-modules" @echo " This generates all the Gtk modules by processing the source" @echo " code and the DocBook documentation. The .chs modules are all" @echo " put into the subdirectory gtk-modules. You need to have" - @echo " downloaded the source and built the docs before doing this." + @echo " downloaded the source and before doing this." @echo @echo "make gdk-modules" @echo " as above but for Gdk" @echo - @echo "make prep-pango-docs pango-modules" + @echo "make pango-modules" @echo " as above but for Pango" @echo @echo "make glade-modules" @@ -33,19 +28,27 @@ # # source code # -PANGO_VERSION = 1.2.3 -GTK_VERSION = 2.2.2 -GLADE_VERSION = 2.0.0 +GLIB_VERSION = 2.4.8 +PANGO_VERSION = 1.4.1 +ATK_VERSION = 1.6.1 +GTK_VERSION = 2.4.14 +GLADE_VERSION = 2.3.6 DOWNLOADS = \ - http://ftp.gnome.org/pub/GNOME/desktop/2.2/2.2.2/sources/pango-$(PANGO_VERSION).tar.gz \ - http://ftp.gnome.org/pub/GNOME/desktop/2.2/2.2.2/sources/gtk+-$(GTK_VERSION).tar.gz \ - http://ftp.gnome.org/pub/GNOME/desktop/2.0/2.0.0/sources/libglade-$(GLADE_VERSION).tar.gz + ftp://ftp.gtk.org/pub/gtk/v2.4/glib-$(GLIB_VERSION).tar.gz \ + ftp://ftp.gtk.org/pub/gtk/v2.4/pango-$(PANGO_VERSION).tar.gz \ + ftp://ftp.gtk.org/pub/gtk/v2.4/atk-$(ATK_VERSION).tar.gz \ + ftp://ftp.gtk.org/pub/gtk/v2.4/gtk+-$(GTK_VERSION).tar.gz \ + http://ftp.gnome.org/pub/GNOME/desktop/2.6/2.6.2/sources/libglade-$(GLADE_VERSION).tar.gz\ + http://ftp.gnome.org/pub/GNOME/desktop/2.6/2.6.2/sources/libgnomecanvas-2.6.1.1.tar.gz get-source-code: for i in $(DOWNLOADS); do \ wget $$i --output-document=- | tar -xz ; \ done; + # following fixes borrowed from Gtk# + ln -f -s gtkfilechooserprivate.h gtk+-$(GTK_VERSION)/gtk/gtkfilechooserpriv.h + patch -p0 atk-1.6.1/atk/atkhyperlink.h < atkhyperlink.patch ############################# @@ -64,13 +67,14 @@ # # Gtk modules # -prep-gtk-docs : gtk+-$(GTK_VERSION) - cd $< && ./configure --enable-gtk-doc && make +#prep-gtk-docs : gtk+-$(GTK_VERSION) +# cd $< && ./configure --enable-gtk-doc && make gtk-docs.xml : gtk+-$(GTK_VERSION)/docs/reference/gtk/xml format-docs.xsl ./mkdocxml.sh $< | xsltproc format-docs.xsl - > $@ -gtk-modules : gtk-api.xml gtk-docs.xml Template.chs ApiGen gdk-api.xml pango-api.xml +gtk-modules : gtk-api.xml gtk-docs.xml Template.chs ApiGen \ + gdk-api.xml pango-api.xml atk-api.xml @mkdir -p $@ ./ApiGen $< Template.chs --doc=gtk-docs.xml --outdir=$@ \ --includeapi=gdk-api.xml --includeapi=pango-api.xml --includeapi=atk-api.xml @@ -94,8 +98,8 @@ # # Pango modules # -prep-pango-docs : pango-$(PANGO_VERSION) - cd $< && ./configure --enable-gtk-doc && make +#prep-pango-docs : pango-$(PANGO_VERSION) +# cd $< && ./configure --enable-gtk-doc && make pango-docs.xml : pango-$(PANGO_VERSION)/docs/xml format-docs.xsl ./mkdocxml.sh $< | xsltproc format-docs.xsl - > $@ Index: gnomecanvas-sources.xml =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/tools/apiGen/gnomecanvas-sources.xml,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- gnomecanvas-sources.xml 26 Jan 2005 12:13:28 -0000 1.1 +++ gnomecanvas-sources.xml 27 Jan 2005 23:10:15 -0000 1.2 @@ -2,7 +2,7 @@ <api filename="gnomecanvas-api.xml"> <library name="gnomecanvas"> <namespace name="Gnome"> - <dir>libgnomecanvas-2.2.1/libgnomecanvas</dir> + <dir>libgnomecanvas-2.6.0/libgnomecanvas</dir> </namespace> </library> </api> Index: ApiGen.hs =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/tools/apiGen/ApiGen.hs,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- ApiGen.hs 26 Jan 2005 12:05:09 -0000 1.8 +++ ApiGen.hs 27 Jan 2005 23:10:14 -0000 1.9 @@ -182,6 +182,9 @@ extractParameter (Xml.CElem (Xml.Elem "parameter" [("ellipsis", _)] [])) = VarArgs extractParameter (Xml.CElem (Xml.Elem "parameter" + [("ellipsis", _) + ,("printf_format_args", _)] [])) = VarArgs +extractParameter (Xml.CElem (Xml.Elem "parameter" [("type", Xml.AttValue type_), ("name", Xml.AttValue name)] [])) = Parameter { @@ -191,6 +194,15 @@ } extractParameter (Xml.CElem (Xml.Elem "parameter" [("type", Xml.AttValue type_), + ("name", Xml.AttValue name), + ("printf_format" ,_)] [])) = + Parameter { + parameter_type = Xml.verbatim type_, + parameter_name = Xml.verbatim name, + parameter_isArray = False + } +extractParameter (Xml.CElem (Xml.Elem "parameter" + [("type", Xml.AttValue type_), ("array", _), ("name", Xml.AttValue name)] [])) = Parameter { @@ -600,10 +612,12 @@ lowerCaseFirstChar . stripKnownPrefixes . concatMap upperCaseFirstChar + . filter (not.null) --to ignore leading underscores . splitBy '_' . takeWhile ('('/=) stripKnownPrefixes :: String -> String +stripKnownPrefixes ('A':'t':'k':remainder) = remainder stripKnownPrefixes ('G':'t':'k':remainder) = remainder stripKnownPrefixes ('G':'d':'k':remainder) = remainder stripKnownPrefixes ('P':'a':'n':'g':'o':remainder) = remainder @@ -833,6 +847,7 @@ where lookup [] = trace ( "Warning: " ++ object_name object ++ " does not inherit from GObject! " ++ show (objectParents object)) GObjectKind + lookup ("GTypeModule":os) = GObjectKind -- GTypeModule is a GObject lookup ("GObject":os) = GObjectKind lookup ("GtkObject":os) = GtkObjectKind lookup (_:os) = lookup os Index: gdk-sources.xml =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/tools/apiGen/gdk-sources.xml,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- gdk-sources.xml 26 Jan 2005 12:13:28 -0000 1.2 +++ gdk-sources.xml 27 Jan 2005 23:10:15 -0000 1.3 @@ -2,12 +2,12 @@ <api filename="gdk-api.xml"> <library name="gdk"> <namespace name="Gdk"> - <dir>gtk+-2.2.2/gdk</dir> + <dir>gtk+-2.4.14/gdk</dir> </namespace> </library> <library name="gdk_pixbuf"> <namespace name="Gdk"> - <dir>gtk+-2.2.2/gdk-pixbuf</dir> + <dir>gtk+-2.4.14/gdk-pixbuf</dir> </namespace> </library> </api> Index: atk-sources.xml =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/tools/apiGen/atk-sources.xml,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- atk-sources.xml 26 Jan 2005 12:13:28 -0000 1.1 +++ atk-sources.xml 27 Jan 2005 23:10:15 -0000 1.2 @@ -2,7 +2,7 @@ <api filename="atk-api.xml"> <library name="atk"> <namespace name="Atk"> - <dir>atk-1.2.4/atk</dir> + <dir>atk-1.6.1/atk</dir> </namespace> </library> </api> |