mirror of
https://github.com/Ryujinx/Opentk.git
synced 2025-09-07 13:33:15 +00:00
Some docs
This commit is contained in:
parent
527efca095
commit
aba85d479c
|
@ -693,9 +693,8 @@ namespace OpenTK.Platform.Windows
|
||||||
IntPtr str = Marshal.AllocHGlobal((int)fileNameSize);
|
IntPtr str = Marshal.AllocHGlobal((int)fileNameSize);
|
||||||
|
|
||||||
Functions.DragQueryFile(hDrop, i, str, fileNameSize);
|
Functions.DragQueryFile(hDrop, i, str, fileNameSize);
|
||||||
|
|
||||||
Marshal.Copy(str, byteArray, 0, (int)(fileNameSize - 1));
|
string dropString = Marshal.PtrToStringAuto(str);
|
||||||
string dropString = System.Text.Encoding.UTF8.GetString(byteArray);
|
|
||||||
OnFileDrop(dropString);
|
OnFileDrop(dropString);
|
||||||
|
|
||||||
Marshal.FreeHGlobal(str);
|
Marshal.FreeHGlobal(str);
|
||||||
|
|
|
@ -53,10 +53,13 @@ namespace OpenTK.Platform.X11
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
// X11 has some defined values
|
// X11 has some defined values
|
||||||
|
// Whis values are defined with c's #define in X.h
|
||||||
internal static class Consts
|
internal static class Consts
|
||||||
{
|
{
|
||||||
public static readonly IntPtr None = IntPtr.Zero;
|
// Universal null resource or null atom
|
||||||
public static readonly IntPtr CurrentTime = IntPtr.Zero;
|
public static readonly IntPtr None = IntPtr.Zero; // #define None 0L
|
||||||
|
// Special time value
|
||||||
|
public static readonly IntPtr CurrentTime = IntPtr.Zero; // #define CurrentTime 0L
|
||||||
}
|
}
|
||||||
|
|
||||||
#region internal static class API
|
#region internal static class API
|
||||||
|
|
|
@ -861,7 +861,6 @@ namespace OpenTK.Platform.X11
|
||||||
// Process all pending events
|
// Process all pending events
|
||||||
while (Exists && window != null)
|
while (Exists && window != null)
|
||||||
{
|
{
|
||||||
//Functions.XNextEvent(window.Display, ref e);
|
|
||||||
using (new XLock(window.Display))
|
using (new XLock(window.Display))
|
||||||
{
|
{
|
||||||
if (!Functions.XCheckWindowEvent(window.Display, window.Handle, window.EventMask, ref e) &&
|
if (!Functions.XCheckWindowEvent(window.Display, window.Handle, window.EventMask, ref e) &&
|
||||||
|
@ -910,9 +909,13 @@ namespace OpenTK.Platform.X11
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// For X11 drag and drop handling use https://freedesktop.org/wiki/Specifications/XDND/#index9h2
|
||||||
else if (e.ClientMessageEvent.message_type == _atom_xdnd_enter)
|
else if (e.ClientMessageEvent.message_type == _atom_xdnd_enter)
|
||||||
{
|
{
|
||||||
// Xdnd started
|
// Xdnd started
|
||||||
|
// ptr1 -> source window handler
|
||||||
|
// ptr2 bit 0 -> set to 1 if source support more than three data formats
|
||||||
|
// ptr2 third byte contains Xdnd version that source supports
|
||||||
bool useList = ((e.ClientMessageEvent.ptr2.ToInt64() & 1) == 1);
|
bool useList = ((e.ClientMessageEvent.ptr2.ToInt64() & 1) == 1);
|
||||||
sourceHandler = e.ClientMessageEvent.ptr1;
|
sourceHandler = e.ClientMessageEvent.ptr1;
|
||||||
sourceXdndVersion = e.ClientMessageEvent.ptr2.ToInt64() >> 24;
|
sourceXdndVersion = e.ClientMessageEvent.ptr2.ToInt64() >> 24;
|
||||||
|
@ -927,7 +930,6 @@ namespace OpenTK.Platform.X11
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Bad code it will save only 1 format
|
|
||||||
formats = Marshal.AllocHGlobal(3 * IntPtr.Size);
|
formats = Marshal.AllocHGlobal(3 * IntPtr.Size);
|
||||||
Marshal.WriteIntPtr(formats, e.ClientMessageEvent.ptr3);
|
Marshal.WriteIntPtr(formats, e.ClientMessageEvent.ptr3);
|
||||||
Marshal.WriteIntPtr(formats, IntPtr.Size * 2, e.ClientMessageEvent.ptr4);
|
Marshal.WriteIntPtr(formats, IntPtr.Size * 2, e.ClientMessageEvent.ptr4);
|
||||||
|
|
Loading…
Reference in a new issue