Esempio n. 1
0
void
_ecore_win32_event_handle_button_release(Ecore_Win32_Callback_Data *msg,
                                         int                        button)
{
   Ecore_Win32_Window *window;

   INF("mouse button released");

   window = (void *)GetWindowLongPtr(msg->window, GWLP_USERDATA);

   {
      Ecore_Event_Mouse_Move *e;

      e = (Ecore_Event_Mouse_Move *)calloc(1, sizeof(Ecore_Event_Mouse_Move));
      if (!e) return;

      e->window = (Ecore_Window)window;
      e->event_window = e->window;
      e->x = GET_X_LPARAM(msg->data_param);
      e->y = GET_Y_LPARAM(msg->data_param);
      e->timestamp = msg->timestamp;

      _ecore_win32_event_last_time = e->timestamp;
      _ecore_win32_event_last_window = (Ecore_Win32_Window *)e->window;

      ecore_event_add(ECORE_EVENT_MOUSE_MOVE, e, NULL, NULL);
   }

   {
      Ecore_Event_Mouse_Button *e;

      e = (Ecore_Event_Mouse_Button *)calloc(1, sizeof(Ecore_Event_Mouse_Button));
      if (!e) return;

      e->window = (Ecore_Window)window;
      e->event_window = e->window;
      e->buttons = button;
      e->x = GET_X_LPARAM(msg->data_param);
      e->y = GET_Y_LPARAM(msg->data_param);
      e->timestamp = msg->timestamp;

      _ecore_win32_mouse_up_count++;

      if ((_ecore_win32_mouse_up_count >= 2) &&
          ((e->timestamp - _ecore_win32_mouse_down_last_time) <= (unsigned long)(1000 * _ecore_win32_double_click_time)) &&
          (e->window == (Ecore_Window)_ecore_win32_mouse_down_last_window))
        e->double_click = 1;

      if ((_ecore_win32_mouse_up_count >= 3) &&
          ((e->timestamp - _ecore_win32_mouse_down_last_last_time) <= (unsigned long)(2 * 1000 * _ecore_win32_double_click_time)) &&
          (e->window == (Ecore_Window)_ecore_win32_mouse_down_last_window) &&
          (e->window == (Ecore_Window)_ecore_win32_mouse_down_last_last_window))
        e->triple_click = 1;

      _ecore_win32_event_last_time = e->timestamp;
      _ecore_win32_event_last_window = (Ecore_Win32_Window *)e->window;

      ecore_event_add(ECORE_EVENT_MOUSE_BUTTON_UP, e, NULL, NULL);
   }
}
Esempio n. 2
0
/**
 * @brief Disconnect from the currently connected server
 * This function calls all necessary functions to cleanly disconnect from the server
 * previously connected to by @p e.
 * @note Disconnecting is immediate, but an ESQL_EVENT_DISCONNECT is still emitted.
 * @param e The #Esql object (NOT NULL)
 */
