/// <summary> /// Called when the browser wants to move or resize the popup widget. /// |rect| contains the new location and size. /// </summary> private void on_popup_size(cef_render_handler_t *self, cef_browser_t *browser, /*const*/ cef_rect_t *rect) { ThrowIfObjectDisposed(); var m_browser = CefBrowser.From(browser); var m_rect = CefRect.From(rect); this.OnPopupSize(m_browser, m_rect); }
/// <summary> /// Called to report find results returned by CefBrowser::Find(). /// |identifer| is the identifier passed to CefBrowser::Find(), |count| /// is the number of matches currently identified, |selectionRect| is the /// location of where the match was found (in window coordinates), /// |activeMatchOrdinal| is the current position in the search results, /// and |finalUpdate| is true if this is the last find notification. /// </summary> private void on_find_result(cef_find_handler_t *self, cef_browser_t *browser, int identifier, int count, /*const*/ cef_rect_t *selectionRect, int activeMatchOrdinal, int finalUpdate) { ThrowIfObjectDisposed(); var m_browser = CefBrowser.From(browser); var m_selectionRect = CefRect.From(selectionRect); var m_finalUpdate = finalUpdate != 0; this.OnFindResult(m_browser, identifier, count, m_selectionRect, activeMatchOrdinal, m_finalUpdate); }
/// <summary> /// Called when an element should be painted. |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 that need to be repainted. On Windows |buffer| will be /// width*height*4 bytes in size and represents a BGRA image with an /// upper-left origin. /// </summary> private void on_paint(cef_render_handler_t *self, cef_browser_t *browser, cef_paint_element_type_t type, int dirtyRectCount, cef_rect_t *dirtyRects, /*const*/ void *buffer) { ThrowIfObjectDisposed(); var m_browser = CefBrowser.From(browser); var m_type = (CefPaintElementType)type; var m_dirtyRects = new CefRect[dirtyRectCount]; for (int i = 0; i < m_dirtyRects.Length; i++) { m_dirtyRects[i] = CefRect.From(dirtyRects); dirtyRects++; } var m_buffer = (IntPtr)buffer; this.OnPaint(m_browser, m_type, m_dirtyRects, m_buffer); }
/// <summary> /// Called to retrieve the simulated screen rectangle. /// Return true if the rectangle was provided. /// </summary> protected virtual bool GetScreenRect(CefBrowser browser, out CefRect rect) { rect = new CefRect(); return(false); }
/// <summary> /// Called when the browser wants to move or resize the popup widget. /// |rect| contains the new location and size. /// </summary> protected virtual void OnPopupSize(CefBrowser browser, CefRect rect) { }
/// <summary> /// Called when an element should be painted. /// |type| indicates whether the element is the view or the popup widget. /// |buffer| contains the pixel data for the whole image. /// |dirtyRects| indicates the portions of the image that have been repainted. /// On Windows |buffer| will be width*height*4 bytes in size and represents a BGRA image with an upper-left origin. /// </summary> protected virtual void OnPaint(CefBrowser browser, CefPaintElementType type, CefRect[] dirtyRect, IntPtr buffer) { }
/// <summary> /// Called to retrieve the view rectangle which is relative to screen coordinates. /// Return true if the rectangle was provided. /// </summary> protected virtual bool GetViewRect(CefBrowser browser, out CefRect rect) { rect = new CefRect(); return false; }
/// <summary> /// Called when an element should be painted. |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 that need to be repainted. On Windows |buffer| will be /// width*height*4 bytes in size and represents a BGRA image with an /// upper-left origin. /// </summary> private void on_paint(cef_render_handler_t* self, cef_browser_t* browser, cef_paint_element_type_t type, int dirtyRectCount, cef_rect_t* dirtyRects, /*const*/ void* buffer) { ThrowIfObjectDisposed(); var m_browser = CefBrowser.From(browser); var m_type = (CefPaintElementType)type; var m_dirtyRects = new CefRect[dirtyRectCount]; for (int i = 0; i < m_dirtyRects.Length; i++) { m_dirtyRects[i] = CefRect.From(dirtyRects); dirtyRects++; } var m_buffer = (IntPtr)buffer; this.OnPaint(m_browser, m_type, m_dirtyRects, m_buffer); }
/// <summary> /// Called to report find results returned by CefBrowser::Find(). /// |identifer| is the identifier passed to CefBrowser::Find(), /// |count| is the number of matches currently identified, /// |selectionRect| is the location of where the match was found (in window coordinates), /// |activeMatchOrdinal| is the current position in the search results, /// and |finalUpdate| is true if this is the last find notification. /// </summary> protected virtual void OnFindResult(CefBrowser browser, int identifier, int count, CefRect selectionRect, int activeMatchOrdinal, bool finalUpdate) { }
/// <summary> /// Invalidate the |dirtyRect| region of the view. /// This method is only used when window rendering is disabled and will result in a call to HandlePaint(). /// </summary> public void Invalidate(CefRect dirtyRect) { cef_rect_t n_dirtyRect; dirtyRect.To(&n_dirtyRect); cef_browser_t.invoke_invalidate(this.ptr, &n_dirtyRect); }