Enlightenment CVS committal

Author  : rbdpngn
Project : e17
Module  : libs/ewl

Dir     : e17/libs/ewl/src


Modified Files:
        ewl_callback.h ewl_embed.c ewl_embed.h ewl_enums.h 
        ewl_events.c ewl_events.h 


Log Message:
Add some mouse wheel support.

===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_callback.h,v
retrieving revision 1.31
retrieving revision 1.32
diff -u -3 -r1.31 -r1.32
--- ewl_callback.h      8 Jun 2004 05:52:33 -0000       1.31
+++ ewl_callback.h      22 Jun 2004 16:44:32 -0000      1.32
@@ -49,7 +49,7 @@
  * Retrives the callback list from a widget for a certain event type.
  */
 #define EWL_CALLBACK_LIST_POINTER(w, t) \
-               (void *)((unsigned int)(w->callbacks[t]) & \
+               (void *)((long)(w->callbacks[t]) & \
                                        ~EWL_CALLBACK_NOTIFY_MASK)
 
 /**
@@ -57,15 +57,15 @@
  * Retrives the callback flags from a widget for a certain event type.
  */
 #define EWL_CALLBACK_FLAGS(w, t) \
-               ((unsigned int)(w->callbacks[t]) & \
+               ((long)(w->callbacks[t]) & \
                                        EWL_CALLBACK_NOTIFY_MASK)
 /**
  * @def EWL_CALLBACK_FLAG_INTERCEPT(w, t)
  * Sets the callback intercept flag from a widget for a certain event type.
  */
 #define EWL_CALLBACK_FLAG_INTERCEPT(w, t) \
-               ((unsigned int)w->callbacks[t] = \
-                        (unsigned int)EWL_CALLBACK_LIST_POINTER(w, t) | \
+               ((long)w->callbacks[t] = \
+                        (long)EWL_CALLBACK_LIST_POINTER(w, t) | \
                         EWL_CALLBACK_NOTIFY_INTERCEPT)
 
 /**
@@ -73,8 +73,8 @@
  * Clears the callback intercept flag from a widget for a certain event type.
  */
 #define EWL_CALLBACK_FLAG_NOINTERCEPT(w, t) \
-               ((unsigned int)w->callbacks[t] = \
-                        (unsigned int)EWL_CALLBACK_LIST_POINTER(w, t) & \
+               ((long)w->callbacks[t] = \
+                        (long)EWL_CALLBACK_LIST_POINTER(w, t) & \
                         EWL_CALLBACK_NOTIFY_MASK & ~EWL_CALLBACK_NOTIFY_INTERCEPT)
 
 /**
@@ -82,8 +82,8 @@
  * Sets the callback notify flag from a widget for a certain event type.
  */
 #define EWL_CALLBACK_FLAG_NOTIFY(w, t) \
-               ((unsigned int)w->callbacks[t] = \
-                        (unsigned int)EWL_CALLBACK_LIST_POINTER(w, t) | \
+               ((long)w->callbacks[t] = \
+                        (long)EWL_CALLBACK_LIST_POINTER(w, t) | \
                         EWL_CALLBACK_NOTIFY_NOTIFY)
 
 /**
@@ -91,8 +91,8 @@
  * Sets the callback list for a widget for a certain event type.
  */
 #define EWL_CALLBACK_LIST_ASSIGN(w, t, l) \
-               (unsigned int)w->callbacks[t] = (unsigned int)l | \
-                       ((unsigned int)w->callbacks[t] & \
+               (long)w->callbacks[t] = (long)l | \
+                       ((long)w->callbacks[t] & \
                         EWL_CALLBACK_NOTIFY_MASK)
 
 void            ewl_callbacks_init(void);
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_embed.c,v
retrieving revision 1.37
retrieving revision 1.38
diff -u -3 -r1.37 -r1.38
--- ewl_embed.c 2 Jun 2004 20:52:50 -0000       1.37
+++ ewl_embed.c 22 Jun 2004 16:44:32 -0000      1.38
@@ -523,6 +523,36 @@
 }
 
 /**
+ * @param embed: the embed where the mouse event is to occur
+ * @param x: the x coordinate of the mouse out
+ * @param y: the y coordinate of the mouse out
+ * @param mods: the mask of key modifiers currently release
+ * @return Returns no value.
+ * @brief Sends a mouse out event to the last focused widget
+ */
+void
+ewl_embed_feed_mouse_wheel(Ewl_Embed *embed, int x, int y, int z, int dir, unsigned 
int mods)
+{
+       Ewl_Event_Mouse_Wheel ev;
+       DENTER_FUNCTION(DLEVEL_STABLE);
+
+       ev.modifiers = mods;
+       ev.x = x;
+       ev.y = y;
+       ev.z = z;
+       ev.dir = dir;
+
+       while (last_focused) {
+               ewl_callback_call_with_event_data(last_focused,
+                                                 EWL_CALLBACK_MOUSE_WHEEL,
+                                                 &ev);
+               last_focused = last_focused->parent;
+       }
+
+       DLEAVE_FUNCTION(DLEVEL_STABLE);
+}
+
+/**
  * @param path: the font path to add to the embeds
  * @return Returns no value.
  * @brief Add a font path to all embeds after realized
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_embed.h,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -3 -r1.25 -r1.26
--- ewl_embed.h 2 Jun 2004 18:36:36 -0000       1.25
+++ ewl_embed.h 22 Jun 2004 16:44:32 -0000      1.26
@@ -74,6 +74,8 @@
                                          unsigned int modifiers);
 void            ewl_embed_feed_mouse_out(Ewl_Embed *embed, int x, int y,
                                         unsigned int modifiers);
+void            ewl_embed_feed_mouse_wheel(Ewl_Embed *embed, int x, int y,
+                                          int z, int dir, unsigned int mods);
 void            ewl_embed_font_path_add(char *path);
 Ewl_Embed      *ewl_embed_find_by_evas_window(Ewl_Embed_Evas_Window *win);
 Ewl_Embed      *ewl_embed_find_by_widget(Ewl_Widget * w);
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_enums.h,v
retrieving revision 1.50
retrieving revision 1.51
diff -u -3 -r1.50 -r1.51
--- ewl_enums.h 14 May 2004 13:54:12 -0000      1.50
+++ ewl_enums.h 22 Jun 2004 16:44:32 -0000      1.51
@@ -29,6 +29,7 @@
        EWL_CALLBACK_MOUSE_DOWN, /**< Mouse was pressed down */
        EWL_CALLBACK_MOUSE_UP, /**< Mouse was released */
        EWL_CALLBACK_MOUSE_MOVE, /**< Mouse was moved */
+       EWL_CALLBACK_MOUSE_WHEEL, /**< Mouse wheel scrolled */
        EWL_CALLBACK_FOCUS_IN, /**< Mouse was placed over the widget */
        EWL_CALLBACK_FOCUS_OUT, /**< Mouse was moved away from the widget */
        EWL_CALLBACK_SELECT, /**< Widget was selected by mouse or key */
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_events.c,v
retrieving revision 1.61
retrieving revision 1.62
diff -u -3 -r1.61 -r1.62
--- ewl_events.c        12 Apr 2004 13:07:23 -0000      1.61
+++ ewl_events.c        22 Jun 2004 16:44:32 -0000      1.62
@@ -29,6 +29,7 @@
 int ewl_ev_x_key_down(void *data, int type, void *_ev);
 int ewl_ev_x_key_up(void *data, int type, void *_ev);
 int ewl_ev_x_mouse_down(void *data, int type, void *_ev);
+int ewl_ev_x_mouse_wheel(void *data, int type, void *_ev);
 int ewl_ev_x_mouse_up(void *data, int type, void *_ev);
 int ewl_ev_x_mouse_move(void *data, int type, void *_ev);
 int ewl_ev_x_mouse_out(void *data, int type, void *_ev);
@@ -83,6 +84,8 @@
                                        ewl_ev_x_mouse_up, NULL);
                ecore_event_handler_add(ECORE_X_EVENT_MOUSE_MOVE,
                                        ewl_ev_x_mouse_move, NULL);
+               ecore_event_handler_add(ECORE_X_EVENT_MOUSE_WHEEL,
+                                       ewl_ev_x_mouse_wheel, NULL);
                ecore_event_handler_add(ECORE_X_EVENT_MOUSE_OUT,
                                        ewl_ev_x_mouse_out, NULL);
 
@@ -433,6 +436,31 @@
 /**
  * @param data: user specified data passed to the function
  * @param type: the type of event triggering the function call
+ * @param e: the mouse wheel event information
+ * @return Returns no value.
+ * @brief Handles the mouse wheel events in windows
+ *
+ * Dispatches the mouse wheel event to the appropriate ewl window.
+ */
+int ewl_ev_x_mouse_wheel(void *data, int type, void *e)
+{
+       Ewl_Embed      *embed;
+       Ecore_X_Event_Mouse_Wheel *ev = e;
+
+       DENTER_FUNCTION(DLEVEL_STABLE);
+
+       embed = ewl_embed_find_by_evas_window((void *)ev->win);
+       if (!embed)
+               DRETURN_INT(TRUE, DLEVEL_STABLE);
+
+       ewl_embed_feed_mouse_wheel(embed, ev->x, ev->y, ev->z, ev->direction, 
key_modifiers);
+
+       DRETURN_INT(TRUE, DLEVEL_STABLE);
+}
+
+/**
+ * @param data: user specified data passed to the function
+ * @param type: the type of event triggering the function call
  * @param e: the mouse out event information
  * @return Returns no value.
  * @brief Handles the data for a paste becoming available in windows
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_events.h,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -3 -r1.19 -r1.20
--- ewl_events.h        10 Mar 2004 21:19:00 -0000      1.19
+++ ewl_events.h        22 Jun 2004 16:44:32 -0000      1.20
@@ -138,6 +138,21 @@
        int y; /**< Y coordinate the mouse left at */
 };
 
+typedef struct Ewl_Event_Mouse_Wheel Ewl_Event_Mouse_Wheel;
+
+/**
+ * @struct Ewl_Event_Mouse_Wheel
+ * Provides information about the mouse wheel scrolling
+ */
+struct Ewl_Event_Mouse_Wheel
+{
+       unsigned int modifiers; /**< Modifiers that were pressed */
+       int x; /**< X coordinate the mouse left at */
+       int y; /**< Y coordinate the mouse left at */
+       int z; /**< Z value of mouse wheel */
+       int dir; /**< Direction mouse wheel scrolled */
+};
+
 int ewl_ev_init(void);
 unsigned int ewl_ev_get_modifiers();
 




-------------------------------------------------------
This SF.Net email sponsored by Black Hat Briefings & Training.
Attend Black Hat Briefings & Training, Las Vegas July 24-29 - 
digital self defense, top technical experts, no vendor pitches, 
unmatched networking opportunities. Visit www.blackhat.com
_______________________________________________
enlightenment-cvs mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to