1 #ifndef LWPP_GENERIC_HANDLER_H
2 #define LWPP_GENERIC_HANDLER_H
28 LWCommandCode
lookup (
const char *cmdName)
32 int execute (LWCommandCode cmd,
int argc,
const DynaValue *argv, DynaValue *result)
44 void editServer(
const char *type,
const char *name, LWItemID
id = 0)
50 std::ostringstream cmd;
51 cmd <<
"ApplyServer " << type <<
" " << name;
55 std::ostringstream cmd;
56 cmd <<
"EditServer " << type <<
" " << index;
59 static int findServer(
const char *type,
const char *name, LWItemID
id = 0)
66 std::ostringstream cmd;
67 cmd <<
"ApplyServer " << type <<
" " << name;
73 std::ostringstream cmd;
74 cmd <<
"ApplyServer " << type <<
" " << name;
81 std::ostringstream cmd;
82 cmd <<
"RemoveServer " << type <<
" " << index;
86 void removeServer(
const char *type,
const char *name, LWItemID
id = 0)
88 while (
int index = (
findServer(type, name,
id)))
90 std::ostringstream cmd;
91 cmd <<
"RemoveServer " << type <<
" " << index;
121 static int Activate(
int version, GlobalFunc *global, LWInstance inst,
void *serverData)
125 LWLayoutGeneric *local =
static_cast<LWLayoutGeneric *
>(inst);
129 return plugin.Activate();
161 static int Activate(
int version, GlobalFunc *global, LWInstance inst,
void *serverData)
165 LWLayoutGeneric *local =
static_cast<LWLayoutGeneric *
>(inst);
167 if (plugin == 0) plugin =
new T();
168 plugin->setLG(local);
169 return plugin->Activate();
173 #define IMPLEMENT_NONMODAL_GENERIC(className) template<> className *lwpp::LayoutNonModalGenericAdaptor< className >::plugin = 0;
176 #endif //LWPP_GENERIC_HANDLER_H