Compare commits

...

2 Commits

Author SHA1 Message Date
Avi Levin 21ccd37737 eo: cleaning eo_base_callbacks.c
@fix
2015-03-19 18:25:09 +02:00
Avi Levin fa8f786d44 back 2015-03-16 15:55:32 +02:00
35 changed files with 839 additions and 5873 deletions

View File

@ -205,6 +205,7 @@ static void st_color_class_name(void);
static void st_color_class_color(void);
static void st_color_class_color2(void);
static void st_color_class_color3(void);
static void st_color_class_desc(void);
static void ob_collections(void);
static void st_collections_base_scale(void);
@ -376,6 +377,8 @@ static void st_collections_group_parts_part_description_properties_shade(void);
static void st_collections_group_parts_part_description_orientation_look1(void);
static void st_collections_group_parts_part_description_orientation_look2(void);
static void st_collections_group_parts_part_description_orientation_look_to(void);
static void st_collections_group_parts_part_description_orientation_angle_axis(void);
static void st_collections_group_parts_part_description_orientation_quaternion(void);
#ifdef HAVE_EPHYSICS
static void st_collections_group_parts_part_description_physics_mass(void);
@ -496,7 +499,8 @@ static void st_collections_group_nobroadcast(void);
{PREFIX"color_classes.color_class.name", st_color_class_name}, /* dup */ \
{PREFIX"color_classes.color_class.color", st_color_class_color}, /* dup */ \
{PREFIX"color_classes.color_class.color2", st_color_class_color2}, /* dup */ \
{PREFIX"color_classes.color_class.color3", st_color_class_color3}, /* dup */
{PREFIX"color_classes.color_class.color3", st_color_class_color3}, /* dup */ \
{PREFIX"color_classes.color_class.description", st_color_class_desc}, /* dup */
#define PROGRAM_SEQUENCE(PREFIX, NAME, FN) \
{PREFIX".program."NAME, FN}, /* dup */ \
@ -565,6 +569,32 @@ static void st_collections_group_nobroadcast(void);
ed->type_node.orientation.type = EVAS_3D_NODE_ORIENTATION_TYPE_LOOK_TO; \
}
#define SET_ANGLE_AXIS(Type, type_node) \
Edje_Part_Description_##Type *ed; \
ed = (Edje_Part_Description_##Type*) current_desc; \
\
if (ed->type_node.orientation.type <= EVAS_3D_NODE_ORIENTATION_TYPE_ANGLE_AXIS) \
{ \
ed->type_node.orientation.data[0] = FROM_DOUBLE(parse_float(0)); \
ed->type_node.orientation.data[1] = FROM_DOUBLE(parse_float(1)); \
ed->type_node.orientation.data[2] = FROM_DOUBLE(parse_float(2)); \
ed->type_node.orientation.data[3] = FROM_DOUBLE(parse_float(3)); \
ed->type_node.orientation.type = EVAS_3D_NODE_ORIENTATION_TYPE_ANGLE_AXIS; \
}
#define SET_QUATERNION(Type, type_node) \
Edje_Part_Description_##Type *ed; \
ed = (Edje_Part_Description_##Type*) current_desc; \
\
if (ed->type_node.orientation.type <= EVAS_3D_NODE_ORIENTATION_TYPE_QUATERNION) \
{ \
ed->type_node.orientation.data[1] = FROM_DOUBLE(parse_float(0)); \
ed->type_node.orientation.data[2] = FROM_DOUBLE(parse_float(1)); \
ed->type_node.orientation.data[3] = FROM_DOUBLE(parse_float(2)); \
ed->type_node.orientation.data[0] = FROM_DOUBLE(parse_float(3)); \
ed->type_node.orientation.type = EVAS_3D_NODE_ORIENTATION_TYPE_QUATERNION; \
}
New_Statement_Handler statement_handlers[] =
{
{"externals.external", st_externals_external},
@ -778,6 +808,8 @@ New_Statement_Handler statement_handlers[] =
{"collections.group.parts.part.description.orientation.look1", st_collections_group_parts_part_description_orientation_look1},
{"collections.group.parts.part.description.orientation.look2", st_collections_group_parts_part_description_orientation_look2},
{"collections.group.parts.part.description.orientation.look_to", st_collections_group_parts_part_description_orientation_look_to},
{"collections.group.parts.part.description.orientation.angle_axis", st_collections_group_parts_part_description_orientation_angle_axis},
{"collections.group.parts.part.description.orientation.quaternion", st_collections_group_parts_part_description_orientation_quaternion},
#ifdef HAVE_EPHYSICS
{"collections.group.parts.part.description.physics.mass", st_collections_group_parts_part_description_physics_mass},
@ -2430,6 +2462,28 @@ st_color_class_color3(void)
cc->a3 = parse_int_range(3, 0, 255);
}
/**
@page edcref
@property
description
@parameters
[color class description]
@effect
Provides a descriptive name for the effect of the color class
@since 1.14
@endproperty
*/
static void
st_color_class_desc(void)
{
Edje_Color_Class *cc;
check_arg_count(1);
cc = eina_list_data_get(eina_list_last(edje_file->color_classes));
cc->desc = parse_str(0);
}
/** @edcsubsection{toplevel_styles,
* Styles} */
@ -9686,6 +9740,76 @@ st_collections_group_parts_part_description_orientation_look_to(void)
}
}
/**
@page edcref
@property
angle_axis
@parameters
[x] [y] [z] [w]
@effect
Specifies the angle and indicates what proportions the MESH_NODE rotates in.
@endproperty
*/
static void
st_collections_group_parts_part_description_orientation_angle_axis(void)
{
check_arg_count(4);
if (current_part->type == EDJE_PART_TYPE_CAMERA)
{
SET_ANGLE_AXIS(Camera, camera)
}
else if (current_part->type == EDJE_PART_TYPE_LIGHT)
{
SET_ANGLE_AXIS(Light, light)
}
else if (current_part->type == EDJE_PART_TYPE_MESH_NODE)
{
SET_ANGLE_AXIS(Mesh_Node, mesh_node)
}
else
{
ERR("parse error %s:%i. camera, light and mesh_node attributes in non-CAMERA, non-LIGHT and non-MESH_NODE part.",
file_in, line - 1);
exit(-1);
}
}
/**
@page edcref
@property
quaternion
@parameters
[x] [y] [z] [w]
@effect
Specifies the axis and arccosinus of half angle to rotate on the MESH_NODE, CAMERA or LIGHT.
@endproperty
*/
static void
st_collections_group_parts_part_description_orientation_quaternion(void)
{
check_arg_count(4);
if (current_part->type == EDJE_PART_TYPE_CAMERA)
{
SET_QUATERNION(Camera, camera)
}
else if (current_part->type == EDJE_PART_TYPE_LIGHT)
{
SET_QUATERNION(Light, light)
}
else if (current_part->type == EDJE_PART_TYPE_MESH_NODE)
{
SET_QUATERNION(Mesh_Node, mesh_node)
}
else
{
ERR("parse error %s:%i. camera, light and mesh_node attributes in non-CAMERA, non-LIGHT and non-MESH_NODE part.",
file_in, line - 1);
exit(-1);
}
}
static void
st_collections_group_parts_part_description_proxy_source_visible(void)

View File

@ -65,7 +65,6 @@ _event_handler_cb(void *data, int type EINA_UNUSED, void *event EINA_UNUSED) //
ecore_idle_enterer_del(ctxt->enterer);
ecore_idle_exiter_del(ctxt->exiter);
// ecore_idler_del(ctxt->idler);
eo_unref(ctxt->idler);
ctxt->enterer = NULL;
ctxt->exiter = NULL;
@ -118,7 +117,7 @@ main(void)
ctxt.timer = ecore_timer_add(0.0005, _timer_cb, &ctxt);
ecore_main_loop_begin();
ecore_shutdown();
// ecore_shutdown();
return 0;
}

View File

