Inheritance: Cocoa.Object
Exemplo n.º 1
0
    public MainWindow()
        : base(Gtk.WindowType.Toplevel)
    {
        var webView = new WebKit.WebView();
        var scrolled = new ScrolledWindow();
        var v = new VPaned();

        scrolled.Add(webView);
        v.Pack1(scrolled, true, true);
        scrolled.SetSizeRequest(-1, 50);

        var button = new Button("foo");
        v.Pack2(button, true, true);

        this.Add(v);
        this.ShowAll();

        webView.LoadString("<p>foo</p>", "text/html", "utf-8", null);

        // This won't show up until we've returned from the constructor
        // so let's do something easy that can happen after the window shows
        button.Clicked += (object sender, EventArgs e) => {
            var document = webView.DomDocument;
            var first = document.FirstChild;
            var body = document.GetElementsByTagName("body").Item(0);
            var para = document.CreateElement("p");
            para.AppendChild(document.CreateTextNode("this is some text"));
            body.AppendChild(para);
        };
    }
Exemplo n.º 2
0
 public LinuxBrowserBridge(WebView webBrowser)
     : base()
 {
     this.webBrowser = webBrowser;
     webBrowser.LoadFinished += delegate
     {
         webBrowser.TitleChanged += delegate(object o, TitleChangedArgs titleChangeArgs)
         {
             string pendingArgs = titleChangeArgs.Title;
             JArray argsJArray = (JArray)Newtonsoft.Json.JsonConvert.DeserializeObject(pendingArgs);
             string[] args = new string[argsJArray.Count];
             for (int i = 0; i < argsJArray.Count; i++)
                 args[i] = (string)argsJArray[i];
             if (args[0] == "HandleScriptPropertyChanged")
             {
                 if (args.Length == 3)
                     HandleScriptPropertyChanged(args[1], args[2], null);
                 else
                     HandleScriptPropertyChanged(args[1], args[2], args[3]);
             }
             else if (args[0] == "InvokeViewModelIndexMethod")
                 InvokeViewModelMethod(args[1], args[2], args[3]);
             else if (args[0] == "InvokeViewModelMethod")
                 InvokeViewModelMethod(args[1], args[2]);
             else if (args[0] == "HandleDocumentReady")
                 HandleDocumentReady();
             else if (args[0] == "HostLog")
                 HostLog(args[1]);
             else
                 SpinnakerConfiguration.CurrentConfig.Log(SpinnakerLogLevel.Error,"Ignoring unrecognized call from javascript for [" + args[0] + "] - this means that javascript in the view is trying to reach the host but with bad arguments");
         };
         HandleDocumentReady();
     };
 }
Exemplo n.º 3
0
 public void decidePolicyForNewWindowAction(WebView WebView, CFDictionaryPropertyBag actionInformation, WebURLRequest request, string frameName, IWebPolicyDecisionListener listener)
 {
     if (AllowNewWindows)
         listener.use();
     else
         listener.ignore();
 }
Exemplo n.º 4
0
 public void decidePolicyForNavigationAction(WebView WebView, CFDictionaryPropertyBag actionInformation, WebURLRequest request, webFrame frame, IWebPolicyDecisionListener listener)
 {
     if (AllowNavigation || AllowInitialNavigation)
         listener.use();
     else
         listener.ignore();
 }
