summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLukasz Stanislawski <l.stanislaws@samsung.com>2015-04-29 15:08:57 +0200
committerLukasz Stanislawski <l.stanislaws@samsung.com>2015-05-11 15:48:49 +0200
commit7253de7df2de95ce8e3ddd1ee55ab12f78218b0b (patch)
tree6688852545e9fe9fda9cd6f0a4c8a2c5843c2fe1
parent40202659d69d0ddcd2272d45122a64adef1aa0a3 (diff)
atspi: more org.a11y.atspi.Window signals is broadcasted.
-rw-r--r--src/lib/elm_atspi_bridge.c49
-rw-r--r--src/lib/elm_interface_atspi_window.eo8
-rw-r--r--src/lib/elm_win.c40
3 files changed, 70 insertions, 27 deletions
diff --git a/src/lib/elm_atspi_bridge.c b/src/lib/elm_atspi_bridge.c
index 966508456..ec9e2db15 100644
--- a/src/lib/elm_atspi_bridge.c
+++ b/src/lib/elm_atspi_bridge.c
@@ -86,8 +86,12 @@ EO_CALLBACKS_ARRAY_DEFINE(_events_cb,
86 86
87EO_CALLBACKS_ARRAY_DEFINE(_window_cb, 87EO_CALLBACKS_ARRAY_DEFINE(_window_cb,
88 { ELM_INTERFACE_ATSPI_WINDOW_EVENT_WINDOW_CREATED, _window_signal_send}, 88 { ELM_INTERFACE_ATSPI_WINDOW_EVENT_WINDOW_CREATED, _window_signal_send},
89 { ELM_INTERFACE_ATSPI_WINDOW_EVENT_WINDOW_DESTROYED, _window_signal_send},
89 { ELM_INTERFACE_ATSPI_WINDOW_EVENT_WINDOW_ACTIVATED, _window_signal_send}, 90 { ELM_INTERFACE_ATSPI_WINDOW_EVENT_WINDOW_ACTIVATED, _window_signal_send},
90 { ELM_INTERFACE_ATSPI_WINDOW_EVENT_WINDOW_DEACTIVATED, _window_signal_send} 91 { ELM_INTERFACE_ATSPI_WINDOW_EVENT_WINDOW_DEACTIVATED, _window_signal_send},
92 { ELM_INTERFACE_ATSPI_WINDOW_EVENT_WINDOW_MAXIMIZED, _window_signal_send},
93 { ELM_INTERFACE_ATSPI_WINDOW_EVENT_WINDOW_MINIMIZED, _window_signal_send},
94 { ELM_INTERFACE_ATSPI_WINDOW_EVENT_WINDOW_RESTORED, _window_signal_send}
91); 95);
92 96
93EO_CALLBACKS_ARRAY_DEFINE(_selection_cb, 97EO_CALLBACKS_ARRAY_DEFINE(_selection_cb,
@@ -2616,10 +2620,20 @@ _set_broadcast_flag(const char *event)
2616 _window_signal_broadcast_mask = -1; // broadcast all 2620 _window_signal_broadcast_mask = -1; // broadcast all
2617 else if (!strcmp(tokens[1], "Create")) 2621 else if (!strcmp(tokens[1], "Create"))
2618 STATE_TYPE_SET(_window_signal_broadcast_mask, ATSPI_WINDOW_EVENT_CREATE); 2622 STATE_TYPE_SET(_window_signal_broadcast_mask, ATSPI_WINDOW_EVENT_CREATE);
2623 else if (!strcmp(tokens[1], "Destroy"))
2624 STATE_TYPE_SET(_window_signal_broadcast_mask, ATSPI_WINDOW_EVENT_DESTROY);
2619 else if (!strcmp(tokens[1], "Activate")) 2625 else if (!strcmp(tokens[1], "Activate"))
2620 STATE_TYPE_SET(_window_signal_broadcast_mask, ATSPI_WINDOW_EVENT_ACTIVATE); 2626 STATE_TYPE_SET(_window_signal_broadcast_mask, ATSPI_WINDOW_EVENT_ACTIVATE);
2621 else if (!strcmp(tokens[1], "Deactivate")) 2627 else if (!strcmp(tokens[1], "Deactivate"))
2622 STATE_TYPE_SET(_window_signal_broadcast_mask, ATSPI_WINDOW_EVENT_DEACTIVATE); 2628 STATE_TYPE_SET(_window_signal_broadcast_mask, ATSPI_WINDOW_EVENT_DEACTIVATE);
2629 else if (!strcmp(tokens[1], "Maximize"))
2630 STATE_TYPE_SET(_window_signal_broadcast_mask, ATSPI_WINDOW_EVENT_MAXIMIZE);
2631 else if (!strcmp(tokens[1], "Minimize"))
2632 STATE_TYPE_SET(_window_signal_broadcast_mask, ATSPI_WINDOW_EVENT_MINIMIZE);
2633 else if (!strcmp(tokens[1], "Resize"))
2634 STATE_TYPE_SET(_window_signal_broadcast_mask, ATSPI_WINDOW_EVENT_RESIZE);
2635 else if (!strcmp(tokens[1], "Restore"))
2636 STATE_TYPE_SET(_window_signal_broadcast_mask, ATSPI_WINDOW_EVENT_RESTORE);
2623 } 2637 }
2624 2638
2625 free(tokens[0]); 2639 free(tokens[0]);
@@ -2817,30 +2831,25 @@ _children_changed_signal_send(void *data, Eo *obj, const Eo_Event_Description *d
2817static Eina_Bool 2831static Eina_Bool
2818_window_signal_send(void *data, Eo *obj EINA_UNUSED, const Eo_Event_Description *desc, void *event_info EINA_UNUSED) 2832_window_signal_send(void *data, Eo *obj EINA_UNUSED, const Eo_Event_Description *desc, void *event_info EINA_UNUSED)
2819{ 2833{
2820 const char *event_desc;
2821 Eldbus_Service_Interface *window = data; 2834 Eldbus_Service_Interface *window = data;
2822 enum _Atspi_Window_Signals type; 2835 enum _Atspi_Window_Signals type;
2823 2836
2824 if (desc == ELM_INTERFACE_ATSPI_WINDOW_EVENT_WINDOW_CREATED) 2837 if (desc == ELM_INTERFACE_ATSPI_WINDOW_EVENT_WINDOW_CREATED)
2825 { 2838 type = ATSPI_WINDOW_EVENT_CREATE;
2826 event_desc = "Created"; 2839 else if (desc == ELM_INTERFACE_ATSPI_WINDOW_EVENT_WINDOW_DESTROYED)
2827 type = ATSPI_WINDOW_EVENT_CREATE; 2840 type = ATSPI_WINDOW_EVENT_DESTROY;
2828 }
2829 else if (desc == ELM_INTERFACE_ATSPI_WINDOW_EVENT_WINDOW_DEACTIVATED) 2841 else if (desc == ELM_INTERFACE_ATSPI_WINDOW_EVENT_WINDOW_DEACTIVATED)
2830 { 2842 type = ATSPI_WINDOW_EVENT_DEACTIVATE;
2831 event_desc = "Deactivate";
2832 type = ATSPI_WINDOW_EVENT_DEACTIVATE;
2833 }
2834 else if (desc == ELM_INTERFACE_ATSPI_WINDOW_EVENT_WINDOW_ACTIVATED) 2843 else if (desc == ELM_INTERFACE_ATSPI_WINDOW_EVENT_WINDOW_ACTIVATED)
2835 { 2844 type = ATSPI_WINDOW_EVENT_ACTIVATE;
2836 event_desc = "Activate"; 2845 else if (desc == ELM_INTERFACE_ATSPI_WINDOW_EVENT_WINDOW_MAXIMIZED)
2837 type = ATSPI_WINDOW_EVENT_ACTIVATE; 2846 type = ATSPI_WINDOW_EVENT_MAXIMIZE;
2838 } 2847 else if (desc == ELM_INTERFACE_ATSPI_WINDOW_EVENT_WINDOW_MINIMIZED)
2848 type = ATSPI_WINDOW_EVENT_MINIMIZE;
2849 else if (desc == ELM_INTERFACE_ATSPI_WINDOW_EVENT_WINDOW_RESTORED)
2850 type = ATSPI_WINDOW_EVENT_RESTORE;
2839 else 2851 else
2840 { 2852 return EINA_FALSE;
2841 WRN("ATSPI Window event not handled");
2842 return EINA_FALSE;
2843 }
2844 2853
2845 if (!STATE_TYPE_GET(_window_signal_broadcast_mask, type)) 2854 if (!STATE_TYPE_GET(_window_signal_broadcast_mask, type))
2846 return EINA_FALSE; 2855 return EINA_FALSE;
@@ -2851,9 +2860,9 @@ _window_signal_send(void *data, Eo *obj EINA_UNUSED, const Eo_Event_Description
2851 return EINA_FALSE; 2860 return EINA_FALSE;
2852 } 2861 }
2853 2862
2854 _object_signal_send(window, type, event_desc, 0, 0, "i", 0); 2863 _object_signal_send(window, type, "", 0, 0, "i", 0);
2855 2864
2856 DBG("signal sent Window:%s", event_desc); 2865 DBG("sent signal org.a11y.atspi.Window:%d", type);
2857 2866
2858 return EINA_TRUE; 2867 return EINA_TRUE;
2859} 2868}
diff --git a/src/lib/elm_interface_atspi_window.eo b/src/lib/elm_interface_atspi_window.eo
index 4d573618e..8c5c9b4b2 100644
--- a/src/lib/elm_interface_atspi_window.eo
+++ b/src/lib/elm_interface_atspi_window.eo
@@ -2,7 +2,11 @@ interface Elm_Interface_Atspi_Window ()
2{ 2{
3 events { 3 events {
4 window,created; /*@ Called when new window has been created. */ 4 window,created; /*@ Called when new window has been created. */
5 window,activated; /*@ Called when new window has been activated. (unfocused) */ 5 window,destroyed; /*@ Called when window has been destroyed. */
6 window,deactivated; /*@ Called when new window has been deactivated (unfocused). */ 6 window,activated; /*@ Called when window has been activated. (unfocused) */
7 window,deactivated; /*@ Called when window has been deactivated (unfocused). */
8 window,maximized; /* @ Called when window has been maximmized */
9 window,minimized; /* @ Called when window has been minimized */
10 window,restored; /* @ Called when window has been restored */
7 } 11 }
8} 12}
diff --git a/src/lib/elm_win.c b/src/lib/elm_win.c
index 8198a31af..cc7fb34e2 100644
--- a/src/lib/elm_win.c
+++ b/src/lib/elm_win.c
@@ -1043,6 +1043,9 @@ _elm_win_focus_in(Ecore_Evas *ee)
1043 edje_object_signal_emit(sd->frame_obj, "elm,action,focus", "elm"); 1043 edje_object_signal_emit(sd->frame_obj, "elm,action,focus", "elm");
1044 } 1044 }
1045 1045
1046 if (_elm_config->atspi_mode)
1047 eo_do(obj, eo_event_callback_call(ELM_INTERFACE_ATSPI_WINDOW_EVENT_WINDOW_ACTIVATED, NULL));
1048
1046 /* do nothing */ 1049 /* do nothing */
1047 /* else if (sd->img_obj) */ 1050 /* else if (sd->img_obj) */
1048 /* { */ 1051 /* { */
@@ -1072,6 +1075,9 @@ _elm_win_focus_out(Ecore_Evas *ee)
1072 /* access */ 1075 /* access */
1073 _elm_access_object_highlight_disable(evas_object_evas_get(obj)); 1076 _elm_access_object_highlight_disable(evas_object_evas_get(obj));
1074 1077
1078 if (_elm_config->atspi_mode)
1079 eo_do(obj, eo_event_callback_call(ELM_INTERFACE_ATSPI_WINDOW_EVENT_WINDOW_DEACTIVATED, NULL));
1080
1075 /* do nothing */ 1081 /* do nothing */
1076 /* if (sd->img_obj) */ 1082 /* if (sd->img_obj) */
1077 /* { */ 1083 /* { */
@@ -1263,9 +1269,17 @@ _elm_win_state_change(Ecore_Evas *ee)
1263 if (sd->withdrawn) 1269 if (sd->withdrawn)
1264 evas_object_smart_callback_call(obj, SIG_WITHDRAWN, NULL); 1270 evas_object_smart_callback_call(obj, SIG_WITHDRAWN, NULL);
1265 else if (sd->iconified) 1271 else if (sd->iconified)
1266 evas_object_smart_callback_call(obj, SIG_ICONIFIED, NULL); 1272 {
1273 evas_object_smart_callback_call(obj, SIG_ICONIFIED, NULL);
1274 if (_elm_config->atspi_mode)
1275 eo_do(obj, eo_event_callback_call(ELM_INTERFACE_ATSPI_WINDOW_EVENT_WINDOW_MINIMIZED, NULL));
1276 }
1267 else 1277 else
1268 evas_object_smart_callback_call(obj, SIG_NORMAL, NULL); 1278 {
1279 evas_object_smart_callback_call(obj, SIG_NORMAL, NULL);
1280 if (_elm_config->atspi_mode)
1281 eo_do(obj, eo_event_callback_call(ELM_INTERFACE_ATSPI_WINDOW_EVENT_WINDOW_RESTORED, NULL));
1282 }
1269 } 1283 }
1270 if (ch_sticky) 1284 if (ch_sticky)
1271 { 1285 {
@@ -1297,9 +1311,17 @@ _elm_win_state_change(Ecore_Evas *ee)
1297 if (ch_maximized) 1311 if (ch_maximized)
1298 { 1312 {
1299 if (sd->maximized) 1313 if (sd->maximized)
1300 evas_object_smart_callback_call(obj, SIG_MAXIMIZED, NULL); 1314 {
1315 evas_object_smart_callback_call(obj, SIG_MAXIMIZED, NULL);
1316 if (_elm_config->atspi_mode)
1317 eo_do(obj, eo_event_callback_call(ELM_INTERFACE_ATSPI_WINDOW_EVENT_WINDOW_MAXIMIZED, NULL));
1318 }
1301 else 1319 else
1302 evas_object_smart_callback_call(obj, SIG_UNMAXIMIZED, NULL); 1320 {
1321 evas_object_smart_callback_call(obj, SIG_UNMAXIMIZED, NULL);
1322 if (_elm_config->atspi_mode)
1323 eo_do(obj, eo_event_callback_call(ELM_INTERFACE_ATSPI_WINDOW_EVENT_WINDOW_RESTORED, NULL));
1324 }
1303 } 1325 }
1304 if (ch_profile) 1326 if (ch_profile)
1305 { 1327 {
@@ -1468,6 +1490,9 @@ _elm_win_evas_object_smart_show(Eo *obj, Elm_Win_Data *sd)
1468 TRAP(sd, show); 1490 TRAP(sd, show);
1469 1491
1470 if (sd->shot.info) _shot_handle(sd); 1492 if (sd->shot.info) _shot_handle(sd);
1493
1494 if (_elm_config->atspi_mode)
1495 eo_do(obj, eo_event_callback_call(ELM_INTERFACE_ATSPI_WINDOW_EVENT_WINDOW_CREATED, NULL));
1471} 1496}
1472 1497
1473EOLIAN static void 1498EOLIAN static void
@@ -1503,6 +1528,8 @@ _elm_win_evas_object_smart_hide(Eo *obj, Elm_Win_Data *sd)
1503 ecore_evas_hide(sd->pointer.ee); 1528 ecore_evas_hide(sd->pointer.ee);
1504#endif 1529#endif
1505 } 1530 }
1531 if (_elm_config->atspi_mode)
1532 eo_do(obj, eo_event_callback_call(ELM_INTERFACE_ATSPI_WINDOW_EVENT_WINDOW_DESTROYED, NULL));
1506} 1533}
1507 1534
1508static void 1535static void
@@ -1949,6 +1976,8 @@ _elm_win_delete_request(Ecore_Evas *ee)
1949 evas_object_ref(obj); 1976 evas_object_ref(obj);
1950 evas_object_smart_callback_call(obj, SIG_DELETE_REQUEST, NULL); 1977 evas_object_smart_callback_call(obj, SIG_DELETE_REQUEST, NULL);
1951 // FIXME: if above callback deletes - then the below will be invalid 1978 // FIXME: if above callback deletes - then the below will be invalid
1979 if (_elm_config->atspi_mode)
1980 eo_do(obj, eo_event_callback_call(ELM_INTERFACE_ATSPI_WINDOW_EVENT_WINDOW_DESTROYED, NULL));
1952 if (autodel) evas_object_del(obj); 1981 if (autodel) evas_object_del(obj);
1953 else sd->autodel_clear = NULL; 1982 else sd->autodel_clear = NULL;
1954 evas_object_unref(obj); 1983 evas_object_unref(obj);
@@ -2750,6 +2779,8 @@ _elm_win_frame_cb_close(void *data,
2750 evas_object_ref(win); 2779 evas_object_ref(win);
2751 evas_object_smart_callback_call(win, SIG_DELETE_REQUEST, NULL); 2780 evas_object_smart_callback_call(win, SIG_DELETE_REQUEST, NULL);
2752 // FIXME: if above callback deletes - then the below will be invalid 2781 // FIXME: if above callback deletes - then the below will be invalid
2782 if (_elm_config->atspi_mode)
2783 eo_do(obj, eo_event_callback_call(ELM_INTERFACE_ATSPI_WINDOW_EVENT_WINDOW_DESTROYED, NULL));
2753 if (autodel) evas_object_del(win); 2784 if (autodel) evas_object_del(win);
2754 else sd->autodel_clear = NULL; 2785 else sd->autodel_clear = NULL;
2755 evas_object_unref(win); 2786 evas_object_unref(win);
@@ -3696,7 +3727,6 @@ _elm_win_finalize_internal(Eo *obj, Elm_Win_Data *sd, const char *name, Elm_Win_
3696 if (_elm_config->atspi_mode == ELM_ATSPI_MODE_ON) 3727 if (_elm_config->atspi_mode == ELM_ATSPI_MODE_ON)
3697 { 3728 {
3698 elm_interface_atspi_accessible_children_changed_added_signal_emit(_elm_atspi_bridge_root_get(), obj); 3729 elm_interface_atspi_accessible_children_changed_added_signal_emit(_elm_atspi_bridge_root_get(), obj);
3699 eo_do(obj, eo_event_callback_call(ELM_INTERFACE_ATSPI_WINDOW_EVENT_WINDOW_CREATED, NULL));
3700 } 3730 }
3701 3731
3702 evas_object_show(sd->edje); 3732 evas_object_show(sd->edje);