internal static CfxDragData Wrap(IntPtr nativePtr) { if (nativePtr == IntPtr.Zero) { return(null); } lock (weakCache) { var wrapper = (CfxDragData)weakCache.Get(nativePtr); if (wrapper == null) { wrapper = new CfxDragData(nativePtr); weakCache.Add(wrapper); } else { CfxApi.cfx_release(nativePtr); } return(wrapper); } }
/// <summary> /// Call this function when the user drags the mouse into the web view (before /// calling DragTargetDragOver/DragTargetLeave/DragTargetDrop). |dragData| /// should not contain file contents as this type of data is not allowed to be /// dragged into the web view. File contents can be removed using /// CfxDragData.ResetFileContents (for example, if |dragData| comes from /// CfxRenderHandler.StartDragging). This function is only used when /// window rendering is disabled. /// </summary> /// <remarks> /// See also the original CEF documentation in /// <see href="https://bitbucket.org/chromiumfx/chromiumfx/src/tip/cef/include/capi/cef_browser_capi.h">cef/include/capi/cef_browser_capi.h</see>. /// </remarks> public void DragTargetDragEnter(CfxDragData dragData, CfxMouseEvent @event, CfxDragOperationsMask allowedOps) { CfxApi.cfx_browser_host_drag_target_drag_enter(NativePtr, CfxDragData.Unwrap(dragData), CfxMouseEvent.Unwrap(@event), (int)allowedOps); }
/// <summary> /// Create a new CfxDragData object. /// </summary> /// <remarks> /// See also the original CEF documentation in /// <see href="https://bitbucket.org/chromiumfx/chromiumfx/src/tip/cef/include/capi/cef_drag_data_capi.h">cef/include/capi/cef_drag_data_capi.h</see>. /// </remarks> public static CfxDragData Create() { return(CfxDragData.Wrap(CfxApi.DragData.cfx_drag_data_create())); }
/// <summary> /// Returns a copy of the current object. /// </summary> /// <remarks> /// See also the original CEF documentation in /// <see href="https://bitbucket.org/chromiumfx/chromiumfx/src/tip/cef/include/capi/cef_drag_data_capi.h">cef/include/capi/cef_drag_data_capi.h</see>. /// </remarks> public CfxDragData Clone() { return(CfxDragData.Wrap(CfxApi.DragData.cfx_drag_data_clone(NativePtr))); }