NeoMutt  2025-12-11-800-ga0ee0f
Teaching an old dog new tricks
DOXYGEN
Loading...
Searching...
No Matches
lib.h File Reference

GUI display the mailboxes in a side panel. More...

#include "mutt/list.h"
+ Include dependency graph for lib.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void sb_init (struct MuttWindow *all_dialogs_window)
 Set up the Sidebar.
 
void sb_cleanup (struct ListHead *sidebar_pinned, struct MuttWindow *all_dialogs_window)
 Clean up the Sidebar.
 
int sb_function_dispatcher (struct MuttWindow *win, const struct KeyEvent *event)
 Perform a Sidebar function - Implements function_dispatcher_t -.
 
enum CommandResult parse_sidebar_pin (const struct Command *cmd, struct Buffer *line, const struct ParseContext *pc, struct ParseError *pe)
 Parse the 'sidebar-pin' command - Implements Command::parse() -.
 
enum CommandResult parse_sidebar_unpin (const struct Command *cmd, struct Buffer *line, const struct ParseContext *pc, struct ParseError *pe)
 Parse the 'sidebar-unpin' command - Implements Command::parse() -.
 
void sidebar_init_keys (struct NeoMutt *n, struct SubMenu *sm_generic)
 Initialise the Sidebar Keybindings - Implements ::init_keys_api.
 
struct SubMenusidebar_get_submenu (void)
 Get the Sidebar SubMenu.
 

Detailed Description

GUI display the mailboxes in a side panel.

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 lib.h.

Function Documentation

◆ sb_init()

void sb_init ( struct MuttWindow * all_dialogs_window)

Set up the Sidebar.

Parameters
all_dialogs_windowAll Dialogs Window

Definition at line 214 of file sidebar.c.

215{
216 // Set a default style, if unset
218 if (!attr_color_is_set(ac))
219 ac->attrs = A_UNDERLINE;
220
221 if (all_dialogs_window)
222 {
223 // Listen for dialog creation events
224 notify_observer_add(all_dialogs_window->notify, NT_WINDOW,
226 }
227}
bool attr_color_is_set(const struct AttrColor *ac)
Is the object coloured?
Definition attr.c:178
struct AttrColor * simple_color_get(enum ColorId cid)
Get the colour of an object by its ID.
Definition simple.c:98
@ MT_COLOR_SIDEBAR_HIGHLIGHT
Select cursor.
Definition color.h:71
int sb_insertion_window_observer(struct NotifyCallback *nc)
Notification that a Window has changed - Implements observer_t -.
Definition observer.c:485
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
@ NT_WINDOW
MuttWindow has changed, NotifyWindow, EventWindow.
Definition notify_type.h:58
A curses colour and its attributes.
Definition attr.h:65
int attrs
Text attributes, e.g. A_BOLD.
Definition attr.h:68
struct Notify * notify
Notifications: NotifyWindow, EventWindow.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ sb_cleanup()

void sb_cleanup ( struct ListHead * sidebar_pinned,
struct MuttWindow * all_dialogs_window )

Clean up the Sidebar.

Parameters
sidebar_pinnedList of pinned sidebar entries
all_dialogs_windowAll Dialogs Window

Definition at line 234 of file sidebar.c.

235{
236 if (all_dialogs_window)
238 mutt_list_free(sidebar_pinned);
239}
void mutt_list_free(struct ListHead *h)
Free a List AND its strings.
Definition list.c:123
bool notify_observer_remove(struct Notify *notify, const observer_t callback, const void *global_data)
Remove an observer from an object.
Definition notify.c:230
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ sidebar_init_keys()

void sidebar_init_keys ( struct NeoMutt * n,
struct SubMenu * sm_generic )

Initialise the Sidebar Keybindings - Implements ::init_keys_api.

Definition at line 82 of file functions.c.

83{
85 ASSERT(mod_data);
86
87 struct MenuDefinition *md = NULL;
88 struct SubMenu *sm = NULL;
89 struct SubMenu *sm_editor = editor_get_submenu();
90 ASSERT(sm_editor);
91
93 md = km_register_menu(MENU_SIDEBAR, "sidebar");
94 km_menu_add_submenu(md, sm);
95 km_menu_add_submenu(md, sm_editor);
97
98 mod_data->md_sidebar = md;
99 mod_data->sm_sidebar = sm;
100}
struct SubMenu * editor_get_submenu(void)
Get the Editor SubMenu.
Definition functions.c:583
void km_menu_add_submenu(struct MenuDefinition *md, struct SubMenu *sm)
Add a SubMenu to a Menu Definition.
Definition init.c:121
struct SubMenu * km_register_submenu(const struct MenuFuncOp functions[])
Register a submenu.
Definition init.c:87
struct MenuDefinition * km_register_menu(int menu, const char *name)
Register a menu.
Definition init.c:104
void km_menu_add_bindings(struct MenuDefinition *md, const struct MenuOpSeq bindings[])
Add Keybindings to a Menu.
Definition init.c:134
@ MODULE_ID_SIDEBAR
ModuleSidebar, Sidebar
Definition module_api.h:91
void * neomutt_get_module_data(struct NeoMutt *n, enum ModuleId id)
Get the private data for a Module.
Definition neomutt.c:663
const struct MenuOpSeq SidebarDefaultBindings[]
Key bindings for the Sidebar Window.
Definition functions.c:72
static const struct MenuFuncOp OpSidebar[]
Functions for the Sidebar Window.
Definition functions.c:52
#define ASSERT(COND)
Definition signal2.h:59
Functions for a Dialog or Window.
Definition menu.h:77
Sidebar private Module data.
Definition module_data.h:32
struct MenuDefinition * md_sidebar
Sidebar Menu Definition.
Definition module_data.h:34
struct SubMenu * sm_sidebar
Sidebar functions.
Definition module_data.h:35
Collection of related functions.
Definition menu.h:65
@ MENU_SIDEBAR
Sidebar menu.
Definition type.h:49
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ sidebar_get_submenu()

struct SubMenu * sidebar_get_submenu ( void )

Get the Sidebar SubMenu.

Return values
ptrSidebar SubMenu

Definition at line 106 of file functions.c.

107{
109 ASSERT(mod_data);
110
111 return mod_data->sm_sidebar;
112}
Container for Accounts, Notifications.
Definition neomutt.h:41
+ Here is the call graph for this function:
+ Here is the caller graph for this function: