summaryrefslogtreecommitdiffstats
path: root/src/common/event.h
diff options
context:
space:
mode:
authorPiotr Dziwinski <piotrdz@gmail.com>2012-07-29 15:09:53 +0200
committerPiotr Dziwinski <piotrdz@gmail.com>2012-07-29 15:09:53 +0200
commit7c5a3514dd6e907866bddcbb09b4d9cbd958dd8e (patch)
tree00aaece75d43bd35a3997bf4eacdfd103d29d5c7 /src/common/event.h
parent72c0188ec37c3783133baf6960d72cb3c9d12a6c (diff)
downloadcolobot-7c5a3514dd6e907866bddcbb09b4d9cbd958dd8e.tar.gz
colobot-7c5a3514dd6e907866bddcbb09b4d9cbd958dd8e.tar.bz2
colobot-7c5a3514dd6e907866bddcbb09b4d9cbd958dd8e.zip
Video mode changing
- added video mode querying & changing - added joystick querying & changing - cleaned up CApplication interface
Diffstat (limited to 'src/common/event.h')
-rw-r--r--src/common/event.h33
1 files changed, 31 insertions, 2 deletions
diff --git a/src/common/event.h b/src/common/event.h
index 6ce1a79..0d9aa7c 100644
--- a/src/common/event.h
+++ b/src/common/event.h
@@ -55,6 +55,9 @@ enum EventType
//! Event sent after releasing a key
EVENT_KEY_UP = 9,
+ //! Event sent when application window loses/gains focus
+ EVENT_ACTIVE = 10,
+
//? EVENT_CHAR = 10,
//? EVENT_FOCUS = 11,
@@ -608,7 +611,7 @@ struct JoyAxisEventData
};
/** \struct JoyButtonEventData
- \brief Joystick button event structure */
+ \brief Additional data for joystick button event */
struct JoyButtonEventData
{
//! The joystick button index
@@ -620,7 +623,31 @@ struct JoyButtonEventData
: button(0), state(STATE_PRESSED) {}
};
-// TODO: JoyHatEventData? JoyBallEventData?
+/** \enum ActiveEventFlags
+ \brief Type of focus gained/lost */
+enum ActiveEventFlags
+{
+ //! Application window focus
+ ACTIVE_APP = 0x01,
+ //! Input focus
+ ACTIVE_INPUT = 0x02,
+ //! Mouse focus
+ ACTIVE_MOUSE = 0x04
+
+};
+
+/** \struct ActiveEventData
+ \brief Additional data for active event */
+struct ActiveEventData
+{
+ //! Flags (bitmask of enum values ActiveEventFlags)
+ unsigned char flags = 0;
+ //! True if the focus was gained; false otherwise
+ bool gain;
+
+ ActiveEventData()
+ : flags(0), gain(false) {}
+};
/**
@@ -652,6 +679,8 @@ struct Event
JoyAxisEventData joyAxis;
//! Additional data for EVENT_JOY_AXIS
JoyButtonEventData joyButton;
+ //! Additional data for EVENT_ACTIVE
+ ActiveEventData active;
//? long param; // parameter
//? Math::Point pos; // mouse position (0 .. 1)