File: Rendering.h

package info (click to toggle)
kodi 2%3A20.1%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 143,820 kB
  • sloc: cpp: 664,925; xml: 68,398; ansic: 37,223; python: 6,903; sh: 4,209; javascript: 2,325; makefile: 1,754; perl: 969; java: 513; cs: 390; objc: 340
file content (89 lines) | stat: -rw-r--r-- 2,650 bytes parent folder | download | duplicates (2)
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
/*
 *  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

#include "addons/kodi-dev-kit/include/kodi/c-api/gui/controls/rendering.h"
#include "guilib/IRenderingCallback.h"

class CGUIRenderingControl;

extern "C"
{

  struct AddonGlobalInterface;

  namespace ADDON
  {

  class CAddonDll;

  /*!
   * @brief Global gui Add-on to Kodi callback functions
   *
   * To hold general gui functions and initialize also all other gui related types not
   * related to a instance type and usable for every add-on type.
   *
   * Related add-on header is "./xbmc/addons/kodi-dev-kit/include/kodi/gui/controls/Rendering.h"
   */
  struct Interface_GUIControlAddonRendering
  {
    static void Init(AddonGlobalInterface* addonInterface);
    static void DeInit(AddonGlobalInterface* addonInterface);

    /*!
     * @brief callback functions from add-on to kodi
     *
     * @note To add a new function use the "_" style to directly identify an
     * add-on callback function. Everything with CamelCase is only to be used
     * in Kodi.
     *
     * The parameter `kodiBase` is used to become the pointer for a `CAddonDll`
     * class.
     */
    //@{
    static void set_callbacks(
        KODI_HANDLE kodiBase,
        KODI_GUI_CONTROL_HANDLE handle,
        KODI_GUI_CLIENT_HANDLE clienthandle,
        bool (*createCB)(KODI_GUI_CLIENT_HANDLE, int, int, int, int, ADDON_HARDWARE_CONTEXT),
        void (*renderCB)(KODI_GUI_CLIENT_HANDLE),
        void (*stopCB)(KODI_GUI_CLIENT_HANDLE),
        bool (*dirtyCB)(KODI_GUI_CLIENT_HANDLE));
    static void destroy(KODI_HANDLE kodiBase, KODI_GUI_CONTROL_HANDLE handle);
    //@}
  };

  class CGUIAddonRenderingControl : public IRenderingCallback
  {
    friend struct Interface_GUIControlAddonRendering;

  public:
    explicit CGUIAddonRenderingControl(CGUIRenderingControl* pControl);
    ~CGUIAddonRenderingControl() override = default;

    bool Create(int x, int y, int w, int h, void* device) override;
    void Render() override;
    void Stop() override;
    bool IsDirty() override;
    virtual void Delete();

  protected:
    bool (*CBCreate)(KODI_GUI_CLIENT_HANDLE cbhdl, int x, int y, int w, int h, void* device);
    void (*CBRender)(KODI_GUI_CLIENT_HANDLE cbhdl);
    void (*CBStop)(KODI_GUI_CLIENT_HANDLE cbhdl);
    bool (*CBDirty)(KODI_GUI_CLIENT_HANDLE cbhdl);

    KODI_GUI_CLIENT_HANDLE m_clientHandle;
    CAddonDll* m_addon;
    CGUIRenderingControl* m_control;
    int m_refCount;
  };

  } /* namespace ADDON */
} /* extern "C" */