| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
|
| 23 |
|
| 24 |
|
| 25 |
|
| 26 |
#ifndef __QERPLUGIN_H__ |
| 27 |
#define __QERPLUGIN_H__ |
| 28 |
|
| 29 |
#include "uilib/uilib.h" |
| 30 |
#include "generic/constant.h" |
| 31 |
|
| 32 |
|
| 33 |
|
| 34 |
|
| 35 |
|
| 36 |
|
| 37 |
|
| 38 |
|
| 39 |
|
| 40 |
enum EMessageBoxType |
| 41 |
{ |
| 42 |
eMB_OK, |
| 43 |
eMB_OKCANCEL, |
| 44 |
eMB_YESNO, |
| 45 |
eMB_YESNOCANCEL, |
| 46 |
eMB_NOYES, |
| 47 |
}; |
| 48 |
|
| 49 |
enum EMessageBoxIcon |
| 50 |
{ |
| 51 |
eMB_ICONDEFAULT, |
| 52 |
eMB_ICONERROR, |
| 53 |
eMB_ICONWARNING, |
| 54 |
eMB_ICONQUESTION, |
| 55 |
eMB_ICONASTERISK, |
| 56 |
}; |
| 57 |
|
| 58 |
enum EMessageBoxReturn |
| 59 |
{ |
| 60 |
eIDOK, |
| 61 |
eIDCANCEL, |
| 62 |
eIDYES, |
| 63 |
eIDNO, |
| 64 |
}; |
| 65 |
|
| 66 |
|
| 67 |
|
| 68 |
typedef EMessageBoxReturn ( *PFN_QERAPP_MESSAGEBOX )( ui::Window parent, const char* text, const char* caption , EMessageBoxType type , EMessageBoxIcon icon ); |
| 69 |
|
| 70 |
|
| 71 |
|
| 72 |
|
| 73 |
|
| 74 |
typedef const char* ( *PFN_QERAPP_FILEDIALOG )( ui::Window parent, bool open, const char* title, const char* path , const char* pattern , bool want_load , bool want_import , bool want_save ); |
| 75 |
|
| 76 |
|
| 77 |
typedef char* ( *PFN_QERAPP_DIRDIALOG )( ui::Window parent, const char* title , const char* path ); |
| 78 |
|
| 79 |
|
| 80 |
|
| 81 |
template<typename Element> class BasicVector3; |
| 82 |
typedef BasicVector3<float> Vector3; |
| 83 |
typedef bool ( *PFN_QERAPP_COLORDIALOG )( ui::Window parent, Vector3& color, |
| 84 |
const char* title ); |
| 85 |
|
| 86 |
|
| 87 |
|
| 88 |
typedef ui::Image ( *PFN_QERAPP_NEWIMAGE )( const char* filename ); |
| 89 |
|
| 90 |
|
| 91 |
|
| 92 |
namespace scene |
| 93 |
{ |
| 94 |
class Node; |
| 95 |
} |
| 96 |
|
| 97 |
class ModuleObserver; |
| 98 |
|
| 99 |
#include "signal/signalfwd.h" |
| 100 |
#include "windowobserver.h" |
| 101 |
#include "generic/vector.h" |
| 102 |
|
| 103 |
typedef SignalHandler3<const WindowVector&, ButtonIdentifier, ModifierFlags> MouseEventHandler; |
| 104 |
typedef SignalFwd<MouseEventHandler>::handler_id_type MouseEventHandlerId; |
| 105 |
|
| 106 |
enum VIEWTYPE |
| 107 |
{ |
| 108 |
YZ = 0, |
| 109 |
XZ = 1, |
| 110 |
XY = 2 |
| 111 |
}; |
| 112 |
|
| 113 |
|
| 114 |
struct _QERFuncTable_1 |
| 115 |
{ |
| 116 |
INTEGER_CONSTANT( Version, 1 ); |
| 117 |
STRING_CONSTANT( Name, "radiant" ); |
| 118 |
|
| 119 |
const char* ( *getEnginePath )( ); |
| 120 |
const char* ( *getLocalRcPath )( ); |
| 121 |
const char* ( *getGameToolsPath )( ); |
| 122 |
const char* ( *getAppPath )( ); |
| 123 |
const char* ( *getDataPath )( ); |
| 124 |
const char* ( *getSettingsPath )( ); |
| 125 |
const char* ( *getMapsPath )( ); |
| 126 |
|
| 127 |
const char* ( *getGameFile )( ); |
| 128 |
const char* ( *getGameName )( ); |
| 129 |
const char* ( *getGameMode )( ); |
| 130 |
|
| 131 |
const char* ( *getMapName )( ); |
| 132 |
scene::Node& ( *getMapWorldEntity )( ); |
| 133 |
float ( *getGridSize )(); |
| 134 |
|
| 135 |
const char* ( *getGameDescriptionKeyValue )(const char* key); |
| 136 |
const char* ( *getRequiredGameDescriptionKeyValue )(const char* key); |
| 137 |
|
| 138 |
SignalHandlerId ( *XYWindowDestroyed_connect )( const SignalHandler& handler ); |
| 139 |
void ( *XYWindowDestroyed_disconnect )( SignalHandlerId id ); |
| 140 |
MouseEventHandlerId ( *XYWindowMouseDown_connect )( const MouseEventHandler& handler ); |
| 141 |
void ( *XYWindowMouseDown_disconnect )( MouseEventHandlerId id ); |
| 142 |
VIEWTYPE ( *XYWindow_getViewType )(); |
| 143 |
Vector3 ( *XYWindow_windowToWorld )( const WindowVector& position ); |
| 144 |
const char* ( *TextureBrowser_getSelectedShader )( ); |
| 145 |
|
| 146 |
|
| 147 |
PFN_QERAPP_MESSAGEBOX m_pfnMessageBox; |
| 148 |
PFN_QERAPP_FILEDIALOG m_pfnFileDialog; |
| 149 |
PFN_QERAPP_DIRDIALOG m_pfnDirDialog; |
| 150 |
PFN_QERAPP_COLORDIALOG m_pfnColorDialog; |
| 151 |
PFN_QERAPP_NEWIMAGE m_pfnNewImage; |
| 152 |
|
| 153 |
}; |
| 154 |
|
| 155 |
#include "modulesystem.h" |
| 156 |
|
| 157 |
template<typename Type> |
| 158 |
class GlobalModule; |
| 159 |
typedef GlobalModule<_QERFuncTable_1> GlobalRadiantModule; |
| 160 |
|
| 161 |
template<typename Type> |
| 162 |
class GlobalModuleRef; |
| 163 |
typedef GlobalModuleRef<_QERFuncTable_1> GlobalRadiantModuleRef; |
| 164 |
|
| 165 |
inline _QERFuncTable_1& GlobalRadiant(){ |
| 166 |
return GlobalRadiantModule::getTable(); |
| 167 |
} |
| 168 |
|
| 169 |
#endif |