NeoMutt  2024-04-25-89-g194907
Teaching an old dog new tricks
DOXYGEN
Loading...
Searching...
No Matches
cbar.c File Reference

Compose Bar (status) More...

#include "config.h"
#include <stddef.h>
#include "private.h"
#include "mutt/lib.h"
#include "config/lib.h"
#include "email/lib.h"
#include "core/lib.h"
#include "gui/lib.h"
#include "cbar.h"
#include "color/lib.h"
#include "expando/lib.h"
#include "index/lib.h"
#include "menu/lib.h"
#include "attach_data.h"
#include "cbar_data.h"
#include "globals.h"
#include "muttlib.h"
#include "shared_data.h"
+ Include dependency graph for cbar.c:

Go to the source code of this file.

Functions

static int num_attachments (const struct ComposeAttachData *adata)
 Count the number of attachments.
 
long compose_a_num (const struct ExpandoNode *node, void *data, MuttFormatFlags flags)
 Compose: Number of attachments - Implements ExpandoRenderData::get_number() -.
 
void compose_h (const struct ExpandoNode *node, void *data, MuttFormatFlags flags, int max_cols, struct Buffer *buf)
 Compose: Hostname - Implements ExpandoRenderData::get_string() -.
 
long compose_l_num (const struct ExpandoNode *node, void *data, MuttFormatFlags flags)
 Compose: Size in bytes - Implements ExpandoRenderData::get_number() -.
 
void compose_l (const struct ExpandoNode *node, void *data, MuttFormatFlags flags, int max_cols, struct Buffer *buf)
 Compose: Size in bytes - Implements ExpandoRenderData::get_string() -.
 
void compose_v (const struct ExpandoNode *node, void *data, MuttFormatFlags flags, int max_cols, struct Buffer *buf)
 Compose: Version - Implements ExpandoRenderData::get_string() -.
 
static int cbar_recalc (struct MuttWindow *win)
 Recalculate the Window data - Implements MuttWindow::recalc() -.
 
static int cbar_repaint (struct MuttWindow *win)
 Repaint the Window - Implements MuttWindow::repaint() -.
 
int cbar_color_observer (struct NotifyCallback *nc)
 Notification that a Color has changed - Implements observer_t -.
 
int cbar_config_observer (struct NotifyCallback *nc)
 Notification that a Config Variable has changed - Implements observer_t -.
 
static int cbar_email_observer (struct NotifyCallback *nc)
 Notification that the Email has changed - Implements observer_t -.
 
static int cbar_window_observer (struct NotifyCallback *nc)
 Notification that a Window has changed - Implements observer_t -.
 
struct MuttWindowcbar_new (struct ComposeSharedData *shared)
 Create the Compose Bar (status)
 

Variables

const struct ExpandoRenderData ComposeRenderData []
 Callbacks for Compose Expandos.
 

Detailed Description

Compose 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 cbar.c.

Function Documentation

◆ num_attachments()

static int num_attachments ( const struct ComposeAttachData adata)
static

Count the number of attachments.

Parameters
adataAttachment data
Return values
numNumber of attachments

Definition at line 88 of file cbar.c.

89{
90 if (!adata || !adata->menu)
91 return 0;
92 return adata->menu->max;
93}
struct Menu * menu
Menu displaying the attachments.
Definition: attach_data.h:35
int max
Number of entries in the menu.
Definition: lib.h:81
+ Here is the caller graph for this function:

◆ cbar_new()

struct MuttWindow * cbar_new ( struct ComposeSharedData shared)

Create the Compose Bar (status)

Parameters
sharedShared compose data

Definition at line 298 of file cbar.c.

