aboutsummaryrefslogtreecommitdiffstats
path: root/widgets/text/e-text-model-test.c
diff options
context:
space:
mode:
authorJon Trowbridge <trow@gnu.org>2001-01-30 04:27:38 +0800
committerJon Trowbridge <trow@src.gnome.org>2001-01-30 04:27:38 +0800
commitb0046a3699f814f39e31192e21c17c15b0dd8474 (patch)
tree23e7f567903068db06a80ebcfa4187f264f611fb /widgets/text/e-text-model-test.c
parentba874ca7d0237c07b0630930eeebda613c543640 (diff)
downloadgsoc2013-evolution-b0046a3699f814f39e31192e21c17c15b0dd8474.tar.gz
gsoc2013-evolution-b0046a3699f814f39e31192e21c17c15b0dd8474.tar.zst
gsoc2013-evolution-b0046a3699f814f39e31192e21c17c15b0dd8474.zip
Connect to the model's "position" signal. (e_text_init): Set default value
2001-01-29 Jon Trowbridge <trow@gnu.org> * gal/e-text/e-text.c (e_text_init): Connect to the model's "position" signal. (e_text_init): Set default value for rgba_object as blue. (e_text_destroy): Disconnect model position signal. (fix_selection): Some extra sanity checking to keep the selection from spilling outside of the bounds of the text string as it expands or contracts. Should be obsolete due to the changes to objectify_uris --- but I'll leave this in here for now, in an attempt to avoid non-\0-terminated strings, segfaults, and all of that fun stuff. (e_text_text_model_position): Move our cursor according to the suggestions made by our ETextModel, via the "position" signal. (text_width_with_objects): Check that text is not NULL. (text_draw_with_objects): Accept an extra GdkGC for use in drawing objects. (e_text_set_arg): Properly handle the "position" signal when changing models. (e_text_draw): Initialize the GC for drawing objects, if necessary. (_insert): Comment out the code that adjustes text->selection_*. The cursor is now moved by the ETextModel directly via the position signal, not by the view. * gal/e-text/e-text-model-uri.c (objectify_uris): Add more sophisticated uri recognition via regular expressions. (objectify_uris): Changed to track position changes as model->text expands and contracts along with the objects. Block the objectification of any chunks of text that straddle our current position. (e_text_model_uri_set_text): Added position info to objectify_uris call. (e_text_model_uri_insert): Added position info to objectify_uris call. (e_text_model_uri_insert_length): Added position info to objectify_uris call. (e_text_model_uri_delete): Added position info to objectify_uris call. * gal/e-text/e-text-model.c (e_text_model_class_init): Added a "position" signal that allows the ETextModel to send cursor positioning information back to any view. We need this for text with objects, where the text string can grow and shrink in ways that the view doesn't expect. (e_text_model_real_insert): Added sanity checking of args and a position emission. (e_text_model_real_insert_length): Added sanity checking of args and a position emission. (e_text_model_real_delete): Added sanity checking of args. (e_text_model_suggest_position): A wrapper around the "position" signal emitter. svn path=/trunk/; revision=7894
Diffstat (limited to 'widgets/text/e-text-model-test.c')
-rw-r--r--widgets/text/e-text-model-test.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/widgets/text/e-text-model-test.c b/widgets/text/e-text-model-test.c
index 0c758cd4ba..8f528efce1 100644
--- a/widgets/text/e-text-model-test.c
+++ b/widgets/text/e-text-model-test.c
@@ -38,7 +38,9 @@ main (int argc, gchar **argv)
gnome_init ("ETextModelTest", "0.0", argc, argv);
model = e_text_model_uri_new ();
- e_text_model_set_text (model, "My favorite website is http://www.ximian.com. My next favorite is http://www.gnome.org.");
+ e_text_model_set_text (model, "My favorite website is http://www.ximian.com. My next favorite is www.assbarn.com.");
+
+ describe_model (model);
win = gtk_window_new (GTK_WINDOW_TOPLEVEL);
@@ -52,9 +54,9 @@ main (int argc, gchar **argv)
e_text_get_type (),
"model", model,
"font", "-adobe-helvetica-medium-r-normal--12-120-75-75-p-67-iso8859-1",
- "anchor", GTK_ANCHOR_SOUTH_WEST,
+ "anchor", GTK_ANCHOR_NORTH_WEST,
"line_wrap", TRUE,
- "width", 150.0,
+ "width", 300.0,
"editable", TRUE,
NULL);