[FL-1908] New animation update scheme (#737)
* Assets: update desktop animation frame rate and cleanup. * Power: update ViewPort only if changed. * Gui: tie IconAnimation with View, new update event generation scheme. Desktop: update IconAnimation usage. Co-authored-by: DrZlo13 <who.just.the.doctor@gmail.com>
This commit is contained in:
@@ -14,48 +14,41 @@ typedef enum {
|
||||
ViewPortOrientationVertical,
|
||||
} ViewPortOrientation;
|
||||
|
||||
/*
|
||||
* ViewPort Draw callback
|
||||
/** ViewPort Draw callback
|
||||
* @warning called from GUI thread
|
||||
*/
|
||||
typedef void (*ViewPortDrawCallback)(Canvas* canvas, void* context);
|
||||
|
||||
/*
|
||||
* ViewPort Input callback
|
||||
/** ViewPort Input callback
|
||||
* @warning called from GUI thread
|
||||
*/
|
||||
typedef void (*ViewPortInputCallback)(InputEvent* event, void* context);
|
||||
|
||||
/*
|
||||
* ViewPort allocator
|
||||
/** ViewPort allocator
|
||||
* always returns view_port or stops system if not enough memory.
|
||||
*/
|
||||
ViewPort* view_port_alloc();
|
||||
|
||||
/*
|
||||
* ViewPort deallocator
|
||||
/** ViewPort deallocator
|
||||
* Ensure that view_port was unregistered in GUI system before use.
|
||||
*/
|
||||
void view_port_free(ViewPort* view_port);
|
||||
|
||||
/*
|
||||
* Set view_port width.
|
||||
/** Set view_port width.
|
||||
* Will be used to limit canvas drawing area and autolayout feature.
|
||||
* @param width - wanted width, 0 - auto.
|
||||
*/
|
||||
void view_port_set_width(ViewPort* view_port, uint8_t width);
|
||||
uint8_t view_port_get_width(ViewPort* view_port);
|
||||
|
||||
/*
|
||||
* Set view_port height.
|
||||
/** Set view_port height.
|
||||
* Will be used to limit canvas drawing area and autolayout feature.
|
||||
* @param height - wanted height, 0 - auto.
|
||||
*/
|
||||
void view_port_set_height(ViewPort* view_port, uint8_t height);
|
||||
uint8_t view_port_get_height(ViewPort* view_port);
|
||||
|
||||
/*
|
||||
* Enable or disable view_port rendering.
|
||||
/** Enable or disable view_port rendering.
|
||||
* @param view_port - ViewPort instance
|
||||
* @param enabled
|
||||
* @warning automatically dispatches update event
|
||||
@@ -63,8 +56,7 @@ uint8_t view_port_get_height(ViewPort* view_port);
|
||||
void view_port_enabled_set(ViewPort* view_port, bool enabled);
|
||||
bool view_port_is_enabled(ViewPort* view_port);
|
||||
|
||||
/*
|
||||
* ViewPort event callbacks
|
||||
/** ViewPort event callbacks
|
||||
* @param callback - appropriate callback function
|
||||
* @param context - context to pass to callback
|
||||
*/
|
||||
@@ -74,14 +66,12 @@ void view_port_input_callback_set(
|
||||
ViewPortInputCallback callback,
|
||||
void* context);
|
||||
|
||||
/*
|
||||
* Emit update signal to GUI system.
|
||||
/** Emit update signal to GUI system.
|
||||
* Rendering will happen later after GUI system process signal.
|
||||
*/
|
||||
void view_port_update(ViewPort* view_port);
|
||||
|
||||
/*
|
||||
* Set ViewPort orientation.
|
||||
/** Set ViewPort orientation.
|
||||
* @param orientation, display orientation, horizontal or vertical.
|
||||
*/
|
||||
void view_port_set_orientation(ViewPort* view_port, ViewPortOrientation orientation);
|
||||
|
Reference in New Issue
Block a user