示例#1
0
/* Creates the window for the progress bar test */
void etk_test_progress_bar_window_create(void *data)
{
   static Etk_Widget *win;
   Etk_Widget *vbox;
   Etk_Widget *pbar;
   Etk_Widget *pbar2;

   if (win)
   {
      etk_widget_show_all(ETK_WIDGET(win));
      return;
   }

   win = etk_window_new();
   etk_window_title_set(ETK_WINDOW(win), "Etk Progress Bar Test");
   etk_signal_connect_by_code(ETK_WINDOW_DELETE_EVENT_SIGNAL, ETK_OBJECT(win), ETK_CALLBACK(etk_window_hide_on_delete), NULL);

   vbox = etk_vbox_new(ETK_TRUE, 5);
   etk_container_add(ETK_CONTAINER(win), vbox);

   pbar = etk_progress_bar_new_with_text("0% done");
   etk_box_append(ETK_BOX(vbox), pbar, ETK_BOX_START, ETK_BOX_EXPAND_FILL, 0);

   pbar2 = etk_progress_bar_new_with_text("Loading...");
   etk_progress_bar_pulse_step_set(ETK_PROGRESS_BAR(pbar2), 0.015);
   etk_box_append(ETK_BOX(vbox), pbar2, ETK_BOX_START, ETK_BOX_EXPAND_FILL, 0);

   etk_widget_show_all(win);

   _etk_test_progress_bar_timer = ecore_timer_add(0.05, _etk_test_progress_bar_update, pbar);
   _etk_test_progress_bar_timer2 = ecore_timer_add(0.025, _etk_test_progress_bar_update2, pbar2);

   etk_signal_connect_swapped_by_code(ETK_OBJECT_DESTROYED_SIGNAL, ETK_OBJECT(pbar), ETK_CALLBACK(ecore_timer_del), _etk_test_progress_bar_timer);
   etk_signal_connect_swapped_by_code(ETK_OBJECT_DESTROYED_SIGNAL, ETK_OBJECT(pbar2), ETK_CALLBACK(ecore_timer_del), _etk_test_progress_bar_timer2);
}
void GestureRecognizer::noGesture(WKTouchEventRef eventRef)
{
    switch (WKTouchEventGetType(eventRef)) {
    case kWKEventTypeTouchStart: {
        WKArrayRef touchPoints = WKTouchEventGetTouchPoints(eventRef);
        switch (WKArrayGetSize(touchPoints)) {
        case 1:
            m_gestureHandler->reset();
            m_recognizerFunction = &GestureRecognizer::singleTapGesture;
            m_firstPressedPoint = toIntPoint(getPointAtIndex(touchPoints, 0));
            ASSERT(!m_tapAndHoldTimer);
            m_tapAndHoldTimer = ecore_timer_add(s_tapAndHoldTimeoutInSeconds, tapAndHoldTimerCallback, this);
            m_doubleTapTimer = ecore_timer_add(s_doubleTapTimeoutInSeconds, doubleTapTimerCallback, this);
            break;
        case 2:
            m_recognizerFunction = &GestureRecognizer::pinchGesture;
            m_gestureHandler->handlePinchStarted(createVectorWithWKArray(touchPoints, 2));
            break;
        default:
            // There's no defined gesture when we touch three or more points.
            notImplemented();
            break;
        }
        break;
    }
    case kWKEventTypeTouchMove:
    case kWKEventTypeTouchEnd:
        break;
    default:
        ASSERT_NOT_REACHED();
        break;
    }
}
示例#3
0
文件: shotgun.c 项目: Limsik/e17
void
shotgun_ping_start(Shotgun_Auth *auth)
{
   auth->et_ping = ecore_timer_add(auth->ping_delay, (Ecore_Task_Cb)ping, auth);
   auth->et_ping_timeout = ecore_timer_add(auth->ping_timeout, (Ecore_Task_Cb)ping_timeout, auth);
   ecore_timer_freeze(auth->et_ping_timeout);
}
static void
_ecore_poller_next_tick_eval(void)
{
   int i;
   double interval;

   min_interval = -1;
   for (i = 0; i < 15; i++)
     {
        if (pollers[i])
          {
             min_interval = i;
             break;
          }
     }
   if (min_interval < 0)
     {
        /* no pollers */
         if (timer)
           {
              ecore_timer_del(timer);
              timer = NULL;
           }
         return;
     }
   interval_incr = (1 << min_interval);
   interval = interval_incr * poll_interval;
   /* we are at the tick callback - so no need to do inter-tick adjustments
    * so we can fasttrack this as t -= last_tick in theory is 0.0 (though
    * in practice it will be a very very very small value. also the tick
    * callback will adjust the timer interval at the end anyway */
   if (at_tick)
     {
        if (!timer)
          timer = ecore_timer_add(interval, _ecore_poller_cb_timer, NULL);
     }
   else
     {
        double t;

        if (!timer)
          timer = ecore_timer_add(interval, _ecore_poller_cb_timer, NULL);
        else
          {
             t = ecore_time_get();
             if (interval != poll_cur_interval)
               {
                  t -= last_tick; /* time since we last ticked */
     /* delete the timer and reset it to tick off in the new
      * time interval. at the tick this will be adjusted */
                  ecore_timer_del(timer);
                  timer = ecore_timer_add(interval - t,
                                          _ecore_poller_cb_timer, NULL);
               }
          }
     }
   poll_cur_interval = interval;
}
int ttsd_server_play(int uid)
{
	app_state_e state;
	if (0 > ttsd_data_get_client_state(uid, &state)) {
		SLOG(LOG_ERROR, TAG_TTSD, "[Server ERROR] uid(%d) is NOT valid  ", uid);
		return TTSD_ERROR_INVALID_PARAMETER;
	}
	
	if (APP_STATE_PLAYING == state) {
		SLOG(LOG_WARN, TAG_TTSD, "[Server WARNING] Current state(%d) is 'play' ", uid);
		return TTSD_ERROR_NONE;
	}

	/* check if engine use network */
	if (ttsd_engine_agent_need_network()) {
		if (false == ttsd_network_is_connected()) {
			SLOG(LOG_ERROR, TAG_TTSD, "[Server ERROR] Disconnect network. Current engine needs network service!!!.");
			return TTSD_ERROR_OUT_OF_NETWORK;
		}
	}

	int current_uid = ttsd_data_get_current_playing();

	if (uid != current_uid && -1 != current_uid) {
		/* Send interrupt message */
		SLOG(LOG_DEBUG, TAG_TTSD, "[Server] Old uid(%d) will be interrupted into 'Pause' state ", current_uid);

		/* pause player */
		if (0 != ttsd_player_pause(current_uid)) {
			SLOG(LOG_WARN, TAG_TTSD, "[Server ERROR] fail to ttsd_player_pause() : uid (%d)", current_uid);
		} 

		/* change state */
		ttsd_data_set_client_state(current_uid, APP_STATE_PAUSED);

		int* temp_uid = (int*)malloc(sizeof(int));
		*temp_uid = current_uid;
		ecore_timer_add(0, __send_interrupt_client, temp_uid);
	}
	
	/* Change current play */
	if (0 != ttsd_data_set_client_state(uid, APP_STATE_PLAYING)) {
		SLOG(LOG_ERROR, TAG_TTSD, "[Server ERROR] Fail to set state : uid(%d)", uid);
		return TTSD_ERROR_OPERATION_FAILED;
	}

	if (0 != __server_play_internal(uid, state)) {
		SLOG(LOG_ERROR, TAG_TTSD, "[Server ERROR] Fail to start synthesis : uid(%d)", uid);
		return TTSD_ERROR_OPERATION_FAILED;
	}

	if (NULL == g_timer)
		ecore_timer_add(0, __start_next_synthesis, NULL);

	return TTSD_ERROR_NONE;
}
int
main(int argc, char **argv)
{
   struct context ctxt = {0};

   if (!ecore_init())
     {
        printf("ERROR: Cannot init Ecore!\n");
        return -1;
     }

   _event_type = ecore_event_type_new();

   ctxt.enterer = ecore_idle_enterer_add(_enterer_cb, &ctxt);
   ctxt.exiter = ecore_idle_exiter_add(_exiter_cb, &ctxt);
//   ctxt.idler = ecore_idler_add(_idler_cb, &ctxt);
   ctxt.idler = eo_add_custom(ECORE_IDLER_CLASS, NULL, ecore_idler_constructor(_idler_cb, &ctxt));
   ctxt.handler = ecore_event_handler_add(_event_type,
                                          _event_handler_cb,
                                          &ctxt);
   ctxt.timer = ecore_timer_add(0.0005, _timer_cb, &ctxt);

   ecore_main_loop_begin();
   ecore_shutdown();

   return 0;
}
void setSharedTimerFireTime(double fireTime)
{
    double interval = fireTime - currentTime();

    stopSharedTimer();
    g_sharedTimer = ecore_timer_add(interval, timerEvent, 0);
}
示例#8
0
static void
_queue_render(Miniview *mv)
{
   mv->to_render = 1;
   if ((!mv->deferred_renderer) && (mv->is_shown))
     mv->deferred_renderer = ecore_timer_add(0.1, _deferred_renderer, mv);
}
示例#9
0
static void
window_move_cb (Ecore_Evas * ee)
{
  if (refresh_timer)
    ecore_timer_del (refresh_timer);
  refresh_timer = ecore_timer_add (MOVE_REFRESH, fix_bg, ee);
}
示例#10
0
int tts_prepare(tts_h tts)
{
	SLOG(LOG_DEBUG, TAG_TTSC, "===== Prepare TTS");

	tts_client_s* client = tts_client_get(tts);

	/* check handle */
	if (NULL == client) {
		SLOG(LOG_ERROR, TAG_TTSC, "[ERROR] A handle is not available");
		SLOG(LOG_DEBUG, TAG_TTSC, "=====");
		SLOG(LOG_DEBUG, TAG_TTSC, " ");
		return TTS_ERROR_INVALID_PARAMETER;
	}

	/* check state */
	if (client->current_state != TTS_STATE_CREATED) {
		SLOG(LOG_ERROR, TAG_TTSC, "[ERROR] Invalid State: Current state is not 'CREATED'"); 
		SLOG(LOG_DEBUG, TAG_TTSC, "=====");
		SLOG(LOG_DEBUG, TAG_TTSC, " ");
		return TTS_ERROR_INVALID_STATE;
	}

	ecore_timer_add(0, __tts_connect_daemon, (void*)tts);

	SLOG(LOG_DEBUG, TAG_TTSC, "=====");
	SLOG(LOG_DEBUG, TAG_TTSC, " ");

	return TTS_ERROR_NONE;
}
示例#11
0
文件: e_icon.c 项目: haxworx/Enform
static int
_handle_anim(E_Smart_Data *sd)
{
   double t;

   if (sd->timer) ecore_timer_del(sd->timer);
   sd->timer = NULL;
   sd->frame = 0;
   sd->frame_count = 0;
   if (!evas_object_image_animated_get(sd->obj)) return 0;
   // FIXME: hack around jiyouns BUG!!!!!!!!
   {
      const char *file;
      char buf[256];
      snprintf(buf, sizeof(buf), "%ld", (long)sd);
      evas_object_image_file_get(sd->obj, &file, NULL);
      evas_object_image_file_set(sd->obj, file, buf);
   }
   sd->frame_count = evas_object_image_animated_frame_count_get(sd->obj);
   if (sd->frame_count < 2) return 0;
   evas_object_show(sd->obj);
   t = evas_object_image_animated_frame_duration_get(sd->obj, sd->frame, 0);
   sd->timer = ecore_timer_add(t, _frame_anim, sd);
   return 1;
}
示例#12
0
文件: scrolling.c 项目: Limsik/e17
void
scrolling_start(Scrolling *s)
{
  if (!s) return;

  ecore_timer_add(0.01, _scrolling_move_cb, s);
}
示例#13
0
Eina_Bool
mp_app_key_up_cb(void *data, int type, void *event)
{
	struct appdata *ad = data;
	MP_CHECK_VAL(ad, ECORE_CALLBACK_PASS_ON);

	Ecore_Event_Key *key = event;
	MP_CHECK_VAL(key, ECORE_CALLBACK_PASS_ON);

	if (!g_strcmp0(key->keyname, KEY_VOLUMEUP)) {
		mp_volume_key_event_send(MP_VOLUME_KEY_UP, true);
	}
	else if (!g_strcmp0(key->keyname, KEY_VOLUMEDOWN)) {
		mp_volume_key_event_send(MP_VOLUME_KEY_DOWN, true);
	}
	else if (!g_strcmp0(key->keyname, KEY_MEDIA)) {
		DEBUG_TRACE("Key pressed");
		if (ad->ear_key_press_cnt > 3)
		{
			DEBUG_TRACE("pressed more than 3times");
			return ECORE_CALLBACK_PASS_ON;
		}
		if (ad->ear_key_timer)
		{
			ecore_timer_del(ad->ear_key_timer);
			ad->ear_key_timer = NULL;
		}
		ad->ear_key_timer = ecore_timer_add(0.5, _mp_app_ear_key_timer_cb, ad);
		ad->ear_key_press_cnt++;
	}

	return ECORE_CALLBACK_PASS_ON;
}
示例#14
0
int tts_unprepare(tts_h tts)
{
	SLOG(LOG_DEBUG, TAG_TTSC, "===== Unprepare TTS");

	tts_client_s* client = tts_client_get(tts);

	/* check handle */
	if (NULL == client) {
		SLOG(LOG_ERROR, TAG_TTSC, "[ERROR] A handle is not available");
		return TTS_ERROR_INVALID_PARAMETER;
	}

	/* check state */
	if (client->current_state != TTS_STATE_READY) {
		SLOG(LOG_ERROR, TAG_TTSC, "[ERROR] Invalid State: Current state is not 'READY'"); 
		SLOG(LOG_DEBUG, TAG_TTSC, "=====");
		SLOG(LOG_DEBUG, TAG_TTSC, " ");
		return TTS_ERROR_INVALID_STATE;
	}

	int ret = tts_dbus_request_finalize(client->uid);
	if (0 != ret) {
		SLOG(LOG_WARN, TAG_TTSC, "[ERROR] Fail to request finalize");
	}

	client->before_state = client->current_state;
	client->current_state = TTS_STATE_CREATED;

	ecore_timer_add(0, __tts_notify_state_changed, (void*)tts);

	SLOG(LOG_DEBUG, TAG_TTSC, "=====");
	SLOG(LOG_DEBUG, TAG_TTSC, " ");

	return TTS_ERROR_NONE;
}
示例#15
0
int connline_plugin_trigger_callback(struct connline_context *context,
						connline_callback_f callback,
						enum connline_event event,
						char **changed_property)
{
	struct callback_trigger_data *trigger;
	Eina_Hash *context_ht;

	if (callback == NULL || context == NULL)
		return -EINVAL;

	trigger = calloc(1, sizeof(struct callback_trigger_data));
	if (trigger == NULL)
		return -ENOMEM;

	trigger->callback = callback;
	trigger->context = context;
	trigger->event = event;
	trigger->changed_property = changed_property;

	trigger->e_timer = ecore_timer_add(0, trigger_run, trigger);

	context_ht = eina_hash_find(triggers_table, context);
	if (context_ht == NULL) {
		context_ht = eina_hash_pointer_new(remove_trigger);

		eina_hash_add(triggers_table, context, context_ht);
	}

	eina_hash_add(context_ht, trigger->e_timer, trigger);

	return 0;
}
示例#16
0
static void _init(EWeather *eweather)
{
    Instance *inst = calloc(1, sizeof(Instance));
    eweather->plugin.data = inst;
    inst->weather = eweather;
    inst->count = 11;

    EWeather_Data *e_data = eweather_data_current_get(inst->weather);
    snprintf(e_data->city, sizeof(e_data->city),
            "Paris");
    snprintf(e_data->region, sizeof(e_data->region),
            "IDF");
    snprintf(e_data->country, sizeof(e_data->country),
            "FR");

    e_data = eweather_data_get(inst->weather, 1);
    snprintf(e_data->city, sizeof(e_data->city),
            "Paris");
    snprintf(e_data->region, sizeof(e_data->region),
            "IDF");
    snprintf(e_data->country, sizeof(e_data->country),
            "FR");

    e_data = eweather_data_get(inst->weather, 2);
    snprintf(e_data->city, sizeof(e_data->city),
            "Paris");
    snprintf(e_data->region, sizeof(e_data->region),
            "IDF");
    snprintf(e_data->country, sizeof(e_data->country),
            "FR");


    inst->check_timer = ecore_timer_add(0, _weather_cb_check, inst);
}
示例#17
0
文件: esql_connect.c 项目: Limsik/e17
/**
 * @brief Set a timeout to disconnect after no activity
 * @param e The #Esql object (NOT NULL)
 * @param timeout The timeout in seconds
 *
 * Use this function to apply a timer policy to an Esql object and force disconnection
 * after @p timeout seconds of inactivity.
 * @note Setting a value <= 0 will disable this feature.
 */
