예제 #1
0
        public static void Initialize(WebCore.Config config)
        {
            StringHelper userDataPathStr      = new StringHelper(config.userDataPath);
            StringHelper pluginPathStr        = new StringHelper(config.pluginPath);
            StringHelper logPathStr           = new StringHelper(config.logPath);
            StringHelper userAgentOverrideStr = new StringHelper(config.userAgentOverride);
            StringHelper proxyServerStr       = new StringHelper(config.proxyServer);
            StringHelper proxyConfigScriptStr = new StringHelper(config.proxyConfigScript);
            StringHelper customCSSStr         = new StringHelper(config.customCSS);

            awe_webcore_initialize(config.enablePlugins,
                                   config.enableJavascript,
                                   userDataPathStr.value(),
                                   pluginPathStr.value(),
                                   logPathStr.value(),
                                   config.logLevel,
                                   userAgentOverrideStr.value(),
                                   proxyServerStr.value(),
                                   proxyConfigScriptStr.value(),
                                   config.saveCacheAndCookies,
                                   config.maxCacheSize,
                                   config.disableSameOriginPolicy,
                                   customCSSStr.value());

            activeWebViews = new List <Object>();
        }
예제 #2
0
        public WebForm()
        {
            InitializeComponent();

            Resize += WebForm_Resize;
            webViewBitmap.MouseMove += WebForm_MouseMove;
            webViewBitmap.MouseDown += WebForm_MouseDown;
            webViewBitmap.MouseUp   += WebForm_MouseUp;
            MouseWheel += WebForm_MouseWheel;
            KeyDown    += WebForm_KeyDown;
            KeyUp      += WebForm_KeyUp;
            KeyPress   += WebForm_KeyPress;
            FormClosed += WebForm_FormClosed;
            Activated  += WebForm_Activated;
            Deactivate += WebForm_Deactivate;

            WebCore.Config config = new WebCore.Config();
            config.enablePlugins = true;
            WebCore.Initialize(config);

            webView = WebCore.CreateWebview(webViewBitmap.Width, webViewBitmap.Height);
            webView.LoadURL("http://www.google.com");
            webView.Focus();

            timer          = new Timer();
            timer.Interval = 30;
            timer.Tick    += new EventHandler(timer_Tick);
            timer.Start();
        }
예제 #3
0
    void Start()
    {
        // Initialize webCore and timer if they haven't been already
        if (WebCoreHasStarted == false)
        {
            WebCore.Config conf = new WebCore.Config();
            conf.enablePlugins = true;
            WebCore.Initialize(conf);

            webCoreHelper = new GameObject();
            webCoreHelper.AddComponent <WebCoreHelper>();

            WebCoreHasStarted = true;
        }

        // Create a new webView with a width and height of 512 pixels
        webView = WebCore.CreateWebview(512, 512);

        // Add webView to list of all open webviews
        allWebViews.Add(webView);

        // Load webpage
        webView.LoadURL("http://www.google.com");

        // Create texture that will be updated
        texture = new Texture2D(width, height, TextureFormat.ARGB32, false);

        // Create the pixel array for the plugin to write into at startup
        Pixels = texture.GetPixels(0);

        // "pin" the array in memory, so we can pass direct pointer to it's data to the plugin,
        // without costly marshaling of array of structures.
        PixelsHandle = GCHandle.Alloc(Pixels, GCHandleType.Pinned);

        // Assign texture to the renderer
        if (renderer)
        {
            renderer.material.mainTexture = texture;
        }
        // or gui texture
        else if (GetComponent(typeof(GUITexture)))
        {
            GUITexture gui = GetComponent(typeof(GUITexture)) as GUITexture;
            gui.texture = texture;
        }
        else
        {
            Debug.Log("Game object has no renderer or gui texture to assign the generated texture to!");
        }
    }
예제 #4
0
        protected override void LoadContent()
        {
            WebCore.Config config = new WebCore.Config();
            config.enablePlugins    = true;
            config.enableJavascript = true;
            WebCore.Initialize(config);

            thisWidth  = Game.GraphicsDevice.PresentationParameters.BackBufferWidth;
            thisHeight = Game.GraphicsDevice.PresentationParameters.BackBufferHeight;

            webView = WebCore.CreateWebview(thisWidth, thisHeight);

            webRender = new Texture2D(GraphicsDevice, thisWidth, thisHeight, false, SurfaceFormat.Color);
            webData   = new int[thisWidth * thisHeight];

            webEffect = assetManager.GetAsset <Effect>("Shaders/webEffect");

            LocalURL = URL;
            //ReLoad();
        }
예제 #5
0
        public MainWindow()
        {
            InitializeComponent();

            // Setup Update Timer
            updateTimer          = new DispatcherTimer();
            updateTimer.Tick    += new EventHandler(update);
            updateTimer.Interval = new TimeSpan(0, 0, 0, 0, 15);
            updateTimer.Start();

            this.SourceInitialized      += browserWindowSourceInitialized;
            txtAddress.KeyDown          += txtAddressKeyDown;
            tabControl.SelectionChanged += tabControlChanged;

            // Setup Webcore with plugins enabled
            WebCore.Config config = new WebCore.Config();
            config.enablePlugins = true;
            WebCore.Initialize(config);

            tabViewList = new ArrayList();
        }