]> git.lizzy.rs Git - bspwm.git/blobdiff - tree.h
Don't confine the CYCLE_DIR descriptor
[bspwm.git] / tree.h
diff --git a/tree.h b/tree.h
index e6750d752502a6277688fd8d2416709ffef21d3a..8dff752e04139f0c45a2b0f692ceedc675604eb7 100644 (file)
--- a/tree.h
+++ b/tree.h
-#ifndef _TREE_H
-#define _TREE_H
+/* Copyright (c) 2012, Bastien Dejean
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice, this
+ *    list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this list of conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+ * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
 
-#define INC_EXP 0.9
-#define DEC_EXP 1.1
+#ifndef BSPWM_TREE_H
+#define BSPWM_TREE_H
 
-bool is_leaf(node_t *);
-bool is_tiled(client_t *);
-bool is_floating(client_t *);
-bool is_first_child(node_t *);
-bool is_second_child(node_t *);
-void change_split_ratio(node_t *, value_change_t);
-node_t *first_extrema(node_t *);
-node_t *second_extrema(node_t *);
-node_t *next_leaf(node_t *, node_t *);
-node_t *prev_leaf(node_t *, node_t *);
-node_t *find_fence(node_t *, direction_t);
-node_t *find_neighbor(node_t *, direction_t);
-void get_opposite(direction_t, direction_t*);
-node_t *nearest_neighbor(desktop_t *, node_t *, direction_t);
-int tiled_area(node_t *);
-node_t *find_biggest(desktop_t *);
-void move_fence(node_t *, direction_t, fence_move_t);
-void rotate_tree(node_t *, rotate_t);
-void rotate_brother(node_t *);
-void unrotate_tree(node_t *, rotate_t);
-void unrotate_brother(node_t *);
-void flip_tree(node_t *, flip_t);
-int balance_tree(node_t *);
-void arrange(monitor_t *, desktop_t *);
-void apply_layout(monitor_t *, desktop_t *, node_t *, xcb_rectangle_t, xcb_rectangle_t);
-void insert_node(monitor_t *, desktop_t *, node_t *);
-void pseudo_focus(desktop_t *, node_t *);
-void focus_node(monitor_t *, desktop_t *, node_t *);
-void update_current(void);
-void unlink_node(desktop_t *, node_t *);
-void remove_node(desktop_t *, node_t *);
-void destroy_tree(node_t *);
-void swap_nodes(node_t *, node_t *);
-void fit_monitor(monitor_t *, client_t *);
-void transfer_node(monitor_t *, desktop_t *, monitor_t *, desktop_t *, node_t *);
-void select_monitor(monitor_t *);
-void select_desktop(monitor_t *, desktop_t *);
-void cycle_monitor(cycle_dir_t);
-void cycle_desktop(monitor_t *, desktop_t *, cycle_dir_t, skip_desktop_t);
-void cycle_leaf(monitor_t *, desktop_t *, node_t *, cycle_dir_t, skip_client_t);
-void nearest_leaf(monitor_t *, desktop_t *, node_t *, nearest_arg_t, skip_client_t);
-void circulate_leaves(monitor_t *, desktop_t *, circulate_dir_t);
-void update_vacant_state(node_t *);
-void put_status(void);
-void list_history(char *);
-void list_monitors(list_option_t, char *);
-void list_desktops(monitor_t *, list_option_t, unsigned int, char *);
-void list(desktop_t *, node_t *, char *, unsigned int);
-void restore_layout(char *);
-void restore_history(char *);
+void arrange(monitor_t *m, desktop_t *d);
+void apply_layout(monitor_t *m, desktop_t *d, node_t *n, xcb_rectangle_t rect, xcb_rectangle_t root_rect);
+presel_t *make_presel(void);
+void set_ratio(node_t *n, double rat);
+void presel_dir(monitor_t *m, desktop_t *d, node_t *n, direction_t dir);
+void presel_ratio(monitor_t *m, desktop_t *d, node_t *n, double ratio);
+void cancel_presel(monitor_t *m, desktop_t *d, node_t *n);
+node_t *find_public(desktop_t *d);
+node_t *insert_node(monitor_t *m, desktop_t *d, node_t *n, node_t *f);
+void insert_receptacle(monitor_t *m, desktop_t *d, node_t *n);
+bool activate_node(monitor_t *m, desktop_t *d, node_t *n);
+void transfer_sticky_nodes(monitor_t *m, desktop_t *ds, desktop_t *dd, node_t *n);
+bool focus_node(monitor_t *m, desktop_t *d, node_t *n);
+void update_focused(void);
+void hide_node(node_t *n);
+void show_node(node_t *n);
+node_t *make_node(uint32_t id);
+client_t *make_client(void);
+void initialize_client(node_t *n);
+bool is_focusable(node_t *n);
+bool is_leaf(node_t *n);
+bool is_first_child(node_t *n);
+bool is_second_child(node_t *n);
+unsigned int clients_count_in(node_t *n);
+node_t *brother_tree(node_t *n);
+node_t *first_extrema(node_t *n);
+node_t *second_extrema(node_t *n);
+node_t *first_focusable_leaf(node_t *n);
+node_t *next_leaf(node_t *n, node_t *r);
+node_t *prev_leaf(node_t *n, node_t *r);
+node_t *next_tiled_leaf(node_t *n, node_t *r);
+node_t *prev_tiled_leaf(node_t *n, node_t *r);
+bool is_adjacent(node_t *a, node_t *b, direction_t dir);
+node_t *find_fence(node_t *n, direction_t dir);
+node_t *nearest_neighbor(monitor_t *m, desktop_t *d, node_t *n, direction_t dir, node_select_t sel);
+bool is_child(node_t *a, node_t *b);
+bool is_descendant(node_t *a, node_t *b);
+bool find_by_id(uint32_t id, coordinates_t *loc);
+node_t *find_by_id_in(node_t *r, uint32_t id);
+node_t *nearest_from_tree(monitor_t *m, desktop_t *d, node_t *n, direction_t dir, node_select_t sel);
+node_t *nearest_from_history(monitor_t *m, desktop_t *d, node_t *n, direction_t dir, node_select_t sel);
+node_t *nearest_from_distance(monitor_t *m, desktop_t *d, node_t *n, direction_t dir, node_select_t sel);
+void get_opposite(direction_t src, direction_t *dst);
+unsigned int node_area(desktop_t *d, node_t *n);
+int tiled_count(node_t *n);
+node_t *find_biggest(monitor_t *m, desktop_t *d, node_t *n, node_select_t sel);
+void rotate_tree(node_t *n, int deg);
+void rotate_brother(node_t *n);
+void unrotate_tree(node_t *n, int rot);
+void unrotate_brother(node_t *n);
+void flip_tree(node_t *n, flip_t flp);
+void equalize_tree(node_t *n);
+int balance_tree(node_t *n);
+void unlink_node(monitor_t *m, desktop_t *d, node_t *n);
+void close_node(node_t *n);
+void kill_node(monitor_t *m, desktop_t *d, node_t *n);
+void remove_node(monitor_t *m, desktop_t *d, node_t *n);
+void destroy_tree(monitor_t *m, desktop_t *d, node_t *n);
+bool swap_nodes(monitor_t *m1, desktop_t *d1, node_t *n1, monitor_t *m2, desktop_t *d2, node_t *n2);
+bool transfer_node(monitor_t *ms, desktop_t *ds, node_t *ns, monitor_t *md, desktop_t *dd, node_t *nd);
+bool find_closest_node(coordinates_t *ref, coordinates_t *dst, cycle_dir_t dir, node_select_t sel);
+void circulate_leaves(monitor_t *m, desktop_t *d, node_t *n, circulate_dir_t dir);
+void set_vacant(monitor_t *m, desktop_t *d, node_t *n, bool value);
+void set_vacant_local(monitor_t *m, desktop_t *d, node_t *n, bool value);
+void propagate_vacant_downward(monitor_t *m, desktop_t *d, node_t *n, bool value);
+void propagate_vacant_upward(monitor_t *m, desktop_t *d, node_t *n);
+bool set_layer(monitor_t *m, desktop_t *d, node_t *n, stack_layer_t l);
+bool set_state(monitor_t *m, desktop_t *d, node_t *n, client_state_t s);
+void set_floating(monitor_t *m, desktop_t *d, node_t *n, bool value);
+void set_fullscreen(monitor_t *m, desktop_t *d, node_t *n, bool value);
+void neutralize_occluding_windows(monitor_t *m, desktop_t *d, node_t *n);
+void propagate_flags_upward(monitor_t *m, desktop_t *d, node_t *n);
+void set_hidden(monitor_t *m, desktop_t *d, node_t *n, bool value);
+void set_hidden_local(monitor_t *m, desktop_t *d, node_t *n, bool value);
+void propagate_hidden_downward(monitor_t *m, desktop_t *d, node_t *n, bool value);
+void propagate_hidden_upward(monitor_t *m, desktop_t *d, node_t *n);
+void set_sticky(monitor_t *m, desktop_t *d, node_t *n, bool value);
+void set_private(monitor_t *m, desktop_t *d, node_t *n, bool value);
+void set_locked(monitor_t *m, desktop_t *d, node_t *n, bool value);
+void set_urgent(monitor_t *m, desktop_t *d, node_t *n, bool value);
+bool contains(xcb_rectangle_t a, xcb_rectangle_t b);
+xcb_rectangle_t get_rectangle(desktop_t *d, node_t *n);
+void get_side_handle(desktop_t *d, node_t *n, direction_t dir, xcb_point_t *pt);
+void listen_enter_notify(node_t *n, bool enable);
+
+unsigned int sticky_count(node_t *n);
+unsigned int private_count(node_t *n);
+unsigned int locked_count(node_t *n);
 
 #endif