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


C++ ecore_x_sync函数代码示例

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


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

示例1: ecore_x_window_shape_input_rectangles_get

EAPI Ecore_X_Rectangle *
ecore_x_window_shape_input_rectangles_get(Ecore_X_Window win,
                                          int *num_ret)
{
   Ecore_X_Rectangle *rects = NULL;
#ifdef ShapeInput
   XRectangle *rect;
   int i, num = 0, ord;

   LOGFN(__FILE__, __LINE__, __FUNCTION__);
   rect = XShapeGetRectangles(_ecore_x_disp, win, ShapeInput, &num, &ord);
   if (_ecore_xlib_sync) ecore_x_sync();
   if (rect)
     {
        if (num < 1)
          {
             XFree(rect);
             if (num_ret) *num_ret = 0;
             return NULL;
          }
        rects = malloc(sizeof(Ecore_X_Rectangle) * num);
        if (!rects)
          {
             XFree(rect);
             if (num_ret) *num_ret = 0;
             return NULL;
          }
        for (i = 0; i < num; i++)
          {
             rects[i].x = rect[i].x;
             rects[i].y = rect[i].y;
             rects[i].width = rect[i].width;
             rects[i].height = rect[i].height;
          }
        XFree(rect);
     }
   if (num_ret) *num_ret = num;
   return rects;
#else
   // have to return fake shape input rect of size of window
   Window dw;
   unsigned int di;

   if (num_ret) *num_ret = 0;
   rects = malloc(sizeof(Ecore_X_Rectangle));
   if (!rects) return NULL;
   if (!XGetGeometry(_ecore_x_disp, win, &dw,
                     &(rects[0].x), &(rects[0].y),
                     &(rects[0].width), &(rects[0].height),
                     &di, &di))
     {
        if (_ecore_xlib_sync) ecore_x_sync();
        free(rects);
        return NULL;
     }
      if (_ecore_xlib_sync) ecore_x_sync();
   if (num_ret) *num_ret = 1;
   return rects;
#endif
}
开发者ID:RomainNaour,项目名称:efl,代码行数:60,代码来源:ecore_x_window_shape.c

示例2: ecore_x_icccm_icon_name_get

/**
 * Get a window icon name.
 * @param win The window
 * @return The windows icon name string
 *
 * Return the icon name of a window. String must be free'd when done with.
 */
EAPI char *
ecore_x_icccm_icon_name_get(Ecore_X_Window win)
{
   XTextProperty xprop;

   LOGFN(__FILE__, __LINE__, __FUNCTION__);
   xprop.value = NULL;
   if (XGetWMIconName(_ecore_x_disp, win, &xprop) >= Success)
     {
        if (_ecore_xlib_sync) ecore_x_sync();
        if (xprop.value)
          {
             char **list = NULL;
             char *t = NULL;
             int num = 0;
             int ret;

             if (xprop.encoding == ECORE_X_ATOM_UTF8_STRING)
               t = strdup((char *)xprop.value);
             else
               {
                  /* convert to utf8 */
#ifdef X_HAVE_UTF8_STRING
                  ret = Xutf8TextPropertyToTextList(_ecore_x_disp, &xprop,
                                                    &list, &num);
#else /* ifdef X_HAVE_UTF8_STRING */
                  ret = XmbTextPropertyToTextList(_ecore_x_disp, &xprop,
                                                  &list, &num);
#endif /* ifdef X_HAVE_UTF8_STRING */
                  if (_ecore_xlib_sync) ecore_x_sync();

                  if ((ret == XLocaleNotSupported) ||
                      (ret == XNoMemory) || (ret == XConverterNotFound))
                    t = strdup((char *)xprop.value);
                  else if (ret >= Success)
                    {
                       if ((num >= 1) && (list))
                         t = strdup(list[0]);

                       if (list)
                         XFreeStringList(list);
                    }
               }

             if (xprop.value)
               XFree(xprop.value);

             return t;
          }
     }
   else
     {
        if (_ecore_xlib_sync) ecore_x_sync();
     }

   return NULL;
}
开发者ID:jigpu,项目名称:efl,代码行数:64,代码来源:ecore_x_icccm.c

示例3: ecore_x_window_shape_input_rectangle_clip

