NeoMutt  2024-03-23-23-gec7045
Teaching an old dog new tricks
DOXYGEN
Loading...
Searching...
No Matches
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.

Functions

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

Variables

static struct MuttWindowWinFocus = NULL
 The Window that is currently focussed.
 

Detailed Description

Dump the details of the nested Windows.

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

Function Documentation

◆ win_dump()

static void win_dump ( struct MuttWindow win,
int  indent 
)
static

Definition at line 42 of file window.c.

43{
44 bool visible = mutt_window_is_visible(win);
45
46 mutt_debug(LL_DEBUG1, "%*s%s[%d,%d] %s-%c \033[1;33m%s\033[0m (%d,%d)%s%s\n",
47 indent, "", visible ? "✓" : "✗\033[1;30m", win->state.col_offset,
49 (win->orient == MUTT_WIN_ORIENT_VERTICAL) ? 'V' : 'H',
50 mutt_window_win_name(win), win->state.cols, win->state.rows,
51 visible ? "" : "\033[0m",
52 (win == WinFocus) ? " <-- \033[1;31mFOCUS\033[0m" : "");
53
54 struct MuttWindow *np = NULL;
55 TAILQ_FOREACH(np, &win->children, entries)
56 {
57 win_dump(np, indent + 4);
58 }
59}
const char * name_window_size(const struct MuttWindow *win)
Definition: names.c:261
static void win_dump(struct MuttWindow *win, int indent)
Definition: window.c:42
static struct MuttWindow * WinFocus
The Window that is currently focussed.
Definition: window.c:40
#define mutt_debug(LEVEL,...)
Definition: logging2.h:89
@ LL_DEBUG1
Log at debug level 1.
Definition: logging2.h:43
bool mutt_window_is_visible(struct MuttWindow *win)
Is the Window visible?
Definition: mutt_window.c:512
const char * mutt_window_win_name(const struct MuttWindow *win)
Get the name of a Window.
Definition: mutt_window.c:735
@ MUTT_WIN_ORIENT_VERTICAL
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 96 of file window.c.

97{
99 mutt_debug(LL_DEBUG1, "\n");
101 mutt_debug(LL_DEBUG1, "\n");
102#ifdef DEBUG_SHOW_SERIALISE
103 struct Buffer buf = buf_make(1024);
104 win_serialise(RootWindow, &buf);
105 mutt_debug(LL_DEBUG1, "%s\n", buf_string(&buf));
106 buf_dealloc(&buf);
107#endif
108 WinFocus = NULL;
109}
void buf_dealloc(struct Buffer *buf)
Release the memory allocated by a buffer.
Definition: buffer.c:394
struct Buffer buf_make(size_t size)
Make a new buffer on the stack.
Definition: buffer.c:75
static const char * buf_string(const struct Buffer *buf)
Convert a buffer to a const char * "string".
Definition: buffer.h:97
struct MuttWindow * window_get_focus(void)
Get the currently focused Window.
Definition: mutt_window.c:668
struct MuttWindow * RootWindow
Parent of all Windows.
Definition: rootwin.c:106
String manipulation buffer.
Definition: buffer.h:36
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Variable Documentation

◆ WinFocus

struct MuttWindow* WinFocus = NULL
static

The Window that is currently focussed.

The focus spans from RootWindow through MuttWindow.focus

Definition at line 40 of file window.c.