gstreamer/gstreamer-sharp/NavigationEvent.cs

60 lines
2.1 KiB
C#
Raw Normal View History

2009-05-14 14:50:16 +00:00
namespace Gst.Interfaces {
using System;
using System.Runtime.InteropServices;
using System.Reflection;
using GLib;
using Gst;
using Gst.Interfaces;
2009-05-14 14:50:16 +00:00
public static class NavigationEvent {
[DllImport("libgstinterfaces-0.10.dll") ]
static extern int gst_navigation_event_get_type (IntPtr evnt);
2009-05-14 14:50:16 +00:00
public static Gst.Interfaces.NavigationEventType EventGetType (Gst.Event evnt) {
int raw_ret = gst_navigation_event_get_type (evnt == null ? IntPtr.Zero : evnt.Handle);
Gst.Interfaces.NavigationEventType ret = (Gst.Interfaces.NavigationEventType) raw_ret;
return ret;
}
2009-05-14 14:50:16 +00:00
[DllImport("libgstinterfaces-0.10.dll") ]
static extern bool gst_navigation_event_parse_key_event (IntPtr evnt, out IntPtr key);
2009-05-14 14:50:16 +00:00
public static bool ParseKeyEvent (Gst.Event evnt, out string key) {
IntPtr raw_key;
bool ret = gst_navigation_event_parse_key_event (evnt.Handle, out raw_key);
2009-05-14 14:50:16 +00:00
key = GLib.Marshaller.Utf8PtrToString (raw_key);
2009-05-14 14:50:16 +00:00
return ret;
}
2009-05-14 14:50:16 +00:00
[DllImport("libgstinterfaces-0.10.dll") ]
static extern bool gst_navigation_event_parse_mouse_button_event (IntPtr evnt, out int button, out double x, out double y);
2009-05-14 14:50:16 +00:00
public static bool ParseMouseButtonEvent (Gst.Event evnt, out int button, out double x, out double y) {
return gst_navigation_event_parse_mouse_button_event (evnt.Handle, out button, out x, out y);
}
2009-05-14 14:50:16 +00:00
[DllImport("libgstinterfaces-0.10.dll") ]
static extern bool gst_navigation_event_parse_mouse_move_event (IntPtr evnt, out double x, out double y);
2009-05-14 14:50:16 +00:00
public static bool ParseMouseMoveEvent (Gst.Event evnt, out double x, out double y) {
return gst_navigation_event_parse_mouse_move_event (evnt.Handle, out x, out y);
}
2009-05-14 14:50:16 +00:00
[DllImport("libgstinterfaces-0.10.dll") ]
static extern bool gst_navigation_event_parse_command (IntPtr evnt, out int command);
2009-05-14 14:50:16 +00:00
public static bool ParseCommand (Gst.Event evnt, out Gst.Interfaces.NavigationCommand command) {
int raw_command;
bool ret = gst_navigation_event_parse_command (evnt.Handle, out raw_command);
2009-05-14 14:50:16 +00:00
command = (Gst.Interfaces.NavigationCommand) raw_command;
2009-05-14 14:50:16 +00:00
return ret;
}
}
2009-05-14 14:50:16 +00:00
}