EAPI void ecore_exe_pause(Ecore_Exe *exe) { if (!ECORE_MAGIC_CHECK(exe, ECORE_MAGIC_EXE)) { ECORE_MAGIC_FAIL(exe, ECORE_MAGIC_EXE, "ecore_exe_pause"); return; } if (exe->is_suspended) return; if (SuspendThread(exe->process_thread) != (DWORD)-1) exe->is_suspended = 1; }
/** * Add some delay for the next occurrence of a timer. * This doesn't affect the interval of a timer. * * @param timer The timer to change. * @param add The dalay to add to the next iteration. */ EAPI void ecore_timer_delay(Ecore_Timer *timer, double add) { if (!ECORE_MAGIC_CHECK(timer, ECORE_MAGIC_TIMER)) { ECORE_MAGIC_FAIL(timer, ECORE_MAGIC_TIMER, "ecore_timer_delay"); return; } _ecore_lock(); _ecore_timer_delay(timer, add); _ecore_unlock(); }
EAPI void ecore_exe_continue(Ecore_Exe *exe) { if (!ECORE_MAGIC_CHECK(exe, ECORE_MAGIC_EXE)) { ECORE_MAGIC_FAIL(exe, ECORE_MAGIC_EXE, "ecore_exe_continue"); return; } if (!exe->is_suspended) return; if (ResumeThread(exe->process_thread) != (DWORD)-1) exe->is_suspended = 0; }
/** * Delete an idle enterer callback. * @param idle_enterer The idle enterer to delete * @return The data pointer passed to the idler enterer callback on success. * NULL otherwise. */ EAPI void * ecore_idle_enterer_del(Ecore_Idle_Enterer *idle_enterer) { void *data; if (!ECORE_MAGIC_CHECK(idle_enterer, ECORE_MAGIC_IDLE_ENTERER)) { ECORE_MAGIC_FAIL(idle_enterer, ECORE_MAGIC_IDLE_ENTERER, "ecore_idle_enterer_del"); return NULL; } _ecore_lock(); data = _ecore_idle_enterer_del(idle_enterer); _ecore_unlock(); return data; }
/** * Retrieves data associated with a Ecore_Con_Url connection object. * * Retrieves data associated with a Ecore_Con_Url connection object (previously * set with ecore_con_url_data_set()). * * @param Connection object to retrieve data from. * * @return Data associated with the given object. * * @ingroup Ecore_Con_Url_Group * * @see ecore_con_url_data_set() */ EAPI void * ecore_con_url_data_get(Ecore_Con_Url *url_con) { #ifdef HAVE_CURL if (!ECORE_MAGIC_CHECK(url_con, ECORE_MAGIC_CON_URL)) { ECORE_MAGIC_FAIL(url_con, ECORE_MAGIC_CON_URL, "ecore_con_url_data_get"); return NULL; } return url_con->data; #else return NULL; url_con = NULL; #endif }
/** * Delete a queued job that has not yet been executed. * @param job Handle of the job to delete. * @return The data pointer that was to be passed to the job. */ EAPI void * ecore_job_del(Ecore_Job *job) { void *data; if (!ECORE_MAGIC_CHECK(job, ECORE_MAGIC_JOB)) { ECORE_MAGIC_FAIL(job, ECORE_MAGIC_JOB, "ecore_job_del"); return NULL; } data = job->data; ECORE_MAGIC_SET(job, ECORE_MAGIC_NONE); ecore_event_del(job->event); return data; }
/** * Change the interval the timer ticks of. If set during * a timer call, this will affect the next interval. * * @param timer The timer to change. * @param in The interval in seconds. */ EAPI void ecore_timer_interval_set(Ecore_Timer *timer, double in) { _ecore_lock(); if (!ECORE_MAGIC_CHECK(timer, ECORE_MAGIC_TIMER)) { ECORE_MAGIC_FAIL(timer, ECORE_MAGIC_TIMER, "ecore_timer_interval_set"); goto unlock; } timer->in = in; unlock: _ecore_unlock(); }
EAPI void ecore_animator_thaw(Ecore_Animator *animator) { EINA_MAIN_LOOP_CHECK_RETURN; _ecore_lock(); if (!ECORE_MAGIC_CHECK(animator, ECORE_MAGIC_ANIMATOR)) { ECORE_MAGIC_FAIL(animator, ECORE_MAGIC_ANIMATOR, "ecore_animator_del"); goto unlock; } if (animator->delete_me) goto unlock; animator->suspended = EINA_FALSE; unlock: _ecore_unlock(); }
/** * Get the pending time regarding a timer. * * @param timer The timer to learn from. * @ingroup Ecore_Time_Group */ EAPI double ecore_timer_pending_get(Ecore_Timer * timer) { double now; if (!ECORE_MAGIC_CHECK(timer, ECORE_MAGIC_TIMER)) { ECORE_MAGIC_FAIL(timer, ECORE_MAGIC_TIMER, "ecore_timer_pending_get"); return 0; } now = ecore_time_get(); if (timer->frozen) return timer->pending; return timer->at - now; }
/** * Close the write end of an Ecore_Pipe object created with ecore_pipe_add(). * * @param p The Ecore_Pipe object. */ EAPI void ecore_pipe_write_close(Ecore_Pipe *p) { _ecore_lock(); if (!ECORE_MAGIC_CHECK(p, ECORE_MAGIC_PIPE)) { ECORE_MAGIC_FAIL(p, ECORE_MAGIC_PIPE, "ecore_pipe_write_close"); goto out; } if (p->fd_write != PIPE_FD_INVALID) { pipe_close(p->fd_write); p->fd_write = PIPE_FD_INVALID; } out: _ecore_unlock(); }
/** * Associates data with a connection object. * * Associates data with a connection object, which can be retrieved later with * ecore_con_url_data_get()). * * @param url_con Connection object to associate data. * @param data Data to be set. * * @ingroup Ecore_Con_Url_Group * * @see ecore_con_url_data_get() */ EAPI void ecore_con_url_data_set(Ecore_Con_Url *url_con, void *data) { #ifdef HAVE_CURL if (!ECORE_MAGIC_CHECK(url_con, ECORE_MAGIC_CON_URL)) { ECORE_MAGIC_FAIL(url_con, ECORE_MAGIC_CON_URL, "ecore_con_url_data_set"); return; } url_con->data = data; #else return; url_con = NULL; data = NULL; #endif }
EAPI void ecore_imf_context_preedit_string_get(Ecore_IMF_Context *ctx, char **str, int *cursor_pos) { if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT)) { ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT, "ecore_imf_context_preedit_string_get"); return; } if (ctx->klass->preedit_string_get) ctx->klass->preedit_string_get(ctx, str, cursor_pos); else { if (str) *str = strdup(""); if (cursor_pos) *cursor_pos = 0; } }
/** * Delete an idle exiter handler from the list to be run on exiting idle state. * @param idle_exiter The idle exiter to delete * @return The data pointer that was being being passed to the handler if * successful. NULL otherwise. */ EAPI void * ecore_idle_exiter_del(Ecore_Idle_Exiter *idle_exiter) { void *data; EINA_MAIN_LOOP_CHECK_RETURN_VAL(NULL); if (!ECORE_MAGIC_CHECK(idle_exiter, ECORE_MAGIC_IDLE_EXITER)) { ECORE_MAGIC_FAIL(idle_exiter, ECORE_MAGIC_IDLE_EXITER, "ecore_idle_exiter_del"); return NULL; } _ecore_lock(); data = _ecore_idle_exiter_del(idle_exiter); _ecore_unlock(); return data; }
/** * Start monitoring again the pipe for reading. See ecore_pipe_freeze() for * stopping the monitoring activity. This will not work if * ecore_pipe_read_close() was previously called on the same pipe. * * @param p The Ecore_Pipe object. * @since 1.1 */ EAPI void ecore_pipe_thaw(Ecore_Pipe *p) { EINA_MAIN_LOOP_CHECK_RETURN; if (!ECORE_MAGIC_CHECK(p, ECORE_MAGIC_PIPE)) { ECORE_MAGIC_FAIL(p, ECORE_MAGIC_PIPE, "ecore_pipe_read_thaw"); return; } if (!p->fd_handler && p->fd_read != PIPE_FD_INVALID) { p->fd_handler = ecore_main_fd_handler_add(p->fd_read, ECORE_FD_READ, _ecore_pipe_read, p, NULL, NULL); } }
/** * Stop monitoring if necessary the pipe for reading. See ecore_pipe_thaw() * for monitoring it again. * * @param p The Ecore_Pipe object. * @since 1.1 */ EAPI void ecore_pipe_freeze(Ecore_Pipe *p) { EINA_MAIN_LOOP_CHECK_RETURN; _ecore_lock(); if (!ECORE_MAGIC_CHECK(p, ECORE_MAGIC_PIPE)) { ECORE_MAGIC_FAIL(p, ECORE_MAGIC_PIPE, "ecore_pipe_read_freeze"); goto out; } if (p->fd_handler) { _ecore_main_fd_handler_del(p->fd_handler); p->fd_handler = NULL; } out: _ecore_unlock(); }
/** * Free an Ecore_Pipe object created with ecore_pipe_add(). * * @param p The Ecore_Pipe object to be freed. * @return The pointer to the private data * @ingroup Ecore_Pipe_Group */ EAPI void *ecore_pipe_del(Ecore_Pipe * p) { void *data; if (!ECORE_MAGIC_CHECK(p, ECORE_MAGIC_PIPE)) { ECORE_MAGIC_FAIL(p, ECORE_MAGIC_PIPE, "ecore_pipe_del"); return NULL; } if (p->fd_handler) ecore_main_fd_handler_del(p->fd_handler); if (p->fd_read != PIPE_FD_INVALID) pipe_close(p->fd_read); if (p->fd_write != PIPE_FD_INVALID) pipe_close(p->fd_write); data = (void *) p->data; free(p); return data; }
/** * Enable or disable EPSV extension * @return FIXME: To be more documented. * @ingroup Ecore_Con_Url_Group */ EAPI void ecore_con_url_ftp_use_epsv_set(Ecore_Con_Url *url_con, int use_epsv) { #ifdef HAVE_CURL if (!ECORE_MAGIC_CHECK(url_con, ECORE_MAGIC_CON_URL)) { ECORE_MAGIC_FAIL(url_con, ECORE_MAGIC_CON_URL, "ecore_con_url_ftp_use_epsv_set"); return; } if (url_con->active) return; if (!url_con->url) return; if (use_epsv == EINA_TRUE) curl_easy_setopt(url_con->curl_easy, CURLOPT_FTP_USE_EPSV, 1); else curl_easy_setopt(url_con->curl_easy, CURLOPT_FTP_USE_EPSV, 0); #endif }
EAPI void ecore_imf_context_preedit_string_with_attributes_get(Ecore_IMF_Context *ctx, char **str, Eina_List **attrs, int *cursor_pos) { if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT)) { ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT, "ecore_imf_context_preedit_string_with_attributes_get"); return; } if (ctx->klass->preedit_string_with_attributes_get) ctx->klass->preedit_string_with_attributes_get(ctx, str, attrs, cursor_pos); else { if (str) *str = strdup(""); if (attrs) *attrs = NULL; if (cursor_pos) *cursor_pos = 0; } }
/** * Enable or disable libcurl verbose output, useful for debug * @return FIXME: To be more documented. * @ingroup Ecore_Con_Url_Group */ EAPI void ecore_con_url_verbose_set(Ecore_Con_Url *url_con, int verbose) { #ifdef HAVE_CURL if (!ECORE_MAGIC_CHECK(url_con, ECORE_MAGIC_CON_URL)) { ECORE_MAGIC_FAIL(url_con, ECORE_MAGIC_CON_URL, "ecore_con_url_verbose_set"); return; } if (url_con->active) return; if (!url_con->url) return; if (verbose == EINA_TRUE) curl_easy_setopt(url_con->curl_easy, CURLOPT_VERBOSE, 1); else curl_easy_setopt(url_con->curl_easy, CURLOPT_VERBOSE, 0); #endif }
void * _ecore_pipe_del(Ecore_Pipe *p) { void *data = NULL; if (!ECORE_MAGIC_CHECK(p, ECORE_MAGIC_PIPE)) { ECORE_MAGIC_FAIL(p, ECORE_MAGIC_PIPE, "ecore_pipe_del"); return NULL; } p->delete_me = EINA_TRUE; if (p->handling > 0) return (void *)p->data; if (p->fd_handler) _ecore_main_fd_handler_del(p->fd_handler); if (p->fd_read != PIPE_FD_INVALID) pipe_close(p->fd_read); if (p->fd_write != PIPE_FD_INVALID) pipe_close(p->fd_write); data = (void *)p->data; ecore_pipe_mp_free(p); return data; }
/** * FIXME: To be documented. * @return FIXME: To be documented. * @ingroup Ecore_Con_Url_Group */ EAPI void ecore_con_url_time(Ecore_Con_Url *url_con, Ecore_Con_Url_Time condition, time_t tm) { #ifdef HAVE_CURL if (!ECORE_MAGIC_CHECK(url_con, ECORE_MAGIC_CON_URL)) { ECORE_MAGIC_FAIL(url_con, ECORE_MAGIC_CON_URL, "ecore_con_url_time"); return; } url_con->condition = condition; url_con->time = tm; #else return; url_con = NULL; condition = 0; tm = 0; #endif }
/* * Cleans additional headers. * * Cleans additional headers associated with a connection object (previously * added with ecore_con_url_additional_header_add()). * * @param url_con Connection object to clean additional headers. * * @ingroup Ecore_Con_Url_Group * * @see ecore_con_url_additional_header_add() * @see ecore_con_url_send() */ EAPI void ecore_con_url_additional_headers_clear(Ecore_Con_Url *url_con) { #ifdef HAVE_CURL char *s; if (!ECORE_MAGIC_CHECK(url_con, ECORE_MAGIC_CON_URL)) { ECORE_MAGIC_FAIL(url_con, ECORE_MAGIC_CON_URL, "ecore_con_url_additional_headers_clear"); return; } EINA_LIST_FREE(url_con->additional_headers, s) free(s); #else return; url_con = NULL; #endif }
/** * Add some delay for the next occurrence of a timer. * This doesn't affect the interval of a timer. * * @param timer The timer to change. * @param add The dalay to add to the next iteration. * @ingroup Ecore_Time_Group */ EAPI void ecore_timer_delay(Ecore_Timer * timer, double add) { if (!ECORE_MAGIC_CHECK(timer, ECORE_MAGIC_TIMER)) { ECORE_MAGIC_FAIL(timer, ECORE_MAGIC_TIMER, "ecore_timer_delay"); return; } if (timer->frozen) { timer->pending += add; } else { timers = (Ecore_Timer *) eina_inlist_remove(EINA_INLIST_GET(timers), EINA_INLIST_GET(timer)); _ecore_timer_set(timer, timer->at + add, timer->in, timer->func, timer->data); } }
/** * Close the read end of an Ecore_Pipe object created with ecore_pipe_add(). * * @param p The Ecore_Pipe object. */ EAPI void ecore_pipe_read_close(Ecore_Pipe *p) { EINA_MAIN_LOOP_CHECK_RETURN; if (!ECORE_MAGIC_CHECK(p, ECORE_MAGIC_PIPE)) { ECORE_MAGIC_FAIL(p, ECORE_MAGIC_PIPE, "ecore_pipe_read_close"); return; } if (p->fd_handler) { _ecore_main_fd_handler_del(p->fd_handler); p->fd_handler = NULL; } if (p->fd_read != PIPE_FD_INVALID) { pipe_close(p->fd_read); p->fd_read = PIPE_FD_INVALID; } }
/** * Delete the specified timer from the timer list. * @param timer The timer to delete. * @return The data pointer set for the timer when @ref ecore_timer_add was * called. @c NULL is returned if the function is unsuccessful. * * Note: @p timer must be a valid handle. If the timer function has already * returned 0, the handle is no longer valid (and does not need to be delete). */ EAPI void * ecore_timer_del(Ecore_Timer *timer) { void *data = NULL; _ecore_lock(); if (!ECORE_MAGIC_CHECK(timer, ECORE_MAGIC_TIMER)) { ECORE_MAGIC_FAIL(timer, ECORE_MAGIC_TIMER, "ecore_timer_del"); goto unlock; } data = _ecore_timer_del(timer); unlock: _ecore_unlock(); return data; }
/** * Get the interval the timer ticks on. * * @param timer The timer to retrieve the interval from * @return The interval on success. -1 on failure. */ EAPI double ecore_timer_interval_get(Ecore_Timer *timer) { double interval; _ecore_lock(); if (!ECORE_MAGIC_CHECK(timer, ECORE_MAGIC_TIMER)) { ECORE_MAGIC_FAIL(timer, ECORE_MAGIC_TIMER, "ecore_timer_interval_get"); interval = -1.0; goto unlock; } interval = timer->in; unlock: _ecore_unlock(); return interval; }
/** * Reset a timer to its full interval * This doesn't affect the interval of a timer * @param timer The timer * @since 1.2 * @note This is equivalent to (but faster than) * @code * ecore_timer_delay(timer, ecore_timer_interval_get(timer) - ecore_timer_pending_get(timer)); * @endcode */ EAPI void ecore_timer_reset(Ecore_Timer *timer) { double now, add; if (!ECORE_MAGIC_CHECK(timer, ECORE_MAGIC_TIMER)) { ECORE_MAGIC_FAIL(timer, ECORE_MAGIC_TIMER, __func__); return; } _ecore_lock(); now = ecore_time_get(); if (timer->frozen) add = timer->pending; else add = timer->at - now; _ecore_timer_delay(timer, timer->in - add); _ecore_unlock(); }
EAPI Ecore_Exe_Event_Data * ecore_exe_event_data_get(Ecore_Exe *exe, Ecore_Exe_Flags flags) { Ecore_Exe_Event_Data *e = NULL; unsigned char *inbuf; int inbuf_num; if (!ECORE_MAGIC_CHECK(exe, ECORE_MAGIC_EXE)) { ECORE_MAGIC_FAIL(exe, ECORE_MAGIC_EXE, "ecore_exe_event_data_get"); return NULL; } /* Sort out what sort of event we are, */ /* And get the data. */ if (flags & ECORE_EXE_PIPE_READ) { inbuf = exe->pipe_read.data_buf; inbuf_num = exe->pipe_read.data_size; exe->pipe_read.data_buf = NULL; exe->pipe_read.data_size = 0; } else { inbuf = exe->pipe_error.data_buf; inbuf_num = exe->pipe_error.data_size; exe->pipe_error.data_buf = NULL; exe->pipe_error.data_size = 0; } e = calloc(1, sizeof(Ecore_Exe_Event_Data)); if (e) { e->exe = exe; e->data = inbuf; e->size = inbuf_num; } return e; }
EAPI void ecore_timer_thaw(Ecore_Timer *timer) { double now; if (!ECORE_MAGIC_CHECK(timer, ECORE_MAGIC_TIMER)) { ECORE_MAGIC_FAIL(timer, ECORE_MAGIC_TIMER, "ecore_timer_thaw"); return ; } /* Timer not frozen */ if (!timer->frozen) return ; suspended = (Ecore_Timer *) eina_inlist_remove(EINA_INLIST_GET(suspended), EINA_INLIST_GET(timer)); now = ecore_time_get(); _ecore_timer_set(timer, timer->pending + now, timer->in, timer->func, timer->data); }
EAPI Eina_Bool ecore_imf_context_selection_get(Ecore_IMF_Context *ctx, char **text) { Eina_Bool result = EINA_FALSE; if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT)) { ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT, "ecore_imf_context_selection_get"); return EINA_FALSE; } if (ctx->retrieve_selection_func) { result = ctx->retrieve_selection_func(ctx->retrieve_selection_data, ctx, text); if (!result) { if (text) *text = NULL; } } return result; }