Examples: Remove eo examples.

Those were always bad, inaccurate and outdated, and are not really needed
because you should be using Eolian, and not Eo directly.
This commit is contained in:
Tom Hacohen 2016-03-02 16:11:35 +00:00
parent bf73a1b51f
commit d10f030d2c
30 changed files with 0 additions and 1306 deletions

2
eo/.gitignore vendored
View File

@ -1,2 +0,0 @@
/eo_isa
/eo_simple

View File

@ -1,103 +0,0 @@
MAINTAINERCLEANFILES = Makefile.in
AM_CPPFLAGS = \
-I$(top_builddir)/src/lib/efl \
-I. \
-I$(top_srcdir)/src/lib/eina \
-I$(top_srcdir)/src/lib/eo \
-I$(top_builddir)/src/lib/eina \
-I$(top_builddir)/src/lib/eo \
@EO_CFLAGS@
EXTRA_PROGRAMS = eo_isa eo_simple
if EO_BUILD_EXAMPLE_EVAS
EXTRA_PROGRAMS += eo_evas
endif
eo_isa_SOURCES = \
isa/eo_isa_complex.c \
isa/eo_isa_complex.h \
isa/eo_isa_interface.c \
isa/eo_isa_interface.h \
isa/eo_isa_main.c \
isa/eo_isa_mixin.c \
isa/eo_isa_mixin.h \
isa/eo_isa_simple.c \
isa/eo_isa_simple.h
eo_isa_LDADD = $(top_builddir)/src/lib/eo/libeo.la $(top_builddir)/src/lib/eina/libeina.la @EO_LDFLAGS@ @EFL_PTHREAD_LIBS@
if EO_BUILD_EXAMPLE_EVAS
AM_CPPFLAGS += @ELM_CFLAGS@
eo_evas_SOURCES = \
evas/evas_elw_box.c \
evas/evas_elw_box.h \
evas/evas_elw_boxedbutton.c \
evas/evas_elw_boxedbutton.h \
evas/evas_elw_button.c \
evas/evas_elw_button.h \
evas/evas_elw_win.h \
evas/evas_elw_win.c \
evas/evas_evas_obj.c \
evas/evas_evas_obj.h \
evas/evas_test.c
eo_evas_LDADD = $(top_builddir)/src/lib/eo/libeo.la @ELM_LIBS@ @EO_LDFLAGS@ @EFL_PTHREAD_LIBS@
endif
eo_simple_SOURCES = \
simple/simple_interface.c \
simple/simple_interface.h \
simple/simple_main.c \
simple/simple_mixin.c \
simple/simple_mixin.h \
simple/simple_simple.c \
simple/simple_simple.h
eo_simple_LDADD = $(top_builddir)/src/lib/eo/libeo.la $(top_builddir)/src/lib/eina/libeina.la @EO_LDFLAGS@ @EFL_PTHREAD_LIBS@
DATA_FILES = Makefile.examples
EXTRA_DIST = $(DATA_FILES)
examples: $(EXTRA_PROGRAMS)
clean-local:
rm -f $(EXTRA_PROGRAMS)
install-examples:
$(MKDIR_P) $(datadir)/eo/examples
$(MKDIR_P) $(datadir)/eo/examples/isa
$(MKDIR_P) $(datadir)/eo/examples/simple
cd $(srcdir); \
$(install_sh_DATA) -c $(DATA_FILES) $(datadir)/eo/examples; \
$(install_sh_DATA) -c $(eo_isa_SOURCES) $(datadir)/eo/examples/isa; \
$(install_sh_DATA) -c $(eo_simple_SOURCES) $(datadir)/eo/examples/simple;
if EO_BUILD_EXAMPLE_EVAS
$(MKDIR_P) $(datadir)/eo/examples/evas
cd $(srcdir) && $(install_sh_DATA) -c $(eo_evas_SOURCES) $(datadir)/eo/examples/evas
endif
uninstall-local:
for f in $(DATA_FILES) ; do \
rm -f $(datadir)/eo/examples/$$f ; \
done
for f in $(eo_isa_SOURCES) ; do \
rm -f $(datadir)/eo/examples/isa/$$f ; \
done
for f in $(eo_simple_SOURCES) ; do \
rm -f $(datadir)/eo/examples/simple/$$f ; \
done
for f in $(eo_evas_SOURCES) ; do \
rm -f $(datadir)/eo/examples/evas/$$f ; \
done
if ALWAYS_BUILD_EXAMPLES
noinst_PROGRAMS = $(EXTRA_PROGRAMS)
endif

View File

@ -1,42 +0,0 @@
CC=gcc
COMMON_FLAGS=`pkg-config --libs --cflags eo`
EXTRA_FLAGS=`pkg-config --libs --cflags evas,elementary`
SIMPLE= simple/simple_main.c \
simple/simple_interface.c \
simple/simple_mixin.c \
simple/simple_simple.c
ISA= isa/eo_isa_main.c \
isa/eo_isa_complex.c \
isa/eo_isa_interface.c \
isa/eo_isa_simple.c \
isa/eo_isa_mixin.c
EVAS= evas/evas_test.c \
evas/evas_elw_box.c \
evas/evas_elw_boxedbutton.c \
evas/evas_elw_button.c \
evas/evas_elw_win.c \
evas/evas_evas_obj.c
EXAMPLES= eo_simple \
eo_isa
all: examples
examples: $(EXAMPLES)
@echo "To build optional evas examples, run: make Makefile.examples eo_evas"
eo_simple:
$(CC) -o $@ $(SIMPLE) $(COMMON_FLAGS)
eo_isa:
$(CC) -o $@ $(ISA) $(COMMON_FLAGS)
eo_evas:
$(CC) -o $@ $(EVAS) $(COMMON_FLAGS) $(EXTRA_FLAGS)
clean:
@echo "Cleaning up built objects..."
@rm -Rf $(EXAMPLES) eo_evas

