NeoMutt  2024-12-12-14-g7b49f7
Teaching an old dog new tricks
DOXYGEN
Loading...
Searching...
No Matches
ipanel.c File Reference

Index Panel. More...

#include "config.h"
#include <stdbool.h>
#include "private.h"
#include "mutt/lib.h"
#include "config/lib.h"
#include "core/lib.h"
#include "gui/lib.h"
#include "ibar.h"
#include "private_data.h"
+ Include dependency graph for ipanel.c:

Go to the source code of this file.

Functions

static int ipanel_config_observer (struct NotifyCallback *nc)
 Notification that a Config Variable has changed - Implements observer_t -.
 
static int ipanel_window_observer (struct NotifyCallback *nc)
 Notification that a Window has changed - Implements observer_t -.
 
struct MuttWindowipanel_new (bool status_on_top, struct IndexSharedData *shared)
 Create the Windows for the Index panel.
 

Detailed Description

Index 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 ipanel.c.

Function Documentation

◆ 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:338
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
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 mutt_window_add_child(struct MuttWindow *parent, struct MuttWindow *child)
Add a child to Window.
Definition: mutt_window.c:446
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:182
@ 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:39
#define MUTT_WIN_SIZE_UNLIMITED
Use as much space as possible.
Definition: mutt_window.h:53
@ MUTT_WIN_SIZE_MAXIMISE
Window wants as much space as possible.
Definition: mutt_window.h:49
@ NT_WINDOW
MuttWindow has changed, NotifyWindow, EventWindow.
Definition: notify_type.h:57
@ NT_CONFIG
Config has changed, NotifyConfig, EventConfig.
Definition: notify_type.h:43
struct Notify * notify
Notifications: NotifyConfig, EventConfig.
Definition: subset.h:52
Private state data for the Index.
Definition: private_data.h:35
struct IndexSharedData * shared
Shared Index data.
Definition: private_data.h:40
void * wdata
Private data.
Definition: mutt_window.h:145
struct Notify * notify
Notifications: NotifyWindow, EventWindow.
Definition: mutt_window.h:138
void(* wdata_free)(struct MuttWindow *win, void **ptr)
Definition: mutt_window.h:159
Container for Accounts, Notifications.
Definition: neomutt.h:42
struct ConfigSubset * sub
Inherited config items.
Definition: neomutt.h:46
+ Here is the call graph for this function:
+ Here is the caller graph for this function: