1
/**************************************************************************/
3
/* Copyright (c) 2001, 2007 NoMachine, http://www.nomachine.com/. */
5
/* NXCOMPSHAD, NX protocol compression and NX extensions to this software */
6
/* are copyright of NoMachine. Redistribution and use of the present */
7
/* software is allowed according to terms specified in the file LICENSE */
8
/* which comes in the source distribution. */
10
/* Check http://www.nomachine.com/licensing.html for applicability. */
12
/* NX and NoMachine are trademarks of Medialogic S.p.A. */
14
/* All rights reserved. */
16
/**************************************************************************/
30
logTrace("Input::Input");
39
logTrace("Input::~Input");
41
Event *head = eventsHead_;
45
Event *next = head -> next;
55
logDebug("Input::~Input", "Delete keymap_ [%p].", keymap_);
61
void Input::pushEvent(Display *display, XEvent *event)
63
Event *tail = new Event;
67
logError("Input::pushEvent", ESET(ENOMEM));
73
tail -> display = display;
74
tail -> event = event;
76
if (eventsHead_ == NULL)
82
eventsTail_ -> next = tail;
88
XEvent *Input::popEvent()
90
Event *head = eventsHead_;
97
XEvent *event = head -> event;
99
eventsHead_ = head -> next;
103
if (eventsHead_ == NULL)
111
int Input::removeAllEvents(Display *display)
113
logTrace("Input::removeAllEvents");
117
Event *current = eventsHead_;
121
if (display == current -> display)
124
// Update head of list.
127
if (current == eventsHead_)
129
eventsHead_ = current -> next;
133
// Update tail of list.
136
if (current == eventsTail_)
138
eventsTail_ = eventsHead_;
140
while (eventsTail_ && eventsTail_ -> next)
142
eventsTail_ = eventsTail_ -> next;
150
Event *next = current -> next;
152
delete current -> event;
161
current = current -> next;