summaryrefslogtreecommitdiff
path: root/src/frame.c
diff options
context:
space:
mode:
authorsabetts <sabetts>2003-03-31 07:06:22 +0000
committersabetts <sabetts>2003-03-31 07:06:22 +0000
commiteac6dda17283fe9f312d0c8576f4370f82fc5c0a (patch)
treeb21d6e62bee0b6e4374e240537dfb975fd8a6680 /src/frame.c
parent84ee56d66b889363903eddd81a8b2a07f180656f (diff)
downloadratpoison-eac6dda17283fe9f312d0c8576f4370f82fc5c0a.zip
* src/split.c (current_window): call screen_get_frame.
(split_frame): call screen_get_frame to get appropriate structure. (split_frame): call find_window_number to get appropriate structure. (remove_all_splits): call screen_get_frame to get appropriate structure. (resize_frame): make sure all frames that will be resized are big enough for the resize. (resize_frame): return int (resize_shrink_to_window): call find_window_number to get the appropriate structure. (resize_frame_right): return int (resize_frame_left): likewise (resize_frame_top): likewise (resize_frame_bottom): likewise (resize_frame_horizontally): backup the frameset and restore it if the resize fails. Do not allow a frame to be resized too small or too big. (resize_frame_vertically): likewise (remove_frame): call find_window_number to get the appropriate structure. (set_active_frame): likewise (blank_frame): likewise (show_frame_message): call screen_get_frame to get the appropriate structure. * src/screen.c (screen_width): new function (and prototype) (screen_height): likewise (screen_left): likewise (screen_right): likewise (screen_top): likewise (screen_bottom): likewise (screen_copy_frameset): likewise (screen_restore_frameset): likewise (frameset_free): likewise (screen_get_frame): likewise * src/split.c (maximize_frame): call screen_width and screen_height to get the size for the frame. * src/ratpoison.h: include screen.h * src/manage.c (move_window): * src/frame.h (frame_copy): new prototype (frame_dump): likewise * src/frame.c (frame_copy): new function (frame_dump): likewise * src/events.c (unmap_notify): compare frame numbers, not pointers. (client_msg): call screen_get_frame when blanking the frame. * src/data.h (EMPTY): new define (struct rp_window_frame): replace the win field with win_number. Dependant code updated. (struct rp_window): replace frame with frame_number. Dependant code updated. (struct screen_info): replace rp_current_frame with current_frame and change type to int. Dependant code updated. * src/Makefile.am (ratpoison_SOURCES): added screen.h and screen.c
Diffstat (limited to 'src/frame.c')
-rw-r--r--src/frame.c41
1 files changed, 41 insertions, 0 deletions
diff --git a/src/frame.c b/src/frame.c
index 6faf26e..6ac0277 100644
--- a/src/frame.c
+++ b/src/frame.c
@@ -124,3 +124,44 @@ frame_free (screen_info *s, rp_window_frame *f)
numset_release (s->frames_numset, f->number);
free (f);
}
+
+
+rp_window_frame *
+frame_copy (rp_window_frame *frame)
+{
+ rp_window_frame *copy;
+
+ copy = xmalloc (sizeof (rp_window_frame));
+
+ copy->number = frame->number;
+ copy->x = frame->x;
+ copy->y = frame->y;
+ copy->width = frame->width;
+ copy->height = frame->height;
+ copy->win_number = frame->win_number;
+ copy->last_access = frame->last_access;
+
+ return copy;
+}
+
+char *
+frame_dump (rp_window_frame *frame)
+{
+ char *tmp;
+ struct sbuf *s;
+
+ s = sbuf_new (0);
+ sbuf_printf (s, "%d %d %d %d %d %d %d",
+ frame->number,
+ frame->x,
+ frame->y,
+ frame->width,
+ frame->height,
+ frame->win_number,
+ frame->last_access);
+
+ /* Extract the string and return it, and don't forget to free s. */
+ tmp = sbuf_get (s);
+ free (s);
+ return tmp;
+}