Enlightenment CVS committal

Author  : rbdpngn
Project : e17
Module  : libs/ewl

Dir     : e17/libs/ewl/src


Modified Files:
        ewl_cursor.c ewl_entry.c ewl_entry.h ewl_events.h 
        ewl_password.c ewl_scrollpane.c ewl_scrollpane.h ewl_widget.c 
        ewl_window.c 


Log Message:
Some refactoring to start abstracting the window code some more. Two patches
from Dan Sinclair 1. improve the entry behavior and 2. add the API calls to
scroll the scrollpane manually. Also filled out a few of the event structures.

===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_cursor.c,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -3 -r1.15 -r1.16
--- ewl_cursor.c        12 Nov 2003 20:07:17 -0000      1.15
+++ ewl_cursor.c        24 Feb 2004 04:25:38 -0000      1.16
@@ -59,6 +59,9 @@
        DENTER_FUNCTION(DLEVEL_STABLE);
        DCHECK_PARAM_PTR("c", c);
 
+       if (pos == 0)
+               pos = 1;
+
        c->position.start = c->position.end = c->position.base = pos;
 
        DLEAVE_FUNCTION(DLEVEL_STABLE);
@@ -110,6 +113,9 @@
        DENTER_FUNCTION(DLEVEL_STABLE);
        DCHECK_PARAM_PTR("c", c);
 
+       if (pos == 0)
+               pos = 1;
+
        if (pos < c->position.base) {
                c->position.start = pos;
                c->position.end = c->position.base;
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_entry.c,v
retrieving revision 1.77
retrieving revision 1.78
diff -u -3 -r1.77 -r1.78
--- ewl_entry.c 21 Feb 2004 18:11:11 -0000      1.77
+++ ewl_entry.c 24 Feb 2004 04:25:38 -0000      1.78
@@ -67,7 +67,7 @@
                            ewl_entry_configure_cb, NULL);
 
        ewl_callback_append(w, EWL_CALLBACK_SELECT, ewl_entry_select_cb, NULL);
-       ewl_callback_append(w, EWL_CALLBACK_DESELECT, ewl_entry_deselect_cb,
+       ewl_callback_append(w, EWL_CALLBACK_FOCUS_OUT, ewl_entry_focus_out_cb,
                            NULL);
 
        ewl_entry_set_editable(e, TRUE);
@@ -321,12 +321,13 @@
                index = 0;
        else if (ev->x > CURRENT_X(e->text) + CURRENT_W(e->text)) {
                index = len;
-       } else
+       }
+       else {
                index = ewl_text_get_index_at(EWL_TEXT(e->text), ev->x,
                                              CURRENT_Y(e->text) +
                                              (CURRENT_H(e->text) / 2));
-
-       index++;
+               index++;
+       }
 
        if (index > len + 1)
                index = len + 1;
@@ -391,7 +392,7 @@
        DLEAVE_FUNCTION(DLEVEL_STABLE);
 }
 