EAPI void
ecore_x_window_shape_input_rectangle_clip(Ecore_X_Window win,
                                          int x,
                                          int y,
                                          int w,
                                          int h)
{
#ifdef ShapeInput
   XRectangle rect;

   LOGFN(__FILE__, __LINE__, __FUNCTION__);
   rect.x = x;
   rect.y = y;
   rect.width = w;
   rect.height = h;
   XShapeCombineRectangles(_ecore_x_disp,
                           win,
                           ShapeInput,
                           0,
                           0,
                           &rect,
                           1,
                           ShapeIntersect,
                           Unsorted);
   if (_ecore_xlib_sync) ecore_x_sync();
#else
   return;
   win = x = y = w = h = 0;
#endif
}
开发者ID:RomainNaour,项目名称:efl,代码行数:30,代码来源:ecore_x_window_shape.c

示例4: ecore_x_input_raw_select

EAPI Eina_Bool
ecore_x_input_raw_select(Ecore_X_Window win)
{
#ifdef ECORE_XI2
   XIEventMask emask;
   unsigned char mask[4] = { 0 };

   if (!_ecore_x_xi2_devs)
     return EINA_FALSE;

   LOGFN(__FILE__, __LINE__, __FUNCTION__);
   emask.deviceid = XIAllMasterDevices;
   emask.mask_len = sizeof(mask);
   emask.mask = mask;
#ifdef XI_RawButtonPress
   XISetMask(emask.mask, XI_RawButtonPress);
#endif
#ifdef XI_RawButtonRelease
   XISetMask(emask.mask, XI_RawButtonRelease);
#endif
#ifdef XI_RawMotion
   XISetMask(emask.mask, XI_RawMotion);
#endif

   XISelectEvents(_ecore_x_disp, win, &emask, 1);
   if (_ecore_xlib_sync) ecore_x_sync();

   return EINA_TRUE;
#else
   return EINA_FALSE;
#endif
}
开发者ID:caivega,项目名称:efl-1,代码行数:32,代码来源:ecore_x_xi2.c

示例5: ecore_x_window_shape_rectangles_add

EAPI void
ecore_x_window_shape_rectangles_add(Ecore_X_Window win,
                                    Ecore_X_Rectangle *rects,
                                    int num)
{
   XRectangle *rect = NULL;
   int i;

   LOGFN(__FILE__, __LINE__, __FUNCTION__);
   if (num > 0)
     {
        rect = malloc(sizeof(XRectangle) * num);
        if (!rect) return;
        for (i = 0; i < num; i++)
          {
             rect[i].x = rects[i].x;
             rect[i].y = rects[i].y;
             rect[i].width = rects[i].width;
             rect[i].height = rects[i].height;
          }
     }

   XShapeCombineRectangles(_ecore_x_disp,
                           win,
                           ShapeBounding,
                           0,
                           0,
                           rect,
                           num,
                           ShapeUnion,
                           Unsorted);
   if (_ecore_xlib_sync) ecore_x_sync();
   if (rect) free(rect);
}
开发者ID:RomainNaour,项目名称:efl,代码行数:34,代码来源:ecore_x_window_shape.c

示例6: ecore_x_window_prop_xid_set

/*
 * Set X ID (array) property
 */
EAPI void
ecore_x_window_prop_xid_set(Ecore_X_Window win,
                            Ecore_X_Atom atom,
                            Ecore_X_Atom type,
                            Ecore_X_ID *lst,
                            unsigned int num)
{
#if SIZEOF_INT == SIZEOF_LONG
   XChangeProperty(_ecore_x_disp, win, atom, type, 32, PropModeReplace,
                   (unsigned char *)lst, num);
#else /* if SIZEOF_INT == SIZEOF_LONG */
   unsigned long *pl;
   unsigned int i;

   LOGFN(__FILE__, __LINE__, __FUNCTION__);
   pl = malloc(num * sizeof(unsigned long));
   if (!pl)
     return;

   for (i = 0; i < num; i++)
     pl[i] = lst[i];
   XChangeProperty(_ecore_x_disp, win, atom, type, 32, PropModeReplace,
                   (unsigned char *)pl, num);
   free(pl);
#endif /* if SIZEOF_INT == SIZEOF_LONG */
   if (_ecore_xlib_sync) ecore_x_sync();
}
开发者ID:RomainNaour,项目名称:efl,代码行数:30,代码来源:ecore_x_window_prop.c

