Enlightenment CVS committal Author : dj2 Project : e17 Module : libs/ewl
Dir : e17/libs/ewl/src/lib Modified Files: ewl_engines.c ewl_image.c ewl_mvc.c ewl_mvc.h ewl_text.c ewl_tree2_view.c ewl_tree2_view.h ewl_tree2_view_plain.c ewl_tree2_view_plain.h ewl_tree2_view_scrolled.c ewl_tree2_view_scrolled.h Log Message: - make getting a node in the text tree a bit faster - doxy fixes - warnings fixes =================================================================== RCS file: /cvs/e/e17/libs/ewl/src/lib/ewl_engines.c,v retrieving revision 1.17 retrieving revision 1.18 diff -u -3 -r1.17 -r1.18 --- ewl_engines.c 13 Oct 2006 02:08:00 -0000 1.17 +++ ewl_engines.c 20 Oct 2006 18:21:53 -0000 1.18 @@ -22,8 +22,10 @@ static void **ewl_engine_hooks_get(Ewl_Engine *engine, Ewl_Engine_Hook_Type type); static void *ewl_engine_hook_get(Ewl_Embed *embed, Ewl_Engine_Hook_Type type, int hook); +#if 0 static Ecore_List *ewl_engine_hook_chain_get(Ewl_Embed *embed, Ewl_Engine_Hook_Type type, int hook); +#endif /** * @return Returns no value @@ -1317,6 +1319,7 @@ DRETURN_PTR(match, DLEVEL_STABLE); } +#if 0 /** * @param embed: The embed to lookup the engine chain for hook matching * @param type: The Ewl_Engine_Hook type to find the best matching function @@ -1366,6 +1369,7 @@ DRETURN_PTR(matches, DLEVEL_STABLE); } +#endif static void ewl_engine_free(Ewl_Engine *engine) =================================================================== RCS file: /cvs/e/e17/libs/ewl/src/lib/ewl_image.c,v retrieving revision 1.50 retrieving revision 1.51 diff -u -3 -r1.50 -r1.51 --- ewl_image.c 10 Oct 2006 21:32:16 -0000 1.50 +++ ewl_image.c 20 Oct 2006 18:21:53 -0000 1.51 @@ -237,7 +237,7 @@ void ewl_image_constrain_set(Ewl_Image *i, unsigned int size) { - unsigned int osize; + int osize; DENTER_FUNCTION(DLEVEL_STABLE); DCHECK_PARAM_PTR("i", i); =================================================================== RCS file: /cvs/e/e17/libs/ewl/src/lib/ewl_mvc.c,v retrieving revision 1.9 retrieving revision 1.10 diff -u -3 -r1.9 -r1.10 --- ewl_mvc.c 20 Oct 2006 12:39:58 -0000 1.9 +++ ewl_mvc.c 20 Oct 2006 18:21:53 -0000 1.10 @@ -22,10 +22,6 @@ static void ewl_mvc_selected_change_notify(Ewl_MVC *mvc); static void ewl_mvc_selected_rm_item(Ewl_MVC *mvc, Ewl_Selection *sel, int row, int column); -/* XXX This function is currently not implemented -static void ewl_mvc_cb_highlight_destroy(Ewl_Widget *w, void *ev, - void *data); -*/ static void ewl_mvc_cb_sel_free(void *data); /** @@ -1067,21 +1063,21 @@ } static void -ewl_mvc_highlight_do(Ewl_MVC *mvc, Ewl_Container *c, Ewl_Selection *sel, - Ewl_Widget *w) +ewl_mvc_highlight_do(Ewl_MVC *mvc __UNUSED__, Ewl_Container *c, + Ewl_Selection *sel, Ewl_Widget *w) { Ewl_Widget *h; DENTER_FUNCTION(DLEVEL_STABLE); + DCHECK_PARAM_PTR("c", c); DCHECK_PARAM_PTR("sel", sel); DCHECK_PARAM_PTR("w", w); + DCHECK_TYPE("c", c, EWL_CONTAINER_TYPE); DCHECK_TYPE("w", w, EWL_WIDGET_TYPE); h = ewl_highlight_new(); ewl_highlight_follow_set(EWL_HIGHLIGHT(h), w); ewl_container_child_append(EWL_CONTAINER(c), h); -// ewl_callback_append(h, EWL_CALLBACK_DESTROY, -// ewl_mvc_cb_highlight_destroy, mvc); ewl_widget_show(h); if (sel->type == EWL_SELECTION_TYPE_INDEX) =================================================================== RCS file: /cvs/e/e17/libs/ewl/src/lib/ewl_mvc.h,v retrieving revision 1.8 retrieving revision 1.9 diff -u -3 -r1.8 -r1.9 --- ewl_mvc.h 20 Oct 2006 04:37:34 -0000 1.8 +++ ewl_mvc.h 20 Oct 2006 18:21:53 -0000 1.9 @@ -30,9 +30,8 @@ */ struct Ewl_Selection { - Ewl_Selection_Type type; - - void *highlight; + Ewl_Selection_Type type; /**< The type of selection */ + void *highlight; /**< highlight widgets for the MVC */ }; /** @@ -51,10 +50,10 @@ */ struct Ewl_Selection_Idx { - Ewl_Selection sel; + Ewl_Selection sel; /**< Inherit from Ewl_Selection */ - int row; - int column; + int row; /**< Index row */ + int column; /**< Index column */ }; /** @@ -73,14 +72,14 @@ */ struct Ewl_Selection_Range { - Ewl_Selection sel; + Ewl_Selection sel; /**< Inherit from Ewl_Selection */; struct { - int row; - int column; - } start, - end; + int row; /**< Index row */ + int column; /**< Index column */ + } start, /**< Start of range */ + end; /**< End of range */ }; /** @@ -106,9 +105,9 @@ Ewl_Model *model; /**< The model for the mvc */ struct { - void (*view_change)(Ewl_MVC *mvc); - void (*selected_change)(Ewl_MVC *mvc); - } cb; + void (*view_change)(Ewl_MVC *mvc); /**< View change callback */ + void (*selected_change)(Ewl_MVC *mvc); /**< Selected change callback */ + } cb; /**< Callbacks to the inheriting widgets */ Ecore_List *selected; /**< The selected cells */ =================================================================== RCS file: /cvs/e/e17/libs/ewl/src/lib/ewl_text.c,v retrieving revision 1.132 retrieving revision 1.133 diff -u -3 -r1.132 -r1.133 --- ewl_text.c 20 Oct 2006 04:37:34 -0000 1.132 +++ ewl_text.c 20 Oct 2006 18:21:53 -0000 1.133 @@ -5057,6 +5057,7 @@ ewl_text_tree_node_get(Ewl_Text_Tree *tree, unsigned int char_idx, unsigned int inclusive) { + Ecore_List *children = NULL; Ewl_Text_Tree *child = NULL, *last = NULL; unsigned int char_count = 0; @@ -5071,8 +5072,9 @@ DRETURN_PTR(tree, DLEVEL_STABLE); child = tree; - ecore_list_goto_first(tree->children); - while ((child = ecore_list_next(tree->children))) + children = child->children; + ecore_list_goto_first(children); + while ((child = ecore_list_next(children))) { last = child; @@ -5080,8 +5082,22 @@ if (((inclusive && ((char_count + child->length.chars) >= char_idx))) || (!inclusive && ((char_count + child->length.chars > char_idx)))) { - child = ewl_text_tree_node_get(child, char_idx - char_count, inclusive); - break; + char_idx -= char_count; + char_count = 0; + + if (char_idx > child->length.chars) + { + child = NULL; + break; + } + + if ((!child->children) + || (ecore_list_nodes(child->children) == 0)) + break; + + children = child->children; + ecore_list_goto_first(children); + continue; } char_count += child->length.chars; } @@ -5107,6 +5123,7 @@ { Ewl_Text_Tree *child = NULL, *last = NULL; unsigned int byte_count = 0; + Ecore_List *children; DENTER_FUNCTION(DLEVEL_STABLE); DCHECK_PARAM_PTR_RET("tree", tree, NULL); @@ -5119,8 +5136,9 @@ DRETURN_PTR(tree, DLEVEL_STABLE); child = tree; - ecore_list_goto_first(tree->children); - while ((child = ecore_list_next(tree->children))) + children = child->children; + ecore_list_goto_first(children); + while ((child = ecore_list_next(children))) { last = child; @@ -5128,8 +5146,22 @@ if (((inclusive && ((byte_count + child->length.bytes) >= byte_idx))) || (!inclusive && ((byte_count + child->length.bytes > byte_idx)))) { - child = ewl_text_tree_node_get(child, byte_idx - byte_count, inclusive); - break; + byte_idx -= byte_count; + byte_count = 0; + + if (byte_idx > child->length.bytes) + { + child = NULL; + break; + } + + if ((!child->children) + || (ecore_list_nodes(child->children) == 0)) + break; + + children = child->children; + ecore_list_goto_first(children); + continue; } byte_count += child->length.bytes; } =================================================================== RCS file: /cvs/e/e17/libs/ewl/src/lib/ewl_tree2_view.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -3 -r1.1 -r1.2 --- ewl_tree2_view.c 22 Aug 2006 21:41:45 -0000 1.1 +++ ewl_tree2_view.c 20 Oct 2006 18:21:53 -0000 1.2 @@ -3,6 +3,11 @@ #include "ewl_macros.h" #include "ewl_private.h" +/** + * @param v: The view to initialize + * @return Returns TRUE on success or FALSE on failure + * @brief Initializes an Ewl_Tree2_View to default values + */ int ewl_tree2_view_init(Ewl_Tree2_View *v) { @@ -15,6 +20,12 @@ DRETURN_INT(TRUE, DLEVEL_STABLE); } +/** + * @param v: The view to work with + * @param t: The tree to set + * @return Returns no value + * @brief Sets the @a t tree into the @a v view + */ void ewl_tree2_view_tree2_set(Ewl_Tree2_View *v, Ewl_Tree2 *t) { @@ -29,6 +40,11 @@ DLEAVE_FUNCTION(DLEVEL_STABLE); } +/** + * @param v: The view to work with + * @return Returns the Ewl_Tree2 parent + * @brief Retrieves the tree parent set into the view + */ Ewl_Tree2 * ewl_tree2_view_tree2_get(Ewl_Tree2_View *v) { =================================================================== RCS file: /cvs/e/e17/libs/ewl/src/lib/ewl_tree2_view.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -3 -r1.1 -r1.2 --- ewl_tree2_view.h 22 Aug 2006 21:41:45 -0000 1.1 +++ ewl_tree2_view.h 20 Oct 2006 18:21:53 -0000 1.2 @@ -1,22 +1,47 @@ #ifndef EWL_TREE2_VIEW_H #define EWL_TREE2_VIEW_H +/** + * @addtogroup Ewl_Tree2_View Ewl_Tree2_View: A tree view + * @brief The tree view class + * + * @{ + */ + +/** + * @def EWL_TREE2_VIEW_TYPE + * The type name for Ewl_Tree2_View + */ #define EWL_TREE2_VIEW_TYPE "tree2_view" +/** + * @def EWL_TREE2_VIEW(v) + * Typecasts a pointer to an Ewl_Tree2_View pointer + */ #define EWL_TREE2_VIEW(v) ((Ewl_Tree2_View *)v) +/** + * A View on the tree + */ typedef struct Ewl_Tree2_View Ewl_Tree2_View; + +/** + * Ewl_Tree2_View + */ struct Ewl_Tree2_View { - Ewl_Box box; - - Ewl_Tree2 *parent; + Ewl_Box box; /**< Inherit from Ewl_Box */ + Ewl_Tree2 *parent; /**< The tree parent */ }; int ewl_tree2_view_init(Ewl_Tree2_View *v); void ewl_tree2_view_tree2_set(Ewl_Tree2_View *v, Ewl_Tree2 *t); Ewl_Tree2 *ewl_tree2_view_tree2_get(Ewl_Tree2_View *v); + +/** + * @} + */ #endif =================================================================== RCS file: /cvs/e/e17/libs/ewl/src/lib/ewl_tree2_view_plain.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -3 -r1.1 -r1.2 --- ewl_tree2_view_plain.c 22 Aug 2006 21:41:45 -0000 1.1 +++ ewl_tree2_view_plain.c 20 Oct 2006 18:21:53 -0000 1.2 @@ -5,6 +5,10 @@ static Ewl_View *ewl_tree2_view_plain_view = NULL; +/** + * @return Returns a default Ewl_Tree2_View_Plain struct + * @brief Retrieves a shared Ewl_Tree2_View_Plain widget + */ Ewl_View * ewl_tree2_view_plain_get(void) { @@ -20,6 +24,10 @@ DRETURN_PTR(ewl_tree2_view_plain_view, DLEVEL_STABLE); } +/** + * @return Returns a new Ewl_Widget on success or NULL on failure + * @brief Creates a new Ewl_Tree2_View_Plain_View + */ Ewl_Widget * ewl_tree2_view_plain_new(void) { @@ -40,6 +48,11 @@ DRETURN_PTR(w, DLEVEL_STABLE); } +/** + * @param tv: The tree view to work with + * @return Returns TRUE on success or FALSE on failure + * @brief Initializes an Ewl_Tree2_View_Plain to default values + */ int ewl_tree2_view_plain_init(Ewl_Tree2_View_Plain *tv) { =================================================================== RCS file: /cvs/e/e17/libs/ewl/src/lib/ewl_tree2_view_plain.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -3 -r1.1 -r1.2 --- ewl_tree2_view_plain.h 22 Aug 2006 21:41:45 -0000 1.1 +++ ewl_tree2_view_plain.h 20 Oct 2006 18:21:53 -0000 1.2 @@ -1,21 +1,46 @@ #ifndef EWL_TREE2_VIEW_PLAIN_H #define EWL_TREE2_VIEW_PLAIN_H +/** + * @addtogroup Ewl_Tree2_View_Plain Ewl_Tree2_View_Plain: The plain tree view + * @brief Defines a plain view into the tree just listing rows + * + * @{ + */ + +/** + * @def EWL_TREE2_VIEW_PLAIN_TYPE + * The Ewl_Tree2_View_Plain type + */ #define EWL_TREE2_VIEW_PLAIN_TYPE "tree2_view_plain" +/** + * Ewl_Tree2_View_Plain + */ typedef struct Ewl_Tree2_View_Plain Ewl_Tree2_View_Plain; +/** + * @def EWL_TREE2_VIEW_PLAIN(v) + * Typecasts a pointer to an Ewl_Tree2_View_Plain pointer + */ #define EWL_TREE2_VIEW_PLAIN(tv) ((Ewl_Tree2_View_Plain*)tv) +/** + * Provides a plain view for the tree + */ struct Ewl_Tree2_View_Plain { - Ewl_Tree2_View view; + Ewl_Tree2_View view; /**< Inherit from Ewl_Tree2_View */ }; Ewl_View *ewl_tree2_view_plain_get(void); Ewl_Widget *ewl_tree2_view_plain_new(void); int ewl_tree2_view_plain_init(Ewl_Tree2_View_Plain *tv); + +/** + * @} + */ #endif =================================================================== RCS file: /cvs/e/e17/libs/ewl/src/lib/ewl_tree2_view_scrolled.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -3 -r1.1 -r1.2 --- ewl_tree2_view_scrolled.c 22 Aug 2006 21:41:45 -0000 1.1 +++ ewl_tree2_view_scrolled.c 20 Oct 2006 18:21:53 -0000 1.2 @@ -5,6 +5,10 @@ static Ewl_View *ewl_tree2_view_scrolled_view = NULL; +/** + * @return Returns the view for this widget + * @brief Retrieves the view for this widget + */ Ewl_View * ewl_tree2_view_scrolled_get(void) { @@ -20,6 +24,10 @@ DRETURN_PTR(ewl_tree2_view_scrolled_view, DLEVEL_STABLE); } +/** + * @return Returns a new Ewl_Widget on success or NULL on failure + * @brief Creates and initializes a new Ewl_Tree2_View_Scrolled widget + */ Ewl_Widget * ewl_tree2_view_scrolled_new(void) { @@ -40,6 +48,11 @@ DRETURN_PTR(w, DLEVEL_STABLE); } +/** + * @param tv: The view to work with + * @return Returns TRUE on success or FALSE on failure + * @brief Initialies a tree view to default values + */ int ewl_tree2_view_scrolled_init(Ewl_Tree2_View_Scrolled *tv) { @@ -65,7 +78,7 @@ } /** - * @param tree: The tree to work with + * @param view: The view to work with * @param scroll: If the headers should be scrolled * @return Returns no value * @brief Sets if the headers should be scrolled with the tree =================================================================== RCS file: /cvs/e/e17/libs/ewl/src/lib/ewl_tree2_view_scrolled.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -3 -r1.1 -r1.2 --- ewl_tree2_view_scrolled.h 22 Aug 2006 21:41:45 -0000 1.1 +++ ewl_tree2_view_scrolled.h 20 Oct 2006 18:21:53 -0000 1.2 @@ -1,20 +1,40 @@ #ifndef EWL_TREE2_VIEW_SCROLLED_H #define EWL_TREE2_VIEW_SCROLLED_H +/** + * @addtogroup Ewl_Tree2_View_Scrolled Ewl_Tree2_View_Scrolled The scrolled tree view + * @brief A scrolled view for the tree + * + * @{ + */ + +/** + * @def EWL_TREE2_VIEW_SCROLLED_TYPE + * The type name + */ #define EWL_TREE2_VIEW_SCROLLED_TYPE "tree2_view_scrolled" +/** + * Ewl_Tree2_View_Scrolled + */ typedef struct Ewl_Tree2_View_Scrolled Ewl_Tree2_View_Scrolled; +/** + * @def EWL_TREE2_VIEW_SCROLLED(tv) + * Typecasts a pointer to an Ewl_Tree2_View_Scrolled pointer + */ #define EWL_TREE2_VIEW_SCROLLED(tv) ((Ewl_Tree2_View_Scrolled*)tv) +/** + * A scrolled view on the tree + */ struct Ewl_Tree2_View_Scrolled { - Ewl_Box box; + Ewl_Box box; /**< Inherit from Ewl_Box */ + Ewl_Widget *scroll; /**< The scroll region */ - Ewl_Widget *scroll; - - unsigned char scroll_header:1; - unsigned char scroll_visible:1; + unsigned char scroll_header:1; /**< Do we scroll headers */ + unsigned char scroll_visible:1; /**< Do we we show the headers */ }; Ewl_View *ewl_tree2_view_scrolled_get(void); @@ -25,6 +45,10 @@ void ewl_tree2_view_scrolled_scroll_headers_set(Ewl_Tree2_View *view, unsigned int scroll); unsigned int ewl_tree2_view_scrolled_scroll_headers_get(Ewl_Tree2_View *view); + +/** + * @} + */ #endif ------------------------------------------------------------------------- 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