Enlightenment CVS committal Author : dj2 Project : e17 Module : libs/ewl
Dir : e17/libs/ewl/src/lib Modified Files: ewl_filelist.c ewl_filelist_list.c ewl_filepicker.c ewl_image.c ewl_media.c ewl_media.h ewl_paned.c ewl_tree2.c ewl_tree2.h Log Message: - fix warnings - move ewl_media values to be stored in ewl_media instead of retrieving from emotion - add ewl_tree_dirty_set/get and switch tree->dirty = TRUE to use function =================================================================== RCS file: /cvs/e/e17/libs/ewl/src/lib/ewl_filelist.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -3 -r1.4 -r1.5 --- ewl_filelist.c 15 Apr 2006 05:14:31 -0000 1.4 +++ ewl_filelist.c 20 Apr 2006 02:58:01 -0000 1.5 @@ -700,7 +700,8 @@ } void -ewl_filelist_cb_destroy(Ewl_Widget *w, void *ev, void *data) +ewl_filelist_cb_destroy(Ewl_Widget *w, void *ev __UNUSED__, + void *data __UNUSED__) { Ewl_Filelist *fl; =================================================================== RCS file: /cvs/e/e17/libs/ewl/src/lib/ewl_filelist_list.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -3 -r1.3 -r1.4 --- ewl_filelist_list.c 15 Apr 2006 05:14:31 -0000 1.3 +++ ewl_filelist_list.c 20 Apr 2006 02:58:01 -0000 1.4 @@ -121,7 +121,8 @@ * @brief Callback when the selected files are changed */ void -ewl_filelist_list_selected_file_add(Ewl_Filelist *fl, const char *file) +ewl_filelist_list_selected_file_add(Ewl_Filelist *fl, + const char *file __UNUSED__) { DENTER_FUNCTION(DLEVEL_STABLE); DCHECK_PARAM_PTR("fl", fl); =================================================================== RCS file: /cvs/e/e17/libs/ewl/src/lib/ewl_filepicker.c,v retrieving revision 1.7 retrieving revision 1.8 diff -u -3 -r1.7 -r1.8 --- ewl_filepicker.c 20 Apr 2006 02:13:43 -0000 1.7 +++ ewl_filepicker.c 20 Apr 2006 02:58:01 -0000 1.8 @@ -728,7 +728,7 @@ } static void -ewl_filepicker_cb_filter_change(Ewl_Widget *w, void *ev, void *data) +ewl_filepicker_cb_filter_change(Ewl_Widget *w, void *ev __UNUSED__, void *data) { Ewl_Filepicker *fp; @@ -769,7 +769,8 @@ } static void -ewl_filepicker_cb_destroy(Ewl_Widget *w, void *ev, void *data) +ewl_filepicker_cb_destroy(Ewl_Widget *w, void *ev __UNUSED__, + void *data __UNUSED__) { char *file; Ewl_Filepicker *fp; =================================================================== RCS file: /cvs/e/e17/libs/ewl/src/lib/ewl_image.c,v retrieving revision 1.38 retrieving revision 1.39 diff -u -3 -r1.38 -r1.39 --- ewl_image.c 12 Apr 2006 06:29:31 -0000 1.38 +++ ewl_image.c 20 Apr 2006 02:58:01 -0000 1.39 @@ -6,12 +6,13 @@ #ifdef BUILD_EPSILON_SUPPORT #include <Epsilon.h> #include <Epsilon_Request.h> -#endif static Ecore_Event_Handler *ewl_image_epsilon_handler = NULL; +static int ewl_image_thumbnail_complete_cb(void *data, int type, void *event); +#endif + static Ewl_Image_Type ewl_image_type_get(const char *i); -static int ewl_image_thumbnail_complete_cb(void *data, int type, void *event); static void ewl_image_thumb_destroy_cb(Ewl_Widget *w, void *ev, void *data); /** @@ -593,19 +594,17 @@ DLEAVE_FUNCTION(DLEVEL_STABLE); } +#ifdef BUILD_EPSILON_SUPPORT static int ewl_image_thumbnail_complete_cb(void *data __UNUSED__, int type __UNUSED__, void *event) { -#ifdef BUILD_EPSILON_SUPPORT Ewl_Image_Thumbnail *thumb; Epsilon_Request *ev; -#endif DENTER_FUNCTION(DLEVEL_STABLE); DCHECK_PARAM_PTR_RET("event", event, FALSE); -#ifdef BUILD_EPSILON_SUPPORT ev = event; thumb = ev->data; @@ -613,10 +612,10 @@ ewl_image_file_path_set(EWL_IMAGE(thumb), ev->dest); thumb->thumb = NULL; } -#endif DRETURN_INT(TRUE, DLEVEL_STABLE); } +#endif void ewl_image_reveal_cb(Ewl_Widget *w, void *ev_data __UNUSED__, =================================================================== RCS file: /cvs/e/e17/libs/ewl/src/lib/ewl_media.c,v retrieving revision 1.14 retrieving revision 1.15 diff -u -3 -r1.14 -r1.15 --- ewl_media.c 18 Apr 2006 23:17:02 -0000 1.14 +++ ewl_media.c 20 Apr 2006 02:58:01 -0000 1.15 @@ -270,7 +270,8 @@ emotion_object_play_set(m->video, p); #endif - DLEAVE_FUNCTION(DLEVEL_STABLE); + DRETURN(DLEVEL_STABLE); + p = p; } /** @@ -303,18 +304,11 @@ double ewl_media_position_get(Ewl_Media *m) { - double p = 0.0; - DENTER_FUNCTION(DLEVEL_STABLE) DCHECK_PARAM_PTR_RET("m", m, 0); DCHECK_TYPE_RET("m", m, EWL_MEDIA_TYPE, 0); -#ifdef BUILD_EMOTION_SUPPORT - if (m->video) - p = emotion_object_position_get(m->video); -#endif - - DRETURN_FLOAT(p, DLEVEL_STABLE); + DRETURN_FLOAT(m->position, DLEVEL_STABLE); } /** @@ -361,10 +355,15 @@ DCHECK_PARAM_PTR("m", m); DCHECK_TYPE("m", m, EWL_MEDIA_TYPE); + if (p == m->position) + DRETURN(DLEVEL_STABLE); + + m->position = p; + #ifdef BUILD_EMOTION_SUPPORT if (m->video && ewl_media_seekable_get(m)) { m->block_seek = 1; - emotion_object_position_set(m->video, p); + emotion_object_position_set(m->video, m->position); m->block_seek = 0; } #endif @@ -380,18 +379,11 @@ int ewl_media_audio_mute_get(Ewl_Media *m) { - int mute = 0; - DENTER_FUNCTION(DLEVEL_STABLE) DCHECK_PARAM_PTR_RET("m", m, 0); DCHECK_TYPE("m", m, EWL_MEDIA_TYPE); -#ifdef BUILD_EMOTION_SUPPORT - if (m->video) - mute = emotion_object_audio_mute_get(m->video); -#endif - - DRETURN_INT(mute, DLEVEL_STABLE); + DRETURN_INT(m->mute, DLEVEL_STABLE); } /** @@ -407,9 +399,14 @@ DCHECK_PARAM_PTR("m", m); DCHECK_TYPE("m", m, EWL_MEDIA_TYPE); + if (m->mute == mute) + DRETURN(DLEVEL_STABLE); + + m->mute = mute; + #ifdef BUILD_EMOTION_SUPPORT if (m->video) - emotion_object_audio_mute_set(m->video, mute); + emotion_object_audio_mute_set(m->video, m->mute); #endif DLEAVE_FUNCTION(DLEVEL_STABLE); @@ -423,18 +420,11 @@ double ewl_media_audio_volume_get(Ewl_Media *m) { - double v = 0.0; - DENTER_FUNCTION(DLEVEL_STABLE) DCHECK_PARAM_PTR_RET("m", m, 0); DCHECK_TYPE_RET("m", m, EWL_MEDIA_TYPE, 0.0); -#ifdef BUILD_EMOTION_SUPPORT - if (m->video) - emotion_object_audio_volume_get(m->video); -#endif - - DRETURN_FLOAT(v, DLEVEL_STABLE); + DRETURN_FLOAT(m->volume, DLEVEL_STABLE); } /** @@ -450,9 +440,14 @@ DCHECK_PARAM_PTR("m", m); DCHECK_TYPE("m", m, EWL_MEDIA_TYPE); + if (m->volume == v) + DRETURN(DLEVEL_STABLE); + + m->volume = v; + #ifdef BUILD_EMOTION_SUPPORT if (m->video) - emotion_object_audio_volume_set(m->video, v); + emotion_object_audio_volume_set(m->video, m->volume); #endif DLEAVE_FUNCTION(DLEVEL_STABLE); =================================================================== RCS file: /cvs/e/e17/libs/ewl/src/lib/ewl_media.h,v retrieving revision 1.12 retrieving revision 1.13 diff -u -3 -r1.12 -r1.13 --- ewl_media.h 4 Apr 2006 18:14:39 -0000 1.12 +++ ewl_media.h 20 Apr 2006 02:58:01 -0000 1.13 @@ -41,6 +41,10 @@ Ewl_Media_Module_Type module; /**< Path to the module file */ char *media; /**< Path to the media file */ int block_seek; /**< Temporarily prevent seeking */ + + double volume; /**< The volume setting */ + double position; /**< The position setting */ + unsigned char mute:1; /**< The mute value */ }; Ewl_Widget *ewl_media_new(void); =================================================================== RCS file: /cvs/e/e17/libs/ewl/src/lib/ewl_paned.c,v retrieving revision 1.27 retrieving revision 1.28 diff -u -3 -r1.27 -r1.28 --- ewl_paned.c 19 Mar 2006 16:48:24 -0000 1.27 +++ ewl_paned.c 20 Apr 2006 02:58:01 -0000 1.28 @@ -849,7 +849,8 @@ /* didn't shirnk the entire amount XXX do something ... */ if ((cur_size - new_size) != shrink_size) - ; + { + } cur_size = layout->current_size(EWL_OBJECT(grow)); layout->variable_request(EWL_OBJECT(grow), cur_size + amt); =================================================================== RCS file: /cvs/e/e17/libs/ewl/src/lib/ewl_tree2.c,v retrieving revision 1.13 retrieving revision 1.14 diff -u -3 -r1.13 -r1.14 --- ewl_tree2.c 14 Apr 2006 16:29:44 -0000 1.13 +++ ewl_tree2.c 20 Apr 2006 02:58:01 -0000 1.14 @@ -78,8 +78,7 @@ ewl_tree2_cb_child_resize); ewl_widget_focusable_set(EWL_WIDGET(tree), FALSE); - - tree->dirty = TRUE; + ewl_tree2_dirty_set(tree, TRUE); DRETURN_INT(TRUE, DLEVEL_STABLE); } @@ -98,7 +97,7 @@ DCHECK_TYPE("tree", tree, EWL_TREE2_TYPE); tree->data = data; - tree->dirty = TRUE; + ewl_tree2_dirty_set(tree, TRUE); DLEAVE_FUNCTION(DLEVEL_STABLE); } @@ -147,7 +146,7 @@ ewl_tree2_column_view_set(c, view); ecore_list_append(tree->columns, c); - tree->dirty = TRUE; + ewl_tree2_dirty_set(tree, TRUE); DLEAVE_FUNCTION(DLEVEL_STABLE); } @@ -181,7 +180,7 @@ ewl_tree2_column_view_set(c, view); ecore_list_prepend(tree->columns, c); - tree->dirty = TRUE; + ewl_tree2_dirty_set(tree, TRUE); DLEAVE_FUNCTION(DLEVEL_STABLE); } @@ -218,7 +217,7 @@ ecore_list_goto_index(tree->columns, idx); ecore_list_insert(tree->columns, c); - tree->dirty = TRUE; + ewl_tree2_dirty_set(tree, TRUE); DLEAVE_FUNCTION(DLEVEL_STABLE); } @@ -242,7 +241,7 @@ c = ecore_list_remove(tree->columns); ewl_tree2_column_destroy(c); - tree->dirty = TRUE; + ewl_tree2_dirty_set(tree, TRUE); DLEAVE_FUNCTION(DLEVEL_STABLE); } @@ -267,7 +266,7 @@ else ewl_widget_show(tree->header); - tree->dirty = TRUE; + ewl_tree2_dirty_set(tree, TRUE); DLEAVE_FUNCTION(DLEVEL_STABLE); } @@ -384,8 +383,7 @@ DCHECK_TYPE("tree", tree, EWL_TREE2_TYPE); tree->fixed = fixed; - - tree->dirty = TRUE; + ewl_tree2_dirty_set(tree, TRUE); DLEAVE_FUNCTION(DLEVEL_STABLE); } @@ -405,6 +403,40 @@ DRETURN_INT(tree->fixed, DLEVEL_STABLE); } +/** + * @param tree2: The Ewl_Tree2 to work with + * @param dirty: Set to TRUE if the data in the tree has changed + * @return Returns no value + * @brief Setting this to TRUE tells the tree that it's data has changed + * and it will need to re-create its contents + */ +void +ewl_tree2_dirty_set(Ewl_Tree2 *tree2, unsigned int dirty) +{ + DENTER_FUNCTION(DLEVEL_STABLE); + DCHECK_PARAM_PTR("tree2", tree2); + DCHECK_TYPE("tree2", tree2, EWL_TREE2_TYPE); + + tree2->dirty = !!dirty; + + DLEAVE_FUNCTION(DLEVEL_STABLE); +} + +/** + * @param tree2: The Ewl_Tree2 to use + * @return Returns the dirty status of the tree + * @brief Returns if the tree is currently dirty or not + */ +unsigned int +ewl_tree2_dirty_get(Ewl_Tree2 *tree2) +{ + DENTER_FUNCTION(DLEVEL_STABLE); + DCHECK_PARAM_PTR_RET("tree2", tree2, FALSE); + DCHECK_TYPE_RET("tree2", tree2, EWL_TREE2_TYPE, FALSE); + + DRETURN_INT(tree2->dirty, DLEVEL_STABLE); +} + void ewl_tree2_cb_destroy(Ewl_Widget *w, void *ev __UNUSED__, void *data __UNUSED__) { @@ -454,7 +486,7 @@ // ewl_widget_configure(tree->header); /* if none of the models are dirty we are done */ - if (!tree->dirty) DRETURN(DLEVEL_STABLE); + if (!ewl_tree2_dirty_get(tree)) DRETURN(DLEVEL_STABLE); /* setup the headers */ ewl_container_reset(EWL_CONTAINER(tree->header)); @@ -468,12 +500,10 @@ ewl_widget_print(h); ewl_container_child_append(EWL_CONTAINER(tree->header), h); - /* once we are done this model won't be dirty anymore */ -// col->model->dirty = FALSE; column ++; } - tree->dirty = FALSE; + ewl_tree2_dirty_set(tree, FALSE); DLEAVE_FUNCTION(DLEVEL_STABLE); } =================================================================== RCS file: /cvs/e/e17/libs/ewl/src/lib/ewl_tree2.h,v retrieving revision 1.20 retrieving revision 1.21 diff -u -3 -r1.20 -r1.21 --- ewl_tree2.h 12 Apr 2006 06:43:33 -0000 1.20 +++ ewl_tree2.h 20 Apr 2006 02:58:01 -0000 1.21 @@ -108,9 +108,9 @@ Ecore_List *selected; /**< The list of selected cells */ Ewl_Tree_Mode mode; /**< The mode of the tree */ - unsigned int fixed:1; /**< Rows are fixed height */ - unsigned int headers_visible:1; /**< Are the headers visible? */ - unsigned int dirty:1; /**< Has the data changed? */ + unsigned char fixed:1; /**< Rows are fixed height */ + unsigned char headers_visible:1; /**< Are the headers visible? */ + unsigned char dirty:1; /**< Has the data changed? */ }; /* @@ -143,6 +143,9 @@ void ewl_tree2_fixed_rows_set(Ewl_Tree2 *tree, unsigned int fixed); unsigned int ewl_tree2_fixed_rows_get(Ewl_Tree2 *tree); + +void ewl_tree2_dirty_set(Ewl_Tree2 *tree2, unsigned int dirty); +unsigned int ewl_tree2_dirty_get(Ewl_Tree2 *tree2); /* * Internal stuff. ------------------------------------------------------- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 _______________________________________________ enlightenment-cvs mailing list enlightenment-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs