Example #1
0
/* The function to create the model */
Etk_Tree_Model *
etk_tree_model_edje_new(const char *file, const char *part)
{
	Etk_Tree_Model *model;
	Etk_Tree_Model_Edje *edje_model;

	model = calloc(1, sizeof(Etk_Tree_Model_Edje));
	edje_model = (Etk_Tree_Model_Edje *) model;

	model->cell_data_size = sizeof(Etk_Tree_Model_Edje_Data);
	model->model_free = _edje_model_free;
	model->cell_data_free = _edje_cell_data_free;
	model->cell_data_set = _edje_cell_data_set;
	model->cell_data_get = _edje_cell_data_get;
	model->objects_cache = _edje_objects_cache;
	model->render = _edje_render;
	model->width_get = _edje_width_get;
	model->cache_remove = _edje_cache_remove;

	edje_model->cache = etk_cache_new(50);
	edje_model->file = file;
	edje_model->part = part;

	return model;
}
Example #2
0
/**
 * @brief Creates a tree model that displays an image
 * @return Returns the new model
 * @note You don't need to free it with etk_tree_model_free() if is associtated to a column.
 * It will be freed automatically when the column is destroyed
 */
Etk_Tree_Model *etk_tree_model_image_new(void)
{
   Etk_Tree_Model *model;
   Etk_Tree_Model_Image *image_model;

   model = calloc(1, sizeof(Etk_Tree_Model_Image));
   image_model = (Etk_Tree_Model_Image *)model;

   model->cell_data_size = sizeof(Etk_Tree_Model_Image_Data);
   model->model_free = _image_model_free;
   model->cell_data_free = _image_cell_data_free;
   model->cell_data_set = _image_cell_data_set;
   model->cell_data_get = _image_cell_data_get;
   model->objects_cache = _image_objects_cache;
   model->render = _image_render;
   model->width_get = _image_width_get;
   model->cache_remove = NULL;

   image_model->width = 0;
   image_model->halign = 0.0;
   image_model->cache = etk_cache_new(100);

   return model;
}