Jacek Caban : mshtml: Added beginning IDM_BROWSEMODE implementation.

Alexandre Julliard julliard at wine.codeweavers.com
Mon Jul 3 05:22:50 CDT 2006


Module: wine
Branch: refs/heads/master
Commit: 346d5bc7d03d1a1f5ebfb377a4dfc10c73fb3b26
URL:    http://source.winehq.org/git/?p=wine.git;a=commit;h=346d5bc7d03d1a1f5ebfb377a4dfc10c73fb3b26

Author: Jacek Caban <jacek at codeweavers.com>
Date:   Fri Jun 30 23:44:04 2006 +0200

mshtml: Added beginning IDM_BROWSEMODE implementation.

---

 dlls/mshtml/mshtml_private.h |    7 +++++++
 dlls/mshtml/olecmd.c         |   19 +++++++++++++++++--
 dlls/mshtml/oleobj.c         |   13 ++++++++++---
 3 files changed, 34 insertions(+), 5 deletions(-)

diff --git a/dlls/mshtml/mshtml_private.h b/dlls/mshtml/mshtml_private.h
index ee608de..aece659 100644
--- a/dlls/mshtml/mshtml_private.h
+++ b/dlls/mshtml/mshtml_private.h
@@ -47,6 +47,12 @@ typedef struct HTMLDOMNode HTMLDOMNode;
 typedef struct ConnectionPoint ConnectionPoint;
 typedef struct BSCallback BSCallback;
 
+typedef enum {
+    UNKNOWN_USERMODE,
+    BROWSEMODE,
+    EDITMODE        
+} USERMODE;
+
 typedef struct {
     const IHTMLDocument2Vtbl              *lpHTMLDocument2Vtbl;
     const IHTMLDocument3Vtbl              *lpHTMLDocument3Vtbl;
@@ -78,6 +84,7 @@ typedef struct {
     HWND hwnd;
     HWND tooltips_hwnd;
 
+    USERMODE usermode;
     BOOL in_place_active;
     BOOL ui_active;
     BOOL window_active;
diff --git a/dlls/mshtml/olecmd.c b/dlls/mshtml/olecmd.c
index 1881062..95d8646 100644
--- a/dlls/mshtml/olecmd.c
+++ b/dlls/mshtml/olecmd.c
@@ -30,6 +30,7 @@ #include "ole2.h"
 #include "shlguid.h"
 #include "mshtmdid.h"
 #include "idispids.h"
+#include "mshtmcid.h"
 
 #include "wine/debug.h"
 
@@ -237,6 +238,15 @@ static HRESULT exec_get_print_template(H
     return E_NOTIMPL;
 }
 
+static HRESULT exec_browsemode(HTMLDocument *This)
+{
+    WARN("(%p)\n", This);
+
+    This->usermode = BROWSEMODE;
+
+    return S_OK;
+}
+
 static const struct {
     OLECMDF cmdf;
     HRESULT (*func)(HTMLDocument*,DWORD,VARIANT*,VARIANT*);
@@ -374,8 +384,13 @@ static HRESULT WINAPI OleCommandTarget_E
         FIXME("unsupported nCmdID %ld of CGID_ShellDocView group\n", nCmdID);
         return OLECMDERR_E_NOTSUPPORTED;
     }else if(IsEqualGUID(&CGID_MSHTML, pguidCmdGroup)) {
-        FIXME("unsupported nCmdID %ld of CGID_MSHTML group\n", nCmdID);
-        return OLECMDERR_E_NOTSUPPORTED;
+        switch(nCmdID) {
+        case IDM_BROWSEMODE:
+            return exec_browsemode(This);
+        default:
+            FIXME("unsupported nCmdID %ld of CGID_MSHTML group\n", nCmdID);
+            return OLECMDERR_E_NOTSUPPORTED;
+        }
     }
 
     FIXME("Unsupported pguidCmdGroup %s\n", debugstr_guid(pguidCmdGroup));
diff --git a/dlls/mshtml/oleobj.c b/dlls/mshtml/oleobj.c
index c9d8ead..981f65b 100644
--- a/dlls/mshtml/oleobj.c
+++ b/dlls/mshtml/oleobj.c
@@ -76,6 +76,7 @@ static HRESULT WINAPI OleObject_SetClien
     if(This->client) {
         IOleClientSite_Release(This->client);
         This->client = NULL;
+        This->usermode = UNKNOWN_USERMODE;
     }
 
     if(This->hostui) {
@@ -161,7 +162,9 @@ static HRESULT WINAPI OleObject_SetClien
     This->client = pClientSite;
     This->hostui = pDocHostUIHandler;
 
-    IOleControl_OnAmbientPropertyChange(CONTROL(This), DISPID_AMBIENT_USERMODE);
+    if(This->usermode == UNKNOWN_USERMODE)
+        IOleControl_OnAmbientPropertyChange(CONTROL(This), DISPID_AMBIENT_USERMODE);
+
     IOleControl_OnAmbientPropertyChange(CONTROL(This), DISPID_AMBIENT_OFFLINEIFNOTCONNECTED); 
     IOleControl_OnAmbientPropertyChange(CONTROL(This), DISPID_AMBIENT_SILENT);
     IOleControl_OnAmbientPropertyChange(CONTROL(This), DISPID_AMBIENT_USERAGENT);
@@ -571,9 +574,11 @@ static HRESULT WINAPI OleControl_OnAmbie
             return S_OK;
 
         if(V_VT(&res) == VT_BOOL) {
-            if(!V_BOOL(&res)) {
+            if(V_BOOL(&res)) {
+                This->usermode = BROWSEMODE;
+            }else {
                 FIXME("edit mode is not supported\n");
-                hres = E_FAIL;
+                This->usermode = EDITMODE;
             }
         }else {
             FIXME("V_VT(res)=%d\n", V_VT(&res));
@@ -679,6 +684,8 @@ void HTMLDocument_OleObj_Init(HTMLDocume
     This->lpOleDocumentVtbl = &OleDocumentVtbl;
     This->lpOleControlVtbl = &OleControlVtbl;
 
+    This->usermode = UNKNOWN_USERMODE;
+
     This->client = NULL;
     This->hostui = NULL;
 




More information about the wine-cvs mailing list