当前位置: 首页>>代码示例>>C++>>正文


C++ ecore_event_add函数代码示例

本文整理汇总了C++中ecore_event_add函数的典型用法代码示例。如果您正苦于以下问题:C++ ecore_event_add函数的具体用法?C++ ecore_event_add怎么用?C++ ecore_event_add使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了ecore_event_add函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: _ecore_win32_event_handle_button_release

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);
   }
}
开发者ID:Limsik,项目名称:e17,代码行数:60,代码来源:ecore_win32_event.c

示例2: esql_disconnect

/**
 * @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;
}
开发者ID:Limsik,项目名称:e17,代码行数:38,代码来源:esql_connect.c

示例3: _ecore_fb_li_device_event_syn

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);
	}
}
开发者ID:OpenInkpot-archive,项目名称:ecore,代码行数:34,代码来源:ecore_fb_li.c

示例4: _ecore_fb_li_device_event_rel

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;
	}
}
开发者ID:OpenInkpot-archive,项目名称:ecore,代码行数:55,代码来源:ecore_fb_li.c

示例5: esql_reconnect_handler

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;
}
开发者ID:Limsik,项目名称:e17,代码行数:29,代码来源:esql_events.c

示例6: _wkb_config_value_changed_cb

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);
}
开发者ID:etrunko,项目名称:weekeyboard,代码行数:30,代码来源:wkb-ibus.c

示例7: _ecore_win32_event_handle_configure_notify

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);
}
开发者ID:Limsik,项目名称:e17,代码行数:30,代码来源:ecore_win32_event.c

示例8: e_backlight_level_set

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;
}
开发者ID:maikodaraine,项目名称:EnlightenmentUbuntu,代码行数:32,代码来源:e_backlight.c

示例9: shotgun_disconnect

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;
}
开发者ID:Limsik,项目名称:e17,代码行数:28,代码来源:shotgun.c

示例10: e_msg_send

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);
}
开发者ID:maikodaraine,项目名称:EnlightenmentUbuntu,代码行数:32,代码来源:e_msg.c

示例11: enna_mediaplayer_pause

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;
}
开发者ID:naguirre,项目名称:enna,代码行数:9,代码来源:mediaplayer_emotion.c

示例12: _e_ofono_system_name_owner_exit

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;
}
开发者ID:Limsik,项目名称:e17,代码行数:9,代码来源:e_ofono.c

示例13: con

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;
}
开发者ID:zmike,项目名称:enfeeble,代码行数:10,代码来源:enfeeble.c

示例14: _url_complete_idler_cb

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;
}
开发者ID:OpenInkpot-archive,项目名称:ecore,代码行数:11,代码来源:ecore_con_url.c

示例15: enna_mediaplayer_stop

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;
}
开发者ID:naguirre,项目名称:enna,代码行数:12,代码来源:mediaplayer_emotion.c


注:本文中的ecore_event_add函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。