Example #1
0
        private void on_popup_size(cef_render_handler_t *self, cef_browser_t *browser, cef_rect_t *rect)
        {
            CheckSelf(self);

            var m_browser = CefBrowser.FromNative(browser);
            var m_rect    = new CefRectangle(rect->x, rect->y, rect->width, rect->height);

            OnPopupSize(m_browser, m_rect);
        }
Example #2
0
        public void SetAsChild(IntPtr parentHandle, CefRectangle rect)
        {
            ThrowIfDisposed();

            Style = WindowStyle.WS_CHILD
                    | WindowStyle.WS_CLIPCHILDREN
                    | WindowStyle.WS_CLIPSIBLINGS
                    | WindowStyle.WS_TABSTOP
                    | WindowStyle.WS_VISIBLE;

            ParentHandle = parentHandle;

            X      = rect.X;
            Y      = rect.Y;
            Width  = rect.Width;
            Height = rect.Height;
        }
        private int get_view_rect(cef_render_handler_t* self, cef_browser_t* browser, cef_rect_t* rect)
        {
            CheckSelf(self);

            var m_browser = CefBrowser.FromNative(browser);
            var m_rect = new CefRectangle();

            var result = GetViewRect(m_browser, ref m_rect);

            if (result)
            {
                rect->x = m_rect.X;
                rect->y = m_rect.Y;
                rect->width = m_rect.Width;
                rect->height = m_rect.Height;
                return 1;
            }
            else return 0;
        }
Example #4
0
        private int get_view_rect(cef_render_handler_t *self, cef_browser_t *browser, cef_rect_t *rect)
        {
            CheckSelf(self);

            var m_browser = CefBrowser.FromNative(browser);
            var m_rect    = new CefRectangle();

            var result = GetViewRect(m_browser, ref m_rect);

            if (result)
            {
                rect->x      = m_rect.X;
                rect->y      = m_rect.Y;
                rect->width  = m_rect.Width;
                rect->height = m_rect.Height;
                return(1);
            }
            else
            {
                return(0);
            }
        }
Example #5
0
        private void on_paint(cef_render_handler_t *self, cef_browser_t *browser, CefPaintElementType type, UIntPtr dirtyRectsCount, cef_rect_t *dirtyRects, void *buffer, int width, int height)
        {
            CheckSelf(self);

            var m_browser = CefBrowser.FromNative(browser);

            // TODO: reuse arrays?
            var m_dirtyRects = new CefRectangle[(int)dirtyRectsCount];

            var count = (int)dirtyRectsCount;
            var rect  = dirtyRects;

            for (var i = 0; i < count; i++)
            {
                m_dirtyRects[i].X      = rect->x;
                m_dirtyRects[i].Y      = rect->y;
                m_dirtyRects[i].Width  = rect->width;
                m_dirtyRects[i].Height = rect->height;

                rect++;
            }

            OnPaint(m_browser, type, m_dirtyRects, (IntPtr)buffer, width, height);
        }
Example #6
0
 /// <summary>
 /// Called when the browser wants to move or resize the popup widget. |rect|
 /// contains the new location and size.
 /// </summary>
 protected abstract void OnPopupSize(CefBrowser browser, CefRectangle rect);
 protected override void OnPopupSize(CefBrowser browser, CefRectangle rect)
 {
     throw new NotImplementedException();
 }
 protected override void OnPaint(CefBrowser browser, CefPaintElementType type, CefRectangle[] dirtyRects, IntPtr buffer, int width, int height)
 {
     throw new NotImplementedException();
 }
Example #9
0
        /// <summary>
        /// Invalidate the |dirtyRect| region of the view. The browser will call
        /// CefRenderHandler::OnPaint asynchronously with the updated regions. This
        /// method is only used when window rendering is disabled.
        /// </summary>
        public void Invalidate(CefRectangle dirtyRect, CefPaintElementType type)
        {
            var n_dirtyRect = new cef_rect_t(dirtyRect.X, dirtyRect.Y, dirtyRect.Width, dirtyRect.Height);

            cef_browser_host_t.invalidate(_self, &n_dirtyRect, type);
        }
        public void SetAsChild(IntPtr parentHandle, CefRectangle rect)
        {
            ThrowIfDisposed();

            Style = WindowStyle.WS_CHILD
                  | WindowStyle.WS_CLIPCHILDREN
                  | WindowStyle.WS_CLIPSIBLINGS
                  | WindowStyle.WS_TABSTOP
                  | WindowStyle.WS_VISIBLE;

            ParentHandle = parentHandle;

            X = rect.X;
            Y = rect.Y;
            Width = rect.Width;
            Height = rect.Height;
        }
 /// <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, ref CefRectangle rect)
 {
     // TODO: return CefRectangle? (Nullable<CefRectangle>) instead of returning bool?
     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>
 protected abstract void OnPaint(CefBrowser browser, CefPaintElementType type, CefRectangle[] dirtyRects, IntPtr buffer, int width, int height);
        private void on_paint(cef_render_handler_t* self, cef_browser_t* browser, CefPaintElementType type, UIntPtr dirtyRectsCount, cef_rect_t* dirtyRects, void* buffer, int width, int height)
        {
            CheckSelf(self);

            var m_browser = CefBrowser.FromNative(browser);

            // TODO: reuse arrays?
            var m_dirtyRects = new CefRectangle[(int)dirtyRectsCount];

            var count = (int)dirtyRectsCount;
            var rect = dirtyRects;
            for (var i = 0; i < count; i++)
            {
                m_dirtyRects[i].X = rect->x;
                m_dirtyRects[i].Y = rect->y;
                m_dirtyRects[i].Width = rect->width;
                m_dirtyRects[i].Height = rect->height;

                rect++;
            }

            OnPaint(m_browser, type, m_dirtyRects, (IntPtr)buffer, width, height);
        }
 /// <summary>
 /// Called when the browser wants to move or resize the popup widget. |rect|
 /// contains the new location and size.
 /// </summary>
 protected abstract void OnPopupSize(CefBrowser browser, CefRectangle rect);
        private void on_popup_size(cef_render_handler_t* self, cef_browser_t* browser, cef_rect_t* rect)
        {
            CheckSelf(self);

            var m_browser = CefBrowser.FromNative(browser);
            var m_rect = new CefRectangle(rect->x, rect->y, rect->width, rect->height);

            OnPopupSize(m_browser, m_rect);
        }
Example #16
0
 /// <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, ref CefRectangle rect)
 {
     // TODO: return CefRectangle? (Nullable<CefRectangle>) instead of returning bool?
     return(false);
 }
 /// <summary>
 /// Invalidate the |dirtyRect| region of the view. The browser will call
 /// CefRenderHandler::OnPaint asynchronously with the updated regions. This
 /// method is only used when window rendering is disabled.
 /// </summary>
 public void Invalidate(CefRectangle dirtyRect, CefPaintElementType type)
 {
     var n_dirtyRect = new cef_rect_t(dirtyRect.X, dirtyRect.Y, dirtyRect.Width, dirtyRect.Height);
     cef_browser_host_t.invalidate(_self, &n_dirtyRect, type);
 }
 protected override bool GetRootScreenRect(CefBrowser browser, ref CefRectangle rect)
 {
     return base.GetRootScreenRect(browser, ref rect);
 }