/// <summary>Creates a new instance of a <see cref="GeckoRetargetedEventArgs"/> object.</summary>
 /// <param name="uri"></param>
 public GeckoRetargetedEventArgs(Uri uri, GeckoWindow domWind, Request req)
 {
     Uri               = uri;
     DomWindow         = domWind;
     DomWindowTopLevel = domWind.IsTopWindow();
     Request           = req;
 }
            /// <summary>Creates a new instance of a <see cref="GeckoNavigatedEventArgs"/> object.</summary>
            /// <param name="value"></param>
            /// <param name="response"></param>
            internal GeckoNavigatedEventArgs(Uri value, nsIRequest response, GeckoWindow domWind, bool _sameDocument, bool _errorPage)
            {
                Uri               = value;
                _response         = response;
                DomWindow         = domWind;
                DomWindowTopLevel = ((domWind == null) ? true : DomWindow.DomWindow.Equals(DomWindow.Top.DomWindow));

                IsSameDocument = _sameDocument;
                IsErrorPage    = _errorPage;
            }
Пример #3
0
		public void InitMouseEvent(string type, bool canBubble, bool cancelable, GeckoWindow view, int detail,
								   int screenX, int screenY, int clientX, int clientY,
								   bool ctrlKey, bool altKey, bool shiftKey, bool metaKey,
			ushort button, DomEventTarget target)
		{
			using (var typeArg = new nsAString(type))
			{
				_domMouseEvent.InitMouseEvent(typeArg, canBubble, cancelable, view.DomWindow, detail, screenX, screenY,
											   clientX, clientY, ctrlKey, altKey, shiftKey, metaKey, button, target.NativeObject);
			}
		}
Пример #4
0
 public void InitMouseEvent(string type, bool canBubble, bool cancelable, GeckoWindow view, int detail,
                            int screenX, int screenY, int clientX, int clientY,
                            bool ctrlKey, bool altKey, bool shiftKey, bool metaKey,
                            ushort button, DomEventTarget target)
 {
     using (var typeArg = new nsAString(type))
     {
         _domMouseEvent.InitMouseEvent(typeArg, canBubble, cancelable, view.DomWindow, detail, screenX, screenY,
                                       clientX, clientY, ctrlKey, altKey, shiftKey, metaKey, button, target.NativeObject);
     }
 }
Пример #5
0
        public static bool IsTopWindow(this GeckoWindow geckoWindow)
        {
            if (geckoWindow == null)
            {
                return(true);
            }
            var top = geckoWindow.Top;

            if (top == null)
            {
                return(true);
            }
            return(top.DomWindow.GetHashCode() == geckoWindow.DomWindow.GetHashCode());
        }
Пример #6
0
 /// <summary>
 /// Workaround suggested by Tom Hindle, since GeckoFx-45's CanXSelection properties aren't working.
 /// </summary>
 /// <returns></returns>
 private bool IsThereACurrentTextSelection()
 {
     using (var win = new GeckoWindow(_browser.WebBrowserFocus.GetFocusedWindowAttribute()))
     {
         var sel = win.Selection;
         if (sel.IsCollapsed || sel.FocusNode is GeckoImageElement)
             return false;
     }
     return true;
 }
Пример #7
0
 public static bool IsTopWindow(GeckoWindow geckoWindow)
 {
     if (geckoWindow == null) return true;
     var top = geckoWindow.Top;
     if (top == null) return true;
     return top.DomWindow.GetHashCode() == geckoWindow.DomWindow.GetHashCode();
 }
Пример #8
0
 public AutoJSContext(GeckoWindow window) :
     this((nsIGlobalObject)window.DomWindow)
 {
 }
Пример #9
0
 public AutoJSContext(GeckoWindow window) :
     this(window.DomWindow)
 {
 }
Пример #10
0
		/// <summary>Creates a new instance of a <see cref="GeckoRetargetedEventArgs"/> object.</summary>
		/// <param name="uri"></param>
		public GeckoRetargetedEventArgs(Uri uri, GeckoWindow domWind, Request req)
		{
			Uri = uri;
			DomWindow = domWind;
			DomWindowTopLevel = domWind.IsTopWindow();
			Request = req;
		}
Пример #11
0
		/// <summary>Creates a new instance of a <see cref="GeckoRedirectingEventArgs"/> object.</summary>
		/// <param name="value"></param>
		public GeckoRedirectingEventArgs(Uri value, GeckoWindow domWind)
		{
			Uri = value;
			DomWindow = domWind;
			DomWindowTopLevel = ((domWind == null) ? true : DomWindow.DomWindow.Equals(DomWindow.Top.DomWindow));
		}
Пример #12
0
		/// <summary>Creates a new instance of a <see cref="GeckoNavigatedEventArgs"/> object.</summary>
		/// <param name="value"></param>
		/// <param name="response"></param>
		internal GeckoNavigatedEventArgs(Uri value, nsIRequest response, GeckoWindow domWind, bool _sameDocument, bool _errorPage)
		{
			Uri = value;
			_response = response;
			DomWindow = domWind;

			using (var topWindow = DomWindow.Top)
			{
				DomWindowTopLevel = ((domWind == null) ? true : DomWindow.DomWindow.Equals(topWindow.DomWindow));
			}

			IsSameDocument = _sameDocument;
			IsErrorPage = _errorPage;
		}
Пример #13
0
		protected override void Dispose(bool disposing)
		{
			if (disposing)
			{
				//var count = Gecko.Interop.ComDebug.GetRefCount(WebBrowser);
				if (NavigateFinishedNotifier != null)
					NavigateFinishedNotifier.Dispose();
				//count = Gecko.Interop.ComDebug.GetRefCount(WebBrowser);

				if (_Window != null)
					_Window.Dispose();
				_Window = null;
				if (_Document != null)
					_Document.Dispose();
				_Document = null;
			}
			base.Dispose(disposing);
		}
Пример #14
0
 public GeckoRedirectingEventArgs(Uri destUri, GeckoWindow domWindow)
 {
     // TODO: Complete member initialization
     this.destUri   = destUri;
     this.domWindow = domWindow;
 }
 /// <summary>Creates a new instance of a <see cref="GeckoRedirectingEventArgs"/> object.</summary>
 /// <param name="value"></param>
 public GeckoRedirectingEventArgs(Uri value, GeckoWindow domWind)
 {
     Uri               = value;
     DomWindow         = domWind;
     DomWindowTopLevel = ((domWind == null) ? true : DomWindow.DomWindow.Equals(DomWindow.Top.DomWindow));
 }
 public void InitMouseScrollEvent(string type, bool canBubble, bool cancelable, GeckoWindow view, int detail,
                                  int screenX, int screenY, int clientX, int clientY,
                                  bool ctrlKey, bool altKey, bool shiftKey, bool metaKey,
                                  ushort button, DomEventTarget target, int axis
                                  )
 {
     using (var typeArg = new nsAString(type))
     {
         throw new NotImplementedException();
         //_mouseScrollEvent.InitMouseScrollEvent(typeArg, canBubble, cancelable, view.DomWindow, detail, screenX,
         //    screenY,
         //    clientX, clientY, ctrlKey, altKey, shiftKey, metaKey, button,
         //    target.NativeObject, axis);
     }
 }