From: Enlightenment C. <no...@cv...> - 2006-05-17 22:50:49
|
Enlightenment CVS committal Author : titan Project : e17 Module : proto Dir : e17/proto/ephoto/src Modified Files: ephoto.c ephoto.h ephoto_browsing.c ephoto_presentation.c Log Message: Formatting, cleaned up common code into one function, fixed some warnings. =================================================================== RCS file: /cvs/e/e17/proto/ephoto/src/ephoto.c,v retrieving revision 1.45 retrieving revision 1.46 diff -u -3 -r1.45 -r1.46 --- ephoto.c 17 May 2006 00:44:11 -0000 1.45 +++ ephoto.c 17 May 2006 22:49:23 -0000 1.46 @@ -101,32 +101,12 @@ snprintf(trues, PATH_MAX, "%s", argv[imageint]); } - image_list = ecore_file_ls(argv[imageint]); + image_list = get_images(argv[imageint]); while ( !ecore_list_is_empty(image_list) ) { char *pathi; - char pathw[PATH_MAX]; - pathi = - ecore_list_remove_first(image_list); - snprintf(pathw, PATH_MAX, - "%s%s", trues, pathi); - if ( fnmatch("*.[Pp][Nn][Gg]", - pathw, 0) == 0 ) { - ecore_dlist_append(m->imagelist, - strdup(pathw)); - slidenum++; - } - if ( fnmatch("*.[Jj][Pp][Gg]", - pathw, 0) == 0 ) { - ecore_dlist_append(m->imagelist, - strdup(pathw)); - slidenum++; - } - if ( fnmatch("*.[Jj][Pp][Ee][Gg]", - pathw, 0) == 0 ) { - ecore_dlist_append(m->imagelist, - strdup(pathw)); - slidenum++; - } + ecore_dlist_append(m->imagelist, + strdup(pathi)); + slidenum++; } mainwin = 0; nopresent = 0; @@ -150,32 +130,14 @@ snprintf(trues, PATH_MAX, "%s", argv[imageint]); } - image_list = ecore_file_ls(argv[imageint]); + image_list = get_images(argv[imageint]); while ( !ecore_list_is_empty(image_list) ) { char *pathi; - char pathw[PATH_MAX]; pathi = ecore_list_remove_first(image_list); - snprintf(pathw, PATH_MAX, "%s%s", - trues, pathi); - if ( fnmatch("*.[Pp][Nn][Gg]", - pathw, 0) == 0 ) { - ecore_dlist_append(m->imagelist, - strdup(pathw)); - slidenum++; - } - if ( fnmatch("*.[Jj][Pp][Gg]", - pathw, 0) == 0 ) { - ecore_dlist_append(m->imagelist, - strdup(pathw)); - slidenum++; - } - if ( fnmatch("*.[Jj][Pp][Ee][Gg]", - pathw, 0) == 0 ) { - ecore_dlist_append(m->imagelist, - strdup(pathw)); - slidenum++; - } + ecore_dlist_append(m->imagelist, + strdup(pathi)); + slidenum++; } mainwin = 0; noslide = 0; =================================================================== RCS file: /cvs/e/e17/proto/ephoto/src/ephoto.h,v retrieving revision 1.21 retrieving revision 1.22 diff -u -3 -r1.21 -r1.22 --- ephoto.h 13 May 2006 21:06:16 -0000 1.21 +++ ephoto.h 17 May 2006 22:49:23 -0000 1.22 @@ -47,6 +47,7 @@ void create_list_cb(Ewl_Widget *w, void *event, void *data); void list_albums_cb(Ewl_Widget *w, void *event, void *data); void addi(Ewl_Widget *w, void *event, void *data); +Ecore_List *get_images(const char *dir); typedef struct _Main Main; typedef struct _Slide Slide; =================================================================== RCS file: /cvs/e/e17/proto/ephoto/src/ephoto_browsing.c,v retrieving revision 1.29 retrieving revision 1.30 diff -u -3 -r1.29 -r1.30 --- ephoto_browsing.c 13 May 2006 21:06:16 -0000 1.29 +++ ephoto_browsing.c 17 May 2006 22:49:23 -0000 1.30 @@ -69,7 +69,8 @@ } m->dirtree = ewl_tree_new(1); - ewl_container_child_append(EWL_CONTAINER(m->images), m->dirtree); + ewl_container_child_append(EWL_CONTAINER(m->images), + m->dirtree); ewl_object_maximum_size_set(EWL_OBJECT(m->dirtree), 200, 215); ewl_object_minimum_size_set(EWL_OBJECT(m->dirtree), 200, 215); ewl_tree_headers_visible_set(EWL_TREE(m->dirtree), 0); @@ -82,24 +83,28 @@ ewl_widget_show(m->spacer); m->imagetree = ewl_tree_new(1); - ewl_container_child_append(EWL_CONTAINER(m->images), m->imagetree); + ewl_container_child_append(EWL_CONTAINER(m->images), + m->imagetree); ewl_tree_headers_visible_set(EWL_TREE(m->imagetree), 0); ewl_tree_expandable_rows_set(EWL_TREE(m->imagetree), FALSE); ewl_object_minimum_size_set(EWL_OBJECT(m->imagetree), 200, 260); ewl_object_maximum_size_set(EWL_OBJECT(m->imagetree), 200, 260); - ewl_object_fill_policy_set(EWL_OBJECT(m->imagetree), EWL_FLAG_FILL_VFILL | EWL_FLAG_FILL_VSHRINK); + ewl_object_fill_policy_set(EWL_OBJECT(m->imagetree), + EWL_FLAG_FILL_VFILL | EWL_FLAG_FILL_VSHRINK); ewl_widget_show(m->imagetree); /******************************************/ /*********Lets setup the parent dir row**********/ m->hbox = ewl_hbox_new(); - ewl_object_alignment_set(EWL_OBJECT(m->hbox), EWL_FLAG_ALIGN_CENTER); + ewl_object_alignment_set(EWL_OBJECT(m->hbox), + EWL_FLAG_ALIGN_CENTER); ewl_box_spacing_set(EWL_BOX(m->hbox), 5); ewl_widget_show(m->hbox); m->image = ewl_image_new(); - ewl_image_file_set(EWL_IMAGE(m->image), PACKAGE_DATA_DIR "/images/up.png", NULL); + ewl_image_file_set(EWL_IMAGE(m->image), + PACKAGE_DATA_DIR "/images/up.png", NULL); ewl_container_child_append(EWL_CONTAINER(m->hbox), m->image); ewl_widget_show(m->image); @@ -107,17 +112,21 @@ ewl_widget_name_set(m->texti, pathi); ewl_text_text_set(EWL_TEXT(m->texti), up); ewl_object_minimum_size_set(EWL_OBJECT(m->texti), 10, 16); - ewl_object_fill_policy_set(EWL_OBJECT(m->texti), EWL_FLAG_FILL_ALL); - ewl_object_alignment_set(EWL_OBJECT(m->texti), EWL_FLAG_ALIGN_CENTER); + ewl_object_fill_policy_set(EWL_OBJECT(m->texti), + EWL_FLAG_FILL_ALL); + ewl_object_alignment_set(EWL_OBJECT(m->texti), + EWL_FLAG_ALIGN_CENTER); ewl_container_child_append(EWL_CONTAINER(m->hbox), m->texti); ewl_widget_show(m->texti); m->children[0] = m->hbox; m->children[1] = NULL; - m->row = ewl_tree_row_add(EWL_TREE(m->dirtree), NULL, m->children); - ewl_callback_append(m->texti, EWL_CALLBACK_CLICKED, up_cb, NULL); + m->row = ewl_tree_row_add(EWL_TREE(m->dirtree), NULL, + m->children); + ewl_callback_append(m->texti, EWL_CALLBACK_CLICKED, up_cb, + NULL); - /*****************************************************************/ + /************************************************************/ files = ecore_file_ls(pathf); @@ -171,32 +180,42 @@ m->hbox = ewl_hbox_new(); ewl_box_spacing_set(EWL_BOX(m->hbox), 5); - ewl_object_alignment_set(EWL_OBJECT(m->hbox), EWL_FLAG_ALIGN_CENTER); - ewl_object_fill_policy_set(EWL_OBJECT(m->hbox), EWL_FLAG_FILL_ALL); + ewl_object_alignment_set(EWL_OBJECT(m->hbox), + EWL_FLAG_ALIGN_CENTER); + ewl_object_fill_policy_set(EWL_OBJECT(m->hbox), + EWL_FLAG_FILL_ALL); ewl_widget_name_set(m->hbox, pathw); ewl_widget_show(m->hbox); m->image = ewl_image_new(); - ewl_image_file_set(EWL_IMAGE(m->image), PACKAGE_DATA_DIR "/images/folder.png", NULL); - ewl_container_child_append(EWL_CONTAINER(m->hbox), m->image); + ewl_image_file_set(EWL_IMAGE(m->image), + PACKAGE_DATA_DIR "/images/folder.png", NULL); + ewl_container_child_append(EWL_CONTAINER + (m->hbox), m->image); ewl_widget_show(m->image); m->text = ewl_text_new(); ewl_widget_name_set(m->text, pathw); ewl_text_text_set(EWL_TEXT(m->text), bname); - ewl_object_minimum_size_set(EWL_OBJECT(m->text), 10, 16); - ewl_object_fill_policy_set(EWL_OBJECT(m->text), EWL_FLAG_FILL_SHRINK); - ewl_object_alignment_set(EWL_OBJECT(m->text), EWL_FLAG_ALIGN_CENTER); - ewl_container_child_append(EWL_CONTAINER(m->hbox), m->text); + ewl_object_minimum_size_set(EWL_OBJECT(m->text), + 10, 16); + ewl_object_fill_policy_set(EWL_OBJECT(m->text), + EWL_FLAG_FILL_SHRINK); + ewl_object_alignment_set(EWL_OBJECT(m->text), + EWL_FLAG_ALIGN_CENTER); + ewl_container_child_append(EWL_CONTAINER + (m->hbox), m->text); ewl_widget_show(m->text); m->children[0] = m->hbox; m->children[1] = NULL; - m->row = ewl_tree_row_add(EWL_TREE(m->dirtree), NULL, m->children); - ewl_callback_append(m->hbox, EWL_CALLBACK_CLICKED, populatei_cb, NULL); + m->row = ewl_tree_row_add(EWL_TREE(m->dirtree), + NULL, m->children); + ewl_callback_append(m->hbox, + EWL_CALLBACK_CLICKED, populatei_cb, NULL); } } - /****************************************************************************/ + /*************************************************************/ /************Populate Image files********************/ while( !ecore_list_is_empty(imagefiles) ) { @@ -206,32 +225,43 @@ m->hbox = ewl_hbox_new(); ewl_box_spacing_set(EWL_BOX(m->hbox), 5); - ewl_object_alignment_set(EWL_OBJECT(m->hbox), EWL_FLAG_ALIGN_CENTER); - ewl_object_fill_policy_set(EWL_OBJECT(m->hbox), EWL_FLAG_FILL_ALL); + ewl_object_alignment_set(EWL_OBJECT(m->hbox), + EWL_FLAG_ALIGN_CENTER); + ewl_object_fill_policy_set(EWL_OBJECT(m->hbox), + EWL_FLAG_FILL_ALL); ewl_widget_name_set(m->hbox, itemp); ewl_widget_show(m->hbox); m->image = ewl_image_thumbnail_new(); ewl_image_constrain_set(EWL_IMAGE(m->image), 64); ewl_image_proportional_set(EWL_IMAGE(m->image), TRUE); - ewl_image_thumbnail_request(EWL_IMAGE(m->image), itemp); - ewl_image_file_set(EWL_IMAGE(m->image), PACKAGE_DATA_DIR "images/camera.png", NULL); - ewl_container_child_append(EWL_CONTAINER(m->hbox), m->image); + ewl_image_thumbnail_request(EWL_IMAGE_THUMBNAIL + (m->image), itemp); + ewl_image_file_set(EWL_IMAGE(m->image), + PACKAGE_DATA_DIR "images/camera.png", NULL); + ewl_container_child_append(EWL_CONTAINER(m->hbox), + m->image); ewl_widget_show(m->image); m->text = ewl_text_new(); ewl_widget_name_set(m->text, itemp); ewl_text_text_set(EWL_TEXT(m->text), bname2); - ewl_object_minimum_size_set(EWL_OBJECT(m->text), 10, 16); - ewl_object_fill_policy_set(EWL_OBJECT(m->text), EWL_FLAG_FILL_SHRINK); - ewl_object_alignment_set(EWL_OBJECT(m->text), EWL_FLAG_ALIGN_CENTER); - ewl_container_child_append(EWL_CONTAINER(m->hbox), m->text); + ewl_object_minimum_size_set(EWL_OBJECT(m->text), + 10, 16); + ewl_object_fill_policy_set(EWL_OBJECT(m->text), + EWL_FLAG_FILL_SHRINK); + ewl_object_alignment_set(EWL_OBJECT(m->text), + EWL_FLAG_ALIGN_CENTER); + ewl_container_child_append(EWL_CONTAINER(m->hbox), + m->text); ewl_widget_show(m->text); m->children[0] = m->hbox; m->children[1] = NULL; - m->row = ewl_tree_row_add(EWL_TREE(m->imagetree), NULL, m->children); - ewl_callback_append(m->hbox, EWL_CALLBACK_CLICKED, images_cb, NULL); + m->row = ewl_tree_row_add(EWL_TREE(m->imagetree), NULL, + m->children); + ewl_callback_append(m->hbox, EWL_CALLBACK_CLICKED, + images_cb, NULL); free(itemp); } while (!ecore_list_is_empty(audiofiles)) { @@ -241,36 +271,50 @@ m->hbox = ewl_hbox_new(); ewl_box_spacing_set(EWL_BOX(m->hbox), 5); - ewl_object_alignment_set(EWL_OBJECT(m->hbox), EWL_FLAG_ALIGN_CENTER); - ewl_object_fill_policy_set(EWL_OBJECT(m->hbox), EWL_FLAG_FILL_ALL); + ewl_object_alignment_set(EWL_OBJECT(m->hbox), + EWL_FLAG_ALIGN_CENTER); + ewl_object_fill_policy_set(EWL_OBJECT(m->hbox), + EWL_FLAG_FILL_ALL); ewl_widget_name_set(m->hbox, itemp); ewl_widget_show(m->hbox); m->image = ewl_image_new(); - ewl_image_file_set(EWL_IMAGE(m->image), PACKAGE_DATA_DIR "/images/audio.png", NULL); - ewl_container_child_append(EWL_CONTAINER(m->hbox), m->image); + ewl_image_file_set(EWL_IMAGE(m->image), + PACKAGE_DATA_DIR "/images/audio.png", NULL); + ewl_container_child_append(EWL_CONTAINER(m->hbox), + m->image); ewl_widget_show(m->image); m->text = ewl_text_new(); ewl_widget_name_set(m->text, itemp); ewl_text_text_set(EWL_TEXT(m->text), bname2); - ewl_object_minimum_size_set(EWL_OBJECT(m->text), 10, 16); - ewl_object_fill_policy_set(EWL_OBJECT(m->text), EWL_FLAG_FILL_SHRINK); - ewl_object_alignment_set(EWL_OBJECT(m->text), EWL_FLAG_ALIGN_CENTER); - ewl_container_child_append(EWL_CONTAINER(m->hbox), m->text); + ewl_object_minimum_size_set(EWL_OBJECT(m->text), + 10, 16); + ewl_object_fill_policy_set(EWL_OBJECT(m->text), + EWL_FLAG_FILL_SHRINK); + ewl_object_alignment_set(EWL_OBJECT(m->text), + EWL_FLAG_ALIGN_CENTER); + ewl_container_child_append(EWL_CONTAINER(m->hbox), + m->text); ewl_widget_show(m->text); m->children[0] = m->hbox; m->children[1] = NULL; - m->row = ewl_tree_row_add(EWL_TREE(m->dirtree), NULL, m->children); - ewl_callback_append(m->hbox, EWL_CALLBACK_CLICKED, audio_cb, NULL); + m->row = ewl_tree_row_add(EWL_TREE(m->dirtree), + NULL, m->children); + ewl_callback_append(m->hbox, EWL_CALLBACK_CLICKED, + audio_cb, NULL); free(itemp); } - /***********************************************************************/ + /*********************************************************/ ecore_list_destroy(files); ecore_list_destroy(imagefiles); } + return; + w = NULL; + event = NULL; + data = NULL; } void @@ -296,6 +340,10 @@ ewl_callback_call(m->directory, EWL_CALLBACK_VALUE_CHANGED); } /*******************************************************/ + return; + w = NULL; + event = NULL; + data = NULL; } void @@ -325,6 +373,10 @@ } } /******************************************************/ + return; + w = NULL; + event = NULL; + data = NULL; } void @@ -357,10 +409,12 @@ ewl_widget_name_set(m->i, pathi); ewl_image_constrain_set(EWL_IMAGE(m->i), 64); ewl_image_proportional_set(EWL_IMAGE(m->i), TRUE); - ewl_image_thumbnail_request(EWL_IMAGE(m->i), pathi); - ewl_image_file_set(EWL_IMAGE(m->i), PACKAGE_DATA_DIR "images/camera.png", NULL); + ewl_image_thumbnail_request(EWL_IMAGE_THUMBNAIL(m->i), pathi); + ewl_image_file_set(EWL_IMAGE(m->i), PACKAGE_DATA_DIR + "images/camera.png", NULL); ewl_container_child_append(EWL_CONTAINER(m->ib), m->i); - ewl_callback_append(m->i, EWL_CALLBACK_CLICKED, iremove_cb, NULL); + ewl_callback_append(m->i, EWL_CALLBACK_CLICKED, iremove_cb, + NULL); ewl_widget_show(m->i); ecore_dlist_append(m->imagelist, strdup(pathi)); @@ -373,22 +427,31 @@ ewl_widget_destroy(m->vbutton); m->viewscroll = ewl_scrollpane_new(); - ewl_container_child_append(EWL_CONTAINER(m->viewbox), m->viewscroll); - ewl_object_alignment_set(EWL_OBJECT(m->viewscroll), EWL_FLAG_ALIGN_CENTER); - ewl_object_fill_policy_set(EWL_OBJECT(m->viewscroll), EWL_FLAG_FILL_ALL); + ewl_container_child_append(EWL_CONTAINER(m->viewbox), + m->viewscroll); + ewl_object_alignment_set(EWL_OBJECT(m->viewscroll), + EWL_FLAG_ALIGN_CENTER); + ewl_object_fill_policy_set(EWL_OBJECT(m->viewscroll), + EWL_FLAG_FILL_ALL); ewl_widget_show(m->viewscroll); m->vimage = ewl_image_new(); - ewl_object_fill_policy_set(EWL_OBJECT(m->vimage), EWL_FLAG_FILL_SHRINK); - ewl_container_child_append(EWL_CONTAINER(m->viewscroll), m->vimage); + ewl_object_fill_policy_set(EWL_OBJECT(m->vimage), + EWL_FLAG_FILL_SHRINK); + ewl_container_child_append(EWL_CONTAINER(m->viewscroll), + 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_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_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); @@ -400,12 +463,17 @@ } /**********************************************************/ - /****Enable the slideshow and presentation buttons so we can get to work****/ + /****Enable the slideshow and presentation buttons + so we can get to work****/ ewl_widget_enable(m->slideshow); ewl_widget_state_set(m->slideshow, "enabled"); ewl_widget_enable(m->presentation); ewl_widget_state_set(m->presentation, "enabled"); /***************************************************/ + return; + w = NULL; + event = NULL; + data = NULL; } void @@ -428,5 +496,9 @@ ewl_widget_state_set(m->audiolen, "enabled"); } } + return; + w = NULL; + event = NULL; + data = NULL; } =================================================================== RCS file: /cvs/e/e17/proto/ephoto/src/ephoto_presentation.c,v retrieving revision 1.16 retrieving revision 1.17 diff -u -3 -r1.16 -r1.17 --- ephoto_presentation.c 13 May 2006 22:42:09 -0000 1.16 +++ ephoto_presentation.c 17 May 2006 22:49:23 -0000 1.17 @@ -31,11 +31,13 @@ ewl_image_file_set(EWL_IMAGE(s->screen), picture1, NULL); ewl_object_alignment_set(EWL_OBJECT(s->screen), EWL_FLAG_ALIGN_CENTER); if ( ewl_checkbutton_is_checked(EWL_CHECKBUTTON(m->zoom)) == 1 ) { - ewl_object_fill_policy_set(EWL_OBJECT(s->screen), EWL_FLAG_FILL_ALL); + ewl_object_fill_policy_set(EWL_OBJECT(s->screen), + EWL_FLAG_FILL_ALL); ewl_image_proportional_set(EWL_IMAGE(s->screen), FALSE); } else { - ewl_object_fill_policy_set(EWL_OBJECT(s->screen), EWL_FLAG_FILL_SHRINK); + ewl_object_fill_policy_set(EWL_OBJECT(s->screen), + EWL_FLAG_FILL_SHRINK); } ewl_container_child_append(EWL_CONTAINER(s->cell), s->screen); ewl_widget_show(s->screen); @@ -43,25 +45,36 @@ if ( !picture1 ) { if ( mainwin == 0 ) { if ( argloop == 0 ) { - ewl_callback_call(s->wins, EWL_CALLBACK_CLICKED); + ewl_callback_call(s->wins, + EWL_CALLBACK_CLICKED); } if ( argloop == 1 ) { picture2 = ecore_dlist_goto_first(m->imagelist); ewl_widget_destroy(s->screen); s->screen = ewl_image_new(); - ewl_image_proportional_set(EWL_IMAGE(s->screen), TRUE); - ewl_theme_data_str_set(s->screen, "/image/group", "entry"); - if ( ewl_checkbutton_is_checked(EWL_CHECKBUTTON(m->zoom)) == 1 ) { - ewl_object_fill_policy_set(EWL_OBJECT(s->screen), EWL_FLAG_FILL_ALL); - ewl_image_proportional_set(EWL_IMAGE(s->screen), FALSE); + ewl_image_proportional_set(EWL_IMAGE(s->screen), + TRUE); + ewl_theme_data_str_set(s->screen, + "/image/group", "entry"); + if ( ewl_checkbutton_is_checked(EWL_CHECKBUTTON + (m->zoom)) == 1 ) { + ewl_object_fill_policy_set(EWL_OBJECT + (s->screen), EWL_FLAG_FILL_ALL); + ewl_image_proportional_set(EWL_IMAGE + (s->screen), FALSE); } else { - ewl_object_fill_policy_set(EWL_OBJECT(s->screen), EWL_FLAG_FILL_SHRINK); + ewl_object_fill_policy_set(EWL_OBJECT + (s->screen), + EWL_FLAG_FILL_SHRINK); } - ewl_image_file_set(EWL_IMAGE(s->screen), picture2, NULL); - ewl_object_alignment_set(EWL_OBJECT(s->screen), EWL_FLAG_ALIGN_CENTER); - ewl_container_child_append(EWL_CONTAINER(s->cell), s->screen); + ewl_image_file_set(EWL_IMAGE(s->screen), + picture2, NULL); + ewl_object_alignment_set(EWL_OBJECT(s->screen), + EWL_FLAG_ALIGN_CENTER); + ewl_container_child_append(EWL_CONTAINER + (s->cell), s->screen); ewl_widget_show(s->screen); } @@ -69,7 +82,8 @@ } if ( mainwin == 1 ) { - if (!picture1 && ewl_checkbutton_is_checked(EWL_CHECKBUTTON(m->loopcheck)) == 1 ) { + if (!picture1 && ewl_checkbutton_is_checked + (EWL_CHECKBUTTON(m->loopcheck)) == 1 ) { picture2 = ecore_dlist_goto_first(m->imagelist); ewl_widget_destroy(s->screen); @@ -79,22 +93,34 @@ 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"); - if ( ewl_checkbutton_is_checked(EWL_CHECKBUTTON(m->zoom)) == 1 ) { - ewl_object_fill_policy_set(EWL_OBJECT(s->screen), EWL_FLAG_FILL_ALL); - ewl_image_proportional_set(EWL_IMAGE(s->screen), FALSE); + ewl_image_proportional_set(EWL_IMAGE(s->screen), + TRUE); + ewl_theme_data_str_set(s->screen, + "/image/group", "entry"); + if ( ewl_checkbutton_is_checked(EWL_CHECKBUTTON + (m->zoom)) == 1 ) { + ewl_object_fill_policy_set(EWL_OBJECT + (s->screen), EWL_FLAG_FILL_ALL); + ewl_image_proportional_set(EWL_IMAGE + (s->screen), FALSE); } else { - ewl_object_fill_policy_set(EWL_OBJECT(s->screen), EWL_FLAG_FILL_SHRINK); + ewl_object_fill_policy_set(EWL_OBJECT + (s->screen), + EWL_FLAG_FILL_SHRINK); } - ewl_image_file_set(EWL_IMAGE(s->screen), picture2, NULL); - ewl_object_alignment_set(EWL_OBJECT(s->screen), EWL_FLAG_ALIGN_CENTER); - ewl_container_child_append(EWL_CONTAINER(s->cell), s->screen); + ewl_image_file_set(EWL_IMAGE(s->screen), + picture2, NULL); + ewl_object_alignment_set(EWL_OBJECT(s->screen), + EWL_FLAG_ALIGN_CENTER); + ewl_container_child_append(EWL_CONTAINER + (s->cell), s->screen); ewl_widget_show(s->screen); } - if (!picture1 && ewl_checkbutton_is_checked(EWL_CHECKBUTTON(m->loopcheck)) == 0 ) { - ewl_callback_call(s->wins, EWL_CALLBACK_CLICKED); + if (!picture1 && ewl_checkbutton_is_checked + (EWL_CHECKBUTTON(m->loopcheck)) == 0 ) { + ewl_callback_call(s->wins, + EWL_CALLBACK_CLICKED); } } } @@ -112,6 +138,10 @@ ecore_x_netwm_window_state_set((Ecore_X_Window)win->window, states, 1); ewl_object_size_request(EWL_OBJECT(w), 10000, 10000); /***************************/ + return; + w = NULL; + event = NULL; + data = NULL; } void @@ -123,6 +153,10 @@ audiolen = ewl_media_length_get(EWL_MEDIA(s->audio1)); } } + return; + w = NULL; + event = NULL; + data = NULL; } void @@ -164,7 +198,8 @@ ewl_window_name_set(EWL_WINDOW(s->wins), "Slideshow"); ewl_window_class_set(EWL_WINDOW(s->wins), "Slideshow"); if ( mainwin == 1 ) { - if ( ewl_checkbutton_is_checked(EWL_CHECKBUTTON(m->fullrad)) == 0 ) { + if ( ewl_checkbutton_is_checked(EWL_CHECKBUTTON(m->fullrad)) == + 0 ) { ewl_object_size_request(EWL_OBJECT(s->wins), ws, h); } } @@ -173,16 +208,20 @@ } ewl_object_fill_policy_set(EWL_OBJECT(s->wins), EWL_FLAG_FILL_ALL); if ( mainwin == 1 ) { - if ( ewl_checkbutton_is_checked(EWL_CHECKBUTTON(m->fullrad)) == 1 ) { - ewl_callback_append(s->wins, EWL_CALLBACK_REALIZE, realize_cb, NULL); + if ( ewl_checkbutton_is_checked(EWL_CHECKBUTTON(m->fullrad)) == + 1 ) { + ewl_callback_append(s->wins, EWL_CALLBACK_REALIZE, + realize_cb, NULL); } } if ( mainwin == 0 ) { if ( argfullscreen == 1 ) { - ewl_callback_append(s->wins, EWL_CALLBACK_REALIZE, realize_cb, NULL); + ewl_callback_append(s->wins, EWL_CALLBACK_REALIZE, + realize_cb, NULL); } } - ewl_callback_append(s->wins, EWL_CALLBACK_DELETE_WINDOW, destroys_cb, NULL); + ewl_callback_append(s->wins, EWL_CALLBACK_DELETE_WINDOW, destroys_cb, + NULL); ewl_callback_append(s->wins, EWL_CALLBACK_CLICKED, destroys_cb, NULL); ewl_widget_show(s->wins); @@ -194,11 +233,14 @@ if ( ewl_media_is_available() ) { if (audio != 0) { s->audio1 = ewl_media_new(); - ewl_container_child_append(EWL_CONTAINER(s->wins), s->audio1); + ewl_container_child_append(EWL_CONTAINER(s->wins), + s->audio1); ewl_media_module_get(EWL_MEDIA(s->audio1)); - ewl_media_module_set(EWL_MEDIA(s->audio1), EWL_MEDIA_MODULE_XINE); + ewl_media_module_set(EWL_MEDIA(s->audio1), + EWL_MEDIA_MODULE_XINE); ewl_media_media_set(EWL_MEDIA(s->audio1), audios); - ewl_object_maximum_size_set(EWL_OBJECT(s->audio1), 1, 1); + ewl_object_maximum_size_set(EWL_OBJECT(s->audio1), + 1, 1); ewl_widget_show(s->audio1); } } @@ -206,15 +248,19 @@ /*******Start the slideshow*******/ if ( s->audio1 != NULL ) { - ewl_callback_append(s->audio1, EWL_CALLBACK_REALIZE, play_cb, NULL); - ewl_callback_append(s->audio1, EWL_CALLBACK_REALIZE, play_cb, NULL); + ewl_callback_append(s->audio1, EWL_CALLBACK_REALIZE, + play_cb, NULL); + ewl_callback_append(s->audio1, EWL_CALLBACK_REALIZE, + play_cb, NULL); } if ( mainwin == 1 ) { - if ( ewl_checkbutton_is_checked(EWL_CHECKBUTTON(m->audiolen)) == 1 ) { + if ( ewl_checkbutton_is_checked(EWL_CHECKBUTTON(m->audiolen)) == + 1 ) { time = audiolen / slidenum; } - if ( ewl_checkbutton_is_checked(EWL_CHECKBUTTON(m->audiolen)) == 0 ) { + if ( ewl_checkbutton_is_checked(EWL_CHECKBUTTON(m->audiolen)) == + 0 ) { time = ewl_spinner_value_get(EWL_SPINNER(m->slidetime)); } } @@ -238,14 +284,20 @@ ewl_image_file_set(EWL_IMAGE(s->screen), pic1, NULL); ewl_object_alignment_set(EWL_OBJECT(s->screen), EWL_FLAG_ALIGN_CENTER); if ( ewl_checkbutton_is_checked(EWL_CHECKBUTTON(m->zoom)) == 1 ) { - ewl_object_fill_policy_set(EWL_OBJECT(s->screen), EWL_FLAG_FILL_ALL); + ewl_object_fill_policy_set(EWL_OBJECT(s->screen), + EWL_FLAG_FILL_ALL); ewl_image_proportional_set(EWL_IMAGE(s->screen), FALSE); } else { - ewl_object_fill_policy_set(EWL_OBJECT(s->screen), EWL_FLAG_FILL_SHRINK); + ewl_object_fill_policy_set(EWL_OBJECT(s->screen), + EWL_FLAG_FILL_SHRINK); } ewl_container_child_append(EWL_CONTAINER(s->cell), s->screen); ewl_widget_show(s->screen); + return; + w = NULL; + event = NULL; + data = NULL; } void @@ -263,18 +315,24 @@ ewl_image_proportional_set(EWL_IMAGE(p->imagep), TRUE); ewl_theme_data_str_set(p->imagep, "/image/group", "entry"); if ( ewl_checkbutton_is_checked(EWL_CHECKBUTTON(m->zoom)) == 1 ) { - ewl_object_fill_policy_set(EWL_OBJECT(p->imagep), EWL_FLAG_FILL_ALL); + ewl_object_fill_policy_set(EWL_OBJECT(p->imagep), + EWL_FLAG_FILL_ALL); ewl_image_proportional_set(EWL_IMAGE(p->imagep), FALSE); } else { - ewl_object_fill_policy_set(EWL_OBJECT(p->imagep), EWL_FLAG_FILL_SHRINK); + ewl_object_fill_policy_set(EWL_OBJECT(p->imagep), + EWL_FLAG_FILL_SHRINK); } ewl_image_file_set(EWL_IMAGE(p->imagep), picturep, NULL); ewl_object_alignment_set(EWL_OBJECT(p->imagep), EWL_FLAG_ALIGN_CENTER); ewl_container_child_append(EWL_CONTAINER(p->vboxp), p->imagep); ewl_widget_show(p->imagep); /*********************************************/ -} + return; + w = NULL; + event = NULL; + data = NULL; +} void next_cb(Ewl_Widget * w, void *event, void *data) @@ -295,18 +353,25 @@ ewl_image_proportional_set(EWL_IMAGE(p->imagep), TRUE); ewl_theme_data_str_set(p->imagep, "/image/group", "entry"); if ( ewl_checkbutton_is_checked(EWL_CHECKBUTTON(m->zoom)) == 1 ) { - ewl_object_fill_policy_set(EWL_OBJECT(p->imagep), EWL_FLAG_FILL_ALL); + ewl_object_fill_policy_set(EWL_OBJECT(p->imagep), + EWL_FLAG_FILL_ALL); ewl_image_proportional_set(EWL_IMAGE(p->imagep), FALSE); } else { - ewl_object_fill_policy_set(EWL_OBJECT(p->imagep), EWL_FLAG_FILL_SHRINK); + ewl_object_fill_policy_set(EWL_OBJECT(p->imagep), + EWL_FLAG_FILL_SHRINK); } ewl_image_file_set(EWL_IMAGE(p->imagep), picturep, NULL); ewl_object_alignment_set(EWL_OBJECT(p->imagep), EWL_FLAG_ALIGN_CENTER); ewl_container_child_append(EWL_CONTAINER(p->vboxp), p->imagep); ewl_widget_show(p->imagep); /***************************************************************/ -} + return; + w = NULL; + event = NULL; + data = NULL; +} + void previous_cb(Ewl_Widget * w, void *event, void *data) { @@ -326,18 +391,25 @@ ewl_image_proportional_set(EWL_IMAGE(p->imagep), TRUE); ewl_theme_data_str_set(p->imagep, "/image/group", "entry"); if ( ewl_checkbutton_is_checked(EWL_CHECKBUTTON(m->zoom)) == 1 ) { - ewl_object_fill_policy_set(EWL_OBJECT(p->imagep), EWL_FLAG_FILL_ALL); + ewl_object_fill_policy_set(EWL_OBJECT(p->imagep), + EWL_FLAG_FILL_ALL); ewl_image_proportional_set(EWL_IMAGE(p->imagep), FALSE); } else { - ewl_object_fill_policy_set(EWL_OBJECT(p->imagep), EWL_FLAG_FILL_SHRINK); + ewl_object_fill_policy_set(EWL_OBJECT(p->imagep), + EWL_FLAG_FILL_SHRINK); } ewl_image_file_set(EWL_IMAGE(p->imagep), picturep, NULL); ewl_object_alignment_set(EWL_OBJECT(p->imagep), EWL_FLAG_ALIGN_CENTER); ewl_container_child_append(EWL_CONTAINER(p->vboxp), p->imagep); ewl_widget_show(p->imagep); /********************************************************************/ + return; + w = NULL; + event = NULL; + data = NULL; } + void last_cb(Ewl_Widget * w, void *event, void *data) { @@ -352,18 +424,25 @@ ewl_image_proportional_set(EWL_IMAGE(p->imagep), TRUE); ewl_theme_data_str_set(p->imagep, "/image/group", "entry"); if ( ewl_checkbutton_is_checked(EWL_CHECKBUTTON(m->zoom)) == 1 ) { - ewl_object_fill_policy_set(EWL_OBJECT(p->imagep), EWL_FLAG_FILL_ALL); + ewl_object_fill_policy_set(EWL_OBJECT(p->imagep), + EWL_FLAG_FILL_ALL); ewl_image_proportional_set(EWL_IMAGE(p->imagep), FALSE); } else { - ewl_object_fill_policy_set(EWL_OBJECT(p->imagep), EWL_FLAG_FILL_SHRINK); + ewl_object_fill_policy_set(EWL_OBJECT(p->imagep), + EWL_FLAG_FILL_SHRINK); } ewl_image_file_set(EWL_IMAGE(p->imagep), picturep, NULL); ewl_object_alignment_set(EWL_OBJECT(p->imagep), EWL_FLAG_ALIGN_CENTER); ewl_container_child_append(EWL_CONTAINER(p->vboxp), p->imagep); ewl_widget_show(p->imagep); /*****************************************************************/ + return; + w = NULL; + event = NULL; + data = NULL; } + void presentation_cb(Ewl_Widget * w, void *event, void *data) { @@ -396,22 +475,27 @@ ewl_window_name_set(EWL_WINDOW(s->wins), "Presentation"); ewl_window_class_set(EWL_WINDOW(s->wins), "Presentation"); if ( mainwin == 1 ) { - if ( ewl_checkbutton_is_checked(EWL_CHECKBUTTON(m->fullrad)) == 0 ) { + if ( ewl_checkbutton_is_checked(EWL_CHECKBUTTON(m->fullrad)) == + 0 ) { ewl_object_size_request(EWL_OBJECT(s->wins), ws, h); } - if ( ewl_checkbutton_is_checked(EWL_CHECKBUTTON(m->fullrad)) == 1 ) { - ewl_callback_append(s->wins, EWL_CALLBACK_REALIZE, realize_cb, NULL); + if ( ewl_checkbutton_is_checked(EWL_CHECKBUTTON(m->fullrad)) == + 1 ) { + ewl_callback_append(s->wins, EWL_CALLBACK_REALIZE, + realize_cb, NULL); } } if ( mainwin == 0 ) { if ( argfullscreen == 1 ) { - ewl_callback_append(s->wins, EWL_CALLBACK_REALIZE, realize_cb, NULL); + ewl_callback_append(s->wins, EWL_CALLBACK_REALIZE, + realize_cb, NULL); } if ( argfullscreen == 0 ) { ewl_object_size_request(EWL_OBJECT(s->wins), ws, h); } } - ewl_callback_append(s->wins, EWL_CALLBACK_DELETE_WINDOW, destroyp_cb, NULL); + ewl_callback_append(s->wins, EWL_CALLBACK_DELETE_WINDOW, destroyp_cb, + NULL); ewl_widget_show(s->wins); p->vbox1p = ewl_vbox_new(); @@ -434,11 +518,13 @@ ewl_theme_data_str_set(p->imagep, "/image/group", "entry"); ewl_image_proportional_set(EWL_IMAGE(p->imagep), TRUE); if ( ewl_checkbutton_is_checked(EWL_CHECKBUTTON(m->zoom)) == 1 ) { - ewl_object_fill_policy_set(EWL_OBJECT(p->imagep), EWL_FLAG_FILL_ALL); + ewl_object_fill_policy_set(EWL_OBJECT(p->imagep), + EWL_FLAG_FILL_ALL); ewl_image_proportional_set(EWL_IMAGE(p->imagep), FALSE); } else { - ewl_object_fill_policy_set(EWL_OBJECT(p->imagep), EWL_FLAG_FILL_SHRINK); + ewl_object_fill_policy_set(EWL_OBJECT(p->imagep), + EWL_FLAG_FILL_SHRINK); } ewl_image_file_set(EWL_IMAGE(p->imagep), pictureone, NULL); ewl_object_alignment_set(EWL_OBJECT(p->imagep), EWL_FLAG_ALIGN_CENTER); @@ -471,10 +557,12 @@ p->previous = ewl_button_new(); ewl_button_label_set(EWL_BUTTON(p->previous), "Previous"); ewl_container_child_append(EWL_CONTAINER(p->hboxp), p->previous); - ewl_object_alignment_set(EWL_OBJECT(p->previous), EWL_FLAG_ALIGN_CENTER); + ewl_object_alignment_set(EWL_OBJECT(p->previous), + EWL_FLAG_ALIGN_CENTER); ewl_object_maximum_size_set(EWL_OBJECT(p->previous), 70, 50); ewl_object_minimum_size_set(EWL_OBJECT(p->previous), 70, 50); - ewl_callback_append(p->previous, EWL_CALLBACK_CLICKED, previous_cb, NULL); + ewl_callback_append(p->previous, EWL_CALLBACK_CLICKED, previous_cb, + NULL); ewl_widget_show(p->previous); p->next = ewl_button_new(); @@ -495,6 +583,10 @@ ewl_callback_append(p->last, EWL_CALLBACK_CLICKED, last_cb, NULL); ewl_widget_show(p->last); /*******************************************************************/ + return; + w = NULL; + event = NULL; + data = NULL; } /*******************************************/ |