summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuilherme Lepsch <lepsch@expertisesolutions.com.br>2015-03-24 17:50:11 -0300
committerGuilherme Lepsch <lepsch@expertisesolutions.com.br>2015-03-24 17:50:11 -0300
commitc533f68b0b960623f85a32ac7992f80c0c380847 (patch)
treec2e86c1a660e6bf175cd4a3d67605fe8b0560d84
parent8c05e9e0df2ed4b10d96c35dfdce3b18a9f86ec1 (diff)
elm_prefs: EFL Data Model (Emodel) integration (WIP).
-rw-r--r--m4/efl_beta.m41
-rw-r--r--m4/efl_eo.m41
-rw-r--r--src/lib/Elementary.h.in2
-rw-r--r--src/lib/elm_prefs.c273
-rw-r--r--src/lib/elm_prefs.eo52
-rw-r--r--src/lib/elm_widget_prefs.h1
6 files changed, 266 insertions, 64 deletions
diff --git a/m4/efl_beta.m4 b/m4/efl_beta.m4
index c8047299f..8ac2c19fb 100644
--- a/m4/efl_beta.m4
+++ b/m4/efl_beta.m4
@@ -2,4 +2,5 @@ dnl use: EFL_ENABLE_BETA_API_SUPPORT
2AC_DEFUN([EFL_ENABLE_BETA_API_SUPPORT], 2AC_DEFUN([EFL_ENABLE_BETA_API_SUPPORT],
3[ 3[
4 AC_DEFINE([EFL_BETA_API_SUPPORT], [1], [Enable access to unstable EFL API that are still in beta]) 4 AC_DEFINE([EFL_BETA_API_SUPPORT], [1], [Enable access to unstable EFL API that are still in beta])
5 CPPFLAGS="${CPPFLAGS} -DEFL_BETA_API_SUPPORT=1"
5]) 6])
diff --git a/m4/efl_eo.m4 b/m4/efl_eo.m4
index 864baf5fc..21e3ffab1 100644
--- a/m4/efl_eo.m4
+++ b/m4/efl_eo.m4
@@ -2,5 +2,6 @@ dnl use: EFL_ENABLE_EO_API_SUPPORT
2AC_DEFUN([EFL_ENABLE_EO_API_SUPPORT], 2AC_DEFUN([EFL_ENABLE_EO_API_SUPPORT],
3[ 3[
4 AC_DEFINE([EFL_EO_API_SUPPORT], [1], [Enable access to unstable EFL Eo API]) 4 AC_DEFINE([EFL_EO_API_SUPPORT], [1], [Enable access to unstable EFL Eo API])
5 CPPFLAGS="${CPPFLAGS} -DEFL_EO_API_SUPPORT=1"
5]) 6])
6 7
diff --git a/src/lib/Elementary.h.in b/src/lib/Elementary.h.in
index 5c5753bf0..cc6c475fb 100644
--- a/src/lib/Elementary.h.in
+++ b/src/lib/Elementary.h.in
@@ -84,6 +84,8 @@
84#include <Efreet_Mime.h> 84#include <Efreet_Mime.h>
85#include <Efreet_Trash.h> 85#include <Efreet_Trash.h>
86#include <Ethumb_Client.h> 86#include <Ethumb_Client.h>
87#include <Eo.h>
88#include <Emodel.h>
87 89
88#ifdef ELM_ELOCATION 90#ifdef ELM_ELOCATION
89#include <Elocation.h> 91#include <Elocation.h>
diff --git a/src/lib/elm_prefs.c b/src/lib/elm_prefs.c
index 56bcf7f67..be091d339 100644
--- a/src/lib/elm_prefs.c
+++ b/src/lib/elm_prefs.c
@@ -10,7 +10,9 @@
10#include "elm_widget_prefs.h" 10#include "elm_widget_prefs.h"
11#include "elm_prefs_edd.x" 11#include "elm_prefs_edd.x"
12 12
13#include "Eo.h" 13#include <Eo.h>
14
15#include <stdbool.h>
14 16
15#define MY_CLASS ELM_PREFS_CLASS 17#define MY_CLASS ELM_PREFS_CLASS
16 18
@@ -40,10 +42,11 @@ static Eina_Hash *_elm_prefs_item_widgets_map = NULL;
40static Eina_Hash *_elm_prefs_item_type_widgets_map = NULL; 42static Eina_Hash *_elm_prefs_item_type_widgets_map = NULL;
41static const Elm_Prefs_Item_Iface *_elm_prefs_item_default_widget = NULL; 43static const Elm_Prefs_Item_Iface *_elm_prefs_item_default_widget = NULL;
42 44
43static void _elm_prefs_values_get_default(Elm_Prefs_Page_Node *, 45static void _elm_prefs_values_get_default(Elm_Prefs_Page_Node *, Eina_Bool);
44 Eina_Bool); 46static Eina_Bool _prefs_item_widget_value_from_self(Elm_Prefs_Item_Node *, Eina_Bool);
45static Eina_Bool _prefs_item_widget_value_from_self(Elm_Prefs_Item_Node *, 47static Eina_Bool _elm_prefs_value_get(Elm_Prefs_Data *, const char *, Eina_Value *);
46 Eina_Bool); 48static Eina_Bool _elm_prefs_value_set(Elm_Prefs_Data *, const char *, const Elm_Prefs_Item_Type, const Eina_Value *);
49static Eina_Bool _elm_prefs_item_changed(Eo *, Elm_Prefs_Data *, const char *);
47 50
48EOLIAN static void 51EOLIAN static void
49_elm_prefs_evas_object_smart_add(Eo *obj, Elm_Prefs_Data *_pd EINA_UNUSED) 52_elm_prefs_evas_object_smart_add(Eo *obj, Elm_Prefs_Data *_pd EINA_UNUSED)
@@ -245,19 +248,10 @@ _prefs_item_widget_value_from_data(Elm_Prefs_Data *sd,
245 if (!_prefs_data_types_match(t, it->type)) 248 if (!_prefs_data_types_match(t, it->type))
246 { 249 {
247 if (!_prefs_data_type_fix(it, value)) return EINA_FALSE; 250 if (!_prefs_data_type_fix(it, value)) return EINA_FALSE;
248 else
249 {
250 Eina_Bool v_set;
251
252 sd->changing_from_ui = EINA_TRUE;
253 251
254 v_set = elm_prefs_data_value_set(sd->prefs_data, 252 // write-back the type fix only if prefs_data
255 buf, it->type, value); 253 if (sd->prefs_data && !_elm_prefs_value_set(sd, buf, it->type, value))
256 254 return EINA_FALSE;
257 sd->changing_from_ui = EINA_FALSE;
258
259 if (!v_set) return EINA_FALSE;
260 }
261 } 255 }
262 256
263 if (!it->available) 257 if (!it->available)
@@ -362,33 +356,78 @@ _elm_prefs_item_list_node_by_name(Elm_Prefs_Data *sd,
362static void 356static void
363_prefs_data_item_changed_cb(void *cb_data, 357_prefs_data_item_changed_cb(void *cb_data,
364 Elm_Prefs_Data_Event_Type type EINA_UNUSED, 358 Elm_Prefs_Data_Event_Type type EINA_UNUSED,
365 Elm_Prefs_Data *prefs_data, 359 Elm_Prefs_Data *prefs_data EINA_UNUSED,
366 void *event_info) 360 void *event_info)
367{ 361{
368 Elm_Prefs_Data_Event_Changed *evt = event_info; 362 Elm_Prefs_Data_Event_Changed *evt = event_info;
369 Eo *obj = cb_data; 363 Eo *obj = cb_data;
370 Elm_Prefs_Item_Node *it;
371 Eina_Value value;
372 364
373 ELM_PREFS_DATA_GET(obj, sd); 365 ELM_PREFS_DATA_GET(obj, sd);
374 if (sd->changing_from_ui) return; 366 if (sd->changing_from_ui) return;
375 367
376 it = _elm_prefs_item_node_by_name(sd, evt->key); 368 if (_elm_prefs_item_changed(obj, sd, evt->key))
377 if (!it) return; 369 _elm_prefs_mark_as_dirty(obj);
370}
378 371
379 if (elm_prefs_data_value_get(prefs_data, evt->key, NULL, &value)) 372static Eina_Bool
380 { 373_elm_prefs_item_changed(Eo *obj,
381 if (!_prefs_item_widget_value_from_data(sd, it, &value)) goto end; 374 Elm_Prefs_Data *sd,
375 const char *key)
376{
377 Elm_Prefs_Item_Node *item = _elm_prefs_item_node_by_name(sd, key);
378 if (!item) return EINA_FALSE;
382 379
383 _elm_prefs_item_changed_report(obj, it); 380 Eina_Value value;
384 _elm_prefs_mark_as_dirty(obj); 381 if (!_elm_prefs_value_get(sd, key, &value))
382 {
383 ERR("failed to fetch value from data after changed event: %s", key);
384 return EINA_FALSE;
385 } 385 }
386 else
387 ERR("failed to fetch value from data after changed event");
388 386
389end: 387 Eina_Bool changed = _prefs_item_widget_value_from_data(sd, item, &value);
388 if (changed)
389 _elm_prefs_item_changed_report(obj, item);
390
390 eina_value_flush(&value); 391 eina_value_flush(&value);
391 return; 392 return changed;
393}
394
395static Eina_Bool
396_elm_prefs_properties_changed(Eo *obj,
397 Elm_Prefs_Data *sd,
398 const Eina_Array *properties)
399{
400 bool changed = EINA_FALSE;
401
402 size_t i;
403 const char *property;
404 Eina_Array_Iterator it;
405 EINA_ARRAY_ITER_NEXT(properties, i, property, it)
406 changed = _elm_prefs_item_changed(obj, sd, property) || changed;
407
408 return changed;
409}
410
411static Eina_Bool
412_model_property_changed_cb(void *data,
413 Eo *model EINA_UNUSED,
414 const Eo_Event_Description *desc EINA_UNUSED,
415 void *event_info)
416{
417 const Emodel_Property_Event *evt = (Emodel_Property_Event*)event_info;
418 Eo *obj = (Eo*)data;
419
420 ELM_PREFS_DATA_GET(obj, sd);
421 if (sd->changing_from_ui) return EO_CALLBACK_CONTINUE;
422
423 Eina_Bool changed = _elm_prefs_properties_changed
424 (obj, sd, evt->changed_properties);
425 changed = _elm_prefs_properties_changed
426 (obj, sd, evt->invalidated_properties) || changed;
427 if (changed)
428 _elm_prefs_mark_as_dirty(obj);
429
430 return EO_CALLBACK_CONTINUE;
392} 431}
393 432
394static void 433static void
@@ -446,6 +485,25 @@ _elm_prefs_data_cbs_del(Eo *obj)
446 "prefs data handle"); 485 "prefs data handle");
447} 486}
448 487
488static Eina_Bool
489_elm_prefs_model_cbs_add(Eo *obj, Emodel *model)
490{
491 eo_do(model, eo_event_callback_add(EMODEL_EVENT_PROPERTIES_CHANGED,
492 _model_property_changed_cb, obj));
493 return EINA_TRUE;
494}
495
496static void
497_elm_prefs_model_cbs_del(Eo *obj)
498{
499 ELM_PREFS_DATA_GET(obj, sd);
500
501 if (!sd->model) return;
502
503 eo_do(sd->model, eo_event_callback_del(EMODEL_EVENT_PROPERTIES_CHANGED,
504 _model_property_changed_cb, obj));
505}
506
449EOLIAN static void 507EOLIAN static void
450_elm_prefs_evas_object_smart_del(Eo *obj, Elm_Prefs_Data *sd) 508_elm_prefs_evas_object_smart_del(Eo *obj, Elm_Prefs_Data *sd)
451{ 509{
@@ -454,17 +512,21 @@ _elm_prefs_evas_object_smart_del(Eo *obj, Elm_Prefs_Data *sd)
454 if (sd->saving_poller) ecore_poller_del(sd->saving_poller); 512 if (sd->saving_poller) ecore_poller_del(sd->saving_poller);
455 513
456 _elm_prefs_data_cbs_del(obj); 514 _elm_prefs_data_cbs_del(obj);
515 _elm_prefs_model_cbs_del(obj);
457 516
458 if (sd->root) 517 if (sd->root)
459 { 518 {
460 elm_prefs_data_version_set(sd->prefs_data, sd->root->version); 519 if (sd->prefs_data)
461 520 {
462 _elm_prefs_save(obj); 521 elm_prefs_data_version_set(sd->prefs_data, sd->root->version);
522 _elm_prefs_save(obj);
523 }
463 524
464 _root_node_free(sd); 525 _root_node_free(sd);
465 } 526 }
466 527
467 if (sd->prefs_data) elm_prefs_data_unref(sd->prefs_data); 528 if (sd->prefs_data) elm_prefs_data_unref(sd->prefs_data);
529 if (sd->model) eo_unref(sd->model);
468 530
469 eina_stringshare_del(sd->file); 531 eina_stringshare_del(sd->file);
470 eina_stringshare_del(sd->page); 532 eina_stringshare_del(sd->page);
@@ -581,18 +643,18 @@ _item_changed_cb(Evas_Object *it_obj)
581 if (it->w_impl->value_validate && 643 if (it->w_impl->value_validate &&
582 !it->w_impl->value_validate(it->w_obj)) 644 !it->w_impl->value_validate(it->w_obj))
583 { 645 {
584 if (sd->prefs_data) 646 if (sd->prefs_data || sd->model)
585 { 647 {
586 Eina_Value value; 648 Eina_Value value;
587 649
588 // Restoring to the last valid value. 650 // Restoring to the last valid value.
589 if (!elm_prefs_data_value_get(sd->prefs_data, buf, NULL, &value)) 651 if (!_elm_prefs_value_get(sd, buf, &value))
652 goto restore_fail;
653
654 Eina_Bool ret = it->w_impl->value_set(it->w_obj, &value);
655 eina_value_flush(&value);
656 if (!ret)
590 goto restore_fail; 657 goto restore_fail;
591 if (!it->w_impl->value_set(it->w_obj, &value))
592 {
593 eina_value_flush(&value);
594 goto restore_fail;
595 }
596 } 658 }
597 else 659 else
598 { 660 {
@@ -604,7 +666,7 @@ _item_changed_cb(Evas_Object *it_obj)
604 } 666 }
605 667
606end: 668end:
607 if (sd->prefs_data) 669 if (sd->prefs_data || sd->model)
608 { 670 {
609 Eina_Value value; 671 Eina_Value value;
610 672
@@ -612,10 +674,8 @@ end:
612 ERR("failed to fetch value from widget of item %s", buf); 674 ERR("failed to fetch value from widget of item %s", buf);
613 else 675 else
614 { 676 {
615 sd->changing_from_ui = EINA_TRUE; 677 _elm_prefs_value_set(sd, buf, it->type, &value);
616 elm_prefs_data_value_set(sd->prefs_data, buf, it->type, &value);
617 eina_value_flush(&value); 678 eina_value_flush(&value);
618 sd->changing_from_ui = EINA_FALSE;
619 } 679 }
620 } 680 }
621 681
@@ -1059,26 +1119,18 @@ _elm_prefs_values_get_user(Elm_Prefs_Data *sd,
1059 1119
1060 EINA_LIST_FOREACH(p->items, l, it) 1120 EINA_LIST_FOREACH(p->items, l, it)
1061 { 1121 {
1062 Eina_Bool get_err = EINA_FALSE, set_err = EINA_FALSE;
1063
1064 if (it->type == ELM_PREFS_TYPE_PAGE) 1122 if (it->type == ELM_PREFS_TYPE_PAGE)
1065 { 1123 {
1066 Elm_Prefs_Page_Node *subp = it->subpage; 1124 Elm_Prefs_Page_Node *subp = it->subpage;
1067 1125
1068 if (!elm_prefs_data_value_get 1126 if (!_elm_prefs_value_get(sd, subp->name, &value))
1069 (sd->prefs_data, subp->name, NULL, &value))
1070 { 1127 {
1071 INF("failed to fetch value for item %s on user data, " 1128 INF("failed to fetch value for item %s on user data, "
1072 "writing UI value back on it", it->name); 1129 "writing UI value back on it", it->name);
1073 1130
1074 if (eina_value_setup(&value, EINA_VALUE_TYPE_STRINGSHARE) && 1131 if (eina_value_setup(&value, EINA_VALUE_TYPE_STRINGSHARE) &&
1075 eina_value_set(&value, subp->name)) 1132 eina_value_set(&value, subp->name))
1076 { 1133 _elm_prefs_value_set(sd, subp->name, it->type, &value);
1077 sd->changing_from_ui = EINA_TRUE;
1078 elm_prefs_data_value_set
1079 (sd->prefs_data, subp->name, it->type, &value);
1080 sd->changing_from_ui = EINA_FALSE;
1081 }
1082 } 1134 }
1083 1135
1084 _elm_prefs_values_get_user(sd, subp); 1136 _elm_prefs_values_get_user(sd, subp);
@@ -1092,11 +1144,15 @@ _elm_prefs_values_get_user(Elm_Prefs_Data *sd,
1092 1144
1093 snprintf(buf, sizeof(buf), "%s:%s", p->name, it->name); 1145 snprintf(buf, sizeof(buf), "%s:%s", p->name, it->name);
1094 1146
1095 if (!elm_prefs_data_value_get(sd->prefs_data, buf, NULL, &value)) 1147 Eina_Bool get_err = EINA_FALSE, set_err = EINA_FALSE;
1148 if (!_elm_prefs_value_get(sd, buf, &value))
1096 get_err = EINA_TRUE; 1149 get_err = EINA_TRUE;
1097 else if (!_prefs_item_widget_value_from_data(sd, it, &value)) 1150 else if (!_prefs_item_widget_value_from_data(sd, it, &value))
1098 set_err = EINA_TRUE; 1151 set_err = EINA_TRUE;
1099 1152
1153 if (!get_err)
1154 eina_value_flush(&value);
1155
1100 if (get_err || set_err) 1156 if (get_err || set_err)
1101 { 1157 {
1102 if (get_err) 1158 if (get_err)
@@ -1111,15 +1167,11 @@ _elm_prefs_values_get_user(Elm_Prefs_Data *sd,
1111 it->name); 1167 it->name);
1112 else 1168 else
1113 { 1169 {
1114 sd->changing_from_ui = EINA_TRUE; 1170 _elm_prefs_value_set(sd, buf, it->type, &value);
1115 elm_prefs_data_value_set 1171 eina_value_flush(&value);
1116 (sd->prefs_data, buf, it->type, &value);
1117 sd->changing_from_ui = EINA_FALSE;
1118 } 1172 }
1119 } 1173 }
1120 } 1174 }
1121
1122 eina_value_flush(&value);
1123 } 1175 }
1124} 1176}
1125 1177
@@ -1187,6 +1239,9 @@ _elm_prefs_data_set(Eo *obj, Elm_Prefs_Data *sd, Elm_Prefs_Data *prefs_data)
1187{ 1239{
1188 if (!sd->root) return EINA_FALSE; 1240 if (!sd->root) return EINA_FALSE;
1189 1241
1242 Eina_Bool ret = eo_do_ret(obj, ret, elm_obj_prefs_model_set(NULL));
1243 if (!ret) return EINA_FALSE;
1244
1190 if (prefs_data && !_elm_prefs_data_cbs_add(obj, prefs_data)) 1245 if (prefs_data && !_elm_prefs_data_cbs_add(obj, prefs_data))
1191 return EINA_FALSE; 1246 return EINA_FALSE;
1192 1247
@@ -1227,6 +1282,55 @@ _elm_prefs_data_get(Eo *obj EINA_UNUSED, Elm_Prefs_Data *sd)
1227 else return sd->prefs_data; 1282 else return sd->prefs_data;
1228} 1283}
1229 1284
1285EOLIAN static Eina_Bool
1286_elm_prefs_model_set(Eo *obj, Elm_Prefs_Data *sd, Emodel *model)
1287{
1288 if (!sd->root) return EINA_FALSE;
1289
1290 Eina_Bool ret = eo_do_ret(obj, ret, elm_obj_prefs_data_set(NULL));
1291 if (!ret) return EINA_FALSE;
1292
1293 if (model && !_elm_prefs_model_cbs_add(obj, model))
1294 return EINA_FALSE;
1295
1296 if (sd->model)
1297 {
1298 _elm_prefs_model_cbs_del(obj);
1299 eo_unref(sd->model);
1300 }
1301
1302 sd->model = model;
1303
1304 if (!sd->model)
1305 {
1306 INF("resetting prefs to default values");
1307 _elm_prefs_values_get_default(sd->root, EINA_FALSE);
1308
1309 goto end;
1310 }
1311
1312 eo_ref(sd->model);
1313
1314 sd->values_fetching = EINA_TRUE;
1315 _elm_prefs_values_get_user(sd, sd->root);
1316 sd->values_fetching = EINA_FALSE;
1317
1318end:
1319 evas_object_smart_callback_call
1320 (obj, SIG_PAGE_CHANGED, (char *)sd->root->name);
1321
1322 return EINA_TRUE;
1323}
1324
1325EOLIAN static Emodel*
1326_elm_prefs_model_get(Eo *obj EINA_UNUSED, Elm_Prefs_Data *sd)
1327{
1328 if (!sd->root)
1329 return NULL;
1330
1331 return sd->model;
1332}
1333
1230EOLIAN static void 1334EOLIAN static void
1231_elm_prefs_autosave_set(Eo *obj, Elm_Prefs_Data *_pd EINA_UNUSED, Eina_Bool autosave) 1335_elm_prefs_autosave_set(Eo *obj, Elm_Prefs_Data *_pd EINA_UNUSED, Eina_Bool autosave)
1232{ 1336{
@@ -1884,4 +1988,49 @@ elm_prefs_file_get(const Eo *obj, const char **file, const char **page)
1884 return EINA_TRUE; 1988 return EINA_TRUE;
1885} 1989}
1886 1990
1991static Eina_Bool
1992_elm_prefs_value_get(Elm_Prefs_Data *sd, const char *key, Eina_Value *value)
1993{
1994 if (sd->prefs_data)
1995 return elm_prefs_data_value_get(sd->prefs_data, key, NULL, value);
1996
1997 if (sd->model)
1998 {
1999 Emodel_Load_Status status;
2000 const Eina_Value *prop_value;
2001 eo_do(sd->model, status = emodel_property_get(key, &prop_value));
2002 if (EMODEL_LOAD_STATUS_ERROR == status)
2003 return EINA_FALSE;
2004
2005 return eina_value_copy(prop_value, value);
2006 }
2007
2008 return EINA_FALSE;
2009}
2010
2011static Eina_Bool
2012_elm_prefs_value_set(Elm_Prefs_Data *sd,
2013 const char *key,
2014 const Elm_Prefs_Item_Type type,
2015 const Eina_Value *value)
2016{
2017 sd->changing_from_ui = EINA_TRUE;
2018
2019 Eina_Bool result = EINA_FALSE;
2020 if (sd->prefs_data)
2021 result = elm_prefs_data_value_set(sd->prefs_data, key, type, value);
2022 else
2023 if (sd->model)
2024 {
2025 // TODO: Convert the value
2026 Emodel_Load_Status status;
2027 eo_do(sd->model, status = emodel_property_set(key, value));
2028 result = EMODEL_LOAD_STATUS_ERROR != status;
2029 // TODO: The property changed event could be delayed for Emodel
2030 }
2031
2032 sd->changing_from_ui = EINA_FALSE;
2033 return result;
2034}
2035
1887#include "elm_prefs.eo.c" 2036#include "elm_prefs.eo.c"
diff --git a/src/lib/elm_prefs.eo b/src/lib/elm_prefs.eo
index 0218482bd..8036fab08 100644
--- a/src/lib/elm_prefs.eo
+++ b/src/lib/elm_prefs.eo
@@ -1,5 +1,4 @@
1class Elm_Prefs (Elm_Widget, Efl.File) 1class Elm_Prefs (Elm_Widget, Efl.File) {
2{
3 eo_prefix: elm_obj_prefs; 2 eo_prefix: elm_obj_prefs;
4 properties { 3 properties {
5 data { 4 data {
@@ -51,6 +50,55 @@ class Elm_Prefs (Elm_Widget, Efl.File)
51 Elm_Prefs_Data *data; /*@ A valid prefs_data handle */ 50 Elm_Prefs_Data *data; /*@ A valid prefs_data handle */
52 } 51 }
53 } 52 }
53 model {
54 set {
55 /*@
56 Set user model for a given prefs widget
57
58 @return @c EINA_TRUE, on success, @c EINA_FALSE otherwise
59
60 Once a prefs widget is created, after elm_prefs_file_set() is
61 issued on it, all of its UI elements will get default values, when
62 declared on that file. To fetch an user's own, personal set of
63 those values, one gets to pair a <b>model</b> handle to the
64 prefs widget. This is what this call is intended for.
65
66 Model property values from @a model with names matching the ones
67 present on the file passed on elm_prefs_file_set() to @a obj will
68 have their values applied to the respective UI elements of the
69 widget.
70
71 When @a obj dies, the values of the elements declared on its @b
72 .epb file (the one set on elm_prefs_file_set()) marked as permanent
73 <b>will be written back</b> to @a model, if it is writable.
74 One is also able to make this writing event to take place
75 automatically after each UI element modification by using
76 elm_prefs_autosave_set().
77
78 @note @a obj will keep a reference of its own for @a model,
79 but you should still unreference it by yourself, after the widget
80 is gone.
81
82 @see elm_prefs_model_get()
83
84 @since 1.8 */
85 return: bool;
86 }
87 get {
88 /*@
89 Get user model for a given prefs widget
90
91 @return A pointer to the user model of a given prefs widget on success.
92 @c NULL otherwise.
93
94 @see elm_prefs_model_set() for more details
95
96 @since 1.8 */
97 }
98 values {
99 Emodel *model; /*@ A valid model handle */
100 }
101 }
54 autosave { 102 autosave {
55 set { 103 set {
56 /*@ 104 /*@
diff --git a/src/lib/elm_widget_prefs.h b/src/lib/elm_widget_prefs.h
index 728ef3d6c..d384c229a 100644
--- a/src/lib/elm_widget_prefs.h
+++ b/src/lib/elm_widget_prefs.h
@@ -76,6 +76,7 @@ struct _Elm_Prefs_Data
76 Elm_Prefs_Page_Node *root; 76 Elm_Prefs_Page_Node *root;
77 77
78 Elm_Prefs_Data *prefs_data; 78 Elm_Prefs_Data *prefs_data;
79 Emodel *model;
79 const char *file; 80 const char *file;
80 const char *page; 81 const char *page;
81 82