Enhancement - Hooks

- Implemented all command hooks.
- Implemented several field hooks.
- Implemented several task hooks.
- Reorganized event validation code.
- Finalized Hooks -> API::call* mechanism.
- Implemented several hook unit tests.
- Corrected unit tests that didn't specify rc.hooks=on.
- Corrected builds that include Lua.
This commit is contained in:
Paul Beckingham
2010-01-31 23:29:22 -05:00
parent 50f27e0952
commit f351e17a63
15 changed files with 782 additions and 97 deletions

View File

@@ -32,6 +32,8 @@
#include <vector>
#include <string>
#include "Task.h"
extern "C"
{
#include "lua.h"
@@ -49,9 +51,9 @@ public:
void initialize ();
bool callProgramHook (const std::string&, const std::string&);
bool callListHook (const std::string&, const std::string& /*, iterator */);
bool callTaskHook (const std::string&, const std::string&, int);
bool callFieldHook (const std::string&, const std::string&, const std::string&, const std::string&);
bool callListHook (const std::string&, const std::string&, std::vector <Task>&);
bool callTaskHook (const std::string&, const std::string&, Task&);
bool callFieldHook (const std::string&, const std::string&, const std::string&, std::string&);
private:
void loadFile (const std::string&);
@@ -59,6 +61,12 @@ private:
public:
lua_State* L;
std::vector <std::string> loaded;
// Context for the API.
// std::vector <Task> all;
Task current;
// std::string& name;
// std::string& value;
};
#endif