NeoMutt  2024-10-02-37-gfa9146
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.

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 651 of file index.c.

652{
654 win->recalc = index_recalc;
655 win->repaint = index_repaint;
656
657 struct Menu *menu = win->wdata;
658 menu->mdata = priv;
659 menu->mdata_free = NULL; // Menu doesn't own the data
660 priv->menu = menu;
661
672
673 return win;
674}
void mutt_color_observer_add(observer_t callback, void *global_data)
Add an observer.
Definition: notify.c:59
static int index_color_observer(struct NotifyCallback *nc)
Notification that a Color has changed - Implements observer_t -.
Definition: index.c:260
static int index_config_observer(struct NotifyCallback *nc)
Notification that a Config Variable has changed - Implements observer_t -.
Definition: index.c:385
static int index_index_observer(struct NotifyCallback *nc)
Notification that the Index has changed - Implements observer_t -.
Definition: index.c:449
static int index_menu_observer(struct NotifyCallback *nc)
Notification that the Menu has changed - Implements observer_t -.
Definition: index.c:474
static int index_score_observer(struct NotifyCallback *nc)
Notification that a 'score' command has occurred - Implements observer_t -.
Definition: index.c:496
static int index_global_observer(struct NotifyCallback *nc)
Notification that a Global event occurred - Implements observer_t -.
Definition: index.c:426
static int index_altern_observer(struct NotifyCallback *nc)
Notification that an 'alternates' command has occurred - Implements observer_t -.
Definition: index.c:222
static int index_subjrx_observer(struct NotifyCallback *nc)
Notification that a 'subjectrx' command has occurred - Implements observer_t -.
Definition: index.c:528
static int index_attach_observer(struct NotifyCallback *nc)
Notification that an 'attachments' command has occurred - Implements observer_t -.
Definition: index.c:241
static int index_window_observer(struct NotifyCallback *nc)
Notification that a Window has changed - Implements observer_t -.
Definition: index.c:547
static int index_recalc(struct MuttWindow *win)
Recalculate the Index display - Implements MuttWindow::recalc() -.
Definition: index.c:587
static int index_repaint(struct MuttWindow *win)
Repaint the Index display - Implements MuttWindow::repaint() -.
Definition: index.c:597
struct MuttWindow * menu_window_new(enum MenuType type, struct ConfigSubset *sub)
Create a new Menu Window.
Definition: window.c:140
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:57
@ NT_MENU
Menu has changed, MenuRedrawFlags.
Definition: notify_type.h:51
@ 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:54
@ 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
@ NT_SUBJRX
Subject Regex has changed, NotifySubjRx.
Definition: notify_type.h:55
struct Notify * notify
Notifications: NotifyConfig, EventConfig.
Definition: subset.h:52
struct IndexSharedData * shared
Shared Index data.
Definition: private_data.h:40
struct Menu * menu
Menu controlling the index.
Definition: private_data.h:41
struct Notify * notify
Notifications: NotifyIndex, IndexSharedData.
Definition: shared_data.h:44
Definition: lib.h:79
struct MuttWindow * win
Window holding the Menu.
Definition: lib.h:86
void(* mdata_free)(struct Menu *menu, void **ptr)
Definition: lib.h:161
struct Notify * notify
Notifications.
Definition: lib.h:145
void * mdata
Private data.
Definition: lib.h:147
int(* repaint)(struct MuttWindow *win)
Definition: mutt_window.h:186
void * wdata
Private data.
Definition: mutt_window.h:144
struct Notify * notify
Notifications: NotifyWindow, EventWindow.
Definition: mutt_window.h:137
int(* recalc)(struct MuttWindow *win)
Definition: mutt_window.h:172
Container for Accounts, Notifications.
Definition: neomutt.h:42
struct Notify * notify
Notifications handler.
Definition: neomutt.h:43
struct ConfigSubset * sub
Inherited config items.
Definition: neomutt.h:46
@ MENU_INDEX
Index panel (list of emails)
Definition: type.h:51
+ 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() -.
Definition: private_data.c:36
struct MuttWindow * ibar_new(struct MuttWindow *parent, struct IndexSharedData *shared, struct IndexPrivateData *priv)
Create the Index Bar (status)
Definition: ibar.c:337
struct IndexPrivateData * index_private_data_new(struct IndexSharedData *shared)
Create new Index Data.
Definition: private_data.c:49
struct MuttWindow * index_window_new(struct IndexPrivateData *priv)
Create a new Index Window (list of Emails)
Definition: index.c:651
void mutt_window_add_child(struct MuttWindow *parent, struct MuttWindow *child)
Add a child to Window.
Definition: mutt_window.c:445
struct MuttWindow * mutt_window_new(enum WindowType type, enum MuttWindowOrientation orient, enum MuttWindowSize size, int cols, int rows)
Create a new Window.
Definition: mutt_window.c:181
@ WT_INDEX
A panel containing the Index Window.
Definition: mutt_window.h:96
@ 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.
Definition: private_data.h:35
void(* wdata_free)(struct MuttWindow *win, void **ptr)
Definition: mutt_window.h:158
+ 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 184 of file index.c.

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