| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
#pragma once |
| 10 |
|
| 11 |
#include "IActivePortList.h" |
| 12 |
#include "addons/AddonEvents.h" |
| 13 |
#include "games/GameTypes.h" |
| 14 |
#include "games/controllers/ControllerTypes.h" |
| 15 |
#include "games/ports/types/PortNode.h" |
| 16 |
#include "utils/Observer.h" |
| 17 |
|
| 18 |
#include <memory> |
| 19 |
|
| 20 |
class CFileItemList; |
| 21 |
class CGUIWindow; |
| 22 |
|
| 23 |
namespace KODI |
| 24 |
{ |
| 25 |
namespace GAME |
| 26 |
{ |
| 27 |
class CController; |
| 28 |
class IActivePortList; |
| 29 |
|
| 30 |
|
| 31 |
|
| 32 |
|
| 33 |
class CGUIActivePortList : public IActivePortList, public Observer |
| 34 |
{ |
| 35 |
public: |
| 36 |
CGUIActivePortList(CGUIWindow& window, int controlId, bool showInputDisabled); |
| 37 |
~CGUIActivePortList() override; |
| 38 |
|
| 39 |
|
| 40 |
bool Initialize(GameClientPtr gameClient) override; |
| 41 |
void Deinitialize() override; |
| 42 |
void Refresh() override; |
| 43 |
|
| 44 |
|
| 45 |
void Notify(const Observable& obs, const ObservableMessage msg) override; |
| 46 |
|
| 47 |
private: |
| 48 |
|
| 49 |
void OnEvent(const ADDON::AddonEvent& event); |
| 50 |
|
| 51 |
|
| 52 |
void InitializeGUI(); |
| 53 |
void DeinitializeGUI(); |
| 54 |
void AddInputDisabled(); |
| 55 |
void AddItems(const PortVec& ports); |
| 56 |
void AddItem(const ControllerPtr& controller, const std::string& controllerAddress); |
| 57 |
void AddPadding(); |
| 58 |
void CleanupItems(); |
| 59 |
|
| 60 |
|
| 61 |
CGUIWindow& m_guiWindow; |
| 62 |
const int m_controlId; |
| 63 |
const bool m_showInputDisabled; |
| 64 |
|
| 65 |
|
| 66 |
std::unique_ptr<CFileItemList> m_vecItems; |
| 67 |
uint32_t m_alignment{0}; |
| 68 |
|
| 69 |
|
| 70 |
GameClientPtr m_gameClient; |
| 71 |
}; |
| 72 |
} |
| 73 |
} |