NeoMutt  2021-02-05-89-gabe350
Teaching an old dog new tricks
DOXYGEN
private.h
Go to the documentation of this file.
1 
23 #ifndef MUTT_SIDEBAR_PRIVATE_H
24 #define MUTT_SIDEBAR_PRIVATE_H
25 
26 #include <stdbool.h>
27 #include "mutt/lib.h"
28 #include "config/lib.h"
29 #include "gui/lib.h"
30 
31 struct Mailbox;
32 
33 extern struct ListHead SidebarWhitelist;
34 
38 struct SbEntry
39 {
40  char box[256];
41  char display[256];
42  int depth;
43  struct Mailbox *mailbox;
44  bool is_hidden;
45  enum ColorId color;
46 };
47 
51 enum DivType
52 {
56 };
57 
62 {
63  ARRAY_HEAD(, struct SbEntry *) entries;
64 
65  int top_index;
66  int opn_index;
67  int hil_index;
68  int bot_index;
69 
70  short previous_sort;
72  short divider_width;
73 };
74 
75 // sidebar.c
76 void sb_add_mailbox (struct SidebarWindowData *wdata, struct Mailbox *m);
77 void sb_remove_mailbox (struct SidebarWindowData *wdata, struct Mailbox *m);
78 void sb_set_current_mailbox(struct SidebarWindowData *wdata, struct Mailbox *m);
79 
80 // functions.c
81 bool select_next(struct SidebarWindowData *wdata);
82 bool select_prev(struct SidebarWindowData *wdata);
83 
84 // observer.c
86 void sb_win_add_observers(struct MuttWindow *win);
87 
88 // sort.c
89 void sb_sort_entries(struct SidebarWindowData *wdata, enum SortType sort);
90 
91 // wdata.c
92 void sb_wdata_free(struct MuttWindow *win, void **ptr);
93 struct SidebarWindowData *sb_wdata_get(struct MuttWindow *win);
94 struct SidebarWindowData *sb_wdata_new(void);
95 
96 // window.c
97 int sb_recalc(struct MuttWindow *win);
98 int sb_repaint(struct MuttWindow *win);
99 
100 #endif /* MUTT_SIDEBAR_PRIVATE_H */
NotifyCallback
Data passed to a notification function.
Definition: observer.h:39
Mailbox
A mailbox.
Definition: mailbox.h:81
sb_win_add_observers
void sb_win_add_observers(struct MuttWindow *win)
Add Observers to the Sidebar Window.
Definition: observer.c:409
SidebarWindowData::divider_width
short divider_width
Width of the divider in screen columns.
Definition: private.h:72
MuttWindow
A division of the screen.
Definition: mutt_window.h:115
sb_wdata_get
struct SidebarWindowData * sb_wdata_get(struct MuttWindow *win)
Get the Sidebar data for this window.
Definition: wdata.c:70
SortType
SortType
Methods for sorting.
Definition: sort2.h:43
select_prev
bool select_prev(struct SidebarWindowData *wdata)
Selects the previous unhidden mailbox.
Definition: functions.c:112
SidebarWindowData
Sidebar private Window data -.
Definition: private.h:61
ColorId
ColorId
List of all colored objects.
Definition: color.h:58
SidebarWindowData::ARRAY_HEAD
ARRAY_HEAD(, struct SbEntry *) entries
Items to display in the sidebar.
sb_repaint
int sb_repaint(struct MuttWindow *win)
Repaint the Sidebar display - Implements MuttWindow::repaint()
Definition: window.c:836
SidebarWindowData::divider_type
enum DivType divider_type
Type of divider to use, e.g. SB_DIV_ASCII.
Definition: private.h:71
SB_DIV_ASCII
@ SB_DIV_ASCII
An ASCII vertical bar (pipe)
Definition: private.h:54
SbEntry::box
char box[256]
Mailbox path (possibly abbreviated)
Definition: private.h:40
lib.h
SidebarWindowData::top_index
int top_index
First mailbox visible in sidebar.
Definition: private.h:65
sb_wdata_new
struct SidebarWindowData * sb_wdata_new(void)
Create new Window data for the Sidebar.
Definition: wdata.c:39
sb_add_mailbox
void sb_add_mailbox(struct SidebarWindowData *wdata, struct Mailbox *m)
Add a Mailbox to the Sidebar.
Definition: sidebar.c:82
lib.h
sb_insertion_observer
int sb_insertion_observer(struct NotifyCallback *nc)
Listen for new Dialogs - Implements observer_t.
Definition: observer.c:442
sb_wdata_free
void sb_wdata_free(struct MuttWindow *win, void **ptr)
Free Sidebar Window data - Implements MuttWindow::wdata_free()
Definition: wdata.c:49
SB_DIV_UTF8
@ SB_DIV_UTF8
A unicode line-drawing character.
Definition: private.h:55
SidebarWhitelist
struct ListHead SidebarWhitelist
List of mailboxes to always display in the sidebar.
Definition: sidebar.c:42
DivType
DivType
Source of the sidebar divider character.
Definition: private.h:51
SidebarWindowData::opn_index
int opn_index
Current (open) mailbox.
Definition: private.h:66
SbEntry::display
char display[256]
Formatted string to display.
Definition: private.h:41
SbEntry::depth
int depth
Indentation depth.
Definition: private.h:42
SbEntry::is_hidden
bool is_hidden
Don't show, e.g. $sidebar_new_mail_only.
Definition: private.h:44
SbEntry::color
enum ColorId color
Colour to use.
Definition: private.h:45
sb_set_current_mailbox
void sb_set_current_mailbox(struct SidebarWindowData *wdata, struct Mailbox *m)
Set the current Mailbox.
Definition: sidebar.c:165
select_next
bool select_next(struct SidebarWindowData *wdata)
Selects the next unhidden mailbox.
Definition: functions.c:44
SidebarWindowData::hil_index
int hil_index
Highlighted mailbox.
Definition: private.h:67
SbEntry::mailbox
struct Mailbox * mailbox
Mailbox this represents.
Definition: private.h:43
SbEntry
Info about folders in the sidebar.
Definition: private.h:38
sb_remove_mailbox
void sb_remove_mailbox(struct SidebarWindowData *wdata, struct Mailbox *m)
Remove a Mailbox from the Sidebar.
Definition: sidebar.c:111
sb_recalc
int sb_recalc(struct MuttWindow *win)
Recalculate the Sidebar display - Implements MuttWindow::recalc()
Definition: window.c:642
SidebarWindowData::bot_index
int bot_index
Last mailbox visible in sidebar.
Definition: private.h:68
lib.h
SB_DIV_USER
@ SB_DIV_USER
User configured using $sidebar_divider_char.
Definition: private.h:53
sb_sort_entries
void sb_sort_entries(struct SidebarWindowData *wdata, enum SortType sort)
Sort the Sidebar entries.
Definition: sort.c:177
SidebarWindowData::previous_sort
short previous_sort
Old $sidebar_sort_method
Definition: private.h:70