Exemplo n.º 5
0
        public void Init()
        {
            try{
                var fxd = new Fixed();
                _window.Add(fxd);
                _wbkt = new WebView();
                fxd.Add(_wbkt);

                //init window
                this.SetSizeRequest(_window_width, _window_height);
                _window.AllowShrink = false;
                _window.Resizable = false;
                _window.SetPosition(WindowPosition.CenterAlways);

                //subscribe on events
                _window.DeleteEvent += OnDelete;
                _wbkt.LoadFinished += OnWindowLoaded;

                //webkit init
                _wbkt.Open(string.Format (URL, this._app_id, _scope, _display, _api_veresion));
            }
            catch(Exception ex)
            {
                this.throwError(22, "Error while window initialization: " + ex.Message);
            }
        }
 public void didFailLoadingWithError(WebView WebView, uint identifier, WebError error, IWebDataSource dataSource)
 {
     IWebURLResponse resp = null;
     resources.TryGetValue(identifier, out resp);
     if (resp != null)
        ResourceFailedLoading(resources[identifier], error);
 }
 public void didReceiveContentLength(WebView WebView, uint identifier, uint length, IWebDataSource dataSource)
 {
     int received = (int)length;
     try
     {
         ResourceSizeAvailable(resources[identifier], received);
     }
     catch { }
 }
        public void DidCreateJavascriptContext(WebView view, JSContext context, WebFrame frame)
        {
            jsContext = context;
            jsContext.ExceptionHandler = (JSContext contextException, JSValue exception) => {
                Console.WriteLine("JavaScript Exception: {0}", exception);
            };

            nativeBridge = new MyNativeBridge(jsContext);
            jsContext[(NSString)"nativeBridge"] = JSValue.From(nativeBridge, jsContext);
        }
Exemplo n.º 9
0
            public void DecidePolicyForNavigation(wk.WebView webView, NSDictionary action, NSUrlRequest request, wk.WebFrame frame, NSObject listener)
            {
                var url  = (NSUrl)action.ObjectForKey(new NSString("WebActionOriginalURLKey"));
                var args = new WebViewNewWindowEventArgs(new Uri(url.AbsoluteString), frame.Name);

                Handler.Callback.OnOpenNewWindow(Handler.Widget, args);
                if (!args.Cancel)
                {
                    NSWorkspace.SharedWorkspace.OpenUrl(url);
                }
                listener.PerformSelector(selIgnore, null, 0);
            }
