Twilight Princess
Decompilation of The Legend of Zelda: Twilight Princess
Loading...
Searching...
No Matches
JORMContext.h
Go to the documentation of this file.
1#ifndef JORMCONTEXT_H
2#define JORMCONTEXT_H
3
4#include <dolphin.h>
7
8#define MCTX_MSG_RESET 0
9#define MCTX_MSG_GET_ROOT_OBJ 2
10#define MCTX_MSG_GEN_OBJ_INFO 4
11#define MCTX_MSG_INVALID_NODE 5
12#define MCTX_MSG_UPDATE_NODE 8
13#define MCTX_MSG_FIO 9
14#define MCTX_MSG_OPEN_MESSAGE_BOX 10
15#define MCTX_MSG_START_NODE 12
16#define MCTX_MSG_GET_HOST_INFO 14
17#define MCTX_MSG_SHELL_EXEC 15
18
19#define MCTX_COMMAND_START_NODE (u32)0
20#define MCTX_COMMAND_END_NODE (u32)1
21#define MCTX_COMMAND_GEN_CONTROL (u32)2
22#define MCTX_COMMAND_GEN_NODE (u32)3
23#define MCTX_COMMAND_START_SELECTOR (u32)4
24#define MCTX_COMMAND_END_SELECTOR (u32)5
25#define MCTX_COMMAND_SELECTOR_ITEM (u32)6
26#define MCTX_COMMAND_INVALID_NODE (u32)7
27#define MCTX_COMMAND_UPDATE_CONTROL (u32)8
28
29#define DEFINE_GEN_CHECKBOX(T, kind) \
30 void genCheckBox(const char* label, T* pSrc, T mask, u32 style, JOREventListener* pListener, \
31 u16 posX, u16 posY, u16 width, u16 height) { \
32 genCheckBoxSub(kind, label, (u32)pSrc, style, *pSrc, mask, pListener, posX, posY, width, \
33 height); \
34 }
35
36#define DEFINE_GEN_CHECKBOX_ID(T, kind) \
37 void genCheckBoxID(const char* label, u32 id, T mask, T initValue, u32 style, \
38 JOREventListener* pListener, u16 posX, u16 posY, u16 width, u16 height) { \
39 genCheckBoxSub(kind, label, id, style, initValue, mask, pListener, posX, posY, width, \
40 height); \
41 }
42
43#define DEFINE_GEN_SLIDER(T, kind) \
44 void genSlider(const char* label, T* pSrc, T rangeMin, T rangeMax, u32 style, \
45 JOREventListener* pListener, u16 posX, u16 posY, u16 width, u16 height) { \
46 genSliderSub(kind, label, (u32)pSrc, style, *pSrc, rangeMin, rangeMax, pListener, posX, \
47 posY, width, height); \
48 }
49
50#define DEFINE_GEN_SLIDER_ID(T, kind) \
51 void genSliderID(const char* label, u32 id, T data, T rangeMin, T rangeMax, u32 style, \
52 JOREventListener* pListener, u16 posX, u16 posY, u16 width, u16 height) { \
53 genSliderSub(kind, label, id, style, data, rangeMin, rangeMax, pListener, posX, posY, \
54 width, height); \
55 }
56
57namespace jhostio {
58 enum EKind {
59 EKind_8B = 0x08,
60 EKind_16B = 0x10,
61 EKind_32B = 0x20,
62 };
63
64 inline u32 GetEKindSize(u32 param_0) { return param_0 & 0xFF; }
65}
66
67class JORReflexible;
68class JORFile;
70class JORHostInfo;
71
73public:
75
79 u8* msgPtr() { return mBuffer; }
80
81 void openFile(JORFile* pFile, u32 flags, const char* path, const char* extMask, u32 maskSize,
82 const char* defaultExt, const char* param_6, const char* fileSuffix);
83 void closeFile(JORFile* pFile);
84 void readBegin(JORFile* pFile, s32 size);
85 void readData(JORFile* pFile);
86 void writeBegin(JORFile* pFile, u16 flags, u32 size);
87 void writeData(JORFile* pFile, const void* pBuffer, s32 size, u32 position);
88 void writeDone(JORFile* pFile, u32 size);
89 void sendShellExecuteRequest(void*, const char*, const char*, const char*, const char*, int);
91 void endNode();
92
93 void genRootNode(const char* label, JORReflexible* obj, u32 param_2, u32 param_3) {
94 genNodeSub(label, obj, param_2, param_3);
95 }
96
97 void genNode(const char* label, JORReflexible* obj, u32 param_2, u32 param_3) {
99 genNodeSub(label, obj, param_2, param_3);
100 }
101
103 u32 param_4, u32 param_5) {
105 "JORMContext: genNode must specify strict( not null node ) parent object\n");
106
110 genNodeSub(label, obj, param_4, param_5);
111 }
112
114 u32 param_4, u32 param_5) {
116 113, parentObj != NULL,
117 "JORMContext: startNode must specify strict( not null node ) parent object\n");
118
122 genNodeSub(label, obj, param_4, param_5);
123 }
124
125 void startNode(const char* label, JORReflexible* obj, u32 param_2, u32 param_3) {
127 genNodeSub(label, obj, param_2, param_3);
128 }
129
130 void genNodeSub(const char* label, JORReflexible* i_node, u32, u32);
133
134 void genControl(u32 type, u32 kind, const char* label, u32 style, u32 id,
136
137 void genSliderSub(u32 kind, const char* label, u32 id, u32 style, s32 initValue, s32 rangeMin,
138 s32 rangeMax, JOREventListener* pListener, u16 posX, u16 posY, u16 width,
139 u16 height);
140
141 void genCheckBoxSub(u32 kind, const char* label, u32 id, u32 style, u16 initValue, u16 mask,
142 JOREventListener* pListener, u16 posX, u16 posY, u16 width, u16 height);
143
144 void startSelectorSub(u32 type, u32 kind, const char* label, u32 id, u32 style, s32 initValue,
145 JOREventListener* pListener, u16 posX, u16 posY, u16 width, u16 height);
146
147 void endSelectorSub();
148
149 void genSelectorItemSub(const char* label, s32 itemNo, u32 param_2, u16 posX, u16 posY,
150 u16 width, u16 height);
151
152 void genButton(const char* label, u32 id, u32 style, JOREventListener* pListener, u16 posX,
153 u16 posY, u16 width, u16 height);
154
155 void genLabel(const char* label, u32 id, u32 style, JOREventListener* pListener, u16 posX,
156 u16 posY, u16 width, u16 height);
157
158 void genGroupBox(const char* label, u32 id, u32 style, JOREventListener* pListener, u16 posX,
159 u16 posY, u16 width, u16 height);
160
161 void genEditBoxID(const char* label, u32 id, const char* string, u16 length, u32 style,
162 JOREventListener* pListener, u16 posX, u16 posY, u16 width, u16 height);
163
169
171
175 DEFINE_GEN_SLIDER(u8, 0x100 | jhostio::EKind_8B)
177 DEFINE_GEN_SLIDER(f32, JORPropertyEvent::EKind_FloatValue | jhostio::EKind_32B)
179
180 DEFINE_GEN_SLIDER_ID(f64, JORPropertyEvent::EKind_ValueID | JORPropertyEvent::EKind_FloatValue)
182
184 genSelectorItemSub(label, itemNo, 0, 0, 0, 0, 0);
185 }
186
187 void genRadioButtonItem(const char* label, s32 itemNo, u32 param_2, u16 posX, u16 posY,
188 u16 width, u16 height) {
189 genSelectorItemSub(label, itemNo, param_2, posX, posY, width, height);
190 }
191
192 void updateControl(u32 mode, u32 id, u32 param_2);
193 void updateControl(u32 mode, u32 id, const char* param_2);
194 void updateSliderSub(u32 mode, u32 id, s32 value, s32 rangeMin, s32 rangeMax,
195 u32 param_5);
196 void updateCheckBoxSub(u32 mode, u32 id, u16 value, u16 mask, u32 param_4);
197 void updateSelectorSub(u32 mode, u32 id, s32 value, u32 param_3);
198 void updateEditBoxID(u32 mode, u32 id, const char* string, u32 param_3, u16 length);
199 void editComboBoxItem(u32 param_0, u32 param_1, const char* param_2, s32 param_3, u32 param_4);
200
201 void openMessageBox(void* param_0, u32 style, const char* message, const char* title);
202
203 /* 0x00000 */ u8 mBuffer[0x10000];
205};
206
209
210#endif /* JORMCONTEXT_H */
void releaseJORMContext(JORMContext *)
JORMContext * attachJORMContext(u32)
@ JSUStreamSeekFrom_SET
Definition JSUIosBase.h:7
T cLib_calcTimer(T *value)
Definition c_lib.h:79
Definition JORReflexible.h:36
Definition JORFile.h:24
Definition JORHostInfo.h:10
Definition JORMContext.h:72
void genButton(const char *label, u32 id, u32 style, JOREventListener *pListener, u16 posX, u16 posY, u16 width, u16 height)
Definition JORServer.cpp:608
void updateCheckBoxSub(u32 mode, u32 id, u16 value, u16 mask, u32 param_4)
Definition JORServer.cpp:691
void sendHostInfoRequest(u32 requestType, JORHostInfo *pHostInfo)
Definition JORServer.cpp:812
DEFINE_GEN_CHECKBOX(u8, 0x100|jhostio::EKind_8B) DEFINE_GEN_CHECKBOX(u16
jhostio::EKind_16B jhostio::EKind_8B DEFINE_GEN_SLIDER(s16, jhostio::EKind_16B) DEFINE_GEN_SLIDER(f32
void genEditBoxID(const char *label, u32 id, const char *string, u16 length, u32 style, JOREventListener *pListener, u16 posX, u16 posY, u16 width, u16 height)
Definition JORServer.cpp:650
void genSelectorItemSub(const char *label, s32 itemNo, u32 param_2, u16 posX, u16 posY, u16 width, u16 height)
Definition JORServer.cpp:601
void genControl(u32 type, u32 kind, const char *label, u32 style, u32 id, JOREventListener *pListener, u32 initValue)
Definition JORServer.cpp:536
void putNode(JORReflexible *obj)
u8 * msgPtr()
Definition JORMContext.h:79
void bufInit()
Definition JORMContext.h:76
jhostio::EKind_16B DEFINE_GEN_CHECKBOX_ID(u16, JORPropertyEvent::EKind_ValueID|0x100) DEFINE_GEN_SLIDER(u8
void updateEditBoxID(u32 mode, u32 id, const char *string, u32 param_3, u16 length)
Definition JORServer.cpp:711
s32 msgSize()
Definition JORMContext.h:78
void updateSliderSub(u32 mode, u32 id, s32 value, s32 rangeMin, s32 rangeMax, u32 param_5)
Definition JORServer.cpp:679
void genSliderSub(u32 kind, const char *label, u32 id, u32 style, s32 initValue, s32 rangeMin, s32 rangeMax, JOREventListener *pListener, u16 posX, u16 posY, u16 width, u16 height)
Definition JORServer.cpp:554
u8 mBuffer[0x10000]
Definition JORMContext.h:203
void genNodeSub(const char *label, JORReflexible *i_node, u32, u32)
Definition JORServer.cpp:514
void sendShellExecuteRequest(void *, const char *, const char *, const char *, const char *, int)
Definition JORServer.cpp:816
void invalidNode(JORReflexible *i_node, u32)
Definition JORServer.cpp:529
void openFile(JORFile *pFile, u32 flags, const char *path, const char *extMask, u32 maskSize, const char *defaultExt, const char *param_6, const char *fileSuffix)
Definition JORServer.cpp:729
void endNode()
Definition JORServer.cpp:525
void readData(JORFile *pFile)
Definition JORServer.cpp:773
void startSelectorSub(u32 type, u32 kind, const char *label, u32 id, u32 style, s32 initValue, JOREventListener *pListener, u16 posX, u16 posY, u16 width, u16 height)
Definition JORServer.cpp:583
void genRadioButtonItem(const char *label, s32 itemNo, u32 param_2, u16 posX, u16 posY, u16 width, u16 height)
Definition JORMContext.h:187
jhostio::EKind_16B jhostio::EKind_8B JORPropertyEvent::EKind_FloatValue jhostio::EKind_32B JORPropertyEvent::EKind_ValueID JORPropertyEvent::EKind_FloatValue s32 itemNo
Definition JORMContext.h:183
void writeDone(JORFile *pFile, u32 size)
Definition JORServer.cpp:800
void genNode(const char *label, JORReflexible *obj, u32 param_2, u32 param_3)
Definition JORMContext.h:97
void genRootNode(const char *label, JORReflexible *obj, u32 param_2, u32 param_3)
Definition JORMContext.h:93
void editComboBoxItem(u32 param_0, u32 param_1, const char *param_2, s32 param_3, u32 param_4)
Definition JORServer.cpp:723
void endSelectorSub()
Definition JORServer.cpp:597
jhostio::EKind_16B jhostio::EKind_8B JORPropertyEvent::EKind_FloatValue jhostio::EKind_32B JORPropertyEvent::EKind_ValueID JORPropertyEvent::EKind_FloatValue DEFINE_GEN_SLIDER_ID(int, JORPropertyEvent::EKind_ValueID) void genComboBoxItem(const char *label
void openMessageBox(void *param_0, u32 style, const char *message, const char *title)
Definition JORServer.cpp:808
void readBegin(JORFile *pFile, s32 size)
Definition JORServer.cpp:765
void closeFile(JORFile *pFile)
Definition JORServer.cpp:761
void writeBegin(JORFile *pFile, u16 flags, u32 size)
Definition JORServer.cpp:780
void genNode(JORReflexible *parentObj, u32 param_1, const char *label, JORReflexible *obj, u32 param_4, u32 param_5)
Definition JORMContext.h:102
void genLabel(const char *label, u32 id, u32 style, JOREventListener *pListener, u16 posX, u16 posY, u16 width, u16 height)
Definition JORServer.cpp:622
JORMContext()
Definition JORMContext.h:74
void putMsgID(u32 msgID)
Definition JORMContext.h:77
JSUMemoryOutputStream mOutputStream
Definition JORMContext.h:204
void startNode(JORReflexible *parentObj, u32 param_1, const char *label, JORReflexible *obj, u32 param_4, u32 param_5)
Definition JORMContext.h:113
void genGroupBox(const char *label, u32 id, u32 style, JOREventListener *pListener, u16 posX, u16 posY, u16 width, u16 height)
Definition JORServer.cpp:636
void genCheckBoxSub(u32 kind, const char *label, u32 id, u32 style, u16 initValue, u16 mask, JOREventListener *pListener, u16 posX, u16 posY, u16 width, u16 height)
Definition JORServer.cpp:569
void writeData(JORFile *pFile, const void *pBuffer, s32 size, u32 position)
Definition JORServer.cpp:789
void updateControl(u32 mode, u32 id, u32 param_2)
Definition JORServer.cpp:665
void startNode(const char *label, JORReflexible *obj, u32 param_2, u32 param_3)
Definition JORMContext.h:125
void updateSelectorSub(u32 mode, u32 id, s32 value, u32 param_3)
Definition JORServer.cpp:703
Definition JORReflexible.h:41
Definition JSUMemoryStream.h:32
virtual s32 seek(s32, JSUStreamSeekFrom)
virtual s32 getPosition() const
Definition JORMContext.h:57
EKind
Definition JORMContext.h:58
@ EKind_32B
Definition JORMContext.h:61
@ EKind_16B
Definition JORMContext.h:60
@ EKind_8B
Definition JORMContext.h:59
u32 GetEKindSize(u32 param_0)
Definition JORMContext.h:64
Definition JORReflexible.h:10
unsigned long u32
Definition types.h:10
float f32
Definition types.h:22
signed short s16
Definition types.h:5
double f64
Definition types.h:23
unsigned short u16
Definition types.h:9
signed long s32
Definition types.h:6
unsigned char u8
Definition types.h:8
static u32 message
Definition vi.c:838