void
esql_disconnect(Esql *e)
{
   DBG("(e=%p)", e);
   EINA_SAFETY_ON_NULL_RETURN(e);
   if (e->pool)
     {
        esql_pool_disconnect((Esql_Pool *)e);
        return;
     }
   EINA_SAFETY_ON_NULL_RETURN(e->backend.db);

   e->backend.disconnect(e);
   if (e->fdh) ecore_main_fd_handler_del(e->fdh);
   e->fdh = NULL;
   if (e->connected)
     {
        if (e->pool_member)
          e->pool_struct->e_connected--;
        if ((!e->pool_member) || (!e->pool_struct->e_connected))
          {
             INFO("Disconnected");
             if (e->pool_member)
               ecore_event_add(ESQL_EVENT_DISCONNECT, e->pool_struct, (Ecore_End_Cb)esql_fake_free, NULL);
             else
               ecore_event_add(ESQL_EVENT_DISCONNECT, e, (Ecore_End_Cb)esql_fake_free, NULL);
             e->event_count++;
          }
     }
   e->connected = EINA_FALSE;
}
Esempio n. 3
0
static void
_ecore_fb_li_device_event_syn(Ecore_Fb_Input_Device *dev, struct input_event *iev)
{
	if(!dev->listen)
		return;

	if(dev->mouse.event == ECORE_FB_EVENT_MOUSE_MOVE)
	{
		Ecore_Fb_Event_Mouse_Move *ev;
		ev = calloc(1,sizeof(Ecore_Fb_Event_Mouse_Move));
		ev->x = dev->mouse.x;
		ev->y = dev->mouse.y;
		ev->dev = dev;
		ecore_event_add(ECORE_FB_EVENT_MOUSE_MOVE, ev, NULL, NULL);
	}
	else if(dev->mouse.event == ECORE_FB_EVENT_MOUSE_BUTTON_DOWN)
	{
		Ecore_Fb_Event_Mouse_Button_Down *ev;
		ev = calloc(1, sizeof(Ecore_Fb_Event_Mouse_Button_Down));
		ev->x = dev->mouse.x;
		ev->y = dev->mouse.y;
		ev->button = 1;
		ecore_event_add(ECORE_FB_EVENT_MOUSE_BUTTON_DOWN, ev, NULL, NULL);
	}
	else if(dev->mouse.event == ECORE_FB_EVENT_MOUSE_BUTTON_UP)
	{
		Ecore_Fb_Event_Mouse_Button_Up *ev;
		ev = calloc(1, sizeof(Ecore_Fb_Event_Mouse_Button_Up));
		ev->x = dev->mouse.x;
		ev->y = dev->mouse.y;
		ev->button = 1;
		ecore_event_add(ECORE_FB_EVENT_MOUSE_BUTTON_UP, ev, NULL, NULL);
	}
}
Esempio n. 4
0
static void
_ecore_fb_li_device_event_rel(Ecore_Fb_Input_Device *dev, struct input_event *iev)
{
	if(!dev->listen)
		return;
	/* dispatch the button events if they are queued */
	switch(iev->code)
	{
		case REL_X:
		case REL_Y:
		{
			Ecore_Fb_Event_Mouse_Move *ev;
			if(iev->code == REL_X)
			{
				dev->mouse.x += iev->value;
				if(dev->mouse.x > dev->mouse.w - 1)
					dev->mouse.x = dev->mouse.w;
				else if(dev->mouse.x < 0)
					dev->mouse.x = 0;
			}
			else
			{
				dev->mouse.y += iev->value;
				if(dev->mouse.y > dev->mouse.h - 1)
					dev->mouse.y = dev->mouse.h;
				else if(dev->mouse.y < 0)
					dev->mouse.y = 0;
			}
			ev = calloc(1,sizeof(Ecore_Fb_Event_Mouse_Move));
			ev->x = dev->mouse.x;
			ev->y = dev->mouse.y;
			ev->dev = dev;

			ecore_event_add(ECORE_FB_EVENT_MOUSE_MOVE,ev,NULL,NULL);
			break;
		}
		case REL_WHEEL:
		case REL_HWHEEL:
		{
			Ecore_Fb_Event_Mouse_Wheel *ev;
			ev = calloc(1, sizeof(Ecore_Fb_Event_Mouse_Wheel));

			ev->x = dev->mouse.x;
			ev->y = dev->mouse.y;
			if(iev->code == REL_HWHEEL)
				ev->direction = 1;
			ev->wheel = iev->value;
			ev->dev = dev;
			ecore_event_add(ECORE_FB_EVENT_MOUSE_WHEEL, ev, NULL, NULL);
			break;
		}
		default:
			break;
	}
}
Esempio n. 5
0
static void
_win_play_pause_toggle(Win *w)
{
   ecore_event_add(ENJOY_EVENT_PLAYER_STATUS_CHANGE, NULL, NULL, NULL);
   ecore_event_add(ENJOY_EVENT_PLAYER_CAPS_CHANGE, NULL, NULL, NULL);

   if (w->play.playing)
      elm_toolbar_item_state_set(w->action.play, w->action.pause);
   else
      elm_toolbar_item_state_unset(w->action.play);
}
Esempio n. 6
0
static void
_win_song_set(Win *w, Song *s)
{
   Edje_Message_Int mi;
   Song *previous;
   char str[32];

   w->play.position = 0.0;
   w->play.length = 0.0;
   previous = w->song;
   w->song = s;
   if (!s) goto end;

   if (s->trackno > 0)
     snprintf(str, sizeof(str), "%d", s->trackno);
   else
     str[0] = '\0';

   edje_object_part_text_set(w->edje, "ejy.text.trackno", str);
   edje_object_part_text_set(w->edje, "ejy.text.title", s->title);
   edje_object_part_text_set(w->edje, "ejy.text.album", s->album);
   edje_object_part_text_set(w->edje, "ejy.text.artist", s->artist);
   edje_object_part_text_set(w->edje, "ejy.text.genre", s->genre);

   mi.val = s->rating;
   edje_object_message_send(elm_layout_edje_get(w->nowplaying), EDJE_MESSAGE_INT, MSG_RATING, &mi);

   emotion_object_file_set(w->emotion, s->path);
   emotion_object_position_set(w->emotion, w->play.position);
   w->play.playing = EINA_TRUE;
   w->play.playing_last = EINA_FALSE;
   emotion_object_play_set(w->emotion, EINA_TRUE);
   emotion_object_audio_volume_set(w->emotion, w->play.volume);

end:
   if ((!w->play.playing) && (w->timer.play_eval))
     {
        ecore_timer_del(w->timer.play_eval);
        w->timer.play_eval = NULL;
     }
   else if ((w->play.playing) && (!w->timer.play_eval))
     w->timer.play_eval = ecore_timer_loop_add
       (0.1, _win_play_eval_timer, w);

   _win_nowplaying_update(w, previous);
   _win_play_eval(w);
   _win_toolbar_eval(w);

   ecore_event_add(ENJOY_EVENT_PLAYER_CAPS_CHANGE, NULL, NULL, NULL);
   ecore_event_add(ENJOY_EVENT_PLAYER_TRACK_CHANGE, NULL, NULL, NULL);
}
Esempio n. 7
0
Eina_Bool
esql_reconnect_handler(Esql *e)
{
   Esql *ev;
   int ret, fd;

   ev = e->pool_member ? (Esql *)e->pool_struct : e; /* use pool struct for events */
   e->reconnect_timer = NULL;
   ret = e->backend.connect(e);
   EINA_SAFETY_ON_NULL_GOTO(e->backend.db, error);
   if (ret == ECORE_FD_ERROR)
     {
        ERR("Connection error: %s", e->backend.error_get(e));
        goto error;
     }
   fd = e->backend.fd_get(e);
   if (fd != -1)
     {
        e->fdh = ecore_main_fd_handler_add(fd, ECORE_FD_READ | ECORE_FD_WRITE | ECORE_FD_ERROR, (Ecore_Fd_Cb)esql_connect_handler, e, NULL, NULL);
        ecore_main_fd_handler_active_set(e->fdh, ret);
        e->current = ESQL_CONNECT_TYPE_INIT;
        if (ev->database) esql_database_set(e, ev->database);
     }
   return EINA_FALSE;
error:
   ecore_event_add(ESQL_EVENT_DISCONNECT, ev, (Ecore_End_Cb)esql_fake_free, NULL);
   e->event_count++;
   return EINA_FALSE;
}
Esempio n. 8
0
static void
_win_toolbar_eval(Win *w)
{

    if ((w->play.shuffle) || (list_prev_exists(w->list)))
        elm_toolbar_item_disabled_set(w->action.prev, EINA_FALSE);
    else
        elm_toolbar_item_disabled_set(w->action.prev, EINA_TRUE);

    if ((w->play.shuffle) || (list_next_exists(w->list)))
        elm_toolbar_item_disabled_set(w->action.next, EINA_FALSE);
    else
        elm_toolbar_item_disabled_set(w->action.next, EINA_TRUE);

    if (w->song)
    {
        elm_toolbar_item_disabled_set(w->action.play, EINA_FALSE);
        elm_toolbar_item_disabled_set(w->action.nowplaying, EINA_FALSE);
    }
    else
    {
        elm_toolbar_item_disabled_set(w->action.play, EINA_TRUE);
        elm_toolbar_item_disabled_set(w->action.nowplaying, EINA_TRUE);
    }

    ecore_event_add(ENJOY_EVENT_PLAYER_CAPS_CHANGE, NULL, NULL, NULL);
}
Esempio n. 9
0
static void
_wkb_config_value_changed_cb(void *data, const Eldbus_Message *msg)
{
   const char *section, *name;
   Eldbus_Message_Iter *value;
   struct wkb_config_key *key;

   _check_message_errors(msg);

   if (!eldbus_message_arguments_get(msg, "ssv", &section, &name, &value))
     {
        ERR("Error reading message arguments");
        return;
     }

   INF("ValueChanged: section: '%s', name: '%s'", section, name);

   /* Emit general CONFIG_VALUE_CHANGED event */
   if (!(key = wkb_ibus_config_get_key(section, name)))
     {
        ERR("Config key '%s' or section '%s' not found", section, name);
        return;
     }

   ecore_event_add(WKB_IBUS_CONFIG_VALUE_CHANGED, key, _wkb_config_value_changed_end_cb, NULL);

   /* If theme changed, emit specific THEME_CHANGED event */
   if (strncmp(section, "weekeyboard", strlen("weekeyboard")) == 0 && strncmp(name, "theme", strlen("theme")) == 0)
      _wkb_config_theme_changed(key);
}
Esempio n. 10
0
void
_ecore_win32_event_handle_configure_notify(Ecore_Win32_Callback_Data *msg)
{
   WINDOWINFO                          wi;
   Ecore_Win32_Event_Window_Configure *e;
   WINDOWPOS                          *window_pos;

   INF("window configure notify");

   e = calloc(1, sizeof(Ecore_Win32_Event_Window_Configure));
   if (!e) return;

   window_pos = (WINDOWPOS *)msg->data_param;
   wi.cbSize = sizeof(WINDOWINFO);
   if (!GetWindowInfo(window_pos->hwnd, &wi))
     {
        free(e);
        return;
     }

   e->window = (void *)GetWindowLongPtr(msg->window, GWLP_USERDATA);
   e->abovewin = (void *)GetWindowLongPtr(window_pos->hwndInsertAfter, GWLP_USERDATA);
   e->x = wi.rcClient.left;
   e->y = wi.rcClient.top;
   e->width = wi.rcClient.right - wi.rcClient.left;
   e->height = wi.rcClient.bottom - wi.rcClient.top;
   e->timestamp = _ecore_win32_event_last_time;

   ecore_event_add(ECORE_WIN32_EVENT_WINDOW_CONFIGURE, e, NULL, NULL);
}
EAPI void
e_backlight_level_set(E_Zone *zone, double val, double tim)
{
   double bl_now;
   // zone == NULL == everything
   // set backlight associated with zone to val over period of tim
   // if tim == 0.0 - then do it instantnly, if time == -1 use some default
   // transition time
   if (val < 0.0) val = 0.0;
   else if (val > 1.0)
     val = 1.0;
   if ((fabs(val - e_bl_val) < DBL_EPSILON) && (!bl_anim)) return;
   if (!zone) zone = e_util_zone_current_get(e_manager_current_get());
   ecore_event_add(E_EVENT_BACKLIGHT_CHANGE, NULL, NULL, NULL);
   bl_now = e_bl_val;
   e_bl_val = val;
   if (fabs(tim) < DBL_EPSILON)
     {
        _e_backlight_set(zone, val);
        return;
     }
//   if (e_config->backlight.mode != E_BACKLIGHT_MODE_NORMAL) return;
   if (e_config->backlight.mode == E_BACKLIGHT_MODE_NORMAL)
     tim = 0.5;
   else
   if (tim < 0.0)
     tim = e_config->backlight.transition;

   E_FREE_FUNC(bl_anim, ecore_animator_del);
   bl_anim = ecore_animator_timeline_add(tim, _bl_anim, zone);
   bl_animval = bl_now;
}
Esempio n. 12
0
void
volume_add(char *vol)
{
   volumes = eina_list_append(volumes, strdup(vol));
   volume_index(vol);
   ecore_event_add(VOLUME_ADD, strdup(vol), NULL, NULL);
}
Esempio n. 13
0
File: shotgun.c Progetto: Limsik/e17
void
shotgun_disconnect(Shotgun_Auth *auth)
{
   if (!auth) return;
   if (auth->svr_name)
     ecore_event_add(SHOTGUN_EVENT_DISCONNECT, auth, shotgun_fake_free, NULL);
   if (auth->ev_add) ecore_event_handler_del(auth->ev_add);
   if (auth->ev_del) ecore_event_handler_del(auth->ev_del);
   if (auth->ev_data) ecore_event_handler_del(auth->ev_data);
   if (auth->ev_error) ecore_event_handler_del(auth->ev_error);
   if (auth->ev_upgrade) ecore_event_handler_del(auth->ev_upgrade);
   if (auth->ev_write) ecore_event_handler_del(auth->ev_write);
   if (auth->svr) ecore_con_server_del(auth->svr);
   if (auth->keepalive) ecore_timer_del(auth->keepalive);
   if (auth->et_ping) ecore_timer_del(auth->et_ping);
   if (auth->et_ping_timeout) ecore_timer_del(auth->et_ping_timeout);
   auth->keepalive = NULL;
   auth->ev_add = NULL;
   auth->ev_del = NULL;
   auth->ev_data = NULL;
   auth->ev_error = NULL;
   auth->ev_upgrade = NULL;
   auth->ev_write = NULL;
   auth->svr = NULL;
   auth->state = 0;
   memset(&auth->features, 0, sizeof(auth->features));
   auth->pending_ping = 0;
}
Esempio n. 14
0
EAPI void
e_msg_send(const char *name, const char *info, int val, E_Object *obj, void *msgdata, void (*afterfunc)(void *data, E_Object *obj, void *msgdata), void *afterdata)
{
   unsigned int size, pos, name_len, info_len;
   E_Msg_Event *ev;

   name_len = info_len = 0;
   size = sizeof(E_Msg_Event);
   if (name) name_len = strlen(name) + 1;
   if (info) info_len = strlen(info) + 1;
   ev = malloc(size + name_len + info_len);
   if (!ev) return;
   pos = size;
   if (name)
     {
        ev->name = ((char *)ev) + pos;
        pos += name_len;
        strcpy(ev->name, name);
     }
   if (info)
     {
        ev->info = ((char *)ev) + pos;
        strcpy(ev->info, info);
     }
   ev->val = val;
   ev->obj = obj;
   ev->msgdata = msgdata;
   ev->afterfunc = afterfunc;
   ev->afterdata = afterdata;
   if (ev->obj) e_object_ref(ev->obj);
   ecore_event_add(E_EVENT_MSG, ev, _e_msg_event_free, NULL);
}
Esempio n. 15
0
void
volume_deindex(char *vol)
{
   Eina_List *l;
   
   for (l = scans; l; l = l->next)
     {
	Scan *s;
	
	s = l->data;
	if (!strcmp(s->vol, vol))
	  {
	     free(s->vol);
	     if (s->timer)
	       {
		  ecore_event_add(VOLUME_SCAN_STOP, strdup(s->vol), NULL, NULL);
		  ecore_timer_del(s->timer);
	       }
	     while (s->items)
	       {
		  Volume_Item *vi;
		  
		  vi = s->items->data;
		  items = eina_list_remove(items, vi);
		  s->items = eina_list_remove_list(s->items, s->items);
		  if 
		    (!strcmp(vi->type, "video"))
		    video_count--;
		  else if
		    (!strcmp(vi->type, "audio"))
		    audio_count--;
		  else if 
		    (!strcmp(vi->type, "photo"))
		    photo_count--;
		  ecore_event_add(VOLUME_TYPE_DEL, strdup(vi->path), NULL, NULL);
 		  free(vi->path);
 		  free(vi->rpath);
		  free(vi->name);
		  if (vi->genre) eina_stringshare_del(vi->genre);
		  free(vi);
	       }
	     free(s);
	     scans = eina_list_remove_list(scans, l);
	     return;
	  }
     }
}
Esempio n. 16
0
int
enna_mediaplayer_pause(void)
{
    emotion_object_play_set(mp->player, EINA_FALSE);
    mp->play_state = PAUSE;
    ecore_event_add(ENNA_EVENT_MEDIAPLAYER_PAUSE, NULL, NULL, NULL);

    return 0;
}
Esempio n. 17
0
File: e_ofono.c Progetto: Limsik/e17
static void
_e_ofono_system_name_owner_exit(void)
{
   e_ofono_manager_clear_elements();
   ecore_event_add(E_OFONO_EVENT_MANAGER_OUT, NULL, NULL, NULL);

   free(unique_name);
   unique_name = NULL;
}
Esempio n. 18
0
static Eina_Bool
con(Enfeeble *enf, int type __UNUSED__, Ecore_Con_Event_Server_Add *ev)
{
   if ((enf != ecore_con_server_data_get(ev->server)) || (!enf))
     return ECORE_CALLBACK_PASS_ON;

   INF("Connected");
   ecore_event_add(ENFEEBLE_EVENT_CONNECT, enf, enfeeble_fake_free, NULL);
   return EINA_FALSE;
}
Esempio n. 19
0
static Eina_Bool
_url_complete_idler_cb(void *data)
{
   Ecore_Con_Url_Event *lev;

   lev = data;
   ecore_event_add(lev->type, lev->ev, _ecore_con_event_url_free, NULL);
   free(lev);

   return ECORE_CALLBACK_CANCEL;
}
Esempio n. 20
0
int
enna_mediaplayer_stop(void)
{
    emotion_object_play_set(mp->player, EINA_FALSE);
    emotion_object_position_set(mp->player, 0);
    mp->play_state = STOPPED;
    evas_object_hide(mp->player);
    evas_object_show(enna->layout);
    ecore_event_add(ENNA_EVENT_MEDIAPLAYER_STOP, NULL, NULL, NULL);

    return 0;
}
Esempio n. 21
0
EAPI void
e_init_done(void)
{
   undone--;
   if (undone > 0) return;
   done = 1;
   ecore_event_add(E_EVENT_INIT_DONE, NULL, NULL, NULL);
//   printf("---DONE %p\n", client);
   if (!client) return;
   ecore_ipc_client_send(client, E_IPC_DOMAIN_INIT, 2, 0, 0, 0, NULL, 0);
   ecore_ipc_client_flush(client);
}
Esempio n. 22
0
void
volume_del(char *vol)
{
   volume_deindex(vol);
   vol = volume_list_exists(volumes, vol);
   if (vol)
     {
	ecore_event_add(VOLUME_DEL, strdup(vol), NULL, NULL);
	volumes = eina_list_remove(volumes, vol);
	free(vol);
     }
}
Esempio n. 23
0
static size_t
_ecore_con_url_data_cb(void *buffer, size_t size, size_t nitems, void *userp)
{
   Ecore_Con_Url *url_con;
   Ecore_Con_Event_Url_Data *e;
   size_t real_size = size * nitems;

   url_con = (Ecore_Con_Url *)userp;

   if (!url_con) return -1;
   if (!ECORE_MAGIC_CHECK(url_con, ECORE_MAGIC_CON_URL))
     {
	ECORE_MAGIC_FAIL(url_con, ECORE_MAGIC_CON_URL, "ecore_con_url_data_cb");
	return -1;
     }

   url_con->received += real_size;

   if (url_con->write_fd < 0)
     {
	e = malloc(sizeof(Ecore_Con_Event_Url_Data) + sizeof(unsigned char) * (real_size - 1));
	if (e)
	  {
	     e->url_con = url_con;
	     e->size = real_size;
	     memcpy(e->data, buffer, real_size);
	     ecore_event_add(ECORE_CON_EVENT_URL_DATA, e,
			     _ecore_con_event_url_free, NULL);
	  }
     }
   else
     {
	ssize_t	count = 0;
	size_t total_size = real_size;
	size_t offset = 0;

	while (total_size > 0)
	  {
	     count = write(url_con->write_fd, (char*) buffer + offset, total_size);
	     if (count < 0)
	       {
		  if (errno != EAGAIN && errno != EINTR) return -1;
	       }
	     else
	       {
		  total_size -= count;
		  offset += count;
	       }
	  }
     }

   return real_size;
}
Esempio n. 24
0
int
enna_mediaplayer_play(Enna_Playlist *enna_playlist)
{
    mp->cur_playlist = enna_playlist;

    switch (mp->play_state)
    {
    case STOPPED:
    {
      Enna_File *item;
        item = eina_list_nth(enna_playlist->playlist,
                             enna_playlist->selected);
        emotion_object_play_set(mp->player, EINA_FALSE);
        if (item && item->uri)
            emotion_object_file_set(mp->player, item->mrl);
        emotion_object_play_set(mp->player, EINA_TRUE);
        if (item && item->type == ENNA_FILE_FILM)
        {
            evas_object_show(mp->player);
            evas_object_hide(enna->layout);
        }
        mp->play_state = PLAYING;
        ecore_event_add(ENNA_EVENT_MEDIAPLAYER_START, NULL, NULL, NULL);
        break;
    }
    case PLAYING:
        enna_mediaplayer_pause();
        break;
    case PAUSE:
        emotion_object_play_set(mp->player, EINA_TRUE);
        mp->play_state = PLAYING;
        ecore_event_add(ENNA_EVENT_MEDIAPLAYER_UNPAUSE,
                        NULL, NULL, NULL);
        break;
    default:
        break;
    }

    return 0;
}
Esempio n. 25
0
void
_ecore_win32_event_handle_leave_notify(Ecore_Win32_Callback_Data *msg)
{
  {
     Ecore_Event_Mouse_Move *e;

     INF("mouse out");

     e = (Ecore_Event_Mouse_Move *)calloc(1, sizeof(Ecore_Event_Mouse_Move));
     if (!e) return;

     e->window = (Ecore_Window)GetWindowLongPtr(msg->window, GWLP_USERDATA);
     e->event_window = e->window;
     e->x = msg->x;
     e->y = msg->y;
     e->timestamp = msg->timestamp;

     _ecore_win32_event_last_time = e->timestamp;
     _ecore_win32_event_last_window = (Ecore_Win32_Window *)e->window;

     ecore_event_add(ECORE_EVENT_MOUSE_MOVE, e, NULL, NULL);
  }

  {
     Ecore_Win32_Event_Mouse_Out *e;

     e = (Ecore_Win32_Event_Mouse_Out *)calloc(1, sizeof(Ecore_Win32_Event_Mouse_Out));
     if (!e) return;

     e->window = (void *)GetWindowLongPtr(msg->window, GWLP_USERDATA);
     e->x = msg->x;
     e->y = msg->y;
     e->timestamp = msg->timestamp;

     _ecore_win32_event_last_time = e->timestamp;

     ecore_event_add(ECORE_WIN32_EVENT_MOUSE_OUT, e, NULL, NULL);
  }
}
Esempio n. 26
0
static Eina_Bool
disc(Enfeeble *enf, int type __UNUSED__, Ecore_Con_Event_Server_Del *ev)
{
   if ((enf != ecore_con_server_data_get(ev->server)) || (!enf))
     return ECORE_CALLBACK_PASS_ON;

   INF("Disconnected");
   ecore_con_server_del(enf->svr);
   enf->svr = NULL;
   enf->ev_del = NULL;
   ecore_event_add(ENFEEBLE_EVENT_DISCONNECT, enf, enfeeble_fake_free, NULL);
   return EINA_FALSE;
}
Esempio n. 27
0
static void
_win_populate_job(void *data)
{
   Win *w = data;
   w->job.populate = NULL;

   if (w->db)
     {
        db_close(w->db);
        w->db = NULL;
     }

   if (access(w->db_path, F_OK|X_OK) == 0)
     w->db = db_open(w->db_path);

   if (!w->db)
     {
        char tmpdir[PATH_MAX];
        lms_t *lms = lms_new(w->db_path);
        if (!lms)
          goto no_lms;
        enjoy_lms_charsets_add(lms);
        if (!enjoy_lms_parsers_add(lms))
          goto no_parsers;

        snprintf(tmpdir, sizeof(tmpdir), "%s/tmpdir-nomusic",
                 enjoy_cache_dir_get());
        ecore_file_mkpath(tmpdir);
        if (lms_process_single_process(lms, tmpdir) != 0)
          CRITICAL("Failed to scan empty directory %s", tmpdir);
        ecore_file_rmdir(tmpdir);
        lms_free(lms);

        w->db = db_open(w->db_path);
        if (!w->db)
          goto no_lms;

        goto populate;

     no_parsers:
        CRITICAL("could not add any lightmediascanner parser!");
        lms_free(lms);
     no_lms:
        CRITICAL("could not create database at %s!", w->db_path);
        exit(-1);
     }

 populate:
   ecore_event_add(ENJOY_EVENT_DB_UNLOCKED, NULL, NULL, NULL);
   list_populate(w->list, w->db);
}
Esempio n. 28
0
static void
_eio_monitor_error(Eio_Monitor *monitor, int error)
{
   Eio_Monitor_Error *ev;

   ev = calloc(1, sizeof (Eio_Monitor_Error));
   if (!ev) return;

   ev->monitor = monitor;
   EINA_REFCOUNT_REF(ev->monitor);
   ev->error = error;

   ecore_event_add(EIO_MONITOR_ERROR, ev, _eio_monitor_error_cleanup_cb, NULL);
}
Esempio n. 29
0
static void
enna_mediaplayer_change(Enna_Playlist *enna_playlist, int type)
{
    Enna_File *item;

    item = eina_list_nth(enna_playlist->playlist, enna_playlist->selected);
    enna_log(ENNA_MSG_EVENT, NULL, "select %d", enna_playlist->selected);
    if (!item)
        return;

    enna_mediaplayer_stop();
    enna_mediaplayer_play(enna_playlist);
    ecore_event_add(type, NULL, NULL, NULL);
}
Esempio n. 30
0
static void
_device_found_callback(void *data, DBusMessage *msg)
{
   E_Bluez_Element *element = (E_Bluez_Element *)data;
   E_Bluez_Device_Found *device;
   DBusMessageIter itr;
   int t;
   char *name = NULL;
   void *value = NULL;

   DBG("Device found %s", element->path);

   if (!_dbus_callback_check_and_init(msg, &itr, NULL))
      return;

   device = calloc(sizeof(E_Bluez_Device_Found), 1);
   if (!device)
     {
        ERR("No memory to alocate E_Bluez_Device_Found");
        return;
     }

   t = dbus_message_iter_get_arg_type(&itr);
   if (!_dbus_iter_type_check(t, DBUS_TYPE_STRING))
     {
        ERR("missing device name in DeviceFound");
        return;
     }

   dbus_message_iter_get_basic(&itr, &name);

   dbus_message_iter_next(&itr);
   t = dbus_message_iter_get_arg_type(&itr);
   if (!_dbus_iter_type_check(t, DBUS_TYPE_ARRAY))
     {
        ERR("missing array in DeviceFound");
        return;
     }

   value = e_bluez_element_iter_get_array(&itr, name);

   if (!value)
      return;

   device->name = eina_stringshare_add(name);
   device->adapter = element;
   device->array = value;

   ecore_event_add(E_BLUEZ_EVENT_DEVICE_FOUND, device, NULL, NULL);
}