xbmc
General.h
1 /*
2  * Copyright (C) 2005-2018 Team Kodi
3  * This file is part of Kodi - https://kodi.tv
4  *
5  * SPDX-License-Identifier: GPL-2.0-or-later
6  * See LICENSES/README.md for more information.
7  */
8 
9 #pragma once
10 
11 #include "../AddonBase.h"
12 #include "../c-api/gui/general.h"
13 
14 #ifdef __cplusplus
15 
16 namespace kodi
17 {
18 namespace gui
19 {
20 
21 //==============================================================================
30 
31 //==============================================================================
35 inline void ATTR_DLL_LOCAL Lock()
36 {
37  using namespace ::kodi::addon;
38  CPrivateBase::m_interface->toKodi->kodi_gui->general->lock();
39 }
40 //------------------------------------------------------------------------------
41 
42 //==============================================================================
46 inline void ATTR_DLL_LOCAL Unlock()
47 {
48  using namespace ::kodi::addon;
49  CPrivateBase::m_interface->toKodi->kodi_gui->general->unlock();
50 }
51 //------------------------------------------------------------------------------
52 
53 //==============================================================================
59 inline int ATTR_DLL_LOCAL GetScreenHeight()
60 {
61  using namespace ::kodi::addon;
62  return CPrivateBase::m_interface->toKodi->kodi_gui->general->get_screen_height(
63  CPrivateBase::m_interface->toKodi->kodiBase);
64 }
65 //------------------------------------------------------------------------------
66 
67 //==============================================================================
73 inline int ATTR_DLL_LOCAL GetScreenWidth()
74 {
75  using namespace ::kodi::addon;
76  return CPrivateBase::m_interface->toKodi->kodi_gui->general->get_screen_width(
77  CPrivateBase::m_interface->toKodi->kodiBase);
78 }
79 //------------------------------------------------------------------------------
80 
81 //==============================================================================
87 inline int ATTR_DLL_LOCAL GetVideoResolution()
88 {
89  using namespace ::kodi::addon;
90  return CPrivateBase::m_interface->toKodi->kodi_gui->general->get_video_resolution(
91  CPrivateBase::m_interface->toKodi->kodiBase);
92 }
93 //------------------------------------------------------------------------------
94 
95 //==============================================================================
111 inline int ATTR_DLL_LOCAL GetCurrentWindowDialogId()
112 {
113  using namespace ::kodi::addon;
114  return CPrivateBase::m_interface->toKodi->kodi_gui->general->get_current_window_dialog_id(
115  CPrivateBase::m_interface->toKodi->kodiBase);
116 }
117 //------------------------------------------------------------------------------
118 
119 //==============================================================================
135 inline int ATTR_DLL_LOCAL GetCurrentWindowId()
136 {
137  using namespace ::kodi::addon;
138  return CPrivateBase::m_interface->toKodi->kodi_gui->general->get_current_window_id(
139  CPrivateBase::m_interface->toKodi->kodiBase);
140 }
141 //------------------------------------------------------------------------------
142 
143 //==============================================================================
165 inline kodi::HardwareContext GetHWContext()
166 {
167  using namespace ::kodi::addon;
168  return CPrivateBase::m_interface->toKodi->kodi_gui->general->get_hw_context(
169  CPrivateBase::m_interface->toKodi->kodiBase);
170 }
171 //------------------------------------------------------------------------------
172 
173 //==============================================================================
179 inline AdjustRefreshRateStatus ATTR_DLL_LOCAL GetAdjustRefreshRateStatus()
180 {
181  using namespace ::kodi::addon;
182  return CPrivateBase::m_interface->toKodi->kodi_gui->general->get_adjust_refresh_rate_status(
183  CPrivateBase::m_interface->toKodi->kodiBase);
184 }
185 //------------------------------------------------------------------------------
186 
187 } /* namespace gui */
188 } /* namespace kodi */
189 
190 #endif /* __cplusplus */
AdjustRefreshRateStatus
Adjust refresh rate enum Used to get the Adjust refresh rate status info.
Definition: general.h:24