|
PebbleOS
|
Single slot holding the phone-supplied image of the notification on screen. More...
Macros | |
| #define | NOTIFICATION_IMAGE_SUPPORTED 0 |
| Whether the platform supports notification images. | |
Functions | |
| void | notification_image_service_init (void) |
| Initialize the service. | |
| bool | notification_image_claim (const Uuid *item_id, uint8_t *token_out) |
| Claim the slot for an item. | |
| const struct GBitmap * | notification_image_lock (const Uuid *item_id) |
| Lock the slot and get the image of an item. | |
| void | notification_image_unlock (void) |
| Unlock the slot locked by notification_image_lock(). | |
| bool | notification_image_is_pending (const Uuid *item_id) |
| Check whether the image of an item is still being fetched. | |
| bool | notification_image_store (uint8_t token, struct GBitmap *bitmap) |
| Store a delivered image. | |
| void | notification_image_clear (void) |
| Release the slot and free the stored image. | |
Single slot holding the phone-supplied image of the notification on screen.
Only one notification card is focused at a time, so one slot is enough. A card claims the slot for its item, requests the image from the phone with the returned token, and draws whatever has been stored while holding the slot lock. Responses are delivered on KernelMain while cards render on KernelMain or the App task, so all functions are thread safe.
| #define NOTIFICATION_IMAGE_SUPPORTED 0 |
Whether the platform supports notification images.
Images need a color display and enough RAM for the decoded bitmap, so only emery and gabbro qualify, the same bar as album art.
| bool notification_image_claim | ( | const Uuid * | item_id, |
| uint8_t * | token_out | ||
| ) |
Claim the slot for an item.
Drops any image held for a previous item.
| item_id | Item to claim the slot for. | |
| [out] | token_out | Token to send with the image request. |
item_id, whether the image is in flight, delivered or the phone said it has none, so callers can drive this from a redraw; also false if an argument is NULL. | void notification_image_clear | ( | void | ) |
Release the slot and free the stored image.
| bool notification_image_is_pending | ( | const Uuid * | item_id | ) |
Check whether the image of an item is still being fetched.
Lets a card show a placeholder instead of an empty band until the phone answers.
| item_id | Item to check. |
item_id is outstanding. | const struct GBitmap * notification_image_lock | ( | const Uuid * | item_id | ) |
Lock the slot and get the image of an item.
The slot stays locked until notification_image_unlock(), which must be called even when this returns NULL. The lock is recursive.
| item_id | Item whose image to get. |
item_id. | void notification_image_service_init | ( | void | ) |
Initialize the service.
Call once at boot before any other function here.
| bool notification_image_store | ( | uint8_t | token, |
| struct GBitmap * | bitmap | ||
| ) |
Store a delivered image.
Takes ownership of bitmap; it, its pixel data and its palette must be allocated on the kernel heap. A stale token frees the bitmap.
| token | Token returned by notification_image_claim(). |
| bitmap | Delivered image, or NULL when the phone had no image. |
bitmap is NULL as that removes the pending placeholder. | void notification_image_unlock | ( | void | ) |
Unlock the slot locked by notification_image_lock().