2004-02-16 Mike Kestner <mkestner@ximian.com>

* gdk/Gdk.metadata : hide EventAny
	* gdk/Event.cs : make this a full EventAny implementation.
	* gdk/gdk-api.xml : regen
	* gdk/gdk-symbols.xml : map EventAny to Gdk.Event.
	* glue/event.cs : expose window and send_event fields.

svn path=/trunk/gtk-sharp/; revision=23134
This commit is contained in:
Mike Kestner 2004-02-16 17:48:14 +00:00
parent b44b408e52
commit ad8ca4e74d
6 changed files with 68 additions and 10 deletions

View file

@ -1,3 +1,11 @@
2004-02-16 Mike Kestner <mkestner@ximian.com>
* gdk/Gdk.metadata : hide EventAny
* gdk/Event.cs : make this a full EventAny implementation.
* gdk/gdk-api.xml : regen
* gdk/gdk-symbols.xml : map EventAny to Gdk.Event.
* glue/event.cs : expose window and send_event fields.
2004-02-14 Todd Berman <tberman@sevenl.net>
* gtk/Gtk.metadata : hide Widget.SetState

View file

@ -1,22 +1,48 @@
// Gdk.Event.cs - Custom event wrapper
//
// Author: Rachel Hestilow <hestilow@ximian.com>
// Authors: Rachel Hestilow <hestilow@ximian.com>
// Mike Kestner <mkestner@ximian.com>
//
// (c) 2002 Rachel Hestilow
// (c) 2004 Novell, Inc.
namespace Gdk {
using System;
using System.Collections;
using System.Runtime.InteropServices;
public class Event : GLib.Boxed {
public class Event : GLib.IWrapper {
[DllImport("gtksharpglue")]
static extern EventType gtksharp_gdk_event_get_event_type (IntPtr evt);
public Event(IntPtr raw) : base(raw) {}
[DllImport("gtksharpglue")]
static extern IntPtr gtksharp_gdk_event_get_window (IntPtr evt);
[DllImport("gtksharpglue")]
static extern sbyte gtksharp_gdk_event_get_send_event (IntPtr evt);
[DllImport("libgdk-win32-2.0-0.dll")]
static extern IntPtr gdk_event_get_type ();
IntPtr raw;
public Event(IntPtr raw)
{
this.raw = raw;
}
public IntPtr Handle {
get {
return raw;
}
}
public static GLib.GType GType {
get {
return new GLib.GType (gdk_event_get_type ());
}
}
public EventType Type {
get {
@ -24,11 +50,17 @@ namespace Gdk {
}
}
public bool IsValid {
public Window Window {
get {
return (Handle != IntPtr.Zero);
return GLib.Object.GetObject (gtksharp_gdk_event_get_window (Handle)) as Window;
}
}
public bool SendEvent {
get {
return gtksharp_gdk_event_get_send_event (Handle) == 0 ? false : true;
}
}
}
}
}

View file

@ -62,6 +62,7 @@
<attr path="//object[@cname='GdkWindow']/method[@name='GetToplevels']" name="hidden">1</attr>
<attr path="//object[@cname='GdkWindow']/method[@name='PeekChildren']" name="hidden">1</attr>
<attr path="//object[@cname='GdkWindow']/method[@name='SetIconList']" name="hidden">1</attr>
<attr path="//struct[@cname='GdkEventAny']" name="hidden">1</attr>
<attr path="//struct[@cname='GdkPixmapObject']" name="hidden">1</attr>
<attr path="//struct[@cname='GdkTimeCoord']/field[@cname='axes']" name="array_len">128</attr>
<attr path="//struct[@cname='GdkWindowObject']" name="hidden">1</attr>

View file

@ -2265,7 +2265,7 @@
</parameters>
</callback>
</struct>
<struct name="EventAny" cname="GdkEventAny">
<struct name="EventAny" cname="GdkEventAny" hidden="1">
<field cname="type" type="GdkEventType" />
<field cname="window" type="GdkWindow*" />
<field cname="send_event" type="gint8" />

View file

@ -1,5 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<api>
<symbol type="manual" cname="GdkEvent" name="Gdk.Event"/>
<symbol type="manual" cname="GdkEventAny" name="Gdk.Event"/>
</api>

View file

@ -1,8 +1,10 @@
/* event.c : Glue to access fields in GdkEvent.
*
* Author: Rachel Hestilow <hestilow@ximian.com>
* Authors: Rachel Hestilow <hestilow@ximian.com>
* Mike Kestner <mkestner@ximian.com>
*
* <c> 2002 Rachel Hestilow, Mike Kestner
* (c) 2004 Novell, Inc.
*/
@ -10,6 +12,8 @@
/* Forward declarations */
GdkEventType gtksharp_gdk_event_get_event_type (GdkEvent *event);
GdkWindow* gtksharp_gdk_event_get_window (GdkEventAny *event);
gint8 gtksharp_gdk_event_get_send_event (GdkEventAny *event);
/* */
GdkEventType
@ -18,3 +22,15 @@ gtksharp_gdk_event_get_event_type (GdkEvent *event)
return event->type;
}
GdkWindow*
gtksharp_gdk_event_get_window (GdkEventAny *event)
{
return event->window;
}
gint8
gtksharp_gdk_event_get_send_event (GdkEventAny *event)
{
return event->send_event;
}