コード例 #1
0
/**
 * Retrieves the parent window a given window has. This uses the shadow window
 * tree.
 * @param   root The root window of @p win - if 0, this will be automatically determined with extra processing overhead
 * @param   win The window to get the parent window of
 * @return  The parent window of @p win
 * @ingroup Ecore_X_Window_Geometry_Group
 */
EAPI Ecore_X_Window
ecore_x_window_shadow_parent_get(Ecore_X_Window root EINA_UNUSED,
                                 Ecore_X_Window win)
{
   Shadow *s;
   int i = 0;

   if (!shadow_base)
     {
        _ecore_x_window_tree_shadow_populate();
        if (!shadow_base) return 0;
     }

   for (i = 0; i < shadow_num; i++)
     {
        if (!shadow_base[i]) continue;

        s = _ecore_x_window_shadow_tree_find_shadow(shadow_base[i], win);
        if (s)
          {
             if (!s->parent) return 0;
             return s->parent->win;
          }
     }
   return 0;
}
コード例 #2
0
/**
 * Retrieves the parent window a given window has. This uses the shadow window
 * tree.
 * @param   root The root window of @p win - if 0, this will be automatically determined with extra processing overhead
 * @param   win The window to get the parent window of
 * @return  The parent window of @p win
 * @ingroup Ecore_X_Window_Geometry_Group
 */
EAPI Ecore_X_Window
ecore_x_window_shadow_parent_get(Ecore_X_Window root __UNUSED__,
                                 Ecore_X_Window win)
{
   Shadow *s;
   int i;

   LOGFN(__FILE__, __LINE__, __FUNCTION__);
   if (!shadow_base)
     {
        _ecore_x_window_tree_shadow_populate();
        if (!shadow_base)
          return 0;
     }

   for (i = 0; i < shadow_num; i++)
     {
        if (!shadow_base[i])
          continue;

        s = _ecore_x_window_shadow_tree_find_shadow(shadow_base[i], win);
        if (s)
          {
             if (!s->parent)
               return 0;

             return s->parent->win;
          }
     }
   return 0;
} /* ecore_x_window_shadow_parent_get */
コード例 #3
0
Shadow *
_ecore_x_window_shadow_tree_find(Ecore_X_Window base)
{
   Shadow *s;
   int i = 0;

   for (i = 0; i < shadow_num; i++)
     {
        if (!shadow_base[i]) continue;

        if ((s =
               _ecore_x_window_shadow_tree_find_shadow(shadow_base[i], base)))
          return s;
     }
   return NULL;
}
コード例 #4
0
Shadow *
_ecore_x_window_shadow_tree_find_shadow(Shadow        *s,
                                        Ecore_X_Window win)
{
   Shadow *ss;
   int i = 0;

   if (s->win == win) return s;

   if (s->children)
     {
        for (i = 0; i < s->children_num; i++)
          {
             if (!s->children[i]) continue;

             if ((ss =
                    _ecore_x_window_shadow_tree_find_shadow(s->children[i], win)))
               return ss;
          }
     }

   return NULL;
}