Enlightenment CVS committal
Author : rbdpngn
Project : e17
Module : libs/ewl
Dir : e17/libs/ewl/src
Modified Files:
Ewl.h ewl_box.c ewl_container.c ewl_debug.h ewl_embed.c
ewl_embed.h ewl_entry.c ewl_events.c ewl_events.h ewl_grid.c
ewl_image.c ewl_misc.c ewl_object.c ewl_password.c
ewl_scrollbar.c ewl_seeker.c ewl_selectionbar.c ewl_spectrum.c
ewl_spinner.c ewl_text.c ewl_textarea.c ewl_theme.c
ewl_tooltip.c ewl_widget.c ewl_window.c
Log Message:
Abstracted the input events to avoid engine dependancies.
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/Ewl.h,v
retrieving revision 1.46
retrieving revision 1.47
diff -u -3 -r1.46 -r1.47
--- Ewl.h 23 Feb 2004 21:23:09 -0000 1.46
+++ Ewl.h 26 Feb 2004 05:38:30 -0000 1.47
@@ -272,6 +272,7 @@
#include <stdint.h>
#include <string.h>
#include <limits.h>
+#include <ctype.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_box.c,v
retrieving revision 1.61
retrieving revision 1.62
diff -u -3 -r1.61 -r1.62
--- ewl_box.c 14 Jan 2004 20:42:54 -0000 1.61
+++ ewl_box.c 26 Feb 2004 05:38:30 -0000 1.62
@@ -755,6 +755,8 @@
static void
ewl_box_setup()
{
+ DENTER_FUNCTION(DLEVEL_STABLE);
+
if (!vertical) {
vertical = NEW(Box_Orientation, 1);
if (!vertical)
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_container.c,v
retrieving revision 1.60
retrieving revision 1.61
diff -u -3 -r1.60 -r1.61
--- ewl_container.c 17 Feb 2004 05:18:38 -0000 1.60
+++ ewl_container.c 26 Feb 2004 05:38:31 -0000 1.61
@@ -287,6 +287,8 @@
int new_w, new_h;
Ewl_Container *c;
+ DENTER_FUNCTION(DLEVEL_STABLE);
+
DCHECK_PARAM_PTR("w", w);
if (!size || ewl_in_realize_phase() || !REALIZED(w))
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_debug.h,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -3 -r1.19 -r1.20
--- ewl_debug.h 21 Feb 2004 04:50:45 -0000 1.19
+++ ewl_debug.h 26 Feb 2004 05:38:31 -0000 1.20
@@ -28,6 +28,7 @@
#define DRETURN(lvl) \
{ \
+ DLEAVE_FUNCTION(lvl); \
if (ewl_config.debug.enable && ewl_config.debug.level >= lvl) \
{ \
fprintf(stderr, "<-- %s:%i\tReturn in %s();\n", \
@@ -38,6 +39,7 @@
#define DRETURN_PTR(ptr, lvl) \
{ \
+ DLEAVE_FUNCTION(lvl); \
if (ewl_config.debug.enable && ewl_config.debug.level >= lvl) \
{ \
fprintf(stderr, "<-- %s:%i\tReturning %p in %s();\n", \
@@ -48,6 +50,7 @@
#define DRETURN_FLOAT(num, lvl) \
{ \
+ DLEAVE_FUNCTION(lvl); \
if (ewl_config.debug.enable && ewl_config.debug.level >= lvl) \
{ \
fprintf(stderr, "<-- %s:%i\tReturning %f in %s();\n", \
@@ -58,6 +61,7 @@
#define DRETURN_INT(num, lvl) \
{ \
+ DLEAVE_FUNCTION(lvl); \
if (ewl_config.debug.enable && ewl_config.debug.level >= lvl) \
{ \
fprintf(stderr, "<-- %s:%i\tReturning %i in %s();\n", \
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_embed.c,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -3 -r1.24 -r1.25
--- ewl_embed.c 19 Feb 2004 21:45:02 -0000 1.24
+++ ewl_embed.c 26 Feb 2004 05:38:31 -0000 1.25
@@ -1,5 +1,10 @@
#include <Ewl.h>
+extern Ewl_Widget *last_selected;
+extern Ewl_Widget *last_key;
+extern Ewl_Widget *last_focused;
+extern Ewl_Widget *dnd_widget;
+
Ewd_List *ewl_embed_list = NULL;
Evas_Smart *embedded_smart = NULL;
@@ -202,6 +207,292 @@
}
/**
+ * @param embed: the embed where the key event is to occur
+ * @param keyname: the key press to trigger
+ * @return Returns no value.
+ * @brief Sends the event for a key press into an embed.
+ */
+void ewl_embed_feed_key_down(Ewl_Embed *embed, char *keyname)
+{
+ Ewl_Widget *temp;
+ Ewl_Event_Key_Down ev;
+
+ DENTER_FUNCTION(DLEVEL_STABLE);
+ DCHECK_PARAM_PTR("embed", embed);
+ DCHECK_PARAM_PTR("keyname", keyname);
+
+ ev.keyname = strdup(keyname);
+
+ /*
+ * If a widget has been selected then we send the keystroke to the
+ * appropriate widget.
+ */
+ if (!last_key || !ewl_container_parent_of(EWL_WIDGET(embed),
+ last_key)) {
+ if (last_selected)
+ last_key = last_selected;
+ else
+ last_key = EWL_WIDGET(embed);
+ }
+
+ /*
+ * Dispatcher of key down events, these get sent to the last widget
+ * selected, and every parent above it.
+ */
+ temp = last_key;
+ while (temp) {
+ if (!(ewl_object_has_state(EWL_OBJECT(temp),
+ EWL_FLAG_STATE_DISABLED)))
+ ewl_callback_call_with_event_data(temp,
+ EWL_CALLBACK_KEY_DOWN, &ev);
+ temp = temp->parent;
+ }
+
+ FREE(ev.keyname);
+
+ DLEAVE_FUNCTION(DLEVEL_STABLE);
+}
+
+
+/**
+ * @param embed: the embed where the key event is to occur
+ * @param keyname: the key release to trigger
+ * @return Returns no value.
+ * @brief Sends the event for a key release into an embed.
+ */
+void ewl_embed_feed_key_up(Ewl_Embed *embed, char *keyname)
+{
+ Ewl_Widget *temp;
+ Ewl_Event_Key_Up ev;
+
+ DENTER_FUNCTION(DLEVEL_STABLE);
+ DCHECK_PARAM_PTR("embed", embed);
+ DCHECK_PARAM_PTR("keyname", keyname);
+
+ ev.keyname = strdup(keyname);
+
+ /*
+ * Dispatcher of key up events, these get sent to the last widget
+ * selected, and every parent above it.
+ */
+ temp = last_key;
+ while (temp) {
+ if (!(ewl_object_has_state(EWL_OBJECT(temp),
+ EWL_FLAG_STATE_DISABLED)))
+ ewl_callback_call_with_event_data(temp,
+ EWL_CALLBACK_KEY_UP, &ev);
+ temp = temp->parent;
+ }
+
+ FREE(ev.keyname);
+
+ DLEAVE_FUNCTION(DLEVEL_STABLE);
+}
+
+
+/**
+ * @param embed: the embed where the mouse event is to occur
+ * @param b: the number of the button pressed
+ * @return Returns no value.
+ * @brief Sends the event for a mouse button press into an embed.
+ */
+void ewl_embed_feed_mouse_down(Ewl_Embed *embed, int b, int x, int y)
+{
+ int double_click = 0;
+ Ewl_Event_Mouse_Down ev;
+ Ewl_Widget *temp = NULL;
+ Ewl_Widget *widget = NULL;
+
+ DENTER_FUNCTION(DLEVEL_STABLE);
+ DCHECK_PARAM_PTR("embed", embed);
+
+ widget = ewl_container_get_child_at_recursive(EWL_CONTAINER(embed),
+ x, y);
+
+ /*
+ * Save the newly selected widget for further reference, do this prior
+ * to triggering the callback to avoid funkiness if the callback
+ * causes the widget to be destroyed.
+ */
+ temp = last_selected;
+ last_key = last_selected = widget;
+
+ /*
+ * Determine whether this widget has already been selected, if not,
+ * deselect the previously selected widget and notify it of the
+ * change. Then select the new widget and notify it of the selection.
+ */
+ if (widget != temp) {
+ if (temp) {
+ ewl_object_remove_state(EWL_OBJECT(temp),
+ EWL_FLAG_STATE_SELECTED);
+ ewl_callback_call(temp, EWL_CALLBACK_DESELECT);
+ }
+
+ if (widget && !(ewl_object_has_state(EWL_OBJECT(widget),
+ EWL_FLAG_STATE_DISABLED))) {
+ ewl_object_add_state(EWL_OBJECT(widget),
+ EWL_FLAG_STATE_SELECTED);
+ ewl_callback_call(widget, EWL_CALLBACK_SELECT);
+ }
+ }
+
+ ev.x = x;
+ ev.y = y;
+ ev.button = b;
+
+ /*
+ * While the mouse is down the widget has a pressed state, the widget
+ * and its parents are notified in this change of state.
+ */
+ temp = widget;
+ while (temp) {
+ if (!(ewl_object_has_state(EWL_OBJECT(temp),
+ EWL_FLAG_STATE_DISABLED))) {
+ ewl_object_add_state(EWL_OBJECT(temp),
+ EWL_FLAG_STATE_PRESSED);
+ ewl_callback_call_with_event_data(temp,
+ EWL_CALLBACK_MOUSE_DOWN, &ev);
+
+ if (double_click) {
+ ewl_callback_call_with_event_data(temp,
+ EWL_CALLBACK_DOUBLE_CLICKED,
+ &ev);
+ }
+ }
+ temp = temp->parent;
+ }
+
+ DLEAVE_FUNCTION(DLEVEL_STABLE);
+}
+
+
+/**
+ * @param embed: the embed where the mouse event is to occur
+ * @param b: the number of the button released
+ * @return Returns no value.
+ * @brief Sends the event for a mouse button release into an embed.
+ */
+void ewl_embed_feed_mouse_up(Ewl_Embed *embed, int b, int x, int y)
+{
+ Ewl_Widget *temp;
+ Ewl_Event_Mouse_Up ev;
+
+ DENTER_FUNCTION(DLEVEL_STABLE);
+ DCHECK_PARAM_PTR("embed", embed);
+
+ ev.x = x;
+ ev.y = y;
+ ev.button = b;
+
+ /*
+ * When the mouse is released the widget no longer has a pressed state,
+ * the widget and its parents are notified in this change of state.
+ */
+ temp = last_selected;
+ while (temp) {
+ if (!(ewl_object_has_state(EWL_OBJECT(temp),
+ EWL_FLAG_STATE_DISABLED))) {
+ ewl_object_remove_state(EWL_OBJECT(temp),
+ EWL_FLAG_STATE_PRESSED);
+ ewl_callback_call_with_event_data(temp,
+ EWL_CALLBACK_MOUSE_UP, &ev);
+
+ }
+
+ temp = temp->parent;
+ }
+
+ DLEAVE_FUNCTION(DLEVEL_STABLE);
+}
+
+void ewl_embed_feed_mouse_move(Ewl_Embed *embed, int x, int y)
+{
+ Ewl_Widget *widget;
+ Ewl_Event_Mouse_Move ev;
+
+ DENTER_FUNCTION(DLEVEL_STABLE);
+ DCHECK_PARAM_PTR("embed", embed);
+
+ widget = ewl_container_get_child_at_recursive(EWL_CONTAINER(embed),
+ x, y);
+
+ ev.x = x;
+ ev.y = y;
+
+ /*
+ * Defocus all widgets up to the level of a shared parent of old and
+ * newly focused widgets.
+ */
+ while (last_focused && (widget != last_focused) &&
+ !ewl_container_parent_of(last_focused, widget)) {
+ ewl_object_remove_state(EWL_OBJECT(last_focused),
+ EWL_FLAG_STATE_HILITED);
+ ewl_callback_call(last_focused, EWL_CALLBACK_FOCUS_OUT);
+ last_focused = last_focused->parent;
+ }
+
+ /*
+ * Pass out the movement event up the chain, allows parents to
+ * react to mouse movement in their children.
+ */
+ last_focused = widget;
+ while (last_focused) {
+
+ if (!(ewl_object_has_state(EWL_OBJECT(last_focused),
+ EWL_FLAG_STATE_DISABLED))) {
+
+ /*
+ * First mouse move event in a widget marks it focused.
+ */
+ if (!(ewl_object_has_state(EWL_OBJECT(last_focused),
+ EWL_FLAG_STATE_HILITED))) {
+ ewl_object_add_state(EWL_OBJECT(last_focused),
+ EWL_FLAG_STATE_HILITED);
+ ewl_callback_call_with_event_data(last_focused,
+ EWL_CALLBACK_FOCUS_IN, &ev);
+ }
+
+ ewl_callback_call_with_event_data(last_focused,
+ EWL_CALLBACK_MOUSE_MOVE, &ev);
+ }
+ last_focused = last_focused->parent;
+ }
+
+ last_focused = widget;
+
+ if (dnd_widget && ewl_object_has_state(EWL_OBJECT(dnd_widget),
+ EWL_FLAG_STATE_DND))
+ ewl_callback_call_with_event_data(dnd_widget,
+ EWL_CALLBACK_MOUSE_MOVE, &ev);
+
+ if (last_selected && ewl_object_has_state(EWL_OBJECT(last_selected),
+ EWL_FLAG_STATE_PRESSED))
+ ewl_callback_call_with_event_data(last_selected,
+ EWL_CALLBACK_MOUSE_MOVE, &ev);
+ else
+ dnd_widget = NULL;
+
+ DLEAVE_FUNCTION(DLEVEL_STABLE);
+}
+
+/**
+ * @return Returns no value.
+ * @brief Sends a mouse out event to the last focused widget
+ */
+void ewl_embed_feed_mouse_out()
+{
+ DENTER_FUNCTION(DLEVEL_STABLE);
+
+ while (last_focused) {
+ ewl_callback_call(last_focused, EWL_CALLBACK_FOCUS_OUT);
+ 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
@@ -577,8 +868,7 @@
{
DENTER_FUNCTION(DLEVEL_STABLE);
- ewl_ev_mouse_out(NULL, ECORE_X_EVENT_MOUSE_OUT,
- ecore_event_current_event_get());
+ ewl_embed_feed_mouse_out();
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -587,10 +877,14 @@
ewl_embed_evas_mouse_down_cb(void *data, Evas *e, Evas_Object *obj,
void *event_info)
{
+ Ewl_Embed *embed;
+ Evas_Event_Mouse_Down *ev = event_info;
+
DENTER_FUNCTION(DLEVEL_STABLE);
- ewl_ev_mouse_down(NULL, ECORE_X_EVENT_MOUSE_BUTTON_DOWN,
- ecore_event_current_event_get());
+ embed = evas_object_smart_data_get(obj);
+ ewl_embed_feed_mouse_down(embed, ev->button, ev->canvas.x,
+ ev->canvas.y);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -599,10 +893,14 @@
ewl_embed_evas_mouse_up_cb(void *data, Evas *e, Evas_Object *obj,
void *event_info)
{
+ Ewl_Embed *embed;
+ Evas_Event_Mouse_Up *ev = event_info;
+
DENTER_FUNCTION(DLEVEL_STABLE);
- ewl_ev_mouse_up(NULL, ECORE_X_EVENT_MOUSE_BUTTON_UP,
- ecore_event_current_event_get());
+ embed = evas_object_smart_data_get(obj);
+ ewl_embed_feed_mouse_up(embed, ev->button, ev->canvas.x,
+ ev->canvas.y);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -611,10 +909,13 @@
ewl_embed_evas_mouse_move_cb(void *data, Evas *e, Evas_Object *obj,
void *event_info)
{
+ Ewl_Embed *embed;
+ Evas_Event_Mouse_Up *ev = event_info;
+
DENTER_FUNCTION(DLEVEL_STABLE);
- ewl_ev_mouse_move(NULL, ECORE_X_EVENT_MOUSE_MOVE,
- ecore_event_current_event_get());
+ embed = evas_object_smart_data_get(obj);
+ ewl_embed_feed_mouse_move(embed, ev->canvas.x, ev->canvas.y);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -632,10 +933,13 @@
ewl_embed_evas_key_down_cb(void *data, Evas *e, Evas_Object *obj,
void *event_info)
{
+ Ewl_Embed *embed;
+ Evas_Event_Key_Down *ev = event_info;
+
DENTER_FUNCTION(DLEVEL_STABLE);
- ewl_ev_key_down(NULL, ECORE_X_EVENT_KEY_DOWN,
- ecore_event_current_event_get());
+ embed = evas_object_smart_data_get(obj);
+ ewl_embed_feed_key_down(embed, ev->keyname);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -644,10 +948,13 @@
ewl_embed_evas_key_up_cb(void *data, Evas *e, Evas_Object *obj,
void *event_info)
{
+ Ewl_Embed *embed;
+ Evas_Event_Key_Down *ev = event_info;
+
DENTER_FUNCTION(DLEVEL_STABLE);
- ewl_ev_key_up(NULL, ECORE_X_EVENT_KEY_UP,
- ecore_event_current_event_get());
+ embed = evas_object_smart_data_get(obj);
+ ewl_embed_feed_key_up(embed, ev->keyname);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_embed.h,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -3 -r1.15 -r1.16
--- ewl_embed.h 19 Feb 2004 21:45:02 -0000 1.15
+++ ewl_embed.h 26 Feb 2004 05:38:31 -0000 1.16
@@ -46,6 +46,14 @@
int ewl_embed_init(Ewl_Embed * win);
Evas_Object *ewl_embed_set_evas(Ewl_Embed *emb, Evas *evas,
Ecore_X_Window evas_window);
+void ewl_embed_feed_key_down(Ewl_Embed *embed, char *keyname);
+void ewl_embed_feed_key_up(Ewl_Embed *embed, char *keyname);
+void ewl_embed_feed_mouse_down(Ewl_Embed *embed, int b, int x,
+ int y);
+void ewl_embed_feed_mouse_up(Ewl_Embed *embed, int b, int x,
+ int y);
+void ewl_embed_feed_mouse_move(Ewl_Embed *embed, int x, int y);
+void ewl_embed_feed_mouse_out();
void ewl_embed_font_path_add(char *path);
Ewl_Embed *ewl_embed_find_by_evas_window(Ecore_X_Window win);
Ewl_Embed *ewl_embed_find_by_widget(Ewl_Widget * w);
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_entry.c,v
retrieving revision 1.79
retrieving revision 1.80
diff -u -3 -r1.79 -r1.80
--- ewl_entry.c 24 Feb 2004 16:52:26 -0000 1.79
+++ ewl_entry.c 26 Feb 2004 05:38:31 -0000 1.80
@@ -266,7 +266,7 @@
{
Ewl_Entry *e;
char *evd = NULL;
- Ecore_X_Event_Key_Down *ev;
+ Ewl_Event_Key_Down *ev;
DENTER_FUNCTION(DLEVEL_STABLE);
DCHECK_PARAM_PTR("w", w);
@@ -294,8 +294,8 @@
EWL_TEXT(w)->text);
FREE(evd);
}
- else if (ev->key_compose) {
- ewl_entry_insert_text(e, ev->key_compose);
+ else if (ev->keyname) {
+ ewl_entry_insert_text(e, ev->keyname);
}
DLEAVE_FUNCTION(DLEVEL_STABLE);
@@ -306,7 +306,7 @@
*/
void ewl_entry_mouse_down_cb(Ewl_Widget * w, void *ev_data, void *user_data)
{
- Ecore_X_Event_Mouse_Button_Down *ev;
+ Ewl_Event_Mouse_Down *ev;
Ewl_Entry *e;
int index = 0, len = 0;
@@ -344,7 +344,7 @@
void ewl_entry_mouse_move_cb(Ewl_Widget * w, void *ev_data, void *user_data)
{
int index = 0;
- Ecore_X_Event_Mouse_Move *ev;
+ Ewl_Event_Mouse_Move *ev;
Ewl_Entry *e;
DENTER_FUNCTION(DLEVEL_STABLE);
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_events.c,v
retrieving revision 1.50
retrieving revision 1.51
diff -u -3 -r1.50 -r1.51
--- ewl_events.c 14 Feb 2004 07:19:58 -0000 1.50
+++ ewl_events.c 26 Feb 2004 05:38:33 -0000 1.51
@@ -1,12 +1,38 @@
-
#include <Ewl.h>
+#ifdef HAVE_CONFIG_H
+#include "ewl-config.h"
+#endif
extern Ewl_Widget *last_selected;
extern Ewl_Widget *last_key;
extern Ewl_Widget *last_focused;
extern Ewl_Widget *dnd_widget;
+extern Ewd_List *embed_list;;
+
+#ifdef HAVE_EVAS_ENGINE_SOFTWARE_X11_H
+int ewl_ev_x_window_expose(void *data, int type, void *_ev);
+int ewl_ev_x_window_configure(void *data, int type, void *_ev);
+int ewl_ev_x_window_delete(void *data, int type, void *_ev);
+
+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_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);
+int ewl_ev_x_paste(void *data, int type, void *_ev);
+#endif
+
+#ifdef HAVE_EVAS_ENGINE_FB
+int ewl_ev_fb_key_down(void *data, int type, void *_ev);
+int ewl_ev_fb_key_up(void *data, int type, void *_ev);
+int ewl_ev_fb_mouse_down(void *data, int type, void *_ev);
+int ewl_ev_fb_mouse_up(void *data, int type, void *_ev);
+int ewl_ev_fb_mouse_move(void *data, int type, void *_ev);
+#endif
+
/**
* @return Returns true or false to indicate success in initializing events.
@@ -16,43 +42,61 @@
{
DENTER_FUNCTION(DLEVEL_STABLE);
+#ifdef HAVE_EVAS_ENGINE_SOFTWARE_X11_H
/*
* Register dispatching functions for window events.
*/
ecore_event_handler_add(ECORE_X_EVENT_WINDOW_DAMAGE,
- ewl_ev_window_expose, NULL);
+ ewl_ev_x_window_expose, NULL);
ecore_event_handler_add(ECORE_X_EVENT_WINDOW_CONFIGURE,
- ewl_ev_window_configure, NULL);
+ ewl_ev_x_window_configure, NULL);
ecore_event_handler_add(ECORE_X_EVENT_WINDOW_DELETE_REQUEST,
- ewl_ev_window_delete, NULL);
+ ewl_ev_x_window_delete, NULL);
/*
* Register dispatching functions for keyboard events.
*/
- ecore_event_handler_add(ECORE_X_EVENT_KEY_DOWN, ewl_ev_key_down, NULL);
- ecore_event_handler_add(ECORE_X_EVENT_KEY_UP, ewl_ev_key_up, NULL);
+ ecore_event_handler_add(ECORE_X_EVENT_KEY_DOWN, ewl_ev_x_key_down,
+ NULL);
+ ecore_event_handler_add(ECORE_X_EVENT_KEY_UP, ewl_ev_x_key_up, NULL);
/*
* Finally, register dispatching functions for mouse events.
*/
ecore_event_handler_add(ECORE_X_EVENT_MOUSE_BUTTON_DOWN,
- ewl_ev_mouse_down, NULL);
- ecore_event_handler_add(ECORE_X_EVENT_MOUSE_BUTTON_UP, ewl_ev_mouse_up,
- NULL);
+ ewl_ev_x_mouse_down, NULL);
+ ecore_event_handler_add(ECORE_X_EVENT_MOUSE_BUTTON_UP,
+ ewl_ev_x_mouse_up, NULL);
ecore_event_handler_add(ECORE_X_EVENT_MOUSE_MOVE,
- ewl_ev_mouse_move, NULL);
- ecore_event_handler_add(ECORE_X_EVENT_MOUSE_OUT, ewl_ev_mouse_out,
+ ewl_ev_x_mouse_move, NULL);
+ ecore_event_handler_add(ECORE_X_EVENT_MOUSE_OUT, ewl_ev_x_mouse_out,
NULL);
/*
* Selection callbacks to allow for pasting.
*/
- ecore_event_handler_add(ECORE_X_EVENT_SELECTION_NOTIFY, ewl_ev_paste,
+ ecore_event_handler_add(ECORE_X_EVENT_SELECTION_NOTIFY, ewl_ev_x_paste,
+ NULL);
+#endif
+
+#ifdef HAVE_EVAS_ENGINE_FB
+ ecore_event_handler_add(ECORE_FB_EVENT_KEY_DOWN, ewl_ev_fb_key_down,
+ NULL);
+ ecore_event_handler_add(ECORE_FB_EVENT_KEY_UP, ewl_ev_fb_key_up,
+ NULL);
+ ecore_event_handler_add(ECORE_FB_EVENT_MOUSE_DOWN, ewl_ev_fb_mouse_down,
+ NULL);
+ ecore_event_handler_add(ECORE_FB_EVENT_MOUSE_UP, ewl_ev_fb_mouse_up,
NULL);
+ ecore_event_handler_add(ECORE_FB_EVENT_MOUSE_MOVE, ewl_ev_fb_mouse_move,
+ NULL);
+#endif
DRETURN_INT(1, DLEVEL_STABLE);
}
+#ifdef HAVE_EVAS_ENGINE_SOFTWARE_X11_H
+
/**
* @param data: user specified data passed to the function
* @param type: the type of event triggering the function call
@@ -62,7 +106,7 @@
*
* Dispatches the expose event to the appropriate window for handling.
*/
-int ewl_ev_window_expose(void *data, int type, void * e)
+int ewl_ev_x_window_expose(void *data, int type, void * e)
{
/*
* Widgets don't need to know about this usually, but we still need to
@@ -94,7 +138,7 @@
*
* Dispatches a configure even to the appropriate ewl window.
*/
-int ewl_ev_window_configure(void *data, int type, void *e)
+int ewl_ev_x_window_configure(void *data, int type, void *e)
{
/*
* When a configure event occurs, we must update the windows geometry
@@ -134,7 +178,7 @@
*
* Dispatches the delete event to the appropriate ewl window.
*/
-int ewl_ev_window_delete(void *data, int type, void *e)
+int ewl_ev_x_window_delete(void *data, int type, void *e)
{
/*
* Retrieve the appropriate ewl_window using the x window id that is
@@ -165,9 +209,8 @@
*
* Dispatches the key down event to the appropriate ewl window.
*/
-int ewl_ev_key_down(void *data, int type, void *e)
+int ewl_ev_x_key_down(void *data, int type, void *e)
{
- Ewl_Widget *temp;
Ewl_Embed *embed;
Ecore_X_Event_Key_Down *ev;
@@ -180,30 +223,7 @@
if (!embed)
DRETURN_INT(TRUE, DLEVEL_STABLE);
- /*
- * If a widget has been selected then we send the keystroke to the
- * appropriate widget.
- */
- if (!last_key || !ewl_container_parent_of(EWL_WIDGET(embed),
- last_key)) {
- if (last_selected)
- last_key = last_selected;
- else
- last_key = EWL_WIDGET(embed);
- }
-
- /*
- * Dispatcher of key down events, these get sent to the last widget
- * selected, and every parent above it.
- */
- temp = last_key;
- while (temp) {
- if (!(ewl_object_has_state(EWL_OBJECT(temp),
- EWL_FLAG_STATE_DISABLED)))
- ewl_callback_call_with_event_data(temp,
- EWL_CALLBACK_KEY_DOWN, ev);
- temp = temp->parent;
- }
+ ewl_embed_feed_key_down(embed, ev->keyname);
DRETURN_INT(TRUE, DLEVEL_STABLE);
}
@@ -217,9 +237,8 @@
*
* Dispatches the key up event to the appropriate ewl window.
*/
-int ewl_ev_key_up(void *data, int type, void *e)
+int ewl_ev_x_key_up(void *data, int type, void *e)
{
- Ewl_Widget *temp;
Ewl_Embed *embed;
Ecore_X_Event_Key_Up *ev;
@@ -231,18 +250,7 @@
if (!embed)
DRETURN_INT(TRUE, DLEVEL_STABLE);
- /*
- * Dispatcher of key up events, these get sent to the last widget
- * selected, and every parent above it.
- */
- temp = last_key;
- while (temp) {
- if (!(ewl_object_has_state(EWL_OBJECT(temp),
- EWL_FLAG_STATE_DISABLED)))
- ewl_callback_call_with_event_data(temp,
- EWL_CALLBACK_KEY_UP, ev);
- temp = temp->parent;
- }
+ ewl_embed_feed_key_up(embed, ev->keyname);
DRETURN_INT(TRUE, DLEVEL_STABLE);
}
@@ -258,10 +266,8 @@
* Dispatches the mouse down event to the appropriate ewl window.
* Also determines the widgets clicked state.
*/
-int ewl_ev_mouse_down(void *data, int type, void *e)
+int ewl_ev_x_mouse_down(void *data, int type, void *e)
{
- Ewl_Widget *widget = NULL;
- Ewl_Widget *temp = NULL;
Ewl_Embed *embed;
Ecore_X_Event_Mouse_Button_Down *ev;
@@ -273,58 +279,7 @@
if (!embed)
DRETURN_INT(TRUE, DLEVEL_STABLE);
- widget = ewl_container_get_child_at_recursive(EWL_CONTAINER(embed),
- ev->x, ev->y);
-
- /*
- * Save the newly selected widget for further reference, do this prior
- * to triggering the callback to avoid funkiness if the callback
- * causes the widget to be destroyed.
- */
- temp = last_selected;
- last_key = last_selected = widget;
-
- /*
- * Determine whether this widget has already been selected, if not,
- * deselect the previously selected widget and notify it of the
- * change. Then select the new widget and notify it of the selection.
- */
- if (widget != temp) {
- if (temp) {
- ewl_object_remove_state(EWL_OBJECT(temp),
- EWL_FLAG_STATE_SELECTED);
- ewl_callback_call(temp, EWL_CALLBACK_DESELECT);
- }
-
- if (widget && !(ewl_object_has_state(EWL_OBJECT(widget),
- EWL_FLAG_STATE_DISABLED))) {
- ewl_object_add_state(EWL_OBJECT(widget),
- EWL_FLAG_STATE_SELECTED);
- ewl_callback_call(widget, EWL_CALLBACK_SELECT);
- }
- }
-
- /*
- * While the mouse is down the widget has a pressed state, the widget
- * and its parents are notified in this change of state.
- */
- temp = widget;
- while (temp) {
- if (!(ewl_object_has_state(EWL_OBJECT(temp),
- EWL_FLAG_STATE_DISABLED))) {
- ewl_object_add_state(EWL_OBJECT(temp),
- EWL_FLAG_STATE_PRESSED);
- ewl_callback_call_with_event_data(temp,
- EWL_CALLBACK_MOUSE_DOWN, ev);
-
- if (ev->double_click) {
- ewl_callback_call_with_event_data(temp,
- EWL_CALLBACK_DOUBLE_CLICKED,
- ev);
- }
- }
- temp = temp->parent;
- }
+ ewl_embed_feed_mouse_down(embed, ev->button, ev->x, ev->y);
DRETURN_INT(TRUE, DLEVEL_STABLE);
}
@@ -340,9 +295,8 @@
* Dispatches the mouse up event to the appropriate ewl window.
* Also determines the widgets clicked state.
*/
-int ewl_ev_mouse_up(void *data, int type, void *e)
+int ewl_ev_x_mouse_up(void *data, int type, void *e)
{
- Ewl_Widget *temp;
Ewl_Embed *embed;
Ecore_X_Event_Mouse_Button_Up *ev;
@@ -354,23 +308,7 @@
if (!embed)
DRETURN_INT(TRUE, DLEVEL_STABLE);
- /*
- * When the mouse is released the widget no longer has a pressed state,
- * the widget and its parents are notified in this change of state.
- */
- temp = last_selected;
- while (temp) {
- if (!(ewl_object_has_state(EWL_OBJECT(temp),
- EWL_FLAG_STATE_DISABLED))) {
- ewl_object_remove_state(EWL_OBJECT(temp),
- EWL_FLAG_STATE_PRESSED);
- ewl_callback_call_with_event_data(temp,
- EWL_CALLBACK_MOUSE_UP, ev);
-
- }
-
- temp = temp->parent;
- }
+ ewl_embed_feed_mouse_up(embed, ev->button, ev->x, ev->y);
DRETURN_INT(TRUE, DLEVEL_STABLE);
}
@@ -385,9 +323,8 @@
*
* Dispatches the mouse move event to the appropriate ewl window.
*/
-int ewl_ev_mouse_move(void *data, int type, void *e)
+int ewl_ev_x_mouse_move(void *data, int type, void *e)
{
- Ewl_Widget *widget;
Ewl_Embed *embed;
Ecore_X_Event_Mouse_Move *ev;
@@ -399,61 +336,7 @@
if (!embed)
DRETURN_INT(TRUE, DLEVEL_STABLE);
- widget = ewl_container_get_child_at_recursive(EWL_CONTAINER(embed),
- ev->x, ev->y);
-
- /*
- * Defocus all widgets up to the level of a shared parent of old and
- * newly focused widgets.
- */
- while (last_focused && (widget != last_focused) &&
- !ewl_container_parent_of(last_focused, widget)) {
- ewl_object_remove_state(EWL_OBJECT(last_focused),
- EWL_FLAG_STATE_HILITED);
- ewl_callback_call(last_focused, EWL_CALLBACK_FOCUS_OUT);
- last_focused = last_focused->parent;
- }
-
- /*
- * Pass out the movement event up the chain, allows parents to
- * react to mouse movement in their children.
- */
- last_focused = widget;
- while (last_focused) {
-
- if (!(ewl_object_has_state(EWL_OBJECT(last_focused),
- EWL_FLAG_STATE_DISABLED))) {
-
- /*
- * First mouse move event in a widget marks it focused.
- */
- if (!(ewl_object_has_state(EWL_OBJECT(last_focused),
- EWL_FLAG_STATE_HILITED))) {
- ewl_object_add_state(EWL_OBJECT(last_focused),
- EWL_FLAG_STATE_HILITED);
- ewl_callback_call_with_event_data(last_focused,
- EWL_CALLBACK_FOCUS_IN, ev);
- }
-
- ewl_callback_call_with_event_data(last_focused,
- EWL_CALLBACK_MOUSE_MOVE, ev);
- }
- last_focused = last_focused->parent;
- }
-
- last_focused = widget;
-
- if (dnd_widget && ewl_object_has_state(EWL_OBJECT(dnd_widget),
- EWL_FLAG_STATE_DND))
- ewl_callback_call_with_event_data(dnd_widget,
- EWL_CALLBACK_MOUSE_MOVE, ev);
-
- if (last_selected && ewl_object_has_state(EWL_OBJECT(last_selected),
- EWL_FLAG_STATE_PRESSED))
- ewl_callback_call_with_event_data(last_selected,
- EWL_CALLBACK_MOUSE_MOVE, ev);
- else
- dnd_widget = NULL;
+ ewl_embed_feed_mouse_move(embed, ev->x, ev->y);
DRETURN_INT(TRUE, DLEVEL_STABLE);
}
@@ -467,14 +350,11 @@
*
* Dispatches the mouse out event to the appropriate ewl window.
*/
-int ewl_ev_mouse_out(void *data, int type, void *e)
+int ewl_ev_x_mouse_out(void *data, int type, void *e)
{
DENTER_FUNCTION(DLEVEL_STABLE);
- while (last_focused) {
- ewl_callback_call(last_focused, EWL_CALLBACK_FOCUS_OUT);
- last_focused = last_focused->parent;
- }
+ ewl_embed_feed_mouse_out();
DRETURN_INT(TRUE, DLEVEL_STABLE);
}
@@ -488,7 +368,7 @@
*
* Dispatches the mouse out event to the appropriate ewl window.
*/
-int ewl_ev_paste(void *data, int type, void *e)
+int ewl_ev_x_paste(void *data, int type, void *e)
{
DENTER_FUNCTION(DLEVEL_STABLE);
@@ -496,3 +376,123 @@
DRETURN_INT(TRUE, DLEVEL_STABLE);
}
+
+#endif
+
+#ifdef HAVE_EVAS_ENGINE_FB
+
+/**
+ * @param data: user specified data passed to the function
+ * @param type: the type of event triggering the function call
+ * @param e: the key down event information
+ * @return Returns no value.
+ * @brief Handles key down events in windows
+ *
+ * Dispatches the key down event to the appropriate ewl window.
+ */
+int ewl_ev_fb_key_down(void *data, int type, void *e)
+{
+ Ewl_Widget *temp;
+ Ewl_Embed *embed;
+ Ecore_Fb_Event_Key_Down *ev;
+
+ DENTER_FUNCTION(DLEVEL_STABLE);
+
+ ev = e;
+
+ embed = ewd_list_goto_first(embed_list);
+
+ if (!embed)
+ DRETURN_INT(TRUE, DLEVEL_STABLE);
+
+ ewl_ev_feed_key_down(embed, ev->keyname);
+
+ 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 key up event information
+ * @return Returns no value.
+ * @brief Handles key down events in windows
+ *
+ * Dispatches the key down event to the appropriate ewl window.
+ */
+int ewl_ev_fb_key_up(void *data, int type, void *e)
+{
+ Ewl_Widget *temp;
+ Ewl_Embed *embed;
+ Ecore_Fb_Event_Key_Up *ev;
+
+ DENTER_FUNCTION(DLEVEL_STABLE);
+
+ ev = e;
+
+ embed = ewd_list_goto_first(embed_list);
+
+ if (!embed)
+ DRETURN_INT(TRUE, DLEVEL_STABLE);
+
+ ewl_ev_feed_key_down(embed, ev->keyname);
+
+ 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 down event information
+ * @return Returns no value.
+ * @brief Handles mouse down events in windows
+ *
+ * Dispatches the mouse down event to the appropriate ewl window.
+ * Also determines the widgets clicked state.
+ */
+int ewl_ev_fb_mouse_down(void *data, int type, void *e)
+{
+ Ewl_Embed *embed;
+ Ecore_Fb_Event_Mouse_Button_Down *ev;
+
+ DENTER_FUNCTION(DLEVEL_STABLE);
+
+ ev = e;
+
+ embed = ewl_embed_find_by_evas_window(ev->win);
+ if (!embed)
+ DRETURN_INT(TRUE, DLEVEL_STABLE);
+
+ ewl_embed_feed_mouse_down(embed, ev->button, ev->x, ev->y);
+
+ 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 move event information
+ * @return Returns no value.
+ * @brief Handles mouse move events in windows
+ *
+ * Dispatches the mouse move event to the appropriate ewl window.
+ */
+int ewl_ev_fb_mouse_move(void *data, int type, void *e)
+{
+ Ewl_Widget *widget;
+ Ewl_Embed *embed;
+ Ecore_Fb_Event_Mouse_Move *ev;
+
+ DENTER_FUNCTION(DLEVEL_STABLE);
+
+ ev = e;
+
+ embed = ewl_embed_find_by_evas_window(ev->win);
+ if (!embed)
+ DRETURN_INT(TRUE, DLEVEL_STABLE);
+
+ ewl_embed_feed_mouse_move(embed, ev->x, ev->y);
+
+ DRETURN_INT(TRUE, DLEVEL_STABLE);
+}
+
+#endif
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_events.h,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -3 -r1.16 -r1.17
--- ewl_events.h 24 Feb 2004 04:25:38 -0000 1.16
+++ ewl_events.h 26 Feb 2004 05:38:34 -0000 1.17
@@ -85,18 +85,6 @@
int ewl_ev_init(void);
-int ewl_ev_window_expose(void *data, int type, void *_ev);
-int ewl_ev_window_configure(void *data, int type, void *_ev);
-int ewl_ev_window_delete(void *data, int type, void *_ev);
-
-int ewl_ev_key_down(void *data, int type, void *_ev);
-int ewl_ev_key_up(void *data, int type, void *_ev);
-int ewl_ev_mouse_down(void *data, int type, void *_ev);
-int ewl_ev_mouse_up(void *data, int type, void *_ev);
-int ewl_ev_mouse_move(void *data, int type, void *_ev);
-int ewl_ev_mouse_out(void *data, int type, void *_ev);
-int ewl_ev_paste(void *data, int type, void *_ev);
-
/**
* @}
*/
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_grid.c,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -3 -r1.15 -r1.16
--- ewl_grid.c 3 Jan 2004 21:23:11 -0000 1.15
+++ ewl_grid.c 26 Feb 2004 05:38:34 -0000 1.16
@@ -499,6 +499,8 @@
Ewl_Grid *g;
Ewl_Grid_Child *cdata;
+ DENTER_FUNCTION(DLEVEL_STABLE);
+
g = EWL_GRID(p);
cdata = ewl_widget_get_data(c, (void *) g);
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_image.c,v
retrieving revision 1.37
retrieving revision 1.38
diff -u -3 -r1.37 -r1.38
--- ewl_image.c 22 Nov 2003 20:01:02 -0000 1.37
+++ ewl_image.c 26 Feb 2004 05:38:34 -0000 1.38
@@ -367,7 +367,7 @@
if (l >= 8 && !(strncasecmp((char *) i + l - 8, ".bits.db", 8)))
return EWL_IMAGE_TYPE_EDJE;
- return EWL_IMAGE_TYPE_NORMAL;
+ DRETURN_INT(EWL_IMAGE_TYPE_NORMAL, DLEVEL_STABLE);
}
@@ -375,7 +375,7 @@
{
Ewl_Image *i;
Ewl_Embed *emb;
- Ecore_X_Event_Mouse_Button_Down *ev;
+ Ewl_Event_Mouse_Down *ev;
DENTER_FUNCTION(DLEVEL_STABLE);
DCHECK_PARAM_PTR("w", w);
@@ -394,7 +394,7 @@
{
Ewl_Image *i;
Ewl_Embed *emb;
- Ecore_X_Event_Mouse_Button_Up *ev;
+ Ewl_Event_Mouse_Up *ev;
DENTER_FUNCTION(DLEVEL_STABLE);
DCHECK_PARAM_PTR("w", w);
@@ -413,7 +413,7 @@
{
Ewl_Image *i;
Ewl_Embed *emb;
- Ecore_X_Event_Mouse_Move *ev;
+ Ewl_Event_Mouse_Move *ev;
DENTER_FUNCTION(DLEVEL_STABLE);
DCHECK_PARAM_PTR("w", w);
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_misc.c,v
retrieving revision 1.64
retrieving revision 1.65
diff -u -3 -r1.64 -r1.65
--- ewl_misc.c 25 Feb 2004 06:57:28 -0000 1.64
+++ ewl_misc.c 26 Feb 2004 05:38:35 -0000 1.65
@@ -529,10 +529,13 @@
ewl_object_add_queued(EWL_OBJECT(w), EWL_FLAG_QUEUED_RSCHEDULED);
ewd_list_append(realize_list, w);
+
+ DLEAVE_FUNCTION(DLEVEL_STABLE);
}
void ewl_child_add_place(Ewl_Widget *w)
{
+ DENTER_FUNCTION(DLEVEL_STABLE);
if (ewl_object_get_flags(EWL_OBJECT(w), EWL_FLAG_PROPERTY_TOPLEVEL))
ewd_list_append(child_add_list, w);
else {
@@ -549,6 +552,8 @@
}
}
ewd_list_prepend(child_add_list, w);
+
+ DLEAVE_FUNCTION(DLEVEL_STABLE);
}
void ewl_realize_queue()
@@ -628,6 +633,8 @@
void ewl_destroy_request(Ewl_Widget *w)
{
+ DENTER_FUNCTION(DLEVEL_STABLE);
+
if (ewl_object_has_queued(EWL_OBJECT(w), EWL_FLAG_QUEUED_DSCHEDULED))
DRETURN(DLEVEL_STABLE);
@@ -646,6 +653,8 @@
*/
if (ewl_object_get_recursive(EWL_OBJECT(w)))
ewl_container_destroy(EWL_CONTAINER(w));
+
+ DLEAVE_FUNCTION(DLEVEL_STABLE);
}
void ewl_evas_destroy(Evas *evas)
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_object.c,v
retrieving revision 1.49
retrieving revision 1.50
diff -u -3 -r1.49 -r1.50
--- ewl_object.c 3 Jan 2004 21:23:11 -0000 1.49
+++ ewl_object.c 26 Feb 2004 05:38:36 -0000 1.50
@@ -92,6 +92,7 @@
*/
int ewl_object_get_current_x(Ewl_Object * o)
{
+ DENTER_FUNCTION(DLEVEL_STABLE);
DCHECK_PARAM_PTR_RET("o", o, 0);
DRETURN_INT(CURRENT_X(o) - PADDING_LEFT(o) - INSET_LEFT(o),
@@ -105,6 +106,7 @@
*/
int ewl_object_get_current_y(Ewl_Object * o)
{
+ DENTER_FUNCTION(DLEVEL_STABLE);
DCHECK_PARAM_PTR_RET("o", o, 0);
DRETURN_INT(CURRENT_Y(o) - PADDING_TOP(o) - INSET_TOP(o),
@@ -120,6 +122,7 @@
{
int w;
+ DENTER_FUNCTION(DLEVEL_STABLE);
DCHECK_PARAM_PTR_RET("o", o, 0);
w = CURRENT_W(o);
@@ -148,6 +151,7 @@
{
int h;
+ DENTER_FUNCTION(DLEVEL_STABLE);
DCHECK_PARAM_PTR_RET("o", o, 0);
h = CURRENT_H(o);
@@ -318,6 +322,7 @@
{
int add, temp;
+ DENTER_FUNCTION(DLEVEL_STABLE);
DCHECK_PARAM_PTR_RET("o", o, 0);
add = INSET_HORIZONTAL(o) + PADDING_HORIZONTAL(o);
@@ -343,6 +348,7 @@
{
int add, temp;
+ DENTER_FUNCTION(DLEVEL_STABLE);
DCHECK_PARAM_PTR_RET("o", o, 0);
add = INSET_VERTICAL(o) + PADDING_VERTICAL(o);
@@ -962,6 +968,7 @@
*/
int ewl_object_top_padding(Ewl_Object * o)
{
+ DENTER_FUNCTION(DLEVEL_STABLE);
DCHECK_PARAM_PTR_RET("o", o, 0);
DRETURN_INT(PADDING_TOP(o), DLEVEL_STABLE);
@@ -974,6 +981,7 @@
*/
int ewl_object_bottom_padding(Ewl_Object * o)
{
+ DENTER_FUNCTION(DLEVEL_STABLE);
DCHECK_PARAM_PTR_RET("o", o, 0);
DRETURN_INT(PADDING_BOTTOM(o), DLEVEL_STABLE);
@@ -986,6 +994,7 @@
*/
int ewl_object_left_padding(Ewl_Object * o)
{
+ DENTER_FUNCTION(DLEVEL_STABLE);
DCHECK_PARAM_PTR_RET("o", o, 0);
DRETURN_INT(PADDING_LEFT(o), DLEVEL_STABLE);
@@ -998,6 +1007,7 @@
*/
int ewl_object_right_padding(Ewl_Object * o)
{
+ DENTER_FUNCTION(DLEVEL_STABLE);
DCHECK_PARAM_PTR_RET("o", o, 0);
DRETURN_INT(PADDING_RIGHT(o), DLEVEL_STABLE);
@@ -1142,6 +1152,8 @@
if (EWL_WIDGET(o)->parent)
ewl_widget_configure(EWL_WIDGET(o)->parent);
+
+ DLEAVE_FUNCTION(DLEVEL_STABLE);
}
/**
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_password.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -3 -r1.6 -r1.7
--- ewl_password.c 24 Feb 2004 16:52:28 -0000 1.6
+++ ewl_password.c 26 Feb 2004 05:38:38 -0000 1.7
@@ -184,7 +184,7 @@
int len;
char *tmp;
Ewl_Password *e;
- Ecore_X_Event_Key_Down *ev;
+ Ewl_Event_Key_Down *ev;
DENTER_FUNCTION(DLEVEL_STABLE);
DCHECK_PARAM_PTR("w", w);
@@ -209,8 +209,8 @@
"KP_Enter"))
ewl_callback_call_with_event_data(w, EWL_CALLBACK_VALUE_CHANGED,
EWL_TEXT(w)->text);
- else if (ev->key_compose) {
- ewl_password_insert_text(e, ev->key_compose);
+ else if (ev->keyname) {
+ ewl_password_insert_text(e, ev->keyname);
}
DLEAVE_FUNCTION(DLEVEL_STABLE);
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_scrollbar.c,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -3 -r1.28 -r1.29
--- ewl_scrollbar.c 25 Nov 2003 07:47:29 -0000 1.28
+++ ewl_scrollbar.c 26 Feb 2004 05:38:38 -0000 1.29
@@ -42,7 +42,6 @@
void ewl_scrollbar_init(Ewl_Scrollbar * s, Ewl_Orientation orientation)
{
Ewl_Widget *w;
- char key[PATH_MAX];
DENTER_FUNCTION(DLEVEL_STABLE);
DCHECK_PARAM_PTR("s", s);
@@ -149,8 +148,8 @@
/*
* Set the alignment of the buttons to the seeker.
*/
- snprintf(key, PATH_MAX, "%s/button_order", w->appearance);
- s->buttons_alignment = ewl_theme_data_get_int(EWL_WIDGET(s), key);
+ s->buttons_alignment = ewl_theme_data_get_int(EWL_WIDGET(s),
+ "button_order");
/*
* Setup a few orientation specific variables, such as appearance and
@@ -416,7 +415,6 @@
double dt;
double value;
int velocity;
- char tmp[PATH_MAX];
s = EWL_SCROLLBAR(data);
@@ -427,8 +425,7 @@
* Check the theme for a velocity setting and bring it within normal
* useable bounds.
*/
- snprintf(tmp, PATH_MAX, "%s/velocity", EWL_WIDGET(s)->appearance);
- velocity = ewl_theme_data_get_int(EWL_WIDGET(s), tmp);
+ velocity = ewl_theme_data_get_int(EWL_WIDGET(s), "velocity");
if (velocity < 1)
velocity = 1;
else if (velocity > 10)
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_seeker.c,v
retrieving revision 1.50
retrieving revision 1.51
diff -u -3 -r1.50 -r1.51
--- ewl_seeker.c 25 Nov 2003 07:47:29 -0000 1.50
+++ ewl_seeker.c 26 Feb 2004 05:38:39 -0000 1.51
@@ -379,7 +379,7 @@
void
ewl_seeker_button_mouse_down_cb(Ewl_Widget * w, void *ev_data, void *user_data)
{
- Ecore_X_Event_Mouse_Button_Down *ev;
+ Ewl_Event_Mouse_Down *ev;
Ewl_Seeker *s;
int xx, yy, ww, hh;
@@ -420,7 +420,7 @@
void
ewl_seeker_button_mouse_move_cb(Ewl_Widget * w, void *ev_data, void *user_data)
{
- Ecore_X_Event_Mouse_Move *ev;
+ Ewl_Event_Mouse_Move *ev;
Ewl_Seeker *s;
int mx, my;
int dx, dy;
@@ -500,7 +500,7 @@
void ewl_seeker_mouse_down_cb(Ewl_Widget * w, void *ev_data, void *user_data)
{
Ewl_Seeker *s;
- Ecore_X_Event_Mouse_Button_Down *ev;
+ Ewl_Event_Mouse_Down *ev;
double value;
int xx, yy, ww, hh;
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_selectionbar.c,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -3 -r1.15 -r1.16
--- ewl_selectionbar.c 19 Nov 2003 20:18:35 -0000 1.15
+++ ewl_selectionbar.c 26 Feb 2004 05:38:40 -0000 1.16
@@ -351,6 +351,7 @@
Ewl_Selectionbar *s;
int retval = 0;
+ DENTER_FUNCTION(DLEVEL_STABLE);
ecore_timer_del(close_timer);
w = EWL_WIDGET(ev_data);
@@ -386,6 +387,7 @@
Ewl_Selectionbar *s;
int retval = 0;
+ DENTER_FUNCTION(DLEVEL_STABLE);
ecore_timer_del(open_timer);
w = EWL_WIDGET(ev_data);
@@ -428,7 +430,7 @@
Ewl_Widget *child;
Ewl_Object *o;
Ewd_List *children;
- Ecore_X_Event_Mouse_Move *ev;
+ Ewl_Event_Mouse_Move *ev;
Ewl_Selectionbar *s;
int x, old_x;
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_spectrum.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -3 -r1.4 -r1.5
--- ewl_spectrum.c 19 Nov 2003 20:18:36 -0000 1.4
+++ ewl_spectrum.c 26 Feb 2004 05:38:40 -0000 1.5
@@ -13,6 +13,7 @@
{
Ewl_Spectrum *sp = NULL;
+ DENTER_FUNCTION(DLEVEL_STABLE);
sp = NEW(Ewl_Spectrum, 1);
if (!sp)
DRETURN_PTR(NULL, DLEVEL_STABLE);
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_spinner.c,v
retrieving revision 1.45
retrieving revision 1.46
diff -u -3 -r1.45 -r1.46
--- ewl_spinner.c 23 Feb 2004 15:28:29 -0000 1.45
+++ ewl_spinner.c 26 Feb 2004 05:38:40 -0000 1.46
@@ -1,4 +1,3 @@
-
#include <Ewl.h>
static void ewl_spinner_calc_value(Ewl_Spinner *s, double val);
@@ -11,6 +10,7 @@
{
Ewl_Spinner *s = NULL;
+ DENTER_FUNCTION(DLEVEL_STABLE);
s = NEW(Ewl_Spinner, 1);
if (!s)
DRETURN_PTR(NULL, DLEVEL_STABLE);
@@ -84,6 +84,8 @@
ewl_spinner_decrease_value_cb, w);
ewl_callback_append(s->button_decrease, EWL_CALLBACK_KEY_DOWN,
ewl_spinner_key_down_cb, NULL);
+
+ DLEAVE_FUNCTION(DLEVEL_STABLE);
}
/**
@@ -346,7 +348,7 @@
{
Ewl_Entry *e;
Ewl_Spinner *s;
- Ecore_X_Event_Key_Down *ev;
+ Ewl_Event_Key_Down *ev;
DENTER_FUNCTION(DLEVEL_STABLE);
DCHECK_PARAM_PTR("w", w);
@@ -372,19 +374,10 @@
ewl_entry_delete_to_left(e);
else if (!strcmp(ev->keyname, "Delete"))
ewl_entry_delete_to_right(e);
- else if (ev->key_compose && (ev->key_compose[0] == '0' ||
- ev->key_compose[0] == '1' ||
- ev->key_compose[0] == '2' ||
- ev->key_compose[0] == '3' ||
- ev->key_compose[0] == '4' ||
- ev->key_compose[0] == '5' ||
- ev->key_compose[0] == '6' ||
- ev->key_compose[0] == '7' ||
- ev->key_compose[0] == '8' ||
- ev->key_compose[0] == '9' ||
- ev->key_compose[0] == '.' ||
- ev->key_compose[0] == '-'))
- ewl_entry_insert_text(e, ev->key_compose);
+ else if (ev->keyname && (isdigit(ev->keyname[0]) ||
+ ev->keyname[0] == '.' ||
+ ev->keyname[0] == '-'))
+ ewl_entry_insert_text(e, ev->keyname);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_text.c,v
retrieving revision 1.58
retrieving revision 1.59
diff -u -3 -r1.58 -r1.59
--- ewl_text.c 21 Feb 2004 18:11:11 -0000 1.58
+++ ewl_text.c 26 Feb 2004 05:38:40 -0000 1.59
@@ -568,7 +568,6 @@
{
Ewl_Text *t;
Ewl_Embed *emb;
- char key[PATH_MAX];
Evas_Coord x, y, width, height;
@@ -586,34 +585,22 @@
/*
* Setup the default font.
*/
- snprintf(key, PATH_MAX, "%s/font", w->appearance);
- t->font = ewl_theme_data_get_str(w, key);
-
- snprintf(key, PATH_MAX, "%s/font_size", w->appearance);
- t->font_size = ewl_theme_data_get_int(w, key);
+ t->font = ewl_theme_data_get_str(w, "font");
+ t->font_size = ewl_theme_data_get_int(w, "font_size");
}
estyle_set_font(t->estyle, t->font, t->font_size);
- if (!t->style) {
- /*
- * Setup the default style alignment and text.
- */
- snprintf(key, PATH_MAX, "%s/style", w->appearance);
- t->style = ewl_theme_data_get_str(w, key);
- }
+ if (!t->style)
+ t->style = ewl_theme_data_get_str(w, "style");
estyle_set_style(t->estyle, t->style);
if (!(t->overrides & EWL_TEXT_OVERRIDE_COLOR)) {
- snprintf(key, PATH_MAX, "%s/color/r", w->appearance);
- t->r = ewl_theme_data_get_int(w, key);
- snprintf(key, PATH_MAX, "%s/color/g", w->appearance);
- t->g = ewl_theme_data_get_int(w, key);
- snprintf(key, PATH_MAX, "%s/color/b", w->appearance);
- t->b = ewl_theme_data_get_int(w, key);
- snprintf(key, PATH_MAX, "%s/color/a", w->appearance);
- t->a = ewl_theme_data_get_int(w, key);
+ t->r = ewl_theme_data_get_int(w, "color/r");
+ t->g = ewl_theme_data_get_int(w, "color/g");
+ t->b = ewl_theme_data_get_int(w, "color/b");
+ t->a = ewl_theme_data_get_int(w, "color/a");
}
/*
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_textarea.c,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -3 -r1.22 -r1.23
--- ewl_textarea.c 22 Nov 2003 20:01:02 -0000 1.22
+++ ewl_textarea.c 26 Feb 2004 05:38:41 -0000 1.23
@@ -34,7 +34,7 @@
*/
void ewl_textarea_init(Ewl_TextArea * ta, char *text)
{
- Ewl_Widget *w;
+ Ewl_Widget *w;
DENTER_FUNCTION(DLEVEL_STABLE);
DCHECK_PARAM_PTR("ta", ta);
@@ -52,6 +52,8 @@
ewl_callback_append(w, EWL_CALLBACK_CONFIGURE,
ewl_textarea_configure_cb, NULL);
+ ta->etox_context = etox_context_new();
+
if (text)
ewl_textarea_set_text(ta, text);
@@ -111,6 +113,7 @@
*/
Evas_Object *ewl_textarea_get_etox(Ewl_TextArea * ta)
{
+ DENTER_FUNCTION(DLEVEL_STABLE);
DCHECK_PARAM_PTR_RET("ta", ta, NULL);
DRETURN_PTR(ta->etox, DLEVEL_STABLE);
@@ -177,25 +180,16 @@
etox_context_free(ta->etox_context);
ta->etox_context = NULL;
} else {
- char key[PATH_MAX];
/*
* Get the default style and color based on the theme.
*/
- snprintf(key, PATH_MAX, "%s/style", w->appearance);
- style = ewl_theme_data_get_str(w, key);
-
- snprintf(key, PATH_MAX, "%s/r", w->appearance);
- r = ewl_theme_data_get_int(w, key);
-
- snprintf(key, PATH_MAX, "%s/g", w->appearance);
- g = ewl_theme_data_get_int(w, key);
-
- snprintf(key, PATH_MAX, "%s/b", w->appearance);
- b = ewl_theme_data_get_int(w, key);
+ style = ewl_theme_data_get_str(w, "style");
- snprintf(key, PATH_MAX, "%s/a", w->appearance);
- a = ewl_theme_data_get_int(w, key);
+ r = ewl_theme_data_get_int(w, "color/r");
+ g = ewl_theme_data_get_int(w, "color/g");
+ b = ewl_theme_data_get_int(w, "color/b");
+ a = ewl_theme_data_get_int(w, "color/a");
/*
* Set the default style
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_theme.c,v
retrieving revision 1.57
retrieving revision 1.58
diff -u -3 -r1.57 -r1.58
--- ewl_theme.c 23 Feb 2004 05:43:27 -0000 1.57
+++ ewl_theme.c 26 Feb 2004 05:38:41 -0000 1.58
@@ -177,8 +177,7 @@
*/
font_paths = ewd_list_new();
if (font_paths) {
- snprintf(key, PATH_MAX, "/theme/font_path");
- font_path = ewl_theme_data_get_str(NULL, key);
+ font_path = ewl_theme_data_get_str(NULL, "/theme/font_path");
if (font_path) {
if (*font_path == '/')
@@ -243,6 +242,7 @@
*/
char *ewl_theme_path()
{
+ DENTER_FUNCTION(DLEVEL_STABLE);
DRETURN_PTR(strdup(theme_path), DLEVEL_STABLE);
}
@@ -252,6 +252,7 @@
*/
E_DB_File *ewl_theme_get_db()
{
+ DENTER_FUNCTION(DLEVEL_STABLE);
DRETURN_PTR(theme_db, DLEVEL_STABLE);
}
@@ -341,11 +342,20 @@
{
char *ret = NULL;
char *temp = NULL;
+ char key[PATH_MAX];
DENTER_FUNCTION(DLEVEL_STABLE);
DCHECK_PARAM_PTR_RET("k", k, NULL);
- for (temp = k; temp && !ret; temp = strchr(temp, '/')) {
+ /*
+ * Use the widget's appearance string to build a relative theme key.
+ */
+ if (w)
+ snprintf(key, PATH_MAX, "%s/%s", w->appearance, k);
+ else
+ strcpy(key, k);
+
+ for (temp = key; temp && !ret; temp = strchr(temp, '/')) {
if (w && w->theme)
ret = ewd_hash_get(w->theme, temp);
@@ -386,11 +396,20 @@
{
int ret = 0;
char *temp;
+ char key[PATH_MAX];
DENTER_FUNCTION(DLEVEL_STABLE);
DCHECK_PARAM_PTR_RET("k", k, FALSE);
- for (temp = k; temp && !ret; temp = strchr(temp, '/')) {
+ /*
+ * Use the widget's appearance string to build a relative theme key.
+ */
+ if (w)
+ snprintf(key, PATH_MAX, "%s/%s", w->appearance, k);
+ else
+ strcpy(key, k);
+
+ for (temp = key; temp && !ret; temp = strchr(temp, '/')) {
if (w->theme)
ret = (int) (ewd_hash_get(w->theme, temp));
else
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_tooltip.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -3 -r1.5 -r1.6
--- ewl_tooltip.c 21 Feb 2004 04:50:45 -0000 1.5
+++ ewl_tooltip.c 26 Feb 2004 05:38:41 -0000 1.6
@@ -145,7 +145,7 @@
ewl_tooltip_parent_mouse_move_cb(Ewl_Widget * w, void *ev_data, void *user_data)
{
Ewl_Tooltip *t = user_data;
- Ecore_X_Event_Mouse_Move *e = ev_data;
+ Ewl_Event_Mouse_Move *e = ev_data;
DENTER_FUNCTION(DLEVEL_STABLE);
DCHECK_PARAM_PTR("w", w);
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_widget.c,v
retrieving revision 1.104
retrieving revision 1.105
diff -u -3 -r1.104 -r1.105
--- ewl_widget.c 24 Feb 2004 04:25:39 -0000 1.104
+++ ewl_widget.c 26 Feb 2004 05:38:41 -0000 1.105
@@ -458,7 +458,8 @@
DCHECK_PARAM_PTR_RET("w", w, NULL);
- return (w->appearance ? strdup(w->appearance) : NULL);
+ DRETURN_PTR(w->appearance ? strdup(w->appearance) : NULL,
+ DLEVEL_STABLE);
}
/**
@@ -984,12 +985,10 @@
*/
void ewl_widget_realize_cb(Ewl_Widget * w, void *ev_data, void *user_data)
{
- int len;
int l = 0, r = 0, t = 0, b = 0;
int i_l = 0, i_r = 0, i_t = 0, i_b = 0;
int p_l = 0, p_r = 0, p_t = 0, p_b = 0;
char *i = NULL;
- char *key = NULL;
char *group = NULL;
Evas_Coord width, height;
Ewl_Embed *emb = NULL;
@@ -1043,26 +1042,12 @@
p_b = b - p_b;
/*
- * Calculate the length of the base key string, then allocate
- * the memory for it plus room for placing /visible at the end.
- */
- len = strlen(w->appearance) + 7;
- key = NEW(char, len);
- if (!key)
- DRETURN(DLEVEL_STABLE);
-
- /*
* Retrieve the path to the theme file that will be loaded
* return if no file to be loaded. Also get the group name in the
* theme file.
*/
- snprintf(key, len, "%s/file", w->appearance);
- i = ewl_theme_image_get(w, key);
-
- snprintf(key, len, "%s/group", w->appearance);
- group = ewl_theme_data_get_str(w, key);
-
- FREE(key);
+ i = ewl_theme_image_get(w, "file");
+ group = ewl_theme_data_get_str(w, "group");
if (group) {
emb = ewl_embed_find_by_widget(w);
@@ -1291,6 +1276,7 @@
void
ewl_widget_focus_in_cb(Ewl_Widget *w, void *ev_data, void *user_data)
{
+ DENTER_FUNCTION(DLEVEL_STABLE);
if (ewl_object_has_state(EWL_OBJECT(w), EWL_FLAG_STATE_DISABLED))
DRETURN(DLEVEL_STABLE);
@@ -1298,33 +1284,40 @@
ewl_widget_set_state(w, "mouse,down,0");
else
ewl_widget_set_state(w, "mouse,in");
+
+ DLEAVE_FUNCTION(DLEVEL_STABLE);
}
void
ewl_widget_focus_out_cb(Ewl_Widget *w, void *ev_data, void *user_data)
{
+ DENTER_FUNCTION(DLEVEL_STABLE);
if (ewl_object_has_state(EWL_OBJECT(w), EWL_FLAG_STATE_DISABLED))
DRETURN(DLEVEL_STABLE);
ewl_widget_set_state(w, "mouse,out");
+ DLEAVE_FUNCTION(DLEVEL_STABLE);
}
void
ewl_widget_mouse_down_cb(Ewl_Widget *w, void *ev_data, void *user_data)
{
- Ecore_X_Event_Mouse_Button_Down *e = ev_data;
+ Ewl_Event_Mouse_Down *e = ev_data;
char state[14];
+ DENTER_FUNCTION(DLEVEL_STABLE);
if (ewl_object_has_state(EWL_OBJECT(w), EWL_FLAG_STATE_DISABLED))
DRETURN(DLEVEL_STABLE);
snprintf(state, 14, "mouse,down,%i", e->button);
ewl_widget_set_state(w, state);
+ DLEAVE_FUNCTION(DLEVEL_STABLE);
}
void
ewl_widget_mouse_up_cb(Ewl_Widget *w, void *ev_data, void *user_data)
{
+ DENTER_FUNCTION(DLEVEL_STABLE);
if (ewl_object_has_state(EWL_OBJECT(w), EWL_FLAG_STATE_DISABLED))
DRETURN(DLEVEL_STABLE);
@@ -1335,14 +1328,17 @@
ev_data);
} else
ewl_widget_set_state(w, "mouse,out");
+ DLEAVE_FUNCTION(DLEVEL_STABLE);
}
void
ewl_widget_mouse_move_cb(Ewl_Widget *w, void *ev_data, void *user_data)
{
+ DENTER_FUNCTION(DLEVEL_STABLE);
if (w->theme_object) {
edje_object_signal_emit(w->theme_object, "mouse,move", "EWL");
}
+ DLEAVE_FUNCTION(DLEVEL_STABLE);
}
static void
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_window.c,v
retrieving revision 1.73
retrieving revision 1.74
diff -u -3 -r1.73 -r1.74
--- ewl_window.c 25 Feb 2004 06:57:28 -0000 1.73
+++ ewl_window.c 26 Feb 2004 05:38:41 -0000 1.74
@@ -358,7 +358,7 @@
* 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)
+#ifdef 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),
@@ -386,7 +386,7 @@
glinfo = (Evas_Engine_Info_GL_X11 *)info;
glinfo->info.display = ecore_x_display_get();
- glinfo->info.visual = glinfo->func.best_depth_get(
+ glinfo->info.visual = glinfo->func.best_visual_get(
glinfo->info.display,
DefaultScreen(glinfo->info.display));
glinfo->info.colormap = glinfo->func.best_colormap_get(
-------------------------------------------------------
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