2008-11-15 Mike Kestner <mkestner@novell.com>
* gdk/Event.cs: add EventOwnerChange to GetEvent. * gdk/EventOwnerChange.cs: manual subclass of Gdk.Event. * gdk/Gdk.metadata: hide EventOwnerChange. * gdk/Makefile.am: add EventOwnerChange.cs. * gdk/gdk-symbols.xml: add EventOwnerChange. svn path=/trunk/gtk-sharp/; revision=118953
This commit is contained in:
parent
16a8111ff4
commit
a39a739bca
6 changed files with 110 additions and 0 deletions
|
@ -1,3 +1,11 @@
|
|||
2008-11-15 Mike Kestner <mkestner@novell.com>
|
||||
|
||||
* gdk/Event.cs: add EventOwnerChange to GetEvent.
|
||||
* gdk/EventOwnerChange.cs: manual subclass of Gdk.Event.
|
||||
* gdk/Gdk.metadata: hide EventOwnerChange.
|
||||
* gdk/Makefile.am: add EventOwnerChange.cs.
|
||||
* gdk/gdk-symbols.xml: add EventOwnerChange.
|
||||
|
||||
2008-11-15 Mike Kestner <mkestner@novell.com>
|
||||
|
||||
* gtk/Gtk.metadata: mark the SpinButton::Output signal as manually
|
||||
|
|
|
@ -133,6 +133,10 @@ namespace Gdk {
|
|||
return new EventWindowState (raw);
|
||||
case EventType.Setting:
|
||||
return new EventSetting (raw);
|
||||
#if GTK_SHARP_2_6
|
||||
case EventType.OwnerChange:
|
||||
return new EventOwnerChange (raw);
|
||||
#endif
|
||||
#if GTK_SHARP_2_8
|
||||
case EventType.GrabBroken:
|
||||
return new EventGrabBroken (raw);
|
||||
|
|
95
gdk/EventOwnerChange.cs
Normal file
95
gdk/EventOwnerChange.cs
Normal file
|
@ -0,0 +1,95 @@
|
|||
// Gdk.EventOwnerChange.cs - Custom OwnerChange event wrapper
|
||||
//
|
||||
// Author: Mike Kestner <mkestner@novell.com>
|
||||
//
|
||||
// Copyright (c) 2008 Novell, Inc.
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or
|
||||
// modify it under the terms of version 2 of the Lesser GNU General
|
||||
// Public License as published by the Free Software Foundation.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
// Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public
|
||||
// License along with this program; if not, write to the
|
||||
// Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
// Boston, MA 02111-1307, USA.
|
||||
|
||||
|
||||
namespace Gdk {
|
||||
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
public class EventOwnerChange : Event {
|
||||
|
||||
public EventOwnerChange (IntPtr handle) : base (handle) {}
|
||||
|
||||
struct NativeStruct {
|
||||
public Gdk.EventType type;
|
||||
public IntPtr window;
|
||||
public sbyte send_event;
|
||||
public uint owner;
|
||||
public Gdk.OwnerChange reason;
|
||||
public IntPtr selection;
|
||||
public uint time;
|
||||
public uint selection_time;
|
||||
}
|
||||
|
||||
NativeStruct Native {
|
||||
get { return (NativeStruct) Marshal.PtrToStructure (Handle, typeof (NativeStruct)); }
|
||||
}
|
||||
|
||||
public uint Owner {
|
||||
get { return Native.owner; }
|
||||
set {
|
||||
NativeStruct native = Native;
|
||||
native.owner = value;
|
||||
Marshal.StructureToPtr (native, Handle, false);
|
||||
}
|
||||
}
|
||||
|
||||
public OwnerChange Reason {
|
||||
get { return Native.reason; }
|
||||
set {
|
||||
NativeStruct native = Native;
|
||||
native.reason = value;
|
||||
Marshal.StructureToPtr (native, Handle, false);
|
||||
}
|
||||
}
|
||||
|
||||
public Gdk.Atom Selection {
|
||||
get {
|
||||
IntPtr sel = Native.selection;
|
||||
return sel == IntPtr.Zero ? null : (Gdk.Atom) GLib.Opaque.GetOpaque (sel, typeof (Gdk.Atom), false);
|
||||
}
|
||||
set {
|
||||
NativeStruct native = Native;
|
||||
native.selection = value == null ? IntPtr.Zero : value.Handle;
|
||||
Marshal.StructureToPtr (native, Handle, false);
|
||||
}
|
||||
}
|
||||
|
||||
public uint Time {
|
||||
get { return Native.time; }
|
||||
set {
|
||||
NativeStruct native = Native;
|
||||
native.time = value;
|
||||
Marshal.StructureToPtr (native, Handle, false);
|
||||
}
|
||||
}
|
||||
|
||||
public uint SelectionTime {
|
||||
get { return Native.selection_time; }
|
||||
set {
|
||||
NativeStruct native = Native;
|
||||
native.selection_time = value;
|
||||
Marshal.StructureToPtr (native, Handle, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -177,6 +177,7 @@
|
|||
<attr path="/api/namespace/struct[@cname='GdkEventKey']" name="hidden">1</attr>
|
||||
<attr path="/api/namespace/struct[@cname='GdkEventMotion']" name="hidden">1</attr>
|
||||
<attr path="/api/namespace/struct[@cname='GdkEventNoExpose']" name="hidden">1</attr>
|
||||
<attr path="/api/namespace/struct[@cname='GdkEventOwnerChange']" name="hidden">1</attr>
|
||||
<attr path="/api/namespace/struct[@cname='GdkEventProperty']" name="hidden">1</attr>
|
||||
<attr path="/api/namespace/struct[@cname='GdkEventProximity']" name="hidden">1</attr>
|
||||
<attr path="/api/namespace/struct[@cname='GdkEventScroll']" name="hidden">1</attr>
|
||||
|
|
|
@ -25,6 +25,7 @@ sources = \
|
|||
EventGrabBroken.cs \
|
||||
EventKey.cs \
|
||||
EventMotion.cs \
|
||||
EventOwnerChange.cs \
|
||||
EventProperty.cs \
|
||||
EventProximity.cs \
|
||||
EventScroll.cs \
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
<symbol type="manual" cname="GdkEventScroll" name="Gdk.EventScroll"/>
|
||||
<symbol type="manual" cname="GdkEventSelection" name="Gdk.EventSelection"/>
|
||||
<symbol type="manual" cname="GdkEventSetting" name="Gdk.EventSetting"/>
|
||||
<symbol type="manual" cname="GdkEventOwnerChange" name="Gdk.EventOwnerChange"/>
|
||||
<symbol type="manual" cname="GdkEventVisibility" name="Gdk.EventVisibility"/>
|
||||
<symbol type="manual" cname="GdkEventWindowState" name="Gdk.EventWindowState"/>
|
||||
<symbol type="simple" cname="GdkKey" name="Gdk.Key" default_value="Gdk.Key.VoidSymbol"/>
|
||||
|
|
Loading…
Reference in a new issue