diff options
Diffstat (limited to 'src/emu/uiinput.h')
-rw-r--r-- | src/emu/uiinput.h | 27 |
1 files changed, 13 insertions, 14 deletions
diff --git a/src/emu/uiinput.h b/src/emu/uiinput.h index 85f4eb7cebd..17747fc9f98 100644 --- a/src/emu/uiinput.h +++ b/src/emu/uiinput.h @@ -26,7 +26,7 @@ struct ui_event { - enum type + enum class type { NONE, MOUSE_MOVE, @@ -60,37 +60,36 @@ public: void frame_update(); - /* pushes a single event onto the queue */ + // pushes a single event onto the queue bool push_event(ui_event event); - /* pops an event off of the queue */ + // pops an event off of the queue bool pop_event(ui_event *event); - /* check the next event type without removing it */ - ui_event::type peek_event_type() const { return (m_events_start != m_events_end) ? m_events[m_events_start].event_type : ui_event::NONE; } + // check the next event type without removing it + ui_event::type peek_event_type() const { return (m_events_start != m_events_end) ? m_events[m_events_start].event_type : ui_event::type::NONE; } - /* clears all outstanding events */ + // clears all outstanding events void reset(); - /* retrieves the current location of the mouse */ + // retrieves the current location of the mouse render_target *find_mouse(s32 *x, s32 *y, bool *button) const; ioport_field *find_mouse_field() const; - /* return true if a key down for the given user interface sequence is detected */ + // return true if a key down for the given user interface sequence is detected bool pressed(int code); // enable/disable UI key presses bool presses_enabled() const { return m_presses_enabled; } void set_presses_enabled(bool enabled) { m_presses_enabled = enabled; } - /* return true if a key down for the given user interface sequence is detected, or if - autorepeat at the given speed is triggered */ + // return true if a key down for the given user interface sequence is detected, or if autorepeat at the given speed is triggered bool pressed_repeat(int code, int speed); // getters running_machine &machine() const { return m_machine; } - + // queueing events void push_mouse_move_event(render_target* target, s32 x, s32 y); void push_mouse_leave_event(render_target* target); void push_mouse_down_event(render_target* target, s32 x, s32 y); @@ -108,19 +107,19 @@ private: // internal state running_machine & m_machine; // reference to our machine - /* pressed states; retrieved with ui_input_pressed() */ + // pressed states; retrieved with ui_input_pressed() bool m_presses_enabled; osd_ticks_t m_next_repeat[IPT_COUNT]; u8 m_seqpressed[IPT_COUNT]; - /* mouse position/info */ + // mouse position/info render_target * m_current_mouse_target; s32 m_current_mouse_x; s32 m_current_mouse_y; bool m_current_mouse_down; ioport_field * m_current_mouse_field; - /* popped states; ring buffer of ui_events */ + // popped states; ring buffer of ui_events ui_event m_events[EVENT_QUEUE_SIZE]; int m_events_start; int m_events_end; |