NeoMutt
2024-11-14-34-g5aaf0d
Teaching an old dog new tricks
DOXYGEN
Loading...
Searching...
No Matches
wdata.c
Go to the documentation of this file.
1
30
#include "config.h"
31
#include <stddef.h>
32
#include "
private.h
"
33
#include "
mutt/lib.h
"
34
#include "
gui/lib.h
"
35
36
struct
IndexSharedData
;
37
44
struct
SidebarWindowData
*
sb_wdata_new
(
struct
MuttWindow
*
win
,
struct
IndexSharedData
*
shared
)
45
{
46
struct
SidebarWindowData
*
wdata
=
MUTT_MEM_CALLOC
(1,
struct
SidebarWindowData
);
47
wdata
->win =
win
;
48
wdata
->shared =
shared
;
49
ARRAY_INIT
(&
wdata
->entries);
50
return
wdata
;
51
}
52
56
void
sb_wdata_free
(
struct
MuttWindow
*
win
,
void
**ptr)
57
{
58
if
(!ptr || !*ptr)
59
return
;
60
61
struct
SidebarWindowData
*
wdata
= *ptr;
62
63
struct
SbEntry
**sbep = NULL;
64
ARRAY_FOREACH
(sbep, &wdata->
entries
)
65
{
66
FREE
(sbep);
67
}
68
ARRAY_FREE
(&wdata->
entries
);
69
70
FREE
(ptr);
71
}
72
77
struct
SidebarWindowData
*
sb_wdata_get
(
struct
MuttWindow
*
win
)
78
{
79
if
(!
win
|| (
win
->
type
!=
WT_SIDEBAR
))
80
return
NULL;
81
82
return
win
->
wdata
;
83
}
ARRAY_FOREACH
#define ARRAY_FOREACH(elem, head)
Iterate over all elements of the array.
Definition:
array.h:212
ARRAY_FREE
#define ARRAY_FREE(head)
Release all memory.
Definition:
array.h:204
ARRAY_INIT
#define ARRAY_INIT(head)
Initialize an array.
Definition:
array.h:65
sb_wdata_free
void sb_wdata_free(struct MuttWindow *win, void **ptr)
Free Sidebar Window data - Implements MuttWindow::wdata_free() -.
Definition:
wdata.c:56
lib.h
Convenience wrapper for the gui headers.
FREE
#define FREE(x)
Definition:
memory.h:55
MUTT_MEM_CALLOC
#define MUTT_MEM_CALLOC(n, type)
Definition:
memory.h:40
lib.h
Convenience wrapper for the library headers.
WT_SIDEBAR
@ WT_SIDEBAR
Side panel containing Accounts or groups of data.
Definition:
mutt_window.h:100
private.h
GUI display the mailboxes in a side panel.
sb_wdata_new
struct SidebarWindowData * sb_wdata_new(struct MuttWindow *win, struct IndexSharedData *shared)
Create new Window data for the Sidebar.
Definition:
wdata.c:44
sb_wdata_get
struct SidebarWindowData * sb_wdata_get(struct MuttWindow *win)
Get the Sidebar data for this window.
Definition:
wdata.c:77
IndexSharedData
Data shared between Index, Pager and Sidebar.
Definition:
shared_data.h:37
MuttWindow
Definition:
mutt_window.h:122
MuttWindow::wdata
void * wdata
Private data.
Definition:
mutt_window.h:144
MuttWindow::type
enum WindowType type
Window type, e.g. WT_SIDEBAR.
Definition:
mutt_window.h:143
SbEntry
Info about folders in the sidebar.
Definition:
private.h:41
SidebarWindowData
Sidebar private Window data -.
Definition:
private.h:88
SidebarWindowData::shared
struct IndexSharedData * shared
Shared Index Data.
Definition:
private.h:90
SidebarWindowData::win
struct MuttWindow * win
Sidebar Window.
Definition:
private.h:89
SidebarWindowData::entries
struct SbEntryArray entries
Items to display in the sidebar.
Definition:
private.h:91