NeoMutt  2024-04-16-36-g75b6fb
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  ExpandoRenderData
 

Macros

#define MUTT_FORMAT_NO_FLAGS   0
 No flags are set.
 
#define MUTT_FORMAT_FORCESUBJ   (1 << 0)
 Print the subject even if unchanged.
 
#define MUTT_FORMAT_TREE   (1 << 1)
 Draw the thread tree.
 
#define MUTT_FORMAT_STAT_FILE   (1 << 2)
 Used by attach_format_str.
 
#define MUTT_FORMAT_ARROWCURSOR   (1 << 3)
 Reserve space for arrow_cursor.
 
#define MUTT_FORMAT_INDEX   (1 << 4)
 This is a main index entry.
 
#define MUTT_FORMAT_PLAIN   (1 << 5)
 Do not prepend DISP_TO, DISP_CC ...
 

Typedefs

typedef uint8_t MuttFormatFlags
 Flags for expando_render(), e.g. MUTT_FORMAT_FORCESUBJ.
 

Functions

int node_tree_render (const struct ExpandoNode *node, const struct ExpandoRenderData *rdata, 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.

Macro Definition Documentation

◆ MUTT_FORMAT_NO_FLAGS

#define MUTT_FORMAT_NO_FLAGS   0

No flags are set.

Definition at line 33 of file render.h.

◆ MUTT_FORMAT_FORCESUBJ

#define MUTT_FORMAT_FORCESUBJ   (1 << 0)

Print the subject even if unchanged.

Definition at line 34 of file render.h.

◆ MUTT_FORMAT_TREE

#define MUTT_FORMAT_TREE   (1 << 1)

Draw the thread tree.

Definition at line 35 of file render.h.

◆ MUTT_FORMAT_STAT_FILE

#define MUTT_FORMAT_STAT_FILE   (1 << 2)

Used by attach_format_str.

Definition at line 36 of file render.h.

◆ MUTT_FORMAT_ARROWCURSOR

#define MUTT_FORMAT_ARROWCURSOR   (1 << 3)

Reserve space for arrow_cursor.

Definition at line 37 of file render.h.

◆ MUTT_FORMAT_INDEX

#define MUTT_FORMAT_INDEX   (1 << 4)

This is a main index entry.

Definition at line 38 of file render.h.

◆ MUTT_FORMAT_PLAIN

#define MUTT_FORMAT_PLAIN   (1 << 5)

Do not prepend DISP_TO, DISP_CC ...

Definition at line 39 of file render.h.

Typedef Documentation

◆ MuttFormatFlags

typedef uint8_t MuttFormatFlags

Flags for expando_render(), e.g. MUTT_FORMAT_FORCESUBJ.

Definition at line 32 of file render.h.

Function Documentation

◆ node_tree_render()

int node_tree_render ( const struct ExpandoNode node,
const struct ExpandoRenderData rdata,
struct Buffer buf,
int  max_cols,
void *  data,
MuttFormatFlags  flags 
)

Render a tree of ExpandoNodes into a string.

Parameters
nodeRoot of tree
rdataExpando Render data
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.

48{
49 int total_cols = 0;
50
51 for (; node && (total_cols < max_cols); node = node->next)
52 {
53 if (!node->render)
54 continue;
55
56 total_cols += node->render(node, rdata, buf, max_cols - total_cols, data, flags);
57 }
58
59 return total_cols;
60}
struct ExpandoNode * next
Linked list.
Definition: node.h:69
+ Here is the caller graph for this function: