home · contact · privacy
Rely on ncurses windows' _begyx properties instead of duplicating them in Win structs.
[plomrogue] / windows.h
index c8b6841e94f1efece07741804f25e5b8b32895db..690ba44eebdf9f36c490be14449fa0bf9b3e8b1d 100644 (file)
--- a/windows.h
+++ b/windows.h
@@ -2,15 +2,14 @@ struct WinMeta {
   struct Win * chain_start;
   struct Win * chain_end;
   struct Win * active;
-  int height; };
+  int height;
+  int width; };
 
 struct Win {
   struct Win * prev;
   struct Win * next;
   int width;
   int height;
-  int start_x;
-  int start_y;
   WINDOW * curses_win;
   char border_left;
   char border_down;
@@ -18,17 +17,28 @@ struct Win {
   void (* draw) (struct Win *);
   void * data; };
 
+struct yx {
+  int y;
+  int x; };
+
+struct Corners {
+  struct yx tl;
+  struct yx tr;
+  struct yx bl;
+  struct yx br; };
+
 struct  WinMeta init_win_meta (WINDOW *);
 struct Win init_window (struct WinMeta *, char *);
 void append_window (struct WinMeta *, struct Win *);
 void suspend_window (struct WinMeta *, struct Win *);
-void place_window (struct WinMeta *, struct Win *);
+struct yx place_window (struct WinMeta *, struct Win *);
 void update_windows (struct WinMeta *, struct Win *);
 void destroy_window (struct Win *);
-void draw_windows (struct WinMeta *, struct Win *);
+void draw_window(struct Win *);
+void draw_windows (struct Win *);
+void draw_windows_borders (struct Win *, struct Win *, struct Corners *, int);
+void draw_window_borders (struct Win *, char);
 void draw_all_windows (struct WinMeta *);
-void draw_window(struct WinMeta *, struct Win *);
-void undraw_window (WINDOW *);
 void resize_window (struct WinMeta *, char);
 void cycle_active_window (struct WinMeta *, char);
 void shift_window (struct WinMeta *, char);