summaryrefslogtreecommitdiff
path: root/src/data.h
diff options
context:
space:
mode:
authorsabetts <sabetts>2001-02-23 10:12:14 +0000
committersabetts <sabetts>2001-02-23 10:12:14 +0000
commit65a47e5685546d2810293f249d2fdd589239926f (patch)
tree8c5c7a84ae90325a1c50d91280285a898c09e909 /src/data.h
parent4a1fbcfa9fd7bb43e9b387ca271a37e9bed03adb (diff)
downloadratpoison-65a47e5685546d2810293f249d2fdd589239926f.zip
* main.c (main): passes return value of find_window_other() to
set_active_window(). * list.h (remove_from_window_list): removed prototype (find_window_in_list): new prototype (append_to_list): likewise (insert_into_list): likewise (remove_from_list): likewise * list.c: propogated use of rp_unmapped_window_sentinel and rp_mapped_window_sentinel. (find_window_in_list): new function (find_window): calls find_window_in_list to search mapped and unmapped window lists. (remove_from_window_list): removed function (init_window_list): initialized sentinels (find_window_prev): searches only the mapped window list. (find_window_next): likewise (find_window_other): likewise (append_to_list): new function (insert_into_list): new function (remove_from_list): new function * events.c (unmap_notify): Searches only the mapped window list. moves the window from the unmapped window list to the mapped window list. * data.h: removed rp_window_head and rp_window_tail, updated dependant files. Added rp_mapped_window_sentinel and rp_unmapped_window_sentinel globals. * bar.c (update_window_names): loops only through mapped window list.
Diffstat (limited to 'src/data.h')
-rw-r--r--src/data.h24
1 files changed, 22 insertions, 2 deletions
diff --git a/src/data.h b/src/data.h
index 9ba8419..e79ab41 100644
--- a/src/data.h
+++ b/src/data.h
@@ -84,8 +84,28 @@ struct rp_action
/* void (*func)(void *); */
};
-extern rp_window *rp_window_head, *rp_window_tail;
-extern rp_window *rp_current_window;
+/* These _sentinel pointers point to a special rp_window whose next
+ pointer points to the head of the list and whose prev pointer
+ points to the tail. This is done to simplify removing an element
+ from the list: since there are no head and tail global variable
+ pointers that need to be updated, functions that manipulate
+ elements in a list don't need to know what list they belong to. The
+ last element's next pointer points to the sentinel as does the
+ first element's prev pointer. An empty list is represented by the
+ sentinel's prev and next pointers pointing to itself. */
+
+/* A list of mapped windows. These windows show up in the window
+ list and have a number assigned to them. */
+extern rp_window *rp_mapped_window_sentinel;
+
+/* A list of unmapped windows. These windows do not have a number
+ assigned to them and are not visible/active. */
+extern rp_window *rp_unmapped_window_sentinel;
+
+/* Pointer to the currently focused window. Points to an element in
+ the mapped window list. NULL if there are no mapped windows. */
+extern rp_window *rp_current_window;
+
extern screen_info *screens;
extern int num_screens;