sawfish r4243 - in trunk: . man src



Author: jkozicki
Date: Mon Aug  4 13:19:41 2008
New Revision: 4243
URL: http://svn.gnome.org/viewvc/sawfish?rev=4243&view=rev

Log:
Add Window prop list & prop del by Teika Kazura.



Modified:
   trunk/ChangeLog
   trunk/man/sawmill.texi
   trunk/src/sawmill_subrs.h
   trunk/src/windows.c

Modified: trunk/man/sawmill.texi
==============================================================================
--- trunk/man/sawmill.texi	(original)
+++ trunk/man/sawmill.texi	Mon Aug  4 13:19:41 2008
@@ -841,6 +841,22 @@
 @code{map-window-properties} returns @code{nil} immediately.
 @end defun
 
+ defun window-plist window
+Returns the property list of the window @var{window} which is of the form
+ code{(prop value prop value ...)}. 
+
+The returned list is ``copied once'', i.e., its structure is copied,
+but elements other than symbol, lists for example, are the original ones.
+Do NOT modify them to change the property value. Use @code{window-put}
+instead.
+ end defun
+
+ defun window-prop-del window property
+Delete @var{property} of @var{window}. Returs @code{t} for success,
+otherwise @code{nil}.
+
+Do NOT delete keymap with this function. Use @code{window-put} instead.
+ end defun
 
 @node Window Types, Window Attributes, Window Property Lists, Windows
 @section Window Types

Modified: trunk/src/sawmill_subrs.h
==============================================================================
--- trunk/src/sawmill_subrs.h	(original)
+++ trunk/src/sawmill_subrs.h	Mon Aug  4 13:19:41 2008
@@ -322,6 +322,8 @@
 extern void register_property_monitor (repv prop, void (*callback)
 				       (Lisp_Window *, repv, repv, repv));
 extern repv Fwindow_put (repv win, repv prop, repv value);
+extern repv Fwindow_prop_del (repv win, repv prop);
+extern repv Fwindow_plist (repv win);
 extern repv Fwindow_name (repv win);
 extern repv Fwindow_full_name (repv win);
 extern repv Fwindow_icon_name (repv win);

Modified: trunk/src/windows.c
==============================================================================
--- trunk/src/windows.c	(original)
+++ trunk/src/windows.c	Mon Aug  4 13:19:41 2008
@@ -80,6 +80,7 @@
 
 static repv gravity_map[StaticGravity+1];
 
+// In sawfish-1.3.3, the only callback used is keymap_prop_change. 
 struct prop_handler {
     struct prop_handler *next;
     repv prop;
@@ -744,6 +745,51 @@
     return val;
 }
 
+DEFUN("window-prop-del", Fwindow_prop_del, Swindow_prop_del,
+      (repv win, repv prop), rep_Subr2) /*
+::doc:sawfish.wm.windows.subrs#window-prop-del::
+window-put WINDOW PROPERTY
+
+Delete PROPERTY of WINDOW. Returs t for success, otherwise nil.
+
+Do NOT delete keymap with this function. Use `window-put' instead.
+::end:: */
+{
+    repv plist;
+    rep_DECLARE1(win, XWINDOWP);
+    plist = VWIN(win)->plist;
+    while (rep_CONSP(plist) && rep_CONSP(rep_CDR(plist)))
+    {
+	if (rep_CAR(plist) == prop
+	    || (!rep_SYMBOLP(prop)
+		&& rep_value_cmp (rep_CAR(plist), prop) == 0))
+	{
+            rep_CAR(plist) = rep_CADDR(plist);
+	    rep_CDR(plist) = rep_CDDDR(plist);
+	    return Qt;
+	}
+	plist = rep_CDDR(plist);
+    }
+    return Qnil;
+}
+
+DEFUN("window-plist", Fwindow_plist, Swindow_plist,
+      (repv win), rep_Subr1) /*
+::doc:sawfish.wm.windows.subrs#window-plist::
+window-plist WINDOW
+
+Returns the property list of the window window which is of the form
+(prop value prop value ...).
+
+The returned list is ``copied once'', i.e., its structure is copied,
+but elements other than atom, lists for example, are the original ones.
+Do NOT modify them to change the property value. Use window-put instead.
+::end:: */
+{
+    rep_DECLARE1(win, XWINDOWP);
+    return Fcopy_sequence (VWIN(win)->plist);
+}
+
 DEFUN("window-name", Fwindow_name, Swindow_name, (repv win), rep_Subr1) /*
 ::doc:sawfish.wm.windows.subrs#window-name::
 window-name WINDOW
@@ -1597,6 +1643,8 @@
     rep_ADD_SUBR(Swindow_get);
     rep_ADD_SUBR(Smap_window_properties);
     rep_ADD_SUBR(Swindow_put);
+    rep_ADD_SUBR(Swindow_prop_del);
+    rep_ADD_SUBR(Swindow_plist);
     rep_ADD_SUBR(Swindow_name);
     rep_ADD_SUBR(Swindow_full_name);
     rep_ADD_SUBR(Swindow_icon_name);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]