NeoMutt  2025-12-11-911-gd8d604
Teaching an old dog new tricks
DOXYGEN
Loading...
Searching...
No Matches
render.h File Reference

Render Expandos using Data. More...

#include <stdint.h>
+ Include dependency graph for render.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  ExpandoRenderCallback
 

Typedefs

typedef uint8_t MuttFormatFlags
 
typedef void(* get_string_t) (const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf)
 
typedef long(* get_number_t) (const struct ExpandoNode *node, void *data, MuttFormatFlags flags)
 

Enumerations

enum  MuttFormatFlag {
  MUTT_FORMAT_NONE = 0 , MUTT_FORMAT_FORCESUBJ = 1U << 0 , MUTT_FORMAT_TREE = 1U << 1 , MUTT_FORMAT_STAT_FILE = 1U << 2 ,
  MUTT_FORMAT_ARROWCURSOR = 1U << 3 , MUTT_FORMAT_INDEX = 1U << 4 , MUTT_FORMAT_PLAIN = 1U << 5
}
 Flags for expando_render(), e.g. More...
 

Functions

int node_render (const struct ExpandoNode *node, const struct ExpandoRenderCallback *erc, struct Buffer *buf, int max_cols, void *data, MuttFormatFlags flags)
 Render a tree of ExpandoNodes into a string.
 

Detailed Description

Render Expandos using Data.

Authors
  • Tóth János
  • 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 render.h.

Typedef Documentation

◆ MuttFormatFlags

typedef uint8_t MuttFormatFlags

Definition at line 45 of file render.h.

◆ get_string_t

typedef void(* get_string_t) (const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf)

Definition at line 59 of file render.h.

◆ get_number_t

typedef long(* get_number_t) (const struct ExpandoNode *node, void *data, MuttFormatFlags flags)

Definition at line 73 of file render.h.

Enumeration Type Documentation

◆ MuttFormatFlag

Flags for expando_render(), e.g.

MUTT_FORMAT_FORCESUBJ

Enumerator
MUTT_FORMAT_NONE 

No flags are set.

MUTT_FORMAT_FORCESUBJ 

Print the subject even if unchanged.

MUTT_FORMAT_TREE 

Draw the thread tree.

MUTT_FORMAT_STAT_FILE 

Used by attach_format_str.

MUTT_FORMAT_ARROWCURSOR 

Reserve space for arrow_cursor.

MUTT_FORMAT_INDEX 

This is a main index entry.

MUTT_FORMAT_PLAIN 

Do not prepend DISP_TO, DISP_CC ...

Definition at line 35 of file render.h.

36{
38 MUTT_FORMAT_FORCESUBJ = 1U << 0,
39 MUTT_FORMAT_TREE = 1U << 1,
40 MUTT_FORMAT_STAT_FILE = 1U << 2,
41 MUTT_FORMAT_ARROWCURSOR = 1U << 3,
42 MUTT_FORMAT_INDEX = 1U << 4,
43 MUTT_FORMAT_PLAIN = 1U << 5,
44};
@ MUTT_FORMAT_PLAIN
Do not prepend DISP_TO, DISP_CC ...
Definition render.h:43
@ MUTT_FORMAT_INDEX
This is a main index entry.
Definition render.h:42
@ MUTT_FORMAT_ARROWCURSOR
Reserve space for arrow_cursor.
Definition render.h:41
@ MUTT_FORMAT_STAT_FILE
Used by attach_format_str.
Definition render.h:40
@ MUTT_FORMAT_TREE
Draw the thread tree.
Definition render.h:39
@ MUTT_FORMAT_NONE
No flags are set.
Definition render.h:37
@ MUTT_FORMAT_FORCESUBJ
Print the subject even if unchanged.
Definition render.h:38

Function Documentation

◆ node_render()

int node_render ( const struct ExpandoNode * node,
const struct ExpandoRenderCallback * erc,
struct Buffer * buf,
int max_cols,
void * data,
MuttFormatFlags flags )

Render a tree of ExpandoNodes into a string.

Parameters
nodeRoot of tree
ercExpando Render Callback functions
bufBuffer for the result
max_colsMaximum number of screen columns to use
dataPrivate data
flagsFlags to control behaviour
Return values
numNumber of screen columns used

Definition at line 45 of file render.c.

47{
48 if (!node || !node->render)
49 return 0;
50
51 return node->render(node, erc, buf, max_cols, data, flags);
52}
int(* render)(const struct ExpandoNode *node, const struct ExpandoRenderCallback *erc, struct Buffer *buf, int max_cols, void *data, MuttFormatFlags flags)
Definition node.h:92
+ Here is the caller graph for this function: