Enlightenment CVS committal
Author : titansoccer15
Project : e17
Module : proto
Dir : e17/proto/ephoto/src
Modified Files:
ephoto.c ephoto.h ephoto_browsing.c ephoto_presentation.c
Log Message:
This adds an image viewer to ephoto. You can view images and add them to the
slideshow while viewing them. look++ functionality++.
===================================================================
RCS file: /cvsroot/enlightenment/e17/proto/ephoto/src/ephoto.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -3 -r1.4 -r1.5
--- ephoto.c 25 Feb 2006 06:53:55 -0000 1.4
+++ ephoto.c 15 Mar 2006 04:22:37 -0000 1.5
@@ -1,4 +1,3 @@
-
#include "ephoto.h"
/***Global Defs***/
@@ -103,12 +102,46 @@
ewl_object_maximum_size_set(EWL_OBJECT(m->audiotree), 200, 160);
ewl_widget_show(m->audiotree);
+ m->notebook = ewl_notebook_new();
+ ewl_notebook_tabbar_position_set(EWL_NOTEBOOK(m->notebook),
EWL_POSITION_TOP);
+ ewl_container_child_append(EWL_CONTAINER(m->hbox), m->notebook);
+ ewl_object_alignment_set(EWL_OBJECT(m->notebook),
EWL_FLAG_ALIGN_CENTER);
+ ewl_object_fill_policy_set(EWL_OBJECT(m->notebook), EWL_FLAG_FILL_ALL);
+ ewl_widget_show(m->notebook);
+
+ m->viewbox = ewl_vbox_new();
+ ewl_container_child_append(EWL_CONTAINER(m->notebook), m->viewbox);
+ ewl_object_alignment_set(EWL_OBJECT(m->viewbox), EWL_FLAG_ALIGN_CENTER);
+ ewl_box_spacing_set(EWL_BOX(m->viewbox), 10);
+ ewl_object_fill_policy_set(EWL_OBJECT(m->viewbox), EWL_FLAG_FILL_ALL);
+ ewl_widget_show(m->viewbox);
+
+ m->vimage = ewl_image_new();
+ ewl_object_fill_policy_set(EWL_OBJECT(m->vimage), EWL_FLAG_FILL_ALL);
+ ewl_image_proportional_set(EWL_IMAGE(m->vimage), TRUE);
+ ewl_container_child_append(EWL_CONTAINER(m->viewbox), m->vimage);
+ ewl_widget_show(m->vimage);
+
+ m->vbutton = ewl_button_new();
+ ewl_button_label_set(EWL_BUTTON(m->vbutton), "Add image to slideshow");
+ ewl_container_child_append(EWL_CONTAINER(m->viewbox), m->vbutton);
+ ewl_object_maximum_size_set(EWL_OBJECT(m->vbutton), 150 , 25);
+ ewl_object_alignment_set(EWL_OBJECT(m->vbutton), EWL_FLAG_ALIGN_CENTER);
+ ewl_callback_append(m->vbutton, EWL_CALLBACK_CLICKED, images_cb, NULL);
+ ewl_widget_disable(m->vbutton);
+ ewl_widget_state_set(m->vbutton, "disabled");
+ ewl_widget_show(m->vbutton);
+
+ ewl_notebook_page_tab_text_set(EWL_NOTEBOOK(m->notebook), m->viewbox,
"View Image");
+
m->vbox2 = ewl_vbox_new();
- ewl_container_child_append(EWL_CONTAINER(m->hbox), m->vbox2);
+ ewl_container_child_append(EWL_CONTAINER(m->notebook), m->vbox2);
ewl_object_alignment_set(EWL_OBJECT(m->vbox2), EWL_FLAG_ALIGN_CENTER);
ewl_box_spacing_set(EWL_BOX(m->vbox2), 10);
ewl_object_size_request(EWL_OBJECT(m->vbox2), 20, 400);
ewl_widget_show(m->vbox2);
+
+ ewl_notebook_page_tab_text_set(EWL_NOTEBOOK(m->notebook), m->vbox2,
"Slideshow/Presentation");
m->content = ewl_border_new();
ewl_border_text_set(EWL_BORDER(m->content), "Content");
===================================================================
RCS file: /cvsroot/enlightenment/e17/proto/ephoto/src/ephoto.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -3 -r1.4 -r1.5
--- ephoto.h 22 Feb 2006 06:30:25 -0000 1.4
+++ ephoto.h 15 Mar 2006 04:22:37 -0000 1.5
@@ -21,11 +21,11 @@
void previous_cb(Ewl_Widget *w, void *event, void *data);
void next_cb(Ewl_Widget *w, void *event, void *data);
void first_cb(Ewl_Widget *w, void *event, void *data);
- void slideshow_cb(Ewl_Widget *w, void *event, void *data);
+void slideshow_cb(Ewl_Widget *w, void *event, void *data);
int _change_picture_cb(void *data);
void destroyp_cb(Ewl_Widget *w, void *event, void *data);
void destroys_cb(Ewl_Widget *w, void *event, void *data);
- void destroy_cb(Ewl_Widget *w, void *event, void *data);
+void destroy_cb(Ewl_Widget *w, void *event, void *data);
void populatei_cb(Ewl_Widget *w, void *event, void *data);
void populatea_cb(Ewl_Widget *w, void *event, void *data);
void images_cb(Ewl_Widget *w, void *event, void *data);
@@ -78,6 +78,10 @@
Ewl_Widget *audiolen;
Ewl_Widget *loopcheck;
Ewl_Widget *i;
+ Ewl_Widget *notebook;
+ Ewl_Widget *vimage;
+ Ewl_Widget *viewbox;
+ Ewl_Widget *vbutton;
Ecore_List *imagelist;
Ecore_List *presentlist;
};
===================================================================
RCS file: /cvsroot/enlightenment/e17/proto/ephoto/src/ephoto_browsing.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -3 -r1.8 -r1.9
--- ephoto_browsing.c 25 Feb 2006 06:53:55 -0000 1.8
+++ ephoto_browsing.c 15 Mar 2006 04:22:37 -0000 1.9
@@ -434,30 +434,47 @@
char imagedb[PATH_MAX];
char tempcheck[PATH_MAX];
char equiv[PATH_MAX];
+ Ewl_Widget *page;
/********************************************************/
- pathi = ewl_widget_name_get(w);
- name = basename(pathi);
-
- /**********Add the images to the iconbox and list**********/
- m->i = ewl_iconbox_icon_add(EWL_ICONBOX(m->ib), name, pathi);
- ewl_callback_append(m->i, EWL_CALLBACK_CLICKED, iremove_cb, NULL);
- ewl_widget_name_set(m->i, pathi);
+ if ( w == m->vbutton ) {
+ pathi = ewl_image_file_path_get(EWL_IMAGE(m->vimage));
+ name = basename(pathi);
+ }
- ewl_iconbox_icon_arrange(EWL_ICONBOX(m->ib));
+ else {
+ pathi = ewl_widget_name_get(w);
+ name = basename(pathi);
+ }
- ecore_dlist_append(m->imagelist, strdup(pathi));
- slidenum++;
+ page = ewl_notebook_visible_page_get(EWL_NOTEBOOK(m->notebook));
- //home = getenv("HOME");
- //snprintf(imagedb, PATH_MAX, "%s/ephoto_images", home);
- //printf("%s\n", imagedb);
- //snprintf(tempcheck, PATH_MAX, "%s/%s", imagedb, name);
- //printf("%s\n", tempcheck);
- //if ( !ecore_file_exists(tempcheck) ) {
- // snprintf(equiv, PATH_MAX, "%s", pathi);
- // printf("%s\n", equiv);
- // ecore_file_cp(equiv, tempcheck);
- //}
+ /**********Add the images to the iconbox and list**********/
+ if ( page == m->vbox2 || w == m->vbutton ) {
+ m->i = ewl_iconbox_icon_add(EWL_ICONBOX(m->ib), name, pathi);
+ ewl_callback_append(m->i, EWL_CALLBACK_CLICKED, iremove_cb,
NULL);
+ ewl_widget_name_set(m->i, pathi);
+
+ ewl_iconbox_icon_arrange(EWL_ICONBOX(m->ib));
+
+ ecore_dlist_append(m->imagelist, strdup(pathi));
+ slidenum++;
+
+ //home = getenv("HOME");
+ //snprintf(imagedb, PATH_MAX, "%s/ephoto_images", home);
+ //printf("%s\n", imagedb);
+ //snprintf(tempcheck, PATH_MAX, "%s/%s", imagedb, name);
+ //printf("%s\n", tempcheck);
+ //if ( !ecore_file_exists(tempcheck) ) {
+ // snprintf(equiv, PATH_MAX, "%s", pathi);
+ // printf("%s\n", equiv);
+ // ecore_file_cp(equiv, tempcheck);
+ //}
+ }
+ if ( page == m->viewbox && w != m->vbutton ) {
+ ewl_image_file_set(EWL_IMAGE(m->vimage), pathi, NULL);
+ ewl_widget_enable(m->vbutton);
+ ewl_widget_state_set(m->vbutton, "enabled");
+ }
/**********************************************************/
/****Enable the slideshow and presentation buttons so we can get to
work****/
===================================================================
RCS file: /cvsroot/enlightenment/e17/proto/ephoto/src/ephoto_presentation.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -3 -r1.5 -r1.6
--- ephoto_presentation.c 23 Feb 2006 05:31:54 -0000 1.5
+++ ephoto_presentation.c 15 Mar 2006 04:22:37 -0000 1.6
@@ -37,6 +37,7 @@
s->text = NULL;
}
s->screen = ewl_image_new();
+ ewl_image_proportional_set(EWL_IMAGE(s->screen), TRUE);
ewl_theme_data_str_set(s->screen, "/image/group", "entry");
ewl_image_file_set(EWL_IMAGE(s->screen), picture1, NULL);
ewl_object_alignment_set(EWL_OBJECT(s->screen), EWL_FLAG_ALIGN_CENTER);
@@ -57,6 +58,7 @@
hsize = ewl_text_text_get(EWL_TEXT(m->hsize));
h = atoi(hsize);
s->screen = ewl_image_new();
+ ewl_image_proportional_set(EWL_IMAGE(s->screen), TRUE);
ewl_theme_data_str_set(s->screen, "/image/group", "entry");
ewl_object_fill_policy_set(EWL_OBJECT(s->screen),
EWL_FLAG_FILL_SHRINK);
ewl_image_file_set(EWL_IMAGE(s->screen), picture2, NULL);
@@ -178,6 +180,7 @@
/*******************************************************************/
pic1 = ecore_dlist_goto_first(m->imagelist);
s->screen = ewl_image_new();
+ ewl_image_proportional_set(EWL_IMAGE(s->screen), TRUE);
ewl_theme_data_str_set(s->screen, "/image/group", "entry");
ewl_image_file_set(EWL_IMAGE(s->screen), pic1, NULL);
ewl_object_alignment_set(EWL_OBJECT(s->screen), EWL_FLAG_ALIGN_CENTER);
-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
enlightenment-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs