sawfish r4242 - in trunk: . man src



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

Log:
src/keys.c, src/frames.c, src/windows.c, src/sawmill_subrs.h,
man/sawmill.texi: Added Negative-property-p by Teika kazura
NOTE: we also need window-remprop. window-plist and window-setplist



Modified:
   trunk/ChangeLog
   trunk/man/sawmill.texi
   trunk/src/frames.c
   trunk/src/keys.c
   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:02:51 2008
@@ -824,10 +824,14 @@
 properties not X properties.
 @end defun
 
- defun window-get window property
+ defun window-get window property &optional checker
 Return the window property named @var{property} (a symbol) associated
 with the window object @var{window}, or @code{nil} if no such property
 exists.  Note that these are Lisp properties not X properties.
+
+If the optional third argument @var{checker} is non-nil, then @var{checker}
+is returned if the requested property does not exist. This is used to
+distinguish the assigned value of @code{nil} from property's absence.
 @end defun
 
 @defun map-window-properties function window

Modified: trunk/src/frames.c
==============================================================================
--- trunk/src/frames.c	(original)
+++ trunk/src/frames.c	Mon Aug  4 13:02:51 2008
@@ -1179,7 +1179,7 @@
     tem = Fassq (Qremovable, fp->alist);
     if (tem && tem != Qnil && rep_CDR(tem) != Qnil)
     {
-	tem = Fwindow_get (rep_VAL(w), Qremoved_classes);	/* XXX hoist */
+       tem = Fwindow_get (rep_VAL(w), Qremoved_classes, Qnil);	/* XXX hoist */
 	if (tem && rep_CONSP(tem))
 	{
 	    tem = Fmemq (class, tem);
@@ -1464,7 +1464,7 @@
     /* bounding box of frame */
     int left_x, top_y, right_x, bottom_y;
 
-    tem = Fwindow_get (rep_VAL(w), Qhide_client);
+    tem = Fwindow_get (rep_VAL(w), Qhide_client, Qnil);
     if (tem && tem != Qnil)
 	w->client_hidden = 1;
     else

Modified: trunk/src/keys.c
==============================================================================
--- trunk/src/keys.c	(original)
+++ trunk/src/keys.c	Mon Aug  4 13:02:51 2008
@@ -477,7 +477,7 @@
 	    if (!k && current_window)
 	    {
 		/* 3. search focused/pointer window keymap property */
-		tem = Fwindow_get (rep_VAL(current_window), Qkeymap);
+	        tem = Fwindow_get (rep_VAL(current_window), Qkeymap, Qnil);
 		if (tem && tem != Qnil)
 		    k = search_keymap(tem, code, mods, callback);
 	    }
@@ -1778,7 +1778,7 @@
     {
 	if (!WINDOW_IS_GONE_P (w))
 	{
-	    repv tem = Fwindow_get (rep_VAL(w), Qkeymap);
+	    repv tem = Fwindow_get (rep_VAL(w), Qkeymap, Qnil);
 	    if (rep_SYMBOLP(tem) && tem != Qnil)
 		tem = Fsymbol_value (tem, Qt);
 	    if (km == global || tem == km)
@@ -1838,7 +1838,7 @@
     tem = Fsymbol_value (Qglobal_keymap, Qt);
     if (tem != Qnil && !rep_VOIDP(tem) && !WINDOW_IS_GONE_P (w))
 	grab_keymap_events (w->id, tem, grab);
-    tem = Fwindow_get (rep_VAL(w), Qkeymap);
+    tem = Fwindow_get (rep_VAL(w), Qkeymap, Qnil);
     if (tem && tem != Qnil && !WINDOW_IS_GONE_P (w))
 	grab_keymap_events (w->id, tem, grab);
 }

Modified: trunk/src/sawmill_subrs.h
==============================================================================
--- trunk/src/sawmill_subrs.h	(original)
+++ trunk/src/sawmill_subrs.h	Mon Aug  4 13:02:51 2008
@@ -318,7 +318,7 @@
 extern Lisp_Window *add_window (Window id);
 extern void remove_window (Lisp_Window *win, bool destroyed, bool from_error);
 extern void emit_pending_destroys (void);
-extern repv Fwindow_get (repv win, repv prop);
+extern repv Fwindow_get (repv win, repv prop, repv checker);
 extern void register_property_monitor (repv prop, void (*callback)
 				       (Lisp_Window *, repv, repv, repv));
 extern repv Fwindow_put (repv win, repv prop, repv value);

Modified: trunk/src/windows.c
==============================================================================
--- trunk/src/windows.c	(original)
+++ trunk/src/windows.c	Mon Aug  4 13:02:51 2008
@@ -536,7 +536,7 @@
 
 	if (!WINDOW_IS_GONE_P (w))
 	{
-	    repv tem = Fwindow_get (rep_VAL(w), Qplaced);
+           repv tem = Fwindow_get (rep_VAL(w), Qplaced, Qnil);
 	    if (initialising || (tem && tem == Qnil))
 	    {
 		/* ..then the place-window-hook.. */
@@ -639,13 +639,19 @@
 /* Lisp functions */
 
 DEFUN("window-get", Fwindow_get, Swindow_get,
-      (repv win, repv prop), rep_Subr2) /*
+      (repv win, repv prop, repv checker), rep_Subr3) /*
 ::doc:sawfish.wm.windows.subrs#window-get::
-window-get WINDOW PROPERTY
+window-get WINDOW PROPERTY &optional CHECKER
 
 Return the value of the property named PROPERTY (a symbol) of WINDOW.
 
 Note that these are Lisp properties not X properties.
+
+If the optional argument CHECKER is nil, then the return value is
+nil, either when the property value is nil, or the property is absent.
+
+If CHECKER is non-nil, than it returns CHECKER if the property
+is unset.
 ::end:: */
 {
     repv plist;
@@ -661,7 +667,7 @@
 	}
 	plist = rep_CDR(rep_CDR(plist));
     }
-    return Qnil;
+    return checker;
 }
 
 DEFUN("map-window-properties", Fmap_window_properties,
@@ -1292,7 +1298,7 @@
     rep_PUSHGC(gc_hook, hook);
     rep_PUSHGC(gc_args, args);
     rep_PUSHGC(gc_type, type);
-    tem = Fwindow_get (win, hook);
+    tem = Fwindow_get (win, hook, Qnil);
     if (tem && tem != Qnil)
     {
 	tem = Fcall_hook (tem, args, type);



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