summaryrefslogtreecommitdiff
path: root/src/data.h
diff options
context:
space:
mode:
authorsabetts <sabetts>2001-09-09 02:59:23 +0000
committersabetts <sabetts>2001-09-09 02:59:23 +0000
commit1bd2211aa5c392d9873c74ffc998bea744007a29 (patch)
treeb695cac6f169042430a4d7c1a9cc0ac9bda63304 /src/data.h
parent52cd2d7d10d543fe989e3cde617faf7453dcc494 (diff)
downloadratpoison-1bd2211aa5c392d9873c74ffc998bea744007a29.zip
* src/list.h (update_window_position): new prototype
(window_name): new prototype (get_window_list): update prototype * src/events.c (grab_rat): Don't wrap in an #ifdef (ungrab_rat): likewise (handle_key): record if the rat is grabbed and only ungrab it at the end if it was first grabbed. * src/actions.h (cmd_pos): new prototype (cmd_defwinpos): new prototype (cmd_deftranspos): new prototype (cmd_defmaxsizepos): new prototype (cmd_defbartimeout): new prototype (cmd_defbarloc): new prototype (cmd_deffont): new prototype (cmd_defpadding): new prototype (cmd_defborder): new prototype (cmd_definputwidth): new prototype (cmd_defwaitcursor): new prototype (cmd_defwinfmt): new prototype (cmd_defwinname): new prototype * src/messages.h (MESSAGE_FRAME_STRING): new message * src/manage.c (get_wmname): renamed from get_window_name (get_class_hints): new function (get_res_name): likewise (get_res_class): likewise (update_window_name): update the window's wm_name, res_name, and res_class fields. (update_window_name): calls functions get_wmname, get_res_name, get_res_class. (update_window_name): Don't crop the window name. (update_window_information): call update_window_position. (move_window): new function (maximize_transient): only set the window's width and height fields. (maximize_normal): likewise (maximize): call move_window (force_maximize): likewise (force_maximize): if the window has resize hints, resize it 1 resize unit. * src/main.c: new global variable, defaults. remove static variable, font, and move to defaults. Dependant code updated. (init_defaults): new function (main): call init_defaults. (init_screen): initialize the screen's fg_color to black and bg_color to white. * src/list.c (free_window): free the fields user_name, res_name, res_class, and wm_name. (update_window_position): new function (window_name): new function. Code accessing a window's name uses this function. All code updated. (add_to_window_list): call update_window_position (add_to_window_list): initialize wm_name, res_name, and res_class for the new window. (format_window_name): new function (get_window_list): Add parameter fmt. All callers updated. (get_window_list): call format_window_name. * src/conf.h: move Configuration variables to the global variable, defaults. Dependant code updated. * src/data.h (TOP_LEFT): new define (TOP_CENTER): likewise (TOP_RIGHT): likewise (CENTER_LEFT): likewise (CENTER_CENTER): likewise (CENTER_RIGHT): likewise (BOTTOM_LEFT): likewise (BOTTOM_CENTER): likewise (BOTTOM_RIGHT): likewise (struct rp_window): new fields user_name, wm_name, res_name, res_class, position. (struct rp_window): remove field name. Replaced with user_name. Dependant code updated. (struct screen_info): remove field font. dependant code updated. (struct screen_info): new fields fg_color, bg_color. (struct rp_defaults): new struct (defaults): new global * src/actions.c (parse_winpos): new function (cmd_pos): likewise (cmd_defwinpos): likewise (cmd_deftranspos): likewise (cmd_defmaxsizepos): likewise (cmd_defbartimeout): likewise (cmd_defbarloc): likewise (cmd_deffont): likewise (cmd_defpadding): likewise (cmd_defborder): likewise (cmd_definputwidth): likewise (cmd_defwaitcursor): likewise (cmd_defwinfmt): likewise (cmd_defwinname): likewise (user_commands): New commands defbarloc, defbartimeout, defborder, deffont, defintputwidth, defmaxsizepos, defpadding, deftranspos, defwaitcursor, defwinfmt, defwinname, defwinpos.
Diffstat (limited to 'src/data.h')
-rw-r--r--src/data.h61
1 files changed, 59 insertions, 2 deletions
diff --git a/src/data.h b/src/data.h
index 6ed2d44..b29047f 100644
--- a/src/data.h
+++ b/src/data.h
@@ -44,15 +44,33 @@ struct rp_window_frame
};
+/* Possible positions for a window. */
+#define TOP_LEFT 0
+#define TOP_CENTER 1
+#define TOP_RIGHT 2
+
+#define CENTER_LEFT 3
+#define CENTER_CENTER 4
+#define CENTER_RIGHT 5
+
+#define BOTTOM_LEFT 6
+#define BOTTOM_CENTER 7
+#define BOTTOM_RIGHT 8
+
struct rp_window
{
screen_info *scr;
Window w;
int number;
- char *name;
int state;
int last_access;
int named;
+
+ /* Window name hints. */
+ char *user_name;
+ char *wm_name;
+ char *res_name;
+ char *res_class;
/* Dimensions */
int x, y, width, height, border;
@@ -70,6 +88,10 @@ struct rp_window
/* Saved mouse position */
int mouse_x, mouse_y;
+ /* The alignment of the window. To what side or corner should the
+ window stick to. */
+ int position;
+
/* A window can be visible inside a frame but not the frame's
current window. This keeps track of what frame the window was
mapped into. */
@@ -81,13 +103,13 @@ struct rp_window
struct screen_info
{
GC normal_gc;
- XFontStruct *font; /* The font we want to use. */
XWindowAttributes root_attr;
Window root, bar_window, key_window, input_window, frame_window, help_window;
int bar_is_raised;
int screen_num; /* Our screen number as dictated my X */
Colormap def_cmap;
Cursor rat;
+ unsigned long fg_color, bg_color; /* The pixel color. */
};
struct rp_action
@@ -104,6 +126,41 @@ struct rp_key
unsigned int state;
};
+struct rp_defaults
+{
+ /* Default positions for new normal windows, transient windows, and
+ normal windows with maxsize hints. */
+ int win_pos;
+ int trans_pos;
+ int maxsize_pos;
+
+ int input_window_size;
+ int window_border_width;
+
+ int bar_x_padding;
+ int bar_y_padding;
+ int bar_location;
+ int bar_timeout;
+
+ int frame_indicator_timeout;
+
+ int padding_left;
+ int padding_right;
+ int padding_top;
+ int padding_bottom;
+
+ XFontStruct *font;
+
+ int wait_for_key_cursor;
+
+ char *window_fmt;
+
+ /* Which name to use: wm_name, res_name, res_class. */
+ int win_name;
+};
+
+extern struct rp_defaults defaults;
+
/* The prefix key also known as the command character under screen. */
extern struct rp_key prefix_key;