PREFIX value ml_elm_hoversel_item_add( value v_obj, value v_label, value v_icon, value v_func, value v_unit) { const char* label; if(v_label == Val_int(0)) label = NULL; else label = String_val(Field(v_label, 0)); const char* icon_file; Elm_Icon_Type icon_type; if(v_icon == Val_int(0)) { icon_file = NULL; icon_type = 0; } else { value v = Field(v_icon, 0); icon_file = String_val(Field(v, 0)); icon_type = Elm_Icon_Type_val(Field(v, 1)); } Evas_Smart_Cb func; value* data; if(v_func == Val_int(0)) { func = NULL; data = NULL; } else { func = ml_Evas_Smart_Cb; data = ml_register_value(Field(v_func, 0)); } Elm_Object_Item* item = elm_hoversel_item_add((Evas_Object*) v_obj, label, icon_file, icon_type, func, data); if(item == NULL) { if(data != NULL) ml_remove_value(data); caml_failwith("elm_hoversel_item_add"); } if(data != NULL) elm_object_item_del_cb_set(item, ml_Evas_Smart_Cb_on_del); return (value) item; }
PREFIX value ml_ecore_animator_custom_source_tick_end_callback_set( value v_fun) { static value* prev = NULL; if(prev != NULL) ml_remove_value(prev); prev = ml_register_value(v_fun); ecore_animator_custom_source_tick_end_callback_set(ml_Ecore_Cb, prev); return Val_unit; }
void ml_Elm_Gen_Item_Del_Cb_free(void* data, Evas_Object* obj) { CAMLparam0(); CAMLlocal1(v_obj); value* v_class = data; v_obj = copy_Evas_Object(obj); caml_callback(Field(*v_class, 4), v_obj); ml_remove_value(v_class); CAMLreturn0; }
PREFIX value ml_ecore_animator_add(value v_fun) { value* data = ml_register_value(v_fun); Ecore_Animator* anim = ecore_animator_add(ml_Ecore_Task_Cb_free_on_last, data); if(anim == NULL) { ml_remove_value(data); caml_failwith("ecore_animator_add"); } return Val_Ecore_Animator(anim); }
PREFIX value ml_ecore_animator_del(value v_anim) { value* data = ecore_animator_del(Ecore_Animator_val(v_anim)); ml_remove_value(data); return Val_unit; }