NeoMutt  2025-12-11-911-gd8d604
Teaching an old dog new tricks
DOXYGEN
Loading...
Searching...
No Matches
private.h File Reference

Private Index Functions. More...

#include <stdbool.h>
+ Include dependency graph for private.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  EmailFormatInfo
 Data passed to index_format_str() More...
 

Functions

struct MuttWindowindex_window_new (struct IndexPrivateData *priv)
 Create a new Index Window (list of Emails)
 
struct MuttWindowipanel_new (bool status_on_top, struct IndexSharedData *shared)
 Create the Windows for the Index panel.
 
int index_adjust_sort_threads (const struct ConfigSubset *sub)
 Adjust use_threads/sort/sort_aux.
 

Detailed Description

Private Index Functions.

Authors
  • Richard Russon
  • Pietro Cerutti

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

Function Documentation

◆ index_window_new()

struct MuttWindow * index_window_new ( struct IndexPrivateData * priv)

Create a new Index Window (list of Emails)

Parameters
privPrivate Index data
Return values
ptrNew Window

Definition at line 658 of file index.c.

659{
661 ASSERT(mod_data);
662
663 struct MuttWindow *win = menu_window_new(mod_data->menu_index, NeoMutt->sub);
664 win->recalc = index_recalc;
665 win->repaint = index_repaint;
666
667 struct Menu *menu = win->wdata;
668 menu->mdata = priv;
669 menu->mdata_free = NULL; // Menu doesn't own the data
670 priv->menu = menu;
671
682
683 return win;
684}
void mutt_color_observer_add(observer_t callback, void *global_data)
Add an observer.
Definition notify.c:62
static int index_color_observer(struct NotifyCallback *nc)
Notification that a Color has changed - Implements observer_t -.
Definition index.c:261
static int index_config_observer(struct NotifyCallback *nc)
Notification that a Config Variable has changed - Implements observer_t -.
Definition index.c:386
static int index_index_observer(struct NotifyCallback *nc)
Notification that the Index has changed - Implements observer_t -.
Definition index.c:456
static int index_menu_observer(struct NotifyCallback *nc)
Notification that the Menu has changed - Implements observer_t -.
Definition index.c:481
static int index_score_observer(struct NotifyCallback *nc)
Notification that a 'score' command has occurred - Implements observer_t -.
Definition index.c:503
static int index_subjectrx_observer(struct NotifyCallback *nc)
Notification that a 'subject-regex' command has occurred - Implements observer_t -.
Definition index.c:535
static int index_global_observer(struct NotifyCallback *nc)
Notification that a Global event occurred - Implements observer_t -.
Definition index.c:433
static int index_altern_observer(struct NotifyCallback *nc)
Notification that an 'alternates' command has occurred - Implements observer_t -.
Definition index.c:223
static int index_attach_observer(struct NotifyCallback *nc)
Notification that an 'attachments' command has occurred - Implements observer_t -.
Definition index.c:242
static int index_window_observer(struct NotifyCallback *nc)
Notification that a Window has changed - Implements observer_t -.
Definition index.c:554
static int index_recalc(struct MuttWindow *win)
Recalculate the Index display - Implements MuttWindow::recalc() -.
Definition index.c:594
static int index_repaint(struct MuttWindow *win)
Repaint the Index display - Implements MuttWindow::repaint() -.
Definition index.c:604
struct MuttWindow * menu_window_new(const struct MenuDefinition *md, struct ConfigSubset *sub)
Create a new Menu Window.
Definition window.c:140
@ MODULE_ID_INDEX
ModuleIndex, Index
Definition module_api.h:72
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
void * neomutt_get_module_data(struct NeoMutt *n, enum ModuleId id)
Get the private data for a Module.
Definition neomutt.c:663
@ NT_WINDOW
MuttWindow has changed, NotifyWindow, EventWindow.
Definition notify_type.h:58
@ NT_MENU
Menu has changed, MenuRedrawFlags.
Definition notify_type.h:52
@ NT_ATTACH
Attachment command changed, NotifyAttach.
Definition notify_type.h:39
@ NT_CONFIG
Config has changed, NotifyConfig, EventConfig.
Definition notify_type.h:43
@ NT_SCORE
Email scoring has changed.
Definition notify_type.h:55
@ NT_SUBJECTRX
Subject Regex has changed, NotifySubjectRx.
Definition notify_type.h:56
@ NT_ALL
Register for all notifications.
Definition notify_type.h:35
@ NT_GLOBAL
Not object-related, NotifyGlobal.
Definition notify_type.h:46
@ NT_ALTERN
Alternates command changed, NotifyAlternates.
Definition notify_type.h:38
#define ASSERT(COND)
Definition signal2.h:59
struct Notify * notify
Notifications: NotifyConfig, EventConfig.
Definition subset.h:51
Index private Module data.
Definition module_data.h:32
struct MenuDefinition * menu_index
Index menu definition.
Definition module_data.h:34
struct IndexSharedData * shared
Shared Index data.
struct Menu * menu
Menu controlling the index.
struct Notify * notify
Notifications: NotifyIndex, IndexSharedData.
Definition shared_data.h:44
Definition lib.h:86
struct MuttWindow * win
Window holding the Menu.
Definition lib.h:94
void(* mdata_free)(struct Menu *menu, void **ptr)
Definition lib.h:169
struct Notify * notify
Notifications.
Definition lib.h:153
void * mdata
Private data.
Definition lib.h:155
int(* repaint)(struct MuttWindow *win)
void * wdata
Private data.
struct Notify * notify
Notifications: NotifyWindow, EventWindow.
int(* recalc)(struct MuttWindow *win)
Container for Accounts, Notifications.
Definition neomutt.h:41
struct Notify * notify
Notifications handler.
Definition neomutt.h:45
struct ConfigSubset * sub
Inherited config items.
Definition neomutt.h:49
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ipanel_new()

