diff options
| author | George Hazan <ghazan@miranda.im> | 2021-11-07 19:24:53 +0300 |
|---|---|---|
| committer | George Hazan <ghazan@miranda.im> | 2021-11-07 19:24:53 +0300 |
| commit | 2d3b4b958926b3ed7d4a5d997121fe91a12f83cc (patch) | |
| tree | 1c40efd80b1fefc6dc2c80ad258f136754a02b7d /include | |
| parent | 3d88a792fb2f3950989d95d91e7de57fa1b74923 (diff) | |
update for system includes & import libraries
Diffstat (limited to 'include')
| -rw-r--r-- | include/m_core.h | 43 | ||||
| -rw-r--r-- | include/m_gui.h | 120 | ||||
| -rw-r--r-- | include/m_types.h | 45 |
3 files changed, 126 insertions, 82 deletions
diff --git a/include/m_core.h b/include/m_core.h index 8726e189a1..db198cfebb 100644 --- a/include/m_core.h +++ b/include/m_core.h @@ -513,26 +513,6 @@ __forceinline char* mir_utf8decodeA(const char* src) } /////////////////////////////////////////////////////////////////////////////// -// The UUID structure below is used to for plugin UUID's and module type definitions - -struct MUUID -{ - unsigned long a; - unsigned short b; - unsigned short c; - unsigned char d[8]; -}; - -__forceinline bool operator==(const MUUID &p1, const MUUID &p2) -{ - return memcmp(&p1, &p2, sizeof(MUUID)) == 0; -} -__forceinline bool operator!=(const MUUID &p1, const MUUID &p2) -{ - return memcmp(&p1, &p2, sizeof(MUUID)) != 0; -} - -/////////////////////////////////////////////////////////////////////////////// // Window subclassing #ifdef _MSC_VER @@ -573,6 +553,29 @@ MIR_CORE_DLL(void) UnloadCoreModule(void); #if defined(__cplusplus) } +/////////////////////////////////////////////////////////////////////////////// +// The UUID structure below is used to for plugin UUID's and module type definitions + +struct MUUID +{ + unsigned long a; + unsigned short b; + unsigned short c; + unsigned char d[8]; +}; + +__forceinline bool operator==(const MUUID& p1, const MUUID& p2) +{ + return memcmp(&p1, &p2, sizeof(MUUID)) == 0; +} +__forceinline bool operator!=(const MUUID& p1, const MUUID& p2) +{ + return memcmp(&p1, &p2, sizeof(MUUID)) != 0; +} + +/////////////////////////////////////////////////////////////////////////////// +// C++ templates + template <typename T> HANDLE mir_forkThread(void(MIR_CDECL *pFunc)(T* param), T *arg) { diff --git a/include/m_gui.h b/include/m_gui.h index 5277d7e05d..b7510ab504 100644 --- a/include/m_gui.h +++ b/include/m_gui.h @@ -500,7 +500,7 @@ public: void NotifyChange(); void SetDraw(bool bEnable); - INT_PTR SendMsg(UINT Msg, WPARAM wParam, LPARAM lParam) const; + LRESULT SendMsg(UINT Msg, WPARAM wParam, LPARAM lParam) const; void SetText(const wchar_t *text); void SetTextA(const char *text); @@ -517,11 +517,11 @@ public: int GetInt() const; virtual BOOL OnCommand(HWND /*hwndCtrl*/, WORD /*idCtrl*/, WORD /*idCode*/) { return FALSE; } - virtual BOOL OnNotify(int /*idCtrl*/, struct NMHDR* /*pnmh*/) { return FALSE; } + virtual BOOL OnNotify(int /*idCtrl*/, NMHDR* /*pnmh*/) { return FALSE; } - virtual BOOL OnMeasureItem(struct MEASUREITEMSTRUCT*) { return FALSE; } - virtual BOOL OnDrawItem(struct DRAWITEMSTRUCT*) { return FALSE; } - virtual BOOL OnDeleteItem(struct DELETEITEMSTRUCT*) { 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(); @@ -541,13 +541,13 @@ public: protected: virtual void GetCaretPos(CContextMenuPos&) const; - virtual INT_PTR CustomWndProc(UINT msg, WPARAM wParam, LPARAM lParam); + virtual LRESULT CustomWndProc(UINT msg, WPARAM wParam, LPARAM lParam); void Subclass(); void Unsubclass(); private: - static INT_PTR CALLBACK GlobalSubclassWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam); + static LRESULT CALLBACK GlobalSubclassWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam); }; ///////////////////////////////////////////////////////////////////////////////////////// @@ -615,7 +615,7 @@ public: __forceinline int GetPos() const { return m_iPosition; } protected: - INT_PTR CustomWndProc(UINT msg, WPARAM wParam, LPARAM lParam) override; + LRESULT CustomWndProc(UINT msg, WPARAM wParam, LPARAM lParam) override; void OnInit() override; int m_iPosition; @@ -715,7 +715,7 @@ public: struct TEventInfo { CCtrlClc *ctrl; - struct NMCLISTCONTROL *info; + NMCLISTCONTROL *info; }; CCallback<TEventInfo> OnExpanded; @@ -812,8 +812,8 @@ class MIR_CORE_EXPORT CCtrlDate : public CCtrlData public: CCtrlDate(CDlgBase *dlg, int ctrlId); - void GetTime(struct SYSTEMTIME*); - void SetTime(struct SYSTEMTIME*); + void GetTime(SYSTEMTIME*); + void SetTime(SYSTEMTIME*); }; ///////////////////////////////////////////////////////////////////////////////////////// @@ -1015,12 +1015,12 @@ public: HWND EditLabel(int iItem); int EnableGroupView(BOOL fEnable); BOOL EnsureVisible(int i, BOOL fPartialOK); - int FindItem(int iStart, const struct LVFINDINFO *plvfi); + int FindItem(int iStart, const LVFINDINFO *plvfi); COLORREF GetBkColor() const; - void GetBkImage(struct LVBKIMAGE *plvbki) const; + void GetBkImage(LVBKIMAGE *plvbki) const; UINT GetCallbackMask() const; BOOL GetCheckState(UINT iIndex) const; - void GetColumn(int iCol, struct LVCOLUMN *pcol) const; + void GetColumn(int iCol, LVCOLUMN *pcol) const; void GetColumnOrderArray(int iCount, int *lpiArray) const; int GetColumnWidth(int iCol) const; int GetCountPerPage() const; @@ -1028,20 +1028,20 @@ public: DWORD GetExtendedListViewStyle() const; int GetFocusedGroup() const; int GetGroupCount() const; - void GetGroupInfo(int iGroupId, struct LVGROUP *pgrp) const; - void GetGroupInfoByIndex(int iIndex, struct LVGROUP *pgrp) const; - void GetGroupMetrics(struct LVGROUPMETRICS *pGroupMetrics) const; + void GetGroupInfo(int iGroupId, LVGROUP *pgrp) const; + void GetGroupInfoByIndex(int iIndex, LVGROUP *pgrp) const; + void GetGroupMetrics(LVGROUPMETRICS *pGroupMetrics) const; UINT GetGroupState(UINT dwGroupId, UINT dwMask) const; HWND GetHeader() const; HCURSOR GetHotCursor() const; int GetHotItem() const; DWORD GetHoverTime() const; HIMAGELIST GetImageList(int iImageList) const; - BOOL GetInsertMark(struct LVINSERTMARK *plvim) const; + BOOL GetInsertMark(LVINSERTMARK *plvim) const; COLORREF GetInsertMarkColor() const; int GetInsertMarkRect(RECT *prc) const; BOOL GetISearchString(LPSTR lpsz) const; - bool GetItem(struct LVITEM *pitem) const; + bool GetItem(LVITEM *pitem) const; int GetItemCount() const; void GetItemPosition(int i, POINT *ppt) const; void GetItemRect(int i, RECT *prc, int code) const; @@ -1059,8 +1059,8 @@ public: BOOL GetSubItemRect(int iItem, int iSubItem, int code, RECT *lpRect) const; COLORREF GetTextBkColor() const; COLORREF GetTextColor() const; - void GetTileInfo(struct LVTILEINFO *plvtinfo) const; - void GetTileViewInfo(struct LVTILEVIEWINFO *plvtvinfo) const; + void GetTileInfo(LVTILEINFO *plvtinfo) const; + void GetTileViewInfo(LVTILEVIEWINFO *plvtvinfo) const; HWND GetToolTips() const; int GetTopIndex() const; BOOL GetUnicodeFormat() const; @@ -1068,12 +1068,12 @@ public: BOOL GetViewRect(RECT *prc) const; void GetWorkAreas(int nWorkAreas, RECT *lprc) const; BOOL HasGroup(int dwGroupId); - int HitTest(struct LVHITTESTINFO *pinfo) const; - int HitTestEx(struct LVHITTESTINFO *pinfo); - int InsertColumn(int iCol, const struct LVCOLUMN *pcol); - int InsertGroup(int index, struct LVGROUP *pgrp); - void InsertGroupSorted(struct LVINSERTGROUPSORTED *structInsert); - int InsertItem(const struct LVITEM *pitem); + int HitTest(LVHITTESTINFO *pinfo) const; + int HitTestEx(LVHITTESTINFO *pinfo); + int InsertColumn(int iCol, const LVCOLUMN *pcol); + int InsertGroup(int index, LVGROUP *pgrp); + void InsertGroupSorted(LVINSERTGROUPSORTED *structInsert); + int InsertItem(const LVITEM *pitem); BOOL InsertMarkHitTest(POINT *point, LVINSERTMARK *plvim); BOOL IsGroupViewEnabled(); UINT IsItemVisible(UINT index); @@ -1084,26 +1084,26 @@ public: int RemoveGroup(int iGroupId); BOOL Scroll(int dx, int dy); BOOL SetBkColor(COLORREF clrBk); - BOOL SetBkImage(struct LVBKIMAGE *plvbki); + BOOL SetBkImage(LVBKIMAGE *plvbki); BOOL SetCallbackMask(UINT mask); void SetCheckState(UINT iIndex, BOOL fCheck); - BOOL SetColumn(int iCol, struct LVCOLUMN *pcol); + BOOL SetColumn(int iCol, LVCOLUMN *pcol); BOOL SetColumnOrderArray(int iCount, int *lpiArray); BOOL SetColumnWidth(int iCol, int cx); void SetExtendedListViewStyle(DWORD dwExStyle); void SetExtendedListViewStyleEx(DWORD dwExMask, DWORD dwExStyle); - int SetGroupInfo(int iGroupId, struct LVGROUP *pgrp); - void SetGroupMetrics(struct LVGROUPMETRICS *pGroupMetrics); + int SetGroupInfo(int iGroupId, LVGROUP *pgrp); + void SetGroupMetrics(LVGROUPMETRICS *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(struct LVSETINFOTIP *plvSetInfoTip); - BOOL SetInsertMark(struct LVINSERTMARK *plvim); + BOOL SetInfoTip(LVSETINFOTIP *plvSetInfoTip); + BOOL SetInsertMark(LVINSERTMARK *plvim); COLORREF SetInsertMarkColor(COLORREF color); - BOOL SetItem(const struct LVITEM *pitem); + BOOL SetItem(const LVITEM *pitem); void SetItemCount(int cItems); void SetItemCountEx(int cItems, DWORD dwFlags); BOOL SetItemPosition(int i, int x, int y); @@ -1115,14 +1115,14 @@ public: int SetSelectionMark(int iIndex); BOOL SetTextBkColor(COLORREF clrText); BOOL SetTextColor(COLORREF clrText); - BOOL SetTileInfo(struct LVTILEINFO *plvtinfo); - BOOL SetTileViewInfo(struct LVTILEVIEWINFO *plvtvinfo); + BOOL SetTileInfo(LVTILEINFO *plvtinfo); + BOOL SetTileViewInfo(LVTILEVIEWINFO *plvtvinfo); HWND SetToolTips(HWND ToolTip); BOOL SetUnicodeFormat(BOOL fUnicode); int SetView(DWORD iView); void SetWorkAreas(int nWorkAreas, RECT *lprc); - int SubItemHitTest(struct LVHITTESTINFO *pInfo) const; - int SubItemHitTestEx(struct LVHITTESTINFO *plvhti); + int SubItemHitTest(LVHITTESTINFO *pInfo) const; + int SubItemHitTestEx(LVHITTESTINFO *plvhti); BOOL Update(int iItem); #ifdef _MSC_VER @@ -1143,15 +1143,15 @@ public: struct TEventInfo { CCtrlListView *treeviewctrl; union { - struct NMHDR *nmhdr; - struct NMLISTVIEW *nmlv; - struct NMLVDISPINFO *nmlvdi; - struct NMLVSCROLL *nmlvscr; - struct NMLVGETINFOTIP *nmlvit; - struct NMLVFINDITEM *nmlvfi; - struct NMITEMACTIVATE *nmlvia; - struct NMLVKEYDOWN *nmlvkey; - struct NMLVCUSTOMDRAW *nmcd; + NMHDR *nmhdr; + NMLISTVIEW *nmlv; + NMLVDISPINFO *nmlvdi; + NMLVSCROLL *nmlvscr; + NMLVGETINFOTIP *nmlvit; + NMLVFINDITEM *nmlvfi; + NMITEMACTIVATE *nmlvia; + NMLVKEYDOWN *nmlvkey; + NMLVCUSTOMDRAW *nmcd; }; }; @@ -1223,7 +1223,7 @@ public: HIMAGELIST GetImageList(int iImage) const; int GetIndent() const; COLORREF GetInsertMarkColor() const; - bool GetItem(struct TVITEMEX *tvi) const; + bool GetItem(TVITEMEX *tvi) const; int GetItemHeight() const; void GetItemRect(HTREEITEM hItem, RECT *rcItem, BOOL fItemRect) const; DWORD GetItemState(HTREEITEM hItem, DWORD stateMask) const; @@ -1242,8 +1242,8 @@ public: HWND GetToolTips() const; BOOL GetUnicodeFormat() const; unsigned GetVisibleCount() const; - HTREEITEM HitTest(struct TVHITTESTINFO *hti) const; - HTREEITEM InsertItem(struct TVINSERTSTRUCT *tvis); + HTREEITEM HitTest(TVHITTESTINFO *hti) const; + HTREEITEM InsertItem(TVINSERTSTRUCT *tvis); void Select(HTREEITEM hItem, DWORD flag); void SelectDropTarget(HTREEITEM hItem); void SelectItem(HTREEITEM hItem); @@ -1263,7 +1263,7 @@ public: HWND SetToolTips(HWND hwndToolTips); BOOL SetUnicodeFormat(BOOL fUnicode); void SortChildren(HTREEITEM hItem, BOOL fRecurse); - void SortChildrenCB(struct TVSORTCB *cb, BOOL fRecurse); + void SortChildrenCB(TVSORTCB *cb, BOOL fRecurse); // Additional stuff void TranslateItem(HTREEITEM hItem); @@ -1275,7 +1275,7 @@ public: bool IsSelected(HTREEITEM hItem); int GetNumSelected(); - void GetSelected(LIST<struct _TREEITEM> &selected); + void GetSelected(LIST<_TREEITEM> &selected); void Select(HTREEITEM hItem); void Select(LIST<_TREEITEM> &selected); @@ -1292,12 +1292,12 @@ public: struct TEventInfo { CCtrlTreeView *treeviewctrl; union { - struct NMHDR *nmhdr; - struct NMTREEVIEW *nmtv; - struct NMTVKEYDOWN *nmtvkey; - struct NMTVDISPINFO *nmtvdi; - struct NMTVGETINFOTIP *nmtvit; - struct NMTVCUSTOMDRAW *nmcd; + NMHDR *nmhdr; + NMTREEVIEW *nmtv; + NMTVKEYDOWN *nmtvkey; + NMTVDISPINFO *nmtvdi; + NMTVGETINFOTIP *nmtvit; + NMTVCUSTOMDRAW *nmcd; HTREEITEM hItem; // for OnItemChanged }; }; @@ -1326,7 +1326,7 @@ protected: BOOL OnNotify(int idCtrl, NMHDR *pnmh) override; void GetCaretPos(CContextMenuPos&) const override; - INT_PTR CustomWndProc(UINT msg, WPARAM wParam, LPARAM lParam) override; + LRESULT CustomWndProc(UINT msg, WPARAM wParam, LPARAM lParam) override; union { uint32_t m_dwFlags; @@ -1431,7 +1431,7 @@ protected: bool OnApply() override; void OnReset() override; - INT_PTR CustomWndProc(UINT msg, WPARAM wParam, LPARAM lParam) override; + LRESULT CustomWndProc(UINT msg, WPARAM wParam, LPARAM lParam) override; }; ///////////////////////////////////////////////////////////////////////////////////////// diff --git a/include/m_types.h b/include/m_types.h index 236adfbb1f..1223ff4c7e 100644 --- a/include/m_types.h +++ b/include/m_types.h @@ -27,11 +27,11 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. /////////////////////////////////////////////////////////////////////////////// // Linux +#ifndef _MSC_VER + #include <wchar.h> #include <netinet/in.h> -#ifndef _MSC_VER - #define CALLBACK #define EXTERN_C extern "C" @@ -110,11 +110,52 @@ DECLARE_HANDLE(HINSTANCE); struct EXCEPTION_POINTERS { int unused; }; struct LOGFONT { int unused; }; +struct SYSTEMTIME; +struct MEASUREITEMSTRUCT; +struct DRAWITEMSTRUCT; +struct DELETEITEMSTRUCT; + +struct NMHDR; +struct NMLISTVIEW; +struct NMLVDISPINFO; +struct NMLVSCROLL; +struct NMLVGETINFOTIP; +struct NMLVFINDITEM; +struct NMITEMACTIVATE; +struct NMLVKEYDOWN; +struct NMLVCUSTOMDRAW; +struct NMCLISTCONTROL; +struct NMTREEVIEW; +struct NMTVKEYDOWN; +struct NMTVDISPINFO; +struct NMTVGETINFOTIP; +struct NMTVCUSTOMDRAW; + +struct LVFINDINFO; +struct LVBKIMAGE; +struct LVCOLUMN; +struct LVGROUP; +struct LVGROUPMETRICS; +struct LVINSERTMARK; +struct LVTILEINFO; +struct LVTILEVIEWINFO; +struct LVITEM; +struct LVHITTESTINFO; +struct LVINSERTGROUPSORTED; +struct LVSETINFOTIP; + +struct TVITEMEX; +struct TVHITTESTINFO; +struct TVINSERTSTRUCT; +struct TVSORTCB; +struct _TREEITEM; #else /////////////////////////////////////////////////////////////////////////////// // Windows +#include <tchar.h> + #define MIR_EXPORT __declspec(dllexport) #define MIR_IMPORT __declspec(dllimport) |
