forked from enlightenment/efl
Eo examples: evas_obj -> exevas_obj (example evas).
Fix it not to clash anymore with the Evas work. SVN revision: 71928
This commit is contained in:
parent
7d7697f102
commit
1d3b0bf164
|
@ -67,5 +67,5 @@ static const Eo_Class_Description class_desc = {
|
||||||
NULL
|
NULL
|
||||||
};
|
};
|
||||||
|
|
||||||
EO_DEFINE_CLASS(elw_box_class_get, &class_desc, EVAS_OBJ_CLASS, NULL)
|
EO_DEFINE_CLASS(elw_box_class_get, &class_desc, EXEVAS_OBJ_CLASS, NULL)
|
||||||
|
|
||||||
|
|
|
@ -23,7 +23,7 @@ _constructor(Eo *obj, void *class_data EINA_UNUSED, va_list *list EINA_UNUSED)
|
||||||
Eo *bt = eo_add(ELW_BUTTON_CLASS, obj);
|
Eo *bt = eo_add(ELW_BUTTON_CLASS, obj);
|
||||||
eo_composite_attach(bt, obj);
|
eo_composite_attach(bt, obj);
|
||||||
eo_do(bt, eo_event_callback_forwarder_add(EV_CLICKED, obj));
|
eo_do(bt, eo_event_callback_forwarder_add(EV_CLICKED, obj));
|
||||||
eo_do(bt, evas_obj_visibility_set(EINA_TRUE));
|
eo_do(bt, exevas_obj_visibility_set(EINA_TRUE));
|
||||||
|
|
||||||
eo_do(obj, elw_box_pack_end(bt));
|
eo_do(obj, elw_box_pack_end(bt));
|
||||||
eo_unref(bt);
|
eo_unref(bt);
|
||||||
|
|
|
@ -26,7 +26,7 @@ _position_set(Eo *obj, void *class_data EINA_UNUSED, va_list *list)
|
||||||
x = va_arg(*list, Evas_Coord);
|
x = va_arg(*list, Evas_Coord);
|
||||||
y = va_arg(*list, Evas_Coord);
|
y = va_arg(*list, Evas_Coord);
|
||||||
printf("But set position %d,%d\n", x, y);
|
printf("But set position %d,%d\n", x, y);
|
||||||
eo_do_super(obj, evas_obj_position_set(x, y));
|
eo_do_super(obj, exevas_obj_position_set(x, y));
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -81,7 +81,7 @@ _class_constructor(Eo_Class *klass)
|
||||||
EO_OP_FUNC(EO_BASE_ID(EO_BASE_SUB_ID_CONSTRUCTOR), _constructor),
|
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(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(ELW_BUTTON_ID(ELW_BUTTON_SUB_ID_TEXT_SET), _text_set),
|
||||||
EO_OP_FUNC(EVAS_OBJ_ID(EVAS_OBJ_SUB_ID_POSITION_SET), _position_set),
|
EO_OP_FUNC(EXEVAS_OBJ_ID(EXEVAS_OBJ_SUB_ID_POSITION_SET), _position_set),
|
||||||
EO_OP_FUNC_SENTINEL
|
EO_OP_FUNC_SENTINEL
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -108,5 +108,5 @@ static const Eo_Class_Description class_desc = {
|
||||||
NULL
|
NULL
|
||||||
};
|
};
|
||||||
|
|
||||||
EO_DEFINE_CLASS(elw_button_class_get, &class_desc, EVAS_OBJ_CLASS, NULL)
|
EO_DEFINE_CLASS(elw_button_class_get, &class_desc, EXEVAS_OBJ_CLASS, NULL)
|
||||||
|
|
||||||
|
|
|
@ -65,5 +65,5 @@ static const Eo_Class_Description class_desc = {
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
EO_DEFINE_CLASS(elw_win_class_get, &class_desc, EVAS_OBJ_CLASS, NULL)
|
EO_DEFINE_CLASS(elw_win_class_get, &class_desc, EXEVAS_OBJ_CLASS, NULL)
|
||||||
|
|
||||||
|
|
|
@ -5,9 +5,9 @@
|
||||||
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
|
||||||
#define MY_CLASS EVAS_OBJ_CLASS
|
#define MY_CLASS EXEVAS_OBJ_CLASS
|
||||||
|
|
||||||
EAPI Eo_Op EVAS_OBJ_BASE_ID = 0;
|
EAPI Eo_Op EXEVAS_OBJ_BASE_ID = 0;
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
|
@ -85,7 +85,7 @@ _constructor(Eo *obj, void *class_data EINA_UNUSED, va_list *list EINA_UNUSED)
|
||||||
/* Add type check. */
|
/* Add type check. */
|
||||||
Eo *parent = eo_parent_get(obj);
|
Eo *parent = eo_parent_get(obj);
|
||||||
if (parent)
|
if (parent)
|
||||||
eo_do(parent, evas_obj_child_add(obj));
|
eo_do(parent, exevas_obj_child_add(obj));
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -108,12 +108,12 @@ _class_constructor(Eo_Class *klass)
|
||||||
const Eo_Op_Func_Description func_desc[] = {
|
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_CONSTRUCTOR), _constructor),
|
||||||
EO_OP_FUNC(EO_BASE_ID(EO_BASE_SUB_ID_DESTRUCTOR), _destructor),
|
EO_OP_FUNC(EO_BASE_ID(EO_BASE_SUB_ID_DESTRUCTOR), _destructor),
|
||||||
EO_OP_FUNC(EVAS_OBJ_ID(EVAS_OBJ_SUB_ID_POSITION_SET), _position_set),
|
EO_OP_FUNC(EXEVAS_OBJ_ID(EXEVAS_OBJ_SUB_ID_POSITION_SET), _position_set),
|
||||||
EO_OP_FUNC(EVAS_OBJ_ID(EVAS_OBJ_SUB_ID_SIZE_SET), _size_set),
|
EO_OP_FUNC(EXEVAS_OBJ_ID(EXEVAS_OBJ_SUB_ID_SIZE_SET), _size_set),
|
||||||
EO_OP_FUNC(EVAS_OBJ_ID(EVAS_OBJ_SUB_ID_COLOR_SET), _color_set),
|
EO_OP_FUNC(EXEVAS_OBJ_ID(EXEVAS_OBJ_SUB_ID_COLOR_SET), _color_set),
|
||||||
EO_OP_FUNC_CONST(EVAS_OBJ_ID(EVAS_OBJ_SUB_ID_COLOR_GET), _color_get),
|
EO_OP_FUNC_CONST(EXEVAS_OBJ_ID(EXEVAS_OBJ_SUB_ID_COLOR_GET), _color_get),
|
||||||
EO_OP_FUNC(EVAS_OBJ_ID(EVAS_OBJ_SUB_ID_VISIBILITY_SET), _visibility_set),
|
EO_OP_FUNC(EXEVAS_OBJ_ID(EXEVAS_OBJ_SUB_ID_VISIBILITY_SET), _visibility_set),
|
||||||
EO_OP_FUNC(EVAS_OBJ_ID(EVAS_OBJ_SUB_ID_CHILD_ADD), _child_add),
|
EO_OP_FUNC(EXEVAS_OBJ_ID(EXEVAS_OBJ_SUB_ID_CHILD_ADD), _child_add),
|
||||||
EO_OP_FUNC_SENTINEL
|
EO_OP_FUNC_SENTINEL
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -121,19 +121,19 @@ _class_constructor(Eo_Class *klass)
|
||||||
}
|
}
|
||||||
|
|
||||||
static const Eo_Op_Description op_desc[] = {
|
static const Eo_Op_Description op_desc[] = {
|
||||||
EO_OP_DESCRIPTION(EVAS_OBJ_SUB_ID_POSITION_SET, "Position of an evas object."),
|
EO_OP_DESCRIPTION(EXEVAS_OBJ_SUB_ID_POSITION_SET, "Position of an evas object."),
|
||||||
EO_OP_DESCRIPTION(EVAS_OBJ_SUB_ID_SIZE_SET, "Size of an evas object."),
|
EO_OP_DESCRIPTION(EXEVAS_OBJ_SUB_ID_SIZE_SET, "Size of an evas object."),
|
||||||
EO_OP_DESCRIPTION(EVAS_OBJ_SUB_ID_COLOR_SET, "Color of an evas object."),
|
EO_OP_DESCRIPTION(EXEVAS_OBJ_SUB_ID_COLOR_SET, "Color of an evas object."),
|
||||||
EO_OP_DESCRIPTION_CONST(EVAS_OBJ_SUB_ID_COLOR_GET, "Color of an evas object."),
|
EO_OP_DESCRIPTION_CONST(EXEVAS_OBJ_SUB_ID_COLOR_GET, "Color of an evas object."),
|
||||||
EO_OP_DESCRIPTION(EVAS_OBJ_SUB_ID_VISIBILITY_SET, "Visibility of an evas object."),
|
EO_OP_DESCRIPTION(EXEVAS_OBJ_SUB_ID_VISIBILITY_SET, "Visibility of an evas object."),
|
||||||
EO_OP_DESCRIPTION(EVAS_OBJ_SUB_ID_CHILD_ADD, "Add a child eo."),
|
EO_OP_DESCRIPTION(EXEVAS_OBJ_SUB_ID_CHILD_ADD, "Add a child eo."),
|
||||||
EO_OP_DESCRIPTION_SENTINEL
|
EO_OP_DESCRIPTION_SENTINEL
|
||||||
};
|
};
|
||||||
|
|
||||||
static const Eo_Class_Description class_desc = {
|
static const Eo_Class_Description class_desc = {
|
||||||
"Evas Object",
|
"Evas Object",
|
||||||
EO_CLASS_TYPE_REGULAR_NO_INSTANT,
|
EO_CLASS_TYPE_REGULAR_NO_INSTANT,
|
||||||
EO_CLASS_DESCRIPTION_OPS(&EVAS_OBJ_BASE_ID, op_desc, EVAS_OBJ_SUB_ID_LAST),
|
EO_CLASS_DESCRIPTION_OPS(&EXEVAS_OBJ_BASE_ID, op_desc, EXEVAS_OBJ_SUB_ID_LAST),
|
||||||
NULL,
|
NULL,
|
||||||
sizeof(Widget_Data),
|
sizeof(Widget_Data),
|
||||||
_class_constructor,
|
_class_constructor,
|
||||||
|
|
|
@ -1,82 +1,82 @@
|
||||||
#ifndef EVAS_OBJ_H
|
#ifndef EXEVAS_OBJ_H
|
||||||
#define EVAS_OBJ_H
|
#define EXEVAS_OBJ_H
|
||||||
|
|
||||||
#include "Eo.h"
|
#include "Eo.h"
|
||||||
|
|
||||||
extern EAPI Eo_Op EVAS_OBJ_BASE_ID;
|
extern EAPI Eo_Op EXEVAS_OBJ_BASE_ID;
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
EVAS_OBJ_SUB_ID_POSITION_SET,
|
EXEVAS_OBJ_SUB_ID_POSITION_SET,
|
||||||
EVAS_OBJ_SUB_ID_SIZE_SET,
|
EXEVAS_OBJ_SUB_ID_SIZE_SET,
|
||||||
EVAS_OBJ_SUB_ID_COLOR_SET,
|
EXEVAS_OBJ_SUB_ID_COLOR_SET,
|
||||||
EVAS_OBJ_SUB_ID_COLOR_GET,
|
EXEVAS_OBJ_SUB_ID_COLOR_GET,
|
||||||
EVAS_OBJ_SUB_ID_VISIBILITY_SET,
|
EXEVAS_OBJ_SUB_ID_VISIBILITY_SET,
|
||||||
EVAS_OBJ_SUB_ID_CHILD_ADD,
|
EXEVAS_OBJ_SUB_ID_CHILD_ADD,
|
||||||
EVAS_OBJ_SUB_ID_LAST
|
EXEVAS_OBJ_SUB_ID_LAST
|
||||||
};
|
};
|
||||||
|
|
||||||
#define EVAS_OBJ_ID(sub_id) (EVAS_OBJ_BASE_ID + sub_id)
|
#define EXEVAS_OBJ_ID(sub_id) (EXEVAS_OBJ_BASE_ID + sub_id)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @def evas_obj_position_set(x, y)
|
* @def exevas_obj_position_set(x, y)
|
||||||
* @brief Set object's position
|
* @brief Set object's position
|
||||||
* @param[in] x object's X position
|
* @param[in] x object's X position
|
||||||
* @param[in] y object's Y position
|
* @param[in] y object's Y position
|
||||||
*/
|
*/
|
||||||
#define evas_obj_position_set(x, y) EVAS_OBJ_ID(EVAS_OBJ_SUB_ID_POSITION_SET), EO_TYPECHECK(Evas_Coord, x), EO_TYPECHECK(Evas_Coord, y)
|
#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 evas_obj_size_set(w, h)
|
* @def exevas_obj_size_set(w, h)
|
||||||
* @brief Set object's size
|
* @brief Set object's size
|
||||||
* @param[in] w object's width
|
* @param[in] w object's width
|
||||||
* @param[in] h object's height
|
* @param[in] h object's height
|
||||||
*/
|
*/
|
||||||
#define evas_obj_size_set(w, h) EVAS_OBJ_ID(EVAS_OBJ_SUB_ID_SIZE_SET), EO_TYPECHECK(Evas_Coord, w), EO_TYPECHECK(Evas_Coord, h)
|
#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 evas_obj_color_set(r, g, b, a)
|
* @def exevas_obj_color_set(r, g, b, a)
|
||||||
* @brief Set object's color
|
* @brief Set object's color
|
||||||
* @param[in] r r-value of color
|
* @param[in] r r-value of color
|
||||||
* @param[in] g g-value of color
|
* @param[in] g g-value of color
|
||||||
* @param[in] b b-value of color
|
* @param[in] b b-value of color
|
||||||
* @param[in] a a-value of color
|
* @param[in] a a-value of color
|
||||||
*/
|
*/
|
||||||
#define evas_obj_color_set(r, g, b, a) EVAS_OBJ_ID(EVAS_OBJ_SUB_ID_COLOR_SET), EO_TYPECHECK(int, r), EO_TYPECHECK(int, g), EO_TYPECHECK(int, b), EO_TYPECHECK(int, a)
|
#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 evas_obj_color_get(r, g, b, a)
|
* @def exevas_obj_color_get(r, g, b, a)
|
||||||
* @brief Set object's position
|
* @brief Set object's position
|
||||||
* @param[out] r integer pointer for r-value of color
|
* @param[out] r integer pointer for r-value of color
|
||||||
* @param[out] g integer pointer for g-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] b integer pointer for b-value of color
|
||||||
* @param[out] a integer pointer for a-value of color
|
* @param[out] a integer pointer for a-value of color
|
||||||
*/
|
*/
|
||||||
#define evas_obj_color_get(r, g, b, a) EVAS_OBJ_ID(EVAS_OBJ_SUB_ID_COLOR_GET), EO_TYPECHECK(int *, r), EO_TYPECHECK(int *, g), EO_TYPECHECK(int *, b), EO_TYPECHECK(int *, a)
|
#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 evas_obj_visibility_set(v)
|
* @def exevas_obj_visibility_set(v)
|
||||||
* @brief Set object's visible property
|
* @brief Set object's visible property
|
||||||
* @param[in] v True/False value
|
* @param[in] v True/False value
|
||||||
*/
|
*/
|
||||||
#define evas_obj_visibility_set(v) EVAS_OBJ_ID(EVAS_OBJ_SUB_ID_VISIBILITY_SET), EO_TYPECHECK(Eina_Bool, v)
|
#define exevas_obj_visibility_set(v) EXEVAS_OBJ_ID(EXEVAS_OBJ_SUB_ID_VISIBILITY_SET), EO_TYPECHECK(Eina_Bool, v)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @def evas_obj_child_add(child)
|
* @def exevas_obj_child_add(child)
|
||||||
* @brief Add child to current object
|
* @brief Add child to current object
|
||||||
* @param[in] pointer to child object
|
* @param[in] pointer to child object
|
||||||
*/
|
*/
|
||||||
#define evas_obj_child_add(child) EVAS_OBJ_ID(EVAS_OBJ_SUB_ID_CHILD_ADD), EO_TYPECHECK(Eo *, child)
|
#define exevas_obj_child_add(child) EXEVAS_OBJ_ID(EXEVAS_OBJ_SUB_ID_CHILD_ADD), EO_TYPECHECK(Eo *, child)
|
||||||
|
|
||||||
#define EVAS_OBJ_CLASS evas_object_class_get()
|
#define EXEVAS_OBJ_CLASS evas_object_class_get()
|
||||||
const Eo_Class *evas_object_class_get(void);
|
const Eo_Class *evas_object_class_get(void);
|
||||||
|
|
||||||
#define EVAS_OBJ_STR "Evas_Obj"
|
#define EXEVAS_OBJ_STR "Evas_Obj"
|
||||||
/* FIXME: Hack in the meanwhile. */
|
/* FIXME: Hack in the meanwhile. */
|
||||||
static inline Evas_Object *
|
static inline Evas_Object *
|
||||||
eo_evas_object_get(const Eo *obj)
|
eo_evas_object_get(const Eo *obj)
|
||||||
{
|
{
|
||||||
void *data;
|
void *data;
|
||||||
eo_query(obj, eo_base_data_get(EVAS_OBJ_STR, &data));
|
eo_query(obj, eo_base_data_get(EXEVAS_OBJ_STR, &data));
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -84,7 +84,7 @@ eo_evas_object_get(const Eo *obj)
|
||||||
static inline void
|
static inline void
|
||||||
eo_evas_object_set(Eo *obj, Evas_Object *evas_obj)
|
eo_evas_object_set(Eo *obj, Evas_Object *evas_obj)
|
||||||
{
|
{
|
||||||
eo_do(obj, eo_base_data_set(EVAS_OBJ_STR, evas_obj, NULL));
|
eo_do(obj, eo_base_data_set(EXEVAS_OBJ_STR, evas_obj, NULL));
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -30,26 +30,26 @@ main(int argc, char *argv[])
|
||||||
eo_init();
|
eo_init();
|
||||||
|
|
||||||
Eo *win = eo_add(ELW_WIN_CLASS, NULL);
|
Eo *win = eo_add(ELW_WIN_CLASS, NULL);
|
||||||
eo_do(win, evas_obj_size_set(winw, winh), evas_obj_visibility_set(EINA_TRUE));
|
eo_do(win, exevas_obj_size_set(winw, winh), exevas_obj_visibility_set(EINA_TRUE));
|
||||||
|
|
||||||
Eo *bt = eo_add(ELW_BUTTON_CLASS, win);
|
Eo *bt = eo_add(ELW_BUTTON_CLASS, win);
|
||||||
eo_do(bt, evas_obj_position_set(25, 25),
|
eo_do(bt, exevas_obj_position_set(25, 25),
|
||||||
evas_obj_size_set(50, 50),
|
exevas_obj_size_set(50, 50),
|
||||||
evas_obj_color_set(255, 0, 0, 255),
|
exevas_obj_color_set(255, 0, 0, 255),
|
||||||
elw_button_text_set("Click"),
|
elw_button_text_set("Click"),
|
||||||
evas_obj_visibility_set(EINA_TRUE));
|
exevas_obj_visibility_set(EINA_TRUE));
|
||||||
eo_do(bt, eo_event_callback_add(EV_CLICKED, _btn_clicked_cb, "btn"));
|
eo_do(bt, eo_event_callback_add(EV_CLICKED, _btn_clicked_cb, "btn"));
|
||||||
|
|
||||||
int r, g, b, a;
|
int r, g, b, a;
|
||||||
eo_do(bt, evas_obj_color_get(&r, &g, &b, &a));
|
eo_do(bt, exevas_obj_color_get(&r, &g, &b, &a));
|
||||||
printf("RGBa(%d, %d, %d, %d)\n", r, g, b, a);
|
printf("RGBa(%d, %d, %d, %d)\n", r, g, b, a);
|
||||||
|
|
||||||
Eo *bx = eo_add(ELW_BOXEDBUTTON_CLASS, win);
|
Eo *bx = eo_add(ELW_BOXEDBUTTON_CLASS, win);
|
||||||
eo_do(bx, evas_obj_position_set(100, 100),
|
eo_do(bx, exevas_obj_position_set(100, 100),
|
||||||
evas_obj_size_set(70, 70),
|
exevas_obj_size_set(70, 70),
|
||||||
evas_obj_color_set(0, 0, 255, 255),
|
exevas_obj_color_set(0, 0, 255, 255),
|
||||||
elw_button_text_set("Click2"),
|
elw_button_text_set("Click2"),
|
||||||
evas_obj_visibility_set(EINA_TRUE));
|
exevas_obj_visibility_set(EINA_TRUE));
|
||||||
eo_do(bx, eo_event_callback_add(EV_CLICKED, _btn_clicked_cb, "bxedbtn"));
|
eo_do(bx, eo_event_callback_add(EV_CLICKED, _btn_clicked_cb, "bxedbtn"));
|
||||||
|
|
||||||
elm_run();
|
elm_run();
|
||||||
|
|
Loading…
Reference in New Issue