Enlightenment CVS committal

Author  : pfritz
Project : e17
Module  : libs/ewl

Dir     : e17/libs/ewl/src/bin/tests


Modified Files:
        ewl_text_editor.c 


Log Message:
you can now test utf character support when you hit CTRL-a

===================================================================
RCS file: /cvs/e/e17/libs/ewl/src/bin/tests/ewl_text_editor.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -3 -r1.3 -r1.4
--- ewl_text_editor.c   22 May 2006 18:09:00 -0000      1.3
+++ ewl_text_editor.c   3 Jul 2006 00:56:53 -0000       1.4
@@ -2,6 +2,7 @@
 #include "ewl_test_private.h"
 #include <stdio.h>
 #include <stdlib.h>
+#include <string.h>
 
 typedef struct 
 {
@@ -47,6 +48,7 @@
 static void ete_cb_set(Ewl_Widget *w, void *ev, void *data);
 static void ete_cb_load(Ewl_Widget *w, void *ev, void *data);
 static void ete_cb_clear(Ewl_Widget *w, void *ev, void *data);
+static void ete_cb_key_down(Ewl_Widget *w, void *ev, void *data);
 
 void 
 test_info(Ewl_Test *test)
@@ -139,6 +141,7 @@
 
        ewl_object_fill_policy_set(EWL_OBJECT(o), 
                                EWL_FLAG_FILL_HFILL | EWL_FLAG_FILL_VFILL);
+       ewl_callback_append(o, EWL_CALLBACK_KEY_DOWN, ete_cb_key_down, NULL);
        ewl_widget_show(o);
 
        hbox = ewl_hbox_new();
@@ -377,4 +380,27 @@
        ewl_text_clear(EWL_TEXT(entry));
 }
 
+static void
+ete_cb_key_down(Ewl_Widget *w, void *ev, void *data __UNUSED__)
+{
+       Ewl_Event_Key_Down *e;
+
+       e = ev;
+
+       /*
+        * insert an utf-8 character when you hit CTRL-a
+        */
+       if (e && (e->modifiers & EWL_KEY_MODIFIER_CTRL) 
+                       && !strcmp(e->keyname, "a")) {
+               Ewl_Embed * emb;
+               unsigned char buf[3];
+
+               emb = ewl_embed_widget_find(w);
+               buf[0] = 0xC3;
+               buf[1] = 0xA4;
+               buf[2] = 0;
+               
+               ewl_embed_key_down_feed(emb, (char *)buf, 0);
+       }
+}
 



Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to