mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-20 08:41:07 +00:00
cf9fd6ec9a
Also fix indention everywhere and change code to use Gst.MiniObject.GetObject() instead of GLib.Opaque.GetOpaque(). It's currently not possible to implement or use GInterfaces on mini objects but apart from that this should be a great improvement, especially new mini object classes can be defined in C# now.
59 lines
2.1 KiB
C#
59 lines
2.1 KiB
C#
namespace Gst.Interfaces {
|
|
|
|
using System;
|
|
using System.Runtime.InteropServices;
|
|
using System.Reflection;
|
|
using GLib;
|
|
using Gst;
|
|
using Gst.Interfaces;
|
|
|
|
public static class NavigationEvent {
|
|
[DllImport ("gstinterfaces-0.10.dll") ]
|
|
static extern int gst_navigation_event_get_type (IntPtr evnt);
|
|
|
|
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;
|
|
}
|
|
|
|
[DllImport ("gstinterfaces-0.10.dll") ]
|
|
static extern bool gst_navigation_event_parse_key_event (IntPtr evnt, out IntPtr key);
|
|
|
|
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);
|
|
|
|
key = GLib.Marshaller.Utf8PtrToString (raw_key);
|
|
|
|
return ret;
|
|
}
|
|
|
|
[DllImport ("gstinterfaces-0.10.dll") ]
|
|
static extern bool gst_navigation_event_parse_mouse_button_event (IntPtr evnt, out int button, out double x, out double y);
|
|
|
|
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);
|
|
}
|
|
|
|
[DllImport ("gstinterfaces-0.10.dll") ]
|
|
static extern bool gst_navigation_event_parse_mouse_move_event (IntPtr evnt, out double x, out double y);
|
|
|
|
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);
|
|
}
|
|
|
|
[DllImport ("gstinterfaces-0.10.dll") ]
|
|
static extern bool gst_navigation_event_parse_command (IntPtr evnt, out int command);
|
|
|
|
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);
|
|
|
|
command = (Gst.Interfaces.NavigationCommand) raw_command;
|
|
|
|
return ret;
|
|
}
|
|
|
|
}
|
|
}
|