|
|
|
@ -1,14 +1,5 @@ |
|
|
|
|
#include "ephoto.h" |
|
|
|
|
|
|
|
|
|
/*Ephoto Databasing Global Variables*/ |
|
|
|
|
static sqlite3 *db; |
|
|
|
|
|
|
|
|
|
/*Ephoto Ecore Global Variables*/ |
|
|
|
|
static Ecore_List *albums; |
|
|
|
|
|
|
|
|
|
/*Ephoto Layout Global Variable*/ |
|
|
|
|
static char **views; |
|
|
|
|
|
|
|
|
|
/*Ewl Callbacks*/ |
|
|
|
|
static void combo_changed(Ewl_Widget *w, void *event, void *data); |
|
|
|
|
static void destroy(Ewl_Widget *w, void *event, void *data); |
|
|
|
@ -30,37 +21,33 @@ static void *views_data_fetch(void *data, unsigned int row, unsigned int column) |
|
|
|
|
static int views_data_count(void *data); |
|
|
|
|
|
|
|
|
|
/*Ephoto Global Variables*/ |
|
|
|
|
Ewl_Widget *atree, *tbar, *vcombo, *view_box, *fbox_vbox, *edit_vbox, *list_vbox, *fbox;
|
|
|
|
|
Ewl_Widget *eimage, *ltree, *ilabel, *currenta, *currentf, *currenti, *toolbar, *edit_tools; |
|
|
|
|
Ecore_List *images; |
|
|
|
|
|
|
|
|
|
Ephoto_Main *em; |
|
|
|
|
|
|
|
|
|
/*Destroy the Main Window*/ |
|
|
|
|
static void destroy(Ewl_Widget *w, void *event, void *data) |
|
|
|
|
{ |
|
|
|
|
Ewl_Widget *window; |
|
|
|
|
|
|
|
|
|
window = data; |
|
|
|
|
ephoto_db_close(db); |
|
|
|
|
ewl_widget_destroy(window); |
|
|
|
|
ewl_main_quit(); |
|
|
|
|
ephoto_db_close(em->db); |
|
|
|
|
ewl_widget_destroy(em->win); |
|
|
|
|
ecore_list_destroy(em->albums); |
|
|
|
|
ecore_list_destroy(em->images); |
|
|
|
|
free(em->views); |
|
|
|
|
free(em); |
|
|
|
|
ewl_main_quit(); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
static void window_fullscreen(Ewl_Widget *w, void *event, void *data) |
|
|
|
|
{ |
|
|
|
|
int fullscreen; |
|
|
|
|
Ewl_Widget *window; |
|
|
|
|
|
|
|
|
|
window = data; |
|
|
|
|
fullscreen = ewl_window_fullscreen_get(EWL_WINDOW(window)); |
|
|
|
|
|
|
|
|
|
fullscreen = ewl_window_fullscreen_get(EWL_WINDOW(em->win)); |
|
|
|
|
if(!fullscreen) |
|
|
|
|
{ |
|
|
|
|
ewl_window_fullscreen_set(EWL_WINDOW(window), 1); |
|
|
|
|
ewl_window_fullscreen_set(EWL_WINDOW(em->win), 1); |
|
|
|
|
} |
|
|
|
|
else |
|
|
|
|
{ |
|
|
|
|
ewl_window_fullscreen_set(EWL_WINDOW(window), 0); |
|
|
|
|
ewl_window_fullscreen_set(EWL_WINDOW(em->win), 0); |
|
|
|
|
} |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
@ -68,44 +55,46 @@ static void window_fullscreen(Ewl_Widget *w, void *event, void *data) |
|
|
|
|
/*Create the Main Ephoto Window*/ |
|
|
|
|
void create_main_gui(void) |
|
|
|
|
{ |
|
|
|
|
Ewl_Widget *win, *vbox, *spacer, *text, *entry, *hbox; |
|
|
|
|
Ewl_Widget *vbox, *spacer, *text, *entry, *hbox; |
|
|
|
|
Ewl_Widget *rvbox, *sp, *hsep, *vsep, *image; |
|
|
|
|
Ewl_Widget *shbox, *seeker; |
|
|
|
|
|
|
|
|
|
win = ewl_window_new(); |
|
|
|
|
ewl_window_title_set(EWL_WINDOW(win), "Ephoto!"); |
|
|
|
|
ewl_window_name_set(EWL_WINDOW(win), "Ephoto!"); |
|
|
|
|
ewl_object_size_request(EWL_OBJECT(win), 777, 542); |
|
|
|
|
ewl_callback_append(win, EWL_CALLBACK_DELETE_WINDOW, destroy, win); |
|
|
|
|
ewl_widget_show(win); |
|
|
|
|
em = NULL; |
|
|
|
|
em = calloc(1, sizeof(Ephoto_Main)); |
|
|
|
|
|
|
|
|
|
em->win = ewl_window_new(); |
|
|
|
|
ewl_window_title_set(EWL_WINDOW(em->win), "Ephoto!"); |
|
|
|
|
ewl_window_name_set(EWL_WINDOW(em->win), "Ephoto!"); |
|
|
|
|
ewl_object_size_request(EWL_OBJECT(em->win), 777, 542); |
|
|
|
|
ewl_callback_append(em->win, EWL_CALLBACK_DELETE_WINDOW, destroy, NULL); |
|
|
|
|
ewl_widget_show(em->win); |
|
|
|
|
|
|
|
|
|
vbox = ewl_vbox_new(); |
|
|
|
|
ewl_box_spacing_set(EWL_BOX(vbox), 5); |
|
|
|
|
ewl_object_fill_policy_set(EWL_OBJECT(vbox), EWL_FLAG_FILL_ALL); |
|
|
|
|
ewl_container_child_append(EWL_CONTAINER(win), vbox); |
|
|
|
|
ewl_container_child_append(EWL_CONTAINER(em->win), vbox); |
|
|
|
|
ewl_widget_show(vbox); |
|
|
|
|
|
|
|
|
|
tbar = ewl_hbox_new(); |
|
|
|
|
ewl_object_fill_policy_set(EWL_OBJECT(tbar), EWL_FLAG_FILL_SHRINK); |
|
|
|
|
ewl_object_alignment_set(EWL_OBJECT(tbar), EWL_FLAG_ALIGN_RIGHT); |
|
|
|
|
ewl_container_child_append(EWL_CONTAINER(vbox), tbar); |
|
|
|
|
ewl_widget_show(tbar); |
|
|
|
|
em->tbar = ewl_hbox_new(); |
|
|
|
|
ewl_object_fill_policy_set(EWL_OBJECT(em->tbar), EWL_FLAG_FILL_SHRINK); |
|
|
|
|
ewl_object_alignment_set(EWL_OBJECT(em->tbar), EWL_FLAG_ALIGN_RIGHT); |
|
|
|
|
ewl_container_child_append(EWL_CONTAINER(vbox), em->tbar); |
|
|
|
|
ewl_widget_show(em->tbar); |
|
|
|
|
|
|
|
|
|
vcombo = add_vcombo(tbar); |
|
|
|
|
em->vcombo = add_vcombo(em->tbar); |
|
|
|
|
|
|
|
|
|
spacer = ewl_spacer_new(); |
|
|
|
|
ewl_object_minimum_w_set(EWL_OBJECT(spacer), 100); |
|
|
|
|
ewl_object_maximum_w_set(EWL_OBJECT(spacer), 100); |
|
|
|
|
ewl_container_child_append(EWL_CONTAINER(tbar), spacer); |
|
|
|
|
ewl_container_child_append(EWL_CONTAINER(em->tbar), spacer); |
|
|
|
|
ewl_widget_show(spacer); |
|
|
|
|
|
|
|
|
|
entry = ewl_entry_new(); |
|
|
|
|
ewl_object_minimum_size_set(EWL_OBJECT(entry), 157, 22); |
|
|
|
|
ewl_object_maximum_size_set(EWL_OBJECT(entry), 157, 22); |
|
|
|
|
ewl_container_child_append(EWL_CONTAINER(tbar), entry); |
|
|
|
|
ewl_container_child_append(EWL_CONTAINER(em->tbar), entry); |
|
|
|
|
ewl_widget_show(entry); |
|
|
|
|
|
|
|
|
|
add_button(tbar, "Find", NULL, NULL, NULL); |
|
|
|
|
add_button(em->tbar, "Find", NULL, NULL, NULL); |
|
|
|
|
|
|
|
|
|
hbox = ewl_hbox_new(); |
|
|
|
|
ewl_box_spacing_set(EWL_BOX(hbox), 2); |
|
|
|
@ -113,8 +102,8 @@ void create_main_gui(void) |
|
|
|
|
ewl_container_child_append(EWL_CONTAINER(vbox), hbox); |
|
|
|
|
ewl_widget_show(hbox); |
|
|
|
|
|
|
|
|
|
atree = add_atree(hbox); |
|
|
|
|
ewl_object_maximum_w_set(EWL_OBJECT(atree), 172); |
|
|
|
|
em->atree = add_atree(hbox); |
|
|
|
|
ewl_object_maximum_w_set(EWL_OBJECT(em->atree), 172); |
|
|
|
|
|
|
|
|
|
rvbox = ewl_vbox_new(); |
|
|
|
|
ewl_box_spacing_set(EWL_BOX(rvbox), 1); |
|
|
|
@ -122,111 +111,69 @@ void create_main_gui(void) |
|
|
|
|
ewl_container_child_append(EWL_CONTAINER(hbox), rvbox); |
|
|
|
|
ewl_widget_show(rvbox); |
|
|
|
|
|
|
|
|
|
view_box = ewl_notebook_new(); |
|
|
|
|
ewl_notebook_tabbar_visible_set(EWL_NOTEBOOK(view_box), 0); |
|
|
|
|
ewl_object_fill_policy_set(EWL_OBJECT(view_box), EWL_FLAG_FILL_ALL); |
|
|
|
|
ewl_container_child_append(EWL_CONTAINER(rvbox), view_box); |
|
|
|
|
ewl_widget_show(view_box); |
|
|
|
|
|
|
|
|
|
fbox_vbox = ewl_vbox_new(); |
|
|
|
|
ewl_object_fill_policy_set(EWL_OBJECT(fbox_vbox), EWL_FLAG_FILL_ALL); |
|
|
|
|
ewl_container_child_append(EWL_CONTAINER(view_box), fbox_vbox); |
|
|
|
|
ewl_widget_show(fbox_vbox); |
|
|
|
|
ewl_notebook_page_tab_text_set(EWL_NOTEBOOK(view_box), fbox_vbox, "Normal"); |
|
|
|
|
|
|
|
|
|
sp = ewl_scrollpane_new(); |
|
|
|
|
ewl_object_fill_policy_set(EWL_OBJECT(sp), EWL_FLAG_FILL_ALL); |
|
|
|
|
ewl_container_child_append(EWL_CONTAINER(fbox_vbox), sp); |
|
|
|
|
ewl_widget_show(sp); |
|
|
|
|
|
|
|
|
|
fbox = ewl_hfreebox_new(); |
|
|
|
|
ewl_object_fill_policy_set(EWL_OBJECT(fbox), EWL_FLAG_FILL_ALL); |
|
|
|
|
ewl_container_child_append(EWL_CONTAINER(sp), fbox); |
|
|
|
|
ewl_widget_show(fbox); |
|
|
|
|
|
|
|
|
|
edit_vbox = ewl_vbox_new(); |
|
|
|
|
ewl_object_fill_policy_set(EWL_OBJECT(edit_vbox), EWL_FLAG_FILL_ALL); |
|
|
|
|
ewl_container_child_append(EWL_CONTAINER(view_box), edit_vbox); |
|
|
|
|
ewl_widget_show(edit_vbox); |
|
|
|
|
ewl_notebook_page_tab_text_set(EWL_NOTEBOOK(view_box), edit_vbox, "Edit"); |
|
|
|
|
|
|
|
|
|
eimage = add_image(edit_vbox, NULL, 0, NULL, NULL); |
|
|
|
|
ewl_object_alignment_set(EWL_OBJECT(eimage), EWL_FLAG_ALIGN_CENTER); |
|
|
|
|
ewl_object_fill_policy_set(EWL_OBJECT(eimage), EWL_FLAG_FILL_SHRINK); |
|
|
|
|
|
|
|
|
|
list_vbox = ewl_vbox_new(); |
|
|
|
|
ewl_object_fill_policy_set(EWL_OBJECT(list_vbox), EWL_FLAG_FILL_ALL); |
|
|
|
|
ewl_container_child_append(EWL_CONTAINER(view_box), list_vbox); |
|
|
|
|
ewl_widget_show(list_vbox); |
|
|
|
|
ewl_notebook_page_tab_text_set(EWL_NOTEBOOK(view_box), list_vbox, "List"); |
|
|
|
|
|
|
|
|
|
ltree = add_ltree(list_vbox);
|
|
|
|
|
em->view_box = ewl_notebook_new(); |
|
|
|
|
ewl_notebook_tabbar_visible_set(EWL_NOTEBOOK(em->view_box), 0); |
|
|
|
|
ewl_object_fill_policy_set(EWL_OBJECT(em->view_box), EWL_FLAG_FILL_ALL); |
|
|
|
|
ewl_container_child_append(EWL_CONTAINER(rvbox), em->view_box); |
|
|
|
|
ewl_widget_show(em->view_box); |
|
|
|
|
|
|
|
|
|
ilabel = add_label(rvbox, "Image Information", 1); |
|
|
|
|
add_normal_view(em->view_box); |
|
|
|
|
|
|
|
|
|
/*shbox = ewl_hbox_new();
|
|
|
|
|
ewl_object_alignment_set(EWL_OBJECT(shbox), EWL_FLAG_ALIGN_RIGHT); |
|
|
|
|
ewl_object_fill_policy_set(EWL_OBJECT(shbox), EWL_FLAG_FILL_SHRINK); |
|
|
|
|
ewl_container_child_append(EWL_CONTAINER(vbox), shbox); |
|
|
|
|
ewl_widget_show(shbox); |
|
|
|
|
add_edit_view(em->view_box); |
|
|
|
|
|
|
|
|
|
seeker = ewl_hseeker_new(); |
|
|
|
|
ewl_object_maximum_w_set(EWL_OBJECT(seeker), 150); |
|
|
|
|
ewl_object_alignment_set(EWL_OBJECT(seeker), EWL_FLAG_ALIGN_RIGHT); |
|
|
|
|
ewl_container_child_append(EWL_CONTAINER(shbox), seeker); |
|
|
|
|
ewl_widget_show(seeker);*/ |
|
|
|
|
add_list_view(em->view_box);
|
|
|
|
|
|
|
|
|
|
hsep = ewl_hseparator_new(); |
|
|
|
|
ewl_container_child_append(EWL_CONTAINER(vbox), hsep); |
|
|
|
|
ewl_widget_show(hsep); |
|
|
|
|
|
|
|
|
|
toolbar = ewl_toolbar_new(); |
|
|
|
|
ewl_box_spacing_set(EWL_BOX(toolbar), 5); |
|
|
|
|
ewl_object_minimum_h_set(EWL_OBJECT(toolbar), 30); |
|
|
|
|
ewl_object_alignment_set(EWL_OBJECT(toolbar), EWL_FLAG_ALIGN_CENTER); |
|
|
|
|
ewl_object_fill_policy_set(EWL_OBJECT(toolbar), EWL_FLAG_FILL_SHRINK); |
|
|
|
|
ewl_container_child_append(EWL_CONTAINER(vbox), toolbar); |
|
|
|
|
ewl_widget_show(toolbar); |
|
|
|
|
em->toolbar = ewl_toolbar_new(); |
|
|
|
|
ewl_box_spacing_set(EWL_BOX(em->toolbar), 5); |
|
|
|
|
ewl_object_minimum_h_set(EWL_OBJECT(em->toolbar), 30); |
|
|
|
|
ewl_object_alignment_set(EWL_OBJECT(em->toolbar), EWL_FLAG_ALIGN_CENTER); |
|
|
|
|
ewl_object_fill_policy_set(EWL_OBJECT(em->toolbar), EWL_FLAG_FILL_SHRINK); |
|
|
|
|
ewl_container_child_append(EWL_CONTAINER(vbox), em->toolbar); |
|
|
|
|
ewl_widget_show(em->toolbar); |
|
|
|
|
|
|
|
|
|
image = add_image(toolbar, PACKAGE_DATA_DIR "/images/normal_view.png", 0, show_normal_view, NULL); |
|
|
|
|
image = add_image(em->toolbar, PACKAGE_DATA_DIR "/images/normal_view.png", 0, show_normal_view, NULL); |
|
|
|
|
ewl_image_constrain_set(EWL_IMAGE(image), 30); |
|
|
|
|
|
|
|
|
|
image = add_image(toolbar, PACKAGE_DATA_DIR "/images/edit_view.png", 0, show_edit_view, NULL); |
|
|
|
|
image = add_image(em->toolbar, PACKAGE_DATA_DIR "/images/edit_view.png", 0, show_edit_view, NULL); |
|
|
|
|
ewl_image_constrain_set(EWL_IMAGE(image), 30); |
|
|
|
|
|
|
|
|
|
image = add_image(toolbar, PACKAGE_DATA_DIR "/images/list_view.png", 0, show_list_view, NULL); |
|
|
|
|
image = add_image(em->toolbar, PACKAGE_DATA_DIR "/images/list_view.png", 0, show_list_view, NULL); |
|
|
|
|
ewl_image_constrain_set(EWL_IMAGE(image), 30); |
|
|
|
|
|
|
|
|
|
vsep = ewl_vseparator_new(); |
|
|
|
|
ewl_container_child_append(EWL_CONTAINER(toolbar), vsep); |
|
|
|
|
ewl_container_child_append(EWL_CONTAINER(em->toolbar), vsep); |
|
|
|
|
ewl_widget_show(vsep); |
|
|
|
|
|
|
|
|
|
image = add_image(toolbar, PACKAGE_DATA_DIR "/images/get_exif.png", 0, display_exif_dialog, NULL); |
|
|
|
|
image = add_image(em->toolbar, PACKAGE_DATA_DIR "/images/get_exif.png", 0, display_exif_dialog, NULL); |
|
|
|
|
ewl_image_constrain_set(EWL_IMAGE(image), 30); |
|
|
|
|
|
|
|
|
|
image = add_image(toolbar, PACKAGE_DATA_DIR "/images/stock_fullscreen.png", 0, window_fullscreen, win); |
|
|
|
|
image = add_image(em->toolbar, PACKAGE_DATA_DIR "/images/stock_fullscreen.png", 0, window_fullscreen, NULL); |
|
|
|
|
ewl_image_constrain_set(EWL_IMAGE(image), 30); |
|
|
|
|
|
|
|
|
|
image = add_image(toolbar, PACKAGE_DATA_DIR "/images/x-office-presentation.png", 0, NULL, NULL); |
|
|
|
|
image = add_image(em->toolbar, PACKAGE_DATA_DIR "/images/x-office-presentation.png", 0, NULL, NULL); |
|
|
|
|
ewl_image_constrain_set(EWL_IMAGE(image), 30); |
|
|
|
|
|
|
|
|
|
vsep = ewl_vseparator_new(); |
|
|
|
|
ewl_container_child_append(EWL_CONTAINER(toolbar), vsep); |
|
|
|
|
ewl_container_child_append(EWL_CONTAINER(em->toolbar), vsep); |
|
|
|
|
ewl_widget_show(vsep); |
|
|
|
|
|
|
|
|
|
edit_tools = ewl_hbox_new(); |
|
|
|
|
ewl_object_fill_policy_set(EWL_OBJECT(edit_tools), EWL_FLAG_FILL_HFILL); |
|
|
|
|
ewl_container_child_append(EWL_CONTAINER(toolbar), edit_tools); |
|
|
|
|
ewl_widget_show(edit_tools); |
|
|
|
|
em->edit_tools = ewl_hbox_new(); |
|
|
|
|
ewl_object_fill_policy_set(EWL_OBJECT(em->edit_tools), EWL_FLAG_FILL_HFILL); |
|
|
|
|
ewl_container_child_append(EWL_CONTAINER(em->toolbar), em->edit_tools); |
|
|
|
|
ewl_widget_show(em->edit_tools); |
|
|
|
|
|
|
|
|
|
add_edit_tools(edit_tools); |
|
|
|
|
ewl_widget_hide(edit_tools); |
|
|
|
|
add_edit_tools(em->edit_tools); |
|
|
|
|
ewl_widget_hide(em->edit_tools); |
|
|
|
|
|
|
|
|
|
albums = ecore_list_new(); |
|
|
|
|
db = ephoto_db_init(); |
|
|
|
|
albums = ephoto_db_list_albums(db); |
|
|
|
|
em->albums = ecore_list_new(); |
|
|
|
|
em->db = ephoto_db_init(); |
|
|
|
|
em->albums = ephoto_db_list_albums(em->db); |
|
|
|
|
|
|
|
|
|
ewl_mvc_data_set(EWL_MVC(atree), albums); |
|
|
|
|
ewl_mvc_data_set(EWL_MVC(em->atree), em->albums); |
|
|
|
|
|
|
|
|
|
populate(NULL, NULL, "Complete Library"); |
|
|
|
|
|
|
|
|
@ -244,47 +191,47 @@ static void populate(Ewl_Widget *w, void *event, void *data) |
|
|
|
|
if (w) |
|
|
|
|
{ |
|
|
|
|
album = (char *)ewl_widget_name_get(w); |
|
|
|
|
if (currenta)
|
|
|
|
|
if (em->currenta)
|
|
|
|
|
{ |
|
|
|
|
ewl_widget_state_set(currenta, "unselected", EWL_STATE_PERSISTENT); |
|
|
|
|
ewl_widget_state_set(EWL_ICON(currenta)->label, "default", EWL_STATE_PERSISTENT); |
|
|
|
|
ewl_widget_state_set(em->currenta, "unselected", EWL_STATE_PERSISTENT); |
|
|
|
|
ewl_widget_state_set(EWL_ICON(em->currenta)->label, "default", EWL_STATE_PERSISTENT); |
|
|
|
|
} |
|
|
|
|
currenta = w; |
|
|
|
|
ewl_widget_state_set(currenta, "selected", EWL_STATE_PERSISTENT); |
|
|
|
|
ewl_widget_state_set(EWL_ICON(currenta)->label, "blue", EWL_STATE_PERSISTENT); |
|
|
|
|
em->currenta = w; |
|
|
|
|
ewl_widget_state_set(em->currenta, "selected", EWL_STATE_PERSISTENT); |
|
|
|
|
ewl_widget_state_set(EWL_ICON(em->currenta)->label, "blue", EWL_STATE_PERSISTENT); |
|
|
|
|
} |
|
|
|
|
else |
|
|
|
|
{ |
|
|
|
|
album = data; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (images) |
|
|
|
|
if (em->images) |
|
|
|
|
{ |
|
|
|
|
ecore_dlist_destroy(images); |
|
|
|
|
ecore_dlist_destroy(em->images); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
images = ecore_dlist_new(); |
|
|
|
|
images = ephoto_db_list_images(db, album); |
|
|
|
|
em->images = ecore_dlist_new(); |
|
|
|
|
em->images = ephoto_db_list_images(em->db, album); |
|
|
|
|
|
|
|
|
|
ecore_dlist_goto_first(images); |
|
|
|
|
ewl_container_reset(EWL_CONTAINER(fbox)); |
|
|
|
|
while (ecore_dlist_current(images)) |
|
|
|
|
ecore_dlist_goto_first(em->images); |
|
|
|
|
ewl_container_reset(EWL_CONTAINER(em->fbox)); |
|
|
|
|
while (ecore_dlist_current(em->images)) |
|
|
|
|
{ |
|
|
|
|
imagef = ecore_dlist_current(images); |
|
|
|
|
imagef = ecore_dlist_current(em->images); |
|
|
|
|
|
|
|
|
|
thumb = add_image(fbox, imagef, 1, set_info, NULL); |
|
|
|
|
thumb = add_image(em->fbox, imagef, 1, set_info, NULL); |
|
|
|
|
ewl_object_alignment_set(EWL_OBJECT(thumb), EWL_FLAG_ALIGN_CENTER); |
|
|
|
|
ewl_widget_name_set(thumb, imagef); |
|
|
|
|
|
|
|
|
|
ecore_dlist_next(images); |
|
|
|
|
ecore_dlist_next(em->images); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
ecore_dlist_goto_first(images); |
|
|
|
|
ecore_dlist_goto_first(em->images); |
|
|
|
|
|
|
|
|
|
ewl_mvc_data_set(EWL_MVC(ltree), images); |
|
|
|
|
ewl_mvc_dirty_set(EWL_MVC(ltree), 1); |
|
|
|
|
ewl_mvc_data_set(EWL_MVC(em->ltree), em->images); |
|
|
|
|
ewl_mvc_dirty_set(EWL_MVC(em->ltree), 1); |
|
|
|
|
|
|
|
|
|
ewl_image_file_set(EWL_IMAGE(eimage), ecore_dlist_current(images), NULL); |
|
|
|
|
ewl_image_file_set(EWL_IMAGE(em->eimage), ecore_dlist_current(em->images), NULL); |
|
|
|
|
|
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
@ -296,10 +243,10 @@ static Ewl_Widget *add_vcombo(Ewl_Widget *c) |
|
|
|
|
Ewl_Model *model; |
|
|
|
|
Ewl_View *view; |
|
|
|
|
|
|
|
|
|
views = calloc(3, sizeof(char *)); |
|
|
|
|
views[0] = strdup("Normal"); |
|
|
|
|
views[1] = strdup("Edit"); |
|
|
|
|
views[2] = strdup("List"); |
|
|
|
|
em->views = calloc(3, sizeof(char *)); |
|
|
|
|
em->views[0] = strdup("Normal"); |
|
|
|
|
em->views[1] = strdup("Edit"); |
|
|
|
|
em->views[2] = strdup("List"); |
|
|
|
|
|
|
|
|
|
model = ewl_model_new(); |
|
|
|
|
ewl_model_fetch_set(model, views_data_fetch); |
|
|
|
@ -313,7 +260,7 @@ static Ewl_Widget *add_vcombo(Ewl_Widget *c) |
|
|
|
|
combo = ewl_combo_new(); |
|
|
|
|
ewl_mvc_model_set(EWL_MVC(combo), model); |
|
|
|
|
ewl_mvc_view_set(EWL_MVC(combo), view); |
|
|
|
|
ewl_mvc_data_set(EWL_MVC(combo), views); |
|
|
|
|
ewl_mvc_data_set(EWL_MVC(combo), em->views); |
|
|
|
|
ewl_object_fill_policy_set(EWL_OBJECT(combo), EWL_FLAG_FILL_SHRINK); |
|
|
|
|
ewl_container_child_append(EWL_CONTAINER(c), combo); |
|
|
|
|
ewl_callback_append(combo, EWL_CALLBACK_VALUE_CHANGED, combo_changed, NULL); |
|
|
|
@ -337,7 +284,7 @@ static Ewl_Widget *views_header_fetch(void *data, int col) |
|
|
|
|
/*Get the data for the view combo*/ |
|
|
|
|
static void *views_data_fetch(void *data, unsigned int row, unsigned int col) |
|
|
|
|
{ |
|
|
|
|
if (row < 3) return views[row]; |
|
|
|
|
if (row < 3) return em->views[row]; |
|
|
|
|
else return NULL; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -354,15 +301,15 @@ static void combo_changed(Ewl_Widget *w, void *event, void *data) |
|
|
|
|
|
|
|
|
|
idx = ewl_mvc_selected_get(EWL_MVC(w)); |
|
|
|
|
|
|
|
|
|
if (!strcmp(views[idx->row], "Normal")) |
|
|
|
|
if (!strcmp(em->views[idx->row], "Normal")) |
|
|
|
|
{ |
|
|
|
|
show_normal_view(NULL, NULL, NULL); |
|
|
|
|
} |
|
|
|
|
else if (!strcmp(views[idx->row], "Edit")) |
|
|
|
|
else if (!strcmp(em->views[idx->row], "Edit")) |
|
|
|
|
{ |
|
|
|
|
show_edit_view(NULL, NULL, NULL); |
|
|
|
|
} |
|
|
|
|
else if (!strcmp(views[idx->row], "List")) |
|
|
|
|
else if (!strcmp(em->views[idx->row], "List")) |
|
|
|
|
{ |
|
|
|
|
show_list_view(NULL, NULL, NULL); |
|
|
|
|
} |
|
|
|
@ -383,6 +330,7 @@ static Ewl_Widget *add_atree(Ewl_Widget *c) |
|
|
|
|
|
|
|
|
|
tree = ewl_tree2_new(); |
|
|
|
|
ewl_tree2_headers_visible_set(EWL_TREE2(tree), 0); |
|
|
|
|
ewl_tree2_fixed_rows_set(EWL_TREE2(tree), 1); |
|
|
|
|
ewl_mvc_model_set(EWL_MVC(tree), model); |
|
|
|
|
ewl_mvc_selection_mode_set(EWL_MVC(tree), EWL_SELECTION_MODE_SINGLE); |
|
|
|
|
ewl_object_fill_policy_set(EWL_OBJECT(tree), EWL_FLAG_FILL_ALL); |
|
|
|
@ -447,7 +395,7 @@ static void *album_data_fetch(void *data, unsigned int row, unsigned int column) |
|
|
|
|
char *album; |
|
|
|
|
void *val = NULL; |
|
|
|
|
|
|
|
|
|
album = ecore_list_goto_index(albums, row); |
|
|
|
|
album = ecore_list_goto_index(em->albums, row); |
|
|
|
|
if (album) |
|
|
|
|
{ |
|
|
|
|
val = album; |
|
|
|
@ -461,7 +409,7 @@ static int album_data_count(void *data) |
|
|
|
|
{ |
|
|
|
|
int val; |
|
|
|
|
|
|
|
|
|
val = ecore_list_nodes(albums); |
|
|
|
|
val = ecore_list_nodes(em->albums); |
|
|
|
|
|
|
|
|
|
return val; |
|
|
|
|
} |
|
|
|
|