@ -2,50 +2,64 @@
//gcc -g eina_inarray_01.c -o eina_inarray_01 `pkg-config --cflags --libs eina`
#include <Eina.h>
struct _Eo_Callback_Description
{
//Eo_Callback_Description *next;
void *func_data;
int priority;
};
int
_eo_base_callback_priority_cmp(const void *a, const void *b)
{
return ((struct _Eo_Callback_Description*)a)->priority > ((struct _Eo_Callback_Description*)b)->priority;
}
int
cmp(const void *a, const void *b)
{
return *(int*)a > *(int*)b;
}
Eina_Bool
check( const void *iarr, void *a, void *b)
{
return ((struct _Eo_Callback_Description*)a)->priority==2;
}
void insert( Eina_Inarray *iarr, int pr){
struct _Eo_Callback_Description cb;
cb.priority = pr;
// _eo_callbacks_sorted_insert(pd, cb);
eina_inarray_insert_sorted(iarr, &cb , _eo_base_callback_priority_cmp);
}
int main(int argc EINA_UNUSED, char **argv EINA_UNUSED)
{
Eina_Inarray *iarr;
char ch, *ch2;
int a, *b;
struct _Eo_Callback_Description a, *b;
eina_init();
iarr = eina_inarray_new(sizeof(char), 0);
iarr = eina_inarray_new(sizeof(struct _Eo_Callback_Description), 0);
ch = 'a';
eina_inarray_push(iarr, &ch);
ch = 'b';
eina_inarray_push(iarr, &ch);
ch = 'c';
eina_inarray_push(iarr, &ch);
ch = 'd';
eina_inarray_push(iarr, &ch);
// struct _Eo_Callback_Description cb;
printf("Inline array of chars:\n");
EINA_INARRAY_FOREACH(iarr, ch2)
printf("char: %c(pointer: %p)\n", *ch2, ch2);
eina_inarray_flush(iarr);
eina_inarray_step_set(iarr, sizeof(Eina_Inarray), sizeof(int), 4);
a = 97;
eina_inarray_push(iarr, &a);
a = 98;
eina_inarray_push(iarr, &a);
a = 100;
eina_inarray_push(iarr, &a);
a = 99;
eina_inarray_insert_sorted(iarr, &a, cmp);
// cb = calloc(1, sizeof(*cb));
// if (!cb) return;
// cb.priority = 2;
// _eo_callbacks_sorted_insert(pd, cb);
// eina_inarray_insert_sorted(iarr, &cb , _eo_base_callback_priority_cmp);
insert(iarr, 2);
insert(iarr, 4);
insert(iarr, -1 );
eina_inarray_foreach_remove( iarr, check, NULL);
printf("Inline array of integers with %d elements:\n", eina_inarray_count(iarr));
EINA_INARRAY_FOREACH(iarr, b)
printf("int: %d(pointer: %p)\n", *b, b);
printf("int: %d(pointer: %p)\n", b->priority, b);
eina_inarray_free(iarr);
eina_shutdown();

View File

@ -3,9 +3,8 @@
#include <Eina.h>
int
main(int argc EINA_UNUSED, char **argv EINA_UNUSED)
{
Eina_Inarray *iarr;
int add_array(){
const char* strings[] = {
"helo", "hera", "starbuck", "kat", "boomer",
"hotdog", "longshot", "jammer", "crashdown", "hardball",
@ -13,7 +12,7 @@ main(int argc EINA_UNUSED, char **argv EINA_UNUSED)
"skulls", "bulldog", "flat top", "hammerhead", "gonzo"
};
char **str, **str2;
Eina_Inarray *iarr;
int i;
eina_init();
@ -24,6 +23,21 @@ main(int argc EINA_UNUSED, char **argv EINA_UNUSED)
eina_inarray_push(iarr, str);
}
}
int
main(int argc EINA_UNUSED, char **argv EINA_UNUSED)
{
char **str, **str2;
int i;
eina_init();
iarr = eina_inarray_new(sizeof(char *), 0);
add_array();
printf("Inline array of strings:\n");
EINA_INARRAY_FOREACH(iarr, str2)
printf("string: %s(pointer: %p)\n", *str2, str2);

View File

@ -268,7 +268,7 @@ evas_3d_mmap_LDADD = $(ECORE_EVAS_COMMON_LDADD) @EFL_PTHREAD_LIBS@
evas_3d_mmap_CPPFLAGS = $(ECORE_EVAS_COMMON_CPPFLAGS)
EXTRA_PROGRAMS += evas_3d_colorpick
evas_3d_colorpick_SOURCES = evas-3d-colorpick.c
evas_3d_colorpick_SOURCES = evas-3d-colorpick.c evas-3d-primitives.c
evas_3d_colorpick_LDADD = $(ECORE_EVAS_COMMON_LDADD) @EFL_PTHREAD_LIBS@
evas_3d_colorpick_CPPFLAGS = $(ECORE_EVAS_COMMON_CPPFLAGS)
@ -331,19 +331,15 @@ resources/images/enlightenment.png \
resources/images/red.png \
resources/images/im1.png \
resources/images/cube1.png \
resources/images/eagle.png \
resources/images/M15.png \
resources/images/M15_1.png \
resources/images/bg_space.jpg \
resources/images/EarthDiffuse.png \
resources/images/moon.png \
resources/images/normal_lego.png \
resources/images/sonic.png \
resources/images/sweet_home_reversed.png \
resources/images/star.jpg \
resources/models/eagle.md2 \
resources/models/M15.mtl \
resources/models/M15.obj \
resources/models/mesh_for_mmap.eet \
resources/models/mesh_for_mmap.md2 \
resources/models/mesh_for_mmap.mtl \
resources/models/mesh_for_mmap.obj \
resources/models/mesh_for_mmap.ply \
resources/models/Normal_UVs_Colors.ply \
@ -355,13 +351,9 @@ resources/models/NoNormal_UVs_NoColors.ply \
resources/models/NoNormal_NoUVs_Colors.ply \
resources/models/NoNormal_NoUVs_NoColors.ply \
resources/models/sonic.md2 \
resources/models/sweet_home.mtl \
resources/models/sweet_home.obj \
resources/models/sweet_home_only_vertex_coords.mtl \
resources/models/sweet_home_only_vertex_coords.obj \
resources/models/sweet_home_without_normals.mtl \
resources/models/sweet_home_without_normals.obj \
resources/models/sweet_home_without_tex_coords.mtl \
resources/models/sweet_home_without_tex_coords.obj \
Makefile.examples

View File

@ -1,6 +1,6 @@
/**
* This example shows how to get and draw axis-aligned bounding box.
*
*
* @see _mesh_aabb(Evas_3D_Mesh **mesh_b, const Evas_3D_Node *node);
* Rotate axises (keys 1-4) for model and bounding box view from another angle.
*

View File

@ -5,14 +5,13 @@
* in terminal time response of the found node.
* Use key UP/DOWN for changing z coordinate of camera
* Use key LEFT/RIGHT for scale each node
* Use shortcut parameters of commanline: r - rows of objects, c - columns of objects, m - path for model name,
* f - path for first texture, s - path for second texture.
*
* Use shortcut parameters of commanline: r - rows of objects, c - columns of objects,
* p - precision of the spheres, f - path for first texture, s - path for second texture.
*
* @verbatim
* gcc -o evas-3d-colorpick evas-3d-colorpick.c `pkg-config --libs --cflags evas ecore ecore-evas eo eina efl`
* gcc -o evas-3d-colorpick evas-3d-colorpick.c evas-3d-primitives.c `pkg-config --libs --cflags evas ecore ecore-evas eo eina efl` -lm
* @endverbatim
*/
//TODO new resources
#ifdef HAVE_CONFIG_H
#include "config.h"
@ -27,6 +26,8 @@
#include <Ecore.h>
#include <Ecore_Evas.h>
#include <Ecore_Getopt.h>
#include <math.h>
#include "evas-3d-primitives.h"
#include "evas-common.h"
#define WIDTH 800
@ -34,10 +35,15 @@
#define ANIMATION_COUNT 3
#define MAX_PATH 128
#define INIT_SCALE 7.5
#define BIG_SCALE 10.0
#define SMALL_SCALE 5.0
#define SCALE_UNIT 0.5
#define VEC_3(value) value, value, value
static const char *model_path = PACKAGE_EXAMPLES_DIR EVAS_MODEL_FOLDER "/M15.obj";
static const char *image1_path = PACKAGE_EXAMPLES_DIR EVAS_IMAGE_FOLDER "/M15.png";
static const char *image2_path = PACKAGE_EXAMPLES_DIR EVAS_IMAGE_FOLDER "/M15_1.png";
static const vec2 tex_scale = {1, 1};
static const char *image1_path = PACKAGE_EXAMPLES_DIR EVAS_IMAGE_FOLDER "/wood.jpg";
static const char *image2_path = PACKAGE_EXAMPLES_DIR EVAS_IMAGE_FOLDER "/rocks.jpg";
Ecore_Evas *ecore_evas = NULL;
Evas *evas = NULL;
@ -55,16 +61,17 @@ Ecore_Getopt optdesc = {
"Example mesh color pick mechanism",
0,
{
ECORE_GETOPT_STORE_INT('r', "row", "Rows of models"),
ECORE_GETOPT_STORE_INT('c', "column", "Columns of models"),
ECORE_GETOPT_STORE_STR('m', "name model", "Name of model"),
ECORE_GETOPT_STORE_INT('r', "row", "Rows of spheres"),
ECORE_GETOPT_STORE_INT('c', "column", "Columns of spheres"),
ECORE_GETOPT_STORE_INT('p', "precision", "Precision of spheres"),
ECORE_GETOPT_STORE_STR('f', "texture1", "Name1 of texture"),
ECORE_GETOPT_STORE_STR('s', "texture2", "Name2 of texture"),
ECORE_GETOPT_HELP('h', "help"),
ECORE_GETOPT_SENTINEL
}
};
typedef struct _Mine
typedef struct _Object
{
Eo *node;
Eo *mesh1;
@ -76,11 +83,10 @@ Ecore_Getopt optdesc = {
Evas_Real speed;
Ecore_Timer *animate;
Eina_Bool (*m15_init)(void *m15, const char *model,
const char *texture1, const char *texture2);
Eina_Bool (*m15_animate)(void *data);
Eina_Bool (*sphere_init)(void *sphere, const char *texture1, const char *texture2);
Eina_Bool (*sphere_animate)(void *data);
} MineM15;
} Test_object;
typedef struct _Scene
{
@ -93,11 +99,11 @@ typedef struct _Scene
int row;
int col;
int precision;
Eina_List *mines;
Eina_List *spheres;
Eina_Bool (*scene_init)(const char *model,
const char *texture1, const char *texture2);
Eina_Bool (*scene_init)(const char *texture1, const char *texture2);
} Scene_Data;
@ -107,12 +113,12 @@ static void
_on_delete(Ecore_Evas *ee EINA_UNUSED)
{
Eina_List *l;
MineM15 * item;
EINA_LIST_FOREACH(globalscene.mines, l, item)
Test_object * item;
EINA_LIST_FOREACH(globalscene.spheres, l, item)
{
free(item);
}
eina_list_free(globalscene.mines);
eina_list_free(globalscene.spheres);
ecore_main_loop_quit();
@ -128,30 +134,30 @@ _on_canvas_resize(Ecore_Evas *ee)
}
static Eina_Bool
_animate_mine1(void *data)
_animate_sphere1(void *data)
{
static int angle = 0.0;
Eo *n = (Eo*)(((MineM15 *)data)->node);
Eo *n = (Eo*)(((Test_object *)data)->node);
eo_do(n, evas_3d_node_orientation_angle_axis_set(angle, 1.0, 0.0, 1.0));
angle++;
if (angle > 360) angle = 0.0;
return EINA_TRUE;
}
static Eina_Bool
_animate_mine2(void *data)
_animate_sphere2(void *data)
{
static int angle = 0.0;
Eo *n = (Eo*)(((MineM15 *)data)->node);
Eo *n = (Eo*)(((Test_object *)data)->node);
eo_do(n, evas_3d_node_orientation_angle_axis_set(angle, 0.0, 1.0, 1.0));
angle++;
if (angle > 360) angle = 0.0;
return EINA_TRUE;
}
static Eina_Bool
_animate_mine3(void *data)
_animate_sphere3(void *data)
{
static int angle = 0.0;
Eo *n = (Eo*)(((MineM15 *)data)->node);
Eo *n = (Eo*)(((Test_object *)data)->node);
eo_do(n, evas_3d_node_orientation_angle_axis_set(angle, 1.0, 1.0, 0.0));
angle++;
if (angle > 360) angle = 0.0;
@ -162,10 +168,10 @@ void _recalculate_position()
{
int i = 0, j = 0, count = 0;
Evas_Real x0, y0, z0, x1, y1, z1, shiftx = 0, shifty = 0;
MineM15 *m;
Test_object *m;
eo_do(((MineM15 *)eina_list_nth(globalscene.mines, 0))->node, evas_3d_object_update());
eo_do(((MineM15 *)eina_list_nth(globalscene.mines, 0))->node,
eo_do(((Test_object *)eina_list_nth(globalscene.spheres, 0))->node, evas_3d_object_update());
eo_do(((Test_object *)eina_list_nth(globalscene.spheres, 0))->node,
evas_3d_node_bounding_box_get(&x0, &y0, &z0, &x1, &y1, &z1));
for (i = 0; i < globalscene.row; ++i)
@ -174,7 +180,7 @@ void _recalculate_position()
for(j = 0; j < globalscene.col; ++j)
{
shifty = j * 2 * y1;
m = (MineM15 *)eina_list_nth(globalscene.mines, count);
m = (Test_object *)eina_list_nth(globalscene.spheres, count);
eo_do(m->node, evas_3d_node_position_set(shifty, 0.0, shiftx));
count++;
}
@ -187,7 +193,7 @@ _on_key_down(void *data EINA_UNUSED, Evas *e EINA_UNUSED,
Evas_Event_Key_Down *ev = event_info;
Evas_Real x, y, z;
Eina_List *l;
MineM15 * item;
Test_object * item;
if (!strcmp(ev->key, "Down"))
{
eo_do(globalscene.camera_node, evas_3d_node_position_get(EVAS_3D_SPACE_PARENT, &x, &y, &z));
@ -200,21 +206,21 @@ _on_key_down(void *data EINA_UNUSED, Evas *e EINA_UNUSED,
}
else if (!strcmp(ev->key, "Left"))
{
eo_do(((MineM15 *)eina_list_nth(globalscene.mines, 0))->node,
eo_do(((Test_object *)eina_list_nth(globalscene.spheres, 0))->node,
evas_3d_node_scale_get(EVAS_3D_SPACE_PARENT, &x, &y, &z));
EINA_LIST_FOREACH(globalscene.mines, l, item)
EINA_LIST_FOREACH(globalscene.spheres, l, item)
{
eo_do(item->node, evas_3d_node_scale_set((x - 0.1), (y - 0.1), (z - 0.1)));
eo_do(item->node, evas_3d_node_scale_set((x - SCALE_UNIT), (y - SCALE_UNIT), (z - SCALE_UNIT)));
}
_recalculate_position();
}
else if (!strcmp(ev->key, "Right"))
{
eo_do(((MineM15 *)eina_list_nth(globalscene.mines, 0))->node,
eo_do(((Test_object *)eina_list_nth(globalscene.spheres, 0))->node,
evas_3d_node_scale_get(EVAS_3D_SPACE_PARENT, &x, &y, &z));
EINA_LIST_FOREACH(globalscene.mines, l, item)
EINA_LIST_FOREACH(globalscene.spheres, l, item)
{
eo_do(item->node, evas_3d_node_scale_set((x + 0.1), (y + 0.1), (z + 0.1)));
eo_do(item->node, evas_3d_node_scale_set((x + SCALE_UNIT), (y + SCALE_UNIT), (z + SCALE_UNIT)));
}
_recalculate_position();
}
@ -243,7 +249,7 @@ _on_mouse_down(void *data EINA_UNUSED, Evas *e EINA_UNUSED, Evas_Object *eo EINA
if (flag)
{
fprintf(stdout, "Boom! Time expended for color pick: %2.7f .\n", diff_sec);
eo_do(n, evas_3d_node_scale_set(0.5, 0.5, 0.5));
eo_do(n, evas_3d_node_scale_set(VEC_3(SMALL_SCALE)));
}
}
else
@ -255,49 +261,50 @@ _on_mouse_down(void *data EINA_UNUSED, Evas *e EINA_UNUSED, Evas_Object *eo EINA
if (flag)
{
fprintf(stdout, "Boom! Time expended for geometry pick: %2.7f .\n", diff_sec);
eo_do(n, evas_3d_node_scale_set(1.0, 1.0, 1.0));
eo_do(n, evas_3d_node_scale_set(VEC_3(BIG_SCALE)));
}
}
}
Eina_Bool
_init_m15(void *this, const char *model, const char *texture1,
const char *texture2)
_init_sphere(void *this, const char *texture1, const char *texture2)
{
MineM15 *m15 = (MineM15 *)this;
m15->mesh1 = eo_add(EVAS_3D_MESH_CLASS, evas);
m15->mesh2 = eo_add(EVAS_3D_MESH_CLASS, evas);
m15->material1 = eo_add(EVAS_3D_MATERIAL_CLASS, evas);
m15->material2 = eo_add(EVAS_3D_MATERIAL_CLASS, evas);
eo_do(m15->mesh1,
efl_file_set(model, NULL),
evas_3d_mesh_frame_material_set(0, m15->material1),
Test_object *sphere = (Test_object *)this;
sphere->mesh1 = eo_add(EVAS_3D_MESH_CLASS, evas);
sphere->mesh2 = eo_add(EVAS_3D_MESH_CLASS, evas);
sphere->material1 = eo_add(EVAS_3D_MATERIAL_CLASS, evas);
sphere->material2 = eo_add(EVAS_3D_MATERIAL_CLASS, evas);
evas_3d_add_sphere_frame(sphere->mesh1, 0, globalscene.precision, tex_scale);
eo_do(sphere->mesh1,
evas_3d_mesh_frame_material_set(0, sphere->material1),
evas_3d_mesh_shade_mode_set(EVAS_3D_SHADE_MODE_PHONG));
eo_do(m15->mesh2,
efl_file_set(model, NULL),
evas_3d_mesh_frame_material_set(0, m15->material2),
evas_3d_add_sphere_frame(sphere->mesh2, 0, globalscene.precision, tex_scale);
eo_do(sphere->mesh2,
evas_3d_mesh_frame_material_set(0, sphere->material2),
evas_3d_mesh_shade_mode_set(EVAS_3D_SHADE_MODE_PHONG));
eo_do(m15->mesh1, evas_3d_mesh_color_pick_enable_set(EINA_TRUE));
eo_do(m15->mesh2, evas_3d_mesh_color_pick_enable_set(EINA_TRUE));
eo_do(sphere->mesh1, evas_3d_mesh_color_pick_enable_set(EINA_TRUE));
eo_do(sphere->mesh2, evas_3d_mesh_color_pick_enable_set(EINA_TRUE));
m15->texture1 = eo_add(EVAS_3D_TEXTURE_CLASS, evas);
eo_do(m15->texture1,
sphere->texture1 = eo_add(EVAS_3D_TEXTURE_CLASS, evas);
eo_do(sphere->texture1,
evas_3d_texture_file_set(texture1, NULL),
evas_3d_texture_filter_set(EVAS_3D_TEXTURE_FILTER_NEAREST,
EVAS_3D_TEXTURE_FILTER_NEAREST),
evas_3d_texture_wrap_set(EVAS_3D_WRAP_MODE_REPEAT,
EVAS_3D_WRAP_MODE_REPEAT));
m15->texture2 = eo_add(EVAS_3D_TEXTURE_CLASS, evas);
eo_do(m15->texture2,
sphere->texture2 = eo_add(EVAS_3D_TEXTURE_CLASS, evas);
eo_do(sphere->texture2,
evas_3d_texture_file_set(texture2, NULL),
evas_3d_texture_filter_set(EVAS_3D_TEXTURE_FILTER_NEAREST,
EVAS_3D_TEXTURE_FILTER_NEAREST),
evas_3d_texture_wrap_set(EVAS_3D_WRAP_MODE_REPEAT,
EVAS_3D_WRAP_MODE_REPEAT));
eo_do(m15->material1,
evas_3d_material_texture_set(EVAS_3D_MATERIAL_DIFFUSE, m15->texture1),
eo_do(sphere->material1,
evas_3d_material_texture_set(EVAS_3D_MATERIAL_DIFFUSE, sphere->texture1),
evas_3d_material_enable_set(EVAS_3D_MATERIAL_AMBIENT, EINA_TRUE),
evas_3d_material_enable_set(EVAS_3D_MATERIAL_DIFFUSE, EINA_TRUE),
evas_3d_material_enable_set(EVAS_3D_MATERIAL_SPECULAR, EINA_TRUE),
@ -309,8 +316,8 @@ _init_m15(void *this, const char *model, const char *texture1,
evas_3d_material_color_set(EVAS_3D_MATERIAL_SPECULAR,
1.0, 1.0, 1.0, 1.0),
evas_3d_material_shininess_set(50.0));
eo_do(m15->material2,
evas_3d_material_texture_set(EVAS_3D_MATERIAL_DIFFUSE, m15->texture2),
eo_do(sphere->material2,
evas_3d_material_texture_set(EVAS_3D_MATERIAL_DIFFUSE, sphere->texture2),
evas_3d_material_enable_set(EVAS_3D_MATERIAL_AMBIENT, EINA_TRUE),
evas_3d_material_enable_set(EVAS_3D_MATERIAL_DIFFUSE, EINA_TRUE),
evas_3d_material_enable_set(EVAS_3D_MATERIAL_SPECULAR, EINA_TRUE),
@ -327,16 +334,15 @@ _init_m15(void *this, const char *model, const char *texture1,
Eina_Bool
_init_scene(const char *model, const char *texture1,
const char *texture2)
_init_scene(const char *texture1, const char *texture2)
{
int i = 0, j = 0, count = 0;
Evas_Real x0, y0, z0, x1, y1, z1, tmp, shiftx = 0, shifty = 0;
MineM15 *m;
Test_object *m;
animate_func[0] = _animate_mine1;
animate_func[1] = _animate_mine2;
animate_func[2] = _animate_mine3;
animate_func[0] = _animate_sphere1;
animate_func[1] = _animate_sphere2;
animate_func[2] = _animate_sphere3;
globalscene.scene = eo_add(EVAS_3D_SCENE_CLASS, evas);
@ -379,35 +385,36 @@ _init_scene(const char *model, const char *texture1,
tmp = 0.01;
for (i = 0; i < globalscene.col * globalscene.row; i++, j++)
{
MineM15 *m15tmp;
m = malloc(sizeof(MineM15));
m->m15_init = _init_m15;
Test_object *spheretmp;
m = malloc(sizeof(Test_object));
m->sphere_init = _init_sphere;
if (!i)
m->m15_init(m, model, texture1, texture2);
m->sphere_init(m, texture1, texture2);
else
{
m15tmp = (MineM15 *)eina_list_nth(globalscene.mines, 0);
m->mesh1 = m15tmp->mesh1;
m->mesh2 = m15tmp->mesh2;
m->material1 = m15tmp->material1;
m->material2 = m15tmp->material2;
m->texture1 = m15tmp->texture1;
m->texture2 = m15tmp->texture2;
spheretmp = (Test_object *)eina_list_nth(globalscene.spheres, 0);
m->mesh1 = spheretmp->mesh1;
m->mesh2 = spheretmp->mesh2;
m->material1 = spheretmp->material1;
m->material2 = spheretmp->material2;
m->texture1 = spheretmp->texture1;
m->texture2 = spheretmp->texture2;
}
m->node = eo_add(EVAS_3D_NODE_CLASS, evas,
evas_3d_node_constructor(EVAS_3D_NODE_TYPE_MESH));
m->speed = tmp;
if (j >= ANIMATION_COUNT) j = 0;
m->m15_animate = animate_func[j];
m->animate = ecore_timer_add(m->speed, m->m15_animate, m);
m->sphere_animate = animate_func[j];
m->animate = ecore_timer_add(m->speed, m->sphere_animate, m);
eo_do(globalscene.root_node, evas_3d_node_member_add(m->node));
eo_do(m->node, evas_3d_node_mesh_add(m->mesh1));
globalscene.mines = eina_list_append(globalscene.mines, m);
eo_do(m->node, evas_3d_node_mesh_add(m->mesh1),
evas_3d_node_scale_set(VEC_3(INIT_SCALE)));
globalscene.spheres = eina_list_append(globalscene.spheres, m);
tmp += 0.01;
}
eo_do(((MineM15 *)eina_list_nth(globalscene.mines, 0))->node, evas_3d_object_update());
eo_do(((MineM15 *)eina_list_nth(globalscene.mines, 0))->node,
eo_do(((Test_object *)eina_list_nth(globalscene.spheres, 0))->node, evas_3d_object_update());
eo_do(((Test_object *)eina_list_nth(globalscene.spheres, 0))->node,
evas_3d_node_bounding_box_get(&x0, &y0, &z0, &x1, &y1, &z1));
for (i = 0; i < globalscene.row; ++i)
@ -416,7 +423,7 @@ _init_scene(const char *model, const char *texture1,
for(j = 0; j < globalscene.col; ++j)
{
shifty = j * 2 * y1;
m = (MineM15 *)eina_list_nth(globalscene.mines, count);
m = (Test_object *)eina_list_nth(globalscene.spheres, count);
eo_do(m->node, evas_3d_node_position_set(shifty, 0.0, shiftx));
if (!(i % 2))
{
@ -436,14 +443,14 @@ _init_scene(const char *model, const char *texture1,
int main(int argc, char **argv)
{
int row = 0, col = 0;
char *model = NULL, *texture1 = NULL, *texture2 = NULL;
int row = 0, col = 0, precision = 0;
char *texture1 = NULL, *texture2 = NULL;
Eina_Bool r;
Ecore_Getopt_Value values[] = {
ECORE_GETOPT_VALUE_INT(row),
ECORE_GETOPT_VALUE_INT(col),
ECORE_GETOPT_VALUE_STR(model),
ECORE_GETOPT_VALUE_INT(precision),
ECORE_GETOPT_VALUE_STR(texture1),
ECORE_GETOPT_VALUE_STR(texture2),
ECORE_GETOPT_VALUE_NONE
@ -456,12 +463,12 @@ int main(int argc, char **argv)
if (!row) row = 2;
if (!col) col = 5;
if (!model) model = (char *)model_path;
if (!precision) precision = 30;
if (!texture1) texture1 = (char *)image1_path;
if (!texture2) texture2 = (char *)image2_path;
fprintf(stdout, "row - %d, col - %d, model - %s, texture1 - %s, texture2 - %s\n",
row, col, model, texture1, texture2);
fprintf(stdout, "row - %d, col - %d, precision of spheres - %d, texture1 - %s, texture2 - %s\n",
row, col, precision, texture1, texture2);
ecore_evas = ecore_evas_new("opengl_x11", 10, 10, WIDTH, HEIGHT, NULL);
@ -482,7 +489,8 @@ int main(int argc, char **argv)
globalscene.scene_init = _init_scene;
globalscene.row = row;
globalscene.col = col;
globalscene.scene_init(model, texture1, texture2);
globalscene.precision = precision;
globalscene.scene_init(texture1, texture2);
image = evas_object_image_filled_add(evas);

View File

@ -8,7 +8,7 @@
* Use 'z', 'x', 'c', 'Z', 'X' and 'C' keys to change scaling constants of mesh.
* See in terminal output value distance to far plane of frustum and value of visibility of node
* @see evas_3d_camera_node_visible_get.
*
*
* @verbatim
* gcc -o evas-3d-frustum evas-3d-frustum.c `pkg-config --libs --cflags efl evas ecore ecore-evas eo` -lm
* @endverbatim
@ -32,8 +32,8 @@
#define WIDTH 800
#define HEIGHT 600
static const char *image_eagle_path = PACKAGE_EXAMPLES_DIR EVAS_IMAGE_FOLDER "/eagle.png";
static const char *eagle_path = PACKAGE_EXAMPLES_DIR EVAS_MODEL_FOLDER "/eagle.md2";
static const char *texture_path = PACKAGE_EXAMPLES_DIR EVAS_IMAGE_FOLDER "/sweet_home_reversed.png";
static const char *mesh_path = PACKAGE_EXAMPLES_DIR EVAS_MODEL_FOLDER "/sweet_home.obj";
typedef struct _Scene_Data
{
@ -54,7 +54,7 @@ typedef struct _Scene_Data
Evas *evas;
Evas_Object *background,*image;
Evas_Real obj_x = 0.0, obj_y = 0.0, obj_z = 0.0, obj_sc_x = 1.0, obj_sc_y = 1.0, obj_sc_z = 1.0;
Evas_Real obj_x = 0.0, obj_y = 0.0, obj_z = 0.0, obj_sc_x = 10.0, obj_sc_y = 10.0, obj_sc_z = 10.0;
Evas_Real fleft = -5, fright = 5, fbottom = -5, fup = 5, fnear = 20, ffar = 1000;
Evas_Real radius = 0;
Evas_3D_Frustum_Mode key = EVAS_3D_FRUSTUM_MODE_AABB;
@ -448,10 +448,7 @@ _mesh_setup(Scene_Data *data)
data->mesh_node =
eo_add(EVAS_3D_NODE_CLASS, evas,
evas_3d_node_constructor(EVAS_3D_NODE_TYPE_MESH),
evas_3d_node_position_set(obj_x, obj_y, obj_z),
evas_3d_node_scale_set(obj_sc_x, obj_sc_y, obj_sc_z));
eo_add(EVAS_3D_NODE_CLASS, evas, evas_3d_node_constructor(EVAS_3D_NODE_TYPE_MESH));
eo_do(data->root_node, evas_3d_node_member_add(data->mesh_node));
eo_do(data->mesh_node, evas_3d_node_mesh_add(data->mesh));
}
@ -464,7 +461,7 @@ _mesh_setup_model(Scene_Data *data)
data->texture_model = eo_add(EVAS_3D_TEXTURE_CLASS, evas);
eo_do(data->texture_model,
evas_3d_texture_file_set(image_eagle_path, NULL),
evas_3d_texture_file_set(texture_path, NULL),
evas_3d_texture_filter_set(EVAS_3D_TEXTURE_FILTER_NEAREST, EVAS_3D_TEXTURE_FILTER_NEAREST),
evas_3d_texture_wrap_set(EVAS_3D_WRAP_MODE_REPEAT, EVAS_3D_WRAP_MODE_REPEAT));
@ -481,7 +478,7 @@ _mesh_setup_model(Scene_Data *data)
evas_3d_material_shininess_set(100.0));
eo_do(data->mesh_model,
efl_file_set(eagle_path, NULL),
efl_file_set(mesh_path, NULL),
evas_3d_mesh_frame_material_set(0, data->material_model),
evas_3d_mesh_shade_mode_set(EVAS_3D_SHADE_MODE_DIFFUSE));
}
@ -502,6 +499,7 @@ _scene_setup(Scene_Data *data)
evas_3d_node_constructor(EVAS_3D_NODE_TYPE_MESH));
eo_do(data->mesh_node_model,
evas_3d_node_position_set(obj_x, obj_y, obj_z),
evas_3d_node_orientation_angle_axis_set(-90, 1.0, 0.0, 0.0),
evas_3d_node_scale_set(obj_sc_x, obj_sc_y, obj_sc_z));
eo_do(data->root_node, evas_3d_node_member_add(data->mesh_node_model));
eo_do(data->mesh_node_model, evas_3d_node_mesh_add(data->mesh_model));

View File

@ -401,12 +401,9 @@ evas_gl_exam(Evas_Object *win)
Evas_Native_Surface ns;
//Config for the surface for evas gl
Evas_GL_Config config =
{
EVAS_GL_RGBA_8888,
EVAS_GL_DEPTH_BIT_32,
EVAS_GL_STENCIL_NONE
};
Evas_GL_Config *config = evas_gl_config_new();
config->color_format = EVAS_GL_RGBA_8888;
config->depth_bits = EVAS_GL_DEPTH_BIT_24;
//Get the window size
Evas_Coord w,h;
@ -417,8 +414,9 @@ evas_gl_exam(Evas_Object *win)
gldata.glapi = evas_gl_api_get(gldata.evasgl);
//Create a surface and context
gldata.sfc = evas_gl_surface_create(gldata.evasgl, &config, w, h);
gldata.sfc = evas_gl_surface_create(gldata.evasgl, config, w, h);
gldata.ctx = evas_gl_context_create(gldata.evasgl, NULL);
evas_gl_config_free(config);
//Set rotation variables
gldata.xangle = 45.0f;

View File

@ -248,10 +248,6 @@ main(void)
ecore_main_loop_begin();
/* Decrementing object's reference count.*/
eo_unref(d.bg);
eo_unref(d.clipper_border);
ecore_evas_free(d.ee);
ecore_evas_shutdown();
return 0;

Binary file not shown.

Before

Width:  |  Height:  |  Size: 99 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 144 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 117 KiB

View File

@ -1,16 +0,0 @@
# 3ds Max Wavefront OBJ Exporter v0.97b - (c)2007 guruware
# File Created: 26.03.2014 19:15:34
newmtl Material__25
Ns 10.0000
Ni 1.5000
d 1.0000
Tr 0.0000
Tf 1.0000 1.0000 1.0000
illum 2
Ka 0.5880 0.5880 0.5880
Kd 0.5880 0.5880 0.5880
Ks 0.0000 0.0000 0.0000
Ke 0.0000 0.0000 0.0000
map_Ka D:\Bajado de Internet\Max 3ds\BF4 weapons\Gadgets\M15\m15_d.tga
map_Kd D:\Bajado de Internet\Max 3ds\BF4 weapons\Gadgets\M15\m15_d.tga

File diff suppressed because it is too large Load Diff

View File

@ -1,11 +0,0 @@
# Blender MTL File: 'None'
# Material Count: 1
newmtl Material.001
Ns 90.196078
Ka 0.000000 0.000000 0.000000
Kd 0.124158 0.125842 0.000000
Ks 0.025297 0.000000 1.000000
Ni 1.000000
d 1.000000
illum 2

View File

@ -1,22 +0,0 @@
# Blender MTL File: 'sweet_home.blend'
# Material Count: 2
newmtl Material
Ns 96.078431
Ka 0.000000 0.000000 0.000000
Kd 0.640000 0.640000 0.640000
Ks 0.500000 0.500000 0.500000
Ni 1.000000
d 1.000000
illum 2
map_Kd /home/bdevichev/Desktop/rect.png
newmtl Material_Untitled
Ns 96.078431
Ka 0.000000 0.000000 0.000000
Kd 0.640000 0.640000 0.640000
Ks 0.500000 0.500000 0.500000
Ni 1.000000
d 1.000000
illum 2
map_Kd /home/bdevichev/Desktop/sweet_home.png

View File

@ -1,12 +0,0 @@
# Blender MTL File: 'sweet_home.blend'
# Material Count: 1
newmtl Material
Ns 96.078431
Ka 0.000000 0.000000 0.000000
Kd 0.640000 0.640000 0.640000
Ks 0.500000 0.500000 0.500000
Ni 1.000000
d 1.000000
illum 2
map_Kd /home/bdevichev/Desktop/rect.png

View File

@ -1,22 +0,0 @@
# Blender MTL File: 'sweet_home.blend'
# Material Count: 2
newmtl Material
Ns 96.078431
Ka 0.000000 0.000000 0.000000
Kd 0.640000 0.640000 0.640000
Ks 0.500000 0.500000 0.500000
Ni 1.000000
d 1.000000
illum 2
map_Kd /home/bdevichev/Desktop/rect.png
newmtl Material_Untitled
Ns 96.078431
Ka 0.000000 0.000000 0.000000
Kd 0.640000 0.640000 0.640000
Ks 0.500000 0.500000 0.500000
Ni 1.000000
d 1.000000
illum 2
map_Kd /home/bdevichev/Desktop/sweet_home.png

View File

@ -1,12 +0,0 @@
# Blender MTL File: 'sweet_home.blend'
# Material Count: 1
newmtl Material
Ns 96.078431
Ka 0.000000 0.000000 0.000000
Kd 0.640000 0.640000 0.640000
Ks 0.500000 0.500000 0.500000
Ni 1.000000
d 1.000000
illum 2
map_Kd /home/bdevichev/Desktop/rect.png

View File

@ -401,6 +401,8 @@ _ecore_con_server_eo_base_finalize(Ecore_Con_Server *obj, Ecore_Con_Server_Data
if (!svr->name)
goto error;
type = compl_type & ECORE_CON_TYPE;
EINA_SAFETY_ON_TRUE_GOTO(((type == ECORE_CON_REMOTE_TCP) ||
(type == ECORE_CON_REMOTE_NODELAY) ||
(type == ECORE_CON_REMOTE_CORK) ||
@ -411,8 +413,6 @@ _ecore_con_server_eo_base_finalize(Ecore_Con_Server *obj, Ecore_Con_Server_Data
if (ecore_con_ssl_server_prepare(obj, compl_type & ECORE_CON_SSL))
goto error;
type = compl_type & ECORE_CON_TYPE;
if ((type == ECORE_CON_LOCAL_USER) ||
(type == ECORE_CON_LOCAL_SYSTEM) ||
(type == ECORE_CON_LOCAL_ABSTRACT))

View File

@ -813,6 +813,26 @@ EAPI Eina_Bool edje_edit_color_class_colors_set(Evas_Object *obj, const char *cl
*/
EAPI Eina_Bool edje_edit_color_class_name_set(Evas_Object *obj, const char *name, const char *newname);
/** Get the description of a color class.
*
* @param obj Object being edited.
* @param name Color class to get the description of.
*
* @return The description of the color class or @c NULL if not found
* @since 1.14
*/
EAPI Eina_Stringshare *edje_edit_color_class_description_get(Evas_Object *obj, const char *class_name);
/** Change the description of a color class.
*
* @param obj Object being edited.
* @param name Color class to edit.
* @param desc New description for the color class
*
* @return @c EINA_TRUE in case of success, @c EINA_FALSE otherwise.
* @since 1.14
*/
EAPI Eina_Bool edje_edit_color_class_description_set(Evas_Object *obj, const char *class_name, const char *desc);
//@}

View File

@ -418,6 +418,7 @@ _edje_edd_init(void)
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_color_class, Edje_Color_Class, "g3", g3, EET_T_UCHAR);
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_color_class, Edje_Color_Class, "b3", b3, EET_T_UCHAR);
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_color_class, Edje_Color_Class, "a3", a3, EET_T_UCHAR);
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_color_class, Edje_Color_Class, "desc", desc, EET_T_STRING);
/* the main file directory */
EET_EINA_FILE_DATA_DESCRIPTOR_CLASS_SET(&eddc, Edje_File);

View File

@ -2519,6 +2519,43 @@ edje_edit_color_class_colors_set(Evas_Object *obj, const char *class_name, int r
return EINA_FALSE;
}
EAPI Eina_Stringshare *
edje_edit_color_class_description_get(Evas_Object *obj, const char *class_name)
{
Eina_List *l;
Edje_Color_Class *cc;
GET_ED_OR_RETURN(NULL);
EINA_SAFETY_ON_NULL_RETURN_VAL(class_name, NULL);
if (!ed->file || !ed->file->color_classes)
return NULL;
EINA_LIST_FOREACH(ed->file->color_classes, l, cc)
if (eina_streq(cc->name, class_name))
return cc->desc;
return NULL;
}
EAPI Eina_Bool
edje_edit_color_class_description_set(Evas_Object *obj, const char *class_name, const char *desc)
{
Eina_List *l;
Edje_Color_Class *cc;
GET_ED_OR_RETURN(EINA_FALSE);
EINA_SAFETY_ON_NULL_RETURN_VAL(class_name, EINA_FALSE);
if (!ed->file || !ed->file->color_classes)
return EINA_FALSE;
EINA_LIST_FOREACH(ed->file->color_classes, l, cc)
if (eina_streq(cc->name, class_name))
{
eina_stringshare_replace(&cc->desc, desc);
return EINA_TRUE;
}
return EINA_FALSE;
}
EAPI Eina_Bool
edje_edit_color_class_add(Evas_Object *obj, const char *name)
{
@ -11426,6 +11463,9 @@ _edje_generate_source_of_group(Edje *ed, Edje_Part_Collection_Directory_Entry *p
Eina_List *alias_list = NULL;
const char *alias;
Eina_Iterator *it;
int len;
char *tmp_alias;
const char* aliased;
obj = edje_edit_object_add(ed->base->evas);
if (!edje_object_file_set(obj, ed->file->path, group)) return EINA_FALSE;
@ -11507,13 +11547,14 @@ _edje_generate_source_of_group(Edje *ed, Edje_Part_Collection_Directory_Entry *p
BUF_APPEND(I2"parts {\n");
if ((pc->aliased) && (pc->alias))
{
it = eina_hash_iterator_data_new(pc->aliased);
EINA_ITERATOR_FOREACH(it, alias)
BUF_APPENDF(I3"alias: \"%s\" ", alias);
eina_iterator_free(it);
it = eina_hash_iterator_data_new(pc->alias);
EINA_ITERATOR_FOREACH(it, alias)
BUF_APPENDF("\"%s\";\n", alias);
{
tmp_alias = strdup(alias);
aliased = _edje_find_alias(pc->aliased, tmp_alias, &len);
BUF_APPENDF(I3"alias: \"%s\" \"%s\";\n", aliased, alias);
free(tmp_alias);
}
eina_iterator_free(it);
}
for (i = 0; i < pc->parts_count; i++)

View File

@ -1545,6 +1545,7 @@ _edje_file_free(Edje_File *edf)
EINA_LIST_FREE(edf->color_classes, ecc)
{
if (edf->free_strings && ecc->name) eina_stringshare_del(ecc->name);
if (edf->free_strings) eina_stringshare_del(ecc->desc);
free(ecc);
}
@ -1809,7 +1810,7 @@ _edje_object_pack_item_hints_set(Evas_Object *obj, Edje_Pack_Element *it)
evas_object_resize(obj, w, h);
}
static const char *
const char *
_edje_find_alias(Eina_Hash *aliased, char *src, int *length)
{
const char *alias;

View File

@ -2146,6 +2146,18 @@ class Edje.Object (Evas.Smart_Clipped, Efl.File)
@out int a3; /*@ Shadow Alpha value */
}
}
color_class_description_get @const {
/*@
@brief Gets the description of an object color class.
@return The description of the target color class or @c NULL if not found
This function gets the description of a color class in use by an object. */
return: const(char)*;
params {
@in const(char)* color_class;
}
}
part_drag_step {
/*@
@brief Steps the dragable x,y steps.

View File

@ -1867,6 +1867,7 @@ struct _Edje_Color_Class
unsigned char r, g, b, a;
unsigned char r2, g2, b2, a2;
unsigned char r3, g3, b3, a3;
Eina_Stringshare *desc;
};
struct _Edje_Text_Class
@ -2255,6 +2256,7 @@ void _edje_color_class_on_del(Edje *ed, Edje_Part *ep);
void _edje_color_class_members_free(void);
void _edje_color_class_hash_free(void);
const char * _edje_find_alias(Eina_Hash *aliased, char *src, int *length);
Edje_Text_Class *_edje_text_class_find(Edje *ed, const char *text_class);
void _edje_text_class_member_add(Edje *ed, const char *text_class);
void _edje_text_class_member_del(Edje *ed, const char *text_class);

View File

@ -66,6 +66,7 @@ _edje_color_class_free(void *data)
Edje_Color_Class *cc = data;
if (cc->name) eina_stringshare_del(cc->name);
eina_stringshare_del(cc->desc);
free(cc);
}

View File

@ -774,6 +774,13 @@ _edje_object_color_class_get(Eo *obj EINA_UNUSED, Edje *ed, const char *color_cl
return EINA_FALSE;
}
EOLIAN Eina_Stringshare *
_edje_object_color_class_description_get(Eo *obj EINA_UNUSED, Edje *ed, const char *color_class)
{
Edje_Color_Class *cc = _edje_color_class_find(ed, color_class);
return cc ? cc->desc : NULL;
}
void
edje_object_color_class_del(Evas_Object *obj, const char *color_class)
{

View File

@ -641,11 +641,15 @@ EAPI void eo_error_set_internal(const Eo *obj, const char *file, int line);
/**
* @def eo_add
* @brief Create a new object with the default constructor.
* @brief Create a new object and call its constructor(If it exits).
*
* The object returned by this function always has at least 1 ref. If the object
* has a parent, it returns with 1 ref, and even if it doesn't have a parent
* it's returned with 1 ref. This is convenient in C.
* The object returned by this function will always have 1 ref
* (reference count) irrespective of whether the parent is NULL or
* not.
* If the object is created using this function, then it would
* automatically gets deleted when the parent object is deleted.
* There is no need to call eo_unref on the child. This is convenient
* in C.
*
* If you want a more "consistent" behaviour, take a look at #eo_add_ref.
*
@ -658,10 +662,13 @@ EAPI void eo_error_set_internal(const Eo *obj, const char *file, int line);
/**
* @def eo_add_ref
* @brief Create a new object with the default constructor.
* @brief Create a new object and call its constructor(If it exists).
*
* The object returned by this function has 1 ref for itself, 1 ref from the
* parent (if exists) and possible other refs if were added during construction.
* If a child object is created using this, then it won't get deleted
* when the parent object is deleted until you manually remove the ref
* by calling eo_unref().
*
* @param klass the class of the object to create.
* @param parent the parent to set to the object.

View File

@ -34,6 +34,18 @@ static inline void _eo_data_xunref_internal(_Eo_Object *obj, void *data, const _
static const _Eo_Class *_eo_op_class_get(Eo_Op op);
static const char * _eo_op_id_name_get(Eo_Op op);
//avi dbg start
static unsigned int eo_data_scope_get_counter=0;
static clock_t eo_data_scope_get_clocks =0;
static unsigned int eo_op_class_counter=0;
static clock_t eo_op_class_get_clocks =0;
static unsigned int eo_call_resolve_counter=0;
static clock_t eo_call_resolve_clocks =0;
//avi dbg end
/* Start of Dich */
/* How we search and store the implementations in classes. */
@ -168,10 +180,12 @@ _eo_class_pointer_get(const Eo_Class *klass_id)
static const _Eo_Class *
_eo_op_class_get(Eo_Op op)
{
eo_op_class_counter++;
/* FIXME: Make it fast. */
_Eo_Class **itr = _eo_classes;
int mid, max, min;
clock_t start_time=clock();
min = 0;
max = _eo_classes_last_id - 1;
while (min <= max)
@ -182,10 +196,13 @@ _eo_op_class_get(Eo_Op op)
min = mid + 1;
else if (itr[mid]->base_id > op)
max = mid - 1;
else
return itr[mid];
}
else{
eo_op_class_get_clocks+=clock()-start_time;
return itr[mid];
}
}
eo_op_class_get_clocks+=clock()-start_time;
return NULL;
}
@ -565,7 +582,11 @@ EAPI Eina_Bool
const op_type_funcs *func;
Eina_Bool is_obj;
if (op == EO_NOOP) return EINA_FALSE;
eo_call_resolve_counter++;
clock_t start_time=clock();
if (op == EO_NOOP) return EINA_FALSE;
fptr = _eo_call_stack_get(is_main_loop)->frame_ptr;
@ -617,7 +638,7 @@ EAPI Eina_Bool
call->obj = call->klass;
call->data = NULL;
}
eo_call_resolve_clocks+=clock()-start_time;
return EINA_TRUE;
}
@ -653,6 +674,8 @@ end:
call->func = func->func;
call->data = _eo_data_scope_get(emb_obj, func->src);
eo_call_resolve_clocks+=clock()-start_time;
return EINA_TRUE;
}
}
@ -676,6 +699,9 @@ end:
file, line, func_name, op, main_klass->desc->name);
}
}
eo_call_resolve_clocks+=clock()-start_time;
return EINA_FALSE;
}
@ -1600,6 +1626,9 @@ _eo_condtor_done(Eo *obj_id)
static inline void *
_eo_data_scope_get(const _Eo_Object *obj, const _Eo_Class *klass)
{
eo_data_scope_get_counter++;
clock_t start_time = clock();
if (EINA_LIKELY((klass->desc->data_size > 0) && (klass->desc->type != EO_CLASS_TYPE_MIXIN)))
return ((char *) obj) + _eo_sz + klass->data_offset;
@ -1610,17 +1639,23 @@ _eo_data_scope_get(const _Eo_Object *obj, const _Eo_Class *klass)
{
Eo_Extension_Data_Offset *doff_itr = obj->klass->extn_data_off;
if (!doff_itr)
if (!doff_itr){
eo_data_scope_get_clocks+=clock()-start_time;
return NULL;
}
while (doff_itr->klass)
{
if (doff_itr->klass == klass)
if (doff_itr->klass == klass){
eo_data_scope_get_clocks+=clock()-start_time;
return ((char *) obj) + _eo_sz + doff_itr->offset;
}
doff_itr++;
}
}
eo_data_scope_get_clocks+=clock()-start_time;
return NULL;
}
@ -1901,4 +1936,16 @@ eo_manual_free(Eo *obj_id)
return EINA_TRUE;
}
static __attribute__((destructor)) void finish(void)
{
printf("eo.c: _eo_data_scope_get= %u time=%f , eo_op_class_get=%u time=%f, eo_call_resolve=%u time=%f\n",
eo_data_scope_get_counter, (double) eo_data_scope_get_clocks /CLOCKS_PER_SEC,
eo_op_class_counter, (double)eo_op_class_get_clocks /CLOCKS_PER_SEC,
eo_call_resolve_counter, (double)eo_call_resolve_clocks /CLOCKS_PER_SEC
);//avi debug
}

View File

@ -12,6 +12,8 @@ static int event_freeze_count = 0;
typedef struct _Eo_Callback_Description Eo_Callback_Description;
#define CALLSIZE 62
typedef struct
{
Eina_List *children;
@ -21,11 +23,39 @@ typedef struct
Eina_Inlist *generic_data;
Eo ***wrefs;
Eo_Callback_Description *callbacks;
// Eo_Callback_Description *callbacks;
Eina_Inarray *callbacks;
int callbacks_hash[ CALLSIZE +1][2];
Eina_Bool callbacks_hash_dirty ;
unsigned short walking_list;
unsigned short event_freeze_count;
Eina_Bool deletions_waiting : 1;
unsigned int called_counter;
unsigned int callbacks_counter;
unsigned int called_loop_counter;
unsigned int called_inner_loop_counter;
unsigned int arrays_counter;
clock_t called_sum_clocks ;
unsigned int events_counter;
unsigned long long int have_events;
} Eo_Base_Data;
static unsigned int called_counter=0;
static unsigned int callbacks_counter=0;
static unsigned int called_loop_counter=0;
static unsigned int called_inner_loop_counter=0;
static unsigned int arrays_counter=0;
static unsigned int objects_counter=0;
static clock_t called_sum_clocks =0;
static clock_t start_clock =0;
static clock_t key_data_get_sum_clocks =0;
static unsigned int events_counter=0;
typedef struct
{
@ -84,7 +114,7 @@ _eo_base_key_data_get(Eo *obj EINA_UNUSED, Eo_Base_Data *pd, const char *key)
/* We don't really change it... */
Eo_Generic_Data_Node *node;
if (!key) return NULL;
clock_t start_time=clock();
EINA_INLIST_FOREACH(pd->generic_data, node)
{
if (!strcmp(node->key, key))
@ -94,7 +124,7 @@ _eo_base_key_data_get(Eo *obj EINA_UNUSED, Eo_Base_Data *pd, const char *key)
return node->data;
}
}
key_data_get_sum_clocks+=clock()-start_time;
return NULL;
}
@ -435,7 +465,7 @@ _legacy_events_hash_free_cb(void *_desc)
struct _Eo_Callback_Description
{
Eo_Callback_Description *next;
//Eo_Callback_Description *next;
union
{
@ -455,7 +485,7 @@ static void
_eo_callback_remove(Eo_Base_Data *pd, Eo_Callback_Description *cb)
{
Eo_Callback_Description *itr, *pitr = NULL;
#if 0
itr = pd->callbacks;
for ( ; itr; )
@ -480,20 +510,107 @@ _eo_callback_remove(Eo_Base_Data *pd, Eo_Callback_Description *cb)
pitr = titr;
}
}
#endif
}
/* Actually remove, doesn't care about walking list, or delete_me */
static void
_eo_callback_remove_all(Eo_Base_Data *pd)
{
#if 0
while (pd->callbacks)
{
Eo_Callback_Description *next = pd->callbacks->next;
free(pd->callbacks);
pd->callbacks = next;
}
#endif
}
int _eo_base_get_event_index_hash( const Eo_Event_Description *a){
void * p;
if (!a){
printf("not a \n");
return 0;//avi todo fo change to -1
}
/* If either is legacy, fallback to string comparison. */
if ((a->doc == _legacy_event_desc))
{
p = a->name;
}
else
{
p=a;
}
int index_hash = ((unsigned long long int )p)%CALLSIZE;
return index_hash;
}
void _eo_base_set_event_hash( const Eo_Event_Description *a , Eo_Base_Data *pd, int i, int aIndex){
int index_hash = _eo_base_get_event_index_hash(a );
// pd->callbacks_hash[index_hash] |= 1<<i;
if( pd->callbacks_hash[index_hash][0] == -1 ){
pd->callbacks_hash[index_hash][0] = i;
pd->callbacks_hash[index_hash][1] = aIndex;
pd->callbacks_hash[index_hash][2] = 0;
// printf("first one for %d is %d\n", index_hash, i);
}
else{
pd->callbacks_hash[index_hash][2]++;//there is more
// printf("more than one for %d\n", index_hash);
}
}
void _eo_base_update_callbacks_hash ( Eo_Base_Data *pd){
Eo_Callback_Description *cb;
for( int i=0;i< CALLSIZE ;i++){
pd->callbacks_hash[i][0] = -1;
pd->callbacks_hash[i][1]= -1;
pd->callbacks_hash[i][2] = 0;
}
int i=0;
EINA_INARRAY_FOREACH(pd->callbacks, cb){
if (!cb->delete_me)
{
if (cb->func_array)
{
const Eo_Callback_Array_Item *it;
int count = 0;
for (it = cb->items.item_array; it->func; it++)
{
_eo_base_set_event_hash( it->desc , pd, i, count);
count++;
}
}
else{
_eo_base_set_event_hash( cb->items.item.desc, pd , i, -1);
}
}
i++;
}
pd->callbacks_hash_dirty = EINA_FALSE;
}
_eo_base_callback_delete_me_check( const Eina_Inarray *iarr, void *a, void *b)
{
return ((struct _Eo_Callback_Description*)a)->delete_me;
}
static void
_eo_callbacks_clear(Eo_Base_Data *pd)
{
@ -509,21 +626,15 @@ _eo_callbacks_clear(Eo_Base_Data *pd)
pd->deletions_waiting = EINA_FALSE;
for (cb = pd->callbacks; cb; )
{
Eo_Callback_Description *titr = cb;
cb = cb->next;
eina_inarray_foreach_remove( pd->callbacks, _eo_base_callback_delete_me_check, NULL);
_eo_base_update_callbacks_hash(pd);
if (titr->delete_me)
{
_eo_callback_remove(pd, titr);
}
}
}
static void
_eo_callbacks_sorted_insert(Eo_Base_Data *pd, Eo_Callback_Description *cb)
{
Eo_Callback_Description *itr, *itrp = NULL;
for (itr = pd->callbacks; itr && (itr->priority < cb->priority);
itr = itr->next)
@ -541,29 +652,72 @@ _eo_callbacks_sorted_insert(Eo_Base_Data *pd, Eo_Callback_Description *cb)
cb->next = pd->callbacks;
pd->callbacks = cb;
}
}
void set_event_have( const Eo_Event_Description *a , Eo_Base_Data *pd){
void * p;
if (!a)
return;
/* If either is legacy, fallback to string comparison. */
if ((a->doc == _legacy_event_desc))
{
p = a->name;
}
else
{
p=a;
}
unsigned int index = ((unsigned long long int )p)%63;
if( (pd->have_events & (1<<index) )==0){
pd->events_counter++;
pd->have_events |= 1<<index;
}
}
int
_eo_base_callback_priority_cmp(const void *a, const void *b)
{
return (( Eo_Callback_Description*)a)->priority < (( Eo_Callback_Description*)b)->priority;
}
EOLIAN static void
_eo_base_event_callback_priority_add(Eo *obj, Eo_Base_Data *pd,
const Eo_Event_Description *desc,
Eo_Callback_Priority priority,
Eo_Event_Cb func,
const void *user_data)
const Eo_Event_Description *desc,
Eo_Callback_Priority priority,
Eo_Event_Cb func,
const void *user_data)
{
Eo_Callback_Description *cb;
Eo_Callback_Description cb;
cb = calloc(1, sizeof(*cb));
if (!cb) return;
cb->items.item.desc = desc;
cb->items.item.func = func;
cb->func_data = (void *) user_data;
cb->priority = priority;
_eo_callbacks_sorted_insert(pd, cb);
// cb = calloc(1, sizeof(*cb));
// if (!cb) return;
cb.items.item.desc = desc;
cb.items.item.func = func;
cb.func_data = (void *) user_data;
cb.priority = priority;
cb.func_array = EINA_FALSE;
cb.delete_me = EINA_FALSE;
// _eo_callbacks_sorted_insert(pd, cb);
eina_inarray_insert_sorted(pd->callbacks, &cb , _eo_base_callback_priority_cmp);
//pd->callbacks_hash_dirty = EINA_TRUE;
_eo_base_update_callbacks_hash(pd);
{
const Eo_Callback_Array_Item arr[] = { {desc, func}, {NULL, NULL}};
eo_do(obj, eo_event_callback_call(EO_EV_CALLBACK_ADD, (void *)arr));
}
pd->callbacks_counter++;//avi debug
set_event_have( desc, pd);
}
EOLIAN static void
@ -574,11 +728,12 @@ _eo_base_event_callback_del(Eo *obj, Eo_Base_Data *pd,
{
Eo_Callback_Description *cb;
for (cb = pd->callbacks; cb; cb = cb->next)
{
if ((cb->items.item.desc == desc) && (cb->items.item.func == func) &&
EINA_INARRAY_FOREACH(pd->callbacks, cb)
if ((cb->items.item.desc == desc) && (cb->items.item.func == func) &&
(cb->func_data == user_data))
{
// eina_inarray_remove(callbacks , cb );
const Eo_Callback_Array_Item arr[] = { {desc, func}, {NULL, NULL}};
cb->delete_me = EINA_TRUE;
@ -587,32 +742,45 @@ _eo_base_event_callback_del(Eo *obj, Eo_Base_Data *pd,
eo_do(obj, eo_event_callback_call(EO_EV_CALLBACK_DEL, (void *)arr); );
return;
}
}
DBG("Callback of object %p with function %p and data %p not found.", obj, func, user_data);
}
EOLIAN static void
_eo_base_event_callback_array_priority_add(Eo *obj, Eo_Base_Data *pd,
const Eo_Callback_Array_Item *array,
Eo_Callback_Priority priority,
const void *user_data)
const Eo_Callback_Array_Item *array,
Eo_Callback_Priority priority,
const void *user_data)
{
Eo_Callback_Description *cb;
Eo_Callback_Description cb;
cb = calloc(1, sizeof(*cb));
if (!cb) return;
cb->func_data = (void *) user_data;
cb->priority = priority;
cb->items.item_array = array;
cb->func_array = EINA_TRUE;
_eo_callbacks_sorted_insert(pd, cb);
// cb = calloc(1, sizeof(*cb));
// if (!cb) return;
cb.func_data = (void *) user_data;
cb.priority = priority;
cb.items.item_array = array;
cb.func_array = EINA_TRUE;
cb.delete_me = EINA_FALSE;
// _eo_callbacks_sorted_insert(pd, cb);
eina_inarray_insert_sorted(pd->callbacks, &cb , _eo_base_callback_priority_cmp);
//pd->callbacks_hash_dirty = EINA_TRUE;
_eo_base_update_callbacks_hash(pd);
{
eo_do(obj, eo_event_callback_call(EO_EV_CALLBACK_ADD, (void *)array); );
}
pd->arrays_counter++;//avi debug
const Eo_Callback_Array_Item *it;
for (it = cb.items.item_array; it->func; it++)
{
set_event_have( it->desc, pd);
}
}
EOLIAN static void
_eo_base_event_callback_array_del(Eo *obj, Eo_Base_Data *pd,
const Eo_Callback_Array_Item *array,
@ -620,8 +788,8 @@ _eo_base_event_callback_array_del(Eo *obj, Eo_Base_Data *pd,
{
Eo_Callback_Description *cb;
for (cb = pd->callbacks; cb; cb = cb->next)
{
EINA_INARRAY_FOREACH(pd->callbacks, cb)
if ((cb->items.item_array == array) && (cb->func_data == user_data))
{
cb->delete_me = EINA_TRUE;
@ -631,7 +799,6 @@ _eo_base_event_callback_array_del(Eo *obj, Eo_Base_Data *pd,
eo_do(obj, eo_event_callback_call(EO_EV_CALLBACK_DEL, (void *)array); );
return;
}
}
DBG("Callback of object %p with function array %p and data %p not found.", obj, array, user_data);
}
@ -663,8 +830,8 @@ _cb_desc_match(const Eo_Event_Description *a, const Eo_Event_Description *b)
EOLIAN static Eina_Bool
_eo_base_event_callback_call(Eo *obj_id, Eo_Base_Data *pd,
const Eo_Event_Description *desc,
void *event_info)
const Eo_Event_Description *desc,
void *event_info)
{
Eina_Bool ret;
Eo_Callback_Description *cb;
@ -676,52 +843,131 @@ _eo_base_event_callback_call(Eo *obj_id, Eo_Base_Data *pd,
_eo_ref(obj);
pd->walking_list++;
for (cb = pd->callbacks; cb; cb = cb->next)
pd->called_counter++;//avi debug
clock_t start_time = clock();
if(pd->callbacks_hash_dirty){
_eo_base_update_callbacks_hash(pd);
//printf("dirty!\n");
}
int index_hash = _eo_base_get_event_index_hash( desc );
if(pd->callbacks_hash[index_hash][0]==-1)
goto end;
if(pd->callbacks_hash[index_hash][2]==0){//the only one
// printf("call the only one!\n");
cb = eina_inarray_nth(pd->callbacks, pd->callbacks_hash[index_hash][0]);
if (!cb->delete_me)
{
if(pd->callbacks_hash[index_hash][1]>-1){//array
//printf("array!\n");
const Eo_Callback_Array_Item *it= cb->items.item_array+pd->callbacks_hash[index_hash][1];
if (!_cb_desc_match(it->desc, desc))
goto end;//instead of continiue
if (!it->desc->unfreezable &&
(event_freeze_count || pd->event_freeze_count))
goto end;//instead of continiue
unsigned int before_func=clock();
/* Abort callback calling if the func says so. */
if (!it->func((void *) cb->func_data, obj_id, desc,
(void *) event_info))
{
start_time+=clock()-before_func;
ret = EINA_FALSE;
goto end;
}
start_time+=clock()-before_func;
}
else{
if (!_cb_desc_match(cb->items.item.desc, desc))
goto end;//instead of continiue
if ((!cb->items.item.desc
|| !cb->items.item.desc->unfreezable) &&
(event_freeze_count || pd->event_freeze_count))
goto end;//instead of continiue
unsigned int before_func=clock();
/* Abort callback calling if the func says so. */
if (!cb->items.item.func((void *) cb->func_data, obj_id, desc,
(void *) event_info))
{
start_time+=clock()-before_func;
ret = EINA_FALSE;
goto end;
}
start_time+=clock()-before_func;
}
}
goto end;
}
// printf("cal: more than one for %d\n", index_hash);
EINA_INARRAY_FOREACH(pd->callbacks, cb)
{
pd->called_loop_counter++;//avi debug
if (!cb->delete_me)
{
if (cb->func_array)
{
const Eo_Callback_Array_Item *it;
//int counter = 0;
for (it = cb->items.item_array; it->func; it++)
{
pd->called_inner_loop_counter++;//avi debug
// printf("here arrary index %d \n",counter++);
if (!_cb_desc_match(it->desc, desc))
continue;
if (!it->desc->unfreezable &&
(event_freeze_count || pd->event_freeze_count))
(event_freeze_count || pd->event_freeze_count))
continue;
unsigned int before_func=clock();
/* Abort callback calling if the func says so. */
if (!it->func((void *) cb->func_data, obj_id, desc,
(void *) event_info))
{
start_time+=clock()-before_func;
ret = EINA_FALSE;
goto end;
}
start_time+=clock()-before_func;
}
}
else
{
// printf("here regular callback \n");
if (!_cb_desc_match(cb->items.item.desc, desc))
continue;
continue;
if ((!cb->items.item.desc
|| !cb->items.item.desc->unfreezable) &&
(event_freeze_count || pd->event_freeze_count))
continue;
|| !cb->items.item.desc->unfreezable) &&
(event_freeze_count || pd->event_freeze_count))
continue;
unsigned int before_func=clock();
/* Abort callback calling if the func says so. */
if (!cb->items.item.func((void *) cb->func_data, obj_id, desc,
(void *) event_info))
(void *) event_info))
{
start_time+=clock()-before_func;
ret = EINA_FALSE;
goto end;
}
start_time+=clock()-before_func;
}
}
}
end:
pd->called_sum_clocks +=clock()-start_time;//avi dbg
pd->walking_list--;
_eo_callbacks_clear(pd);
_eo_unref(obj);
@ -969,25 +1215,77 @@ EOLIAN static void
_eo_base_constructor(Eo *obj, Eo_Base_Data *pd EINA_UNUSED)
{
DBG("%p - %s.", obj, eo_class_name_get(MY_CLASS));
pd->called_counter=0;
pd->callbacks_counter=0;
pd-> called_loop_counter=0;
pd-> called_loop_counter=0;
pd->called_inner_loop_counter=0;
pd-> arrays_counter=0;
pd-> called_sum_clocks =0;
pd->events_counter=0;
pd->have_events = 0;
pd->callbacks = eina_inarray_new(sizeof(Eo_Callback_Description), 10 );//added by avi
for( int i=0;i< CALLSIZE ;i++){
pd->callbacks_hash[i][0] = pd->callbacks_hash[i][1]= -1;
pd->callbacks_hash[i][2] = 0;
}
pd->callbacks_hash_dirty = EINA_FALSE;
_eo_condtor_done(obj);
}
static int c = 0;
static __attribute__((destructor)) void finish(void)
{
c=1;
printf("calbacks stats-All objects!: num objects=%u total time=%f called cal times= %u called loops=%u called inner loops=%u called clocks=%f called sec=%f callbacks count=%u clabbacks arrays=%u key_data_get_sum_clocks=%f events counter=%u \n",
objects_counter,(double)(clock()-start_clock)/CLOCKS_PER_SEC, called_counter, called_loop_counter, called_inner_loop_counter,(double)called_sum_clocks,
(double)called_sum_clocks/CLOCKS_PER_SEC, callbacks_counter, arrays_counter, (double)key_data_get_sum_clocks /CLOCKS_PER_SEC,
events_counter);//avi debug
}
EOLIAN static void
_eo_base_destructor(Eo *obj, Eo_Base_Data *pd)
{
Eo *child;
DBG("%p - %s.", obj, eo_class_name_get(MY_CLASS));
if( pd->callbacks_counter>0 && getenv("EO_DEBUG"))
printf("calbacks stats-%s: called cal times= %u called loops=%u called inner loops=%u alled clocks=%f called sec=%f callbacks count=%u clabbacks arrays=%u events_counter = %u\n",
eo_class_name_get(MY_CLASS ), pd->called_counter, pd->called_loop_counter, pd->called_inner_loop_counter, (double)pd->called_sum_clocks,
(double)pd->called_sum_clocks/CLOCKS_PER_SEC, pd->callbacks_counter, pd->arrays_counter,
pd->events_counter);//avi debug
called_counter+=pd->called_counter;
callbacks_counter+=pd->callbacks_counter;
called_loop_counter+= pd->called_loop_counter;
arrays_counter+=pd->arrays_counter;
called_inner_loop_counter+=pd->called_inner_loop_counter;
called_sum_clocks+=pd-> called_sum_clocks;
events_counter+=pd->events_counter;
if( pd->callbacks_counter>0 )//only with atleast one calllbacks
objects_counter++;
EINA_LIST_FREE(pd->children, child)
eo_do(child, eo_parent_set(NULL));
_eo_generic_data_del_all(pd);
_wref_destruct(pd);
_eo_callback_remove_all(pd);
// _eo_callback_remove_all(pd);
eina_inarray_free(pd->callbacks);//added by avi
_eo_condtor_done(obj);
if(c==1)
printf("shit\n");
}
EOLIAN static Eo *
@ -999,6 +1297,9 @@ _eo_base_finalize(Eo *obj, Eo_Base_Data *pd EINA_UNUSED)
EOLIAN static void
_eo_base_class_constructor(Eo_Class *klass EINA_UNUSED)
{
if(start_clock==0)
start_clock=clock();//avi dbg
event_freeze_count = 0;
_legacy_events_hash = eina_hash_stringshared_new(_legacy_events_hash_free_cb);
}

View File

@ -621,7 +621,12 @@ _node_free(Evas_3D_Object *obj)
eina_list_free(pd->members);
}
if (pd->data.mesh.meshes)
if (pd->parent)
{
eo_do(pd->parent, evas_3d_node_member_del(obj));
}
if (pd->type == EVAS_3D_NODE_TYPE_MESH && pd->data.mesh.meshes)
{
Eina_List *l;
Evas_3D_Mesh *m;
@ -632,10 +637,10 @@ _node_free(Evas_3D_Object *obj)
}
eina_list_free(pd->data.mesh.meshes);
}
if (pd->data.mesh.node_meshes)
eina_hash_free(pd->data.mesh.node_meshes);
if (pd->data.mesh.node_meshes)
eina_hash_free(pd->data.mesh.node_meshes);
}
if (pd->scenes_root)
eina_hash_free(pd->scenes_root);

View File

@ -1060,21 +1060,21 @@ evas_gl_common_texture_upload(Evas_GL_Texture *tex, RGBA_Image *im, unsigned int
_tex_sub_2d(tex->gc, tex->x, tex->y + im->cache_entry.h,
im->cache_entry.w, 1,
fmt, tex->pt->dataformat,
(unsigned char *) im->image.data + (((im->cache_entry.h - 1) * im->cache_entry.w)) * bytes_count);
im->image.data8 + (((im->cache_entry.h - 1) * im->cache_entry.w)) * bytes_count);
// xxx
// xxx
// o
_tex_sub_2d(tex->gc, tex->x - 1, tex->y + im->cache_entry.h,
1, 1,
fmt, tex->pt->dataformat,
(unsigned char *) im->image.data + (((im->cache_entry.h - 1) * im->cache_entry.w)) * bytes_count);
im->image.data8 + (((im->cache_entry.h - 1) * im->cache_entry.w)) * bytes_count);
// xxx
// xxx
// o
_tex_sub_2d(tex->gc, tex->x + im->cache_entry.w, tex->y + im->cache_entry.h,
1, 1,
fmt, tex->pt->dataformat,
(unsigned char *) im->image.data + (((im->cache_entry.h - 1) * im->cache_entry.w) + (im->cache_entry.w - 1)) * bytes_count);
im->image.data8 + (im->cache_entry.h * im->cache_entry.w - 1) * bytes_count);
//2D packing
// ---
// xxx
@ -1096,7 +1096,7 @@ evas_gl_common_texture_upload(Evas_GL_Texture *tex, RGBA_Image *im, unsigned int
_tex_sub_2d(tex->gc, tex->x + im->cache_entry.w, tex->y - 1,
1, 1,
fmt, tex->pt->dataformat,
im->image.data + (im->cache_entry.w - 1) * bytes_count);
im->image.data8 + (im->cache_entry.w - 1) * bytes_count);
if (tex->gc->shared->info.unpack_row_length)
{
glPixelStorei(GL_UNPACK_ROW_LENGTH, im->cache_entry.w);
@ -1113,7 +1113,7 @@ evas_gl_common_texture_upload(Evas_GL_Texture *tex, RGBA_Image *im, unsigned int
_tex_sub_2d(tex->gc, tex->x + im->cache_entry.w, tex->y,
1, im->cache_entry.h,
fmt, tex->pt->dataformat,
(unsigned char *) im->image.data + (im->cache_entry.w - 1) * bytes_count);
im->image.data8 + (im->cache_entry.w - 1) * bytes_count);
}
else
{