NeoMutt  2024-03-23-147-g885fbc
Teaching an old dog new tricks
DOXYGEN
Loading...
Searching...
No Matches
ibar.c File Reference

Index Bar (status) More...

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

Go to the source code of this file.

Data Structures

struct  IBarPrivateData
 Data to draw the Index Bar. More...
 

Functions

static int ibar_recalc (struct MuttWindow *win)
 Recalculate the Window data - Implements MuttWindow::recalc() -.
 
static int ibar_repaint (struct MuttWindow *win)
 Repaint the Window - Implements MuttWindow::repaint() -.
 
static int ibar_color_observer (struct NotifyCallback *nc)
 Notification that a Color has changed - Implements observer_t -.
 
static int ibar_config_observer (struct NotifyCallback *nc)
 Notification that a Config Variable has changed - Implements observer_t -.
 
static int ibar_index_observer (struct NotifyCallback *nc)
 Notification that the Index has changed - Implements observer_t -.
 
static int ibar_menu_observer (struct NotifyCallback *nc)
 Notification that a Menu has changed - Implements observer_t -.
 
static int ibar_window_observer (struct NotifyCallback *nc)
 Notification that a Window has changed - Implements observer_t -.
 
static void ibar_data_free (struct MuttWindow *win, void **ptr)
 Free the private data - Implements MuttWindow::wdata_free() -.
 
static struct IBarPrivateDataibar_data_new (struct IndexSharedData *shared, struct IndexPrivateData *priv)
 Create the private data for the Index Bar (status)
 
struct MuttWindowibar_new (struct MuttWindow *parent, struct IndexSharedData *shared, struct IndexPrivateData *priv)
 Create the Index Bar (status)
 

Detailed Description

Index Bar (status)

Authors
  • Richard Russon
  • Tóth János

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 ibar.c.

Function Documentation

◆ ibar_data_new()

static struct IBarPrivateData * ibar_data_new ( struct IndexSharedData shared,
struct IndexPrivateData priv 
)
static

Create the private data for the Index Bar (status)

Parameters
sharedShared Index data
privPrivate Index data
Return values
ptrNew IBarPrivateData

Definition at line 319 of file ibar.c.

321{
322 struct IBarPrivateData *ibar_data = mutt_mem_calloc(1, sizeof(struct IBarPrivateData));
323
324 ibar_data->shared = shared;
325 ibar_data->priv = priv;
326
327 return ibar_data;
328}
void * mutt_mem_calloc(size_t nmemb, size_t size)
Allocate zeroed memory on the heap.
Definition: memory.c:50
Data to draw the Index Bar.
Definition: ibar.c:79
struct IndexSharedData * shared
Shared Index data.
Definition: ibar.c:80
struct IndexPrivateData * priv
Private Index data.
Definition: ibar.c:81
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ibar_new()

struct MuttWindow * ibar_new ( struct MuttWindow parent,
struct IndexSharedData shared,
struct IndexPrivateData priv 
)

Create the Index Bar (status)

Parameters
parentParent Window
sharedShared Index data
privPrivate Index data
Return values
ptrNew Index Bar

Definition at line 337 of file ibar.c.

339{
343
344 win_ibar->wdata = ibar_data_new(shared, priv);
345 win_ibar->wdata_free = ibar_data_free;
346 win_ibar->recalc = ibar_recalc;
347 win_ibar->repaint = ibar_repaint;
348
354
355 return win_ibar;
356}
void mutt_color_observer_add(observer_t callback, void *global_data)
Add an observer.
Definition: notify.c:59
static int ibar_menu_observer(struct NotifyCallback *nc)
Notification that a Menu has changed - Implements observer_t -.
Definition: ibar.c:245
static int ibar_window_observer(struct NotifyCallback *nc)
Notification that a Window has changed - Implements observer_t -.
Definition: ibar.c:262
static int ibar_config_observer(struct NotifyCallback *nc)
Notification that a Config Variable has changed - Implements observer_t -.
Definition: ibar.c:193
static int ibar_color_observer(struct NotifyCallback *nc)
Notification that a Color has changed - Implements observer_t -.
Definition: ibar.c:167
static int ibar_index_observer(struct NotifyCallback *nc)
Notification that the Index has changed - Implements observer_t -.
Definition: ibar.c:230
static int ibar_recalc(struct MuttWindow *win)
Recalculate the Window data - Implements MuttWindow::recalc() -.
Definition: ibar.c:90
static int ibar_repaint(struct MuttWindow *win)
Repaint the Window - Implements MuttWindow::repaint() -.
Definition: ibar.c:139
static void ibar_data_free(struct MuttWindow *win, void **ptr)
Free the private data - Implements MuttWindow::wdata_free() -.
Definition: ibar.c:299
static struct IBarPrivateData * ibar_data_new(struct IndexSharedData *shared, struct IndexPrivateData *priv)
Create the private data for the Index Bar (status)
Definition: ibar.c:319
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
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_STATUS_BAR
Status Bar containing extra info about the Index/Pager/etc.
Definition: mutt_window.h:102
@ 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_FIXED
Window has a fixed size.
Definition: mutt_window.h:47
@ NT_WINDOW
MuttWindow has changed, NotifyWindow, EventWindow.
Definition: notify_type.h:57
@ NT_MENU
Menu has changed, MenuRedrawFlags.
Definition: notify_type.h:51
@ NT_CONFIG
Config has changed, NotifyConfig, EventConfig.
Definition: notify_type.h:43
@ NT_ALL
Register for all notifications.
Definition: notify_type.h:35
struct Notify * notify
Notifications: NotifyConfig, EventConfig.
Definition: subset.h:52
struct Notify * notify
Notifications: NotifyIndex, IndexSharedData.
Definition: shared_data.h:44
int(* repaint)(struct MuttWindow *win)
Definition: mutt_window.h:187
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:173
void(* wdata_free)(struct MuttWindow *win, void **ptr)
Definition: mutt_window.h:159
struct MuttWindow * parent
Parent Window.
Definition: mutt_window.h:135
Container for Accounts, Notifications.
Definition: neomutt.h:41
struct ConfigSubset * sub
Inherited config items.
Definition: neomutt.h:45
+ Here is the call graph for this function:
+ Here is the caller graph for this function: