forked from enlightenment/enlightenment
70 lines
1.5 KiB
C
70 lines
1.5 KiB
C
|
#include "e.h"
|
||
|
|
||
|
typedef struct _E_Util_Fake_Mouse_Up_Info E_Util_Fake_Mouse_Up_Info;
|
||
|
|
||
|
struct _E_Util_Fake_Mouse_Up_Info
|
||
|
{
|
||
|
E_Container *con;
|
||
|
int button;
|
||
|
};
|
||
|
|
||
|
/* local subsystem functions */
|
||
|
static void _e_util_container_fake_mouse_up_cb(void *data);
|
||
|
static int _e_util_wakeup_cb(void *data);
|
||
|
|
||
|
/* local subsystem globals */
|
||
|
static Ecore_Timer *_e_util_dummy_timer = NULL;
|
||
|
|
||
|
/* externally accessible functions */
|
||
|
void
|
||
|
e_util_container_fake_mouse_up_later(E_Container *con, int button)
|
||
|
{
|
||
|
E_Util_Fake_Mouse_Up_Info *info;
|
||
|
|
||
|
info = calloc(1, sizeof(E_Util_Fake_Mouse_Up_Info));
|
||
|
if (info)
|
||
|
{
|
||
|
info->con = con;
|
||
|
info->button = button;
|
||
|
e_object_ref(E_OBJECT(info->con));
|
||
|
ecore_job_add(_e_util_container_fake_mouse_up_cb, info);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
void
|
||
|
e_util_container_fake_mouse_up_all_later(E_Container *con)
|
||
|
{
|
||
|
e_util_container_fake_mouse_up_later(con, 1);
|
||
|
e_util_container_fake_mouse_up_later(con, 2);
|
||
|
e_util_container_fake_mouse_up_later(con, 3);
|
||
|
}
|
||
|
|
||
|
void
|
||
|
e_util_wakeup(void)
|
||
|
{
|
||
|
if (_e_util_dummy_timer) return;
|
||
|
_e_util_dummy_timer = ecore_timer_add(0.0, _e_util_wakeup_cb, NULL);
|
||
|
}
|
||
|
|
||
|
/* local subsystem functions */
|
||
|
static void
|
||
|
_e_util_container_fake_mouse_up_cb(void *data)
|
||
|
{
|
||
|
E_Util_Fake_Mouse_Up_Info *info;
|
||
|
|
||
|
info = data;
|
||
|
if (info)
|
||
|
{
|
||
|
evas_event_feed_mouse_up(info->con->bg_evas, info->button);
|
||
|
e_object_unref(E_OBJECT(info->con));
|
||
|
free(info);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
static int
|
||
|
_e_util_wakeup_cb(void *data)
|
||
|
{
|
||
|
_e_util_dummy_timer = NULL;
|
||
|
return 0;
|
||
|
}
|