Enlightenment CVS committal

Author  : titan
Project : e17
Module  : proto

Dir     : e17/proto/ephoto/src


Modified Files:
        ephoto.c ephoto.h ephoto_misc.c 


Log Message:

Added a menubar for ephoto. Yay :)!

===================================================================
RCS file: /cvs/e/e17/proto/ephoto/src/ephoto.c,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -3 -r1.26 -r1.27
--- ephoto.c    31 Mar 2006 22:10:07 -0000      1.26
+++ ephoto.c    1 Apr 2006 05:17:27 -0000       1.27
@@ -262,16 +262,73 @@
                m->win = ewl_window_new();
                ewl_window_title_set(EWL_WINDOW(m->win), "ephoto");
                ewl_window_name_set(EWL_WINDOW(m->win), "ephoto");
-               ewl_object_size_request(EWL_OBJECT(m->win), 640, 480);
+               ewl_object_size_request(EWL_OBJECT(m->win), 640, 500);
                ewl_callback_append(m->win, EWL_CALLBACK_DELETE_WINDOW, 
destroy_cb, NULL);
                ewl_widget_show(m->win);
                mainwin = 1;
        
+               m->avbox = ewl_vbox_new();
+               ewl_container_child_append(EWL_CONTAINER(m->win), m->avbox);
+               ewl_object_fill_policy_set(EWL_OBJECT(m->avbox), 
EWL_FLAG_FILL_ALL);
+               ewl_widget_show(m->avbox);
+               
+               m->menubar = ewl_hmenubar_new();
+               ewl_container_child_append(EWL_CONTAINER(m->avbox), m->menubar);
+               ewl_widget_show(m->menubar);
+
+               m->menu = ewl_menu_new();
+               ewl_button_label_set(EWL_BUTTON(m->menu), "File");
+               ewl_container_child_append(EWL_CONTAINER(m->menubar), m->menu);
+               ewl_object_fill_policy_set(EWL_OBJECT(m->menu), 
EWL_FLAG_FILL_NONE);
+               ewl_widget_show(m->menu);
+
+               m->menu_item = ewl_menu_item_new();
+               ewl_button_label_set(EWL_BUTTON(m->menu_item), "Exit");
+               ewl_container_child_append(EWL_CONTAINER(m->menu), 
m->menu_item);
+               ewl_callback_append(m->menu_item, EWL_CALLBACK_CLICKED, 
destroy_cb, NULL);
+               ewl_widget_show(m->menu_item);
+
+               m->menu = ewl_menu_new();
+               ewl_button_label_set(EWL_BUTTON(m->menu), "Actions");
+               ewl_container_child_append(EWL_CONTAINER(m->menubar), m->menu);
+               ewl_object_fill_policy_set(EWL_OBJECT(m->menu), 
EWL_FLAG_FILL_NONE);
+               ewl_widget_show(m->menu);
+
+               m->menu_item = ewl_menu_item_new();
+                ewl_button_label_set(EWL_BUTTON(m->menu_item), "Slideshow");
+                ewl_container_child_append(EWL_CONTAINER(m->menu), 
m->menu_item);
+                ewl_callback_append(m->menu_item, EWL_CALLBACK_CLICKED, 
slideshow_cb, NULL);
+                ewl_widget_show(m->menu_item);
+
+               m->menu_item = ewl_menu_item_new();
+                ewl_button_label_set(EWL_BUTTON(m->menu_item), "Presentation");
+                ewl_container_child_append(EWL_CONTAINER(m->menu), 
m->menu_item);
+                ewl_callback_append(m->menu_item, EWL_CALLBACK_CLICKED, 
presentation_cb, NULL);
+               ewl_widget_show(m->menu_item);
+
+               m->menu = ewl_menu_new();
+                ewl_button_label_set(EWL_BUTTON(m->menu), "Help");
+                ewl_container_child_append(EWL_CONTAINER(m->menubar), m->menu);
+                ewl_object_fill_policy_set(EWL_OBJECT(m->menu), 
EWL_FLAG_FILL_NONE);
+                ewl_widget_show(m->menu);
+
+                m->menu_item = ewl_menu_item_new();
+                ewl_button_label_set(EWL_BUTTON(m->menu_item), "Ephoto Help");
+                ewl_container_child_append(EWL_CONTAINER(m->menu), 
m->menu_item);
+                ewl_callback_append(m->menu_item, EWL_CALLBACK_CLICKED, 
ephoto_men_cb, "help");
+                ewl_widget_show(m->menu_item);
+
+               m->menu_item = ewl_menu_item_new();
+                ewl_button_label_set(EWL_BUTTON(m->menu_item), "About Ephoto");
+                ewl_container_child_append(EWL_CONTAINER(m->menu), 
m->menu_item);
+                ewl_callback_append(m->menu_item, EWL_CALLBACK_CLICKED, 
ephoto_men_cb, "about");
+                ewl_widget_show(m->menu_item);
+
                m->hbox = ewl_hpaned_new();
                ewl_object_alignment_set(EWL_OBJECT(m->hbox), 
EWL_FLAG_ALIGN_CENTER);
-               ewl_container_child_append(EWL_CONTAINER(m->win), m->hbox);
+               ewl_container_child_append(EWL_CONTAINER(m->avbox), m->hbox);
                ewl_widget_show(m->hbox);
