summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcel Hollerbach <mail@marcel-hollerbach.de>2018-06-25 06:57:08 -0400
committerMike Blumenkrantz <zmike@samsung.com>2018-06-25 06:57:08 -0400
commitef5c93d173e9e3f5fdc5844651b51a481b8bac60 (patch)
treec4ef52ebe7ddd079ef9b85a7c15914a6026657d9
parent73050511977928524c23b8bff34c519aad8235ab (diff)
elm_web: convert the enum fields correctly, as previously done
Summary: ensure that everything stays in the allowed and previously used ranges. The enums that are passed here are not equivalent. Depends on D6383 Reviewers: devilhorns, zmike Reviewed By: zmike Subscribers: cedric, #committers, zmike Tags: #efl Differential Revision: https://phab.enlightenment.org/D6384
-rw-r--r--src/lib/elementary/elm_web2.c38
1 files changed, 36 insertions, 2 deletions
diff --git a/src/lib/elementary/elm_web2.c b/src/lib/elementary/elm_web2.c
index 35360c40f6..8fb606c2d4 100644
--- a/src/lib/elementary/elm_web2.c
+++ b/src/lib/elementary/elm_web2.c
@@ -157,16 +157,50 @@ elm_web_window_features_region_get(const Elm_Web_Window_Features *wf,
157 ewm.window_features_region_get(wf, x, y, w, h); 157 ewm.window_features_region_get(wf, x, y, w, h);
158} 158}
159 159
160
161static inline void
162_convert_web_zoom_mode(Elm_Web_Zoom_Mode *legacy_mode, Efl_Ui_Zoom_Mode *mode, Eina_Bool to_legacy)
163{
164 #define CONVERT(LEGACY_MODE, NEW_MODE) \
165 if (to_legacy && *mode == NEW_MODE) \
166 { \
167 *legacy_mode =LEGACY_MODE; \
168 return; \
169 } \
170 if (!to_legacy && *legacy_mode == LEGACY_MODE) \
171 { \
172 *mode = NEW_MODE; \
173 return; \
174 } \
175
176 CONVERT(ELM_WEB_ZOOM_MODE_MANUAL, EFL_UI_ZOOM_MODE_MANUAL)
177 CONVERT(ELM_WEB_ZOOM_MODE_AUTO_FIT, EFL_UI_ZOOM_MODE_AUTO_FIT)
178 CONVERT(ELM_WEB_ZOOM_MODE_AUTO_FILL, EFL_UI_ZOOM_MODE_AUTO_FILL)
179 CONVERT(ELM_WEB_ZOOM_MODE_LAST, EFL_UI_ZOOM_MODE_LAST)
180 CONVERT(ELM_WEB_ZOOM_MODE_LAST, EFL_UI_ZOOM_MODE_AUTO_FIT_IN)
181
182 #undef CONVERT
183}
184
160EAPI void 185EAPI void
161elm_web_zoom_mode_set(Evas_Object *obj, Elm_Web_Zoom_Mode mode) 186elm_web_zoom_mode_set(Evas_Object *obj, Elm_Web_Zoom_Mode mode)
162{ 187{
163 efl_ui_zoom_mode_set(obj, mode); 188 Efl_Ui_Zoom_Mode new_mode;
189
190 _convert_web_zoom_mode(&mode, &new_mode, EINA_FALSE);
191
192 efl_ui_zoom_mode_set(obj, new_mode);
164} 193}
165 194
166EAPI Elm_Web_Zoom_Mode 195EAPI Elm_Web_Zoom_Mode
167elm_web_zoom_mode_get(const Evas_Object *obj) 196elm_web_zoom_mode_get(const Evas_Object *obj)
168{ 197{
169 return efl_ui_zoom_mode_get(obj); 198 Efl_Ui_Zoom_Mode new_mode = efl_ui_zoom_mode_get(obj);;
199 Elm_Web_Zoom_Mode mode;
200
201 _convert_web_zoom_mode(&mode, &new_mode, EINA_TRUE);
202
203 return mode;
170} 204}
171 205
172EAPI void 206EAPI void