[cosmetic] cleanup copyright headers
[vuplus_xbmc] / xbmc / windowing / wayland / InputFactory.h
1 #pragma once
2
3 /*
4  *      Copyright (C) 2005-2013 Team XBMC
5  *      http://xbmc.org
6  *
7  *  This Program is free software; you can redistribute it and/or modify
8  *  it under the terms of the GNU General Public License as published by
9  *  the Free Software Foundation; either version 2, or (at your option)
10  *  any later version.
11  *
12  *  This Program is distributed in the hope that it will be useful,
13  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  *  GNU General Public License for more details.
16  *
17  *  You should have received a copy of the GNU General Public License
18  *  along with XBMC; see the file COPYING.  If not, see
19  *  <http://www.gnu.org/licenses/>.
20  *
21  */
22 #include <boost/scoped_ptr.hpp>
23
24 #include "CursorManager.h"
25 #include "Seat.h"
26 #include "Pointer.h"
27 #include "PointerProcessor.h"
28 #include "Keyboard.h"
29 #include "KeyboardProcessor.h"
30
31 class IDllWaylandClient;
32 class IDllXKBCommon;
33
34 struct wl_keyboard;
35 struct wl_pointer;
36 struct wl_seat;
37 struct wl_surface;
38
39 namespace xbmc
40 {
41 /* InputFactory is effectively just a manager class that encapsulates
42  * all input related information and ties together a wayland seat with
43  * the rest of the XBMC input handling subsystem. It is an internal
44  * class just for tying together these two ends. */
45 class InputFactory :
46   public wayland::IInputReceiver,
47   public ICursorManager
48 {
49 public:
50
51   InputFactory(IDllWaylandClient &clientLibrary,
52                IDllXKBCommon &xkbCommonLibrary,
53                struct wl_seat *seat,
54                IEventListener &dispatch,
55                ITimeoutManager &timeouts);
56
57   void SetXBMCSurface(struct wl_surface *s);
58
59 private:
60
61   void SetCursor(uint32_t serial,
62                  struct wl_surface *surface,
63                  double surfaceX,
64                  double surfaceY);
65
66   bool InsertPointer(struct wl_pointer *);
67   bool InsertKeyboard(struct wl_keyboard *);
68
69   void RemovePointer();
70   void RemoveKeyboard();
71
72   IDllWaylandClient &m_clientLibrary;
73   IDllXKBCommon &m_xkbCommonLibrary;
74
75   PointerProcessor m_pointerProcessor;
76   KeyboardProcessor m_keyboardProcessor;
77
78   boost::scoped_ptr<wayland::Seat> m_seat;
79   boost::scoped_ptr<wayland::Pointer> m_pointer;
80   boost::scoped_ptr<wayland::Keyboard> m_keyboard;
81 };
82 }