NeoMutt  2022-04-29-178-g3b62e6
Teaching an old dog new tricks
window.c File Reference

Dump the details of the nested Windows. More...

#include "config.h"
#include <stddef.h>
#include <stdbool.h>
#include "mutt/lib.h"
#include "gui/lib.h"
#include "lib.h"
+ Include dependency graph for window.c:

Go to the source code of this file.


static const char * win_size (const struct MuttWindow *win)
static void win_dump (struct MuttWindow *win, int indent)
void debug_win_dump (void)


static struct MuttWindowwin_focus = NULL

Detailed Description

Dump the details of the nested Windows.

  • 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 window.c.

Function Documentation

◆ win_size()

static const char * win_size ( const struct MuttWindow win)

Definition at line 40 of file window.c.

42 if (!win)
43 return "???";
45 switch (win->size)
46 {
48 return "FIX";
50 return "MAX";
52 return "MIN";
53 }
55 return "???";
Window has a fixed size.
Definition: mutt_window.h:47
Window size depends on its children.
Definition: mutt_window.h:49
Window wants as much space as possible.
Definition: mutt_window.h:48
enum MuttWindowSize size
Type of Window, e.g. MUTT_WIN_SIZE_FIXED.
Definition: mutt_window.h:131
+ Here is the caller graph for this function:

◆ win_dump()

static void win_dump ( struct MuttWindow win,
int  indent 

Definition at line 58 of file window.c.

60 bool visible = mutt_window_is_visible(win);
62 mutt_debug(LL_DEBUG1, "%*s%s[%d,%d] %s-%c \033[1;33m%s\033[0m (%d,%d)%s%s\n",
63 indent, "", visible ? "✓" : "✗\033[1;30m", win->state.col_offset,
64 win->state.row_offset, win_size(win),
65 (win->orient == MUTT_WIN_ORIENT_VERTICAL) ? 'V' : 'H',
66 mutt_window_win_name(win), win->state.cols, win->state.rows,
67 visible ? "" : "\033[0m",
68 (win == win_focus) ? " <-- \033[1;31mFOCUS\033[0m" : "");
70 struct MuttWindow *np = NULL;
71 TAILQ_FOREACH(np, &win->children, entries)
72 {
73 win_dump(np, indent + 4);
74 }
static void win_dump(struct MuttWindow *win, int indent)
Definition: window.c:58
static const char * win_size(const struct MuttWindow *win)
Definition: window.c:40
static struct MuttWindow * win_focus
Definition: window.c:38
#define mutt_debug(LEVEL,...)
Definition: logging.h:84
Log at debug level 1.
Definition: logging.h:40
bool mutt_window_is_visible(struct MuttWindow *win)
Is the Window visible?
Definition: mutt_window.c:501
const char * mutt_window_win_name(const struct MuttWindow *win)
Get the name of a Window.
Definition: mutt_window.c:710
Window uses all available vertical space.
Definition: mutt_window.h:38
#define TAILQ_FOREACH(var, head, field)
Definition: queue.h:725
struct WindowState state
Current state of the Window.
Definition: mutt_window.h:127
enum MuttWindowOrientation orient
Which direction the Window will expand.
Definition: mutt_window.h:130
struct MuttWindowList children
Children Windows.
Definition: mutt_window.h:136
short cols
Number of columns, can be MUTT_WIN_SIZE_UNLIMITED.
Definition: mutt_window.h:60
short row_offset
Absolute on-screen row.
Definition: mutt_window.h:63
short col_offset
Absolute on-screen column.
Definition: mutt_window.h:62
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:

◆ debug_win_dump()

void debug_win_dump ( void  )

Definition at line 95 of file window.c.

98 mutt_debug(LL_DEBUG1, "\n");
100 mutt_debug(LL_DEBUG1, "\n");
102 struct Buffer buf = mutt_buffer_make(1024);
103 win_serialise(RootWindow, &buf);
107 win_focus = NULL;
struct Buffer mutt_buffer_make(size_t size)
Make a new buffer on the stack.
Definition: buffer.c:63
void mutt_buffer_dealloc(struct Buffer *buf)
Release the memory allocated by a buffer.
Definition: buffer.c:292
static const char * mutt_buffer_string(const struct Buffer *buf)
Convert a buffer to a const char * "string".
Definition: buffer.h:77
struct MuttWindow * window_get_focus(void)
Get the currently focused Window.
Definition: mutt_window.c:643
struct MuttWindow * RootWindow
Parent of all Windows.
Definition: rootwin.c:104
String manipulation buffer.
Definition: buffer.h:34
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Variable Documentation

◆ win_focus

struct MuttWindow* win_focus = NULL

Definition at line 38 of file window.c.