Beispiel #1
0
 void IRenderWebBrowser.SetCursor(IntPtr handle, CefCursorType type)
 {
     UiThreadRunAsync(() =>
     {
         Cursor = CursorInteropHelper.Create(new SafeFileHandle(handle, ownsHandle: false));
     });
 }
 public unsafe int OnCursorChange(cef_browser_t *browser, IntPtr cursor, CefCursorType type, [Immutable] cef_cursor_info_t *custom_cursor_info)
 {
     fixed(cef_display_handler_t *self = &this)
     {
         return(((delegate * unmanaged[Stdcall] < cef_display_handler_t *, cef_browser_t *, IntPtr, CefCursorType, cef_cursor_info_t *, int >)on_cursor_change)(self, browser, cursor, type, custom_cursor_info));
     }
 }
Beispiel #3
0
 protected override void OnCursorChange(CefBrowser browser, IntPtr cursorHandle, CefCursorType type, CefCursorInfo customCursorInfo)
 {
     _uiHelper.PerformInUiThread(() =>
         {
             Cursor cursor = CursorInteropHelper.Create(new SafeFileHandle(cursorHandle, false));
             _owner.Cursor = cursor;
         });
 }
 protected override void OnCursorChange(CefBrowser browser, IntPtr cursorHandle, CefCursorType type, CefCursorInfo customCursorInfo)
 {
 }
 protected override void OnCursorChange(CefBrowser browser, IntPtr cursorHandle, CefCursorType type, CefCursorInfo customCursorInfo)
 {
     _owner.InvokeIfRequired(() => _owner.HostWindowInternal.Cursor = new Cursor(cursorHandle));
 }
 public override void OnCursorChange(CefBrowser browser, IntPtr cursor, CefCursorType type, CefCursorInfo customCursorInfo)
 {
     _implementation.OnCursorChange(browser, cursor, type, customCursorInfo);
 }
Beispiel #7
0
 /// <summary>
 /// Called when the browser's cursor has changed. If |type| is CT_CUSTOM then
 /// |custom_cursor_info| will be populated with the custom cursor information.
 /// </summary>
 protected abstract void OnCursorChange(CefBrowser browser, IntPtr cursorHandle, CefCursorType type, CefCursorInfo customCursorInfo);
        /// <summary>
        /// Called when an element should be painted. Pixel values passed to this
        /// method are scaled relative to view coordinates based on the value of
        /// CefScreenInfo.device_scale_factor returned from GetScreenInfo. |type|
        /// indicates whether the element is the view or the popup widget. |buffer|
        /// contains the pixel data for the whole image. |dirtyRects| contains the set
        /// of rectangles in pixel coordinates that need to be repainted. |buffer| will
        /// be |width|*|height|*4 bytes in size and represents a BGRA image with an
        /// upper-left origin.
        /// </summary>
        // protected abstract void OnPaint(cef_browser_t* browser, CefPaintElementType type, UIntPtr dirtyRectsCount, cef_rect_t* dirtyRects, void* buffer, int width, int height);

        private void on_cursor_change(cef_render_handler_t *self, cef_browser_t *browser, IntPtr cursor, CefCursorType type, cef_cursor_info_t *custom_cursor_info)
        {
            CheckSelf(self);
            throw new NotImplementedException(); // TODO: CefRenderHandler.OnCursorChange
        }
Beispiel #9
0
        protected override void OnCursorChange(CefBrowser browser, IntPtr cursorHandle, CefCursorType type, CefCursorInfo customCursorInfo)
        {
            Cursor cursor;

            if (type == CefCursorType.Custom)
            {
                cursor = CustomCursor.Create(ref customCursorInfo);
            }
            else if (cursorHandle == IntPtr.Zero)
            {
                cursor = CustomCursor.None;
            }
            else
            {
                cursor = new Cursor(cursorHandle);
            }
            WebView.RaiseCefCursorChange(new CursorChangeEventArgs(cursor, type));
        }
 /// <summary>
 /// Called when the browser's cursor has changed. If |type| is CT_CUSTOM then
 /// |custom_cursor_info| will be populated with the custom cursor information.
 /// Return true if the cursor change was handled or false for default handling.
 /// </summary>
 protected virtual bool OnCursorChange(CefBrowser browser, IntPtr cursorHandle, CefCursorType type, CefCursorInfo customCursorInfo)
 => false;
