Enlightenment CVS committal
Author : rephorm
Project : e17
Module : libs/etox
Dir : e17/libs/etox/src
Modified Files:
Etox.h etox_context.c etox_line.c etox_selection.c
Log Message:
Can now apply a context to a selection.
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/etox/src/Etox.h,v
retrieving revision 1.38
retrieving revision 1.39
diff -u -3 -r1.38 -r1.39
--- Etox.h 6 Aug 2003 02:45:35 -0000 1.38
+++ Etox.h 19 Aug 2003 18:08:12 -0000 1.39
@@ -205,5 +205,7 @@
int y), void *data);
void etox_selection_del_callback(Etox_Selection * selected,
Evas_Callback_Type callback);
+void etox_selection_apply_context(Etox_Selection *selected,
+ Etox_Context *context);
#endif
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/etox/src/etox_context.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -3 -r1.10 -r1.11
--- etox_context.c 6 Aug 2003 02:45:36 -0000 1.10
+++ etox_context.c 19 Aug 2003 18:08:12 -0000 1.11
@@ -83,6 +83,8 @@
if (et->context->marker.style)
ret->marker.style = strdup(et->context->marker.style);
+ ret->flags = et->context->flags;
+
return ret;
}
@@ -123,6 +125,8 @@
if (et->context->marker.style)
et->context->marker.style = strdup(context->marker.style);
+
+ et->context->flags = context->flags;
}
/**
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/etox/src/etox_line.c,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -3 -r1.25 -r1.26
--- etox_line.c 19 Aug 2003 15:36:12 -0000 1.25
+++ etox_line.c 19 Aug 2003 18:08:12 -0000 1.26
@@ -662,11 +662,30 @@
bit = l->data;
- estyle_set_style(bit, context->style);
- evas_object_color_set(bit, context->r, context->g, context->b,
- context->a);
- estyle_set_font(bit, context->font, context->font_size);
+ if (!l->prev && line->flags & ETOX_LINE_WRAPPED)
+ {
+ /* go past any obstacles */
+ while (estyle_fixed(bit))
+ {
+ /* if there are only obstacles on the line (can this happen?) */
+ if (!l->next)
+ return;
+ l = l->next;
+ bit = l->data;
+ }
+ estyle_set_text(bit, context->marker.text);
+ estyle_set_style(bit, context->marker.style);
+ estyle_set_color(bit, context->marker.r, context->marker.g,
+ context->marker.b, context->marker.a);
+ }
+ else
+ {
+ estyle_set_style(bit, context->style);
+ evas_object_color_set(bit, context->r, context->g, context->b,
+ context->a);
+ estyle_set_font(bit, context->font, context->font_size);
+ }
if (l == le)
break;
}
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/etox/src/etox_selection.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -3 -r1.7 -r1.8
--- etox_selection.c 19 Aug 2003 04:00:23 -0000 1.7
+++ etox_selection.c 19 Aug 2003 18:08:12 -0000 1.8
@@ -378,3 +378,46 @@
Evas_Callback_Type callback)
{
}
+
+void
+etox_selection_apply_context(Etox_Selection *selected,
+ Etox_Context *context)
+{
+ Evas_List *l;
+ Etox_Line *line;
+
+ if (selected->start.line == selected->end.line)
+ {
+ etox_line_apply_context(selected->start.line, context,
+ selected->start.bit, selected->end.bit);
+ }
+
+ else
+ {
+ /* start on the first line */
+ l = evas_list_find_list(selected->etox->lines, selected->start.line);
+
+ line = l->data;
+
+ for (; l; l = l->next)
+ {
+ line = l->data;
+
+ if (line == selected->start.line)
+ {
+ etox_line_apply_context(line, context, selected->start.bit, NULL);
+ }
+ else if (line == selected->end.line)
+ {
+ etox_line_apply_context(line, context, NULL, selected->end.bit);
+ break;
+ }
+ else
+ {
+ etox_line_apply_context(line, context, NULL, NULL);
+ }
+ }
+ }
+
+ etox_layout(selected->etox);
+}
-------------------------------------------------------
This SF.net email is sponsored by: VM Ware
With VMware you can run multiple operating systems on a single machine.
WITHOUT REBOOTING! Mix Linux / Windows / Novell virtual machines
at the same time. Free trial click here:http://www.vmware.com/wl/offer/358/0
_______________________________________________
enlightenment-cvs mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs