the first part of reimplementing has been done
now we have app object and singletons are only: log logn plugin and app git-svn-id: svn://ttmath.org/publicrep/winix/trunk@628 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
@@ -14,11 +14,15 @@
|
||||
#include <vector>
|
||||
#include <string>
|
||||
#include <map>
|
||||
#include "request.h"
|
||||
#include "data.h"
|
||||
#include "pluginmsg.h"
|
||||
#include "log.h"
|
||||
#include "plugindata.h"
|
||||
#include "config.h"
|
||||
#include "request.h"
|
||||
#include "system.h"
|
||||
#include "sessionmanager.h"
|
||||
#include "functions/functions.h"
|
||||
#include "templates/templates.h"
|
||||
|
||||
|
||||
/*
|
||||
@@ -33,6 +37,8 @@
|
||||
and you can set the name of the plugin by setting info.p1 pointer
|
||||
to a string buffer (const char *)
|
||||
(this buffer will not be copied so it should not be destroyed after Init finishes)
|
||||
also in Init you can only use logger (log) info.config and info.db objects
|
||||
(the rest winix objects are not initialized yet)
|
||||
*/
|
||||
|
||||
|
||||
@@ -50,10 +56,19 @@ struct PluginInfo
|
||||
// unique plugin identifier
|
||||
int plugin_id;
|
||||
|
||||
// objects from winix which are accessible from a plugin
|
||||
Db * db;
|
||||
Config * config;
|
||||
Request * request;
|
||||
System * system;
|
||||
Functions * functions;
|
||||
Templates * templates;
|
||||
SessionManager * session_manager;
|
||||
|
||||
// pointer to the plugin session (can be null if not set by the plugin)
|
||||
// you should use WINIX_SESSION_CREATED and WINIX_SESSION_REMOVE
|
||||
// to create your plugin's session data
|
||||
PluginDataBase * plugin_data_base;
|
||||
PluginDataBase * plugin_data_base; // !! zmienic nazwe na plugin_session_base ? a moze session_base; a moze plugin_session?
|
||||
|
||||
// function return status
|
||||
// default: false (if not set by the plugin)
|
||||
@@ -62,6 +77,8 @@ struct PluginInfo
|
||||
|
||||
void Clear()
|
||||
{
|
||||
// pointers to winix objects are not cleared here
|
||||
|
||||
p1 = 0;
|
||||
p2 = 0;
|
||||
l1 = 0;
|
||||
@@ -109,6 +126,14 @@ public:
|
||||
Plugin();
|
||||
~Plugin();
|
||||
|
||||
void SetDb(Db * pdb);
|
||||
void SetConfig(Config * pconfig);
|
||||
void SetRequest(Request * prequest);
|
||||
void SetSystem(System * psystem);
|
||||
void SetFunctions(Functions * pfunctions);
|
||||
void SetTemplates(Templates * ptemplates);
|
||||
void SetSessionManager(SessionManager * psession_manager);
|
||||
|
||||
void LoadPlugin(const char * filename);
|
||||
void LoadPlugin(const std::string & filename);
|
||||
void LoadPlugins(const std::vector<std::string> & plugins);
|
||||
@@ -134,6 +159,14 @@ public:
|
||||
|
||||
private:
|
||||
|
||||
Db * db;
|
||||
Config * config;
|
||||
Request * request;
|
||||
System * system;
|
||||
Functions * functions;
|
||||
Templates * templates;
|
||||
SessionManager * session_manager;
|
||||
|
||||
|
||||
struct PluginsItem
|
||||
{
|
||||
@@ -151,6 +184,8 @@ private:
|
||||
|
||||
void * LoadInitFun(const char * filename, Fun1 & fun_init);
|
||||
void Call(int message, Slots::iterator & slot);
|
||||
|
||||
bool SetPointers(PluginInfo & info);
|
||||
};
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user