summaryrefslogtreecommitdiff
path: root/src/lib/ecore_evas
diff options
context:
space:
mode:
authorJiyoun Park <jijibe99@gmail.com>2013-02-15 09:32:40 +0000
committerJiyoun Park <jijibe99@gmail.com>2013-02-15 09:32:40 +0000
commitc5a8a6b5ff3da760fdd5018fdfba05cc2b82588e (patch)
tree021977392dcc128263818e9c118dfd8ae94e25b4 /src/lib/ecore_evas
parent98854667875ef83fc18a393a5d26b30603984b97 (diff)
Add infrastructure to handle message between ecore and parent ecore in Ecore_Evas
I add new example related with this. (ecore_evas_extn_socket & plug example) ecore extn use this infrasturcture, server app and client app can communicate each other later, this can be used to contorl access message SVN revision: 83942
Diffstat (limited to 'src/lib/ecore_evas')
-rw-r--r--src/lib/ecore_evas/Ecore_Evas.h67
-rw-r--r--src/lib/ecore_evas/ecore_evas.c55
-rw-r--r--src/lib/ecore_evas/ecore_evas_buffer.c40
-rw-r--r--src/lib/ecore_evas/ecore_evas_ews.c4
-rw-r--r--src/lib/ecore_evas/ecore_evas_private.h4
5 files changed, 168 insertions, 2 deletions
diff --git a/src/lib/ecore_evas/Ecore_Evas.h b/src/lib/ecore_evas/Ecore_Evas.h
index 2393e313ee..839d7a6d50 100644
--- a/src/lib/ecore_evas/Ecore_Evas.h
+++ b/src/lib/ecore_evas/Ecore_Evas.h
@@ -683,6 +683,73 @@ EAPI void ecore_evas_window_available_profiles_set(Ecore_Evas *ee, const
683 */ 683 */
684EAPI Eina_Bool ecore_evas_window_available_profiles_get(Ecore_Evas *ee, char ***profiles, unsigned int *count); 684EAPI Eina_Bool ecore_evas_window_available_profiles_get(Ecore_Evas *ee, char ***profiles, unsigned int *count);
685/** 685/**
686 * @brief Send message to parent ecore
687 *
688 * @param ee The Ecore_Evas to set
689 * @param msg_domain The domain of message
690 * @param msg_id The id of message
691 * @param data The data of message
692 * @param size The size of message data
693 *
694 * @warning Support for this depends on the underlying windowing system.
695 * @since 1.8.0
696 *
697 * @see ecore_evas_msg_send()
698 * @see ecore_evas_callback_msg_parent_handle_set()
699 * @see eecore_evas_callback_msg_handle_set()
700 *
701 * This is a list of examples of these functions:
702 * @li @ref ecore_evas_extn_socket_example
703 * @li @ref ecore_evas_extn_plug_example
704 */
705EAPI void ecore_evas_msg_parent_send(Ecore_Evas *ee, int msg_domain, int msg_id, void *data, int size);
706/**
707 * @brief Send message to child ecore
708 *
709 * @param ee The Ecore_Evas to set
710 * @param msg_domain The domain of message
711 * @param msg_id The id of message
712 * @param data The data of message
713 * @param size The size of message data
714 *
715 * @warning Support for this depends on the underlying windowing system.
716 * @since 1.8.0
717 *
718 * @see ecore_evas_msg_parent_send()
719 * @see ecore_evas_callback_msg_parent_handle_set()
720 * @see eecore_evas_callback_msg_handle_set()
721 */
722EAPI void ecore_evas_msg_send(Ecore_Evas *ee, int msg_domain, int msg_id, void *data, int size);
723/**
724 * Set a callback for parent Ecore_Evas message.
725 *
726 * @param ee The Ecore_Evas to set callbacks on
727 * @param func_parent_handle The handle to be called when message arive.
728 *
729 * @warning Support for this depends on the underlying windowing system.
730 * @since 1.8.0
731 *
732 * @see ecore_evas_msg_parent_send()
733 * @see ecore_evas_msg_send()
734 * @see eecore_evas_callback_msg_handle_set()
735 */
736EAPI void ecore_evas_callback_msg_parent_handle_set(Ecore_Evas *ee, void (*func_parent_handle)(Ecore_Evas *ee, int msg_domain, int msg_id, void *data, int size));
737/**
738 * Set a callback for child Ecore_Evas message.
739 *
740 * @param ee The Ecore_Evas to set callbacks on
741 * @param func_handle The handle to be called when message arive
742 *
743 * @warning Support for this depends on the underlying windowing system.
744 * @since 1.8.0
745 *
746 * @see ecore_evas_msg_parent_send()
747 * @see ecore_evas_msg_send()
748 * @see ecore_evas_callback_msg_parent_handle_set()
749 */
750EAPI void ecore_evas_callback_msg_handle_set(Ecore_Evas *ee, void (*func_handle)(Ecore_Evas *ee, int msg_domain, int msg_id, void *data, int size));
751
752/**
686 * @brief Move an Ecore_Evas. 753 * @brief Move an Ecore_Evas.
687 * 754 *
688 * @param ee The Ecore_Evas to move 755 * @param ee The Ecore_Evas to move
diff --git a/src/lib/ecore_evas/ecore_evas.c b/src/lib/ecore_evas/ecore_evas.c
index daa12ea9c3..15b95736f3 100644
--- a/src/lib/ecore_evas/ecore_evas.c
+++ b/src/lib/ecore_evas/ecore_evas.c
@@ -2192,6 +2192,61 @@ ecore_evas_manual_render(Ecore_Evas *ee)
2192} 2192}
2193 2193
2194EAPI void 2194EAPI void
2195ecore_evas_msg_parent_send(Ecore_Evas *ee, int msg_domain, int msg_id, void *data, int size)
2196{
2197 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
2198 {
2199 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
2200 "ecore_evas_msg_parent_send");
2201 return;
2202 }
2203 DBG("Msg(to parent): ee=%p msg_domain=%d msg_id=%d size=%d", ee, msg_domain, msg_id, size);
2204 IFC(ee, fn_msg_parent_send) (ee, msg_domain, msg_id, data, size);
2205 IFE;
2206}
2207
2208EAPI void
2209ecore_evas_msg_send(Ecore_Evas *ee, int msg_domain, int msg_id, void *data, int size)
2210{
2211 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
2212 {
2213 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
2214 "ecore_evas_msg_send");
2215 return;
2216 }
2217 DBG("Msg: ee=%p msg_domain=%d msg_id=%d size=%d", ee, msg_domain, msg_id, size);
2218 IFC(ee, fn_msg_send) (ee, msg_domain, msg_id, data, size);
2219 IFE;
2220}
2221
2222EAPI void
2223ecore_evas_callback_msg_parent_handle_set(Ecore_Evas *ee, void (*func_parent_handle)(Ecore_Evas *ee, int msg_domain, int msg_id, void *data, int size))
2224{
2225 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
2226 {
2227 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
2228 "ecore_evas_msg_parent_handle");
2229 return;
2230 }
2231 DBG("Msg Parent handle: ee=%p", ee);
2232 ee->func.fn_msg_parent_handle = func_parent_handle;
2233}
2234
2235EAPI void
2236ecore_evas_callback_msg_handle_set(Ecore_Evas *ee, void (*func_handle)(Ecore_Evas *ee, int msg_domain, int msg_id, void *data, int size))
2237{
2238 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
2239 {
2240 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
2241 "ecore_evas_msg_handle");
2242 return;
2243 }
2244 DBG("Msg handle: ee=%p", ee);
2245 ee->func.fn_msg_handle = func_handle;
2246}
2247
2248
2249EAPI void
2195ecore_evas_comp_sync_set(Ecore_Evas *ee, Eina_Bool do_sync) 2250ecore_evas_comp_sync_set(Ecore_Evas *ee, Eina_Bool do_sync)
2196{ 2251{
2197 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS)) 2252 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
diff --git a/src/lib/ecore_evas/ecore_evas_buffer.c b/src/lib/ecore_evas/ecore_evas_buffer.c
index 96e5fb6cfe..c76af25ada 100644
--- a/src/lib/ecore_evas/ecore_evas_buffer.c
+++ b/src/lib/ecore_evas/ecore_evas_buffer.c
@@ -474,6 +474,42 @@ _ecore_evas_buffer_profile_set(Ecore_Evas *ee, const char *profile)
474 } 474 }
475} 475}
476 476
477static void
478_ecore_evas_buffer_msg_parent_send(Ecore_Evas *ee, int msg_domain, int msg_id, void *data, int size)
479{
480 Ecore_Evas *parent_ee = NULL;
481 parent_ee = ecore_evas_data_get(ee, "parent");
482
483 if (parent_ee)
484 {
485 if (parent_ee->func.fn_msg_parent_handle)
486 parent_ee ->func.fn_msg_parent_handle(parent_ee, msg_domain, msg_id, data, size);
487 }
488 else
489 {
490 if (ee->func.fn_msg_parent_handle)
491 ee ->func.fn_msg_parent_handle(ee, msg_domain, msg_id, data, size);
492 }
493}
494
495static void
496_ecore_evas_buffer_msg_send(Ecore_Evas *ee, int msg_domain, int msg_id, void *data, int size)
497{
498 Ecore_Evas *child_ee = NULL;
499 child_ee = ecore_evas_data_get(ee, "child");
500
501 if (!child_ee)
502 {
503 if (child_ee->func.fn_msg_handle)
504 child_ee->func.fn_msg_handle(child_ee, msg_domain, msg_id, data, size);
505 }
506 else
507 {
508 if (ee->func.fn_msg_handle)
509 ee->func.fn_msg_handle(ee, msg_domain, msg_id, data, size);
510 }
511}
512
477static Ecore_Evas_Engine_Func _ecore_buffer_engine_func = 513static Ecore_Evas_Engine_Func _ecore_buffer_engine_func =
478{ 514{
479 _ecore_evas_buffer_free, 515 _ecore_evas_buffer_free,
@@ -534,7 +570,9 @@ static Ecore_Evas_Engine_Func _ecore_buffer_engine_func =
534 570
535 _ecore_evas_buffer_render, 571 _ecore_evas_buffer_render,
536 NULL, // screen_geometry_get 572 NULL, // screen_geometry_get
537 NULL // screen_dpi_get 573 NULL, // screen_dpi_get
574 _ecore_evas_buffer_msg_parent_send,
575 _ecore_evas_buffer_msg_send
538}; 576};
539 577
540static void * 578static void *
diff --git a/src/lib/ecore_evas/ecore_evas_ews.c b/src/lib/ecore_evas/ecore_evas_ews.c
index 4f52ae2cba..936b70a415 100644
--- a/src/lib/ecore_evas/ecore_evas_ews.c
+++ b/src/lib/ecore_evas/ecore_evas_ews.c
@@ -697,7 +697,9 @@ static const Ecore_Evas_Engine_Func _ecore_ews_engine_func =
697 697
698 _ecore_evas_ews_render, 698 _ecore_evas_ews_render,
699 _ecore_evas_ews_screen_geometry_get, 699 _ecore_evas_ews_screen_geometry_get,
700 NULL // screen_dpi_get 700 NULL, // screen_dpi_get
701 NULL,
702 NULL // msg_send
701}; 703};
702 704
703void 705void
diff --git a/src/lib/ecore_evas/ecore_evas_private.h b/src/lib/ecore_evas/ecore_evas_private.h
index f9c208b23d..793461fe73 100644
--- a/src/lib/ecore_evas/ecore_evas_private.h
+++ b/src/lib/ecore_evas/ecore_evas_private.h
@@ -122,6 +122,8 @@ struct _Ecore_Evas_Engine_Func
122 int (*fn_render) (Ecore_Evas *ee); 122 int (*fn_render) (Ecore_Evas *ee);
123 void (*fn_screen_geometry_get) (const Ecore_Evas *ee, int *x, int *y, int *w, int *h); 123 void (*fn_screen_geometry_get) (const Ecore_Evas *ee, int *x, int *y, int *w, int *h);
124 void (*fn_screen_dpi_get) (const Ecore_Evas *ee, int *xdpi, int *ydpi); 124 void (*fn_screen_dpi_get) (const Ecore_Evas *ee, int *xdpi, int *ydpi);
125 void (*fn_msg_parent_send) (Ecore_Evas *ee, int maj, int min, void *data, int size);
126 void (*fn_msg_send) (Ecore_Evas *ee, int maj, int min, void *data, int size);
125}; 127};
126 128
127struct _Ecore_Evas_Interface 129struct _Ecore_Evas_Interface
@@ -295,6 +297,8 @@ struct _Ecore_Evas
295 void (*fn_post_render) (Ecore_Evas *ee); 297 void (*fn_post_render) (Ecore_Evas *ee);
296 void (*fn_pre_free) (Ecore_Evas *ee); 298 void (*fn_pre_free) (Ecore_Evas *ee);
297 void (*fn_state_change) (Ecore_Evas *ee); 299 void (*fn_state_change) (Ecore_Evas *ee);
300 void (*fn_msg_parent_handle) (Ecore_Evas *ee, int maj, int min, void *data, int size);
301 void (*fn_msg_handle) (Ecore_Evas *ee, int maj, int min, void *data, int size);
298 } func; 302 } func;
299 303
300 Ecore_Evas_Engine engine; 304 Ecore_Evas_Engine engine;