diff --git a/ChangeLog b/ChangeLog index 4eb9b8489..ccb14692b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2001-10-30 Mike Kestner + + * codegen/defs-parse.pl : streamline mkdir stuff. Prune the object + list back to just Window for now. Suppress generation of the Prop + get/set accessor methods. + * codegen/gdk-types.defs : Updated the 2button/3button event types + since I don't feel like automangling them now. + * gdk/Event.cs : Killed the now redundant EventType declaration. + * glib/Object.cs : Override the Equals and GetHashCode methods. + 2001-10-25 Mike Kestner * glib/Object.cs : Added Get|SetProperty methods for Object diff --git a/codegen/defs-parse.pl b/codegen/defs-parse.pl index 3ba05efd2..1f8e7d205 100755 --- a/codegen/defs-parse.pl +++ b/codegen/defs-parse.pl @@ -16,6 +16,9 @@ 'guint32', "uint", 'const-gchar', "IntPtr", 'GObject', "IntPtr", 'gchar', "IntPtr"); +`mkdir -p ../gdk/generated`; +`mkdir -p ../gtk/generated`; + while ($def = get_def()) { if ($def =~ /^\(define-(enum|flags)/) { @@ -44,7 +47,7 @@ while ($def = get_def()) { } foreach $key (sort (keys (%objects))) { - next if ($key !~ /(GtkBin|GtkButton|GtkContainer|GtkObject|GtkWidget|GtkWindow)$/); + next if ($key ne "GtkWindow"); gen_object (split (/\n/, $objects{$key})); } @@ -106,8 +109,7 @@ sub gen_enum } } - $dir = "../generated/" . lc ($namespace); - `mkdir -p $dir`; + $dir = "../" . lc ($namespace) . "/generated"; open (OUTFILE, ">$dir/$typename.cs") || die "can't open file"; @@ -157,8 +159,7 @@ sub gen_object $parent = $maptypes{$1}; $objdef =~ /in-module "(\w+)"/; - $dir = "../generated/" . lc ($namespace = $1); - `mkdir -p $dir`; + $dir = "../" . lc ($namespace = $1) . "/generated"; %props = (); %events = (); @@ -173,7 +174,7 @@ sub gen_object } } - print "Generating Class $typename in ../$dir/$typename.cs\n"; + print "Generating Class $typename in $dir/$typename.cs\n"; open (OUTFILE, ">$dir/$typename.cs") || die "can't open file"; print OUTFILE "// Generated file: Do not modify\n\n"; @@ -192,6 +193,10 @@ sub gen_object } foreach $key (sort (keys (%methods))) { + if (($key =~ /^(Get|Set)(\w+)/) && exists($props{$2})) { + print "killed $key\n"; + next; + } print OUTFILE gen_method ($key, $methods{$key}, "gtk-1.3.dll"); } diff --git a/codegen/gdk-types.defs b/codegen/gdk-types.defs index 9a2458ffe..7191e4ff9 100644 --- a/codegen/gdk-types.defs +++ b/codegen/gdk-types.defs @@ -247,8 +247,8 @@ '("expose" "GDK_EXPOSE") '("motion-notify" "GDK_MOTION_NOTIFY") '("button-press" "GDK_BUTTON_PRESS") - '("2button-press" "GDK_2BUTTON_PRESS") - '("3button-press" "GDK_3BUTTON_PRESS") + '("two-button-press" "GDK_2BUTTON_PRESS") + '("three-button-press" "GDK_3BUTTON_PRESS") '("button-release" "GDK_BUTTON_RELEASE") '("key-press" "GDK_KEY_PRESS") '("key-release" "GDK_KEY_RELEASE") diff --git a/gdk/Event.cs b/gdk/Event.cs index 1c8d76f5a..25b18b519 100644 --- a/gdk/Event.cs +++ b/gdk/Event.cs @@ -2,45 +2,6 @@ namespace Gdk { using System; using System.Runtime.InteropServices; - public enum EventType - { - Nothing = -1, - Delete = 0, - Destroy = 1, - Expose = 2, - MotionNotify = 3, - ButtonPress = 4, - TwoButtonPress = 5, - ThreeButtonPress = 6, - ButtonRelease = 7, - KeyPress = 8, - KeyRelease = 9, - EnterNotify = 10, - LeaveNotify = 11, - FocusChange = 12, - Configure = 13, - Map = 14, - Unmap = 15, - PropertyNotify = 16, - SelectionClear = 17, - SelectionRequest = 18, - SelectionNotify = 19, - ProximityIn = 20, - ProximityOut = 21, - DragEnter = 22, - DragLeave = 23, - DragMotion = 24, - DragStatus = 25, - DropStart = 26, - DropFinished = 27, - ClientEvent = 28, - VisibilityNotify = 29, - NoExpose = 30, - Scroll = 31, - WindowState = 32, - Setting = 33 - } - public class Event { public Event(IntPtr e) diff --git a/glib/Object.cs b/glib/Object.cs index 23ce463a2..9786f9a48 100644 --- a/glib/Object.cs +++ b/glib/Object.cs @@ -106,6 +106,35 @@ namespace GLib { } } + /// + /// Equals Method + /// + /// + /// + /// Checks equivalence of two Objects. + /// + + public override bool Equals (object o) + { + if (!(o is Object)) + return false; + + return (Handle == ((Object) o).Handle); + } + + /// + /// GetHashCode Method + /// + /// + /// + /// Calculates a hashing value. + /// + + public override int GetHashCode () + { + return Handle.GetHashCode (); + } + /// /// GetData Method ///