示例7: ecore_x_icccm_name_class_get

/**
 * Get a window name & class.
 * @param win The window
 * @param n The name string
 * @param c The class string
 *
 * Get a window name * class
 */
EAPI void
ecore_x_icccm_name_class_get(Ecore_X_Window win,
                             char **n,
                             char **c)
{
   XClassHint xch;

   LOGFN(__FILE__, __LINE__, __FUNCTION__);
   if (n)
     *n = NULL;

   if (c)
     *c = NULL;

   xch.res_name = NULL;
   xch.res_class = NULL;
   if (XGetClassHint(_ecore_x_disp, win, &xch))
     {
        if (n)
          if (xch.res_name)
            *n = strdup(xch.res_name);

        if (c)
          if (xch.res_class)
            *c = strdup(xch.res_class);

        XFree(xch.res_name);
        XFree(xch.res_class);
     }
   if (_ecore_xlib_sync) ecore_x_sync();
}
开发者ID:jigpu,项目名称:efl,代码行数:39,代码来源:ecore_x_icccm.c

示例8: ecore_x_icccm_state_get

EAPI Ecore_X_Window_State_Hint
ecore_x_icccm_state_get(Ecore_X_Window win)
{
   unsigned char *prop_ret = NULL;
   Atom type_ret;
   unsigned long bytes_after, num_ret;
   int format_ret;
   Ecore_X_Window_State_Hint hint;

   LOGFN(__FILE__, __LINE__, __FUNCTION__);
   hint = ECORE_X_WINDOW_STATE_HINT_NONE;
   XGetWindowProperty(_ecore_x_disp, win, ECORE_X_ATOM_WM_STATE,
                      0, 0x7fffffff, False, ECORE_X_ATOM_WM_STATE,
                      &type_ret, &format_ret, &num_ret, &bytes_after,
                      &prop_ret);
   if (_ecore_xlib_sync) ecore_x_sync();
   if ((prop_ret) && (num_ret == 2))
     {
        if (prop_ret[0] == WithdrawnState)
          hint = ECORE_X_WINDOW_STATE_HINT_WITHDRAWN;
        else if (prop_ret[0] == NormalState)
          hint = ECORE_X_WINDOW_STATE_HINT_NORMAL;
        else if (prop_ret[0] == IconicState)
          hint = ECORE_X_WINDOW_STATE_HINT_ICONIC;
     }

   if (prop_ret)
     XFree(prop_ret);

   return hint;
}
开发者ID:jigpu,项目名称:efl,代码行数:31,代码来源:ecore_x_icccm.c

示例9: ecore_x_window_prop_list

EAPI Ecore_X_Atom *
ecore_x_window_prop_list(Ecore_X_Window win,
                         int *num_ret)
{
   Ecore_X_Atom *atoms;
   Atom *atom_ret;
   int num = 0, i;

   LOGFN(__FILE__, __LINE__, __FUNCTION__);
   if (num_ret)
     *num_ret = 0;

   atom_ret = XListProperties(_ecore_x_disp, win, &num);
   if (_ecore_xlib_sync) ecore_x_sync();
   if (!atom_ret)
     return NULL;

   atoms = malloc(num * sizeof(Ecore_X_Atom));
   if (atoms)
     {
        for (i = 0; i < num; i++)
          atoms[i] = atom_ret[i];
        if (num_ret)
          *num_ret = num;
     }

   XFree(atom_ret);
   return atoms;
}
开发者ID:RomainNaour,项目名称:efl,代码行数:29,代码来源:ecore_x_window_prop.c

示例10: ecore_x_window_prop_protocol_isset

EAPI Eina_Bool
ecore_x_window_prop_protocol_isset(Ecore_X_Window win,
                                   Ecore_X_WM_Protocol protocol)
{
   Atom proto, *protos = NULL;
   int i, protos_count = 0;
   Eina_Bool ret = EINA_FALSE;

   /* check for invalid values */
   if (protocol >= ECORE_X_WM_PROTOCOL_NUM)
     return EINA_FALSE;

   LOGFN(__FILE__, __LINE__, __FUNCTION__);
   proto = _ecore_x_atoms_wm_protocols[protocol];

   ret = XGetWMProtocols(_ecore_x_disp, win, &protos, &protos_count);
   if (_ecore_xlib_sync) ecore_x_sync();
   if (!ret)
     return ret;

   for (i = 0; i < protos_count; i++)
     if (protos[i] == proto)
       {
          ret = EINA_TRUE;
          break;
       }

   XFree(protos);
   return ret;
}
开发者ID:RomainNaour,项目名称:efl,代码行数:30,代码来源:ecore_x_window_prop.c

