canvas3d: remove all feature implementation in edje/edje_cc

Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de>
Reviewed-by: Shinwoo Kim <cinoo.kim@samsung.com>
Differential Revision: https://phab.enlightenment.org/D11547
This commit is contained in:
Hermet Park 2020-03-20 09:00:24 +00:00 committed by Marcel Hollerbach
parent 2359386d5d
commit 849b37d641
8 changed files with 6 additions and 2147 deletions

View File

@ -25,7 +25,6 @@ Eina_List *snd_dirs = NULL;
Eina_List *mo_dirs = NULL;
Eina_List *vibration_dirs = NULL;
Eina_List *img_dirs = NULL;
Eina_List *model_dirs = NULL;
Eina_List *fnt_dirs = NULL;
Eina_List *data_dirs = NULL;
Eina_List *defines = NULL;
@ -174,8 +173,6 @@ main(int argc, char **argv)
img_dirs = eina_list_append(img_dirs, ".");
model_dirs = eina_list_append(model_dirs, ".");
/* add defines to epp so edc files can detect edje_cc version */
defines = eina_list_append(defines, mem_strdup("-DEDJE_VERSION_12=12"));
@ -224,11 +221,6 @@ main(int argc, char **argv)
i++;
img_dirs = eina_list_append(img_dirs, argv[i]);
}
else if ((!strcmp(argv[i], "-mod") || !strcmp(argv[i], "--model_dir")) && (i < (argc - 1)))
{
i++;
model_dirs = eina_list_append(model_dirs, argv[i]);
}
else if ((!strcmp(argv[i], "-fd") || !strcmp(argv[i], "--font_dir")) && (i < (argc - 1)))
{
i++;

View File

@ -230,13 +230,8 @@ void copied_program_anonymous_lookup_delete(Edje_Part_Collection *pc, int *de
void data_queue_anonymous_lookup(Edje_Part_Collection *pc, Edje_Program *ep, int *dest);
void data_queue_copied_anonymous_lookup(Edje_Part_Collection *pc, int *src, int *dest);
void data_queue_image_lookup(char *name, int *dest, Eina_Bool *set);
void data_queue_model_lookup(char *name, int *dest, Eina_Bool *set);
void data_queue_copied_image_lookup(int *src, int *dest, Eina_Bool *set);
void data_queue_image_remove(int *dest, Eina_Bool *set);
void data_queue_copied_model_lookup(int *src, int *dest, Eina_Bool *set);
void data_queue_model_remove(int *dest, Eina_Bool *set);
void data_queue_spectrum_lookup(char *name, int *dest);
void data_queue_spectrum_slave_lookup(int *master, int *slave);
void data_process_lookups(void);
void data_process_scripts(void);
void data_process_script_lookups(void);
@ -308,7 +303,6 @@ void script_rewrite(Code *code);
/* global vars */
extern Eina_List *ext_dirs;
extern Eina_List *img_dirs;
extern Eina_List *model_dirs;
extern Eina_List *fnt_dirs;
extern Eina_List *snd_dirs;
extern Eina_List *mo_dirs;

File diff suppressed because it is too large Load Diff

View File

@ -232,7 +232,6 @@ static Eina_List *program_lookups = NULL;
static Eina_List *group_lookups = NULL;
static Eina_List *face_group_lookups = NULL;
static Eina_List *image_lookups = NULL;
static Eina_List *model_lookups = NULL;
static Eina_Hash *part_dest_lookup = NULL;
static Eina_Hash *part_pc_dest_lookup = NULL;
@ -775,19 +774,6 @@ check_program(Edje_Part_Collection *pc, Edje_Program *ep, Eet_File *ef)
}
}
}
if (((ep->action == EDJE_ACTION_TYPE_STATE_SET) ||
(ep->action == EDJE_ACTION_TYPE_SIGNAL_EMIT)) &&
(et->id < (int)pc->parts_count) &&
(part->type == EDJE_PART_TYPE_MESH_NODE) &&
(strstr(ep->signal, "mouse")))
{
for (i = 0; (i < pc->parts_count) && (ep->source_3d_id < 0); i++)
{
if (!strcmp(pc->parts[i]->name, ep->source))
ep->source_3d_id = i;
}
ep->source = mem_strdup(pc->parts[camera_id]->name);
}
}
}
@ -807,9 +793,6 @@ _alias_clean(Edje_Part_Collection_Directory_Entry *ce)
ce->count.TABLE = 0;
ce->count.EXTERNAL = 0;
ce->count.PROXY = 0;
ce->count.MESH_NODE = 0;
ce->count.LIGHT = 0;
ce->count.CAMERA = 0;
ce->count.SPACER = 0;
ce->count.VECTOR = 0;
ce->count.part = 0;
@ -1617,39 +1600,6 @@ data_write_images(void)
}
}
static void
data_check_models(Eet_File *ef EINA_UNUSED, int *model_num EINA_UNUSED)
{
int i;
if (!((edje_file) && (edje_file->model_dir))) return;
for (i = 0; i < (int)edje_file->model_dir->entries_count; i++)
{
Edje_Model_Directory_Entry *model;
Eina_List *ll;
char *s;
Eina_Bool file_exist = EINA_FALSE;
model = &edje_file->model_dir->entries[i];
EINA_LIST_FOREACH(model_dirs, ll, s)
{
char buf[PATH_MAX];
snprintf(buf, sizeof(buf), "%s/%s", s, model->entry);
file_exist = file_exist || ecore_file_exists(buf);
}
if (!file_exist)
{
ERR("Unable to load model \"%s\". Check if path to file is correct (both directory and file name).",
model->entry);
exit(-1);
}
}
}
static void
data_thread_sounds(void *data, Ecore_Thread *thread EINA_UNUSED)
{
@ -2836,7 +2786,6 @@ data_write(void)
{
Eet_File *ef;
Eet_Error err;
int model_num = 0;
int sound_num = 0;
int mo_num = 0;
int vibration_num = 0;
@ -2923,8 +2872,6 @@ data_write(void)
INF("fontmap: %3.5f", ecore_time_get() - t); t = ecore_time_get();
data_write_vectors(ef, &vector_num);
INF("vectors: %3.5f", ecore_time_get() - t); t = ecore_time_get();
data_check_models(ef, &model_num);
INF("models: %3.5f", ecore_time_get() - t); t = ecore_time_get();
data_write_fonts(ef, &font_num);
INF("fonts: %3.5f", ecore_time_get() - t); t = ecore_time_get();
data_write_sounds(ef, &sound_num);
@ -3515,49 +3462,6 @@ data_queue_image_remove(int *dest, Eina_Bool *set)
}
}
void
data_queue_model_lookup(char *name, int *dest, Eina_Bool *set)
{
Image_Lookup *il;
il = mem_alloc(SZ(Image_Lookup));
model_lookups = eina_list_append(model_lookups, il);
il->name = mem_strdup(name);
il->dest = dest;
il->set = set;
}
void
data_queue_model_remove(int *dest, Eina_Bool *set)
{
Eina_List *l;
Image_Lookup *il;
EINA_LIST_FOREACH(model_lookups, l, il)
{
if (il->dest == dest && il->set == set)
{
model_lookups = eina_list_remove_list(model_lookups, l);
free(il->name);
free(il);
return;
}
}
}
void
data_queue_copied_model_lookup(int *src, int *dest, Eina_Bool *set)
{
Eina_List *l;
Image_Lookup *il;
EINA_LIST_FOREACH(model_lookups, l, il)
{
if (il->dest == src)
data_queue_model_lookup(il->name, dest, set);
}
}
void
data_queue_copied_image_lookup(int *src, int *dest, Eina_Bool *set)
{
@ -3719,7 +3623,6 @@ _data_image_id_update(Eina_List *images_unused_list)
Edje_Part_Collection *pc;
Edje_Part *part;
Edje_Part_Description_Image *part_desc_image;
Edje_Part_Description_Mesh_Node *part_desc_mesh_node;
Edje_Part_Image_Id *tween_id;
unsigned int i, j, desc_it;
Eina_List *l, *l2, *l3;
@ -3746,15 +3649,6 @@ _data_image_id_update(Eina_List *images_unused_list)
} \
}
#define PART_DESC_PROXY_ID_UPDATE \
EINA_LIST_FOREACH(images_unused_list, l3, iui) \
{ \
if ((iui) && (part_desc_mesh_node->mesh_node.texture.id == iui->old_id)) \
{ \
part_desc_mesh_node->mesh_node.texture.id = iui->new_id; \
break; \
} \
}
EINA_LIST_FOREACH_SAFE(edje_collections, l, l2, pc)
{
for (i = 0; i < pc->parts_count; i++)
@ -3771,17 +3665,6 @@ _data_image_id_update(Eina_List *images_unused_list)
PART_DESC_IMAGE_ID_UPDATE
}
}
else if (part->type == EDJE_PART_TYPE_MESH_NODE)
{
part_desc_mesh_node = (Edje_Part_Description_Mesh_Node *)part->default_desc;
if (!part_desc_mesh_node) continue;
PART_DESC_PROXY_ID_UPDATE
for (j = 0; j < part->other.desc_count; j++)
{
part_desc_mesh_node = (Edje_Part_Description_Mesh_Node *)part->other.desc[j];
PART_DESC_PROXY_ID_UPDATE
}
}
}
}
for (i = 0; i < edje_file->image_dir->sets_count; i++)
@ -3804,46 +3687,6 @@ _data_image_id_update(Eina_List *images_unused_list)
}
}
static void
_data_model_id_update(Eina_List *models_unused_list)
{
Image_Unused_Ids *iui;
Edje_Part_Collection *pc;
Edje_Part *part;
Edje_Part_Description_Mesh_Node *part_desc_mesh_node;
unsigned int i, j;
Eina_List *l, *l2, *l3;
#define PART_DESC_MODEL_ID_UPDATE \
EINA_LIST_FOREACH(models_unused_list, l3, iui) \
{ \
if ((iui) && (part_desc_mesh_node->mesh_node.mesh.id == iui->old_id)) \
{ \
part_desc_mesh_node->mesh_node.mesh.id = iui->new_id; \
break; \
} \
} \
EINA_LIST_FOREACH_SAFE(edje_collections, l, l2, pc)
{
for (i = 0; i < pc->parts_count; i++)
{
part = pc->parts[i];
if (part->type == EDJE_PART_TYPE_MESH_NODE)
{
part_desc_mesh_node = (Edje_Part_Description_Mesh_Node *)part->default_desc;
if (!part_desc_mesh_node) continue;
PART_DESC_MODEL_ID_UPDATE
for (j = 0; j < part->other.desc_count; j++)
{
part_desc_mesh_node = (Edje_Part_Description_Mesh_Node *)part->other.desc[j];
PART_DESC_MODEL_ID_UPDATE
}
}
}
}
}
void
data_process_lookups(void)
{
@ -3853,11 +3696,9 @@ data_process_lookups(void)
Program_Lookup *program;
Group_Lookup *group;
Image_Lookup *image;
Image_Lookup *model;
Eina_List *l2;
Eina_List *l;
Eina_Hash *images_in_use;
Eina_Hash *models_in_use;
char *group_name;
Eina_Bool is_lua = EINA_FALSE;
Image_Unused_Ids *iui;
@ -4255,86 +4096,6 @@ free_group:
}
eina_hash_free(images_in_use);
models_in_use = eina_hash_string_superfast_new(NULL);
EINA_LIST_FREE(model_lookups, model)
{
Eina_Bool find = EINA_FALSE;
if (edje_file->model_dir)
{
Edje_Model_Directory_Entry *de;
unsigned int i;
for (i = 0; i < edje_file->model_dir->entries_count; ++i)
{
de = edje_file->model_dir->entries + i;
if ((de->entry) && (!strcmp(de->entry, model->name)))
{
*(model->dest) = de->id;
*(model->set) = EINA_FALSE;
find = EINA_TRUE;
if (!eina_hash_find(models_in_use, model->name))
eina_hash_direct_add(models_in_use, de->entry, de);
break;
}
}
}
if (!find)
{
ERR("Unable to find model name \"%s\".", model->name);
exit(-1);
}
free(model->name);
free(model);
}
if (edje_file->model_dir && !is_lua)
{
Edje_Model_Directory_Entry *de, *de_last, *mdl;
Eina_List *models_unused_list = NULL;
unsigned int i;
for (i = 0; i < edje_file->model_dir->entries_count; ++i)
{
de = edje_file->model_dir->entries + i;
if (de->entry && eina_hash_find(models_in_use, de->entry))
continue;
INF("Model '%s' in resource 'edje/model/%i' will not be included as it is unused.",
de->entry, de->id);
/* so as not to write the unused models, moved last model in the
list to unused model position and check it */
free((void *)de->entry);
de->entry = NULL;
de_last = edje_file->model_dir->entries + edje_file->model_dir->entries_count - 1;
iui = mem_alloc(SZ(Image_Unused_Ids));
iui->old_id = de_last->id;
models_unused_list = eina_list_append(models_unused_list, iui);
iui->new_id = i;
de_last->id = i;
memcpy(de, de_last, sizeof (Edje_Model_Directory_Entry));
--i; /* need to check a moved model on this index */
edje_file->model_dir->entries_count--;
mdl = realloc(edje_file->model_dir->entries,
sizeof (Edje_Model_Directory_Entry) * edje_file->model_dir->entries_count);
edje_file->model_dir->entries = mdl;
}
/* update model id in parts */
if (models_unused_list) _data_model_id_update(models_unused_list);
EINA_LIST_FREE(models_unused_list, iui)
free(iui);
}
eina_hash_free(models_in_use);
}
static void

