int main(int argc, char *argv[]) { (void) argc; (void) argv; eo_init(); Eo *obj = eo_add(SIMPLE_CLASS, NULL); eo_do(obj, simple_a_set(1), simple_b_set(2)); int a, b, sum = 0; eo_do(obj, simple_a_get(&a), simple_b_get(&b), mixin_ab_sum_get(&sum)); fail_if(sum != a + b + 2); /* 2 for the two mixins... */ eo_do(obj, mixin_ab_sum_get(&sum), mixin_ab_sum_get(&sum)); Mixin2_Public_Data *pd2 = eo_data_get(obj, MIXIN2_CLASS); fail_if(pd2->count != 6); Mixin3_Public_Data *pd3 = eo_data_get(obj, MIXIN3_CLASS); fail_if(pd3->count != 9); eo_unref(obj); obj = eo_add(INHERIT_CLASS, NULL); eo_do(obj, simple_a_set(5), simple_a_get(&a)); fail_if(a != 5); eo_unref(obj); eo_shutdown(); return 0; }
int main(int argc, char *argv[]) { (void) argc; (void) argv; eo_init(); Eo *obj = eo_add(INHERIT2_CLASS, NULL); eo_do(obj, simple_a_set(1)); Simple_Public_Data *pd = eo_data_get(obj, SIMPLE_CLASS); fail_if(pd->a != 2); eo_unref(obj); obj = eo_add(INHERIT3_CLASS, NULL); eo_do(obj, simple_a_set(1)); pd = eo_data_get(obj, SIMPLE_CLASS); fail_if(pd->a != 3); eo_unref(obj); obj = eo_add(INHERIT2_CLASS, NULL); eo_do(obj, inherit2_print()); eo_unref(obj); obj = eo_add(SIMPLE_CLASS, NULL); fail_if(eo_do(obj, inherit2_print2())); fail_if(eo_do_super(obj, simple_a_print())); fail_if(eo_do(obj, simple_class_print())); fail_if(!eo_class_do(SIMPLE_CLASS, simple_class_print())); fail_if(!eo_class_do(INHERIT_CLASS, simple_class_print())); fail_if(!eo_class_do(INHERIT2_CLASS, simple_class_print())); fail_if(!eo_class_do(INHERIT3_CLASS, simple_class_print())); fail_if(eo_class_do(SIMPLE_CLASS, simple_a_print())); eo_constructor_super(obj); eo_destructor_super(obj); eo_unref(obj); eo_shutdown(); return 0; }
END_TEST START_TEST (elm_atspi_children_and_parent) { elm_init(0, NULL); generate_app(); Eo* root = eo_add(ELM_ATSPI_APP_OBJECT_CLASS, NULL); Eina_List *child_list = NULL; eo_do(root, child_list = elm_interface_atspi_accessible_children_get()); //eo_do(eina_list_nth(child_list, 0), bg_child_list = elm_interface_atspi_accessible_children_get()); ck_assert(eina_list_count(child_list) == 1); Eo *win = NULL; win = eina_list_nth(child_list, 0); ck_assert(win != NULL); ck_assert(win == g_win); eo_unref(root); elm_shutdown(); }
static void _add(Efm_Monitor *mon, const char *file) { const char *path; const char *filename; Efm_File *ef; Efm_Monitor_Data *pd; Eina_Bool result; Eina_Bool dir; path = eina_stringshare_add(file); ef = eo_add(EFM_FILE_CLASS, mon, result = efm_file_obj_generate(path)); if (!ef) return; if (!result) { ERR("Creation of %s failed, this is ... strange", file); eo_del(ef); return; } pd = eo_data_scope_get(mon, EFM_MONITOR_CLASS); if (pd->config.only_folder && eo_do_ret(ef, dir, efm_file_obj_is_type(EFM_FILE_TYPE_DIRECTORY))) return; if (!pd->config.hidden_files && eo_do_ret(ef, filename, efm_file_obj_filename_get())[0] == '.') return; eina_hash_add(pd->file_icons, path, ef); eo_do(mon, eo_event_callback_call(EFM_MONITOR_EVENT_FILE_ADD, ef); MARK_POPULATED); }
END_TEST START_TEST (elm_atspi_children_and_parent2) { elm_init(0, NULL); generate_app(); Eo* root = eo_add(ELM_ATSPI_APP_OBJECT_CLASS, NULL); Eo *win = NULL; Eina_List *root_children; eo_do(root, root_children = elm_interface_atspi_accessible_children_get()); win = eina_list_nth(root_children, 0); Eina_List *win_children; eo_do(win, win_children = elm_interface_atspi_accessible_children_get()); ck_assert(eina_list_count(win_children) == 2); Eo *btn = NULL; btn = eina_list_nth(win_children, 0); ck_assert(btn != NULL); ck_assert(btn == g_bg); btn = eina_list_nth(win_children, 1); ck_assert(btn != NULL); ck_assert(btn == g_btn); eo_unref(root); elm_shutdown(); }
int main(int argc, char *argv[]) { (void) argc; (void) argv; eo_init(); Eo *obj = eo_add(SIMPLE_CLASS, NULL); eo_do(obj, simple_a_set(1), simple_b_set(2)); int a, b, sum = 0; eo_do(obj, simple_a_get(&a), simple_b_get(&b), interface_ab_sum_get(&sum)); fail_if(sum != a + b); sum = 0; eo_do(obj, interface_ab_sum_get(&sum), interface_ab_sum_get(&sum)); fail_if(sum != a + b); eo_do(obj, interface2_ab_sum_get2(&sum), interface2_ab_sum_get2(&sum)); fail_if(sum != a + b + 1); eo_unref(obj); eo_shutdown(); return 0; }
END_TEST START_TEST (elm_atspi_description_set) { elm_init(0, NULL); Eo* root = eo_add(ELM_ATSPI_APP_OBJECT_CLASS, NULL); const char *ret = NULL; const char *desc = "Test description"; eo_do(root, ret = elm_interface_atspi_accessible_description_get()); ck_assert(ret == NULL); eo_do(root, elm_interface_atspi_accessible_description_set(desc)); eo_do(root, ret = elm_interface_atspi_accessible_description_get()); ck_assert(ret != NULL); ck_assert_str_eq(ret, "Test description"); eo_unref(root); elm_shutdown(); }
static void _sub_path_process(Elm_App_Client *eo, Eldbus_Message_Iter *obj_iter, Elm_App_Client_Data *data, Eina_Bool loading_list) { const char *obj_path; Eldbus_Message_Iter *array_iface, *iface; eldbus_message_iter_arguments_get(obj_iter, "oa{sa{sv}}", &obj_path, &array_iface); while (eldbus_message_iter_get_and_next(array_iface, '{', &iface)) { const char *iface_name; Eldbus_Message_Iter *array_props; Elm_App_Client_View *view; eldbus_message_iter_arguments_get(iface, "sa{sv}", &iface_name, &array_props); if (strcmp(iface_name, "org.enlightenment.ApplicationView1")) continue; view = eina_hash_find(data->views, obj_path); if (view) continue; view = eo_add(ELM_APP_CLIENT_VIEW_CLASS, eo, elm_app_client_view_path_set(obj_path)); eina_hash_add(data->views, obj_path, view); if (!loading_list) eo_do(eo, eo_event_callback_call(ELM_APP_CLIENT_EVENT_VIEW_CREATED, view)); } }
EAPI Evas_Object * edje_object_add(Evas *evas) { Evas_Object *e; e = eo_add(MY_CLASS, evas); return e; }
int main(int argc, char *argv[]) { int ret = 0; (void) argc; (void) argv; eo_init(); Eo *obj = eo_add(SIMPLE_CLASS, NULL); fail_if(my_init_count != 2); eo_do(obj, simple_a_set(1), simple_b_set(2)); int a, b; eo_do(obj, simple_a_get(&a), simple_b_get(&b), mixin_add_and_print(5)); eo_unref(obj); fail_if(my_init_count != 0); obj = eo_add(SIMPLE2_CLASS, NULL); fail_if(obj); obj = eo_add(SIMPLE3_CLASS, NULL); fail_if(obj); my_init_count = 0; obj = eo_add(SIMPLE4_CLASS, NULL); fail_if(my_init_count != 2); eo_unref(obj); fail_if(my_init_count != 0); obj = eo_add(SIMPLE5_CLASS, NULL); fail_if(!obj); eo_unref(obj); obj = eo_add(SIMPLE6_CLASS, NULL); fail_if(!obj); eo_unref(obj); obj = eo_add(SIMPLE7_CLASS, NULL); fail_if(obj); my_init_count = 0; obj = eo_add_custom(SIMPLE_CLASS, NULL, simple_constructor(7)); fail_if(!obj); fail_if(my_init_count != 2); eo_do(obj, simple_a_get(&a)); fail_if(a != 7); eo_unref(obj); eo_shutdown(); return ret; }
EAPI Evas_Out * evas_out_add(Evas *e) { MAGIC_CHECK(e, Evas, MAGIC_EVAS); return NULL; MAGIC_CHECK_END(); Evas_Object *eo_obj = eo_add(MY_CLASS, e); return eo_obj; }
EAPI Evas_Object * evas_object_rectangle_add(Evas *e) { MAGIC_CHECK(e, Evas, MAGIC_EVAS); return NULL; MAGIC_CHECK_END(); Evas_Object *eo_obj = eo_add(EVAS_RECTANGLE_CLASS, e); return eo_obj; }
EAPI Evas_Object * evas_object_polygon_add(Evas *e) { MAGIC_CHECK(e, Evas, MAGIC_EVAS); return NULL; MAGIC_CHECK_END(); Evas_Object *eo_obj = eo_add(EVAS_POLYGON_CLASS, e); return eo_obj; }
EAPI Ecore_Con_Url * ecore_con_url_new(const char *url) { Ecore_Con_Url *url_obj; url_obj = eo_add(ECORE_CON_URL_CLASS, NULL, ecore_con_url_obj_url_set(url)); return url_obj; }
EAPI Evas_Canvas3D_Primitive * evas_canvas3d_primitive_add(Evas *e) { MAGIC_CHECK(e, Evas, MAGIC_EVAS); return NULL; MAGIC_CHECK_END(); Evas_Object *eo_obj = eo_add(MY_CLASS, e); return eo_obj; }
int main(int argc, char *argv[]) { Evas_Coord winw, winh; { winw = 400; winh = 400; } elm_init(argc, argv); eo_init(); Eo *win = eo_add(ELW_WIN_CLASS, NULL); eo_do(win, evas_obj_size_set(winw, winh), evas_obj_visibility_set(EINA_TRUE)); Eo *bt = eo_add(ELW_BUTTON_CLASS, win); eo_do(bt, evas_obj_position_set(25, 25), evas_obj_size_set(50, 50), evas_obj_color_set(255, 0, 0, 255), elw_button_text_set("Click"), evas_obj_visibility_set(EINA_TRUE)); eo_do(bt, eo_event_callback_add(EV_CLICKED, _btn_clicked_cb, "btn")); int r, g, b, a; eo_do(bt, evas_obj_color_get(&r, &g, &b, &a)); printf("RGBa(%d, %d, %d, %d)\n", r, g, b, a); Eo *bx = eo_add(ELW_BOXEDBUTTON_CLASS, win); eo_do(bx, evas_obj_position_set(100, 100), evas_obj_size_set(70, 70), evas_obj_color_set(0, 0, 255, 255), elw_button_text_set("Click2"), evas_obj_visibility_set(EINA_TRUE)); eo_do(bx, eo_event_callback_add(EV_CLICKED, _btn_clicked_cb, "bxedbtn")); elm_run(); eo_unref(bx); eo_unref(bt); eo_unref(win); eo_shutdown(); elm_shutdown(); return 0; }
int mount_init() { sd = calloc(1, sizeof(Emous_Manager_Static_Data)); sd->hash = eina_hash_stringshared_new(NULL); manager = eo_add(EMOUS_MANAGER_CLASS, NULL); return 1; }
EAPI Evas_Object * evas_object_line_add(Evas *e) { MAGIC_CHECK(e, Evas, MAGIC_EVAS); return NULL; MAGIC_CHECK_END(); Evas_Object *eo_obj = eo_add(EVAS_OBJ_LINE_CLASS, e); eo_unref(eo_obj); return eo_obj; }
void _camera_setup(Scene_Data *data) { data->camera = eo_add(EVAS_CANVAS3D_CAMERA_CLASS, evas); eo_do(data->camera, evas_canvas3d_camera_projection_perspective_set(65.0, 1.0, 1.0, 300.0)); data->mediator_node = eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(EVAS_CANVAS3D_NODE_TYPE_NODE)); data->camera_node = eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(EVAS_CANVAS3D_NODE_TYPE_CAMERA)); eo_do(data->root_node, evas_canvas3d_node_member_add(data->mediator_node)); eo_do(data->mediator_node, evas_canvas3d_node_member_add(data->camera_node)); eo_do(data->camera_node, evas_canvas3d_node_camera_set(data->camera), evas_canvas3d_node_position_set(20.0, 80.0, 30.0); evas_canvas3d_node_look_at_set(EVAS_CANVAS3D_SPACE_PARENT, 0.0, 0.0, 0.0, EVAS_CANVAS3D_SPACE_PARENT, 0.0, 1.0, 0.0)); }
void _light_setup(Scene_Data *data) { data->light = eo_add(EVAS_CANVAS3D_LIGHT_CLASS, evas); eo_do(data->light, evas_canvas3d_light_ambient_set(0.2, 0.2, 0.2, 1.0), evas_canvas3d_light_diffuse_set(1.0, 1.0, 1.0, 1.0), evas_canvas3d_light_specular_set(0.2, 0.2, 0.2, 1.0), evas_canvas3d_light_projection_perspective_set(100.0, 1.0, 1.0, 200.0)); data->light_node = eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(EVAS_CANVAS3D_NODE_TYPE_LIGHT)); eo_do(data->light_node, evas_canvas3d_node_light_set(data->light), evas_canvas3d_node_position_set(-30.0, 70.0, 0.0), evas_canvas3d_node_look_at_set(EVAS_CANVAS3D_SPACE_PARENT, 0.0, 0.0, 0.0, EVAS_CANVAS3D_SPACE_PARENT, 0.0, 0.0, 1.0)); eo_do(data->root_node, evas_canvas3d_node_member_add(data->light_node)); }
static void bench_eo_do_general(int request) { int i; Eo *obj = eo_add(SIMPLE_CLASS, NULL); for (i = 0 ; i < request ; i++) { eo_do(obj, simple_a_set(i)); } eo_unref(obj); }
EAPI Ecore_Idler * ecore_idler_add(Ecore_Task_Cb func, const void *data) { Ecore_Idler *ie = NULL; _ecore_lock(); ie = eo_add(MY_CLASS, _ecore_parent, ecore_idler_constructor(func, data)); _ecore_unlock(); return ie; }
EAPI Ecore_Exe * ecore_exe_pipe_run(const char *exe_cmd, Ecore_Exe_Flags flags, const void *data) { Ecore_Exe *ret = eo_add(MY_CLASS, NULL, ecore_obj_exe_command_set(exe_cmd, flags)); if (ret) { Ecore_Exe_Data *pd = eo_data_scope_get(ret, MY_CLASS); pd->data = (void *) data; } return ret; }
END_TEST START_TEST(eo_stack) { eo_init(); Eo *obj = eo_add(SIMPLE_CLASS, NULL); fail_if(!obj); eo_do(obj, simple_recursive(123)); eo_unref(obj); eo_shutdown(); }
END_TEST START_TEST (elm_atspi_role_get) { elm_init(0, NULL); Eo* root = eo_add(ELM_ATSPI_APP_OBJECT_CLASS, NULL); Elm_Atspi_Role role; eo_do(root, role = elm_interface_atspi_accessible_role_get()); ck_assert(role == ELM_ATSPI_ROLE_APPLICATION); eo_unref(root); elm_shutdown(); }
END_TEST START_TEST (elm_atspi_localized_role_name_get) { elm_init(0, NULL); Eo* root = eo_add(ELM_ATSPI_APP_OBJECT_CLASS, NULL); const char *ret = NULL; eo_do(root, ret = elm_interface_atspi_accessible_localized_role_name_get()); ck_assert(ret != NULL); eo_unref(root); elm_shutdown(); }
int main(int argc, char *argv[]) { (void) argc; (void) argv; eo_init(); Eo *obj = eo_add(INHERIT_CLASS, NULL); eo_do(obj, simple_a_set(1), inherit_prot_print()); Simple_Public_Data *pd = eo_data_scope_get(obj, SIMPLE_CLASS); printf("Pub: %d\n", pd->public_x2); eo_unref(obj); eo_shutdown(); return 0; }
END_TEST START_TEST(eo_api_not_implemented_call) { eo_init(); eina_log_print_cb_set(eo_test_print_cb, &ctx); Eo *obj = eo_add(SIMPLE_CLASS, NULL); fail_if(!obj); TEST_EO_ERROR("_eo_api_op_id_get", "in %s:%d: unable to resolve %s api func '%s' %p in class '%s'."); eo_do(obj, simple_no_implementation()); fail_unless(ctx.did); eo_unref(obj); eina_log_print_cb_set(eina_log_print_cb_stderr, NULL); eo_shutdown(); }
END_TEST START_TEST(eo_op_not_found_in_super) { eo_init(); eina_log_print_cb_set(eo_test_print_cb, &ctx); Eo *obj = eo_add(SIMPLE_CLASS, NULL); fail_if(!obj); TEST_EO_ERROR("_eo_call_resolve", "in %s:%d: func '%s' (%d) could not be resolved for class '%s' for super of '%s'."); eo_do_super(obj, SIMPLE_CLASS, simple_a_set(10)); fail_unless(ctx.did); eo_unref(obj); eina_log_print_cb_set(eina_log_print_cb_stderr, NULL); eo_shutdown(); }
int main(int argc, char *argv[]) { (void) argc; (void) argv; eo_init(); Eo *obj = eo_add(SIMPLE_CLASS, NULL); eo_do(obj, simple_a_set(4)); int a = 0, a2 = 0, a3 = 0; eo_do(obj, a = simple_a_get(), a3 = interface_a_power_3_get(), a2 = mixin_a_square_get()); printf("Got %d %d %d\n", a, a2, a3); eo_unref(obj); eo_shutdown(); return 0; }