summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLukasz Stanislawski <l.stanislaws@samsung.com>2014-06-25 11:56:36 +0200
committerLukasz Stanislawski <l.stanislaws@samsung.com>2014-07-02 14:14:49 +0200
commit99a32ea4bc83e1bcd4d19bd47ab6434ac142e76a (patch)
tree9f8f7bb29a71f8dca9ebcada423285e438eca62c
parent556e45732db3e7bff2fb88181b56f9751bdda01d (diff)
atspi: unify atspi initialization
commit removes internal elm_atspi_init function and moves atspi_app_object creation to atspi_bridge.
-rw-r--r--src/lib/elm_atspi_app_object.c29
-rw-r--r--src/lib/elm_atspi_bridge.c18
-rw-r--r--src/lib/elm_main.c3
-rw-r--r--src/lib/elm_priv.h5
-rw-r--r--src/lib/elm_win.c4
5 files changed, 17 insertions, 42 deletions
diff --git a/src/lib/elm_atspi_app_object.c b/src/lib/elm_atspi_app_object.c
index 8e8576a52..6313250c8 100644
--- a/src/lib/elm_atspi_app_object.c
+++ b/src/lib/elm_atspi_app_object.c
@@ -13,8 +13,6 @@
13#include "elm_atspi_app_object.eo.h" 13#include "elm_atspi_app_object.eo.h"
14 14
15extern Eina_List *_elm_win_list; 15extern Eina_List *_elm_win_list;
16static Eo *_atspi_root;
17static int _init;
18 16
19typedef struct _Elm_Atspi_App_Object_Data Elm_Atspi_App_Object_Data; 17typedef struct _Elm_Atspi_App_Object_Data Elm_Atspi_App_Object_Data;
20 18
@@ -71,31 +69,4 @@ _elm_atspi_app_object_elm_interface_atspi_accessible_role_get(Eo *obj EINA_UNUSE
71 return ELM_ATSPI_ROLE_APPLICATION; 69 return ELM_ATSPI_ROLE_APPLICATION;
72} 70}
73 71
74EAPI void
75_elm_atspi_init(void)
76{
77 if (!_init)
78 {
79 _atspi_root = eo_add(ELM_ATSPI_APP_OBJECT_CLASS, NULL);
80 _init = 1;
81 }
82}
83
84EAPI void
85_elm_atspi_shutdown(void)
86{
87 if (_init)
88 {
89 eo_unref(_atspi_root);
90 _atspi_root = NULL;
91 _init = 0;
92 }
93}
94
95EAPI Eo*
96_elm_atspi_root_get(void)
97{
98 return _atspi_root;
99}
100
101#include "elm_atspi_app_object.eo.c" 72#include "elm_atspi_app_object.eo.c"
diff --git a/src/lib/elm_atspi_bridge.c b/src/lib/elm_atspi_bridge.c
index bdfea92b0..16be16617 100644
--- a/src/lib/elm_atspi_bridge.c
+++ b/src/lib/elm_atspi_bridge.c
@@ -18,6 +18,8 @@
18#include "elm_priv.h" 18#include "elm_priv.h"
19#include <assert.h> 19#include <assert.h>
20 20
21#include "elm_atspi_app_object.eo.h"
22
21#include "elm_interface_atspi_accessible.h" 23#include "elm_interface_atspi_accessible.h"
22#include "elm_interface_atspi_accessible.eo.h" 24#include "elm_interface_atspi_accessible.eo.h"
23#include "elm_interface_atspi_component.eo.h" 25#include "elm_interface_atspi_component.eo.h"
@@ -3257,14 +3259,12 @@ _elm_atspi_bridge_init(void)
3257 Eldbus_Message *msg; 3259 Eldbus_Message *msg;
3258 Eldbus_Connection *session_bus; 3260 Eldbus_Connection *session_bus;
3259 3261
3260 if (!_init_count && (_elm_config->atspi_mode != ELM_ATSPI_MODE_OFF)) 3262 if (!_init_count)
3261 { 3263 {
3262 _elm_atspi_init(); 3264 _root = eo_add(ELM_ATSPI_APP_OBJECT_CLASS, NULL);
3263
3264 _root = _elm_atspi_root_get();
3265 if (!_root) 3265 if (!_root)
3266 { 3266 {
3267 ERR("Unable to get root object"); 3267 ERR("Unable to create root object");
3268 return; 3268 return;
3269 } 3269 }
3270 3270
@@ -3282,12 +3282,18 @@ _elm_atspi_bridge_init(void)
3282 } 3282 }
3283} 3283}
3284 3284
3285EAPI Eo*
3286_elm_atspi_bridge_root_get(void)
3287{
3288 return _root;
3289}
3290
3285void 3291void
3286_elm_atspi_bridge_shutdown(void) 3292_elm_atspi_bridge_shutdown(void)
3287{ 3293{
3288 if (_init_count) 3294 if (_init_count)
3289 { 3295 {
3290 _elm_atspi_shutdown(); 3296 eo_unref(_root);
3291 3297
3292 if (_cache_update_idler) 3298 if (_cache_update_idler)
3293 ecore_idler_del(_cache_update_idler); 3299 ecore_idler_del(_cache_update_idler);
diff --git a/src/lib/elm_main.c b/src/lib/elm_main.c
index 9ca9a03bb..feda8872d 100644
--- a/src/lib/elm_main.c
+++ b/src/lib/elm_main.c
@@ -310,7 +310,8 @@ elm_init(int argc,
310 system_handlers[0] = ecore_event_handler_add(ECORE_EVENT_MEMORY_STATE, _sys_memory_changed, NULL); 310 system_handlers[0] = ecore_event_handler_add(ECORE_EVENT_MEMORY_STATE, _sys_memory_changed, NULL);
311 system_handlers[1] = ecore_event_handler_add(ECORE_EVENT_LOCALE_CHANGED, _sys_lang_changed, NULL); 311 system_handlers[1] = ecore_event_handler_add(ECORE_EVENT_LOCALE_CHANGED, _sys_lang_changed, NULL);
312 312
313 _elm_atspi_bridge_init(); 313 if (_elm_config->atspi_mode != ELM_ATSPI_MODE_OFF)
314 _elm_atspi_bridge_init();
314 315
315 return _elm_init_count; 316 return _elm_init_count;
316} 317}
diff --git a/src/lib/elm_priv.h b/src/lib/elm_priv.h
index c9994df29..e84bad5ee 100644
--- a/src/lib/elm_priv.h
+++ b/src/lib/elm_priv.h
@@ -342,10 +342,7 @@ struct _Elm_Datetime_Module_Data
342 Elm_Datetime_Field_Type field_type); 342 Elm_Datetime_Field_Type field_type);
343}; 343};
344 344
345void _elm_atspi_init(void); 345Eo *_elm_atspi_bridge_root_get(void);
346void _elm_atspi_shutdown(void);
347Eo *_elm_atspi_root_get(void);
348
349void _elm_atspi_bridge_init(void); 346void _elm_atspi_bridge_init(void);
350void _elm_atspi_bridge_shutdown(void); 347void _elm_atspi_bridge_shutdown(void);
351 348
diff --git a/src/lib/elm_win.c b/src/lib/elm_win.c
index 7e3be34d1..11ca2d35a 100644
--- a/src/lib/elm_win.c
+++ b/src/lib/elm_win.c
@@ -3335,7 +3335,7 @@ _elm_win_constructor(Eo *obj, Elm_Win_Data *sd, const char *name, Elm_Win_Type t
3335 if (_elm_config->atspi_mode == ELM_ATSPI_MODE_ON) 3335 if (_elm_config->atspi_mode == ELM_ATSPI_MODE_ON)
3336 { 3336 {
3337 eo_do(obj, elm_interface_atspi_accessible_role_set(ELM_ATSPI_ROLE_WINDOW)); 3337 eo_do(obj, elm_interface_atspi_accessible_role_set(ELM_ATSPI_ROLE_WINDOW));
3338 elm_interface_atspi_accessible_children_changed_added_signal_emit(_elm_atspi_root_get(), obj); 3338 elm_interface_atspi_accessible_children_changed_added_signal_emit(_elm_atspi_bridge_root_get(), obj);
3339 eo_do(obj, eo_event_callback_call(ELM_INTERFACE_ATSPI_WINDOW_EVENT_WINDOW_CREATED, NULL)); 3339 eo_do(obj, eo_event_callback_call(ELM_INTERFACE_ATSPI_WINDOW_EVENT_WINDOW_CREATED, NULL));
3340 } 3340 }
3341 3341
@@ -4819,7 +4819,7 @@ EOLIAN static Eo*
4819_elm_win_elm_interface_atspi_accessible_parent_get(Eo *obj EINA_UNUSED, Elm_Win_Data *sd EINA_UNUSED) 4819_elm_win_elm_interface_atspi_accessible_parent_get(Eo *obj EINA_UNUSED, Elm_Win_Data *sd EINA_UNUSED)
4820{ 4820{
4821 // attach all kinds of windows directly to ATSPI application root object 4821 // attach all kinds of windows directly to ATSPI application root object
4822 return _elm_atspi_root_get(); 4822 return _elm_atspi_bridge_root_get();
4823} 4823}
4824 4824
4825#include "elm_win.eo.c" 4825#include "elm_win.eo.c"