From d41f6593b019e3e0627d2dd9ec1b33e3b4d4adbd Mon Sep 17 00:00:00 2001 From: Mike Kestner Date: Tue, 10 Feb 2004 16:04:50 +0000 Subject: [PATCH] 2004-02-10 Mike Kestner * art/Art.metadata : mark a field private * art/art-api.xml : regen * gda/Gda.metadata : mark a few structs opaque * gda/gda-api.xml : regen * gdk/*.custom : fix changed field names * gdk/gdk-api.xml : regen * generator/Field.cs : StudlyCase simple typed field names. * gnome/Gnome.metadata : mark FontEntry.weight private to avoid collision with Weight field. s|//|/api/namespace|g * gnome/gnome-api.xml : regen * gtk/Gtk.metadata : rename AccelKey.accel_key to key to avoid collision with type name. * gtk/*.custom : fix changed field names * gtk/gtk-api.xml : regen * pango/pango-api.xml : regen * parser/gapi_pp.pl : add a private_regex to hide BACKEND and ENGINE apis, which are by convention private. * sample/* : make compile * sample/GtkDemo/* : make compile * sample/test/* : make compile * sources/gtk-sharp-sources.xml : exclude a bunch of pango source files. svn path=/trunk/gtk-sharp/; revision=22947 --- ChangeLog | 25 ++ art/Art.metadata | 1 + art/art-api.xml | 2 +- gda/Gda.metadata | 4 +- gda/gda-api.xml | 6 +- gdk/Color.custom | 18 +- gdk/DeviceAxis.custom | 2 +- gdk/Drawable.custom | 2 +- gdk/EventKey.custom | 2 +- gdk/Point.custom | 6 +- gdk/Rectangle.custom | 12 +- gdk/Window.custom | 2 +- gdk/gdk-api.xml | 150 +------ generator/Field.cs | 10 +- gnome/Gnome.metadata | 171 ++++---- gnome/gnome-api.xml | 2 +- gtk/AccelKey.custom | 4 +- gtk/Gtk.metadata | 1 + gtk/TargetEntry.custom | 6 +- gtk/TreeIter.custom | 4 +- gtk/Widget.custom | 2 +- pango/pango-api.xml | 614 +-------------------------- parser/gapi_pp.pl | 18 + sample/CanvasExample.cs | 14 +- sample/GnomeHelloWorld.cs | 2 +- sample/GtkDemo/DemoColorSelection.cs | 6 +- sample/GtkDemo/DemoDrawingArea.cs | 58 +-- sample/GtkDemo/DemoMenus.cs | 16 +- sample/GtkDemo/DemoPixbuf.cs | 6 +- sample/GtkDemo/Makefile | 2 +- sample/Scribble.cs | 42 +- sample/test/TestCheckButton.cs | 2 +- sample/test/TestColorSelection.cs | 15 +- sample/test/TestCombo.cs | 2 +- sample/test/TestDialog.cs | 2 +- sample/test/TestFlipping.cs | 2 +- sample/test/TestMenus.cs | 4 +- sample/test/TestRadioButton.cs | 16 +- sample/test/TestRange.cs | 2 +- sample/test/TestSizeGroup.cs | 6 +- sample/test/TestStatusbar.cs | 2 +- sample/test/WidgetViewer.cs | 2 +- sources/gtk-sharp-sources.xml | 9 + 43 files changed, 288 insertions(+), 986 deletions(-) diff --git a/ChangeLog b/ChangeLog index d60c7fc53..bd5009005 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,28 @@ +2004-02-10 Mike Kestner + + * art/Art.metadata : mark a field private + * art/art-api.xml : regen + * gda/Gda.metadata : mark a few structs opaque + * gda/gda-api.xml : regen + * gdk/*.custom : fix changed field names + * gdk/gdk-api.xml : regen + * generator/Field.cs : StudlyCase simple typed field names. + * gnome/Gnome.metadata : mark FontEntry.weight private to + avoid collision with Weight field. s|//|/api/namespace|g + * gnome/gnome-api.xml : regen + * gtk/Gtk.metadata : rename AccelKey.accel_key to key to + avoid collision with type name. + * gtk/*.custom : fix changed field names + * gtk/gtk-api.xml : regen + * pango/pango-api.xml : regen + * parser/gapi_pp.pl : add a private_regex to hide BACKEND + and ENGINE apis, which are by convention private. + * sample/* : make compile + * sample/GtkDemo/* : make compile + * sample/test/* : make compile + * sources/gtk-sharp-sources.xml : exclude a bunch of pango + source files. + 2004-02-07 Mike Kestner * configure.in : tagged 0.16 and bumped cvs version. diff --git a/art/Art.metadata b/art/Art.metadata index e69b141c6..6030f6684 100644 --- a/art/Art.metadata +++ b/art/Art.metadata @@ -3,5 +3,6 @@ ToStringArray 17 17 + private 1 diff --git a/art/art-api.xml b/art/art-api.xml index b2710ccff..df8eb80e8 100644 --- a/art/art-api.xml +++ b/art/art-api.xml @@ -314,7 +314,7 @@ - + diff --git a/gda/Gda.metadata b/gda/Gda.metadata index 88ddae0ab..22d253c98 100644 --- a/gda/Gda.metadata +++ b/gda/Gda.metadata @@ -13,6 +13,8 @@ 1 1 DataChanged - 1 + 1 + 1 + 1 diff --git a/gda/gda-api.xml b/gda/gda-api.xml index e5406b62c..569ca50b0 100644 --- a/gda/gda-api.xml +++ b/gda/gda-api.xml @@ -1313,7 +1313,7 @@ - + @@ -1383,7 +1383,7 @@ - + @@ -1527,7 +1527,7 @@ - + diff --git a/gdk/Color.custom b/gdk/Color.custom index 40f341b17..6e8fb003d 100644 --- a/gdk/Color.custom +++ b/gdk/Color.custom @@ -10,15 +10,15 @@ public override string ToString () { - return String.Format ("rgb:{0:x}/{1:x}/{2:x}", red, green, blue); + return String.Format ("rgb:{0:x}/{1:x}/{2:x}", Red, Green, Blue); } public Color (byte r, byte g, byte b) { - red = (ushort) (r << 8 | r); - green = (ushort) (g << 8 | g); - blue = (ushort) (b << 8 | b); - pixel = 0; + Red = (ushort) (r << 8 | r); + Green = (ushort) (g << 8 | g); + Blue = (ushort) (b << 8 | b); + Pixel = 0; } public Color (System.Drawing.Color color) @@ -28,10 +28,10 @@ public Color (System.Drawing.Color color) g = color.G; b = color.B; - red = (ushort) (r << 8 | r); - green = (ushort) (g << 8 | g); - blue = (ushort) (b << 8 | b); - pixel = 0; + Red = (ushort) (r << 8 | r); + Green = (ushort) (g << 8 | g); + Blue = (ushort) (b << 8 | b); + Pixel = 0; } [DllImport("libgdk-win32-2.0-0.dll")] diff --git a/gdk/DeviceAxis.custom b/gdk/DeviceAxis.custom index 9dc3c46d6..5529c14bd 100644 --- a/gdk/DeviceAxis.custom +++ b/gdk/DeviceAxis.custom @@ -18,7 +18,7 @@ public override string ToString () { - return "Gdk.DeviceAxis, max:" + this.max + ",min:" + this.min; + return "Gdk.DeviceAxis, max:" + this.Max + ",min:" + this.Min; } diff --git a/gdk/Drawable.custom b/gdk/Drawable.custom index 5ecc15a42..a108fd719 100644 --- a/gdk/Drawable.custom +++ b/gdk/Drawable.custom @@ -17,7 +17,7 @@ public System.Drawing.Size Size { public void DrawRectangle(Gdk.GC gc, bool filled, Gdk.Rectangle area) { - gdk_draw_rectangle(Handle, gc.Handle, filled, area.x, area.y, area.width, area.height); + gdk_draw_rectangle(Handle, gc.Handle, filled, area.X, area.Y, area.Width, area.Height); } public void DrawRectangle(Gdk.GC gc, bool filled, System.Drawing.Rectangle area) diff --git a/gdk/EventKey.custom b/gdk/EventKey.custom index 99aabe385..d959af453 100644 --- a/gdk/EventKey.custom +++ b/gdk/EventKey.custom @@ -22,6 +22,6 @@ public static GLib.GType GType { public Gdk.Key Key { get { - return (Gdk.Key) this.keyval; + return (Gdk.Key) this.Keyval; } } diff --git a/gdk/Point.custom b/gdk/Point.custom index 0914dea2a..19fe77cdf 100644 --- a/gdk/Point.custom +++ b/gdk/Point.custom @@ -18,7 +18,7 @@ public override string ToString () { - return String.Format ("({0},{1})", x, y); + return String.Format ("({0},{1})", X, Y); } /// @@ -32,6 +32,6 @@ public override string ToString () public Point (int x, int y) { - this.x = x; - this.y = y; + this.X = x; + this.Y = y; } diff --git a/gdk/Rectangle.custom b/gdk/Rectangle.custom index 7d2f322ea..b3484f637 100644 --- a/gdk/Rectangle.custom +++ b/gdk/Rectangle.custom @@ -18,19 +18,19 @@ public override string ToString () { - return String.Format ("{0}x{1}+{2}+{3}", width, height, x, y); + return String.Format ("{0}x{1}+{2}+{3}", Width, Height, X, Y); } public Rectangle (int x, int y, int width, int height) { - this.x = x; - this.y = y; - this.width = width; - this.height = height; + this.X = x; + this.Y = y; + this.Width = width; + this.Height = height; } public static implicit operator System.Drawing.Rectangle (Gdk.Rectangle rect) { - return new System.Drawing.Rectangle (rect.x, rect.y, rect.width, rect.height); + return new System.Drawing.Rectangle (rect.X, rect.Y, rect.Width, rect.Height); } diff --git a/gdk/Window.custom b/gdk/Window.custom index f39eb3dea..07d6bd3be 100644 --- a/gdk/Window.custom +++ b/gdk/Window.custom @@ -10,7 +10,7 @@ get { Gdk.Rectangle rect = Gdk.Rectangle.Zero; gdk_window_get_frame_extents (Handle, ref rect); - return new System.Drawing.Rectangle (rect.x, rect.y, rect.width, rect.height); + return new System.Drawing.Rectangle (rect.X, rect.Y, rect.Width, rect.Height); } } diff --git a/gdk/gdk-api.xml b/gdk/gdk-api.xml index 0fdc9aa28..c2e68a1f4 100644 --- a/gdk/gdk-api.xml +++ b/gdk/gdk-api.xml @@ -3585,9 +3585,6 @@ - - - @@ -3620,45 +3617,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -4164,14 +4112,7 @@ - - - - - - - - + @@ -4200,95 +4141,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/generator/Field.cs b/generator/Field.cs index dcf01511c..246032024 100644 --- a/generator/Field.cs +++ b/generator/Field.cs @@ -21,6 +21,12 @@ namespace GtkSharp.Generation { this.elem = elem; } + public string Access { + get { + return elem.HasAttribute ("access") ? elem.GetAttribute ("access") : "public"; + } + } + public int ArrayLength { get { if (!IsArray) @@ -170,8 +176,10 @@ namespace GtkSharp.Generation { } else if (IsPointer && CSType != "string") { // FIXME: probably some fields here which should be visible. sw.WriteLine ("\t\tprivate {0} {1};", CSType, Name); + } else if (Access != "public") { + sw.WriteLine ("\t\t{0} {1} {2};", Access, CSType, Name); } else { - sw.WriteLine ("\t\tpublic {0} {1};", CSType, Name); + sw.WriteLine ("\t\tpublic {0} {1};", CSType, StudlyName); } return true; diff --git a/gnome/Gnome.metadata b/gnome/Gnome.metadata index 056fae705..a03c4642a 100644 --- a/gnome/Gnome.metadata +++ b/gnome/Gnome.metadata @@ -1,89 +1,90 @@ - 1 - const-gchar* - const-gchar* - Base - 1 - 1 - GdkHelper - GtkHelper - const-gchar* - const-gchar* - const-gchar* - 1 - 1 - PromptCleared - out - out - gboolean - out - gboolean - out - out - out - out - out - out - out - 1 - ArtWindRule - 1 - 1 - 1 - 1 - out - 1 - ref - 1 - 1 - ref - CanvasEvent - out - out - ArtVpathDash - Connected - Disconnected - BackClicked - CancelClicked - FinishClicked - NextClicked - Prepared - GetGtkEntry - Activated - 1 - 1 - Activated - const-gchar* - const-gchar* - const-gchar* - const-gchar* - const-gchar* + 1 + const-gchar* + const-gchar* + Base + 1 + 1 + GdkHelper + GtkHelper + const-gchar* + const-gchar* + const-gchar* + 1 + 1 + PromptCleared + out + out + gboolean + out + gboolean + out + out + out + out + out + out + out + 1 + ArtWindRule + 1 + 1 + 1 + 1 + out + 1 + ref + 1 + 1 + ref + CanvasEvent + out + out + ArtVpathDash + Connected + Disconnected + BackClicked + CancelClicked + FinishClicked + NextClicked + Prepared + GetGtkEntry + Activated + 1 + 1 + Activated + const-gchar* + const-gchar* + const-gchar* + const-gchar* + const-gchar* 1 - 1 - 1 - int - 1 - 1 - IconFocused - IconSelected - IconUnselected - 1 - const-gchar* - gchar* - const-gchar* - const-gchar* - GnomePrintDialogFlags - 1 - const-gchar* - const-gchar* - GObject - GObject - const-gchar* - CurveTo - LineTo - LineToMoving - MoveTo - Gnome.CanvasPathDef - const-gchar* + 1 + 1 + int + 1 + 1 + IconFocused + IconSelected + IconUnselected + 1 + const-gchar* + gchar* + const-gchar* + const-gchar* + GnomePrintDialogFlags + 1 + const-gchar* + const-gchar* + GObject + GObject + const-gchar* + CurveTo + LineTo + LineToMoving + MoveTo + Gnome.CanvasPathDef + private + const-gchar* diff --git a/gnome/gnome-api.xml b/gnome/gnome-api.xml index e107ecac2..d48457be5 100644 --- a/gnome/gnome-api.xml +++ b/gnome/gnome-api.xml @@ -5365,7 +5365,7 @@ - + diff --git a/gtk/AccelKey.custom b/gtk/AccelKey.custom index 49cc2a44a..e50fe0a59 100644 --- a/gtk/AccelKey.custom +++ b/gtk/AccelKey.custom @@ -3,6 +3,6 @@ public Gdk.Key Key; public AccelKey (Gdk.Key key, Gdk.ModifierType mods, Gtk.AccelFlags flags) { this.Key = key; - this.accel_mods = mods; - this.accel_flags = flags; + this.AccelMods = mods; + this.AccelFlags = flags; } diff --git a/gtk/Gtk.metadata b/gtk/Gtk.metadata index 3bcf1201a..e3563a1c0 100644 --- a/gtk/Gtk.metadata +++ b/gtk/Gtk.metadata @@ -1,6 +1,7 @@ GdkKey + key GdkModifierType GtkAccelFlags 1 diff --git a/gtk/TargetEntry.custom b/gtk/TargetEntry.custom index 3f79290b1..8a66e59bc 100644 --- a/gtk/TargetEntry.custom +++ b/gtk/TargetEntry.custom @@ -9,7 +9,7 @@ public TargetEntry (string target, Gtk.TargetFlags flags, uint info) { - this.target = target; - this.flags = flags; - this.info = info; + this.Target = target; + this.Flags = flags; + this.Info = info; } diff --git a/gtk/TreeIter.custom b/gtk/TreeIter.custom index 16feece94..72d2a45c6 100644 --- a/gtk/TreeIter.custom +++ b/gtk/TreeIter.custom @@ -3,7 +3,7 @@ // public override int GetHashCode () { - return stamp; + return Stamp; } public override bool Equals (object o) @@ -14,7 +14,7 @@ if (!(o is TreeIter)) return false; TreeIter ti = (TreeIter) o; - return ti.stamp == stamp && + return ti.Stamp == Stamp && ti._user_data == _user_data && ti._user_data2 == _user_data2 && ti._user_data3 == _user_data3; diff --git a/gtk/Widget.custom b/gtk/Widget.custom index ac2ea79d5..fbbb8d5ba 100644 --- a/gtk/Widget.custom +++ b/gtk/Widget.custom @@ -46,6 +46,6 @@ public System.Drawing.Size RequestSize { public void AddAccelerator (string accel_signal, AccelGroup accel_group, AccelKey accel_key) { - this.AddAccelerator (accel_signal, accel_group, (uint) accel_key.Key, accel_key.accel_mods, accel_key.accel_flags); + this.AddAccelerator (accel_signal, accel_group, (uint) accel_key.Key, accel_key.AccelMods, accel_key.AccelFlags); } diff --git a/pango/pango-api.xml b/pango/pango-api.xml index c6b4b891f..3b44638f7 100644 --- a/pango/pango-api.xml +++ b/pango/pango-api.xml @@ -49,10 +49,6 @@ - - - - @@ -109,28 +105,6 @@ - - - - - - - - - - - - - - - - - - - - - - @@ -171,7 +145,6 @@ - @@ -184,12 +157,6 @@ - - - - - - @@ -253,25 +220,6 @@ - - - - - - - - - - - - - - - - - - - @@ -814,47 +762,8 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + @@ -981,12 +890,7 @@ - - - - - - + @@ -1002,7 +906,6 @@ - @@ -1114,59 +1017,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1375,106 +1225,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1560,29 +1310,6 @@ - - - - - - - - - - - - - - - - - - - - - - - @@ -1668,30 +1395,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - @@ -1701,9 +1404,6 @@ - - - @@ -1722,23 +1422,6 @@ - - - - - - - - - - - - - - - - - @@ -1836,296 +1519,5 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/parser/gapi_pp.pl b/parser/gapi_pp.pl index 74939a7d2..56bc8ca28 100755 --- a/parser/gapi_pp.pl +++ b/parser/gapi_pp.pl @@ -10,6 +10,7 @@ # 2003 Martin Willemoes Hansen # 2003 Novell, Inc. +$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'; @@ -64,6 +65,23 @@ foreach $fname (@hdrs) { while ($line !~ /\*\//) {$line = ;} } elsif ($line =~ /^#ifndef\s+\w+_H_*\b/) { while ($line !~ /#define/) {$line = ;} + } elsif ($line =~ /$private_regex/) { + $nested = 0; + while ($line = ) { + last if (!$nested && ($line =~ /#else|#endif/)); + if ($line =~ /#if/) { + $nested++; + } elsif ($line =~ /#endif/) { + $nested-- + } + next if ($line !~ /^struct/); + + print "private$line"; + do { + $line = ; + print $line; + } until ($line =~ /^\}/); + } } elsif ($line =~ /$eatit_regex/) { $nested = 0; while ($line = ) { diff --git a/sample/CanvasExample.cs b/sample/CanvasExample.cs index 4aaf8294f..fd21ef43e 100644 --- a/sample/CanvasExample.cs +++ b/sample/CanvasExample.cs @@ -102,14 +102,14 @@ namespace GtkSamples { EventButton ev = EventButton.New (args.Event.Handle); CanvasRE item = (CanvasRE) obj; - switch (ev.type) { + switch (ev.Type) { case EventType.ButtonPress: - if (ev.button == 1) { - remember_x = ev.x; - remember_y = ev.y; + if (ev.Button == 1) { + remember_x = ev.X; + remember_y = ev.Y; args.RetVal = true; return; - } else if (ev.button == 3) { + } else if (ev.Button == 3) { item.Destroy (); args.RetVal = true; return; @@ -120,9 +120,9 @@ namespace GtkSamples { args.RetVal = true; return; case EventType.MotionNotify: - Gdk.ModifierType state = (Gdk.ModifierType) ev.state; + Gdk.ModifierType state = (Gdk.ModifierType) ev.State; if ((state & Gdk.ModifierType.Button1Mask) != 0) { - double new_x = ev.x, new_y = ev.y; + double new_x = ev.X, new_y = ev.Y; item.Move (new_x - remember_x, new_y - remember_y); remember_x = new_x; remember_y = new_y; diff --git a/sample/GnomeHelloWorld.cs b/sample/GnomeHelloWorld.cs index 1798a53e9..38c0538f4 100644 --- a/sample/GnomeHelloWorld.cs +++ b/sample/GnomeHelloWorld.cs @@ -160,7 +160,7 @@ namespace GtkSamples { if (type != Gdk.WindowType.Child) Console.WriteLine ("Struct field accessors appear to be broken."); - if (ev.type == EventType.TwoButtonPress && ev.button == 1) { + if (ev.Type == EventType.TwoButtonPress && ev.Button == 1) { g_spawn_command_line_async ("mono " + entries[idx].program, IntPtr.Zero); } } diff --git a/sample/GtkDemo/DemoColorSelection.cs b/sample/GtkDemo/DemoColorSelection.cs index 4c8a9aab2..e4dac4968 100644 --- a/sample/GtkDemo/DemoColorSelection.cs +++ b/sample/GtkDemo/DemoColorSelection.cs @@ -71,12 +71,12 @@ namespace GtkDemo { EventExpose eventExpose = args.Event; Gdk.Window window = eventExpose.window; - Rectangle area = eventExpose.area; + Rectangle area = eventExpose.Area; window.DrawRectangle (drawingArea.Style.BackgroundGC(StateType.Normal), true, - area.x, area.y, - area.width, area.height); + area.X, area.Y, + area.Width, area.Height); SignalArgs sa = (SignalArgs) args; sa.RetVal = true; } diff --git a/sample/GtkDemo/DemoDrawingArea.cs b/sample/GtkDemo/DemoDrawingArea.cs index 7f81f836e..5e5eba020 100644 --- a/sample/GtkDemo/DemoDrawingArea.cs +++ b/sample/GtkDemo/DemoDrawingArea.cs @@ -114,25 +114,25 @@ namespace GtkDemo { Gdk.Window window = eventExpose.window; gc1 = new Gdk.GC (window); - color.red = 30000; - color.green = 0; - color.blue = 30000; + color.Red = 30000; + color.Green = 0; + color.Blue = 30000; gc1.RgbFgColor = color; gc2 = new Gdk.GC (window); - color.red = 65535; - color.green = 65535; - color.blue = 65535; + color.Red = 65535; + color.Green = 65535; + color.Blue = 65535; gc2.RgbFgColor = color; // Start redrawing the Checkerboard xcount = 0; i = Spacing; - while (i < drawingArea.Allocation.width){ + while (i < drawingArea.Allocation.Width){ j = Spacing; ycount = xcount % 2; //start with even/odd depending on row - while (j < drawingArea.Allocation.height){ + while (j < drawingArea.Allocation.Height){ gc = new Gdk.GC (window); if (ycount % 2 != 0){ gc = gc1;} @@ -161,13 +161,13 @@ namespace GtkDemo { EventExpose eventExpose = args.Event; Gdk.Window window = eventExpose.window; - Rectangle area = eventExpose.area; + Rectangle area = eventExpose.Area; window.DrawDrawable (drawingArea1.Style.ForegroundGC(StateType.Normal), pixmap, - area.x, area.y, - area.x, area.y, - area.width, area.height); + area.X, area.Y, + area.X, area.Y, + area.Width, area.Height); SignalArgs sa = (SignalArgs) args; sa.RetVal = false; } @@ -179,12 +179,12 @@ namespace GtkDemo { Gdk.Window window = eventConfigure.window; Rectangle allocation = drawingArea1.Allocation; pixmap = new Pixmap (window, - allocation.width, - allocation.height, + allocation.Width, + allocation.Height, -1); // Initialize the pixmap to white pixmap.DrawRectangle (drawingArea1.Style.WhiteGC, true, 0, 0, - allocation.width, allocation.height); + allocation.Width, allocation.Height); SignalArgs sa = (SignalArgs) args; // We've handled the configure event, no need for further processing. sa.RetVal = true; @@ -208,14 +208,14 @@ namespace GtkDemo { EventMotion ev = args.Event; Gdk.Window window = ev.window; - if (ev.is_hint != 0) { + if (ev.IsHint != 0) { ModifierType s; window.GetPointer (out x, out y, out s); state = s; } else { - x = (int) ev.x; - y = (int) ev.y; - state = (ModifierType) ev.state; + x = (int) ev.X; + y = (int) ev.Y; + state = (ModifierType) ev.State; } if ((state & ModifierType.Button1Mask) != 0 && pixmap != null) @@ -230,24 +230,24 @@ namespace GtkDemo { static void DrawBrush (double x, double y) { Rectangle update_rect = new Rectangle (); - update_rect.x = (int) x - 3; - update_rect.y = (int) y - 3; - update_rect.width = 6; - update_rect.height = 6; + update_rect.X = (int) x - 3; + update_rect.Y = (int) y - 3; + update_rect.Width = 6; + update_rect.Height = 6; //Paint to the pixmap, where we store our state pixmap.DrawRectangle (drawingArea1.Style.BlackGC, true, - update_rect.x, update_rect.y, - update_rect.width, update_rect.height); - drawingArea1.QueueDrawArea (update_rect.x, update_rect.y, - update_rect.width, update_rect.height); + update_rect.X, update_rect.Y, + update_rect.Width, update_rect.Height); + drawingArea1.QueueDrawArea (update_rect.X, update_rect.Y, + update_rect.Width, update_rect.Height); } private void ScribbleButtonPress (object o, ButtonPressEventArgs args) { EventButton ev = args.Event; - if (ev.button == 1 && pixmap != null) - DrawBrush (ev.x, ev.y); + if (ev.Button == 1 && pixmap != null) + DrawBrush (ev.X, ev.Y); //We've handled the event, stop processing SignalArgs sa = (SignalArgs) args; sa.RetVal = true; diff --git a/sample/GtkDemo/DemoMenus.cs b/sample/GtkDemo/DemoMenus.cs index 3a1f0ea09..7636efbe2 100644 --- a/sample/GtkDemo/DemoMenus.cs +++ b/sample/GtkDemo/DemoMenus.cs @@ -95,21 +95,21 @@ namespace GtkDemo menuitem = new CheckMenuItem ("Accelerate Me"); menu.Append (menuitem); AccelKey ak = new AccelKey (); - ak.accel_key = 0xFFBE; - menuitem.AddAccelerator ("activate", accel_group, ak, 0, AccelFlags.Visible); + ak.Key = (Gdk.Key) 0xFFBE; + menuitem.AddAccelerator ("activate", accel_group, ak); menuitem = new CheckMenuItem ("Accelerator locked"); menu.Append (menuitem); AccelKey ak2 = new AccelKey (); - ak2.accel_key = 0xFFBF; - menuitem.AddAccelerator ("activate", accel_group, ak2, 0, AccelFlags.Visible | AccelFlags.Locked); + ak2.Key = (Gdk.Key) 0xFFBF; + menuitem.AddAccelerator ("activate", accel_group, ak2); menuitem = new CheckMenuItem ("Accelerator Frozen"); menu.Append (menuitem); AccelKey ak3 = new AccelKey (); - ak3.accel_key = 0xFFC0; - menuitem.AddAccelerator ("activate", accel_group, ak2, 0, AccelFlags.Visible); - menuitem.AddAccelerator ("activate", accel_group, ak3, 0, AccelFlags.Visible); + ak3.Key = (Gdk.Key) 0xFFC0; + menuitem.AddAccelerator ("activate", accel_group, ak2); + menuitem.AddAccelerator ("activate", accel_group, ak3); OptionMenu option_menu = new OptionMenu (); option_menu.Menu = menu; @@ -152,7 +152,7 @@ namespace GtkDemo for (int i = 0, j = 1; i < 5; i++, j++) { label = String.Format ("item {0} - {1}", depth, j); - menuitem = RadioMenuItem.NewWithLabel (group, label); + menuitem = new RadioMenuItem (group, label); group = ((RadioMenuItem) menuitem).Group; menuitem = new MenuItem (label); menu.Append (menuitem); diff --git a/sample/GtkDemo/DemoPixbuf.cs b/sample/GtkDemo/DemoPixbuf.cs index 9c9cc7767..c50aadc24 100644 --- a/sample/GtkDemo/DemoPixbuf.cs +++ b/sample/GtkDemo/DemoPixbuf.cs @@ -89,7 +89,7 @@ namespace GtkDemo EventExpose ev = args.Event; Widget widget = (Widget) o; - Gdk.Rectangle area = ev.area; + Gdk.Rectangle area = ev.Area; frame.RenderToDrawableAlpha( widget.GdkWindow, @@ -156,8 +156,8 @@ namespace GtkDemo : Math.Max (127, Math.Abs (255 * Math.Cos (f * 2 * Math.PI))))); */ - images[i].Composite (frame, r1.x, r1.y, r1.width, - r1.height, xpos, ypos, k, k, + images[i].Composite (frame, r1.X, r1.Y, r1.Width, + r1.Height, xpos, ypos, k, k, InterpType.Nearest, (int) ((i % 2 == 1) ? Math.Max (127, Math.Abs (255 * Math.Sin (f * 2 * Math.PI))) diff --git a/sample/GtkDemo/Makefile b/sample/GtkDemo/Makefile index b919958d9..1b60cd022 100644 --- a/sample/GtkDemo/Makefile +++ b/sample/GtkDemo/Makefile @@ -1,7 +1,7 @@ CSC = mcs -DLLS = /r:gtk-sharp.dll /r:glib-sharp.dll /r:pango-sharp.dll /r:gdk-sharp.dll /r:System.Drawing.dll +DLLS = /r:gtk-sharp /r:glib-sharp /r:pango-sharp /r:gdk-sharp /r:System.Drawing all: *.cs $(CSC) -g /out:GtkDemo.exe *.cs $(DLLS) diff --git a/sample/Scribble.cs b/sample/Scribble.cs index 28909ce97..8c3f899d3 100644 --- a/sample/Scribble.cs +++ b/sample/Scribble.cs @@ -51,13 +51,13 @@ namespace GtkSamples { Gdk.EventExpose ev = args.Event; Gdk.Window window = ev.window; // FIXME: mcs bug - Gdk.Rectangle area = ev.area; + Gdk.Rectangle area = ev.Area; // FIXME: array marshalling not done yet so no FG */ window.DrawDrawable (darea.Style.BlackGC, pixmap, - area.x, area.y, - area.x, area.y, - area.width, area.height); + area.X, area.Y, + area.X, area.Y, + area.Width, area.Height); args.RetVal = false; } @@ -70,12 +70,12 @@ namespace GtkSamples { Console.WriteLine ("Darea=[{0}]" , darea); pixmap = new Gdk.Pixmap (window, - allocation.width, - allocation.height, + allocation.Width, + allocation.Height, -1); Console.WriteLine ("Darea.Style={0}", darea.Style); pixmap.DrawRectangle (darea.Style.WhiteGC, true, 0, 0, - allocation.width, allocation.height); + allocation.Width, allocation.Height); args.RetVal = true; } @@ -83,23 +83,23 @@ namespace GtkSamples { static void DrawBrush (double x, double y) { Gdk.Rectangle update_rect = new Gdk.Rectangle (); - update_rect.x = (int) x - 5; - update_rect.y = (int) y - 5; - update_rect.width = 10; - update_rect.height = 10; + update_rect.X = (int) x - 5; + update_rect.Y = (int) y - 5; + update_rect.Width = 10; + update_rect.Height = 10; pixmap.DrawRectangle (darea.Style.BlackGC, true, - update_rect.x, update_rect.y, - update_rect.width, update_rect.height); - darea.QueueDrawArea (update_rect.x, update_rect.y, - update_rect.width, update_rect.height); + update_rect.X, update_rect.Y, + update_rect.Width, update_rect.Height); + darea.QueueDrawArea (update_rect.X, update_rect.Y, + update_rect.Width, update_rect.Height); } static void ButtonPressEvent (object obj, ButtonPressEventArgs args) { Gdk.EventButton ev = args.Event; - if (ev.button == 1 && pixmap != null) - DrawBrush (ev.x, ev.y); + if (ev.Button == 1 && pixmap != null) + DrawBrush (ev.X, ev.Y); args.RetVal = true; } @@ -111,14 +111,14 @@ namespace GtkSamples { Gdk.EventMotion ev = args.Event; Gdk.Window window = ev.window; - if (ev.is_hint != 0) { + if (ev.IsHint != 0) { Gdk.ModifierType s; window.GetPointer (out x, out y, out s); state = s; } else { - x = (int) ev.x; - y = (int) ev.y; - state = (Gdk.ModifierType) ev.state; + x = (int) ev.X; + y = (int) ev.Y; + state = (Gdk.ModifierType) ev.State; } if ((state & Gdk.ModifierType.Button1Mask) != 0 && pixmap != null) diff --git a/sample/test/TestCheckButton.cs b/sample/test/TestCheckButton.cs index c317e525f..3c90e4ce6 100644 --- a/sample/test/TestCheckButton.cs +++ b/sample/test/TestCheckButton.cs @@ -50,7 +50,7 @@ namespace WidgetViewer { box2.BorderWidth = 10; box1.PackStart (box2, false, false, 0); - Button button = Button.NewFromStock (Stock.Close); + Button button = new Button (Stock.Close); button.Clicked += new EventHandler (OnCloseClicked); button.CanDefault = true; diff --git a/sample/test/TestColorSelection.cs b/sample/test/TestColorSelection.cs index 4eb861fe9..b16e3c3fc 100644 --- a/sample/test/TestColorSelection.cs +++ b/sample/test/TestColorSelection.cs @@ -63,7 +63,7 @@ namespace WidgetViewer { static string HexFormat (Gdk.Color color) { StringBuilder s = new StringBuilder (); - ushort[] vals = { color.red, color.green, color.blue }; + ushort[] vals = { color.Red, color.Green, color.Blue }; char[] hexchars = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F'}; @@ -88,12 +88,8 @@ namespace WidgetViewer { static void Color_Selection_OK (object o, EventArgs args) { Gdk.Color selected = window.ColorSelection.CurrentColor; - if (selected == Gdk.Color.Zero) - Console.WriteLine ("Color selection failed."); - else { - window.Hide (); - Display_Result (selected); - } + window.Hide (); + Display_Result (selected); } static void Color_Selection_Cancel (object o, EventArgs args) @@ -109,9 +105,6 @@ namespace WidgetViewer { static void Display_Result (Gdk.Color color) { - if (color == Gdk.Color.Zero) - Console.WriteLine ("Null color"); - dialog = new Dialog (); dialog.Title = "Selected Color: " + HexFormat (color); dialog.HasSeparator = true; @@ -124,7 +117,7 @@ namespace WidgetViewer { dialog.VBox.PackStart (da, true, true, 10); dialog.SetDefaultSize (200, 200); - Button button = Button.NewFromStock (Stock.Ok); + Button button = new Button (Stock.Ok); button.Clicked += new EventHandler (Dialog_Ok); button.CanDefault = true; dialog.ActionArea.PackStart (button, true, true, 0); diff --git a/sample/test/TestCombo.cs b/sample/test/TestCombo.cs index 1a89bda6c..fe0cc1b69 100644 --- a/sample/test/TestCombo.cs +++ b/sample/test/TestCombo.cs @@ -42,7 +42,7 @@ namespace WidgetViewer { box2.BorderWidth = 10; box1.PackStart (box2, false, false, 0); - Button button = Button.NewFromStock (Stock.Close); + Button button = new Button (Stock.Close); button.Clicked += new EventHandler (OnCloseClicked); button.CanDefault = true; diff --git a/sample/test/TestDialog.cs b/sample/test/TestDialog.cs index faf6faa01..84e21f3e2 100644 --- a/sample/test/TestDialog.cs +++ b/sample/test/TestDialog.cs @@ -25,7 +25,7 @@ namespace WidgetViewer { window.SetDefaultSize (200, 100); window.Title = "GtkDialog"; - Button button = Button.NewFromStock (Stock.Ok); + Button button = new Button (Stock.Ok); button.Clicked += new EventHandler (Close_Button); button.CanDefault = true; window.ActionArea.PackStart (button, true, true, 0); diff --git a/sample/test/TestFlipping.cs b/sample/test/TestFlipping.cs index 3571d3309..8067a52d4 100644 --- a/sample/test/TestFlipping.cs +++ b/sample/test/TestFlipping.cs @@ -39,7 +39,7 @@ namespace WidgetViewer { check_button.Toggled += new EventHandler (Toggle_Flip); check_button.BorderWidth = 10; - button = Button.NewFromStock (Stock.Close); + button = new Button (Stock.Close); button.Clicked += new EventHandler (Close_Button); button.CanDefault = true; diff --git a/sample/test/TestMenus.cs b/sample/test/TestMenus.cs index e56f59a27..9a9f8b4a1 100644 --- a/sample/test/TestMenus.cs +++ b/sample/test/TestMenus.cs @@ -88,7 +88,7 @@ namespace WidgetViewer { box2.BorderWidth = 10; box1.PackStart (box2, false, true, 0); - Button close_button = Button.NewFromStock (Stock.Close); + Button close_button = new Button (Stock.Close); close_button.Clicked += new EventHandler (Close_Button); box2.PackStart (close_button, true, true, 0); @@ -118,7 +118,7 @@ namespace WidgetViewer { for (int i = 0, j = 1; i < 5; i++, j++) { label = String.Format ("item {0} - {1}", depth, j); - menuitem = RadioMenuItem.NewWithLabel (group, label); + menuitem = new RadioMenuItem (group, label); group = ((RadioMenuItem) menuitem).Group; menuitem = new MenuItem (label); menu.Append (menuitem); diff --git a/sample/test/TestRadioButton.cs b/sample/test/TestRadioButton.cs index 408f4cfd3..da14d7807 100644 --- a/sample/test/TestRadioButton.cs +++ b/sample/test/TestRadioButton.cs @@ -29,17 +29,17 @@ namespace WidgetViewer { box2.BorderWidth = 10; box1.PackStart (box2, true, true, 0); - radio_button = RadioButton.NewWithLabel (new GLib.SList (IntPtr.Zero), "Button 1"); + radio_button = new RadioButton ("Button 1"); box2.PackStart (radio_button, true, true, 0); - radio_button = RadioButton.NewWithLabelFromWidget (radio_button, "Button 2"); + radio_button = new RadioButton (radio_button, "Button 2"); radio_button.Active = true; box2.PackStart (radio_button, true, true, 0); - radio_button = RadioButton.NewWithLabelFromWidget (radio_button, "Button 3"); + radio_button = new RadioButton (radio_button, "Button 3"); box2.PackStart (radio_button, true, true, 0); - radio_button = RadioButton.NewWithLabelFromWidget (radio_button, "Inconsistent"); + radio_button = new RadioButton (radio_button, "Inconsistent"); radio_button.Inconsistent = true; box2.PackStart (radio_button, true, true, 0); @@ -49,16 +49,16 @@ namespace WidgetViewer { box2.BorderWidth = 10; box1.PackStart (box2, true, true, 0); - radio_button = RadioButton.NewWithLabel (new GLib.SList (IntPtr.Zero), "Button 4"); + radio_button = new RadioButton ("Button 4"); radio_button.Mode = false; box2.PackStart (radio_button, true, true, 0); - radio_button = RadioButton.NewWithLabelFromWidget (radio_button, "Button 5"); + radio_button = new RadioButton (radio_button, "Button 5"); radio_button.Active = true; radio_button.Mode = false; box2.PackStart (radio_button, true, true, 0); - radio_button = RadioButton.NewWithLabelFromWidget (radio_button, "Button 6"); + radio_button = new RadioButton (radio_button, "Button 6"); radio_button.Mode = false; box2.PackStart (radio_button, true, true, 0); @@ -68,7 +68,7 @@ namespace WidgetViewer { box2.BorderWidth = 10; box1.PackStart (box2, false, true, 0); - Button button = Button.NewFromStock (Stock.Close); + Button button = new Button (Stock.Close); button.Clicked += new EventHandler (Close_Button); box2.PackStart (button, true, true, 0); button.CanDefault = true; diff --git a/sample/test/TestRange.cs b/sample/test/TestRange.cs index 3f8ed67d8..82fdf908a 100644 --- a/sample/test/TestRange.cs +++ b/sample/test/TestRange.cs @@ -76,7 +76,7 @@ namespace WidgetViewer { box2.BorderWidth = 10; box1.PackStart (box2, false, true, 0); - Button button = Button.NewFromStock (Stock.Close); + Button button = new Button (Stock.Close); button.Clicked += new EventHandler (Close_Button); box2.PackStart (button, true, true, 0); button.CanDefault = true; diff --git a/sample/test/TestSizeGroup.cs b/sample/test/TestSizeGroup.cs index 31d6d9de7..dc24a3f62 100644 --- a/sample/test/TestSizeGroup.cs +++ b/sample/test/TestSizeGroup.cs @@ -51,7 +51,7 @@ namespace WidgetViewer { table = new Table (2, 2, false); table.BorderWidth = 5; table.RowSpacing = 5; - table.ColSpacings = 10; + table.ColumnSpacing = 10; frame.Add (table); Add_Row (table, 0, size_group, "_Dashing", dashes); @@ -62,7 +62,7 @@ namespace WidgetViewer { check_button.Active = true; check_button.Toggled += new EventHandler (Button_Toggle_Cb); - Button close_button = Button.NewFromStock (Stock.Close); + Button close_button = new Button (Stock.Close); close_button.Clicked += new EventHandler (Close_Button); window.ActionArea.PackStart (close_button, false, false, 0); @@ -91,7 +91,7 @@ namespace WidgetViewer { static void Add_Row (Table table, uint row, SizeGroup size_group, string label_text, string [] options) { - Label label = Label.NewWithMnemonic (label_text); + Label label = new Label (label_text); label.SetAlignment (0, 1); table.Attach (label, diff --git a/sample/test/TestStatusbar.cs b/sample/test/TestStatusbar.cs index a45eb43e7..4631ed6e6 100644 --- a/sample/test/TestStatusbar.cs +++ b/sample/test/TestStatusbar.cs @@ -50,7 +50,7 @@ namespace WidgetViewer { box2.BorderWidth = 10; box1.PackStart (box2, false, true, 0); - Button close_button = Button.NewFromStock (Stock.Close); + Button close_button = new Button (Stock.Close); close_button.Clicked += new EventHandler (Close_Button); box2.PackStart (close_button, true, true, 0); button.CanDefault = true; diff --git a/sample/test/WidgetViewer.cs b/sample/test/WidgetViewer.cs index 7d7893aed..ccab95f35 100644 --- a/sample/test/WidgetViewer.cs +++ b/sample/test/WidgetViewer.cs @@ -57,7 +57,7 @@ namespace WidgetViewer { box2.BorderWidth = 10; box1.PackStart (box2, false, false, 0); - Button close_button = Button.NewFromStock (Stock.Close); + Button close_button = new Button (Stock.Close); close_button.Clicked += new EventHandler (Close_Button); box2.PackStart (close_button, true, true, 0); diff --git a/sources/gtk-sharp-sources.xml b/sources/gtk-sharp-sources.xml index e1b82fcd2..de18205e6 100644 --- a/sources/gtk-sharp-sources.xml +++ b/sources/gtk-sharp-sources.xml @@ -10,6 +10,15 @@ pango-1.2.3/pango + pango-1.2.3/pango/pangox-fontcache.c + pango-1.2.3/pango/pangox-fontmap.c + pango-1.2.3/pango/pangox-private.h + pango-1.2.3/pango/pangox.h + pango-1.2.3/pango/pangox.c + pango-1.2.3/pango/pangoxft.h + pango-1.2.3/pango/pangoxft-font.h + pango-1.2.3/pango/pangoxft-fontmap.h + pango-1.2.3/pango/pangoxft-private.h