Commit f67fcbc1 authored by hybrid's avatar hybrid

Named the event structs. Fixed a warning with endif comments.

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@817 dfc29bdd-3216-0410-991c-e03cc46cb475
parent 001e09d0
...@@ -139,78 +139,82 @@ namespace irr ...@@ -139,78 +139,82 @@ namespace irr
//! SEvents hold information about an event. //! SEvents hold information about an event.
struct SEvent struct SEvent
{ {
EEVENT_TYPE EventType; struct SGUIEvent
union
{ {
struct //! IGUIElement who called the event
{ gui::IGUIElement* Caller;
//! IGUIElement who called the event
gui::IGUIElement* Caller;
//! If the event has something to do with another element, it will be held here. //! If the event has something to do with another element, it will be held here.
gui::IGUIElement* Element; gui::IGUIElement* Element;
//! Type of GUI Event //! Type of GUI Event
gui::EGUI_EVENT_TYPE EventType; gui::EGUI_EVENT_TYPE EventType;
} GUIEvent; };
struct struct SMouseInput
{ {
//! X position of mouse cursor //! X position of mouse cursor
s32 X; s32 X;
//! Y position of mouse cursor //! Y position of mouse cursor
s32 Y; s32 Y;
//! mouse wheel delta, usually 1.0 or -1.0. //! mouse wheel delta, usually 1.0 or -1.0.
/** Only valid if event was EMIE_MOUSE_WHEEL */ /** Only valid if event was EMIE_MOUSE_WHEEL */
f32 Wheel; f32 Wheel;
//! type of mouse event //! type of mouse event
EMOUSE_INPUT_EVENT Event; EMOUSE_INPUT_EVENT Event;
} MouseInput; };
struct struct SKeyInput
{ {
//! Character corresponding to the key (0, if not a character) //! Character corresponding to the key (0, if not a character)
wchar_t Char; wchar_t Char;
//! Key which has been pressed or released //! Key which has been pressed or released
EKEY_CODE Key; EKEY_CODE Key;
//! if not pressed, then the key was left up //! if not pressed, then the key was left up
bool PressedDown; bool PressedDown;
//! true if shift was also pressed //! true if shift was also pressed
bool Shift; bool Shift;
//! true if ctrl was also pressed //! true if ctrl was also pressed
bool Control; bool Control;
} KeyInput; };
struct struct SLogEvent
{ {
//! pointer to text which has been logged //! pointer to text which has been logged
const c8* Text; const c8* Text;
//! log level in which the text has been logged //! log level in which the text has been logged
ELOG_LEVEL Level; ELOG_LEVEL Level;
} LogEvent; };
struct struct SUserEvent
{ {
//! Some user specified data as int //! Some user specified data as int
s32 UserData1; s32 UserData1;
//! Another user specified data as int //! Another user specified data as int
s32 UserData2; s32 UserData2;
//! Some user specified data as float //! Some user specified data as float
f32 UserData3; f32 UserData3;
} UserEvent; };
EEVENT_TYPE EventType;
union
{
struct SGUIEvent GUIEvent;
struct SMouseInput MouseInput;
struct SKeyInput KeyInput;
struct SLogEvent LogEvent;
struct SUserEvent UserEvent;
}; };
}; };
......
...@@ -1059,7 +1059,7 @@ u8 BuiltInFontData[] = ...@@ -1059,7 +1059,7 @@ u8 BuiltInFontData[] =
} // end namespace gui } // end namespace gui
} // end namespace irr } // end namespace irr
#endif _IRR_COMPILE_WITH_GUI_ #endif // _IRR_COMPILE_WITH_GUI_
#endif #endif
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment