Jacek Caban : mshtml: Added beginning of set_progress task implementation.

Alexandre Julliard julliard at wine.codeweavers.com
Thu Nov 2 15:47:15 CST 2006


Module: wine
Branch: master
Commit: d6108c6c247121781c8950047039db544dfc683d
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=d6108c6c247121781c8950047039db544dfc683d

Author: Jacek Caban <jacek at codeweavers.com>
Date:   Thu Nov  2 17:34:01 2006 +0100

mshtml: Added beginning of set_progress task implementation.

---

 dlls/mshtml/mshtml_private.h |    3 ++-
 dlls/mshtml/persist.c        |   10 ++++++++++
 dlls/mshtml/task.c           |   40 ++++++++++++++++++++++++++++++++++++++++
 3 files changed, 52 insertions(+), 1 deletions(-)

diff --git a/dlls/mshtml/mshtml_private.h b/dlls/mshtml/mshtml_private.h
index b3ad479..b352c5f 100644
--- a/dlls/mshtml/mshtml_private.h
+++ b/dlls/mshtml/mshtml_private.h
@@ -353,7 +353,8 @@ typedef struct task_t {
 
     enum {
         TASK_SETDOWNLOADSTATE,
-        TASK_PARSECOMPLETE
+        TASK_PARSECOMPLETE,
+        TASK_SETPROGRESS
     } task_id;
 
     struct task_t *next;
diff --git a/dlls/mshtml/persist.c b/dlls/mshtml/persist.c
index 7b35e96..39c3a7e 100644
--- a/dlls/mshtml/persist.c
+++ b/dlls/mshtml/persist.c
@@ -243,6 +243,16 @@ static HRESULT WINAPI PersistMoniker_Loa
 
     bscallback = create_bscallback(pimkName);
 
+    if(This->frame) {
+        task = mshtml_alloc(sizeof(task_t));
+
+        task->doc = This;
+        task->task_id = TASK_SETPROGRESS;
+        task->next = NULL;
+
+        push_task(task);
+    }
+
     task = mshtml_alloc(sizeof(task_t));
 
     task->doc = This;
diff --git a/dlls/mshtml/task.c b/dlls/mshtml/task.c
index 6b5d093..84108d1 100644
--- a/dlls/mshtml/task.c
+++ b/dlls/mshtml/task.c
@@ -179,6 +179,44 @@ static void set_parsecomplete(HTMLDocume
     }
 }
 
+static void set_progress(HTMLDocument *doc)
+{
+    IOleCommandTarget *olecmd = NULL;
+    HRESULT hres;
+
+    TRACE("(%p)\n", doc);
+
+    if(doc->client)
+        IOleClientSite_QueryInterface(doc->client, &IID_IOleCommandTarget, (void**)&olecmd);
+
+    if(olecmd) {
+        VARIANT progress_max, progress;
+
+        V_VT(&progress_max) = VT_I4;
+        V_I4(&progress_max) = 0; /* FIXME */
+        IOleCommandTarget_Exec(olecmd, NULL, OLECMDID_SETPROGRESSMAX, OLECMDEXECOPT_DONTPROMPTUSER,
+                               &progress_max, NULL);
+
+        V_VT(&progress) = VT_I4;
+        V_I4(&progress) = 0; /* FIXME */
+        IOleCommandTarget_Exec(olecmd, NULL, OLECMDID_SETPROGRESSPOS, OLECMDEXECOPT_DONTPROMPTUSER,
+                               &progress, NULL);
+    }
+
+    if(doc->usermode == EDITMODE && doc->hostui) {
+        DOCHOSTUIINFO hostinfo;
+
+        memset(&hostinfo, 0, sizeof(DOCHOSTUIINFO));
+        hostinfo.cbSize = sizeof(DOCHOSTUIINFO);
+        hres = IDocHostUIHandler_GetHostInfo(doc->hostui, &hostinfo);
+        if(SUCCEEDED(hres))
+            /* FIXME: use hostinfo */
+            TRACE("hostinfo = {%u %08x %08x %s %s}\n",
+                    hostinfo.cbSize, hostinfo.dwFlags, hostinfo.dwDoubleClick,
+                    debugstr_w(hostinfo.pchHostCss), debugstr_w(hostinfo.pchHostNS));
+    }
+}
+
 static void process_task(task_t *task)
 {
     switch(task->task_id) {
@@ -186,6 +224,8 @@ static void process_task(task_t *task)
         return set_downloading(task->doc);
     case TASK_PARSECOMPLETE:
         return set_parsecomplete(task->doc);
+    case TASK_SETPROGRESS:
+        return set_progress(task->doc);
     default:
         ERR("Wrong task_id %d\n", task->task_id);
     }




More information about the wine-cvs mailing list