From: <enl...@li...> - 2002-02-04 22:24:08
|
Enlightenment CVS committal Author : rbdpngn Project : e17 Module : libs/estyle Dir : e17/libs/estyle/src Modified Files: Estyle.h estyle.c Log Message: A slight API change, and an optimizations and bug fix. =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/estyle/src/Estyle.h,v retrieving revision 1.5 retrieving revision 1.6 diff -u -3 -r1.5 -r1.6 --- Estyle.h 2002/01/30 23:20:18 1.5 +++ Estyle.h 2002/02/04 22:24:06 1.6 @@ -71,7 +71,7 @@ * Joining and splitting estyles. */ Estyle *estyle_split(Estyle * es, int index); -void estyle_merge(Estyle * es1, Estyle * es2); +int estyle_merge(Estyle * es1, Estyle * es2); #define ESTYLE_HASH_COLOR(r, g, b, a) ((r << 24) | (g << 16) | (b << 8) | a) =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/estyle/src/estyle.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -3 -r1.4 -r1.5 --- estyle.c 2002/01/30 23:04:12 1.4 +++ estyle.c 2002/02/04 22:24:06 1.5 @@ -118,6 +118,9 @@ { CHECK_PARAM_POINTER("es", es); + if (es->x == x && es->y == y) + return; + es->x = x; es->y = y; evas_move(es->evas, es->bit, (double)(x), (double)(y)); @@ -439,16 +442,19 @@ * @es1: the destination estyle that will contain the final text * @es2: the estyle that will be freed, but it's text will be added to @es1 * - * Returns no value. Appends the text in @es2 to the text in @es1 and destroys - * @es2. + * Returns TRUE if the bits are able to be merged, otherwise FALSE. Appends the + * text in @es2 to the text in @es1 and destroys @es2. */ -void estyle_merge(Estyle * es1, Estyle * es2) +int estyle_merge(Estyle * es1, Estyle * es2) { char *new_text, *text1, *text2; - CHECK_PARAM_POINTER("es1", es1); - CHECK_PARAM_POINTER("es2", es2); + CHECK_PARAM_POINTER_RETURN("es1", es1, FALSE); + CHECK_PARAM_POINTER_RETURN("es2", es2, FALSE); + if (!BIT_MERGEABLE(es1, es2)) + return FALSE; + /* * These return a pointer to the actual text in the evas object, not a * copy of it. So don't free them. @@ -470,6 +476,8 @@ FREE(new_text); estyle_free(es2); + + return TRUE; } /** |