void
esql_connect_timeout_set(Esql  *e,
                         double timeout)
{
   EINA_SAFETY_ON_NULL_RETURN(e);

   e->timeout = timeout;
   if (e->pool)
     {
        esql_pool_connect_timeout_set((Esql_Pool*)e, timeout);
        return;
     }
   if (timeout > 0.0)
     {
        if (e->timeout_timer)
          {
             ecore_timer_interval_set(e->timeout_timer, e->timeout);
             ecore_timer_reset(e->timeout_timer);
          }
        else e->timeout_timer = ecore_timer_add(timeout, (Ecore_Task_Cb)esql_timeout_cb, e);
     }
   else
     {
        ecore_timer_del(e->timeout_timer);
        e->timeout_timer = NULL;
        e->timeout = 0;
     }
}
示例#18
0
static void
_exiter_reschedule(void)
{
   if (exiter)
     ecore_timer_del(exiter);
   exiter = ecore_timer_add(10, _on_exiter, NULL);
}
示例#19
0
文件: main.c 项目: gzorin/e17
static void
_next_level(Game *game, int level)
{
    char buf[32];

    if (level > LEVEL_MAX)
    {
        edje_object_signal_emit(game->base, "player_won", "");
        game->mode = OFF;
        return;
    }

    _score_inc(game, 100 * (level - LEVEL_DEFAULT));
    snprintf(buf, sizeof(buf), "%i", level - LEVEL_DEFAULT + 1);
    edje_object_part_text_set(game->base, "level", buf);
    if (level != LEVEL_DEFAULT)
        edje_object_signal_emit(game->base, "next_level", "");
    game->mode = PLAYING;
    game->level = level;
    _create_seq(game);
    game->step = 0;

    if (level == LEVEL_DEFAULT)
        _cpu_turn(game);
    else
        game->turn_timer = ecore_timer_add(1.0, _cpu_turn_cb, game);
}
示例#20
0
void
_ecore_pa_time_restart(pa_time_event *event, const struct timeval *tv)
{
   struct timeval now;
   double interval;

   /* If tv is NULL disable timer */
   if (!tv)
     {
        ecore_timer_del(event->timer);
        event->timer = NULL;
        return;
     }

   event->tv = *tv;

   if (gettimeofday(&now, NULL) == -1)
     {
        ERR("Failed to get the current time!");
        return;
     }

   interval = (tv->tv_sec - now.tv_sec) + (tv->tv_usec - now.tv_usec) / 1000;
   if (event->timer)
     {
        event->timer = ecore_timer_add(interval, _ecore_time_wrapper, event);
     }
   else
     {
        ecore_timer_interval_set(event->timer, interval);
        ecore_timer_reset(event->timer);
     }
}
示例#21
0
Ecore_File_Monitor *
ecore_file_monitor_backend_add(const char *path,
                            void (*func) (void *data, Ecore_File_Monitor *em,
                                          Ecore_File_Event event,
                                          const char *path),
                            void *data)
{
   Ecore_File_Monitor *em;
   size_t len;

   if (!path) return NULL;
   if (!func) return NULL;

   em = calloc(1, sizeof(Ecore_File_Monitor_Poll));
   if (!em) return NULL;

   if (!_timer)
     _timer = ecore_timer_add(_interval, _ecore_file_monitor_poll_handler, NULL);
   else
     ecore_timer_interval_set(_timer, ECORE_FILE_INTERVAL_MIN);

   em->path = strdup(path);
   len = strlen(em->path);
   if (em->path[len - 1] == '/' && strcmp(em->path, "/"))
     em->path[len - 1] = 0;

   em->func = func;
   em->data = data;

   ECORE_FILE_MONITOR_POLL(em)->mtime = ecore_file_mod_time(em->path);
   _monitors = ECORE_FILE_MONITOR(eina_inlist_append(EINA_INLIST_GET(_monitors), EINA_INLIST_GET(em)));

   if (ecore_file_exists(em->path))
     {
        if (ecore_file_is_dir(em->path))
          {
             /* Check for subdirs */
             Eina_List *files;
             char *file;

             files = ecore_file_ls(em->path);
             EINA_LIST_FREE(files, file)
                    {
                       Ecore_File *f;
                       char buf[PATH_MAX];

                       f = calloc(1, sizeof(Ecore_File));
                       if (!f)
                    {
                       free(file);
                         continue;
                    }

                       snprintf(buf, sizeof(buf), "%s/%s", em->path, file);
                       f->name = file;
                       f->mtime = ecore_file_mod_time(buf);
                       f->is_dir = ecore_file_is_dir(buf);
                       em->files = (Ecore_File *) eina_inlist_append(EINA_INLIST_GET(em->files), EINA_INLIST_GET(f));
                    }
          }
示例#22
0
int __tts_cb_set_state(int uid, int state)
{
	tts_client_s* client = tts_client_get_by_uid(uid);
	if( NULL == client ) {
		SLOG(LOG_ERROR, TAG_TTSC, "Handle not found");
		return -1;
	}

	tts_state_e state_from_daemon = (tts_state_e)state;

	if (client->current_state == state_from_daemon) {
		SLOG(LOG_DEBUG, TAG_TTSC, "Current state has already been %d", client->current_state);
		return 0;
	}

	if (NULL != client->state_changed_cb) {
		ecore_timer_add(0, __tts_notify_state_changed, client->tts);
	} else {
		SLOG(LOG_WARN, TAG_TTSC, "[WARNING] State changed callback is null");
	}

	client->before_state = client->current_state;
	client->current_state = state_from_daemon;

	return 0;
}
示例#23
0
static Eina_Bool watch_handler_dispatch(void *data,
					Ecore_Fd_Handler *e_handler)
{
	struct watch_handler *io_handler = data;
	DBusDispatchStatus status;
	unsigned int flags = 0;

	if (ecore_main_fd_handler_active_get(e_handler, ECORE_FD_ERROR)
								== EINA_TRUE)
		flags |= DBUS_WATCH_ERROR;
	if (ecore_main_fd_handler_active_get(e_handler, ECORE_FD_READ)
								== EINA_TRUE)
		flags |= DBUS_WATCH_READABLE;
	if (ecore_main_fd_handler_active_get(e_handler, ECORE_FD_WRITE)
								== EINA_TRUE)
		flags |= DBUS_WATCH_WRITABLE;

	dbus_watch_handle(io_handler->watch, flags);

	status = dbus_connection_get_dispatch_status(io_handler->dbus_cnx);
	if (status == DBUS_DISPATCH_DATA_REMAINS)
		ecore_timer_add(0, efl_dispatch_dbus, io_handler->dbus_cnx);

	dbus_connection_unref(io_handler->dbus_cnx);

	return TRUE;
}
示例#24
0
/**
 * Add a text object to the screen.
 */
Evas_Object *
label_add(Evas *e, int x, int y, const char *fmt, bool anim){
	Evas_Object *o;
	Ecore_Timer *timer;

	if (!e) return NULL;

	o = evas_object_text_add(e);
	evas_object_text_font_set(o, "Vera", 15);
	evas_object_text_style_set(o, EVAS_TEXT_STYLE_SOFT_OUTLINE);
	evas_object_color_set(o, 0,0,0,255);
	evas_object_text_outline_color_set(o,255,255,255,255);

	evas_object_layer_set(o, 1);
	evas_object_text_text_set(o,fmt);
	evas_object_move(o,x,y);
	if (visible) evas_object_show(o);

	labels = eina_list_append(labels, o);

	if (!anim) return o;

	timer = ecore_timer_add(0.1, label_move, o);

	return o;
}
示例#25
0
pa_time_event *
_ecore_pa_time_new(pa_mainloop_api *api, const struct timeval *tv, pa_time_event_cb_t cb, void *userdata)
{
   pa_time_event *event;
   struct _Ecore_Audio_Pa_Private *mloop;
   struct timeval now;
   double interval;

   mloop = api->userdata;

   event = calloc(1, sizeof(pa_time_event));
   event->mainloop = mloop;
   event->userdata = userdata;
   event->callback = cb;
   event->tv = *tv;

   if (gettimeofday(&now, NULL) == -1)
     {
        ERR("Failed to get the current time!");
        return NULL;
     }

   interval = (tv->tv_sec - now.tv_sec) + (tv->tv_usec - now.tv_usec) / 1000;
   event->timer = ecore_timer_add(interval, _ecore_time_wrapper, event);

   return event;
}
示例#26
0
void
_mail_config_updated (Config_Item *ci)
{
  Eina_List *l;

  if (!mail_config)
    return;

  for (l = mail_config->instances; l; l = l->next)
    {
      Instance *inst;

      inst = l->data;
      if (inst->ci != ci) continue;
      if (inst->check_timer)
	{
	   ecore_timer_del (inst->check_timer);
	   inst->check_timer =
	      ecore_timer_add ((ci->check_time * 60.0), _mail_cb_check,
		    inst);
	}

      if (ci->show_label)
	edje_object_signal_emit (inst->mail_obj, "label_active", "");
      else
	edje_object_signal_emit (inst->mail_obj, "label_passive", "");
      break;
    }
}
示例#27
0
static void
_val_fetch(Evas_Object *obj, Eina_Bool user_event)
{
   Eina_Bool rtl;
   double posx = 0.0, posy = 0.0, pos = 0.0, val;

   ELM_SLIDER_DATA_GET(obj, sd);
   ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);

   edje_object_part_drag_value_get
     (wd->resize_obj, "elm.dragable.slider", &posx, &posy);
   if (sd->horizontal) pos = posx;
   else pos = posy;

   rtl = elm_widget_mirrored_get(obj);
   if ((!rtl && sd->inverted) ||
       (rtl && ((!sd->horizontal && sd->inverted) ||
                (sd->horizontal && !sd->inverted))))
     pos = 1.0 - pos;

   val = (pos * (sd->val_max - sd->val_min)) + sd->val_min;
   if (val != sd->val)
     {
        sd->val = val;
        if (user_event)
          {
             evas_object_smart_callback_call(obj, SIG_CHANGED, NULL);
             if (sd->delay) ecore_timer_del(sd->delay);
             sd->delay = ecore_timer_add(SLIDER_DELAY_CHANGED_INTERVAL, _delay_change, obj);
          }
     }
}
示例#28
0
static void _init(EWeather *eweather)
{
   Instance *inst = calloc(1, sizeof(Instance));
   eweather->plugin.data = inst;
   inst->weather = eweather;
   inst->host = eina_stringshare_add("www.google.com");

   printf("INIT %d\n",ecore_con_init());

   inst->add_handler =
      ecore_event_handler_add(ECORE_CON_EVENT_SERVER_ADD,
	    _server_add, inst);
   inst->del_handler =
      ecore_event_handler_add(ECORE_CON_EVENT_SERVER_DEL,
	    _server_del, inst);
   inst->err_handler =
      ecore_event_handler_add(ECORE_CON_EVENT_SERVER_ERROR,
	    _server_error, inst);
   inst->data_handler =
      ecore_event_handler_add(ECORE_CON_EVENT_SERVER_DATA,
	    _server_data, inst);

   inst->check_timer =
      ecore_timer_add(0, _weather_cb_check, inst);
}
示例#29
0
void
daemon_note_show(Daemon_Data *d, E_Notification *n)
{
  e_notification_ref(n);
  d->open_notes = eina_list_append(d->open_notes, n); 
  e_notification_ref(n);
  d->history = eina_list_append(d->history, n); 

  // adjust history
  if ((int) eina_list_count(d->history) > d->max_history_length)
  {
    E_Notification *old;
    old = eina_list_data_get(d->history);
    d->history = eina_list_remove_list(d->history, d->history);
    d->history_start = e_notification_id_get(old) + 1;
    e_notification_unref(old);
  }

  {
    int timeout;

    timeout = e_notification_timeout_get(n);
    Timer_Data *td = calloc(1, sizeof(Timer_Data));
    td->d = d;
    e_notification_ref(n);
    td->n = n;
    ecore_timer_add(timeout == -1 ? d->default_timeout : (float)timeout / 1000, cb_note_close_timer, td);
  }

  printf("Received notification from %s:\n%s\n%s\n\n", 
    e_notification_app_name_get(n),
    e_notification_summary_get(n), e_notification_body_get(n)
  );
}
示例#30
0
void LayoutTestController::setWaitToDump(bool waitUntilDone)
{
    static const double timeoutSeconds = 30;

    m_waitToDump = waitUntilDone;
    if (m_waitToDump && !waitToDumpWatchdog)
        waitToDumpWatchdog = ecore_timer_add(timeoutSeconds, waitToDumpWatchdogFired, 0);
}