From 1ca02083f6ab5f28eabc3fa7a81584f63d4cf9aa Mon Sep 17 00:00:00 2001 From: Mike Kestner Date: Wed, 18 Feb 2004 16:55:54 +0000 Subject: [PATCH] 2004-02-18 Mike Kestner * gdk/Gdk.metadata : hide EventScroll * gdk/EventScroll.cs : glue-based manual implementation. * gdk/EventScroll.custom : kill * gdk/gdk-api.xml : regen * gdk/gdk-symbols.xml : manual mapping for EventScroll. * glue/event.cs : expose Scroll struct fields. svn path=/trunk/gtk-sharp/; revision=23222 --- ChangeLog | 9 +++++ gdk/EventScroll.cs | 89 ++++++++++++++++++++++++++++++++++++++++++ gdk/EventScroll.custom | 18 --------- gdk/Gdk.metadata | 1 + gdk/gdk-api.xml | 2 +- gdk/gdk-symbols.xml | 1 + glue/event.c | 56 ++++++++++++++++++++++++++ 7 files changed, 157 insertions(+), 19 deletions(-) create mode 100644 gdk/EventScroll.cs delete mode 100644 gdk/EventScroll.custom diff --git a/ChangeLog b/ChangeLog index 4bf828bcf..ce9a58379 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2004-02-18 Mike Kestner + + * gdk/Gdk.metadata : hide EventScroll + * gdk/EventScroll.cs : glue-based manual implementation. + * gdk/EventScroll.custom : kill + * gdk/gdk-api.xml : regen + * gdk/gdk-symbols.xml : manual mapping for EventScroll. + * glue/event.cs : expose Scroll struct fields. + 2004-02-18 Mike Kestner * gdk/Gdk.metadata : hide EventButton diff --git a/gdk/EventScroll.cs b/gdk/EventScroll.cs new file mode 100644 index 000000000..807f20724 --- /dev/null +++ b/gdk/EventScroll.cs @@ -0,0 +1,89 @@ +// Gdk.EventScroll.cs - Custom scroll event wrapper +// +// Author: Mike Kestner +// +// (c) 2004 Novell, Inc. + +namespace Gdk { + + using System; + using System.Runtime.InteropServices; + + public class EventScroll : Event { + + [DllImport("gtksharpglue")] + static extern uint gtksharp_gdk_event_scroll_get_time (IntPtr evt); + + [DllImport("gtksharpglue")] + static extern double gtksharp_gdk_event_scroll_get_x (IntPtr evt); + + [DllImport("gtksharpglue")] + static extern double gtksharp_gdk_event_scroll_get_y (IntPtr evt); + + [DllImport("gtksharpglue")] + static extern double gtksharp_gdk_event_scroll_get_x_root (IntPtr evt); + + [DllImport("gtksharpglue")] + static extern double gtksharp_gdk_event_scroll_get_y_root (IntPtr evt); + + [DllImport("gtksharpglue")] + static extern uint gtksharp_gdk_event_scroll_get_state (IntPtr evt); + + [DllImport("gtksharpglue")] + static extern ScrollDirection gtksharp_gdk_event_scroll_get_direction (IntPtr evt); + + [DllImport("gtksharpglue")] + static extern IntPtr gtksharp_gdk_event_scroll_get_device (IntPtr evt); + + public EventScroll (IntPtr raw) : base (raw) {} + + public uint Time { + get { + return gtksharp_gdk_event_scroll_get_time (Handle); + } + } + + public ModifierType State { + get { + return (ModifierType) gtksharp_gdk_event_scroll_get_state (Handle); + } + } + + public double X { + get { + return gtksharp_gdk_event_scroll_get_x (Handle); + } + } + + public double Y { + get { + return gtksharp_gdk_event_scroll_get_y (Handle); + } + } + + public double XRoot { + get { + return gtksharp_gdk_event_scroll_get_x_root (Handle); + } + } + + public double YRoot { + get { + return gtksharp_gdk_event_scroll_get_y_root (Handle); + } + } + + public ScrollDirection Direction { + get { + return gtksharp_gdk_event_scroll_get_direction (Handle); + } + } + + public Device Device { + get { + return GLib.Object.GetObject (gtksharp_gdk_event_scroll_get_device (Handle)) as Device; + } + } + } +} + diff --git a/gdk/EventScroll.custom b/gdk/EventScroll.custom deleted file mode 100644 index 9ff8282b8..000000000 --- a/gdk/EventScroll.custom +++ /dev/null @@ -1,18 +0,0 @@ -// -// gdk/EventScroll.custom -// -// Author: Gustavo Giraldez -// -// Copyright (C) 2004 Gustavo Giraldez. -// - -[DllImport("libgdk-win32-2.0-0.dll")] -static extern IntPtr gdk_event_get_type(); - -public static GLib.GType GType { - get { - IntPtr raw_ret = gdk_event_get_type(); - GLib.GType ret = new GLib.GType(raw_ret); - return ret; - } -} diff --git a/gdk/Gdk.metadata b/gdk/Gdk.metadata index 1b23ec11a..4f0c4fdc3 100644 --- a/gdk/Gdk.metadata +++ b/gdk/Gdk.metadata @@ -66,6 +66,7 @@ 1 1 1 + 1 1 128 1 diff --git a/gdk/gdk-api.xml b/gdk/gdk-api.xml index f2ea5d21f..adcedee55 100644 --- a/gdk/gdk-api.xml +++ b/gdk/gdk-api.xml @@ -2385,7 +2385,7 @@ - +