push 916d6ae32ef88182ddeeedd2a4b2365cc3694db5
[tagua/yd.git] / src / luaapi / luahl.h
blob119a0ab17341588f5d93bb76c568e113c7a11619
1 /*
2 Copyright (c) 2006 Paolo Capriotti <p.capriotti@gmail.com>
3 (c) 2006 Maurizio Monge <maurizio.monge@kdemail.net>
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version.
9 */
11 #ifndef LUAHL_H
12 #define LUAHL_H
14 #include <map>
15 #include <QRegExp>
17 class lua_State;
18 class HLine;
20 namespace LuaApi {
22 class Api {
23 lua_State* m_state;
25 void pcall(int nArgs, int nResults);
26 void pushpair(int x, int y);
27 std::pair<bool, HLine*> runEvent(const QString& text, int eventIndex, QRegExp& pattern);
28 public:
29 Api();
30 ~Api();
32 lua_State* state() const { return m_state; }
33 void runFile(const char* file);
35 HLine* highlight(const QString& text);
39 } // namespace LuaHl
42 #endif // LUAHL_H