efl.ui.win: remove keygrab set/unset from eo api

Summary:
this is fundamentally incompatible with many display servers and will
not ever be supported outside of legacy

ref T7511
Depends on D8083

Reviewers: cedric

Reviewed By: cedric

Subscribers: cedric, #reviewers, #committers

Tags: #efl_api

Maniphest Tasks: T7511

Differential Revision: https://phab.enlightenment.org/D8084
This commit is contained in:
Mike Blumenkrantz 2019-03-04 13:37:30 -05:00
parent e3fa213d10
commit faf6d4f425
2 changed files with 43 additions and 114 deletions

View File

@ -6942,62 +6942,6 @@ _efl_ui_win_prop_focus_skip_set(Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd, Eina_B
TRAP(sd, focus_skip_set, skip);
}
EOLIAN static Eina_Bool
_efl_ui_win_keygrab_set(Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd, const char *key,
Efl_Input_Modifier modifiers EINA_UNUSED,
Efl_Input_Modifier not_modifiers EINA_UNUSED,
int priority EINA_UNUSED, Efl_Ui_Win_Keygrab_Mode grab_mode)
{
Eina_Bool ret = EINA_FALSE;
#ifdef HAVE_ELEMENTARY_X
_internal_elm_win_xwindow_get(sd);
if (sd->x.xwin)
{
Ecore_X_Win_Keygrab_Mode x_grab_mode;
switch (grab_mode)
{
case ELM_WIN_KEYGRAB_SHARED:
x_grab_mode = ECORE_X_WIN_KEYGRAB_SHARED;
break;
case ELM_WIN_KEYGRAB_TOPMOST:
x_grab_mode = ECORE_X_WIN_KEYGRAB_TOPMOST;
break;
case ELM_WIN_KEYGRAB_EXCLUSIVE:
x_grab_mode = ECORE_X_WIN_KEYGRAB_EXCLUSIVE;
break;
case ELM_WIN_KEYGRAB_OVERRIDE_EXCLUSIVE:
x_grab_mode = ECORE_X_WIN_KEYGRAB_OVERRIDE_EXCLUSIVE;
break;
default:
return ret;
}
ret = ecore_x_window_keygrab_set(sd->x.xwin, key, 0, 0, 0, x_grab_mode);
}
#else
(void)sd;
(void)key;
(void)grab_mode;
#endif
return ret;
}
EOLIAN static Eina_Bool
_efl_ui_win_keygrab_unset(Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd, const char *key,
Efl_Input_Modifier modifiers EINA_UNUSED,
Efl_Input_Modifier not_modifiers EINA_UNUSED)
{
Eina_Bool ret = EINA_FALSE;
#ifdef HAVE_ELEMENTARY_X
_internal_elm_win_xwindow_get(sd);
if (sd->x.xwin)
ret = ecore_x_window_keygrab_unset(sd->x.xwin, key, 0, 0);
#else
(void)sd;
(void)key;
#endif
return ret;
}
EOLIAN static void
_efl_ui_win_focus_highlight_enabled_set(Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd, Eina_Bool enabled)
{
@ -8901,13 +8845,40 @@ EAPI Eina_Bool
elm_win_keygrab_set(Elm_Win *obj, const char *key,
Evas_Modifier_Mask modifiers EINA_UNUSED,
Evas_Modifier_Mask not_modifiers EINA_UNUSED,
int priority, Elm_Win_Keygrab_Mode grab_mode)
int priority EINA_UNUSED, Elm_Win_Keygrab_Mode grab_mode)
{
// Note: Not converting modifiers as they are not used in the implementation
return efl_ui_win_keygrab_set(obj, key,
EFL_INPUT_MODIFIER_NONE,
EFL_INPUT_MODIFIER_NONE,
priority, grab_mode);
Eina_Bool ret = EINA_FALSE;
#ifdef HAVE_ELEMENTARY_X
Efl_Ui_Win_Data *sd = efl_data_scope_safe_get(obj, MY_CLASS);
_internal_elm_win_xwindow_get(sd);
if (sd->x.xwin)
{
Ecore_X_Win_Keygrab_Mode x_grab_mode;
switch (grab_mode)
{
case ELM_WIN_KEYGRAB_SHARED:
x_grab_mode = ECORE_X_WIN_KEYGRAB_SHARED;
break;
case ELM_WIN_KEYGRAB_TOPMOST:
x_grab_mode = ECORE_X_WIN_KEYGRAB_TOPMOST;
break;
case ELM_WIN_KEYGRAB_EXCLUSIVE:
x_grab_mode = ECORE_X_WIN_KEYGRAB_EXCLUSIVE;
break;
case ELM_WIN_KEYGRAB_OVERRIDE_EXCLUSIVE:
x_grab_mode = ECORE_X_WIN_KEYGRAB_OVERRIDE_EXCLUSIVE;
break;
default:
return ret;
}
ret = ecore_x_window_keygrab_set(sd->x.xwin, key, 0, 0, 0, x_grab_mode);
}
#else
(void)key;
(void)grab_mode;
#endif
return ret;
}
EAPI Eina_Bool
@ -8916,9 +8887,17 @@ elm_win_keygrab_unset(Elm_Win *obj, const char *key,
Evas_Modifier_Mask not_modifiers EINA_UNUSED)
{
// Note: Not converting modifiers as they are not used in the implementation
return efl_ui_win_keygrab_unset(obj, key,
EFL_INPUT_MODIFIER_NONE,
EFL_INPUT_MODIFIER_NONE);
Eina_Bool ret = EINA_FALSE;
#ifdef HAVE_ELEMENTARY_X
Efl_Ui_Win_Data *sd = efl_data_scope_safe_get(obj, MY_CLASS);
_internal_elm_win_xwindow_get(sd);
if (sd->x.xwin)
ret = ecore_x_window_keygrab_unset(sd->x.xwin, key, 0, 0);
#else
(void)sd;
(void)key;
#endif
return ret;
}
EAPI Eina_Bool

