forked from enlightenment/efl
elementary/conformant - support state change callbacks for comformant.
"virtualkeypad,state,on", "virtualkeypad,state,off", "clipboard,state,on", "clipboard,state,off" SVN revision: 79133
This commit is contained in:
parent
577f90e9a4
commit
29c1236341
|
@ -664,3 +664,8 @@
|
|||
2012-11-07 Mikael Sans (xhell)
|
||||
|
||||
* Fix wrong parameter for thumbnail error in elm_icon.
|
||||
|
||||
2012-11-12 ChunEon Park (Hermet)
|
||||
|
||||
* Support virtualkeypad, clipbard state shange signals from
|
||||
conformant
|
||||
|
|
|
@ -12,6 +12,7 @@ Additions:
|
|||
* Add color picker to elm_colorselector.
|
||||
* Add a search API to list all localisations corresponding to a name in map
|
||||
* Add elm_notify_align_set/get
|
||||
* Add virtualkeypad, clipboard state change signals from conformant.
|
||||
|
||||
Improvements:
|
||||
|
||||
|
|
|
@ -365,7 +365,9 @@ _on_content_resize(void *data,
|
|||
{
|
||||
ELM_CONFORMANT_DATA_GET(data, sd);
|
||||
|
||||
if (sd->vkb_state == ECORE_X_VIRTUAL_KEYBOARD_STATE_OFF) return;
|
||||
if ((sd->vkb_state == ECORE_X_VIRTUAL_KEYBOARD_STATE_OFF) &&
|
||||
(sd->clipboard_state == ECORE_X_ILLUME_CLIPBOARD_STATE_OFF))
|
||||
return;
|
||||
|
||||
if (sd->show_region_job) ecore_job_del(sd->show_region_job);
|
||||
sd->show_region_job = ecore_job_add(_show_region_job, data);
|
||||
|
@ -415,6 +417,58 @@ _autoscroll_objects_update(void *data)
|
|||
}
|
||||
}
|
||||
|
||||
static void
|
||||
_virtualkeypad_state_change(Evas_Object *obj, Ecore_X_Event_Window_Property *ev)
|
||||
{
|
||||
ELM_CONFORMANT_DATA_GET(obj, sd);
|
||||
|
||||
Ecore_X_Window zone = ecore_x_e_illume_zone_get(ev->win);
|
||||
Ecore_X_Virtual_Keyboard_State state =
|
||||
ecore_x_e_virtual_keyboard_state_get(zone);
|
||||
|
||||
if (sd->vkb_state == state) return;
|
||||
sd->vkb_state = state;
|
||||
|
||||
if (state == ECORE_X_VIRTUAL_KEYBOARD_STATE_OFF)
|
||||
{
|
||||
evas_object_size_hint_min_set(sd->virtualkeypad, -1, 0);
|
||||
evas_object_size_hint_max_set(sd->virtualkeypad, -1, 0);
|
||||
elm_widget_display_mode_set(obj, EVAS_DISPLAY_MODE_NONE);
|
||||
evas_object_smart_callback_call(obj, "virtualkeypad,state,off", NULL);
|
||||
}
|
||||
else if (state == ECORE_X_VIRTUAL_KEYBOARD_STATE_ON)
|
||||
{
|
||||
elm_widget_display_mode_set(obj, EVAS_DISPLAY_MODE_COMPRESS);
|
||||
_autoscroll_objects_update(obj);
|
||||
evas_object_smart_callback_call(obj, "virtualkeypad,state,on", NULL);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
_clipboard_state_change(Evas_Object *obj, Ecore_X_Event_Window_Property *ev)
|
||||
{
|
||||
ELM_CONFORMANT_DATA_GET(obj, sd);
|
||||
|
||||
Ecore_X_Window zone = ecore_x_e_illume_zone_get(ev->win);
|
||||
Ecore_X_Illume_Clipboard_State state =
|
||||
ecore_x_e_illume_clipboard_state_get(zone);
|
||||
|
||||
if (sd->clipboard_state == state) return;
|
||||
sd->clipboard_state = state;
|
||||
|
||||
if (state == ECORE_X_ILLUME_CLIPBOARD_STATE_OFF)
|
||||
{
|
||||
evas_object_size_hint_min_set(sd->clipboard, -1, 0);
|
||||
evas_object_size_hint_max_set(sd->clipboard, -1, 0);
|
||||
evas_object_smart_callback_call(obj, "clipboard,state,off", NULL);
|
||||
}
|
||||
else if(state == ECORE_X_ILLUME_CLIPBOARD_STATE_ON)
|
||||
{
|
||||
_autoscroll_objects_update(obj);
|
||||
evas_object_smart_callback_call(obj, "clipboard,state,on", NULL);
|
||||
}
|
||||
}
|
||||
|
||||
static Eina_Bool
|
||||
_on_prop_change(void *data,
|
||||
int type __UNUSED__,
|
||||
|
@ -422,8 +476,6 @@ _on_prop_change(void *data,
|
|||
{
|
||||
Ecore_X_Event_Window_Property *ev = event;
|
||||
|
||||
ELM_CONFORMANT_DATA_GET(data, sd);
|
||||
|
||||
if (ev->atom == ECORE_X_ATOM_E_ILLUME_ZONE)
|
||||
{
|
||||
Conformant_Part_Type part_type;
|
||||
|
@ -444,44 +496,9 @@ _on_prop_change(void *data,
|
|||
else if (ev->atom == ECORE_X_ATOM_E_ILLUME_CLIPBOARD_GEOMETRY)
|
||||
_conformant_part_sizing_eval(data, ELM_CONFORMANT_CLIPBOARD_PART);
|
||||
else if (ev->atom == ECORE_X_ATOM_E_VIRTUAL_KEYBOARD_STATE)
|
||||
{
|
||||
Ecore_X_Window zone;
|
||||
Ecore_X_Virtual_Keyboard_State vkb_state;
|
||||
|
||||
DBG("Keyboard Geometry Changed\n");
|
||||
zone = ecore_x_e_illume_zone_get(ev->win);
|
||||
vkb_state = ecore_x_e_virtual_keyboard_state_get(zone);
|
||||
if (sd->vkb_state != vkb_state)
|
||||
{
|
||||
sd->vkb_state = vkb_state;
|
||||
if (sd->vkb_state == ECORE_X_VIRTUAL_KEYBOARD_STATE_OFF)
|
||||
{
|
||||
evas_object_size_hint_min_set(sd->virtualkeypad, -1, 0);
|
||||
evas_object_size_hint_max_set(sd->virtualkeypad, -1, 0);
|
||||
elm_widget_display_mode_set(data, EVAS_DISPLAY_MODE_NONE);
|
||||
}
|
||||
else if (sd->vkb_state == ECORE_X_VIRTUAL_KEYBOARD_STATE_ON)
|
||||
{
|
||||
elm_widget_display_mode_set(data, EVAS_DISPLAY_MODE_COMPRESS);
|
||||
_autoscroll_objects_update(data);
|
||||
}
|
||||
}
|
||||
}
|
||||
_virtualkeypad_state_change(data, ev);
|
||||
else if (ev->atom == ECORE_X_ATOM_E_ILLUME_CLIPBOARD_STATE)
|
||||
{
|
||||
Ecore_X_Window zone;
|
||||
Ecore_X_Illume_Clipboard_State state;
|
||||
|
||||
zone = ecore_x_e_illume_zone_get(ev->win);
|
||||
state = ecore_x_e_illume_clipboard_state_get(zone);
|
||||
|
||||
if (state != ECORE_X_ILLUME_CLIPBOARD_STATE_ON)
|
||||
{
|
||||
evas_object_size_hint_min_set(sd->clipboard, -1, 0);
|
||||
evas_object_size_hint_max_set(sd->clipboard, -1, 0);
|
||||
}
|
||||
else _autoscroll_objects_update(data);
|
||||
}
|
||||
_clipboard_state_change(data, ev);
|
||||
|
||||
return ECORE_CALLBACK_PASS_ON;
|
||||
}
|
||||
|
@ -538,6 +555,7 @@ _elm_conformant_smart_parent_set(Evas_Object *obj,
|
|||
sd->prop_hdl = ecore_event_handler_add
|
||||
(ECORE_X_EVENT_WINDOW_PROPERTY, _on_prop_change, obj);
|
||||
sd->vkb_state = ECORE_X_VIRTUAL_KEYBOARD_STATE_OFF;
|
||||
sd->clipboard_state = ECORE_X_ILLUME_CLIPBOARD_STATE_OFF;
|
||||
}
|
||||
// FIXME: get kbd region prop
|
||||
#endif
|
||||
|
|
|
@ -22,7 +22,18 @@
|
|||
* This widget inherits from the @ref Layout one, so that all the
|
||||
* functions acting on it also work for conformant objects.
|
||||
*
|
||||
* This widget emits the same signals sent from @ref Layout:
|
||||
* This widget emits the following signals, besides the ones sent from
|
||||
* @ref Layout:
|
||||
* @li "virtualkeypad,state,on": if virtualkeypad state is switched to "on".
|
||||
* (@since 1.8)
|
||||
* @li "virtualkeypad,state,off": if virtualkeypad state is switched to "off".
|
||||
* (@since 1.8)
|
||||
* @li "clipboard,state,on": if clipboard state is switched to "on".
|
||||
* (@since 1.8)
|
||||
* @li "clipboard,state,off": if clipboard state is switched to "off".
|
||||
* (@since 1.8)
|
||||
* In all cases, the @c event parameter of the callback will be
|
||||
* @c NULL.
|
||||
*
|
||||
* Available styles for it:
|
||||
* - @c "default"
|
||||
|
|
|
@ -131,6 +131,7 @@ struct _Elm_Conformant_Smart_Data
|
|||
#ifdef HAVE_ELEMENTARY_X
|
||||
Ecore_Event_Handler *prop_hdl;
|
||||
Ecore_X_Virtual_Keyboard_State vkb_state;
|
||||
Ecore_X_Illume_Clipboard_State clipboard_state;
|
||||
#endif
|
||||
struct
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue