Ejemplo n.º 1
0
        /**
         * Adds the given browser as an overlay of this browser.
         *
         * The overlaid browser will appear transparently over the top of us on our texture.
         * {overlayBrowser} must not have an overlay and must be sized exactly the same as {this}.
         * Additionally, overlayBrowser.EnableRendering must be false. You still need to
         * do something to handle getting input to the right places. Overlays take a notable performance
         * hit on rendering (CPU alpha compositing).
         *
         * Overlays are used internally to implement context menus and pop-up dialogs (alert, onbeforeunload).
         * If the page causes any type of dialog, the overlay will be replaced.
         *
         * Overlays will be resized onto our texture when we are resized. The sizes must always match exactly.
         *
         * Remove the overlay (SetOverlay(null)) before closing either browser.
         *
         * (Note: though you can't set B as an overlay to A when B has an overlay, you can set
         * an overlay on B /while/ it is the overlay for A. For an example of this, try
         * right-clicking on the text area inside a prompt() popup. The context menu that
         * appears is an overlay to the overlay to the actual browser.)
         */
        public void SetOverlay(Browser overlayBrowser)
        {
            if (DeferUnready(() => SetOverlay(overlayBrowser)))
            {
                return;
            }
            if (overlayBrowser && overlayBrowser.DeferUnready(() => SetOverlay(overlayBrowser)))
            {
                return;
            }

            BrowserNative.zfb_setOverlay(browserId, overlayBrowser ? overlayBrowser.browserId : 0);
            overlay = overlayBrowser;

            if (!overlay)
            {
                return;
            }

            if (
                !overlay.Texture ||
                (overlay.Texture.width != Texture.width || overlay.Texture.height != Texture.height)
                )
            {
                overlay.Resize(Texture);
            }
        }
Ejemplo n.º 2
0
 public void ClearAll()
 {
     if (!browser.DeferUnready(ClearAll))
     {
         BrowserNative.zfb_clearCookies(browser.browserId);
     }
 }