Commit fa9093f1 authored by Hugo Beauzée-Luyssen's avatar Hugo Beauzée-Luyssen

Remove now useless view_sys_cb

parent f83645b4
......@@ -48,11 +48,6 @@ intf_destroy(interface *);
/* Views */
typedef struct view_sys view_sys;
typedef struct view_sys_cb {
view_sys* p_sys;
void (*pf_updated)( view_sys* p_sys, bool b_empty );
} view_sys_cb;
typedef enum interface_view_event {
INTERFACE_VIEW_EVENT_NONE,
INTERFACE_VIEW_EVENT_BACK,
......
......@@ -101,13 +101,12 @@ audio_list_artist_view_append_item(list_sys *p_sys, void* p_data)
/* */
elm_object_item_del_cb_set(it, free_list_item_data);
p_sys->p_view_cb->pf_updated(p_sys->p_view_cb->p_sys, false);
list_view_toggle_empty(p_sys, false);
return ali;
}
list_view*
audio_list_artist_view_create(application* p_app, interface* p_intf, Evas_Object* p_parent, view_sys_cb* p_view_cb)
audio_list_artist_view_create(application* p_app, interface* p_intf, Evas_Object* p_parent)
{
list_view* p_view = calloc(1, sizeof(*p_view));
if (p_view == NULL)
......@@ -116,7 +115,7 @@ audio_list_artist_view_create(application* p_app, interface* p_intf, Evas_Object
if (p_sys == NULL)
return NULL;
list_view_common_setup(p_view, p_sys, p_intf, p_view_cb, p_parent);
list_view_common_setup(p_view, p_sys, p_intf, p_parent);
evas_object_size_hint_weight_set(p_sys->p_list, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
evas_object_size_hint_align_set(p_sys->p_list, EVAS_HINT_FILL, EVAS_HINT_FILL);
......
......@@ -30,6 +30,6 @@
#include "ui/interface.h"
list_view*
audio_list_artist_view_create(application* p_app, interface* p_intf, Evas_Object* p_parent, view_sys_cb* p_view_cb);
audio_list_artist_view_create(application* p_app, interface* p_intf, Evas_Object* p_parent);
#endif // AUDIO_LIST_ARTIST_VIEW_H_
......@@ -154,7 +154,7 @@ audio_list_song_view_append_item(list_sys *p_sys, void* p_data)
}
list_view*
audio_list_song_view_create(application* p_app, interface* p_intf, Evas_Object* p_parent, view_sys_cb* p_view_cb)
audio_list_song_view_create(application* p_app, interface* p_intf, Evas_Object* p_parent)
{
list_view* p_view = calloc(1, sizeof(*p_view));
if (p_view == NULL)
......@@ -164,7 +164,7 @@ audio_list_song_view_create(application* p_app, interface* p_intf, Evas_Object*
return NULL;
/* Setup common parts */
list_view_common_setup(p_view, p_sys, p_intf, p_view_cb, p_parent);
list_view_common_setup(p_view, p_sys, p_intf, p_parent);
/* Connect genlist callbacks */
p_sys->p_default_item_class->func.text_get = genlist_text_get_cb;
......
......@@ -31,6 +31,6 @@
#include "ui/interface.h"
list_view*
audio_list_song_view_create(application* p_app, interface* p_intf, Evas_Object* p_parent, view_sys_cb* p_view_cb);
audio_list_song_view_create(application* p_app, interface* p_intf, Evas_Object* p_parent);
#endif // AUDIO_LIST_SONG_ITEM_H_
......@@ -59,7 +59,6 @@ struct view_sys
Evas_Object* p_overflow_menu;
list_view* p_lists[AUDIO_VIEW_MAX];
audio_view_type p_current_tab;
view_sys_cb* p_view_cb;
};
typedef struct toolbar_tab {
......@@ -78,10 +77,10 @@ create_audio_list_type(view_sys *av, audio_view_type type )
{
case AUDIO_VIEW_SONG:
default:
p_view = audio_list_song_view_create(p_app, av->p_intf, av->nf_toolbar, av->p_view_cb);
p_view = audio_list_song_view_create(p_app, av->p_intf, av->nf_toolbar);
break;
case AUDIO_VIEW_ARTIST:
p_view = audio_list_artist_view_create(p_app, av->p_intf, av->nf_toolbar, av->p_view_cb);
p_view = audio_list_artist_view_create(p_app, av->p_intf, av->nf_toolbar);
break;
}
av->p_lists[type] = p_view;
......@@ -216,12 +215,6 @@ audio_view_has_menu(view_sys *p_view_sys)
return true;
}
static void
audio_view_content_changed_cb(view_sys* p_view_sys, bool b_empty)
{
}
interface_view *
create_audio_view(interface *intf, Evas_Object *parent)
{
......@@ -231,9 +224,6 @@ create_audio_view(interface *intf, Evas_Object *parent)
view_sys *audio_view_sys = calloc(1, sizeof(*audio_view_sys));
audio_view_sys->p_intf = intf;
audio_view_sys->p_parent = parent;
view_sys_cb* p_view_cb = audio_view_sys->p_view_cb = calloc(1, sizeof(*p_view_cb));
p_view_cb->pf_updated = &audio_view_content_changed_cb;
p_view_cb->p_sys = audio_view_sys;
view->pf_event = audio_view_callback;
view->p_view_sys = audio_view_sys;
......@@ -278,7 +268,6 @@ destroy_audio_view(interface_view *view)
free(p_sys->p_lists[i]);
}
}
free(p_sys->p_view_cb);
free(p_sys);
free(view);
}
......@@ -79,10 +79,9 @@ list_view_toggle_empty(list_sys* p_list_sys, bool b_empty)
}
void
list_view_common_setup(list_view* p_view, list_sys* p_list, interface* p_intf, view_sys_cb* p_view_cb, Evas_Object* p_parent)
list_view_common_setup(list_view* p_view, list_sys* p_list, interface* p_intf, Evas_Object* p_parent)
{
p_list->p_intf = p_intf;
p_list->p_view_cb = p_view_cb;
/* Container box */
p_list->p_container = elm_box_add(p_parent);
......
......@@ -34,13 +34,12 @@
media_library_controller* p_ctrl; \
interface* p_intf; \
Elm_Genlist_Item_Class* p_default_item_class; \
view_sys_cb* p_view_cb; \
Evas_Object* p_container; \
Evas_Object* p_empty_label; \
bool b_empty;
void
list_view_common_setup(list_view* p_view, list_sys* p_list, interface* p_intf, view_sys_cb* p_view_cb, Evas_Object* p_parent);
list_view_common_setup(list_view* p_view, list_sys* p_list, interface* p_intf, Evas_Object* p_parent);
void
list_view_toggle_empty(list_sys* p_view, bool b_empty);
......
......@@ -199,7 +199,7 @@ video_view_append_item(list_sys *p_list, void* p_data)
}
list_view*
video_view_list_create(interface *p_intf, Evas_Object *p_parent, view_sys_cb* p_view_cb)
video_view_list_create(interface *p_intf, Evas_Object *p_parent)
{
list_view* p_view = calloc(1, sizeof(*p_view));
if (p_view == NULL)
......@@ -210,7 +210,7 @@ video_view_list_create(interface *p_intf, Evas_Object *p_parent, view_sys_cb* p_
return NULL;
list_view_common_setup(p_view, p_sys, p_intf, p_view_cb, p_parent);
list_view_common_setup(p_view, p_sys, p_intf, p_parent);
/* Genlist class */
p_sys->p_default_item_class->func.text_get = genlist_text_get_cb;
......
......@@ -31,6 +31,6 @@
#include "ui/interface.h"
list_view*
video_view_list_create(interface *intf, Evas_Object *p_genlist, view_sys_cb* p_view_cb);
video_view_list_create(interface *intf, Evas_Object *p_genlist);
#endif
......@@ -41,7 +41,6 @@ struct view_sys
interface* p_intf;
Evas_Object *p_parent;
list_view* p_list;
view_sys_cb* p_view_cb;
Evas_Object *p_overflow_menu;
};
......@@ -99,12 +98,6 @@ video_view_has_menu(view_sys *p_view_sys)
return true;
}
static void
video_video_content_updated_cb(view_sys* p_view_sys, bool b_empty)
{
}
interface_view*
create_video_view(interface *intf, Evas_Object *parent)
{
......@@ -114,14 +107,11 @@ create_video_view(interface *intf, Evas_Object *parent)
p_sys->p_intf = intf;
p_sys->p_parent = parent;
p_sys->p_overflow_menu = NULL;
view_sys_cb* p_view_cb = p_sys->p_view_cb = calloc(1, sizeof(*p_view_cb));
p_view_cb->pf_updated = &video_video_content_updated_cb;
p_view_cb->p_sys = p_sys;
view->pf_event = video_view_callback;
view->pf_has_menu = video_view_has_menu;
p_sys->p_list = video_view_list_create(intf, parent, p_sys->p_view_cb);
p_sys->p_list = video_view_list_create(intf, parent);
view->view = p_sys->p_list->pf_get_widget(p_sys->p_list->p_sys);
......@@ -135,7 +125,6 @@ destroy_video_view(interface_view *view)
list_view* p_list_view = view->p_view_sys->p_list;
p_list_view->pf_del(p_list_view->p_sys);
free(p_list_view);
free(view->p_view_sys->p_view_cb);
free(view->p_view_sys);
free(view);
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment