summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorBruno Dilly <bdilly@profusion.mobi>2011-08-01 21:32:25 +0000
committerBruno Dilly <bdilly@profusion.mobi>2011-08-01 21:32:25 +0000
commitbb7117c65023f9ca278140562ee53cb9c37b5d28 (patch)
tree1eb2afb84eff225df5abc94a5a0d9eb2271d57d5 /doc
parent2a80e93e38855585bef6758583cf6c5a8c8bf40f (diff)
Elementary: Mapbuf Documentation
SVN revision: 61968
Diffstat (limited to 'doc')
-rw-r--r--doc/Makefile.am1
-rw-r--r--doc/examples.dox84
-rw-r--r--doc/index.doxy3
-rw-r--r--doc/widgets/Makefile.am2
-rw-r--r--doc/widgets/widget_preview_mapbuf.c29
5 files changed, 119 insertions, 0 deletions
diff --git a/doc/Makefile.am b/doc/Makefile.am
index 7ea36ff68..024f62d2f 100644
--- a/doc/Makefile.am
+++ b/doc/Makefile.am
@@ -36,6 +36,7 @@ WGT_PREVIEW = \
36 slider:preview-00.png:widget_preview_slider:200:100 \ 36 slider:preview-00.png:widget_preview_slider:200:100 \
37 panes:preview-00.png:widget_preview_panes:200:100 \ 37 panes:preview-00.png:widget_preview_panes:200:100 \
38 toolbar:preview-00.png:widget_preview_toolbar:300:100 \ 38 toolbar:preview-00.png:widget_preview_toolbar:300:100 \
39 mapbuf:preview-00.png:widget_preview_mapbuf:200:200 \
39 ctxpopup:preview-00.png:widget_preview_ctxpopup:200:130 \ 40 ctxpopup:preview-00.png:widget_preview_ctxpopup:200:130 \
40 icon:preview-00.png:widget_preview_icon:50:50 \ 41 icon:preview-00.png:widget_preview_icon:50:50 \
41 image:preview-00.png:widget_preview_image:50:50 \ 42 image:preview-00.png:widget_preview_image:50:50 \
diff --git a/doc/examples.dox b/doc/examples.dox
index 1cdb7aa6f..4b3156ebf 100644
--- a/doc/examples.dox
+++ b/doc/examples.dox
@@ -39,6 +39,8 @@
39 * 39 *
40 * @ref clock_example 40 * @ref clock_example
41 * 41 *
42 * @ref mapbuf_example
43 *
42 * @ref diskselector_example_01 44 * @ref diskselector_example_01
43 * 45 *
44 * @ref diskselector_example_02 46 * @ref diskselector_example_02
@@ -1766,6 +1768,88 @@
1766 */ 1768 */
1767 1769
1768/** 1770/**
1771 * @page mapbuf_example Mapbuf Widget Example
1772 *
1773 * This code places a Elementary mapbuf widget on a window,
1774 * to exemplify part of the widget's API.
1775 *
1776 * First we'll add an window with a background and a vertical box to
1777 * pack our interface elements:
1778 * @dontinclude mapbuf_example.c
1779 * @skipline win_add
1780 * @until show(bx)
1781 *
1782 * Next we'll simply add the mapbuf widget to the box:
1783 * @skipline mapbuf_add
1784 * @until pack_end
1785 *
1786 * But mapbuf is a container widget, it won't do anything alone. So let's
1787 * create a table full of icons. For that we'll loop to fill each line of each
1788 * column. See @ref tutorial_table_01 "tutorial_table_01"
1789 * if you don't know how to use tables:
1790 * @skipline table_add
1791 * @until }
1792 * @until }
1793 *
1794 * Finally, setting mapbuf content:
1795 * @skipline content_set
1796 * @skipline show
1797 *
1798 * Also, would be good a horizontal box with some controls to change mapbuf
1799 * behavior:
1800 * @skipline box_add
1801 * @until show
1802 *
1803 * By default map is disabled. So just setting content isn't enough.
1804 * Alpha and smooth settings will be applied when map is enabled.
1805 * So we'll add a toggle for that. Everytime the map properties
1806 * are changed, map will need to be enabled again. So if you
1807 * want to play a bit with our example, remember to always enable
1808 * map again after concluding your changes.
1809 * @skipline toggle_add
1810 * @until show
1811 *
1812 * We have added a callback function to this toggle, so it will enable
1813 * or disable map:
1814 * @dontinclude mapbuf_example.c
1815 * @skip static
1816 * @skip }
1817 * @skipline static
1818 * @until }
1819 *
1820 * Let's add check boxes for alpha blending and smooth rendering:
1821 * @skipline check_add
1822 * @until show
1823 * @until show
1824 *
1825 * By default, mapbuf would enable alpha blending and smooth rendering,
1826 * so we need to check boxes to be consistent with its behavior.
1827 *
1828 * Callback functions look like the one added to the toggle. This way we
1829 * could enable or disable the both properties:
1830 * @dontinclude mapbuf_example.c
1831 * @skip static
1832 * @skip }
1833 * @skip static
1834 * @skip }
1835 * @skipline static
1836 * @until }
1837 * @until }
1838 *
1839 * You'll see that disabling alpha blending will set a black rectangle below
1840 * the icons. That's the reason you only should enable that when you're sure
1841 * the mapbuf content is 100% solid.
1842 *
1843 * See @ref mapbuf_example.c "mapbuf_example.c", whose window should
1844 * look like this picture:
1845 *
1846 * @image html screenshots/mapbuf_example.png
1847 * @image latex screenshots/mapbuf_example.eps width=\textwidth
1848 *
1849 * @example mapbuf_example.c
1850 */
1851
1852/**
1769 * @page diskselector_example_01 Diskselector widget example 1853 * @page diskselector_example_01 Diskselector widget example
1770 * 1854 *
1771 * This code places 4 Elementary diskselector widgets on a window, each of 1855 * This code places 4 Elementary diskselector widgets on a window, each of
diff --git a/doc/index.doxy b/doc/index.doxy
index 956c86165..55e783b07 100644
--- a/doc/index.doxy
+++ b/doc/index.doxy
@@ -137,6 +137,9 @@
137 * @image latex img/widget/label/preview-00.eps 137 * @image latex img/widget/label/preview-00.eps
138 * @li @ref Map 138 * @li @ref Map
139 * @li @ref Mapbuf 139 * @li @ref Mapbuf
140 *
141 * @image html img/widget/mapbuf/preview-00.png
142 * @image latex img/widget/mapbuf/preview-00.eps
140 * @li @ref Menu 143 * @li @ref Menu
141 * 144 *
142 * @image html img/widget/menu/preview-00.png 145 * @image html img/widget/menu/preview-00.png
diff --git a/doc/widgets/Makefile.am b/doc/widgets/Makefile.am
index 1bfb9b83a..8221adb9c 100644
--- a/doc/widgets/Makefile.am
+++ b/doc/widgets/Makefile.am
@@ -51,6 +51,7 @@ widget_preview_frame \
51widget_preview_slider \ 51widget_preview_slider \
52widget_preview_panes \ 52widget_preview_panes \
53widget_preview_toolbar \ 53widget_preview_toolbar \
54widget_preview_mapbuf \
54widget_preview_ctxpopup \ 55widget_preview_ctxpopup \
55widget_preview_icon \ 56widget_preview_icon \
56widget_preview_image \ 57widget_preview_image \
@@ -121,6 +122,7 @@ EXTRA_DIST = \
121 widget_preview_slider.c \ 122 widget_preview_slider.c \
122 widget_preview_panes.c \ 123 widget_preview_panes.c \
123 widget_preview_toolbar.c \ 124 widget_preview_toolbar.c \
125 widget_preview_mapbuf.c \
124 widget_preview_ctxpopup.c \ 126 widget_preview_ctxpopup.c \
125 widget_preview_diskselector.c \ 127 widget_preview_diskselector.c \
126 widget_preview_entry1.c \ 128 widget_preview_entry1.c \
diff --git a/doc/widgets/widget_preview_mapbuf.c b/doc/widgets/widget_preview_mapbuf.c
new file mode 100644
index 000000000..812c76c17
--- /dev/null
+++ b/doc/widgets/widget_preview_mapbuf.c
@@ -0,0 +1,29 @@
1#include "widget_preview_tmpl_head.c"
2
3Evas_Object *o = elm_mapbuf_add(win);
4evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
5elm_win_resize_object_add(win, o);
6evas_object_show(o);
7
8Evas_Object *tb = elm_table_add(win);
9evas_object_size_hint_weight_set(tb, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
10evas_object_size_hint_fill_set(tb, EVAS_HINT_FILL, EVAS_HINT_FILL);
11evas_object_show(tb);
12
13unsigned int i, j;
14for (i = 0; i < 8; i++)
15 {
16 for (j = 0; j < 8; j++)
17 {
18 Evas_Object *ic = elm_icon_add(win);
19 elm_icon_standard_set(ic, "home");
20 elm_icon_scale_set(ic, EINA_FALSE, EINA_FALSE);
21 evas_object_show(ic);
22 elm_table_pack(tb, ic, i, j, 1, 1);
23 }
24 }
25
26elm_mapbuf_content_set(o, tb);
27elm_mapbuf_enabled_set(o, EINA_TRUE);
28
29#include "widget_preview_tmpl_foot.c"