From ee6ba69e446c36e07a4496e70d947181fcddd6ec Mon Sep 17 00:00:00 2001 From: cxl Date: Thu, 14 Jan 2021 13:01:38 +0000 Subject: [PATCH] Ole: some fixes git-svn-id: svn://ultimatepp.org/upp/trunk@15667 f0d560ea-af0d-0410-9eb7-867de7ffcac7 --- uppsrc/Ole/Ctrl/OleCtrl.h | 4 ++-- uppsrc/Ole/Ctrl/control.cpp | 18 +++++++++--------- uppsrc/Ole/util.cpp | 2 +- uppsrc/Ole/util.h | 4 ++-- uppsrc/ide/UppHub.cpp | 9 ++++++--- 5 files changed, 20 insertions(+), 17 deletions(-) diff --git a/uppsrc/Ole/Ctrl/OleCtrl.h b/uppsrc/Ole/Ctrl/OleCtrl.h index 67632c73f..dd5d069de 100644 --- a/uppsrc/Ole/Ctrl/OleCtrl.h +++ b/uppsrc/Ole/Ctrl/OleCtrl.h @@ -618,10 +618,10 @@ public: // IViewObject - STDMETHOD(Draw)(dword aspect, long index, void *aspectinfo, + STDMETHOD(Draw)(DWORD aspect, LONG index, void *aspectinfo, DVTARGETDEVICE *device, HDC target, HDC draw, const RECTL *bounds, const RECTL *wbounds, - BOOL (STDMETHODCALLTYPE *progress)(dword arg), dword arg); + BOOL (STDMETHODCALLTYPE *progress)(ULONG_PTR dwContinue), ULONG_PTR arg); STDMETHOD(GetColorSet)(dword aspect, long index, void *aspectinfo, DVTARGETDEVICE *device, HDC target, LOGPALETTE **palette); STDMETHOD(Freeze)(dword aspect, long index, void *aspectinfo, diff --git a/uppsrc/Ole/Ctrl/control.cpp b/uppsrc/Ole/Ctrl/control.cpp index 1365d3db2..a9f7ffa8d 100644 --- a/uppsrc/Ole/Ctrl/control.cpp +++ b/uppsrc/Ole/Ctrl/control.cpp @@ -527,10 +527,10 @@ HRESULT OcxControl::EnumDAdvise(IEnumSTATDATA **enumerator) return LOGRESULT(E_NOTIMPL); } -HRESULT OcxControl::Draw(dword aspect, long index, void *aspectinfo, - DVTARGETDEVICE *device, HDC target_dc, HDC draw_dc, - const RECTL *bounds, const RECTL *wbounds, - BOOL (STDMETHODCALLTYPE *progress)(dword arg), dword arg) +HRESULT OcxControl::Draw(DWORD aspect, LONG index, void *aspectinfo, + DVTARGETDEVICE *device, HDC target, HDC draw_dc, + const RECTL *bounds, const RECTL *wbounds, + BOOL (STDMETHODCALLTYPE *progress)(ULONG_PTR dwContinue), ULONG_PTR arg) { LOGMETHOD("IViewObject::Draw"); if(aspect != DVASPECT_CONTENT) @@ -743,15 +743,15 @@ HRESULT OcxControl::TranslateAccelerator(MSG *msg) LOGMETHOD("IOleInPlaceObject::TranslateAccelerator"); dword keycode = 0; if(msg->message == WM_KEYDOWN) - keycode = KEYtoK(msg->wParam); + keycode = KEYtoK((dword)msg->wParam); else if(msg->message == WM_KEYUP) - keycode = KEYtoK(msg->wParam) | K_KEYUP; + keycode = KEYtoK((dword)msg->wParam) | K_KEYUP; else if(msg->message == WM_SYSKEYDOWN && (msg->lParam & 0x20000000)) - keycode = KEYtoK(msg->wParam); + keycode = KEYtoK((dword)msg->wParam); else if(msg->message == WM_SYSKEYUP && (msg->lParam & 0x20000000)) - keycode = KEYtoK(msg->wParam) | K_KEYUP; + keycode = KEYtoK((dword)msg->wParam) | K_KEYUP; else if(msg->message == WM_CHAR) - keycode = msg->wParam; + keycode = (dword)msg->wParam; if(keycode == 0 || !IsActive() || !IsEnabled() || !IsVisible()) return LOGRESULT(S_FALSE); diff --git a/uppsrc/Ole/util.cpp b/uppsrc/Ole/util.cpp index ccb4f6784..c9b1a4eff 100644 --- a/uppsrc/Ole/util.cpp +++ b/uppsrc/Ole/util.cpp @@ -19,7 +19,7 @@ GUID GetCoClassGUID(const char *name, bool prog_id) return guid; } -unsigned GetHashValue(const GUID& guid) { +hash_t GetHashValue(const GUID& guid) { const dword *p = reinterpret_cast(&guid); return CombineHash(p[0], p[1], p[2], p[3]); } diff --git a/uppsrc/Ole/util.h b/uppsrc/Ole/util.h index 60bdae7e8..412df8aeb 100644 --- a/uppsrc/Ole/util.h +++ b/uppsrc/Ole/util.h @@ -34,7 +34,7 @@ private: T *ptr; }; -unsigned GetHashValue(const GUID& guid); +hash_t GetHashValue(const GUID& guid); String Format(const GUID& guid); String CFormat(const GUID& guid); inline void Serialize(Stream& stream, GUID& guid) { stream.SerializeRaw((byte *)&guid, sizeof(GUID)); } @@ -74,7 +74,7 @@ private: }; template <> -inline unsigned GetHashValue(const Guid& guid) { return GetHashValue(~guid); } +inline hash_t GetHashValue(const Guid& guid) { return GetHashValue(~guid); } template <> inline String AsString(const GUID& guid) { return Format(guid); } template <> diff --git a/uppsrc/ide/UppHub.cpp b/uppsrc/ide/UppHub.cpp index db7d5c691..ddf3f3852 100644 --- a/uppsrc/ide/UppHub.cpp +++ b/uppsrc/ide/UppHub.cpp @@ -6,6 +6,7 @@ struct UppHubNest : Moveable { int tier = -1; String name; Vector packages; + Vector uses; String description; String repo; String status = "unknown"; @@ -47,6 +48,7 @@ UppHubDlg::UppHubDlg() list.AddIndex("REPO"); list.AddIndex("README"); + list.AddIndex("USES"); list.ColumnWidths("94 72 373 251 119 53"); list.WhenSel = [=] { @@ -139,12 +141,15 @@ void UppHubDlg::Load(int tier, const String& url, bool deep) String list_name = v["name"]; for(Value ns : v["nests"]) { String name = ns["name"]; - UppHubNest& n = upv.GetAdd(ns["name"]); + UppHubNest& n = upv.GetAdd(name); n.name = name; bool tt = tier > n.tier; if(tt || n.packages.GetCount() == 0) for(Value p : ns["packages"]) n.packages.Add(p); + if(tt || n.uses.GetCount() == 0) + for(Value p : ns["uses"]) + n.uses.Add(p); auto Attr = [&](String& a, const char *id) { if(tt || IsNull(a)) a = ns[id]; @@ -234,8 +239,6 @@ void UppHubDlg::Install(bool noprompt) } } - - void UppHubDlg::Uninstall(bool noprompt) { if(list.IsCursor() && (noprompt || PromptYesNo("Uninstall " + ~list.GetKey() + "?"))) {