Kodi Development  20.0
for Binary and Script based Add-Ons
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 ATTRIBUTE_HIDDEN Lock()
36 {
37  using namespace ::kodi::addon;
38  CAddonBase::m_interface->toKodi->kodi_gui->general->lock();
39 }
40 //------------------------------------------------------------------------------
41 
42 //==============================================================================
46 inline void ATTRIBUTE_HIDDEN Unlock()
47 {
48  using namespace ::kodi::addon;
49  CAddonBase::m_interface->toKodi->kodi_gui->general->unlock();
50 }
51 //------------------------------------------------------------------------------
52 
53 //==============================================================================
59 inline int ATTRIBUTE_HIDDEN GetScreenHeight()
60 {
61  using namespace ::kodi::addon;
62  return CAddonBase::m_interface->toKodi->kodi_gui->general->get_screen_height(
63  CAddonBase::m_interface->toKodi->kodiBase);
64 }
65 //------------------------------------------------------------------------------
66 
67 //==============================================================================
73 inline int ATTRIBUTE_HIDDEN GetScreenWidth()
74 {
75  using namespace ::kodi::addon;
76  return CAddonBase::m_interface->toKodi->kodi_gui->general->get_screen_width(
77  CAddonBase::m_interface->toKodi->kodiBase);
78 }
79 //------------------------------------------------------------------------------
80 
81 //==============================================================================
87 inline int ATTRIBUTE_HIDDEN GetVideoResolution()
88 {
89  using namespace ::kodi::addon;
90  return CAddonBase::m_interface->toKodi->kodi_gui->general->get_video_resolution(
91  CAddonBase::m_interface->toKodi->kodiBase);
92 }
93 //------------------------------------------------------------------------------
94 
95 //==============================================================================
111 inline int ATTRIBUTE_HIDDEN GetCurrentWindowDialogId()
112 {
113  using namespace ::kodi::addon;
114  return CAddonBase::m_interface->toKodi->kodi_gui->general->get_current_window_dialog_id(
115  CAddonBase::m_interface->toKodi->kodiBase);
116 }
117 //------------------------------------------------------------------------------
118 
119 //==============================================================================
135 inline int ATTRIBUTE_HIDDEN GetCurrentWindowId()
136 {
137  using namespace ::kodi::addon;
138  return CAddonBase::m_interface->toKodi->kodi_gui->general->get_current_window_id(
139  CAddonBase::m_interface->toKodi->kodiBase);
140 }
141 //------------------------------------------------------------------------------
142 
143 //==============================================================================
165 inline kodi::HardwareContext GetHWContext()
166 {
167  using namespace ::kodi::addon;
168  return CAddonBase::m_interface->toKodi->kodi_gui->general->get_hw_context(
169  CAddonBase::m_interface->toKodi->kodiBase);
170 }
171 //------------------------------------------------------------------------------
172 
173 } /* namespace gui */
174 } /* namespace kodi */
175 
176 #endif /* __cplusplus */
int ATTRIBUTE_HIDDEN GetCurrentWindowDialogId()
Returns the id for the current 'active' dialog as an integer.
Definition: General.h:111
void ATTRIBUTE_HIDDEN Unlock()
Performs a graphical unlock of previous locked rendering engine.
Definition: General.h:46
int ATTRIBUTE_HIDDEN GetScreenWidth()
Return the the current screen width with pixel.
Definition: General.h:73
int ATTRIBUTE_HIDDEN GetCurrentWindowId()
Returns the id for the current 'active' window as an integer.
Definition: General.h:135
int ATTRIBUTE_HIDDEN GetVideoResolution()
Return the the current screen rendering resolution.
Definition: General.h:87
void ATTRIBUTE_HIDDEN 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 ATTRIBUTE_HIDDEN GetScreenHeight()
Return the the current screen height with pixel.
Definition: General.h:59