diff options
author | sabetts <sabetts> | 2001-04-07 05:17:34 +0000 |
---|---|---|
committer | sabetts <sabetts> | 2001-04-07 05:17:34 +0000 |
commit | 8b6f270c70d8fa6898e7d6c3b9533026c757f48c (patch) | |
tree | d060b6c8e452ca1d89b6b16ec1de18d0074cff7b /src/main.c | |
parent | 061f1abef270b3e79326f8f7a4cac1b3a49b7bc1 (diff) | |
download | ratpoison-8b6f270c70d8fa6898e7d6c3b9533026c757f48c.zip |
* src/split.h (hide_frame_indicator): new prototype
(show_frame_indicator): likewise
* src/split.c: include <unistd.h>
(split_frame): set the new_frame's window to NULL
(split_frame): calls show_frame_indicator once the split is done.
(set_active_frame): only call show_frame_indicator if the frame
has no window or if we switched to a different frame.
(update_frame_indicator): prints FRAME_STRING in the frame
indicator window.
(hide_frame_indicator): new function
(show_frame_indicator): likewise
* src/main.c (rp_rat_bits): new variable
(rp_rat_mask_bits): likewise
(alrm_handler): calls hide_frame_indicator
(init_rat_cursor): new function
(init_screen): calls init_rat_cursor
* src/events.c (unmap_notify): calls set_active_frame if the
window being unmapped was in the current frame
(destroy_window): calls set_active_frame if the
window being destroyed was in the current frame
(grab_rat): new function
(grab_rat): likewise
(handle_key): calls grab_rat and ungrab_rat
* src/data.h (struct screen_info): new variable rat
* src/conf.h (FRAME_INDICATOR_TIMEOUT): new #define
(FRAME_STRING): likewise
(RAT_HEIGHT): likewise
(RAT_WIDTH): likewise
(RAT_HOT_X): likewise
(RAT_HOT_Y): likewise
* src/actions.h (cmd_curframe): new prototype
* src/actions.c (initialize_default_keybindings): new key binds
for "curframe"
(user_commands): new command "curframe"
(cmd_curframe): new function
* src/split.c (remove_all_splits): only maximize the current
window if there is one.
(maximize_frame): remove unused code to retrieve the current
screen_info.
* src/actions.c (cmd_h_split): calls h_split_frame on the current
frame.
(cmd_v_split): likewise
(cmd_only): even if the current frame is empty, call
remove_all_splits.
* src/split.c (maximize_frame): new function
(create_initial_frame): calls maximize_frame to fill in the
initial frame's fields.
(num_frames): comment out
(remove_frame): remove special case when there is only 1 frame
left.
* src/split.h (h_split_frame): renamed frome h_split_window
(v_split_frame): renamed frome v_split_window
(split_frame): renamed frome split_window
(remove_all_splits): renamed frome remove_all_frames
(find_windows_frame): new prototype
(find_frame_next): likewise
(find_frame_prev): likewise
(current_window): likewise
(init_frame_list): likewise
(set_active_frame): likewise
* src/split.c (create_initial_frame): new function
(init_frame_list): likewise
(find_windows_frame): likewise
(find_frame_next): likewise
(find_frame_prev): likewise
(current_window): likewise
(update_frame_indicator): likewise
(set_active_frame): likewise
(split_frame): rename from split_window
(v_split_frame): rename from v_split_window
(h_split_frame): rename from h_split_window
(remove_all_splits): renamed frome remove_all_frames
(total_frame_area): traverses rp_window_frame list
(num_frames): likewise
(frame_overlaps): likewise
(remove_frame): likewise
(remove_frame): calls delete_frame_from_list
* src/main.c (main): calls init_frame_list
(init_screen): create and map the frame_window
* src/events.c (new_window): the screen's frame_window is not
managed
(cleanup_frame): new function
(unmap_notify): calls cleanup_frame if window exists in a frame
(destroy_window): likewise
* src/data.h (struct screen_info): remove frame field
(struct rp_window_frame): new fields win, prev, next
(rp_window_frame_sentinel): new global
* src/actions.c (cmd_prev): jumps to last accessed window if
current frame is empty.
(cmd_next): likewise
(cmd_remove): nothing is done if only 1 frame exists
* src/data.h (struct screen_info): new field frame_window
(rp_current_frame): new global
(rp_current_window): removed. All dependant code updated.
Diffstat (limited to 'src/main.c')
-rw-r--r-- | src/main.c | 40 |
1 files changed, 39 insertions, 1 deletions
@@ -37,6 +37,19 @@ static void init_screen (screen_info *s, int screen_num); +/* When a user hits the prefix key, the rat switches to a different + pixmap to indicate that ratpoison expects the user to hit another + key, these are the pixmaps. */ +static unsigned char rp_rat_bits[] = { + 0x00, 0x00, 0xfe, 0x7f, 0x02, 0x40, 0x02, 0x40, 0x02, 0x40, 0x02, 0x40, + 0x02, 0x40, 0x02, 0x40, 0x02, 0x40, 0x02, 0x40, 0x02, 0x40, 0x02, 0x40, + 0x02, 0x40, 0x02, 0x40, 0xfe, 0x7f, 0x00, 0x00}; + +static unsigned char rp_rat_mask_bits[] = { + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff}; + int rat_x; int rat_y; int rat_visible = 1; /* rat is visible by default */ @@ -139,6 +152,9 @@ alrm_handler (int signum) { hide_bar (&screens[i]); } + + hide_frame_indicator(); + XSync (dpy, False); } @@ -435,6 +451,27 @@ main (int argc, char *argv[]) } static void +init_rat_cursor (screen_info *s) +{ + Pixmap fore, mask; + XColor fg, bg, dummy; + + XAllocNamedColor(dpy, DefaultColormap(dpy, s->screen_num), + "black", &fg, &dummy); + XAllocNamedColor(dpy, DefaultColormap(dpy, s->screen_num), + "white", &bg, &dummy); + + fore = XCreatePixmapFromBitmapData (dpy, s->root, + rp_rat_bits, RAT_WIDTH, RAT_HEIGHT, + 1, 0, 1); + mask = XCreatePixmapFromBitmapData (dpy, s->root, + rp_rat_mask_bits, RAT_WIDTH, RAT_HEIGHT, + 1, 0, 1); + s->rat = XCreatePixmapCursor(dpy, fore, mask, + &fg, &bg, RAT_HOT_X, RAT_HOT_Y); +} + +static void init_screen (screen_info *s, int screen_num) { XColor fg_color, bg_color,/* bold_color, */ junk; @@ -444,6 +481,8 @@ init_screen (screen_info *s, int screen_num) s->def_cmap = DefaultColormap (dpy, screen_num); s->font = font; XGetWindowAttributes (dpy, s->root, &s->root_attr); + + init_rat_cursor (s); /* Get our program bar colors */ if (!XAllocNamedColor (dpy, s->def_cmap, FOREGROUND, &fg_color, &junk)) @@ -508,7 +547,6 @@ init_screen (screen_info *s, int screen_num) XSelectInput (dpy, s->frame_window, KeyPressMask ); XMapRaised (dpy, s->frame_window); - XSync (dpy, 0); scanwins (s); |