-void ewl_entry_deselect_cb(Ewl_Widget * w, void *ev_data, void *user_data)
+void ewl_entry_focus_out_cb(Ewl_Widget * w, void *ev_data, void *user_data)
 {
        Ewl_Entry      *e;
 
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_entry.h,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -3 -r1.28 -r1.29
--- ewl_entry.h 3 Jan 2004 21:23:11 -0000       1.28
+++ ewl_entry.h 24 Feb 2004 04:25:38 -0000      1.29
@@ -64,7 +64,7 @@
 void ewl_entry_mouse_down_cb(Ewl_Widget * w, void *ev_data, void *user_data);
 void ewl_entry_mouse_move_cb(Ewl_Widget * w, void *ev_data, void *user_data);
 void ewl_entry_select_cb(Ewl_Widget * w, void *ev_data, void *user_data);
-void ewl_entry_deselect_cb(Ewl_Widget * w, void *ev_data, void *user_data);
+void ewl_entry_focus_out_cb(Ewl_Widget * w, void *ev_data, void *user_data);
 
 void ewl_entry_update_selected_region_cb(Ewl_Widget * w, void *user_data,
                                         void *ev_data);
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_events.h,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -3 -r1.15 -r1.16
--- ewl_events.h        19 Feb 2004 21:45:02 -0000      1.15
+++ ewl_events.h        24 Feb 2004 04:25:38 -0000      1.16
@@ -32,36 +32,55 @@
 
 struct Ewl_Event_Key_Down
 {
+       char *keyname;
+       unsigned int modifiers;
 };
 
 typedef struct Ewl_Event_Key_Up Ewl_Event_Key_Up;
 
 struct Ewl_Event_Key_Up
 {
+       char *keyname;
+       unsigned int modifiers;
 };
 
 typedef struct Ewl_Event_Mouse_Down Ewl_Event_Mouse_Down;
 
 struct Ewl_Event_Mouse_Down
 {
+       int button;
+       int x, y;
+       unsigned int modifiers;
 };
 
 typedef struct Ewl_Event_Mouse_Up Ewl_Event_Mouse_Up;
 
 struct Ewl_Event_Mouse_Up
 {
+       int button;
+       int x, y;
+       unsigned int modifiers;
 };
 
 typedef struct Ewl_Event_Mouse_Move Ewl_Event_Mouse_Move;
 
 struct Ewl_Event_Mouse_Move
 {
+       int x, y;
+};
+
+typedef struct Ewl_Event_Mouse_In Ewl_Event_Mouse_In;
+
+struct Ewl_Event_Mouse_In
+{
+       int x, y;
 };
 
 typedef struct Ewl_Event_Mouse_Out Ewl_Event_Mouse_Out;
 
 struct Ewl_Event_Mouse_Out
 {
+       int x, y;
 };
 
 int ewl_ev_init(void);
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_password.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -3 -r1.4 -r1.5
--- ewl_password.c      10 Dec 2003 01:24:07 -0000      1.4
+++ ewl_password.c      24 Feb 2004 04:25:38 -0000      1.5
@@ -45,7 +45,7 @@
         * Attach necessary callback mechanisms 
         */
        ewl_callback_del(w, EWL_CALLBACK_SELECT, ewl_entry_select_cb);
-       ewl_callback_del(w, EWL_CALLBACK_DESELECT, ewl_entry_deselect_cb);
+       ewl_callback_del(w, EWL_CALLBACK_DESELECT, ewl_entry_focus_out_cb);
        ewl_callback_del(w, EWL_CALLBACK_KEY_DOWN, ewl_entry_key_down_cb);
        ewl_callback_del(w, EWL_CALLBACK_MOUSE_DOWN, ewl_entry_mouse_down_cb);
        ewl_callback_del(w, EWL_CALLBACK_MOUSE_MOVE, ewl_entry_mouse_move_cb);
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_scrollpane.c,v
retrieving revision 1.30
retrieving revision 1.31
diff -u -3 -r1.30 -r1.31
--- ewl_scrollpane.c    25 Nov 2003 07:47:29 -0000      1.30
+++ ewl_scrollpane.c    24 Feb 2004 04:25:38 -0000      1.31
@@ -190,6 +190,68 @@
                        DLEVEL_STABLE);
 }
 
