blob: 2bf7de5c0e470131ab02187db04489a4b0dfa234 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
|
/*
* Copyright (C) 2005-2018 Team Kodi
* This file is part of Kodi - https://kodi.tv
*
* SPDX-License-Identifier: GPL-2.0-or-later
* See LICENSES/README.md for more information.
*/
#pragma once
/*
* addon.h
*
* Created on: Aug 21, 2010
* Author: jim
*/
//#define ENABLE_XBMC_TRACE_API
#include "threads/CriticalSection.h"
#include <memory>
#include <mutex>
#include <vector>
#ifdef TARGET_WINDOWS
#define __PRETTY_FUNCTION__ __FUNCTION__
#endif
/**
* This file contains the public definitions for the Addon api. It's meant to be used
* by those writing language bindings.
*/
namespace XBMCAddon
{
class LanguageHook;
}
namespace XBMCAddonUtils
{
class GuiLock
{
public:
GuiLock(XBMCAddon::LanguageHook* languageHook, bool offScreen);
~GuiLock();
protected:
XBMCAddon::LanguageHook* m_languageHook = nullptr;
bool m_offScreen = false;
};
class InvertSingleLockGuard
{
std::unique_lock<CCriticalSection>& lock;
public:
explicit InvertSingleLockGuard(std::unique_lock<CCriticalSection>& _lock) : lock(_lock)
{
lock.unlock();
}
~InvertSingleLockGuard() { lock.lock(); }
};
/*
* Looks in references.xml for image name
* If none exist return default image name
*/
const char *getDefaultImage(const char* cControlType, const char* cTextureType);
#ifdef ENABLE_XBMC_TRACE_API
class TraceGuard
{
const char* function;
public:
TraceGuard* parent;
int depth;
const char* getSpaces();
explicit TraceGuard(const char* _function);
TraceGuard();
~TraceGuard();
};
#endif
}
#ifdef ENABLE_XBMC_TRACE_API
#define XBMC_TRACE XBMCAddonUtils::TraceGuard _tg(__PRETTY_FUNCTION__)
#else
#define XBMC_TRACE
#endif
|