summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorQuentin Carbonneaux2014-08-25 12:32:37 -0400
committerQuentin Carbonneaux2014-08-25 12:32:37 -0400
commitb7113d57cb7e1e6463c9156be3a703d1e5d7498a (patch)
tree74d6fa63d4e3b9e08ffc6fe39790ec9f2c541c3e
parentd06b27f1e96ff2f2576f2972d59ea5115c0457bb (diff)
start cursor support in win module
-rw-r--r--win.c17
-rw-r--r--win.h1
2 files changed, 18 insertions, 0 deletions
diff --git a/win.c b/win.c
index 61b4748..465e272 100644
--- a/win.c
+++ b/win.c
@@ -147,6 +147,23 @@ win_locus(int x1, int y1, unsigned *pos)
return w;
}
+/* win_resize - Resize or move a window to the specified
+ * location. The upper-left corner of the window is what
+ * moves to the passed coordinates.
+ */
+void
+win_resize(W *w, int x, int y)
+{
+ W *dwin;
+
+ if (w == &tag.win) {
+ if (y > w->gr.y)
+ tag.owner->rev = 0;
+ move(w, w->gr.x, y, w->gr.w, fheight - y);
+ return;
+ }
+}
+
/* win_resize_frame - Called when the whole frame
* is resized.
*/
diff --git a/win.h b/win.h
index d75ba1c..ede8f7a 100644
--- a/win.h
+++ b/win.h
@@ -36,6 +36,7 @@ void win_init(struct gui *g);
W *win_new(EBuf *eb);
void win_delete(W *);
W *win_locus(int, int, unsigned *);
+void win_resize(W *, int x, int y);
void win_resize_frame(int w, int h);
void win_redraw_frame(void);
void win_scroll(W *, int);