+/**
+ * @param s: the scrollpane to set the horizontal scrollbar value
+ * @param val: the value to set the scrollbar too
+ * @return Returns nothing
+ * @brief Set the value of the horizontal scrollbar in @a s to @a val
+ */
+void ewl_scrollpane_set_hscrollbar_value(Ewl_ScrollPane *s, double val)
+{
+    DENTER_FUNCTION(DLEVEL_STABLE);
+    DCHECK_PARAM_PTR("s", s);
+
+    ewl_scrollbar_set_value(EWL_SCROLLBAR(s->hscrollbar), val);
+
+    DLEAVE_FUNCTION(DLEVEL_STABLE);
+}
+
+/**
+ * @param s: the scrollpane to set the vertical scrollbar value
+ * @param val: the value to set the scrollbar too
+ * @return Returns nothing
+ * @brief Set the value of the vertical scrollbar in @a s to @a val
+ */
+void ewl_scrollpane_set_vscrollbar_value(Ewl_ScrollPane *s, double val)
+{
+    DENTER_FUNCTION(DLEVEL_STABLE);
+    DCHECK_PARAM_PTR("s", s);
+
+    ewl_scrollbar_set_value(EWL_SCROLLBAR(s->vscrollbar), val);
+
+    DLEAVE_FUNCTION(DLEVEL_STABLE);
+}
+
+/**
+ * @param s: the scrollpane to retrieve its vertical scrollbar stepping 
+ * @return Returns the value of the stepping of the vertical scrollbar 
+ *         in @a s on success.
+ * @brief Retrives the value of the stepping of the vertical scrollbar in @a s.
+ */
+double ewl_scrollpane_get_hscrollbar_step(Ewl_ScrollPane *s) 
+{
+    DENTER_FUNCTION(DLEVEL_STABLE);
+    DCHECK_PARAM_PTR_RET("s", s, 0.0);
+
+    DRETURN_FLOAT(ewl_scrollbar_get_step(EWL_SCROLLBAR(s->hscrollbar)),
+            DLEVEL_STABLE);
+}
+
+/**
+ * @param s: the scrollpane to retrieve its vertical scrollbar stepping 
+ * @return Returns the value of the stepping of the vertical scrollbar 
+ *         in @a s on success.
+ * @brief Retrives the value of the stepping of the vertical scrollbar in @a s.
+ */
+double ewl_scrollpane_get_vscrollbar_step(Ewl_ScrollPane *s) 
+{
+    DENTER_FUNCTION(DLEVEL_STABLE);
+    DCHECK_PARAM_PTR_RET("s", s, 0.0);
+
+    DRETURN_FLOAT(ewl_scrollbar_get_step(EWL_SCROLLBAR(s->vscrollbar)),
+            DLEVEL_STABLE);
+}
+
 /*
  * Move the contents of the scrollbar into place
  */
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_scrollpane.h,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -3 -r1.9 -r1.10
--- ewl_scrollpane.h    19 Nov 2003 20:18:35 -0000      1.9
+++ ewl_scrollpane.h    24 Feb 2004 04:25:39 -0000      1.10
@@ -54,6 +54,12 @@
 double          ewl_scrollpane_get_hscrollbar_value(Ewl_ScrollPane *s);
 double          ewl_scrollpane_get_vscrollbar_value(Ewl_ScrollPane *s);
 
+void            ewl_scrollpane_set_hscrollbar_value(Ewl_ScrollPane *s, double val);
+void            ewl_scrollpane_set_vscrollbar_value(Ewl_ScrollPane *s, double val);
+
+double          ewl_scrollpane_get_hscrollbar_step(Ewl_ScrollPane *s);
+double          ewl_scrollpane_get_vscrollbar_step(Ewl_ScrollPane *s);
+
 /*
  * Internally used callbacks, override at your own risk.
  */
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_widget.c,v
retrieving revision 1.103
retrieving revision 1.104
diff -u -3 -r1.103 -r1.104
--- ewl_widget.c        23 Feb 2004 06:08:13 -0000      1.103
+++ ewl_widget.c        24 Feb 2004 04:25:39 -0000      1.104
@@ -73,7 +73,7 @@
        ewl_callback_append(w, EWL_CALLBACK_MOUSE_MOVE,
                            ewl_widget_mouse_move_cb, NULL);
 
-       w->inheritance = strdup("/widget");
+       w->inheritance = strdup(":widget:");
        ewl_widget_set_appearance(w, appearance);
 
        DRETURN_INT(TRUE, DLEVEL_STABLE);
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_window.c,v
retrieving revision 1.71
retrieving revision 1.72
diff -u -3 -r1.71 -r1.72
--- ewl_window.c        14 Feb 2004 07:19:58 -0000      1.71
+++ ewl_window.c        24 Feb 2004 04:25:39 -0000      1.72
@@ -331,16 +331,6 @@
        window = EWL_WINDOW(w);
        o = EWL_OBJECT(w);
 