Beispiel #11
0
 public unsafe extern void OnCursorChange(cef_browser_t *browser, IntPtr cursor, CefCursorType type, [Immutable] cef_cursor_info_t *custom_cursor_info);
Beispiel #12
0
 protected internal unsafe override bool OnCursorChange(CefBrowser browser, IntPtr cursor, CefCursorType type, CefCursorInfo customCursorInfo)
 {
     return(_implementation.OnCursorChange(browser, cursor, type, customCursorInfo));
 }
        private int on_cursor_change(cef_display_handler_t *self, cef_browser_t *browser, IntPtr cursor, CefCursorType type, cef_cursor_info_t *custom_cursor_info)
        {
            CheckSelf(self);

            var m_browser       = CefBrowser.FromNative(browser);
            var m_cefCursorInfo = type == CefCursorType.Custom ? new CefCursorInfo(custom_cursor_info) : null;

            var m_result = OnCursorChange(m_browser, cursor, type, m_cefCursorInfo);

            if (m_cefCursorInfo != null)
            {
                m_cefCursorInfo.Dispose();
            }
            return(m_result ? 1 : 0);
        }
Beispiel #14
0
        /// <inheritdoc />
        protected override bool OnCursorChange(CefBrowser browser, IntPtr cursorHandle, CefCursorType type, CefCursorInfo customCursorInfo)
        {
            var ea = new CursorChangeEventArgs(type != CefCursorType.Custom ? CursorInteropHelper.Create(new SafeFileHandle(cursorHandle, false)) : CustomCursor.Create(ref customCursorInfo), type);

            WebView.RaiseCefCursorChange(ea);
            return(ea.Handled);
        }
 /// <summary>
 /// Called when the browser&apos;s cursor has changed.
 /// </summary>
 /// <param name="browser">The browser.</param>
 /// <param name="cursor">The cursor handle.</param>
 /// <param name="type">The cursor type.</param>
 /// <param name="customCursorInfo">
 /// The custom cursor information (if <paramref name="type"/> is <see cref="CefCursorType.Custom"/>).
 /// </param>
 /// <returns>true if the cursor change was handled or false for default handling.</returns>
 internal protected virtual bool OnCursorChange(CefBrowser browser, IntPtr cursor, CefCursorType type, CefCursorInfo customCursorInfo)
 {
     return(false);
 }
Beispiel #16
0
 public CursorChangedEventArgs(IntPtr handle, CefCursorType type)
 {
     Handle = handle;
     Type   = type;
 }
 public CursorChangeEventArgs(Cursor cursor, CefCursorType cursorType)
 {
     this.Cursor     = cursor;
     this.CursorType = cursorType;
 }
        private void on_cursor_change(cef_render_handler_t *self, cef_browser_t *browser, IntPtr cursor, CefCursorType type, cef_cursor_info_t *custom_cursor_info)
        {
            CheckSelf(self);

            var m_browser       = CefBrowser.FromNative(browser);
            var m_cefCursorInfo = type == CefCursorType.Custom ? new CefCursorInfo(custom_cursor_info) : null;

            OnCursorChange(m_browser, cursor, type, m_cefCursorInfo);

            if (m_cefCursorInfo != null)
            {
                m_cefCursorInfo.Dispose();
            }
        }
