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.
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.
26 #define SWIGHIDDENVIRTUAL
28 #define SWIGHIDDENVIRTUAL virtual
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.
46 #define SWIG_CONSTANT_FROM_GETTER(type,varname) %constant type varname = get##varname ()
48 #define SWIG_CONSTANT_FROM_GETTER(type,varname) type get##varname ()
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.
65 #define SWIG_CONSTANT(type,var) %constant type var = var
67 #define SWIG_CONSTANT(type,var)
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.
84 #define SWIG_CONSTANT2(type,var,val) %constant type var = val
86 #define SWIG_CONSTANT2(type,var,val)
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.
96 #define SWIG_IMMUTABLE(var) %feature("immutable"); var; %feature("immutable", "")
98 #define SWIG_IMMUTABLE(var) var