-               
+
                m->vbox = ewl_vbox_new();
                ewl_object_alignment_set(EWL_OBJECT(m->vbox), 
EWL_FLAG_ALIGN_CENTER);
                ewl_box_spacing_set(EWL_BOX(m->vbox), 10);
@@ -526,10 +583,24 @@
                ewl_text_text_set(EWL_TEXT(m->text), "Audio");
                ewl_widget_show(m->text);
                
-               m->atext = ewl_text_new();
-               ewl_container_child_append(EWL_CONTAINER(m->settings), 
m->atext);
-               ewl_object_alignment_set(EWL_OBJECT(m->atext), 
EWL_FLAG_ALIGN_CENTER);
-               ewl_widget_show(m->atext);
+//             m->data = _data_setup();
+//
+//             m->model = ewl_model_new();
+//             ewl_model_fetch_set(m->model, _data_fetch);
+//             ewl_model_count_set(m->model, _data_count_get);
+//
+//             m->view = ewl_view_new();
+//             ewl_view_contructor_set(m->view, ewl_label_new);
+//             ewl_view_assign_set(m->view, 
EWL_VIEW_ASSIGN(ewl_label_text_set));
+//             ewl_view_header_fetch_set(m->view, _data_header_fetch);
+//
+//             m->atext = ewl_combo_new();
+//             ewl_container_child_append(EWL_CONTAINER(m->settings), 
m->atext);
+//             ewl_object_alignment_set(EWL_OBJECT(m->atext), 
EWL_FLAG_ALIGN_CENTER);
+//             ewl_combo_model_set(EWL_COMBO(m->atext), m->model);
+//             ewl_combo_view_set(EWL_COMBO(m->atext), m->view);
+//             ewl_combo_data_set(EWL_COMBO(m->atext), m->data);
+//             ewl_widget_show(m->atext);
                        
                m->hboxv = ewl_hbox_new();
                ewl_container_child_append(EWL_CONTAINER(m->settings), 
m->hboxv);
===================================================================
RCS file: /cvs/e/e17/proto/ephoto/src/ephoto.h,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -3 -r1.10 -r1.11
--- ephoto.h    30 Mar 2006 22:07:12 -0000      1.10
+++ ephoto.h    1 Apr 2006 05:17:27 -0000       1.11
@@ -35,6 +35,12 @@
 void iremove_cb(Ewl_Widget * w, void *event, void *data);
 void realize_cb(Ewl_Widget *w, void *event, void *data);
 void play_cb(Ewl_Widget *w, void *event, void *data);
+void ephoto_men_cb(Ewl_Widget *w, void *event, void *data);
+void destroywin_cb(Ewl_Widget *w, void *event, void *data);
+void *_data_setup(void);
+Ewl_Widget *_data_header_fetch(void*data__UNUSED__,int col__UNUSED__);
+void *_data_fetch(void*data,unsigned int row, unsigned int col__UNUSED__);
+int _data_count_get(void*data);
 
 typedef struct _Main Main;
 typedef struct _Slide Slide;
@@ -85,6 +91,13 @@
        Ewl_Widget      *viewscroll;
        Ewl_Widget      *dirtree;
        Ewl_Widget      *spacer;
+       Ewl_Widget      *model;
+       Ewl_Widget      *view;
+       Ewl_Widget      *menubar;
+       Ewl_Widget      *menu;
+       Ewl_Widget      *menu_item;
+       Ewl_Widget      *avbox;
+       void            *data;
        Ecore_List      *imagelist;
        Ecore_List      *presentlist;
 };