示例11: ecore_x_icccm_iconic_request_send

EAPI void
ecore_x_icccm_iconic_request_send(Ecore_X_Window win,
                                  Ecore_X_Window root)
{
   XEvent xev;

   if (!win)
     return;

   LOGFN(__FILE__, __LINE__, __FUNCTION__);
   if (!root)
     root = DefaultRootWindow(_ecore_x_disp);

   xev.xclient.type = ClientMessage;
   xev.xclient.serial = 0;
   xev.xclient.send_event = True;
   xev.xclient.display = _ecore_x_disp;
   xev.xclient.window = win;
   xev.xclient.format = 32;
   xev.xclient.message_type = ECORE_X_ATOM_WM_CHANGE_STATE;
   xev.xclient.data.l[0] = IconicState;

   XSendEvent(_ecore_x_disp, root, False,
              SubstructureNotifyMask | SubstructureRedirectMask, &xev);
   if (_ecore_xlib_sync) ecore_x_sync();
}
开发者ID:jigpu,项目名称:efl,代码行数:26,代码来源:ecore_x_icccm.c

示例12: ecore_x_icccm_transient_for_unset

/**
 * Remove the transient_for setting from a window.
 * @param win The window
 */
EAPI void
ecore_x_icccm_transient_for_unset(Ecore_X_Window win)
{
   LOGFN(__FILE__, __LINE__, __FUNCTION__);
   XDeleteProperty(_ecore_x_disp, win, ECORE_X_ATOM_WM_TRANSIENT_FOR);
   if (_ecore_xlib_sync) ecore_x_sync();
}
开发者ID:jigpu,项目名称:efl,代码行数:11,代码来源:ecore_x_icccm.c

示例13: ecore_x_window_shape_rectangle_clip

EAPI void
ecore_x_window_shape_rectangle_clip(Ecore_X_Window win,
                                    int x,
                                    int y,
                                    int w,
                                    int h)
{
   XRectangle rect;

   LOGFN(__FILE__, __LINE__, __FUNCTION__);
   rect.x = x;
   rect.y = y;
   rect.width = w;
   rect.height = h;
   XShapeCombineRectangles(_ecore_x_disp,
                           win,
                           ShapeBounding,
                           0,
                           0,
                           &rect,
                           1,
                           ShapeIntersect,
                           Unsorted);
   if (_ecore_xlib_sync) ecore_x_sync();
}
开发者ID:RomainNaour,项目名称:efl,代码行数:25,代码来源:ecore_x_window_shape.c

示例14: ecore_x_icccm_transient_for_set

/**
 * Specify that a window is transient for another top-level window and should be handled accordingly.
 * @param win the transient window
 * @param forwin the toplevel window
 */
EAPI void
ecore_x_icccm_transient_for_set(Ecore_X_Window win,
                                Ecore_X_Window forwin)
{
   LOGFN(__FILE__, __LINE__, __FUNCTION__);
   XSetTransientForHint(_ecore_x_disp, win, forwin);
   if (_ecore_xlib_sync) ecore_x_sync();
}
开发者ID:jigpu,项目名称:efl,代码行数:13,代码来源:ecore_x_icccm.c

示例15: ecore_x_window_shape_mask_set

/**
 * Sets the shape of the given window to that given by the pixmap @p mask.
 * @param   win  The given window.
 * @param   mask A 2-bit depth pixmap that provides the new shape of the
 *               window.
 * @ingroup Ecore_X_Window_Shape
 */
EAPI void
ecore_x_window_shape_mask_set(Ecore_X_Window win,
                              Ecore_X_Pixmap mask)
{
   LOGFN(__FILE__, __LINE__, __FUNCTION__);
   XShapeCombineMask(_ecore_x_disp, win, ShapeBounding, 0, 0, mask, ShapeSet);
   if (_ecore_xlib_sync) ecore_x_sync();
}
开发者ID:RomainNaour,项目名称:efl,代码行数:15,代码来源:ecore_x_window_shape.c


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