NeoMutt  2023-03-22
Teaching an old dog new tricks
rootwin.h File Reference

Root Window. More...

+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.


void rootwin_free (void)
 Free all the default Windows. More...
void rootwin_new (void)
 Create the default Windows. More...
void rootwin_set_size (int cols, int rows)
 Set the dimensions of the Root Window. More...


struct MuttWindowRootWindow
 Parent of all Windows. More...

Detailed Description

Root Window.

  • Richard Russon

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see

Definition in file rootwin.h.

Function Documentation

◆ rootwin_free()

void rootwin_free ( void  )

Free all the default Windows.

Definition at line 178 of file rootwin.c.

void mutt_window_free(struct MuttWindow **ptr)
Free a Window and its children.
Definition: mutt_window.c:200
struct MuttWindow * RootWindow
Parent of all Windows.
Definition: rootwin.c:104
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ rootwin_new()

void rootwin_new ( void  )

Create the default Windows.

Create the Help, Index, Status, Message and Sidebar Windows.

Definition at line 188 of file rootwin.c.

193 RootWindow = win_root;
195 struct MuttWindow *win_helpbar = helpbar_new();
196 struct MuttWindow *win_alldlgs = alldialogs_new();
198 const bool c_status_on_top = cs_subset_bool(NeoMutt->sub, "status_on_top");
199 if (c_status_on_top)
200 {
201 mutt_window_add_child(win_root, win_alldlgs);
202 mutt_window_add_child(win_root, win_helpbar);
203 }
204 else
205 {
206 mutt_window_add_child(win_root, win_helpbar);
207 mutt_window_add_child(win_root, win_alldlgs);
208 }
210 struct MuttWindow *win_cont = msgcont_new();
211 struct MuttWindow *win_msg = msgwin_new();
212 mutt_window_add_child(win_cont, win_msg);
213 mutt_window_add_child(win_root, win_cont);
bool cs_subset_bool(const struct ConfigSubset *sub, const char *name)
Get a boolean config item by name.
Definition: helpers.c:73
struct MuttWindow * alldialogs_new(void)
Create the AllDialogs Window.
Definition: dialog.c:206
static int rootwin_config_observer(struct NotifyCallback *nc)
Notification that a Config Variable has changed - Implements observer_t -.
Definition: rootwin.c:111
static int rootwin_window_observer(struct NotifyCallback *nc)
Notification that a Window has changed - Implements observer_t -.
Definition: rootwin.c:153
struct MuttWindow * helpbar_new(void)
Create the Help Bar Window.
Definition: helpbar.c:333
struct MuttWindow * msgcont_new(void)
Create a new Message Container.
Definition: msgcont.c:45
struct MuttWindow * msgwin_new(void)
Create the Message Window.
Definition: msgwin.c:197
bool notify_observer_add(struct Notify *notify, enum NotifyType type, observer_t callback, void *global_data)
Add an observer to an object.
Definition: notify.c:189
void notify_set_parent(struct Notify *notify, struct Notify *parent)
Set the parent notification handler.
Definition: notify.c:93
void mutt_window_add_child(struct MuttWindow *parent, struct MuttWindow *child)
Add a child to Window.
Definition: mutt_window.c:438
struct MuttWindow * mutt_window_new(enum WindowType type, enum MuttWindowOrientation orient, enum MuttWindowSize size, int cols, int rows)
Create a new Window.
Definition: mutt_window.c:180
Parent of All Windows.
Definition: mutt_window.h:72
Window uses all available vertical space.
Definition: mutt_window.h:38
Window has a fixed size.
Definition: mutt_window.h:47
MuttWindow has changed, NotifyWindow, EventWindow.
Definition: notify_type.h:55
Config has changed, NotifyConfig, EventConfig.
Definition: notify_type.h:43
struct Notify * notify
Notifications: NotifyWindow, EventWindow.
Definition: mutt_window.h:138
Container for Accounts, Notifications.
Definition: neomutt.h:37
struct Notify * notify
Notifications handler.
Definition: neomutt.h:38
struct ConfigSubset * sub
Inherited config items.
Definition: neomutt.h:39
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ rootwin_set_size()

void rootwin_set_size ( int  cols,
int  rows 

Set the dimensions of the Root Window.

rowsNumber of rows on the screen
colsNumber of columns on the screen

This function is called after NeoMutt receives a SIGWINCH signal.

Definition at line 226 of file rootwin.c.

228 if (!RootWindow)
229 return;
231 bool changed = false;
233 if (RootWindow->state.rows != rows)
234 {
235 RootWindow->state.rows = rows;
236 changed = true;
237 }
239 if (RootWindow->state.cols != cols)
240 {
241 RootWindow->state.cols = cols;
242 changed = true;
243 }
245 if (changed)
246 {
248 }
void mutt_window_reflow(struct MuttWindow *win)
Resize a Window and its children.
Definition: mutt_window.c:339
struct WindowState state
Current state of the Window.
Definition: mutt_window.h:127
short cols
Number of columns, can be MUTT_WIN_SIZE_UNLIMITED.
Definition: mutt_window.h:60
short rows
Number of rows, can be MUTT_WIN_SIZE_UNLIMITED.
Definition: mutt_window.h:61
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Variable Documentation

◆ RootWindow

struct MuttWindow* RootWindow

Parent of all Windows.

Definition at line 104 of file rootwin.c.