[PVR][Estuary] Timer settings dialog: Show client name in timer type selection dialog...
[xbmc.git] / xbmc / interfaces / legacy / swighelper.h
blob15a822c326f242984998c2196b4e448017726df6
1 /*
2 * Copyright (C) 2005-2018 Team Kodi
3 * This file is part of Kodi - https://kodi.tv
5 * SPDX-License-Identifier: GPL-2.0-or-later
6 * See LICENSES/README.md for more information.
7 */
9 #pragma once
11 /**
12 * SWIGHIDDENVIRTUAL allows the keyword 'virtual' to be there when the main
13 * Addon api is compiled, but be hidden from the SWIG code generator.
15 * This is to provide finer grain control over which methods are callbackable
16 * (is that a word? ...)
17 * into the scripting language, and which ones are not. True polymorphic
18 * behavior across the scripting language boundary will ONLY occur where
19 * the keyword 'virtual' is used. In other words, you can use the macro
20 * SWIGHIDDENVIRTUAL to 'hide' the polymorphic behavior from the scripting
21 * language using the macro instead.
23 * Note: You should not hide virtual destructors from the scripting language.
25 #ifdef SWIG
26 #define SWIGHIDDENVIRTUAL
27 #else
28 #define SWIGHIDDENVIRTUAL virtual
29 #endif
31 /**
32 * SWIG_CONSTANT_FROM_GETTER will define a constant in the scripting
33 * language from a getter in the Addon api and also provide the
34 * Addon api declaration. E.g. If you use:
36 * SWIG_CONSTANT_FROM_GETTER(int, MY_CONSTANT);
38 * ... in an Addon api header file then you need to define a function:
40 * int getMy_CONSTANT();
42 * ... in a .cpp file. That call will be made to determine the value
43 * of the constant in the scripting language.
45 #ifdef SWIG
46 #define SWIG_CONSTANT_FROM_GETTER(type,varname) %constant type varname = get##varname ()
47 #else
48 #define SWIG_CONSTANT_FROM_GETTER(type,varname) type get##varname ()
49 #endif
51 /**
52 * SWIG_CONSTANT defines a constant in SWIG from an already existing
53 * definition in the Addon api. E.g. a #define from the core window
54 * system like SORT_METHOD_PROGRAM_COUNT included in the api via
55 * a #include can be exposed to the scripting language using
56 * SWIG_CONSTANT(int,SORT_METHOD_PROGRAM_COUNT).
58 * This macro can be used when the constant name and the C++ reference
59 * look the same. When they look different see SWIG_CONSTANT2
61 * Note, this declaration is invisible to the API C++ code and can
62 * only be seen by the SWIG processor.
64 #ifdef SWIG
65 #define SWIG_CONSTANT(type,var) %constant type var = var
66 #else
67 #define SWIG_CONSTANT(type,var)
68 #endif
70 /**
71 * SWIG_CONSTANT2 defines a constant in SWIG from an already existing
72 * definition in the Addon api. E.g. a #define from the core window
73 * system like SORT_METHOD_VIDEO_YEAR included in the api via
74 * a #include can be exposed to the scripting language using
75 * SWIG_CONSTANT2(int,SORT_METHOD_VIDEO_YEAR,SORT_METHOD_YEAR).
77 * This macro can be used when the constant name and the C++ reference
78 * don't look the same. When they look the same see SWIG_CONSTANT
80 * Note, this declaration is invisible to the API C++ code and can
81 * only be seen by the SWIG processor.
83 #ifdef SWIG
84 #define SWIG_CONSTANT2(type,var,val) %constant type var = val
85 #else
86 #define SWIG_CONSTANT2(type,var,val)
87 #endif
89 /**
90 * SWIG_IMMUTABLE defines a member as immutable i.e. read-only.
92 * Note, this declaration is invisible to the API C++ code and can
93 * only be seen by the SWIG processor.
95 #ifdef SWIG
96 #define SWIG_IMMUTABLE(var) %feature("immutable"); var; %feature("immutable", "")
97 #else
98 #define SWIG_IMMUTABLE(var) var
99 #endif