struct MuttWindow * ipanel_new ( bool status_on_top,
struct IndexSharedData * shared )

Create the Windows for the Index panel.

Parameters
status_on_toptrue, if the Index bar should be on top
sharedShared Index data
Return values
ptrNew Index Panel

Definition at line 121 of file ipanel.c.

122{
126
128 panel_index->wdata = priv;
129 panel_index->wdata_free = index_private_data_free;
130
131 struct MuttWindow *win_index = index_window_new(priv);
132
133 struct MuttWindow *win_ibar = ibar_new(panel_index, shared, priv);
134 if (status_on_top)
135 {
136 mutt_window_add_child(panel_index, win_ibar);
137 mutt_window_add_child(panel_index, win_index);
138 }
139 else
140 {
141 mutt_window_add_child(panel_index, win_index);
142 mutt_window_add_child(panel_index, win_ibar);
143 }
144
146 notify_observer_add(panel_index->notify, NT_WINDOW, ipanel_window_observer, panel_index);
147
148 return panel_index;
149}
static int ipanel_config_observer(struct NotifyCallback *nc)
Notification that a Config Variable has changed - Implements observer_t -.
Definition ipanel.c:72
static int ipanel_window_observer(struct NotifyCallback *nc)
Notification that a Window has changed - Implements observer_t -.
Definition ipanel.c:94
void index_private_data_free(struct MuttWindow *win, void **ptr)
Free Private Index Data - Implements MuttWindow::wdata_free() -.
struct MuttWindow * ibar_new(struct MuttWindow *parent, struct IndexSharedData *shared, struct IndexPrivateData *priv)
Create the Index Bar (status)
Definition ibar.c:343
struct IndexPrivateData * index_private_data_new(struct IndexSharedData *shared)
Create new Index Data.
struct MuttWindow * index_window_new(struct IndexPrivateData *priv)
Create a new Index Window (list of Emails)
Definition index.c:658
void mutt_window_add_child(struct MuttWindow *parent, struct MuttWindow *child)
Add a child to Window.
struct MuttWindow * mutt_window_new(enum WindowType type, enum MuttWindowOrientation orient, enum MuttWindowSize size, int cols, int rows)
Create a new Window.
@ WT_INDEX
A panel containing the Index Window.
Definition mutt_window.h:97
@ MUTT_WIN_ORIENT_VERTICAL
Window uses all available vertical space.
Definition mutt_window.h:38
#define MUTT_WIN_SIZE_UNLIMITED
Use as much space as possible.
Definition mutt_window.h:52
@ MUTT_WIN_SIZE_MAXIMISE
Window wants as much space as possible.
Definition mutt_window.h:48
Private state data for the Index.
void(* wdata_free)(struct MuttWindow *win, void **ptr)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ index_adjust_sort_threads()

int index_adjust_sort_threads ( const struct ConfigSubset * sub)

Adjust use_threads/sort/sort_aux.

Parameters
subthe config subset that was just updated

Definition at line 185 of file index.c.

186{
187 /* For lack of a better way, we fake a "set use_threads" */
189}
static int config_use_threads(const struct ConfigSubset *sub)
React to changes to "use_threads".
Definition index.c:161
+ Here is the call graph for this function:
+ Here is the caller graph for this function: