2 * @defgroup Start Getting Started
4 * To write an Elementary app, you can get started with the following:
7 * #include <Elementary.h>
9 * elm_main(int argc, char **argv)
11 * // create window(s) here and do any application init
12 * elm_run(); // run main loop
13 * elm_shutdown(); // after mainloop finishes running, shutdown
14 * return 0; // exit 0 for exit code
19 * To use autotools (which helps in many ways in the long run, like being able
20 * to immediately create releases of your software directly from your tree
21 * and ensure everything needed to build it is there) you will need a
22 * configure.ac, Makefile.am and autogen.sh file.
27 * AC_INIT(myapp, 0.0.0, myname@mydomain.com)
29 * AC_CONFIG_SRCDIR(configure.ac)
30 * AM_CONFIG_HEADER(config.h)
32 * AM_INIT_AUTOMAKE(1.6 dist-bzip2)
33 * PKG_CHECK_MODULES([ELEMENTARY], elementary)
40 * AUTOMAKE_OPTIONS = 1.4 foreign
41 * MAINTAINERCLEANFILES = Makefile.in aclocal.m4 config.h.in configure depcomp install-sh missing
43 * INCLUDES = -I$(top_srcdir)
45 * bin_PROGRAMS = myapp
47 * myapp_SOURCES = main.c
48 * myapp_LDADD = @ELEMENTARY_LIBS@
49 * myapp_CFLAGS = @ELEMENTARY_CFLAGS@
56 * echo "Running aclocal..." ; aclocal $ACLOCAL_FLAGS || exit 1
57 * echo "Running autoheader..." ; autoheader || exit 1
58 * echo "Running autoconf..." ; autoconf || exit 1
59 * echo "Running automake..." ; automake --add-missing --copy --gnu || exit 1
63 * To generate all the things needed to bootstrap just run:
70 * This will generate Makefile.in's, the confgure script and everything else.
72 * This will generate Makefile.in's, the configure script and everything else.
73 >>>>>>> remotes/origin/upstream
74 * After this it works like all normal autotools projects:
81 * Note sudo was assumed to get root permissions, as this would install in
82 * /usr/local which is system-owned. Use any way you like to gain root, or
83 * specify a different prefix with configure:
87 * ./confiugre --prefix=$HOME/mysoftware
89 * ./configure --prefix=$HOME/mysoftware
90 >>>>>>> remotes/origin/upstream
93 * Also remember that autotools buys you some useful commands like:
98 * This uninstalls the software after it was installed with "make install".
99 * It is very useful to clear up what you built if you wish to clean the
106 * This firstly checks if your build tree is "clean" and ready for
107 * distribution. It also builds a tarball (myapp-0.0.0.tar.gz) that is
108 * ready to upload and distribute to the world, that contains the generated
109 * Makefile.in's and configure script. The users do not need to run
110 * autogen.sh - just configure and on. They don't need autotools installed.
111 * This tarball also builds cleanly, has all the sources it needs to build
112 * included (that is sources for your application, not libraries it depends
113 * on like Elementary). It builds cleanly in a buildroot and does not
114 * contain any files that are temporarily generated like binaries and other
115 * build-generated files, so the tarball is clean, and no need to worry
116 * about cleaning up your tree before packaging.
122 * This cleans up all build files (binaries, objects etc.) from the tree.
128 * This cleans out all files from the build and from configure's output too.
131 * make maintainer-clean
134 * This deletes all the files autogen.sh will produce so the tree is clean
135 * to be put into a revision-control system (like CVS, SVN or GIT for example).
137 * There is a more advanced way of making use of the quicklaunch infrastructure
138 * in Elementary (which will not be covered here due to its more advanced
141 * Now let's actually create an interactive "Hello World" gui that you can
142 * click the ok button to exit. It's more code because this now does something
143 * much more significant, but it's still very simple:
146 * #include <Elementary.h>
149 * on_done(void *data, Evas_Object *obj, void *event_info)
151 * // quit the mainloop (elm_run function will return)
156 * elm_main(int argc, char **argv)
158 * Evas_Object *win, *box, *lab, *btn;
160 * // new window - do the usual and give it a name (hello) and title (Hello)
161 * win = elm_win_util_standard_add("hello", "Hello");
162 * // when the user clicks "close" on a window there is a request to delete
163 * evas_object_smart_callback_add(win, "delete,request", on_done, NULL);
165 * // add a box object - default is vertical. a box holds children in a row,
166 * // either horizontally or vertically. nothing more.
167 * box = elm_box_add(win);
169 * // make the box hotizontal
171 * // make the box horizontal
172 >>>>>>> remotes/origin/upstream
173 * elm_box_horizontal_set(box, EINA_TRUE);
174 * // add object as a resize object for the window (controls window minimum
175 * // size as well as gets resized if window is resized)
176 * elm_win_resize_object_add(win, box);
177 * evas_object_show(box);
179 * // add a label widget, set the text and put it in the pad frame
180 * lab = elm_label_add(win);
181 * // set default text of the label
182 * elm_object_text_set(lab, "Hello out there world!");
183 * // pack the label at the end of the box
184 * elm_box_pack_end(box, lab);
185 * evas_object_show(lab);
187 * // add an ok button
188 * btn = elm_button_add(win);
189 * // set default text of button to "OK"
190 * elm_object_text_set(btn, "OK");
191 * // pack the button at the end of the box
192 * elm_box_pack_end(box, btn);
193 * evas_object_show(btn);
194 * // call on_done when button is clicked
195 * evas_object_smart_callback_add(btn, "clicked", on_done, NULL);
197 * // now we are done, show the window
198 * evas_object_show(win);
200 * // run the mainloop and process events and callbacks