[FL-1092] Make View reusable outside of dispatcher (#396)
* View: replace direct View to ViewDispatcher link with callback. ViewDispatcher: update View usage. ViewHandler: update View usage, handle update signal.
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
#pragma once
|
||||
|
||||
#include "view.h"
|
||||
#include "view_dispatcher_i.h"
|
||||
#include <furi.h>
|
||||
|
||||
typedef struct {
|
||||
@@ -10,21 +9,22 @@ typedef struct {
|
||||
} ViewModelLocking;
|
||||
|
||||
struct View {
|
||||
ViewDispatcher* dispatcher;
|
||||
ViewDrawCallback draw_callback;
|
||||
ViewInputCallback input_callback;
|
||||
|
||||
ViewModelType model_type;
|
||||
ViewNavigationCallback previous_callback;
|
||||
ViewNavigationCallback next_callback;
|
||||
ViewCallback enter_callback;
|
||||
ViewCallback exit_callback;
|
||||
|
||||
ViewUpdateCallback update_callback;
|
||||
void* update_callback_context;
|
||||
|
||||
void* model;
|
||||
void* context;
|
||||
};
|
||||
|
||||
/* Set View dispatcher */
|
||||
void view_set_dispatcher(View* view, ViewDispatcher* view_dispatcher);
|
||||
|
||||
/* Unlock model */
|
||||
void view_unlock_model(View* view);
|
||||
|
||||
|
Reference in New Issue
Block a user