Added initial support for displaying on Wayland compositors.
[vuplus_xbmc] / xbmc / windowing / egl / wayland / WaylandLibraries.cpp
1 /*
2  *      Copyright (C) 2011-2013 Team XBMC
3  *      http://www.xbmc.org
4  *
5  *  This Program is free software; you can redistribute it and/or modify
6  *  it under the terms of the GNU General Public License as published by
7  *  the Free Software Foundation; either version 2, or (at your option)
8  *  any later version.
9  *
10  *  This Program is distributed in the hope that it will be useful,
11  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  *  GNU General Public License for more details.
14  *
15  *  You should have received a copy of the GNU General Public License
16  *  along with XBMC; see the file COPYING.  If not, see
17  *  <http://www.gnu.org/licenses/>.
18  *
19  */
20 #include <sstream>
21 #include <stdexcept>
22
23 #include <wayland-client.h>
24 #include "WaylandLibraries.h"
25
26 namespace xw = xbmc::wayland;
27
28 void
29 xw::LoadLibrary(DllDynamic &dll)
30 {
31   if (!dll.Load())
32   {
33     std::stringstream ss;
34     ss << "Failed to load library "
35        << dll.GetFile().c_str();
36
37     throw std::runtime_error(ss.str());
38   }
39 }
40
41 IDllWaylandClient &
42 xw::Libraries::ClientLibrary()
43 {
44   return m_clientLibrary.Get();
45 }
46
47 IDllWaylandEGL &
48 xw::Libraries::EGLLibrary()
49 {
50   return m_eglLibrary.Get();
51 }
52
53 IDllXKBCommon &
54 xw::Libraries::XKBCommonLibrary()
55 {
56   return m_xkbCommonLibrary.Get();
57 }