Enlightenment CVS committal Author : ningerso Project : e17 Module : libs/ewl
Dir : e17/libs/ewl/src/lib Modified Files: ewl_text.c ewl_text.h Log Message: Add text display offset API and fix size when offsets used. =================================================================== RCS file: /cvs/e/e17/libs/ewl/src/lib/ewl_text.c,v retrieving revision 1.94 retrieving revision 1.95 diff -u -3 -r1.94 -r1.95 --- ewl_text.c 12 Apr 2006 06:15:31 -0000 1.94 +++ ewl_text.c 18 Apr 2006 23:18:53 -0000 1.95 @@ -164,6 +164,46 @@ } /** + * @param t: The Ewl_Text to get the layout offsets from + * @return Returns no value. + * @brief Retrieve the current layout offsets of the text + */ +void +ewl_text_offsets_get(Ewl_Text *t, int *x, int *y) +{ + DENTER_FUNCTION(DLEVEL_STABLE); + DCHECK_PARAM_PTR("t", t); + DCHECK_TYPE("t", t, EWL_TEXT_TYPE); + + if (x) + *x = t->offset.x; + + if (y) + *y = t->offset.y; + + DLEAVE_FUNCTION(DLEVEL_STABLE); +} + +/** + * @param t: The Ewl_Text to set the layout offsets + * @return Returns no value. + * @brief Set the current layout offsets of the text + */ +void +ewl_text_offsets_set(Ewl_Text *t, int x, int y) +{ + DENTER_FUNCTION(DLEVEL_STABLE); + DCHECK_PARAM_PTR("t", t); + DCHECK_TYPE("t", t, EWL_TEXT_TYPE); + + t->offset.x = x; + t->offset.y = y; + ewl_widget_configure(EWL_WIDGET(t)); + + DLEAVE_FUNCTION(DLEVEL_STABLE); +} + +/** * @param t: The Ewl_Text to get the geometry from * @param idx: The index to get the geometry for * @param x: Where to put the x value @@ -2511,7 +2551,8 @@ { evas_object_move(t->textblock, xx + t->offset.x, yy + t->offset.y); - evas_object_resize(t->textblock, ww, hh); + evas_object_resize(t->textblock, ww - t->offset.x, + hh - t->offset.y); if (t->dirty) ewl_text_display(t); =================================================================== RCS file: /cvs/e/e17/libs/ewl/src/lib/ewl_text.h,v retrieving revision 1.35 retrieving revision 1.36 diff -u -3 -r1.35 -r1.36 --- ewl_text.h 13 Apr 2006 20:37:23 -0000 1.35 +++ ewl_text.h 18 Apr 2006 23:18:53 -0000 1.36 @@ -105,6 +105,9 @@ unsigned int ewl_text_length_get(Ewl_Text *t); +void ewl_text_offsets_set(Ewl_Text *t, int x, int y); +void ewl_text_offsets_get(Ewl_Text *t, int *x, int *y); + void ewl_text_index_geometry_map(Ewl_Text *t, unsigned int idx, int *x, int *y, int *w, int *h); unsigned int ewl_text_coord_index_map(Ewl_Text *t, int x, int y); ------------------------------------------------------- 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