NeoMutt  2024-10-02-37-gfa9146
Teaching an old dog new tricks
DOXYGEN
Loading...
Searching...
No Matches
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.

Functions

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

Variables

struct MuttWindowRootWindow
 Parent of all Windows.
 

Detailed Description

Root Window.

Authors
  • 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 http://www.gnu.org/licenses/.

Definition in file rootwin.h.

Function Documentation

◆ rootwin_cleanup()

void rootwin_cleanup ( void  )

Free all the default Windows.

Definition at line 202 of file rootwin.c.

203{
204 AllDialogsWindow = NULL;
205 MessageContainer = NULL;
207}
struct MuttWindow * AllDialogsWindow
Parent of all Dialogs.
Definition: dialog.c:80
struct MuttWindow * MessageContainer
Window acting as a stack for the message windows.
Definition: msgcont.c:40
void mutt_window_free(struct MuttWindow **ptr)
Free a Window and its children.
Definition: mutt_window.c:201
struct MuttWindow * RootWindow
Parent of all Windows.
Definition: rootwin.c:106
+ 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 214 of file rootwin.c.

215{
217 MUTT_WIN_SIZE_FIXED, 0, 0);
219 RootWindow = win_root;
220
221 struct MuttWindow *win_helpbar = helpbar_new();
222 struct MuttWindow *win_alldlgs = alldialogs_new();
223
224 const bool c_status_on_top = cs_subset_bool(NeoMutt->sub, "status_on_top");
225 if (c_status_on_top)
226 {
227 mutt_window_add_child(win_root, win_alldlgs);
228 mutt_window_add_child(win_root, win_helpbar);
229 }
230 else
231 {
232 mutt_window_add_child(win_root, win_helpbar);
233 mutt_window_add_child(win_root, win_alldlgs);
234 }
235
236 struct MuttWindow *win_cont = msgcont_new();
237 struct MuttWindow *win_msg = msgwin_new(false);
238 mutt_window_add_child(win_cont, win_msg);
239 mutt_window_add_child(win_root, win_cont);
240
244}
bool cs_subset_bool(const struct ConfigSubset *sub, const char *name)
Get a boolean config item by name.
Definition: helpers.c:47
struct MuttWindow * alldialogs_new(void)
Create the AllDialogs Window.
Definition: dialog.c:210
static int rootwin_config_observer(struct NotifyCallback *nc)
Notification that a Config Variable has changed - Implements observer_t -.
Definition: rootwin.c:113
static int rootwin_resize_observer(struct NotifyCallback *nc)
Notification that the terminal has been resized - Implements observer_t -.
Definition: rootwin.c:153
static int rootwin_window_observer(struct NotifyCallback *nc)
Notification that a Window has changed - Implements observer_t -.
Definition: rootwin.c:174
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:46
struct MuttWindow * msgwin_new(bool interactive)
Create the Message Window.
Definition: msgwin.c:371
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:191
void notify_set_parent(struct Notify *notify, struct Notify *parent)
Set the parent notification handler.
Definition: notify.c:95
void mutt_window_add_child(struct MuttWindow *parent, struct MuttWindow *child)
Add a child to Window.
Definition: mutt_window.c:445
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:181
@ WT_ROOT
Parent of All Windows.
Definition: mutt_window.h:72
@ MUTT_WIN_ORIENT_VERTICAL
Window uses all available vertical space.
Definition: mutt_window.h:38
@ MUTT_WIN_SIZE_FIXED
Window has a fixed size.
Definition: mutt_window.h:47
@ NT_WINDOW
MuttWindow has changed, NotifyWindow, EventWindow.
Definition: notify_type.h:57
@ NT_CONFIG
Config has changed, NotifyConfig, EventConfig.
Definition: notify_type.h:43
@ NT_RESIZE
Window has been resized.
Definition: notify_type.h:52
struct Notify * notify
Notifications: NotifyConfig, EventConfig.
Definition: subset.h:52
struct Notify * notify
Notifications: NotifyWindow, EventWindow.
Definition: mutt_window.h:137
Container for Accounts, Notifications.
Definition: neomutt.h:42
struct Notify * notify_resize
Window resize notifications handler.
Definition: neomutt.h:44
struct Notify * notify
Notifications handler.
Definition: neomutt.h:43
struct ConfigSubset * sub
Inherited config items.
Definition: neomutt.h:46
+ 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.

Parameters
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 253 of file rootwin.c.

254{
255 if (!RootWindow)
256 return;
257
258 bool changed = false;
259
260 if (RootWindow->state.rows != rows)
261 {
262 RootWindow->state.rows = rows;
263 changed = true;
264 }
265
266 if (RootWindow->state.cols != cols)
267 {
268 RootWindow->state.cols = cols;
269 changed = true;
270 }
271
272 if (changed)
273 {
275 }
276}
void mutt_window_reflow(struct MuttWindow *win)
Resize a Window and its children.
Definition: mutt_window.c:343
struct WindowState state
Current state of the Window.
Definition: mutt_window.h:126
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
extern

Parent of all Windows.

Definition at line 106 of file rootwin.c.