MSHTML: Beginning implementation of focus handling

Jacek Caban jack at itma.pwr.wroc.pl
Mon Aug 22 12:29:45 CDT 2005


Changelog:
    Beginning implementation of focus handling
-------------- next part --------------
Index: dlls/mshtml/nsiface.idl
===================================================================
RCS file: /home/wine/wine/dlls/mshtml/nsiface.idl,v
retrieving revision 1.2
diff -u -p -r1.2 nsiface.idl
--- dlls/mshtml/nsiface.idl	11 Aug 2005 18:36:48 -0000	1.2
+++ dlls/mshtml/nsiface.idl	22 Aug 2005 15:25:12 -0000
@@ -70,6 +70,7 @@ typedef nsISupports nsISimpleEnumerator;
 typedef nsISupports nsIWidget;
 typedef nsISupports nsIProtocolHandler;
 typedef nsISupports nsIChannel;
+typedef nsISupports nsIDOMElement;
 
 [
     object,
@@ -302,4 +303,20 @@ interface nsIIOService : nsISupports
     nsresult GetOffline(PRBool *aOffline);
     nsresult SetOffline(PRBool aOffline);
     nsresult AllowPort(PRInt32 aPort, const char *aScheme, PRBool *_retval);
+}
+
+[
+    object,
+    uuid(9c5d3c58-1dd1-11b2-a1c9-f3699284657a)
+]
+interface nsIWebBrowserFocus : nsISupports
+{
+    nsresult Activate();
+    nsresult Deactivate();
+    nsresult SetFocusAtFirstElement();
+    nsresult SetFocusAtLastElement();
+    nsresult GetFocusedWindow(nsIDOMWindow **aFocusedWindow);
+    nsresult SetFocusedWindow(nsIDOMWindow *aFocusedWindow);
+    nsresult GetFocusedElement(nsIDOMElement **aFocusedElement);
+    nsresult SetFocusedElement(nsIDOMElement *aFocusedElement);
 }
Index: dlls/mshtml/nsembed.c
===================================================================
RCS file: /home/wine/wine/dlls/mshtml/nsembed.c,v
retrieving revision 1.7
diff -u -p -r1.7 nsembed.c
--- dlls/mshtml/nsembed.c	22 Aug 2005 10:05:29 -0000	1.7
+++ dlls/mshtml/nsembed.c	22 Aug 2005 15:25:12 -0000
@@ -367,6 +367,11 @@ void HTMLDocument_NSContainer_Init(HTMLD
     if(NS_FAILED(nsres))
         ERR("Could not get nsIWebNavigation interface: %08lx\n", nsres);
 
+    nsres = nsIWebBrowserFocus_QueryInterface(This->nscontainer->webbrowser, &IID_nsIWebBrowserFocus,
+            (void**)&This->nscontainer->focus);
+    if(NS_FAILED(nsres))
+        ERR("Could not get nsIWebBrowserFocus interface: %08lx\n", nsres);
+
 #if 0
     nsres = nsIWebBrowserStream_QueryInterface(This->nscontainer->webbrowser, &IID_nsIWebBrowserStream,
             (void**)&This->nscontainer->stream);
Index: dlls/mshtml/view.c
===================================================================
RCS file: /home/wine/wine/dlls/mshtml/view.c,v
retrieving revision 1.15
diff -u -p -r1.15 view.c
--- dlls/mshtml/view.c	18 Aug 2005 10:50:06 -0000	1.15
+++ dlls/mshtml/view.c	22 Aug 2005 15:25:12 -0000
@@ -74,6 +74,7 @@ static void activate_gecko(HTMLDocument 
 
     nsIBaseWindow_SetVisibility(This->nscontainer->window, TRUE);
     nsIBaseWindow_SetEnabled(This->nscontainer->window, TRUE);
+    nsIWebBrowserFocus_Activate(This->nscontainer->focus);
 }
 
 static LRESULT WINAPI serverwnd_proc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)


More information about the wine-patches mailing list