-       window->window = ecore_x_window_new(0, window->x, window->y,
-                       ewl_object_get_current_w(o),
-                       ewl_object_get_current_h(o));
-
-       ecore_x_window_prop_name_class_set(window->window, window->name,
-                                          window->classname);
-       ecore_x_window_prop_title_set(window->window, window->title);
-       ecore_x_window_prop_protocol_set(window->window,
-                       ECORE_X_WM_PROTOCOL_DELETE_REQUEST,1);
-
        /*
         * Determine the type of evas to create.
         */
@@ -361,13 +351,34 @@
                info = evas_engine_info_get(evas);
        }
 
-       evas_output_size_set(evas, ewl_object_get_current_w(o),
-                       ewl_object_get_current_h(o));
-       evas_output_viewport_set(evas, ewl_object_get_current_x(o),
-                       ewl_object_get_current_y(o),
-                       ewl_object_get_current_w(o),
-                       ewl_object_get_current_h(o));
+       if (!info)
+               DRETURN(DLEVEL_STABLE);
+
+       /*
+        * Prepare the base rendering region for the evas, such as the X
+        * window for the X11 based engines, or the surfaces for directfb.
+        */
+#if defined(HAVE_EVAS_ENGINE_GL_X11_H) || defined(HAVE_EVAS_ENGINE_SOFTWARE_X11_H)
+       if (strstr(render, "x11")) {
+               window->window = ecore_x_window_new(0, window->x, window->y,
+                                               ewl_object_get_current_w(o),
+                                               ewl_object_get_current_h(o));
+
+               ecore_x_window_prop_name_class_set(window->window, window->name,
+                                          window->classname);
+               ecore_x_window_prop_title_set(window->window, window->title);
+               ecore_x_window_prop_protocol_set(window->window,
+                                       ECORE_X_WM_PROTOCOL_DELETE_REQUEST,1);
+
+               if (window->flags & EWL_WINDOW_BORDERLESS)
+                       ecore_x_window_prop_borderless_set(window->window, 1);
+       }
+#endif
 
+       /*
+        * Now perform engine specific info setup. This informs the evas of
+        * the drawing engine specific info it needs.
+        */
 #ifdef HAVE_EVAS_ENGINE_GL_X11_H
        if (!strcmp(render, "gl_x11")) {
                Evas_Engine_Info_GL_X11 *glinfo;
@@ -388,6 +399,16 @@
        }
        else
 #endif
+#ifdef HAVE_EVAS_ENGINE_FB
+       else if (!strcmp(render, "fb")) {
+               Evas_Engine_Info_FB *fbinfo;
+               fbinfo->info.virtual_terminal = 0;
+               fbinfo->info.device_number = 0;
+               fbinfo->info.refresh = 0;
+               fbinfo->info.rotation = ee->rotation;
+               evas_engine_info_set(evas, (Evas_Engine_Info *)fbinfo);
+       }
+#endif
 #ifdef HAVE_EVAS_ENGINE_SOFTWARE_X11_H
        {
                Evas_Engine_Info_Software_X11 *sinfo;
@@ -409,10 +430,14 @@
 
        evas_engine_info_set(evas, info);
 
-       ewl_embed_set_evas(embed, evas, window->window);
+       evas_output_size_set(evas, ewl_object_get_current_w(o),
+                       ewl_object_get_current_h(o));
+       evas_output_viewport_set(evas, ewl_object_get_current_x(o),
+                       ewl_object_get_current_y(o),
+                       ewl_object_get_current_w(o),
+                       ewl_object_get_current_h(o));
 
-       if (window->flags & EWL_WINDOW_BORDERLESS)
-               ecore_x_window_prop_borderless_set(window->window, 1);
+       ewl_embed_set_evas(embed, evas, window->window);
 
        DLEAVE_FUNCTION(DLEVEL_STABLE);
 }




-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now.
Build and deploy apps & Web services for Linux with
a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click
_______________________________________________
enlightenment-cvs mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to