2017-11-20 01:36:28 -08:00
|
|
|
#define EFL_BETA_API_SUPPORT 1
|
|
|
|
|
|
|
|
#include <Eina.h>
|
|
|
|
#include <Efl_Core.h>
|
|
|
|
#include "example_rectangle.eo.h"
|
|
|
|
#include "example_square.eo.h"
|
2017-11-15 02:55:04 -08:00
|
|
|
|
2017-11-17 07:35:45 -08:00
|
|
|
Example_Rectangle *
|
2017-11-15 07:02:37 -08:00
|
|
|
_rectangle_create()
|
2017-11-15 02:55:04 -08:00
|
|
|
{
|
|
|
|
Example_Rectangle *rectangle;
|
|
|
|
|
2018-05-25 10:17:51 -07:00
|
|
|
rectangle = efl_new(EXAMPLE_RECTANGLE_CLASS,
|
2017-11-15 02:55:04 -08:00
|
|
|
efl_name_set(efl_added, "Rectangle"),
|
|
|
|
example_rectangle_width_set(efl_added, 5),
|
|
|
|
example_rectangle_height_set(efl_added, 10));
|
|
|
|
|
|
|
|
return rectangle;
|
|
|
|
}
|
|
|
|
|
2017-11-20 01:36:28 -08:00
|
|
|
Example_Square *
|
2017-11-15 02:55:04 -08:00
|
|
|
_square_create()
|
|
|
|
{
|
|
|
|
Example_Square *square;
|
|
|
|
|
2018-05-25 10:17:51 -07:00
|
|
|
square = efl_new(EXAMPLE_SQUARE_CLASS,
|
2017-11-15 02:55:04 -08:00
|
|
|
efl_name_set(efl_added, "Square"),
|
2017-11-15 09:20:42 -08:00
|
|
|
example_rectangle_width_set(efl_added, 7));
|
2017-11-15 02:55:04 -08:00
|
|
|
|
|
|
|
return square;
|
|
|
|
}
|
|
|
|
|
|
|
|
EAPI_MAIN void
|
|
|
|
efl_main(void *data EINA_UNUSED, const Efl_Event *ev EINA_UNUSED)
|
|
|
|
{
|
2017-11-20 01:36:28 -08:00
|
|
|
Eo *rectangle, *square;
|
|
|
|
|
|
|
|
rectangle = _rectangle_create();
|
|
|
|
|
|
|
|
printf("Rectangle is %dx%d, area is %d\n",
|
|
|
|
example_rectangle_width_get(rectangle),
|
|
|
|
example_rectangle_height_get(rectangle),
|
|
|
|
example_rectangle_area(rectangle));
|
|
|
|
|
|
|
|
efl_unref(rectangle);
|
|
|
|
|
|
|
|
square = _square_create();
|
2017-11-15 02:55:04 -08:00
|
|
|
|
2017-11-20 01:36:28 -08:00
|
|
|
printf("Square is %dx%d, area is %d\n",
|
|
|
|
example_rectangle_width_get(square),
|
|
|
|
example_rectangle_height_get(square),
|
|
|
|
example_rectangle_area(square));
|
2017-11-15 02:55:04 -08:00
|
|
|
|
2017-11-20 01:36:28 -08:00
|
|
|
efl_unref(square);
|
2017-11-15 02:55:04 -08:00
|
|
|
|
|
|
|
efl_exit(0);
|
|
|
|
}
|
|
|
|
EFL_MAIN()
|
|
|
|
|