View File

@ -317,15 +317,6 @@ EAPI void *edje_object_signal_callback_seat_data_get(void);
*
* @brief Functions to manipulate audio abilities in edje.
*
* Perspective is a graphical tool that makes objects represented in 2D
* look like they have a 3D appearance.
*
* Edje allows us to use perspective on any edje object. This group of
* functions deal with the use of perspective, by creating and configuring
* a perspective object that must set to a edje object or a canvas,
* affecting all the objects inside that have no particular perspective
* set already.
*
* @{
*/
@ -1819,6 +1810,7 @@ EAPI Eina_Bool edje_mmap_group_exists(Eina_File *f, const char *glob);
*
* @return @c 1 if a Scene is found is found, @c 0 otherwise
*
* @deprecated
* @since 1.18
*/
EINA_DEPRECATED EAPI Eina_Bool edje_mmap_3d_has(Eina_File *f, const char *group);

View File

@ -3006,15 +3006,6 @@ EAPI const char *edje_object_color_class_description_get(const Edje_Object *obj,
*
* @brief Functions that deal with 3D projection of an 2D object.
*
* Perspective is a graphical tool that makes objects represented in 2D
* look like they have a 3D appearance.
*
* Edje allows us to use perspective on any edje object. This group of
* functions deal with the use of perspective, by creating and configuring
* a perspective object that must set to a edje object or a canvas,
* affecting all the objects inside that have no particular perspective
* set already.
*
* @{
*/

View File

@ -292,17 +292,6 @@ struct _Edje_String
unsigned int id;
};
struct _Edje_3D_Vec {
FLOAT_T x;
FLOAT_T y;
FLOAT_T z;
};
struct _Edje_3D_Int_Vec {
int x;
int y;
int z;
};
typedef struct _Edje_Position_Scale Edje_Alignment;
typedef struct _Edje_Position_Scale Edje_Position_Scale;
@ -314,9 +303,6 @@ typedef struct _Edje_Map_Color Edje_Map_Color;
typedef struct _Edje_Aspect_Prefer Edje_Aspect_Prefer;
typedef struct _Edje_Aspect Edje_Aspect;
typedef struct _Edje_String Edje_String;
typedef struct _Edje_3D_Vec Edje_3D_Vec;
typedef struct _Edje_3D_Int_Vec Edje_3D_Int_Vec;
typedef struct _AABB AABB;
typedef struct _Edje_File Edje_File;
typedef struct _Edje_Style Edje_Style;
@ -361,9 +347,6 @@ typedef struct _Edje_Part_Description_Text Edje_Part_Description_Text;
typedef struct _Edje_Part_Description_Box Edje_Part_Description_Box;
typedef struct _Edje_Part_Description_Table Edje_Part_Description_Table;
typedef struct _Edje_Part_Description_External Edje_Part_Description_External;
typedef struct _Edje_Part_Description_Mesh_Node Edje_Part_Description_Mesh_Node;
typedef struct _Edje_Part_Description_Light Edje_Part_Description_Light;
typedef struct _Edje_Part_Description_Camera Edje_Part_Description_Camera;
typedef struct _Edje_Part_Description_Snapshot Edje_Part_Description_Snapshot;
typedef struct _Edje_Part_Description_Common Edje_Part_Description_Common;
typedef struct _Edje_Part_Description_Spec_Fill Edje_Part_Description_Spec_Fill;
@ -373,9 +356,6 @@ typedef struct _Edje_Part_Description_Spec_Proxy Edje_Part_Description_Spec_
typedef struct _Edje_Part_Description_Spec_Text Edje_Part_Description_Spec_Text;
typedef struct _Edje_Part_Description_Spec_Box Edje_Part_Description_Spec_Box;
typedef struct _Edje_Part_Description_Spec_Table Edje_Part_Description_Spec_Table;
typedef struct _Edje_Part_Description_Spec_Mesh_Node Edje_Part_Description_Spec_Mesh_Node;
typedef struct _Edje_Part_Description_Spec_Light Edje_Part_Description_Spec_Light;
typedef struct _Edje_Part_Description_Spec_Camera Edje_Part_Description_Spec_Camera;
typedef struct _Edje_Part_Description_Spec_Filter Edje_Part_Description_Spec_Filter;
typedef struct _Edje_Part_Description_Spec_Filter_Data Edje_Part_Description_Spec_Filter_Data;
typedef struct _Edje_Physics_Face Edje_Physics_Face;
@ -546,12 +526,6 @@ typedef struct _Edje_Signal_Callback_Custom Edje_Signal_Callback_Custom;
/*----------*/
struct _AABB {
Edje_3D_Vec relative;
Edje_3D_Int_Vec offset;
int rel_to;
};
typedef struct Edje_Image_Hash
{
int id;
@ -825,7 +799,6 @@ struct _Edje_Color_Tree_Node
struct _Edje_Program /* a conditional program to be run */
{
int id; /* id of program */
int source_3d_id; /* id of real 3D part */
const char *name; /* name of the action */
@ -1238,7 +1211,6 @@ struct _Edje_Part
Evas_Event_Flags ignore_flags;
Evas_Event_Flags mask_flags;
unsigned int items_count;
Edje_3D_Vec scale_3d;
Edje_Part_Api api;
Edje_Part_Allowed_Seat **allowed_seats;
unsigned int allowed_seats_count;
@ -1374,8 +1346,6 @@ struct _Edje_Part_Description_Common
} physics;
#endif
Edje_3D_Vec align_3d;
unsigned char visible; /* is it shown */
unsigned char limit; /* 0 == no, 1 = width, 2 = height, 3 = both */
unsigned char no_render; /* no_render override @since 1.19 */
@ -1508,108 +1478,6 @@ struct _Edje_Part_Description_Spec_Table
} min;
};
struct _Edje_Part_Description_Spec_Mesh_Node
{
struct {
Edje_Part_Image_Id **tweens;
unsigned int tweens_count;
int id;
Evas_Canvas3D_Mesh_Primitive primitive;
Evas_Canvas3D_Vertex_Assembly assembly;
int frame;
Eina_Bool set;
} mesh;
struct {
Edje_Part_Image_Id **tweens;
unsigned int tweens_count;
int id;
Evas_Canvas3D_Wrap_Mode wrap1;
Evas_Canvas3D_Wrap_Mode wrap2;
Evas_Canvas3D_Texture_Filter filter1;
Evas_Canvas3D_Texture_Filter filter2;
Eina_Bool need_texture;
Eina_Bool textured;
Eina_Bool set;
} texture;
struct {
Edje_Color ambient;
Edje_Color diffuse;
Edje_Color specular;
Eina_Bool normal;
FLOAT_T shininess;
Evas_Canvas3D_Shader_Mode shade;
Evas_Canvas3D_Material_Attrib material_attrib;
} properties;
AABB aabb1;
AABB aabb2;
struct {
Evas_Canvas3D_Node_Orientation_Type type;
FLOAT_T data[6];
int look_to; /* -1 = whole part collection, or part ID */
} orientation;
Edje_3D_Vec scale_3d;
struct {
Edje_3D_Vec point;
unsigned char space;
} position;
};
struct _Edje_Part_Description_Spec_Light
{
struct {
Edje_Color ambient;
Edje_Color diffuse;
Edje_Color specular;
} properties;
struct {
Edje_3D_Vec point;
unsigned char space;
} position;
struct {
Evas_Canvas3D_Node_Orientation_Type type;
FLOAT_T data[6];
int look_to; /* -1 = whole part collection, or part ID */
} orientation;
struct {
Evas_Real fovy;
Evas_Real aspect;
Evas_Real frustum_near;
Evas_Real frustum_far;
} light;
};
struct _Edje_Part_Description_Spec_Camera
{
struct {
Evas_Real fovy;
Evas_Real aspect;
Evas_Real frustum_near;
Evas_Real frustum_far;
} camera;
struct {
Edje_3D_Vec point;
unsigned char space;
} position;
struct {
Evas_Canvas3D_Node_Orientation_Type type;
FLOAT_T data[6];
int look_to; /* -1 = whole part collection, or part ID */
} orientation;
};
struct _Edje_Part_Description_Spec_Svg
{
int id; /* the svg id to use */
@ -1663,24 +1531,6 @@ struct _Edje_Part_Description_External
Eina_List *external_params; /* parameters for external objects */
};
struct _Edje_Part_Description_Mesh_Node
{
Edje_Part_Description_Common common;
Edje_Part_Description_Spec_Mesh_Node mesh_node;
};
struct _Edje_Part_Description_Light
{
Edje_Part_Description_Common common;
Edje_Part_Description_Spec_Light light;
};
struct _Edje_Part_Description_Camera
{
Edje_Part_Description_Common common;
Edje_Part_Description_Spec_Camera camera;
};
struct _Edje_Part_Description_Vector
{
Edje_Part_Description_Common common;
@ -1892,7 +1742,6 @@ struct _Edje_Calc_Params_Physics
typedef struct _Edje_Calc_Params_Type_Common Edje_Calc_Params_Type_Common;
typedef struct _Edje_Calc_Params_Type_Text Edje_Calc_Params_Type_Text;
typedef struct _Edje_Calc_Params_Type_Node Edje_Calc_Params_Type_Node;
struct _Edje_Calc_Params_Type_Common
{
@ -1913,14 +1762,6 @@ struct _Edje_Calc_Params_Type_Text
Edje_Color color2, color3; // 8
}; // 36
struct _Edje_Calc_Params_Type_Node
{
FLOAT_T data[6]; // 48
Edje_3D_Vec point; // 24
Edje_3D_Vec scale_3d; // 24
int frame; // 4
}; // 100
typedef struct _Edje_Calc_Params_Ext Edje_Calc_Params_Ext;
struct _Edje_Calc_Params_Ext
@ -1938,7 +1779,6 @@ struct _Edje_Calc_Params
union {
Edje_Calc_Params_Type_Common *common;
Edje_Calc_Params_Type_Text *text;
Edje_Calc_Params_Type_Node *node;
} type; // 4/8
Edje_Calc_Params_Ext *ext; // 4/8
struct {
@ -2066,7 +1906,6 @@ struct _Edje_Real_Part
Edje_Part *part; // 4
Evas_Object *object; // 4
Evas_Object *nested_smart; // 4
Eo *node; // 4
Edje_Real_Part_Drag *drag; // 4
Edje_Part_Description_Common *chosen_description; // 4
// WITH EDJE_CALC_CACHE: 307
@ -2561,13 +2400,6 @@ _edje_calc_params_need_type_text(Edje_Calc_Params *p)
p->type.text = calloc(1, sizeof(Edje_Calc_Params_Type_Text));
}
static inline void
_edje_calc_params_need_type_node(Edje_Calc_Params *p)
{
if (p->type.node) return;
p->type.node = calloc(1, sizeof(Edje_Calc_Params_Type_Node));
}
static inline void
_edje_calc_params_need_ext(Edje_Calc_Params *p)
{

View File

@ -14,9 +14,6 @@ enum @beta Efl.Canvas.Layout_Part_Type
external = 10, [[External type value.]]
proxy = 11, [[Proxy type value.]]
spacer = 12, [[Spacer type value @since 1.7.]]
mesh_node = 13, [[Canvas 3D type: mesh node.]]
light = 14, [[Canvas 3D type: light.]]
camera = 15, [[Canvas 3D type: camera.]]
snapshot = 16, [[Snapshot @since 1.16.]]
vector = 17, [[Vector @since 1.18.]]
last = 18 [[Last type value.]]