Enlightenment CVS committal
Author : rbdpngn
Project : e17
Module : libs/ewl
Dir : e17/libs/ewl/src
Modified Files:
Ewl.h Makefile.am ewl_border.c ewl_button.c ewl_entry.c
ewl_filedialog.c ewl_fileselector.c ewl_progressbar.c
ewl_table.c ewl_text.c ewl_text.h ewl_textarea.c
ewl_textarea.h ewl_tooltip.c
Log Message:
A commit to instill fear and breakage in the heartiest of souls.
* Removed references to estyle, using pure Etox now.
* Filled out more of the multi-line / rich text text editing.
* Slightly updated TODO list
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/Ewl.h,v
retrieving revision 1.51
retrieving revision 1.52
diff -u -3 -r1.51 -r1.52
--- Ewl.h 5 May 2004 04:58:34 -0000 1.51
+++ Ewl.h 13 May 2004 06:03:00 -0000 1.52
@@ -328,7 +328,8 @@
#include <ewl_overlay.h>
#include <ewl_embed.h>
#include <ewl_window.h>
-#include <ewl_text.h>
+
+#include <ewl_textarea.h>
#include <ewl_entry.h>
#include <ewl_password.h>
@@ -349,7 +350,6 @@
#include <ewl_notebook.h>
#include <ewl_progressbar.h>
#include <ewl_scrollpane.h>
-#include <ewl_textarea.h>
#include <ewl_selectionbar.h>
#include <ewl_selectionbook.h>
#include <ewl_tooltip.h>
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/Makefile.am,v
retrieving revision 1.46
retrieving revision 1.47
diff -u -3 -r1.46 -r1.47
--- Makefile.am 7 May 2004 05:03:00 -0000 1.46
+++ Makefile.am 13 May 2004 06:03:00 -0000 1.47
@@ -49,7 +49,6 @@
ewl_spacer.h \
ewl_spectrum.h \
ewl_spinner.h \
- ewl_text.h \
ewl_textarea.h \
ewl_table.h \
ewl_tree.h \
@@ -98,7 +97,6 @@
ewl_spectrum.c \
ewl_spinner.c \
ewl_table.c \
- ewl_text.c \
ewl_textarea.c \
ewl_theme.c \
ewl_tree.c \
@@ -106,5 +104,5 @@
ewl_widget.c \
ewl_window.c
-libewl_la_LIBADD = @edje_libs@ @ecore_libs@ @edb_libs@ @evas_libs@ @etox_libs@
@estyle_libs@ -lm
+libewl_la_LIBADD = @edje_libs@ @ecore_libs@ @edb_libs@ @evas_libs@ @etox_libs@ -lm
libewl_la_LDFLAGS = -version-info 0:0:0
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_border.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -3 -r1.1 -r1.2
--- ewl_border.c 3 May 2004 05:46:12 -0000 1.1
+++ ewl_border.c 13 May 2004 06:03:00 -0000 1.2
@@ -76,7 +76,7 @@
DENTER_FUNCTION(DLEVEL_STABLE);
DCHECK_PARAM_PTR("b", b);
- ewl_text_set_text(EWL_TEXT(b->label), t);
+ ewl_text_text_set(EWL_TEXT(b->label), t);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -95,7 +95,7 @@
w = EWL_WIDGET(b);
- DRETURN_PTR(ewl_text_get_text(EWL_TEXT(b->label)), DLEVEL_STABLE);
+ DRETURN_PTR(ewl_text_text_get(EWL_TEXT(b->label)), DLEVEL_STABLE);
}
/*
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_button.c,v
retrieving revision 1.52
retrieving revision 1.53
diff -u -3 -r1.52 -r1.53
--- ewl_button.c 3 Jan 2004 21:23:11 -0000 1.52
+++ ewl_button.c 13 May 2004 06:03:00 -0000 1.53
@@ -83,7 +83,7 @@
ewl_container_append_child(EWL_CONTAINER(b), b->label_object);
}
else
- ewl_text_set_text(EWL_TEXT(b->label_object), l);
+ ewl_text_text_set(EWL_TEXT(b->label_object), l);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -100,7 +100,7 @@
DENTER_FUNCTION(DLEVEL_STABLE);
if (b->label_object)
- val = ewl_text_get_text(EWL_TEXT(b->label_object));
+ val = ewl_text_text_get(EWL_TEXT(b->label_object));
DRETURN_PTR(val, DLEVEL_STABLE);
}
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_entry.c,v
retrieving revision 1.84
retrieving revision 1.85
diff -u -3 -r1.84 -r1.85
--- ewl_entry.c 30 Apr 2004 05:43:59 -0000 1.84
+++ ewl_entry.c 13 May 2004 06:03:00 -0000 1.85
@@ -93,7 +93,7 @@
DENTER_FUNCTION(DLEVEL_STABLE);
DCHECK_PARAM_PTR("e", e);
- ewl_text_set_text(EWL_TEXT(e->text), t);
+ ewl_text_text_set(EWL_TEXT(e->text), t);
ewl_cursor_set_base(EWL_CURSOR(e->cursor), 1);
DLEAVE_FUNCTION(DLEVEL_STABLE);
@@ -113,7 +113,7 @@
w = EWL_WIDGET(e);
- DRETURN_PTR(ewl_text_get_text(EWL_TEXT(e->text)), DLEVEL_STABLE);
+ DRETURN_PTR(ewl_text_text_get(EWL_TEXT(e->text)), DLEVEL_STABLE);
}
/**
@@ -202,7 +202,7 @@
e = EWL_ENTRY(user_data);
- l = ewl_text_get_length(EWL_TEXT(w));
+ l = ewl_text_length_get(EWL_TEXT(w));
/*
* The contents are clipped starting at these positions
@@ -226,11 +226,11 @@
* Now position the cursor based on the current position in the
* text.
*/
- ewl_text_get_letter_geometry(EWL_TEXT(w), --c_spos, &sx,
- &sy, NULL, NULL);
+ ewl_text_index_geometry_map(EWL_TEXT(w), --c_spos, &sx, &sy,
+ NULL, NULL);
- ewl_text_get_letter_geometry(EWL_TEXT(w), --c_epos, &ex,
- &ey, &ew, NULL);
+ ewl_text_index_geometry_map(EWL_TEXT(w), --c_epos, &ex, &ey,
+ &ew, NULL);
base--;
}
@@ -298,7 +298,7 @@
else if (!strcmp(ev->keyname, "Return") || !strcmp(ev->keyname,
"KP_Return") || !strcmp(ev->keyname, "Enter")
|| !strcmp(ev->keyname, "KP_Enter")) {
- evd = ewl_text_get_text(EWL_TEXT(e->text));
+ evd = ewl_text_text_get(EWL_TEXT(e->text));
ewl_callback_call_with_event_data(w, EWL_CALLBACK_VALUE_CHANGED,
EWL_TEXT(w)->text);
FREE(evd);
@@ -325,16 +325,15 @@
ev = ev_data;
e = EWL_ENTRY(w);
- len = ewl_text_get_length(EWL_TEXT(e->text));
+ len = ewl_text_length_get(EWL_TEXT(e->text));
if (ev->x < CURRENT_X(e->text))
index = 0;
else if (ev->x > CURRENT_X(e->text) + CURRENT_W(e->text)) {
index = len;
}
else {
- index = ewl_text_get_index_at(EWL_TEXT(e->text), ev->x,
- CURRENT_Y(e->text) +
- (CURRENT_H(e->text) / 2));
+ index = ewl_text_coord_index_map(EWL_TEXT(e->text), ev->x,
+ ev->y);
}
index++;
@@ -390,12 +389,11 @@
if (ev->x < CURRENT_X(e->text))
index = 0;
else if (ev->x > CURRENT_X(e->text) + CURRENT_W(e->text)) {
- index = ewl_text_get_length(EWL_TEXT(e->text));
+ index = ewl_text_length_get(EWL_TEXT(e->text));
}
else {
- index = ewl_text_get_index_at(EWL_TEXT(e->text), ev->x,
- (CURRENT_Y(e->text) +
- (CURRENT_H(e->text) / 2)));
+ index = ewl_text_coord_index_map(EWL_TEXT(e->text), ev->x,
+ ev->y);
}
/*
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_filedialog.c,v
retrieving revision 1.33
retrieving revision 1.34
diff -u -3 -r1.33 -r1.34
--- ewl_filedialog.c 17 Feb 2004 22:44:11 -0000 1.33
+++ ewl_filedialog.c 13 May 2004 06:03:00 -0000 1.34
@@ -187,7 +187,7 @@
snprintf (str, sizeof (str), "Current dir: %s", path);
free(path);
- ewl_text_set_text (EWL_TEXT (fd->path_label), str);
+ ewl_text_text_set (EWL_TEXT (fd->path_label), str);
path = ewl_fileselector_get_filename(EWL_FILESELECTOR(fd->selector));
if (!path) return;
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_fileselector.c,v
retrieving revision 1.35
retrieving revision 1.36
diff -u -3 -r1.35 -r1.36
--- ewl_fileselector.c 25 Feb 2004 06:57:28 -0000 1.35
+++ ewl_fileselector.c 13 May 2004 06:03:00 -0000 1.36
@@ -270,7 +270,7 @@
fs = EWL_FILESELECTOR (user_data);
- tmp = ewl_text_get_text(EWL_TEXT(w));
+ tmp = ewl_text_text_get(EWL_TEXT(w));
if (!strcmp (tmp, "/"))
snprintf (file, PATH_MAX, "/%s", tmp);
else
@@ -294,7 +294,7 @@
fs = EWL_FILESELECTOR (user_data);
- tmp = ewl_text_get_text(EWL_TEXT(w));
+ tmp = ewl_text_text_get(EWL_TEXT(w));
if (!strcmp (tmp, "/"))
snprintf (file, PATH_MAX, "/%s", tmp);
else
@@ -357,7 +357,7 @@
format = "%s/%s";
snprintf(path, PATH_MAX, format, fs->path,
- ewl_text_get_text(EWL_TEXT(w)));
+ ewl_text_text_get(EWL_TEXT(w)));
ewl_fileselector_directory_adjust (fs, path);
@@ -377,7 +377,7 @@
fs = EWL_FILESELECTOR (user_data);
- dir = ewl_text_get_text(EWL_TEXT(w));
+ dir = ewl_text_text_get(EWL_TEXT(w));
if (!strcmp(fs->path, "/"))
format = "%s%s";
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_progressbar.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -3 -r1.9 -r1.10
--- ewl_progressbar.c 18 Mar 2004 03:41:23 -0000 1.9
+++ ewl_progressbar.c 13 May 2004 06:03:00 -0000 1.10
@@ -94,7 +94,7 @@
* Do a precentage calculation as a default label.
*/
snprintf (c, sizeof (c), "%.0lf%%", (p->value / p->range) * 100);
- ewl_text_set_text(EWL_TEXT(p->label), c);
+ ewl_text_text_set(EWL_TEXT(p->label), c);
}
ewl_widget_configure(EWL_WIDGET(p));
@@ -170,7 +170,7 @@
p->auto_label = FALSE;
if (label)
- ewl_text_set_text(EWL_TEXT(p->label), label);
+ ewl_text_text_set(EWL_TEXT(p->label), label);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -192,7 +192,7 @@
if (format_string) {
snprintf (label, PATH_MAX, format_string, p->value, p->range);
- ewl_text_set_text(EWL_TEXT(p->label), label);
+ ewl_text_text_set(EWL_TEXT(p->label), label);
}
DLEAVE_FUNCTION(DLEVEL_STABLE);
@@ -208,7 +208,7 @@
DCHECK_PARAM_PTR("p", p);
p->auto_label = FALSE;
- ewl_text_set_text(EWL_TEXT(p->label), "");
+ ewl_text_text_set(EWL_TEXT(p->label), "");
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_table.c,v
retrieving revision 1.42
retrieving revision 1.43
diff -u -3 -r1.42 -r1.43
--- ewl_table.c 24 Mar 2004 04:11:09 -0000 1.42
+++ ewl_table.c 13 May 2004 06:03:00 -0000 1.43
@@ -398,7 +398,7 @@
tw = (Ewl_Text *) ecore_list_goto_first(
EWL_CONTAINER(child)->children);
- DRETURN_PTR(ewl_text_get_text(tw), DLEVEL_STABLE);
+ DRETURN_PTR(ewl_text_text_get(tw), DLEVEL_STABLE);
break;
}
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_text.c,v
retrieving revision 1.60
retrieving revision 1.61
diff -u -3 -r1.60 -r1.61
--- ewl_text.c 7 May 2004 18:50:59 -0000 1.60
+++ ewl_text.c 13 May 2004 06:03:01 -0000 1.61
@@ -1,6 +1,6 @@
#include <Ewl.h>
-#include <Estyle.h>
+#include <Etox.h>
/**
* @param text: the text to display
@@ -101,14 +101,14 @@
t->text = strdup(text);
/*
- * Update the estyle if it's been realized at this point.
+ * Update the etox if it's been realized at this point.
*/
- if (t->estyle) {
+ if (t->etox) {
Evas_Coord x, y, width, height;
- estyle_set_text(t->estyle, t->text);
- t->length = estyle_length(t->estyle);
- evas_object_geometry_get(t->estyle, &x, &y, &width, &height);
+ etox_set_text(t->etox, t->text);
+ t->length = etox_get_length(t->etox);
+ evas_object_geometry_get(t->etox, &x, &y, &width, &height);
ewl_object_set_preferred_size(EWL_OBJECT(t),
(int)(width), (int)(height));
}
@@ -167,16 +167,17 @@
t->overrides |= EWL_TEXT_OVERRIDE_FONT;
/*
- * Change the font for the estyle.
+ * Change the font for the etox.
*/
- if (t->estyle) {
+ if (t->etox) {
Evas_Coord x, y, width, height;
/*
* Change the font and then update the size of the widget
*/
- estyle_set_font(t->estyle, t->font, t->font_size);
- evas_object_geometry_get(t->estyle, &x, &y, &width, &height);
+ etox_context_set_font(t->context, t->font, t->font_size);
+ etox_set_text(t->etox, t->text);
+ evas_object_geometry_get(t->etox, &x, &y, &width, &height);
ewl_object_set_preferred_size(EWL_OBJECT(t),
(int)(width), (int)(height));
}
@@ -226,15 +227,15 @@
t->overrides |= EWL_TEXT_OVERRIDE_SIZE;
/*
- * Change the font for the estyle.
+ * Change the font for the etox.
*/
- if (t->estyle) {
+ if (t->etox) {
Evas_Coord x, y, width, height;
/*
* Change the font and then update the size of the widget
*/
- estyle_set_font(t->estyle, t->font, t->font_size);
+ etox_context_set_font(t->context, t->font, t->font_size);
evas_object_geometry_get(t->estyle, &x, &y, &width, &height);
ewl_object_set_preferred_size(EWL_OBJECT(t),
(int)(width), (int)(height));
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_text.h,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -3 -r1.28 -r1.29
--- ewl_text.h 14 Jan 2004 20:42:54 -0000 1.28
+++ ewl_text.h 13 May 2004 06:03:01 -0000 1.29
@@ -33,15 +33,11 @@
struct Ewl_Text
{
Ewl_Widget widget; /**< Inherit from Ewl_Widget */
- Evas_Object *estyle; /**< Pointer to estyle displaying text */
+ Evas_Object *etox; /**< Pointer to etox displaying text */
char *text; /**< The text contents of the estyle */
- char *font; /**< Name of the font used by the estyle */
- char *style; /**< Name of the stylization on the estyle */
- int font_size; /**< The size of the font in the estyle */
- int align; /**< Alignment of the estyle within the widget */
int length; /**< Length of the text in the estyle */
- int r, g, b, a; /**< Text color of the estyle */
+ Etox_Context *context; /**< Context holding text properties */
int overrides; /**< Bitmask of programmer set properties */
};
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_textarea.c,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -3 -r1.24 -r1.25
--- ewl_textarea.c 28 Feb 2004 04:11:03 -0000 1.24
+++ ewl_textarea.c 13 May 2004 06:03:01 -0000 1.25
@@ -1,25 +1,45 @@
#include <Ewl.h>
-static void ewl_textarea_update_size(Ewl_TextArea * ta);
+static void ewl_text_ops_apply(Ewl_Text *ta);
+static void ewl_text_op_free(void *data);
+static void ewl_text_update_size(Ewl_Text * ta);
+
+/*
+ * Private functions for applying operations to the text at realize time.
+ */
+static Ewl_Text_Op *ewl_text_op_color_new(Ewl_Text *ta, int r, int g, int b,
+ int a);
+static void ewl_text_op_color_apply(Ewl_Text *ta, Ewl_Text_Op *op);
+
+static Ewl_Text_Op *ewl_text_op_font_new(Ewl_Text *ta, char *font, int size);
+static void ewl_text_op_font_apply(Ewl_Text *ta, Ewl_Text_Op *op);
+static void ewl_text_op_font_free(void *op);
+
+static Ewl_Text_Op *ewl_text_op_style_new(Ewl_Text *ta, char *style);
+static void ewl_text_op_style_apply(Ewl_Text *ta, Ewl_Text_Op *op);
+static void ewl_text_op_style_free(void *op);
+
+static Ewl_Text_Op * ewl_text_op_align_new(Ewl_Text *ta, unsigned int align);
+static void ewl_text_op_align_apply(Ewl_Text *ta, Ewl_Text_Op *op);
/**
- * @param text: the initial text of the textarea
- * @return Returns a pointer to a new textarea on success, NULL on failure.
+ * @param text: the initial text of the text
+ * @return Returns a pointer to a new text on success, NULL on failure.
* @brief Allocate a new text area widget
*
* Sets the text initially to @a text if not NULL.
*/
-Ewl_Widget *ewl_textarea_new(char *text)
+Ewl_Widget *ewl_text_new(char *text)
{
- Ewl_TextArea *ta;
+ Ewl_Text *ta;
DENTER_FUNCTION(DLEVEL_STABLE);
- ta = NEW(Ewl_TextArea, 1);
+ ta = NEW(Ewl_Text, 1);
if (!ta)
DRETURN_PTR(NULL, DLEVEL_STABLE);
- ewl_textarea_init(ta, text);
+ ewl_text_init(ta, text);
DRETURN_PTR(EWL_WIDGET(ta), DLEVEL_STABLE);
}
@@ -32,46 +52,36 @@
*
* Sets the internal fields and callbacks of a text area to their defaults.
*/
-void ewl_textarea_init(Ewl_TextArea * ta, char *text)
+void ewl_text_init(Ewl_Text * ta, char *text)
{
Ewl_Widget *w;
- char *style;
- int r, g, b, a;
DENTER_FUNCTION(DLEVEL_STABLE);
DCHECK_PARAM_PTR("ta", ta);
w = EWL_WIDGET(ta);
- ewl_widget_init(EWL_WIDGET(w), "textarea");
+ ewl_widget_init(EWL_WIDGET(w), "text");
- ewl_callback_append(w, EWL_CALLBACK_REALIZE, ewl_textarea_realize_cb,
+ ewl_callback_append(w, EWL_CALLBACK_REALIZE, ewl_text_realize_cb,
NULL);
ewl_callback_append(w, EWL_CALLBACK_UNREALIZE,
- ewl_textarea_unrealize_cb, NULL);
- ewl_callback_append(w, EWL_CALLBACK_REPARENT, ewl_textarea_reparent_cb,
+ ewl_text_unrealize_cb, NULL);
+ ewl_callback_append(w, EWL_CALLBACK_DESTROY,
+ ewl_text_destroy_cb, NULL);
+ ewl_callback_append(w, EWL_CALLBACK_REPARENT, ewl_text_reparent_cb,
NULL);
ewl_callback_append(w, EWL_CALLBACK_CONFIGURE,
- ewl_textarea_configure_cb, NULL);
+ ewl_text_configure_cb, NULL);
- ta->etox_context = etox_context_new();
+ ta->ops = ecore_list_new();
+ ta->applied = ecore_list_new();
- /*
- * Get the default style and color based on the theme. Usually this
- * sort of thing is done at realize time, but the context has lots of
- * things that can be overridden.
- */
- style = ewl_theme_data_get_str(w, "style");
- etox_context_set_style(ta->etox_context, style);
-
- r = ewl_theme_data_get_int(w, "color/r");
- g = ewl_theme_data_get_int(w, "color/g");
- b = ewl_theme_data_get_int(w, "color/b");
- a = ewl_theme_data_get_int(w, "color/a");
- etox_context_set_color(ta->etox_context, r, g, b, a);
+ ecore_list_set_free_cb(ta->ops, ewl_text_op_free);
+ ecore_list_set_free_cb(ta->applied, ewl_text_op_free);
if (text)
- ewl_textarea_set_text(ta, text);
+ ewl_text_text_set(ta, text);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -85,7 +95,7 @@
* Sets the text of the text area widget @a ta to a copy of the contents of
* @a text.
*/
-void ewl_textarea_set_text(Ewl_TextArea * ta, char *text)
+void ewl_text_text_set(Ewl_Text * ta, char *text)
{
DENTER_FUNCTION(DLEVEL_STABLE);
DCHECK_PARAM_PTR("ta", ta);
@@ -98,12 +108,11 @@
ta->text = strdup(text);
/*
- * Update the etox and the sizing of the textarea widget.
+ * Update the etox and the sizing of the text widget.
*/
if (ta->etox) {
-
etox_set_text(ta->etox, text);
- ewl_textarea_update_size(ta);
+ ewl_text_update_size(ta);
}
DLEAVE_FUNCTION(DLEVEL_STABLE);
@@ -114,73 +123,134 @@
* @return Returns a copy of the text in @a ta on success, NULL on failure.
* @brief Retrieve the text of a text widget
*/
-char *ewl_textarea_get_text(Ewl_TextArea * ta)
+char *ewl_text_text_get(Ewl_Text * ta)
{
+ char *txt = NULL;
+
DENTER_FUNCTION(DLEVEL_STABLE);
DCHECK_PARAM_PTR_RET("ta", ta, NULL);
- DRETURN_PTR(strdup(ta->text), DLEVEL_STABLE);
+ if (ta->etox)
+ txt = etox_get_text(ta->etox);
+ else if (ta->text)
+ txt = strdup(ta->text);
+
+ DRETURN_PTR(txt, DLEVEL_STABLE);
}
/**
- * @param ta: the textarea to reveal it's etox
- * @return Returns a pointer to the textarea's etox on success, NULL on failure.
- * @brief Retrieve the etox for performing text manipulation
+ * @param ta: the text widget to retrieve length
+ * @return Returns the length of the text contained in the widget.
+ * @brief Retrieve the length of the text displayed by the text widget.
*/
-Evas_Object *ewl_textarea_get_etox(Ewl_TextArea * ta)
+int ewl_text_length_get(Ewl_Text *ta)
{
+ int len = 0;
+
DENTER_FUNCTION(DLEVEL_STABLE);
- DCHECK_PARAM_PTR_RET("ta", ta, NULL);
+ DCHECK_PARAM_PTR_RET("ta", ta, 0);
- DRETURN_PTR(ta->etox, DLEVEL_STABLE);
+ if (ta->etox)
+ len = etox_get_length(ta->etox);
+ else if (ta->text)
+ len = strlen(ta->text);
+
+ DRETURN_INT(len, DLEVEL_STABLE);
}
/**
- * @param ta: the textarea to be assigned a context
- * @param context: the context to be set for the text area
+ * @param ta: the text widget to change color
+ * @param r: the new red value
+ * @param g: the new green value
+ * @param b: the new blue value
+ * @param a: the new alpha value
+ * @brief Changes the currently applied color of the text to specified values
* @return Returns no value.
- * @brief Put a context into the textarea for etox creation
- *
- * Uses @a context when creating/modifying the etox in @a ta.
*/
-void ewl_textarea_set_context(Ewl_TextArea * ta, Etox_Context * context)
+void ewl_text_color_set(Ewl_Text *ta, int r, int g, int b, int a)
{
DENTER_FUNCTION(DLEVEL_STABLE);
-
DCHECK_PARAM_PTR("ta", ta);
- DCHECK_PARAM_PTR("context", context);
- etox_context_copy(ta->etox_context, context);
+ if (REALIZED(ta))
+ etox_context_set_color(ta->context, r, g, b, a);
+ else {
+ Ewl_Text_Op *op;
+ op = ewl_text_op_color_new(ta, r, g, b, a);
+ ecore_list_append(ta->ops, op);
+ }
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
/**
- * @param ta: the textarea to retrieve it's assigned context
- * @return Returns the assigned context in @a ta if one exists, otherwise NULL.
- * @brief Return the setup context for the text area
+ * @param ta: the text widget to map a coordinate to a character index
+ * @param x: the x coordinate over the desired character
+ * @param y: the y coordinate over the desired character
+ * @brief Finds the index of the character under the specified coordinates
+ * @return Returns the index of the found character on success, 0 otherwise.
*/
-Etox_Context *ewl_textarea_get_context(Ewl_TextArea * ta)
+int ewl_text_coord_index_map(Ewl_Text *ta, int x, int y)
{
- Etox_Context *dst;
+ int index;
DENTER_FUNCTION(DLEVEL_STABLE);
+ DCHECK_PARAM_PTR_RET("ta", ta, 0);
- dst = etox_context_new();
- if (dst)
- etox_context_copy(dst, ta->etox_context);
+ if (!ta->etox)
+ DRETURN_INT(0, DLEVEL_STABLE);
- DRETURN_PTR(dst, DLEVEL_STABLE);
+ index = etox_coord_to_index(ta->etox, (Evas_Coord)(x), (Evas_Coord)(y));
+ DRETURN_INT(index, DLEVEL_STABLE);
}
-void ewl_textarea_realize_cb(Ewl_Widget * w, void *ev_data, void *user_data)
+/**
+ * @param ta: the text widget to map index to character geometry
+ * @param index: character index to be mapped
+ * @param x: pointer to store determined character x coordinate
+ * @param y: pointer to store determined character y coordinate
+ * @param w: pointer to store determined character width
+ * @param h: pointer to store determined character height
+ * @return Returns no value.
+ * @brief Maps a character index to a set of coordinates and sizes.
+ *
+ * Any of the coordinate parameters may be NULL, they will be ignored. If the
+ * index fails to map successfully, the values at the locations pointed to by
+ * the coordinate pointers will not be altered. This function can only succeed
+ * after the text widget has been realized.
+ */
+void ewl_text_index_geometry_map(Ewl_Text *ta, int index, int *x, int *y,
+ int *w, int *h)
{
- Ewl_Embed *emb;
- Ewl_TextArea *ta;
+ Evas_Coord tx, ty, tw, th;
+
+ DENTER_FUNCTION(DLEVEL_STABLE);
+ if (!ta->etox)
+ DRETURN(DLEVEL_STABLE);
+
+ etox_index_to_geometry(ta->etox, index, &tx, &ty, &tw, &th);
+ if (x)
+ *x = (int)(tx);
+ if (y)
+ *y = (int)(ty);
+ if (w)
+ *w = (int)(tw);
+ if (h)
+ *h = (int)(th);
+
+ DLEAVE_FUNCTION(DLEVEL_STABLE);
+}
+
+void ewl_text_realize_cb(Ewl_Widget * w, void *ev_data, void *user_data)
+{
+ char *tmp;
+ Ewl_Text *ta;
+ Ewl_Embed *emb;
+ int r, g, b, a;
DENTER_FUNCTION(DLEVEL_STABLE);
DCHECK_PARAM_PTR("w", w);
- ta = EWL_TEXTAREA(w);
+ ta = EWL_TEXT(w);
/*
* Find the embed so we know which evas to draw onto.
@@ -191,13 +261,20 @@
* Create the etox
*/
ta->etox = etox_new(emb->evas);
+ ta->context = etox_get_context(ta->etox);
- /*
- * If the user setup their own context, use that.
- */
- if (ta->etox_context) {
- etox_context_load(ta->etox, ta->etox_context);
- }
+ tmp = ewl_theme_data_get_str(w, "font");
+ etox_context_set_font(ta->context, tmp,
+ ewl_theme_data_get_int(w, "font_size"));
+
+ tmp = ewl_theme_data_get_str(w, "style");
+ etox_context_set_style(ta->context, tmp);
+
+ r = ewl_theme_data_get_int(w, "color/r");
+ g = ewl_theme_data_get_int(w, "color/g");
+ b = ewl_theme_data_get_int(w, "color/b");
+ a = ewl_theme_data_get_int(w, "color/a");
+ etox_context_set_color(ta->context, r, g, b, a);
if (w->fx_clip_box)
evas_object_clip_set(ta->etox, w->fx_clip_box);
@@ -208,22 +285,43 @@
etox_set_text(ta->etox, ta->text);
evas_object_show(ta->etox);
+ ewl_text_ops_apply(ta);
+
/*
- * Update the size of the textarea
+ * Update the size of the text
*/
- ewl_textarea_update_size(ta);
+ ewl_text_update_size(ta);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
-void ewl_textarea_unrealize_cb(Ewl_Widget * w, void *ev_data, void *user_data)
+static void ewl_text_ops_apply(Ewl_Text *ta)
{
- Ewl_TextArea *ta;
+ Ewl_Text_Op *op;
+
+ while ((op = ecore_list_remove(ta->ops))) {
+ op->apply(ta, op);
+ ecore_list_append(ta->applied, op);
+ }
+}
+
+static void ewl_text_op_free(void *data)
+{
+ Ewl_Text_Op *op = data;
+ if (op->free)
+ op->free(op);
+ else
+ FREE(op)
+}
+
+void ewl_text_unrealize_cb(Ewl_Widget * w, void *ev_data, void *user_data)
+{
+ Ewl_Text *ta;
DENTER_FUNCTION(DLEVEL_STABLE);
DCHECK_PARAM_PTR("w", w);
- ta = EWL_TEXTAREA(w);
+ ta = EWL_TEXT(w);
evas_object_clip_unset(ta->etox);
evas_object_del(ta->etox);
@@ -231,27 +329,44 @@
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
-void ewl_textarea_reparent_cb(Ewl_Widget * w, void *ev_data, void *user_data)
+void ewl_text_destroy_cb(Ewl_Widget * w, void *ev_data, void *user_data)
+{
+ Ewl_Text *ta;
+
+ DENTER_FUNCTION(DLEVEL_STABLE);
+ DCHECK_PARAM_PTR("w", w);
+
+ ta = EWL_TEXT(w);
+ ecore_list_destroy(ta->ops);
+ ta->ops = NULL;
+
+ ecore_list_destroy(ta->applied);
+ ta->applied = NULL;
+
+ DLEAVE_FUNCTION(DLEVEL_STABLE);
+}
+
+void ewl_text_reparent_cb(Ewl_Widget * w, void *ev_data, void *user_data)
{
- Ewl_TextArea *ta;
+ Ewl_Text *ta;
DENTER_FUNCTION(DLEVEL_STABLE);
- ta = EWL_TEXTAREA(w);
+ ta = EWL_TEXT(w);
if (ta->etox)
evas_object_layer_set(ta->etox, ewl_widget_get_layer_sum(w));
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
-void ewl_textarea_configure_cb(Ewl_Widget * w, void *ev_data, void *user_data)
+void ewl_text_configure_cb(Ewl_Widget * w, void *ev_data, void *user_data)
{
- Ewl_TextArea *ta;
+ Ewl_Text *ta;
DENTER_FUNCTION(DLEVEL_STABLE);
DCHECK_PARAM_PTR("w", w);
- ta = EWL_TEXTAREA(w);
+ ta = EWL_TEXT(w);
/*
* Update the etox position and size.
@@ -267,7 +382,7 @@
/*
* Set the size of the text area to the size of the etox.
*/
-static void ewl_textarea_update_size(Ewl_TextArea * ta)
+static void ewl_text_update_size(Ewl_Text * ta)
{
Evas_Coord x, y, width, height;
@@ -290,3 +405,186 @@
ewl_object_set_custom_size(EWL_OBJECT(ta), (int)(width),
(int)(height));
}
+
+static Ewl_Text_Op *
+ewl_text_op_color_new(Ewl_Text *ta, int r, int g, int b, int a)
+{
+ Ewl_Text_Op *op;
+ Ewl_Text_Op_Color *opc;
+
+ DENTER_FUNCTION(DLEVEL_STABLE);
+
+ op = NEW(Ewl_Text_Op_Color, 1);
+ if (op) {
+ opc = (Ewl_Text_Op_Color *)op;
+ op->type = EWL_TEXT_OP_TYPE_COLOR_SET;
+ op->apply = ewl_text_op_color_apply;
+ op->free = free;
+ opc->r = r;
+ opc->g = g;
+ opc->b = b;
+ opc->a = a;
+ }
+
+ DRETURN_PTR(op, DLEVEL_STABLE);
+}
+
+static void
+ewl_text_op_color_apply(Ewl_Text *ta, Ewl_Text_Op *op)
+{
+ int or, og, ob, oa;
+ Ewl_Text_Op_Color *opc = (Ewl_Text_Op_Color *)op;
+
+ DENTER_FUNCTION(DLEVEL_STABLE);
+
+ etox_context_get_color(ta->context, &or, &og, &ob, &oa);
+ etox_context_set_color(ta->context, opc->r, opc->g, opc->b, opc->a);
+
+ /*
+ * Store the previous values for undoing.
+ */
+ opc->r = or;
+ opc->g = og;
+ opc->b = ob;
+ opc->a = oa;
+
+ DLEAVE_FUNCTION(DLEVEL_STABLE);
+}
+
+static Ewl_Text_Op *
+ewl_text_op_font_new(Ewl_Text *ta, char *font, int size)
+{
+ Ewl_Text_Op *op;
+ Ewl_Text_Op_Font *opf;
+
+ DENTER_FUNCTION(DLEVEL_STABLE);
+
+ op = NEW(Ewl_Text_Op_Font, 1);
+ if (op) {
+ opf = (Ewl_Text_Op_Font *)op;
+ op->type = EWL_TEXT_OP_TYPE_FONT_SET;
+ op->apply = ewl_text_op_font_apply;
+ op->free = ewl_text_op_font_free;
+ opf->font = strdup(font);
+ opf->size = size;
+ }
+
+ DRETURN_PTR(op, DLEVEL_STABLE);
+}
+
+static void
+ewl_text_op_font_apply(Ewl_Text *ta, Ewl_Text_Op *op)
+{
+ char *of;
+ int size;
+ Ewl_Text_Op_Font *opf = (Ewl_Text_Op_Font *)op;
+
+ DENTER_FUNCTION(DLEVEL_STABLE);
+
+ of = etox_context_get_font(ta->context, &size);
+
+ etox_context_set_font(ta->context, opf->font, opf->size);
+
+ FREE(opf->font);
+ opf->font = of;
+ opf->size = size;
+
+ DLEAVE_FUNCTION(DLEVEL_STABLE);
+}
+
+static void
+ewl_text_op_font_free(void *op)
+{
+ Ewl_Text_Op_Font *opf = (Ewl_Text_Op_Font *)op;
+ DENTER_FUNCTION(DLEVEL_STABLE);
+
+ FREE(opf->font);
+ FREE(opf);
+
+ DLEAVE_FUNCTION(DLEVEL_STABLE);
+}
+
+static Ewl_Text_Op *
+ewl_text_op_style_new(Ewl_Text *ta, char *style)
+{
+ Ewl_Text_Op *op;
+ Ewl_Text_Op_Style *ops;
+
+ DENTER_FUNCTION(DLEVEL_STABLE);
+
+ op = NEW(Ewl_Text_Op_Style, 1);
+ if (op) {
+ ops = (Ewl_Text_Op_Style *)op;
+ op->type = EWL_TEXT_OP_TYPE_STYLE_SET;
+ op->apply = ewl_text_op_style_apply;
+ op->free = ewl_text_op_style_free;
+ ops->style = strdup(style);
+ }
+
+ DRETURN_PTR(op, DLEVEL_STABLE);
+}
+
+static void
+ewl_text_op_style_apply(Ewl_Text *ta, Ewl_Text_Op *op)
+{
+ char *style;
+ Ewl_Text_Op_Style *ops = (Ewl_Text_Op_Style *)op;
+
+ DENTER_FUNCTION(DLEVEL_STABLE);
+
+ style = etox_context_get_style(ta->context);
+ etox_context_set_style(ta->context, ops->style);
+
+ FREE(ops->style);
+ ops->style = style;
+
+ DLEAVE_FUNCTION(DLEVEL_STABLE);
+}
+
+static void
+ewl_text_op_style_free(void *op)
+{
+ Ewl_Text_Op_Style *ops = (Ewl_Text_Op_Style *)op;
+ DENTER_FUNCTION(DLEVEL_STABLE);
+
+ FREE(ops->style);
+ FREE(ops);
+
+ DLEAVE_FUNCTION(DLEVEL_STABLE);
+}
+
+static Ewl_Text_Op *
+ewl_text_op_align_new(Ewl_Text *ta, unsigned int align)
+{
+ Ewl_Text_Op *op;
+ Ewl_Text_Op_Align *opa;
+
+ DENTER_FUNCTION(DLEVEL_STABLE);
+
+ op = NEW(Ewl_Text_Op_Align, 1);
+ if (op) {
+ opa = (Ewl_Text_Op_Align *)op;
+ op->type = EWL_TEXT_OP_TYPE_ALIGN_SET;
+ op->apply = ewl_text_op_align_apply;
+ op->free = free;
+ opa->align = align;
+ }
+
+ DRETURN_PTR(op, DLEVEL_STABLE);
+}
+
+static void
+ewl_text_op_align_apply(Ewl_Text *ta, Ewl_Text_Op *op)
+{
+ unsigned int align;
+ Ewl_Text_Op_Align *opa = (Ewl_Text_Op_Align *)op;
+
+ DENTER_FUNCTION(DLEVEL_STABLE);
+
+ align = etox_context_get_align(ta->context);
+ etox_context_set_align(ta->context, opa->align);
+
+ opa->align = align;
+
+ DLEAVE_FUNCTION(DLEVEL_STABLE);
+}
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_textarea.h,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -3 -r1.10 -r1.11
--- ewl_textarea.h 14 Jan 2004 20:42:54 -0000 1.10
+++ ewl_textarea.h 13 May 2004 06:03:01 -0000 1.11
@@ -1,65 +1,170 @@
-#ifndef __EWL_TEXTAREA_H__
-#define __EWL_TEXTAREA_H__
+#ifndef __EWL_TEXT_H__
+#define __EWL_TEXT_H__
/**
- * @defgroup Ewl_TextArea TextArea: A Multi-Line Text Layout Display
+ * @defgroup Ewl_Text Text: A Multi-Line Text Layout Display
* @brief Defines a class for multi-line text layout and formatting.
*
* @{
*/
/**
- * @themekey /textarea/file
- * @themekey /textarea/group
+ * @themekey /text/file
+ * @themekey /text/group
*/
/**
* Provides for layout of text across multiple lines, as well as formatting
* portions of the text in different ways, and wrapping around obstacles.
*/
-typedef struct Ewl_TextArea Ewl_TextArea;
+typedef struct Ewl_Text Ewl_Text;
/**
- * @def EWL_TEXTAREA(textarea)
- * Typecasts a pointer to an Ewl_TextArea pointer.
+ * @def EWL_TEXT(text)
+ * Typecasts a pointer to an Ewl_Text pointer.
*/
-#define EWL_TEXTAREA(textarea) ((Ewl_TextArea *) textarea)
+#define EWL_TEXT(text) ((Ewl_Text *) text)
/**
- * @struct Ewl_TextArea
+ * @struct Ewl_Text
* Inherits from the Ewl_Widget class and extends it to provide for multi-line
* text layout, obstacle wrapping, and a variety of formatting.
*/
-struct Ewl_TextArea
+struct Ewl_Text
{
- Ewl_Widget widget; /**< Inherit from Ewl_Widget */
- char *text; /**< The initial text in the textarea */
- Evas_Object *etox; /**< The Etox does the actual layout work */
- Etox_Context *etox_context; /**< Contains various format settings */
+ Ewl_Widget widget; /**< Inherit from Ewl_Widget */
+ char *text; /**< The initial text in the text */
+ Evas_Object *etox; /**< Etox does the actual layout work */
+ Etox_Context *context; /**< Contains various format settings */
+ Ecore_List *ops; /**< Series of operations to apply */
+ Ecore_List *applied; /**< Applied set of operations */
};
-Ewl_Widget *ewl_textarea_new(char *text);
-void ewl_textarea_init(Ewl_TextArea * ta, char *text);
+typedef enum
+{
+ EWL_TEXT_OVERRIDE_COLOR = 0x1,
+ EWL_TEXT_OVERRIDE_FONT = 0x2,
+ EWL_TEXT_OVERRIDE_SIZE = 0x4,
+ EWL_TEXT_OVERRIDE_STYLE = 0x8,
+} Ewl_Text_Overrides;
+
+/**
+ * @enum Ewl_Text_Ops
+ * Provides a series of operations that can be performed on the text.
+ */
+typedef enum
+{
+ EWL_TEXT_OP_TYPE_COLOR_SET,
+ EWL_TEXT_OP_TYPE_FONT_SET,
+ EWL_TEXT_OP_TYPE_STYLE_SET,
+ EWL_TEXT_OP_TYPE_ALIGN_SET,
+ EWL_TEXT_OP_TYPE_SELECT,
+ EWL_TEXT_OP_TYPE_TEXT_PREPEND,
+ EWL_TEXT_OP_TYPE_TEXT_APPEND,
+ EWL_TEXT_OP_TYPE_TEXT_INSERT,
+} Ewl_Text_Op_Type;
+
+typedef struct Ewl_Text_Op Ewl_Text_Op;
+struct Ewl_Text_Op
+{
+ Ewl_Text_Op_Type type;
+ void (*apply)(Ewl_Text *ta, Ewl_Text_Op *op);
+ void (*free)(void *);
+};
+
+typedef struct Ewl_Text_Op_Color Ewl_Text_Op_Color;
+struct Ewl_Text_Op_Color
+{
+ Ewl_Text_Op op;
+ int r, g, b, a;
+};
+
+typedef struct Ewl_Text_Op_Font Ewl_Text_Op_Font;
+struct Ewl_Text_Op_Font
+{
+ Ewl_Text_Op op;
+ char *font;
+ int size;
+};
+
+typedef struct Ewl_Text_Op_Style Ewl_Text_Op_Style;
+struct Ewl_Text_Op_Style
+{
+ Ewl_Text_Op op;
+ char *style;
+};
+
+typedef struct Ewl_Text_Op_Align Ewl_Text_Op_Align;
+struct Ewl_Text_Op_Align
+{
+ Ewl_Text_Op op;
+ unsigned int align;
+};
+
+typedef struct Ewl_Text_Op_Select Ewl_Text_Op_Select;
+struct Ewl_Text_Op_Select
+{
+ Ewl_Text_Op op;
+ Evas_Coord sx, sy, ex, ey;
+ int si, ei;
+ char *match;
+ int index;
+};
+
+typedef struct Ewl_Text_Op_Text Ewl_Text_Op_Text;
+struct Ewl_Text_Op_Text
+{
+ Ewl_Text_Op op;
+ char *text;
+ int index;
+};
-void ewl_textarea_set_text(Ewl_TextArea * ta, char *text);
-char *ewl_textarea_get_text(Ewl_TextArea * ta);
+Ewl_Widget *ewl_text_new(char *text);
+void ewl_text_init(Ewl_Text * ta, char *text);
-Evas_Object *ewl_textarea_get_etox(Ewl_TextArea * ta);
-void ewl_textarea_set_context(Ewl_TextArea * ta,
- Etox_Context * context);
-Etox_Context *ewl_textarea_get_context(Ewl_TextArea * ta);
+void ewl_text_text_set(Ewl_Text * ta, char *text);
+void ewl_text_text_prepend(Ewl_Text * ta, char *text);
+void ewl_text_text_append(Ewl_Text * ta, char *text);
+void ewl_text_text_insert(Ewl_Text * ta, char *text, int index);
+char *ewl_text_text_get(Ewl_Text * ta);
+
+int ewl_text_length_get(Ewl_Text *ta);
+
+void ewl_text_font_set(Ewl_Text *ta, char *font, int size);
+char *ewl_text_font_get(Ewl_Text *ta);
+int ewl_text_font_size_get(Ewl_Text *ta);
+
+void ewl_text_style_set(Ewl_Text *ta, char *style);
+char *ewl_text_style_get(Ewl_Text *ta);
+
+void ewl_text_color_set(Ewl_Text *ta, int r, int g, int b, int a);
+void ewl_text_color_get(Ewl_Text *ta, int *r, int *g, int *b, int *a);
+
+void ewl_text_align_set(Ewl_Text *ta, int r, int g, int b, int a);
+unsigned int ewl_text_align_get(Ewl_Text *ta);
+
+void ewl_text_index_select(Ewl_Text *ta, int si, int ei);
+void ewl_text_coord_select(Ewl_Text *ta, int sx, int sy, int ex,
+ int ey);
+
+void ewl_text_index_geometry_map(Ewl_Text *ta, int index, int *xx,
+ int *yy, int *ww, int *hh);
+int ewl_text_coord_index_map(Ewl_Text *ta, int x, int y);
+int ewl_text_coord_geometry_map(Ewl_Text *ta, int x, int y, int *xx,
+ int *yy, int *ww, int *hh);
/*
* Internally used callbacks, override at your own risk.
*/
-void ewl_textarea_realize_cb(Ewl_Widget * w, void *ev_data, void *user_data);
-void ewl_textarea_unrealize_cb(Ewl_Widget * w, void *ev_data, void *user_data);
-void ewl_textarea_reparent_cb(Ewl_Widget * w, void *ev_data, void *user_data);
-void ewl_textarea_configure_cb(Ewl_Widget * w, void *ev_data, void *user_data);
+void ewl_text_realize_cb(Ewl_Widget * w, void *ev_data, void *user_data);
+void ewl_text_unrealize_cb(Ewl_Widget * w, void *ev_data, void *user_data);
+void ewl_text_destroy_cb(Ewl_Widget * w, void *ev_data, void *user_data);
+void ewl_text_reparent_cb(Ewl_Widget * w, void *ev_data, void *user_data);
+void ewl_text_configure_cb(Ewl_Widget * w, void *ev_data, void *user_data);
/**
* @}
*/
-#endif /* __EWL_TEXTAREA_H__ */
+#endif /* __EWL_TEXT_H__ */
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_tooltip.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -3 -r1.7 -r1.8
--- ewl_tooltip.c 18 Mar 2004 16:00:21 -0000 1.7
+++ ewl_tooltip.c 13 May 2004 06:03:01 -0000 1.8
@@ -81,7 +81,7 @@
DENTER_FUNCTION(DLEVEL_STABLE);
DCHECK_PARAM_PTR("t", t);
- ewl_text_set_text (EWL_TEXT (t), text);
+ ewl_text_text_set (EWL_TEXT (t), text);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
-------------------------------------------------------
This SF.Net email is sponsored by: SourceForge.net Broadband
Sign-up now for SourceForge Broadband and get the fastest
6.0/768 connection for only $19.95/mo for the first 3 months!
http://ads.osdn.com/?ad_id=2562&alloc_id=6184&op=click
_______________________________________________
enlightenment-cvs mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs