From 2665037c0ee66b8968ebaf9e13cc2d8a76f63a66 Mon Sep 17 00:00:00 2001 From: Mike Kestner Date: Wed, 18 Feb 2004 16:34:45 +0000 Subject: [PATCH] 2004-02-18 Mike Kestner * gdk/Gdk.metadata : hide EventButton * gdk/EventButton.cs : glue-based manual implementation. * gdk/EventButton.custom : kill * gdk/gdk-api.xml : regen * gdk/gdk-symbols.xml : manual mapping for EventButton. * glue/event.cs : expose Button struct fields. * sample/CanvasExample.cs : fix EventButton ctor * sample/GnomeHelloWorld.cs : fix EventButton ctor svn path=/trunk/gtk-sharp/; revision=23220 --- ChangeLog | 11 +++++ gdk/EventButton.cs | 101 ++++++++++++++++++++++++++++++++++++++ gdk/EventButton.custom | 18 ------- gdk/Gdk.metadata | 1 + gdk/gdk-api.xml | 2 +- gdk/gdk-symbols.xml | 1 + glue/event.c | 65 +++++++++++++++++++++++- sample/CanvasExample.cs | 2 +- sample/GnomeHelloWorld.cs | 8 +-- 9 files changed, 181 insertions(+), 28 deletions(-) create mode 100644 gdk/EventButton.cs delete mode 100644 gdk/EventButton.custom diff --git a/ChangeLog b/ChangeLog index da90ce11d..4bf828bcf 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2004-02-18 Mike Kestner + + * gdk/Gdk.metadata : hide EventButton + * gdk/EventButton.cs : glue-based manual implementation. + * gdk/EventButton.custom : kill + * gdk/gdk-api.xml : regen + * gdk/gdk-symbols.xml : manual mapping for EventButton. + * glue/event.cs : expose Button struct fields. + * sample/CanvasExample.cs : fix EventButton ctor + * sample/GnomeHelloWorld.cs : fix EventButton ctor + 2004-02-17 Radek Doulik * glib/Value.cs: use g_value_set_pointer for diff --git a/gdk/EventButton.cs b/gdk/EventButton.cs new file mode 100644 index 000000000..94df8c954 --- /dev/null +++ b/gdk/EventButton.cs @@ -0,0 +1,101 @@ +// Gdk.EventButton.cs - Custom button event wrapper +// +// Author: Mike Kestner +// +// (c) 2004 Novell, Inc. + +namespace Gdk { + + using System; + using System.Runtime.InteropServices; + + public class EventButton : Event { + + [DllImport("gtksharpglue")] + static extern uint gtksharp_gdk_event_button_get_time (IntPtr evt); + + [DllImport("gtksharpglue")] + static extern double gtksharp_gdk_event_button_get_x (IntPtr evt); + + [DllImport("gtksharpglue")] + static extern double gtksharp_gdk_event_button_get_y (IntPtr evt); + + [DllImport("gtksharpglue")] + static extern double gtksharp_gdk_event_button_get_x_root (IntPtr evt); + + [DllImport("gtksharpglue")] + static extern double gtksharp_gdk_event_button_get_y_root (IntPtr evt); + + [DllImport("gtksharpglue")] + static extern uint gtksharp_gdk_event_button_get_state (IntPtr evt); + + [DllImport("gtksharpglue")] + static extern uint gtksharp_gdk_event_button_get_button (IntPtr evt); + + [DllImport("gtksharpglue")] + static extern IntPtr gtksharp_gdk_event_button_get_device (IntPtr evt); + + [DllImport("gtksharpglue")] + static extern IntPtr gtksharp_gdk_event_button_get_axes (IntPtr evt); + + public EventButton (IntPtr raw) : base (raw) {} + + public uint Time { + get { + return gtksharp_gdk_event_button_get_time (Handle); + } + } + + public ModifierType State { + get { + return (ModifierType) gtksharp_gdk_event_button_get_state (Handle); + } + } + + public double X { + get { + return gtksharp_gdk_event_button_get_x (Handle); + } + } + + public double Y { + get { + return gtksharp_gdk_event_button_get_y (Handle); + } + } + + public double XRoot { + get { + return gtksharp_gdk_event_button_get_x_root (Handle); + } + } + + public double YRoot { + get { + return gtksharp_gdk_event_button_get_y_root (Handle); + } + } + + public uint Button { + get { + return gtksharp_gdk_event_button_get_button (Handle); + } + } + + public Device Device { + get { + return GLib.Object.GetObject (gtksharp_gdk_event_button_get_device (Handle)) as Device; + } + } + + public double[] Axes { + get { + double[] result = new double [2]; + IntPtr axes = gtksharp_gdk_event_button_get_axes (Handle); + Marshal.Copy (result, 0, axes, 2); + return result; + } + } + } +} + diff --git a/gdk/EventButton.custom b/gdk/EventButton.custom deleted file mode 100644 index 395118b06..000000000 --- a/gdk/EventButton.custom +++ /dev/null @@ -1,18 +0,0 @@ -// -// gdk/EventButton.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 6a220b5cb..1b23ec11a 100644 --- a/gdk/Gdk.metadata +++ b/gdk/Gdk.metadata @@ -64,6 +64,7 @@ 1 1 1 + 1 1 1 128 diff --git a/gdk/gdk-api.xml b/gdk/gdk-api.xml index de7c95513..f2ea5d21f 100644 --- a/gdk/gdk-api.xml +++ b/gdk/gdk-api.xml @@ -2270,7 +2270,7 @@ - +