summaryrefslogtreecommitdiff
path: root/src/lib/ecore_evas
diff options
context:
space:
mode:
authorCedric Bail <cedric@osg.samsung.com>2018-04-02 15:11:44 -0700
committerCedric Bail <cedric@osg.samsung.com>2018-04-02 15:12:31 -0700
commit1ca196fbcd5aea30cf1d97190c7525262e9e4664 (patch)
treedd7a0e4cddedcb2059aceee37bf0fe352e46833b /src/lib/ecore_evas
parenta44697c37a304c0d4d574b6772775c6936869e24 (diff)
ecore_evas: add a hook interceptor for evas_new, will be useful for a portable Exactness.
Diffstat (limited to 'src/lib/ecore_evas')
-rw-r--r--src/lib/ecore_evas/Ecore_Evas.h16
-rw-r--r--src/lib/ecore_evas/ecore_evas.c11
2 files changed, 25 insertions, 2 deletions
diff --git a/src/lib/ecore_evas/Ecore_Evas.h b/src/lib/ecore_evas/Ecore_Evas.h
index 1039007b71..e6cc85f5a6 100644
--- a/src/lib/ecore_evas/Ecore_Evas.h
+++ b/src/lib/ecore_evas/Ecore_Evas.h
@@ -2093,7 +2093,7 @@ EAPI void *ecore_evas_data_get(const Ecore_Evas *ee, const char *key);
2093 */ 2093 */
2094EAPI void ecore_evas_data_set(Ecore_Evas *ee, const char *key, const void *data); 2094EAPI void ecore_evas_data_set(Ecore_Evas *ee, const char *key, const void *data);
2095 2095
2096/** 2096 /**
2097 * @brief Sets a callback for Ecore_Evas resize events. 2097 * @brief Sets a callback for Ecore_Evas resize events.
2098 * 2098 *
2099 * @param ee The Ecore_Evas to set callbacks on 2099 * @param ee The Ecore_Evas to set callbacks on
@@ -3185,6 +3185,20 @@ EAPI Evas_Object *ecore_evas_vnc_start(Ecore_Evas *ee, const char *addr, int por
3185#endif 3185#endif
3186 3186
3187/** 3187/**
3188 * @brief Sets a callback for building new Evas.
3189 *
3190 * @param ee The Ecore_Evas to set callbacks on
3191 * @param func The function to call
3192 *
3193 * A call to this function will set a callback on an Ecore_Evas, causing
3194 * @p func to be called whenever a new Ecore_Evas is created.
3195 *
3196 * @warning If and when this function is called depends on the underlying
3197 * windowing system.
3198 */
3199EAPI void ecore_evas_callback_new_set(Evas *(*func)(int w, int h));
3200
3201/**
3188 * @defgroup Ecore_Evas_Ews Ecore_Evas Single Process Windowing System. 3202 * @defgroup Ecore_Evas_Ews Ecore_Evas Single Process Windowing System.
3189 * @ingroup Ecore_Evas_Group 3203 * @ingroup Ecore_Evas_Group
3190 * 3204 *
diff --git a/src/lib/ecore_evas/ecore_evas.c b/src/lib/ecore_evas/ecore_evas.c
index 9a9fbac69c..50eb36dfb9 100644
--- a/src/lib/ecore_evas/ecore_evas.c
+++ b/src/lib/ecore_evas/ecore_evas.c
@@ -5085,6 +5085,14 @@ ecore_evas_callback_device_mouse_in_set(Ecore_Evas *ee,
5085 ee->func.fn_device_mouse_in = func; 5085 ee->func.fn_device_mouse_in = func;
5086} 5086}
5087 5087
5088static Evas *(*replacement_new)(int w, int h) = NULL;
5089
5090EAPI void
5091ecore_evas_callback_new_set(Evas *(*func)(int w, int h))
5092{
5093 replacement_new = func;
5094}
5095
5088EAPI Evas * 5096EAPI Evas *
5089ecore_evas_evas_new(Ecore_Evas *ee, int w, int h) 5097ecore_evas_evas_new(Ecore_Evas *ee, int w, int h)
5090{ 5098{
@@ -5092,7 +5100,8 @@ ecore_evas_evas_new(Ecore_Evas *ee, int w, int h)
5092 5100
5093 if (ee->evas) return ee->evas; 5101 if (ee->evas) return ee->evas;
5094 5102
5095 e = evas_new(); 5103 if (replacement_new) e = replacement_new(w, h);
5104 else e = evas_new();
5096 if (!e) return NULL; 5105 if (!e) return NULL;
5097 5106
5098 ee->evas = e; 5107 ee->evas = e;