Exemplo n.º 10
0
    private void CreateBrowser()
    {
        //Создаем массив обработчиков доступных для вызова из js
        handlers = new Dictionary<string, Action<NameValueCollection>>
        {
            { "callfromjs", nv => CallJs("showMessage", new object[] { nv["msg"] + " Ответ из С#" }) }
        };

        browser = new WebView ();

        browser.NavigationRequested += (sender, args) =>
        {
            var url = new Uri(args.Request.Uri);
            if (url.Scheme != "mp")
            {
                //mp - myprotocol.
                //Обрабатываем вызовы только нашего специального протокола.
                //Переходы по обычным ссылкам работают как и прежде
                return;
            }

            var parameters = System.Web.HttpUtility.ParseQueryString(url.Query);

            handlers[url.Host.ToLower()](parameters);

            //Отменяем переход по ссылке
            browser.StopLoading();
        };

        browser.LoadHtmlString (@"
                <html>
                    <head></head>
                    <body id=body>
                        <h1>Интерфейс</h1>
                        <button id=btn>Вызвать C#</button>
                        <p id=msg></p>

                        <script>
                            function buttonClick() {
                                window.location.href = 'mp://callFromJs?msg=Сообщение из js.';
                            }
                            function showMessage(msg) {
                                document.getElementById('msg').innerHTML = msg;
                            }

                            document.getElementById('btn').onclick = buttonClick;
                        </script>
                    </body>
                </html>
            ", null);

        this.Add (browser);
    }
Exemplo n.º 11
0
 public void InitWebKit(Gtk.Box w)
 {
     HoldingWidget = w;
     wb            = new WebKit.WebView();
     scrollWindow.Add(wb);
     // Hack to work around webkit bug; webkit will crash the app if a size is not provided
     // See https://bugs.eclipse.org/bugs/show_bug.cgi?id=466360 for a related bug report
     wb.SetSizeRequest(2, 2);
     wb.KeyPressEvent += Wb_KeyPressEvent;
     w.PackStart(scrollWindow, true, true, 0);
     w.ShowAll();
 }
Exemplo n.º 12
0
            public override void FailedLoadWithError(WebKit.WebView sender, NSError error, WebFrame forFrame)
            {
                Renderer._sentNavigating = false;

                Renderer._lastEvent = Renderer._lastBackForwardEvent;

                Renderer.Element?.SendNavigated(new WebNavigatedEventArgs(Renderer._lastEvent, new UrlWebViewSource {
                    Url = Renderer.Control.MainFrameUrl
                }, Renderer.Control.MainFrameUrl, WebNavigationResult.Failure));

                Renderer.UpdateCanGoBackForward();
            }
Exemplo n.º 13
0
		public void FinishedLoad(WebView sender, WebFrame forFrame)
		{
			var url = sender.MainFrameUrl;

			if (!Authenticator.HasCompleted) {
				Uri uri;
				if (Uri.TryCreate (url, UriKind.Absolute, out uri)) {
					if (Authenticator.CheckUrl (uri, GetCookies (url)))
						return;
				}
			}
		}
Exemplo n.º 14
0
 public WebBrowser()
     : base(Gtk.WindowType.Toplevel)
 {
     this.Build ();
     m_view = new WebView();
     browserScroll.AddWithViewport(m_view);
     m_view.LoadStarted += HandleViewLoadStarted;
     m_view.LoadProgressChanged += HandleViewLoadProgressChanged;
     m_view.LoadFinished += HandleM_viewLoadFinished;
     browserScroll.ShowAll();
     this.Maximize();
 }
Exemplo n.º 15
0
            public override void UIRunOpenPanelForFileButton(wk.WebView sender, wk.IWebOpenPanelResultListener resultListener)
            {
                var openDlg = new OpenFileDialog();

                if (openDlg.ShowDialog(Handler.Widget.ParentWindow) == DialogResult.Ok)
                {
                    var resultListenerObj = resultListener as wk.WebOpenPanelResultListener;
                    if (resultListenerObj != null)
                    {
                        resultListenerObj.ChooseFilenames(openDlg.Filenames.ToArray());
                    }
                }
            }
Exemplo n.º 16
0
 void HandleCreateWebView(object o, CreateWebViewArgs args)
 {
     Window info = new Window("");
     info.DefaultWidth = 1000;
     info.DefaultHeight = 700;
     VBox vbox2 = new VBox();
     WebView child = new WebView();
     child.NavigationRequested += HandleNavigationRequested1;
     vbox2.PackStart(child);
     info.Add (vbox2);
     info.ShowAll();
     args.RetVal = child;
 }
 public MainWindow()
     : base(Gtk.WindowType.Toplevel)
 {
     Build ();
     webView = new WebView ();
     this.scrolledWebWindow.Add(webView);
     this.text_adress.Text = HOME_PAGE;
     webView.LoadFinished += new LoadFinishedHandler (OnLoadFinished);
     webView.Open (text_adress.Text);
     pathFolderSave = Environment.GetFolderPath (Environment.SpecialFolder.MyMusic);
     downloadList = new DownloadList (this.scrolledListDownlaods);
     downloader = new Downloader (downloadList);
     downloader.SavePath = pathFolderSave;
 }
        public override void AwakeFromNib()
        {
            base.AwakeFromNib();

            NSUserDefaults.StandardUserDefaults.SetBool(true, "WebKitDeveloperExtras");
            NSUserDefaults.StandardUserDefaults.Synchronize();

            myWebView = new WebKit.WebView(Window.ContentView.Bounds, "MainWindow", "");
            myWebView.AutoresizingMask = NSViewResizingMask.WidthSizable | NSViewResizingMask.HeightSizable;
            Window.ContentView.AddSubview(myWebView);

            myWebView.FrameLoadDelegate = new MyFrameLoadDelegate();
            myWebView.MainFrame.LoadRequest(new NSUrlRequest(new NSUrl("http://demo.desktopjavascript.com")));
        }
Exemplo n.º 19
0
    public MainWindow()
        : base(Gtk.WindowType.Toplevel)
    {
        Build();

        this.eng = new Engine(this);
        this.eng.Start();
        this.eng.Stopped += HandleApphandleStopped;

        this.webView = new WebView();
        this.mainContainer.Add(this.webView);
        this.webView.Show();
        this.webView.LoadUri("http://localhost:9999/index.html");
    }
Exemplo n.º 20
0
        public WikipediaView()
        {
            view = new WebView();

            view.ConsoleMessage += delegate(object o, ConsoleMessageArgs args) {
                Log.Debug(args.Message);
            };

            /*view.LoadProgressChanged += delegate (object o, LoadProgressChangedArgs args) {
             *  Log.DebugFormat ("LoadProgress: {0}", args.Progress);
             * };*/

            Add(view);
        }
Exemplo n.º 21
0
        public ItemView(ItemList list)
            : base()
        {
            itemList = list;
            itemList.PropertyChanged += ItemListPropertyChanged;
            this.webView = new WebView ();
            #if ENABLE_FONTS
            this.webSettings = new WebSettings ();
            webView.Settings = webSettings;
            #endif
                        ScrolledWindow sw = new ScrolledWindow ();
                        sw.Add(webView);
            Add(sw);

            Conf.AddNotify (Preference.FONT_PATH,
                                        new NotifyEventHandler (FontNotifyHandler));
            SetFonts ();

            ProxyUpdatedCb ();
            Proxy.Updated += ProxyUpdatedCb;

            webView.NavigationRequested += delegate (object sender, NavigationRequestedArgs args) {
            try {
            /*
             * If last_link is the same as args.Request.Uri, the user clicked on a link
             * (as we know he was hovering). Thus, try to open it on the browser
             */
            if(args.Request.Uri.Equals(last_link)){
                args.RetVal = NavigationResponse.Ignore;
                GtkBeans.Global.ShowUri(null, args.Request.Uri);
            } else {
                /* Otherwise, it's part of the post, so accept it (like the facebook iframe) */
                args.RetVal = NavigationResponse.Accept;
            }
            }
            catch (Exception e) {
            Console.Error.WriteLine("Couldn't show URL: " + args.Request.Uri + e.Message);
            }
            };

            webView.HoveringOverLink += delegate (object sender, HoveringOverLinkArgs args) {
                if (OnUrl != null)
                  OnUrl (args.Link);
                  last_link = args.Link;
            };

            webView.Show ();
            PageLoaded = false;
        }
Exemplo n.º 22
0
 public void decidePolicyForMIMEType(WebView WebView, string type, IWebURLRequest request, webFrame frame, IWebPolicyDecisionListener listener)
 {
     if (WebView.canShowMIMEType(type) == 0 && !request.url().StartsWith("file:") && !type.Contains("pdf"))
     {
         if (AllowDownloads)
             listener.download();
         else
             listener.ignore();
     }
     else
     {
         listener.use();
         Owner.tempmimetype = type;
     }
 }
Exemplo n.º 23
0
        public void StartedProvisionalLoad(WebKit.WebView sender, WebKit.WebFrame forFrame)
        {
            var url = sender.MainFrameUrl;

            if (!Authenticator.HasCompleted)
            {
                Uri uri;
                if (Uri.TryCreate(url, UriKind.Absolute, out uri))
                {
                    if (Authenticator.CheckUrl(uri, GetCookies(url)))
                    {
                        return;
                    }
                }
            }
        }
Exemplo n.º 24
0
 public void decidePolicyForMIMEType(WebView webView, string type, IWebURLRequest request, IWebFrame frame, IWebPolicyDecisionListener listener)
 {
     // todo: add support for showing custom MIME type documents
     // and for changing which MIME types are handled here
     if (webView.canShowMIMEType(type) == 0)
     {
         if (AllowDownloads)
             listener.download();
         else
             listener.ignore();
     }
     else
     {
         listener.use();
     }
 }
Exemplo n.º 25
0
		public override void ViewDidLoad ()
		{
			base.ViewDidLoad ();

			// Register our custom url protocol
			NSUrlProtocol.RegisterClass (new ObjCRuntime.Class (typeof (ImageProtocol)));

			var web = new WebView {
				AutoresizingMask = NSViewResizingMask.HeightSizable | NSViewResizingMask.WidthSizable
			};

			web.Frame = View.Bounds;
			View.AutoresizesSubviews = true;
			View.AddSubview (web);

			web.MainFrame.LoadRequest (NSUrlRequest.FromUrl (NSUrl.FromFilename (NSBundle.MainBundle.PathForResource ("test", "html"))));
		}
Exemplo n.º 26
0
        // Protected implementation of Dispose pattern.
        protected virtual void Dispose(bool disposing)
        {
            if (disposed)
            {
                return;
            }

            if (disposing)
            {
                wb.Dispose();
                wb = null;
                scrollWindow.Destroy();
            }

            // Free any unmanaged objects here.
            //
            disposed = true;
        }
Exemplo n.º 27
0
			public override void DecidePolicyForNavigation (WebView webView, NSDictionary actionInformation, NSUrlRequest request, WebFrame frame, NSObject decisionToken)
			{
				switch ((WebNavigationType)((NSNumber)actionInformation [WebPolicyDelegate.WebActionNavigationTypeKey]).Int32Value) {
				case WebNavigationType.BackForward:
				case WebNavigationType.FormResubmitted:
				case WebNavigationType.FormSubmitted:
					WebPolicyDelegate.DecideIgnore (decisionToken);
					break;
				case WebNavigationType.LinkClicked:
					NSWorkspace.SharedWorkspace.OpenUrl (actionInformation[WebPolicyDelegate.WebActionOriginalUrlKey] as NSUrl);
					WebPolicyDelegate.DecideIgnore (decisionToken);
					break;
				case WebNavigationType.Other:
				case WebNavigationType.Reload:
					WebPolicyDelegate.DecideUse (decisionToken);
					break;
				}
			}
Exemplo n.º 28
0
		public void TableViewDoubleClick(NSObject sender)
		{
//			NSTableView tv = (NSTableView)sender;
//			Console.WriteLine("TableView: {0}", tv);
			ScheduledClass c = scheduleFetcher.ScheduledClasses[(int)tableView.ClickedRow];

//			webPanel = new NSPanel();
			webPanel = new NSWindow();
			webPanel.StyleMask = NSWindowStyle.Resizable | webPanel.StyleMask;
			webPanel.SetContentSize(new CGSize(Window.ContentView.Frame.Size.Width, 500.0f));
			webView = new WebView(new CGRect(0.0f, 50.0f, Window.ContentView.Frame.Size.Width, 450.0f), "", "");
			webView.AutoresizingMask = NSViewResizingMask.HeightSizable | NSViewResizingMask.WidthSizable;
			webPanel.ContentView.AddSubview(webView);

			webView.WeakResourceLoadDelegate = this;
			webView.WeakFrameLoadDelegate = this;

			progressBar = new NSProgressIndicator(new CGRect(25.0f, 12.0f, Window.ContentView.Frame.Size.Width-175.0f, 25.0f));
			progressBar.Style = NSProgressIndicatorStyle.Bar;
			progressBar.Indeterminate = false;
			progressBar.AutoresizingMask = NSViewResizingMask.WidthSizable;
			webPanel.ContentView.AddSubview(progressBar);
			progressBar.MinValue = 0;
			progressBar.MaxValue = 100;
			progressBar.DoubleValue = progress;

			NSButton closebutton = new NSButton(new CGRect(webPanel.Frame.Width - 125.0f, 12.0f, 100.0f, 25.0f));
			closebutton.Title = "Close";
			closebutton.BezelStyle = NSBezelStyle.Rounded;
			closebutton.Target = this;
			closebutton.Action = new Selector("closePanel:");
			closebutton.AutoresizingMask = NSViewResizingMask.MinXMargin;
			webPanel.DefaultButtonCell = closebutton.Cell;
			webPanel.ContentView.AddSubview(closebutton);

			webView.MainFrameUrl = c.Href;
//			Window.BeginSheet(webPanel, (nint) => {
//
//			});
			NSApplication.SharedApplication.BeginSheet(webPanel, Window);

			//NSWorkspace.SharedWorkspace.OpenUrl(new NSUrl(c.Href));
		}
Exemplo n.º 29
0
            public override void FinishedLoad(WebKit.WebView sender, WebFrame forFrame)
            {
                _renderer._sentNavigating = false;

                if (_renderer.Control.IsLoading)
                {
                    return;
                }

                _renderer._ignoreSourceChanges = true;
                _renderer.Element?.SetValueFromRenderer(WebView.SourceProperty, new UrlWebViewSource {
                    Url = _renderer.Control.MainFrameUrl
                });
                _renderer._ignoreSourceChanges = false;

                _renderer._lastEvent = _renderer._lastBackForwardEvent;
                _renderer.Element?.SendNavigated(new WebNavigatedEventArgs(_renderer._lastEvent, _renderer.Element?.Source, _renderer.Control.MainFrameUrl, WebNavigationResult.Success));

                _renderer.UpdateCanGoBackForward();
            }
Exemplo n.º 30
0
        public void WillPerformClientRedirect(WebKit.WebView sender, Foundation.NSUrl toUrl, double secondsDelay, Foundation.NSDate fireDate, WebKit.WebFrame forFrame)
        {
            var url = sender.MainFrameUrl;

            if (!Authenticator.HasCompleted)
            {
                Uri uri;
                if (Uri.TryCreate(url, UriKind.Absolute, out uri))
                {
                    if (Authenticator.CheckUrl(uri, GetCookies(url)))
                    {
                        forFrame.StopLoading();
                        return;
                    }
                }
            }
            else
            {
                forFrame.StopLoading();
            }
        }
		// Shared initialization code
		private void Initialize ()
		{
			mWebView = new WebView(new CGRect(0,0,480,640),"Gps","Gps");
			this.ContentView.AddSubview(mWebView);

			var aUri = new Uri(mUrl);

			mWebView.ReceivedTitle += (object sender, WebFrameTitleEventArgs e) => 
			{
				this.Title = e.Title;
			};

			mWebView.WillPerformClientRedirect += (object sender, WebFrameClientRedirectEventArgs e) => 
			{
				Console.WriteLine("");
			};
				
			//NSUrl aNsUrl = (NSUrl)aUri;
			mWebView.MainFrame.LoadRequest(new NSUrlRequest((NSUrl)aUri));

			SetupListener ();
		}
Exemplo n.º 32
0
            public override void UIPrintFrameView(wk.WebView sender, wk.WebFrameView frameView)
            {
                const float margin         = 24f;
                var         printOperation = frameView.GetPrintOperation(new NSPrintInfo
                {
                    VerticallyCentered = false,
                    LeftMargin         = margin,
                    RightMargin        = margin,
                    TopMargin          = margin,
                    BottomMargin       = margin
                });

                printOperation.PrintPanel.Options =
                    NSPrintPanelOptions.ShowsCopies |
                    NSPrintPanelOptions.ShowsOrientation |
                    NSPrintPanelOptions.ShowsPageSetupAccessory |
                    NSPrintPanelOptions.ShowsPageRange |
                    NSPrintPanelOptions.ShowsPaperSize |
                    NSPrintPanelOptions.ShowsPreview |
                    NSPrintPanelOptions.ShowsPrintSelection |
                    NSPrintPanelOptions.ShowsScaling;
                printOperation.RunOperation();
            }
Exemplo n.º 33
0
        public static void Main(string[] args)
        {
            string url = "http://localhost:8000/testing";

            Console.WriteLine("Loading...");

            Application.Init();
            Window window = new Window ("lolbr");
            window.SetDefaultSize(1024, 500);

            window.Destroyed += delegate (object sender, EventArgs e) {
                Application.Quit ();
            };

            ScrolledWindow scrolled_window = new ScrolledWindow ();
            WebView web_view = new WebView ();
            web_view.Open (url);
            scrolled_window.Add (web_view);
            window.Add(scrolled_window);
            window.ShowAll();

            Application.Run();
        }
Exemplo n.º 34
0
 public void decidePolicyForMIMEType(WebView webView, string type, IWebURLRequest request, IWebFrame frame, IWebPolicyDecisionListener listener)
 {
     listener.use();
 }
Exemplo n.º 35
0
 public WebDragDestinationAction dragDestinationActionMaskForDraggingInfo(WebView WebView, IDataObject draggingInfo)
 {
     throw new NotImplementedException();
 }
 public void canTakeFocus(WebView sender, int forward, out int result)
 {
     throw new NotImplementedException();
 }
 public void addCustomMenuDrawingData(WebView sender, int hMenu)
 {
 }
 public void willPerformDragDestinationAction(WebView WebView, WebDragDestinationAction action, IDataObject draggingInfo)
 {
 }
Exemplo n.º 39
0
 public void contextMenuItemSelected(WebView sender, IntPtr item, CFDictionaryPropertyBag element)
 {
 }
Exemplo n.º 40
0
 public void decidePolicyForNavigationAction(WebView webView, CFDictionaryPropertyBag actionInformation, IWebURLRequest request, IWebFrame frame, IWebPolicyDecisionListener listener)
 {
     listener.use();
 }
Exemplo n.º 41
0
 public void unableToImplementPolicyWithError(WebView webView, WebError error, IWebFrame frame)
 {
 }
Exemplo n.º 42
0
 public void plugInFailedWithError(WebView WebView, WebError error, IWebDataSource dataSource)
 {
     throw new NotImplementedException();
 }
Exemplo n.º 43
0
 public override NSMenuItem[] UIGetContextMenuItems(wk.WebView sender, NSDictionary forElement, NSMenuItem[] defaultMenuItems)
 {
     return(Handler.BrowserContextMenuEnabled ? defaultMenuItems : null);
 }
Exemplo n.º 44
0
 public override bool UIRunJavaScriptConfirmationPanel(wk.WebView sender, string withMessage, wk.WebFrame initiatedByFrame)
 {
     return(MessageBox.Show(Handler.Widget, withMessage, MessageBoxButtons.YesNo) == DialogResult.Yes);
 }
Exemplo n.º 45
0
 public override void UIRunJavaScriptAlertPanelMessage(wk.WebView sender, string withMessage, wk.WebFrame initiatedByFrame)
 {
     MessageBox.Show(Handler.Widget, withMessage);
 }
Exemplo n.º 46
0
 public WebURLRequest willSendRequest(WebView WebView, uint identifier, WebURLRequest request, WebURLResponse redirectResponse, IWebDataSource dataSource)
 {
     throw new NotImplementedException();
 }
Exemplo n.º 47
0
 public void decidePolicyForNewWindowAction(WebView webView, CFDictionaryPropertyBag actionInformation, IWebURLRequest request, string frameName, IWebPolicyDecisionListener listener)
 {
     listener.use();
 }
Exemplo n.º 48
0
 public void identifierForInitialRequest(WebView WebView, WebURLRequest request, IWebDataSource dataSource, uint identifier)
 {
     throw new NotImplementedException();
 }
Exemplo n.º 49
0
 public WebView createModalDialog(WebView sender, IWebURLRequest request)
 {
     throw new NotImplementedException();
 }
Exemplo n.º 50
0
 public void didReceiveResponse(WebView WebView, uint identifier, WebURLResponse response, IWebDataSource dataSource)
 {
     throw new NotImplementedException();
 }
Exemplo n.º 51
0
 public int contextMenuItemsForElement(WebView sender, CFDictionaryPropertyBag element, int defaultItemsHMenu)
 {
     return(owner.IsWebBrowserContextMenuEnabled ? defaultItemsHMenu : 0);
 }
Exemplo n.º 52
0
 public void didReceiveContentLength(WebView WebView, uint identifier, uint length, IWebDataSource dataSource)
 {
     throw new NotImplementedException();
 }
 public void webViewUnfocus(WebView sender)
 {
 }
Exemplo n.º 54
0
 public void didReceiveAuthenticationChallenge(WebView WebView, uint identifier, IWebURLAuthenticationChallenge challenge, IWebDataSource dataSource)
 {
     throw new NotImplementedException();
 }
 public IDataObject willPerformDragSourceAction(WebView WebView, WebDragSourceAction action, ref tagPOINT point, IDataObject pasteboard)
 {
     throw new NotImplementedException();
 }
Exemplo n.º 56
0
 public void didFinishLoadingFromDataSource(WebView WebView, uint identifier, IWebDataSource dataSource)
 {
     throw new NotImplementedException();
 }
 public int canRunModal(WebView WebView)
 {
     throw new NotImplementedException();
 }
Exemplo n.º 58
0
 public void didFailLoadingWithError(WebView WebView, uint identifier, WebError error, IWebDataSource dataSource)
 {
     throw new NotImplementedException();
 }
        public SparkleEventLog()
            : base("")
        {
            SetSizeRequest (480, 640);
            SetPosition (WindowPosition.Center);

            Resizable   = true;
            BorderWidth = 0;

            Title = _("Recent Events");
            IconName = "folder-sparkleshare";

            DeleteEvent += Close;

            this.size_label = new Label () {
                Markup = "<b>Size:</b> …   <b>History:</b> …"
            };

            VBox layout_vertical = new VBox (false, 0);
            this.spinner         = new SparkleSpinner (22);
            this.content_wrapper = new EventBox ();
            this.scrolled_window = new ScrolledWindow ();

            this.web_view = new WebView () {
                Editable = false
            };

            this.web_view.HoveringOverLink += delegate (object o, WebKit.HoveringOverLinkArgs args) {
                this.link_status = args.Link;
            };

            this.web_view.NavigationRequested += delegate (object o, WebKit.NavigationRequestedArgs args) {
                if (args.Request.Uri == this.link_status)
                    SparkleEventLogController.LinkClicked (args.Request.Uri);

                // Don't follow HREFs (as this would cause a page refresh)
                if (!args.Request.Uri.Equals ("file:"))
                    args.RetVal = 1;
            };

            this.scrolled_window.Add (this.web_view);
            this.content_wrapper.Add (this.spinner);

            this.spinner.Start ();

            this.layout_horizontal = new HBox (false, 0);
            this.layout_horizontal.PackStart (this.size_label, true, true, 0);
            this.layout_horizontal.PackStart (new Label ("  "), false, false, 0);

            layout_vertical.PackStart (this.layout_horizontal, false, false, 0);
            layout_vertical.PackStart (CreateShortcutsBar (), false, false, 0);
            layout_vertical.PackStart (this.content_wrapper, true, true, 0);

            Add (layout_vertical);
            ShowAll ();

            UpdateChooser (null);
            UpdateContent (null);

            // Hook up the controller events
            Controller.UpdateChooserEvent += delegate (string [] folders) {
                Application.Invoke (delegate {
                    UpdateChooser (folders);
                });
            };

            Controller.UpdateContentEvent += delegate (string html) {
                 Application.Invoke (delegate {
                    UpdateContent (html);
                });
            };

            Controller.ContentLoadingEvent += delegate {
                Application.Invoke (delegate {
                    if (this.content_wrapper.Child != null)
                        this.content_wrapper.Remove (this.content_wrapper.Child);

                    this.content_wrapper.Add (this.spinner);
                    this.spinner.Start ();
                    this.content_wrapper.ShowAll ();
                });
            };

            Controller.UpdateSizeInfoEvent += delegate (string size, string history_size) {
                Application.Invoke (delegate {
                    this.size_label.Markup = "<b>Size:</b> " + size + "   " +
                                             "<b>History:</b> " + history_size;

                    this.size_label.ShowAll ();
                });
            };
        }
Exemplo n.º 60
0
 public WebDragSourceAction dragSourceActionMaskForPoint(WebView WebView, ref tagPOINT point)
 {
     throw new NotImplementedException();
 }