View File

@ -1,74 +0,0 @@
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include <Elementary.h>
#include "Eo.h"
#include "evas_evas_obj.h"
#include "evas_elw_box.h"
EAPI Eo_Op ELW_BOX_BASE_ID = 0;
typedef struct
{
Evas_Object *bx;
} Widget_Data;
#define MY_CLASS ELW_BOX_CLASS
static void
_pack_end(Eo *obj EINA_UNUSED, void *class_data, va_list *list)
{
Widget_Data *wd = class_data;
Eo *child_obj;
child_obj = va_arg(*list, Eo *);
/* FIXME: Ref and the later uref child_obj here... */
elm_box_pack_end(wd->bx, eo_evas_object_get(child_obj));
}
static void
_constructor(Eo *obj, void *class_data, va_list *list EINA_UNUSED)
{
eo_constructor(eo_super(obj, MY_CLASS));
Widget_Data *wd = class_data;
/* FIXME: An hack, because our tree is not yet only Eo */
wd->bx = elm_box_add(eo_evas_object_get(eo_parent_get(obj)));
evas_object_size_hint_align_set(wd->bx, EVAS_HINT_FILL, EVAS_HINT_FILL);
evas_object_size_hint_weight_set(wd->bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
eo_evas_object_set(obj, wd->bx);
}
static void
_class_constructor(Eo_Class *klass)
{
const Eo_Op_Func_Description func_desc[] = {
EO_OP_FUNC(EO_BASE_ID(EO_BASE_SUB_ID_CONSTRUCTOR), _constructor),
EO_OP_FUNC(ELW_BOX_ID(ELW_BOX_SUB_ID_PACK_END), _pack_end),
EO_OP_FUNC_SENTINEL
};
eo_class_funcs_set(klass, func_desc);
}
static const Eo_Op_Description op_desc[] = {
EO_OP_DESCRIPTION(ELW_BOX_SUB_ID_PACK_END, "Pack obj at the end of box."),
EO_OP_DESCRIPTION_SENTINEL
};
static const Eo_Class_Description class_desc = {
EO_VERSION,
"Elw Box",
EO_CLASS_TYPE_REGULAR,
EO_CLASS_DESCRIPTION_OPS(&ELW_BOX_BASE_ID, op_desc, ELW_BOX_SUB_ID_LAST),
NULL,
sizeof(Widget_Data),
_class_constructor,
NULL
};
EO_DEFINE_CLASS(elw_box_class_get, &class_desc, EXEVAS_OBJ_CLASS, NULL)

View File

@ -1,25 +0,0 @@
#ifndef ELW_BOX_H
#define ELW_BOX_H
#include "Eo.h"
extern EAPI Eo_Op ELW_BOX_BASE_ID;
enum {
ELW_BOX_SUB_ID_PACK_END,
ELW_BOX_SUB_ID_LAST
};
#define ELW_BOX_ID(sub_id) (ELW_BOX_BASE_ID + sub_id)
/**
* @def elw_box_pack_end(obj)
* @brief Pack object to the end of the box
* @param[in] obj object to pack into box
*/
#define elw_box_pack_end(obj) ELW_BOX_ID(ELW_BOX_SUB_ID_PACK_END), EO_TYPECHECK(Eo *, obj)
#define ELW_BOX_CLASS elw_box_class_get()
const Eo_Class *elw_box_class_get(void);
#endif

View File

@ -1,57 +0,0 @@
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include <Elementary.h>
#include "Eo.h"
#include "evas_evas_obj.h"
#include "evas_elw_box.h"
#include "evas_elw_button.h"
#include "evas_elw_boxedbutton.h"
typedef struct
{
// Evas_Object *bx;
} Widget_Data;
#define MY_CLASS ELW_BOXEDBUTTON_CLASS
static void
_constructor(Eo *obj, void *class_data EINA_UNUSED, va_list *list EINA_UNUSED)
{
eo_constructor(eo_super(obj, MY_CLASS));
Eo *bt = eo_add(ELW_BUTTON_CLASS, obj);
eo_composite_attach(obj, bt);
eo_event_callback_forwarder_add(bt, EV_CLICKED, obj);
exevas_obj_visibility_set(bt, EINA_TRUE);
elw_box_pack_end(obj, bt);
eo_unref(bt);
}
static void
_class_constructor(Eo_Class *klass)
{
const Eo_Op_Func_Description func_desc[] = {
EO_OP_FUNC(EO_BASE_ID(EO_BASE_SUB_ID_CONSTRUCTOR), _constructor),
EO_OP_FUNC_SENTINEL
};
eo_class_funcs_set(klass, func_desc);
}
static const Eo_Class_Description class_desc = {
EO_VERSION,
"Elw BoxedButton",
EO_CLASS_TYPE_REGULAR,
EO_CLASS_DESCRIPTION_OPS(NULL, NULL, 0),
NULL,
sizeof(Widget_Data),
_class_constructor,
NULL
};
EO_DEFINE_CLASS(elw_boxedbutton_class_get, &class_desc, ELW_BOX_CLASS, ELW_BUTTON_CLASS, NULL)

View File

@ -1,9 +0,0 @@
#ifndef ELW_BOXEDBUTTON_H
#define ELW_BOXEDBUTTON_H
#include "Eo.h"
#define ELW_BOXEDBUTTON_CLASS elw_boxedbutton_class_get()
const Eo_Class *elw_boxedbutton_class_get(void);
#endif

View File

@ -1,115 +0,0 @@
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include <Elementary.h>
#include "Eo.h"
#include "evas_evas_obj.h"
#include "evas_elw_button.h"
EAPI Eo_Op ELW_BUTTON_BASE_ID = 0;
EAPI const Eo_Event_Description _EV_CLICKED =
EO_EVENT_DESCRIPTION("clicked");
typedef struct
{
Evas_Object *bt;
} Widget_Data;
#define MY_CLASS ELW_BUTTON_CLASS
static void
_position_set(Eo *obj, void *class_data EINA_UNUSED, va_list *list)
{
(void) obj;
Evas_Coord x, y;
x = va_arg(*list, Evas_Coord);
y = va_arg(*list, Evas_Coord);
printf("But set position %d,%d\n", x, y);
exevas_obj_position_set(eo_super(obj, MY_CLASS), x, y);
}
static void
_text_set(Eo *obj EINA_UNUSED, void *class_data, va_list *list)
{
Widget_Data *wd = class_data;
const char *text;
text = va_arg(*list, const char *);
elm_object_text_set(wd->bt, text);
}
static void
_btn_clicked(void *data, Evas_Object *evas_obj, void *event_info)
{
(void) evas_obj;
(void) event_info;
Eo *obj = data;
eo_event_callback_call(obj, EV_CLICKED, NULL, NULL);
}
static void
_constructor(Eo *obj, void *class_data, va_list *list EINA_UNUSED)
{
eo_constructor(eo_super(obj, MY_CLASS));
Widget_Data *wd = class_data;
/* FIXME: An hack, because our tree is not yet only Eo */
wd->bt = elm_button_add(eo_evas_object_get(eo_parent_get(obj)));
evas_object_size_hint_align_set(wd->bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
evas_object_size_hint_weight_set(wd->bt, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
evas_object_smart_callback_add(wd->bt, "clicked", _btn_clicked, obj);
eo_evas_object_set(obj, wd->bt);
}
static void
_destructor(Eo *obj, void *class_data EINA_UNUSED, va_list *list EINA_UNUSED)
{
eo_destructor(eo_super(obj, MY_CLASS));
//Widget_Data *wd = class_data;
/* FIXME: Commented out because it's automatically done because our tree
* is not made of only eo */
//evas_object_del(wd->bt);
}
static void
_class_constructor(Eo_Class *klass)
{
const Eo_Op_Func_Description func_desc[] = {
EO_OP_FUNC(EO_BASE_ID(EO_BASE_SUB_ID_CONSTRUCTOR), _constructor),
EO_OP_FUNC(EO_BASE_ID(EO_BASE_SUB_ID_DESTRUCTOR), _destructor),
EO_OP_FUNC(ELW_BUTTON_ID(ELW_BUTTON_SUB_ID_TEXT_SET), _text_set),
EO_OP_FUNC(EXEVAS_OBJ_ID(EXEVAS_OBJ_SUB_ID_POSITION_SET), _position_set),
EO_OP_FUNC_SENTINEL
};
eo_class_funcs_set(klass, func_desc);
}
static const Eo_Op_Description op_desc[] = {
EO_OP_DESCRIPTION(ELW_BUTTON_SUB_ID_TEXT_SET, "Text of a text supporting evas object."), // FIXME: This ID sholudn't really be defined here...
EO_OP_DESCRIPTION_SENTINEL
};
static const Eo_Event_Description *event_desc[] = {
EV_CLICKED,
NULL
};
static const Eo_Class_Description class_desc = {
EO_VERSION,
"Elw Button",
EO_CLASS_TYPE_REGULAR,
EO_CLASS_DESCRIPTION_OPS(&ELW_BUTTON_BASE_ID, op_desc, ELW_BUTTON_SUB_ID_LAST),
event_desc,
sizeof(Widget_Data),
_class_constructor,
NULL
};
EO_DEFINE_CLASS(elw_button_class_get, &class_desc, EXEVAS_OBJ_CLASS, NULL)

View File

@ -1,29 +0,0 @@
#ifndef ELW_BUTTON_H
#define ELW_BUTTON_H
#include "Eo.h"
extern EAPI Eo_Op ELW_BUTTON_BASE_ID;
enum {
ELW_BUTTON_SUB_ID_TEXT_SET,
ELW_BUTTON_SUB_ID_LAST
};
#define ELW_BUTTON_ID(sub_id) (ELW_BUTTON_BASE_ID + sub_id)
/**
* @def elw_button_text_set(text)
* @brief Set button text
* @param[in] text text to assing to button
* FIXME Doesn't belong here, but just for the example...
*/
#define elw_button_text_set(text) ELW_BUTTON_ID(ELW_BUTTON_SUB_ID_TEXT_SET), EO_TYPECHECK(const char *, text)
extern const Eo_Event_Description _EV_CLICKED;
#define EV_CLICKED (&(_EV_CLICKED))
#define ELW_BUTTON_CLASS elw_button_class_get()
const Eo_Class *elw_button_class_get(void);
#endif

View File

@ -1,74 +0,0 @@
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include <Elementary.h>
#include "Eo.h"
#include "evas_evas_obj.h"
#include "evas_elw_win.h"
typedef struct
{
Evas_Object *win;
Evas_Object *bg;
} Widget_Data;
#define MY_CLASS ELW_WIN_CLASS
static void
my_win_del(void *data, Evas_Object *obj, void *event_info)
{
/* called when my_win_main is requested to be deleted */
elm_exit(); /* exit the program's main loop that runs in elm_run() */
(void) data;
(void) obj;
(void) event_info;
}
static void
_constructor(Eo *obj, void *class_data, va_list *list EINA_UNUSED)
{
eo_constructor(eo_super(obj, MY_CLASS));
Widget_Data *wd = class_data;
/* FIXME: Will actually do something about those when I care... */
wd->win = elm_win_add(NULL, "eo-test", ELM_WIN_BASIC);
elm_win_title_set(wd->win, "Eo Test");
elm_win_autodel_set(wd->win, EINA_TRUE);
evas_object_smart_callback_add(wd->win, "delete,request", my_win_del, NULL);
wd->bg = elm_bg_add(wd->win);
elm_win_resize_object_add(wd->win, wd->bg);
evas_object_size_hint_weight_set(wd->bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
evas_object_show(wd->bg);
eo_evas_object_set(obj, wd->win);
}
static void
_class_constructor(Eo_Class *klass)
{
const Eo_Op_Func_Description func_desc[] = {
EO_OP_FUNC(EO_BASE_ID(EO_BASE_SUB_ID_CONSTRUCTOR), _constructor),
EO_OP_FUNC_SENTINEL
};
eo_class_funcs_set(klass, func_desc);
}
static const Eo_Class_Description class_desc = {
EO_VERSION,
"Elw Win",
EO_CLASS_TYPE_REGULAR,
EO_CLASS_DESCRIPTION_OPS(NULL, NULL, 0),
NULL,
sizeof(Widget_Data),
_class_constructor,
NULL
};
EO_DEFINE_CLASS(elw_win_class_get, &class_desc, EXEVAS_OBJ_CLASS, NULL)

View File

@ -1,9 +0,0 @@
#ifndef ELW_WIN_H
#define ELW_WIN_H
#include "Eo.h"
#define ELW_WIN_CLASS elw_win_class_get()
const Eo_Class *elw_win_class_get(void);
#endif

View File

@ -1,146 +0,0 @@
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include <Elementary.h>
#include "Eo.h"
#include "evas_evas_obj.h"
#define MY_CLASS EXEVAS_OBJ_CLASS
EAPI Eo_Op EXEVAS_OBJ_BASE_ID = 0;
typedef struct
{
Eina_List *children;
} Widget_Data;
static void
_position_set(Eo *obj, void *class_data EINA_UNUSED, va_list *list)
{
Evas_Object *evas_obj = eo_evas_object_get(obj);
Evas_Coord x, y;
x = va_arg(*list, Evas_Coord);
y = va_arg(*list, Evas_Coord);
evas_object_move(evas_obj, x, y);
}
static void
_size_set(Eo *obj, void *class_data EINA_UNUSED, va_list *list)
{
Evas_Object *evas_obj = eo_evas_object_get(obj);
Evas_Coord w, h;
w = va_arg(*list, Evas_Coord);
h = va_arg(*list, Evas_Coord);
evas_object_resize(evas_obj, w, h);
}
static void
_color_set(Eo *obj, void *class_data EINA_UNUSED, va_list *list)
{
Evas_Object *evas_obj = eo_evas_object_get(obj);
int r, g, b, a;
r = va_arg(*list, int);
g = va_arg(*list, int);
b = va_arg(*list, int);
a = va_arg(*list, int);
evas_object_color_set(evas_obj, r, g, b, a);
}
static void
_color_get(Eo *obj, void *class_data EINA_UNUSED, va_list *list)
{
Evas_Object *evas_obj = eo_evas_object_get(obj);
int *r, *g, *b, *a;
r = va_arg(*list, int *);
g = va_arg(*list, int *);
b = va_arg(*list, int *);
a = va_arg(*list, int *);
evas_object_color_get(evas_obj, r, g, b, a);
}
static void
_visibility_set(Eo *obj, void *class_data EINA_UNUSED, va_list *list)
{
Evas_Object *evas_obj = eo_evas_object_get(obj);
Eina_Bool v;
v = va_arg(*list, int);
if (v) evas_object_show(evas_obj);
else evas_object_hide(evas_obj);
}
static void
_child_add(Eo *obj, void *class_data, va_list *list)
{
Widget_Data *wd = class_data;
Eo *child;
child = va_arg(*list, Eo *);
wd->children = eina_list_append(wd->children, eo_xref(child, obj));
}
static void
_constructor(Eo *obj, void *class_data EINA_UNUSED, va_list *list EINA_UNUSED)
{
eo_constructor(eo_super(obj, MY_CLASS));
/* Add type check. */
Eo *parent = eo_parent_get(obj);
if (parent)
exevas_obj_child_add(parent, obj);
}
static void
_destructor(Eo *obj, void *class_data, va_list *list EINA_UNUSED)
{
eo_destructor(eo_super(obj, MY_CLASS));
Widget_Data *wd = class_data;
Eo *child;
EINA_LIST_FREE(wd->children, child)
{
eo_xunref(child, obj);
}
}
static void
_class_constructor(Eo_Class *klass)
{
const Eo_Op_Func_Description func_desc[] = {
EO_OP_FUNC(EO_BASE_ID(EO_BASE_SUB_ID_CONSTRUCTOR), _constructor),
EO_OP_FUNC(EO_BASE_ID(EO_BASE_SUB_ID_DESTRUCTOR), _destructor),
EO_OP_FUNC(EXEVAS_OBJ_ID(EXEVAS_OBJ_SUB_ID_POSITION_SET), _position_set),
EO_OP_FUNC(EXEVAS_OBJ_ID(EXEVAS_OBJ_SUB_ID_SIZE_SET), _size_set),
EO_OP_FUNC(EXEVAS_OBJ_ID(EXEVAS_OBJ_SUB_ID_COLOR_SET), _color_set),
EO_OP_FUNC(EXEVAS_OBJ_ID(EXEVAS_OBJ_SUB_ID_COLOR_GET), _color_get),
EO_OP_FUNC(EXEVAS_OBJ_ID(EXEVAS_OBJ_SUB_ID_VISIBILITY_SET), _visibility_set),
EO_OP_FUNC(EXEVAS_OBJ_ID(EXEVAS_OBJ_SUB_ID_CHILD_ADD), _child_add),
EO_OP_FUNC_SENTINEL
};
eo_class_funcs_set(klass, func_desc);
}
static const Eo_Op_Description op_desc[] = {
EO_OP_DESCRIPTION(EXEVAS_OBJ_SUB_ID_POSITION_SET, "Position of an evas object."),
EO_OP_DESCRIPTION(EXEVAS_OBJ_SUB_ID_SIZE_SET, "Size of an evas object."),
EO_OP_DESCRIPTION(EXEVAS_OBJ_SUB_ID_COLOR_SET, "Color of an evas object."),
EO_OP_DESCRIPTION(EXEVAS_OBJ_SUB_ID_COLOR_GET, "Color of an evas object."),
EO_OP_DESCRIPTION(EXEVAS_OBJ_SUB_ID_VISIBILITY_SET, "Visibility of an evas object."),
EO_OP_DESCRIPTION(EXEVAS_OBJ_SUB_ID_CHILD_ADD, "Add a child eo."),
EO_OP_DESCRIPTION_SENTINEL
};
static const Eo_Class_Description class_desc = {
EO_VERSION,
"Evas Object",
EO_CLASS_TYPE_REGULAR_NO_INSTANT,
EO_CLASS_DESCRIPTION_OPS(&EXEVAS_OBJ_BASE_ID, op_desc, EXEVAS_OBJ_SUB_ID_LAST),
NULL,
sizeof(Widget_Data),
_class_constructor,
NULL
};
EO_DEFINE_CLASS(evas_object_class_get, &class_desc, EO_CLASS, NULL)

View File

@ -1,90 +0,0 @@
#ifndef EXEVAS_OBJ_H
#define EXEVAS_OBJ_H
#include "Eo.h"
extern EAPI Eo_Op EXEVAS_OBJ_BASE_ID;
enum {
EXEVAS_OBJ_SUB_ID_POSITION_SET,
EXEVAS_OBJ_SUB_ID_SIZE_SET,
EXEVAS_OBJ_SUB_ID_COLOR_SET,
EXEVAS_OBJ_SUB_ID_COLOR_GET,
EXEVAS_OBJ_SUB_ID_VISIBILITY_SET,
EXEVAS_OBJ_SUB_ID_CHILD_ADD,
EXEVAS_OBJ_SUB_ID_LAST
};
#define EXEVAS_OBJ_ID(sub_id) (EXEVAS_OBJ_BASE_ID + sub_id)
/**
* @def exevas_obj_position_set(x, y)
* @brief Set object's position
* @param[in] x object's X position
* @param[in] y object's Y position
*/
#define exevas_obj_position_set(x, y) EXEVAS_OBJ_ID(EXEVAS_OBJ_SUB_ID_POSITION_SET), EO_TYPECHECK(Evas_Coord, x), EO_TYPECHECK(Evas_Coord, y)
/**
* @def exevas_obj_size_set(w, h)
* @brief Set object's size
* @param[in] w object's width
* @param[in] h object's height
*/
#define exevas_obj_size_set(w, h) EXEVAS_OBJ_ID(EXEVAS_OBJ_SUB_ID_SIZE_SET), EO_TYPECHECK(Evas_Coord, w), EO_TYPECHECK(Evas_Coord, h)
/**
* @def exevas_obj_color_set(r, g, b, a)
* @brief Set object's color
* @param[in] r r-value of color
* @param[in] g g-value of color
* @param[in] b b-value of color
* @param[in] a a-value of color
*/
#define exevas_obj_color_set(r, g, b, a) EXEVAS_OBJ_ID(EXEVAS_OBJ_SUB_ID_COLOR_SET), EO_TYPECHECK(int, r), EO_TYPECHECK(int, g), EO_TYPECHECK(int, b), EO_TYPECHECK(int, a)
/**
* @def exevas_obj_color_get(r, g, b, a)
* @brief Set object's position
* @param[out] r integer pointer for r-value of color
* @param[out] g integer pointer for g-value of color
* @param[out] b integer pointer for b-value of color
* @param[out] a integer pointer for a-value of color
*/
#define exevas_obj_color_get(r, g, b, a) EXEVAS_OBJ_ID(EXEVAS_OBJ_SUB_ID_COLOR_GET), EO_TYPECHECK(int *, r), EO_TYPECHECK(int *, g), EO_TYPECHECK(int *, b), EO_TYPECHECK(int *, a)
/**
* @def exevas_obj_visibility_set(v)
* @brief Set object's visible property
* @param[in] v True/False value
*/
#define exevas_obj_visibility_set(v) EXEVAS_OBJ_ID(EXEVAS_OBJ_SUB_ID_VISIBILITY_SET), EO_TYPECHECK(Eina_Bool, v)
/**
* @def exevas_obj_child_add(child)
* @brief Add child to current object
* @param[in] pointer to child object
*/
#define exevas_obj_child_add(child) EXEVAS_OBJ_ID(EXEVAS_OBJ_SUB_ID_CHILD_ADD), EO_TYPECHECK(Eo *, child)
#define EXEVAS_OBJ_CLASS evas_object_class_get()
const Eo_Class *evas_object_class_get(void);
#define EXEVAS_OBJ_STR "Evas_Obj"
/* FIXME: Hack in the meanwhile. */
static inline Evas_Object *
eo_evas_object_get(const Eo *obj)
{
void *data;
eo_key_data_get((Eo *) obj, EXEVAS_OBJ_STR, &data);
return data;
}
/* FIXME: Hack in the meanwhile. */
static inline void
eo_evas_object_set(Eo *obj, Evas_Object *evas_obj)
{
eo_key_data_set(obj, EXEVAS_OBJ_STR, evas_obj);
}
#endif

View File

@ -1,67 +0,0 @@
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include <Elementary.h>
#include "evas_evas_obj.h"
#include "evas_elw_button.h"
#include "evas_elw_box.h"
#include "evas_elw_boxedbutton.h"
#include "evas_elw_win.h"
Eina_Bool
_btn_clicked_cb(void *data, const Eo_Event *event)
{
const Eo_Class *klass = eo_class_get(event->obj);
printf("%s obj-type:'%s' data:'%s'\n", desc->name, eo_class_name_get(klass), (const char *) data);
return EO_CALLBACK_CONTINUE;
}
int
main(int argc, char *argv[])
{
Evas_Coord winw, winh;
{
winw = 400;
winh = 400;
}
elm_init(argc, argv);
eo_init();
Eo *win = eo_add(ELW_WIN_CLASS, NULL);
exevas_obj_size_set(win, winw, winh);
exevas_obj_visibility_set(win, EINA_TRUE);
Eo *bt = eo_add(ELW_BUTTON_CLASS, win);
exevas_obj_position_set(bt, 25, 25);
exevas_obj_size_set(bt, 50, 50);
exevas_obj_color_set(bt, 255, 0, 0, 255);
elw_button_text_set(bt, "Click");
exevas_obj_visibility_set(bt, EINA_TRUE);
eo_event_callback_add(bt, EV_CLICKED, _btn_clicked_cb, "btn");
int r, g, b, a;
exevas_obj_color_get(bt, &r, &g, &b, &a);
printf("RGBa(%d, %d, %d, %d)\n", r, g, b, a);
Eo *bx = eo_add(ELW_BOXEDBUTTON_CLASS, win);
exevas_obj_position_set(bx, 100, 100);
exevas_obj_size_set(bx, 70, 70);
exevas_obj_color_set(bx, 0, 0, 255, 255);
elw_button_text_set(bx, "Click2");
exevas_obj_visibility_set(bx, EINA_TRUE);
eo_event_callback_add(bx, EV_CLICKED, _btn_clicked_cb, "bxedbtn");
elm_run();
eo_unref(bx);
eo_unref(bt);
eo_unref(win);
eo_shutdown();
elm_shutdown();
return 0;
}

View File

@ -1,21 +0,0 @@
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include "Eo.h"
#include "eo_isa_complex.h"
#define MY_CLASS COMPLEX_CLASS
static const Eo_Class_Description class_desc = {
EO_VERSION,
"Complex",
EO_CLASS_TYPE_REGULAR,
EO_CLASS_DESCRIPTION_NOOPS(),
NULL,
0,
NULL,
NULL
};
EO_DEFINE_CLASS(complex_class_get, &class_desc, SIMPLE_CLASS, NULL);

View File

@ -1,10 +0,0 @@
#ifndef COMPLEX_H
#define COMPLEX_H
#include "Eo.h"
#include "eo_isa_simple.h"
#define COMPLEX_CLASS complex_class_get()
const Eo_Class *complex_class_get(void);
#endif

View File

@ -1,28 +0,0 @@
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include "Eo.h"
#include "eo_isa_interface.h"
#define MY_CLASS INTERFACE_CLASS
EAPI EO_FUNC_BODY(interface_a_power_3_get, int, 0);
static Eo_Op_Description op_desc[] = {
EO_OP_FUNC(interface_a_power_3_get, NULL),
};
static const Eo_Class_Description class_desc = {
EO_VERSION,
"Interface",
EO_CLASS_TYPE_INTERFACE,
EO_CLASS_DESCRIPTION_OPS(op_desc),
NULL,
0,
NULL,
NULL
};
EO_DEFINE_CLASS(interface_class_get, &class_desc, NULL, NULL)

View File

@ -1,16 +0,0 @@
#ifndef INTERFACE_H
#define INTERFACE_H
#include "Eo.h"
/**
* @def interface_a_power_3_get(ret)
* @brief Get a^3
* @return integer value
*/
EAPI int interface_a_power_3_get(void);
#define INTERFACE_CLASS interface_class_get()
const Eo_Class *interface_class_get(void);
#endif

View File

@ -1,36 +0,0 @@
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include "Eo.h"
#include "eo_isa_simple.h"
#include "eo_isa_complex.h"
int
main(int argc, char *argv[])
{
(void) argc;
(void) argv;
eo_init();
Eo *simpleobj = eo_add(SIMPLE_CLASS, NULL);
Eo *complexobj = eo_add(COMPLEX_CLASS, NULL);
printf("Simple: isa-simple:%d isa-complex:%d isa-mixin:%d isa-interface:%d\n",
eo_isa(simpleobj, SIMPLE_CLASS),
eo_isa(simpleobj, COMPLEX_CLASS),
eo_isa(simpleobj, MIXIN_CLASS),
eo_isa(simpleobj, INTERFACE_CLASS));
printf("Complex: isa-simple:%d isa-complex:%d isa-mixin:%d isa-interface:%d\n",
eo_isa(complexobj, SIMPLE_CLASS),
eo_isa(complexobj, COMPLEX_CLASS),
eo_isa(complexobj, MIXIN_CLASS),
eo_isa(complexobj, INTERFACE_CLASS));
eo_unref(simpleobj);
eo_unref(complexobj);
eo_shutdown();
return 0;
}

View File

@ -1,39 +0,0 @@
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include "Eo.h"
#include "eo_isa_mixin.h"
#include "eo_isa_simple.h"
#define MY_CLASS MIXIN_CLASS
static int
_a_square_get(Eo *obj, void *class_data EINA_UNUSED)
{
int a;
a = simple_a_get(obj);
printf("%s %s\n", eo_class_name_get(MY_CLASS), __func__);
return a * a;
}
EAPI EO_FUNC_BODY(mixin_a_square_get, int, 0);
static Eo_Op_Description op_desc[] = {
EO_OP_FUNC(mixin_a_square_get, _a_square_get),
};
static const Eo_Class_Description class_desc = {
EO_VERSION,
"Mixin",
EO_CLASS_TYPE_MIXIN,
EO_CLASS_DESCRIPTION_OPS(op_desc),
NULL,
0,
NULL,
NULL
};
EO_DEFINE_CLASS(mixin_class_get, &class_desc, NULL, NULL)

View File

@ -1,16 +0,0 @@
#ifndef MIXIN_H
#define MIXIN_H
#include "Eo.h"
/**
* @def mixin_a_square_get(ret)
* @brief Get the square of a.
* @param[out] ret the square of a
*/
EAPI int mixin_a_square_get(void);
#define MIXIN_CLASS mixin_class_get()
const Eo_Class *mixin_class_get(void);
#endif

View File

@ -1,59 +0,0 @@
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include "Eo.h"
#include "eo_isa_simple.h"
typedef struct
{
int a;
} Private_Data;
#define MY_CLASS SIMPLE_CLASS
static int
_a_get(Eo *obj EINA_UNUSED, void *class_data)
{
const Private_Data *pd = class_data;
printf("%s %s\n", eo_class_name_get(MY_CLASS), __func__);
return pd->a;
}
static void
_a_set(Eo *obj EINA_UNUSED, void *class_data, int a)
{
Private_Data *pd = class_data;
pd->a = a;
printf("%s %s\n", eo_class_name_get(MY_CLASS), __func__);
}
static int
_a_power_3_get(Eo *obj EINA_UNUSED, void *class_data)
{
const Private_Data *pd = class_data;
printf("%s %s\n", eo_class_name_get(MY_CLASS), __func__);
return pd->a * pd->a * pd->a;
}
EAPI EO_FUNC_BODY(simple_a_get, int, 0);
EAPI EO_VOID_FUNC_BODYV(simple_a_set, EO_FUNC_CALL(a), int a);
static Eo_Op_Description op_desc[] = {
EO_OP_FUNC(simple_a_set, _a_set),
EO_OP_FUNC(simple_a_get, _a_get),
EO_OP_FUNC_OVERRIDE(interface_a_power_3_get, _a_power_3_get),
};
static const Eo_Class_Description class_desc = {
EO_VERSION,
"Simple",
EO_CLASS_TYPE_REGULAR,
EO_CLASS_DESCRIPTION_OPS(op_desc),
NULL,
sizeof(Private_Data),
NULL,
NULL
};
EO_DEFINE_CLASS(simple_class_get, &class_desc, EO_CLASS, INTERFACE_CLASS, MIXIN_CLASS, NULL);

View File

@ -1,25 +0,0 @@
#ifndef SIMPLE_H
#define SIMPLE_H
#include "Eo.h"
#include "eo_isa_interface.h"
#include "eo_isa_mixin.h"
/**
* @def simple_a_set(a)
* @brief Set value to a-property
* @param[in] a integer value to set
*/
EAPI void simple_a_set(int a);
/**
* @def simple_a_get(a)
* @brief Get value of a-property
* @param[out] integer pointer to a-value
*/
EAPI int simple_a_get(void);
#define SIMPLE_CLASS simple_class_get()
const Eo_Class *simple_class_get(void);
#endif

View File

@ -1,28 +0,0 @@
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include "Eo.h"
#include "simple_interface.h"
#define MY_CLASS INTERFACE_CLASS
EAPI EO_FUNC_BODY(interface_a_power_3_get, int, 0);
static Eo_Op_Description op_desc[] = {
EO_OP_FUNC(interface_a_power_3_get, NULL),
};
static const Eo_Class_Description class_desc = {
EO_VERSION,
"Interface",
EO_CLASS_TYPE_INTERFACE,
EO_CLASS_DESCRIPTION_OPS(op_desc),
NULL,
0,
NULL,
NULL
};
EO_DEFINE_CLASS(interface_class_get, &class_desc, NULL, NULL)

View File

@ -1,16 +0,0 @@
#ifndef INTERFACE_H
#define INTERFACE_H
#include "Eo.h"
/**
* @def interface_a_power_3_get(ret)
* @brief Get a^3
* @return integer value
*/
EAPI int interface_a_power_3_get(void);
#define INTERFACE_CLASS interface_class_get()
const Eo_Class *interface_class_get(void);
#endif

View File

@ -1,31 +0,0 @@
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include "Eo.h"
#include "simple_simple.h"
int
main(int argc, char *argv[])
{
(void) argc;
(void) argv;
eo_init();
Eo *obj = eo_add(SIMPLE_CLASS, NULL);
simple_a_set(obj, 4);
int a = 0, a2 = 0, a3 = 0;
a = simple_a_get(obj);
a3 = interface_a_power_3_get(obj);
a2 = mixin_a_square_get(obj);
printf("Got %d %d %d\n", a, a2, a3);
eo_unref(obj);
eo_shutdown();
return 0;
}

View File

@ -1,39 +0,0 @@
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include "Eo.h"
#include "simple_mixin.h"
#include "simple_simple.h"
#define MY_CLASS MIXIN_CLASS
static int
_a_square_get(Eo *obj, void *class_data EINA_UNUSED)
{
int a;
a = simple_a_get(obj);
printf("%s %s\n", eo_class_name_get(MY_CLASS), __func__);
return a * a;
}
EAPI EO_FUNC_BODY(mixin_a_square_get, int, 0);
static Eo_Op_Description op_desc[] = {
EO_OP_FUNC(mixin_a_square_get, _a_square_get),
};
static const Eo_Class_Description class_desc = {
EO_VERSION,
"Mixin",
EO_CLASS_TYPE_MIXIN,
EO_CLASS_DESCRIPTION_OPS(op_desc),
NULL,
0,
NULL,
NULL
};
EO_DEFINE_CLASS(mixin_class_get, &class_desc, NULL, NULL)

View File

@ -1,16 +0,0 @@
#ifndef MIXIN_H
#define MIXIN_H
#include "Eo.h"
/**
* @def mixin_a_square_get(ret)
* @brief Get the square of a.
* @param[out] ret the square of a
*/
EAPI int mixin_a_square_get(void);
#define MIXIN_CLASS mixin_class_get()
const Eo_Class *mixin_class_get(void);
#endif

View File

@ -1,59 +0,0 @@
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include "Eo.h"
#include "simple_simple.h"
typedef struct
{
int a;
} Private_Data;
#define MY_CLASS SIMPLE_CLASS
static int
_a_get(Eo *obj EINA_UNUSED, void *class_data)
{
const Private_Data *pd = class_data;
printf("%s %s\n", eo_class_name_get(MY_CLASS), __func__);
return pd->a;
}
static void
_a_set(Eo *obj EINA_UNUSED, void *class_data, int a)
{
Private_Data *pd = class_data;
pd->a = a;
printf("%s %s\n", eo_class_name_get(MY_CLASS), __func__);
}
static int
_a_power_3_get(Eo *obj EINA_UNUSED, void *class_data)
{
const Private_Data *pd = class_data;
printf("%s %s\n", eo_class_name_get(MY_CLASS), __func__);
return pd->a * pd->a * pd->a;
}
EAPI EO_FUNC_BODY(simple_a_get, int, 0);
EAPI EO_VOID_FUNC_BODYV(simple_a_set, EO_FUNC_CALL(a), int a);
static Eo_Op_Description op_desc[] = {
EO_OP_FUNC(simple_a_set, _a_set),
EO_OP_FUNC(simple_a_get, _a_get),
EO_OP_FUNC_OVERRIDE(interface_a_power_3_get, _a_power_3_get),
};
static const Eo_Class_Description class_desc = {
EO_VERSION,
"Simple",
EO_CLASS_TYPE_REGULAR,
EO_CLASS_DESCRIPTION_OPS(op_desc),
NULL,
sizeof(Private_Data),
NULL,
NULL
};
EO_DEFINE_CLASS(simple_class_get, &class_desc, EO_CLASS, INTERFACE_CLASS, MIXIN_CLASS, NULL);

View File

@ -1,25 +0,0 @@
#ifndef SIMPLE_H
#define SIMPLE_H
#include "Eo.h"
#include "simple_interface.h"
#include "simple_mixin.h"
/**
* @def simple_a_set(a)
* @brief Set value to a-property
* @param[in] a integer value to set
*/
EAPI void simple_a_set(int a);
/**
* @def simple_a_get(a)
* @brief Get value of a-property
* @param[out] integer pointer to a-value
*/
EAPI int simple_a_get(void);
#define SIMPLE_CLASS simple_class_get()
const Eo_Class *simple_class_get(void);
#endif