17 INLINE MouseWatcherParameter::
18 MouseWatcherParameter() {
26 INLINE MouseWatcherParameter::
28 _button(copy._button),
29 _keycode(copy._keycode),
39 INLINE
void MouseWatcherParameter::
41 _button = copy._button;
42 _keycode = copy._keycode;
51 INLINE MouseWatcherParameter::
52 ~MouseWatcherParameter() {
61 _flags |= F_has_button;
72 _flags |= F_is_keyrepeat;
74 _flags &= ~F_is_keyrepeat;
84 _flags |= F_has_keycode;
92 size_t highlight_start,
size_t highlight_end,
94 _candidate_string = candidate_string;
95 _highlight_start = highlight_start;
96 _highlight_end = highlight_end;
97 _cursor_pos = cursor_pos;
98 _flags |= F_has_candidate;
117 _flags |= F_has_mouse;
128 _flags |= F_is_outside;
130 _flags &= ~F_is_outside;
140 return (_flags & F_has_button) != 0;
158 return (_flags & F_is_keyrepeat) != 0;
166 return (_flags & F_has_keycode) != 0;
184 return (_flags & F_has_candidate) != 0;
193 return _candidate_string;
219 return _highlight_start;
228 return _highlight_end;
254 return (_flags & F_has_mouse) != 0;
274 return (_flags & F_is_outside) != 0;
277 INLINE std::ostream &
std::string get_candidate_string_encoded() const
Returns the candidate string associated with this event.
bool has_mouse() const
Returns true if this parameter has an associated mouse position, false otherwise.
void set_modifier_buttons(const ModifierButtons &mods)
Sets the modifier buttons that were being held while this event was generated.
const ModifierButtons & get_modifier_buttons() const
Returns the set of modifier buttons that were being held down while the event was generated.
int get_keycode() const
Returns the keycode associated with this event.
void set_button(const ButtonHandle &button)
Sets the mouse or keyboard button that generated this event, if any.
bool is_outside() const
Returns true if the mouse was outside the region at the time the event was generated,...
void set_keyrepeat(bool flag)
Sets the state of the "keyrepeat" flag.
bool is_keyrepeat() const
Returns true if the button-down even was generated due to keyrepeat, or false if it was an original b...
bool has_button() const
Returns true if this parameter has an associated mouse or keyboard button, false otherwise.
ButtonHandle get_button() const
Returns the mouse or keyboard button associated with this event.
void set_mouse(const LPoint2 &mouse)
Sets the mouse position that was current at the time the event was generated.
const LPoint2 & get_mouse() const
Returns the mouse position at the time the event was generated, in the normalized range (-1 .
size_t get_cursor_pos() const
Returns the position of the user's edit cursor within the candidate string.
void set_keycode(int keycode)
Sets the keycode associated with this event, if any.
std::string encode_wtext(const std::wstring &wtext) const
Encodes a wide-text string into a single-char string, according to the current encoding.
bool has_candidate() const
Returns true if this parameter has an associated candidate string, false otherwise.
void set_outside(bool flag)
Sets the state of the "outside" flag.
size_t get_highlight_start() const
Returns the first highlighted character in the candidate string.
This is sent along as a parameter to most events generated for a region to indicate the mouse and but...
void set_candidate(const std::wstring &candidate_string, size_t highlight_start, size_t higlight_end, size_t cursor_pos)
Sets the candidate string associated with this event, if any.
size_t get_highlight_end() const
Returns one more than the last highlighted character in the candidate string.
const std::wstring & get_candidate_string() const
Returns the candidate string associated with this event.
bool has_keycode() const
Returns true if this parameter has an associated keycode, false otherwise.