summaryrefslogtreecommitdiff
path: root/doc/widgets
diff options
context:
space:
mode:
authorGustavo Lima Chaves <glima@profusion.mobi>2012-11-30 14:41:39 +0000
committerGustavo Lima Chaves <glima@profusion.mobi>2012-11-30 14:41:39 +0000
commite966637e9fe77e3d52187726859a8de42eae6a22 (patch)
treea7a4f2417187c09ef3ffdf6720d5273d4daa2529 /doc/widgets
parentf3aa3078161e4f5fe846bb4338e7e5c49bda94ea (diff)
downloadelementary-e966637e9fe77e3d52187726859a8de42eae6a22.tar.gz
[elm] Introducing a new widget, along with its infrastructure -- prefs.
The prefs widgets aims to aid with the implementation of preference/configuration windows/UI elements in Elementary-based applications (think of Enlightenment configuration dialogs, elementary_config, etc). Prefs is a widget that populates its view with widgets bound to data types (following the instructions of a ".epb" file that describes a set of items) and handles the storage/restoration of such data on a configuration file automatically. There's also the prefs_data handle, which is the one dealing with user saved data for a given epb defaults set. The documentation on the new widget is rich (we have examples and even an EPC reference) and there's a new test entry for it. I'm blogging about it soon, with screeshots and more details. Enjoy. ps.: This is a team work by Murilo Belluzzo, Ricardo de Almeida and me. SVN revision: 79909
Diffstat (limited to 'doc/widgets')
-rw-r--r--doc/widgets/Makefile.am13
-rw-r--r--doc/widgets/widget_preview_prefs.c24
-rw-r--r--doc/widgets/widget_preview_prefs.epc60
3 files changed, 97 insertions, 0 deletions
diff --git a/doc/widgets/Makefile.am b/doc/widgets/Makefile.am
index a522ec93e..603cc73d9 100644
--- a/doc/widgets/Makefile.am
+++ b/doc/widgets/Makefile.am
@@ -9,6 +9,7 @@ AM_CPPFLAGS = \
-I$(top_srcdir)/src/bin \
-DPACKAGE_BIN_DIR=\"$(bindir)\" \
-DPACKAGE_DATA_DIR=\"$(datadir)/$(PACKAGE)\" \
+-DDOCW_DIR=\"$(abs_top_builddir)/doc/widgets\" \
@ELEMENTARY_CFLAGS@ \
@ELEMENTARY_X_CFLAGS@ \
@ELEMENTARY_FB_CFLAGS@ \
@@ -21,6 +22,15 @@ AM_CPPFLAGS = \
@ELEMENTARY_EMAP_CFLAGS@ \
@EIO_CFLAGS@
+ELM_PREFS_CC = @elm_prefs_cc@
+
+noinst_DATA = widget_preview_prefs.epb
+
+widget_preview_prefs.epb: Makefile widget_preview_prefs.epc
+ $(ELM_PREFS_CC) $(ELM_PREFS_FLAGS) \
+ $(top_srcdir)/doc/widgets/widget_preview_prefs.epc \
+ $(top_builddir)/doc/widgets/widget_preview_prefs.epb
+
noinst_PROGRAMS = \
widget_preview_actionslider \
widget_preview_bg \
@@ -81,6 +91,7 @@ widget_preview_panel \
widget_preview_panes \
widget_preview_photocam \
widget_preview_popup \
+widget_preview_prefs \
widget_preview_progressbar \
widget_preview_radio \
widget_preview_scroller \
@@ -158,6 +169,8 @@ EXTRA_DIST = \
widget_preview_genlist3.c \
widget_preview_genlist4.c \
widget_preview_genlist5.c \
+ widget_preview_prefs.c \
+ widget_preview_prefs.epc \
widget_preview_progressbar.c \
widget_preview_box.c \
widget_preview_notify.c \
diff --git a/doc/widgets/widget_preview_prefs.c b/doc/widgets/widget_preview_prefs.c
new file mode 100644
index 000000000..465f40b02
--- /dev/null
+++ b/doc/widgets/widget_preview_prefs.c
@@ -0,0 +1,24 @@
+#include "widget_preview_tmpl_head.c"
+
+static const char LAYOUT_EPB[] = DOCW_DIR\
+ "/widget_preview_prefs.epb";
+
+static const char LAYOUT_CFG[] = DOCW_DIR\
+ "/widget_preview_prefs.cfg";
+
+Evas_Object *prefs;
+Elm_Prefs_Data *prefs_data;
+
+prefs = elm_prefs_add(win);
+evas_object_size_hint_weight_set(prefs, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+elm_win_resize_object_add(win, prefs);
+evas_object_show(prefs);
+
+elm_prefs_autosave_set(prefs, EINA_TRUE);
+
+prefs_data = elm_prefs_data_new(LAYOUT_CFG, NULL, EET_FILE_MODE_READ_WRITE);
+
+elm_prefs_file_set(prefs, LAYOUT_EPB, NULL);
+elm_prefs_data_set(prefs, prefs_data);
+
+#include "widget_preview_tmpl_foot.c"
diff --git a/doc/widgets/widget_preview_prefs.epc b/doc/widgets/widget_preview_prefs.epc
new file mode 100644
index 000000000..34a3a62cb
--- /dev/null
+++ b/doc/widgets/widget_preview_prefs.epc
@@ -0,0 +1,60 @@
+collection
+{
+ page
+ {
+ name: "main";
+ version: 1;
+ title: "Preferences Widget";
+ subtitle: "Example 01";
+ widget: "elm/vertical_box";
+
+ items {
+ item {
+ name: "universe";
+ type: INT;
+ label: "Ultimate Answer of Life, the Universe and Everything";
+ editable: 1;
+
+ int {
+ default: 42;
+ min: 0;
+ max: 150;
+ }
+ }
+
+ item {
+ name: "label";
+ type: LABEL;
+ label: "Just a label...";
+ }
+
+ item {
+ name: "text";
+ type: TEXT;
+ editable: 1;
+
+ text {
+ placeholder: "This is a text field (:";
+ default: "default str.";
+ }
+ }
+
+ item {
+ name: "sep";
+ type: SEPARATOR;
+ }
+
+ item {
+ name: "save";
+ type: SAVE;
+ label: "Save";
+ }
+
+ item {
+ name: "reset";
+ type: RESET;
+ label: "Reset";
+ }
+ }
+ }
+}