299{
303
304 win_cbar->wdata = cbar_data_new();
305 win_cbar->wdata_free = cbar_data_free;
306 win_cbar->recalc = cbar_recalc;
307 win_cbar->repaint = cbar_repaint;
308
313
314 return win_cbar;
315}
struct ComposeBarData * cbar_data_new(void)
Create the private data for the Compose Bar.
Definition: cbar_data.c:52
void mutt_color_observer_add(observer_t callback, void *global_data)
Add an observer.
Definition: notify.c:59
int cbar_color_observer(struct NotifyCallback *nc)
Notification that a Color has changed - Implements observer_t -.
Definition: cbar.c:197
int cbar_config_observer(struct NotifyCallback *nc)
Notification that a Config Variable has changed - Implements observer_t -.
Definition: cbar.c:223
static int cbar_window_observer(struct NotifyCallback *nc)
Notification that a Window has changed - Implements observer_t -.
Definition: cbar.c:261
static int cbar_email_observer(struct NotifyCallback *nc)
Notification that the Email has changed - Implements observer_t -.
Definition: cbar.c:244
static int cbar_recalc(struct MuttWindow *win)
Recalculate the Window data - Implements MuttWindow::recalc() -.
Definition: cbar.c:153
static int cbar_repaint(struct MuttWindow *win)
Repaint the Window - Implements MuttWindow::repaint() -.
Definition: cbar.c:177
void cbar_data_free(struct MuttWindow *win, void **ptr)
Free the private Compose Bar data - Implements MuttWindow::wdata_free() -.
Definition: cbar_data.c:36
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_CONFIG
Config has changed, NotifyConfig, EventConfig.
Definition: notify_type.h:43
@ NT_EMAIL
Email has changed, NotifyEmail, EventEmail.
Definition: notify_type.h:44
struct Email * email
Email being composed.
Definition: shared_data.h:38
struct Notify * notify
Notifications: NotifyConfig, EventConfig.
Definition: subset.h:52
struct Notify * notify
Notifications: NotifyEmail, EventEmail.
Definition: email.h:73
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
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:

Variable Documentation

◆ ComposeRenderData

const struct ExpandoRenderData ComposeRenderData
Initial value:
= {
{ -1, -1, NULL, NULL },
}
@ ED_COM_ATTACH_COUNT
ComposeAttachData, num_attachments()
Definition: shared_data.h:56
@ ED_COM_ATTACH_SIZE
ComposeAttachData, cum_attachs_size()
Definition: shared_data.h:57
@ ED_COMPOSE
Compose ED_COM_ ExpandoDataCompose.
Definition: domain.h:39
@ ED_GLOBAL
Global ED_GLO_ ExpandoDataGlobal.
Definition: domain.h:44
long compose_a_num(const struct ExpandoNode *node, void *data, MuttFormatFlags flags)
Compose: Number of attachments - Implements ExpandoRenderData::get_number() -.
Definition: cbar.c:98
long compose_l_num(const struct ExpandoNode *node, void *data, MuttFormatFlags flags)
Compose: Size in bytes - Implements ExpandoRenderData::get_number() -.
Definition: cbar.c:118
void compose_h(const struct ExpandoNode *node, void *data, MuttFormatFlags flags, int max_cols, struct Buffer *buf)
Compose: Hostname - Implements ExpandoRenderData::get_string() -.
Definition: cbar.c:108
void compose_v(const struct ExpandoNode *node, void *data, MuttFormatFlags flags, int max_cols, struct Buffer *buf)
Compose: Version - Implements ExpandoRenderData::get_string() -.
Definition: cbar.c:141
void compose_l(const struct ExpandoNode *node, void *data, MuttFormatFlags flags, int max_cols, struct Buffer *buf)
Compose: Size in bytes - Implements ExpandoRenderData::get_string() -.
Definition: cbar.c:127
@ ED_GLO_VERSION
NeoMutt version.
Definition: uid.h:43
@ ED_GLO_HOSTNAME
Local hostname.
Definition: uid.h:35

Callbacks for Compose Expandos.

See also
ComposeFormatDef, ExpandoDataCompose, ExpandoDataGlobal

Definition at line 81 of file cbar.c.