Enlightenment CVS committal
Author : rbdpngn
Project : e17
Module : libs/etox
Dir : e17/libs/etox/src
Modified Files:
Etox_private.h etox.c etox_context.c
Log Message:
Move the private function prototypes into etox.c.
Fix a problem with geometry updates when the text is empty.
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/etox/src/Etox_private.h,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -3 -r1.26 -r1.27
--- Etox_private.h 6 May 2004 05:23:15 -0000 1.26
+++ Etox_private.h 22 May 2004 23:43:02 -0000 1.27
@@ -190,15 +190,6 @@
} start, end;
};
-void etox_free(Evas_Object * et);
-void etox_show(Evas_Object * et);
-void etox_hide(Evas_Object * et);
-void etox_move(Evas_Object * et, Evas_Coord x, Evas_Coord y);
-void etox_resize(Evas_Object * et, Evas_Coord w, Evas_Coord h);
-void etox_set_layer(Evas_Object * et, int layer);
-void etox_set_clip(Evas_Object * et, Evas_Object *clip);
-void etox_unset_clip(Evas_Object * et);
-
void etox_layout(Etox * et);
Evas_Object * etox_split_bit(Etox_Line *line, Evas_Object *bit, int index);
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/etox/src/etox.c,v
retrieving revision 1.80
retrieving revision 1.81
diff -u -3 -r1.80 -r1.81
--- etox.c 21 May 2004 12:45:36 -0000 1.80
+++ etox.c 22 May 2004 23:43:02 -0000 1.81
@@ -1,6 +1,15 @@
#include "config.h"
#include "Etox_private.h"
+static void etox_free(Evas_Object * et);
+static void etox_show(Evas_Object * et);
+static void etox_hide(Evas_Object * et);
+static void etox_move(Evas_Object * et, Evas_Coord x, Evas_Coord y);
+static void etox_resize(Evas_Object * et, Evas_Coord w, Evas_Coord h);
+static void etox_set_layer(Evas_Object * et, int layer);
+static void etox_set_clip(Evas_Object * et, Evas_Object *clip);
+static void etox_unset_clip(Evas_Object * et);
+
static Evas_List *_etox_break_text(Etox * et, char *text);
Evas_Smart *etox_smart = NULL;
@@ -187,11 +196,15 @@
* new text with the last line of the old text. Duplicate text to avoid
* read-only memory segv's when parsing.
*/
- if (text && *text) {
+ if (text) {
text = strdup(text);
- lines = _etox_break_text(et, text);
- FREE(text);
}
+ else {
+ text = strdup(text);
+ }
+
+ lines = _etox_break_text(et, text);
+ FREE(text);
if (!lines)
return;
@@ -269,12 +282,16 @@
* new text with the last line of the old text. Duplicate text to avoid
* read-only memory segv's when parsing.
*/
- if (text && *text) {
+ if (text) {
text = strdup(text);
- lines = _etox_break_text(et, text);
- FREE(text);
+ }
+ else {
+ text = strdup("");
}
+ lines = _etox_break_text(et, text);
+ FREE(text);
+
if (!lines)
return;
@@ -365,11 +382,15 @@
* new text with the last line of the old text. Duplicate text to avoid
* read-only memory segv's when parsing.
*/
- if (text && *text) {
+ if (text) {
text = strdup(text);
- lines = _etox_break_text(et, text);
- FREE(text);
}
+ else {
+ text = strdup("");
+ }
+
+ lines = _etox_break_text(et, text);
+ FREE(text);
if (!lines)
return;
@@ -441,12 +462,16 @@
* Layout the text and add to the display. Duplicate text to avoid
* read-only memory segv's when parsing.
*/
- if (text && *text) {
+ if (text) {
text = strdup(text);
- et->lines = _etox_break_text(et, text);
- FREE(text);
+ }
+ else {
+ text = strdup("");
}
+ et->lines = _etox_break_text(et, text);
+ FREE(text);
+
/*
* Sum up the length and height of the text in the etox.
*/
@@ -456,7 +481,7 @@
for (l = et->lines; l; l = l->next) {
line = l->data;
/*
- * Grab the largest line width for the width of the etox.
+ * Grab the largest line width for the width of the etox.
*/
if (line->w > et->tw)
et->tw = line->w;
@@ -679,7 +704,7 @@
CHECK_PARAM_POINTER_RETURN("obj", obj, 0);
et = evas_object_smart_data_get(obj);
- return et->length + evas_list_count(et->lines);
+ return et->length + evas_list_count(et->lines) - 1;
}
@@ -1211,7 +1236,7 @@
/*
* Add any remaining text after the last line break or tab.
*/
- if (*text) {
+ if (*text || !line->bits) {
bit = etox_style_new(et->evas, text, et->context->style);
evas_object_smart_member_add(bit, et->smart_obj);
evas_object_color_set(bit, et->context->r, et->context->g,
@@ -1220,9 +1245,6 @@
etox_style_set_font(bit, et->context->font, et->context->font_size);
etox_line_append(line, bit);
evas_object_show(bit);
- } else if (line->bits == NULL) {
- ret = evas_list_remove(ret, line);
- etox_line_free(line);
}
return ret;
@@ -1245,14 +1267,17 @@
CHECK_PARAM_POINTER("et", et);
+ if (!et->flags & ETOX_SOFT_WRAP)
+ et->w = 0;
+
if (!et->w)
et->w = et->tw;
/*
- * What the hell, do you expect us to "just know" what text to
- * display, you've got to set some dumbass!
+ * Don't skip out just because the size is 0 x 0, we need to resize
+ * things later.
*/
- if (!et->lines || et->w <= 0 || et->h <= 0)
+ if (!et->lines)
return;
y = et->y;
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/etox/src/etox_context.c,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -3 -r1.21 -r1.22
--- etox_context.c 6 May 2004 05:17:52 -0000 1.21
+++ etox_context.c 22 May 2004 23:43:02 -0000 1.22
@@ -40,8 +40,8 @@
/*
* Set up a default blank wrap marker
*/
- context->marker.text = (char *)strdup("+");
- context->marker.style = (char *)strdup("plain");
+ context->marker.text = strdup("+");
+ context->marker.style = strdup("plain");
context->marker.r = 255;
context->marker.g = 0;
context->marker.b = 0;
-------------------------------------------------------
This SF.Net email is sponsored by: Oracle 10g
Get certified on the hottest thing ever to hit the market... Oracle 10g.
Take an Oracle 10g class now, and we'll give you the exam FREE.
http://ads.osdn.com/?ad_id=3149&alloc_id=8166&op=click
_______________________________________________
enlightenment-cvs mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs