Beispiel #1
0
        /// <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);
        }
Beispiel #3
0
        /// <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);
        }