summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXavi Artigas <xavierartigas@yahoo.es>2019-09-19 10:03:41 +0200
committerXavi Artigas <xavierartigas@yahoo.es>2019-09-19 10:03:41 +0200
commit4e0e7c4615dc4af3ef8c8279b417dc1f5c44539d (patch)
tree19dda8f8e04f6e852d30d2d6e5c8e3f0b2c50562
parent74a8e8d7f46c216d9e41eb0a3c85e3c526c4252b (diff)
Update libraries needed by first tutorial.
Original author: Vincent Torri <vincent.torri@gmail.com>
-rw-r--r--pages/develop/tutorials/c/hello-world.md.txt14
1 files changed, 7 insertions, 7 deletions
diff --git a/pages/develop/tutorials/c/hello-world.md.txt b/pages/develop/tutorials/c/hello-world.md.txt
index 8b0d7ca3d..6a607bdc0 100644
--- a/pages/develop/tutorials/c/hello-world.md.txt
+++ b/pages/develop/tutorials/c/hello-world.md.txt
@@ -15,13 +15,12 @@ Using your favorite text editor, create a text file and save it as ``hello-world
15```c 15```c
16#define EFL_BETA_API_SUPPORT 1 16#define EFL_BETA_API_SUPPORT 1
17 17
18#include <Eina.h>
19#include <Efl_Core.h> 18#include <Efl_Core.h>
20``` 19```
21 20
22The new EFL API has been in Beta stage for a while, and some libraries still need that you define the ``EFL_BETA_API_SUPPORT`` symbols before including any EFL library. Don't worry, though, they should not be required any more in the near future. 21The new EFL API has been in Beta stage for a while, and some libraries still need that you define the ``EFL_BETA_API_SUPPORT`` symbols before including any EFL library. Don't worry, though, they should not be required any more in the near future.
23 22
24The 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_Core.h`` headers. 23The 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 just need to include the ``Efl_Core.h`` header which includes ``Eina.h`` and ``Efl.h``.
25 24
26You will explore the EFL libraries in greater depth in later tutorials. Other examples are ``Efl_Net.h`` for network operations and ``Efl_Ui.h`` to create *User Interface* elements like windows and buttons. 25You will explore the EFL libraries in greater depth in later tutorials. Other examples are ``Efl_Net.h`` for network operations and ``Efl_Ui.h`` to create *User Interface* elements like windows and buttons.
27 26
@@ -43,7 +42,7 @@ efl_main(void *data EINA_UNUSED, const Efl_Event *ev EINA_UNUSED)
43 42
44EFL takes care of all initialization tasks and calls your ``efl_main()`` method when everything is ready. 43EFL takes care of all initialization tasks and calls your ``efl_main()`` method when everything is ready.
45 44
46At this point the parameters to ``efl_main()`` are 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. 45At this point the parameters to ``efl_main()`` are 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. Moreover, the ``data`` argument will always be NULL in this tutorials.
47 46
48## Step Three: Print "Hello World" ## 47## Step Three: Print "Hello World" ##
49 48
@@ -84,7 +83,8 @@ This is not mandatory but it simplifies the setup and shutdown processes conside
84 83
85Your program should now look something like this: 84Your program should now look something like this:
86```c 85```c
87#include <Eina.h> 86#define EFL_BETA_API_SUPPORT 1
87
88#include <Efl_Core.h> 88#include <Efl_Core.h>
89 89
90void 90void
@@ -100,7 +100,7 @@ EFL_MAIN()
100Save 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: 100Save 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:
101 101
102```bash 102```bash
103gcc -o hello-world hello-world.c `pkg-config --cflags --libs eina efl elementary` 103gcc -o hello-world hello-world.c `pkg-config --cflags --libs ecore`
104``` 104```
105 105
106If the systems displays no errors, your program should be ready. Test it by typing: 106If the systems displays no errors, your program should be ready. Test it by typing:
@@ -158,8 +158,8 @@ In the above example, if no parameters are passed to your program (``eina_array_
158 158
159At the end of this tutorial you have learned: 159At the end of this tutorial you have learned:
160 160
161* **Header files** must be included for any EFL libraries you intend to use. Typically, these are ``Eina.h`` and ``Efl.h``. 161* **Header files** must be included for any EFL libraries you intend to use. Typically, these are ``Efl_Core.h`` or ``Efl_Ui.h``.
162* Your **main method** should be ``efl_main()``. 162* Your **main method** should be ``efl_main()``.
163* Your EFL programs should **always call ``efl_exit()``** at some stage. 163* Your EFL programs should **always call ``efl_exit()``** at some stage.
164* Your EFL programs should **include the ``EFL_MAIN()`` macro** at the end so EFL can insert its own start-up and shutdown code. 164* Your EFL programs should **include the ``EFL_MAIN()`` macro** at the end so EFL can insert its own start-up and shutdown code.
165* **Command line parameters** are available through the ``Efl_Event *`` parameter in ``efl_main()``, and can be accessed with ``eina_array_count()`` and ``eina_array_data_get()``. \ No newline at end of file 165* **Command line parameters** are available through the ``Efl_Event *`` parameter in ``efl_main()``, and can be accessed with ``eina_array_count()`` and ``eina_array_data_get()``.