Enlightenment CVS committal

Author  : ningerso
Project : e17
Module  : libs/ewl

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


Modified Files:
        ewl_pointer.c 


Log Message:
Convert the pointer test to use the new custom cursor code.

===================================================================
RCS file: /cvs/e/e17/libs/ewl/src/bin/tests/pointer/ewl_pointer.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -3 -r1.4 -r1.5
--- ewl_pointer.c       8 Nov 2006 05:57:04 -0000       1.4
+++ ewl_pointer.c       8 Nov 2006 06:39:29 -0000       1.5
@@ -4,13 +4,10 @@
 #include <stdlib.h>
 
 static int create_test(Ewl_Container *win);
-static void cb_render(Ewl_Widget *w, void *ev, void *data);
 static void cb_destroy(Ewl_Widget *w, void *ev, void *data);
 static int timer_cb_in(void *data);
 static int timer_cb_out(void *data);
 
-#define WIN_NAME "buffer_engine_window"
-
 static Ecore_Timer *cur_timer;
 
 void 
@@ -29,25 +26,9 @@
        Ewl_Widget *pointer_win;
        Ewl_Widget *o;
 
-       o = ewl_entry_new();
-       ewl_text_text_set(EWL_TEXT(o), "Expect to see a button cursor\n"
-                      "over this entry and a normal cursor\n"
-                      "over other parts of the window");
-       ewl_entry_editable_set(EWL_ENTRY(o), FALSE);
-       ewl_object_fill_policy_set(EWL_OBJECT(o), EWL_FLAG_FILL_HFILL);
-       ewl_container_child_append(EWL_CONTAINER(box), o);
-       ewl_widget_show(o);
-
-       pointer_win = ewl_window_new();
-       ewl_widget_name_set(pointer_win, WIN_NAME);
-       ewl_object_fill_policy_set(EWL_OBJECT(pointer_win), EWL_FLAG_FILL_ALL);
-       ewl_object_size_request(EWL_OBJECT(pointer_win), 64, 64);
-       ewl_embed_engine_name_set(EWL_EMBED(pointer_win), "evas_buffer");
-       ewl_callback_append(pointer_win, EWL_CALLBACK_VALUE_CHANGED,
-                       cb_render, o);
+       pointer_win = ewl_cursor_new();
        ewl_callback_append(pointer_win, EWL_CALLBACK_DESTROY,
                        cb_destroy, o);
-       ewl_widget_appearance_set(pointer_win, "none");
        ewl_widget_show(pointer_win);
 
        o = ewl_button_new();
@@ -57,6 +38,16 @@
 
        cur_timer = ecore_timer_add(2.0, timer_cb_in, o);
 
+       o = ewl_entry_new();
+       ewl_attach_mouse_argb_cursor_set(o, pointer_win);
+       ewl_text_text_set(EWL_TEXT(o), "Expect to see a button cursor\n"
+                      "over this entry and a normal cursor\n"
+                      "over other parts of the window");
+       ewl_entry_editable_set(EWL_ENTRY(o), FALSE);
+       ewl_object_fill_policy_set(EWL_OBJECT(o), EWL_FLAG_FILL_HFILL);
+       ewl_container_child_append(EWL_CONTAINER(box), o);
+       ewl_widget_show(o);
+
        return 1;
 }
 
@@ -82,32 +73,6 @@
        cur_timer = ecore_timer_add(2.0, timer_cb_in, data);
 
        return 0;
-}
-
-static void
-cb_render(Ewl_Widget *w, void *ev __UNUSED__, void *data)
-{
-       int old, handle;
-       int width, height;
-       Ewl_Embed *parent;
-       Ewl_Embed *emb = EWL_EMBED(w);
-       Ewl_Widget *entry = EWL_WIDGET(data);
-
-       parent = ewl_embed_widget_find(entry);
-
-       width = ewl_object_current_w_get(EWL_OBJECT(emb));
-       height = ewl_object_current_h_get(EWL_OBJECT(emb));
-
-       old = (int)ewl_attach_get(entry, EWL_ATTACH_TYPE_MOUSE_CURSOR);
-       if (old >= EWL_MOUSE_CURSOR_MAX)
-               ewl_engine_pointer_free(parent, old);
-
-       handle = ewl_engine_pointer_data_new(parent, emb->evas_window, width,
-                       height);
-
-       ewl_attach_mouse_cursor_set(entry, handle);
-       if (parent->cursor == old)
-               ewl_embed_mouse_cursor_set(entry);
 }
 
 static void



-------------------------------------------------------------------------
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