summaryrefslogtreecommitdiff
path: root/include/m_types.h
blob: 5410b3476a9bc645fb0bc092156dde30c2260546 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
/*

Miranda NG: the free IM client for Microsoft* Windows*

Copyright (C) 2012-23 Miranda NG team (https://miranda-ng.org)
all portions of this codebase are copyrighted to the people
listed in contributors.txt.

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 M_TYPES_H__
#define M_TYPES_H__ 1

///////////////////////////////////////////////////////////////////////////////
// Linux

#ifndef _MSC_VER

#include <wchar.h>
#include <netinet/in.h>

using namespace std;

#define CALLBACK
#define EXTERN_C extern "C"

#define PURE = 0
#define STDMETHOD(method)        virtual HRESULT method
#define STDMETHOD_(ret, method)  virtual ret method
#define STDMETHODIMP_(ret)       ret

#define FALSE 0
#define TRUE  1
#define CP_ACP 0
#define SW_HIDE 0
#define SW_SHOW 5
#define MAX_PATH 260
#define LR_SHARED 0x8000
#define LF_FACESIZE 32
#define _TRUNCATE size_t(-1)
#define INVALID_HANDLE_VALUE HANDLE(-1)

#define MB_OK              0x00000000L
#define MB_OKCANCEL        0x00000001L
#define MB_YESNOCANCEL     0x00000003L
#define MB_YESNO           0x00000004L
#define MB_RETRYCANCEL     0x00000005L

#define MB_ICONSTOP        0x00000010L
#define MB_ICONERROR       0x00000010L
#define MB_ICONQUESTION    0x00000020L
#define MB_ICONEXCLAMATION 0x00000030L
#define MB_ICONWARNING     0x00000030L
#define MB_ICONINFORMATION 0x00000040L

#define IDABORT    3
#define IDCANCEL   2
#define IDCONTINUE 11
#define IDIGNORE   5
#define IDNO       7
#define IDOK       1
#define IDRETRY    4
#define IDTRYAGAIN 10
#define IDYES      6

typedef void          *HANDLE;
typedef int            BOOL, SOCKET;
typedef uint32_t       UINT, COLORREF;
typedef intptr_t       WPARAM, LPARAM, INT_PTR;
typedef uintptr_t      UINT_PTR, DWORD_PTR, LRESULT;
typedef char          *LPSTR;
typedef const char    *LPCSTR;
typedef wchar_t       *LPWSTR, *LPTSTR;
typedef const wchar_t *LPCWSTR, *LPCTSTR;
typedef sockaddr_in    SOCKADDR_IN;

struct RECT { int left, top, right, bottom; };
struct POINT { int x, y; };
struct SIZE { int width, height; };
struct MSG;
struct LOGFONTA;
struct LOGFONTW;
struct WIN32_FIND_DATA;

#define GetCurrentThreadId pthread_self

#define MIR_EXPORT __attribute__((__visibility__("default")))
#define MIR_IMPORT
#define MIR_SYSCALL
#define MIR_CDECL
#define UNREFERENCED_PARAMETER(x)

#define __try try
#define __except catch
#define EXCEPTION_EXECUTE_HANDLER ...

#define _In_z_
#define _Pre_notnull_
#define _Always_(x)
#define _Printf_format_string_
#define _countof(array) (sizeof(array) / sizeof(array[0]))
#define __forceinline inline __attribute__ ((always_inline))
#define __fallthrough

#define InterlockedIncrement(x) __sync_fetch_and_add(x, 1)
#define InterlockedDecrement(x) __sync_fetch_and_add(x, -1)

#define SecureZeroMemory(x, y) memset(x, 0, y)
#define interface struct
#define memcpy_s(a,b,c,d) memcpy(a,c,(b)<(d)?(b):(d))
#define memmove_s(a,b,c,d) memmove(a,c,(b)<(d)?(b):(d))

#define stricmp strcasecmp
#define strnicmp strncasecmp
#define wcsicmp wcscasecmp
#define wcsnicmp wcsncasecmp

#define _vsnprintf vsnprintf
#define _vsnwprintf vswprintf

#define DECLARE_HANDLE(name) struct _##name { int unused; }; typedef struct _##name *name
DECLARE_HANDLE(HDC);
DECLARE_HANDLE(HWND);
DECLARE_HANDLE(HFONT);
DECLARE_HANDLE(HICON);
DECLARE_HANDLE(HMENU);
DECLARE_HANDLE(HBRUSH);
DECLARE_HANDLE(HBITMAP);
DECLARE_HANDLE(HCURSOR);
DECLARE_HANDLE(HTREEITEM);
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;

#ifdef ELEMENTARY_H
	typedef Evas_Object* MWindow;
#else
	typedef void *MWindow;
#endif

#else
///////////////////////////////////////////////////////////////////////////////
// Windows

#include <tchar.h>

#define MIR_EXPORT __declspec(dllexport)
#define MIR_IMPORT __declspec(dllimport)

#define MIR_SYSCALL __stdcall
#define MIR_CDECL   __cdecl

typedef HWND MWindow;

#endif

#endif // M_TYPES_H__