refactoring mainview panel freeing and docs

This commit is contained in:
Andy Williams 2017-08-09 12:46:20 +01:00
parent 27a7ce8688
commit 1bf88c4730
4 changed files with 65 additions and 39 deletions

View File

@ -502,17 +502,9 @@ edi_mainview_panel_remove(Edi_Mainview_Panel *panel)
int panel_id = edi_mainview_panel_id(panel);
_edi_project_config_panel_remove(panel_id);
evas_object_del(panel->welcome);
evas_object_del(panel->content);
evas_object_del(panel->tabs);
evas_object_del(panel->scroll);
evas_object_del(panel->box);
edi_mainview_panel_free(panel);
_edi_mainview_panels = eina_list_remove(_edi_mainview_panels, panel);
free(panel);
panel = NULL;
}
Edi_Mainview_Panel *

View File

@ -38,6 +38,19 @@ extern "C" {
*/
void edi_mainview_add(Evas_Object *parent, Evas_Object *win);
/**
* @}
*
*
* @brief Content management functions.
* @defgroup Content
*
* @{
*
* Opening and managing content within the view.
*
*/
/**
* Close mainview by path.
*
@ -61,19 +74,6 @@ void edi_mainview_refresh_all(void);
*/
void edi_mainview_close_all(void);
/**
* @}
*
*
* @brief Content management functions.
* @defgroup Content
*
* @{
*
* Opening and managing content within the view.
*
*/
/**
* Open the file at path for editing using the type specified.
* Supported types are "text" and "image".

View File

@ -778,6 +778,18 @@ _edi_mainview_panel_prev_clicked_cb(void *data,
elm_scroller_region_bring_in(scroller, x, y, w, h);
}
void
edi_mainview_panel_free(Edi_Mainview_Panel *panel)
{
evas_object_del(panel->welcome);
evas_object_del(panel->content);
evas_object_del(panel->tabs);
evas_object_del(panel->scroll);
evas_object_del(panel->box);
free(panel);
}
Edi_Mainview_Panel *
edi_mainview_panel_add(Evas_Object *parent)
{

View File

@ -32,12 +32,12 @@ typedef struct _Edi_Mainview_Panel
} Edi_Mainview_Panel;
/**
* @brief Content management functions.
* @defgroup Content
* @brief UI management functions.
* @defgroup UI
*
* @{
*
* Opening and managing content within the view.
* Initialisation and management of UI panels.
*
*/
@ -47,35 +47,35 @@ typedef struct _Edi_Mainview_Panel
* @param parent The mainview parent into which the panel will be loaded.
* @return the panel that represents tha added mainview panel.
*
* @ingroup Content
* @ingroup UI
*/
Edi_Mainview_Panel *edi_mainview_panel_add(Evas_Object *parent);
/**
* Free the panel and any related objects.
*
* @param The panel to free.
*
* @ingroup UI
*/
void edi_mainview_panel_free(Edi_Mainview_Panel *panel);
/**
* Close mainview by path.
*
* @param panel the mainview panel context
* @praram path The path of file to close.
*
* @ingroup Content
* @ingroup UI
*/
void edi_mainview_panel_item_close_path(Edi_Mainview_Panel *panel, const char *path);
/**
* Refresh all existing open files.
*
* @param panel the mainview panel context
*
* @ingroup Content
*/
void edi_mainview_panel_refresh_all(Edi_Mainview_Panel *panel);
/**
* Close all existing open files.
*
* @param panel the mainview panel context
*
* @ingroup Content
* @ingroup UI
*/
void edi_mainview_panel_close_all(Edi_Mainview_Panel *panel);
@ -86,7 +86,7 @@ void edi_mainview_panel_close_all(Edi_Mainview_Panel *panel);
* @param panel the mainview panel context
* @param path The absolute path of the file to open.
*
* @ingroup Content
* @ingroup UI
*/
void edi_mainview_panel_open_path(Edi_Mainview_Panel *panel, const char *path);
@ -97,10 +97,32 @@ void edi_mainview_panel_open_path(Edi_Mainview_Panel *panel, const char *path);
* @param panel the mainview panel context
* @param path The path and options of the file to open.
*
* @ingroup Content
* @ingroup UI
*/
void edi_mainview_panel_open(Edi_Mainview_Panel *panel, Edi_Path_Options *options);
/**
* @}
*
*
* @brief Content management functions.
* @defgroup Content
*
* @{
*
* Opening and managing content within the view.
*
*/
/**
* Refresh all existing open files.
*
* @param panel the mainview panel context
*
* @ingroup Content
*/
void edi_mainview_panel_refresh_all(Edi_Mainview_Panel *panel);
void edi_mainview_panel_item_close(Edi_Mainview_Panel *panel, Edi_Mainview_Item *item);
void edi_mainview_panel_item_select(Edi_Mainview_Panel *panel, Edi_Mainview_Item *item);