View File

@ -89,24 +89,6 @@ enum Efl.Ui.Win_Indicator_Mode
If user flicks the upper side of window, the indicator is shown temporarily.]]
}
enum Efl.Ui.Win_Keygrab_Mode
{
[[Define the keygrab modes of window. A window may send commands to the
Keyrouter according this mode, and perform different actions.]]
unknown = 0, [[Unknown keygrab mode]]
shared = (1 << 8), [[Get the grabbed-key together with the other client
windows]]
topmost = (1 << 9), [[Get the grabbed-key only when window is top of the
stack]]
exclusive = (1 << 10), [[Get the grabbed-key exclusively regardless of
window's position]]
override_exclusive = (1 << 11) [[Get the grabbed-key exclusively
regardless of window's position. This is
overrided by grabs from the other client
window]]
}
enum Efl.Ui.Win_Modal_Mode
{
[[Defines the mode of a modal window]]
@ -690,38 +672,6 @@ class @beta Efl.Ui.Win extends Efl.Ui.Widget implements Efl.Canvas.Scene, Efl.Ac
@in v: bool; [[If $true, center vertically. If $false, do not change vertical location.]]
}
}
keygrab_set {
[[Set keygrab value of the window
This function grabs the $key of window using $grab_mode.
]]
return: bool; [[$true on success, $false otherwise]]
params {
@in key: string; [[This string is the keyname to grab.]]
@in modifiers: Efl.Input.Modifier; [[A combination of modifier keys
that must be present to trigger the event. Not supported yet.]]
@in not_modifiers: Efl.Input.Modifier; [[A combination of modifier
keys that must not be present to trigger the event. Not supported yet.]]
@in priority: int; [[Not supported yet.]]
@in grab_mode: Efl.Ui.Win_Keygrab_Mode; [[Describes how the key should
be grabbed, wrt. focus and stacking.]]
}
}
keygrab_unset {
[[Unset keygrab value of the window
This function unset keygrab value. Ungrab $key of window.
]]
return: bool; [[$true on success, $false otherwise]]
params {
@in key: string; [[This string is the keyname to grab.]]
@in modifiers: Efl.Input.Modifier; [[A combination of modifier keys
that must be present to trigger the event. Not supported yet.]]
@in not_modifiers: Efl.Input.Modifier; [[A combination of modifier keys
that must not be present to trigger the event. Not supported yet.]]
}
}
move_resize_start {
[[Start moving or resizing the window.