Beispiel #19
0
 /// <summary>
 /// Sets the cursor.
 /// </summary>
 /// <param name="handle">The handle.</param>
 /// <param name="type">The type.</param>
 void IRenderWebBrowser.SetCursor(IntPtr handle, CefCursorType type)
 {
     //Custom cursors are handled differently, for now keep standard ones executing
     //in an async fashion
     if(type == CefCursorType.Custom)
     {
         //When using a custom it appears we need to update the cursor in a sync fashion
         //Likely the underlying handle/buffer is being released before the cursor
         // is created when executed in an async fashion. Doesn't seem to be a problem
         //for build in cursor types
         UiThreadRunSync(() =>
         {
             Cursor = CursorInteropHelper.Create(new SafeFileHandle(handle, ownsHandle: false));
         });
     }
     else
     {
         UiThreadRunAsync(() =>
         {
             Cursor = CursorInteropHelper.Create(new SafeFileHandle(handle, ownsHandle: false));
         });
     }
 }
 /// <summary>
 /// Called when the browser's cursor has changed. If |type| is CT_CUSTOM then
 /// |custom_cursor_info| will be populated with the custom cursor information.
 /// </summary>
 protected abstract void OnCursorChange(CefBrowser browser, IntPtr cursorHandle, CefCursorType type, CefCursorInfo customCursorInfo);
 protected override void OnCursorChange(CefBrowser browser, IntPtr cursorHandle, CefCursorType type, CefCursorInfo customCursorInfo)
 {
 }
 void IRenderWebBrowser.SetCursor(IntPtr handle, CefCursorType type)
 {
     UiThreadRunAsync(() =>
     {
         Cursor = CursorInteropHelper.Create(new SafeFileHandle(handle, ownsHandle: false));
     });
 }
 internal protected virtual void OnCursorChange(CefBrowser browser, IntPtr cursor, CefCursorType type, CefCursorInfo customCursorInfo)
 {
 }
 void IRenderWebBrowser.SetCursor(IntPtr handle, CefCursorType type)
 {
 }
 protected override void OnCursorChange(CefBrowser browser, IntPtr cursorHandle, CefCursorType type, CefCursorInfo customCursorInfo)
 {
     _uiHelper.PerformInUiThread(() =>
     {
         //Cursor cursor = CursorInteropHelper.Create(new SafeFileHandle(cursorHandle, false));
         //_owner.Cursor = cursor;
     });
 }
 public void SetCursor(IntPtr cursor, CefCursorType type)
 {
     CursorChanged.SafeInvoke(this, new CursorChangedEventArgs(cursor, type));
 }
Beispiel #27
0
 protected override void OnCursorChange(CefBrowser browser,
                                        System.IntPtr cursorHandle, CefCursorType type, CefCursorInfo customCursorInfo)
 {
 }   // throw new NotImplementedException();
Beispiel #28
0
 protected override void OnCursorChange(CefBrowser browser, IntPtr cursorHandle, CefCursorType type, CefCursorInfo customCursorInfo)
 {
     //WebView.RaiseCefCursorChange(
     //	new CursorChangeEventArgs(type != CefCursorType.Custom ? CursorInteropHelper.Create(cursorHandle) : CustomCursor.Create(ref customCursorInfo), type)
     //);
 }
Beispiel #29
0
 void IRenderWebBrowser.SetCursor(IntPtr handle, CefCursorType type)
 {
 }
Beispiel #30
0
        private void on_cursor_change(cef_render_handler_t* self, cef_browser_t* browser, IntPtr cursor, CefCursorType type, cef_cursor_info_t* custom_cursor_info)
        {
            CheckSelf(self);

            var m_browser = CefBrowser.FromNative(browser);
            var m_cefCursorInfo = type == CefCursorType.Custom ? new CefCursorInfo(custom_cursor_info) : null;

            OnCursorChange(m_browser, cursor, type, m_cefCursorInfo);

            if (m_cefCursorInfo != null) m_cefCursorInfo.Dispose();
        }