uploaded original spice-server-0.12.4 and celt-0.5.1.3
[sdk/emulator/libs/spice-server.git] / client / x11 / event_sources_p.h
1 /*
2    Copyright (C) 2009 Red Hat, Inc.
3
4    This library is free software; you can redistribute it and/or
5    modify it under the terms of the GNU Lesser General Public
6    License as published by the Free Software Foundation; either
7    version 2.1 of the License, or (at your option) any later version.
8
9    This library is distributed in the hope that it will be useful,
10    but WITHOUT ANY WARRANTY; without even the implied warranty of
11    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12    Lesser General Public License for more details.
13
14    You should have received a copy of the GNU Lesser General Public
15    License along with this library; if not, see <http://www.gnu.org/licenses/>.
16 */
17
18 #ifndef _H_EVENT_SOURCES_P
19 #define _H_EVENT_SOURCES_P
20
21 #include "common.h"
22 #include "threads.h"
23
24 #define INFINITE -1
25
26 class EventSource;
27
28 class EventSources_p {
29 protected:
30     void add_event(int fd, EventSource* source);
31     void remove_event(EventSource* source);
32
33 public:
34     std::vector<EventSource*> _events;
35     std::vector<int> _fds;
36 };
37
38 class Trigger_p {
39 public:
40     Trigger_p() : _pending_int (false) {}
41     int get_fd() { return _event_fd;}
42     bool reset_event();
43
44 public:
45     int _event_fd;
46     int _event_write_fd;
47     bool _pending_int;
48     Mutex _lock;
49 };
50
51 class Handle_p {
52 };
53
54 #endif