-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathgroup__cpp__kodi__addon__screensaver.html
473 lines (454 loc) · 30.4 KB
/
group__cpp__kodi__addon__screensaver.html
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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.9.1"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Kodi Development: Screensaver</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */
$(document).ready(function() { init_search(); });
/* @license-end */
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectlogo"><img alt="Logo" src="kodi-dev.png"/></td>
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">Kodi Development
 <span id="projectnumber">20.0</span>
</div>
<div id="projectbrief">for Binary and Script based Add-Ons</div>
</td>
<td> <div id="MSearchBox" class="MSearchBoxInactive">
<span class="left">
<img id="MSearchSelect" src="search/mag_sel.svg"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
alt=""/>
<input type="text" id="MSearchField" value="Search" accesskey="S"
onfocus="searchBox.OnSearchFieldFocus(true)"
onblur="searchBox.OnSearchFieldFocus(false)"
onkeyup="searchBox.OnSearchFieldChange(event)"/>
</span><span class="right">
<a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.svg" alt=""/></a>
</span>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.1 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search','.html');
/* @license-end */
</script>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
<div id="nav-tree">
<div id="nav-tree-contents">
<div id="nav-sync" class="sync"></div>
</div>
</div>
<div id="splitbar" style="-moz-user-select:none;"
class="ui-resizable-handle">
</div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */
$(document).ready(function(){initNavTree('group__cpp__kodi__addon__screensaver.html',''); initResizable(); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<div class="header">
<div class="summary">
<a href="#groups">Modules</a> </div>
<div class="headertitle">
<div class="title">Screensaver<div class="ingroups"><a class="el" href="group__cpp.html">C++</a> » <a class="el" href="group__cpp__kodi__addon.html">Interface - kodi::addon</a> » <a class="el" href="group__cpp__kodi__addon__instances.html">Addon type instances</a></div></div> </div>
</div><!--header-->
<div class="contents">
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<p> <h4><code><span style="font-style: italic;">Class: </span><span style="font-style: bold;"><font color=31363b><big> kodi::addon::CInstanceScreensaver </big></font></span></code></h4> <b>Screensaver add-on instance</b> </p>
<p>A screensaver is a Kodi addon that fills the screen with moving images or patterns when the computer is not in use. Initially designed to prevent phosphor burn-in on CRT and plasma computer monitors (hence the name), screensavers are now used primarily for entertainment, security or to display system status information.</p>
<p>Include the header #include <kodi/addon-instance/ScreenSaver.h> to use this class.</p>
<p>This interface allows the creating of screensavers for Kodi, based upon <b>DirectX</b> or/and <b>OpenGL</b> rendering with <code>C++</code> code.</p>
<p>The interface is small and easy usable. It has three functions:</p>
<ul>
<li><b><code>Start()</code></b> - Called on creation</li>
<li><b><code>Render()</code></b> - Called at render time</li>
<li><b><code>Stop()</code></b> - Called when the screensaver has no work</li>
</ul>
<p>Additionally, there are several <a class="el" href="group__cpp__kodi__addon__screensaver___c_b.html">other functions</a> available in which the child class can ask about the current hardware, including the device, display and several other parts.</p>
<hr />
<p>Here is an example of what the <b><code>addon.xml.in</code></b> would look like for an screensaver addon:</p>
<div class="fragment"><div class="line"><?<span class="keyword">xml</span> <span class="keyword">version</span>=<span class="stringliteral">"1.0"</span> <span class="keyword">encoding</span>=<span class="stringliteral">"UTF-8"</span>?></div>
<div class="line"><<span class="keywordtype">addon</span></div>
<div class="line"> <span class="keyword">id</span>=<span class="stringliteral">"screensaver.myspecialnamefor"</span></div>
<div class="line"> <span class="keyword">version</span>=<span class="stringliteral">"1.0.0"</span></div>
<div class="line"> <span class="keyword">name</span>=<span class="stringliteral">"My special screensaver addon"</span></div>
<div class="line"> <span class="keyword">provider-name</span>=<span class="stringliteral">"Your Name"</span>></div>
<div class="line"> <<span class="keywordtype">requires</span>>@<span class="keyword">ADDON_DEPENDS</span>@</<span class="keywordtype">requires</span>></div>
<div class="line"> <<span class="keywordtype">extension</span></div>
<div class="line"> <span class="keyword">point</span>=<span class="stringliteral">"xbmc.ui.screensaver"</span></div>
<div class="line"> <span class="keyword">library_</span>@<span class="keyword">PLATFORM</span>@=<span class="stringliteral">"@LIBRARY_FILENAME@"</span>/></div>
<div class="line"> <<span class="keywordtype">extension</span> <span class="keyword">point</span>=<span class="stringliteral">"xbmc.addon.metadata"</span>></div>
<div class="line"> <<span class="keywordtype">summary</span> <span class="keyword">lang</span>=<span class="stringliteral">"en_GB"</span>><span class="keyword">My</span> <span class="keyword">screensaver</span> <span class="keyword">addon</span></<span class="keywordtype">summary</span>></div>
<div class="line"> <<span class="keywordtype">description</span> <span class="keyword">lang</span>=<span class="stringliteral">"en_GB"</span>><span class="keyword">My</span> <span class="keyword">screensaver</span> <span class="keyword">addon</span> <span class="keyword">description</span></<span class="keywordtype">description</span>></div>
<div class="line"> <<span class="keywordtype">platform</span>>@<span class="keyword">PLATFORM</span>@</<span class="keywordtype">platform</span>></div>
<div class="line"> </<span class="keywordtype">extension</span>></div>
<div class="line"></<span class="keywordtype">addon</span>></div>
</div><!-- fragment --><p>Description to screensaver related addon.xml values: </p><table class="markdownTable">
<tr class="markdownTableHead">
<th class="markdownTableHeadLeft">Name </th><th class="markdownTableHeadNone">Description </th></tr>
<tr class="markdownTableRowOdd">
<td class="markdownTableBodyLeft"><b><code>point</code></b> </td><td class="markdownTableBodyNone">Addon type specification<br />
At all addon types and for this kind always <b>"xbmc.ui.screensaver"</b>. </td></tr>
<tr class="markdownTableRowEven">
<td class="markdownTableBodyLeft"><b><code>library_@PLATFORM@</code></b> </td><td class="markdownTableBodyNone">Sets the used library name, which is automatically set by cmake at addon build. </td></tr>
</table>
<dl class="section remark"><dt>Remarks</dt><dd>For more detailed description of the <b><code>addon.xml</code></b>, see also <a href="https://kodi.wiki/view/Addon.xml">https://kodi.wiki/view/Addon.xml</a>.</dd></dl>
<hr />
<p><b>Here is an example of the minimum required code to start a screensaver:</b> </p><div class="fragment"><div class="line"><span class="preprocessor">#include <kodi/addon-instance/Screensaver.h></span></div>
<div class="line"> </div>
<div class="line"><span class="keyword">class </span>CMyScreenSaver : <span class="keyword">public</span> <a class="code" href="classkodi_1_1addon_1_1_c_addon_base.html">kodi::addon::CAddonBase</a>,</div>
<div class="line"> <span class="keyword">public</span> <a class="code" href="classkodi_1_1addon_1_1_c_instance_screensaver.html">kodi::addon::CInstanceScreensaver</a></div>
<div class="line">{</div>
<div class="line"><span class="keyword">public</span>:</div>
<div class="line"> CMyScreenSaver();</div>
<div class="line"> </div>
<div class="line"> <span class="keywordtype">bool</span> Start() <span class="keyword">override</span>;</div>
<div class="line"> <span class="keywordtype">void</span> Render() <span class="keyword">override</span>;</div>
<div class="line">};</div>
<div class="line"> </div>
<div class="line">CMyScreenSaver::CMyScreenSaver()</div>
<div class="line">{</div>
<div class="line"> ...</div>
<div class="line">}</div>
<div class="line"> </div>
<div class="line"><span class="keywordtype">bool</span> CMyScreenSaver::Start()</div>
<div class="line">{</div>
<div class="line"> ...</div>
<div class="line"> <span class="keywordflow">return</span> <span class="keyword">true</span>;</div>
<div class="line">}</div>
<div class="line"> </div>
<div class="line"><span class="keywordtype">void</span> CMyScreenSaver::Render()</div>
<div class="line">{</div>
<div class="line"> ...</div>
<div class="line">}</div>
<div class="line"> </div>
<div class="line">ADDONCREATOR(CMyScreenSaver)</div>
<div class="ttc" id="aclasskodi_1_1addon_1_1_c_addon_base_html"><div class="ttname"><a href="classkodi_1_1addon_1_1_c_addon_base.html">kodi::addon::CAddonBase</a></div><div class="ttdef"><b>Definition:</b> AddonBase.h:322</div></div>
<div class="ttc" id="aclasskodi_1_1addon_1_1_c_instance_screensaver_html"><div class="ttname"><a href="classkodi_1_1addon_1_1_c_instance_screensaver.html">kodi::addon::CInstanceScreensaver</a></div><div class="ttdef"><b>Definition:</b> Screensaver.h:194</div></div>
</div><!-- fragment --><hr />
<p><b>Here is another example where the screensaver is used together with other instance types:</b></p>
<div class="fragment"><div class="line"><span class="preprocessor">#include <kodi/addon-instance/Screensaver.h></span></div>
<div class="line"> </div>
<div class="line"><span class="keyword">class </span>CMyScreenSaver : <span class="keyword">public</span> <a class="code" href="classkodi_1_1addon_1_1_c_instance_screensaver.html">kodi::addon::CInstanceScreensaver</a></div>
<div class="line">{</div>
<div class="line"><span class="keyword">public</span>:</div>
<div class="line"> CMyScreenSaver(KODI_HANDLE instance, <span class="keyword">const</span> std::string& version);</div>
<div class="line"> </div>
<div class="line"> <span class="keywordtype">bool</span> Start() <span class="keyword">override</span>;</div>
<div class="line"> <span class="keywordtype">void</span> Render() <span class="keyword">override</span>;</div>
<div class="line">};</div>
<div class="line"> </div>
<div class="line">CMyScreenSaver::CMyScreenSaver(KODI_HANDLE instance, <span class="keyword">const</span> std::string& version)</div>
<div class="line"> : CInstanceScreensaver(instance, version)</div>
<div class="line">{</div>
<div class="line"> ...</div>
<div class="line">}</div>
<div class="line"> </div>
<div class="line"><span class="keywordtype">bool</span> CMyScreenSaver::Start()</div>
<div class="line">{</div>
<div class="line"> ...</div>
<div class="line"> <span class="keywordflow">return</span> <span class="keyword">true</span>;</div>
<div class="line">}</div>
<div class="line"> </div>
<div class="line"><span class="keywordtype">void</span> CMyScreenSaver::Render()</div>
<div class="line">{</div>
<div class="line"> ...</div>
<div class="line">}</div>
<div class="line"> </div>
<div class="line"> </div>
<div class="line"><span class="comment">//----------------------------------------------------------------------</span></div>
<div class="line"> </div>
<div class="line"><span class="keyword">class </span>CMyAddon : <span class="keyword">public</span> <a class="code" href="classkodi_1_1addon_1_1_c_addon_base.html">kodi::addon::CAddonBase</a></div>
<div class="line">{</div>
<div class="line"><span class="keyword">public</span>:</div>
<div class="line"> CMyAddon() = <span class="keywordflow">default</span>;</div>
<div class="line"> <a class="code" href="group__cpp__kodi__addon__addonbase___defs___a_d_d_o_n___s_t_a_t_u_s.html#ga335347495ed00620451a69cfe3494502">ADDON_STATUS</a> <a class="code" href="group__cpp__kodi__addon__addonbase.html#ga74ea538a2191541a57115fa89790358c">CreateInstance</a>(<span class="keywordtype">int</span> instanceType,</div>
<div class="line"> <span class="keyword">const</span> std::string& instanceID,</div>
<div class="line"> KODI_HANDLE instance,</div>
<div class="line"> <span class="keyword">const</span> std::string& version,</div>
<div class="line"> KODI_HANDLE& addonInstance) <span class="keyword">override</span>;</div>
<div class="line">};</div>
<div class="line"> </div>
<div class="line"><span class="comment">// If you use only one instance in your add-on, can be instanceType and</span></div>
<div class="line"><span class="comment">// instanceID ignored</span></div>
<div class="line"><a class="code" href="group__cpp__kodi__addon__addonbase___defs___a_d_d_o_n___s_t_a_t_u_s.html#ga335347495ed00620451a69cfe3494502">ADDON_STATUS</a> CMyAddon::CreateInstance(<span class="keywordtype">int</span> instanceType,</div>
<div class="line"> <span class="keyword">const</span> std::string& instanceID,</div>
<div class="line"> KODI_HANDLE instance,</div>
<div class="line"> <span class="keyword">const</span> std::string& version,</div>
<div class="line"> KODI_HANDLE& addonInstance)</div>
<div class="line">{</div>
<div class="line"> <span class="keywordflow">if</span> (instanceType == <a class="code" href="group__cpp__kodi__addon__addonbase___defs___a_d_d_o_n___t_y_p_e.html#ggada0b4c3c9f9c168e5e1c27145ec72357a84fe3fcf6a482a0188eeea3e3b31f499">ADDON_INSTANCE_SCREENSAVER</a>)</div>
<div class="line"> {</div>
<div class="line"> <a class="code" href="group__cpp__kodi.html#gaaa1f205f9375cd086229a1455ede11cc">kodi::Log</a>(<a class="code" href="group__cpp__kodi___defs___addon_log.html#gga913895aaf2ef685961947f8d6b93e038a63f8ea3699765964c764b141bf41e9cc">ADDON_LOG_INFO</a>, <span class="stringliteral">"Creating my Screensaver"</span>);</div>
<div class="line"> addonInstance = <span class="keyword">new</span> CMyScreenSaver(instance, version);</div>
<div class="line"> <span class="keywordflow">return</span> <a class="code" href="group__cpp__kodi__addon__addonbase___defs___a_d_d_o_n___s_t_a_t_u_s.html#gga335347495ed00620451a69cfe3494502a6925909b93ca05098ca5272f16e091c0">ADDON_STATUS_OK</a>;</div>
<div class="line"> }</div>
<div class="line"> <span class="keywordflow">else</span> <span class="keywordflow">if</span> (...)</div>
<div class="line"> {</div>
<div class="line"> ...</div>
<div class="line"> }</div>
<div class="line"> <span class="keywordflow">return</span> <a class="code" href="group__cpp__kodi__addon__addonbase___defs___a_d_d_o_n___s_t_a_t_u_s.html#gga335347495ed00620451a69cfe3494502ac0720dbdce3dcb194f12a0eceb59a501">ADDON_STATUS_UNKNOWN</a>;</div>
<div class="line">}</div>
<div class="line"> </div>
<div class="line">ADDONCREATOR(CMyAddon)</div>
<div class="ttc" id="agroup__cpp__kodi___defs___addon_log_html_gga913895aaf2ef685961947f8d6b93e038a63f8ea3699765964c764b141bf41e9cc"><div class="ttname"><a href="group__cpp__kodi___defs___addon_log.html#gga913895aaf2ef685961947f8d6b93e038a63f8ea3699765964c764b141bf41e9cc">ADDON_LOG_INFO</a></div><div class="ttdeci">@ ADDON_LOG_INFO</div><div class="ttdoc">1 : To include information messages in the log file.</div><div class="ttdef"><b>Definition:</b> addon_base.h:177</div></div>
<div class="ttc" id="agroup__cpp__kodi__addon__addonbase___defs___a_d_d_o_n___s_t_a_t_u_s_html_ga335347495ed00620451a69cfe3494502"><div class="ttname"><a href="group__cpp__kodi__addon__addonbase___defs___a_d_d_o_n___s_t_a_t_u_s.html#ga335347495ed00620451a69cfe3494502">ADDON_STATUS</a></div><div class="ttdeci">ADDON_STATUS</div><div class="ttdef"><b>Definition:</b> addon_base.h:128</div></div>
<div class="ttc" id="agroup__cpp__kodi__addon__addonbase___defs___a_d_d_o_n___s_t_a_t_u_s_html_gga335347495ed00620451a69cfe3494502a6925909b93ca05098ca5272f16e091c0"><div class="ttname"><a href="group__cpp__kodi__addon__addonbase___defs___a_d_d_o_n___s_t_a_t_u_s.html#gga335347495ed00620451a69cfe3494502a6925909b93ca05098ca5272f16e091c0">ADDON_STATUS_OK</a></div><div class="ttdeci">@ ADDON_STATUS_OK</div><div class="ttdoc">For everything OK and no error.</div><div class="ttdef"><b>Definition:</b> addon_base.h:130</div></div>
<div class="ttc" id="agroup__cpp__kodi__addon__addonbase___defs___a_d_d_o_n___s_t_a_t_u_s_html_gga335347495ed00620451a69cfe3494502ac0720dbdce3dcb194f12a0eceb59a501"><div class="ttname"><a href="group__cpp__kodi__addon__addonbase___defs___a_d_d_o_n___s_t_a_t_u_s.html#gga335347495ed00620451a69cfe3494502ac0720dbdce3dcb194f12a0eceb59a501">ADDON_STATUS_UNKNOWN</a></div><div class="ttdeci">@ ADDON_STATUS_UNKNOWN</div><div class="ttdoc">Unknown and incomprehensible error.</div><div class="ttdef"><b>Definition:</b> addon_base.h:142</div></div>
<div class="ttc" id="agroup__cpp__kodi__addon__addonbase___defs___a_d_d_o_n___t_y_p_e_html_ggada0b4c3c9f9c168e5e1c27145ec72357a84fe3fcf6a482a0188eeea3e3b31f499"><div class="ttname"><a href="group__cpp__kodi__addon__addonbase___defs___a_d_d_o_n___t_y_p_e.html#ggada0b4c3c9f9c168e5e1c27145ec72357a84fe3fcf6a482a0188eeea3e3b31f499">ADDON_INSTANCE_SCREENSAVER</a></div><div class="ttdeci">@ ADDON_INSTANCE_SCREENSAVER</div><div class="ttdoc">PVR client instance, see kodi::addon::CInstanceScreensaver.</div><div class="ttdef"><b>Definition:</b> versions.h:235</div></div>
<div class="ttc" id="agroup__cpp__kodi__addon__addonbase_html_ga74ea538a2191541a57115fa89790358c"><div class="ttname"><a href="group__cpp__kodi__addon__addonbase.html#ga74ea538a2191541a57115fa89790358c">kodi::addon::CAddonBase::CreateInstance</a></div><div class="ttdeci">virtual ADDON_STATUS CreateInstance(int instanceType, const std::string &instanceID, KODI_HANDLE instance, const std::string &version, KODI_HANDLE &addonInstance)</div><div class="ttdoc">Instance created.</div><div class="ttdef"><b>Definition:</b> AddonBase.h:481</div></div>
<div class="ttc" id="agroup__cpp__kodi_html_gaaa1f205f9375cd086229a1455ede11cc"><div class="ttname"><a href="group__cpp__kodi.html#gaaa1f205f9375cd086229a1455ede11cc">kodi::Log</a></div><div class="ttdeci">void ATTRIBUTE_HIDDEN Log(const AddonLog loglevel, const char *format,...)</div><div class="ttdoc">Add a message to Kodi's log.</div><div class="ttdef"><b>Definition:</b> AddonBase.h:749</div></div>
</div><!-- fragment --><p>The destruction of the example class <code>CMyScreenSaver</code> is called from Kodi's header. Manually deleting the add-on instance is not required. </p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="groups"></a>
Modules</h2></td></tr>
<tr class="memitem:group__cpp__kodi__addon__screensaver___c_b"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="group__cpp__kodi__addon__screensaver___c_b.html">Information functions</a></td></tr>
<tr class="memdesc:group__cpp__kodi__addon__screensaver___c_b"><td class="mdescLeft"> </td><td class="mdescRight"><b>To get info about the device, display and several other parts</b> <br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
</table>
<h2 class="groupheader">Function Documentation</h2>
<a id="ga1aea828e7f23e2a5837d34bb2b3d48f9"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga1aea828e7f23e2a5837d34bb2b3d48f9">◆ </a></span>CInstanceScreensaver() <span class="overload">[1/2]</span></h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classkodi_1_1addon_1_1_c_instance_screensaver.html">CInstanceScreensaver</a> </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Screensaver class constructor. </p>
<p>Used by an add-on that only supports screensavers. </p>
</div>
</div>
<a id="ga2af22de2470b31dc0aa61f1ce35bf320"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga2af22de2470b31dc0aa61f1ce35bf320">◆ </a></span>CInstanceScreensaver() <span class="overload">[2/2]</span></h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classkodi_1_1addon_1_1_c_instance_screensaver.html">CInstanceScreensaver</a> </td>
<td>(</td>
<td class="paramtype">KODI_HANDLE </td>
<td class="paramname"><em>instance</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const std::string & </td>
<td class="paramname"><em>kodiVersion</em> = <code>""</code> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">explicit</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Screensaver class constructor used to support multiple instance types. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">instance</td><td>The instance value given to <b><code>kodi::addon::CAddonBase::CreateInstance(...)</code></b>. </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">kodiVersion</td><td>[opt] Version used in Kodi for this instance, to allow compatibility to older Kodi versions.</td></tr>
</table>
</dd>
</dl>
<dl class="section note"><dt>Note</dt><dd>Recommended to set <b><code>kodiVersion</code></b>.</dd></dl>
<hr />
<p><b>Here's example about the use of this:</b> </p><div class="fragment"><div class="line"><span class="keyword">class </span>CMyScreenSaver : <span class="keyword">public</span> <a class="code" href="classkodi_1_1addon_1_1_c_instance_screensaver.html">kodi::addon::CInstanceScreensaver</a></div>
<div class="line">{</div>
<div class="line"><span class="keyword">public</span>:</div>
<div class="line"> CMyScreenSaver(KODI_HANDLE instance, <span class="keyword">const</span> std::string& kodiVersion)</div>
<div class="line"> : kodi::addon::<a class="code" href="group__cpp__kodi__addon__screensaver.html#ga1aea828e7f23e2a5837d34bb2b3d48f9">CInstanceScreensaver</a>(instance, kodiVersion)</div>
<div class="line"> {</div>
<div class="line"> ...</div>
<div class="line"> }</div>
<div class="line"> </div>
<div class="line"> ...</div>
<div class="line">};</div>
<div class="line"> </div>
<div class="line"><a class="code" href="group__cpp__kodi__addon__addonbase___defs___a_d_d_o_n___s_t_a_t_u_s.html#ga335347495ed00620451a69cfe3494502">ADDON_STATUS</a> CMyAddon::CreateInstance(<span class="keywordtype">int</span> instanceType,</div>
<div class="line"> <span class="keyword">const</span> std::string& instanceID,</div>
<div class="line"> KODI_HANDLE instance,</div>
<div class="line"> <span class="keyword">const</span> std::string& version,</div>
<div class="line"> KODI_HANDLE& addonInstance)</div>
<div class="line">{</div>
<div class="line"> <a class="code" href="group__cpp__kodi.html#gaaa1f205f9375cd086229a1455ede11cc">kodi::Log</a>(<a class="code" href="group__cpp__kodi___defs___addon_log.html#gga913895aaf2ef685961947f8d6b93e038a63f8ea3699765964c764b141bf41e9cc">ADDON_LOG_INFO</a>, <span class="stringliteral">"Creating my screensaver"</span>);</div>
<div class="line"> addonInstance = <span class="keyword">new</span> CMyScreenSaver(instance, version);</div>
<div class="line"> <span class="keywordflow">return</span> <a class="code" href="group__cpp__kodi__addon__addonbase___defs___a_d_d_o_n___s_t_a_t_u_s.html#gga335347495ed00620451a69cfe3494502a6925909b93ca05098ca5272f16e091c0">ADDON_STATUS_OK</a>;</div>
<div class="line">}</div>
<div class="ttc" id="agroup__cpp__kodi__addon__screensaver_html_ga1aea828e7f23e2a5837d34bb2b3d48f9"><div class="ttname"><a href="group__cpp__kodi__addon__screensaver.html#ga1aea828e7f23e2a5837d34bb2b3d48f9">kodi::addon::CInstanceScreensaver::CInstanceScreensaver</a></div><div class="ttdeci">CInstanceScreensaver()</div><div class="ttdoc">Screensaver class constructor.</div><div class="ttdef"><b>Definition:</b> Screensaver.h:202</div></div>
</div><!-- fragment -->
</div>
</div>
<a id="ga7168a70cecb9b102d950c9fc1fa19270"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga7168a70cecb9b102d950c9fc1fa19270">◆ </a></span>~CInstanceScreensaver()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">~<a class="el" href="classkodi_1_1addon_1_1_c_instance_screensaver.html">CInstanceScreensaver</a> </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">override</span><span class="mlabel">default</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Destructor. </p>
</div>
</div>
<a id="ga5ece6330cf785d6fcdc95c43ebfdcb9b"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga5ece6330cf785d6fcdc95c43ebfdcb9b">◆ </a></span>Start()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">virtual bool Start </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">virtual</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Used to notify the screensaver that it has been started. </p>
<dl class="section return"><dt>Returns</dt><dd>true if the screensaver was started successfully, false otherwise </dd></dl>
</div>
</div>
<a id="gaf6f113a64b92a63894b285b4f2a2c3a5"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaf6f113a64b92a63894b285b4f2a2c3a5">◆ </a></span>Stop()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">virtual void Stop </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">virtual</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Used to inform the screensaver that the rendering control was stopped. </p>
</div>
</div>
<a id="ga0bc3f3606d9cf5304dac90cd7a619194"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga0bc3f3606d9cf5304dac90cd7a619194">◆ </a></span>Render()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">virtual void Render </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">virtual</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Used to indicate when the add-on should render. </p>
</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.1 </li>
</ul>
</div>
</body>
</html>