From 40c4db88a488dab5518603970bdd8c39e5d8a510 Mon Sep 17 00:00:00 2001 From: Dan Winship Date: Tue, 24 May 2005 18:11:33 +0000 Subject: [PATCH] * parser/gapi2xml.pl: Make the enum value parser do the right thing with parenthesized values ("FOO = (1 << 2)") and within-type aliases ("GTK_ANCHOR_N = GTK_ANCHOR_NORTH"). Make it intentionally do the wrong thing with unparsable values (outputting them as-is into the api file) so that we are forced to fix them with metadata rather than silently getting incorrect values. * gdk/gdk-api-2.4.raw: * gdk/gdk-api-2.6.raw (PixdataType): Now recognized as flags, not enum * gtk/Gtk.metadata: hide the enums ArgFlags and RcTokenType (which are not used by any wrapped API, and which formerly contained entirely wrong values). * gtk/gtk-api-2.4.raw: * gtk/gtk-api-2.6.raw (AnchorType, SelectionMode): update with values for aliases * gnome/Gnome.metadata: fix value of Gnome.PrintButtons.Cancel * gnome/gnome-api.raw (PrintUnitBase, PaperSelectorFlags, PrintDialogFlags, PrintDialogRangeFlags): Now recognized as flags, with values. svn path=/trunk/gtk-sharp/; revision=44937 --- ChangeLog | 27 ++ doc/ChangeLog | 12 + doc/en/Gdk/PixdataType.xml | 5 + doc/en/Gnome/PaperSelectorFlags.xml | 5 + doc/en/Gnome/PrintDialogFlags.xml | 5 + doc/en/Gnome/PrintDialogRangeFlags.xml | 5 + doc/en/Gnome/PrintUnitBase.xml | 5 + doc/en/Gtk/ArgFlags.xml | 98 ----- doc/en/Gtk/RcTokenType.xml | 519 ------------------------- doc/en/index.xml | 2 - gda/gda-api.raw | 2 +- gdk/gdk-api-2.4.raw | 8 +- gdk/gdk-api-2.6.raw | 8 +- gnome/Gnome.metadata | 1 + gnome/gnome-api.raw | 36 +- gtk/Gtk.metadata | 2 + gtk/gtk-api-2.4.raw | 40 +- gtk/gtk-api-2.6.raw | 40 +- parser/gapi2xml.pl | 16 +- 19 files changed, 143 insertions(+), 693 deletions(-) delete mode 100644 doc/en/Gtk/ArgFlags.xml delete mode 100644 doc/en/Gtk/RcTokenType.xml diff --git a/ChangeLog b/ChangeLog index 3f532a687..588cd7dc5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,30 @@ +2005-05-24 Dan Winship + + * parser/gapi2xml.pl: Make the enum value parser do the right + thing with parenthesized values ("FOO = (1 << 2)") and within-type + aliases ("GTK_ANCHOR_N = GTK_ANCHOR_NORTH"). Make it intentionally + do the wrong thing with unparsable values (outputting them as-is + into the api file) so that we are forced to fix them with metadata + rather than silently getting incorrect values. + + * gdk/gdk-api-2.4.raw: + * gdk/gdk-api-2.6.raw (PixdataType): Now recognized as flags, + not enum + + * gtk/Gtk.metadata: hide the enums ArgFlags and RcTokenType (which + are not used by any wrapped API, and which formerly contained + entirely wrong values). + + * gtk/gtk-api-2.4.raw: + * gtk/gtk-api-2.6.raw (AnchorType, SelectionMode): update with + values for aliases + + * gnome/Gnome.metadata: fix value of Gnome.PrintButtons.Cancel + + * gnome/gnome-api.raw (PrintUnitBase, PaperSelectorFlags, + PrintDialogFlags, PrintDialogRangeFlags): Now recognized as flags, + with values. + 2005-05-24 John Luke * configure.in.in: remove doc/updater/Makefile to fix build diff --git a/doc/ChangeLog b/doc/ChangeLog index 06329ef2d..f91a8e513 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,3 +1,15 @@ +2005-05-24 Dan Winship + + * en/Gdk/PixdataType.xml: + * en/Gnome/PaperSelectorFlags.xml: + * en/Gnome/PrintDialogFlags.xml: + * en/Gnome/PrintDialogRangeFlags.xml: + * en/Gnome/PrintUnitBase.xml: Regen, adding FlagsAttribute + + * en/index.xml + * en/Gtk/ArgFlags.xml + * en/Gtk/RcTokenType.xml: remove removed types + 2005-05-23 Mike Kestner * Makefile.am : add an update-delete target for --delete. diff --git a/doc/en/Gdk/PixdataType.xml b/doc/en/Gdk/PixdataType.xml index 1c5891997..b2d64d221 100644 --- a/doc/en/Gdk/PixdataType.xml +++ b/doc/en/Gdk/PixdataType.xml @@ -121,4 +121,9 @@ + + + System.Flags + + diff --git a/doc/en/Gnome/PaperSelectorFlags.xml b/doc/en/Gnome/PaperSelectorFlags.xml index 0d1eca250..c007ea2d2 100644 --- a/doc/en/Gnome/PaperSelectorFlags.xml +++ b/doc/en/Gnome/PaperSelectorFlags.xml @@ -45,4 +45,9 @@ + + + System.Flags + + diff --git a/doc/en/Gnome/PrintDialogFlags.xml b/doc/en/Gnome/PrintDialogFlags.xml index cbc3bca69..8b5f9fbaa 100644 --- a/doc/en/Gnome/PrintDialogFlags.xml +++ b/doc/en/Gnome/PrintDialogFlags.xml @@ -45,4 +45,9 @@ + + + System.Flags + + diff --git a/doc/en/Gnome/PrintDialogRangeFlags.xml b/doc/en/Gnome/PrintDialogRangeFlags.xml index c33688373..4fac8bf63 100644 --- a/doc/en/Gnome/PrintDialogRangeFlags.xml +++ b/doc/en/Gnome/PrintDialogRangeFlags.xml @@ -87,4 +87,9 @@ + + + System.Flags + + diff --git a/doc/en/Gnome/PrintUnitBase.xml b/doc/en/Gnome/PrintUnitBase.xml index 8fe7e2cdd..93549997f 100644 --- a/doc/en/Gnome/PrintUnitBase.xml +++ b/doc/en/Gnome/PrintUnitBase.xml @@ -73,4 +73,9 @@ + + + System.Flags + + diff --git a/doc/en/Gtk/ArgFlags.xml b/doc/en/Gtk/ArgFlags.xml deleted file mode 100644 index 339ea5133..000000000 --- a/doc/en/Gtk/ArgFlags.xml +++ /dev/null @@ -1,98 +0,0 @@ - - - - gtk-sharp - [00 24 00 00 04 80 00 00 94 00 00 00 06 02 00 00 00 24 00 00 52 53 41 31 00 04 00 00 01 00 01 00 71 EB 6C 55 75 52 9C BF 72 44 F7 A6 EA 05 62 84 F9 EA E0 3B CF F2 CC 13 2C 9C 49 0A B3 09 EA B0 B5 6B CE 44 9D F5 03 D9 C0 A8 1E 52 05 85 CD BE 70 E2 FB 90 43 4B AC 04 FA 62 22 A8 00 98 B7 A1 A7 B3 AF 99 1A 41 23 24 BB 43 25 F6 B8 65 BB 64 EB F6 D1 C2 06 D5 73 2D DF BC 70 A7 38 9E E5 3E 0C 24 6E 32 79 74 1A D0 05 03 E4 98 42 E1 9B F3 7B 19 8B 40 21 26 CB 36 89 C2 EA 64 96 A4 7C B4] - 2.0.0.0 - - Gtk# is thread aware, but not thread safe; See the Gtk# Thread Programming for details. - - Do not use. - - - - - System.Enum - - - - GLib.GType(WrapperType=typeof(Gtk.ArgFlagsGType)) - - - System.Flags - - - - - - - Field - - Gtk.ArgFlags - - - - - Do not use. - - - - - - - Field - - Gtk.ArgFlags - - - - - Do not use. - - - - - - - Field - - Gtk.ArgFlags - - - - - Do not use. - - - - - - - Field - - Gtk.ArgFlags - - - - - Do not use. - - - - - - - Field - - Gtk.ArgFlags - - - - - Do not use. - - - - - - diff --git a/doc/en/Gtk/RcTokenType.xml b/doc/en/Gtk/RcTokenType.xml deleted file mode 100644 index d2fc80c29..000000000 --- a/doc/en/Gtk/RcTokenType.xml +++ /dev/null @@ -1,519 +0,0 @@ - - - - gtk-sharp - - - 2.0.0.0 - - Gtk# is thread aware, but not thread safe; See the Gtk# Thread Programming for details. - - An enumeration used to represent the tokens in an RC file. - The RcTokenType enumeration represents the tokens in the RC file. It is exposed so that theme engines can reuse these tokens when parsing the theme-engine specific portions of a RC file. - - - System.Enum - - - - GLib.GType(WrapperType=typeof(Gtk.RcTokenTypeGType)) - - - - - - Field - - Gtk.RcTokenType - - - - Token to represent an invalid RC-file directive. - - - - - - - Field - - Gtk.RcTokenType - - - - Token for including another RC file. - - - - - - - Field - - Gtk.RcTokenType - - - - Token for the normal state of a widget. - - - - - - - Field - - Gtk.RcTokenType - - - - Token for the active state of a widget. - - - - - - - Field - - Gtk.RcTokenType - - - - Token for the prelight state of a widget. - - - - - - - Field - - Gtk.RcTokenType - - - - Token for the selected state of a widget. - - - - - - - Field - - Gtk.RcTokenType - - - - Token for the insensitive (unclickable) state of a widget. - - - - - - - Field - - Gtk.RcTokenType - - - - Token for a foreground color. - - - - - - - Field - - Gtk.RcTokenType - - - - Token for a background color. - - - - - - - Field - - Gtk.RcTokenType - - - - Token for the text color of a widget. - - - - - - - Field - - Gtk.RcTokenType - - - - Token for color used for the background of widgets displaying editable text. - - - - - - - Field - - Gtk.RcTokenType - - - - Token for specifying X thickness. - - - - - - - Field - - Gtk.RcTokenType - - - - Token for specifying Y thickness. - - - - - - - Field - - Gtk.RcTokenType - - - - Token for specifying a font. Deprecated; use FontName declarations instead. - - Deprecation is from GTK+ 2.x. - - - - - Field - - Gtk.RcTokenType - - - - Token for specifying a font set. Deprecated; use FontName declarations instead. - - Deprecation is from GTK+ 2.x. - - - - - Field - - Gtk.RcTokenType - - - - Token for specifying a font name. - - - - - - - Field - - Gtk.RcTokenType - - - - Token for specifying a background pixmap. - - - - - - - Field - - Gtk.RcTokenType - - - - Token for specifying the path for pixmaps. - - - - - - - Field - - Gtk.RcTokenType - - - - Token for specifying a style. - - - - - - - Field - - Gtk.RcTokenType - - - - Token for specifying a key binding set. - - - - - - - Field - - Gtk.RcTokenType - - - - Token for specifying a particular key binding. - - - - - - - Field - - Gtk.RcTokenType - - - - Token for binding a style to a widget. - - - - - - - Field - - Gtk.RcTokenType - - - - Token for binding a style to a class of widgets. - - - - - - - Field - - Gtk.RcTokenType - - - - Token for applying a style to an object class. - - - - - - - Field - - Gtk.RcTokenType - - - - Token for specifying that a given RC directive is lowest priority. - - - - - - - Field - - Gtk.RcTokenType - - - - Token for specifying the "gtk" priority level (one above lowest). - - - - - - - Field - - Gtk.RcTokenType - - - - Token for specifying the "application" priority level. - - - - - - - Field - - Gtk.RcTokenType - - - - Token for specifying the "theme" priority level. - - - - - - - Field - - Gtk.RcTokenType - - - - Token for specifying the "rc" priority level. - - - - - - - Field - - Gtk.RcTokenType - - - - Token for specifying "highest" priority level. - - - - - - - Field - - Gtk.RcTokenType - - - - Token to define an engine to use for this style. - - - - - - - Field - - Gtk.RcTokenType - - - - Token to set path to search for theme engines. - - - - - - - Field - - Gtk.RcTokenType - - - - Token to set path used for IM modules. - - - - - - - Field - - Gtk.RcTokenType - - - - Token to set path to the IM modules file. - - - - - - - Field - - Gtk.RcTokenType - - - - Token to specify the icon for a stock item. - - - - - - - Field - - Gtk.RcTokenType - - - - Token to specify a value for use with a left-to-right language. - - - - - - - Field - - Gtk.RcTokenType - - - - Token to specify a value for use with a right-to-left language. - - - - - - - Field - - Gtk.RcTokenType - - - - Token to specify the last token. (FIXME: check this) - - - - - - - diff --git a/doc/en/index.xml b/doc/en/index.xml index 4335fd9ab..767c263fc 100644 --- a/doc/en/index.xml +++ b/doc/en/index.xml @@ -977,7 +977,6 @@ - @@ -1013,7 +1012,6 @@ - diff --git a/gda/gda-api.raw b/gda/gda-api.raw index bea22f55a..8005a623f 100644 --- a/gda/gda-api.raw +++ b/gda/gda-api.raw @@ -10,7 +10,7 @@ - + diff --git a/gdk/gdk-api-2.4.raw b/gdk/gdk-api-2.4.raw index c5e5b402c..e5c3c8ed6 100644 --- a/gdk/gdk-api-2.4.raw +++ b/gdk/gdk-api-2.4.raw @@ -318,7 +318,7 @@ - + @@ -4439,13 +4439,13 @@ - + - + - + diff --git a/gdk/gdk-api-2.6.raw b/gdk/gdk-api-2.6.raw index 328ada1bb..47672aae1 100644 --- a/gdk/gdk-api-2.6.raw +++ b/gdk/gdk-api-2.6.raw @@ -319,7 +319,7 @@ - + @@ -4635,13 +4635,13 @@ - + - + - + diff --git a/gnome/Gnome.metadata b/gnome/Gnome.metadata index 8d14bfb64..9919144cf 100644 --- a/gnome/Gnome.metadata +++ b/gnome/Gnome.metadata @@ -1,5 +1,6 @@ + (int)Gtk.ResponseType.Cancel 1 public public diff --git a/gnome/gnome-api.raw b/gnome/gnome-api.raw index d84bfc1cf..391aa2406 100644 --- a/gnome/gnome-api.raw +++ b/gnome/gnome-api.raw @@ -5342,11 +5342,11 @@ - - - - - + + + + + @@ -7172,25 +7172,25 @@ - - - + + + - + - - - + + + - - - - - - + + + + + + diff --git a/gtk/Gtk.metadata b/gtk/Gtk.metadata index d15e9f30f..ccd3049a4 100644 --- a/gtk/Gtk.metadata +++ b/gtk/Gtk.metadata @@ -66,6 +66,7 @@ out out 1 + 1 1 1 1 @@ -73,6 +74,7 @@ 1 1 1 + 1 1 1 1 diff --git a/gtk/gtk-api-2.4.raw b/gtk/gtk-api-2.4.raw index 165020306..87d44f525 100644 --- a/gtk/gtk-api-2.4.raw +++ b/gtk/gtk-api-2.4.raw @@ -22,20 +22,20 @@ - - - - - - - - + + + + + + + + - - - - + + + + @@ -288,7 +288,7 @@ - + @@ -381,7 +381,7 @@ - + @@ -397,12 +397,12 @@ - - - - - - + + + + + + diff --git a/gtk/gtk-api-2.6.raw b/gtk/gtk-api-2.6.raw index 677161309..cd20fa588 100644 --- a/gtk/gtk-api-2.6.raw +++ b/gtk/gtk-api-2.6.raw @@ -22,20 +22,20 @@ - - - - - - - - + + + + + + + + - - - - + + + + @@ -289,7 +289,7 @@ - + @@ -382,7 +382,7 @@ - + @@ -398,12 +398,12 @@ - - - - - - + + + + + + diff --git a/parser/gapi2xml.pl b/parser/gapi2xml.pl index 0b50f570d..334abe724 100755 --- a/parser/gapi2xml.pl +++ b/parser/gapi2xml.pl @@ -228,12 +228,12 @@ foreach $cname (sort(keys(%edefs))) { if ($enum_gtype{$cname}) { $enum_elem->setAttribute("gtype", $enum_gtype{$cname}); } - if ($def =~ /=\s*1\s*<<\s*\d+/) { + if ($def =~ /<setAttribute('type', "flags"); } else { $enum_elem->setAttribute('type', "enum"); } - $def =~ /\{(.*)\}/; + $def =~ /\{(.*\S)\s*\}/; @vals = split(/,\s*/, $1); $vals[0] =~ s/^\s+//; @v0 = split(/_/, $vals[0]); @@ -252,12 +252,14 @@ foreach $cname (sort(keys(%edefs))) { } foreach $val (@vals) { - if ($val =~ /$common\_?(\w+)\s*=\s*(\-?\d+.*)/) { + $val =~ s/=\s*\(\s*(.*\S)\s*\)\s*/= \1/; + if ($val =~ /$common\_?(\w+)\s*=\s*(.*)$/) { $name = $1; - if ($2 =~ /1u?\s*<<\s*(\d+)/) { - $enumval = "1 << $1"; - } else { - $enumval = $2; + $enumval = $2; + if ($enumval =~ /^(\d+|0x[0-9A-Fa-f]+)u?\s*<<\s*(\d+)$/) { + $enumval = "$1 << $2"; + } elsif ($enumval =~ /^$common\_?(\w+)$/) { + $enumval = StudlyCaps(lc($1)) } } elsif ($val =~ /$common\_?(\w+)/) { $name = $1; $enumval = "";