Kodi Development 22.0
for Binary and Script based Add-Ons
 
Loading...
Searching...
No Matches
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
16namespace kodi
17{
18namespace gui
19{
20
21//==============================================================================
30
31//==============================================================================
35inline void ATTR_DLL_LOCAL Lock()
36{
37 using namespace ::kodi::addon;
38 CPrivateBase::m_interface->toKodi->kodi_gui->general->lock();
39}
40//------------------------------------------------------------------------------
41
42//==============================================================================
46inline void ATTR_DLL_LOCAL Unlock()
47{
48 using namespace ::kodi::addon;
49 CPrivateBase::m_interface->toKodi->kodi_gui->general->unlock();
50}
51//------------------------------------------------------------------------------
52
53//==============================================================================
59inline 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//==============================================================================
73inline 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//==============================================================================
87inline 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//==============================================================================
111inline 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//==============================================================================
135inline 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//==============================================================================
165inline 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//==============================================================================
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 */
int ATTR_DLL_LOCAL GetVideoResolution()
Return the the current screen rendering resolution.
Definition General.h:87
AdjustRefreshRateStatus
Adjust refresh rate enum Used to get the Adjust refresh rate status info.
Definition general.h:25
int ATTR_DLL_LOCAL GetScreenHeight()
Return the the current screen height with pixel.
Definition General.h:59
void ATTR_DLL_LOCAL Lock()
Performs a graphical lock of rendering engine.
Definition General.h:35
kodi::HardwareContext GetHWContext()
To get hardware specific device context interface.
Definition General.h:165
int ATTR_DLL_LOCAL GetCurrentWindowDialogId()
Returns the id for the current 'active' dialog as an integer.
Definition General.h:111
int ATTR_DLL_LOCAL GetScreenWidth()
Return the the current screen width with pixel.
Definition General.h:73
int ATTR_DLL_LOCAL GetCurrentWindowId()
Returns the id for the current 'active' window as an integer.
Definition General.h:135
AdjustRefreshRateStatus ATTR_DLL_LOCAL GetAdjustRefreshRateStatus()
Get Adjust refresh rate setting status.
Definition General.h:179
void ATTR_DLL_LOCAL Unlock()
Performs a graphical unlock of previous locked rendering engine.
Definition General.h:46