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

Quoted-Email colours. More...

#include "config.h"
#include <stddef.h>
#include "mutt/lib.h"
#include "core/lib.h"
#include "quoted.h"
#include "color.h"
#include "module_data.h"
#include "notify2.h"
#include "simple2.h"
+ Include dependency graph for quoted.c:

Go to the source code of this file.

Functions

static int quoted_color_observer (struct NotifyCallback *nc)
 Notification that a Color has changed - Implements observer_t -.
 
void quoted_colors_init (void)
 Initialise the Quoted colours.
 
void quoted_colors_reset (int *num_quoted_colors)
 Reset the quoted-email colours.
 
void quoted_colors_cleanup (int *num_quoted_colors)
 Cleanup the quoted-email colours.
 
struct AttrColorquoted_colors_get (int q)
 Return the color of a quote, cycling through the used quotes.
 
int quoted_colors_num_used (void)
 Return the number of used quotes.
 

Detailed Description

Quoted-Email colours.

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

Function Documentation

◆ quoted_colors_init()

void quoted_colors_init ( void )

Initialise the Quoted colours.

Definition at line 73 of file quoted.c.

74{
76}
void mutt_color_observer_add(observer_t callback, void *global_data)
Add an observer.
Definition notify.c:62
static int quoted_color_observer(struct NotifyCallback *nc)
Notification that a Color has changed - Implements observer_t -.
Definition quoted.c:42
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ quoted_colors_reset()

void quoted_colors_reset ( int * num_quoted_colors)

Reset the quoted-email colours.

Parameters
num_quoted_colorsPointer to the quoted color count

Definition at line 82 of file quoted.c.

83{
84 *num_quoted_colors = 0;
85}
+ Here is the caller graph for this function:

◆ quoted_colors_cleanup()

void quoted_colors_cleanup ( int * num_quoted_colors)

Cleanup the quoted-email colours.

Parameters
num_quoted_colorsPointer to the quoted color count

Definition at line 91 of file quoted.c.

92{
94 quoted_colors_reset(num_quoted_colors);
95}
void mutt_color_observer_remove(observer_t callback, void *global_data)
Remove an observer.
Definition notify.c:73
void quoted_colors_reset(int *num_quoted_colors)
Reset the quoted-email colours.
Definition quoted.c:82
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ quoted_colors_get()

struct AttrColor * quoted_colors_get ( int q)

Return the color of a quote, cycling through the used quotes.

Parameters
qQuote level
Return values
enumColorId, e.g. MT_COLOR_QUOTED3

Definition at line 102 of file quoted.c.

103{
105 if (mod_data->num_quoted_colors == 0)
106 return NULL;
107
108 // If we have too few colours, cycle around
109 q %= mod_data->num_quoted_colors;
110
112}
struct AttrColor * simple_color_get(enum ColorId cid)
Get the colour of an object by its ID.
Definition simple.c:98
@ MT_COLOR_QUOTED0
Pager: quoted text, level 0.
Definition color.h:57
@ MODULE_ID_COLOR
ModuleColor, Color
Definition module_api.h:53
void * neomutt_get_module_data(struct NeoMutt *n, enum ModuleId id)
Get the private data for a Module.
Definition neomutt.c:663
Color private Module data.
Definition module_data.h:35
int num_quoted_colors
Number of colours for quoted email text.
Definition module_data.h:41
Container for Accounts, Notifications.
Definition neomutt.h:41
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ quoted_colors_num_used()

int quoted_colors_num_used ( void )

Return the number of used quotes.

Return values
numNumber of used quotes

Definition at line 118 of file quoted.c.

119{
121 return mod_data->num_quoted_colors;
122}
+ Here is the call graph for this function:
+ Here is the caller graph for this function: