|
@@ -94,7 +94,7 @@ pointer_and_keyboard(GraphicsWindow *host, const string &name) {
|
|
|
// Description:
|
|
// Description:
|
|
|
////////////////////////////////////////////////////////////////////
|
|
////////////////////////////////////////////////////////////////////
|
|
|
GraphicsWindowInputDevice::
|
|
GraphicsWindowInputDevice::
|
|
|
-GraphicsWindowInputDevice(const GraphicsWindowInputDevice ©)
|
|
|
|
|
|
|
+GraphicsWindowInputDevice(const GraphicsWindowInputDevice ©)
|
|
|
{
|
|
{
|
|
|
*this = copy;
|
|
*this = copy;
|
|
|
}
|
|
}
|
|
@@ -105,7 +105,7 @@ GraphicsWindowInputDevice(const GraphicsWindowInputDevice ©)
|
|
|
// Description:
|
|
// Description:
|
|
|
////////////////////////////////////////////////////////////////////
|
|
////////////////////////////////////////////////////////////////////
|
|
|
void GraphicsWindowInputDevice::
|
|
void GraphicsWindowInputDevice::
|
|
|
-operator = (const GraphicsWindowInputDevice ©)
|
|
|
|
|
|
|
+operator = (const GraphicsWindowInputDevice ©)
|
|
|
{
|
|
{
|
|
|
LightMutexHolder holder(_lock);
|
|
LightMutexHolder holder(_lock);
|
|
|
LightMutexHolder holder1(copy._lock);
|
|
LightMutexHolder holder1(copy._lock);
|
|
@@ -165,7 +165,7 @@ get_button_event() {
|
|
|
// Function: GraphicsWindowInputDevice::has_pointer_event
|
|
// Function: GraphicsWindowInputDevice::has_pointer_event
|
|
|
// Access: Public
|
|
// Access: Public
|
|
|
// Description: Returns true if this device has a pending pointer
|
|
// Description: Returns true if this device has a pending pointer
|
|
|
-// event (a mouse movement), or false otherwise. If
|
|
|
|
|
|
|
+// event (a mouse movement), or false otherwise. If
|
|
|
// this returns true, the particular event may be
|
|
// this returns true, the particular event may be
|
|
|
// extracted via get_pointer_event().
|
|
// extracted via get_pointer_event().
|
|
|
////////////////////////////////////////////////////////////////////
|
|
////////////////////////////////////////////////////////////////////
|
|
@@ -234,7 +234,7 @@ disable_pointer_mode() {
|
|
|
|
|
|
|
|
////////////////////////////////////////////////////////////////////
|
|
////////////////////////////////////////////////////////////////////
|
|
|
// Function: GraphicsWindowInputDevice::set_pointer
|
|
// Function: GraphicsWindowInputDevice::set_pointer
|
|
|
-// Access: Public
|
|
|
|
|
|
|
+// Access: Published
|
|
|
// Description: Records that a mouse movement has taken place.
|
|
// Description: Records that a mouse movement has taken place.
|
|
|
////////////////////////////////////////////////////////////////////
|
|
////////////////////////////////////////////////////////////////////
|
|
|
void GraphicsWindowInputDevice::
|
|
void GraphicsWindowInputDevice::
|
|
@@ -264,7 +264,7 @@ set_pointer(bool inwin, double x, double y, double time) {
|
|
|
} else {
|
|
} else {
|
|
|
_mouse_data = _true_mouse_data;
|
|
_mouse_data = _true_mouse_data;
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
if (_enable_pointer_events) {
|
|
if (_enable_pointer_events) {
|
|
|
int seq = _event_sequence++;
|
|
int seq = _event_sequence++;
|
|
|
if (_pointer_events == 0) {
|
|
if (_pointer_events == 0) {
|
|
@@ -279,7 +279,7 @@ set_pointer(bool inwin, double x, double y, double time) {
|
|
|
|
|
|
|
|
////////////////////////////////////////////////////////////////////
|
|
////////////////////////////////////////////////////////////////////
|
|
|
// Function: GraphicsWindowInputDevice::button_down
|
|
// Function: GraphicsWindowInputDevice::button_down
|
|
|
-// Access: Public
|
|
|
|
|
|
|
+// Access: Published
|
|
|
// Description: Records that the indicated button has been depressed.
|
|
// Description: Records that the indicated button has been depressed.
|
|
|
////////////////////////////////////////////////////////////////////
|
|
////////////////////////////////////////////////////////////////////
|
|
|
void GraphicsWindowInputDevice::
|
|
void GraphicsWindowInputDevice::
|
|
@@ -291,7 +291,7 @@ button_down(ButtonHandle button, double time) {
|
|
|
|
|
|
|
|
////////////////////////////////////////////////////////////////////
|
|
////////////////////////////////////////////////////////////////////
|
|
|
// Function: GraphicsWindowInputDevice::button_resume_down
|
|
// Function: GraphicsWindowInputDevice::button_resume_down
|
|
|
-// Access: Public
|
|
|
|
|
|
|
+// Access: Published
|
|
|
// Description: Records that the indicated button was depressed
|
|
// Description: Records that the indicated button was depressed
|
|
|
// earlier, and we only just detected the event after
|
|
// earlier, and we only just detected the event after
|
|
|
// the fact. This is mainly useful for tracking the
|
|
// the fact. This is mainly useful for tracking the
|
|
@@ -300,14 +300,13 @@ button_down(ButtonHandle button, double time) {
|
|
|
void GraphicsWindowInputDevice::
|
|
void GraphicsWindowInputDevice::
|
|
|
button_resume_down(ButtonHandle button, double time) {
|
|
button_resume_down(ButtonHandle button, double time) {
|
|
|
LightMutexHolder holder(_lock);
|
|
LightMutexHolder holder(_lock);
|
|
|
- _button_events.push_back(ButtonEvent(button, ButtonEvent::T_resume_down, time)
|
|
|
|
|
-);
|
|
|
|
|
|
|
+ _button_events.push_back(ButtonEvent(button, ButtonEvent::T_resume_down, time));
|
|
|
_buttons_held.insert(button);
|
|
_buttons_held.insert(button);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
////////////////////////////////////////////////////////////////////
|
|
////////////////////////////////////////////////////////////////////
|
|
|
// Function: GraphicsWindowInputDevice::button_up
|
|
// Function: GraphicsWindowInputDevice::button_up
|
|
|
-// Access: Public
|
|
|
|
|
|
|
+// Access: Published
|
|
|
// Description: Records that the indicated button has been released.
|
|
// Description: Records that the indicated button has been released.
|
|
|
////////////////////////////////////////////////////////////////////
|
|
////////////////////////////////////////////////////////////////////
|
|
|
void GraphicsWindowInputDevice::
|
|
void GraphicsWindowInputDevice::
|
|
@@ -319,7 +318,7 @@ button_up(ButtonHandle button, double time) {
|
|
|
|
|
|
|
|
////////////////////////////////////////////////////////////////////
|
|
////////////////////////////////////////////////////////////////////
|
|
|
// Function: GraphicsWindowInputDevice::keystroke
|
|
// Function: GraphicsWindowInputDevice::keystroke
|
|
|
-// Access: Public
|
|
|
|
|
|
|
+// Access: Published
|
|
|
// Description: Records that the indicated keystroke has been
|
|
// Description: Records that the indicated keystroke has been
|
|
|
// generated.
|
|
// generated.
|
|
|
////////////////////////////////////////////////////////////////////
|
|
////////////////////////////////////////////////////////////////////
|
|
@@ -331,24 +330,24 @@ keystroke(int keycode, double time) {
|
|
|
|
|
|
|
|
////////////////////////////////////////////////////////////////////
|
|
////////////////////////////////////////////////////////////////////
|
|
|
// Function: GraphicsWindowInputDevice::candidate
|
|
// Function: GraphicsWindowInputDevice::candidate
|
|
|
-// Access: Public
|
|
|
|
|
|
|
+// Access: Published
|
|
|
// Description: Records that the indicated candidate string has been
|
|
// Description: Records that the indicated candidate string has been
|
|
|
// highlighted. This is used to implement IME support
|
|
// highlighted. This is used to implement IME support
|
|
|
// for typing in international languages, especially
|
|
// for typing in international languages, especially
|
|
|
// Chinese/Japanese/Korean.
|
|
// Chinese/Japanese/Korean.
|
|
|
////////////////////////////////////////////////////////////////////
|
|
////////////////////////////////////////////////////////////////////
|
|
|
void GraphicsWindowInputDevice::
|
|
void GraphicsWindowInputDevice::
|
|
|
-candidate(const wstring &candidate_string, size_t highlight_start,
|
|
|
|
|
|
|
+candidate(const wstring &candidate_string, size_t highlight_start,
|
|
|
size_t highlight_end, size_t cursor_pos) {
|
|
size_t highlight_end, size_t cursor_pos) {
|
|
|
LightMutexHolder holder(_lock);
|
|
LightMutexHolder holder(_lock);
|
|
|
- _button_events.push_back(ButtonEvent(candidate_string,
|
|
|
|
|
|
|
+ _button_events.push_back(ButtonEvent(candidate_string,
|
|
|
highlight_start, highlight_end,
|
|
highlight_start, highlight_end,
|
|
|
cursor_pos));
|
|
cursor_pos));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
////////////////////////////////////////////////////////////////////
|
|
////////////////////////////////////////////////////////////////////
|
|
|
// Function: GraphicsWindowInputDevice::focus_lost
|
|
// Function: GraphicsWindowInputDevice::focus_lost
|
|
|
-// Access: Public
|
|
|
|
|
|
|
+// Access: Published
|
|
|
// Description: This should be called when the window focus is lost,
|
|
// Description: This should be called when the window focus is lost,
|
|
|
// so that we may miss upcoming button events
|
|
// so that we may miss upcoming button events
|
|
|
// (especially "up" events) for the next period of time.
|
|
// (especially "up" events) for the next period of time.
|
|
@@ -369,7 +368,7 @@ focus_lost(double time) {
|
|
|
|
|
|
|
|
////////////////////////////////////////////////////////////////////
|
|
////////////////////////////////////////////////////////////////////
|
|
|
// Function: GraphicsWindowInputDevice::raw_button_down
|
|
// Function: GraphicsWindowInputDevice::raw_button_down
|
|
|
-// Access: Public
|
|
|
|
|
|
|
+// Access: Published
|
|
|
// Description: Records that the indicated button has been depressed.
|
|
// Description: Records that the indicated button has been depressed.
|
|
|
////////////////////////////////////////////////////////////////////
|
|
////////////////////////////////////////////////////////////////////
|
|
|
void GraphicsWindowInputDevice::
|
|
void GraphicsWindowInputDevice::
|
|
@@ -380,7 +379,7 @@ raw_button_down(ButtonHandle button, double time) {
|
|
|
|
|
|
|
|
////////////////////////////////////////////////////////////////////
|
|
////////////////////////////////////////////////////////////////////
|
|
|
// Function: GraphicsWindowInputDevice::raw_button_up
|
|
// Function: GraphicsWindowInputDevice::raw_button_up
|
|
|
-// Access: Public
|
|
|
|
|
|
|
+// Access: Published
|
|
|
// Description: Records that the indicated button has been released.
|
|
// Description: Records that the indicated button has been released.
|
|
|
////////////////////////////////////////////////////////////////////
|
|
////////////////////////////////////////////////////////////////////
|
|
|
void GraphicsWindowInputDevice::
|
|
void GraphicsWindowInputDevice::
|