Add EET for new Exactness data types
This commit is contained in:
parent
bea26c676e
commit
3dd58276a2
|
@ -11,27 +11,12 @@
|
|||
|
||||
#include "tsuite_file_data.h"
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int w;
|
||||
int h;
|
||||
void *pixels;
|
||||
int pixels_len;
|
||||
} Exactness_Image;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
void *p1;
|
||||
void *p2;
|
||||
} _Two_Ptrs;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
Lists_st *scn;
|
||||
// Exactness_Scenario *scn;
|
||||
Eina_List *imgs; /* List of Exactness_Image */
|
||||
} Exactness_Unit;
|
||||
|
||||
static Eo *_main_box = NULL;
|
||||
static Eina_List *_gls = NULL;
|
||||
static Eina_List *_units = NULL;
|
||||
|
@ -202,8 +187,8 @@ _pixels_compare(Exactness_Image *img1, Exactness_Image *img2, Eina_Bool *has_dif
|
|||
free(imgO);
|
||||
return NULL;
|
||||
}
|
||||
imgO->pixels_len = imgO->w * imgO->h *4;
|
||||
imgO->pixels = malloc(imgO->pixels_len);
|
||||
imgO->pixels_count = imgO->w * imgO->h *4;
|
||||
imgO->pixels = malloc(imgO->pixels_count);
|
||||
|
||||
pxs1 = img1 ? img1->pixels : NULL;
|
||||
pxs2 = img2 ? img2->pixels : NULL;
|
||||
|
@ -455,8 +440,8 @@ _gui_unit_display(Exactness_Unit *unit1, Exactness_Unit *unit2, int position)
|
|||
}
|
||||
_itc_init();
|
||||
|
||||
itr1 = unit1 && unit1->scn ? unit1->scn->variant_list : NULL;
|
||||
itr2 = unit2 && unit2->scn ? unit2->scn->variant_list : NULL;
|
||||
itr1 = unit1 ? unit1->events : NULL;
|
||||
itr2 = unit2 ? unit2->events : NULL;
|
||||
|
||||
if (itr1)
|
||||
elm_genlist_item_append(gl, _grp_itc, "Scenario", NULL, ELM_GENLIST_ITEM_GROUP, NULL, NULL);
|
||||
|
@ -529,8 +514,8 @@ _image_read(const char *filename)
|
|||
evas_object_image_size_get(img, &w, &h);
|
||||
ex_img->w = w;
|
||||
ex_img->h = h;
|
||||
ex_img->pixels_len = w * h * 4;
|
||||
len = ex_img->pixels_len;
|
||||
ex_img->pixels_count = w * h * 4;
|
||||
len = ex_img->pixels_count;
|
||||
ex_img->pixels = malloc(len);
|
||||
memcpy(ex_img->pixels, evas_object_image_data_get(img, EINA_FALSE), len);
|
||||
|
||||
|
@ -635,7 +620,7 @@ main(int argc, char *argv[])
|
|||
unsigned int tm = evt_time_get(0, v);
|
||||
if (tm) evt_time_set(tm - list->first_timestamp, v);
|
||||
}
|
||||
ex_unit->scn = list;
|
||||
ex_unit->events = list->variant_list;
|
||||
_units = eina_list_append(_units, ex_unit);
|
||||
}
|
||||
else if (!strcmp(ext, ".png"))
|
||||
|
|
|
@ -17,7 +17,6 @@
|
|||
#include <Ecore_File.h>
|
||||
#include <Ecore_Con.h>
|
||||
#include <Elementary.h>
|
||||
//#include <Ecore_Evas.h>
|
||||
|
||||
#include "tsuite_file_data.h"
|
||||
#include "exactness_private.h"
|
||||
|
|
|
@ -944,4 +944,36 @@ void _data_descriptors_shutdown(void)
|
|||
/* FIXME: Should probably only init and shutdown once */
|
||||
}
|
||||
}
|
||||
|
||||
Eet_Data_Descriptor *
|
||||
unit_desc_make(void)
|
||||
{
|
||||
Eet_Data_Descriptor_Class eddc;
|
||||
static Eet_Data_Descriptor *unit_d = NULL;
|
||||
_data_descriptors_init();
|
||||
if (!unit_d)
|
||||
{
|
||||
/* Exactness_Image */
|
||||
Exactness_Image ex_img;
|
||||
Eet_Data_Descriptor *img_d;
|
||||
EET_EINA_STREAM_DATA_DESCRIPTOR_CLASS_SET(&eddc, Exactness_Image);
|
||||
img_d = eet_data_descriptor_stream_new(&eddc);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(img_d, Exactness_Image, "w", w, EET_T_UINT);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(img_d, Exactness_Image, "h", w, EET_T_UINT);
|
||||
eet_data_descriptor_element_add(img_d, "pixels", EET_T_INT, EET_G_VAR_ARRAY,
|
||||
(char *)(&(ex_img.pixels)) - (char *)(&(ex_img)),
|
||||
(char *)(&(ex_img.pixels_count)) - (char *)(&(ex_img)), NULL, NULL);
|
||||
|
||||
/* Exactness_Unit */
|
||||
EET_EINA_STREAM_DATA_DESCRIPTOR_CLASS_SET(&eddc, Exactness_Unit);
|
||||
unit_d = eet_data_descriptor_stream_new(&eddc);
|
||||
EET_DATA_DESCRIPTOR_ADD_LIST(unit_d, Exactness_Unit,
|
||||
"events", events, _desc->_variant_descriptor);
|
||||
EET_DATA_DESCRIPTOR_ADD_LIST(unit_d, Exactness_Unit,
|
||||
"imgs", imgs, img_d);
|
||||
}
|
||||
|
||||
return unit_d;
|
||||
}
|
||||
|
||||
/* END Event struct descriptors */
|
||||
|
|
|
@ -266,6 +266,23 @@ Eet_Data_Descriptor *object_info_desc_make(void);
|
|||
EAPI Eina_Bool objects_files_compare(const char *filename1, const char *filename2, Eina_Bool verbose);
|
||||
/* END Objects */
|
||||
|
||||
/* START Unit desc */
|
||||
typedef struct
|
||||
{
|
||||
int w;
|
||||
int h;
|
||||
void *pixels;
|
||||
int pixels_count;
|
||||
} Exactness_Image;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
Eina_List *events; /* List of Variant_st */
|
||||
Eina_List *imgs; /* List of Exactness_Image */
|
||||
} Exactness_Unit;
|
||||
|
||||
Eet_Data_Descriptor *unit_desc_make(void);
|
||||
/* END Unit desc */
|
||||
|
||||
Tsuite_Event_Type tsuite_event_mapping_type_get(const char *name);
|
||||
const char * tsuite_event_mapping_type_str_get(Tsuite_Event_Type t);
|
||||
|
|
Loading…
Reference in New Issue