forked from enlightenment/efl
evas: introduce a log domain to monitor which object gets focus
This commit is contained in:
parent
8e104d5bfe
commit
dda350e3b4
|
@ -5,12 +5,33 @@
|
|||
#include "evas_private.h"
|
||||
#include "interfaces/efl_common_internal.h"
|
||||
|
||||
|
||||
static int evas_focus_log_domain = -1;
|
||||
|
||||
#define F_CRI(...) EINA_LOG_DOM_CRIT(evas_focus_log_domain, __VA_ARGS__)
|
||||
#define F_ERR(...) EINA_LOG_DOM_ERR(evas_focus_log_domain, __VA_ARGS__)
|
||||
#define F_WRN(...) EINA_LOG_DOM_WARN(evas_focus_log_domain, __VA_ARGS__)
|
||||
#define F_INF(...) EINA_LOG_DOM_INFO(evas_focus_log_domain, __VA_ARGS__)
|
||||
#define F_DBG(...) EINA_LOG_DOM_DBG(evas_focus_log_domain, __VA_ARGS__)
|
||||
|
||||
/* private calls */
|
||||
|
||||
/* local calls */
|
||||
|
||||
/* public calls */
|
||||
|
||||
void
|
||||
evas_focus_init(void)
|
||||
{
|
||||
evas_focus_log_domain = eina_log_domain_register("evas-focus", "red");
|
||||
}
|
||||
|
||||
void
|
||||
evas_focus_shutdown(void)
|
||||
{
|
||||
eina_log_domain_unregister(evas_focus_log_domain);
|
||||
evas_focus_log_domain = -1;
|
||||
}
|
||||
|
||||
static Eina_Bool
|
||||
_already_focused(Eina_List *seats, Efl_Input_Device *seat)
|
||||
|
@ -38,6 +59,8 @@ _default_seat_get(const Eo *evas_obj)
|
|||
return edata->default_seat;
|
||||
}
|
||||
|
||||
#define DEBUG_TUPLE(v) v, (v ? efl_class_name_get(v) : "(null)")
|
||||
|
||||
static void
|
||||
_evas_focus_set(Eo *evas_obj, Efl_Input_Device *key, Eina_Bool focus)
|
||||
{
|
||||
|
@ -47,6 +70,8 @@ _evas_focus_set(Eo *evas_obj, Efl_Input_Device *key, Eina_Bool focus)
|
|||
EINA_SAFETY_ON_NULL_RETURN(evas);
|
||||
edata = efl_data_scope_get(evas, EVAS_CANVAS_CLASS);
|
||||
|
||||
F_DBG("Focus moved in %d from (%p,%s) to (%p,%s)", efl_input_device_seat_id_get(key), DEBUG_TUPLE(eina_hash_find(edata->focused_objects, &key)), DEBUG_TUPLE(evas_obj));
|
||||
|
||||
if (focus)
|
||||
eina_hash_add(edata->focused_objects, &key, evas_obj);
|
||||
else
|
||||
|
|
|
@ -96,6 +96,7 @@ evas_init(void)
|
|||
EINA_LOG_STATE_INIT);
|
||||
|
||||
_efl_gfx_map_init();
|
||||
evas_focus_init();
|
||||
|
||||
return _evas_init_count;
|
||||
|
||||
|
@ -141,6 +142,8 @@ evas_shutdown(void)
|
|||
EINA_LOG_STATE_START,
|
||||
EINA_LOG_STATE_SHUTDOWN);
|
||||
|
||||
evas_focus_shutdown();
|
||||
|
||||
evas_common_shutdown();
|
||||
|
||||
#ifdef EVAS_CSERVE2
|
||||
|
|
|
@ -1909,6 +1909,9 @@ void _efl_canvas_gesture_manager_filter_event(Eo *gesture_manager, Eo *target, v
|
|||
void _efl_canvas_gesture_manager_callback_del_hook(Eo *gesture_manager, Eo *target, const Efl_Event_Description *type);
|
||||
void _efl_canvas_gesture_manager_callback_add_hook(Eo *gesture_manager, Eo *target, const Efl_Event_Description *type);
|
||||
|
||||
//evas focus functions
|
||||
void evas_focus_init(void);
|
||||
void evas_focus_shutdown(void);
|
||||
|
||||
extern Eina_Cow *evas_object_proxy_cow;
|
||||
extern Eina_Cow *evas_object_map_cow;
|
||||
|
|
Loading…
Reference in New Issue