void download_main_is_finished(void *data, const char *file, int status){ is_downloading = false; is_running = false; if(status != 200){ override_text(&info, "information_download", "No internet connection"); download_is_failed = true; ecore_main_loop_iterate(); sleep(2); return ; } override_text(&info, "information_download", "Extracting.."); ecore_main_loop_iterate(); sleep(1); extract_zip(file,CACHE_PATH); file_delete(file); override_text(&info, "information_download", "Loading menu.."); ecore_main_loop_iterate(); }
bool EWK2UnitTestBase::waitUntilTrue(bool &flag, double timeoutSeconds) { CallbackDataExpectedValue<bool> data(true, timeoutSeconds); while (!data.isDone() && !flag) ecore_main_loop_iterate(); return !data.didTimeOut(); }
void TestController::platformRunUntil(bool& condition, double timeout) { if (timeout == m_noTimeout) { // Never timeout if we are debugging or not meant to timeout. while (!condition) ecore_main_loop_iterate(); return; } timer = ecore_timer_loop_add(timeout, timerFired, 0); ecore_main_loop_begin(); }
EAPI_MAIN int elm_main(int argc, char **argv) { setpriority(PRIO_PROCESS, 0, +15); int x, y, w, h; if (argc > 1) { file=argv[1]; } if (argc > 2) { command=argv[2]; } if (argc > 3) { x=atof(argv[3]); } if (argc > 4) { y=atof(argv[4]); } if (argc > 5) { w=atof(argv[5]); } if (argc > 6) { h=atof(argv[6]); } else { printf("how to use: ./button_png filename command x y w h \n"); elm_exit(); exit(0); } win = elm_win_add(NULL, NULL, ELM_WIN_NOTIFICATION); elm_win_prop_focus_skip_set(win, EINA_TRUE); Evas *evas = evas_object_evas_get(win); evas_object_move(win, x, y); evas_object_resize(win,w,h); evas_object_show(win); // Create an image object Evas_Object *img = evas_object_image_filled_add(evas); evas_object_image_file_set(img, file, NULL); evas_object_move(img, 0, 0); evas_object_resize(img,w,h); evas_object_event_callback_add(img, EVAS_CALLBACK_MOUSE_DOWN, _on_keydown, NULL); evas_object_show(img); ecore_main_loop_iterate(); elm_run(); return 0; }
void download_is_finished(void *data, const char *file, int status){ printf("\nDone (status: %d)\n", status); download_status = status; if(status == 200 && !is_abort){ override_text(&download_perc, "d_perc_text", "Installing.."); ecore_main_loop_iterate(); switch(Apps[category].type_file[app+(y*3+x)]){ case PSC_PACKAGE: Create_Bubble(file, Apps[category].name[app+(y*3+x)].c_str()); pkg_is_installed = true; break; case PSC_THEME: Copy_Theme(file, Apps[category].name[app+(y*3+x)].c_str()); break; case PSC_IMAGE: // /dev_hdd0/photo break; case PSC_VIDEO: break; default: break; } } override_text(&download_perc, "d_perc_text", "Deleting cache.."); ecore_main_loop_iterate(); file_delete(file); sleep(1); is_downloading = false; hide_obj(down); hide_edj(&download_perc); hide_edj(&download); is_download = false; if(!is_abort){ is_asking_exit_to_xmb = true; show_edj(&download_ask); }else is_abort = false; evas_object_resize(down, 0, Bar_Y_Val); }
bool EWK2UnitTestBase::waitUntilURLChangedTo(const char* expectedURL, double timeoutSeconds) { CallbackDataExpectedValue<CString> data(expectedURL, timeoutSeconds); evas_object_smart_callback_add(m_webView, "url,changed", onURLChanged, &data); while (!data.isDone()) ecore_main_loop_iterate(); evas_object_smart_callback_del(m_webView, "url,changed", onURLChanged); return !data.didTimeOut(); }
bool EWK2UnitTestBase::waitUntilLoadFinished(double timeoutSeconds) { CallbackDataTimer data(timeoutSeconds); evas_object_smart_callback_add(m_webView, "load,finished", onLoadFinished, &data); while (!data.isDone()) ecore_main_loop_iterate(); evas_object_smart_callback_del(m_webView, "load,finished", onLoadFinished); return !data.didTimeOut(); }
int download_main_func_curl(void *clientp, double dltotal, double dlnow, double ultotal, double ulnow){ is_downloading = true; char perc[26]; if(dltotal!=0){ sprintf(perc,"Downloading.. %.2f %%", dlnow*100/dltotal); override_text(&info, "information_download", perc); }else if(is_abort){ is_abort = false; return -1; } ecore_main_loop_iterate(); return 0; }
int download_func_curl(void *clientp, double dltotal, double dlnow, double ultotal, double ulnow){ is_downloading = true; char perc[10]; if(dltotal!=0){ sprintf(perc,"%.2f %%", dlnow*100/dltotal); override_text(&download_perc, "d_perc_text", perc); evas_object_resize(down, Bar_X_Val*dlnow/dltotal, Bar_Y_Val); }else if(get_download_wr_status()){ sprintf(perc,"Downloading.."); override_text(&download_perc, "d_perc_text", perc); } if(is_abort){ return -1; } ecore_main_loop_iterate(); return 0; }
Eina_List* EWK2UnitTestBase::waitUntilSpellingLanguagesLoaded(unsigned expectedLanguageCount, double timeoutValue) { // Keep waiting until all languages has been loaded or leave afqter timeout. // Languages are being loaded in the timer, we have to wait for them. Eina_List* loadedLanguages = nullptr; void* actual = nullptr; CallbackDataExpectedValue<bool> data(true, timeoutValue); while ((eina_list_count(loadedLanguages) != expectedLanguageCount) && !data.isDone()) { if (loadedLanguages) { // List has to be freed before acquiring new one. actual = nullptr; EINA_LIST_FREE(loadedLanguages, actual) eina_stringshare_del(static_cast<const char*>(actual)); } loadedLanguages = ewk_text_checker_spell_checking_languages_get(); ecore_main_loop_iterate(); } return loadedLanguages; }
void EventLoop::cycle() { ecore_main_loop_iterate(); }
void run(bool* done) { while (!*done) ecore_main_loop_iterate(); }
/** * @return Returns no value. * @brief One iteration of the main execution loop of EWL * * This is one iteration of the main execution loop of ewl. It dispatches * all of the current incoming events and renders updates on the queue to the evas's used by ewl. * Remember to clean up with ewl_shutdown () afterwards. */ void ewl_main_iterate (void) { ecore_main_loop_iterate (); }
void EventLoop::cycle() { printf("EventLoop::cycle()\n"); ecore_main_loop_iterate(); }
evfs_connection * evfs_connect(void (*callback_func) (EvfsEvent *, void *), void *obj) { ecore_init(); ecore_ipc_init(); int connect_attempts = 0; evfs_connection *connection = NEW(evfs_connection); connection->id = MAX_CLIENT; connection->prog_event = NULL; connection->callback_func = callback_func; connection->obj = obj; evfs_io_initialise(); evfs_vfolder_initialise(); if (!_libevfs_init) { _libevfs_init = 1; _libevfs_next_command_id = 1; evfs_session_servers = ecore_hash_new(ecore_direct_hash, ecore_direct_compare); /*Register the callback*/ ecore_event_handler_add(ECORE_IPC_EVENT_SERVER_DATA, evfs_server_data, NULL); client_list = ecore_list_new(); ecore_list_append(client_list, connection); } else { ecore_list_prepend(client_list, connection); } retry: if (connect_attempts > MAX_ATTEMPTS) { fprintf(stderr, "Could not start server after max attempts\n"); exit(1); /*We shouldn't really kill the libraries parent! */ return NULL; } if (! (connection->server = ecore_ipc_server_connect(ECORE_IPC_LOCAL_USER, EVFS_IPC_TITLE,0, connection))) { fprintf(stderr, "Cannot connect to evfs server with '%s', making new server and trying again..\n", EVFS_IPC_TITLE); if (!connect_attempts) { if (evfs_server_spawn()) { printf("Failure to start evfs server!\n"); } } connect_attempts++; usleep(100000 * connect_attempts); goto retry; } else { ecore_hash_set(evfs_session_servers, connection->server, (int*)1); while (connection->id == MAX_CLIENT) { /*printf("Waiting for connection id..\n");*/ ecore_main_loop_iterate(); } /*printf("Got connection ID: %d\n", connection->id);*/ } return connection; }