summaryrefslogtreecommitdiff
path: root/plugins/MirLua/src/stdafx.h
blob: 0bd6712d487ce46713a2ff6d331265e2b9df969f (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
#ifndef _COMMON_H_
#define _COMMON_H_

#include <windows.h>
#include <commctrl.h>
#include <malloc.h>
#include <time.h>

#include <map>
#include <string>

#include <newpluginapi.h>
#include <m_core.h>
#include <m_utils.h>
#include <m_langpack.h>
#include <m_database.h>
#include <m_options.h>
#include <m_gui.h>
#include <m_netlib.h>

#include <m_genmenu.h>
#include <m_clist.h>
#include <m_hotkeys.h>
#include <m_icolib.h>
#include <m_skin.h>
#include <m_message.h>
#include <m_chat.h>
#include <m_protocols.h>
#include <m_contacts.h>

#include <m_folders.h>
#include <m_msg_buttonsbar.h>
#include <m_popup.h>
#include <m_toptoolbar.h>

#include <m_lua.h>
#include <lua.hpp>

#include "version.h"
#include "resource.h"

class CMLuaScript;

#include "mlua.h"
#include "mlua_script.h"
#include "mlua_module_loader.h"
#include "mlua_script_loader.h"
#include "mlua_options.h"
#include "mlua_metatable.h"

#define MODULE "MirLua"

extern HINSTANCE g_hInstance;

extern CMLua *g_mLua;

extern int hMLuaLangpack;

extern HANDLE g_hCLibsFolder;
extern HANDLE g_hScriptsFolder;
#ifdef _UNICODE
	#define MIRLUA_PATHT MIRANDA_PATHW L"\\Scripts"
#else
	#define MIRLUA_PATHT MIRANDA_PATH "\\Scripts"
#endif

/* modules */

#define MLUA_CORE	"m_core"
LUAMOD_API int (luaopen_m_core)(lua_State *L);

#define MLUA_CHAT	"m_chat"
LUAMOD_API int (luaopen_m_chat)(lua_State *L);

#define MLUA_CLIST	"m_clist"
LUAMOD_API int (luaopen_m_clist)(lua_State *L);

#define MLUA_DATABASE	"m_database"
LUAMOD_API int (luaopen_m_database)(lua_State *L);

#define MLUA_ICOLIB	"m_icolib"
LUAMOD_API int (luaopen_m_icolib)(lua_State *L);

#include "m_genmenu.h"

#define MLUA_HOTKEYS	"m_hotkeys"
LUAMOD_API int (luaopen_m_hotkeys)(lua_State *L);

#define MLUA_MESSAGE	"m_message"
LUAMOD_API int (luaopen_m_message)(lua_State *L);

#include "m_protocols.h"

#include "m_schedule.h"

#define MLUA_SOUNDS	"m_sounds"
LUAMOD_API int (luaopen_m_sounds)(lua_State *L);

/* utils */

extern HANDLE hNetlib;
void Log(const char *format, ...);
void Log(const wchar_t *format, ...);

void ShowNotification(const char *caption, const char *message, int flags = 0, MCONTACT hContact = NULL);

int luaM_atpanic(lua_State *L);
int luaM_pcall(lua_State *L, int n = 0, int r = 0);

int luaM_print(lua_State *L);

int luaM_toansi(lua_State *L);
int luaM_toucs2(lua_State *L);

int luaM_topointer(lua_State *L);
int luaM_tonumber(lua_State *L);

WPARAM luaM_tomparam(lua_State *L, int idx);

int luaM_interpolate(lua_State *L);

bool luaM_toboolean(lua_State *L, int idx);

void InitIcons();
HICON GetIcon(int iconId);
HANDLE GetIconHandle(int iconId);

void ObsoleteMethod(lua_State *L, const char *message);

#endif //_COMMON_H_