summaryrefslogtreecommitdiff
path: root/src/lib/ecore_evas
diff options
context:
space:
mode:
authorCedric Bail <cedric@osg.samsung.com>2018-04-02 14:55:57 -0700
committerCedric Bail <cedric@osg.samsung.com>2018-04-02 15:12:31 -0700
commita44697c37a304c0d4d574b6772775c6936869e24 (patch)
treef70f6c1e2056d44bf5c0240e3b850c4c6f948a1b /src/lib/ecore_evas
parent94433af83a0a0560df32d47d7f48a136b16e0d80 (diff)
ecore_evas: refactor logic for creating Ecore_Evas.
Diffstat (limited to 'src/lib/ecore_evas')
-rw-r--r--src/lib/ecore_evas/ecore_evas.c49
-rw-r--r--src/lib/ecore_evas/ecore_evas_private.h3
2 files changed, 46 insertions, 6 deletions
diff --git a/src/lib/ecore_evas/ecore_evas.c b/src/lib/ecore_evas/ecore_evas.c
index 8e90539d59..9a9fbac69c 100644
--- a/src/lib/ecore_evas/ecore_evas.c
+++ b/src/lib/ecore_evas/ecore_evas.c
@@ -3746,12 +3746,7 @@ ecore_evas_sub_ecore_evas_list_get(const Ecore_Evas *ee)
3746EAPI void 3746EAPI void
3747ecore_evas_input_event_register(Ecore_Evas *ee) 3747ecore_evas_input_event_register(Ecore_Evas *ee)
3748{ 3748{
3749 ecore_event_window_register(ee->prop.window, ee, ee->evas, 3749 ecore_evas_done(ee, EINA_FALSE);
3750 (Ecore_Event_Mouse_Move_Cb)_ecore_evas_mouse_move_process,
3751 (Ecore_Event_Multi_Move_Cb)_ecore_evas_mouse_multi_move_process,
3752 (Ecore_Event_Multi_Down_Cb)_ecore_evas_mouse_multi_down_process,
3753 (Ecore_Event_Multi_Up_Cb)_ecore_evas_mouse_multi_up_process);
3754 _ecore_event_window_direct_cb_set((Ecore_Window)ee, _ecore_evas_input_direct_cb);
3755} 3750}
3756 3751
3757EAPI void 3752EAPI void
@@ -5089,3 +5084,45 @@ ecore_evas_callback_device_mouse_in_set(Ecore_Evas *ee,
5089 IFE; 5084 IFE;
5090 ee->func.fn_device_mouse_in = func; 5085 ee->func.fn_device_mouse_in = func;
5091} 5086}
5087
5088EAPI Evas *
5089ecore_evas_evas_new(Ecore_Evas *ee, int w, int h)
5090{
5091 Evas *e;
5092
5093 if (ee->evas) return ee->evas;
5094
5095 e = evas_new();
5096 if (!e) return NULL;
5097
5098 ee->evas = e;
5099 evas_data_attach_set(e, ee);
5100
5101 if (ECORE_EVAS_PORTRAIT(ee))
5102 {
5103 evas_output_size_set(e, w, h);
5104 evas_output_viewport_set(e, 0, 0, w, h);
5105 }
5106 else
5107 {
5108 evas_output_size_set(e, h, w);
5109 evas_output_viewport_set(e, 0, 0, h, w);
5110 }
5111
5112 return e;
5113}
5114
5115EAPI void
5116ecore_evas_done(Ecore_Evas *ee, Eina_Bool single_window)
5117{
5118 _ecore_evas_register(ee);
5119 ecore_event_window_register(ee->prop.window, ee, ee->evas,
5120 (Ecore_Event_Mouse_Move_Cb)_ecore_evas_mouse_move_process,
5121 (Ecore_Event_Multi_Move_Cb)_ecore_evas_mouse_multi_move_process,
5122 (Ecore_Event_Multi_Down_Cb)_ecore_evas_mouse_multi_down_process,
5123 (Ecore_Event_Multi_Up_Cb)_ecore_evas_mouse_multi_up_process);
5124 _ecore_event_window_direct_cb_set(ee->prop.window, _ecore_evas_input_direct_cb);
5125
5126 if (single_window)
5127 evas_event_feed_mouse_in(ee->evas, (unsigned int)((unsigned long long)(ecore_time_get() * 1000.0) & 0xffffffff), NULL);
5128}
diff --git a/src/lib/ecore_evas/ecore_evas_private.h b/src/lib/ecore_evas/ecore_evas_private.h
index 14cfae791d..3dbd61ea62 100644
--- a/src/lib/ecore_evas/ecore_evas_private.h
+++ b/src/lib/ecore_evas/ecore_evas_private.h
@@ -487,6 +487,9 @@ Eina_Bool _ecore_evas_cursors_init(Ecore_Evas *ee);
487EAPI void ecore_evas_render_wait(Ecore_Evas *ee); 487EAPI void ecore_evas_render_wait(Ecore_Evas *ee);
488EAPI Eina_Bool ecore_evas_render(Ecore_Evas *ee); 488EAPI Eina_Bool ecore_evas_render(Ecore_Evas *ee);
489 489
490EAPI Evas *ecore_evas_evas_new(Ecore_Evas *ee, int w, int h);
491EAPI void ecore_evas_done(Ecore_Evas *ee, Eina_Bool single_window);
492
490static inline Eina_Bool 493static inline Eina_Bool
491ecore_evas_render_prepare(Ecore_Evas *ee) 494ecore_evas_render_prepare(Ecore_Evas *ee)
492{ 495{