Enlightenment CVS committal Author : titan Project : e17 Module : apps/ephoto
Dir : e17/apps/ephoto/src/bin Modified Files: ephoto_list_view.c ephoto_main.c Log Message: Update ephoto to the api breakage for ewl mvc widgets. =================================================================== RCS file: /cvs/e/e17/apps/ephoto/src/bin/ephoto_list_view.c,v retrieving revision 1.12 retrieving revision 1.13 diff -u -3 -r1.12 -r1.13 --- ephoto_list_view.c 21 Mar 2007 10:40:27 -0000 1.12 +++ ephoto_list_view.c 23 Mar 2007 23:10:28 -0000 1.13 @@ -1,7 +1,6 @@ #include "ephoto.h" -static Ewl_Widget *list_view_new(void); -static void list_view_assign(Ewl_Widget *w, void *data); +static Ewl_Widget *list_view_new(void *data, int column, int row); static Ewl_Widget *list_header_fetch(void *data, int column); static void *list_data_fetch(void *data, unsigned int row, unsigned int column); static int list_data_count(void *data); @@ -61,8 +60,7 @@ ewl_widget_show(tree); view = ewl_view_new(); - ewl_view_constructor_set(view, list_view_new); - ewl_view_assign_set(view, list_view_assign); + ewl_view_widget_fetch_set(view, list_view_new); ewl_view_header_fetch_set(view, list_header_fetch); ewl_tree2_column_append(EWL_TREE2(tree), view, FALSE); @@ -71,48 +69,37 @@ /* The view of the images */ -static Ewl_Widget *list_view_new(void) +static Ewl_Widget *list_view_new(void *data, int row, int column) { - Ewl_Widget *hbox; + const char *image; + char info[PATH_MAX]; + int size, width, height; + Ewl_Widget *hbox, *img, *text; + + image = data; + image_pixels_int_get(image, &width, &height); + size = ecore_file_size(image); + snprintf(info, PATH_MAX, "Name: %s\nPixels: %s\nSize: %s\n", + basename((char *)image), + image_pixels_string_get(image), + file_size_get(size)); hbox = ewl_hbox_new(); ewl_box_spacing_set(EWL_BOX(hbox), 10); ewl_object_fill_policy_set(EWL_OBJECT(hbox), EWL_FLAG_FILL_HFILL); ewl_callback_append(hbox, EWL_CALLBACK_CLICKED, set_active_list_view, NULL); + ewl_widget_name_set(hbox, image); ewl_widget_show(hbox); + img = add_image(hbox, image, 1, NULL, NULL); + ewl_image_constrain_set(EWL_IMAGE(img), 64); + + text = add_text(hbox, info); + ewl_object_fill_policy_set(EWL_OBJECT(text), EWL_FLAG_FILL_SHRINK); + ewl_object_alignment_set(EWL_OBJECT(text), EWL_FLAG_ALIGN_LEFT); + return hbox; } - -/*The row that is added to the tree*/ -static void list_view_assign(Ewl_Widget *w, void *data) -{ - const char *image; - char info[PATH_MAX]; - int size; - int width, height; - Ewl_Widget *img, *text; - - image = data; - image_pixels_int_get(image, &width, &height); - - img = add_image(w, image, 1, NULL, NULL); - ewl_image_constrain_set(EWL_IMAGE(img), 64); - ewl_widget_name_set(w, image); - - size = ecore_file_size(image); - - snprintf(info, PATH_MAX, "Name: %s\nPixels: %s\nSize: %s\n", - basename((char *)image), - image_pixels_string_get(image), - file_size_get(size)); - - text = add_text(w, info); - ewl_object_fill_policy_set(EWL_OBJECT(text), EWL_FLAG_FILL_SHRINK); - ewl_object_alignment_set(EWL_OBJECT(text), EWL_FLAG_ALIGN_LEFT); - - return; -} /* The header for the tree */ static Ewl_Widget *list_header_fetch(void *data, int column) =================================================================== RCS file: /cvs/e/e17/apps/ephoto/src/bin/ephoto_main.c,v retrieving revision 1.16 retrieving revision 1.17 diff -u -3 -r1.16 -r1.17 --- ephoto_main.c 21 Mar 2007 10:43:23 -0000 1.16 +++ ephoto_main.c 23 Mar 2007 23:10:28 -0000 1.17 @@ -9,8 +9,7 @@ static Ewl_Widget *add_atree(Ewl_Widget *c); /*Ephoto MVC Callbacks*/ -static Ewl_Widget *album_view_new(void); -static void album_view_assign(Ewl_Widget *w, void *data); +static Ewl_Widget *album_view_new(void *data, int column, int row); static Ewl_Widget *album_header_fetch(void *data, int column); static void *album_data_fetch(void *data, unsigned int row, unsigned int column); static int album_data_count(void *data); @@ -246,8 +245,7 @@ ewl_widget_show(tree); view = ewl_view_new(); - ewl_view_constructor_set(view, album_view_new); - ewl_view_assign_set(view, album_view_assign); + ewl_view_widget_fetch_set(view, album_view_new); ewl_view_header_fetch_set(view, album_header_fetch); ewl_tree2_column_append(EWL_TREE2(tree), view, FALSE); @@ -256,34 +254,27 @@ /* The view of the users albums */ -static Ewl_Widget *album_view_new(void) +static Ewl_Widget *album_view_new(void *data, int column, int row) { + const char *album; Ewl_Widget *icon; + album = data; + icon = ewl_icon_new(); ewl_icon_thumbnailing_set(EWL_ICON(icon), FALSE); + ewl_icon_image_set(EWL_ICON(icon), PACKAGE_DATA_DIR "/images/image.png", NULL); + ewl_icon_label_set(EWL_ICON(icon), album); + ewl_icon_constrain_set(EWL_ICON(icon), 25); ewl_box_orientation_set(EWL_BOX(icon), EWL_ORIENTATION_HORIZONTAL); ewl_object_alignment_set(EWL_OBJECT(icon), EWL_FLAG_ALIGN_LEFT); ewl_object_fill_policy_set(EWL_OBJECT(icon), EWL_FLAG_FILL_ALL); + ewl_callback_append(icon, EWL_CALLBACK_CLICKED, populate, NULL); + ewl_widget_name_set(icon, album); ewl_widget_show(icon); return icon; } - -/*The row that is added to the tree*/ -static void album_view_assign(Ewl_Widget *w, void *data) -{ - const char *album; - - album = data; - ewl_icon_image_set(EWL_ICON(w), PACKAGE_DATA_DIR "/images/image.png", NULL); - ewl_icon_label_set(EWL_ICON(w), album); - ewl_icon_constrain_set(EWL_ICON(w), 25); - ewl_widget_name_set(w, album); - ewl_callback_append(w, EWL_CALLBACK_CLICKED, populate, NULL); - - return; -} /* The header for the tree */ static Ewl_Widget *album_header_fetch(void *data, int column) ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ enlightenment-cvs mailing list enlightenment-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs