2001-10-30 Mike Kestner <mkestner@speakeasy.net>
* 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. svn path=/trunk/gtk-sharp/; revision=1231
This commit is contained in:
parent
bdec55ab35
commit
c3b0ed58d9
5 changed files with 52 additions and 47 deletions
10
ChangeLog
10
ChangeLog
|
@ -1,3 +1,13 @@
|
||||||
|
2001-10-30 Mike Kestner <mkestner@speakeasy.net>
|
||||||
|
|
||||||
|
* 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 <mkestner@speakeasy.net>
|
2001-10-25 Mike Kestner <mkestner@speakeasy.net>
|
||||||
|
|
||||||
* glib/Object.cs : Added Get|SetProperty methods for Object
|
* glib/Object.cs : Added Get|SetProperty methods for Object
|
||||||
|
|
|
@ -16,6 +16,9 @@
|
||||||
'guint32', "uint", 'const-gchar', "IntPtr", 'GObject', "IntPtr",
|
'guint32', "uint", 'const-gchar', "IntPtr", 'GObject', "IntPtr",
|
||||||
'gchar', "IntPtr");
|
'gchar', "IntPtr");
|
||||||
|
|
||||||
|
`mkdir -p ../gdk/generated`;
|
||||||
|
`mkdir -p ../gtk/generated`;
|
||||||
|
|
||||||
while ($def = get_def()) {
|
while ($def = get_def()) {
|
||||||
|
|
||||||
if ($def =~ /^\(define-(enum|flags)/) {
|
if ($def =~ /^\(define-(enum|flags)/) {
|
||||||
|
@ -44,7 +47,7 @@ while ($def = get_def()) {
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach $key (sort (keys (%objects))) {
|
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}));
|
gen_object (split (/\n/, $objects{$key}));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -106,8 +109,7 @@ sub gen_enum
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$dir = "../generated/" . lc ($namespace);
|
$dir = "../" . lc ($namespace) . "/generated";
|
||||||
`mkdir -p $dir`;
|
|
||||||
|
|
||||||
open (OUTFILE, ">$dir/$typename.cs") || die "can't open file";
|
open (OUTFILE, ">$dir/$typename.cs") || die "can't open file";
|
||||||
|
|
||||||
|
@ -157,8 +159,7 @@ sub gen_object
|
||||||
$parent = $maptypes{$1};
|
$parent = $maptypes{$1};
|
||||||
|
|
||||||
$objdef =~ /in-module "(\w+)"/;
|
$objdef =~ /in-module "(\w+)"/;
|
||||||
$dir = "../generated/" . lc ($namespace = $1);
|
$dir = "../" . lc ($namespace = $1) . "/generated";
|
||||||
`mkdir -p $dir`;
|
|
||||||
|
|
||||||
%props = ();
|
%props = ();
|
||||||
%events = ();
|
%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";
|
open (OUTFILE, ">$dir/$typename.cs") || die "can't open file";
|
||||||
|
|
||||||
print OUTFILE "// Generated file: Do not modify\n\n";
|
print OUTFILE "// Generated file: Do not modify\n\n";
|
||||||
|
@ -192,6 +193,10 @@ sub gen_object
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach $key (sort (keys (%methods))) {
|
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");
|
print OUTFILE gen_method ($key, $methods{$key}, "gtk-1.3.dll");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -247,8 +247,8 @@
|
||||||
'("expose" "GDK_EXPOSE")
|
'("expose" "GDK_EXPOSE")
|
||||||
'("motion-notify" "GDK_MOTION_NOTIFY")
|
'("motion-notify" "GDK_MOTION_NOTIFY")
|
||||||
'("button-press" "GDK_BUTTON_PRESS")
|
'("button-press" "GDK_BUTTON_PRESS")
|
||||||
'("2button-press" "GDK_2BUTTON_PRESS")
|
'("two-button-press" "GDK_2BUTTON_PRESS")
|
||||||
'("3button-press" "GDK_3BUTTON_PRESS")
|
'("three-button-press" "GDK_3BUTTON_PRESS")
|
||||||
'("button-release" "GDK_BUTTON_RELEASE")
|
'("button-release" "GDK_BUTTON_RELEASE")
|
||||||
'("key-press" "GDK_KEY_PRESS")
|
'("key-press" "GDK_KEY_PRESS")
|
||||||
'("key-release" "GDK_KEY_RELEASE")
|
'("key-release" "GDK_KEY_RELEASE")
|
||||||
|
|
39
gdk/Event.cs
39
gdk/Event.cs
|
@ -2,45 +2,6 @@ namespace Gdk {
|
||||||
using System;
|
using System;
|
||||||
using System.Runtime.InteropServices;
|
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 class Event
|
||||||
{
|
{
|
||||||
public Event(IntPtr e)
|
public Event(IntPtr e)
|
||||||
|
|
|
@ -106,6 +106,35 @@ namespace GLib {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Equals Method
|
||||||
|
/// </summary>
|
||||||
|
///
|
||||||
|
/// <remarks>
|
||||||
|
/// Checks equivalence of two Objects.
|
||||||
|
/// </remarks>
|
||||||
|
|
||||||
|
public override bool Equals (object o)
|
||||||
|
{
|
||||||
|
if (!(o is Object))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
return (Handle == ((Object) o).Handle);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// GetHashCode Method
|
||||||
|
/// </summary>
|
||||||
|
///
|
||||||
|
/// <remarks>
|
||||||
|
/// Calculates a hashing value.
|
||||||
|
/// </remarks>
|
||||||
|
|
||||||
|
public override int GetHashCode ()
|
||||||
|
{
|
||||||
|
return Handle.GetHashCode ();
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// GetData Method
|
/// GetData Method
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
Loading…
Reference in a new issue