WWW-www.enlightenment.org pushed a commit to branch master. http://git.enlightenment.org/website/www-content.git/commit/?id=02758817990751b07fb6f8fe8f0be9aeba98a410
commit 02758817990751b07fb6f8fe8f0be9aeba98a410 Author: Xavi Artigas <xavierarti...@yahoo.es> Date: Mon Nov 13 02:49:21 2017 -0800 Wiki page hello-world.md changed with summary [Assorted fixes] by Xavi Artigas --- pages/develop/tutorial/c/hello-world.md.txt | 29 +++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/pages/develop/tutorial/c/hello-world.md.txt b/pages/develop/tutorial/c/hello-world.md.txt index 38a3defc..aa7df2bb 100644 --- a/pages/develop/tutorial/c/hello-world.md.txt +++ b/pages/develop/tutorial/c/hello-world.md.txt @@ -8,22 +8,27 @@ This tutorial will guide you through the necessary steps to build your first "He There is very little code in this first tutorial so don't worry if you have little coding experience. The main goal is to build and execute an application using EFL. You will need a basic knowledge of C to get started. -## Step One: Includes ## +## Step One: Defines and Includes ## Using your favorite text editor, create a text file and save it as ``hello-world.c``. Type in the following: ```c +#define EFL_EO_API_SUPPORT 1 +#define EFL_BETA_API_SUPPORT 1 + #include <Eina.h> #include <Efl.h> #include <Elementary.h> ``` -The EFL is split into several libraries. You only need to include the ones you actually want to use. In this tutorial we are calling methods from the ``Eina`` and ``Efl`` libraries, therefore we need to include the ``Eina.h`` and ``Efl.h`` headers. +The new EFL API has been in Beta stage for a while, and some libraries still need that you define the ``EFL_EO_API_SUPPORT`` and ``EFL_BETA_API_SUPPORT`` symbols before including any EFL library. Don't worry, though, they should not be required anymore in the near future. + +The EFL is split into several libraries. You only need to include the ones you actually want to use. In this tutorial you will be calling methods from the ``Eina`` and ``Efl`` libraries, therefore you need to include the ``Eina.h`` and ``Efl.h`` headers. > **NOTE:** > The ``Elementary.h`` header is special and required for the program to > compile. It will be removed soon, however. -If you're not sure which libraries your program is actually using just look at the prefix of the EFL methods and macros. In this case we're using ``eina_``, ``EINA_``, ``efl_`` and ``EFL_``. +If you're not sure which libraries your program is actually using just look at the prefix of the EFL methods and macros. In this case you will be using ``eina_``, ``EINA_``, ``efl_`` and ``EFL_``. You will explore the EFL libraries in greater depth in later tutorials. In the meantime, visit the [List of EFL Libraries](list-of-efl-libraries.md) for an overview of the purpose of each one. @@ -40,7 +45,7 @@ efl_main(void *data EINA_UNUSED, const Efl_Event *ev EINA_UNUSED) EFL takes care of all initialization tasks and calls your ``efl_main()`` method when everything is ready. -We will focus on the ``efl_main()`` parameters in the following tutorial. In this one we're not using them, hence the ``EINA_UNUSED`` macro. This is optional but it gets rid of warnings regarding unused parameters so it's worth having. +The following tutorial will focus on the ``efl_main()`` parameters. In this one they're not being used, hence the ``EINA_UNUSED`` macro. This is optional but it gets rid of warnings regarding unused parameters so it's worth having. ## Step Three: Print "Hello World" ## @@ -62,7 +67,7 @@ Any programs you create with EFL must always terminate by calling ``efl_exit()`` The parameter ``efl_exit()`` is the value your program returns to the operating system. -## Step Five: Automatic EFL setup and Shutdown ## +## Step Five: Automatic EFL Setup and Shutdown ## This final piece of "boilerplate" code should be included at the end of every EFL program. Type the following at the very end of your program as the last line: @@ -72,7 +77,7 @@ EFL_MAIN() This defines the real ``main()`` method required by C programs, which deals with initialization and deinitilization tasks. It also eventually calls the ``efl_main()`` method that you defined above. -This is not mandatory but it simplifies the setup and shutdown processes considerably, so we are going to use it in this series of tutorials. +This is not mandatory but it simplifies the setup and shutdown processes considerably, so it is going to be used a lot in this series of tutorials. ## The Complete Program ## @@ -93,10 +98,10 @@ EFL_MAIN() ## Running the Program ## -Save the program then build it as outlined in [Setting up the Development Environment](/develop/setup/c/#Building). If you are using the ``gcc`` compiler, run: +Save the program then build it as outlined in [Setting up the Development Environment](/develop/setup/c/#Building). As a reminder, if you are using the ``gcc`` compiler, run: ```bash -gcc -o hello-world hello-world.c `pkg-config --cflags --libs eina efl elementary` -DEFL_EO_API_SUPPORT=1 -DEFL_BETA_API_SUPPORT=1 +gcc -o hello-world hello-world.c `pkg-config --cflags --libs eina efl elementary` ``` If the systems displays no errors, your program should be ready. Test it by typing: @@ -111,9 +116,9 @@ The words ``Hello World!`` will now appear on the screen. At the end of this tutorial you have learned: -* Header files must be included for any EFL libraries you intend to use. Typically, these are ``Eina.h`` and ``Efl.h``. -* Your main method should be ``efl_main()``. -* Your EFL programs should always call ``efl_exit()`` at some stage. -* Your EFL programs should include the ``EFL_MAIN()`` macro at the end so EFL can insert its own start-up and shutdown code. +* **Header files** must be included for any EFL libraries you intend to use. Typically, these are ``Eina.h`` and ``Efl.h``. +* Your **main method** should be ``efl_main()``. +* Your EFL programs should **always call ``efl_exit()``** at some stage. +* Your EFL programs should **include the ``EFL_MAIN()`` macro** at the end so EFL can insert its own start-up and shutdown code. The next tutorial keeps introducing more basic concepts, and shows how to retrieve the command line parameters passed to your program. \ No newline at end of file --