| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
#ifndef PLANREADERLUA_H |
| 14 |
#define PLANREADERLUA_H |
| 15 |
|
| 16 |
#include "impositionplan.h" |
| 17 |
|
| 18 |
#include <string> |
| 19 |
|
| 20 |
struct lua_State; |
| 21 |
|
| 22 |
class LuaMachina |
| 23 |
{ |
| 24 |
lua_State *L; |
| 25 |
public: |
| 26 |
LuaMachina(); |
| 27 |
~LuaMachina(); |
| 28 |
|
| 29 |
inline lua_State* State() |
| 30 |
{ |
| 31 |
return L; |
| 32 |
} |
| 33 |
}; |
| 34 |
|
| 35 |
|
| 36 |
|
| 37 |
class PlanReader_Lua |
| 38 |
{ |
| 39 |
LuaMachina L; |
| 40 |
|
| 41 |
public: |
| 42 |
PlanReader_Lua(const std::string & planfile, PoDoFo::Impose::ImpositionPlan* ip); |
| 43 |
~PlanReader_Lua(); |
| 44 |
|
| 45 |
static int PushRecord(lua_State *L); |
| 46 |
|
| 47 |
private: |
| 48 |
PoDoFo::Impose::ImpositionPlan* plan; |
| 49 |
|
| 50 |
|
| 51 |
bool hasGlobal(const std::string& name); |
| 52 |
|
| 53 |
|
| 54 |
double getNumber(const std::string& name); |
| 55 |
|
| 56 |
void setNumber(const std::string& name, double value); |
| 57 |
|
| 58 |
std::string getString(const std::string& name); |
| 59 |
}; |
| 60 |
|
| 61 |
#endif |