GUI: abolish API injection into instances. (#265)

* GUI: abolish API injection into instances. Update usage by 3rd party apps.
* GUI: update documentation. Cleanup api usage. Adjust status bar item spacing.
This commit is contained in:
あく
2020-12-14 13:50:32 +03:00
committed by GitHub
parent ff7ce6f00f
commit d3ff787864
39 changed files with 486 additions and 422 deletions

View File

@@ -27,8 +27,16 @@ typedef enum {
GuiLayerMAX /* Don't use or move, special value */
} GuiLayer;
typedef struct GuiApi GuiApi;
struct GuiApi {
void (*add_widget)(GuiApi* gui_api, Widget* widget, GuiLayer layer);
void (*remove_widget)(GuiApi* gui_api, Widget* widget);
};
typedef struct Gui Gui;
/*
* Add widget to widget tree
* @remarks thread safe
*/
void gui_add_widget(Gui* gui, Widget* widget, GuiLayer layer);
/*
* Remove widget from rendering tree
* @remarks thread safe
*/
void gui_remove_widget(Gui* gui, Widget* widget);