[global::System.Runtime.InteropServices.DllImport(lib, EntryPoint = "tzsh_kvm_service_secondary_selection_unset")]
internal static extern int UnsetSecondarySelection(IntPtr kvmService);
+ [global::System.Runtime.InteropServices.DllImport(lib, EntryPoint = "tzsh_kvm_service_perform_drop_target")]
+ internal static extern int PerformDropTarget(IntPtr kvmService, uint drop_target);
+
internal delegate void KVMDragStartEventCallback(IntPtr data, IntPtr kvmService);
[global::System.Runtime.InteropServices.DllImport(lib, EntryPoint = "tzsh_kvm_service_drag_start_cb_set")]
internal static extern int SetDragStartEventHandler(IntPtr kvmService, KVMDragStartEventCallback func, IntPtr data);
private event EventHandler _dragStarted;
private event EventHandler _dragEnded;
+
+ /// <summary>
+ /// Drop target type of PerformDrop request of KVM Service.
+ /// </summary>
+ public enum DropTarget
+ {
+ /// <summary>
+ /// Drop to KVM Service window self.
+ /// </summary>
+ KVMServiceWin = 0,
+ /// <summary>
+ /// Drop to the window that under pointer.
+ /// </summary>
+ UnderPointer = 1,
+ };
+
/// <summary>
/// Creates a new KVM Service handle.
/// </summary>
_tzsh.ErrorCodeThrow(res);
}
+ /// <summary>
+ /// Requests to perform drop to given target.
+ /// </summary>
+ /// <exception cref="ArgumentException">Thrown when failed of invalid argument.</exception>
+ public void PerformDrop(DropTarget target)
+ {
+ int res = Interop.KVMService.PerformDropTarget(_kvmService, (uint)target);
+ _tzsh.ErrorCodeThrow(res);
+ }
+
/// <summary>
/// Requests to cancel current drag.
/// </summary>
text.WidthResizePolicy = ResizePolicyType.FillToParent;
windowView.Add(text);
- KVMServiceWindow kvmServiceWindow = new KVMServiceWindow(new Rectangle(2500, 0, 60, 1440));
+ kvmServiceWindow = new KVMServiceWindow(new Rectangle(2500, 0, 60, 1440));
kvmServiceWindow.Show();
}
{
Exit();
}
+ if (e.Key.State == Key.StateType.Down && (e.Key.KeyPressedName == "d" || e.Key.KeyPressedName == "D"))
+ {
+ Log.Debug("KVMSample", e.Key.KeyPressedName + " pressed!");
+ dropTimer = new Timer(5000);
+ dropTimer.Tick += (source, args) => {
+ Log.Debug("KVMSample", "Timer tick!");
+ kvmServiceWindow.PerformDrop();
+ dropTimer.Stop();
+ return false;
+ };
+ dropTimer.Start();
+ }
}
private bool OnTouchEvent(object sender, View.TouchEventArgs e)
}
private DragAndDrop dnd;
+ private KVMServiceWindow kvmServiceWindow;
+ private Timer dropTimer;
}
class KVMServiceWindow : Window
kvmService.DragEnded += OnDragEnded;
}
+ public void PerformDrop()
+ {
+ kvmService.PerformDrop(Tizen.NUI.WindowSystem.Shell.KVMService.DropTarget.UnderPointer);
+ }
+
private void OnDnDEvent(object sender, DragEvent e)
{
if (e.DragType == DragType.Enter)