summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--bin10/lib/mir_core.libbin182140 -> 328086 bytes
-rw-r--r--bin10/lib/mir_core64.libbin179998 -> 329818 bytes
-rw-r--r--bin12/lib/mir_core.libbin182140 -> 328086 bytes
-rw-r--r--bin12/lib/mir_core64.libbin179998 -> 329818 bytes
-rw-r--r--include/delphi/m_core.inc5
-rw-r--r--include/delphi/m_protoint.inc1
-rw-r--r--include/m_core.h24
-rw-r--r--include/m_gui.h (renamed from protocols/JabberG/src/ui_utils.h)469
-rw-r--r--include/m_protoint.h70
-rw-r--r--plugins/TabSRMM/src/msgdlgutils.cpp2
-rw-r--r--protocols/IRCG/IRC_10.vcxproj2
-rw-r--r--protocols/IRCG/IRC_10.vcxproj.filters6
-rw-r--r--protocols/IRCG/IRC_12.vcxproj2
-rw-r--r--protocols/IRCG/IRC_12.vcxproj.filters6
-rw-r--r--protocols/IRCG/src/irc.h1
-rw-r--r--protocols/IRCG/src/irc_dlg.h142
-rw-r--r--protocols/IRCG/src/options.cpp2
-rw-r--r--protocols/IRCG/src/ui_utils.cpp1811
-rw-r--r--protocols/IRCG/src/ui_utils.h1102
-rw-r--r--protocols/JabberG/jabber_10.vcxproj3
-rw-r--r--protocols/JabberG/jabber_10.vcxproj.filters9
-rw-r--r--protocols/JabberG/jabber_12.vcxproj3
-rw-r--r--protocols/JabberG/jabber_12.vcxproj.filters9
-rw-r--r--protocols/JabberG/src/jabber.h28
-rw-r--r--protocols/JabberG/src/jabber_db_utils.h98
-rw-r--r--protocols/JabberG/src/jabber_filterlist.cpp332
-rw-r--r--protocols/JabberG/src/jabber_iqid.cpp10
-rw-r--r--protocols/JabberG/src/jabber_proto.cpp26
-rw-r--r--protocols/JabberG/src/jabber_proto.h5
-rw-r--r--protocols/JabberG/src/jabber_thread.cpp4
-rw-r--r--protocols/JabberG/src/jabber_util.cpp16
-rw-r--r--src/core/miranda.h8
-rw-r--r--src/mir_core/mir_core_10.vcxproj1
-rw-r--r--src/mir_core/mir_core_10.vcxproj.filters3
-rw-r--r--src/mir_core/mir_core_12.vcxproj3
-rw-r--r--src/mir_core/mir_core_12.vcxproj.filters9
-rw-r--r--src/mir_core/src/commonheaders.h5
-rw-r--r--src/mir_core/src/mir_core.def468
-rw-r--r--src/mir_core/src/mir_core64.def468
-rw-r--r--src/mir_core/src/miranda.h4
-rw-r--r--src/mir_core/src/protos.cpp89
-rw-r--r--src/mir_core/src/threads.cpp2
-rw-r--r--src/mir_core/src/ui_utils.cpp (renamed from protocols/JabberG/src/ui_utils.cpp)383
-rw-r--r--src/modules/protocols/protocols.cpp63
-rw-r--r--src/modules/protocols/protoopts.cpp5
45 files changed, 1839 insertions, 3860 deletions
diff --git a/bin10/lib/mir_core.lib b/bin10/lib/mir_core.lib
index 96b214b0fc..1b66d13388 100644
--- a/bin10/lib/mir_core.lib
+++ b/bin10/lib/mir_core.lib
Binary files differ
diff --git a/bin10/lib/mir_core64.lib b/bin10/lib/mir_core64.lib
index e588d21af2..751cc7e5f9 100644
--- a/bin10/lib/mir_core64.lib
+++ b/bin10/lib/mir_core64.lib
Binary files differ
diff --git a/bin12/lib/mir_core.lib b/bin12/lib/mir_core.lib
index a7d7bf6404..bf921fdb39 100644
--- a/bin12/lib/mir_core.lib
+++ b/bin12/lib/mir_core.lib
Binary files differ
diff --git a/bin12/lib/mir_core64.lib b/bin12/lib/mir_core64.lib
index 31255d77a0..8205621e8e 100644
--- a/bin12/lib/mir_core64.lib
+++ b/bin12/lib/mir_core64.lib
Binary files differ
diff --git a/include/delphi/m_core.inc b/include/delphi/m_core.inc
index 8d770fe9b9..6e89a196e2 100644
--- a/include/delphi/m_core.inc
+++ b/include/delphi/m_core.inc
@@ -437,6 +437,11 @@ function ProtoServiceExists(const szModule, szName:PAnsiChar):int; stdcall;
function ProtoCallService(const szModule, szName:PAnsiChar; wParam:WPARAM; lParam:LPARAM):int_ptr; stdcall;
external CoreDLL name 'ProtoServiceExists';
+procedure ProtoWindowAdd(pThis:pointer; wnd:HWND); stdcall;
+ external CoreDLL name 'ProtoWindowAdd';
+
+procedure ProtoWindowRemove(pThis:pointer; wnd:HWND); stdcall;
+ external CoreDLL name 'ProtoWindowRemove';
// Call it in the very beginning of your proto's constructor
procedure ProtoConstructor(pThis:pointer{PPROTO_INTERFACE}; const pszModuleName:PAnsiChar;
diff --git a/include/delphi/m_protoint.inc b/include/delphi/m_protoint.inc
index 1c1fce8af1..716c52f85b 100644
--- a/include/delphi/m_protoint.inc
+++ b/include/delphi/m_protoint.inc
@@ -51,6 +51,7 @@ type
szModuleName :PAnsiChar;
hProtoIcon :THANDLE;
hNetlibUser :THANDLE;
+ hWindowList :THANDLE;
//////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////
// Virtual functions
diff --git a/include/m_core.h b/include/m_core.h
index 78b33606b2..4b8eb0a824 100644
--- a/include/m_core.h
+++ b/include/m_core.h
@@ -368,34 +368,38 @@ MIR_CORE_DLL(int) mir_vsnwprintf(wchar_t *buffer, size_t count, const wchar_t
///////////////////////////////////////////////////////////////////////////////
// protocol functions
+struct PROTO_INTERFACE;
+
MIR_CORE_DLL(INT_PTR) ProtoCallService(LPCSTR szModule, const char *szService, WPARAM wParam, LPARAM lParam);
MIR_CORE_DLL(int) ProtoServiceExists(LPCSTR szModule, const char *szService);
MIR_CORE_DLL(INT_PTR) ProtoBroadcastAck(LPCSTR szModule, MCONTACT hContact, int type, int result, HANDLE hProcess, LPARAM lParam);
// Call it in the very beginning of your proto's constructor
-MIR_CORE_DLL(void) ProtoConstructor(struct PROTO_INTERFACE *pThis, const char *pszModuleName, const TCHAR *ptszUserName);
+MIR_CORE_DLL(void) ProtoConstructor(PROTO_INTERFACE *pThis, const char *pszModuleName, const TCHAR *ptszUserName);
// Call it in the very end of your proto's destructor
-MIR_CORE_DLL(void) ProtoDestructor(struct PROTO_INTERFACE *pThis);
+MIR_CORE_DLL(void) ProtoDestructor(PROTO_INTERFACE *pThis);
#if defined( __cplusplus )
typedef void (__cdecl PROTO_INTERFACE::*ProtoThreadFunc)(void*);
-MIR_CORE_DLL(void) ProtoForkThread(struct PROTO_INTERFACE *pThis, ProtoThreadFunc, void *param);
-MIR_CORE_DLL(HANDLE) ProtoForkThreadEx(struct PROTO_INTERFACE *pThis, ProtoThreadFunc, void *param, UINT* threadID);
+MIR_CORE_DLL(void) ProtoForkThread(PROTO_INTERFACE *pThis, ProtoThreadFunc, void *param);
+MIR_CORE_DLL(HANDLE) ProtoForkThreadEx(PROTO_INTERFACE *pThis, ProtoThreadFunc, void *param, UINT* threadID);
+MIR_CORE_DLL(void) ProtoWindowAdd(PROTO_INTERFACE *pThis, HWND hwnd);
+MIR_CORE_DLL(void) ProtoWindowRemove(PROTO_INTERFACE *pThis, HWND hwnd);
typedef int (__cdecl PROTO_INTERFACE::*ProtoEventFunc)(WPARAM, LPARAM);
-MIR_CORE_DLL(void) ProtoHookEvent(struct PROTO_INTERFACE *pThis, const char* szName, ProtoEventFunc pFunc);
-MIR_CORE_DLL(HANDLE) ProtoCreateHookableEvent(struct PROTO_INTERFACE *pThis, const char* szService);
+MIR_CORE_DLL(void) ProtoHookEvent(PROTO_INTERFACE *pThis, const char* szName, ProtoEventFunc pFunc);
+MIR_CORE_DLL(HANDLE) ProtoCreateHookableEvent(PROTO_INTERFACE *pThis, const char* szService);
typedef INT_PTR (__cdecl PROTO_INTERFACE::*ProtoServiceFunc)(WPARAM, LPARAM);
-MIR_CORE_DLL(void) ProtoCreateService(struct PROTO_INTERFACE *pThis, const char* szService, ProtoServiceFunc);
+MIR_CORE_DLL(void) ProtoCreateService(PROTO_INTERFACE *pThis, const char* szService, ProtoServiceFunc);
typedef INT_PTR (__cdecl PROTO_INTERFACE::*ProtoServiceFuncParam)(WPARAM, LPARAM, LPARAM);
-MIR_CORE_DLL(void) ProtoCreateServiceParam(struct PROTO_INTERFACE *pThis, const char* szService, ProtoServiceFuncParam, LPARAM);
+MIR_CORE_DLL(void) ProtoCreateServiceParam(PROTO_INTERFACE *pThis, const char* szService, ProtoServiceFuncParam, LPARAM);
#endif
-MIR_CORE_DLL(void) ProtoLogA(struct PROTO_INTERFACE *pThis, LPCSTR szFormat, va_list args);
-MIR_CORE_DLL(void) ProtoLogW(struct PROTO_INTERFACE *pThis, LPCWSTR wszFormat, va_list args);
+MIR_CORE_DLL(void) ProtoLogA(PROTO_INTERFACE *pThis, LPCSTR szFormat, va_list args);
+MIR_CORE_DLL(void) ProtoLogW(PROTO_INTERFACE *pThis, LPCWSTR wszFormat, va_list args);
// avatar support functions
diff --git a/protocols/JabberG/src/ui_utils.h b/include/m_gui.h
index 174eab7dfe..a2e238d9c1 100644
--- a/protocols/JabberG/src/ui_utils.h
+++ b/include/m_gui.h
@@ -24,100 +24,119 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
-#ifndef __jabber_ui_utils_h__
-#define __jabber_ui_utils_h__
+#pragma once
-#pragma warning(disable:4355)
+#ifndef __M_GUI_H
+#define __M_GUI_H
-#ifndef LPLVCOLUMN
-typedef struct tagNMLVSCROLL
-{
- NMHDR hdr;
- int dx;
- int dy;
-} NMLVSCROLL;
-typedef struct tagLVG
-{
- UINT cbSize;
- UINT mask;
- LPWSTR pszHeader;
- int cchHeader;
- LPWSTR pszFooter;
- int cchFooter;
- int iGroupId;
- UINT stateMask;
- UINT state;
- UINT uAlign;
-} LVGROUP, *PLVGROUP;
-typedef struct tagLVGROUPMETRICS
+#include <m_protoint.h>
+#include <m_clc.h>
+
+#pragma warning(disable:4355 4251)
+
+/////////////////////////////////////////////////////////////////////////////////////////
+// helpers for the option's visualization
+
+template<typename Int> struct CMIntTraits { static __forceinline bool IsSigned() { return false; } };
+template<> struct CMIntTraits<signed char> { static __forceinline bool IsSigned() { return true; } };
+template<> struct CMIntTraits<signed short> { static __forceinline bool IsSigned() { return true; } };
+template<> struct CMIntTraits<signed long> { static __forceinline bool IsSigned() { return true; } };
+
+template<int Size>
+struct CMDBTraits
{
- UINT cbSize;
- UINT mask;
- UINT Left;
- UINT Top;
- UINT Right;
- UINT Bottom;
- COLORREF crLeft;
- COLORREF crTop;
- COLORREF crRight;
- COLORREF crBottom;
- COLORREF crHeader;
- COLORREF crFooter;
-} LVGROUPMETRICS, *PLVGROUPMETRICS;
-typedef struct tagLVTILEVIEWINFO
+};
+
+template<>
+struct CMDBTraits<1>
{
- UINT cbSize;
- DWORD dwMask;
- DWORD dwFlags;
- SIZE sizeTile;
- int cLines;
- RECT rcLabelMargin;
-} LVTILEVIEWINFO, *PLVTILEVIEWINFO;
-typedef struct tagLVTILEINFO
+ typedef BYTE DBType;
+ enum { DBTypeId = DBVT_BYTE };
+ static __forceinline DBType Get(PROTO_INTERFACE *pPro, char *szSetting, DBType value)
+ {
+ return pPro->getByte(szSetting, value);
+ }
+ static __forceinline void Set(PROTO_INTERFACE *pPro, char *szSetting, DBType value)
+ {
+ pPro->setByte(szSetting, value);
+ }
+};
+
+template<>
+struct CMDBTraits<2>
{
- UINT cbSize;
- int iItem;
- UINT cColumns;
- PUINT puColumns;
-} LVTILEINFO, *PLVTILEINFO;
-typedef struct
+ typedef WORD DBType;
+ enum { DBTypeId = DBVT_WORD };
+ static __forceinline DBType Get(PROTO_INTERFACE *pPro, char *szSetting, DBType value)
+ {
+ pPro->getWord(szSetting, value);
+ }
+ static __forceinline void Set(PROTO_INTERFACE *pPro, char *szSetting, DBType value)
+ {
+ pPro->setWord(szSetting, value);
+ }
+};
+
+template<>
+struct CMDBTraits<4>
{
- UINT cbSize;
- DWORD dwFlags;
- int iItem;
- DWORD dwReserved;
-} LVINSERTMARK, * LPLVINSERTMARK;
-typedef int (CALLBACK *PFNLVGROUPCOMPARE)(int, int, void *);
-typedef struct tagLVINSERTGROUPSORTED
+ typedef DWORD DBType;
+ enum { DBTypeId = DBVT_DWORD };
+ static __forceinline DBType Get(PROTO_INTERFACE *pPro, char *szSetting, DBType value)
+ {
+ return pPro->getDword(szSetting, value);
+ }
+ static __forceinline void Set(PROTO_INTERFACE *pPro, char *szSetting, DBType value)
+ {
+ pPro->setDword(szSetting, value);
+ }
+};
+
+class CMOptionBase
{
- PFNLVGROUPCOMPARE pfnGroupCompare;
- void *pvData;
- LVGROUP lvGroup;
-} LVINSERTGROUPSORTED, *PLVINSERTGROUPSORTED;
-typedef struct tagLVSETINFOTIP
+public:
+ __forceinline char* GetDBModuleName() const { return m_proto->m_szModuleName; }
+ __forceinline char* GetDBSettingName() const { return m_szSetting; }
+
+protected:
+ __forceinline CMOptionBase(PROTO_INTERFACE *proto, char *szSetting) :
+ m_proto(proto), m_szSetting(szSetting)
+ {}
+
+ PROTO_INTERFACE *m_proto;
+ char *m_szSetting;
+
+private:
+ CMOptionBase(const CMOptionBase &) {}
+ void operator= (const CMOptionBase &) {}
+};
+
+template<class T>
+class CMOption : public CMOptionBase
{
- UINT cbSize;
- DWORD dwFlags;
- LPWSTR pszText;
- int iItem;
- int iSubItem;
-} LVSETINFOTIP, *PLVSETINFOTIP;
-#define LPLVCOLUMN LPLVCOLUMNA
-#define LPLVITEM LPLVITEMA
-#define LVN_BEGINSCROLL (LVN_FIRST-80)
-#define LVN_ENDSCROLL (LVN_FIRST-81)
-#define LVN_HOTTRACK (LVN_FIRST-21)
-#define LVN_MARQUEEBEGIN (LVN_FIRST-56)
-#define LVM_MAPINDEXTOID (LVM_FIRST + 180)
-#define LVGF_HEADER 0x00000001
-#define LVGF_GROUPID 0x00000010
-#define ListView_MapIndexToID(hwnd, index) \
- (UINT)SendMessage((hwnd), LVM_MAPINDEXTOID, (WPARAM)index, 0)
-#define TreeView_GetLineColor(hwnd) \
- (COLORREF)SendMessage((hwnd), TVM_GETLINECOLOR, 0, 0)
-#define TreeView_SetLineColor(hwnd, clr) \
- (COLORREF)SendMessage((hwnd), TVM_SETLINECOLOR, 0, (LPARAM)(clr))
-#endif
+public:
+ typedef T Type;
+
+ __forceinline CMOption(PROTO_INTERFACE *proto, char *szSetting, Type defValue) :
+ CMOptionBase(proto, szSetting), m_default(defValue)
+ {}
+
+ __forceinline operator Type()
+ {
+ return (Type)CMDBTraits<sizeof(Type)>::Get(m_proto, m_szSetting, m_default);
+ }
+ __forceinline Type operator= (Type value)
+ {
+ CMDBTraits<sizeof(Type)>::Set(m_proto, m_szSetting, (CMDBTraits<sizeof(Type)>::DBType)value);
+ return value;
+ }
+
+private:
+ Type m_default;
+
+ CMOption(const CMOption &) : CMOptionBase(NULL, NULL, DBVT_DELETED) {}
+ void operator= (const CMOption &) {}
+};
/////////////////////////////////////////////////////////////////////////////////////////
// Callbacks
@@ -177,14 +196,14 @@ __inline CCallback<TArgument> Callback(TClass *object, void (TClass::*func)(TArg
/////////////////////////////////////////////////////////////////////////////////////////
// CDbLink
-class CDataLink
+class MIR_CORE_EXPORT CDataLink
{
protected:
BYTE m_type;
bool m_bSigned;
public:
- CDataLink(BYTE type, bool bSigned): m_type(type), m_bSigned(bSigned) {}
+ __inline CDataLink(BYTE type, bool bSigned) : m_type(type), m_bSigned(bSigned) {}
virtual ~CDataLink() {}
__inline BYTE GetDataType() { return m_type; }
@@ -198,7 +217,7 @@ public:
virtual void SaveText(TCHAR *value) = 0;
};
-class CDbLink: public CDataLink
+class MIR_CORE_EXPORT CDbLink : public CDataLink
{
char *m_szModule;
char *m_szSetting;
@@ -223,32 +242,34 @@ public:
};
template<class T>
-class CMOptionLink: public CDataLink
+class CMOptionLink : public CDataLink
{
private:
CMOption<T> *m_option;
public:
- CMOptionLink(CMOption<T> &option): CDataLink(CMDBTraits<sizeof(T)>::DBTypeId, CMIntTraits<T>::IsSigned()), m_option(&option) {}
+ __forceinline CMOptionLink(CMOption<T> &option) :
+ CDataLink(CMDBTraits<sizeof(T)>::DBTypeId, CMIntTraits<T>::IsSigned()), m_option(&option)
+ {}
- DWORD LoadUnsigned() { return (DWORD)(T)*m_option; }
- int LoadSigned() { return (int)(T)*m_option; }
- void SaveInt(DWORD value) { *m_option = (T)value; }
+ __forceinline DWORD LoadUnsigned() { return (DWORD)(T)*m_option; }
+ __forceinline int LoadSigned() { return (int)(T)*m_option; }
+ __forceinline void SaveInt(DWORD value) { *m_option = (T)value; }
- TCHAR *LoadText() { return NULL; }
- void SaveText(TCHAR*) {}
+ __forceinline TCHAR *LoadText() { return NULL; }
+ __forceinline void SaveText(TCHAR*) {}
};
/////////////////////////////////////////////////////////////////////////////////////////
// CDlgBase - base dialog class
-class CDlgBase
+class MIR_CORE_EXPORT CDlgBase
{
friend class CCtrlBase;
friend class CCtrlData;
public:
- CDlgBase(int idDialog, HWND hwndParent);
+ CDlgBase(HINSTANCE hInst, int idDialog, HWND hwndParent);
virtual ~CDlgBase();
// general utilities
@@ -283,13 +304,14 @@ public:
LRESULT m_lresult;
protected:
- HWND m_hwnd;
- HWND m_hwndParent;
- int m_idDialog;
- MSG m_msg;
- bool m_isModal;
- bool m_initialized;
- bool m_forceResizable;
+ HINSTANCE m_hInst;
+ HWND m_hwnd;
+ HWND m_hwndParent;
+ int m_idDialog;
+ MSG m_msg;
+ bool m_isModal;
+ bool m_initialized;
+ bool m_forceResizable;
enum { CLOSE_ON_OK = 0x1, CLOSE_ON_CANCEL = 0x2 };
BYTE m_autoClose; // automatically close dialog on IDOK/CANCEL commands. default: CLOSE_ON_OK|CLOSE_ON_CANCEL
@@ -330,7 +352,7 @@ private:
/////////////////////////////////////////////////////////////////////////////////////////
// CCtrlBase
-class CCtrlBase
+class MIR_CORE_EXPORT CCtrlBase
{
friend class CDlgBase;
@@ -338,11 +360,12 @@ public:
CCtrlBase(CDlgBase *wnd, int idCtrl);
virtual ~CCtrlBase() { Unsubclass(); }
- __inline HWND GetHwnd() const { return m_hwnd; }
- __inline CDlgBase *GetParent() { return m_parentWnd; }
+ __forceinline HWND GetHwnd() const { return m_hwnd; }
+ __forceinline int GetCtrlId() const { return m_idCtrl; }
+ __forceinline CDlgBase *GetParent() { return m_parentWnd; }
void Enable(int bIsEnable = true);
- __inline void Disable() { Enable(false); }
+ __forceinline void Disable() { Enable(false); }
BOOL Enabled(void) const;
LRESULT SendMsg(UINT Msg, WPARAM wParam, LPARAM lParam);
@@ -404,7 +427,7 @@ private:
/////////////////////////////////////////////////////////////////////////////////////////
// CCtrlButton
-class CCtrlButton : public CCtrlBase
+class MIR_CORE_EXPORT CCtrlButton : public CCtrlBase
{
typedef CCtrlBase CSuper;
@@ -416,7 +439,7 @@ public:
CCallback<CCtrlButton> OnClick;
};
-class CCtrlMButton : public CCtrlButton
+class MIR_CORE_EXPORT CCtrlMButton : public CCtrlButton
{
typedef CCtrlButton CSuper;
@@ -436,7 +459,7 @@ protected:
const char* m_toolTip;
};
-class CCtrlHyperlink : public CCtrlBase
+class MIR_CORE_EXPORT CCtrlHyperlink : public CCtrlBase
{
typedef CCtrlBase CSuper;
@@ -451,7 +474,7 @@ protected:
/////////////////////////////////////////////////////////////////////////////////////////
// CCtrlClc
-class CCtrlClc: public CCtrlBase
+class MIR_CORE_EXPORT CCtrlClc : public CCtrlBase
{
typedef CCtrlBase CSuper;
@@ -507,8 +530,8 @@ public:
struct TEventInfo
{
- CCtrlClc *ctrl;
- NMCLISTCONTROL *info;
+ CCtrlClc *ctrl;
+ NMCLISTCONTROL *info;
};
CCallback<TEventInfo> OnExpanded;
@@ -531,7 +554,7 @@ protected:
/////////////////////////////////////////////////////////////////////////////////////////
// CCtrlData - data access controls base class
-class CCtrlData : public CCtrlBase
+class MIR_CORE_EXPORT CCtrlData : public CCtrlBase
{
typedef CCtrlBase CSuper;
@@ -572,7 +595,7 @@ protected:
/////////////////////////////////////////////////////////////////////////////////////////
// CCtrlCheck
-class CCtrlCheck : public CCtrlData
+class MIR_CORE_EXPORT CCtrlCheck : public CCtrlData
{
typedef CCtrlData CSuper;
@@ -600,7 +623,7 @@ public:
/////////////////////////////////////////////////////////////////////////////////////////
// CCtrlEdit
-class CCtrlEdit : public CCtrlData
+class MIR_CORE_EXPORT CCtrlEdit : public CCtrlData
{
typedef CCtrlData CSuper;
@@ -643,7 +666,7 @@ public:
/////////////////////////////////////////////////////////////////////////////////////////
// CCtrlListBox
-class CCtrlListBox : public CCtrlBase
+class MIR_CORE_EXPORT CCtrlListBox : public CCtrlBase
{
typedef CCtrlBase CSuper;
@@ -681,7 +704,7 @@ protected:
/////////////////////////////////////////////////////////////////////////////////////////
// CCtrlCombo
-class CCtrlCombo : public CCtrlData
+class MIR_CORE_EXPORT CCtrlCombo : public CCtrlData
{
typedef CCtrlData CSuper;
@@ -759,7 +782,7 @@ public:
/////////////////////////////////////////////////////////////////////////////////////////
// CCtrlListView
-class CCtrlListView : public CCtrlBase
+class MIR_CORE_EXPORT CCtrlListView : public CCtrlBase
{
typedef CCtrlBase CSuper;
@@ -954,32 +977,13 @@ protected:
BOOL OnNotify(int idCtrl, NMHDR *pnmh);
};
-struct CFilterData;
-class CCtrlFilterListView : public CCtrlListView
-{
- typedef CCtrlListView CSuper;
-
-public:
- CCtrlFilterListView(CDlgBase* dlg, int ctrlId, bool trackFilter, bool keepHiglight);
- ~CCtrlFilterListView();
-
- TCHAR *GetFilterText();
- CCallback<CCtrlFilterListView> OnFilterChanged;
-
-protected:
- CFilterData *fdat;
- bool m_trackFilter;
- bool m_keepHiglight;
-
- void OnInit();
- LRESULT CustomWndProc(UINT msg, WPARAM wParam, LPARAM lParam);
- void FilterHighlight(TCHAR *filter);
-};
-
/////////////////////////////////////////////////////////////////////////////////////////
// CCtrlTreeView
-class CCtrlTreeView : public CCtrlBase
+#undef GetNextSibling
+#undef GetPrevSibling
+
+class MIR_CORE_EXPORT CCtrlTreeView : public CCtrlBase
{
typedef CCtrlBase CSuper;
@@ -988,72 +992,70 @@ public:
// Classic TV interface
HIMAGELIST CreateDragImage(HTREEITEM hItem);
- void DeleteAllItems();
- void DeleteItem(HTREEITEM hItem);
- HWND EditLabel(HTREEITEM hItem);
- void EndEditLabelNow(BOOL cancel);
- void EnsureVisible(HTREEITEM hItem);
- void Expand(HTREEITEM hItem, DWORD flag);
- COLORREF GetBkColor();
- DWORD GetCheckState(HTREEITEM hItem);
- HTREEITEM GetChild(HTREEITEM hItem);
- int GetCount();
- HTREEITEM GetDropHilight();
- HWND GetEditControl();
- HTREEITEM GetFirstVisible();
+ void DeleteAllItems();
+ void DeleteItem(HTREEITEM hItem);
+ HWND EditLabel(HTREEITEM hItem);
+ void EndEditLabelNow(BOOL cancel);
+ void EnsureVisible(HTREEITEM hItem);
+ void Expand(HTREEITEM hItem, DWORD flag);
+ COLORREF GetBkColor();
+ DWORD GetCheckState(HTREEITEM hItem);
+ HTREEITEM GetChild(HTREEITEM hItem);
+ int GetCount();
+ HTREEITEM GetDropHilight();
+ HWND GetEditControl();
+ HTREEITEM GetFirstVisible();
HIMAGELIST GetImageList(int iImage);
- int GetIndent();
- COLORREF GetInsertMarkColor();
- void GetItem(TVITEMEX *tvi);
- int GetItemHeight();
- void GetItemRect(HTREEITEM hItem, RECT *rcItem, BOOL fItemRect);
- DWORD GetItemState(HTREEITEM hItem, DWORD stateMask);
- HTREEITEM GetLastVisible();
- COLORREF GetLineColor();
- HTREEITEM GetNextItem(HTREEITEM hItem, DWORD flag);
- HTREEITEM GetNextSibling(HTREEITEM hItem);
- HTREEITEM GetNextVisible(HTREEITEM hItem);
- HTREEITEM GetParent(HTREEITEM hItem);
- HTREEITEM GetPrevSibling(HTREEITEM hItem);
- HTREEITEM GetPrevVisible(HTREEITEM hItem);
- HTREEITEM GetRoot();
- DWORD GetScrollTime();
- HTREEITEM GetSelection();
- COLORREF GetTextColor();
- HWND GetToolTips();
- BOOL GetUnicodeFormat();
- unsigned GetVisibleCount();
- HTREEITEM HitTest(TVHITTESTINFO *hti);
- HTREEITEM InsertItem(TVINSERTSTRUCT *tvis);
- //HTREEITEM MapAccIDToHTREEITEM(UINT id);
- //UINT MapHTREEITEMtoAccID(HTREEITEM hItem);
- void Select(HTREEITEM hItem, DWORD flag);
- void SelectDropTarget(HTREEITEM hItem);
- void SelectItem(HTREEITEM hItem);
- void SelectSetFirstVisible(HTREEITEM hItem);
- COLORREF SetBkColor(COLORREF clBack);
- void SetCheckState(HTREEITEM hItem, DWORD state);
- void SetImageList(HIMAGELIST hIml, int iImage);
- void SetIndent(int iIndent);
- void SetInsertMark(HTREEITEM hItem, BOOL fAfter);
- COLORREF SetInsertMarkColor(COLORREF clMark);
- void SetItem(TVITEMEX *tvi);
- void SetItemHeight(short cyItem);
- void SetItemState(HTREEITEM hItem, DWORD state, DWORD stateMask);
- COLORREF SetLineColor(COLORREF clLine);
- void SetScrollTime(UINT uMaxScrollTime);
- COLORREF SetTextColor(COLORREF clText);
- HWND SetToolTips(HWND hwndToolTips);
- BOOL SetUnicodeFormat(BOOL fUnicode);
- void SortChildren(HTREEITEM hItem, BOOL fRecurse);
- void SortChildrenCB(TVSORTCB *cb, BOOL fRecurse);
+ int GetIndent();
+ COLORREF GetInsertMarkColor();
+ void GetItem(TVITEMEX *tvi);
+ int GetItemHeight();
+ void GetItemRect(HTREEITEM hItem, RECT *rcItem, BOOL fItemRect);
+ DWORD GetItemState(HTREEITEM hItem, DWORD stateMask);
+ HTREEITEM GetLastVisible();
+ COLORREF GetLineColor();
+ HTREEITEM GetNextItem(HTREEITEM hItem, DWORD flag);
+ HTREEITEM GetNextSibling(HTREEITEM hItem);
+ HTREEITEM GetNextVisible(HTREEITEM hItem);
+ HTREEITEM GetParent(HTREEITEM hItem);
+ HTREEITEM GetPrevSibling(HTREEITEM hItem);
+ HTREEITEM GetPrevVisible(HTREEITEM hItem);
+ HTREEITEM GetRoot();
+ DWORD GetScrollTime();
+ HTREEITEM GetSelection();
+ COLORREF GetTextColor();
+ HWND GetToolTips();
+ BOOL GetUnicodeFormat();
+ unsigned GetVisibleCount();
+ HTREEITEM HitTest(TVHITTESTINFO *hti);
+ HTREEITEM InsertItem(TVINSERTSTRUCT *tvis);
+ void Select(HTREEITEM hItem, DWORD flag);
+ void SelectDropTarget(HTREEITEM hItem);
+ void SelectItem(HTREEITEM hItem);
+ void SelectSetFirstVisible(HTREEITEM hItem);
+ COLORREF SetBkColor(COLORREF clBack);
+ void SetCheckState(HTREEITEM hItem, DWORD state);
+ void SetImageList(HIMAGELIST hIml, int iImage);
+ void SetIndent(int iIndent);
+ void SetInsertMark(HTREEITEM hItem, BOOL fAfter);
+ COLORREF SetInsertMarkColor(COLORREF clMark);
+ void SetItem(TVITEMEX *tvi);
+ void SetItemHeight(short cyItem);
+ void SetItemState(HTREEITEM hItem, DWORD state, DWORD stateMask);
+ COLORREF SetLineColor(COLORREF clLine);
+ void SetScrollTime(UINT uMaxScrollTime);
+ COLORREF SetTextColor(COLORREF clText);
+ HWND SetToolTips(HWND hwndToolTips);
+ BOOL SetUnicodeFormat(BOOL fUnicode);
+ void SortChildren(HTREEITEM hItem, BOOL fRecurse);
+ void SortChildrenCB(TVSORTCB *cb, BOOL fRecurse);
// Additional stuff
- void TranslateItem(HTREEITEM hItem);
- void TranslateTree();
- HTREEITEM FindNamedItem(HTREEITEM hItem, const TCHAR *name);
- void GetItem(HTREEITEM hItem, TVITEMEX *tvi);
- void GetItem(HTREEITEM hItem, TVITEMEX *tvi, TCHAR *szText, int iTextLength);
+ void TranslateItem(HTREEITEM hItem);
+ void TranslateTree();
+ HTREEITEM FindNamedItem(HTREEITEM hItem, const TCHAR *name);
+ void GetItem(HTREEITEM hItem, TVITEMEX *tvi);
+ void GetItem(HTREEITEM hItem, TVITEMEX *tvi, TCHAR *szText, int iTextLength);
// Events
struct TEventInfo {
@@ -1089,7 +1091,7 @@ protected:
/////////////////////////////////////////////////////////////////////////////////////////
// CCtrlTreeView
-class CCtrlPages: public CCtrlBase
+class MIR_CORE_EXPORT CCtrlPages : public CCtrlBase
{
typedef CCtrlBase CSuper;
@@ -1127,7 +1129,7 @@ private:
// CCtrlCustom
template<typename TDlg>
-class CCtrlCustom : public CCtrlBase
+class MIR_CORE_EXPORT CCtrlCustom : public CCtrlBase
{
typedef CCtrlBase CSuper;
@@ -1211,27 +1213,15 @@ public:
struct PROTO_INTERFACE;
-class CProtoIntDlgBase : public CDlgBase
+class MIR_CORE_EXPORT CProtoIntDlgBase : public CDlgBase
{
typedef CDlgBase CSuper;
public:
- __inline CProtoIntDlgBase(PROTO_INTERFACE *proto, int idDialog, HWND parent, bool show_label=true) :
- CDlgBase(idDialog, parent),
- m_proto_interface(proto),
- m_show_label(show_label),
- m_hwndStatus(NULL)
- {
- }
+ CProtoIntDlgBase(PROTO_INTERFACE *proto, int idDialog, HWND parent, bool show_label = true);
- __inline void CreateLink(CCtrlData& ctrl, char *szSetting, BYTE type, DWORD iValue, bool bSigned = false)
- {
- ctrl.CreateDbLink(m_proto_interface->m_szModuleName, szSetting, type, iValue, bSigned);
- }
- __inline void CreateLink(CCtrlData& ctrl, const char *szSetting, TCHAR *szValue)
- {
- ctrl.CreateDbLink(m_proto_interface->m_szModuleName, szSetting, szValue);
- }
+ void CreateLink(CCtrlData& ctrl, char *szSetting, BYTE type, DWORD iValue, bool bSigned = false);
+ void CreateLink(CCtrlData& ctrl, const char *szSetting, TCHAR *szValue);
template<class T>
__inline void CreateLink(CCtrlData& ctrl, CMOption<T> &option)
@@ -1250,9 +1240,9 @@ protected:
INT_PTR DlgProc(UINT msg, WPARAM wParam, LPARAM lParam);
- virtual void OnProtoRefresh(WPARAM, LPARAM) {}
- virtual void OnProtoActivate(WPARAM, LPARAM) {}
- virtual void OnProtoCheckOnline(WPARAM, LPARAM) {}
+ virtual void OnProtoRefresh(WPARAM, LPARAM);
+ virtual void OnProtoActivate(WPARAM, LPARAM);
+ virtual void OnProtoCheckOnline(WPARAM, LPARAM);
private:
void UpdateProtoTitle(const TCHAR *szText = NULL);
@@ -1275,22 +1265,6 @@ public:
protected:
TProto* m_proto;
-
- INT_PTR DlgProc(UINT msg, WPARAM wParam, LPARAM lParam)
- {
- switch (msg)
- {
- case WM_INITDIALOG:
- m_proto->WindowSubscribe(m_hwnd);
- break;
- case WM_DESTROY:
- WindowFreeIcon(m_hwnd);
- m_proto->WindowUnsubscribe(m_hwnd);
- break;
- }
-
- return CSuper::DlgProc(msg, wParam, lParam);
- }
};
/////////////////////////////////////////////////////////////////////////////////////////
@@ -1383,9 +1357,4 @@ protected:
return CMessageMapSuperClass::DlgProc(msg, wParam, lParam); \
}
-/////////////////////////////////////////////////////////////////////////////////////////
-// Misc utitlities
-int UIEmulateBtnClick(HWND hwndDlg, UINT idcButton);
-void UIShowControls(HWND hwndDlg, int *idList, int nCmdShow);
-
-#endif // __jabber_ui_utils_h__
+#endif // __M_GUI_H
diff --git a/include/m_protoint.h b/include/m_protoint.h
index 763b9d48ac..de6a4ceff2 100644
--- a/include/m_protoint.h
+++ b/include/m_protoint.h
@@ -48,14 +48,15 @@ typedef enum
struct MIR_CORE_EXPORT PROTO_INTERFACE : public MZeroedObject
{
- int m_iStatus,
- m_iDesiredStatus,
- m_iXStatus,
- m_iVersion; // version 2 or higher designate support of Unicode services
- TCHAR* m_tszUserName;
- char* m_szModuleName;
- HANDLE m_hProtoIcon;
- HANDLE m_hNetlibUser;
+ int m_iStatus, // current protocol status
+ m_iDesiredStatus, // status to be set after logging in
+ m_iXStatus, // extanded status
+ m_iVersion; // version 2 or higher designate support of Unicode services
+ TCHAR* m_tszUserName; // human readable protocol's name
+ char* m_szModuleName; // internal protocol name, also its database module name
+ HANDLE m_hProtoIcon; // icon to be displayed in the account manager
+ HANDLE m_hNetlibUser; // network agent
+ HANDLE m_hWindowList; // list of all windows which belong to this protocol's instance
//////////////////////////////////////////////////////////////////////////////////////
// Helpers
@@ -73,6 +74,11 @@ struct MIR_CORE_EXPORT PROTO_INTERFACE : public MZeroedObject
ProtoLogW(this, wszFormat, args);
}
+ __forceinline void WindowSubscribe(HWND hwnd) {
+ ::ProtoWindowAdd(this, hwnd); }
+ __forceinline void WindowUnsubscribe(HWND hwnd) {
+ ::ProtoWindowRemove(this, hwnd); }
+
__forceinline INT_PTR ProtoBroadcastAck(MCONTACT hContact, int type, int hResult, HANDLE hProcess, LPARAM lParam) {
return ::ProtoBroadcastAck(m_szModuleName, hContact, type, hResult, hProcess, lParam); }
@@ -198,39 +204,33 @@ struct MIR_CORE_EXPORT PROTO_INTERFACE : public MZeroedObject
/////////////////////////////////////////////////////////////////////////////////////////
// Basic class for all protocols written in C++
-template<class T> class PROTO : public PROTO_INTERFACE
+template<class T> struct PROTO : public PROTO_INTERFACE
{
+ __forceinline PROTO(const char *szProto, const TCHAR *tszUserName) {
+ ::ProtoConstructor(this, szProto, tszUserName); }
-public:
- __forceinline PROTO(const char *szProto, const TCHAR *tszUserName)
- {
- ::ProtoConstructor(this, szProto, tszUserName);
- }
-
- __forceinline ~PROTO()
- {
- ::ProtoDestructor(this);
- }
+ __forceinline ~PROTO() {
+ ::ProtoDestructor(this); }
- __forceinline HANDLE CreateProtoEvent(const char *name)
- { return ::ProtoCreateHookableEvent(this, name); }
+ __forceinline HANDLE CreateProtoEvent(const char *name) {
+ return ::ProtoCreateHookableEvent(this, name); }
- typedef int (__cdecl T::*MyEventFunc)(WPARAM, LPARAM);
- __forceinline void HookProtoEvent(const char *name, MyEventFunc pFunc)
- { ::ProtoHookEvent(this, name, (ProtoEventFunc)pFunc); }
+ typedef int(__cdecl T::*MyEventFunc)(WPARAM, LPARAM);
+ __forceinline void HookProtoEvent(const char *name, MyEventFunc pFunc) {
+ ::ProtoHookEvent(this, name, (ProtoEventFunc)pFunc); }
- typedef void (__cdecl T::*MyThreadFunc)(void*);
- __forceinline void ForkThread(MyThreadFunc pFunc, void *param)
- { ::ProtoForkThread(this, (ProtoThreadFunc)pFunc, param); }
- HANDLE __forceinline ForkThreadEx(MyThreadFunc pFunc, void *param, UINT *pThreadId)
- { return ::ProtoForkThreadEx(this, (ProtoThreadFunc)pFunc, param, pThreadId); }
+ typedef void(__cdecl T::*MyThreadFunc)(void*);
+ __forceinline void ForkThread(MyThreadFunc pFunc, void *param) {
+ ::ProtoForkThread(this, (ProtoThreadFunc)pFunc, param); }
+ HANDLE __forceinline ForkThreadEx(MyThreadFunc pFunc, void *param, UINT *pThreadId) {
+ return ::ProtoForkThreadEx(this, (ProtoThreadFunc)pFunc, param, pThreadId); }
- typedef INT_PTR (__cdecl T::*MyServiceFunc)(WPARAM, LPARAM);
- __forceinline void CreateProtoService(const char *name, MyServiceFunc pFunc)
- { ::ProtoCreateService(this, name, (ProtoServiceFunc)pFunc); }
+ typedef INT_PTR(__cdecl T::*MyServiceFunc)(WPARAM, LPARAM);
+ __forceinline void CreateProtoService(const char *name, MyServiceFunc pFunc) {
+ ::ProtoCreateService(this, name, (ProtoServiceFunc)pFunc); }
- typedef INT_PTR (__cdecl T::*MyServiceFuncParam)(WPARAM, LPARAM, LPARAM);
- __forceinline void CreateProtoServiceParam(const char *name, MyServiceFuncParam pFunc, LPARAM param)
- { ::ProtoCreateServiceParam(this, name, (ProtoServiceFuncParam)pFunc, param); }
+ typedef INT_PTR(__cdecl T::*MyServiceFuncParam)(WPARAM, LPARAM, LPARAM);
+ __forceinline void CreateProtoServiceParam(const char *name, MyServiceFuncParam pFunc, LPARAM param) {
+ ::ProtoCreateServiceParam(this, name, (ProtoServiceFuncParam)pFunc, param); }
};
#endif // M_PROTOINT_H__
diff --git a/plugins/TabSRMM/src/msgdlgutils.cpp b/plugins/TabSRMM/src/msgdlgutils.cpp
index 6be4a99bd9..394bad89f2 100644
--- a/plugins/TabSRMM/src/msgdlgutils.cpp
+++ b/plugins/TabSRMM/src/msgdlgutils.cpp
@@ -1642,8 +1642,6 @@ void TSAPI LoadThemeDefaults(TContainerData *pContainer)
void TSAPI LoadOverrideTheme(TContainerData *pContainer)
{
- BOOL bReadTemplates = TRUE;
-
memset(&pContainer->theme, 0, sizeof(TLogTheme));
if (mir_tstrlen(pContainer->szAbsThemeFile) > 1) {
if (PathFileExists(pContainer->szAbsThemeFile)) {
diff --git a/protocols/IRCG/IRC_10.vcxproj b/protocols/IRCG/IRC_10.vcxproj
index d3432d8c87..a437b42238 100644
--- a/protocols/IRCG/IRC_10.vcxproj
+++ b/protocols/IRCG/IRC_10.vcxproj
@@ -209,7 +209,6 @@
<ClCompile Include="src\services.cpp" />
<ClCompile Include="src\main.cpp" />
<ClCompile Include="src\tools.cpp" />
- <ClCompile Include="src\ui_utils.cpp" />
<ClCompile Include="src\userinfo.cpp" />
<ClCompile Include="src\windows.cpp" />
</ItemGroup>
@@ -218,7 +217,6 @@
<ClInclude Include="src\irc_dlg.h" />
<ClInclude Include="src\irclib.h" />
<ClInclude Include="src\resource.h" />
- <ClInclude Include="src\ui_utils.h" />
<ClInclude Include="src\version.h" />
</ItemGroup>
<ItemGroup>
diff --git a/protocols/IRCG/IRC_10.vcxproj.filters b/protocols/IRCG/IRC_10.vcxproj.filters
index f422854c53..3e850c5326 100644
--- a/protocols/IRCG/IRC_10.vcxproj.filters
+++ b/protocols/IRCG/IRC_10.vcxproj.filters
@@ -52,9 +52,6 @@
<ClCompile Include="src\tools.cpp">
<Filter>Source Files</Filter>
</ClCompile>
- <ClCompile Include="src\ui_utils.cpp">
- <Filter>Source Files</Filter>
- </ClCompile>
<ClCompile Include="src\userinfo.cpp">
<Filter>Source Files</Filter>
</ClCompile>
@@ -78,9 +75,6 @@
<ClInclude Include="src\resource.h">
<Filter>Header Files</Filter>
</ClInclude>
- <ClInclude Include="src\ui_utils.h">
- <Filter>Header Files</Filter>
- </ClInclude>
<ClInclude Include="src\version.h">
<Filter>Header Files</Filter>
</ClInclude>
diff --git a/protocols/IRCG/IRC_12.vcxproj b/protocols/IRCG/IRC_12.vcxproj
index e61311d11e..d2d0823f61 100644
--- a/protocols/IRCG/IRC_12.vcxproj
+++ b/protocols/IRCG/IRC_12.vcxproj
@@ -212,7 +212,6 @@
<ClCompile Include="src\services.cpp" />
<ClCompile Include="src\main.cpp" />
<ClCompile Include="src\tools.cpp" />
- <ClCompile Include="src\ui_utils.cpp" />
<ClCompile Include="src\userinfo.cpp" />
<ClCompile Include="src\windows.cpp" />
</ItemGroup>
@@ -221,7 +220,6 @@
<ClInclude Include="src\irc_dlg.h" />
<ClInclude Include="src\irclib.h" />
<ClInclude Include="src\resource.h" />
- <ClInclude Include="src\ui_utils.h" />
</ItemGroup>
<ItemGroup>
<None Include="Docs\IRC_servers.ini" />
diff --git a/protocols/IRCG/IRC_12.vcxproj.filters b/protocols/IRCG/IRC_12.vcxproj.filters
index ec1a5eb0bd..783c4dbfc0 100644
--- a/protocols/IRCG/IRC_12.vcxproj.filters
+++ b/protocols/IRCG/IRC_12.vcxproj.filters
@@ -52,9 +52,6 @@
<ClCompile Include="src\tools.cpp">
<Filter>Source Files</Filter>
</ClCompile>
- <ClCompile Include="src\ui_utils.cpp">
- <Filter>Source Files</Filter>
- </ClCompile>
<ClCompile Include="src\userinfo.cpp">
<Filter>Source Files</Filter>
</ClCompile>
@@ -78,9 +75,6 @@
<ClInclude Include="src\resource.h">
<Filter>Header Files</Filter>
</ClInclude>
- <ClInclude Include="src\ui_utils.h">
- <Filter>Header Files</Filter>
- </ClInclude>
</ItemGroup>
<ItemGroup>
<None Include="Docs\IRC_servers.ini">
diff --git a/protocols/IRCG/src/irc.h b/protocols/IRCG/src/irc.h
index 7af8860637..a666514a85 100644
--- a/protocols/IRCG/src/irc.h
+++ b/protocols/IRCG/src/irc.h
@@ -72,6 +72,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "m_icolib.h"
#include "m_string.h"
#include "win2k.h"
+#include "m_gui.h"
#include "resource.h"
diff --git a/protocols/IRCG/src/irc_dlg.h b/protocols/IRCG/src/irc_dlg.h
index cd251c5a16..9f18a90862 100644
--- a/protocols/IRCG/src/irc_dlg.h
+++ b/protocols/IRCG/src/irc_dlg.h
@@ -19,26 +19,24 @@ along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
-#include "ui_utils.h"
-
/////////////////////////////////////////////////////////////////////////////////////////
// Dialogs
-struct CMessageBoxDlg : public CProtoDlgBase<CIrcProto>
+struct CMessageBoxDlg : public CProtoDlgBase < CIrcProto >
{
DCCINFO* pdci;
- CMessageBoxDlg( CIrcProto* _pro, DCCINFO* _dci );
+ CMessageBoxDlg(CIrcProto* _pro, DCCINFO* _dci);
CCtrlButton m_Ok;
- void OnOk( CCtrlButton* );
+ void OnOk(CCtrlButton*);
virtual void OnInitDialog();
};
-struct CCoolIrcDlg : public CProtoDlgBase<CIrcProto>
+struct CCoolIrcDlg : public CProtoDlgBase < CIrcProto >
{
- CCoolIrcDlg( CIrcProto* _pro, int dlgId, HWND parent = NULL );
+ CCoolIrcDlg(CIrcProto* _pro, int dlgId, HWND parent = NULL);
virtual INT_PTR DlgProc(UINT msg, WPARAM wParam, LPARAM lParam);
@@ -48,24 +46,24 @@ struct CCoolIrcDlg : public CProtoDlgBase<CIrcProto>
struct CWhoisDlg : public CCoolIrcDlg
{
- CWhoisDlg( CIrcProto* _pro );
+ CWhoisDlg(CIrcProto* _pro);
CCtrlCombo m_InfoNick;
CCtrlEdit m_Reply;
CCtrlBase m_Caption, m_AwayTime;
CCtrlBase m_InfoName, m_InfoId, m_InfoAddress, m_InfoChannels, m_InfoAuth,
- m_InfoServer, m_InfoAway2, m_InfoOther;
+ m_InfoServer, m_InfoAway2, m_InfoOther;
CCtrlButton m_Ping, m_Version, m_Time, m_userInfo, m_Refresh, m_Query;
- void ShowMessage( const CIrcMessage* );
- void ShowMessageNoUser( const CIrcMessage* );
+ void ShowMessage(const CIrcMessage*);
+ void ShowMessageNoUser(const CIrcMessage*);
- void OnGo( CCtrlButton* );
- void OnQuery( CCtrlButton* );
- void OnPing( CCtrlButton* );
- void OnUserInfo( CCtrlButton* );
- void OnTime( CCtrlButton* );
- void OnVersion( CCtrlButton* );
+ void OnGo(CCtrlButton*);
+ void OnQuery(CCtrlButton*);
+ void OnPing(CCtrlButton*);
+ void OnUserInfo(CCtrlButton*);
+ void OnTime(CCtrlButton*);
+ void OnVersion(CCtrlButton*);
virtual void OnInitDialog();
virtual void OnClose();
@@ -74,7 +72,7 @@ struct CWhoisDlg : public CCoolIrcDlg
struct CNickDlg : public CCoolIrcDlg
{
- CNickDlg( CIrcProto* _pro );
+ CNickDlg(CIrcProto* _pro);
CCtrlCombo m_Enick;
CCtrlButton m_Ok;
@@ -82,15 +80,15 @@ struct CNickDlg : public CCoolIrcDlg
virtual void OnInitDialog();
virtual void OnDestroy();
- void OnOk( CCtrlButton* );
+ void OnOk(CCtrlButton*);
};
-struct CListDlg : public CProtoDlgBase<CIrcProto>
+struct CListDlg : public CProtoDlgBase < CIrcProto >
{
- CListDlg( CIrcProto* _pro );
+ CListDlg(CIrcProto* _pro);
virtual void OnInitDialog();
- virtual void OnChange( CCtrlBase* ctrl );
+ virtual void OnChange(CCtrlBase* ctrl);
virtual INT_PTR DlgProc(UINT msg, WPARAM wParam, LPARAM lParam);
virtual void OnDestroy();
virtual int Resizer(UTILRESIZECONTROL *urc);
@@ -100,27 +98,27 @@ struct CListDlg : public CProtoDlgBase<CIrcProto>
UINT_PTR m_timer;
CCtrlButton m_Join;
- void OnJoin( CCtrlButton* );
+ void OnJoin(CCtrlButton*);
- void List_OnColumnClick( CCtrlListView::TEventInfo* ev );
+ void List_OnColumnClick(CCtrlListView::TEventInfo* ev);
- void UpdateList( void );
+ void UpdateList(void);
};
struct CJoinDlg : public CCoolIrcDlg
{
- CJoinDlg( CIrcProto* _pro );
+ CJoinDlg(CIrcProto* _pro);
virtual void OnInitDialog();
virtual void OnDestroy();
CCtrlButton m_Ok;
- void OnOk( CCtrlButton* );
+ void OnOk(CCtrlButton*);
};
struct CQuickDlg : public CCoolIrcDlg
{
- CQuickDlg( CIrcProto* _pro );
+ CQuickDlg(CIrcProto* _pro);
virtual void OnInitDialog();
virtual void OnDestroy();
@@ -129,7 +127,7 @@ struct CQuickDlg : public CCoolIrcDlg
void OnServerCombo(CCtrlData*);
CCtrlButton m_Ok;
- void OnOk( CCtrlButton* );
+ void OnOk(CCtrlButton*);
private:
struct SERVER_INFO* m_si;
@@ -137,7 +135,7 @@ private:
struct CManagerDlg : public CCoolIrcDlg
{
- CManagerDlg( CIrcProto* _pro );
+ CManagerDlg(CIrcProto* _pro);
CCtrlCheck m_check1, m_check2, m_check3, m_check4, m_check5, m_check6, m_check7, m_check8, m_check9;
CCtrlEdit m_key, m_limit;
@@ -155,32 +153,32 @@ struct CManagerDlg : public CCoolIrcDlg
void OnCheck6(CCtrlData*);
void OnRadio(CCtrlData*);
- void OnAdd( CCtrlButton* );
- void OnEdit( CCtrlButton* );
- void OnRemove( CCtrlButton* );
+ void OnAdd(CCtrlButton*);
+ void OnEdit(CCtrlButton*);
+ void OnRemove(CCtrlButton*);
- void OnListDblClick( CCtrlListBox* );
- void OnChangeList( CCtrlListBox* );
+ void OnListDblClick(CCtrlListBox*);
+ void OnChangeList(CCtrlListBox*);
void OnChangeModes(CCtrlData*);
void OnChangeTopic(CCtrlData*);
- void OnApplyModes( CCtrlButton* );
- void OnApplyTopic( CCtrlButton* );
+ void OnApplyModes(CCtrlButton*);
+ void OnApplyTopic(CCtrlButton*);
void ApplyQuestion();
void CloseQuestion();
- void InitManager( int mode, const TCHAR* window );
+ void InitManager(int mode, const TCHAR* window);
};
struct CQuestionDlg : public CCoolIrcDlg
{
- CQuestionDlg( CIrcProto* _pro, CManagerDlg* owner = NULL );
+ CQuestionDlg(CIrcProto* _pro, CManagerDlg* owner = NULL);
virtual void OnInitDialog();
virtual void OnClose();
CCtrlButton m_Ok;
- void OnOk( CCtrlButton* );
+ void OnOk(CCtrlButton*);
void Activate();
@@ -193,7 +191,7 @@ private:
//---- the first property page: Account -------------------------------------------------
-struct CConnectPrefsDlg : public CProtoDlgBase<CIrcProto>
+struct CConnectPrefsDlg : public CProtoDlgBase < CIrcProto >
{
bool m_serverlistModified;
@@ -206,21 +204,21 @@ struct CConnectPrefsDlg : public CProtoDlgBase<CIrcProto>
CCtrlEdit m_identSystem, m_identPort;
CCtrlCheck m_forceVisible, m_rejoinOnKick, m_rejoinChannels, m_disableError,
- m_address, m_useServer, m_showServer, m_keepAlive, m_autoJoin,
- m_oldStyle, m_onlineNotif, m_channelAway, m_enableServer;
+ m_address, m_useServer, m_showServer, m_keepAlive, m_autoJoin,
+ m_oldStyle, m_onlineNotif, m_channelAway, m_enableServer;
CCtrlEdit m_onlineTimer, m_limit, m_spin1, m_spin2, m_ssl;
- CConnectPrefsDlg( CIrcProto* _pro );
+ CConnectPrefsDlg(CIrcProto* _pro);
- static CDlgBase* Create( void* param ) { return new CConnectPrefsDlg(( CIrcProto* )param ); }
+ static CDlgBase* Create(void* param) { return new CConnectPrefsDlg((CIrcProto*)param); }
virtual void OnInitDialog();
virtual void OnApply();
void OnServerCombo(CCtrlData*);
- void OnAddServer( CCtrlButton* );
- void OnDeleteServer( CCtrlButton* );
- void OnEditServer( CCtrlButton* );
+ void OnAddServer(CCtrlButton*);
+ void OnDeleteServer(CCtrlButton*);
+ void OnEditServer(CCtrlButton*);
void OnStartup(CCtrlData*);
void OnIdent(CCtrlData*);
void OnUseServer(CCtrlData*);
@@ -231,16 +229,16 @@ struct CConnectPrefsDlg : public CProtoDlgBase<CIrcProto>
//---- the second property page: DCC/CTCP -----------------------------------------------
-struct CCtcpPrefsDlg : public CProtoDlgBase<CIrcProto>
+struct CCtcpPrefsDlg : public CProtoDlgBase < CIrcProto >
{
CCtrlCombo m_combo;
CCtrlCheck m_slow, m_fast, m_disc, m_passive, m_sendNotice, m_enableIP, m_fromServer;
CCtrlEdit m_ip, m_userInfo;
CCtrlCheck m_radio1, m_radio2, m_radio3;
- CCtcpPrefsDlg( CIrcProto* _pro );
+ CCtcpPrefsDlg(CIrcProto* _pro);
- static CDlgBase* Create( void* param ) { return new CCtcpPrefsDlg(( CIrcProto* )param ); }
+ static CDlgBase* Create(void* param) { return new CCtcpPrefsDlg((CIrcProto*)param); }
virtual void OnInitDialog();
virtual void OnApply();
@@ -250,7 +248,7 @@ struct CCtcpPrefsDlg : public CProtoDlgBase<CIrcProto>
//---- the third property page: Other ---------------------------------------------------
-struct COtherPrefsDlg : public CProtoDlgBase<CIrcProto>
+struct COtherPrefsDlg : public CProtoDlgBase < CIrcProto >
{
bool m_performlistModified;
@@ -260,36 +258,36 @@ struct COtherPrefsDlg : public CProtoDlgBase<CIrcProto>
CCtrlEdit m_pertormEdit, m_quitMessage, m_alias;
CCtrlCheck m_perform, m_scripting, m_autodetect;
- COtherPrefsDlg( CIrcProto* _pro );
+ COtherPrefsDlg(CIrcProto* _pro);
- static CDlgBase* Create( void* param ) { return new COtherPrefsDlg(( CIrcProto* )param ); }
+ static CDlgBase* Create(void* param) { return new COtherPrefsDlg((CIrcProto*)param); }
virtual void OnInitDialog();
virtual void OnApply();
virtual void OnDestroy();
- void OnUrl( CCtrlButton* );
+ void OnUrl(CCtrlButton*);
void OnPerformCombo(CCtrlData*);
void OnCodePage(CCtrlData*);
void OnPerformEdit(CCtrlData*);
void OnPerform(CCtrlData*);
- void OnAdd( CCtrlButton* );
- void OnDelete( CCtrlButton* );
+ void OnAdd(CCtrlButton*);
+ void OnDelete(CCtrlButton*);
- void addPerformComboValue( int idx, const char* szValueName );
+ void addPerformComboValue(int idx, const char* szValueName);
};
//---- the fourth property page: Ignore -------------------------------------------------
-struct CIgnorePrefsDlg : public CProtoDlgBase<CIrcProto>
+struct CIgnorePrefsDlg : public CProtoDlgBase < CIrcProto >
{
CCtrlMButton m_add, m_edit, m_del;
CCtrlCheck m_enable, m_ignoreChat, m_ignoreFile, m_ignoreChannel, m_ignoreUnknown;
CCtrlListView m_list;
-
- CIgnorePrefsDlg( CIrcProto* _pro );
- static CDlgBase* Create( void* param ) { return new CIgnorePrefsDlg(( CIrcProto* )param ); }
+ CIgnorePrefsDlg(CIrcProto* _pro);
+
+ static CDlgBase* Create(void* param) { return new CIgnorePrefsDlg((CIrcProto*)param); }
virtual void OnInitDialog();
virtual void OnDestroy();
@@ -297,29 +295,29 @@ struct CIgnorePrefsDlg : public CProtoDlgBase<CIrcProto>
virtual INT_PTR DlgProc(UINT msg, WPARAM wParam, LPARAM lParam);
- void List_OnColumnClick( CCtrlListView::TEventInfo* );
+ void List_OnColumnClick(CCtrlListView::TEventInfo*);
void OnEnableIgnore(CCtrlData*);
void OnIgnoreChat(CCtrlData*);
- void OnAdd( CCtrlButton* );
- void OnEdit( CCtrlButton* );
- void OnDelete( CCtrlButton* );
+ void OnAdd(CCtrlButton*);
+ void OnEdit(CCtrlButton*);
+ void OnDelete(CCtrlButton*);
- void FixButtons( void );
- void RebuildList( void );
- void UpdateList( void );
+ void FixButtons(void);
+ void RebuildList(void);
+ void UpdateList(void);
};
-struct CAddIgnoreDlg : public CProtoDlgBase<CIrcProto>
+struct CAddIgnoreDlg : public CProtoDlgBase < CIrcProto >
{
CCtrlButton m_Ok;
CIgnorePrefsDlg* m_owner;
TCHAR szOldMask[500];
- CAddIgnoreDlg( CIrcProto* _pro, const TCHAR* mask, CIgnorePrefsDlg* parent );
+ CAddIgnoreDlg(CIrcProto* _pro, const TCHAR* mask, CIgnorePrefsDlg* parent);
virtual void OnInitDialog();
virtual void OnClose();
- void OnOk( CCtrlButton* );
+ void OnOk(CCtrlButton*);
};
diff --git a/protocols/IRCG/src/options.cpp b/protocols/IRCG/src/options.cpp
index 8633977dd1..4cce32ad83 100644
--- a/protocols/IRCG/src/options.cpp
+++ b/protocols/IRCG/src/options.cpp
@@ -22,8 +22,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "irc.h"
#include <win2k.h>
-#include "ui_utils.h"
-
static const CIrcProto* pZero = NULL;
void CIrcProto::ReadSettings(TDbSetting* sets, int count)
diff --git a/protocols/IRCG/src/ui_utils.cpp b/protocols/IRCG/src/ui_utils.cpp
deleted file mode 100644
index a72e9b1384..0000000000
--- a/protocols/IRCG/src/ui_utils.cpp
+++ /dev/null
@@ -1,1811 +0,0 @@
-/*
-
-Object UI extensions
-Copyright (C) 2008 Victor Pavlychko, George Hazan
-
-This program is free software; you can redistribute it and/or
-modify it under the terms of the GNU General Public License
-as published by the Free Software Foundation; either version 2
-of the License, or ( at your option ) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-
-#include "irc.h"
-#include "ui_utils.h"
-
-extern HINSTANCE hInst;
-
-CDlgBase::CDlgBase(int idDialog, HWND hwndParent) :
- m_controls(1, CCtrlBase::cmp)
-{
- m_idDialog = idDialog;
- m_hwndParent = hwndParent;
- m_hwnd = NULL;
- m_first = NULL;
- m_isModal = false;
- m_initialized = false;
- m_autoClose = CLOSE_ON_OK|CLOSE_ON_CANCEL;
- m_forceResizable = false;
-}
-
-CDlgBase::~CDlgBase()
-{
- if (m_hwnd)
- DestroyWindow(m_hwnd);
-}
-
-void CDlgBase::Create()
-{
- ShowWindow(CreateDialogParam(hInst, MAKEINTRESOURCE(m_idDialog), m_hwndParent, GlobalDlgProc, (LPARAM)(CDlgBase *)this), SW_HIDE);
-}
-
-void CDlgBase::Show()
-{
- ShowWindow(CreateDialogParam(hInst, MAKEINTRESOURCE(m_idDialog), m_hwndParent, GlobalDlgProc, (LPARAM)(CDlgBase *)this), SW_SHOW);
-}
-
-int CDlgBase::DoModal()
-{
- m_isModal = true;
- return DialogBoxParam(hInst, MAKEINTRESOURCE(m_idDialog), m_hwndParent, GlobalDlgProc, (LPARAM)(CDlgBase *)this);
-}
-
-int CDlgBase::Resizer(UTILRESIZECONTROL*)
-{
- return RD_ANCHORX_LEFT|RD_ANCHORY_TOP;
-}
-
-INT_PTR CDlgBase::DlgProc(UINT msg, WPARAM wParam, LPARAM lParam)
-{
- switch (msg)
- {
- case WM_INITDIALOG:
- {
- m_initialized = false;
- TranslateDialogDefault(m_hwnd);
-
- for ( CCtrlBase* p = m_first; p != NULL; p = p->m_next )
- AddControl( p );
-
- NotifyControls(&CCtrlBase::OnInit);
- OnInitDialog();
-
- m_initialized = true;
- return TRUE;
- }
-
- case WM_MEASUREITEM:
- {
- MEASUREITEMSTRUCT *param = (MEASUREITEMSTRUCT *)lParam;
- if (param && param->CtlID)
- if (CCtrlBase *ctrl = FindControl(param->CtlID))
- return ctrl->OnMeasureItem(param);
- return FALSE;
- }
-
- case WM_DRAWITEM:
- {
- DRAWITEMSTRUCT *param = (DRAWITEMSTRUCT *)lParam;
- if (param && param->CtlID)
- if (CCtrlBase *ctrl = FindControl(param->CtlID))
- return ctrl->OnDrawItem(param);
- return FALSE;
- }
-
- case WM_DELETEITEM:
- {
- DELETEITEMSTRUCT *param = (DELETEITEMSTRUCT *)lParam;
- if (param && param->CtlID)
- if (CCtrlBase *ctrl = FindControl(param->CtlID))
- return ctrl->OnDeleteItem(param);
- return FALSE;
- }
-
- case WM_COMMAND:
- {
- HWND hwndCtrl = (HWND)lParam;
- WORD idCtrl = LOWORD(wParam);
- WORD idCode = HIWORD(wParam);
- if (CCtrlBase *ctrl = FindControl(idCtrl)) {
- BOOL result = ctrl->OnCommand(hwndCtrl, idCtrl, idCode);
- if ( result != FALSE )
- return result;
- }
-
- if (idCode == BN_CLICKED &&
- ((idCtrl == IDOK) && (m_autoClose & CLOSE_ON_OK) ||
- (idCtrl == IDCANCEL) && (m_autoClose & CLOSE_ON_CANCEL)))
- {
- PostMessage( m_hwnd, WM_CLOSE, 0, 0 );
- }
- return FALSE;
- }
-
- case WM_NOTIFY:
- {
- int idCtrl = wParam;
- NMHDR *pnmh = (NMHDR *)lParam;
-
- if (pnmh->idFrom == 0)
- {
- if (pnmh->code == PSN_APPLY)
- {
- NotifyControls(&CCtrlBase::OnApply);
- OnApply();
- }
- else if (pnmh->code == PSN_RESET)
- {
- NotifyControls(&CCtrlBase::OnReset);
- OnReset();
- }
- }
-
- if (CCtrlBase *ctrl = FindControl(pnmh->idFrom))
- return ctrl->OnNotify(idCtrl, pnmh);
- return FALSE;
- }
-
- case WM_SIZE:
- {
- if (m_forceResizable || (GetWindowLongPtr(m_hwnd, GWL_STYLE) & WS_SIZEBOX))
- {
- UTILRESIZEDIALOG urd;
- urd.cbSize = sizeof(urd);
- urd.hwndDlg = m_hwnd;
- urd.hInstance = hInst;
- urd.lpTemplate = MAKEINTRESOURCEA(m_idDialog);
- urd.lParam = 0;
- urd.pfnResizer = GlobalDlgResizer;
- CallService(MS_UTILS_RESIZEDIALOG, 0, (LPARAM)&urd);
- }
- return TRUE;
- }
-
- case WM_CLOSE:
- {
- m_lresult = FALSE;
- OnClose();
- if ( !m_lresult )
- {
- if (m_isModal)
- EndDialog(m_hwnd, 0);
- else
- DestroyWindow(m_hwnd);
- }
- return TRUE;
- }
-
- case WM_DESTROY:
- {
- OnDestroy();
- NotifyControls(&CCtrlBase::OnDestroy);
-
- SetWindowLongPtr(m_hwnd, GWLP_USERDATA, 0);
- m_hwnd = NULL;
- if (m_isModal)
- {
- m_isModal = false;
- } else
- { // modeless dialogs MUST be allocated with 'new'
- delete this;
- }
- return TRUE;
- }
- }
-
- return FALSE;
-}
-
-INT_PTR CALLBACK CDlgBase::GlobalDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
-{
- CDlgBase *wnd = NULL;
- if (msg == WM_INITDIALOG)
- {
- SetWindowLongPtr(hwnd, GWLP_USERDATA, lParam);
- wnd = (CDlgBase *)lParam;
- wnd->m_hwnd = hwnd;
- } else
- {
- wnd = (CDlgBase *)GetWindowLongPtr(hwnd, GWLP_USERDATA);
- }
-
- if (!wnd) return FALSE;
-
- wnd->m_msg.hwnd = hwnd;
- wnd->m_msg.message = msg;
- wnd->m_msg.wParam = wParam;
- wnd->m_msg.lParam = lParam;
- return wnd->DlgProc(msg, wParam, lParam);
-}
-
-int CDlgBase::GlobalDlgResizer(HWND hwnd, LPARAM, UTILRESIZECONTROL *urc)
-{
- CDlgBase *wnd = (CDlgBase *)GetWindowLongPtr(hwnd, GWLP_USERDATA);
- if (!wnd) return 0;
-
- return wnd->Resizer(urc);
-}
-
-void CDlgBase::AddControl(CCtrlBase *ctrl)
-{
- m_controls.insert(ctrl);
-}
-
-void CDlgBase::NotifyControls(void (CCtrlBase::*fn)())
-{
- for (int i = 0; i < m_controls.getCount(); ++i)
- (m_controls[i]->*fn)();
-}
-
-CCtrlBase* CDlgBase::FindControl(int idCtrl)
-{
- CCtrlBase search(NULL, idCtrl);
- return m_controls.find(&search);
-}
-
-/////////////////////////////////////////////////////////////////////////////////////////
-// CCtrlCombo class
-
-CCtrlCombo::CCtrlCombo( CDlgBase* dlg, int ctrlId ) :
- CCtrlData( dlg, ctrlId )
-{
-}
-
-int CCtrlCombo::AddString(const TCHAR *text, LPARAM data)
-{
- int iItem = SendMessage(m_hwnd, CB_ADDSTRING, 0, (LPARAM)text);
- if ( data )
- SendMessage(m_hwnd, CB_SETITEMDATA, iItem, data);
- return iItem;
-}
-
-int CCtrlCombo::AddStringA(const char *text, LPARAM data)
-{
- int iItem = SendMessageA(m_hwnd, CB_ADDSTRING, 0, (LPARAM)text);
- if ( data )
- SendMessage(m_hwnd, CB_SETITEMDATA, iItem, data);
- return iItem;
-}
-
-void CCtrlCombo::DeleteString(int index)
-{ SendMessage(m_hwnd, CB_DELETESTRING, index, 0);
-}
-
-int CCtrlCombo::FindString(const TCHAR *str, int index, bool exact )
-{ return SendMessage(m_hwnd, exact?CB_FINDSTRINGEXACT:CB_FINDSTRING, index, (LPARAM)str);
-}
-
-int CCtrlCombo::FindStringA(const char *str, int index, bool exact )
-{ return SendMessageA(m_hwnd, exact?CB_FINDSTRINGEXACT:CB_FINDSTRING, index, (LPARAM)str);
-}
-
-int CCtrlCombo::GetCount()
-{ return SendMessage(m_hwnd, CB_GETCOUNT, 0, 0);
-}
-
-int CCtrlCombo::GetCurSel()
-{ return SendMessage(m_hwnd, CB_GETCURSEL, 0, 0);
-}
-
-bool CCtrlCombo::GetDroppedState()
-{ return SendMessage(m_hwnd, CB_GETDROPPEDSTATE, 0, 0) ? true : false;
-}
-
-LPARAM CCtrlCombo::GetItemData(int index)
-{ return SendMessage(m_hwnd, CB_GETITEMDATA, index, 0);
-}
-
-TCHAR* CCtrlCombo::GetItemText(int index)
-{
- TCHAR *result = (TCHAR *)mir_alloc(sizeof(TCHAR) * (SendMessage(m_hwnd, CB_GETLBTEXTLEN, index, 0) + 1));
- SendMessage(m_hwnd, CB_GETLBTEXT, index, (LPARAM)result);
- return result;
-}
-
-TCHAR* CCtrlCombo::GetItemText(int index, TCHAR *buf, int size)
-{
- TCHAR *result = (TCHAR *)_alloca(sizeof(TCHAR) * (SendMessage(m_hwnd, CB_GETLBTEXTLEN, index, 0) + 1));
- SendMessage(m_hwnd, CB_GETLBTEXT, index, (LPARAM)result);
- mir_tstrncpy(buf, result, size);
- return buf;
-}
-
-int CCtrlCombo::InsertString(TCHAR *text, int pos, LPARAM data)
-{
- int iItem = SendMessage(m_hwnd, CB_INSERTSTRING, pos, (LPARAM)text);
- SendMessage(m_hwnd, CB_SETITEMDATA, iItem, data);
- return iItem;
-}
-
-void CCtrlCombo::ResetContent()
-{ SendMessage(m_hwnd, CB_RESETCONTENT, 0, 0);
-}
-
-int CCtrlCombo::SelectString(TCHAR *str)
-{ return SendMessage(m_hwnd, CB_SELECTSTRING, 0, (LPARAM)str);
-}
-
-int CCtrlCombo::SetCurSel(int index)
-{ return SendMessage(m_hwnd, CB_SETCURSEL, index, 0);
-}
-
-void CCtrlCombo::SetItemData(int index, LPARAM data)
-{ SendMessage(m_hwnd, CB_SETITEMDATA, index, data);
-}
-
-void CCtrlCombo::ShowDropdown(bool show)
-{ SendMessage(m_hwnd, CB_SHOWDROPDOWN, show ? TRUE : FALSE, 0);
-}
-
-/////////////////////////////////////////////////////////////////////////////////////////
-// CCtrlListBox class
-
-CCtrlListBox::CCtrlListBox( CDlgBase* dlg, int ctrlId ) :
- CCtrlBase( dlg, ctrlId )
-{
-}
-
-BOOL CCtrlListBox::OnCommand(HWND, WORD, WORD idCode)
-{
- switch (idCode)
- {
- case LBN_DBLCLK: OnDblClick(this); break;
- case LBN_SELCANCEL: OnSelCancel(this); break;
- case LBN_SELCHANGE: OnSelChange(this); break;
- }
- return TRUE;
-}
-
-int CCtrlListBox::AddString(TCHAR *text, LPARAM data)
-{
- int iItem = SendMessage(m_hwnd, LB_ADDSTRING, 0, (LPARAM)text);
- SendMessage(m_hwnd, LB_SETITEMDATA, iItem, data);
- return iItem;
-}
-
-void CCtrlListBox::DeleteString(int index)
-{ SendMessage(m_hwnd, LB_DELETESTRING, index, 0);
-}
-
-int CCtrlListBox::FindString( TCHAR *str, int index, bool exact)
-{ return SendMessage(m_hwnd, exact?LB_FINDSTRINGEXACT:LB_FINDSTRING, index, (LPARAM)str);
-}
-
-int CCtrlListBox::GetCount()
-{ return SendMessage(m_hwnd, LB_GETCOUNT, 0, 0);
-}
-
-int CCtrlListBox::GetCurSel()
-{ return SendMessage(m_hwnd, LB_GETCURSEL, 0, 0);
-}
-
-LPARAM CCtrlListBox::GetItemData(int index)
-{ return SendMessage(m_hwnd, LB_GETITEMDATA, index, 0);
-}
-
-TCHAR* CCtrlListBox::GetItemText(int index)
-{
- TCHAR *result = (TCHAR *)mir_alloc(sizeof(TCHAR) * (SendMessage(m_hwnd, LB_GETTEXTLEN, index, 0) + 1));
- SendMessage(m_hwnd, LB_GETTEXT, index, (LPARAM)result);
- return result;
-}
-
-TCHAR* CCtrlListBox::GetItemText(int index, TCHAR *buf, int size)
-{
- TCHAR *result = (TCHAR *)_alloca(sizeof(TCHAR) * (SendMessage(m_hwnd, LB_GETTEXTLEN, index, 0) + 1));
- SendMessage(m_hwnd, LB_GETTEXT, index, (LPARAM)result);
- mir_tstrncpy(buf, result, size);
- return buf;
-}
-
-bool CCtrlListBox::GetSel(int index)
-{ return SendMessage(m_hwnd, LB_GETSEL, index, 0) ? true : false;
-}
-
-int CCtrlListBox::GetSelCount()
-{ return SendMessage(m_hwnd, LB_GETSELCOUNT, 0, 0);
-}
-
-int* CCtrlListBox::GetSelItems(int *items, int count)
-{
- SendMessage(m_hwnd, LB_GETSELITEMS, count, (LPARAM)items);
- return items;
-}
-
-int* CCtrlListBox::GetSelItems()
-{
- int count = GetSelCount() + 1;
- int *result = (int *)mir_alloc(sizeof(int) * count);
- SendMessage(m_hwnd, LB_GETSELITEMS, count, (LPARAM)result);
- result[count-1] = -1;
- return result;
-}
-
-int CCtrlListBox::InsertString(TCHAR *text, int pos, LPARAM data)
-{
- int iItem = SendMessage(m_hwnd, CB_INSERTSTRING, pos, (LPARAM)text);
- SendMessage(m_hwnd, CB_SETITEMDATA, iItem, data);
- return iItem;
-}
-
-void CCtrlListBox::ResetContent()
-{ SendMessage(m_hwnd, LB_RESETCONTENT, 0, 0);
-}
-
-int CCtrlListBox::SelectString(TCHAR *str)
-{ return SendMessage(m_hwnd, LB_SELECTSTRING, 0, (LPARAM)str);
-}
-
-int CCtrlListBox::SetCurSel(int index)
-{ return SendMessage(m_hwnd, LB_SETCURSEL, index, 0);
-}
-
-void CCtrlListBox::SetItemData(int index, LPARAM data)
-{ SendMessage(m_hwnd, LB_SETITEMDATA, index, data);
-}
-
-void CCtrlListBox::SetSel(int index, bool sel)
-{ SendMessage(m_hwnd, LB_SETSEL, sel ? TRUE : FALSE, index);
-}
-
-/////////////////////////////////////////////////////////////////////////////////////////
-// CCtrlCheck class
-
-CCtrlCheck::CCtrlCheck( CDlgBase* dlg, int ctrlId ) :
- CCtrlData( dlg, ctrlId )
-{
-}
-
-int CCtrlCheck::GetState()
-{
- return SendMessage(m_hwnd, BM_GETCHECK, 0, 0);
-}
-
-void CCtrlCheck::SetState(int state)
-{
- SendMessage(m_hwnd, BM_SETCHECK, state, 0);
-}
-
-/////////////////////////////////////////////////////////////////////////////////////////
-// CCtrlEdit class
-
-CCtrlEdit::CCtrlEdit( CDlgBase* dlg, int ctrlId ) :
- CCtrlData( dlg, ctrlId )
-{
-}
-
-/////////////////////////////////////////////////////////////////////////////////////////
-// CCtrlData class
-
-CCtrlData::CCtrlData( CDlgBase *wnd, int idCtrl ) :
- CCtrlBase( wnd, idCtrl ),
- m_dbLink( NULL )
-{
-}
-
-void CCtrlData::OnInit()
-{
- CCtrlBase::OnInit();
- m_changed = false;
-}
-
-void CCtrlData::NotifyChange()
-{
- if (!m_parentWnd || m_parentWnd->IsInitialized()) m_changed = true;
- if ( m_parentWnd ) {
- m_parentWnd->OnChange(this);
- if ( m_parentWnd->IsInitialized())
- ::SendMessage( ::GetParent( m_parentWnd->GetHwnd()), PSM_CHANGED, 0, 0 );
- }
-
- OnChange(this);
-}
-
-void CCtrlData::CreateDbLink( const char* szModuleName, const char* szSetting, BYTE type, DWORD iValue )
-{
- m_dbLink = new CDbLink( szModuleName, szSetting, type, iValue);
-}
-
-void CCtrlData::CreateDbLink( const char* szModuleName, const char* szSetting, TCHAR* szValue )
-{
- m_dbLink = new CDbLink( szModuleName, szSetting, DBVT_TCHAR, szValue );
-}
-
-/////////////////////////////////////////////////////////////////////////////////////////
-// CCtrlButton
-
-int CCtrlButton::GetState()
-{ return SendMessage(m_hwnd, BM_GETCHECK, 0, 0);
-}
-
-void CCtrlButton::SetState(int state)
-{ SendMessage(m_hwnd, BM_SETCHECK, state, 0);
-}
-
-/////////////////////////////////////////////////////////////////////////////////////////
-// CCtrlMButton
-
-CCtrlMButton::CCtrlMButton( CDlgBase* dlg, int ctrlId, HICON hIcon, const char* tooltip ) :
- CCtrlButton( dlg, ctrlId ),
- m_hIcon( hIcon ),
- m_toolTip( tooltip )
-{
-}
-
-CCtrlMButton::CCtrlMButton( CDlgBase* dlg, int ctrlId, int iCoreIcon, const char* tooltip ) :
- CCtrlButton( dlg, ctrlId ),
- m_hIcon( LoadSkinnedIcon(iCoreIcon)),
- m_toolTip( tooltip )
-{
-}
-
-CCtrlMButton::~CCtrlMButton()
-{
- if (m_hIcon)
- Skin_ReleaseIcon(m_hIcon);
-}
-
-void CCtrlMButton::OnInit()
-{
- CCtrlButton::OnInit();
-
- SendMessage( m_hwnd, BM_SETIMAGE, IMAGE_ICON, (LPARAM)m_hIcon );
- SendMessage( m_hwnd, BUTTONADDTOOLTIP, (WPARAM)m_toolTip, 0);
-}
-
-void CCtrlMButton::MakeFlat()
-{
- SendMessage(m_hwnd, BUTTONSETASFLATBTN, TRUE, 0);
-}
-
-void CCtrlMButton::MakePush()
-{
- SendMessage(m_hwnd, BUTTONSETASPUSHBTN, TRUE, 0);
-}
-
-/////////////////////////////////////////////////////////////////////////////////////////
-// CCtrlButton
-
-CCtrlButton::CCtrlButton( CDlgBase* wnd, int idCtrl ) :
- CCtrlBase( wnd, idCtrl )
-{
-}
-
-BOOL CCtrlButton::OnCommand(HWND, WORD, WORD idCode)
-{
- if ( idCode == BN_CLICKED || idCode == STN_CLICKED )
- OnClick(this);
- return FALSE;
-}
-
-/////////////////////////////////////////////////////////////////////////////////////////
-// CCtrlHyperlink
-
-CCtrlHyperlink::CCtrlHyperlink( CDlgBase* wnd, int idCtrl, const char* url ) :
- CCtrlBase( wnd, idCtrl ),
- m_url(url)
-{
-}
-
-BOOL CCtrlHyperlink::OnCommand(HWND, WORD, WORD)
-{
- ShellExecuteA(m_hwnd, "open", m_url, "", "", SW_SHOW);
- return FALSE;
-}
-
-/////////////////////////////////////////////////////////////////////////////////////////
-// CCtrlClc
-CCtrlClc::CCtrlClc( CDlgBase* dlg, int ctrlId ):
- CCtrlBase(dlg, ctrlId)
-{
-}
-
-BOOL CCtrlClc::OnNotify(int, NMHDR *pnmh)
-{
- TEventInfo evt = { this, (NMCLISTCONTROL *)pnmh };
- switch (pnmh->code)
- {
- case CLN_EXPANDED: OnExpanded(&evt); break;
- case CLN_LISTREBUILT: OnListRebuilt(&evt); break;
- case CLN_ITEMCHECKED: OnItemChecked(&evt); break;
- case CLN_DRAGGING: OnDragging(&evt); break;
- case CLN_DROPPED: OnDropped(&evt); break;
- case CLN_LISTSIZECHANGE: OnListSizeChange(&evt); break;
- case CLN_OPTIONSCHANGED: OnOptionsChanged(&evt); break;
- case CLN_DRAGSTOP: OnDragStop(&evt); break;
- case CLN_NEWCONTACT: OnNewContact(&evt); break;
- case CLN_CONTACTMOVED: OnContactMoved(&evt); break;
- case CLN_CHECKCHANGED: OnCheckChanged(&evt); break;
- case NM_CLICK: OnClick(&evt); break;
- }
- return FALSE;
-}
-
-void CCtrlClc::AddContact(MCONTACT hContact)
-{ SendMessage(m_hwnd, CLM_ADDCONTACT, hContact, 0);
-}
-
-void CCtrlClc::AddGroup(HANDLE hGroup)
-{ SendMessage(m_hwnd, CLM_ADDGROUP, (WPARAM)hGroup, 0);
-}
-
-void CCtrlClc::AutoRebuild()
-{ SendMessage(m_hwnd, CLM_AUTOREBUILD, 0, 0);
-}
-
-void CCtrlClc::DeleteItem(HANDLE hItem)
-{ SendMessage(m_hwnd, CLM_DELETEITEM, (WPARAM)hItem, 0);
-}
-
-void CCtrlClc::EditLabel(HANDLE hItem)
-{ SendMessage(m_hwnd, CLM_EDITLABEL, (WPARAM)hItem, 0);
-}
-
-void CCtrlClc::EndEditLabel(bool save)
-{ SendMessage(m_hwnd, CLM_ENDEDITLABELNOW, save ? 0 : 1, 0);
-}
-
-void CCtrlClc::EnsureVisible(HANDLE hItem, bool partialOk)
-{ SendMessage(m_hwnd, CLM_ENSUREVISIBLE, (WPARAM)hItem, partialOk ? TRUE : FALSE);
-}
-
-void CCtrlClc::Expand(HANDLE hItem, DWORD flags)
-{ SendMessage(m_hwnd, CLM_EXPAND, (WPARAM)hItem, flags);
-}
-
-HANDLE CCtrlClc::FindContact(MCONTACT hContact)
-{ return (HANDLE)SendMessage(m_hwnd, CLM_FINDCONTACT, hContact, 0);
-}
-
-HANDLE CCtrlClc::FindGroup(HANDLE hGroup)
-{ return (HANDLE)SendMessage(m_hwnd, CLM_FINDGROUP, (WPARAM)hGroup, 0);
-}
-
-COLORREF CCtrlClc::GetBkColor()
-{ return (COLORREF)SendMessage(m_hwnd, CLM_GETBKCOLOR, 0, 0);
-}
-
-bool CCtrlClc::GetCheck(HANDLE hItem)
-{ return SendMessage(m_hwnd, CLM_GETCHECKMARK, (WPARAM)hItem, 0) ? true : false;
-}
-
-int CCtrlClc::GetCount()
-{ return SendMessage(m_hwnd, CLM_GETCOUNT, 0, 0);
-}
-
-HWND CCtrlClc::GetEditControl()
-{ return (HWND)SendMessage(m_hwnd, CLM_GETEDITCONTROL, 0, 0);
-}
-
-DWORD CCtrlClc::GetExpand(HANDLE hItem)
-{ return SendMessage(m_hwnd, CLM_GETEXPAND, (WPARAM)hItem, 0);
-}
-
-int CCtrlClc::GetExtraColumns()
-{ return SendMessage(m_hwnd, CLM_GETEXTRACOLUMNS, 0, 0);
-}
-
-BYTE CCtrlClc::GetExtraImage(HANDLE hItem, int iColumn)
-{ return (BYTE)(SendMessage(m_hwnd, CLM_GETEXTRAIMAGE, (WPARAM)hItem, MAKELPARAM(iColumn, 0)) & 0xFF);
-}
-
-HIMAGELIST CCtrlClc::GetExtraImageList()
-{ return (HIMAGELIST)SendMessage(m_hwnd, CLM_GETEXTRAIMAGELIST, 0, 0);
-}
-
-HFONT CCtrlClc::GetFont(int iFontId)
-{ return (HFONT)SendMessage(m_hwnd, CLM_GETFONT, (WPARAM)iFontId, 0);
-}
-
-HANDLE CCtrlClc::GetSelection()
-{ return (HANDLE)SendMessage(m_hwnd, CLM_GETSELECTION, 0, 0);
-}
-
-HANDLE CCtrlClc::HitTest(int x, int y, DWORD *hitTest)
-{ return (HANDLE)SendMessage(m_hwnd, CLM_HITTEST, (WPARAM)hitTest, MAKELPARAM(x,y));
-}
-
-void CCtrlClc::SelectItem(HANDLE hItem)
-{ SendMessage(m_hwnd, CLM_SELECTITEM, (WPARAM)hItem, 0);
-}
-
-void CCtrlClc::SetBkBitmap(DWORD mode, HBITMAP hBitmap)
-{ SendMessage(m_hwnd, CLM_SETBKBITMAP, mode, (LPARAM)hBitmap);
-}
-
-void CCtrlClc::SetBkColor(COLORREF clBack)
-{ SendMessage(m_hwnd, CLM_SETBKCOLOR, (WPARAM)clBack, 0);
-}
-
-void CCtrlClc::SetCheck(HANDLE hItem, bool check)
-{ SendMessage(m_hwnd, CLM_SETCHECKMARK, (WPARAM)hItem, check ? 1 : 0);
-}
-
-void CCtrlClc::SetExtraColumns(int iColumns)
-{ SendMessage(m_hwnd, CLM_SETEXTRACOLUMNS, (WPARAM)iColumns, 0);
-}
-
-void CCtrlClc::SetExtraImage(HANDLE hItem, int iColumn, int iImage)
-{ SendMessage(m_hwnd, CLM_SETEXTRAIMAGE, (WPARAM)hItem, MAKELPARAM(iColumn, iImage));
-}
-
-void CCtrlClc::SetExtraImageList(HIMAGELIST hImgList)
-{ SendMessage(m_hwnd, CLM_SETEXTRAIMAGELIST, 0, (LPARAM)hImgList);
-}
-
-void CCtrlClc::SetFont(int iFontId, HANDLE hFont, bool bRedraw)
-{ SendMessage(m_hwnd, CLM_SETFONT, (WPARAM)hFont, MAKELPARAM(bRedraw ? 1 : 0, iFontId));
-}
-
-void CCtrlClc::SetIndent(int iIndent)
-{ SendMessage(m_hwnd, CLM_SETINDENT, (WPARAM)iIndent, 0);
-}
-
-void CCtrlClc::SetItemText(HANDLE hItem, char *szText)
-{ SendMessage(m_hwnd, CLM_SETITEMTEXT, (WPARAM)hItem, (LPARAM)szText);
-}
-
-void CCtrlClc::SetHideEmptyGroups(bool state)
-{ SendMessage(m_hwnd, CLM_SETHIDEEMPTYGROUPS, state ? 1 : 0, 0);
-}
-
-void CCtrlClc::SetGreyoutFlags(DWORD flags)
-{ SendMessage(m_hwnd, CLM_SETGREYOUTFLAGS, (WPARAM)flags, 0);
-}
-
-bool CCtrlClc::GetHideOfflineRoot()
-{ return SendMessage(m_hwnd, CLM_GETHIDEOFFLINEROOT, 0, 0) ? true : false;
-}
-
-void CCtrlClc::SetHideOfflineRoot(bool state)
-{ SendMessage(m_hwnd, CLM_SETHIDEOFFLINEROOT, state ? 1 : 0, 9);
-}
-
-void CCtrlClc::SetUseGroups(bool state)
-{ SendMessage(m_hwnd, CLM_SETUSEGROUPS, state ? 1 : 0, 0);
-}
-
-void CCtrlClc::SetOfflineModes(DWORD modes)
-{ SendMessage(m_hwnd, CLM_SETOFFLINEMODES, modes, 0);
-}
-
-DWORD CCtrlClc::GetExStyle()
-{ return SendMessage(m_hwnd, CLM_GETEXSTYLE, 0, 0);
-}
-
-void CCtrlClc::SetExStyle(DWORD exStyle)
-{ SendMessage(m_hwnd, CLM_SETEXSTYLE, (WPARAM)exStyle, 0);
-}
-
-int CCtrlClc::GetLefrMargin()
-{ return SendMessage(m_hwnd, CLM_GETLEFTMARGIN, 0, 0);
-}
-
-void CCtrlClc::SetLeftMargin(int iMargin)
-{ SendMessage(m_hwnd, CLM_SETLEFTMARGIN, (WPARAM)iMargin, 0);
-}
-
-HANDLE CCtrlClc::AddInfoItem(CLCINFOITEM *cii)
-{ return (HANDLE)SendMessage(m_hwnd, CLM_ADDINFOITEM, 0, (LPARAM)cii);
-}
-
-int CCtrlClc::GetItemType(HANDLE hItem)
-{ return SendMessage(m_hwnd, CLM_GETITEMTYPE, (WPARAM)hItem, 0);
-}
-
-HANDLE CCtrlClc::GetNextItem(HANDLE hItem, DWORD flags)
-{ return (HANDLE)SendMessage(m_hwnd, CLM_GETNEXTITEM, (WPARAM)flags, (LPARAM)hItem);
-}
-
-COLORREF CCtrlClc::GetTextColot(int iFontId)
-{ return (COLORREF)SendMessage(m_hwnd, CLM_GETTEXTCOLOR, (WPARAM)iFontId, 0);
-}
-
-void CCtrlClc::SetTextColor(int iFontId, COLORREF clText)
-{ SendMessage(m_hwnd, CLM_SETTEXTCOLOR, (WPARAM)iFontId, (LPARAM)clText);
-}
-
-/////////////////////////////////////////////////////////////////////////////////////////
-// CCtrlListView
-
-CCtrlListView::CCtrlListView( CDlgBase* dlg, int ctrlId ) :
- CCtrlBase(dlg, ctrlId)
-{
-}
-
-BOOL CCtrlListView::OnNotify(int, NMHDR *pnmh)
-{
- TEventInfo evt = { this, pnmh };
-
- switch (pnmh->code) {
- case NM_DBLCLK: OnDoubleClick(&evt); return TRUE;
- case LVN_BEGINDRAG: OnBeginDrag(&evt); return TRUE;
- case LVN_BEGINLABELEDIT: OnBeginLabelEdit(&evt); return TRUE;
- case LVN_BEGINRDRAG: OnBeginRDrag(&evt); return TRUE;
- case LVN_BEGINSCROLL: OnBeginScroll(&evt); return TRUE;
- case LVN_COLUMNCLICK: OnColumnClick(&evt); return TRUE;
- case LVN_DELETEALLITEMS: OnDeleteAllItems(&evt); return TRUE;
- case LVN_DELETEITEM: OnDeleteItem(&evt); return TRUE;
- case LVN_ENDLABELEDIT: OnEndLabelEdit(&evt); return TRUE;
- case LVN_ENDSCROLL: OnEndScroll(&evt); return TRUE;
- case LVN_GETDISPINFO: OnGetDispInfo(&evt); return TRUE;
- case LVN_GETINFOTIP: OnGetInfoTip(&evt); return TRUE;
- case LVN_HOTTRACK: OnHotTrack(&evt); return TRUE;
- //case LVN_INCREMENTALSEARCH: OnIncrementalSearch(&evt); return TRUE;
- case LVN_INSERTITEM: OnInsertItem(&evt); return TRUE;
- case LVN_ITEMACTIVATE: OnItemActivate(&evt); return TRUE;
- case LVN_ITEMCHANGED: OnItemChanged(&evt); return TRUE;
- case LVN_ITEMCHANGING: OnItemChanging(&evt); return TRUE;
- case LVN_KEYDOWN: OnKeyDown(&evt); return TRUE;
- case LVN_MARQUEEBEGIN: OnMarqueeBegin(&evt); return TRUE;
- case LVN_SETDISPINFO: OnSetDispInfo(&evt); return TRUE;
- }
-
- return FALSE;
-}
-DWORD CCtrlListView::ApproximateViewRect(int cx, int cy, int iCount)
-{ return ListView_ApproximateViewRect(m_hwnd, cx, cy, iCount);
-}
-void CCtrlListView::Arrange(UINT code)
-{ ListView_Arrange(m_hwnd, code);
-}
-void CCtrlListView::CancelEditLabel()
-{ ListView_CancelEditLabel(m_hwnd);
-}
-HIMAGELIST CCtrlListView::CreateDragImage(int iItem, LPPOINT lpptUpLeft)
-{ return ListView_CreateDragImage(m_hwnd, iItem, lpptUpLeft);
-}
-void CCtrlListView::DeleteAllItems()
-{ ListView_DeleteAllItems(m_hwnd);
-}
-void CCtrlListView::DeleteColumn(int iCol)
-{ ListView_DeleteColumn(m_hwnd, iCol);
-}
-void CCtrlListView::DeleteItem(int iItem)
-{ ListView_DeleteItem(m_hwnd, iItem);
-}
-HWND CCtrlListView::EditLabel(int iItem)
-{ return ListView_EditLabel(m_hwnd, iItem);
-}
-int CCtrlListView::EnableGroupView(BOOL fEnable)
-{ return ListView_EnableGroupView(m_hwnd, fEnable);
-}
-BOOL CCtrlListView::EnsureVisible(int i, BOOL fPartialOK)
-{ return ListView_EnsureVisible(m_hwnd, i, fPartialOK);
-}
-int CCtrlListView::FindItem(int iStart, const LVFINDINFO *plvfi)
-{ return ListView_FindItem(m_hwnd, iStart, plvfi);
-}
-COLORREF CCtrlListView::GetBkColor()
-{ return ListView_GetBkColor(m_hwnd);
-}
-void CCtrlListView::GetBkImage(LPLVBKIMAGE plvbki)
-{ ListView_GetBkImage(m_hwnd, plvbki);
-}
-UINT CCtrlListView::GetCallbackMask()
-{ return ListView_GetCallbackMask(m_hwnd);
-}
-BOOL CCtrlListView::GetCheckState(UINT iIndex)
-{ return ListView_GetCheckState(m_hwnd, iIndex);
-}
-void CCtrlListView::GetColumn(int iCol, LPLVCOLUMN pcol)
-{ ListView_GetColumn(m_hwnd, iCol, pcol);
-}
-void CCtrlListView::GetColumnOrderArray(int iCount, int *lpiArray)
-{ ListView_GetColumnOrderArray(m_hwnd, iCount, lpiArray);
-}
-int CCtrlListView::GetColumnWidth(int iCol)
-{ return ListView_GetColumnWidth(m_hwnd, iCol);
-}
-int CCtrlListView::GetCountPerPage()
-{ return ListView_GetCountPerPage(m_hwnd);
-}
-HWND CCtrlListView::GetEditControl()
-{ return ListView_GetEditControl(m_hwnd);
-}
-//void CCtrlListView::GetEmptyText(PWSTR pszText, UINT cchText)
-//{ ListView_GetEmptyText(m_hwnd, pszText, cchText);
-//}
-DWORD CCtrlListView::GetExtendedListViewStyle()
-{ return ListView_GetExtendedListViewStyle(m_hwnd);
-}
-//INT CCtrlListView::GetFocusedGroup()
-//{ return ListView_GetFocusedGroup(m_hwnd);
-//}
-//void CCtrlListView::GetFooterInfo(LPLVFOOTERINFO plvfi)
-//{ ListView_GetFooterInfo(m_hwnd, plvfi);
-//}
-//void CCtrlListView::GetFooterItem(UINT iItem, LVFOOTERITEM *pfi)
-//{ ListView_GetFooterItem(m_hwnd, iItem, pfi);
-//}
-//void CCtrlListView::GetFooterItemRect(UINT iItem, RECT *prc)
-//{ ListView_GetFooterItemRect(m_hwnd, iItem, prc);
-//}
-//void CCtrlListView::GetFooterRect(RECT *prc)
-//{ ListView_GetFooterRect(m_hwnd, prc);
-//}
-//int CCtrlListView::GetGroupCount()
-//{ return ListView_GetGroupCount(m_hwnd);
-//}
-//HIMAGELIST CCtrlListView::GetGroupHeaderImageList()
-//{ return ListView_GetGroupHeaderImageList(m_hwnd);
-//}
-//void CCtrlListView::GetGroupInfo(int iGroupId, PLVGROUP pgrp)
-//{ ListView_GetGroupInfo(m_hwnd, iGroupId, pgrp);
-//}
-//void CCtrlListView::GetGroupInfoByIndex(int iIndex, PLVGROUP pgrp)
-//{ ListView_GetGroupInfoByIndex(m_hwnd, iIndex, pgrp);
-//}
-void CCtrlListView::GetGroupMetrics(LVGROUPMETRICS *pGroupMetrics)
-{ ListView_GetGroupMetrics(m_hwnd, pGroupMetrics);
-}
-//BOOL CCtrlListView::GetGroupRect(int iGroupId, RECT *prc)
-//{ return ListView_GetGroupRect(m_hwnd, iGroupId, prc);
-//}
-//UINT CCtrlListView::GetGroupState(UINT dwGroupId, UINT dwMask)
-//{ return ListView_GetGroupState(m_hwnd, dwGroupId, dwMask);
-//}
-HWND CCtrlListView::GetHeader()
-{ return ListView_GetHeader(m_hwnd);
-}
-HCURSOR CCtrlListView::GetHotCursor()
-{ return ListView_GetHotCursor(m_hwnd);
-}
-INT CCtrlListView::GetHotItem()
-{ return ListView_GetHotItem(m_hwnd);
-}
-DWORD CCtrlListView::GetHoverTime()
-{ return ListView_GetHoverTime(m_hwnd);
-}
-HIMAGELIST CCtrlListView::GetImageList(int iImageList)
-{ return ListView_GetImageList(m_hwnd, iImageList);
-}
-BOOL CCtrlListView::GetInsertMark(LVINSERTMARK *plvim)
-{ return ListView_GetInsertMark(m_hwnd, plvim);
-}
-COLORREF CCtrlListView::GetInsertMarkColor()
-{ return ListView_GetInsertMarkColor(m_hwnd);
-}
-int CCtrlListView::GetInsertMarkRect(LPRECT prc)
-{ return ListView_GetInsertMarkRect(m_hwnd, prc);
-}
-BOOL CCtrlListView::GetISearchString(LPSTR lpsz)
-{ return ListView_GetISearchString(m_hwnd, lpsz);
-}
-void CCtrlListView::GetItem(LPLVITEM pitem)
-{ ListView_GetItem(m_hwnd, pitem);
-}
-int CCtrlListView::GetItemCount()
-{ return ListView_GetItemCount(m_hwnd);
-}
-//void CCtrlListView::GetItemIndexRect(LVITEMINDEX *plvii, LONG iSubItem, LONG code, LPRECT prc)
-//{ ListView_GetItemIndexRect(m_hwnd, plvii, iSubItem, code, prc);
-//}
-void CCtrlListView::GetItemPosition(int i, POINT *ppt)
-{ ListView_GetItemPosition(m_hwnd, i, ppt);
-}
-void CCtrlListView::GetItemRect(int i, RECT *prc, int code)
-{ ListView_GetItemRect(m_hwnd, i, prc, code);
-}
-DWORD CCtrlListView::GetItemSpacing(BOOL fSmall)
-{ return ListView_GetItemSpacing(m_hwnd, fSmall);
-}
-UINT CCtrlListView::GetItemState(int i, UINT mask)
-{ return ListView_GetItemState(m_hwnd, i, mask);
-}
-void CCtrlListView::GetItemText(int iItem, int iSubItem, LPTSTR pszText, int cchTextMax)
-{ ListView_GetItemText(m_hwnd, iItem, iSubItem, pszText, cchTextMax);
-}
-int CCtrlListView::GetNextItem(int iStart, UINT flags)
-{ return ListView_GetNextItem(m_hwnd, iStart, flags);
-}
-//BOOL CCtrlListView::GetNextItemIndex(LVITEMINDEX *plvii, LPARAM flags)
-//{ return ListView_GetNextItemIndex(m_hwnd, plvii, flags);
-//}
-BOOL CCtrlListView::GetNumberOfWorkAreas(LPUINT lpuWorkAreas)
-{ return ListView_GetNumberOfWorkAreas(m_hwnd, lpuWorkAreas);
-}
-BOOL CCtrlListView::GetOrigin(LPPOINT lpptOrg)
-{ return ListView_GetOrigin(m_hwnd, lpptOrg);
-}
-COLORREF CCtrlListView::GetOutlineColor()
-{ return ListView_GetOutlineColor(m_hwnd);
-}
-UINT CCtrlListView::GetSelectedColumn()
-{ return ListView_GetSelectedColumn(m_hwnd);
-}
-UINT CCtrlListView::GetSelectedCount()
-{ return ListView_GetSelectedCount(m_hwnd);
-}
-INT CCtrlListView::GetSelectionMark()
-{ return ListView_GetSelectionMark(m_hwnd);
-}
-int CCtrlListView::GetStringWidth(LPCSTR psz)
-{ return ListView_GetStringWidth(m_hwnd, psz);
-}
-BOOL CCtrlListView::GetSubItemRect(int iItem, int iSubItem, int code, LPRECT lpRect)
-{ return ListView_GetSubItemRect(m_hwnd, iItem, iSubItem, code, lpRect);
-}
-COLORREF CCtrlListView::GetTextBkColor()
-{ return ListView_GetTextBkColor(m_hwnd);
-}
-COLORREF CCtrlListView::GetTextColor()
-{ return ListView_GetTextColor(m_hwnd);
-}
-void CCtrlListView::GetTileInfo(PLVTILEINFO plvtinfo)
-{ ListView_GetTileInfo(m_hwnd, plvtinfo);
-}
-void CCtrlListView::GetTileViewInfo(PLVTILEVIEWINFO plvtvinfo)
-{ ListView_GetTileViewInfo(m_hwnd, plvtvinfo);
-}
-HWND CCtrlListView::GetToolTips()
-{ return ListView_GetToolTips(m_hwnd);
-}
-int CCtrlListView::GetTopIndex()
-{ return ListView_GetTopIndex(m_hwnd);
-}
-BOOL CCtrlListView::GetUnicodeFormat()
-{ return ListView_GetUnicodeFormat(m_hwnd);
-}
-DWORD CCtrlListView::GetView()
-{ return ListView_GetView(m_hwnd);
-}
-BOOL CCtrlListView::GetViewRect(RECT *prc)
-{ return ListView_GetViewRect(m_hwnd, prc);
-}
-void CCtrlListView::GetWorkAreas(INT nWorkAreas, LPRECT lprc)
-{ ListView_GetWorkAreas(m_hwnd, nWorkAreas, lprc);
-}
-BOOL CCtrlListView::HasGroup(int dwGroupId)
-{ return ListView_HasGroup(m_hwnd, dwGroupId);
-}
-int CCtrlListView::HitTest(LPLVHITTESTINFO pinfo)
-{ return ListView_HitTest(m_hwnd, pinfo);
-}
-//int CCtrlListView::HitTestEx(LPLVHITTESTINFO pinfo)
-//{ return ListView_HitTestEx(m_hwnd, pinfo);
-//}
-int CCtrlListView::InsertColumn(int iCol, const LPLVCOLUMN pcol)
-{ return ListView_InsertColumn(m_hwnd, iCol, pcol);
-}
-int CCtrlListView::InsertGroup(int index, PLVGROUP pgrp)
-{ return ListView_InsertGroup(m_hwnd, index, pgrp);
-}
-void CCtrlListView::InsertGroupSorted(PLVINSERTGROUPSORTED structInsert)
-{ ListView_InsertGroupSorted(m_hwnd, structInsert);
-}
-int CCtrlListView::InsertItem(const LPLVITEM pitem)
-{ return ListView_InsertItem(m_hwnd, pitem);
-}
-BOOL CCtrlListView::InsertMarkHitTest(LPPOINT point, LVINSERTMARK *plvim)
-{ return ListView_InsertMarkHitTest(m_hwnd, point, plvim);
-}
-BOOL CCtrlListView::IsGroupViewEnabled()
-{ return ListView_IsGroupViewEnabled(m_hwnd);
-}
-//UINT CCtrlListView::IsItemVisible(UINT index)
-//{ return ListView_IsItemVisible(m_hwnd, index);
-//}
-UINT CCtrlListView::MapIDToIndex(UINT id)
-{ return ListView_MapIDToIndex(m_hwnd, id);
-}
-UINT CCtrlListView::MapIndexToID(UINT index)
-{ return ListView_MapIndexToID(m_hwnd, index);
-}
-BOOL CCtrlListView::RedrawItems(int iFirst, int iLast)
-{ return ListView_RedrawItems(m_hwnd, iFirst, iLast);
-}
-void CCtrlListView::RemoveAllGroups()
-{ ListView_RemoveAllGroups(m_hwnd);
-}
-int CCtrlListView::RemoveGroup(int iGroupId)
-{ return ListView_RemoveGroup(m_hwnd, iGroupId);
-}
-BOOL CCtrlListView::Scroll(int dx, int dy)
-{ return ListView_Scroll(m_hwnd, dx, dy);
-}
-BOOL CCtrlListView::SetBkColor(COLORREF clrBk)
-{ return ListView_SetBkColor(m_hwnd, clrBk);
-}
-BOOL CCtrlListView::SetBkImage(LPLVBKIMAGE plvbki)
-{ return ListView_SetBkImage(m_hwnd, plvbki);
-}
-BOOL CCtrlListView::SetCallbackMask(UINT mask)
-{ return ListView_SetCallbackMask(m_hwnd, mask);
-}
-void CCtrlListView::SetCheckState(UINT iIndex, BOOL fCheck)
-{ ListView_SetCheckState(m_hwnd, iIndex, fCheck);
-}
-BOOL CCtrlListView::SetColumn(int iCol, LPLVCOLUMN pcol)
-{ return ListView_SetColumn(m_hwnd, iCol, pcol);
-}
-BOOL CCtrlListView::SetColumnOrderArray(int iCount, int *lpiArray)
-{ return ListView_SetColumnOrderArray(m_hwnd, iCount, lpiArray);
-}
-BOOL CCtrlListView::SetColumnWidth(int iCol, int cx)
-{ return ListView_SetColumnWidth(m_hwnd, iCol, cx);
-}
-void CCtrlListView::SetExtendedListViewStyle(DWORD dwExStyle)
-{ ListView_SetExtendedListViewStyle(m_hwnd, dwExStyle);
-}
-void CCtrlListView::SetExtendedListViewStyleEx(DWORD dwExMask, DWORD dwExStyle)
-{ ListView_SetExtendedListViewStyleEx(m_hwnd, dwExMask, dwExStyle);
-}
-//HIMAGELIST CCtrlListView::SetGroupHeaderImageList(HIMAGELIST himl)
-//{ return ListView_SetGroupHeaderImageList(m_hwnd, himl);
-//}
-int CCtrlListView::SetGroupInfo(int iGroupId, PLVGROUP pgrp)
-{ return ListView_SetGroupInfo(m_hwnd, iGroupId, pgrp);
-}
-void CCtrlListView::SetGroupMetrics(PLVGROUPMETRICS pGroupMetrics)
-{ ListView_SetGroupMetrics(m_hwnd, pGroupMetrics);
-}
-//void CCtrlListView::SetGroupState(UINT dwGroupId, UINT dwMask, UINT dwState)
-//{ ListView_SetGroupState(m_hwnd, dwGroupId, dwMask, dwState);
-//}
-HCURSOR CCtrlListView::SetHotCursor(HCURSOR hCursor)
-{ return ListView_SetHotCursor(m_hwnd, hCursor);
-}
-INT CCtrlListView::SetHotItem(INT iIndex)
-{ return ListView_SetHotItem(m_hwnd, iIndex);
-}
-void CCtrlListView::SetHoverTime(DWORD dwHoverTime)
-{ ListView_SetHoverTime(m_hwnd, dwHoverTime);
-}
-DWORD CCtrlListView::SetIconSpacing(int cx, int cy)
-{ return ListView_SetIconSpacing(m_hwnd, cx, cy);
-}
-HIMAGELIST CCtrlListView::SetImageList(HIMAGELIST himl, int iImageList)
-{ return ListView_SetImageList(m_hwnd, himl, iImageList);
-}
-BOOL CCtrlListView::SetInfoTip(PLVSETINFOTIP plvSetInfoTip)
-{ return ListView_SetInfoTip(m_hwnd, plvSetInfoTip);
-}
-BOOL CCtrlListView::SetInsertMark(LVINSERTMARK *plvim)
-{ return ListView_SetInsertMark(m_hwnd, plvim);
-}
-COLORREF CCtrlListView::SetInsertMarkColor(COLORREF color)
-{ return ListView_SetInsertMarkColor(m_hwnd, color);
-}
-BOOL CCtrlListView::SetItem(const LPLVITEM pitem)
-{ return ListView_SetItem(m_hwnd, pitem);
-}
-void CCtrlListView::SetItemCount(int cItems)
-{ ListView_SetItemCount(m_hwnd, cItems);
-}
-void CCtrlListView::SetItemCountEx(int cItems, DWORD dwFlags)
-{ ListView_SetItemCountEx(m_hwnd, cItems, dwFlags);
-}
-//HRESULT CCtrlListView::SetItemIndexState(LVITEMINDEX *plvii, UINT data, UINT mask)
-//{ return ListView_SetItemIndexState(m_hwnd, plvii, data, mask);
-//}
-BOOL CCtrlListView::SetItemPosition(int i, int x, int y)
-{ return ListView_SetItemPosition(m_hwnd, i, x, y);
-}
-void CCtrlListView::SetItemPosition32(int iItem, int x, int y)
-{ ListView_SetItemPosition32(m_hwnd, iItem, x, y);
-}
-void CCtrlListView::SetItemState(int i, UINT state, UINT mask)
-{ ListView_SetItemState(m_hwnd, i, state, mask);
-}
-void CCtrlListView::SetItemText(int i, int iSubItem, TCHAR *pszText)
-{ ListView_SetItemText(m_hwnd, i, iSubItem, pszText);
-}
-COLORREF CCtrlListView::SetOutlineColor(COLORREF color)
-{ return ListView_SetOutlineColor(m_hwnd, color);
-}
-void CCtrlListView::SetSelectedColumn(int iCol)
-{ ListView_SetSelectedColumn(m_hwnd, iCol);
-}
-INT CCtrlListView::SetSelectionMark(INT iIndex)
-{ return ListView_SetSelectionMark(m_hwnd, iIndex);
-}
-BOOL CCtrlListView::SetTextBkColor(COLORREF clrText)
-{ return ListView_SetTextBkColor(m_hwnd, clrText);
-}
-BOOL CCtrlListView::SetTextColor(COLORREF clrText)
-{ return ListView_SetTextColor(m_hwnd, clrText);
-}
-BOOL CCtrlListView::SetTileInfo(PLVTILEINFO plvtinfo)
-{ return ListView_SetTileInfo(m_hwnd, plvtinfo);
-}
-BOOL CCtrlListView::SetTileViewInfo(PLVTILEVIEWINFO plvtvinfo)
-{ return ListView_SetTileViewInfo(m_hwnd, plvtvinfo);
-}
-HWND CCtrlListView::SetToolTips(HWND ToolTip)
-{ return ListView_SetToolTips(m_hwnd, ToolTip);
-}
-BOOL CCtrlListView::SetUnicodeFormat(BOOL fUnicode)
-{ return ListView_SetUnicodeFormat(m_hwnd, fUnicode);
-}
-int CCtrlListView::SetView(DWORD iView)
-{ return ListView_SetView(m_hwnd, iView);
-}
-void CCtrlListView::SetWorkAreas(INT nWorkAreas, LPRECT lprc)
-{ ListView_SetWorkAreas(m_hwnd, nWorkAreas, lprc);
-}
-int CCtrlListView::SortGroups(PFNLVGROUPCOMPARE pfnGroupCompare, LPVOID plv)
-{ return ListView_SortGroups(m_hwnd, pfnGroupCompare, plv);
-}
-BOOL CCtrlListView::SortItems(PFNLVCOMPARE pfnCompare, LPARAM lParamSort)
-{ return ListView_SortItems(m_hwnd, pfnCompare, lParamSort);
-}
-BOOL CCtrlListView::SortItemsEx(PFNLVCOMPARE pfnCompare, LPARAM lParamSort)
-{ return ListView_SortItemsEx(m_hwnd, pfnCompare, lParamSort);
-}
-INT CCtrlListView::SubItemHitTest(LPLVHITTESTINFO pInfo)
-{ return ListView_SubItemHitTest(m_hwnd, pInfo);
-}
-//INT CCtrlListView::SubItemHitTestEx(LPLVHITTESTINFO plvhti)
-//{ return ListView_SubItemHitTestEx(m_hwnd, plvhti);
-//}
-BOOL CCtrlListView::Update(int iItem)
-{ return ListView_Update(m_hwnd, iItem);
-}
-/////////////////////////////////////////////////////////////////////////////////////////
-// CCtrlTreeView
-
-CCtrlTreeView::CCtrlTreeView( CDlgBase* dlg, int ctrlId ):
- CCtrlBase(dlg, ctrlId)
-{
-}
-
-BOOL CCtrlTreeView::OnNotify(int, NMHDR *pnmh)
-{
- TEventInfo evt = { this, pnmh };
-
- switch (pnmh->code)
- {
- case TVN_BEGINDRAG: OnBeginDrag(&evt); return TRUE;
- case TVN_BEGINLABELEDIT: OnBeginLabelEdit(&evt); return TRUE;
- case TVN_BEGINRDRAG: OnBeginRDrag(&evt); return TRUE;
- case TVN_DELETEITEM: OnDeleteItem(&evt); return TRUE;
- case TVN_ENDLABELEDIT: OnEndLabelEdit(&evt); return TRUE;
- case TVN_GETDISPINFO: OnGetDispInfo(&evt); return TRUE;
- case TVN_GETINFOTIP: OnGetInfoTip(&evt); return TRUE;
- case TVN_ITEMEXPANDED: OnItemExpanded(&evt); return TRUE;
- case TVN_ITEMEXPANDING: OnItemExpanding(&evt); return TRUE;
- case TVN_KEYDOWN: OnKeyDown(&evt); return TRUE;
- case TVN_SELCHANGED: OnSelChanged(&evt); return TRUE;
- case TVN_SELCHANGING: OnSelChanging(&evt); return TRUE;
- case TVN_SETDISPINFO: OnSetDispInfo(&evt); return TRUE;
- case TVN_SINGLEEXPAND: OnSingleExpand(&evt); return TRUE;
- }
-
- return FALSE;
-}
-
-void CCtrlTreeView::TranslateItem(HTREEITEM hItem)
-{
- TCHAR buf[128];
- TVITEMEX tvi;
-
- GetItem(hItem, &tvi, buf, SIZEOF(buf));
- tvi.pszText = TranslateTS(tvi.pszText);
- SetItem(&tvi);
-}
-
-void CCtrlTreeView::TranslateTree()
-{
- HTREEITEM hItem = GetRoot();
- while (hItem)
- {
- TranslateItem(hItem);
-
- HTREEITEM hItemTmp = 0;
- if (hItemTmp = GetChild(hItem))
- hItem = hItemTmp;
- else if (hItemTmp = GetNextSibling(hItem))
- hItem = hItemTmp;
- else
- {
- for (;;)
- {
- if (!(hItem = GetParent(hItem))) break;
- if (hItemTmp = GetNextSibling(hItem))
- {
- hItem = hItemTmp;
- break;
- }
- }
- }
- }
-}
-
-HTREEITEM CCtrlTreeView::FindNamedItem(HTREEITEM hItem, const TCHAR *name)
-{
- TVITEMEX tvi = {0};
- TCHAR str[MAX_PATH];
-
- if (hItem)
- tvi.hItem = GetChild(hItem);
- else
- tvi.hItem = GetRoot();
-
- if (!name)
- return tvi.hItem;
-
- tvi.mask = TVIF_TEXT;
- tvi.pszText = str;
- tvi.cchTextMax = SIZEOF(str);
-
- while (tvi.hItem)
- {
- GetItem(&tvi);
-
- if (!mir_tstrcmp(tvi.pszText, name))
- return tvi.hItem;
-
- tvi.hItem = GetNextSibling(tvi.hItem);
- }
- return NULL;
-}
-
-void CCtrlTreeView::GetItem(HTREEITEM hItem, TVITEMEX *tvi)
-{
- memset(tvi, 0, sizeof(*tvi));
- tvi->mask = TVIF_CHILDREN|TVIF_HANDLE|TVIF_IMAGE|TVIF_INTEGRAL|TVIF_PARAM|TVIF_SELECTEDIMAGE|TVIF_STATE;
- tvi->hItem = hItem;
- GetItem(tvi);
-}
-
-void CCtrlTreeView::GetItem(HTREEITEM hItem, TVITEMEX *tvi, TCHAR *szText, int iTextLength)
-{
- memset(tvi, 0, sizeof(*tvi));
- tvi->mask = TVIF_CHILDREN|TVIF_HANDLE|TVIF_IMAGE|TVIF_INTEGRAL|TVIF_PARAM|TVIF_SELECTEDIMAGE|TVIF_STATE|TVIF_TEXT;
- tvi->hItem = hItem;
- tvi->pszText = szText;
- tvi->cchTextMax = iTextLength;
- GetItem(tvi);
-}
-
-HIMAGELIST CCtrlTreeView::CreateDragImage(HTREEITEM hItem)
-{ return TreeView_CreateDragImage(m_hwnd, hItem);
-}
-
-void CCtrlTreeView::DeleteAllItems()
-{ TreeView_DeleteAllItems(m_hwnd);
-}
-
-void CCtrlTreeView::DeleteItem(HTREEITEM hItem)
-{ TreeView_DeleteItem(m_hwnd, hItem);
-}
-
-HWND CCtrlTreeView::EditLabel(HTREEITEM hItem)
-{ return TreeView_EditLabel(m_hwnd, hItem);
-}
-
-void CCtrlTreeView::EndEditLabelNow(BOOL cancel)
-{ TreeView_EndEditLabelNow(m_hwnd, cancel);
-}
-
-void CCtrlTreeView::EnsureVisible(HTREEITEM hItem)
-{ TreeView_EnsureVisible(m_hwnd, hItem);
-}
-
-void CCtrlTreeView::Expand(HTREEITEM hItem, DWORD flag)
-{ TreeView_Expand(m_hwnd, hItem, flag);
-}
-
-COLORREF CCtrlTreeView::GetBkColor()
-{ return TreeView_GetBkColor(m_hwnd);
-}
-
-DWORD CCtrlTreeView::GetCheckState(HTREEITEM hItem)
-{ return TreeView_GetCheckState(m_hwnd, hItem);
-}
-
-HTREEITEM CCtrlTreeView::GetChild(HTREEITEM hItem)
-{ return TreeView_GetChild(m_hwnd, hItem);
-}
-
-int CCtrlTreeView::GetCount()
-{ return TreeView_GetCount(m_hwnd);
-}
-
-HTREEITEM CCtrlTreeView::GetDropHilight()
-{ return TreeView_GetDropHilight(m_hwnd);
-}
-
-HWND CCtrlTreeView::GetEditControl()
-{ return TreeView_GetEditControl(m_hwnd);
-}
-
-HTREEITEM CCtrlTreeView::GetFirstVisible()
-{ return TreeView_GetFirstVisible(m_hwnd);
-}
-
-HIMAGELIST CCtrlTreeView::GetImageList(int iImage)
-{ return TreeView_GetImageList(m_hwnd, iImage);
-}
-
-int CCtrlTreeView::GetIndent()
-{ return TreeView_GetIndent(m_hwnd);
-}
-
-COLORREF CCtrlTreeView::GetInsertMarkColor()
-{ return TreeView_GetInsertMarkColor(m_hwnd);
-}
-
-void CCtrlTreeView::GetItem(TVITEMEX *tvi)
-{ TreeView_GetItem(m_hwnd, tvi);
-}
-
-int CCtrlTreeView::GetItemHeight()
-{ return TreeView_GetItemHeight(m_hwnd);
-}
-
-void CCtrlTreeView::GetItemRect(HTREEITEM hItem, RECT *rcItem, BOOL fItemRect)
-{ TreeView_GetItemRect(m_hwnd, hItem, rcItem, fItemRect);
-}
-
-DWORD CCtrlTreeView::GetItemState(HTREEITEM hItem, DWORD stateMask)
-{ return TreeView_GetItemState(m_hwnd, hItem, stateMask);
-}
-
-HTREEITEM CCtrlTreeView::GetLastVisible()
-{ return TreeView_GetLastVisible(m_hwnd);
-}
-
-COLORREF CCtrlTreeView::GetLineColor()
-{ return TreeView_GetLineColor(m_hwnd);
-}
-
-HTREEITEM CCtrlTreeView::GetNextItem(HTREEITEM hItem, DWORD flag)
-{ return TreeView_GetNextItem(m_hwnd, hItem, flag);
-}
-
-HTREEITEM CCtrlTreeView::GetNextSibling(HTREEITEM hItem)
-{ return TreeView_GetNextSibling(m_hwnd, hItem);
-}
-
-HTREEITEM CCtrlTreeView::GetNextVisible(HTREEITEM hItem)
-{ return TreeView_GetNextVisible(m_hwnd, hItem);
-}
-
-HTREEITEM CCtrlTreeView::GetParent(HTREEITEM hItem)
-{ return TreeView_GetParent(m_hwnd, hItem);
-}
-
-HTREEITEM CCtrlTreeView::GetPrevSibling(HTREEITEM hItem)
-{ return TreeView_GetPrevSibling(m_hwnd, hItem);
-}
-
-HTREEITEM CCtrlTreeView::GetPrevVisible(HTREEITEM hItem)
-{ return TreeView_GetPrevVisible(m_hwnd, hItem);
-}
-
-HTREEITEM CCtrlTreeView::GetRoot()
-{ return TreeView_GetRoot(m_hwnd);
-}
-
-DWORD CCtrlTreeView::GetScrollTime()
-{ return TreeView_GetScrollTime(m_hwnd);
-}
-
-HTREEITEM CCtrlTreeView::GetSelection()
-{ return TreeView_GetSelection(m_hwnd);
-}
-
-COLORREF CCtrlTreeView::GetTextColor()
-{ return TreeView_GetTextColor(m_hwnd);
-}
-
-HWND CCtrlTreeView::GetToolTips()
-{ return TreeView_GetToolTips(m_hwnd);
-}
-
-BOOL CCtrlTreeView::GetUnicodeFormat()
-{ return TreeView_GetUnicodeFormat(m_hwnd);
-}
-
-unsigned CCtrlTreeView::GetVisibleCount()
-{ return TreeView_GetVisibleCount(m_hwnd);
-}
-
-HTREEITEM CCtrlTreeView::HitTest(TVHITTESTINFO *hti)
-{ return TreeView_HitTest(m_hwnd, hti);
-}
-
-HTREEITEM CCtrlTreeView::InsertItem(TVINSERTSTRUCT *tvis)
-{ return TreeView_InsertItem(m_hwnd, tvis);
-}
-
-/*
-HTREEITEM CCtrlTreeView::MapAccIDToHTREEITEM(UINT id)
-{ return TreeView_MapAccIDToHTREEITEM(m_hwnd, id);
-}
-
-UINT CCtrlTreeView::MapHTREEITEMtoAccID(HTREEITEM hItem)
-{ return TreeView_MapHTREEITEMtoAccID(m_hwnd, hItem);
-}
-
-*/
-void CCtrlTreeView::Select(HTREEITEM hItem, DWORD flag)
-{ TreeView_Select(m_hwnd, hItem, flag);
-}
-
-void CCtrlTreeView::SelectDropTarget(HTREEITEM hItem)
-{ TreeView_SelectDropTarget(m_hwnd, hItem);
-}
-
-void CCtrlTreeView::SelectItem(HTREEITEM hItem)
-{ TreeView_SelectItem(m_hwnd, hItem);
-}
-
-void CCtrlTreeView::SelectSetFirstVisible(HTREEITEM hItem)
-{ TreeView_SelectSetFirstVisible(m_hwnd, hItem);
-}
-
-COLORREF CCtrlTreeView::SetBkColor(COLORREF clBack)
-{ return TreeView_SetBkColor(m_hwnd, clBack);
-}
-
-void CCtrlTreeView::SetCheckState(HTREEITEM hItem, DWORD state)
-{ TreeView_SetCheckState(m_hwnd, hItem, state);
-}
-
-void CCtrlTreeView::SetImageList(HIMAGELIST hIml, int iImage)
-{ TreeView_SetImageList(m_hwnd, hIml, iImage);
-}
-
-void CCtrlTreeView::SetIndent(int iIndent)
-{ TreeView_SetIndent(m_hwnd, iIndent);
-}
-
-void CCtrlTreeView::SetInsertMark(HTREEITEM hItem, BOOL fAfter)
-{ TreeView_SetInsertMark(m_hwnd, hItem, fAfter);
-}
-
-COLORREF CCtrlTreeView::SetInsertMarkColor(COLORREF clMark)
-{ return TreeView_SetInsertMarkColor(m_hwnd, clMark);
-}
-
-void CCtrlTreeView::SetItem(TVITEMEX *tvi)
-{ TreeView_SetItem(m_hwnd, tvi);
-}
-
-void CCtrlTreeView::SetItemHeight(short cyItem)
-{ TreeView_SetItemHeight(m_hwnd, cyItem);
-}
-
-void CCtrlTreeView::SetItemState(HTREEITEM hItem, DWORD state, DWORD stateMask)
-{ TreeView_SetItemState(m_hwnd, hItem, state, stateMask);
-}
-
-COLORREF CCtrlTreeView::SetLineColor(COLORREF clLine)
-{ return TreeView_SetLineColor(m_hwnd, clLine);
-}
-
-void CCtrlTreeView::SetScrollTime(UINT uMaxScrollTime)
-{ TreeView_SetScrollTime(m_hwnd, uMaxScrollTime);
-}
-
-COLORREF CCtrlTreeView::SetTextColor(COLORREF clText)
-{ return TreeView_SetTextColor(m_hwnd, clText);
-}
-
-HWND CCtrlTreeView::SetToolTips(HWND hwndToolTips)
-{ return TreeView_SetToolTips(m_hwnd, hwndToolTips);
-}
-
-BOOL CCtrlTreeView::SetUnicodeFormat(BOOL fUnicode)
-{ return TreeView_SetUnicodeFormat(m_hwnd, fUnicode);
-}
-
-void CCtrlTreeView::SortChildren(HTREEITEM hItem, BOOL fRecurse)
-{ TreeView_SortChildren(m_hwnd, hItem, fRecurse);
-}
-
-void CCtrlTreeView::SortChildrenCB(TVSORTCB *cb, BOOL fRecurse)
-{ TreeView_SortChildrenCB(m_hwnd, cb, fRecurse);
-}
-
-/////////////////////////////////////////////////////////////////////////////////////////
-// CCtrlBase
-
-CCtrlBase::CCtrlBase(CDlgBase *wnd, int idCtrl) :
- m_parentWnd( wnd ),
- m_idCtrl( idCtrl ),
- m_hwnd( NULL ),
- m_wndproc( NULL )
-{
- if ( wnd ) {
- m_next = wnd->m_first;
- wnd->m_first = this;
-} }
-
-void CCtrlBase::OnInit()
-{
- m_hwnd = (m_idCtrl && m_parentWnd && m_parentWnd->GetHwnd()) ? GetDlgItem(m_parentWnd->GetHwnd(), m_idCtrl) : NULL;
-}
-
-void CCtrlBase::OnDestroy()
-{
- Unsubclass();
- m_hwnd = NULL;
-}
-
-void CCtrlBase::Enable( int bIsEnable )
-{
- ::EnableWindow( m_hwnd, bIsEnable );
-}
-
-BOOL CCtrlBase::Enabled() const
-{
- return ( m_hwnd ) ? IsWindowEnabled( m_hwnd ) : FALSE;
-}
-
-LRESULT CCtrlBase::SendMsg( UINT Msg, WPARAM wParam, LPARAM lParam )
-{
- return ::SendMessage( m_hwnd, Msg, wParam, lParam );
-}
-
-void CCtrlBase::SetText(const TCHAR *text)
-{
- ::SetWindowText( m_hwnd, text );
-}
-
-void CCtrlBase::SetTextA(const char *text)
-{
- ::SetWindowTextA( m_hwnd, text );
-}
-
-void CCtrlBase::SetInt(int value)
-{
- TCHAR buf[32] = {0};
- mir_sntprintf(buf, SIZEOF(buf), _T("%d"), value);
- SetWindowText(m_hwnd, buf);
-}
-
-TCHAR* CCtrlBase::GetText()
-{
- int length = GetWindowTextLength(m_hwnd) + 1;
- TCHAR *result = (TCHAR *)mir_alloc(length * sizeof(TCHAR));
- GetWindowText(m_hwnd, result, length);
- return result;
-}
-
-char* CCtrlBase::GetTextA()
-{
- int length = GetWindowTextLength(m_hwnd) + 1;
- char *result = (char *)mir_alloc(length * sizeof(char));
- GetWindowTextA(m_hwnd, result, length);
- return result;
-}
-
-TCHAR* CCtrlBase::GetText(TCHAR *buf, int size)
-{
- GetWindowText(m_hwnd, buf, size);
- buf[size-1] = 0;
- return buf;
-}
-
-char* CCtrlBase::GetTextA(char *buf, int size)
-{
- GetWindowTextA(m_hwnd, buf, size);
- buf[size-1] = 0;
- return buf;
-}
-
-int CCtrlBase::GetInt()
-{
- int length = GetWindowTextLength(m_hwnd) + 1;
- TCHAR *result = (TCHAR *)_alloca(length * sizeof(TCHAR));
- GetWindowText(m_hwnd, result, length);
- return _ttoi(result);
-}
-
-LRESULT CCtrlBase::CustomWndProc(UINT msg, WPARAM wParam, LPARAM lParam)
-{
- if (msg == WM_DESTROY) Unsubclass();
- return CallWindowProc(m_wndproc, m_hwnd, msg, wParam, lParam);
-}
-
-void CCtrlBase::Subclass()
-{
- SetWindowLongPtr(m_hwnd, GWLP_USERDATA, (LONG_PTR)this);
- m_wndproc = (WNDPROC)SetWindowLongPtr(m_hwnd, GWLP_WNDPROC, (LONG_PTR)GlobalSubclassWndProc);
-}
-
-void CCtrlBase::Unsubclass()
-{
- if (m_wndproc)
- {
- SetWindowLongPtr(m_hwnd, GWLP_WNDPROC, (LONG_PTR)m_wndproc);
- SetWindowLongPtr(m_hwnd, GWLP_USERDATA, 0);
- m_wndproc = 0;
-} }
-
-/////////////////////////////////////////////////////////////////////////////////////////
-// CDbLink class
-
-CDbLink::CDbLink(const char *szModule, const char *szSetting, BYTE type, DWORD iValue)
-{
- m_szModule = mir_strdup(szModule);
- m_szSetting = mir_strdup(szSetting);
- m_type = type;
- m_iDefault = iValue;
- m_szDefault = 0;
- dbv.type = DBVT_DELETED;
-}
-
-CDbLink::CDbLink(const char *szModule, const char *szSetting, BYTE type, TCHAR *szValue)
-{
- m_szModule = mir_strdup(szModule);
- m_szSetting = mir_strdup(szSetting);
- m_type = type;
- m_szDefault = mir_tstrdup(szValue);
- dbv.type = DBVT_DELETED;
-}
-
-CDbLink::~CDbLink()
-{
- mir_free(m_szModule);
- mir_free(m_szSetting);
- mir_free(m_szDefault);
- if (dbv.type != DBVT_DELETED)
- db_free(&dbv);
-}
-
-DWORD CDbLink::LoadInt()
-{
- switch (m_type) {
- case DBVT_BYTE: return db_get_b(NULL, m_szModule, m_szSetting, m_iDefault);
- case DBVT_WORD: return db_get_w(NULL, m_szModule, m_szSetting, m_iDefault);
- case DBVT_DWORD: return db_get_dw(NULL, m_szModule, m_szSetting, m_iDefault);
- default: return m_iDefault;
- }
-}
-
-void CDbLink::SaveInt(DWORD value)
-{
- switch (m_type) {
- case DBVT_BYTE: db_set_b(NULL, m_szModule, m_szSetting, (BYTE)value); break;
- case DBVT_WORD: db_set_w(NULL, m_szModule, m_szSetting, (WORD)value); break;
- case DBVT_DWORD: db_set_dw(NULL, m_szModule, m_szSetting, value); break;
- }
-}
-
-TCHAR* CDbLink::LoadText()
-{
- if (dbv.type != DBVT_DELETED) db_free(&dbv);
- if (!db_get_ts(NULL, m_szModule, m_szSetting, &dbv))
- {
- if (dbv.type == DBVT_TCHAR)
- return dbv.ptszVal;
- return m_szDefault;
- }
-
- dbv.type = DBVT_DELETED;
- return m_szDefault;
-}
-
-void CDbLink::SaveText(TCHAR *value)
-{
- db_set_ts(NULL, m_szModule, m_szSetting, value);
-}
-
-/////////////////////////////////////////////////////////////////////////////////////////
-// Misc utilities
-
-int UIEmulateBtnClick(HWND hwndDlg, UINT idcButton)
-{
- if (IsWindowEnabled(GetDlgItem(hwndDlg, idcButton)))
- PostMessage(hwndDlg, WM_COMMAND, MAKEWPARAM(idcButton, BN_CLICKED), (LPARAM)GetDlgItem(hwndDlg, idcButton));
- return 0;
-}
-
-void UIShowControls(HWND hwndDlg, int *idList, int nCmdShow)
-{
- for (; *idList; ++idList)
- ShowWindow(GetDlgItem(hwndDlg, *idList), nCmdShow);
-}
diff --git a/protocols/IRCG/src/ui_utils.h b/protocols/IRCG/src/ui_utils.h
deleted file mode 100644
index ef70439f61..0000000000
--- a/protocols/IRCG/src/ui_utils.h
+++ /dev/null
@@ -1,1102 +0,0 @@
-/*
-
-Jabber Protocol Plugin for Miranda IM
-Copyright ( C ) 2002-04 Santithorn Bunchua
-Copyright ( C ) 2005-08 George Hazan
-Copyright ( C ) 2007-08 Maxim Mluhov
-Copyright ( C ) 2007-08 Victor Pavlychko
-
-This program is free software; you can redistribute it and/or
-modify it under the terms of the GNU General Public License
-as published by the Free Software Foundation; either version 2
-of the License, or ( at your option ) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-
-#ifndef __jabber_ui_utils_h__
-#define __jabber_ui_utils_h__
-
-#include "m_clc.h"
-
-#ifndef LPLVCOLUMN
-typedef struct tagNMLVSCROLL
-{
- NMHDR hdr;
- int dx;
- int dy;
-} NMLVSCROLL;
-typedef struct tagLVG
-{
- UINT cbSize;
- UINT mask;
- LPWSTR pszHeader;
- int cchHeader;
- LPWSTR pszFooter;
- int cchFooter;
- int iGroupId;
- UINT stateMask;
- UINT state;
- UINT uAlign;
-} LVGROUP, *PLVGROUP;
-typedef struct tagLVGROUPMETRICS
-{
- UINT cbSize;
- UINT mask;
- UINT Left;
- UINT Top;
- UINT Right;
- UINT Bottom;
- COLORREF crLeft;
- COLORREF crTop;
- COLORREF crRight;
- COLORREF crBottom;
- COLORREF crHeader;
- COLORREF crFooter;
-} LVGROUPMETRICS, *PLVGROUPMETRICS;
-typedef struct tagLVTILEVIEWINFO
-{
- UINT cbSize;
- DWORD dwMask;
- DWORD dwFlags;
- SIZE sizeTile;
- int cLines;
- RECT rcLabelMargin;
-} LVTILEVIEWINFO, *PLVTILEVIEWINFO;
-typedef struct tagLVTILEINFO
-{
- UINT cbSize;
- int iItem;
- UINT cColumns;
- PUINT puColumns;
-} LVTILEINFO, *PLVTILEINFO;
-typedef struct
-{
- UINT cbSize;
- DWORD dwFlags;
- int iItem;
- DWORD dwReserved;
-} LVINSERTMARK, * LPLVINSERTMARK;
-typedef int (CALLBACK *PFNLVGROUPCOMPARE)(int, int, void *);
-typedef struct tagLVINSERTGROUPSORTED
-{
- PFNLVGROUPCOMPARE pfnGroupCompare;
- void *pvData;
- LVGROUP lvGroup;
-} LVINSERTGROUPSORTED, *PLVINSERTGROUPSORTED;
-typedef struct tagLVSETINFOTIP
-{
- UINT cbSize;
- DWORD dwFlags;
- LPWSTR pszText;
- int iItem;
- int iSubItem;
-} LVSETINFOTIP, *PLVSETINFOTIP;
-#define LPLVCOLUMN LPLVCOLUMNA
-#define LPLVITEM LPLVITEMA
-#define LVN_BEGINSCROLL (LVN_FIRST-80)
-#define LVN_ENDSCROLL (LVN_FIRST-81)
-#define LVN_HOTTRACK (LVN_FIRST-21)
-#define LVN_MARQUEEBEGIN (LVN_FIRST-56)
-#define LVM_MAPINDEXTOID (LVM_FIRST + 180)
-#define ListView_MapIndexToID(hwnd, index) \
- (UINT)SendMessage((hwnd), LVM_MAPINDEXTOID, (WPARAM)index, 0)
-#define TreeView_GetLineColor(hwnd) \
- (COLORREF)SendMessage((hwnd), TVM_GETLINECOLOR, 0, 0)
-#define TreeView_SetLineColor(hwnd, clr) \
- (COLORREF)SendMessage((hwnd), TVM_SETLINECOLOR, 0, (LPARAM)(clr))
-#endif
-
-
-#pragma warning(disable:4355)
-
-/////////////////////////////////////////////////////////////////////////////////////////
-// Callbacks
-
-struct CCallbackImp
-{
- struct CDummy
- { int foo;
- };
-
-public:
- __inline CCallbackImp(): m_object(NULL), m_func(NULL) {}
-
- __inline CCallbackImp(const CCallbackImp &other): m_object(other.m_object), m_func(other.m_func) {}
- __inline CCallbackImp &operator=(const CCallbackImp &other) { m_object = other.m_object; m_func = other.m_func; return *this; }
-
- __inline bool operator==(const CCallbackImp &other) const { return (m_object == other.m_object) && (m_func == other.m_func); }
- __inline bool operator!=(const CCallbackImp &other) const { return (m_object != other.m_object) || (m_func != other.m_func); }
-
- __inline operator bool() const { return m_object && m_func; }
-
- __inline bool CheckObject(void *object) const { return (object == m_object) ? true : false; }
-
-protected:
- template<typename TClass, typename TArgument>
- __inline CCallbackImp(TClass *object, void ( TClass::*func)(TArgument *argument)): m_object(( CDummy* )object), m_func((TFnCallback)func) {}
-
- __inline void Invoke(void *argument) const { if (m_func && m_object) (m_object->*m_func)(argument); }
-
-private:
- typedef void ( CDummy::*TFnCallback)( void *argument );
-
- CDummy* m_object;
- TFnCallback m_func;
-};
-
-template<typename TArgument>
-struct CCallback: public CCallbackImp
-{
-public:
- __inline CCallback() {}
-
- template<typename TClass>
- __inline CCallback(TClass *object, void ( TClass::*func)(TArgument *argument)): CCallbackImp(object, func) {}
-
- __inline CCallback& operator=( const CCallbackImp& x ) { CCallbackImp::operator =( x ); return *this; }
-
- __inline void operator()(TArgument *argument) const { Invoke((void *)argument); }
-};
-
-template<typename TClass, typename TArgument>
-__inline CCallback<TArgument> Callback(TClass *object, void (TClass::*func)(TArgument *argument))
- { return CCallback<TArgument>(object, func); }
-
-/////////////////////////////////////////////////////////////////////////////////////////
-// CDlgBase - base dialog class
-
-class CDlgBase
-{
- friend class CCtrlBase;
- friend class CCtrlData;
-
-public:
- CDlgBase(int idDialog, HWND hwndParent);
- virtual ~CDlgBase();
-
- // general utilities
- void Create();
- void Show();
- int DoModal();
-
- __inline HWND GetHwnd() const { return m_hwnd; }
- __inline bool IsInitialized() const { return m_initialized; }
- __inline void Close() { SendMessage(m_hwnd, WM_CLOSE, 0, 0); }
- __inline const MSG *ActiveMessage() const { return &m_msg; }
-
- // dynamic creation support (mainly to avoid leaks in options)
- struct CreateParam
- {
- CDlgBase *(*create)(void *param);
- void *param;
- };
- static INT_PTR CALLBACK DynamicDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
- {
- if (msg == WM_INITDIALOG)
- {
- CreateParam *param = (CreateParam *)lParam;
- CDlgBase *wnd = param->create(param->param);
- SetWindowLongPtr(hwnd, DWLP_DLGPROC, (LONG_PTR)GlobalDlgProc);
- return GlobalDlgProc(hwnd, msg, wParam, (LPARAM)wnd);
- }
-
- return FALSE;
- }
-
- LRESULT m_lresult;
-
-protected:
- HWND m_hwnd;
- HWND m_hwndParent;
- int m_idDialog;
- MSG m_msg;
- bool m_isModal;
- bool m_initialized;
- bool m_forceResizable;
-
- enum { CLOSE_ON_OK = 0x1, CLOSE_ON_CANCEL = 0x2 };
- BYTE m_autoClose; // automatically close dialog on IDOK/CANCEL commands. default: CLOSE_ON_OK|CLOSE_ON_CANCEL
-
- CCtrlBase* m_first;
-
- // override this handlers to provide custom functionality
- // general messages
- virtual void OnInitDialog() { }
- virtual void OnClose() { }
- virtual void OnDestroy() { }
-
- // miranda-related stuff
- virtual int Resizer(UTILRESIZECONTROL *urc);
- virtual void OnApply() {}
- virtual void OnReset() {}
- virtual void OnChange(CCtrlBase*) {}
-
- // main dialog procedure
- virtual INT_PTR DlgProc(UINT msg, WPARAM wParam, LPARAM lParam);
-
- // resister controls
- void AddControl(CCtrlBase *ctrl);
-
-private:
- LIST<CCtrlBase> m_controls;
-
- void NotifyControls(void (CCtrlBase::*fn)());
- CCtrlBase *FindControl(int idCtrl);
-
- static INT_PTR CALLBACK GlobalDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);
- static int GlobalDlgResizer(HWND hwnd, LPARAM lParam, UTILRESIZECONTROL *urc);
-};
-
-/////////////////////////////////////////////////////////////////////////////////////////
-// CDbLink
-
-class CDbLink
-{
- char *m_szModule;
- char *m_szSetting;
- BYTE m_type;
-
- DWORD m_iDefault;
- TCHAR *m_szDefault;
-
- DBVARIANT dbv;
-
-public:
- CDbLink(const char *szModule, const char *szSetting, BYTE type, DWORD iValue);
- CDbLink(const char *szModule, const char *szSetting, BYTE type, TCHAR *szValue);
- ~CDbLink();
-
- __inline BYTE GetDataType() { return m_type; }
-
- DWORD LoadInt();
- void SaveInt(DWORD value);
-
- TCHAR *LoadText();
- void SaveText(TCHAR *value);
-};
-
-/////////////////////////////////////////////////////////////////////////////////////////
-// CCtrlBase
-
-class CCtrlBase
-{
- friend class CDlgBase;
-
-public:
- CCtrlBase(CDlgBase *wnd, int idCtrl );
- virtual ~CCtrlBase() { Unsubclass(); }
-
- __inline int GetCtrlId() const { return m_idCtrl; }
- __inline HWND GetHwnd() const { return m_hwnd; }
- __inline CDlgBase *GetParent() { return m_parentWnd; }
-
- void Enable( int bIsEnable = true );
- __inline void Disable() { Enable( false ); }
- BOOL Enabled( void ) const;
-
- LRESULT SendMsg( UINT Msg, WPARAM wParam, LPARAM lParam );
-
- void SetText(const TCHAR *text);
- void SetTextA(const char *text);
- void SetInt(int value);
-
- TCHAR *GetText();
- char *GetTextA();
-
- TCHAR *GetText(TCHAR *buf, int size);
- char *GetTextA(char *buf, int size);
-
- int GetInt();
-
- virtual BOOL OnCommand(HWND /*hwndCtrl*/, WORD /*idCtrl*/, WORD /*idCode*/) { return FALSE; }
- virtual BOOL OnNotify(int /*idCtrl*/, NMHDR* /*pnmh*/) { return FALSE; }
-
- virtual BOOL OnMeasureItem(MEASUREITEMSTRUCT*) { return FALSE; }
- virtual BOOL OnDrawItem(DRAWITEMSTRUCT*) { return FALSE; }
- virtual BOOL OnDeleteItem(DELETEITEMSTRUCT*) { return FALSE; }
-
- virtual void OnInit();
- virtual void OnDestroy();
-
- virtual void OnApply() {}
- virtual void OnReset() {}
-
- static int cmp(const CCtrlBase *c1, const CCtrlBase *c2)
- {
- if (c1->m_idCtrl < c2->m_idCtrl) return -1;
- if (c1->m_idCtrl > c2->m_idCtrl) return +1;
- return 0;
- }
-
-protected:
- HWND m_hwnd;
- int m_idCtrl;
- CCtrlBase* m_next;
- CDlgBase* m_parentWnd;
-
- virtual LRESULT CustomWndProc(UINT msg, WPARAM wParam, LPARAM lParam);
- void Subclass();
- void Unsubclass();
-
-private:
- WNDPROC m_wndproc;
- static LRESULT CALLBACK GlobalSubclassWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
- {
- if (CCtrlBase *ctrl = (CCtrlBase*)GetWindowLongPtr(hwnd, GWLP_USERDATA))
- if (ctrl)
- return ctrl->CustomWndProc(msg, wParam, lParam);
-
- return DefWindowProc(hwnd, msg, wParam, lParam);
- }
-};
-
-/////////////////////////////////////////////////////////////////////////////////////////
-// CCtrlButton
-
-class CCtrlButton : public CCtrlBase
-{
-public:
- CCtrlButton( CDlgBase* dlg, int ctrlId );
-
- virtual BOOL OnCommand(HWND hwndCtrl, WORD idCtrl, WORD idCode);
-
- CCallback<CCtrlButton> OnClick;
-
- int GetState();
- void SetState(int state);
-};
-
-class CCtrlMButton : public CCtrlButton
-{
-public:
- CCtrlMButton( CDlgBase* dlg, int ctrlId, HICON hIcon, const char* tooltip );
- CCtrlMButton( CDlgBase* dlg, int ctrlId, int iCoreIcon, const char* tooltip );
- ~CCtrlMButton();
-
- void MakeFlat();
- void MakePush();
-
- virtual void OnInit();
-
-protected:
- HICON m_hIcon;
- const char* m_toolTip;
-};
-
-class CCtrlHyperlink : public CCtrlBase
-{
-public:
- CCtrlHyperlink( CDlgBase* dlg, int ctrlId, const char* url );
-
- virtual BOOL OnCommand(HWND hwndCtrl, WORD idCtrl, WORD idCode);
-
-protected:
- const char* m_url;
-};
-
-/////////////////////////////////////////////////////////////////////////////////////////
-// CCtrlClc
-class CCtrlClc: public CCtrlBase
-{
-public:
- CCtrlClc( CDlgBase* dlg, int ctrlId );
-
- void AddContact(MCONTACT hContact);
- void AddGroup(HANDLE hGroup);
- void AutoRebuild();
- void DeleteItem(HANDLE hItem);
- void EditLabel(HANDLE hItem);
- void EndEditLabel(bool save);
- void EnsureVisible(HANDLE hItem, bool partialOk);
- void Expand(HANDLE hItem, DWORD flags);
- HANDLE FindContact(MCONTACT hContact);
- HANDLE FindGroup(HANDLE hGroup);
- COLORREF GetBkColor();
- bool GetCheck(HANDLE hItem);
- int GetCount();
- HWND GetEditControl();
- DWORD GetExpand(HANDLE hItem);
- int GetExtraColumns();
- BYTE GetExtraImage(HANDLE hItem, int iColumn);
- HIMAGELIST GetExtraImageList();
- HFONT GetFont(int iFontId);
- HANDLE GetSelection();
- HANDLE HitTest(int x, int y, DWORD *hitTest);
- void SelectItem(HANDLE hItem);
- void SetBkBitmap(DWORD mode, HBITMAP hBitmap);
- void SetBkColor(COLORREF clBack);
- void SetCheck(HANDLE hItem, bool check);
- void SetExtraColumns(int iColumns);
- void SetExtraImage(HANDLE hItem, int iColumn, int iImage);
- void SetExtraImageList(HIMAGELIST hImgList);
- void SetFont(int iFontId, HANDLE hFont, bool bRedraw);
- void SetIndent(int iIndent);
- void SetItemText(HANDLE hItem, char *szText);
- void SetHideEmptyGroups(bool state);
- void SetGreyoutFlags(DWORD flags);
- bool GetHideOfflineRoot();
- void SetHideOfflineRoot(bool state);
- void SetUseGroups(bool state);
- void SetOfflineModes(DWORD modes);
- DWORD GetExStyle();
- void SetExStyle(DWORD exStyle);
- int GetLefrMargin();
- void SetLeftMargin(int iMargin);
- HANDLE AddInfoItem(CLCINFOITEM *cii);
- int GetItemType(HANDLE hItem);
- HANDLE GetNextItem(HANDLE hItem, DWORD flags);
- COLORREF GetTextColot(int iFontId);
- void SetTextColor(int iFontId, COLORREF clText);
-
- struct TEventInfo
- {
- CCtrlClc *ctrl;
- NMCLISTCONTROL *info;
- };
-
- CCallback<TEventInfo> OnExpanded;
- CCallback<TEventInfo> OnListRebuilt;
- CCallback<TEventInfo> OnItemChecked;
- CCallback<TEventInfo> OnDragging;
- CCallback<TEventInfo> OnDropped;
- CCallback<TEventInfo> OnListSizeChange;
- CCallback<TEventInfo> OnOptionsChanged;
- CCallback<TEventInfo> OnDragStop;
- CCallback<TEventInfo> OnNewContact;
- CCallback<TEventInfo> OnContactMoved;
- CCallback<TEventInfo> OnCheckChanged;
- CCallback<TEventInfo> OnClick;
-
-protected:
- BOOL OnNotify(int idCtrl, NMHDR *pnmh);
-};
-
-/////////////////////////////////////////////////////////////////////////////////////////
-// CCtrlData - data access controls base class
-
-class CCtrlData : public CCtrlBase
-{
-public:
- CCtrlData( CDlgBase* dlg, int ctrlId );
-
- virtual ~CCtrlData()
- {
- if (m_dbLink) delete m_dbLink;
- }
-
- __inline bool IsChanged() const { return m_changed; }
-
- void CreateDbLink( const char* szModuleName, const char* szSetting, BYTE type, DWORD iValue );
- void CreateDbLink( const char* szModuleName, const char* szSetting, TCHAR* szValue );
-
- virtual void OnInit();
-
- // Events
- CCallback<CCtrlData> OnChange;
-
-protected:
- CDbLink *m_dbLink;
- bool m_changed;
-
- void NotifyChange();
-
- __inline BYTE GetDataType() { return m_dbLink ? m_dbLink->GetDataType() : DBVT_DELETED; }
- __inline DWORD LoadInt() { return m_dbLink ? m_dbLink->LoadInt() : 0; }
- __inline void SaveInt(DWORD value) { if (m_dbLink) m_dbLink->SaveInt(value); }
- __inline const TCHAR *LoadText() { return m_dbLink ? m_dbLink->LoadText() : _T(""); }
- __inline void SaveText(TCHAR *value) { if (m_dbLink) m_dbLink->SaveText(value); }
-};
-
-/////////////////////////////////////////////////////////////////////////////////////////
-// CCtrlCheck
-
-class CCtrlCheck : public CCtrlData
-{
-public:
- CCtrlCheck( CDlgBase* dlg, int ctrlId );
- virtual BOOL OnCommand(HWND, WORD, WORD) { NotifyChange(); return TRUE; }
- virtual void OnInit()
- {
- CCtrlData::OnInit();
- OnReset();
- }
- virtual void OnApply()
- {
- SaveInt(GetState());
- }
- virtual void OnReset()
- {
- SetState(LoadInt());
- }
-
- int GetState();
- void SetState(int state);
-};
-
-/////////////////////////////////////////////////////////////////////////////////////////
-// CCtrlEdit
-
-class CCtrlEdit : public CCtrlData
-{
-public:
- CCtrlEdit( CDlgBase* dlg, int ctrlId );
- virtual BOOL OnCommand(HWND, WORD, WORD idCode)
- {
- if (idCode == EN_CHANGE)
- NotifyChange();
- return TRUE;
- }
- virtual void OnInit()
- {
- CCtrlData::OnInit();
- OnReset();
- }
- virtual void OnApply()
- {
- if (GetDataType() == DBVT_TCHAR)
- {
- int len = GetWindowTextLength(m_hwnd) + 1;
- TCHAR *buf = (TCHAR *)_alloca(sizeof(TCHAR) * len);
- GetWindowText(m_hwnd, buf, len);
- SaveText(buf);
- }
- else if (GetDataType() != DBVT_DELETED)
- {
- SaveInt(GetInt());
- }
- }
- virtual void OnReset()
- {
- if (GetDataType() == DBVT_TCHAR)
- SetText(LoadText());
- else if (GetDataType() != DBVT_DELETED)
- SetInt(LoadInt());
- }
-};
-
-/////////////////////////////////////////////////////////////////////////////////////////
-// CCtrlListBox
-
-class CCtrlListBox : public CCtrlBase
-{
-public:
- CCtrlListBox( CDlgBase* dlg, int ctrlId );
-
- int AddString(TCHAR *text, LPARAM data=0);
- void DeleteString(int index);
- int FindString(TCHAR *str, int index = -1, bool exact = false);
- int GetCount();
- int GetCurSel();
- LPARAM GetItemData(int index);
- TCHAR* GetItemText(int index);
- TCHAR* GetItemText(int index, TCHAR *buf, int size);
- bool GetSel(int index);
- int GetSelCount();
- int* GetSelItems(int *items, int count);
- int* GetSelItems();
- int InsertString(TCHAR *text, int pos, LPARAM data=0);
- void ResetContent();
- int SelectString(TCHAR *str);
- int SetCurSel(int index);
- void SetItemData(int index, LPARAM data);
- void SetSel(int index, bool sel=true);
-
- // Events
- CCallback<CCtrlListBox> OnDblClick;
- CCallback<CCtrlListBox> OnSelCancel;
- CCallback<CCtrlListBox> OnSelChange;
-
-protected:
- BOOL OnCommand(HWND hwndCtrl, WORD idCtrl, WORD idCode);
-};
-
-/////////////////////////////////////////////////////////////////////////////////////////
-// CCtrlCombo
-
-class CCtrlCombo : public CCtrlData
-{
-public:
- CCtrlCombo( CDlgBase* dlg, int ctrlId );
-
- virtual BOOL OnCommand(HWND, WORD, WORD idCode)
- {
- switch (idCode)
- {
- case CBN_CLOSEUP: OnCloseup(this); break;
- case CBN_DROPDOWN: OnDropdown(this); break;
-
- case CBN_EDITCHANGE:
- case CBN_EDITUPDATE:
- case CBN_SELCHANGE:
- case CBN_SELENDOK:
- NotifyChange();
- break;
- }
- return TRUE;
- }
-
- virtual void OnInit()
- {
- CCtrlData::OnInit();
- OnReset();
- }
- virtual void OnApply()
- {
- if (GetDataType() == DBVT_TCHAR)
- {
- int len = GetWindowTextLength(m_hwnd) + 1;
- TCHAR *buf = (TCHAR *)_alloca(sizeof(TCHAR) * len);
- GetWindowText(m_hwnd, buf, len);
- SaveText(buf);
- }
- else if (GetDataType() != DBVT_DELETED)
- {
- SaveInt(GetInt());
- }
- }
- virtual void OnReset()
- {
- if (GetDataType() == DBVT_TCHAR)
- SetText(LoadText());
- else if (GetDataType() != DBVT_DELETED)
- SetInt(LoadInt());
- }
-
- // Control interface
- int AddString(const TCHAR *text, LPARAM data = 0 );
- int AddStringA(const char *text, LPARAM data = 0 );
- void DeleteString(int index);
- int FindString(const TCHAR *str, int index = -1, bool exact = false);
- int FindStringA(const char *str, int index = -1, bool exact = false);
- int GetCount();
- int GetCurSel();
- bool GetDroppedState();
- LPARAM GetItemData(int index);
- TCHAR* GetItemText(int index);
- TCHAR* GetItemText(int index, TCHAR *buf, int size);
- int InsertString(TCHAR *text, int pos, LPARAM data=0);
- void ResetContent();
- int SelectString(TCHAR *str);
- int SetCurSel(int index);
- void SetItemData(int index, LPARAM data);
- void ShowDropdown(bool show = true);
-
- // Events
- CCallback<CCtrlCombo> OnCloseup;
- CCallback<CCtrlCombo> OnDropdown;
-};
-
-/////////////////////////////////////////////////////////////////////////////////////////
-// CCtrlListView
-
-class CCtrlListView : public CCtrlBase
-{
-public:
- CCtrlListView( CDlgBase* dlg, int ctrlId );
-
- // Classic LV interface
- DWORD ApproximateViewRect(int cx, int cy, int iCount);
- void Arrange(UINT code);
- void CancelEditLabel();
- HIMAGELIST CreateDragImage(int iItem, LPPOINT lpptUpLeft);
- void DeleteAllItems();
- void DeleteColumn(int iCol);
- void DeleteItem(int iItem);
- HWND EditLabel(int iItem);
- int EnableGroupView(BOOL fEnable);
- BOOL EnsureVisible(int i, BOOL fPartialOK);
- int FindItem(int iStart, const LVFINDINFO *plvfi);
- COLORREF GetBkColor();
- void GetBkImage(LPLVBKIMAGE plvbki);
- UINT GetCallbackMask();
- BOOL GetCheckState(UINT iIndex);
- void GetColumn(int iCol, LPLVCOLUMN pcol);
- void GetColumnOrderArray(int iCount, int *lpiArray);
- int GetColumnWidth(int iCol);
- int GetCountPerPage();
- HWND GetEditControl();
- //void GetEmptyText(PWSTR pszText, UINT cchText);
- DWORD GetExtendedListViewStyle();
- INT GetFocusedGroup();
- //void GetFooterInfo(LVFOOTERINFO *plvfi);
- //void GetFooterItem(UINT iItem, LVFOOTERITEM *pfi);
- //void GetFooterItemRect(UINT iItem, RECT *prc);
- //void GetFooterRect(RECT *prc);
- int GetGroupCount();
- //HIMAGELIST GetGroupHeaderImageList();
- void GetGroupInfo(int iGroupId, PLVGROUP pgrp);
- void GetGroupInfoByIndex(int iIndex, PLVGROUP pgrp);
- void GetGroupMetrics(LVGROUPMETRICS *pGroupMetrics);
- //BOOL GetGroupRect(int iGroupId, RECT *prc);
- UINT GetGroupState(UINT dwGroupId, UINT dwMask);
- HWND GetHeader();
- HCURSOR GetHotCursor();
- INT GetHotItem();
- DWORD GetHoverTime();
- HIMAGELIST GetImageList(int iImageList);
- BOOL GetInsertMark(LVINSERTMARK *plvim);
- COLORREF GetInsertMarkColor();
- int GetInsertMarkRect(LPRECT prc);
- BOOL GetISearchString(LPSTR lpsz);
- void GetItem(LPLVITEM pitem);
- int GetItemCount();
- //void GetItemIndexRect(LVITEMINDEX *plvii, LONG iSubItem, LONG code, LPRECT prc);
- void GetItemPosition(int i, POINT *ppt);
- void GetItemRect(int i, RECT *prc, int code);
- DWORD GetItemSpacing(BOOL fSmall);
- UINT GetItemState(int i, UINT mask);
- void GetItemText(int iItem, int iSubItem, LPTSTR pszText, int cchTextMax);
- int GetNextItem(int iStart, UINT flags);
- //BOOL GetNextItemIndex(LVITEMINDEX *plvii, LPARAM flags);
- BOOL GetNumberOfWorkAreas(LPUINT lpuWorkAreas);
- BOOL GetOrigin(LPPOINT lpptOrg);
- COLORREF GetOutlineColor();
- UINT GetSelectedColumn();
- UINT GetSelectedCount();
- INT GetSelectionMark();
- int GetStringWidth(LPCSTR psz);
- BOOL GetSubItemRect(int iItem, int iSubItem, int code, LPRECT lpRect);
- COLORREF GetTextBkColor();
- COLORREF GetTextColor();
- void GetTileInfo(PLVTILEINFO plvtinfo);
- void GetTileViewInfo(PLVTILEVIEWINFO plvtvinfo);
- HWND GetToolTips();
- int GetTopIndex();
- BOOL GetUnicodeFormat();
- DWORD GetView();
- BOOL GetViewRect(RECT *prc);
- void GetWorkAreas(INT nWorkAreas, LPRECT lprc);
- BOOL HasGroup(int dwGroupId);
- int HitTest(LPLVHITTESTINFO pinfo);
- int HitTestEx(LPLVHITTESTINFO pinfo);
- int InsertColumn(int iCol, const LPLVCOLUMN pcol);
- int InsertGroup(int index, PLVGROUP pgrp);
- void InsertGroupSorted(PLVINSERTGROUPSORTED structInsert);
- int InsertItem(const LPLVITEM pitem);
- BOOL InsertMarkHitTest(LPPOINT point, LVINSERTMARK *plvim);
- BOOL IsGroupViewEnabled();
- UINT IsItemVisible(UINT index);
- UINT MapIDToIndex(UINT id);
- UINT MapIndexToID(UINT index);
- BOOL RedrawItems(int iFirst, int iLast);
- void RemoveAllGroups();
- int RemoveGroup(int iGroupId);
- BOOL Scroll(int dx, int dy);
- BOOL SetBkColor(COLORREF clrBk);
- BOOL SetBkImage(LPLVBKIMAGE plvbki);
- BOOL SetCallbackMask(UINT mask);
- void SetCheckState(UINT iIndex, BOOL fCheck);
- BOOL SetColumn(int iCol, LPLVCOLUMN pcol);
- BOOL SetColumnOrderArray(int iCount, int *lpiArray);
- BOOL SetColumnWidth(int iCol, int cx);
- void SetExtendedListViewStyle(DWORD dwExStyle);
- void SetExtendedListViewStyleEx(DWORD dwExMask, DWORD dwExStyle);
- //HIMAGELIST SetGroupHeaderImageList(HIMAGELIST himl);
- int SetGroupInfo(int iGroupId, PLVGROUP pgrp);
- void SetGroupMetrics(PLVGROUPMETRICS pGroupMetrics);
- void SetGroupState(UINT dwGroupId, UINT dwMask, UINT dwState);
- HCURSOR SetHotCursor(HCURSOR hCursor);
- INT SetHotItem(INT iIndex);
- void SetHoverTime(DWORD dwHoverTime);
- DWORD SetIconSpacing(int cx, int cy);
- HIMAGELIST SetImageList(HIMAGELIST himl, int iImageList);
- BOOL SetInfoTip(PLVSETINFOTIP plvSetInfoTip);
- BOOL SetInsertMark(LVINSERTMARK *plvim);
- COLORREF SetInsertMarkColor(COLORREF color);
- BOOL SetItem(const LPLVITEM pitem);
- void SetItemCount(int cItems);
- void SetItemCountEx(int cItems, DWORD dwFlags);
- //HRESULT SetItemIndexState(LVITEMINDEX *plvii, UINT data, UINT mask);
- BOOL SetItemPosition(int i, int x, int y);
- void SetItemPosition32(int iItem, int x, int y);
- void SetItemState(int i, UINT state, UINT mask);
- void SetItemText(int i, int iSubItem, TCHAR *pszText);
- COLORREF SetOutlineColor(COLORREF color);
- void SetSelectedColumn(int iCol);
- INT SetSelectionMark(INT iIndex);
- BOOL SetTextBkColor(COLORREF clrText);
- BOOL SetTextColor(COLORREF clrText);
- BOOL SetTileInfo(PLVTILEINFO plvtinfo);
- BOOL SetTileViewInfo(PLVTILEVIEWINFO plvtvinfo);
- HWND SetToolTips(HWND ToolTip);
- BOOL SetUnicodeFormat(BOOL fUnicode);
- int SetView(DWORD iView);
- void SetWorkAreas(INT nWorkAreas, LPRECT lprc);
- int SortGroups(PFNLVGROUPCOMPARE pfnGroupCompare, LPVOID plv);
- BOOL SortItems(PFNLVCOMPARE pfnCompare, LPARAM lParamSort);
- BOOL SortItemsEx(PFNLVCOMPARE pfnCompare, LPARAM lParamSort);
- INT SubItemHitTest(LPLVHITTESTINFO pInfo);
- INT SubItemHitTestEx(LPLVHITTESTINFO plvhti);
- BOOL Update(int iItem);
-
- // Events
- struct TEventInfo {
- CCtrlListView *treeviewctrl;
- union {
- NMHDR *nmhdr;
- NMLISTVIEW *nmlv;
- NMLVDISPINFO *nmlvdi;
- NMLVSCROLL *nmlvscr;
- NMLVGETINFOTIP *nmlvit;
- NMLVFINDITEM *nmlvfi;
- NMITEMACTIVATE *nmlvia;
- NMLVKEYDOWN *nmlvkey;
- };
- };
-
- CCallback<TEventInfo> OnBeginDrag;
- CCallback<TEventInfo> OnBeginLabelEdit;
- CCallback<TEventInfo> OnBeginRDrag;
- CCallback<TEventInfo> OnBeginScroll;
- CCallback<TEventInfo> OnColumnClick;
- //CCallback<TEventInfo> OnColumnDropdown;
- //CCallback<TEventInfo> OnColumnOverflowClick;
- CCallback<TEventInfo> OnDeleteAllItems;
- CCallback<TEventInfo> OnDeleteItem;
- CCallback<TEventInfo> OnDoubleClick;
- CCallback<TEventInfo> OnEndLabelEdit;
- CCallback<TEventInfo> OnEndScroll;
- CCallback<TEventInfo> OnGetDispInfo;
- //CCallback<TEventInfo> OnGetEmptyMarkup;
- CCallback<TEventInfo> OnGetInfoTip;
- CCallback<TEventInfo> OnHotTrack;
- CCallback<TEventInfo> OnIncrementalSearch;
- CCallback<TEventInfo> OnInsertItem;
- CCallback<TEventInfo> OnItemActivate;
- CCallback<TEventInfo> OnItemChanged;
- CCallback<TEventInfo> OnItemChanging;
- CCallback<TEventInfo> OnKeyDown;
- //CCallback<TEventInfo> OnLinkClick;
- CCallback<TEventInfo> OnMarqueeBegin;
- CCallback<TEventInfo> OnSetDispInfo;
-
-protected:
- BOOL OnNotify(int idCtrl, NMHDR *pnmh);
-};
-
-/////////////////////////////////////////////////////////////////////////////////////////
-// CCtrlTreeView
-
-class CCtrlTreeView : public CCtrlBase
-{
-public:
- CCtrlTreeView( CDlgBase* dlg, int ctrlId );
-
- // Classic TV interface
- HIMAGELIST CreateDragImage(HTREEITEM hItem);
- void DeleteAllItems();
- void DeleteItem(HTREEITEM hItem);
- HWND EditLabel(HTREEITEM hItem);
- void EndEditLabelNow(BOOL cancel);
- void EnsureVisible(HTREEITEM hItem);
- void Expand(HTREEITEM hItem, DWORD flag);
- COLORREF GetBkColor();
- DWORD GetCheckState(HTREEITEM hItem);
- HTREEITEM GetChild(HTREEITEM hItem);
- int GetCount();
- HTREEITEM GetDropHilight();
- HWND GetEditControl();
- HTREEITEM GetFirstVisible();
- HIMAGELIST GetImageList(int iImage);
- int GetIndent();
- COLORREF GetInsertMarkColor();
- void GetItem(TVITEMEX *tvi);
- int GetItemHeight();
- void GetItemRect(HTREEITEM hItem, RECT *rcItem, BOOL fItemRect);
- DWORD GetItemState(HTREEITEM hItem, DWORD stateMask);
- HTREEITEM GetLastVisible();
- COLORREF GetLineColor();
- HTREEITEM GetNextItem(HTREEITEM hItem, DWORD flag);
- HTREEITEM GetNextSibling(HTREEITEM hItem);
- HTREEITEM GetNextVisible(HTREEITEM hItem);
- HTREEITEM GetParent(HTREEITEM hItem);
- HTREEITEM GetPrevSibling(HTREEITEM hItem);
- HTREEITEM GetPrevVisible(HTREEITEM hItem);
- HTREEITEM GetRoot();
- DWORD GetScrollTime();
- HTREEITEM GetSelection();
- COLORREF GetTextColor();
- HWND GetToolTips();
- BOOL GetUnicodeFormat();
- unsigned GetVisibleCount();
- HTREEITEM HitTest(TVHITTESTINFO *hti);
- HTREEITEM InsertItem(TVINSERTSTRUCT *tvis);
- //HTREEITEM MapAccIDToHTREEITEM(UINT id);
- //UINT MapHTREEITEMtoAccID(HTREEITEM hItem);
- void Select(HTREEITEM hItem, DWORD flag);
- void SelectDropTarget(HTREEITEM hItem);
- void SelectItem(HTREEITEM hItem);
- void SelectSetFirstVisible(HTREEITEM hItem);
- COLORREF SetBkColor(COLORREF clBack);
- void SetCheckState(HTREEITEM hItem, DWORD state);
- void SetImageList(HIMAGELIST hIml, int iImage);
- void SetIndent(int iIndent);
- void SetInsertMark(HTREEITEM hItem, BOOL fAfter);
- COLORREF SetInsertMarkColor(COLORREF clMark);
- void SetItem(TVITEMEX *tvi);
- void SetItemHeight(short cyItem);
- void SetItemState(HTREEITEM hItem, DWORD state, DWORD stateMask);
- COLORREF SetLineColor(COLORREF clLine);
- void SetScrollTime(UINT uMaxScrollTime);
- COLORREF SetTextColor(COLORREF clText);
- HWND SetToolTips(HWND hwndToolTips);
- BOOL SetUnicodeFormat(BOOL fUnicode);
- void SortChildren(HTREEITEM hItem, BOOL fRecurse);
- void SortChildrenCB(TVSORTCB *cb, BOOL fRecurse);
-
- // Additional stuff
- void TranslateItem(HTREEITEM hItem);
- void TranslateTree();
- HTREEITEM FindNamedItem(HTREEITEM hItem, const TCHAR *name);
- void GetItem(HTREEITEM hItem, TVITEMEX *tvi);
- void GetItem(HTREEITEM hItem, TVITEMEX *tvi, TCHAR *szText, int iTextLength);
-
- // Events
- struct TEventInfo {
- CCtrlTreeView *treeviewctrl;
- union {
- NMHDR *nmhdr;
- NMTREEVIEW *nmtv;
- NMTVDISPINFO *nmtvdi;
- NMTVGETINFOTIP *nmtvit;
- NMTVKEYDOWN *nmtvkey;
- };
- };
-
- CCallback<TEventInfo> OnBeginDrag;
- CCallback<TEventInfo> OnBeginLabelEdit;
- CCallback<TEventInfo> OnBeginRDrag;
- CCallback<TEventInfo> OnDeleteItem;
- CCallback<TEventInfo> OnEndLabelEdit;
- CCallback<TEventInfo> OnGetDispInfo;
- CCallback<TEventInfo> OnGetInfoTip;
- CCallback<TEventInfo> OnItemExpanded;
- CCallback<TEventInfo> OnItemExpanding;
- CCallback<TEventInfo> OnKeyDown;
- CCallback<TEventInfo> OnSelChanged;
- CCallback<TEventInfo> OnSelChanging;
- CCallback<TEventInfo> OnSetDispInfo;
- CCallback<TEventInfo> OnSingleExpand;
-
-protected:
- BOOL OnNotify(int idCtrl, NMHDR *pnmh);
-};
-
-/////////////////////////////////////////////////////////////////////////////////////////
-// CCtrlCustom
-
-template<typename TDlg>
-class CCtrlCustom : public CCtrlBase
-{
-private:
- void (TDlg::*m_pfnOnCommand)(HWND hwndCtrl, WORD idCtrl, WORD idCode);
- void (TDlg::*m_pfnOnNotify)(int idCtrl, NMHDR *pnmh);
- void (TDlg::*m_pfnOnMeasureItem)(MEASUREITEMSTRUCT *param);
- void (TDlg::*m_pfnOnDrawItem)(DRAWITEMSTRUCT *param);
- void (TDlg::*m_pfnOnDeleteItem)(DELETEITEMSTRUCT *param);
-
-public:
- CCtrlCustom(TDlg *wnd, int idCtrl,
- void (TDlg::*pfnOnCommand)(HWND hwndCtrl, WORD idCtrl, WORD idCode),
- void (TDlg::*pfnOnNotify)(int idCtrl, NMHDR *pnmh),
- void (TDlg::*pfnOnMeasureItem)(MEASUREITEMSTRUCT *param) = NULL,
- void (TDlg::*pfnOnDrawItem)(DRAWITEMSTRUCT *param) = NULL,
- void (TDlg::*pfnOnDeleteItem)(DELETEITEMSTRUCT *param) = NULL): CCtrlBase(wnd, idCtrl)
- {
- m_pfnOnCommand = pfnOnCommand;
- m_pfnOnNotify = pfnOnNotify;
- m_pfnOnMeasureItem = pfnOnMeasureItem;
- m_pfnOnDrawItem = pfnOnDrawItem;
- m_pfnOnDeleteItem = pfnOnDeleteItem;
- }
-
- virtual BOOL OnCommand(HWND hwndCtrl, WORD idCtrl, WORD idCode)
- {
- if (m_parentWnd && m_pfnOnCommand) {
- m_parentWnd->m_lresult = 0;
- (((TDlg *)m_parentWnd)->*m_pfnOnCommand)(hwndCtrl, idCtrl, idCode);
- return m_parentWnd->m_lresult;
- }
- return FALSE;
- }
- virtual BOOL OnNotify(int idCtrl, NMHDR *pnmh)
- {
- if (m_parentWnd && m_pfnOnNotify) {
- m_parentWnd->m_lresult = 0;
- (((TDlg *)m_parentWnd)->*m_pfnOnNotify)(idCtrl, pnmh);
- return m_parentWnd->m_lresult;
- }
- return FALSE;
- }
-
- virtual BOOL OnMeasureItem(MEASUREITEMSTRUCT *param)
- {
- if (m_parentWnd && m_pfnOnMeasureItem) {
- m_parentWnd->m_lresult = 0;
- (((TDlg *)m_parentWnd)->*m_pfnOnMeasureItem)(param);
- return m_parentWnd->m_lresult;
- }
- return FALSE;
- }
- virtual BOOL OnDrawItem(DRAWITEMSTRUCT *param)
- {
- if (m_parentWnd && m_pfnOnDrawItem) {
- m_parentWnd->m_lresult = 0;
- (((TDlg *)m_parentWnd)->*m_pfnOnDrawItem)(param);
- return m_parentWnd->m_lresult;
- }
- return FALSE;
- }
- virtual BOOL OnDeleteItem(DELETEITEMSTRUCT *param)
- {
- if (m_parentWnd && m_pfnOnDeleteItem) {
- m_parentWnd->m_lresult = 0;
- (((TDlg *)m_parentWnd)->*m_pfnOnDeleteItem)(param);
- return m_parentWnd->m_lresult;
- }
- return FALSE;
- }
-};
-
-/////////////////////////////////////////////////////////////////////////////////////////
-// CProtoDlgBase
-
-template<typename TProto>
-class CProtoDlgBase : public CDlgBase
-{
-public:
- __inline CProtoDlgBase<TProto>(TProto *proto, int idDialog, HWND parent ) :
- CDlgBase( idDialog, parent ),
- m_proto( proto )
- {
- }
-
- __inline void CreateLink( CCtrlData& ctrl, char *szSetting, BYTE type, DWORD iValue)
- {
- ctrl.CreateDbLink((( PROTO_INTERFACE* )m_proto)->m_szModuleName, szSetting, type, iValue );
- }
- __inline void CreateLink( CCtrlData& ctrl, const char *szSetting, TCHAR *szValue)
- {
- ctrl.CreateDbLink((( PROTO_INTERFACE* )m_proto)->m_szModuleName, szSetting, szValue );
- }
-
- __inline TProto *GetProto() { return m_proto; }
-
-protected:
- TProto* m_proto;
-};
-
-/////////////////////////////////////////////////////////////////////////////////////////
-
-int UIEmulateBtnClick(HWND hwndDlg, UINT idcButton);
-void UIShowControls(HWND hwndDlg, int *idList, int nCmdShow);
-
-#endif // __jabber_ui_utils_h__
diff --git a/protocols/JabberG/jabber_10.vcxproj b/protocols/JabberG/jabber_10.vcxproj
index af0c1f620b..cacdf64001 100644
--- a/protocols/JabberG/jabber_10.vcxproj
+++ b/protocols/JabberG/jabber_10.vcxproj
@@ -203,6 +203,7 @@
<ItemGroup>
<ClCompile Include="src\jabber_api.cpp" />
<ClCompile Include="src\jabber_archive.cpp" />
+ <ClCompile Include="src\jabber_filterlist.cpp" />
<ClCompile Include="src\stdafx.cpp">
<PrecompiledHeader>Create</PrecompiledHeader>
</ClCompile>
@@ -256,7 +257,6 @@
<ClCompile Include="src\jabber_xstatus.cpp" />
<ClCompile Include="src\jabber_zstream.cpp" />
<ClCompile Include="src\jabber.cpp" />
- <ClCompile Include="src\ui_utils.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\include\m_jabber.h" />
@@ -282,7 +282,6 @@
<ClInclude Include="src\jabber_xml.h" />
<ClInclude Include="src\jabber_xstatus.h" />
<ClInclude Include="src\resource.h" />
- <ClInclude Include="src\ui_utils.h" />
<ClInclude Include="src\version.h" />
</ItemGroup>
<ItemGroup>
diff --git a/protocols/JabberG/jabber_10.vcxproj.filters b/protocols/JabberG/jabber_10.vcxproj.filters
index b6eca86a71..91fba5ae78 100644
--- a/protocols/JabberG/jabber_10.vcxproj.filters
+++ b/protocols/JabberG/jabber_10.vcxproj.filters
@@ -159,9 +159,6 @@
<ClCompile Include="src\jabber_zstream.cpp">
<Filter>Source Files</Filter>
</ClCompile>
- <ClCompile Include="src\ui_utils.cpp">
- <Filter>Source Files</Filter>
- </ClCompile>
<ClCompile Include="src\jabber_captcha.cpp">
<Filter>Source Files</Filter>
</ClCompile>
@@ -177,6 +174,9 @@
<ClCompile Include="src\jabber_api.cpp">
<Filter>Source Files</Filter>
</ClCompile>
+ <ClCompile Include="src\jabber_filterlist.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="src\jabber.h">
@@ -236,9 +236,6 @@
<ClInclude Include="src\resource.h">
<Filter>Header Files</Filter>
</ClInclude>
- <ClInclude Include="src\ui_utils.h">
- <Filter>Header Files</Filter>
- </ClInclude>
<ClInclude Include="src\version.h">
<Filter>Header Files</Filter>
</ClInclude>
diff --git a/protocols/JabberG/jabber_12.vcxproj b/protocols/JabberG/jabber_12.vcxproj
index c7b9cb9fab..ce3eac016e 100644
--- a/protocols/JabberG/jabber_12.vcxproj
+++ b/protocols/JabberG/jabber_12.vcxproj
@@ -206,6 +206,7 @@
<ItemGroup>
<ClCompile Include="src\jabber_api.cpp" />
<ClCompile Include="src\jabber_archive.cpp" />
+ <ClCompile Include="src\jabber_filterlist.cpp" />
<ClCompile Include="src\stdafx.cpp">
<PrecompiledHeader>Create</PrecompiledHeader>
</ClCompile>
@@ -259,7 +260,6 @@
<ClCompile Include="src\jabber_xstatus.cpp" />
<ClCompile Include="src\jabber_zstream.cpp" />
<ClCompile Include="src\jabber.cpp" />
- <ClCompile Include="src\ui_utils.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\include\m_jabber.h" />
@@ -285,7 +285,6 @@
<ClInclude Include="src\jabber_xml.h" />
<ClInclude Include="src\jabber_xstatus.h" />
<ClInclude Include="src\resource.h" />
- <ClInclude Include="src\ui_utils.h" />
<ClInclude Include="src\version.h" />
</ItemGroup>
<ItemGroup>
diff --git a/protocols/JabberG/jabber_12.vcxproj.filters b/protocols/JabberG/jabber_12.vcxproj.filters
index b6eca86a71..91fba5ae78 100644
--- a/protocols/JabberG/jabber_12.vcxproj.filters
+++ b/protocols/JabberG/jabber_12.vcxproj.filters
@@ -159,9 +159,6 @@
<ClCompile Include="src\jabber_zstream.cpp">
<Filter>Source Files</Filter>
</ClCompile>
- <ClCompile Include="src\ui_utils.cpp">
- <Filter>Source Files</Filter>
- </ClCompile>
<ClCompile Include="src\jabber_captcha.cpp">
<Filter>Source Files</Filter>
</ClCompile>
@@ -177,6 +174,9 @@
<ClCompile Include="src\jabber_api.cpp">
<Filter>Source Files</Filter>
</ClCompile>
+ <ClCompile Include="src\jabber_filterlist.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="src\jabber.h">
@@ -236,9 +236,6 @@
<ClInclude Include="src\resource.h">
<Filter>Header Files</Filter>
</ClInclude>
- <ClInclude Include="src\ui_utils.h">
- <Filter>Header Files</Filter>
- </ClInclude>
<ClInclude Include="src\version.h">
<Filter>Header Files</Filter>
</ClInclude>
diff --git a/protocols/JabberG/src/jabber.h b/protocols/JabberG/src/jabber.h
index d6c1b29490..f16f4b60aa 100644
--- a/protocols/JabberG/src/jabber.h
+++ b/protocols/JabberG/src/jabber.h
@@ -95,6 +95,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include <m_xstatus.h>
#include <win2k.h>
#include <m_imgsrvc.h>
+#include <m_clc.h>
#include <m_addcontact.h>
#include <m_folders.h>
@@ -105,6 +106,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include <m_proto_listeningto.h>
#include <m_nudge.h>
#include <m_skin_eng.h>
+#include <m_gui.h>
#include "../../plugins/zlib/src/zlib.h"
@@ -115,7 +117,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "jabber_byte.h"
#include "jabber_ibb.h"
#include "jabber_db_utils.h"
-#include "ui_utils.h"
struct CJabberProto;
@@ -140,6 +141,28 @@ protected:
}
};
+struct CFilterData;
+class CCtrlFilterListView : public CCtrlListView
+{
+ typedef CCtrlListView CSuper;
+
+public:
+ CCtrlFilterListView(CDlgBase* dlg, int ctrlId, bool trackFilter, bool keepHiglight);
+ ~CCtrlFilterListView();
+
+ TCHAR *GetFilterText();
+ CCallback<CCtrlFilterListView> OnFilterChanged;
+
+protected:
+ CFilterData *fdat;
+ bool m_trackFilter;
+ bool m_keepHiglight;
+
+ void OnInit();
+ LRESULT CustomWndProc(UINT msg, WPARAM wParam, LPARAM lParam);
+ void FilterHighlight(TCHAR *filter);
+};
+
#if !defined(OPENFILENAME_SIZE_VERSION_400)
#define OPENFILENAME_SIZE_VERSION_400 sizeof(OPENFILENAME)
#endif
@@ -747,6 +770,9 @@ CJabberProto *JabberChooseInstance(bool bIsLink=false);
bool JabberReadXep203delay(HXML node, time_t &msgTime);
+int UIEmulateBtnClick(HWND hwndDlg, UINT idcButton);
+void UIShowControls(HWND hwndDlg, int *idList, int nCmdShow);
+
//---- jabber_xml.cpp -------------------------------------------------------------------
void strdel(char* parBuffer, int len);
diff --git a/protocols/JabberG/src/jabber_db_utils.h b/protocols/JabberG/src/jabber_db_utils.h
index f171fbc7f5..605cee97c7 100644
--- a/protocols/JabberG/src/jabber_db_utils.h
+++ b/protocols/JabberG/src/jabber_db_utils.h
@@ -27,104 +27,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#ifndef __jabber_db_utils_h__
#define __jabber_db_utils_h__
-template<typename Int> struct CMIntTraits { static __forceinline bool IsSigned() { return false; } };
-template<> struct CMIntTraits<signed char> { static __forceinline bool IsSigned() { return true; } };
-template<> struct CMIntTraits<signed short> { static __forceinline bool IsSigned() { return true; } };
-template<> struct CMIntTraits<signed long> { static __forceinline bool IsSigned() { return true; } };
-
-template<int Size>
-struct CMDBTraits
-{
-};
-
-template<>
-struct CMDBTraits<1>
-{
- typedef BYTE DBType;
- enum { DBTypeId = DBVT_BYTE };
- static __forceinline DBType Get(PROTO_INTERFACE *pPro, char *szSetting, DBType value)
- {
- return pPro->getByte(szSetting, value);
- }
- static __forceinline void Set(PROTO_INTERFACE *pPro, char *szSetting, DBType value)
- {
- pPro->setByte(szSetting, value);
- }
-};
-
-template<>
-struct CMDBTraits<2>
-{
- typedef WORD DBType;
- enum { DBTypeId = DBVT_WORD };
- static __forceinline DBType Get(PROTO_INTERFACE *pPro, char *szSetting, DBType value)
- {
- pPro->getWord(szSetting, value);
- }
- static __forceinline void Set(PROTO_INTERFACE *pPro, char *szSetting, DBType value)
- {
- pPro->setWord(szSetting, value);
- }
-};
-
-template<>
-struct CMDBTraits<4>
-{
- typedef DWORD DBType;
- enum { DBTypeId = DBVT_DWORD };
- static __forceinline DBType Get(PROTO_INTERFACE *pPro, char *szSetting, DBType value)
- {
- return pPro->getDword(szSetting, value);
- }
- static __forceinline void Set(PROTO_INTERFACE *pPro, char *szSetting, DBType value)
- {
- pPro->setDword(szSetting, value);
- }
-};
-
-class CMOptionBase
-{
-public:
- char* GetDBModuleName() const { return m_proto->m_szModuleName; }
- char* GetDBSettingName() const { return m_szSetting; }
-
-protected:
- CMOptionBase(PROTO_INTERFACE *proto, char *szSetting): m_proto(proto), m_szSetting(szSetting) {}
-
- PROTO_INTERFACE *m_proto;
- char *m_szSetting;
-
-private:
- CMOptionBase(const CMOptionBase &) {}
- void operator= (const CMOptionBase &) {}
-};
-
-template<class T>
-class CMOption: public CMOptionBase
-{
-public:
- typedef T Type;
-
- __forceinline CMOption(PROTO_INTERFACE *proto, char *szSetting, Type defValue):
- CMOptionBase(proto, szSetting), m_default(defValue) {}
-
- __forceinline operator Type()
- {
- return (Type)CMDBTraits<sizeof(Type)>::Get(m_proto, m_szSetting, m_default);
- }
- __forceinline Type operator= (Type value)
- {
- CMDBTraits<sizeof(Type)>::Set(m_proto, m_szSetting, (CMDBTraits<sizeof(Type)>::DBType)value);
- return value;
- }
-
-private:
- Type m_default;
-
- CMOption(const CMOption &): CMOptionBase(NULL, NULL, DBVT_DELETED) {}
- void operator= (const CMOption &) {}
-};
-
struct CJabberOptions
{
CMOption<BYTE> AllowVersionRequests;
diff --git a/protocols/JabberG/src/jabber_filterlist.cpp b/protocols/JabberG/src/jabber_filterlist.cpp
new file mode 100644
index 0000000000..68753e974a
--- /dev/null
+++ b/protocols/JabberG/src/jabber_filterlist.cpp
@@ -0,0 +1,332 @@
+/*
+
+Jabber Protocol Plugin for Miranda NG
+
+Copyright (c) 2002-04 Santithorn Bunchua
+Copyright (c) 2005-12 George Hazan
+Copyright (c) 2007 Victor Pavlychko
+Copyright (ñ) 2012-15 Miranda NG project
+
+This program is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License
+as published by the Free Software Foundation; either version 2
+of the License, or (at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+*/
+
+#include "jabber.h"
+
+/////////////////////////////////////////////////////////////////////////////////////////
+// CCtrlFilterListView
+
+#define FILTER_BOX_HEIGHT 21
+
+struct CFilterData : public MZeroedObject
+{
+ HFONT m_hfntNormal;
+ HFONT m_hfntEmpty;
+ COLORREF m_clGray;
+ TCHAR *m_filterText;
+
+ RECT m_rcButtonClear;
+ RECT m_rcEditBox;
+
+ WNDPROC m_oldWndProc;
+ HWND m_hwndOwner;
+ HWND m_hwndEditBox;
+
+ void ReleaseFilterData()
+ {
+ DeleteObject(m_hfntEmpty); m_hfntEmpty = NULL;
+ }
+
+ ~CFilterData()
+ {
+ ReleaseFilterData();
+ }
+};
+
+CCtrlFilterListView::CCtrlFilterListView(CDlgBase* dlg, int ctrlId, bool trackFilter, bool keepHiglight):
+ CCtrlListView(dlg, ctrlId),
+ m_trackFilter(trackFilter),
+ m_keepHiglight(keepHiglight)
+{
+ fdat = new CFilterData;
+}
+
+CCtrlFilterListView::~CCtrlFilterListView()
+{
+ if (fdat->m_filterText) mir_free(fdat->m_filterText);
+ delete fdat;
+}
+
+TCHAR *CCtrlFilterListView::GetFilterText()
+{
+ return fdat->m_filterText;
+}
+
+void CCtrlFilterListView::OnInit()
+{
+ CSuper::OnInit();
+ Subclass();
+}
+
+static LRESULT CALLBACK sttEditBoxSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
+{
+ CFilterData *fdat = (CFilterData *)GetWindowLongPtr(hwnd, GWLP_USERDATA);
+ if (fdat == NULL)
+ return DefWindowProc(hwnd, msg, wParam, lParam);
+
+ switch (msg) {
+ case WM_GETDLGCODE:
+ if ((wParam == VK_RETURN) || (wParam == VK_ESCAPE))
+ return DLGC_WANTMESSAGE;
+ break;
+
+ case WM_SYSKEYDOWN:
+ case WM_KEYDOWN:
+ if (wParam == VK_RETURN) {
+ if (fdat->m_filterText) mir_free(fdat->m_filterText);
+ int length = GetWindowTextLength(hwnd) + 1;
+ if (length == 1)
+ fdat->m_filterText = 0;
+ else {
+ fdat->m_filterText = (TCHAR *)mir_alloc(sizeof(TCHAR) * length);
+ GetWindowText(hwnd, fdat->m_filterText, length);
+ }
+
+ DestroyWindow(hwnd);
+ RedrawWindow(fdat->m_hwndOwner, NULL, NULL, RDW_INVALIDATE|RDW_FRAME);
+ PostMessage(fdat->m_hwndOwner, WM_APP, 0, 0);
+ }
+ else if (wParam == VK_ESCAPE) {
+ DestroyWindow(hwnd);
+ return 0;
+ }
+
+ PostMessage(fdat->m_hwndOwner, WM_APP, 1, 0);
+ break;
+
+ case WM_KILLFOCUS:
+ DestroyWindow(hwnd);
+ return 0;
+
+ case WM_DESTROY:
+ fdat->m_hwndEditBox = NULL;
+ }
+
+ return CallWindowProc(fdat->m_oldWndProc, hwnd, msg, wParam, lParam);
+}
+
+void CCtrlFilterListView::FilterHighlight(TCHAR *str)
+{
+ TCHAR buf[256];
+ int count = GetItemCount();
+ for (int i=0; i < count; i++) {
+ bool found = false;
+ if (str) {
+ for (int j = 0; j < 10; ++j) {
+ GetItemText(i, j, buf, SIZEOF(buf));
+ if (!*buf)
+ break;
+
+ if (_tcsstr(buf, str)) {
+ found = true;
+ break;
+ }
+ }
+ }
+
+ SetItemState(i, found ? LVIS_DROPHILITED : 0, LVIS_DROPHILITED);
+ }
+}
+
+LRESULT CCtrlFilterListView::CustomWndProc(UINT msg, WPARAM wParam, LPARAM lParam)
+{
+ POINT pt;
+
+ switch (msg) {
+ case WM_APP:
+ switch (wParam) {
+ case 0:
+ OnFilterChanged(this);
+ if (!m_keepHiglight)
+ FilterHighlight(NULL);
+ break;
+
+ case 1:
+ if (m_trackFilter && fdat->m_hwndEditBox) {
+ TCHAR *str = 0;
+ int length = GetWindowTextLength(fdat->m_hwndEditBox) + 1;
+ if (length == 1)
+ str = 0;
+ else {
+ str = (TCHAR *)mir_alloc(sizeof(TCHAR) * length);
+ GetWindowText(fdat->m_hwndEditBox, str, length);
+ }
+ FilterHighlight(str);
+ if (str) mir_free(str);
+ }
+ break;
+
+ case 2:
+ fdat->m_hwndOwner = m_hwnd;
+ fdat->m_hwndEditBox = CreateWindow(_T("edit"), fdat->m_filterText,
+ WS_CHILD|WS_VISIBLE|WS_TABSTOP|ES_LEFT|ES_AUTOHSCROLL,
+ 0, 0, 0, 0,
+ ::GetParent(m_hwnd), (HMENU)-1, hInst, NULL);
+
+ SendMessage(fdat->m_hwndEditBox, WM_SETFONT, (WPARAM)fdat->m_hfntNormal, 0);
+
+ RECT rc = fdat->m_rcEditBox;
+ MapWindowPoints(m_hwnd, ::GetParent(m_hwnd), (LPPOINT)&rc, 2);
+ SetWindowPos(fdat->m_hwndEditBox, HWND_TOP, rc.left-5, rc.top+2, rc.right-rc.left, rc.bottom-rc.top-4, SWP_SHOWWINDOW);
+ SendMessage(fdat->m_hwndEditBox, EM_SETSEL, 0, -1);
+
+ fdat->m_oldWndProc = (WNDPROC)GetWindowLongPtr(fdat->m_hwndEditBox, GWLP_WNDPROC);
+ SetWindowLongPtr(fdat->m_hwndEditBox, GWLP_USERDATA, (LONG_PTR)fdat);
+ SetWindowLongPtr(fdat->m_hwndEditBox, GWLP_WNDPROC, (LONG_PTR)sttEditBoxSubclassProc);
+
+ SetFocus(m_hwnd); // hack to avoid popping of list over the box...
+ SetFocus(fdat->m_hwndEditBox);
+ }
+ break;
+
+ case WM_NCCALCSIZE:
+ {
+ RECT *prect = (RECT *)lParam;
+
+ CSuper::CustomWndProc(msg, wParam, lParam);
+ prect->bottom -= FILTER_BOX_HEIGHT;
+
+ fdat->ReleaseFilterData();
+
+ fdat->m_hfntNormal = (HFONT)SendMessage(m_hwnd, WM_GETFONT, 0, 0);
+ if (!fdat->m_hfntNormal)
+ fdat->m_hfntNormal = (HFONT)GetStockObject(DEFAULT_GUI_FONT);
+
+ LOGFONT lf;
+ GetObject(fdat->m_hfntNormal, sizeof(lf), &lf);
+ lf.lfItalic = TRUE;
+ fdat->m_hfntEmpty = CreateFontIndirect(&lf);
+
+ COLORREF clText = GetSysColor(COLOR_WINDOWTEXT);
+ COLORREF clBack = GetSysColor(COLOR_WINDOW);
+ fdat->m_clGray = RGB(
+ (GetRValue(clBack) + 2*GetRValue(clText)) / 3,
+ (GetGValue(clBack) + 2*GetGValue(clText)) / 3,
+ (GetBValue(clBack) + 2*GetBValue(clText)) / 3);
+
+ if (fdat->m_hwndEditBox)
+ DestroyWindow(fdat->m_hwndEditBox);
+ }
+ return 0;
+
+ case WM_NCPAINT:
+ CSuper::CustomWndProc(msg, wParam, lParam);
+ {
+ RECT rc;
+ GetWindowRect(m_hwnd, &rc);
+ OffsetRect(&rc, -rc.left, -rc.top);
+ InflateRect(&rc, -1, -1);
+ rc.top = rc.bottom - FILTER_BOX_HEIGHT;
+
+ POINT pts[] = {
+ {rc.left, rc.top},
+ {rc.left+FILTER_BOX_HEIGHT, rc.top},
+ {rc.left+FILTER_BOX_HEIGHT+FILTER_BOX_HEIGHT/2+1, rc.top+FILTER_BOX_HEIGHT/2+1},
+ {rc.left+FILTER_BOX_HEIGHT, rc.top+FILTER_BOX_HEIGHT},
+ {rc.left, rc.top+FILTER_BOX_HEIGHT},
+ };
+ HRGN hrgnFilter = CreatePolygonRgn(pts, SIZEOF(pts), ALTERNATE);
+
+ HDC hdc = GetWindowDC(m_hwnd);
+
+ FillRect(hdc, &rc, GetSysColorBrush(COLOR_WINDOW));
+ FillRgn(hdc, hrgnFilter, GetSysColorBrush(COLOR_BTNFACE));
+
+ SetBkMode(hdc, TRANSPARENT);
+
+ if (fdat->m_filterText) {
+ SetRect(&fdat->m_rcButtonClear,
+ rc.right - FILTER_BOX_HEIGHT + (FILTER_BOX_HEIGHT-16)/2, rc.top + (FILTER_BOX_HEIGHT-16)/2,
+ rc.right - FILTER_BOX_HEIGHT + (FILTER_BOX_HEIGHT-16)/2 + 16, rc.top + (FILTER_BOX_HEIGHT-16)/2 + 16);
+
+ DrawIconEx(hdc, rc.left + (FILTER_BOX_HEIGHT-16)/2, rc.top + (FILTER_BOX_HEIGHT-16)/2, g_LoadIconEx("sd_filter_apply"), 16, 16, 0, NULL, DI_NORMAL);
+ DrawIconEx(hdc, rc.right - FILTER_BOX_HEIGHT + (FILTER_BOX_HEIGHT-16)/2, rc.top + (FILTER_BOX_HEIGHT-16)/2, LoadSkinnedIcon(SKINICON_OTHER_DELETE), 16, 16, 0, NULL, DI_NORMAL);
+
+ rc.left += 5*FILTER_BOX_HEIGHT/3;
+ rc.right -= 5*FILTER_BOX_HEIGHT/3;
+
+ fdat->m_rcEditBox = rc;
+
+ SelectObject(hdc, fdat->m_hfntNormal);
+ ::SetTextColor(hdc, GetSysColor(COLOR_WINDOWTEXT));
+ DrawText(hdc, fdat->m_filterText, -1, &rc, DT_SINGLELINE|DT_VCENTER|DT_NOPREFIX|DT_END_ELLIPSIS);
+ }
+ else {
+ SetRect(&fdat->m_rcButtonClear, 0, 0, 0, 0);
+
+ DrawIconEx(hdc, rc.left + (FILTER_BOX_HEIGHT-16)/2, rc.top + (FILTER_BOX_HEIGHT-16)/2, g_LoadIconEx("sd_filter_reset"), 16, 16, 0, NULL, DI_NORMAL);
+
+ rc.left += 5*FILTER_BOX_HEIGHT/3;
+ rc.right -= 5;
+
+ fdat->m_rcEditBox = rc;
+
+ SelectObject(hdc, fdat->m_hfntEmpty);
+ ::SetTextColor(hdc, fdat->m_clGray);
+ DrawText(hdc, TranslateT("Set filter..."), -1, &rc, DT_SINGLELINE|DT_VCENTER|DT_NOPREFIX|DT_END_ELLIPSIS);
+ }
+
+ ReleaseDC(m_hwnd, hdc);
+
+ DeleteObject(hrgnFilter);
+ }
+ return 0;
+
+ case WM_NCHITTEST:
+ pt.x = LOWORD(lParam);
+ pt.y = HIWORD(lParam);
+ MapWindowPoints(NULL, m_hwnd, &pt, 1);
+
+ if (PtInRect(&fdat->m_rcButtonClear, pt))
+ return HTBORDER;
+ if (PtInRect(&fdat->m_rcEditBox, pt))
+ return HTBORDER;
+ break;
+
+ case WM_NCLBUTTONUP:
+ pt.x = LOWORD(lParam);
+ pt.y = HIWORD(lParam);
+ MapWindowPoints(NULL, m_hwnd, &pt, 1);
+
+ if (PtInRect(&fdat->m_rcButtonClear, pt)) {
+ SetFocus(m_hwnd);
+ if (fdat->m_filterText) mir_free(fdat->m_filterText);
+ fdat->m_filterText = NULL;
+ RedrawWindow(m_hwnd, NULL, NULL, RDW_INVALIDATE|RDW_FRAME);
+ OnFilterChanged(this);
+ FilterHighlight(NULL);
+ }
+ else if (PtInRect(&fdat->m_rcEditBox, pt))
+ PostMessage(m_hwnd, WM_APP, 2, 0);
+ break;
+
+ case WM_KEYDOWN:
+ if (wParam == 'F' && GetAsyncKeyState(VK_CONTROL))
+ PostMessage(m_hwnd, WM_APP, 2, 0);
+ break;
+ }
+
+ return CSuper::CustomWndProc(msg, wParam, lParam);
+}
diff --git a/protocols/JabberG/src/jabber_iqid.cpp b/protocols/JabberG/src/jabber_iqid.cpp
index 7269561533..cc0f8d4bd4 100644
--- a/protocols/JabberG/src/jabber_iqid.cpp
+++ b/protocols/JabberG/src/jabber_iqid.cpp
@@ -508,7 +508,7 @@ void CJabberProto::OnIqResultGetRoster(HXML iqNode, CJabberIqInfo *pInfo)
GroupchatJoinByHContact((MCONTACT)chatRooms[i], true);
UI_SAFE_NOTIFY_HWND(m_hwndJabberAddBookmark, WM_JABBER_CHECK_ONLINE);
- WindowNotify(WM_JABBER_CHECK_ONLINE);
+ WindowList_Broadcast(m_hWindowList, WM_JABBER_CHECK_ONLINE, 0, 0);
UI_SAFE_NOTIFY(m_pDlgServiceDiscovery, WM_JABBER_TRANSPORT_REFRESH);
@@ -1115,17 +1115,15 @@ void CJabberProto::OnIqResultGetVcard(HXML iqNode, CJabberIqInfo*)
else {
if ((hContact = HContactFromJID(jid)) != NULL)
ProtoBroadcastAck(hContact, ACKTYPE_GETINFO, ACKRESULT_SUCCESS, (HANDLE)1, 0);
- WindowNotify(WM_JABBER_REFRESH_VCARD);
+ WindowList_Broadcast(m_hWindowList, WM_JABBER_REFRESH_VCARD, 0, 0);
}
}
void CJabberProto::OnIqResultSetVcard(HXML iqNode, CJabberIqInfo*)
{
debugLogA("<iq/> iqIdSetVcard");
- if (!xmlGetAttrValue(iqNode, _T("type")))
- return;
-
- WindowNotify(WM_JABBER_REFRESH_VCARD);
+ if (xmlGetAttrValue(iqNode, _T("type")))
+ WindowList_Broadcast(m_hWindowList, WM_JABBER_REFRESH_VCARD, 0, 0);
}
void CJabberProto::OnIqResultSetSearch(HXML iqNode, CJabberIqInfo*)
diff --git a/protocols/JabberG/src/jabber_proto.cpp b/protocols/JabberG/src/jabber_proto.cpp
index e9652107d4..b93b55c489 100644
--- a/protocols/JabberG/src/jabber_proto.cpp
+++ b/protocols/JabberG/src/jabber_proto.cpp
@@ -75,9 +75,6 @@ CJabberProto::CJabberProto(const char *aProtoName, const TCHAR *aUserName) :
debugLogA("Setting protocol/module name to '%s'", m_szModuleName);
- // Jabber dialog list
- m_windowList = WindowList_Create();
-
// Protocol services and events...
m_hEventNudge = CreateProtoEvent(PE_NUDGE);
m_hEventXStatusIconChanged = CreateProtoEvent(JE_CUSTOMSTATUS_EXTRAICON_CHANGED);
@@ -162,8 +159,6 @@ CJabberProto::~CJabberProto()
delete m_pInfoFrame;
- WindowList_Destroy(m_windowList);
-
DestroyHookableEvent(m_hEventNudge);
DestroyHookableEvent(m_hEventXStatusIconChanged);
DestroyHookableEvent(m_hEventXStatusChanged);
@@ -1305,27 +1300,6 @@ int __cdecl CJabberProto::UserIsTyping(MCONTACT hContact, int type)
}
/////////////////////////////////////////////////////////////////////////////////////////
-// Notify dialogs
-
-void CJabberProto::WindowSubscribe(HWND hwnd)
-{
- WindowList_Add(m_windowList, hwnd, NULL);
-}
-
-void CJabberProto::WindowUnsubscribe(HWND hwnd)
-{
- WindowList_Remove(m_windowList, hwnd);
-}
-
-void CJabberProto::WindowNotify(UINT msg, bool async)
-{
- if (async)
- WindowList_BroadcastAsync(m_windowList, msg, 0, 0);
- else
- WindowList_Broadcast(m_windowList, msg, 0, 0);
-}
-
-/////////////////////////////////////////////////////////////////////////////////////////
// InfoFrame events
void CJabberProto::InfoFrame_OnSetup(CJabberInfoFrame_Event*)
diff --git a/protocols/JabberG/src/jabber_proto.h b/protocols/JabberG/src/jabber_proto.h
index 8c7ce2dc03..d078c91343 100644
--- a/protocols/JabberG/src/jabber_proto.h
+++ b/protocols/JabberG/src/jabber_proto.h
@@ -185,8 +185,6 @@ struct CJabberProto : public PROTO<CJabberProto>, public IJabberInterface
CJabberDlgBase *m_pDlgJabberJoinGroupchat;
CJabberDlgBase *m_pDlgNotes;
- HANDLE m_windowList;
-
// Service and event handles
HANDLE m_hEventNudge;
HANDLE m_hEventXStatusIconChanged;
@@ -643,9 +641,6 @@ struct CJabberProto : public PROTO<CJabberProto>, public IJabberInterface
void __cdecl SendMessageAckThread(void* hContact);
MCONTACT AddToListByJID(const TCHAR *newJid, DWORD flags);
- void WindowSubscribe(HWND hwnd);
- void WindowUnsubscribe(HWND hwnd);
- void WindowNotify(UINT msg, bool async = false);
void InfoFrame_OnSetup(CJabberInfoFrame_Event *evt);
void InfoFrame_OnTransport(CJabberInfoFrame_Event *evt);
diff --git a/protocols/JabberG/src/jabber_thread.cpp b/protocols/JabberG/src/jabber_thread.cpp
index b53de765b1..6043baeafa 100644
--- a/protocols/JabberG/src/jabber_thread.cpp
+++ b/protocols/JabberG/src/jabber_thread.cpp
@@ -513,7 +513,7 @@ recvRest:
ListRemoveList(LIST_CHATROOM);
ListRemoveList(LIST_BOOKMARK);
UI_SAFE_NOTIFY_HWND(m_hwndJabberAddBookmark, WM_JABBER_CHECK_ONLINE);
- WindowNotify(WM_JABBER_CHECK_ONLINE);
+ WindowList_Broadcast(m_hWindowList, WM_JABBER_CHECK_ONLINE, 0, 0);
// Set status to offline
int oldStatus = m_iStatus;
@@ -529,7 +529,7 @@ recvRest:
m_tmJabberLoggedInTime = 0;
ListWipe();
- WindowNotify(WM_JABBER_REFRESH_VCARD);
+ WindowList_Broadcast(m_hWindowList, WM_JABBER_REFRESH_VCARD, 0, 0);
}
else if (info.bIsReg && !info.reg_done)
SendMessage(info.conn.reg_hwndDlg, WM_JABBER_REGDLG_UPDATE, 100, (LPARAM)TranslateT("Error: Connection lost"));
diff --git a/protocols/JabberG/src/jabber_util.cpp b/protocols/JabberG/src/jabber_util.cpp
index dea5b49ff7..68f7acd2c7 100644
--- a/protocols/JabberG/src/jabber_util.cpp
+++ b/protocols/JabberG/src/jabber_util.cpp
@@ -1148,3 +1148,19 @@ void __cdecl CJabberProto::LoadHttpAvatars(void* param)
if (hHttpCon)
Netlib_CloseHandle(hHttpCon);
}
+
+/////////////////////////////////////////////////////////////////////////////////////////
+// UI utilities
+
+int UIEmulateBtnClick(HWND hwndDlg, UINT idcButton)
+{
+ if (IsWindowEnabled(GetDlgItem(hwndDlg, idcButton)))
+ PostMessage(hwndDlg, WM_COMMAND, MAKEWPARAM(idcButton, BN_CLICKED), (LPARAM)GetDlgItem(hwndDlg, idcButton));
+ return 0;
+}
+
+void UIShowControls(HWND hwndDlg, int *idList, int nCmdShow)
+{
+ for (; *idList; ++idList)
+ ShowWindow(GetDlgItem(hwndDlg, *idList), nCmdShow);
+}
diff --git a/src/core/miranda.h b/src/core/miranda.h
index 61b17cd6fa..c079e26324 100644
--- a/src/core/miranda.h
+++ b/src/core/miranda.h
@@ -148,7 +148,6 @@ PROTOACCOUNT* Proto_CreateAccount(const char *szModuleName, const char *szBasePr
PROTOACCOUNT* __fastcall Proto_GetAccount(const char *accName);
PROTOACCOUNT* __fastcall Proto_GetAccount(MCONTACT hContact);
-PROTOCOLDESCRIPTOR* __fastcall Proto_IsProtocolLoaded(const char *szProtoName);
bool __fastcall Proto_IsAccountEnabled(PROTOACCOUNT *pa);
bool __fastcall Proto_IsAccountLocked(PROTOACCOUNT *pa);
@@ -211,7 +210,10 @@ public:
extern "C"
{
- MIR_CORE_DLL(int)Langpack_MarkPluginLoaded(PLUGININFOEX* pInfo);
- MIR_CORE_DLL(int)GetSubscribersCount(HANDLE hHook);
+ MIR_CORE_DLL(int) Langpack_MarkPluginLoaded(PLUGININFOEX* pInfo);
+ MIR_CORE_DLL(int) GetSubscribersCount(HANDLE hHook);
MIR_CORE_DLL(void) db_setCurrent(MIDatabase* _db);
+
+ MIR_CORE_DLL(PROTOCOLDESCRIPTOR*) Proto_IsProtocolLoaded(const char *szProtoName);
+ MIR_CORE_DLL(PROTOCOLDESCRIPTOR*) Proto_RegisterModule(PROTOCOLDESCRIPTOR *pd);
};
diff --git a/src/mir_core/mir_core_10.vcxproj b/src/mir_core/mir_core_10.vcxproj
index 9b7fd8f38c..f41eb0202c 100644
--- a/src/mir_core/mir_core_10.vcxproj
+++ b/src/mir_core/mir_core_10.vcxproj
@@ -88,6 +88,7 @@
<ClCompile Include="src\sha1.cpp" />
<ClCompile Include="src\subclass.cpp" />
<ClCompile Include="src\threads.cpp" />
+ <ClCompile Include="src\ui_utils.cpp" />
<ClCompile Include="src\utf.cpp" />
<ClCompile Include="src\utils.cpp" />
<ClCompile Include="src\winver.cpp" />
diff --git a/src/mir_core/mir_core_10.vcxproj.filters b/src/mir_core/mir_core_10.vcxproj.filters
index 59ed6773fb..a1af8ffb9e 100644
--- a/src/mir_core/mir_core_10.vcxproj.filters
+++ b/src/mir_core/mir_core_10.vcxproj.filters
@@ -109,6 +109,9 @@
<ClCompile Include="src\mc.cpp">
<Filter>Source Files</Filter>
</ClCompile>
+ <ClCompile Include="src\ui_utils.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="src\commonheaders.h">
diff --git a/src/mir_core/mir_core_12.vcxproj b/src/mir_core/mir_core_12.vcxproj
index 0ee739d83f..6be5f7e179 100644
--- a/src/mir_core/mir_core_12.vcxproj
+++ b/src/mir_core/mir_core_12.vcxproj
@@ -21,8 +21,10 @@
<ItemGroup>
<ClInclude Include="..\..\include\m_core.h" />
<ClInclude Include="..\..\include\m_database.h" />
+ <ClInclude Include="..\..\include\m_gui.h" />
<ClInclude Include="..\..\include\m_json.h" />
<ClInclude Include="..\..\include\m_metacontacts.h" />
+ <ClInclude Include="..\..\include\m_protoint.h" />
<ClInclude Include="..\..\include\m_string.h" />
<ClInclude Include="..\..\include\m_system.h" />
<ClInclude Include="..\..\include\m_system_cpp.h" />
@@ -86,6 +88,7 @@
<ClCompile Include="src\sha1.cpp" />
<ClCompile Include="src\subclass.cpp" />
<ClCompile Include="src\threads.cpp" />
+ <ClCompile Include="src\ui_utils.cpp" />
<ClCompile Include="src\utf.cpp" />
<ClCompile Include="src\utils.cpp" />
<ClCompile Include="src\winver.cpp" />
diff --git a/src/mir_core/mir_core_12.vcxproj.filters b/src/mir_core/mir_core_12.vcxproj.filters
index 832c3f3b5f..ad3bf82317 100644
--- a/src/mir_core/mir_core_12.vcxproj.filters
+++ b/src/mir_core/mir_core_12.vcxproj.filters
@@ -106,6 +106,9 @@
<ClCompile Include="src\mc.cpp">
<Filter>Source Files</Filter>
</ClCompile>
+ <ClCompile Include="src\ui_utils.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\include\m_core.h">
@@ -159,6 +162,12 @@
<ClInclude Include="..\..\include\m_string.h">
<Filter>Header Files</Filter>
</ClInclude>
+ <ClInclude Include="..\..\include\m_gui.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\include\m_protoint.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
</ItemGroup>
<ItemGroup>
<None Include="..\..\include\m_string.inl">
diff --git a/src/mir_core/src/commonheaders.h b/src/mir_core/src/commonheaders.h
index 5a8d414682..a3a7896ca2 100644
--- a/src/mir_core/src/commonheaders.h
+++ b/src/mir_core/src/commonheaders.h
@@ -35,6 +35,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include <shlobj.h>
#include <commctrl.h>
#include <vssym32.h>
+#include <Uxtheme.h>
#include <malloc.h>
#include <stdio.h>
@@ -57,6 +58,10 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include <m_langpack.h>
#include <m_string.h>
#include <m_metacontacts.h>
+#include <m_protomod.h>
+#include <m_protoint.h>
+#include <m_skin.h>
+#include <m_netlib.h>
#include "miranda.h"
diff --git a/src/mir_core/src/mir_core.def b/src/mir_core/src/mir_core.def
index 043c374ea3..d43ffd571c 100644
--- a/src/mir_core/src/mir_core.def
+++ b/src/mir_core/src/mir_core.def
@@ -608,3 +608,471 @@ mir_wstrcmpi @280
?setWString@PROTO_INTERFACE@@QAEXPBDPB_W@Z @606 NONAME
?setWord@PROTO_INTERFACE@@QAEXIPBDG@Z @607 NONAME
?setWord@PROTO_INTERFACE@@QAEXPBDG@Z @608 NONAME
+??0CCtrlBase@@QAE@ABV0@@Z @609 NONAME
+??0CCtrlBase@@QAE@PAVCDlgBase@@H@Z @610 NONAME
+??0CCtrlButton@@QAE@ABV0@@Z @611 NONAME
+??0CCtrlButton@@QAE@PAVCDlgBase@@H@Z @612 NONAME
+??0CCtrlCheck@@QAE@ABV0@@Z @613 NONAME
+??0CCtrlCheck@@QAE@PAVCDlgBase@@H@Z @614 NONAME
+??0CCtrlClc@@QAE@ABV0@@Z @615 NONAME
+??0CCtrlClc@@QAE@PAVCDlgBase@@H@Z @616 NONAME
+??0CCtrlCombo@@QAE@ABV0@@Z @617 NONAME
+??0CCtrlCombo@@QAE@PAVCDlgBase@@H@Z @618 NONAME
+??0CCtrlData@@QAE@ABV0@@Z @619 NONAME
+??0CCtrlData@@QAE@PAVCDlgBase@@H@Z @620 NONAME
+??0CCtrlEdit@@QAE@ABV0@@Z @621 NONAME
+??0CCtrlEdit@@QAE@PAVCDlgBase@@H@Z @622 NONAME
+??0CCtrlHyperlink@@QAE@ABV0@@Z @623 NONAME
+??0CCtrlHyperlink@@QAE@PAVCDlgBase@@HPBD@Z @624 NONAME
+??0CCtrlListBox@@QAE@ABV0@@Z @625 NONAME
+??0CCtrlListBox@@QAE@PAVCDlgBase@@H@Z @626 NONAME
+??0CCtrlListView@@QAE@ABV0@@Z @627 NONAME
+??0CCtrlListView@@QAE@PAVCDlgBase@@H@Z @628 NONAME
+??0CCtrlMButton@@QAE@ABV0@@Z @629 NONAME
+??0CCtrlMButton@@QAE@PAVCDlgBase@@HHPBD@Z @630 NONAME
+??0CCtrlMButton@@QAE@PAVCDlgBase@@HPAUHICON__@@PBD@Z @631 NONAME
+??0CCtrlPages@@QAE@ABV0@@Z @632 NONAME
+??0CCtrlPages@@QAE@PAVCDlgBase@@H@Z @633 NONAME
+??0CCtrlTreeView@@QAE@ABV0@@Z @634 NONAME
+??0CCtrlTreeView@@QAE@PAVCDlgBase@@H@Z @635 NONAME
+??0CDataLink@@QAE@ABV0@@Z @636 NONAME
+??0CDataLink@@QAE@E_N@Z @637 NONAME
+??0CDbLink@@QAE@ABV0@@Z @638 NONAME
+??0CDbLink@@QAE@PBD0EK_N@Z @639 NONAME
+??0CDbLink@@QAE@PBD0EPA_W@Z @640 NONAME
+??0CDlgBase@@QAE@ABV0@@Z @641 NONAME
+??0CDlgBase@@QAE@PAUHINSTANCE__@@HPAUHWND__@@@Z @642 NONAME
+??0CProtoIntDlgBase@@QAE@ABV0@@Z @643 NONAME
+??0CProtoIntDlgBase@@QAE@PAUPROTO_INTERFACE@@HPAUHWND__@@_N@Z @644 NONAME
+??1CCtrlBase@@UAE@XZ @645 NONAME
+??1CCtrlButton@@UAE@XZ @646 NONAME
+??1CCtrlCheck@@UAE@XZ @647 NONAME
+??1CCtrlClc@@UAE@XZ @648 NONAME
+??1CCtrlCombo@@UAE@XZ @649 NONAME
+??1CCtrlData@@UAE@XZ @650 NONAME
+??1CCtrlEdit@@UAE@XZ @651 NONAME
+??1CCtrlHyperlink@@UAE@XZ @652 NONAME
+??1CCtrlListBox@@UAE@XZ @653 NONAME
+??1CCtrlListView@@UAE@XZ @654 NONAME
+??1CCtrlMButton@@UAE@XZ @655 NONAME
+??1CCtrlPages@@UAE@XZ @656 NONAME
+??1CCtrlTreeView@@UAE@XZ @657 NONAME
+??1CDataLink@@UAE@XZ @658 NONAME
+??1CDbLink@@UAE@XZ @659 NONAME
+??1CDlgBase@@UAE@XZ @660 NONAME
+??1CProtoIntDlgBase@@UAE@XZ @661 NONAME
+??4CCtrlBase@@QAEAAV0@ABV0@@Z @662 NONAME
+??4CCtrlButton@@QAEAAV0@ABV0@@Z @663 NONAME
+??4CCtrlCheck@@QAEAAV0@ABV0@@Z @664 NONAME
+??4CCtrlClc@@QAEAAV0@ABV0@@Z @665 NONAME
+??4CCtrlCombo@@QAEAAV0@ABV0@@Z @666 NONAME
+??4CCtrlData@@QAEAAV0@ABV0@@Z @667 NONAME
+??4CCtrlEdit@@QAEAAV0@ABV0@@Z @668 NONAME
+??4CCtrlHyperlink@@QAEAAV0@ABV0@@Z @669 NONAME
+??4CCtrlListBox@@QAEAAV0@ABV0@@Z @670 NONAME
+??4CCtrlListView@@QAEAAV0@ABV0@@Z @671 NONAME
+??4CCtrlMButton@@QAEAAV0@ABV0@@Z @672 NONAME
+??4CCtrlPages@@QAEAAV0@ABV0@@Z @673 NONAME
+??4CCtrlTreeView@@QAEAAV0@ABV0@@Z @674 NONAME
+??4CDataLink@@QAEAAV0@ABV0@@Z @675 NONAME
+??4CDbLink@@QAEAAV0@ABV0@@Z @676 NONAME
+??4CDlgBase@@QAEAAV0@ABV0@@Z @677 NONAME
+??4CProtoIntDlgBase@@QAEAAV0@ABV0@@Z @678 NONAME
+??_7CCtrlBase@@6B@ @679 NONAME
+??_7CCtrlButton@@6B@ @680 NONAME
+??_7CCtrlCheck@@6B@ @681 NONAME
+??_7CCtrlClc@@6B@ @682 NONAME
+??_7CCtrlCombo@@6B@ @683 NONAME
+??_7CCtrlData@@6B@ @684 NONAME
+??_7CCtrlEdit@@6B@ @685 NONAME
+??_7CCtrlHyperlink@@6B@ @686 NONAME
+??_7CCtrlListBox@@6B@ @687 NONAME
+??_7CCtrlListView@@6B@ @688 NONAME
+??_7CCtrlMButton@@6B@ @689 NONAME
+??_7CCtrlPages@@6B@ @690 NONAME
+??_7CCtrlTreeView@@6B@ @691 NONAME
+??_7CDataLink@@6B@ @692 NONAME
+??_7CDbLink@@6B@ @693 NONAME
+??_7CDlgBase@@6B@ @694 NONAME
+??_7CProtoIntDlgBase@@6B@ @695 NONAME
+?ActivatePage@CCtrlPages@@QAEXH@Z @696 NONAME
+?ActiveMessage@CDlgBase@@QBEPBUtagMSG@@XZ @697 NONAME
+?AddColumn@CCtrlListView@@QAEXHPA_WH@Z @698 NONAME
+?AddContact@CCtrlClc@@QAEXI@Z @699 NONAME
+?AddControl@CDlgBase@@IAEXPAVCCtrlBase@@@Z @700 NONAME
+?AddGroup@CCtrlClc@@QAEXPAX@Z @701 NONAME
+?AddGroup@CCtrlListView@@QAEXHPA_W@Z @702 NONAME
+?AddInfoItem@CCtrlClc@@QAEPAXPAUCLCINFOITEM@@@Z @703 NONAME
+?AddItem@CCtrlListView@@QAEHPA_WHJH@Z @704 NONAME
+?AddPage@CCtrlPages@@QAEXPA_WPAUHICON__@@U?$CCallback@X@@PAX@Z @705 NONAME
+?AddString@CCtrlCombo@@QAEHPB_WJ@Z @706 NONAME
+?AddString@CCtrlListBox@@QAEHPA_WJ@Z @707 NONAME
+?AddStringA@CCtrlCombo@@QAEHPBDJ@Z @708 NONAME
+?ApproximateViewRect@CCtrlListView@@QAEKHHH@Z @709 NONAME
+?Arrange@CCtrlListView@@QAEXI@Z @710 NONAME
+?AttachDialog@CCtrlPages@@QAEXHPAVCDlgBase@@@Z @711 NONAME
+?AutoRebuild@CCtrlClc@@QAEXXZ @712 NONAME
+?CancelEditLabel@CCtrlListView@@QAEXXZ @713 NONAME
+?Close@CDlgBase@@QAEXXZ @714 NONAME
+?Create@CDlgBase@@QAEXXZ @715 NONAME
+?CreateDbLink@CCtrlData@@QAEXPAVCDataLink@@@Z @716 NONAME
+?CreateDbLink@CCtrlData@@QAEXPBD0EK_N@Z @717 NONAME
+?CreateDbLink@CCtrlData@@QAEXPBD0PA_W@Z @718 NONAME
+?CreateDragImage@CCtrlListView@@QAEPAU_IMAGELIST@@HPAUtagPOINT@@@Z @719 NONAME
+?CreateDragImage@CCtrlTreeView@@QAEPAU_IMAGELIST@@PAU_TREEITEM@@@Z @720 NONAME
+?CreateImageList@CCtrlListView@@QAEPAU_IMAGELIST@@H@Z @721 NONAME
+?CreateLink@CProtoIntDlgBase@@QAEXAAVCCtrlData@@PADEK_N@Z @722 NONAME
+?CreateLink@CProtoIntDlgBase@@QAEXAAVCCtrlData@@PBDPA_W@Z @723 NONAME
+?CustomWndProc@CCtrlBase@@MAEJIIJ@Z @724 NONAME
+?CustomWndProc@CCtrlPages@@MAEJIIJ@Z @725 NONAME
+?DeleteAllItems@CCtrlListView@@QAEXXZ @726 NONAME
+?DeleteAllItems@CCtrlTreeView@@QAEXXZ @727 NONAME
+?DeleteColumn@CCtrlListView@@QAEXH@Z @728 NONAME
+?DeleteItem@CCtrlClc@@QAEXPAX@Z @729 NONAME
+?DeleteItem@CCtrlListView@@QAEXH@Z @730 NONAME
+?DeleteItem@CCtrlTreeView@@QAEXPAU_TREEITEM@@@Z @731 NONAME
+?DeleteString@CCtrlCombo@@QAEXH@Z @732 NONAME
+?DeleteString@CCtrlListBox@@QAEXH@Z @733 NONAME
+?Disable@CCtrlBase@@QAEXXZ @734 NONAME
+?DlgProc@CDlgBase@@MAEHIIJ@Z @735 NONAME
+?DlgProc@CProtoIntDlgBase@@MAEHIIJ@Z @736 NONAME
+?DoModal@CDlgBase@@QAEHXZ @737 NONAME
+?DynamicDlgProc@CDlgBase@@SGHPAUHWND__@@IIJ@Z @738 NONAME
+?EditLabel@CCtrlClc@@QAEXPAX@Z @739 NONAME
+?EditLabel@CCtrlListView@@QAEPAUHWND__@@H@Z @740 NONAME
+?EditLabel@CCtrlTreeView@@QAEPAUHWND__@@PAU_TREEITEM@@@Z @741 NONAME
+?Enable@CCtrlBase@@QAEXH@Z @742 NONAME
+?EnableGroupView@CCtrlListView@@QAEHH@Z @743 NONAME
+?Enabled@CCtrlBase@@QBEHXZ @744 NONAME
+?EndEditLabel@CCtrlClc@@QAEX_N@Z @745 NONAME
+?EndEditLabelNow@CCtrlTreeView@@QAEXH@Z @746 NONAME
+?EnsureVisible@CCtrlClc@@QAEXPAX_N@Z @747 NONAME
+?EnsureVisible@CCtrlListView@@QAEHHH@Z @748 NONAME
+?EnsureVisible@CCtrlTreeView@@QAEXPAU_TREEITEM@@@Z @749 NONAME
+?Expand@CCtrlClc@@QAEXPAXK@Z @750 NONAME
+?Expand@CCtrlTreeView@@QAEXPAU_TREEITEM@@K@Z @751 NONAME
+?FindContact@CCtrlClc@@QAEPAXI@Z @752 NONAME
+?FindControl@CDlgBase@@AAEPAVCCtrlBase@@H@Z @753 NONAME
+?FindGroup@CCtrlClc@@QAEPAXPAX@Z @754 NONAME
+?FindItem@CCtrlListView@@QAEHHPBUtagLVFINDINFOW@@@Z @755 NONAME
+?FindNamedItem@CCtrlTreeView@@QAEPAU_TREEITEM@@PAU2@PB_W@Z @756 NONAME
+?FindString@CCtrlCombo@@QAEHPB_WH_N@Z @757 NONAME
+?FindString@CCtrlListBox@@QAEHPA_WH_N@Z @758 NONAME
+?FindStringA@CCtrlCombo@@QAEHPBDH_N@Z @759 NONAME
+?GetBkColor@CCtrlClc@@QAEKXZ @760 NONAME
+?GetBkColor@CCtrlListView@@QAEKXZ @761 NONAME
+?GetBkColor@CCtrlTreeView@@QAEKXZ @762 NONAME
+?GetBkImage@CCtrlListView@@QAEXPAUtagLVBKIMAGEW@@@Z @763 NONAME
+?GetCallbackMask@CCtrlListView@@QAEIXZ @764 NONAME
+?GetCheck@CCtrlClc@@QAE_NPAX@Z @765 NONAME
+?GetCheckState@CCtrlListView@@QAEHI@Z @766 NONAME
+?GetCheckState@CCtrlTreeView@@QAEKPAU_TREEITEM@@@Z @767 NONAME
+?GetChild@CCtrlTreeView@@QAEPAU_TREEITEM@@PAU2@@Z @768 NONAME
+?GetColumn@CCtrlListView@@QAEXHPAUtagLVCOLUMNW@@@Z @769 NONAME
+?GetColumnOrderArray@CCtrlListView@@QAEXHPAH@Z @770 NONAME
+?GetColumnWidth@CCtrlListView@@QAEHH@Z @771 NONAME
+?GetCount@CCtrlClc@@QAEHXZ @772 NONAME
+?GetCount@CCtrlCombo@@QAEHXZ @773 NONAME
+?GetCount@CCtrlListBox@@QAEHXZ @774 NONAME
+?GetCount@CCtrlTreeView@@QAEHXZ @775 NONAME
+?GetCountPerPage@CCtrlListView@@QAEHXZ @776 NONAME
+?GetCurSel@CCtrlCombo@@QAEHXZ @777 NONAME
+?GetCurSel@CCtrlListBox@@QAEHXZ @778 NONAME
+?GetDataSigned@CCtrlData@@IAE_NXZ @779 NONAME
+?GetDataSigned@CDataLink@@QAEEXZ @780 NONAME
+?GetDataType@CCtrlData@@IAEEXZ @781 NONAME
+?GetDataType@CDataLink@@QAEEXZ @782 NONAME
+?GetDropHilight@CCtrlTreeView@@QAEPAU_TREEITEM@@XZ @783 NONAME
+?GetDroppedState@CCtrlCombo@@QAE_NXZ @784 NONAME
+?GetEditControl@CCtrlClc@@QAEPAUHWND__@@XZ @785 NONAME
+?GetEditControl@CCtrlListView@@QAEPAUHWND__@@XZ @786 NONAME
+?GetEditControl@CCtrlTreeView@@QAEPAUHWND__@@XZ @787 NONAME
+?GetExStyle@CCtrlClc@@QAEKXZ @788 NONAME
+?GetExpand@CCtrlClc@@QAEKPAX@Z @789 NONAME
+?GetExtendedListViewStyle@CCtrlListView@@QAEKXZ @790 NONAME
+?GetExtraColumns@CCtrlClc@@QAEHXZ @791 NONAME
+?GetExtraImage@CCtrlClc@@QAEEPAXH@Z @792 NONAME
+?GetExtraImageList@CCtrlClc@@QAEPAU_IMAGELIST@@XZ @793 NONAME
+?GetFirstVisible@CCtrlTreeView@@QAEPAU_TREEITEM@@XZ @794 NONAME
+?GetFont@CCtrlClc@@QAEPAUHFONT__@@H@Z @795 NONAME
+?GetGroupMetrics@CCtrlListView@@QAEXPAUtagLVGROUPMETRICS@@@Z @796 NONAME
+?GetHeader@CCtrlListView@@QAEPAUHWND__@@XZ @797 NONAME
+?GetHideOfflineRoot@CCtrlClc@@QAE_NXZ @798 NONAME
+?GetHotCursor@CCtrlListView@@QAEPAUHICON__@@XZ @799 NONAME
+?GetHotItem@CCtrlListView@@QAEHXZ @800 NONAME
+?GetHoverTime@CCtrlListView@@QAEKXZ @801 NONAME
+?GetHwnd@CCtrlBase@@QBEPAUHWND__@@XZ @802 NONAME
+?GetHwnd@CDlgBase@@QBEPAUHWND__@@XZ @803 NONAME
+?GetISearchString@CCtrlListView@@QAEHPAD@Z @804 NONAME
+?GetImageList@CCtrlListView@@QAEPAU_IMAGELIST@@H@Z @805 NONAME
+?GetImageList@CCtrlTreeView@@QAEPAU_IMAGELIST@@H@Z @806 NONAME
+?GetIndent@CCtrlTreeView@@QAEHXZ @807 NONAME
+?GetInsertMark@CCtrlListView@@QAEHPAULVINSERTMARK@@@Z @808 NONAME
+?GetInsertMarkColor@CCtrlListView@@QAEKXZ @809 NONAME
+?GetInsertMarkColor@CCtrlTreeView@@QAEKXZ @810 NONAME
+?GetInsertMarkRect@CCtrlListView@@QAEHPAUtagRECT@@@Z @811 NONAME
+?GetInt@CCtrlBase@@QAEHXZ @812 NONAME
+?GetItem@CCtrlListView@@QAEXPAUtagLVITEMW@@@Z @813 NONAME
+?GetItem@CCtrlTreeView@@QAEXPAU_TREEITEM@@PAUtagTVITEMEXW@@@Z @814 NONAME
+?GetItem@CCtrlTreeView@@QAEXPAU_TREEITEM@@PAUtagTVITEMEXW@@PA_WH@Z @815 NONAME
+?GetItem@CCtrlTreeView@@QAEXPAUtagTVITEMEXW@@@Z @816 NONAME
+?GetItemCount@CCtrlListView@@QAEHXZ @817 NONAME
+?GetItemData@CCtrlCombo@@QAEJH@Z @818 NONAME
+?GetItemData@CCtrlListBox@@QAEJH@Z @819 NONAME
+?GetItemData@CCtrlListView@@QAEJH@Z @820 NONAME
+?GetItemHeight@CCtrlTreeView@@QAEHXZ @821 NONAME
+?GetItemPosition@CCtrlListView@@QAEXHPAUtagPOINT@@@Z @822 NONAME
+?GetItemRect@CCtrlListView@@QAEXHPAUtagRECT@@H@Z @823 NONAME
+?GetItemRect@CCtrlTreeView@@QAEXPAU_TREEITEM@@PAUtagRECT@@H@Z @824 NONAME
+?GetItemSpacing@CCtrlListView@@QAEKH@Z @825 NONAME
+?GetItemState@CCtrlListView@@QAEIHI@Z @826 NONAME
+?GetItemState@CCtrlTreeView@@QAEKPAU_TREEITEM@@K@Z @827 NONAME
+?GetItemText@CCtrlCombo@@QAEPA_WH@Z @828 NONAME
+?GetItemText@CCtrlCombo@@QAEPA_WHPA_WH@Z @829 NONAME
+?GetItemText@CCtrlListBox@@QAEPA_WH@Z @830 NONAME
+?GetItemText@CCtrlListBox@@QAEPA_WHPA_WH@Z @831 NONAME
+?GetItemText@CCtrlListView@@QAEXHHPA_WH@Z @832 NONAME
+?GetItemType@CCtrlClc@@QAEHPAX@Z @833 NONAME
+?GetLastVisible@CCtrlTreeView@@QAEPAU_TREEITEM@@XZ @834 NONAME
+?GetLefrMargin@CCtrlClc@@QAEHXZ @835 NONAME
+?GetLineColor@CCtrlTreeView@@QAEKXZ @836 NONAME
+?GetNextItem@CCtrlClc@@QAEPAXPAXK@Z @837 NONAME
+?GetNextItem@CCtrlListView@@QAEHHI@Z @838 NONAME
+?GetNextItem@CCtrlTreeView@@QAEPAU_TREEITEM@@PAU2@K@Z @839 NONAME
+?GetNextSibling@CCtrlTreeView@@QAEPAU_TREEITEM@@PAU2@@Z @840 NONAME
+?GetNextVisible@CCtrlTreeView@@QAEPAU_TREEITEM@@PAU2@@Z @841 NONAME
+?GetNumberOfWorkAreas@CCtrlListView@@QAEHPAI@Z @842 NONAME
+?GetOrigin@CCtrlListView@@QAEHPAUtagPOINT@@@Z @843 NONAME
+?GetOutlineColor@CCtrlListView@@QAEKXZ @844 NONAME
+?GetParent@CCtrlBase@@QAEPAVCDlgBase@@XZ @845 NONAME
+?GetParent@CCtrlTreeView@@QAEPAU_TREEITEM@@PAU2@@Z @846 NONAME
+?GetPrevSibling@CCtrlTreeView@@QAEPAU_TREEITEM@@PAU2@@Z @847 NONAME
+?GetPrevVisible@CCtrlTreeView@@QAEPAU_TREEITEM@@PAU2@@Z @848 NONAME
+?GetProtoInterface@CProtoIntDlgBase@@QAEPAUPROTO_INTERFACE@@XZ @849 NONAME
+?GetRoot@CCtrlTreeView@@QAEPAU_TREEITEM@@XZ @850 NONAME
+?GetScrollTime@CCtrlTreeView@@QAEKXZ @851 NONAME
+?GetSel@CCtrlListBox@@QAE_NH@Z @852 NONAME
+?GetSelCount@CCtrlListBox@@QAEHXZ @853 NONAME
+?GetSelItems@CCtrlListBox@@QAEPAHPAHH@Z @854 NONAME
+?GetSelItems@CCtrlListBox@@QAEPAHXZ @855 NONAME
+?GetSelectedColumn@CCtrlListView@@QAEIXZ @856 NONAME
+?GetSelectedCount@CCtrlListView@@QAEIXZ @857 NONAME
+?GetSelection@CCtrlClc@@QAEPAXXZ @858 NONAME
+?GetSelection@CCtrlTreeView@@QAEPAU_TREEITEM@@XZ @859 NONAME
+?GetSelectionMark@CCtrlListView@@QAEHXZ @860 NONAME
+?GetState@CCtrlCheck@@QAEHXZ @861 NONAME
+?GetStringWidth@CCtrlListView@@QAEHPBD@Z @862 NONAME
+?GetSubItemRect@CCtrlListView@@QAEHHHHPAUtagRECT@@@Z @863 NONAME
+?GetText@CCtrlBase@@QAEPA_WPA_WH@Z @864 NONAME
+?GetText@CCtrlBase@@QAEPA_WXZ @865 NONAME
+?GetTextA@CCtrlBase@@QAEPADPADH@Z @866 NONAME
+?GetTextA@CCtrlBase@@QAEPADXZ @867 NONAME
+?GetTextBkColor@CCtrlListView@@QAEKXZ @868 NONAME
+?GetTextColor@CCtrlListView@@QAEKXZ @869 NONAME
+?GetTextColor@CCtrlTreeView@@QAEKXZ @870 NONAME
+?GetTextColot@CCtrlClc@@QAEKH@Z @871 NONAME
+?GetTileInfo@CCtrlListView@@QAEXPAUtagLVTILEINFO@@@Z @872 NONAME
+?GetTileViewInfo@CCtrlListView@@QAEXPAUtagLVTILEVIEWINFO@@@Z @873 NONAME
+?GetToolTips@CCtrlListView@@QAEPAUHWND__@@XZ @874 NONAME
+?GetToolTips@CCtrlTreeView@@QAEPAUHWND__@@XZ @875 NONAME
+?GetTopIndex@CCtrlListView@@QAEHXZ @876 NONAME
+?GetUnicodeFormat@CCtrlListView@@QAEHXZ @877 NONAME
+?GetUnicodeFormat@CCtrlTreeView@@QAEHXZ @878 NONAME
+?GetView@CCtrlListView@@QAEKXZ @879 NONAME
+?GetViewRect@CCtrlListView@@QAEHPAUtagRECT@@@Z @880 NONAME
+?GetVisibleCount@CCtrlTreeView@@QAEIXZ @881 NONAME
+?GetWorkAreas@CCtrlListView@@QAEXHPAUtagRECT@@@Z @882 NONAME
+?GlobalDlgProc@CDlgBase@@CGHPAUHWND__@@IIJ@Z @883 NONAME
+?GlobalDlgResizer@CDlgBase@@CAHPAUHWND__@@JPAUUTILRESIZECONTROL@@@Z @884 NONAME
+?GlobalSubclassWndProc@CCtrlBase@@CGJPAUHWND__@@IIJ@Z @885 NONAME
+?HasGroup@CCtrlListView@@QAEHH@Z @886 NONAME
+?HitTest@CCtrlClc@@QAEPAXHHPAK@Z @887 NONAME
+?HitTest@CCtrlListView@@QAEHPAUtagLVHITTESTINFO@@@Z @888 NONAME
+?HitTest@CCtrlTreeView@@QAEPAU_TREEITEM@@PAUtagTVHITTESTINFO@@@Z @889 NONAME
+?InsertColumn@CCtrlListView@@QAEHHQAUtagLVCOLUMNW@@@Z @890 NONAME
+?InsertGroup@CCtrlListView@@QAEHHPAUtagLVGROUP@@@Z @891 NONAME
+?InsertGroupSorted@CCtrlListView@@QAEXPAUtagLVINSERTGROUPSORTED@@@Z @892 NONAME
+?InsertItem@CCtrlListView@@QAEHQAUtagLVITEMW@@@Z @893 NONAME
+?InsertItem@CCtrlTreeView@@QAEPAU_TREEITEM@@PAUtagTVINSERTSTRUCTW@@@Z @894 NONAME
+?InsertMarkHitTest@CCtrlListView@@QAEHPAUtagPOINT@@PAULVINSERTMARK@@@Z @895 NONAME
+?InsertString@CCtrlCombo@@QAEHPA_WHJ@Z @896 NONAME
+?InsertString@CCtrlListBox@@QAEHPA_WHJ@Z @897 NONAME
+?IsChanged@CCtrlData@@QBE_NXZ @898 NONAME
+?IsGroupViewEnabled@CCtrlListView@@QAEHXZ @899 NONAME
+?IsInitialized@CDlgBase@@QBE_NXZ @900 NONAME
+?LoadSigned@CCtrlData@@IAEHXZ @901 NONAME
+?LoadSigned@CDbLink@@UAEHXZ @902 NONAME
+?LoadText@CCtrlData@@IAEPB_WXZ @903 NONAME
+?LoadText@CDbLink@@UAEPA_WXZ @904 NONAME
+?LoadUnsigned@CCtrlData@@IAEKXZ @905 NONAME
+?LoadUnsigned@CDbLink@@UAEKXZ @906 NONAME
+?MakeFlat@CCtrlMButton@@QAEXXZ @907 NONAME
+?MakePush@CCtrlMButton@@QAEXXZ @908 NONAME
+?MapIDToIndex@CCtrlListView@@QAEII@Z @909 NONAME
+?MapIndexToID@CCtrlListView@@QAEII@Z @910 NONAME
+?NotifyChange@CCtrlData@@IAEXXZ @911 NONAME
+?NotifyControls@CDlgBase@@AAEXP8CCtrlBase@@AEXXZ@Z @912 NONAME
+?OnApply@CCtrlBase@@UAEXXZ @913 NONAME
+?OnApply@CCtrlCheck@@UAEXXZ @914 NONAME
+?OnApply@CCtrlCombo@@UAEXXZ @915 NONAME
+?OnApply@CCtrlEdit@@UAEXXZ @916 NONAME
+?OnApply@CDlgBase@@MAEXXZ @917 NONAME
+?OnChange@CDlgBase@@MAEXPAVCCtrlBase@@@Z @918 NONAME
+?OnClose@CDlgBase@@MAEXXZ @919 NONAME
+?OnCommand@CCtrlBase@@UAEHPAUHWND__@@GG@Z @920 NONAME
+?OnCommand@CCtrlButton@@UAEHPAUHWND__@@GG@Z @921 NONAME
+?OnCommand@CCtrlCheck@@UAEHPAUHWND__@@GG@Z @922 NONAME
+?OnCommand@CCtrlCombo@@UAEHPAUHWND__@@GG@Z @923 NONAME
+?OnCommand@CCtrlEdit@@UAEHPAUHWND__@@GG@Z @924 NONAME
+?OnCommand@CCtrlHyperlink@@UAEHPAUHWND__@@GG@Z @925 NONAME
+?OnCommand@CCtrlListBox@@MAEHPAUHWND__@@GG@Z @926 NONAME
+?OnDeleteItem@CCtrlBase@@UAEHPAUtagDELETEITEMSTRUCT@@@Z @927 NONAME
+?OnDestroy@CCtrlBase@@UAEXXZ @928 NONAME
+?OnDestroy@CCtrlPages@@MAEXXZ @929 NONAME
+?OnDestroy@CDlgBase@@MAEXXZ @930 NONAME
+?OnDrawItem@CCtrlBase@@UAEHPAUtagDRAWITEMSTRUCT@@@Z @931 NONAME
+?OnInit@CCtrlBase@@UAEXXZ @932 NONAME
+?OnInit@CCtrlCheck@@UAEXXZ @933 NONAME
+?OnInit@CCtrlCombo@@UAEXXZ @934 NONAME
+?OnInit@CCtrlData@@UAEXXZ @935 NONAME
+?OnInit@CCtrlEdit@@UAEXXZ @936 NONAME
+?OnInit@CCtrlMButton@@UAEXXZ @937 NONAME
+?OnInit@CCtrlPages@@MAEXXZ @938 NONAME
+?OnInitDialog@CDlgBase@@MAEXXZ @939 NONAME
+?OnMeasureItem@CCtrlBase@@UAEHPAUtagMEASUREITEMSTRUCT@@@Z @940 NONAME
+?OnNotify@CCtrlBase@@UAEHHPAUtagNMHDR@@@Z @941 NONAME
+?OnNotify@CCtrlClc@@MAEHHPAUtagNMHDR@@@Z @942 NONAME
+?OnNotify@CCtrlListView@@MAEHHPAUtagNMHDR@@@Z @943 NONAME
+?OnNotify@CCtrlPages@@MAEHHPAUtagNMHDR@@@Z @944 NONAME
+?OnNotify@CCtrlTreeView@@MAEHHPAUtagNMHDR@@@Z @945 NONAME
+?OnProtoActivate@CProtoIntDlgBase@@MAEXIJ@Z @946 NONAME
+?OnProtoCheckOnline@CProtoIntDlgBase@@MAEXIJ@Z @947 NONAME
+?OnProtoRefresh@CProtoIntDlgBase@@MAEXIJ@Z @948 NONAME
+?OnReset@CCtrlBase@@UAEXXZ @949 NONAME
+?OnReset@CCtrlCheck@@UAEXXZ @950 NONAME
+?OnReset@CCtrlCombo@@UAEXXZ @951 NONAME
+?OnReset@CCtrlEdit@@UAEXXZ @952 NONAME
+?OnReset@CDlgBase@@MAEXXZ @953 NONAME
+?RedrawItems@CCtrlListView@@QAEHHH@Z @954 NONAME
+?RemoveAllGroups@CCtrlListView@@QAEXXZ @955 NONAME
+?RemoveGroup@CCtrlListView@@QAEHH@Z @956 NONAME
+?ResetContent@CCtrlCombo@@QAEXXZ @957 NONAME
+?ResetContent@CCtrlListBox@@QAEXXZ @958 NONAME
+?Resizer@CDlgBase@@MAEHPAUUTILRESIZECONTROL@@@Z @959 NONAME
+?SaveInt@CCtrlData@@IAEXK@Z @960 NONAME
+?SaveInt@CDbLink@@UAEXK@Z @961 NONAME
+?SaveText@CCtrlData@@IAEXPA_W@Z @962 NONAME
+?SaveText@CDbLink@@UAEXPA_W@Z @963 NONAME
+?Scroll@CCtrlListView@@QAEHHH@Z @964 NONAME
+?Select@CCtrlTreeView@@QAEXPAU_TREEITEM@@K@Z @965 NONAME
+?SelectDropTarget@CCtrlTreeView@@QAEXPAU_TREEITEM@@@Z @966 NONAME
+?SelectItem@CCtrlClc@@QAEXPAX@Z @967 NONAME
+?SelectItem@CCtrlTreeView@@QAEXPAU_TREEITEM@@@Z @968 NONAME
+?SelectSetFirstVisible@CCtrlTreeView@@QAEXPAU_TREEITEM@@@Z @969 NONAME
+?SelectString@CCtrlCombo@@QAEHPA_W@Z @970 NONAME
+?SelectString@CCtrlListBox@@QAEHPA_W@Z @971 NONAME
+?SendMsg@CCtrlBase@@QAEJIIJ@Z @972 NONAME
+?SetBkBitmap@CCtrlClc@@QAEXKPAUHBITMAP__@@@Z @973 NONAME
+?SetBkColor@CCtrlClc@@QAEXK@Z @974 NONAME
+?SetBkColor@CCtrlListView@@QAEHK@Z @975 NONAME
+?SetBkColor@CCtrlTreeView@@QAEKK@Z @976 NONAME
+?SetBkImage@CCtrlListView@@QAEHPAUtagLVBKIMAGEW@@@Z @977 NONAME
+?SetCallbackMask@CCtrlListView@@QAEHI@Z @978 NONAME
+?SetCheck@CCtrlClc@@QAEXPAX_N@Z @979 NONAME
+?SetCheckState@CCtrlListView@@QAEXIH@Z @980 NONAME
+?SetCheckState@CCtrlTreeView@@QAEXPAU_TREEITEM@@K@Z @981 NONAME
+?SetColumn@CCtrlListView@@QAEHHPAUtagLVCOLUMNW@@@Z @982 NONAME
+?SetColumnOrderArray@CCtrlListView@@QAEHHPAH@Z @983 NONAME
+?SetColumnWidth@CCtrlListView@@QAEHHH@Z @984 NONAME
+?SetCurSel@CCtrlCombo@@QAEHH@Z @985 NONAME
+?SetCurSel@CCtrlListBox@@QAEHH@Z @986 NONAME
+?SetExStyle@CCtrlClc@@QAEXK@Z @987 NONAME
+?SetExtendedListViewStyle@CCtrlListView@@QAEXK@Z @988 NONAME
+?SetExtendedListViewStyleEx@CCtrlListView@@QAEXKK@Z @989 NONAME
+?SetExtraColumns@CCtrlClc@@QAEXH@Z @990 NONAME
+?SetExtraImage@CCtrlClc@@QAEXPAXHH@Z @991 NONAME
+?SetExtraImageList@CCtrlClc@@QAEXPAU_IMAGELIST@@@Z @992 NONAME
+?SetFont@CCtrlClc@@QAEXHPAX_N@Z @993 NONAME
+?SetGreyoutFlags@CCtrlClc@@QAEXK@Z @994 NONAME
+?SetGroupInfo@CCtrlListView@@QAEHHPAUtagLVGROUP@@@Z @995 NONAME
+?SetGroupMetrics@CCtrlListView@@QAEXPAUtagLVGROUPMETRICS@@@Z @996 NONAME
+?SetHideEmptyGroups@CCtrlClc@@QAEX_N@Z @997 NONAME
+?SetHideOfflineRoot@CCtrlClc@@QAEX_N@Z @998 NONAME
+?SetHotCursor@CCtrlListView@@QAEPAUHICON__@@PAU2@@Z @999 NONAME
+?SetHotItem@CCtrlListView@@QAEHH@Z @1000 NONAME
+?SetHoverTime@CCtrlListView@@QAEXK@Z @1001 NONAME
+?SetIconSpacing@CCtrlListView@@QAEKHH@Z @1002 NONAME
+?SetImageList@CCtrlListView@@QAEPAU_IMAGELIST@@PAU2@H@Z @1003 NONAME
+?SetImageList@CCtrlTreeView@@QAEXPAU_IMAGELIST@@H@Z @1004 NONAME
+?SetIndent@CCtrlClc@@QAEXH@Z @1005 NONAME
+?SetIndent@CCtrlTreeView@@QAEXH@Z @1006 NONAME
+?SetInfoTip@CCtrlListView@@QAEHPAUtagLVSETINFOTIP@@@Z @1007 NONAME
+?SetInsertMark@CCtrlListView@@QAEHPAULVINSERTMARK@@@Z @1008 NONAME
+?SetInsertMark@CCtrlTreeView@@QAEXPAU_TREEITEM@@H@Z @1009 NONAME
+?SetInsertMarkColor@CCtrlListView@@QAEKK@Z @1010 NONAME
+?SetInsertMarkColor@CCtrlTreeView@@QAEKK@Z @1011 NONAME
+?SetInt@CCtrlBase@@QAEXH@Z @1012 NONAME
+?SetItem@CCtrlListView@@QAEHQAUtagLVITEMW@@@Z @1013 NONAME
+?SetItem@CCtrlListView@@QAEXHHPA_WH@Z @1014 NONAME
+?SetItem@CCtrlTreeView@@QAEXPAUtagTVITEMEXW@@@Z @1015 NONAME
+?SetItemCount@CCtrlListView@@QAEXH@Z @1016 NONAME
+?SetItemCountEx@CCtrlListView@@QAEXHK@Z @1017 NONAME
+?SetItemData@CCtrlCombo@@QAEXHJ@Z @1018 NONAME
+?SetItemData@CCtrlListBox@@QAEXHJ@Z @1019 NONAME
+?SetItemHeight@CCtrlTreeView@@QAEXF@Z @1020 NONAME
+?SetItemPosition32@CCtrlListView@@QAEXHHH@Z @1021 NONAME
+?SetItemPosition@CCtrlListView@@QAEHHHH@Z @1022 NONAME
+?SetItemState@CCtrlListView@@QAEXHII@Z @1023 NONAME
+?SetItemState@CCtrlTreeView@@QAEXPAU_TREEITEM@@KK@Z @1024 NONAME
+?SetItemText@CCtrlClc@@QAEXPAXPAD@Z @1025 NONAME
+?SetItemText@CCtrlListView@@QAEXHHPA_W@Z @1026 NONAME
+?SetLeftMargin@CCtrlClc@@QAEXH@Z @1027 NONAME
+?SetLineColor@CCtrlTreeView@@QAEKK@Z @1028 NONAME
+?SetOfflineModes@CCtrlClc@@QAEXK@Z @1029 NONAME
+?SetOutlineColor@CCtrlListView@@QAEKK@Z @1030 NONAME
+?SetScrollTime@CCtrlTreeView@@QAEXI@Z @1031 NONAME
+?SetSel@CCtrlListBox@@QAEXH_N@Z @1032 NONAME
+?SetSelectedColumn@CCtrlListView@@QAEXH@Z @1033 NONAME
+?SetSelectionMark@CCtrlListView@@QAEHH@Z @1034 NONAME
+?SetState@CCtrlCheck@@QAEXH@Z @1035 NONAME
+?SetStatusText@CProtoIntDlgBase@@QAEXPB_W@Z @1036 NONAME
+?SetText@CCtrlBase@@QAEXPB_W@Z @1037 NONAME
+?SetTextA@CCtrlBase@@QAEXPBD@Z @1038 NONAME
+?SetTextBkColor@CCtrlListView@@QAEHK@Z @1039 NONAME
+?SetTextColor@CCtrlClc@@QAEXHK@Z @1040 NONAME
+?SetTextColor@CCtrlListView@@QAEHK@Z @1041 NONAME
+?SetTextColor@CCtrlTreeView@@QAEKK@Z @1042 NONAME
+?SetTileInfo@CCtrlListView@@QAEHPAUtagLVTILEINFO@@@Z @1043 NONAME
+?SetTileViewInfo@CCtrlListView@@QAEHPAUtagLVTILEVIEWINFO@@@Z @1044 NONAME
+?SetToolTips@CCtrlListView@@QAEPAUHWND__@@PAU2@@Z @1045 NONAME
+?SetToolTips@CCtrlTreeView@@QAEPAUHWND__@@PAU2@@Z @1046 NONAME
+?SetUnicodeFormat@CCtrlListView@@QAEHH@Z @1047 NONAME
+?SetUnicodeFormat@CCtrlTreeView@@QAEHH@Z @1048 NONAME
+?SetUseGroups@CCtrlClc@@QAEX_N@Z @1049 NONAME
+?SetView@CCtrlListView@@QAEHK@Z @1050 NONAME
+?SetWorkAreas@CCtrlListView@@QAEXHPAUtagRECT@@@Z @1051 NONAME
+?Show@CDlgBase@@QAEXH@Z @1052 NONAME
+?ShowDropdown@CCtrlCombo@@QAEX_N@Z @1053 NONAME
+?ShowPage@CCtrlPages@@AAEXPAVCDlgBase@@@Z @1054 NONAME
+?SortChildren@CCtrlTreeView@@QAEXPAU_TREEITEM@@H@Z @1055 NONAME
+?SortChildrenCB@CCtrlTreeView@@QAEXPAUtagTVSORTCB@@H@Z @1056 NONAME
+?SortGroups@CCtrlListView@@QAEHP6GHHHPAX@Z0@Z @1057 NONAME
+?SortItems@CCtrlListView@@QAEHP6GHJJJ@ZJ@Z @1058 NONAME
+?SortItemsEx@CCtrlListView@@QAEHP6GHJJJ@ZJ@Z @1059 NONAME
+?SubItemHitTest@CCtrlListView@@QAEHPAUtagLVHITTESTINFO@@@Z @1060 NONAME
+?Subclass@CCtrlBase@@IAEXXZ @1061 NONAME
+?ThemeDialogBackground@CDlgBase@@IAEXH@Z @1062 NONAME
+?TranslateItem@CCtrlTreeView@@QAEXPAU_TREEITEM@@@Z @1063 NONAME
+?TranslateTree@CCtrlTreeView@@QAEXXZ @1064 NONAME
+?Unsubclass@CCtrlBase@@IAEXXZ @1065 NONAME
+?Update@CCtrlListView@@QAEHH@Z @1066 NONAME
+?UpdateProtoTitle@CProtoIntDlgBase@@AAEXPB_W@Z @1067 NONAME
+?UpdateStatusBar@CProtoIntDlgBase@@AAEXXZ @1068 NONAME
+?WindowSubscribe@PROTO_INTERFACE@@QAEXPAUHWND__@@@Z @1069 NONAME
+?WindowUnsubscribe@PROTO_INTERFACE@@QAEXPAUHWND__@@@Z @1070 NONAME
+?cmp@CCtrlBase@@SAHPBV1@0@Z @1071 NONAME
+?GetCtrlId@CCtrlBase@@QBEHXZ @1072 NONAME
+ProtoWindowAdd @1073
+ProtoWindowRemove @1074
+Proto_IsProtocolLoaded @1075
+Proto_RegisterModule @1076
diff --git a/src/mir_core/src/mir_core64.def b/src/mir_core/src/mir_core64.def
index b66aa36d74..b281f47266 100644
--- a/src/mir_core/src/mir_core64.def
+++ b/src/mir_core/src/mir_core64.def
@@ -608,3 +608,471 @@ mir_wstrcmpi @280
?setWString@PROTO_INTERFACE@@QEAAXPEBDPEB_W@Z @606 NONAME
?setWord@PROTO_INTERFACE@@QEAAXIPEBDG@Z @607 NONAME
?setWord@PROTO_INTERFACE@@QEAAXPEBDG@Z @608 NONAME
+??0CCtrlBase@@QEAA@AEBV0@@Z @609 NONAME
+??0CCtrlBase@@QEAA@PEAVCDlgBase@@H@Z @610 NONAME
+??0CCtrlButton@@QEAA@AEBV0@@Z @611 NONAME
+??0CCtrlButton@@QEAA@PEAVCDlgBase@@H@Z @612 NONAME
+??0CCtrlCheck@@QEAA@AEBV0@@Z @613 NONAME
+??0CCtrlCheck@@QEAA@PEAVCDlgBase@@H@Z @614 NONAME
+??0CCtrlClc@@QEAA@AEBV0@@Z @615 NONAME
+??0CCtrlClc@@QEAA@PEAVCDlgBase@@H@Z @616 NONAME
+??0CCtrlCombo@@QEAA@AEBV0@@Z @617 NONAME
+??0CCtrlCombo@@QEAA@PEAVCDlgBase@@H@Z @618 NONAME
+??0CCtrlData@@QEAA@AEBV0@@Z @619 NONAME
+??0CCtrlData@@QEAA@PEAVCDlgBase@@H@Z @620 NONAME
+??0CCtrlEdit@@QEAA@AEBV0@@Z @621 NONAME
+??0CCtrlEdit@@QEAA@PEAVCDlgBase@@H@Z @622 NONAME
+??0CCtrlHyperlink@@QEAA@AEBV0@@Z @623 NONAME
+??0CCtrlHyperlink@@QEAA@PEAVCDlgBase@@HPEBD@Z @624 NONAME
+??0CCtrlListBox@@QEAA@AEBV0@@Z @625 NONAME
+??0CCtrlListBox@@QEAA@PEAVCDlgBase@@H@Z @626 NONAME
+??0CCtrlListView@@QEAA@AEBV0@@Z @627 NONAME
+??0CCtrlListView@@QEAA@PEAVCDlgBase@@H@Z @628 NONAME
+??0CCtrlMButton@@QEAA@AEBV0@@Z @629 NONAME
+??0CCtrlMButton@@QEAA@PEAVCDlgBase@@HHPEBD@Z @630 NONAME
+??0CCtrlMButton@@QEAA@PEAVCDlgBase@@HPEAUHICON__@@PEBD@Z @631 NONAME
+??0CCtrlPages@@QEAA@AEBV0@@Z @632 NONAME
+??0CCtrlPages@@QEAA@PEAVCDlgBase@@H@Z @633 NONAME
+??0CCtrlTreeView@@QEAA@AEBV0@@Z @634 NONAME
+??0CCtrlTreeView@@QEAA@PEAVCDlgBase@@H@Z @635 NONAME
+??0CDataLink@@QEAA@AEBV0@@Z @636 NONAME
+??0CDataLink@@QEAA@E_N@Z @637 NONAME
+??0CDbLink@@QEAA@AEBV0@@Z @638 NONAME
+??0CDbLink@@QEAA@PEBD0EK_N@Z @639 NONAME
+??0CDbLink@@QEAA@PEBD0EPEA_W@Z @640 NONAME
+??0CDlgBase@@QEAA@AEBV0@@Z @641 NONAME
+??0CDlgBase@@QEAA@PEAUHINSTANCE__@@HPEAUHWND__@@@Z @642 NONAME
+??0CProtoIntDlgBase@@QEAA@AEBV0@@Z @643 NONAME
+??0CProtoIntDlgBase@@QEAA@PEAUPROTO_INTERFACE@@HPEAUHWND__@@_N@Z @644 NONAME
+??1CCtrlBase@@UEAA@XZ @645 NONAME
+??1CCtrlButton@@UEAA@XZ @646 NONAME
+??1CCtrlCheck@@UEAA@XZ @647 NONAME
+??1CCtrlClc@@UEAA@XZ @648 NONAME
+??1CCtrlCombo@@UEAA@XZ @649 NONAME
+??1CCtrlData@@UEAA@XZ @650 NONAME
+??1CCtrlEdit@@UEAA@XZ @651 NONAME
+??1CCtrlHyperlink@@UEAA@XZ @652 NONAME
+??1CCtrlListBox@@UEAA@XZ @653 NONAME
+??1CCtrlListView@@UEAA@XZ @654 NONAME
+??1CCtrlMButton@@UEAA@XZ @655 NONAME
+??1CCtrlPages@@UEAA@XZ @656 NONAME
+??1CCtrlTreeView@@UEAA@XZ @657 NONAME
+??1CDataLink@@UEAA@XZ @658 NONAME
+??1CDbLink@@UEAA@XZ @659 NONAME
+??1CDlgBase@@UEAA@XZ @660 NONAME
+??1CProtoIntDlgBase@@UEAA@XZ @661 NONAME
+??4CCtrlBase@@QEAAAEAV0@AEBV0@@Z @662 NONAME
+??4CCtrlButton@@QEAAAEAV0@AEBV0@@Z @663 NONAME
+??4CCtrlCheck@@QEAAAEAV0@AEBV0@@Z @664 NONAME
+??4CCtrlClc@@QEAAAEAV0@AEBV0@@Z @665 NONAME
+??4CCtrlCombo@@QEAAAEAV0@AEBV0@@Z @666 NONAME
+??4CCtrlData@@QEAAAEAV0@AEBV0@@Z @667 NONAME
+??4CCtrlEdit@@QEAAAEAV0@AEBV0@@Z @668 NONAME
+??4CCtrlHyperlink@@QEAAAEAV0@AEBV0@@Z @669 NONAME
+??4CCtrlListBox@@QEAAAEAV0@AEBV0@@Z @670 NONAME
+??4CCtrlListView@@QEAAAEAV0@AEBV0@@Z @671 NONAME
+??4CCtrlMButton@@QEAAAEAV0@AEBV0@@Z @672 NONAME
+??4CCtrlPages@@QEAAAEAV0@AEBV0@@Z @673 NONAME
+??4CCtrlTreeView@@QEAAAEAV0@AEBV0@@Z @674 NONAME
+??4CDataLink@@QEAAAEAV0@AEBV0@@Z @675 NONAME
+??4CDbLink@@QEAAAEAV0@AEBV0@@Z @676 NONAME
+??4CDlgBase@@QEAAAEAV0@AEBV0@@Z @677 NONAME
+??4CProtoIntDlgBase@@QEAAAEAV0@AEBV0@@Z @678 NONAME
+??_7CCtrlBase@@6B@ @679 NONAME
+??_7CCtrlButton@@6B@ @680 NONAME
+??_7CCtrlCheck@@6B@ @681 NONAME
+??_7CCtrlClc@@6B@ @682 NONAME
+??_7CCtrlCombo@@6B@ @683 NONAME
+??_7CCtrlData@@6B@ @684 NONAME
+??_7CCtrlEdit@@6B@ @685 NONAME
+??_7CCtrlHyperlink@@6B@ @686 NONAME
+??_7CCtrlListBox@@6B@ @687 NONAME
+??_7CCtrlListView@@6B@ @688 NONAME
+??_7CCtrlMButton@@6B@ @689 NONAME
+??_7CCtrlPages@@6B@ @690 NONAME
+??_7CCtrlTreeView@@6B@ @691 NONAME
+??_7CDataLink@@6B@ @692 NONAME
+??_7CDbLink@@6B@ @693 NONAME
+??_7CDlgBase@@6B@ @694 NONAME
+??_7CProtoIntDlgBase@@6B@ @695 NONAME
+?ActivatePage@CCtrlPages@@QEAAXH@Z @696 NONAME
+?ActiveMessage@CDlgBase@@QEBAPEBUtagMSG@@XZ @697 NONAME
+?AddColumn@CCtrlListView@@QEAAXHPEA_WH@Z @698 NONAME
+?AddContact@CCtrlClc@@QEAAXI@Z @699 NONAME
+?AddControl@CDlgBase@@IEAAXPEAVCCtrlBase@@@Z @700 NONAME
+?AddGroup@CCtrlClc@@QEAAXPEAX@Z @701 NONAME
+?AddGroup@CCtrlListView@@QEAAXHPEA_W@Z @702 NONAME
+?AddInfoItem@CCtrlClc@@QEAAPEAXPEAUCLCINFOITEM@@@Z @703 NONAME
+?AddItem@CCtrlListView@@QEAAHPEA_WH_JH@Z @704 NONAME
+?AddPage@CCtrlPages@@QEAAXPEA_WPEAUHICON__@@U?$CCallback@X@@PEAX@Z @705 NONAME
+?AddString@CCtrlCombo@@QEAAHPEB_W_J@Z @706 NONAME
+?AddString@CCtrlListBox@@QEAAHPEA_W_J@Z @707 NONAME
+?AddStringA@CCtrlCombo@@QEAAHPEBD_J@Z @708 NONAME
+?ApproximateViewRect@CCtrlListView@@QEAAKHHH@Z @709 NONAME
+?Arrange@CCtrlListView@@QEAAXI@Z @710 NONAME
+?AttachDialog@CCtrlPages@@QEAAXHPEAVCDlgBase@@@Z @711 NONAME
+?AutoRebuild@CCtrlClc@@QEAAXXZ @712 NONAME
+?CancelEditLabel@CCtrlListView@@QEAAXXZ @713 NONAME
+?Close@CDlgBase@@QEAAXXZ @714 NONAME
+?Create@CDlgBase@@QEAAXXZ @715 NONAME
+?CreateDbLink@CCtrlData@@QEAAXPEAVCDataLink@@@Z @716 NONAME
+?CreateDbLink@CCtrlData@@QEAAXPEBD0EK_N@Z @717 NONAME
+?CreateDbLink@CCtrlData@@QEAAXPEBD0PEA_W@Z @718 NONAME
+?CreateDragImage@CCtrlListView@@QEAAPEAU_IMAGELIST@@HPEAUtagPOINT@@@Z @719 NONAME
+?CreateDragImage@CCtrlTreeView@@QEAAPEAU_IMAGELIST@@PEAU_TREEITEM@@@Z @720 NONAME
+?CreateImageList@CCtrlListView@@QEAAPEAU_IMAGELIST@@H@Z @721 NONAME
+?CreateLink@CProtoIntDlgBase@@QEAAXAEAVCCtrlData@@PEADEK_N@Z @722 NONAME
+?CreateLink@CProtoIntDlgBase@@QEAAXAEAVCCtrlData@@PEBDPEA_W@Z @723 NONAME
+?CustomWndProc@CCtrlBase@@MEAA_JI_K_J@Z @724 NONAME
+?CustomWndProc@CCtrlPages@@MEAA_JI_K_J@Z @725 NONAME
+?DeleteAllItems@CCtrlListView@@QEAAXXZ @726 NONAME
+?DeleteAllItems@CCtrlTreeView@@QEAAXXZ @727 NONAME
+?DeleteColumn@CCtrlListView@@QEAAXH@Z @728 NONAME
+?DeleteItem@CCtrlClc@@QEAAXPEAX@Z @729 NONAME
+?DeleteItem@CCtrlListView@@QEAAXH@Z @730 NONAME
+?DeleteItem@CCtrlTreeView@@QEAAXPEAU_TREEITEM@@@Z @731 NONAME
+?DeleteString@CCtrlCombo@@QEAAXH@Z @732 NONAME
+?DeleteString@CCtrlListBox@@QEAAXH@Z @733 NONAME
+?Disable@CCtrlBase@@QEAAXXZ @734 NONAME
+?DlgProc@CDlgBase@@MEAA_JI_K_J@Z @735 NONAME
+?DlgProc@CProtoIntDlgBase@@MEAA_JI_K_J@Z @736 NONAME
+?DoModal@CDlgBase@@QEAAHXZ @737 NONAME
+?DynamicDlgProc@CDlgBase@@SA_JPEAUHWND__@@I_K_J@Z @738 NONAME
+?EditLabel@CCtrlClc@@QEAAXPEAX@Z @739 NONAME
+?EditLabel@CCtrlListView@@QEAAPEAUHWND__@@H@Z @740 NONAME
+?EditLabel@CCtrlTreeView@@QEAAPEAUHWND__@@PEAU_TREEITEM@@@Z @741 NONAME
+?Enable@CCtrlBase@@QEAAXH@Z @742 NONAME
+?EnableGroupView@CCtrlListView@@QEAAHH@Z @743 NONAME
+?Enabled@CCtrlBase@@QEBAHXZ @744 NONAME
+?EndEditLabel@CCtrlClc@@QEAAX_N@Z @745 NONAME
+?EndEditLabelNow@CCtrlTreeView@@QEAAXH@Z @746 NONAME
+?EnsureVisible@CCtrlClc@@QEAAXPEAX_N@Z @747 NONAME
+?EnsureVisible@CCtrlListView@@QEAAHHH@Z @748 NONAME
+?EnsureVisible@CCtrlTreeView@@QEAAXPEAU_TREEITEM@@@Z @749 NONAME
+?Expand@CCtrlClc@@QEAAXPEAXK@Z @750 NONAME
+?Expand@CCtrlTreeView@@QEAAXPEAU_TREEITEM@@K@Z @751 NONAME
+?FindContact@CCtrlClc@@QEAAPEAXI@Z @752 NONAME
+?FindControl@CDlgBase@@AEAAPEAVCCtrlBase@@H@Z @753 NONAME
+?FindGroup@CCtrlClc@@QEAAPEAXPEAX@Z @754 NONAME
+?FindItem@CCtrlListView@@QEAAHHPEBUtagLVFINDINFOW@@@Z @755 NONAME
+?FindNamedItem@CCtrlTreeView@@QEAAPEAU_TREEITEM@@PEAU2@PEB_W@Z @756 NONAME
+?FindString@CCtrlCombo@@QEAAHPEB_WH_N@Z @757 NONAME
+?FindString@CCtrlListBox@@QEAAHPEA_WH_N@Z @758 NONAME
+?FindStringA@CCtrlCombo@@QEAAHPEBDH_N@Z @759 NONAME
+?GetBkColor@CCtrlClc@@QEAAKXZ @760 NONAME
+?GetBkColor@CCtrlListView@@QEAAKXZ @761 NONAME
+?GetBkColor@CCtrlTreeView@@QEAAKXZ @762 NONAME
+?GetBkImage@CCtrlListView@@QEAAXPEAUtagLVBKIMAGEW@@@Z @763 NONAME
+?GetCallbackMask@CCtrlListView@@QEAAIXZ @764 NONAME
+?GetCheck@CCtrlClc@@QEAA_NPEAX@Z @765 NONAME
+?GetCheckState@CCtrlListView@@QEAAHI@Z @766 NONAME
+?GetCheckState@CCtrlTreeView@@QEAAKPEAU_TREEITEM@@@Z @767 NONAME
+?GetChild@CCtrlTreeView@@QEAAPEAU_TREEITEM@@PEAU2@@Z @768 NONAME
+?GetColumn@CCtrlListView@@QEAAXHPEAUtagLVCOLUMNW@@@Z @769 NONAME
+?GetColumnOrderArray@CCtrlListView@@QEAAXHPEAH@Z @770 NONAME
+?GetColumnWidth@CCtrlListView@@QEAAHH@Z @771 NONAME
+?GetCount@CCtrlClc@@QEAAHXZ @772 NONAME
+?GetCount@CCtrlCombo@@QEAAHXZ @773 NONAME
+?GetCount@CCtrlListBox@@QEAAHXZ @774 NONAME
+?GetCount@CCtrlTreeView@@QEAAHXZ @775 NONAME
+?GetCountPerPage@CCtrlListView@@QEAAHXZ @776 NONAME
+?GetCurSel@CCtrlCombo@@QEAAHXZ @777 NONAME
+?GetCurSel@CCtrlListBox@@QEAAHXZ @778 NONAME
+?GetDataSigned@CCtrlData@@IEAA_NXZ @779 NONAME
+?GetDataSigned@CDataLink@@QEAAEXZ @780 NONAME
+?GetDataType@CCtrlData@@IEAAEXZ @781 NONAME
+?GetDataType@CDataLink@@QEAAEXZ @782 NONAME
+?GetDropHilight@CCtrlTreeView@@QEAAPEAU_TREEITEM@@XZ @783 NONAME
+?GetDroppedState@CCtrlCombo@@QEAA_NXZ @784 NONAME
+?GetEditControl@CCtrlClc@@QEAAPEAUHWND__@@XZ @785 NONAME
+?GetEditControl@CCtrlListView@@QEAAPEAUHWND__@@XZ @786 NONAME
+?GetEditControl@CCtrlTreeView@@QEAAPEAUHWND__@@XZ @787 NONAME
+?GetExStyle@CCtrlClc@@QEAAKXZ @788 NONAME
+?GetExpand@CCtrlClc@@QEAAKPEAX@Z @789 NONAME
+?GetExtendedListViewStyle@CCtrlListView@@QEAAKXZ @790 NONAME
+?GetExtraColumns@CCtrlClc@@QEAAHXZ @791 NONAME
+?GetExtraImage@CCtrlClc@@QEAAEPEAXH@Z @792 NONAME
+?GetExtraImageList@CCtrlClc@@QEAAPEAU_IMAGELIST@@XZ @793 NONAME
+?GetFirstVisible@CCtrlTreeView@@QEAAPEAU_TREEITEM@@XZ @794 NONAME
+?GetFont@CCtrlClc@@QEAAPEAUHFONT__@@H@Z @795 NONAME
+?GetGroupMetrics@CCtrlListView@@QEAAXPEAUtagLVGROUPMETRICS@@@Z @796 NONAME
+?GetHeader@CCtrlListView@@QEAAPEAUHWND__@@XZ @797 NONAME
+?GetHideOfflineRoot@CCtrlClc@@QEAA_NXZ @798 NONAME
+?GetHotCursor@CCtrlListView@@QEAAPEAUHICON__@@XZ @799 NONAME
+?GetHotItem@CCtrlListView@@QEAAHXZ @800 NONAME
+?GetHoverTime@CCtrlListView@@QEAAKXZ @801 NONAME
+?GetHwnd@CCtrlBase@@QEBAPEAUHWND__@@XZ @802 NONAME
+?GetHwnd@CDlgBase@@QEBAPEAUHWND__@@XZ @803 NONAME
+?GetISearchString@CCtrlListView@@QEAAHPEAD@Z @804 NONAME
+?GetImageList@CCtrlListView@@QEAAPEAU_IMAGELIST@@H@Z @805 NONAME
+?GetImageList@CCtrlTreeView@@QEAAPEAU_IMAGELIST@@H@Z @806 NONAME
+?GetIndent@CCtrlTreeView@@QEAAHXZ @807 NONAME
+?GetInsertMark@CCtrlListView@@QEAAHPEAULVINSERTMARK@@@Z @808 NONAME
+?GetInsertMarkColor@CCtrlListView@@QEAAKXZ @809 NONAME
+?GetInsertMarkColor@CCtrlTreeView@@QEAAKXZ @810 NONAME
+?GetInsertMarkRect@CCtrlListView@@QEAAHPEAUtagRECT@@@Z @811 NONAME
+?GetInt@CCtrlBase@@QEAAHXZ @812 NONAME
+?GetItem@CCtrlListView@@QEAAXPEAUtagLVITEMW@@@Z @813 NONAME
+?GetItem@CCtrlTreeView@@QEAAXPEAU_TREEITEM@@PEAUtagTVITEMEXW@@@Z @814 NONAME
+?GetItem@CCtrlTreeView@@QEAAXPEAU_TREEITEM@@PEAUtagTVITEMEXW@@PEA_WH@Z @815 NONAME
+?GetItem@CCtrlTreeView@@QEAAXPEAUtagTVITEMEXW@@@Z @816 NONAME
+?GetItemCount@CCtrlListView@@QEAAHXZ @817 NONAME
+?GetItemData@CCtrlCombo@@QEAA_JH@Z @818 NONAME
+?GetItemData@CCtrlListBox@@QEAA_JH@Z @819 NONAME
+?GetItemData@CCtrlListView@@QEAA_JH@Z @820 NONAME
+?GetItemHeight@CCtrlTreeView@@QEAAHXZ @821 NONAME
+?GetItemPosition@CCtrlListView@@QEAAXHPEAUtagPOINT@@@Z @822 NONAME
+?GetItemRect@CCtrlListView@@QEAAXHPEAUtagRECT@@H@Z @823 NONAME
+?GetItemRect@CCtrlTreeView@@QEAAXPEAU_TREEITEM@@PEAUtagRECT@@H@Z @824 NONAME
+?GetItemSpacing@CCtrlListView@@QEAAKH@Z @825 NONAME
+?GetItemState@CCtrlListView@@QEAAIHI@Z @826 NONAME
+?GetItemState@CCtrlTreeView@@QEAAKPEAU_TREEITEM@@K@Z @827 NONAME
+?GetItemText@CCtrlCombo@@QEAAPEA_WH@Z @828 NONAME
+?GetItemText@CCtrlCombo@@QEAAPEA_WHPEA_WH@Z @829 NONAME
+?GetItemText@CCtrlListBox@@QEAAPEA_WH@Z @830 NONAME
+?GetItemText@CCtrlListBox@@QEAAPEA_WHPEA_WH@Z @831 NONAME
+?GetItemText@CCtrlListView@@QEAAXHHPEA_WH@Z @832 NONAME
+?GetItemType@CCtrlClc@@QEAAHPEAX@Z @833 NONAME
+?GetLastVisible@CCtrlTreeView@@QEAAPEAU_TREEITEM@@XZ @834 NONAME
+?GetLefrMargin@CCtrlClc@@QEAAHXZ @835 NONAME
+?GetLineColor@CCtrlTreeView@@QEAAKXZ @836 NONAME
+?GetNextItem@CCtrlClc@@QEAAPEAXPEAXK@Z @837 NONAME
+?GetNextItem@CCtrlListView@@QEAAHHI@Z @838 NONAME
+?GetNextItem@CCtrlTreeView@@QEAAPEAU_TREEITEM@@PEAU2@K@Z @839 NONAME
+?GetNextSibling@CCtrlTreeView@@QEAAPEAU_TREEITEM@@PEAU2@@Z @840 NONAME
+?GetNextVisible@CCtrlTreeView@@QEAAPEAU_TREEITEM@@PEAU2@@Z @841 NONAME
+?GetNumberOfWorkAreas@CCtrlListView@@QEAAHPEAI@Z @842 NONAME
+?GetOrigin@CCtrlListView@@QEAAHPEAUtagPOINT@@@Z @843 NONAME
+?GetOutlineColor@CCtrlListView@@QEAAKXZ @844 NONAME
+?GetParent@CCtrlBase@@QEAAPEAVCDlgBase@@XZ @845 NONAME
+?GetParent@CCtrlTreeView@@QEAAPEAU_TREEITEM@@PEAU2@@Z @846 NONAME
+?GetPrevSibling@CCtrlTreeView@@QEAAPEAU_TREEITEM@@PEAU2@@Z @847 NONAME
+?GetPrevVisible@CCtrlTreeView@@QEAAPEAU_TREEITEM@@PEAU2@@Z @848 NONAME
+?GetProtoInterface@CProtoIntDlgBase@@QEAAPEAUPROTO_INTERFACE@@XZ @849 NONAME
+?GetRoot@CCtrlTreeView@@QEAAPEAU_TREEITEM@@XZ @850 NONAME
+?GetScrollTime@CCtrlTreeView@@QEAAKXZ @851 NONAME
+?GetSel@CCtrlListBox@@QEAA_NH@Z @852 NONAME
+?GetSelCount@CCtrlListBox@@QEAAHXZ @853 NONAME
+?GetSelItems@CCtrlListBox@@QEAAPEAHPEAHH@Z @854 NONAME
+?GetSelItems@CCtrlListBox@@QEAAPEAHXZ @855 NONAME
+?GetSelectedColumn@CCtrlListView@@QEAAIXZ @856 NONAME
+?GetSelectedCount@CCtrlListView@@QEAAIXZ @857 NONAME
+?GetSelection@CCtrlClc@@QEAAPEAXXZ @858 NONAME
+?GetSelection@CCtrlTreeView@@QEAAPEAU_TREEITEM@@XZ @859 NONAME
+?GetSelectionMark@CCtrlListView@@QEAAHXZ @860 NONAME
+?GetState@CCtrlCheck@@QEAAHXZ @861 NONAME
+?GetStringWidth@CCtrlListView@@QEAAHPEBD@Z @862 NONAME
+?GetSubItemRect@CCtrlListView@@QEAAHHHHPEAUtagRECT@@@Z @863 NONAME
+?GetText@CCtrlBase@@QEAAPEA_WPEA_WH@Z @864 NONAME
+?GetText@CCtrlBase@@QEAAPEA_WXZ @865 NONAME
+?GetTextA@CCtrlBase@@QEAAPEADPEADH@Z @866 NONAME
+?GetTextA@CCtrlBase@@QEAAPEADXZ @867 NONAME
+?GetTextBkColor@CCtrlListView@@QEAAKXZ @868 NONAME
+?GetTextColor@CCtrlListView@@QEAAKXZ @869 NONAME
+?GetTextColor@CCtrlTreeView@@QEAAKXZ @870 NONAME
+?GetTextColot@CCtrlClc@@QEAAKH@Z @871 NONAME
+?GetTileInfo@CCtrlListView@@QEAAXPEAUtagLVTILEINFO@@@Z @872 NONAME
+?GetTileViewInfo@CCtrlListView@@QEAAXPEAUtagLVTILEVIEWINFO@@@Z @873 NONAME
+?GetToolTips@CCtrlListView@@QEAAPEAUHWND__@@XZ @874 NONAME
+?GetToolTips@CCtrlTreeView@@QEAAPEAUHWND__@@XZ @875 NONAME
+?GetTopIndex@CCtrlListView@@QEAAHXZ @876 NONAME
+?GetUnicodeFormat@CCtrlListView@@QEAAHXZ @877 NONAME
+?GetUnicodeFormat@CCtrlTreeView@@QEAAHXZ @878 NONAME
+?GetView@CCtrlListView@@QEAAKXZ @879 NONAME
+?GetViewRect@CCtrlListView@@QEAAHPEAUtagRECT@@@Z @880 NONAME
+?GetVisibleCount@CCtrlTreeView@@QEAAIXZ @881 NONAME
+?GetWorkAreas@CCtrlListView@@QEAAXHPEAUtagRECT@@@Z @882 NONAME
+?GlobalDlgProc@CDlgBase@@CA_JPEAUHWND__@@I_K_J@Z @883 NONAME
+?GlobalDlgResizer@CDlgBase@@CAHPEAUHWND__@@_JPEAUUTILRESIZECONTROL@@@Z @884 NONAME
+?GlobalSubclassWndProc@CCtrlBase@@CA_JPEAUHWND__@@I_K_J@Z @885 NONAME
+?HasGroup@CCtrlListView@@QEAAHH@Z @886 NONAME
+?HitTest@CCtrlClc@@QEAAPEAXHHPEAK@Z @887 NONAME
+?HitTest@CCtrlListView@@QEAAHPEAUtagLVHITTESTINFO@@@Z @888 NONAME
+?HitTest@CCtrlTreeView@@QEAAPEAU_TREEITEM@@PEAUtagTVHITTESTINFO@@@Z @889 NONAME
+?InsertColumn@CCtrlListView@@QEAAHHQEAUtagLVCOLUMNW@@@Z @890 NONAME
+?InsertGroup@CCtrlListView@@QEAAHHPEAUtagLVGROUP@@@Z @891 NONAME
+?InsertGroupSorted@CCtrlListView@@QEAAXPEAUtagLVINSERTGROUPSORTED@@@Z @892 NONAME
+?InsertItem@CCtrlListView@@QEAAHQEAUtagLVITEMW@@@Z @893 NONAME
+?InsertItem@CCtrlTreeView@@QEAAPEAU_TREEITEM@@PEAUtagTVINSERTSTRUCTW@@@Z @894 NONAME
+?InsertMarkHitTest@CCtrlListView@@QEAAHPEAUtagPOINT@@PEAULVINSERTMARK@@@Z @895 NONAME
+?InsertString@CCtrlCombo@@QEAAHPEA_WH_J@Z @896 NONAME
+?InsertString@CCtrlListBox@@QEAAHPEA_WH_J@Z @897 NONAME
+?IsChanged@CCtrlData@@QEBA_NXZ @898 NONAME
+?IsGroupViewEnabled@CCtrlListView@@QEAAHXZ @899 NONAME
+?IsInitialized@CDlgBase@@QEBA_NXZ @900 NONAME
+?LoadSigned@CCtrlData@@IEAAHXZ @901 NONAME
+?LoadSigned@CDbLink@@UEAAHXZ @902 NONAME
+?LoadText@CCtrlData@@IEAAPEB_WXZ @903 NONAME
+?LoadText@CDbLink@@UEAAPEA_WXZ @904 NONAME
+?LoadUnsigned@CCtrlData@@IEAAKXZ @905 NONAME
+?LoadUnsigned@CDbLink@@UEAAKXZ @906 NONAME
+?MakeFlat@CCtrlMButton@@QEAAXXZ @907 NONAME
+?MakePush@CCtrlMButton@@QEAAXXZ @908 NONAME
+?MapIDToIndex@CCtrlListView@@QEAAII@Z @909 NONAME
+?MapIndexToID@CCtrlListView@@QEAAII@Z @910 NONAME
+?NotifyChange@CCtrlData@@IEAAXXZ @911 NONAME
+?NotifyControls@CDlgBase@@AEAAXP8CCtrlBase@@EAAXXZ@Z @912 NONAME
+?OnApply@CCtrlBase@@UEAAXXZ @913 NONAME
+?OnApply@CCtrlCheck@@UEAAXXZ @914 NONAME
+?OnApply@CCtrlCombo@@UEAAXXZ @915 NONAME
+?OnApply@CCtrlEdit@@UEAAXXZ @916 NONAME
+?OnApply@CDlgBase@@MEAAXXZ @917 NONAME
+?OnChange@CDlgBase@@MEAAXPEAVCCtrlBase@@@Z @918 NONAME
+?OnClose@CDlgBase@@MEAAXXZ @919 NONAME
+?OnCommand@CCtrlBase@@UEAAHPEAUHWND__@@GG@Z @920 NONAME
+?OnCommand@CCtrlButton@@UEAAHPEAUHWND__@@GG@Z @921 NONAME
+?OnCommand@CCtrlCheck@@UEAAHPEAUHWND__@@GG@Z @922 NONAME
+?OnCommand@CCtrlCombo@@UEAAHPEAUHWND__@@GG@Z @923 NONAME
+?OnCommand@CCtrlEdit@@UEAAHPEAUHWND__@@GG@Z @924 NONAME
+?OnCommand@CCtrlHyperlink@@UEAAHPEAUHWND__@@GG@Z @925 NONAME
+?OnCommand@CCtrlListBox@@MEAAHPEAUHWND__@@GG@Z @926 NONAME
+?OnDeleteItem@CCtrlBase@@UEAAHPEAUtagDELETEITEMSTRUCT@@@Z @927 NONAME
+?OnDestroy@CCtrlBase@@UEAAXXZ @928 NONAME
+?OnDestroy@CCtrlPages@@MEAAXXZ @929 NONAME
+?OnDestroy@CDlgBase@@MEAAXXZ @930 NONAME
+?OnDrawItem@CCtrlBase@@UEAAHPEAUtagDRAWITEMSTRUCT@@@Z @931 NONAME
+?OnInit@CCtrlBase@@UEAAXXZ @932 NONAME
+?OnInit@CCtrlCheck@@UEAAXXZ @933 NONAME
+?OnInit@CCtrlCombo@@UEAAXXZ @934 NONAME
+?OnInit@CCtrlData@@UEAAXXZ @935 NONAME
+?OnInit@CCtrlEdit@@UEAAXXZ @936 NONAME
+?OnInit@CCtrlMButton@@UEAAXXZ @937 NONAME
+?OnInit@CCtrlPages@@MEAAXXZ @938 NONAME
+?OnInitDialog@CDlgBase@@MEAAXXZ @939 NONAME
+?OnMeasureItem@CCtrlBase@@UEAAHPEAUtagMEASUREITEMSTRUCT@@@Z @940 NONAME
+?OnNotify@CCtrlBase@@UEAAHHPEAUtagNMHDR@@@Z @941 NONAME
+?OnNotify@CCtrlClc@@MEAAHHPEAUtagNMHDR@@@Z @942 NONAME
+?OnNotify@CCtrlListView@@MEAAHHPEAUtagNMHDR@@@Z @943 NONAME
+?OnNotify@CCtrlPages@@MEAAHHPEAUtagNMHDR@@@Z @944 NONAME
+?OnNotify@CCtrlTreeView@@MEAAHHPEAUtagNMHDR@@@Z @945 NONAME
+?OnProtoActivate@CProtoIntDlgBase@@MEAAX_K_J@Z @946 NONAME
+?OnProtoCheckOnline@CProtoIntDlgBase@@MEAAX_K_J@Z @947 NONAME
+?OnProtoRefresh@CProtoIntDlgBase@@MEAAX_K_J@Z @948 NONAME
+?OnReset@CCtrlBase@@UEAAXXZ @949 NONAME
+?OnReset@CCtrlCheck@@UEAAXXZ @950 NONAME
+?OnReset@CCtrlCombo@@UEAAXXZ @951 NONAME
+?OnReset@CCtrlEdit@@UEAAXXZ @952 NONAME
+?OnReset@CDlgBase@@MEAAXXZ @953 NONAME
+?RedrawItems@CCtrlListView@@QEAAHHH@Z @954 NONAME
+?RemoveAllGroups@CCtrlListView@@QEAAXXZ @955 NONAME
+?RemoveGroup@CCtrlListView@@QEAAHH@Z @956 NONAME
+?ResetContent@CCtrlCombo@@QEAAXXZ @957 NONAME
+?ResetContent@CCtrlListBox@@QEAAXXZ @958 NONAME
+?Resizer@CDlgBase@@MEAAHPEAUUTILRESIZECONTROL@@@Z @959 NONAME
+?SaveInt@CCtrlData@@IEAAXK@Z @960 NONAME
+?SaveInt@CDbLink@@UEAAXK@Z @961 NONAME
+?SaveText@CCtrlData@@IEAAXPEA_W@Z @962 NONAME
+?SaveText@CDbLink@@UEAAXPEA_W@Z @963 NONAME
+?Scroll@CCtrlListView@@QEAAHHH@Z @964 NONAME
+?Select@CCtrlTreeView@@QEAAXPEAU_TREEITEM@@K@Z @965 NONAME
+?SelectDropTarget@CCtrlTreeView@@QEAAXPEAU_TREEITEM@@@Z @966 NONAME
+?SelectItem@CCtrlClc@@QEAAXPEAX@Z @967 NONAME
+?SelectItem@CCtrlTreeView@@QEAAXPEAU_TREEITEM@@@Z @968 NONAME
+?SelectSetFirstVisible@CCtrlTreeView@@QEAAXPEAU_TREEITEM@@@Z @969 NONAME
+?SelectString@CCtrlCombo@@QEAAHPEA_W@Z @970 NONAME
+?SelectString@CCtrlListBox@@QEAAHPEA_W@Z @971 NONAME
+?SendMsg@CCtrlBase@@QEAA_JI_K_J@Z @972 NONAME
+?SetBkBitmap@CCtrlClc@@QEAAXKPEAUHBITMAP__@@@Z @973 NONAME
+?SetBkColor@CCtrlClc@@QEAAXK@Z @974 NONAME
+?SetBkColor@CCtrlListView@@QEAAHK@Z @975 NONAME
+?SetBkColor@CCtrlTreeView@@QEAAKK@Z @976 NONAME
+?SetBkImage@CCtrlListView@@QEAAHPEAUtagLVBKIMAGEW@@@Z @977 NONAME
+?SetCallbackMask@CCtrlListView@@QEAAHI@Z @978 NONAME
+?SetCheck@CCtrlClc@@QEAAXPEAX_N@Z @979 NONAME
+?SetCheckState@CCtrlListView@@QEAAXIH@Z @980 NONAME
+?SetCheckState@CCtrlTreeView@@QEAAXPEAU_TREEITEM@@K@Z @981 NONAME
+?SetColumn@CCtrlListView@@QEAAHHPEAUtagLVCOLUMNW@@@Z @982 NONAME
+?SetColumnOrderArray@CCtrlListView@@QEAAHHPEAH@Z @983 NONAME
+?SetColumnWidth@CCtrlListView@@QEAAHHH@Z @984 NONAME
+?SetCurSel@CCtrlCombo@@QEAAHH@Z @985 NONAME
+?SetCurSel@CCtrlListBox@@QEAAHH@Z @986 NONAME
+?SetExStyle@CCtrlClc@@QEAAXK@Z @987 NONAME
+?SetExtendedListViewStyle@CCtrlListView@@QEAAXK@Z @988 NONAME
+?SetExtendedListViewStyleEx@CCtrlListView@@QEAAXKK@Z @989 NONAME
+?SetExtraColumns@CCtrlClc@@QEAAXH@Z @990 NONAME
+?SetExtraImage@CCtrlClc@@QEAAXPEAXHH@Z @991 NONAME
+?SetExtraImageList@CCtrlClc@@QEAAXPEAU_IMAGELIST@@@Z @992 NONAME
+?SetFont@CCtrlClc@@QEAAXHPEAX_N@Z @993 NONAME
+?SetGreyoutFlags@CCtrlClc@@QEAAXK@Z @994 NONAME
+?SetGroupInfo@CCtrlListView@@QEAAHHPEAUtagLVGROUP@@@Z @995 NONAME
+?SetGroupMetrics@CCtrlListView@@QEAAXPEAUtagLVGROUPMETRICS@@@Z @996 NONAME
+?SetHideEmptyGroups@CCtrlClc@@QEAAX_N@Z @997 NONAME
+?SetHideOfflineRoot@CCtrlClc@@QEAAX_N@Z @998 NONAME
+?SetHotCursor@CCtrlListView@@QEAAPEAUHICON__@@PEAU2@@Z @999 NONAME
+?SetHotItem@CCtrlListView@@QEAAHH@Z @1000 NONAME
+?SetHoverTime@CCtrlListView@@QEAAXK@Z @1001 NONAME
+?SetIconSpacing@CCtrlListView@@QEAAKHH@Z @1002 NONAME
+?SetImageList@CCtrlListView@@QEAAPEAU_IMAGELIST@@PEAU2@H@Z @1003 NONAME
+?SetImageList@CCtrlTreeView@@QEAAXPEAU_IMAGELIST@@H@Z @1004 NONAME
+?SetIndent@CCtrlClc@@QEAAXH@Z @1005 NONAME
+?SetIndent@CCtrlTreeView@@QEAAXH@Z @1006 NONAME
+?SetInfoTip@CCtrlListView@@QEAAHPEAUtagLVSETINFOTIP@@@Z @1007 NONAME
+?SetInsertMark@CCtrlListView@@QEAAHPEAULVINSERTMARK@@@Z @1008 NONAME
+?SetInsertMark@CCtrlTreeView@@QEAAXPEAU_TREEITEM@@H@Z @1009 NONAME
+?SetInsertMarkColor@CCtrlListView@@QEAAKK@Z @1010 NONAME
+?SetInsertMarkColor@CCtrlTreeView@@QEAAKK@Z @1011 NONAME
+?SetInt@CCtrlBase@@QEAAXH@Z @1012 NONAME
+?SetItem@CCtrlListView@@QEAAHQEAUtagLVITEMW@@@Z @1013 NONAME
+?SetItem@CCtrlListView@@QEAAXHHPEA_WH@Z @1014 NONAME
+?SetItem@CCtrlTreeView@@QEAAXPEAUtagTVITEMEXW@@@Z @1015 NONAME
+?SetItemCount@CCtrlListView@@QEAAXH@Z @1016 NONAME
+?SetItemCountEx@CCtrlListView@@QEAAXHK@Z @1017 NONAME
+?SetItemData@CCtrlCombo@@QEAAXH_J@Z @1018 NONAME
+?SetItemData@CCtrlListBox@@QEAAXH_J@Z @1019 NONAME
+?SetItemHeight@CCtrlTreeView@@QEAAXF@Z @1020 NONAME
+?SetItemPosition32@CCtrlListView@@QEAAXHHH@Z @1021 NONAME
+?SetItemPosition@CCtrlListView@@QEAAHHHH@Z @1022 NONAME
+?SetItemState@CCtrlListView@@QEAAXHII@Z @1023 NONAME
+?SetItemState@CCtrlTreeView@@QEAAXPEAU_TREEITEM@@KK@Z @1024 NONAME
+?SetItemText@CCtrlClc@@QEAAXPEAXPEAD@Z @1025 NONAME
+?SetItemText@CCtrlListView@@QEAAXHHPEA_W@Z @1026 NONAME
+?SetLeftMargin@CCtrlClc@@QEAAXH@Z @1027 NONAME
+?SetLineColor@CCtrlTreeView@@QEAAKK@Z @1028 NONAME
+?SetOfflineModes@CCtrlClc@@QEAAXK@Z @1029 NONAME
+?SetOutlineColor@CCtrlListView@@QEAAKK@Z @1030 NONAME
+?SetScrollTime@CCtrlTreeView@@QEAAXI@Z @1031 NONAME
+?SetSel@CCtrlListBox@@QEAAXH_N@Z @1032 NONAME
+?SetSelectedColumn@CCtrlListView@@QEAAXH@Z @1033 NONAME
+?SetSelectionMark@CCtrlListView@@QEAAHH@Z @1034 NONAME
+?SetState@CCtrlCheck@@QEAAXH@Z @1035 NONAME
+?SetStatusText@CProtoIntDlgBase@@QEAAXPEB_W@Z @1036 NONAME
+?SetText@CCtrlBase@@QEAAXPEB_W@Z @1037 NONAME
+?SetTextA@CCtrlBase@@QEAAXPEBD@Z @1038 NONAME
+?SetTextBkColor@CCtrlListView@@QEAAHK@Z @1039 NONAME
+?SetTextColor@CCtrlClc@@QEAAXHK@Z @1040 NONAME
+?SetTextColor@CCtrlListView@@QEAAHK@Z @1041 NONAME
+?SetTextColor@CCtrlTreeView@@QEAAKK@Z @1042 NONAME
+?SetTileInfo@CCtrlListView@@QEAAHPEAUtagLVTILEINFO@@@Z @1043 NONAME
+?SetTileViewInfo@CCtrlListView@@QEAAHPEAUtagLVTILEVIEWINFO@@@Z @1044 NONAME
+?SetToolTips@CCtrlListView@@QEAAPEAUHWND__@@PEAU2@@Z @1045 NONAME
+?SetToolTips@CCtrlTreeView@@QEAAPEAUHWND__@@PEAU2@@Z @1046 NONAME
+?SetUnicodeFormat@CCtrlListView@@QEAAHH@Z @1047 NONAME
+?SetUnicodeFormat@CCtrlTreeView@@QEAAHH@Z @1048 NONAME
+?SetUseGroups@CCtrlClc@@QEAAX_N@Z @1049 NONAME
+?SetView@CCtrlListView@@QEAAHK@Z @1050 NONAME
+?SetWorkAreas@CCtrlListView@@QEAAXHPEAUtagRECT@@@Z @1051 NONAME
+?Show@CDlgBase@@QEAAXH@Z @1052 NONAME
+?ShowDropdown@CCtrlCombo@@QEAAX_N@Z @1053 NONAME
+?ShowPage@CCtrlPages@@AEAAXPEAVCDlgBase@@@Z @1054 NONAME
+?SortChildren@CCtrlTreeView@@QEAAXPEAU_TREEITEM@@H@Z @1055 NONAME
+?SortChildrenCB@CCtrlTreeView@@QEAAXPEAUtagTVSORTCB@@H@Z @1056 NONAME
+?SortGroups@CCtrlListView@@QEAAHP6AHHHPEAX@Z0@Z @1057 NONAME
+?SortItems@CCtrlListView@@QEAAHP6AH_J00@Z0@Z @1058 NONAME
+?SortItemsEx@CCtrlListView@@QEAAHP6AH_J00@Z0@Z @1059 NONAME
+?SubItemHitTest@CCtrlListView@@QEAAHPEAUtagLVHITTESTINFO@@@Z @1060 NONAME
+?Subclass@CCtrlBase@@IEAAXXZ @1061 NONAME
+?ThemeDialogBackground@CDlgBase@@IEAAXH@Z @1062 NONAME
+?TranslateItem@CCtrlTreeView@@QEAAXPEAU_TREEITEM@@@Z @1063 NONAME
+?TranslateTree@CCtrlTreeView@@QEAAXXZ @1064 NONAME
+?Unsubclass@CCtrlBase@@IEAAXXZ @1065 NONAME
+?Update@CCtrlListView@@QEAAHH@Z @1066 NONAME
+?UpdateProtoTitle@CProtoIntDlgBase@@AEAAXPEB_W@Z @1067 NONAME
+?UpdateStatusBar@CProtoIntDlgBase@@AEAAXXZ @1068 NONAME
+?WindowSubscribe@PROTO_INTERFACE@@QEAAXPEAUHWND__@@@Z @1069 NONAME
+?WindowUnsubscribe@PROTO_INTERFACE@@QEAAXPEAUHWND__@@@Z @1070 NONAME
+?cmp@CCtrlBase@@SAHPEBV1@0@Z @1071 NONAME
+?GetCtrlId@CCtrlBase@@QEBAHXZ @1072 NONAME
+ProtoWindowAdd @1073
+ProtoWindowRemove @1074
+Proto_IsProtocolLoaded @1075
+Proto_RegisterModule @1076
diff --git a/src/mir_core/src/miranda.h b/src/mir_core/src/miranda.h
index 268d023190..9cd924348c 100644
--- a/src/mir_core/src/miranda.h
+++ b/src/mir_core/src/miranda.h
@@ -26,6 +26,9 @@ extern "C"
{
MIR_CORE_DLL(int) Langpack_MarkPluginLoaded(PLUGININFOEX* pInfo);
MIR_CORE_DLL(MUUID*) Langpack_LookupUuid(WPARAM wParam);
+
+ MIR_CORE_DLL(PROTOCOLDESCRIPTOR*) Proto_IsProtocolLoaded(const char *szProtoName);
+ MIR_CORE_DLL(PROTOCOLDESCRIPTOR*) Proto_RegisterModule(PROTOCOLDESCRIPTOR *pd);
};
void UnloadLangPackModule(void);
@@ -37,6 +40,7 @@ int InitPathUtils(void);
void InitProtocols();
void UninitProtocols();
+HINSTANCE ProtoGetInstance(const char *szModuleName);
extern HINSTANCE hInst;
extern HWND hAPCWindow;
diff --git a/src/mir_core/src/protos.cpp b/src/mir_core/src/protos.cpp
index 6ac870da74..075ea581d9 100644
--- a/src/mir_core/src/protos.cpp
+++ b/src/mir_core/src/protos.cpp
@@ -23,24 +23,54 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "commonheaders.h"
-#include <m_protomod.h>
-#include <m_protoint.h>
-#include <m_skin.h>
-#include <m_netlib.h>
+static int CompareProtos(const PROTOCOLDESCRIPTOR *p1, const PROTOCOLDESCRIPTOR *p2)
+{
+ return strcmp(p1->szName, p2->szName);
+}
+
+static LIST<PROTOCOLDESCRIPTOR> protos(10, CompareProtos);
static HANDLE hAckEvent;
-void InitProtocols()
+/////////////////////////////////////////////////////////////////////////////////////////
+
+MIR_CORE_DLL(PROTOCOLDESCRIPTOR*) Proto_IsProtocolLoaded(const char *szProtoName)
{
- hAckEvent = CreateHookableEvent(ME_PROTO_ACK);
+ if (szProtoName == NULL)
+ return NULL;
+
+ PROTOCOLDESCRIPTOR tmp;
+ tmp.szName = (char*)szProtoName;
+ return protos.find(&tmp);
}
-void UninitProtocols()
+INT_PTR Proto_EnumProtocols(WPARAM wParam, LPARAM lParam)
{
- if (hAckEvent) {
- DestroyHookableEvent(hAckEvent);
- hAckEvent = NULL;
- }
+ *(int*)wParam = protos.getCount();
+ *(PROTOCOLDESCRIPTOR***)lParam = protos.getArray();
+ return 0;
+}
+
+MIR_CORE_DLL(PROTOCOLDESCRIPTOR*) Proto_RegisterModule(PROTOCOLDESCRIPTOR *pd)
+{
+ PROTOCOLDESCRIPTOR *p = (PROTOCOLDESCRIPTOR*)mir_calloc(sizeof(PROTOCOLDESCRIPTOR));
+ if (!p)
+ return NULL;
+
+ memcpy(p, pd, pd->cbSize);
+ p->szName = mir_strdup(pd->szName);
+ protos.insert(p);
+ return p;
+}
+
+HINSTANCE ProtoGetInstance(const char *szModuleName)
+{
+ PROTOACCOUNT *pa = ProtoGetAccount(szModuleName);
+ if (pa == NULL)
+ return NULL;
+
+ PROTOCOLDESCRIPTOR *p = Proto_IsProtocolLoaded(pa->szProtoName);
+ return (p == NULL) ? NULL : GetInstByAddress(p->fnInit);
}
/////////////////////////////////////////////////////////////////////////////////////////
@@ -120,6 +150,8 @@ MIR_CORE_DLL(void) ProtoDestructor(PROTO_INTERFACE *pThis)
{
mir_free(pThis->m_szModuleName);
mir_free(pThis->m_tszUserName);
+
+ WindowList_Destroy(pThis->m_hWindowList);
}
MIR_CORE_DLL(void) ProtoCreateService(PROTO_INTERFACE *pThis, const char* szService, ProtoServiceFunc serviceProc)
@@ -163,6 +195,19 @@ MIR_CORE_DLL(HANDLE) ProtoForkThreadEx(PROTO_INTERFACE *pThis, ProtoThreadFunc p
return (HANDLE)::mir_forkthreadowner((pThreadFuncOwner)*(void**)&pFunc, pThis, param, threadID ? threadID : &lthreadID);
}
+MIR_CORE_DLL(void) ProtoWindowAdd(PROTO_INTERFACE *pThis, HWND hwnd)
+{
+ if (pThis->m_hWindowList == NULL)
+ pThis->m_hWindowList = WindowList_Create();
+
+ WindowList_Add(pThis->m_hWindowList, hwnd, NULL);
+}
+
+MIR_CORE_DLL(void) ProtoWindowRemove(PROTO_INTERFACE *pThis, HWND hwnd)
+{
+ WindowList_Remove(pThis->m_hWindowList, hwnd);
+}
+
/////////////////////////////////////////////////////////////////////////////////////////
MIR_CORE_DLL(LPCTSTR) ProtoGetAvatarExtension(int format)
@@ -426,3 +471,25 @@ int PROTO_INTERFACE::OnEvent(PROTOEVENTTYPE iEventType, WPARAM wParam, LPARAM lP
{
return 1; // not an error, vitally important
}
+
+/////////////////////////////////////////////////////////////////////////////////////////
+
+void InitProtocols()
+{
+ CreateServiceFunction(MS_PROTO_ENUMPROTOS, Proto_EnumProtocols);
+ hAckEvent = CreateHookableEvent(ME_PROTO_ACK);
+}
+
+void UninitProtocols()
+{
+ for (int i = 0; i < protos.getCount(); i++) {
+ mir_free(protos[i]->szName);
+ mir_free(protos[i]);
+ }
+ protos.destroy();
+
+ if (hAckEvent) {
+ DestroyHookableEvent(hAckEvent);
+ hAckEvent = NULL;
+ }
+}
diff --git a/src/mir_core/src/threads.cpp b/src/mir_core/src/threads.cpp
index 237bc2ed97..ea47e19260 100644
--- a/src/mir_core/src/threads.cpp
+++ b/src/mir_core/src/threads.cpp
@@ -210,7 +210,7 @@ MIR_CORE_DLL(void) KillObjectThreads(void* owner)
if (p->pObject == owner) {
char szModuleName[MAX_PATH];
GetModuleFileNameA(p->hOwner, szModuleName, sizeof(szModuleName));
- Netlib_Logf(0, "Killing objec thread %s:%p", szModuleName, p->dwThreadId);
+ Netlib_Logf(0, "Killing object thread %s:%p", szModuleName, p->dwThreadId);
TerminateThread(p->hThread, 9999);
CloseHandle(p->hThread);
threads.remove(j);
diff --git a/protocols/JabberG/src/ui_utils.cpp b/src/mir_core/src/ui_utils.cpp
index abb205b69b..3fb58c11a1 100644
--- a/protocols/JabberG/src/ui_utils.cpp
+++ b/src/mir_core/src/ui_utils.cpp
@@ -20,20 +20,26 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
-#include "jabber.h"
+#include "commonheaders.h"
-extern HINSTANCE hInst;
+#include <m_button.h>
+#include <m_gui.h>
+#include <m_icolib.h>
+#include <m_skin.h>
-CDlgBase::CDlgBase(int idDialog, HWND hwndParent) :
+#pragma comment(lib, "uxtheme")
+
+CDlgBase::CDlgBase(HINSTANCE hInst, int idDialog, HWND hwndParent) :
m_controls(1, CCtrlBase::cmp)
{
+ m_hInst = hInst;
m_idDialog = idDialog;
m_hwndParent = hwndParent;
m_hwnd = NULL;
m_first = NULL;
m_isModal = false;
m_initialized = false;
- m_autoClose = CLOSE_ON_OK|CLOSE_ON_CANCEL;
+ m_autoClose = CLOSE_ON_OK | CLOSE_ON_CANCEL;
m_forceResizable = false;
}
@@ -45,18 +51,18 @@ CDlgBase::~CDlgBase()
void CDlgBase::Create()
{
- ShowWindow(CreateDialogParam(hInst, MAKEINTRESOURCE(m_idDialog), m_hwndParent, GlobalDlgProc, (LPARAM)(CDlgBase *)this), SW_HIDE);
+ ShowWindow(CreateDialogParam(m_hInst, MAKEINTRESOURCE(m_idDialog), m_hwndParent, GlobalDlgProc, (LPARAM)(CDlgBase *)this), SW_HIDE);
}
void CDlgBase::Show(int nCmdShow)
{
- ShowWindow(CreateDialogParam(hInst, MAKEINTRESOURCE(m_idDialog), m_hwndParent, GlobalDlgProc, (LPARAM)(CDlgBase *)this), nCmdShow);
+ ShowWindow(CreateDialogParam(m_hInst, MAKEINTRESOURCE(m_idDialog), m_hwndParent, GlobalDlgProc, (LPARAM)(CDlgBase *)this), nCmdShow);
}
int CDlgBase::DoModal()
{
m_isModal = true;
- return DialogBoxParam(hInst, MAKEINTRESOURCE(m_idDialog), m_hwndParent, GlobalDlgProc, (LPARAM)(CDlgBase *)this);
+ return DialogBoxParam(m_hInst, MAKEINTRESOURCE(m_idDialog), m_hwndParent, GlobalDlgProc, (LPARAM)(CDlgBase *)this);
}
int CDlgBase::Resizer(UTILRESIZECONTROL*)
@@ -152,7 +158,7 @@ INT_PTR CDlgBase::DlgProc(UINT msg, WPARAM wParam, LPARAM lParam)
UTILRESIZEDIALOG urd;
urd.cbSize = sizeof(urd);
urd.hwndDlg = m_hwnd;
- urd.hInstance = hInst;
+ urd.hInstance = m_hInst;
urd.lpTemplate = MAKEINTRESOURCEA(m_idDialog);
urd.lParam = 0;
urd.pfnResizer = GlobalDlgResizer;
@@ -515,14 +521,14 @@ CCtrlMButton::CCtrlMButton(CDlgBase* dlg, int ctrlId, HICON hIcon, const char* t
CCtrlMButton::CCtrlMButton(CDlgBase* dlg, int ctrlId, int iCoreIcon, const char* tooltip) :
CCtrlButton(dlg, ctrlId),
- m_hIcon(LoadSkinnedIcon(iCoreIcon)),
+ m_hIcon(::LoadSkinnedIcon(iCoreIcon)),
m_toolTip(tooltip)
{
}
CCtrlMButton::~CCtrlMButton()
{
- g_ReleaseIcon(m_hIcon);
+ ::Skin_ReleaseIcon(m_hIcon);
}
void CCtrlMButton::OnInit()
@@ -666,7 +672,8 @@ int CCtrlClc::GetExtraColumns()
}
BYTE CCtrlClc::GetExtraImage(HANDLE hItem, int iColumn)
-{ return (BYTE)(SendMessage(m_hwnd, CLM_GETEXTRAIMAGE, (WPARAM)hItem, MAKELPARAM(iColumn, 0)) & EMPTY_EXTRA_ICON);
+{
+ return (BYTE)(SendMessage(m_hwnd, CLM_GETEXTRAIMAGE, (WPARAM)hItem, MAKELPARAM(iColumn, 0)) & 0xFFFF);
}
HIMAGELIST CCtrlClc::GetExtraImageList()
@@ -1243,312 +1250,6 @@ BOOL CCtrlListView::Update(int iItem)
}
/////////////////////////////////////////////////////////////////////////////////////////
-// CCtrlFilterListView
-
-#define FILTER_BOX_HEIGHT 21
-
-struct CFilterData : public MZeroedObject
-{
- HFONT m_hfntNormal;
- HFONT m_hfntEmpty;
- COLORREF m_clGray;
- TCHAR *m_filterText;
-
- RECT m_rcButtonClear;
- RECT m_rcEditBox;
-
- WNDPROC m_oldWndProc;
- HWND m_hwndOwner;
- HWND m_hwndEditBox;
-
- void ReleaseFilterData()
- {
- DeleteObject(m_hfntEmpty); m_hfntEmpty = NULL;
- }
-
- ~CFilterData()
- {
- ReleaseFilterData();
- }
-};
-
-CCtrlFilterListView::CCtrlFilterListView(CDlgBase* dlg, int ctrlId, bool trackFilter, bool keepHiglight):
- CCtrlListView(dlg, ctrlId),
- m_trackFilter(trackFilter),
- m_keepHiglight(keepHiglight)
-{
- fdat = new CFilterData;
-}
-
-CCtrlFilterListView::~CCtrlFilterListView()
-{
- if (fdat->m_filterText) mir_free(fdat->m_filterText);
- delete fdat;
-}
-
-TCHAR *CCtrlFilterListView::GetFilterText()
-{
- return fdat->m_filterText;
-}
-
-void CCtrlFilterListView::OnInit()
-{
- CSuper::OnInit();
- Subclass();
-}
-
-static LRESULT CALLBACK sttEditBoxSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
-{
- CFilterData *fdat = (CFilterData *)GetWindowLongPtr(hwnd, GWLP_USERDATA);
- if (fdat == NULL)
- return DefWindowProc(hwnd, msg, wParam, lParam);
-
- switch (msg) {
- case WM_GETDLGCODE:
- if ((wParam == VK_RETURN) || (wParam == VK_ESCAPE))
- return DLGC_WANTMESSAGE;
- break;
-
- case WM_SYSKEYDOWN:
- case WM_KEYDOWN:
- if (wParam == VK_RETURN) {
- if (fdat->m_filterText) mir_free(fdat->m_filterText);
- int length = GetWindowTextLength(hwnd) + 1;
- if (length == 1)
- fdat->m_filterText = 0;
- else {
- fdat->m_filterText = (TCHAR *)mir_alloc(sizeof(TCHAR) * length);
- GetWindowText(hwnd, fdat->m_filterText, length);
- }
-
- DestroyWindow(hwnd);
- RedrawWindow(fdat->m_hwndOwner, NULL, NULL, RDW_INVALIDATE|RDW_FRAME);
- PostMessage(fdat->m_hwndOwner, WM_APP, 0, 0);
- }
- else if (wParam == VK_ESCAPE) {
- DestroyWindow(hwnd);
- return 0;
- }
-
- PostMessage(fdat->m_hwndOwner, WM_APP, 1, 0);
- break;
-
- case WM_KILLFOCUS:
- DestroyWindow(hwnd);
- return 0;
-
- case WM_DESTROY:
- fdat->m_hwndEditBox = NULL;
- }
-
- return CallWindowProc(fdat->m_oldWndProc, hwnd, msg, wParam, lParam);
-}
-
-void CCtrlFilterListView::FilterHighlight(TCHAR *str)
-{
- TCHAR buf[256];
- int count = GetItemCount();
- for (int i=0; i < count; i++) {
- bool found = false;
- if (str) {
- for (int j = 0; j < 10; ++j) {
- GetItemText(i, j, buf, SIZEOF(buf));
- if (!*buf)
- break;
-
- if (_tcsstr(buf, str)) {
- found = true;
- break;
- }
- }
- }
-
- SetItemState(i, found ? LVIS_DROPHILITED : 0, LVIS_DROPHILITED);
- }
-}
-
-LRESULT CCtrlFilterListView::CustomWndProc(UINT msg, WPARAM wParam, LPARAM lParam)
-{
- POINT pt;
-
- switch (msg) {
- case WM_APP:
- switch (wParam) {
- case 0:
- OnFilterChanged(this);
- if (!m_keepHiglight)
- FilterHighlight(NULL);
- break;
-
- case 1:
- if (m_trackFilter && fdat->m_hwndEditBox) {
- TCHAR *str = 0;
- int length = GetWindowTextLength(fdat->m_hwndEditBox) + 1;
- if (length == 1)
- str = 0;
- else {
- str = (TCHAR *)mir_alloc(sizeof(TCHAR) * length);
- GetWindowText(fdat->m_hwndEditBox, str, length);
- }
- FilterHighlight(str);
- if (str) mir_free(str);
- }
- break;
-
- case 2:
- fdat->m_hwndOwner = m_hwnd;
- fdat->m_hwndEditBox = CreateWindow(_T("edit"), fdat->m_filterText,
- WS_CHILD|WS_VISIBLE|WS_TABSTOP|ES_LEFT|ES_AUTOHSCROLL,
- 0, 0, 0, 0,
- ::GetParent(m_hwnd), (HMENU)-1, hInst, NULL);
-
- SendMessage(fdat->m_hwndEditBox, WM_SETFONT, (WPARAM)fdat->m_hfntNormal, 0);
-
- RECT rc = fdat->m_rcEditBox;
- MapWindowPoints(m_hwnd, ::GetParent(m_hwnd), (LPPOINT)&rc, 2);
- SetWindowPos(fdat->m_hwndEditBox, HWND_TOP, rc.left-5, rc.top+2, rc.right-rc.left, rc.bottom-rc.top-4, SWP_SHOWWINDOW);
- SendMessage(fdat->m_hwndEditBox, EM_SETSEL, 0, -1);
-
- fdat->m_oldWndProc = (WNDPROC)GetWindowLongPtr(fdat->m_hwndEditBox, GWLP_WNDPROC);
- SetWindowLongPtr(fdat->m_hwndEditBox, GWLP_USERDATA, (LONG_PTR)fdat);
- SetWindowLongPtr(fdat->m_hwndEditBox, GWLP_WNDPROC, (LONG_PTR)sttEditBoxSubclassProc);
-
- SetFocus(m_hwnd); // hack to avoid popping of list over the box...
- SetFocus(fdat->m_hwndEditBox);
- }
- break;
-
- case WM_NCCALCSIZE:
- {
- RECT *prect = (RECT *)lParam;
-
- CSuper::CustomWndProc(msg, wParam, lParam);
- prect->bottom -= FILTER_BOX_HEIGHT;
-
- fdat->ReleaseFilterData();
-
- fdat->m_hfntNormal = (HFONT)SendMessage(m_hwnd, WM_GETFONT, 0, 0);
- if (!fdat->m_hfntNormal)
- fdat->m_hfntNormal = (HFONT)GetStockObject(DEFAULT_GUI_FONT);
-
- LOGFONT lf;
- GetObject(fdat->m_hfntNormal, sizeof(lf), &lf);
- lf.lfItalic = TRUE;
- fdat->m_hfntEmpty = CreateFontIndirect(&lf);
-
- COLORREF clText = GetSysColor(COLOR_WINDOWTEXT);
- COLORREF clBack = GetSysColor(COLOR_WINDOW);
- fdat->m_clGray = RGB(
- (GetRValue(clBack) + 2*GetRValue(clText)) / 3,
- (GetGValue(clBack) + 2*GetGValue(clText)) / 3,
- (GetBValue(clBack) + 2*GetBValue(clText)) / 3);
-
- if (fdat->m_hwndEditBox)
- DestroyWindow(fdat->m_hwndEditBox);
- }
- return 0;
-
- case WM_NCPAINT:
- CSuper::CustomWndProc(msg, wParam, lParam);
- {
- RECT rc;
- GetWindowRect(m_hwnd, &rc);
- OffsetRect(&rc, -rc.left, -rc.top);
- InflateRect(&rc, -1, -1);
- rc.top = rc.bottom - FILTER_BOX_HEIGHT;
-
- POINT pts[] = {
- {rc.left, rc.top},
- {rc.left+FILTER_BOX_HEIGHT, rc.top},
- {rc.left+FILTER_BOX_HEIGHT+FILTER_BOX_HEIGHT/2+1, rc.top+FILTER_BOX_HEIGHT/2+1},
- {rc.left+FILTER_BOX_HEIGHT, rc.top+FILTER_BOX_HEIGHT},
- {rc.left, rc.top+FILTER_BOX_HEIGHT},
- };
- HRGN hrgnFilter = CreatePolygonRgn(pts, SIZEOF(pts), ALTERNATE);
-
- HDC hdc = GetWindowDC(m_hwnd);
-
- FillRect(hdc, &rc, GetSysColorBrush(COLOR_WINDOW));
- FillRgn(hdc, hrgnFilter, GetSysColorBrush(COLOR_BTNFACE));
-
- SetBkMode(hdc, TRANSPARENT);
-
- if (fdat->m_filterText) {
- SetRect(&fdat->m_rcButtonClear,
- rc.right - FILTER_BOX_HEIGHT + (FILTER_BOX_HEIGHT-16)/2, rc.top + (FILTER_BOX_HEIGHT-16)/2,
- rc.right - FILTER_BOX_HEIGHT + (FILTER_BOX_HEIGHT-16)/2 + 16, rc.top + (FILTER_BOX_HEIGHT-16)/2 + 16);
-
- DrawIconEx(hdc, rc.left + (FILTER_BOX_HEIGHT-16)/2, rc.top + (FILTER_BOX_HEIGHT-16)/2, g_LoadIconEx("sd_filter_apply"), 16, 16, 0, NULL, DI_NORMAL);
- DrawIconEx(hdc, rc.right - FILTER_BOX_HEIGHT + (FILTER_BOX_HEIGHT-16)/2, rc.top + (FILTER_BOX_HEIGHT-16)/2, LoadSkinnedIcon(SKINICON_OTHER_DELETE), 16, 16, 0, NULL, DI_NORMAL);
-
- rc.left += 5*FILTER_BOX_HEIGHT/3;
- rc.right -= 5*FILTER_BOX_HEIGHT/3;
-
- fdat->m_rcEditBox = rc;
-
- SelectObject(hdc, fdat->m_hfntNormal);
- ::SetTextColor(hdc, GetSysColor(COLOR_WINDOWTEXT));
- DrawText(hdc, fdat->m_filterText, -1, &rc, DT_SINGLELINE|DT_VCENTER|DT_NOPREFIX|DT_END_ELLIPSIS);
- }
- else {
- SetRect(&fdat->m_rcButtonClear, 0, 0, 0, 0);
-
- DrawIconEx(hdc, rc.left + (FILTER_BOX_HEIGHT-16)/2, rc.top + (FILTER_BOX_HEIGHT-16)/2, g_LoadIconEx("sd_filter_reset"), 16, 16, 0, NULL, DI_NORMAL);
-
- rc.left += 5*FILTER_BOX_HEIGHT/3;
- rc.right -= 5;
-
- fdat->m_rcEditBox = rc;
-
- SelectObject(hdc, fdat->m_hfntEmpty);
- ::SetTextColor(hdc, fdat->m_clGray);
- DrawText(hdc, TranslateT("Set filter..."), -1, &rc, DT_SINGLELINE|DT_VCENTER|DT_NOPREFIX|DT_END_ELLIPSIS);
- }
-
- ReleaseDC(m_hwnd, hdc);
-
- DeleteObject(hrgnFilter);
- }
- return 0;
-
- case WM_NCHITTEST:
- pt.x = LOWORD(lParam);
- pt.y = HIWORD(lParam);
- MapWindowPoints(NULL, m_hwnd, &pt, 1);
-
- if (PtInRect(&fdat->m_rcButtonClear, pt))
- return HTBORDER;
- if (PtInRect(&fdat->m_rcEditBox, pt))
- return HTBORDER;
- break;
-
- case WM_NCLBUTTONUP:
- pt.x = LOWORD(lParam);
- pt.y = HIWORD(lParam);
- MapWindowPoints(NULL, m_hwnd, &pt, 1);
-
- if (PtInRect(&fdat->m_rcButtonClear, pt)) {
- SetFocus(m_hwnd);
- if (fdat->m_filterText) mir_free(fdat->m_filterText);
- fdat->m_filterText = NULL;
- RedrawWindow(m_hwnd, NULL, NULL, RDW_INVALIDATE|RDW_FRAME);
- OnFilterChanged(this);
- FilterHighlight(NULL);
- }
- else if (PtInRect(&fdat->m_rcEditBox, pt))
- PostMessage(m_hwnd, WM_APP, 2, 0);
- break;
-
- case WM_KEYDOWN:
- if (wParam == 'F' && GetAsyncKeyState(VK_CONTROL))
- PostMessage(m_hwnd, WM_APP, 2, 0);
- break;
- }
-
- return CSuper::CustomWndProc(msg, wParam, lParam);
-}
-
-/////////////////////////////////////////////////////////////////////////////////////////
// CCtrlTreeView
CCtrlTreeView::CCtrlTreeView(CDlgBase* dlg, int ctrlId):
@@ -2248,6 +1949,27 @@ void CDbLink::SaveText(TCHAR *value)
/////////////////////////////////////////////////////////////////////////////////////////
// Base protocol dialog
+CProtoIntDlgBase::CProtoIntDlgBase(PROTO_INTERFACE *proto, int idDialog, HWND parent, bool show_label) :
+ CDlgBase(::ProtoGetInstance(proto->m_szModuleName), idDialog, parent),
+ m_proto_interface(proto),
+ m_show_label(show_label),
+ m_hwndStatus(NULL)
+{}
+
+void CProtoIntDlgBase::CreateLink(CCtrlData& ctrl, char *szSetting, BYTE type, DWORD iValue, bool bSigned)
+{
+ ctrl.CreateDbLink(m_proto_interface->m_szModuleName, szSetting, type, iValue, bSigned);
+}
+
+void CProtoIntDlgBase::CreateLink(CCtrlData& ctrl, const char *szSetting, TCHAR *szValue)
+{
+ ctrl.CreateDbLink(m_proto_interface->m_szModuleName, szSetting, szValue);
+}
+
+void CProtoIntDlgBase::OnProtoRefresh(WPARAM, LPARAM) {}
+void CProtoIntDlgBase::OnProtoActivate(WPARAM, LPARAM) {}
+void CProtoIntDlgBase::OnProtoCheckOnline(WPARAM, LPARAM) {}
+
void CProtoIntDlgBase::SetStatusText(const TCHAR *statusText)
{
if (m_hwndStatus)
@@ -2261,14 +1983,21 @@ INT_PTR CProtoIntDlgBase::DlgProc(UINT msg, WPARAM wParam, LPARAM lParam)
switch (msg) {
case WM_INITDIALOG: // call inherited init code first
result = CSuper::DlgProc(msg, wParam, lParam);
+ m_proto_interface->WindowSubscribe(m_hwnd);
if (m_show_label) {
- m_hwndStatus = CreateStatusWindow(WS_CHILD | WS_VISIBLE, NULL, m_hwnd, IDC_STATUSBAR);
+ m_hwndStatus = CreateStatusWindow(WS_CHILD | WS_VISIBLE, NULL, m_hwnd, 999);
SetWindowPos(m_hwndStatus, HWND_BOTTOM, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE);
UpdateStatusBar();
UpdateProtoTitle();
}
return result;
+ case WM_DESTROY:
+ Skin_ReleaseIcon((HICON)SendMessage(m_hwnd, WM_SETICON, ICON_BIG, 0));
+ Skin_ReleaseIcon((HICON)SendMessage(m_hwnd, WM_SETICON, ICON_SMALL, 0));
+ m_proto_interface->WindowUnsubscribe(m_hwnd);
+ break;
+
case WM_SETTEXT:
if (m_show_label && IsWindowUnicode(m_hwnd)) {
TCHAR *szTitle = (TCHAR *)lParam;
@@ -2288,7 +2017,7 @@ INT_PTR CProtoIntDlgBase::DlgProc(UINT msg, WPARAM wParam, LPARAM lParam)
}
break;
- // Protocol events
+ // Protocol events
case WM_PROTO_ACTIVATE:
OnProtoActivate(wParam, lParam);
return m_lresult;
@@ -2350,19 +2079,3 @@ void CProtoIntDlgBase::UpdateStatusBar()
SendMessage(m_hwndStatus, SB_SETICON, 1, (LPARAM)LoadSkinnedProtoIcon(m_proto_interface->m_szModuleName, m_proto_interface->m_iStatus));
SendMessage(m_hwndStatus, SB_SETTEXT, 1, (LPARAM)m_proto_interface->m_tszUserName);
}
-
-/////////////////////////////////////////////////////////////////////////////////////////
-// Misc utilities
-
-int UIEmulateBtnClick(HWND hwndDlg, UINT idcButton)
-{
- if (IsWindowEnabled(GetDlgItem(hwndDlg, idcButton)))
- PostMessage(hwndDlg, WM_COMMAND, MAKEWPARAM(idcButton, BN_CLICKED), (LPARAM)GetDlgItem(hwndDlg, idcButton));
- return 0;
-}
-
-void UIShowControls(HWND hwndDlg, int *idList, int nCmdShow)
-{
- for (; *idList; ++idList)
- ShowWindow(GetDlgItem(hwndDlg, *idList), nCmdShow);
-}
diff --git a/src/modules/protocols/protocols.cpp b/src/modules/protocols/protocols.cpp
index 5eef009c36..688c2f5428 100644
--- a/src/modules/protocols/protocols.cpp
+++ b/src/modules/protocols/protocols.cpp
@@ -47,14 +47,7 @@ static LIST<TServiceListItem> serviceItems(10, CompareServiceItems);
//------------------------------------------------------------------------------------
-static int CompareProtos(const PROTOCOLDESCRIPTOR* p1, const PROTOCOLDESCRIPTOR* p2)
-{
- return strcmp(p1->szName, p2->szName);
-}
-
-static LIST<PROTOCOLDESCRIPTOR> protos(10, CompareProtos);
-
-static int CompareProtos2(const PROTOCOLDESCRIPTOR* p1, const PROTOCOLDESCRIPTOR* p2)
+static int CompareProtos(const PROTOCOLDESCRIPTOR *p1, const PROTOCOLDESCRIPTOR *p2)
{
if (p1->type != p2->type)
return p1->type - p2->type;
@@ -62,53 +55,33 @@ static int CompareProtos2(const PROTOCOLDESCRIPTOR* p1, const PROTOCOLDESCRIPTOR
return strcmp(p1->szName, p2->szName);
}
-LIST<PROTOCOLDESCRIPTOR> filters(10, CompareProtos2);
+LIST<PROTOCOLDESCRIPTOR> filters(10, CompareProtos);
//------------------------------------------------------------------------------------
void FreeFilesMatrix(TCHAR ***files);
-PROTOCOLDESCRIPTOR* __fastcall Proto_IsProtocolLoaded(const char *szProtoName)
-{
- if (szProtoName) {
- PROTOCOLDESCRIPTOR tmp;
- tmp.szName = (char*)szProtoName;
- return protos.find(&tmp);
- }
- return NULL;
-}
-
INT_PTR srvProto_IsLoaded(WPARAM, LPARAM lParam)
{
return (INT_PTR)Proto_IsProtocolLoaded((char*)lParam);
}
-INT_PTR Proto_EnumProtocols(WPARAM wParam, LPARAM lParam)
-{
- *(int*)wParam = protos.getCount();
- *(PROTOCOLDESCRIPTOR***)lParam = protos.getArray();
- return 0;
-}
-
static PROTO_INTERFACE* defInitProto(const char* szModuleName, const TCHAR*)
{
return AddDefaultAccount(szModuleName);
}
-static INT_PTR Proto_RegisterModule(WPARAM, LPARAM lParam)
+static INT_PTR srvProto_RegisterModule(WPARAM, LPARAM lParam)
{
- PROTOCOLDESCRIPTOR* pd = (PROTOCOLDESCRIPTOR*)lParam, *p;
+ PROTOCOLDESCRIPTOR *pd = (PROTOCOLDESCRIPTOR*)lParam;
if (pd->cbSize != sizeof(PROTOCOLDESCRIPTOR) && pd->cbSize != PROTOCOLDESCRIPTOR_V3_SIZE)
return 1;
- p = (PROTOCOLDESCRIPTOR*)mir_alloc(sizeof(PROTOCOLDESCRIPTOR));
- if (!p)
+ PROTOCOLDESCRIPTOR *p = Proto_RegisterModule(pd);
+ if (p == NULL)
return 2;
if (pd->cbSize == PROTOCOLDESCRIPTOR_V3_SIZE) {
- memset(p, 0, sizeof(PROTOCOLDESCRIPTOR));
- p->cbSize = PROTOCOLDESCRIPTOR_V3_SIZE;
- p->type = pd->type;
if (p->type == PROTOTYPE_PROTOCOL || p->type == PROTOTYPE_VIRTUAL) {
// let's create a new container
PROTO_INTERFACE* ppi = AddDefaultAccount(pd->szName);
@@ -132,9 +105,7 @@ static INT_PTR Proto_RegisterModule(WPARAM, LPARAM lParam)
}
}
}
- else *p = *pd;
- p->szName = mir_strdup(pd->szName);
- protos.insert(p);
+
if (p->type != PROTOTYPE_PROTOCOL && p->type != PROTOTYPE_VIRTUAL)
filters.insert(p);
return 0;
@@ -680,8 +651,7 @@ int LoadProtocolsModule(void)
CreateServiceFunction(MS_PROTO_BROADCASTACK, Proto_BroadcastAck);
CreateServiceFunction(MS_PROTO_ISPROTOCOLLOADED, srvProto_IsLoaded);
- CreateServiceFunction(MS_PROTO_ENUMPROTOS, Proto_EnumProtocols);
- CreateServiceFunction(MS_PROTO_REGISTERMODULE, Proto_RegisterModule);
+ CreateServiceFunction(MS_PROTO_REGISTERMODULE, srvProto_RegisterModule);
CreateServiceFunction(MS_PROTO_SELFISTYPING, Proto_SelfIsTyping);
CreateServiceFunction(MS_PROTO_CONTACTISTYPING, Proto_ContactIsTyping);
@@ -708,14 +678,6 @@ void UnloadProtocolsModule()
hAccListChanged = NULL;
}
- if (protos.getCount()) {
- for (int i = 0; i < protos.getCount(); i++) {
- mir_free(protos[i]->szName);
- mir_free(protos[i]);
- }
- protos.destroy();
- }
-
for (int i = 0; i < serviceItems.getCount(); i++)
mir_free(serviceItems[i]);
serviceItems.destroy();
@@ -725,11 +687,6 @@ void UnloadProtocolsModule()
pfnUninitProto GetProtocolDestructor(char *szProto)
{
- PROTOCOLDESCRIPTOR temp;
- temp.szName = szProto;
- int idx = protos.getIndex(&temp);
- if (idx != -1)
- return protos[idx]->fnUninit;
-
- return NULL;
+ PROTOCOLDESCRIPTOR *p = Proto_IsProtocolLoaded(szProto);
+ return (p == NULL) ? NULL : p->fnUninit;
}
diff --git a/src/modules/protocols/protoopts.cpp b/src/modules/protocols/protoopts.cpp
index 68b341fbda..f5d6a7a04d 100644
--- a/src/modules/protocols/protoopts.cpp
+++ b/src/modules/protocols/protoopts.cpp
@@ -30,7 +30,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#define WM_MY_REFRESH (WM_USER+0x1000)
#define WM_MY_RENAME (WM_USER+0x1001)
-INT_PTR Proto_EnumProtocols(WPARAM, LPARAM);
bool CheckProtocolOrder(void);
#define errMsg \
@@ -181,9 +180,9 @@ static INT_PTR CALLBACK AccFormDlgProc(HWND hwndDlg, UINT message, WPARAM wParam
case WM_INITDIALOG:
TranslateDialogDefault(hwndDlg);
{
- PROTOCOLDESCRIPTOR** proto;
+ PROTOCOLDESCRIPTOR **proto;
int protoCount, i, cnt = 0;
- Proto_EnumProtocols((WPARAM)&protoCount, (LPARAM)&proto);
+ CallService(MS_PROTO_ENUMPROTOS, (WPARAM)&protoCount, (LPARAM)&proto);
for (i = 0; i < protoCount; i++) {
PROTOCOLDESCRIPTOR* pd = proto[i];
if (pd->type == PROTOTYPE_PROTOCOL && pd->cbSize == sizeof(*pd)) {