ajwillia-ms pushed a commit to branch master. http://git.enlightenment.org/tools/examples.git/commit/?id=09ff6b7b62e62482f11632f305128d8e3fe82b64
commit 09ff6b7b62e62482f11632f305128d8e3fe82b64 Author: Andy Williams <[email protected]> Date: Fri Nov 17 15:35:45 2017 +0000 eo-inherit: Remove the interface as we will explain that in multiinherit --- tutorial/c/eo-inherit/src/eo_inherit.h | 2 -- tutorial/c/eo-inherit/src/eo_inherit_main.c | 24 ++++----------------- tutorial/c/eo-inherit/src/example_circle.c | 30 -------------------------- tutorial/c/eo-inherit/src/example_circle.eo | 18 ---------------- tutorial/c/eo-inherit/src/example_rectangle.c | 2 +- tutorial/c/eo-inherit/src/example_rectangle.eo | 11 ++++++---- tutorial/c/eo-inherit/src/example_shape.c | 7 ------ tutorial/c/eo-inherit/src/example_shape.eo | 11 ---------- tutorial/c/eo-inherit/src/meson.build | 2 +- 9 files changed, 13 insertions(+), 94 deletions(-) diff --git a/tutorial/c/eo-inherit/src/eo_inherit.h b/tutorial/c/eo-inherit/src/eo_inherit.h index 4c9fe63..3a1b18a 100644 --- a/tutorial/c/eo-inherit/src/eo_inherit.h +++ b/tutorial/c/eo-inherit/src/eo_inherit.h @@ -9,9 +9,7 @@ #include <Eina.h> #include <Efl_Core.h> -#include "example_shape.eo.h" #include "example_rectangle.eo.h" #include "example_square.eo.h" -#include "example_circle.eo.h" #endif diff --git a/tutorial/c/eo-inherit/src/eo_inherit_main.c b/tutorial/c/eo-inherit/src/eo_inherit_main.c index eb6091f..8a2a2cb 100644 --- a/tutorial/c/eo-inherit/src/eo_inherit_main.c +++ b/tutorial/c/eo-inherit/src/eo_inherit_main.c @@ -1,6 +1,6 @@ #include "eo_inherit.h" -Example_Shape * +Example_Rectangle * _rectangle_create() { Example_Rectangle *rectangle; @@ -13,7 +13,7 @@ _rectangle_create() return rectangle; } -Example_Shape * +Example_Rectangle * _square_create() { Example_Square *square; @@ -25,22 +25,10 @@ _square_create() return square; } -Example_Shape * -_circle_create() -{ - Example_Circle *circle; - - circle = efl_add(EXAMPLE_CIRCLE_CLASS, NULL, - efl_name_set(efl_added, "Circle"), - example_circle_radius_set(efl_added, 5)); - - return circle; -} - void -_shape_print(Example_Shape *shape) +_shape_print(Example_Rectangle *shape) { - printf("Shape named %s has area %d\n", efl_name_get(shape), example_shape_area(shape)); + printf("Shape named %s has area %d\n", efl_name_get(shape), example_rectangle_area(shape)); } EAPI_MAIN void @@ -56,10 +44,6 @@ efl_main(void *data EINA_UNUSED, const Efl_Event *ev EINA_UNUSED) _shape_print(shape); efl_unref(shape); - shape = _circle_create(); - _shape_print(shape); - efl_unref(shape); - efl_exit(0); } EFL_MAIN() diff --git a/tutorial/c/eo-inherit/src/example_circle.c b/tutorial/c/eo-inherit/src/example_circle.c deleted file mode 100644 index 2051a80..0000000 --- a/tutorial/c/eo-inherit/src/example_circle.c +++ /dev/null @@ -1,30 +0,0 @@ -#define EFL_BETA_API_SUPPORT -#include <Eo.h> -#include "example_circle.eo.h" - -#include "eo_inherit.h" - -typedef struct -{ - int radius; -} Example_Circle_Data; - -EOLIAN static void -_example_circle_radius_set(Eo *obj EINA_UNUSED, Example_Circle_Data *pd, int radius) -{ - pd->radius = radius; -} - -EOLIAN static int -_example_circle_radius_get(Eo *obj EINA_UNUSED , Example_Circle_Data *pd) -{ - return pd->radius; -} - -EOLIAN static int -_example_circle_example_shape_area(Eo *obj EINA_UNUSED, Example_Circle_Data *pd) -{ - return (int)(pd->radius * pd->radius * 3.14159f); -} - -#include "example_circle.eo.c" diff --git a/tutorial/c/eo-inherit/src/example_circle.eo b/tutorial/c/eo-inherit/src/example_circle.eo deleted file mode 100644 index 6a91fac..0000000 --- a/tutorial/c/eo-inherit/src/example_circle.eo +++ /dev/null @@ -1,18 +0,0 @@ -class Example.Circle (Efl.Object, Example.Shape) { - [[A circle shape object]] - methods { - @property radius { - [[The radius of this circle]] - set { - } - get { - } - values { - radius: int; - } - } - } - implements { - Example.Shape.area; - } -} diff --git a/tutorial/c/eo-inherit/src/example_rectangle.c b/tutorial/c/eo-inherit/src/example_rectangle.c index f2128bd..f0befe6 100644 --- a/tutorial/c/eo-inherit/src/example_rectangle.c +++ b/tutorial/c/eo-inherit/src/example_rectangle.c @@ -34,7 +34,7 @@ _example_rectangle_height_get(Eo *obj EINA_UNUSED, Example_Rectangle_Data *pd) } EOLIAN static int -_example_rectangle_example_shape_area(Eo *obj EINA_UNUSED, Example_Rectangle_Data *pd) +_example_rectangle_area(Eo *obj EINA_UNUSED, Example_Rectangle_Data *pd) { return pd->width * pd->height; } diff --git a/tutorial/c/eo-inherit/src/example_rectangle.eo b/tutorial/c/eo-inherit/src/example_rectangle.eo index 957f09b..5d53f52 100644 --- a/tutorial/c/eo-inherit/src/example_rectangle.eo +++ b/tutorial/c/eo-inherit/src/example_rectangle.eo @@ -1,4 +1,4 @@ -class Example.Rectangle (Efl.Object, Example.Shape) { +class Example.Rectangle (Efl.Object) { [[A rectangle shape object]] methods { @property width { @@ -21,8 +21,11 @@ class Example.Rectangle (Efl.Object, Example.Shape) { height: int; [[Rectangle height]] } } - } - implements { - Example.Shape.area; + area { + [[Calculate the area of the shape.]] + params { + } + return: int; + } } } diff --git a/tutorial/c/eo-inherit/src/example_shape.c b/tutorial/c/eo-inherit/src/example_shape.c deleted file mode 100644 index 1fc8dd0..0000000 --- a/tutorial/c/eo-inherit/src/example_shape.c +++ /dev/null @@ -1,7 +0,0 @@ -#define EFL_BETA_API_SUPPORT -#include <Eo.h> -#include "example_shape.eo.h" - -#include "eo_inherit.h" - -#include "example_shape.eo.c" diff --git a/tutorial/c/eo-inherit/src/example_shape.eo b/tutorial/c/eo-inherit/src/example_shape.eo deleted file mode 100644 index d2ee74d..0000000 --- a/tutorial/c/eo-inherit/src/example_shape.eo +++ /dev/null @@ -1,11 +0,0 @@ -interface Example.Shape { - [[A generic shape object]] - methods { - area { - [[Calculate the area of the shape.]] - params { - } - return: int; - } - } -} diff --git a/tutorial/c/eo-inherit/src/meson.build b/tutorial/c/eo-inherit/src/meson.build index 4334c40..48c9478 100644 --- a/tutorial/c/eo-inherit/src/meson.build +++ b/tutorial/c/eo-inherit/src/meson.build @@ -1,6 +1,6 @@ eolian_gen = find_program('eolian_gen') -eo_src = ['example_shape', 'example_rectangle', 'example_square', 'example_circle'] +eo_src = ['example_rectangle', 'example_square'] eo_csrc = [] eo_gen = [] --
