summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMike Blumenkrantz <zmike@samsung.com>2019-03-04 13:37:30 -0500
committerMike Blumenkrantz <zmike@samsung.com>2019-03-04 13:37:30 -0500
commitfaf6d4f4256dd644a24aa1f24589df8f3b5f67ff (patch)
tree6939b51242ce31e01ae03bd63b16c2d56feda992 /src
parente3fa213d100ddb733d66830bb72525df07813c2b (diff)
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
Diffstat (limited to 'src')
-rw-r--r--src/lib/elementary/efl_ui_win.c107
-rw-r--r--src/lib/elementary/efl_ui_win.eo50
2 files changed, 43 insertions, 114 deletions
diff --git a/src/lib/elementary/efl_ui_win.c b/src/lib/elementary/efl_ui_win.c
index f29365d485..43ecc9d864 100644
--- a/src/lib/elementary/efl_ui_win.c
+++ b/src/lib/elementary/efl_ui_win.c
@@ -6942,62 +6942,6 @@ _efl_ui_win_prop_focus_skip_set(Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd, Eina_B
6942 TRAP(sd, focus_skip_set, skip); 6942 TRAP(sd, focus_skip_set, skip);
6943} 6943}
6944 6944
6945EOLIAN static Eina_Bool
6946_efl_ui_win_keygrab_set(Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd, const char *key,
6947 Efl_Input_Modifier modifiers EINA_UNUSED,
6948 Efl_Input_Modifier not_modifiers EINA_UNUSED,
6949 int priority EINA_UNUSED, Efl_Ui_Win_Keygrab_Mode grab_mode)
6950{
6951 Eina_Bool ret = EINA_FALSE;
6952#ifdef HAVE_ELEMENTARY_X
6953 _internal_elm_win_xwindow_get(sd);
6954 if (sd->x.xwin)
6955 {
6956 Ecore_X_Win_Keygrab_Mode x_grab_mode;
6957 switch (grab_mode)
6958 {
6959 case ELM_WIN_KEYGRAB_SHARED:
6960 x_grab_mode = ECORE_X_WIN_KEYGRAB_SHARED;
6961 break;
6962 case ELM_WIN_KEYGRAB_TOPMOST:
6963 x_grab_mode = ECORE_X_WIN_KEYGRAB_TOPMOST;
6964 break;
6965 case ELM_WIN_KEYGRAB_EXCLUSIVE:
6966 x_grab_mode = ECORE_X_WIN_KEYGRAB_EXCLUSIVE;
6967 break;
6968 case ELM_WIN_KEYGRAB_OVERRIDE_EXCLUSIVE:
6969 x_grab_mode = ECORE_X_WIN_KEYGRAB_OVERRIDE_EXCLUSIVE;
6970 break;
6971 default:
6972 return ret;
6973 }
6974 ret = ecore_x_window_keygrab_set(sd->x.xwin, key, 0, 0, 0, x_grab_mode);
6975 }
6976#else
6977 (void)sd;
6978 (void)key;
6979 (void)grab_mode;
6980#endif
6981 return ret;
6982}
6983
6984EOLIAN static Eina_Bool
6985_efl_ui_win_keygrab_unset(Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd, const char *key,
6986 Efl_Input_Modifier modifiers EINA_UNUSED,
6987 Efl_Input_Modifier not_modifiers EINA_UNUSED)
6988{
6989 Eina_Bool ret = EINA_FALSE;
6990#ifdef HAVE_ELEMENTARY_X
6991 _internal_elm_win_xwindow_get(sd);
6992 if (sd->x.xwin)
6993 ret = ecore_x_window_keygrab_unset(sd->x.xwin, key, 0, 0);
6994#else
6995 (void)sd;
6996 (void)key;
6997#endif
6998 return ret;
6999}
7000
7001EOLIAN static void 6945EOLIAN static void
7002_efl_ui_win_focus_highlight_enabled_set(Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd, Eina_Bool enabled) 6946_efl_ui_win_focus_highlight_enabled_set(Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd, Eina_Bool enabled)
7003{ 6947{
@@ -8901,13 +8845,40 @@ EAPI Eina_Bool
8901elm_win_keygrab_set(Elm_Win *obj, const char *key, 8845elm_win_keygrab_set(Elm_Win *obj, const char *key,
8902 Evas_Modifier_Mask modifiers EINA_UNUSED, 8846 Evas_Modifier_Mask modifiers EINA_UNUSED,
8903 Evas_Modifier_Mask not_modifiers EINA_UNUSED, 8847 Evas_Modifier_Mask not_modifiers EINA_UNUSED,
8904 int priority, Elm_Win_Keygrab_Mode grab_mode) 8848 int priority EINA_UNUSED, Elm_Win_Keygrab_Mode grab_mode)
8905{ 8849{
8906 // Note: Not converting modifiers as they are not used in the implementation 8850 // Note: Not converting modifiers as they are not used in the implementation
8907 return efl_ui_win_keygrab_set(obj, key, 8851 Eina_Bool ret = EINA_FALSE;
8908 EFL_INPUT_MODIFIER_NONE, 8852#ifdef HAVE_ELEMENTARY_X
8909 EFL_INPUT_MODIFIER_NONE, 8853 Efl_Ui_Win_Data *sd = efl_data_scope_safe_get(obj, MY_CLASS);
8910 priority, grab_mode); 8854 _internal_elm_win_xwindow_get(sd);
8855 if (sd->x.xwin)
8856 {
8857 Ecore_X_Win_Keygrab_Mode x_grab_mode;
8858 switch (grab_mode)
8859 {
8860 case ELM_WIN_KEYGRAB_SHARED:
8861 x_grab_mode = ECORE_X_WIN_KEYGRAB_SHARED;
8862 break;
8863 case ELM_WIN_KEYGRAB_TOPMOST:
8864 x_grab_mode = ECORE_X_WIN_KEYGRAB_TOPMOST;
8865 break;
8866 case ELM_WIN_KEYGRAB_EXCLUSIVE:
8867 x_grab_mode = ECORE_X_WIN_KEYGRAB_EXCLUSIVE;
8868 break;
8869 case ELM_WIN_KEYGRAB_OVERRIDE_EXCLUSIVE:
8870 x_grab_mode = ECORE_X_WIN_KEYGRAB_OVERRIDE_EXCLUSIVE;
8871 break;
8872 default:
8873 return ret;
8874 }
8875 ret = ecore_x_window_keygrab_set(sd->x.xwin, key, 0, 0, 0, x_grab_mode);
8876 }
8877#else
8878 (void)key;
8879 (void)grab_mode;
8880#endif
8881 return ret;
8911} 8882}
8912 8883
8913EAPI Eina_Bool 8884EAPI Eina_Bool
@@ -8916,9 +8887,17 @@ elm_win_keygrab_unset(Elm_Win *obj, const char *key,
8916 Evas_Modifier_Mask not_modifiers EINA_UNUSED) 8887 Evas_Modifier_Mask not_modifiers EINA_UNUSED)
8917{ 8888{
8918 // Note: Not converting modifiers as they are not used in the implementation 8889 // Note: Not converting modifiers as they are not used in the implementation
8919 return efl_ui_win_keygrab_unset(obj, key, 8890 Eina_Bool ret = EINA_FALSE;
8920 EFL_INPUT_MODIFIER_NONE, 8891#ifdef HAVE_ELEMENTARY_X
8921 EFL_INPUT_MODIFIER_NONE); 8892 Efl_Ui_Win_Data *sd = efl_data_scope_safe_get(obj, MY_CLASS);
8893 _internal_elm_win_xwindow_get(sd);
8894 if (sd->x.xwin)
8895 ret = ecore_x_window_keygrab_unset(sd->x.xwin, key, 0, 0);
8896#else
8897 (void)sd;
8898 (void)key;
8899#endif
8900 return ret;
8922} 8901}
8923 8902
8924EAPI Eina_Bool 8903EAPI Eina_Bool
diff --git a/src/lib/elementary/efl_ui_win.eo b/src/lib/elementary/efl_ui_win.eo
index 301435f2d3..94b283096e 100644
--- a/src/lib/elementary/efl_ui_win.eo
+++ b/src/lib/elementary/efl_ui_win.eo
@@ -89,24 +89,6 @@ enum Efl.Ui.Win_Indicator_Mode
89 If user flicks the upper side of window, the indicator is shown temporarily.]] 89 If user flicks the upper side of window, the indicator is shown temporarily.]]
90} 90}
91 91
92enum Efl.Ui.Win_Keygrab_Mode
93{
94 [[Define the keygrab modes of window. A window may send commands to the
95 Keyrouter according this mode, and perform different actions.]]
96
97 unknown = 0, [[Unknown keygrab mode]]
98 shared = (1 << 8), [[Get the grabbed-key together with the other client
99 windows]]
100 topmost = (1 << 9), [[Get the grabbed-key only when window is top of the
101 stack]]
102 exclusive = (1 << 10), [[Get the grabbed-key exclusively regardless of
103 window's position]]
104 override_exclusive = (1 << 11) [[Get the grabbed-key exclusively
105 regardless of window's position. This is
106 overrided by grabs from the other client
107 window]]
108}
109
110enum Efl.Ui.Win_Modal_Mode 92enum Efl.Ui.Win_Modal_Mode
111{ 93{
112 [[Defines the mode of a modal window]] 94 [[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
690 @in v: bool; [[If $true, center vertically. If $false, do not change vertical location.]] 672 @in v: bool; [[If $true, center vertically. If $false, do not change vertical location.]]
691 } 673 }
692 } 674 }
693 keygrab_set {
694 [[Set keygrab value of the window
695
696 This function grabs the $key of window using $grab_mode.
697 ]]
698
699 return: bool; [[$true on success, $false otherwise]]
700 params {
701 @in key: string; [[This string is the keyname to grab.]]
702 @in modifiers: Efl.Input.Modifier; [[A combination of modifier keys
703 that must be present to trigger the event. Not supported yet.]]
704 @in not_modifiers: Efl.Input.Modifier; [[A combination of modifier
705 keys that must not be present to trigger the event. Not supported yet.]]
706 @in priority: int; [[Not supported yet.]]
707 @in grab_mode: Efl.Ui.Win_Keygrab_Mode; [[Describes how the key should
708 be grabbed, wrt. focus and stacking.]]
709 }
710 }
711 keygrab_unset {
712 [[Unset keygrab value of the window
713
714 This function unset keygrab value. Ungrab $key of window.
715 ]]
716 return: bool; [[$true on success, $false otherwise]]
717 params {
718 @in key: string; [[This string is the keyname to grab.]]
719 @in modifiers: Efl.Input.Modifier; [[A combination of modifier keys
720 that must be present to trigger the event. Not supported yet.]]
721 @in not_modifiers: Efl.Input.Modifier; [[A combination of modifier keys
722 that must not be present to trigger the event. Not supported yet.]]
723 }
724 }
725 move_resize_start { 675 move_resize_start {
726 [[Start moving or resizing the window. 676 [[Start moving or resizing the window.
727 677