===================================================================
RCS file: /cvs/e/e17/proto/ephoto/src/ephoto_misc.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -3 -r1.4 -r1.5
--- ephoto_misc.c       22 Mar 2006 00:26:02 -0000      1.4
+++ ephoto_misc.c       1 Apr 2006 05:17:27 -0000       1.5
@@ -41,6 +41,13 @@
        data = NULL;
        /**********************************/
 }
+void
+destroywin_cb(Ewl_Widget * w, void *event, void *data)
+{
+       ewl_widget_destroy(data);
+       return;
+       data = NULL;
+}
 
 void
 rad_cb(Ewl_Widget * w, void *event, void *data)
@@ -63,3 +70,58 @@
        }
        /****************************************************/
 }
+void
+ephoto_men_cb(Ewl_Widget * w, void *event, void *data)
+{
+       Ewl_Widget *hwin;
+       Ewl_Widget *vbox;
+       Ewl_Widget *text;
+       Ewl_Widget *cancel;
+       static char *help_text = "-To view an image, select the simple image 
viewer tab, and then click an image from\n"
+                                "the browser.To add this image to the 
slideshow/presentation, click the add to slideshow\n"
+                                "button. Also, to add images to the 
slideshow/presentation, click the slideshow/presentation\n"
+                                "tab, and then click an image from the 
browser.  Use the self explanatory settings box to add\n"
+                                "features.  Length of slideshow is the amount 
of time each image will be shown in the slideshow.\n"
+                                "Loop slideshow loops the slideshow. Fit to 
audio, fits the length of the slideshow to the\n"
+                                "length of the audio.  You can set the width 
and height of the slideshow by manipulating the\n"
+                                "Custom or Fullscreen settings.  Audio thats 
added via the combo box, will play during the\n"
+                                "slideshow. Finally, select whether you want a 
slideshow, orpresentation via the button.\n"
+                                "Command line options can be viewed by doing 
ephoto --help from a terminal.\n";
+       static char *about_text = "-Ephoto is an advanced image viewer.  It is 
written in .c and ewl.  It allows you to\n"
+                                 "browse images, and view them either in a 
simple image viewer form, or in a slideshow or\n"
+                                 "controlled presentation.  If emotioned is 
compiled, you can have audio play while your\n"
+                                 "images are being shown in the slideshow.  
For help see help from the ephoto menu. \n"
+                                 "For options, see ephoto --help from the 
terminal.\n";
+       hwin = ewl_window_new();
+        ewl_window_title_set(EWL_WINDOW(hwin), "Help");
+        ewl_window_name_set(EWL_WINDOW(hwin), "Help");
+        ewl_object_size_request(EWL_OBJECT(hwin), 400, 300);
+        ewl_callback_append(hwin, EWL_CALLBACK_DELETE_WINDOW, destroywin_cb, 
hwin);
+        ewl_widget_show(hwin);
+       
+        vbox = ewl_vbox_new();
+        ewl_container_child_append(EWL_CONTAINER(hwin), vbox);
+        ewl_object_fill_policy_set(EWL_OBJECT(vbox), EWL_FLAG_FILL_ALL);
+        ewl_widget_show(vbox);
+
+        text = ewl_text_new();
+        ewl_container_child_append(EWL_CONTAINER(vbox), text);
+        ewl_object_alignment_set(EWL_OBJECT(text), EWL_FLAG_ALIGN_CENTER);
+        ewl_text_font_size_set(EWL_TEXT(text), 12);
+       if ( data == "help" ) {
+               ewl_text_text_set(EWL_TEXT(text), help_text);
+       }
+       if ( data == "about" ) {
+               ewl_text_text_set(EWL_TEXT(text), about_text);
+       }
+       ewl_widget_show(text);
+       
+        cancel = ewl_button_new();
+        ewl_button_label_set(EWL_BUTTON(cancel), "Close");
+        ewl_container_child_append(EWL_CONTAINER(vbox), cancel);
+        ewl_object_alignment_set(EWL_OBJECT(cancel), EWL_FLAG_ALIGN_CENTER);
+        ewl_object_maximum_size_set(EWL_OBJECT(cancel), 80, 15);
+        ewl_callback_append(cancel, EWL_CALLBACK_CLICKED, destroywin_cb, hwin);
+        ewl_widget_show(cancel);
+}
+




-------------------------------------------------------
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
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to