Enlightenment CVS committal

Author  : raster
Project : e17
Module  : libs/ecore

Dir     : e17/libs/ecore/src/lib/ecore_x


Modified Files:
        Ecore_X.h ecore_x_netwm.c 


Log Message:


add in a types get - as u can have a list of them.

===================================================================
RCS file: /cvs/e/e17/libs/ecore/src/lib/ecore_x/Ecore_X.h,v
retrieving revision 1.195
retrieving revision 1.196
diff -u -3 -r1.195 -r1.196
--- Ecore_X.h   11 Jan 2008 07:33:57 -0000      1.195
+++ Ecore_X.h   7 Mar 2008 11:02:22 -0000       1.196
@@ -1448,6 +1448,7 @@
 EAPI void                ecore_x_netwm_window_type_get_prefetch(Ecore_X_Window 
window);
 EAPI void                ecore_x_netwm_window_type_get_fetch(void);
 EAPI int                 ecore_x_netwm_window_type_get(Ecore_X_Window win, 
Ecore_X_Window_Type *type);
+EAPI int                 ecore_x_netwm_window_types_get(Ecore_X_Window win, 
Ecore_X_Window_Type **types);
 EAPI int                 ecore_x_netwm_allowed_action_isset(Ecore_X_Window 
win, Ecore_X_Action action);
 EAPI void                ecore_x_netwm_allowed_action_set(Ecore_X_Window win, 
Ecore_X_Action *action, unsigned int num);
 EAPI void                
ecore_x_netwm_allowed_action_get_prefetch(Ecore_X_Window window);
===================================================================
RCS file: /cvs/e/e17/libs/ecore/src/lib/ecore_x/ecore_x_netwm.c,v
retrieving revision 1.60
retrieving revision 1.61
diff -u -3 -r1.60 -r1.61
--- ecore_x_netwm.c     6 Mar 2008 10:19:21 -0000       1.60
+++ ecore_x_netwm.c     7 Mar 2008 11:02:22 -0000       1.61
@@ -1000,40 +1000,41 @@
 ecore_x_netwm_window_type_get(Ecore_X_Window win, Ecore_X_Window_Type *type)
 {
    int                  num, i;
-   Ecore_X_Atom        *atoms;
+   Ecore_X_Atom        *atoms = NULL;
 
    if (type) *type = ECORE_X_WINDOW_TYPE_NORMAL;
 
-   num = ecore_x_window_prop_atom_list_get(win, 
ECORE_X_ATOM_NET_WM_WINDOW_TYPE,
+   num = ecore_x_window_prop_atom_list_get(win, 
+                                          ECORE_X_ATOM_NET_WM_WINDOW_TYPE,
                                           &atoms);
-   if (num < 0)
-     {
-       /* IMO this is not the place to mix netwm and icccm /kwo */
-       /* Check if WM_TRANSIENT_FOR is set */
-       if ((type) && (ecore_x_icccm_transient_for_get(win)))
-         *type = ECORE_X_WINDOW_TYPE_DIALOG;
-       return 1;
-     }
+   if ((type) && (num >= 1) && (atoms))
+     *type = _ecore_x_netwm_window_type_type_get(atoms[0]);
+
+   free(atoms);
+   if (num >= 1) return 1;
+   return 0;
+}
 
-   if (type)
+EAPI int
+ecore_x_netwm_window_types_get(Ecore_X_Window win, Ecore_X_Window_Type **types)
+{
+   int                  num, i;
+   Ecore_X_Atom        *atoms = NULL;
+
+   if (types) *types = NULL;
+   num = ecore_x_window_prop_atom_list_get(win,
+                                          ECORE_X_ATOM_NET_WM_WINDOW_TYPE,
+                                          &atoms);
+   if ((num <= 0) || (!atoms))
      {
-       *type = _ecore_x_netwm_window_type_type_get(atoms[0]);
-       if (num > 1)
-         {
-            // FIXME: mor than 1? what to do?
-         }
-/* disable - preferred type is the first - others are hints    
-       for (i = 0; i < num; ++i)
-         {
-            *type = _ecore_x_netwm_window_type_type_get(atoms[i]);
-            if (*type != ECORE_X_WINDOW_TYPE_UNKNOWN)
-              break;
-         }
- */
+       if (atoms) free(atoms);
+       return 0;
      }
-
-   free(atoms);
-   return 1;
+   for (i = 0; i < num; i++)
+     atoms[i] = _ecore_x_netwm_window_type_type_get(atoms[i]);
+   if (types) *types = atoms;
+   else free(atoms);
+   return num;
 }
 
 static Ecore_X_Atom



-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to