Subghz app example (#365)

* Gui: ported submenu and view_dispatcher_remove_view from iButton branch

* App gui-test: use backported submenu api

* App subghz: initial commit

* App subghz: syntax fix

* App gui-test: fix submenu callback

* App subghz: add subfolders to build

* Gui view: c++ verison of with_view_model

* Subghz app: simple spectrum settings view

* Subghz app: add spectrum settings view to view manager

* Subghz app: spectrum settings scene

Co-authored-by: coreglitch <mail@s3f.ru>
This commit is contained in:
SG
2021-03-05 19:47:27 +10:00
committed by GitHub
parent 025b77ecc1
commit 7afdd14a4c
21 changed files with 648 additions and 18 deletions

View File

@@ -141,6 +141,18 @@ void* view_get_model(View* view);
*/
void view_commit_model(View* view, bool update);
#ifdef __cplusplus
}
#endif
#ifdef __cplusplus
#define with_view_model_cpp(view, type, var, function_body) \
{ \
type* p = static_cast<type*>(view_get_model(view)); \
bool update = [&](type * var) function_body(p); \
view_commit_model(view, update); \
}
#else
/*
* With clause for view model
* @param view, View instance pointer
@@ -153,7 +165,4 @@ void view_commit_model(View* view, bool update);
bool update = ({ bool __fn__ function_body __fn__; })(p); \
view_commit_model(view, update); \
}
#ifdef __cplusplus
}
#endif
#endif