NeoMutt  2024-10-02-37-gfa9146
Teaching an old dog new tricks
DOXYGEN
Loading...
Searching...
No Matches
pbar.c File Reference

Pager Bar. More...

#include "config.h"
#include <stdio.h>
#include <sys/stat.h>
#include "mutt/lib.h"
#include "config/lib.h"
#include "core/lib.h"
#include "gui/lib.h"
#include "pbar.h"
#include "lib.h"
#include "color/lib.h"
#include "expando/lib.h"
#include "index/lib.h"
#include "display.h"
#include "hdrline.h"
#include "mview.h"
#include "private_data.h"
+ Include dependency graph for pbar.c:

Go to the source code of this file.

Data Structures

struct  PBarPrivateData
 Data to draw the Pager Bar. More...
 

Functions

static int pbar_recalc (struct MuttWindow *win)
 Recalculate the Window data - Implements MuttWindow::recalc() -.
 
static int pbar_repaint (struct MuttWindow *win)
 Repaint the Window - Implements MuttWindow::repaint() -.
 
static int pbar_color_observer (struct NotifyCallback *nc)
 Notification that a Color has changed - Implements observer_t -.
 
static int pbar_config_observer (struct NotifyCallback *nc)
 Notification that a Config Variable has changed - Implements observer_t -.
 
static int pbar_index_observer (struct NotifyCallback *nc)
 Notification that the Index has changed - Implements observer_t -.
 
static int pbar_pager_observer (struct NotifyCallback *nc)
 Notification that the Pager has changed - Implements observer_t -.
 
static int pbar_window_observer (struct NotifyCallback *nc)
 Notification that a Window has changed - Implements observer_t -.
 
static void pbar_data_free (struct MuttWindow *win, void **ptr)
 Free the private data - Implements MuttWindow::wdata_free() -.
 
static struct PBarPrivateDatapbar_data_new (struct IndexSharedData *shared, struct PagerPrivateData *priv)
 Create new private data.
 
struct MuttWindowpbar_new (struct IndexSharedData *shared, struct PagerPrivateData *priv)
 Create the Pager Bar.
 

Detailed Description

Pager Bar.

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

Function Documentation

◆ pbar_data_new()

static struct PBarPrivateData * pbar_data_new ( struct IndexSharedData shared,
struct PagerPrivateData priv 
)
static

Create new private data.

Parameters
sharedShared Index data
privPrivate Index data
Return values
ptrNew PBar

Definition at line 314 of file pbar.c.

316{
317 struct PBarPrivateData *pbar_data = mutt_mem_calloc(1, sizeof(struct PBarPrivateData));
318
319 pbar_data->shared = shared;
320 pbar_data->priv = priv;
321
322 return pbar_data;
323}
void * mutt_mem_calloc(size_t nmemb, size_t size)
Allocate zeroed memory on the heap.
Definition: memory.c:51
Data to draw the Pager Bar.
Definition: pbar.c:83
struct PagerPrivateData * priv
Private Pager data.
Definition: pbar.c:85
struct IndexSharedData * shared
Shared Index data.
Definition: pbar.c:84
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ pbar_new()

struct MuttWindow * pbar_new ( struct IndexSharedData shared,
struct PagerPrivateData priv 
)

Create the Pager Bar.

Parameters
sharedShared Pager data
privPrivate Pager data
Return values
ptrNew Pager Bar

Definition at line 331 of file pbar.c.

332{
336
337 win_pbar->wdata = pbar_data_new(shared, priv);
338 win_pbar->wdata_free = pbar_data_free;
339 win_pbar->recalc = pbar_recalc;
340 win_pbar->repaint = pbar_repaint;
341
347
348 return win_pbar;
349}
void mutt_color_observer_add(observer_t callback, void *global_data)
Add an observer.
Definition: notify.c:59
static int pbar_window_observer(struct NotifyCallback *nc)
Notification that a Window has changed - Implements observer_t -.
Definition: pbar.c:259
static int pbar_color_observer(struct NotifyCallback *nc)
Notification that a Color has changed - Implements observer_t -.
Definition: pbar.c:173
static int pbar_config_observer(struct NotifyCallback *nc)
Notification that a Config Variable has changed - Implements observer_t -.
Definition: pbar.c:196
static int pbar_pager_observer(struct NotifyCallback *nc)
Notification that the Pager has changed - Implements observer_t -.
Definition: pbar.c:238
static int pbar_index_observer(struct NotifyCallback *nc)
Notification that the Index has changed - Implements observer_t -.
Definition: pbar.c:223
static int pbar_recalc(struct MuttWindow *win)
Recalculate the Window data - Implements MuttWindow::recalc() -.
Definition: pbar.c:92
static int pbar_repaint(struct MuttWindow *win)
Repaint the Window - Implements MuttWindow::repaint() -.
Definition: pbar.c:153
static void pbar_data_free(struct MuttWindow *win, void **ptr)
Free the private data - Implements MuttWindow::wdata_free() -.
Definition: pbar.c:296
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:181
@ WT_STATUS_BAR
Status Bar containing extra info about the Index/Pager/etc.
Definition: mutt_window.h:101
@ 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_CONFIG
Config has changed, NotifyConfig, EventConfig.
Definition: notify_type.h:43
@ NT_PAGER
Pager data has changed, NotifyPager, PagerPrivateData.
Definition: notify_type.h:53
@ NT_ALL
Register for all notifications.
Definition: notify_type.h:35
static struct PBarPrivateData * pbar_data_new(struct IndexSharedData *shared, struct PagerPrivateData *priv)
Create new private data.
Definition: pbar.c:314
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: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
void(* wdata_free)(struct MuttWindow *win, void **ptr)
Definition: mutt_window.h:158
Container for Accounts, Notifications.
Definition: neomutt.h:42
struct ConfigSubset * sub
Inherited config items.
Definition: neomutt.h:46
struct Notify * notify
Notifications: NotifyPager, PagerPrivateData.
Definition: private_data.h:71
+ Here is the call graph for this function:
+ Here is the caller graph for this function: