Enlightenment CVS committal

Author  : xcomputerman
Project : e17
Module  : libs/ecore

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


Modified Files:
        Ecore_X.h ecore_x_icccm.c ecore_x_window_prop.c 


Log Message:
Add transient_for, window_role and client_leader hints

===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ecore/src/lib/ecore_x/Ecore_X.h,v
retrieving revision 1.78
retrieving revision 1.79
diff -u -3 -r1.78 -r1.79
--- Ecore_X.h   26 Nov 2004 07:28:51 -0000      1.78
+++ Ecore_X.h   26 Nov 2004 08:27:44 -0000      1.79
@@ -1020,6 +1020,21 @@
      ecore_x_icccm_colormap_window_set(Ecore_X_Window win, Ecore_X_Window 
subwin);
    EAPI void
      ecore_x_icccm_colormap_window_unset(Ecore_X_Window win, Ecore_X_Window 
subwin);
+   EAPI void
+     ecore_x_icccm_transient_for_set(Ecore_X_Window win, Ecore_X_Window 
forwin);
+   EAPI void
+     ecore_x_icccm_transient_for_unset(Ecore_X_Window win);
+   EAPI Ecore_X_Window
+     ecore_x_icccm_transient_for_get(Ecore_X_Window win);
+   EAPI void
+     ecore_x_icccm_window_role_set(Ecore_X_Window win, const char *role);
+   EAPI char *
+     ecore_x_icccm_window_role_get(Ecore_X_Window win);
+   EAPI void
+     ecore_x_icccm_client_leader_set(Ecore_X_Window win, Ecore_X_Window l);
+   EAPI Ecore_X_Window
+     ecore_x_icccm_client_leader_get(Ecore_X_Window win);
+
    
    typedef enum _Ecore_X_MWM_Hint_Func
      {
===================================================================
RCS file: 
/cvsroot/enlightenment/e17/libs/ecore/src/lib/ecore_x/ecore_x_icccm.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -3 -r1.9 -r1.10
--- ecore_x_icccm.c     26 Nov 2004 07:28:51 -0000      1.9
+++ ecore_x_icccm.c     26 Nov 2004 08:27:45 -0000      1.10
@@ -739,11 +739,105 @@
    XFree(old_data);
 }
 
+/**
+ * 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
+ */
+void
+ecore_x_icccm_transient_for_set(Ecore_X_Window win, Ecore_X_Window forwin)
+{
+   XSetTransientForHint(_ecore_x_disp, win, forwin);
+}
+
+/**
+ * Remove the transient_for setting from a window.
+ * @param The window
+ */
+void
+ecore_x_icccm_transient_for_unset(Ecore_X_Window win)
+{
+   XDeleteProperty(_ecore_x_disp, win, _ecore_x_atom_wm_transient_for);
+}
+
+/**
+ * Get the window this window is transient for, if any.
+ * @param win The window to check
+ * @return The window ID of the top-level window, or 0 if the property does 
not exist.
+ */
+Ecore_X_Window
+ecore_x_icccm_transient_for_get(Ecore_X_Window win)
+{
+   Ecore_X_Window forwin;
+
+   if(XGetTransientForHint(_ecore_x_disp, win, &forwin))
+      return forwin;
+   else
+      return 0;
+   
+}
+
+/**
+ * Set the window role hint.
+ * @param win The window
+ * @param role The role string
+ */
+void
+ecore_x_icccm_window_role_set(Ecore_X_Window win, const char *role)
+{
+   ecore_x_window_prop_string_set(win, _ecore_x_atom_wm_window_role,
+                                  (char *)role);
+}
+
+/**
+ * Get the window role.
+ * @param win The window
+ * @return The window's role string.
+ */
+char *
+ecore_x_icccm_window_role_get(Ecore_X_Window win)
+{
+   return ecore_x_window_prop_string_get(win,
+                                         _ecore_x_atom_wm_window_role);
+}
+
+/**
+ * Set the window's client leader.
+ * @param win The window
+ * @param l The client leader window
+ *
+ * All non-transient top-level windows created by an app other than
+ * the main window must have this property set to the app's main window.
+ */
+void
+ecore_x_icccm_client_leader_set(Ecore_X_Window win, Ecore_X_Window l)
+{
+   ecore_x_window_prop_property_set(win,
+                                    _ecore_x_atom_wm_client_leader,
+                                    XA_WINDOW, 32, &l, 1);
+}
+
+/**
+ * Get the window's client leader.
+ * @param win The window
+ * @return The window's client leader window, or 0 if unset */
+Ecore_X_Window
+ecore_x_icccm_client_leader_get(Ecore_X_Window win)
+{
+   unsigned char  *data;
+   int             num;
+   
+   if(ecore_x_window_prop_property_get(win,
+                                       _ecore_x_atom_wm_client_leader,
+                                       XA_WINDOW, 32, &data, &num))
+      return (Ecore_X_Window)*data;
+   else
+      return 0;
+}
+
+
  
 /* FIXME: move these things in here as they are icccm related */
-/* get/set window role */
-/* get/set client leader */
-/* get/set transient for */
 /* send iconify request */
 
 /* FIXME: there are older E hints, gnome hints and mwm hints and new netwm */
===================================================================
RCS file: 
/cvsroot/enlightenment/e17/libs/ecore/src/lib/ecore_x/ecore_x_window_prop.c,v
retrieving revision 1.55
retrieving revision 1.56
diff -u -3 -r1.55 -r1.56
--- ecore_x_window_prop.c       26 Nov 2004 07:28:51 -0000      1.55
+++ ecore_x_window_prop.c       26 Nov 2004 08:27:45 -0000      1.56
@@ -324,7 +324,8 @@
  * @param t The icon name string
  * 
  * Set a window icon name
- * DEPRECATED. Please use ecore_x_icccm_icon_name_set() instead.
+ * DEPRECATED. Please use ecore_x_icccm_icon_name_set() instead,
+ * and ecore_x_netwm_icon_name_set() when it becomes available.
  */
 void
 ecore_x_window_prop_icon_name_set(Ecore_X_Window win, const char *t)




-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now. 
http://productguide.itmanagersjournal.com/
_______________________________________________
enlightenment-cvs mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to