Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef __PLCORE_FRONTENDMAIN_H__
00024 #define __PLCORE_FRONTENDMAIN_H__
00025 #pragma once
00026
00027
00028
00029
00030
00031 #include "PLCore/Main.h"
00032 #include "PLCore/Runtime.h"
00033 #include "PLCore/ModuleMain.h"
00034 #include "PLCore/Frontend/Frontend.h"
00035 #include "PLCore/Frontend/FrontendContext.h"
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053 #define pl_module_application(ModuleName, ApplicationClass) \
00054 int PLMain(const PLCore::String &sExecutableFilename, const PLCore::Array<PLCore::String> &lstArguments) \
00055 { \
00056 \
00057 if (PLCore::Runtime::ScanDirectoryPluginsAndData()) { \
00058 \
00059 PLCore::FrontendContext cFrontendContext; \
00060 cFrontendContext.SetExecutableFilename(sExecutableFilename); \
00061 cFrontendContext.SetArguments(lstArguments); \
00062 cFrontendContext.SetName(ModuleName); \
00063 cFrontendContext.SetFrontendParameters(PLCore::String("ApplicationClass=\"") + ApplicationClass + '\"'); \
00064 \
00065 \
00066 return PLCore::Frontend::Run(cFrontendContext); \
00067 } else { \
00068 \
00069 return -1; \
00070 } \
00071 } \
00072 \
00073 pl_module_plugin(ModuleName)
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089 #define pl_module_application_frontend(ModuleName, ApplicationClass, FrontendClass) \
00090 int PLMain(const PLCore::String &sExecutableFilename, const PLCore::Array<PLCore::String> &lstArguments) \
00091 { \
00092 \
00093 if (PLCore::Runtime::ScanDirectoryPluginsAndData()) { \
00094 \
00095 PLCore::FrontendContext cFrontendContext; \
00096 cFrontendContext.SetExecutableFilename(sExecutableFilename); \
00097 cFrontendContext.SetArguments(lstArguments); \
00098 cFrontendContext.SetName(ModuleName); \
00099 cFrontendContext.SetFrontendParameters(PLCore::String("ApplicationClass=\"") + ApplicationClass + '\"'); \
00100 cFrontendContext.SetFrontendImplementation(FrontendClass); \
00101 \
00102 \
00103 return PLCore::Frontend::Run(cFrontendContext); \
00104 } else { \
00105 \
00106 return -1; \
00107 } \
00108 } \
00109 \
00110 pl_module_plugin(ModuleName)
00111
00112
00113 #endif // __PLCORE_FRONTENDMAIN_H__