wut  v1.7.0
Wii U Toolchain
IIconInfoAccessor.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <nn/result.h>
5 #include <nn/sl/sl_cpp.h>
6 #include <wut.h>
7 
8 #ifdef __cplusplus
9 
10 namespace nn::sl {
12 
13  public:
15  InitInternalVtable();
16  }
17 
19  InitInternalVtable();
20  }
21 
23  InitInternalVtable();
24  return *this;
25  }
26 
28  InitInternalVtable();
29  return *this;
30  }
31 
32  ~IIconInfoAccessor() override = default;
33 
34  private:
35  static nn::Result GetTitleIconInfoWrapper(details::IIconInfoAccessorInternal *instance, nn::sl::IconInfo *outIconInfo, const nn::sl::TitleInfo &titleInfo, nn::sl::Language language) {
36  return instance->vtable->instance->GetTitleIconInfo(outIconInfo, titleInfo, language);
37  }
38  static nn::Result GetMiiIconWrapper(details::IIconInfoAccessorInternal *instance, void *buffer, uint32_t buffer_size, uint32_t slot) {
39  return instance->vtable->instance->GetMiiIcon(buffer, buffer_size, slot);
40  }
41 
42  details::IIconInfoAccessorInternal *GetInternal() override {
43  return &mInstance;
44  }
45 
46  void InitInternalVtable() {
47  mVTable = {.instance = this,
48  .GetTitleIconInfoFn = GetTitleIconInfoWrapper,
49  .GetMiiIconFn = GetMiiIconWrapper};
50  mInstance.vtable = &mVTable;
51  }
52 
54  details::IIconInfoAccessorInternalVTable mVTable{};
55  };
56 
58 } // namespace nn::sl
59 
60 #endif
Result value type used by nn libraries.
Definition: result.h:68
IIconInfoAccessor & operator=(IIconInfoAccessor &&src) noexcept
~IIconInfoAccessor() override=default
IIconInfoAccessor & operator=(const IIconInfoAccessor &other)
IIconInfoAccessor(IIconInfoAccessor &src)
virtual nn::Result GetMiiIcon(void *buffer, uint32_t buffer_size, uint32_t slot) const =0
virtual nn::Result GetTitleIconInfo(nn::sl::IconInfo *outIconInfo, const nn::sl::TitleInfo &titleInfo, nn::sl::Language language) const =0
struct nn::sl::details::IIconInfoAccessorInternal IIconInfoAccessorInternal
Language
Definition: sl_cpp.h:251
details::IIconInfoAccessorBase & GetDefaultIconInfoAccessor()