NeoMutt  2023-03-22
Teaching an old dog new tricks
DOXYGEN
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) More...
 
struct MuttWindowipanel_new (bool status_on_top, struct IndexSharedData *shared)
 Create the Windows for the Index panel. More...
 
int index_adjust_sort_threads (const struct ConfigSubset *sub)
 Adjust use_threads/sort/sort_aux. More...
 

Detailed Description

Private Index Functions.

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

Function Documentation

◆ index_window_new()

struct MuttWindow * index_window_new ( struct IndexPrivateData priv)

Create a new Index Window (list of Emails)

Return values
ptrNew Window

Definition at line 586 of file index.c.

587{
589 win->recalc = index_recalc;
590 win->repaint = index_repaint;
591
592 struct Menu *menu = win->wdata;
593 menu->mdata = priv;
594 menu->mdata_free = NULL; // Menu doesn't own the data
595 priv->menu = menu;
596
607
608 return win;
609}
static int index_color_observer(struct NotifyCallback *nc)
Notification that a Color has changed - Implements observer_t -.
Definition: index.c:266
static int index_config_observer(struct NotifyCallback *nc)
Notification that a Config Variable has changed - Implements observer_t -.
Definition: index.c:320
static int index_index_observer(struct NotifyCallback *nc)
Notification that the Index has changed - Implements observer_t -.
Definition: index.c:390
static int index_menu_observer(struct NotifyCallback *nc)
Notification that the Menu has changed - Implements observer_t -.
Definition: index.c:415
static int index_score_observer(struct NotifyCallback *nc)
Notification that a 'score' command has occurred - Implements observer_t -.
Definition: index.c:437
static int index_global_observer(struct NotifyCallback *nc)
Notification that a Global event occurred - Implements observer_t -.
Definition: index.c:367
static int index_altern_observer(struct NotifyCallback *nc)
Notification that an 'alternates' command has occurred - Implements observer_t -.
Definition: index.c:228
static int index_subjrx_observer(struct NotifyCallback *nc)
Notification that a 'subjectrx' command has occurred - Implements observer_t -.
Definition: index.c:469
static int index_attach_observer(struct NotifyCallback *nc)
Notification that an 'attachments' command has occurred - Implements observer_t -.
Definition: index.c:247
static int index_window_observer(struct NotifyCallback *nc)
Notification that a Window has changed - Implements observer_t -.
Definition: index.c:488
static int index_recalc(struct MuttWindow *win)
Recalculate the Index display - Implements MuttWindow::recalc() -.
Definition: index.c:527
static int index_repaint(struct MuttWindow *win)
Repaint the Index display - Implements MuttWindow::repaint() -.
Definition: index.c:537
struct MuttWindow * menu_window_new(enum MenuType type, struct ConfigSubset *sub)
Create a new Menu Window.
Definition: window.c:136
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:189
@ NT_WINDOW
MuttWindow has changed, NotifyWindow, EventWindow.
Definition: notify_type.h:55
@ 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_COLOR
Colour has changed, NotifyColor, EventColor.
Definition: notify_type.h:41
@ NT_SCORE
Email scoring has changed.
Definition: notify_type.h:53
@ 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:54
struct IndexSharedData * shared
Shared Index data.
Definition: private_data.h:42
struct Menu * menu
Menu controlling the index.
Definition: private_data.h:43
struct Notify * notify
Notifications: NotifyIndex, IndexSharedData.
Definition: shared_data.h:44
Definition: lib.h:70
struct MuttWindow * win
Window holding the Menu.
Definition: lib.h:77
void(* mdata_free)(struct Menu *menu, void **ptr)
Definition: lib.h:152
struct Notify * notify
Notifications.
Definition: lib.h:136
void * mdata
Private data.
Definition: lib.h:138
int(* repaint)(struct MuttWindow *win)
Definition: mutt_window.h:181
void * wdata
Private data.
Definition: mutt_window.h:145
struct Notify * notify
Notifications: NotifyWindow, EventWindow.
Definition: mutt_window.h:138
int(* recalc)(struct MuttWindow *win)
Definition: mutt_window.h:170
Container for Accounts, Notifications.
Definition: neomutt.h:37
struct Notify * notify
Notifications handler.
Definition: neomutt.h:38
struct ConfigSubset * sub
Inherited config items.
Definition: neomutt.h:39
@ MENU_INDEX
Index panel (list of emails)
Definition: type.h:50
+ 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 panel_index->focus = win_index;
133
134 struct MuttWindow *win_ibar = ibar_new(panel_index, shared, priv);
135 if (status_on_top)
136 {
137 mutt_window_add_child(panel_index, win_ibar);
138 mutt_window_add_child(panel_index, win_index);
139 }
140 else
141 {
142 mutt_window_add_child(panel_index, win_index);
143 mutt_window_add_child(panel_index, win_ibar);
144 }
145
147 notify_observer_add(panel_index->notify, NT_WINDOW, ipanel_window_observer, panel_index);
148
149 return panel_index;
150}
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:331
struct IndexPrivateData * index_private_data_new(struct IndexSharedData *shared)
Create new Index Data.
Definition: private_data.c:51
struct MuttWindow * index_window_new(struct IndexPrivateData *priv)
Create a new Index Window (list of Emails)
Definition: index.c:586
void mutt_window_add_child(struct MuttWindow *parent, struct MuttWindow *child)
Add a child to Window.
Definition: mutt_window.c:438
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:180
@ 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.
Definition: private_data.h:35
struct MuttWindow * focus
Focused Window.
Definition: mutt_window.h:140
void(* wdata_free)(struct MuttWindow *win, void **ptr)
Definition: mutt_window.h:159
+ 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 181 of file index.c.

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