Enlightenment CVS committal
Author : rbdpngn
Project : e17
Module : libs/etox
Dir : e17/libs/etox/src
Modified Files:
Etox.h etox_context.c etox_line.c
Log Message:
Fixup some wrapping that got broken along the way.
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/etox/src/Etox.h,v
retrieving revision 1.46
retrieving revision 1.47
diff -u -3 -r1.46 -r1.47
--- Etox.h 28 Feb 2004 04:10:02 -0000 1.46
+++ Etox.h 16 Mar 2004 04:54:46 -0000 1.47
@@ -27,6 +27,14 @@
ETOX_BIT_TYPE_OBSTACLE = 1,
ETOX_BIT_TYPE_WRAP_MARKER = 2
};
+
+typedef enum _etox_marker_placement Etox_Marker_Placement;
+enum _etox_marker_placement
+{
+ ETOX_MARKER_BEGINNING = 0,
+ ETOX_MARKER_END = 1,
+};
+
/*
* The context structure holds information relative to the appearance of text
* that is added to the etox.
@@ -75,6 +83,7 @@
char *text;
char *style;
int r, g, b, a;
+ Etox_Marker_Placement placement;
} marker;
};
@@ -145,6 +154,9 @@
*/
void etox_context_set_wrap_marker(Etox_Context * context, char *marker, char *style);
void etox_context_set_wrap_marker_color(Etox_Context * context, int r, int g, int b,
int a);
+Etox_Marker_Placement etox_context_get_wrap_marker_place(Etox_Context *context);
+void etox_context_set_wrap_marker_place(Etox_Context *context,
+ Etox_Marker_Placement place);
/*
* Text manipulation functions
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/etox/src/etox_context.c,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -3 -r1.18 -r1.19
--- etox_context.c 28 Feb 2004 04:10:03 -0000 1.18
+++ etox_context.c 16 Mar 2004 04:54:47 -0000 1.19
@@ -463,3 +463,24 @@
context->marker.b = b;
context->marker.a = a;
}
+
+/*
+ * @param context: the context to change current wrapping marker
+ * @param place: the placement to use for the wrap marker
+ */
+void
+etox_context_set_wrap_marker_place(Etox_Context *context,
+ Etox_Marker_Placement place)
+{
+ CHECK_PARAM_POINTER("context", context);
+
+ context->marker.placement = place;
+}
+
+Etox_Marker_Placement
+etox_context_get_wrap_marker_place(Etox_Context *context)
+{
+ CHECK_PARAM_POINTER_RETURN("context", context, 0);
+
+ return context->marker.placement;
+}
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/etox/src/etox_line.c,v
retrieving revision 1.32
retrieving revision 1.33
diff -u -3 -r1.32 -r1.33
--- etox_line.c 18 Feb 2004 19:17:07 -0000 1.32
+++ etox_line.c 16 Mar 2004 04:54:47 -0000 1.33
@@ -144,6 +144,8 @@
evas_object_geometry_get(bit, &x, &y, &w, &h);
line->w += w;
+ if (h > line->h)
+ line->h = h;
line->length += estyle_length(bit);
etox_selections_update(bit, line);
@@ -195,6 +197,8 @@
if (!line->bits)
return;
+ etox_line_print_bits(line);
+
/*
* Determine the horizontal alignment of the text and set the starting
* x coordinate appropriately.
@@ -436,7 +440,7 @@
}
/* Wrap if we've found a reasonable position */
- if (index > 0) {
+ if (index >= 0) {
etox_line_split(line, bit, index);
ll = evas_list_find_list(et->lines, line);
@@ -455,7 +459,10 @@
estyle_set_font(marker, et->context->font,
et->context->font_size);
evas_object_show(marker);
- etox_line_prepend(ll->data, marker);
+ if (et->context->marker.placement == ETOX_MARKER_BEGINNING)
+ etox_line_prepend(ll->data, marker);
+ else
+ etox_line_append(line, marker);
}
else
index = 0;
@@ -471,7 +478,6 @@
Evas_Object *split = NULL;
ll = evas_list_find_list(line->bits, bit);
- ll = ll->next;
/*
* add the newline after the current one
@@ -486,18 +492,10 @@
*/
if (index > 0) {
if (index < estyle_length(bit)) {
- /* split the edge bit */
split = etox_split_bit(line, bit, index);
- etox_line_remove(line, split);
}
+ ll = ll->next;
}
- else {
- split = bit;
- etox_line_remove(line, bit);
- }
-
- if (split)
- etox_line_append(newline, split);
/*
* move the remaining bits to the new line
-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
_______________________________________________
enlightenment-cvs mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs