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

GUI display a user-configurable status line. More...

#include "config.h"
#include <stdbool.h>
#include <stdio.h>
#include <sys/types.h>
#include "mutt/lib.h"
#include "config/lib.h"
#include "core/lib.h"
#include "status.h"
#include "expando/lib.h"
#include "index/lib.h"
#include "menu/lib.h"
#include "postpone/lib.h"
#include "globals.h"
#include "mutt_mailbox.h"
#include "mutt_thread.h"
#include "muttlib.h"
#include "mview.h"
+ Include dependency graph for status.c:

Go to the source code of this file.

Data Structures

struct  MenuStatusLineData
 Data for creating a Menu line. More...
 

Functions

void status_f (const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf)
 Status: pathname of the mailbox - Implements ExpandoRenderData::get_string() -.
 
static char * get_sort_str (char *buf, size_t buflen, enum SortType method)
 Get the sort method as a string.
 
void status_r (const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf)
 Status: Modified/read-only flag - Implements ExpandoRenderData::get_string() -.
 
void status_D (const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf)
 Status: Description of the mailbox - Implements ExpandoRenderData::get_string() -.
 
long status_M_num (const struct ExpandoNode *node, void *data, MuttFormatFlags flags)
 Status: Number of messages - Implements ExpandoRenderData::get_number() -.
 
long status_m_num (const struct ExpandoNode *node, void *data, MuttFormatFlags flags)
 Status: Number of messages in the mailbox - Implements ExpandoRenderData::get_number() -.
 
long status_n_num (const struct ExpandoNode *node, void *data, MuttFormatFlags flags)
 Status: Number of new messages - Implements ExpandoRenderData::get_number() -.
 
long status_o_num (const struct ExpandoNode *node, void *data, MuttFormatFlags flags)
 Status: Number of old messages - Implements ExpandoRenderData::get_number() -.
 
long status_d_num (const struct ExpandoNode *node, void *data, MuttFormatFlags flags)
 Status: Number of deleted messages - Implements ExpandoRenderData::get_number() -.
 
long status_F_num (const struct ExpandoNode *node, void *data, MuttFormatFlags flags)
 Status: Number of flagged messages - Implements ExpandoRenderData::get_number() -.
 
long status_t_num (const struct ExpandoNode *node, void *data, MuttFormatFlags flags)
 Status: Number of tagged messages - Implements ExpandoRenderData::get_number() -.
 
long status_p_num (const struct ExpandoNode *node, void *data, MuttFormatFlags flags)
 Status: Number of postponed messages - Implements ExpandoRenderData::get_number() -.
 
long status_b_num (const struct ExpandoNode *node, void *data, MuttFormatFlags flags)
 Status: Number of mailboxes with new mail - Implements ExpandoRenderData::get_number() -.
 
long status_l_num (const struct ExpandoNode *node, void *data, MuttFormatFlags flags)
 Status: Size of the current mailbox - Implements ExpandoRenderData::get_number() -.
 
void status_l (const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf)
 Status: Size of the current mailbox - Implements ExpandoRenderData::get_string() -.
 
void status_T (const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf)
 Status: Current threading mode - Implements ExpandoRenderData::get_string() -.
 
void status_s (const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf)
 Status: Sorting mode - Implements ExpandoRenderData::get_string() -.
 
void status_S (const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf)
 Status: Aux sorting method - Implements ExpandoRenderData::get_string() -.
 
long status_P_num (const struct ExpandoNode *node, void *data, MuttFormatFlags flags)
 Status: Percentage through index - Implements ExpandoRenderData::get_number() -.
 
void status_P (const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf)
 Status: Percentage through index - Implements ExpandoRenderData::get_string() -.
 
void status_h (const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf)
 Status: Local hostname - Implements ExpandoRenderData::get_string() -.
 
long status_L_num (const struct ExpandoNode *node, void *data, MuttFormatFlags flags)
 Status: Size of the messages - Implements ExpandoRenderData::get_number() -.
 
void status_L (const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf)
 Status: Size of the messages - Implements ExpandoRenderData::get_string() -.
 
long status_R_num (const struct ExpandoNode *node, void *data, MuttFormatFlags flags)
 Status: Number of read messages - Implements ExpandoRenderData::get_number() -.
 
long status_u_num (const struct ExpandoNode *node, void *data, MuttFormatFlags flags)
 Status: Number of unread messages - Implements ExpandoRenderData::get_number() -.
 
void status_v (const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf)
 Status: Version string - Implements ExpandoRenderData::get_string() -.
 
void status_V (const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf)
 Status: Active limit pattern - Implements ExpandoRenderData::get_string() -.
 
void menu_status_line (struct Buffer *buf, struct IndexSharedData *shared, struct Menu *menu, int max_cols, const struct Expando *exp)
 Create the status line.
 

Variables

const struct ExpandoRenderData StatusRenderData []
 Callbacks for Status Expandos.
 

Detailed Description

GUI display a user-configurable status line.

Authors
  • Michael R. Elkins
  • Richard Russon
  • Austin Ray
  • Pietro Cerutti
  • Eric Blake
  • Dennis Schön
  • 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 status.c.

Function Documentation

◆ get_sort_str()

static char * get_sort_str ( char *  buf,
size_t  buflen,
enum SortType  method 
)
static

Get the sort method as a string.

Parameters
bufBuffer for the sort string
buflenLength of the buffer
methodSort method, see SortType
Return values
ptrBuffer pointer

Definition at line 65 of file status.c.

66{
67 snprintf(buf, buflen, "%s%s%s", (method & SORT_REVERSE) ? "reverse-" : "",
68 (method & SORT_LAST) ? "last-" : "",
70 return buf;
71}
const char * mutt_map_get_name(int val, const struct Mapping *map)
Lookup a string for a constant.
Definition: mapping.c:42
const struct Mapping SortMethods[]
Sort methods for '$sort' for the index.
Definition: mutt_config.c:88
#define SORT_MASK
Mask for the sort id.
Definition: sort2.h:70
#define SORT_LAST
Sort thread by last-X, e.g. received date.
Definition: sort2.h:72
#define SORT_REVERSE
Reverse the order of the sort.
Definition: sort2.h:71
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ menu_status_line()

void menu_status_line ( struct Buffer buf,
struct IndexSharedData shared,
struct Menu menu,
int  max_cols,
const struct Expando exp 
)

Create the status line.

Parameters
[out]bufBuffer in which to save string
[in]sharedShared Index data
[in]menuCurrent menu
[in]max_colsMaximum number of columns to use (-1 means unlimited)
[in]expExpando
See also
status_format_str()

Definition at line 496 of file status.c.

498{
499 struct MenuStatusLineData data = { shared, menu };
500
501 expando_filter(exp, StatusRenderData, &data, MUTT_FORMAT_NO_FLAGS, max_cols, buf);
502}
int expando_filter(const struct Expando *exp, const struct ExpandoRenderData *rdata, void *data, MuttFormatFlags flags, int max_cols, struct Buffer *buf)
Render an Expando and run the result through a filter.
Definition: filter.c:138
#define MUTT_FORMAT_NO_FLAGS
No flags are set.
Definition: render.h:33
const struct ExpandoRenderData StatusRenderData[]
Callbacks for Status Expandos.
Definition: status.c:56
Data for creating a Menu line.
Definition: status.c:77
struct IndexSharedData * shared
Data shared between Index, Pager and Sidebar.
Definition: status.c:78
struct Menu * menu
Current Menu.
Definition: status.c:79
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Variable Documentation

◆ StatusRenderData

const struct ExpandoRenderData StatusRenderData
Initial value:
= {
{ -1, -1, NULL, NULL },
}
@ ED_MENU
Menu ED_MEN_ ExpandoDataMenu.
Definition: domain.h:48
@ ED_GLOBAL
Global ED_GLO_ ExpandoDataGlobal.
Definition: domain.h:44
@ ED_INDEX
Index ED_IND_ ExpandoDataIndex.
Definition: domain.h:46
long status_p_num(const struct ExpandoNode *node, void *data, MuttFormatFlags flags)
Status: Number of postponed messages - Implements ExpandoRenderData::get_number() -.
Definition: status.c:257
long status_b_num(const struct ExpandoNode *node, void *data, MuttFormatFlags flags)
Status: Number of mailboxes with new mail - Implements ExpandoRenderData::get_number() -.
Definition: status.c:269
long status_R_num(const struct ExpandoNode *node, void *data, MuttFormatFlags flags)
Status: Number of read messages - Implements ExpandoRenderData::get_number() -.
Definition: status.c:441
long status_d_num(const struct ExpandoNode *node, void *data, MuttFormatFlags flags)
Status: Number of deleted messages - Implements ExpandoRenderData::get_number() -.
Definition: status.c:221
long status_o_num(const struct ExpandoNode *node, void *data, MuttFormatFlags flags)
Status: Number of old messages - Implements ExpandoRenderData::get_number() -.
Definition: status.c:209
long status_t_num(const struct ExpandoNode *node, void *data, MuttFormatFlags flags)
Status: Number of tagged messages - Implements ExpandoRenderData::get_number() -.
Definition: status.c:245
long status_n_num(const struct ExpandoNode *node, void *data, MuttFormatFlags flags)
Status: Number of new messages - Implements ExpandoRenderData::get_number() -.
Definition: status.c:197
long status_m_num(const struct ExpandoNode *node, void *data, MuttFormatFlags flags)
Status: Number of messages in the mailbox - Implements ExpandoRenderData::get_number() -.
Definition: status.c:185
long status_F_num(const struct ExpandoNode *node, void *data, MuttFormatFlags flags)
Status: Number of flagged messages - Implements ExpandoRenderData::get_number() -.
Definition: status.c:233
long status_P_num(const struct ExpandoNode *node, void *data, MuttFormatFlags flags)
Status: Percentage through index - Implements ExpandoRenderData::get_number() -.
Definition: status.c:349
long status_u_num(const struct ExpandoNode *node, void *data, MuttFormatFlags flags)
Status: Number of unread messages - Implements ExpandoRenderData::get_number() -.
Definition: status.c:453
long status_M_num(const struct ExpandoNode *node, void *data, MuttFormatFlags flags)
Status: Number of messages - Implements ExpandoRenderData::get_number() -.
Definition: status.c:173
long status_l_num(const struct ExpandoNode *node, void *data, MuttFormatFlags flags)
Status: Size of the current mailbox - Implements ExpandoRenderData::get_number() -.
Definition: status.c:281
long status_L_num(const struct ExpandoNode *node, void *data, MuttFormatFlags flags)
Status: Size of the messages - Implements ExpandoRenderData::get_number() -.
Definition: status.c:410
void status_r(const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf)
Status: Modified/read-only flag - Implements ExpandoRenderData::get_string() -.
Definition: status.c:85
void status_T(const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf)
Status: Current threading mode - Implements ExpandoRenderData::get_string() -.
Definition: status.c:312
void status_s(const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf)
Status: Sorting mode - Implements ExpandoRenderData::get_string() -.
Definition: status.c:323
void status_l(const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf)
Status: Size of the current mailbox - Implements ExpandoRenderData::get_string() -.
Definition: status.c:295
void status_D(const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf)
Status: Description of the mailbox - Implements ExpandoRenderData::get_string() -.
Definition: status.c:118
void status_L(const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf)
Status: Size of the messages - Implements ExpandoRenderData::get_string() -.
Definition: status.c:424
void status_h(const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf)
Status: Local hostname - Implements ExpandoRenderData::get_string() -.
Definition: status.c:400
void status_f(const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf)
Status: pathname of the mailbox - Implements ExpandoRenderData::get_string() -.
Definition: status.c:139
void status_v(const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf)
Status: Version string - Implements ExpandoRenderData::get_string() -.
Definition: status.c:465
void status_S(const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf)
Status: Aux sorting method - Implements ExpandoRenderData::get_string() -.
Definition: status.c:336
void status_V(const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf)
Status: Active limit pattern - Implements ExpandoRenderData::get_string() -.
Definition: status.c:475
void status_P(const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf)
Status: Percentage through index - Implements ExpandoRenderData::get_string() -.
Definition: status.c:365
@ ED_IND_LIMIT_COUNT
Mailbox.vcount.
Definition: shared_data.h:59
@ ED_IND_MAILBOX_PATH
Mailbox.pathbuf, Mailbox.name.
Definition: shared_data.h:62
@ ED_IND_DELETED_COUNT
Mailbox.msg_deleted.
Definition: shared_data.h:56
@ ED_IND_NEW_COUNT
Mailbox.msg_new.
Definition: shared_data.h:65
@ ED_IND_MAILBOX_SIZE
Mailbox.size.
Definition: shared_data.h:63
@ ED_IND_LIMIT_PATTERN
MailboxView.pattern.
Definition: shared_data.h:60
@ ED_IND_READ_COUNT
Mailbox.msg_count, Mailbox.msg_unread.
Definition: shared_data.h:69
@ ED_IND_POSTPONED_COUNT
mutt_num_postponed()
Definition: shared_data.h:67
@ ED_IND_FLAGGED_COUNT
Mailbox.msg_flagged.
Definition: shared_data.h:58
@ ED_IND_MESSAGE_COUNT
Mailbox.msg_count.
Definition: shared_data.h:64
@ ED_IND_OLD_COUNT
Mailbox.msg_unread, Mailbox.msg_new.
Definition: shared_data.h:66
@ ED_IND_READONLY
Mailbox.readonly, Mailbox.dontwrite.
Definition: shared_data.h:68
@ ED_IND_UNREAD_COUNT
Mailbox.msg_unread.
Definition: shared_data.h:71
@ ED_IND_TAGGED_COUNT
Mailbox.msg_tagged.
Definition: shared_data.h:70
@ ED_IND_LIMIT_SIZE
MailboxView.vsize.
Definition: shared_data.h:61
@ ED_IND_DESCRIPTION
Mailbox.name.
Definition: shared_data.h:57
@ ED_IND_UNREAD_MAILBOXES
Mailbox, mutt_mailbox_check()
Definition: shared_data.h:72
@ ED_MEN_PERCENTAGE
Menu.top, ...
Definition: lib.h:68
@ ED_GLO_SORT
Value of $sort.
Definition: uid.h:40
@ ED_GLO_VERSION
NeoMutt version.
Definition: uid.h:43
@ ED_GLO_USE_THREADS
Value of $use_threads.
Definition: uid.h:42
@ ED_GLO_HOSTNAME
Local hostname.
Definition: uid.h:35
@ ED_GLO_SORT_AUX
Value of $sort_aux.
Definition: uid.h:41

Callbacks for Status Expandos.

See also
StatusFormatDef, ExpandoDataGlobal, ExpandoDataIndex, ExpandoDataMenu

Definition at line 56 of file status.c.