#include <string.h>
+#include <Ecore_X.h>
#include "border.h"
#define BOUNDS_CHANGED "object:bounds-changed"
#define WIDTH 720
#define HEIGHT 1280
-static Evas* evas = NULL;
static Evas_Object *r1 = NULL;
static Evas_Object *r2 = NULL;
static Evas_Object *r3 = NULL;
draw_border(event->source);
}
+Ecore_X_Window _get_win_below(int x, int y)
+{
+ int num;
+ Ecore_X_Window win = ecore_x_window_at_xy_get(x, y);
+ ecore_x_window_ignore_set(win, 1);
+ Ecore_X_Window *skip = ecore_x_window_ignore_list(&num);
+ fprintf(stderr, "win_below:%d\n", ecore_x_window_at_xy_with_skip_get(x, y, skip, num));
+ fprintf(stderr, "win_top:%d\n", win);
+ return ecore_x_window_at_xy_with_skip_get(x, y, skip, num);
+}
+
+Eina_Bool _mouse_up(void *data,
+ int type,
+ void *event)
+{
+ Ecore_Event_Mouse_Button *ev = event;
+ ecore_x_mouse_up_send(_get_win_below(ev->x, ev->y), ev->x, ev->y, 1);
+ fprintf(stderr, "mouse_up\n");
+ return ECORE_CALLBACK_PASS_ON;
+}
+
+static Eina_Bool _mouse_down(void *data,
+ int type,
+ void *event)
+{
+ Ecore_Event_Mouse_Button *ev = event;
+ ecore_x_mouse_down_send(_get_win_below(ev->x, ev->y), ev->x, ev->y, 1);
+ fprintf(stderr, "mouse_down\n");
+ return ECORE_CALLBACK_PASS_ON;
+}
+
+static Eina_Bool _mouse_move(void *data,
+ int type,
+ void *event)
+{
+ Ecore_Event_Mouse_Button *ev = event;
+ ecore_x_mouse_move_send(_get_win_below(ev->x, ev->y), ev->x, ev->y);
+ fprintf(stderr, "mouse_move\n");
+ return ECORE_CALLBACK_PASS_ON;
+}
+
Eina_Bool border_init(void)
{
GError *error = NULL;
return EINA_TRUE;
win = elm_win_add(NULL, "highlight", ELM_WIN_BASIC);
+
elm_win_alpha_set(win, EINA_TRUE);
+ elm_win_override_set(win, EINA_TRUE);
evas_object_resize(win, WIDTH, HEIGHT);
evas_object_move(win, 0, 0);
evas_object_layer_set(win, 6);
evas_object_show(r4);
evas_object_show(win);
+ ecore_event_init();
+ ecore_event_handler_add(ECORE_EVENT_MOUSE_BUTTON_DOWN, _mouse_down, NULL);
+ ecore_event_handler_add(ECORE_EVENT_MOUSE_BUTTON_UP, _mouse_up, NULL);
+ ecore_event_handler_add(ECORE_EVENT_MOUSE_BUTTON_UP, _mouse_move, NULL);
+
+
listener = atspi_event_listener_new (_bounds_changed, NULL, NULL);
atspi_event_listener_register (listener, BOUNDS_CHANGED, &error);
evas_object_del(r4);
r4 = NULL;
}
- if(win) {
- evas_object_del(win);
- win = NULL;
- }
initialized = EINA_FALSE;
}