[Gtk-sharp-list] Is and Has methods as properties patch
Martin Willemoes Hansen
mwh@sysrq.dk
Tue, 28 Oct 2003 19:03:00 +0100
--=-CLt4DBC1N6NwkkZCLLKe
Content-Type: text/plain
Content-Transfer-Encoding: 7bit
Hi!
Ived patch the generator to use properties for Is and Has methods.
Okay to commit?
--
Martin Willemoes Hansen
--------------------------------------------------------
E-Mail mwh@sysrq.dk Website mwh.sysrq.dk
IRC MWH, freenode.net
--------------------------------------------------------
--=-CLt4DBC1N6NwkkZCLLKe
Content-Disposition: attachment; filename=IsAndHasAsProperties.diff
Content-Type: text/x-patch; name=IsAndHasAsProperties.diff; charset=iso-8859-1
Content-Transfer-Encoding: 7bit
? IsAndHasAsProperties.diff
Index: ChangeLog
===================================================================
RCS file: /cvs/public/gtk-sharp/ChangeLog,v
retrieving revision 1.535
diff -u -r1.535 ChangeLog
--- ChangeLog 28 Oct 2003 15:45:35 -0000 1.535
+++ ChangeLog 28 Oct 2003 18:14:17 -0000
@@ -1,3 +1,16 @@
+2003-10-28 Martin Willemoes Hansen <mwh@sysrq.dk>
+
+ * gdk/Gdk.metadata: fixed property identifier collision
+ * gdk/gdk-api.xml: regenerated
+ * generator/Method.cs: added Is and Has as property methods
+ * gnome/Gnome.metadata: fixed property identifier collisions and
+ sorted it.
+ * gnome/gnome-api.xml: regenerated
+ * gtk/Gtk.metadata: fixed property identifier collision
+ * gtk/gtk-api.xml: regenerated
+ * gtkhtml/Gtk.metadata: fixed property identifier collision
+ * gtkhtml/gtkhtml-api.xml: regenerated
+
2003-10-28 Mike Kestner <mkestner@ximian.com>
* generator/BoxedGen.cs : generate GLib.Value ctors. [fixes #47168]
Index: gdk/Gdk.metadata
===================================================================
RCS file: /cvs/public/gtk-sharp/gdk/Gdk.metadata,v
retrieving revision 1.2
diff -u -r1.2 Gdk.metadata
--- gdk/Gdk.metadata 13 Oct 2003 21:53:40 -0000 1.2
+++ gdk/Gdk.metadata 28 Oct 2003 18:14:19 -0000
@@ -29,6 +29,7 @@
<attr path="//object[@cname='GdkPixbuf']/method[@name='RenderPixmapAndMaskForColormap']" name="library">libgdk-win32-2.0-0.dll</attr>
<attr path="//object[@cname='GdkPixbuf']/method[@name='RenderPixmapAndMask']" name="library">libgdk-win32-2.0-0.dll</attr>
<attr path="//object[@cname='GdkPixbuf']/method[@name='ScaleSimple']" name="hidden">1</attr>
+ <attr path="//object[@cname='GdkPixbufAnimation']/method[@name='IsStaticImage']" name="name">GetIsStaticImage</attr>
<attr path="//object[@cname='GdkPixbufLoader']/method[@name='GetPixbuf']" name="needs_ref">1</attr>
<attr path="//object[@cname='GdkPixbufLoader']/method[@name='Write']/*/*[@name='buf']" name="array">1</attr>
<attr path="//object[@cname='GdkPixmap']" name="parent">GdkDrawable</attr>
Index: gdk/gdk-api.xml
===================================================================
RCS file: /cvs/public/gtk-sharp/gdk/gdk-api.xml,v
retrieving revision 1.5
diff -u -r1.5 gdk-api.xml
--- gdk/gdk-api.xml 20 Oct 2003 20:02:15 -0000 1.5
+++ gdk/gdk-api.xml 28 Oct 2003 18:14:19 -0000
@@ -4001,7 +4001,7 @@
<method name="GetWidth" cname="gdk_pixbuf_animation_get_width">
<return-type type="int" />
</method>
- <method name="IsStaticImage" cname="gdk_pixbuf_animation_is_static_image">
+ <method cname="gdk_pixbuf_animation_is_static_image" name="GetIsStaticImage">
<return-type type="gboolean" />
</method>
<constructor cname="gdk_pixbuf_animation_new_from_file">
Index: generator/Method.cs
===================================================================
RCS file: /cvs/public/gtk-sharp/generator/Method.cs,v
retrieving revision 1.35
diff -u -r1.35 Method.cs
--- generator/Method.cs 8 Oct 2003 02:56:44 -0000 1.35
+++ generator/Method.cs 28 Oct 2003 18:14:19 -0000
@@ -168,7 +168,7 @@
else
safety = "";
- is_get = (((parms != null && ((parms.IsAccessor && s_ret == "void") || (parms.Count == 0 && s_ret != "void"))) || (parms == null && s_ret != "void")) && Name.Length > 3 && Name.Substring(0, 3) == "Get");
+ is_get = (((parms != null && ((parms.IsAccessor && s_ret == "void") || (parms.Count == 0 && s_ret != "void"))) || (parms == null && s_ret != "void")) && Name.Length > 3 && (Name.StartsWith ("Get") || Name.StartsWith ("Is") || Name.StartsWith ("Has")));
is_set = ((parms != null && (parms.IsAccessor || (parms.Count == 1 && s_ret == "void"))) && (Name.Length > 3 && Name.Substring(0, 3) == "Set"));
if (parms != null) {
@@ -233,7 +233,7 @@
s_ret = parms.AccessorReturnType;
sw.Write(s_ret);
sw.Write(" ");
- sw.Write(Name.Substring (3));
+ sw.Write(Name.StartsWith ("Is") ? Name.Substring (2) : Name.Substring (3));
sw.WriteLine(" { ");
} else {
sw.Write(s_ret + " " + Name + sig);
Index: gnome/Gnome.metadata
===================================================================
RCS file: /cvs/public/gtk-sharp/gnome/Gnome.metadata,v
retrieving revision 1.2
diff -u -r1.2 Gnome.metadata
--- gnome/Gnome.metadata 17 Oct 2003 20:23:24 -0000 1.2
+++ gnome/Gnome.metadata 28 Oct 2003 18:14:19 -0000
@@ -2,30 +2,17 @@
<metadata>
<attr path="//boxed[@cname='GnomeCanvasPoints']" name="opaque">1</attr>
<attr path="//boxed[@cname='GnomeGlyphList']/method/*/*[@type='const-guchar*']" name="type">const-gchar*</attr>
- <attr path="//boxed[@cname='GnomePrintUnit']/method/*/*[@type='const-guchar*']" name="type">const-gchar*</attr>
<attr path="//boxed[@cname='GnomePrintUnit']/method[@name='GetIdentity']/*/*[@name='base']" name="name">Base</attr>
+ <attr path="//boxed[@cname='GnomePrintUnit']/method/*/*[@type='const-guchar*']" name="type">const-gchar*</attr>
<attr path="//class[@cname='GnomeConfig_']/method[@name='SetSetHandler']" name="hidden">1</attr>
<attr path="//class[@cname='GnomeConfig_']/method[@name='SetSyncHandler']" name="hidden">1</attr>
<attr path="//class[@cname='GnomeGdk_']" name="name">GdkHelper</attr>
<attr path="//class[@cname='GnomeGtk_']" name="name">GtkHelper</attr>
<attr path="//class[@cname='GnomePrint_']/method/*/*[@name='in']" name="type">const-gchar*</attr>
- <attr path="//class[@cname='GnomePrint_']/method/*/*[@name='text']" name="type">const-gchar*</attr>
<attr path="//class[@cname='GnomePrint_']/method/*/*[@name='name']" name="type">const-gchar*</attr>
+ <attr path="//class[@cname='GnomePrint_']/method/*/*[@name='text']" name="type">const-gchar*</attr>
<attr path="//object[@cname='GnomeAbout']/constructor[@cname='gnome_about_new']/*/*[@type='const-gchar**']" name="array">1</attr>
<attr path="//object[@cname='GnomeAppBar']/signal[@name='ClearPrompt']" name="name">PromptCleared</attr>
- <attr path="//object[@cname='GnomeCanvas']/method[@name='C2w']/*/*[@type='double*']" name="pass_as">out</attr>
- <attr path="//object[@cname='GnomeCanvas']/method[@name='GetButtPoints']/*/*[@type='double*']" name="pass_as">out</attr>
- <attr path="//object[@cname='GnomeCanvas']/method[@name='GetColor']/return-type" name="type">gboolean</attr>
- <attr path="//object[@cname='GnomeCanvas']/method[@name='GetColor']/*/*[@type='GdkColor*']" name="pass_as">out</attr>
- <attr path="//object[@cname='GnomeCanvas']/method[@name='GetMiterPoints']/return-type" name="type">gboolean</attr>
- <attr path="//object[@cname='GnomeCanvas']/method[@name='GetMiterPoints']/*/*[@type='double*']" name="pass_as">out</attr>
- <attr path="//object[@cname='GnomeCanvas']/method[@name='GetScrollOffsets']/*/*[@type='int*']" name="pass_as">out</attr>
- <attr path="//object[@cname='GnomeCanvas']/method[@name='GetScrollRegion']/*/*[@type='double*']" name="pass_as">out</attr>
- <attr path="//object[@cname='GnomeCanvas']/method[@name='W2c']/*/*[@type='int*']" name="pass_as">out</attr>
- <attr path="//object[@cname='GnomeCanvas']/method[@name='W2cD']/*/*[@type='double*']" name="pass_as">out</attr>
- <attr path="//object[@cname='GnomeCanvas']/method[@name='WindowToWorld']/*/*[@type='double*']" name="pass_as">out</attr>
- <attr path="//object[@cname='GnomeCanvas']/method[@name='WorldToWindow']/*/*[@type='double*']" name="pass_as">out</attr>
- <attr path="//object[@cname='GnomeCanvas']/method[@name='W2cAffine']" name="hidden">1</attr>
<attr path="//object[@cname='GnomeCanvasClipgroup']/property[@name='Wind']" name="type">ArtWindRule</attr>
<attr path="//object[@cname='GnomeCanvasItem']/constructor[@cname='gnome_canvas_item_new']" name="hidden">1</attr>
<attr path="//object[@cname='GnomeCanvasItem']/method[@name='AffineAbsolute']" name="hidden">1</attr>
@@ -33,13 +20,26 @@
<attr path="//object[@cname='GnomeCanvasItem']/method[@name='Construct']" name="hidden">1</attr>
<attr path="//object[@cname='GnomeCanvasItem']/method[@name='GetBounds']/*/*[@type='double*']" name="pass_as">out</attr>
<attr path="//object[@cname='GnomeCanvasItem']/method[@name='I2cAffine']" name="hidden">1</attr>
- <attr path="//object[@cname='GnomeCanvasItem']/method[@name='I2w']/*/*[@type='double*']" name="pass_as">ref</attr>
<attr path="//object[@cname='GnomeCanvasItem']/method[@name='I2wAffine']" name="hidden">1</attr>
+ <attr path="//object[@cname='GnomeCanvasItem']/method[@name='I2w']/*/*[@type='double*']" name="pass_as">ref</attr>
<attr path="//object[@cname='GnomeCanvasItem']/method[@name='SetValist']" name="hidden">1</attr>
<attr path="//object[@cname='GnomeCanvasItem']/method[@name='W2i']/*/*[@type='double*']" name="pass_as">ref</attr>
<attr path="//object[@cname='GnomeCanvasItem']/signal[@name='Event']" name="name">CanvasEvent</attr>
- <attr path="//object[@cname='GnomeCanvasRichText']/method[@name='GetIterLocation']/*/*[@name='location']" name="pass_as">out</attr>
+ <attr path="//object[@cname='GnomeCanvas']/method[@name='C2w']/*/*[@type='double*']" name="pass_as">out</attr>
+ <attr path="//object[@cname='GnomeCanvas']/method[@name='GetButtPoints']/*/*[@type='double*']" name="pass_as">out</attr>
+ <attr path="//object[@cname='GnomeCanvas']/method[@name='GetColor']/return-type" name="type">gboolean</attr>
+ <attr path="//object[@cname='GnomeCanvas']/method[@name='GetColor']/*/*[@type='GdkColor*']" name="pass_as">out</attr>
+ <attr path="//object[@cname='GnomeCanvas']/method[@name='GetMiterPoints']/return-type" name="type">gboolean</attr>
+ <attr path="//object[@cname='GnomeCanvas']/method[@name='GetMiterPoints']/*/*[@type='double*']" name="pass_as">out</attr>
+ <attr path="//object[@cname='GnomeCanvas']/method[@name='GetScrollOffsets']/*/*[@type='int*']" name="pass_as">out</attr>
+ <attr path="//object[@cname='GnomeCanvas']/method[@name='GetScrollRegion']/*/*[@type='double*']" name="pass_as">out</attr>
+ <attr path="//object[@cname='GnomeCanvas']/method[@name='W2cAffine']" name="hidden">1</attr>
+ <attr path="//object[@cname='GnomeCanvas']/method[@name='W2cD']/*/*[@type='double*']" name="pass_as">out</attr>
+ <attr path="//object[@cname='GnomeCanvas']/method[@name='W2c']/*/*[@type='int*']" name="pass_as">out</attr>
+ <attr path="//object[@cname='GnomeCanvas']/method[@name='WindowToWorld']/*/*[@type='double*']" name="pass_as">out</attr>
+ <attr path="//object[@cname='GnomeCanvas']/method[@name='WorldToWindow']/*/*[@type='double*']" name="pass_as">out</attr>
<attr path="//object[@cname='GnomeCanvasRichText']/method[@name='GetIterAtLocation']/*/*[@name='iter']" name="pass_as">out</attr>
+ <attr path="//object[@cname='GnomeCanvasRichText']/method[@name='GetIterLocation']/*/*[@name='location']" name="pass_as">out</attr>
<attr path="//object[@cname='GnomeCanvasShape']/property[@name='Dash']" name="type">ArtVpathDash</attr>
<attr path="//object[@cname='GnomeClient']/signal[@name='Connect']" name="name">Connected</attr>
<attr path="//object[@cname='GnomeClient']/signal[@name='Disconnect']" name="name">Disconnected</attr>
@@ -53,11 +53,11 @@
<attr path="//object[@cname='GnomeFileEntry']/method[@name='GnomeEntry']" name="hidden">1</attr>
<attr path="//object[@cname='GnomeFileEntry']/method[@name='GtkEntry']" name="hidden">1</attr>
<attr path="//object[@cname='GnomeFileEntry']/signal[@name='Activate']" name="name">Activated</attr>
+ <attr path="//object[@cname='GnomeFontFace']/method/return-type[@type='const-guchar*']" name="type">const-gchar*</attr>
+ <attr path="//object[@cname='GnomeFontFace']/method/*/*[@type='const-guchar*']" name="type">const-gchar*</attr>
<attr path="//object[@cname='GnomeFont']/method/return-type[@type='const-guchar*']" name="type">const-gchar*</attr>
<attr path="//object[@cname='GnomeFont']/method/*/*[@type='const-guchar*']" name="type">const-gchar*</attr>
<attr path="//object[@cname='GnomeFontPreview']/method/*/*[@type='const-guchar*']" name="type">const-gchar*</attr>
- <attr path="//object[@cname='GnomeFontFace']/method/return-type[@type='const-guchar*']" name="type">const-gchar*</attr>
- <attr path="//object[@cname='GnomeFontFace']/method/*/*[@type='const-guchar*']" name="type">const-gchar*</attr>
<attr path="//object[@cname='GnomeIconEntry']/method[@name='PickDialog']" name="hidden">1</attr>
<attr path="//object[@cname='GnomeIconList']/constructor[@cname='gnome_icon_list_new']/*/*[@type='GtkAdjustment*']" name="null_ok">1</attr>
<attr path="//object[@cname='GnomeIconList']/method[@name='GetSelection']/return-type" name="element_type">int</attr>
@@ -66,11 +66,11 @@
<attr path="//object[@cname='GnomeIconList']/signal[@name='FocusIcon']" name="name">IconFocused</attr>
<attr path="//object[@cname='GnomeIconList']/signal[@name='SelectIcon']" name="name">IconSelected</attr>
<attr path="//object[@cname='GnomeIconList']/signal[@name='UnselectIcon']" name="name">IconUnselected</attr>
- <attr path="//object[@cname='GnomePrintConfig']/method/*/*[@type='const-guchar*']" name="type">const-gchar*</attr>
<attr path="//object[@cname='GnomePrintConfig']/method[@name='Get']/return-type" name="type">gchar*</attr>
- <attr path="//object[@cname='GnomePrintDialog']/method/*/*[@type='const-guchar*']" name="type">const-gchar*</attr>
- <attr path="//object[@cname='GnomePrintDialog']/constructor[@cname='gnome_print_dialog_new']/*/*[@type='const-guchar*']" name="type">const-gchar*</attr>
+ <attr path="//object[@cname='GnomePrintConfig']/method/*/*[@type='const-guchar*']" name="type">const-gchar*</attr>
<attr path="//object[@cname='GnomePrintDialog']/constructor[@cname='gnome_print_dialog_new']/*/*[@name='flags']" name="type">GnomePrintDialogFlags</attr>
+ <attr path="//object[@cname='GnomePrintDialog']/constructor[@cname='gnome_print_dialog_new']/*/*[@type='const-guchar*']" name="type">const-gchar*</attr>
+ <attr path="//object[@cname='GnomePrintDialog']/method/*/*[@type='const-guchar*']" name="type">const-gchar*</attr>
<attr path="//object[@cname='GnomePrintJob']" name="disabledefaultconstructor">1</attr>
<attr path="//object[@cname='GnomePrintJobPreview']/constructor/*/*[@type='const-guchar*']" name="type">const-gchar*</attr>
<attr path="//object[@cname='GnomePrintMeta']/method/*/*[@name='filename']" name="type">const-gchar*</attr>
@@ -78,9 +78,11 @@
<attr path="//object[@cname='GnomePrintTransport']" name="parent">GObject</attr>
<attr path="//object[@cname='GPAOptionMenu']/constructor/*/*[@type='const-guchar*']" name="type">const-gchar*</attr>
<attr path="//struct[@cname='GnomeCanvasPathDef']/method[@name='Curveto']" name="name">CurveTo</attr>
- <attr path="//struct[@cname='GnomeCanvasPathDef']/method[@name='Lineto']" name="name">LineTo</attr>
+ <attr path="//struct[@cname='GnomeCanvasPathDef']/method[@name='HasCurrentpoint']" name="name">GetHasCurrentpoint</attr>
<attr path="//struct[@cname='GnomeCanvasPathDef']/method[@name='LinetoMoving']" name="name">LineToMoving</attr>
+ <attr path="//struct[@cname='GnomeCanvasPathDef']/method[@name='Lineto']" name="name">LineTo</attr>
<attr path="//struct[@cname='GnomeCanvasPathDef']/method[@name='Moveto']" name="name">MoveTo</attr>
<attr path="//struct[@cname='GnomeCanvasPathDef']/method[@name='Split']/return-type" name="element_type">Gnome.CanvasPathDef</attr>
+ <attr path="//struct[@cname='GPPath']/method[@name='HasCurrentpoint']" name="name">GetHasCurrentpoint</attr>
<attr path="//struct[@cname='GnomePrintPaper']/method/*/*[@type='const-guchar*']" name="type">const-gchar*</attr>
</metadata>
Index: gnome/gnome-api.xml
===================================================================
RCS file: /cvs/public/gtk-sharp/gnome/gnome-api.xml,v
retrieving revision 1.3
diff -u -r1.3 gnome-api.xml
--- gnome/gnome-api.xml 17 Oct 2003 20:23:24 -0000 1.3
+++ gnome/gnome-api.xml 28 Oct 2003 18:14:21 -0000
@@ -1575,7 +1575,7 @@
<method name="FirstBpath" cname="gnome_canvas_path_def_first_bpath">
<return-type type="ArtBpath*" />
</method>
- <method name="HasCurrentpoint" cname="gnome_canvas_path_def_has_currentpoint">
+ <method cname="gnome_canvas_path_def_has_currentpoint" name="GetHasCurrentpoint">
<return-type type="gboolean" />
</method>
<method name="IsEmpty" cname="gnome_canvas_path_def_is_empty">
@@ -5471,7 +5471,7 @@
<method name="FirstBpath" cname="gp_path_first_bpath">
<return-type type="ArtBpath*" />
</method>
- <method name="HasCurrentpoint" cname="gp_path_has_currentpoint">
+ <method cname="gp_path_has_currentpoint" name="GetHasCurrentpoint">
<return-type type="gboolean" />
</method>
<method name="IsEmpty" cname="gp_path_is_empty">
Index: gtk/Gtk.metadata
===================================================================
RCS file: /cvs/public/gtk-sharp/gtk/Gtk.metadata,v
retrieving revision 1.8
diff -u -r1.8 Gtk.metadata
--- gtk/Gtk.metadata 26 Oct 2003 19:05:59 -0000 1.8
+++ gtk/Gtk.metadata 28 Oct 2003 18:14:22 -0000
@@ -226,6 +226,7 @@
<attr path="//object[@cname='GtkWidget']/method[@name='GetParentWindow']" name="needs_ref">1</attr>
<attr path="//object[@cname='GtkWidget']/method[@name='GetStyle']" name="needs_ref">1</attr>
<attr path="//object[@cname='GtkWidget']/method[@name='GetVisual']" name="needs_ref">1</attr>
+ <attr path="//object[@cname='GtkWidget']/method[@name='HasScreen']" name="name">GetHasScreen</attr>
<attr path="//object[@cname='GtkWidget']/method[@name='Intersect']/*/*[@name='intersection']" name="pass_as">out</attr>
<attr path="//object[@cname='GtkWidget']/method[@name='IsFocus']" name="name">GetIsFocus</attr>
<attr path="//object[@cname='GtkWidget']/method[@name='ListAccelClosures']" name="hidden">1</attr>
Index: gtk/gtk-api.xml
===================================================================
RCS file: /cvs/public/gtk-sharp/gtk/gtk-api.xml,v
retrieving revision 1.17
diff -u -r1.17 gtk-api.xml
--- gtk/gtk-api.xml 26 Oct 2003 19:05:59 -0000 1.17
+++ gtk/gtk-api.xml 28 Oct 2003 18:14:24 -0000
@@ -10093,7 +10093,7 @@
<method name="GrabFocus" cname="gtk_widget_grab_focus">
<return-type type="void" />
</method>
- <method name="HasScreen" cname="gtk_widget_has_screen">
+ <method cname="gtk_widget_has_screen" name="GetHasScreen">
<return-type type="gboolean" />
</method>
<method name="Hide" cname="gtk_widget_hide">
Index: gtkhtml/Gtk.metadata
===================================================================
RCS file: /cvs/public/gtk-sharp/gtkhtml/Gtk.metadata,v
retrieving revision 1.2
diff -u -r1.2 Gtk.metadata
--- gtkhtml/Gtk.metadata 22 Oct 2003 19:25:36 -0000 1.2
+++ gtkhtml/Gtk.metadata 28 Oct 2003 18:14:26 -0000
@@ -3,6 +3,7 @@
<attr path="//object[@cname='GtkHTML']/signal[@name='Command']" name="name">OnCommand</attr>
<attr path="//object[@cname='GtkHTML']/method[@name='BeginContent']" name="name">Begin</attr>
<attr path="//object[@cname='GtkHTML']/method[@name='BeginFull']" name="name">Begin</attr>
+ <attr path="//object[@cname='GtkHTML']/method[@name='HasUndo']" name="name">GetHasUndo</attr>
<attr path="//struct[@cname='GtkHTMLStream']/method[@name='Write']/*/*[@name='buffer']" name="type">const-guchar*</attr>
<attr path="//struct[@cname='GtkHTMLStream']/method[@name='Write']/*/*[@name='buffer']" name="array">1</attr>
</metadata>
Index: gtkhtml/gtkhtml-api.xml
===================================================================
RCS file: /cvs/public/gtk-sharp/gtkhtml/gtkhtml-api.xml,v
retrieving revision 1.6
diff -u -r1.6 gtkhtml-api.xml
--- gtkhtml/gtkhtml-api.xml 22 Oct 2003 19:25:36 -0000 1.6
+++ gtkhtml/gtkhtml-api.xml 28 Oct 2003 18:14:26 -0000
@@ -573,7 +573,7 @@
<parameter type="const-char*" name="url" />
</parameters>
</method>
- <method name="HasUndo" cname="gtk_html_has_undo">
+ <method cname="gtk_html_has_undo" name="GetHasUndo">
<return-type type="gboolean" />
</method>
<method name="ImagePreload" cname="gtk_html_image_preload">
--=-CLt4DBC1N6NwkkZCLLKe--