]> granicus.if.org Git - neomutt/commitdiff
window: nestable
authorRichard Russon <rich@flatcap.org>
Wed, 24 Jul 2019 11:52:50 +0000 (12:52 +0100)
committerRichard Russon <rich@flatcap.org>
Sun, 27 Oct 2019 03:29:27 +0000 (03:29 +0000)
mutt_window.c
mutt_window.h

index f898748bfed82161a0feace55ae8f4ea613e64d9..cd8c8c026a2c1e8267baff0defe484671550d758 100644 (file)
@@ -52,6 +52,7 @@ struct MuttWindow *mutt_window_new(void)
 {
   struct MuttWindow *win = mutt_mem_calloc(1, sizeof(struct MuttWindow));
 
+  TAILQ_INIT(&win->children);
   return win;
 }
 
index 483c3cc0779d881da4d2daa83de85e9fef94711b..bc258604ab3197be0b6ef0dbef4fcd24329c47a8 100644 (file)
 
 #include "config.h"
 
+/**
+ * enum MuttWindowOrientation - Which way does the Window expand?
+ */
+enum MuttWindowOrientation
+{
+  MUTT_WIN_ORIENT_VERTICAL = 1, ///< Window uses all available vertical space
+  MUTT_WIN_ORIENT_HORIZONTAL,   ///< Window uses all available horizontal space
+};
+
+/**
+ * enum MuttWindowSize - Control the allocation of Window space
+ */
+enum MuttWindowSize
+{
+  MUTT_WIN_SIZE_FIXED = 1, ///< Window has a fixed size
+  MUTT_WIN_SIZE_MAXIMISE,  ///< Window wants as much space as possible
+  MUTT_WIN_SIZE_MINIMISE,  ///< Window size depends on its children
+};
+
+#define MUTT_WIN_SIZE_UNLIMITED -1 ///< Use as much space as possible
+
+TAILQ_HEAD(MuttWindowList, MuttWindow);
+
 /**
  * struct MuttWindow - A division of the screen
  *
@@ -36,6 +59,14 @@ struct MuttWindow
   int cols;
   int row_offset;
   int col_offset;
+
+  bool visible;
+  enum MuttWindowOrientation orient;
+  enum MuttWindowSize size;
+
+  TAILQ_ENTRY(MuttWindow) entries;
+  struct MuttWindow *parent;
+  struct MuttWindowList children;
 };
 
 extern struct MuttWindow *MuttHelpWindow;