Resolves timeline resource ids to image resources.
More...
Resolves timeline resource ids to image resources.
Timeline icons are referred to by a TimelineResourceId with a size. Ids with SYSTEM_RESOURCE_FLAG set are system icons, looked up in a table generated with the system resources. Other ids are published by an app: its resource pack holds a lookup table (resource TLUT_RESOURCE_ID, starting with the TLUT_SIGNATURE) of TimelineLutEntry rows indexed by the id.
◆ TimelineResourceInfo
| struct TimelineResourceInfo |
Timeline resource to resolve.
| Data Fields |
|
const Uuid * |
app_id |
App that published res_id. |
|
TimelineResourceId |
fallback_id |
System resource used if res_id cannot be resolved. |
|
TimelineResourceId |
res_id |
Timeline resource id. |
◆ AppResourceInfo
| Data Fields |
|
ResAppNum |
res_app_num |
Resource bank: the system or an app. |
|
uint32_t |
res_id |
Resource id within the bank. |
◆ AppResourceId
Resource in a resource bank.
| Data Fields |
|
ResAppNum |
res_app_num |
Resource bank. |
|
uint32_t |
resource_id |
Resource id within the bank. |
◆ TimelineLutEntry
Row of an app's timeline resource lookup table.
| Data Fields |
|
uint32_t |
large |
Resource id of the large icon. |
|
uint32_t |
small |
Resource id of the small icon. |
|
uint32_t |
tiny |
Resource id of the tiny icon. |
◆ SYSTEM_RESOURCE_FLAG
| #define SYSTEM_RESOURCE_FLAG 0x80000000 |
Flag marking a TimelineResourceId as a system resource.
◆ TIMELINE_LARGE_RESOURCE_SIZE
| #define TIMELINE_LARGE_RESOURCE_SIZE (GSize(80, 80)) |
Size of large timeline icons.
◆ TIMELINE_RESOURCE_PBW_SUPPORT_FIRST_SDK_VERSION_MAJOR
| #define TIMELINE_RESOURCE_PBW_SUPPORT_FIRST_SDK_VERSION_MAJOR (0x5) |
Major version of the first SDK supporting timeline icons in PBWs.
◆ TIMELINE_RESOURCE_PBW_SUPPORT_FIRST_SDK_VERSION_MINOR
| #define TIMELINE_RESOURCE_PBW_SUPPORT_FIRST_SDK_VERSION_MINOR (0x3d) |
Minor version of the first SDK supporting timeline icons in PBWs.
◆ TIMELINE_SMALL_RESOURCE_SIZE
| #define TIMELINE_SMALL_RESOURCE_SIZE (GSize(50, 50)) |
Size of small timeline icons.
◆ TIMELINE_TINY_RESOURCE_SIZE
| #define TIMELINE_TINY_RESOURCE_SIZE (GSize(25, 25)) |
Size of tiny timeline icons.
◆ TLUT_DATA_OFFSET
◆ TLUT_RESOURCE_ID
| #define TLUT_RESOURCE_ID 1 |
Resource id of the lookup table in an app's resource pack.
◆ TLUT_SIGNATURE
| #define TLUT_SIGNATURE PBL_FOURCC('T', 'L', 'U', 'T') |
Signature at the start of an app's timeline resource lookup table.
◆ TimelineResourceSize
Sizes of timeline icons.
| Enumerator |
|---|
| TimelineResourceSizeTiny | 25x25 pixels.
|
| TimelineResourceSizeSmall | 50x50 pixels.
|
| TimelineResourceSizeLarge | 80x80 pixels.
|
| TimelineResourceSizeCount | Number of sizes.
|
◆ sys_timeline_resources_get_id()
Syscall version of timeline_resources_get_id().
Validates the buffers of unprivileged callers.
- Parameters
-
| timeline_res | Timeline resource and the app that published it. |
| size | Icon size. |
| [out] | res_info_out | Resolved resource; zeroed on invalid arguments. |
◆ timeline_resources_get_gsize()
◆ timeline_resources_get_id()
Resolve a timeline resource, falling back to its fallback system resource.
- Parameters
-
| timeline_res | Timeline resource and the app that published it. |
| size | Icon size. |
| [out] | res_info_out | Resolved resource; both fields 0 if neither the resource nor the fallback could be resolved. |
◆ timeline_resources_get_id_system()
Resolve a timeline resource id in a given app resource bank.
Does not check that the app was built with an SDK supporting published timeline resources; use timeline_resources_get_id() unless that is already known. App icons must be bitmaps or PDC images of at most 700 bytes.
- Parameters
-
| timeline_id | Timeline resource id. |
| size | Icon size. |
| res_app_num | App resource bank, used if timeline_id is not a system resource. |
| [out] | res_info_out | Resolved resource, set only on success; may be NULL. |
- Returns
- true if
timeline_id is valid for size and res_app_num.
◆ timeline_resources_is_system()
| bool timeline_resources_is_system |
( |
TimelineResourceId |
timeline_id | ) |
|
Check whether a timeline resource id is a system resource.
- Parameters
-
| timeline_id | Timeline resource id. |
- Returns
- true if SYSTEM_RESOURCE_FLAG is set.