summaryrefslogtreecommitdiff
path: root/src/lib/efl/Efl.h
diff options
context:
space:
mode:
authorMike Blumenkrantz <zmike@samsung.com>2020-01-30 10:45:39 -0500
committerMarcel Hollerbach <mail@marcel-hollerbach.de>2020-02-14 09:20:21 +0100
commit94a29d05dea1e9c35b9f595119dd6f73d79fdb5b (patch)
treed4fadafcf1183752ee5c6ed821c785fc674e8f29 /src/lib/efl/Efl.h
parent0f2a61b5f280f11ba661996482a509f370d7e5e1 (diff)
efl/config: move C wrappers for this out of elm_config.h to Efl.h
this is beta API and belongs in its proper header Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de> Differential Revision: https://phab.enlightenment.org/D11247
Diffstat (limited to '')
-rw-r--r--src/lib/efl/Efl.h94
1 files changed, 94 insertions, 0 deletions
diff --git a/src/lib/efl/Efl.h b/src/lib/efl/Efl.h
index 649383f2c9..ea891223e9 100644
--- a/src/lib/efl/Efl.h
+++ b/src/lib/efl/Efl.h
@@ -234,6 +234,100 @@ EAPI Efl_Object *efl_part(const Eo *obj, const char *name);
234 234
235EAPI void efl_observable_tuple_free(Efl_Observable_Tuple *tuple); 235EAPI void efl_observable_tuple_free(Efl_Observable_Tuple *tuple);
236 236
237
238
239static inline Eina_Bool
240efl_config_bool_set(Efl_Config *obj, const char * name, Eina_Bool val)
241{
242 Eina_Value *v = eina_value_new(EINA_VALUE_TYPE_UCHAR);
243 Eina_Bool b;
244 eina_value_set(v, val);
245 b = efl_config_set(obj, name, v);
246 eina_value_free(v);
247 return b;
248}
249
250static inline Eina_Bool
251efl_config_bool_get(const Efl_Config *obj, const char * name)
252{
253 Eina_Value *v = efl_config_get(obj, name);
254 Eina_Bool b = 0;
255 if (eina_value_type_get(v) == EINA_VALUE_TYPE_UCHAR)
256 eina_value_get(v, &b);
257 eina_value_free(v);
258 return b;
259}
260
261static inline Eina_Bool
262efl_config_int_set(Efl_Config *obj, const char * name, int val)
263{
264 Eina_Value *v = eina_value_new(EINA_VALUE_TYPE_INT);
265 Eina_Bool b;
266 eina_value_set(v, val);
267 b = efl_config_set(obj, name, v);
268 eina_value_free(v);
269 return b;
270}
271
272static inline int
273efl_config_int_get(const Efl_Config *obj, const char * name)
274{
275 Eina_Value *v = efl_config_get(obj, name);
276 int b = 0;
277 if (eina_value_type_get(v) == EINA_VALUE_TYPE_INT)
278 eina_value_get(v, &b);
279 eina_value_free(v);
280 return b;
281}
282
283static inline Eina_Bool
284efl_config_double_set(Efl_Config *obj, const char * name, double val)
285{
286 Eina_Value *v = eina_value_new(EINA_VALUE_TYPE_DOUBLE);
287 Eina_Bool b;
288 eina_value_set(v, val);
289 b = efl_config_set(obj, name, v);
290 eina_value_free(v);
291 return b;
292}
293
294static inline double
295efl_config_double_get(const Efl_Config *obj, const char * name)
296{
297 Eina_Value *v = efl_config_get(obj, name);
298 double b = 0;
299 if (eina_value_type_get(v) == EINA_VALUE_TYPE_DOUBLE)
300 eina_value_get(v, &b);
301 eina_value_free(v);
302 return b;
303}
304
305static inline Eina_Bool
306efl_config_string_set(Efl_Config *obj, const char *name, const char *val)
307{
308 Eina_Value *v = eina_value_new(EINA_VALUE_TYPE_STRING);
309 Eina_Bool b;
310 eina_value_set(v, val);
311 b = efl_config_set(obj, name, v);
312 eina_value_free(v);
313 return b;
314}
315
316static inline Eina_Stringshare *
317efl_config_string_get(const Efl_Config *obj, const char *name)
318{
319 Eina_Value *v = efl_config_get(obj, name);
320 Eina_Stringshare *s = 0;
321 if (eina_value_type_get(v) == EINA_VALUE_TYPE_STRING)
322 {
323 const char *b = 0;
324 eina_value_get(v, &b);
325 s = eina_stringshare_add(b);
326 }
327 eina_value_free(v);
328 return s;
329}
330
237#else 331#else
238 332
239#ifndef EFL_NOLEGACY_API_SUPPORT 333#ifndef EFL_NOLEGACY_API_SUPPORT