aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/libraries/elementary/src/lib/elm_getting_started.h
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--libraries/elementary/src/lib/elm_getting_started.h197
1 files changed, 197 insertions, 0 deletions
diff --git a/libraries/elementary/src/lib/elm_getting_started.h b/libraries/elementary/src/lib/elm_getting_started.h
new file mode 100644
index 0000000..9b11a54
--- /dev/null
+++ b/libraries/elementary/src/lib/elm_getting_started.h
@@ -0,0 +1,197 @@
1/**
2 * @defgroup Start Getting Started
3 * @ingroup Elementary
4 *
5 * To write an Elementary app, you can get started with the following:
6 *
7 * @code
8 * #include <Elementary.h>
9 * EAPI_MAIN int
10 * elm_main(int argc, char **argv)
11 * {
12 * // create window(s) here and do any application init
13 * elm_run(); // run main loop
14 * elm_shutdown(); // after mainloop finishes running, shutdown
15 * return 0; // exit 0 for exit code
16 * }
17 * ELM_MAIN()
18 * @endcode
19 *
20 * To use autotools (which helps in many ways in the long run, like being able
21 * to immediately create releases of your software directly from your tree
22 * and ensure everything needed to build it is there) you will need a
23 * configure.ac, Makefile.am and autogen.sh file.
24 *
25 * configure.ac:
26 *
27 * @verbatim
28 * AC_INIT(myapp, 0.0.0, myname@mydomain.com)
29 * AC_PREREQ(2.52)
30 * AC_CONFIG_SRCDIR(configure.ac)
31 * AM_CONFIG_HEADER(config.h)
32 * AC_PROG_CC
33 * AM_INIT_AUTOMAKE(1.6 dist-bzip2)
34 * PKG_CHECK_MODULES([ELEMENTARY], elementary)
35 * AC_OUTPUT(Makefile)
36 * @endverbatim
37 *
38 * Makefile.am:
39 *
40 * @verbatim
41 * AUTOMAKE_OPTIONS = 1.4 foreign
42 * MAINTAINERCLEANFILES = Makefile.in aclocal.m4 config.h.in configure depcomp install-sh missing
43 *
44 * INCLUDES = -I$(top_srcdir)
45 *
46 * bin_PROGRAMS = myapp
47 *
48 * myapp_SOURCES = main.c
49 * myapp_LDADD = @ELEMENTARY_LIBS@
50 * myapp_CFLAGS = @ELEMENTARY_CFLAGS@
51 * @endverbatim
52 *
53 * autogen.sh:
54 *
55 * @verbatim
56 *#!/bin/sh
57 * echo "Running aclocal..." ; aclocal $ACLOCAL_FLAGS || exit 1
58 * echo "Running autoheader..." ; autoheader || exit 1
59 * echo "Running autoconf..." ; autoconf || exit 1
60 * echo "Running automake..." ; automake --add-missing --copy --gnu || exit 1
61 * ./configure "$@"
62 * @endverbatim
63 *
64 * To generate all the things needed to bootstrap just run:
65 *
66 * @verbatim
67 * ./autogen.sh
68 * @endverbatim
69 *
70 * This will generate Makefile.in's, the configure script and everything else.
71 * After this it works like all normal autotools projects:
72 * @verbatim
73 * ./configure
74 * make
75 * sudo make install
76 * @endverbatim
77 *
78 * Note sudo was assumed to get root permissions, as this would install in
79 * /usr/local which is system-owned. Use any way you like to gain root, or
80 * specify a different prefix with configure:
81 *
82 * @verbatim
83 * ./configure --prefix=$HOME/mysoftware
84 * @endverbatim
85 *
86 * Also remember that autotools buys you some useful commands like:
87 * @verbatim
88 * make uninstall
89 * @endverbatim
90 *
91 * This uninstalls the software after it was installed with "make install".
92 * It is very useful to clear up what you built if you wish to clean the
93 * system.
94 *
95 * @verbatim
96 * make distcheck
97 * @endverbatim
98 *
99 * This firstly checks if your build tree is "clean" and ready for
100 * distribution. It also builds a tarball (myapp-0.0.0.tar.gz) that is
101 * ready to upload and distribute to the world, that contains the generated
102 * Makefile.in's and configure script. The users do not need to run
103 * autogen.sh - just configure and on. They don't need autotools installed.
104 * This tarball also builds cleanly, has all the sources it needs to build
105 * included (that is sources for your application, not libraries it depends
106 * on like Elementary). It builds cleanly in a buildroot and does not
107 * contain any files that are temporarily generated like binaries and other
108 * build-generated files, so the tarball is clean, and no need to worry
109 * about cleaning up your tree before packaging.
110 *
111 * @verbatim
112 * make clean
113 * @endverbatim
114 *
115 * This cleans up all build files (binaries, objects etc.) from the tree.
116 *
117 * @verbatim
118 * make distclean
119 * @endverbatim
120 *
121 * This cleans out all files from the build and from configure's output too.
122 *
123 * @verbatim
124 * make maintainer-clean
125 * @endverbatim
126 *
127 * This deletes all the files autogen.sh will produce so the tree is clean
128 * to be put into a revision-control system (like CVS, SVN or GIT for example).
129 *
130 * There is a more advanced way of making use of the quicklaunch infrastructure
131 * in Elementary (which will not be covered here due to its more advanced
132 * nature).
133 *
134 * Now let's actually create an interactive "Hello World" gui that you can
135 * click the ok button to exit. It's more code because this now does something
136 * much more significant, but it's still very simple:
137 *
138 * @code
139 * #include <Elementary.h>
140 *
141 * static void
142 * on_done(void *data, Evas_Object *obj, void *event_info)
143 * {
144 * // quit the mainloop (elm_run function will return)
145 * elm_exit();
146 * }
147 *
148 * EAPI_MAIN int
149 * elm_main(int argc, char **argv)
150 * {
151 * Evas_Object *win, *box, *lab, *btn;
152 *
153 * // new window - do the usual and give it a name (hello) and title (Hello)
154 * win = elm_win_util_standard_add("hello", "Hello");
155 * // when the user clicks "close" on a window there is a request to delete
156 * evas_object_smart_callback_add(win, "delete,request", on_done, NULL);
157 *
158 * // add a box object - default is vertical. a box holds children in a row,
159 * // either horizontally or vertically. nothing more.
160 * box = elm_box_add(win);
161 * // make the box horizontal
162 * elm_box_horizontal_set(box, EINA_TRUE);
163 * // add object as a resize object for the window (controls window minimum
164 * // size as well as gets resized if window is resized)
165 * elm_win_resize_object_add(win, box);
166 * evas_object_show(box);
167 *
168 * // add a label widget, set the text and put it in the pad frame
169 * lab = elm_label_add(win);
170 * // set default text of the label
171 * elm_object_text_set(lab, "Hello out there world!");
172 * // pack the label at the end of the box
173 * elm_box_pack_end(box, lab);
174 * evas_object_show(lab);
175 *
176 * // add an ok button
177 * btn = elm_button_add(win);
178 * // set default text of button to "OK"
179 * elm_object_text_set(btn, "OK");
180 * // pack the button at the end of the box
181 * elm_box_pack_end(box, btn);
182 * evas_object_show(btn);
183 * // call on_done when button is clicked
184 * evas_object_smart_callback_add(btn, "clicked", on_done, NULL);
185 *
186 * // now we are done, show the window
187 * evas_object_show(win);
188 *
189 * // run the mainloop and process events and callbacks
190 * elm_run();
191 * elm_shutdown();
192 * return 0;
193 * }
194 * ELM_MAIN()
195 * @endcode
196 *
197 */