summaryrefslogtreecommitdiff
path: root/alpine/colorconf.h
blob: d78debb3a3d52f78f7d99263446eef171428d31b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
/*
 * $Id: colorconf.h 769 2007-10-24 00:15:40Z hubert@u.washington.edu $
 *
 * ========================================================================
 * Copyright 2013-2019 Eduardo Chappa
 * Copyright 2006-2007 University of Washington
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * ========================================================================
 */

#ifndef PINE_COLORCONF_INCLUDED
#define PINE_COLORCONF_INCLUDED


#include "conftype.h"
#include "../pith/state.h"
#include "../pith/conf.h"


#define HEADER_WORD "Header "
#define TOKEN_WORD "Index Token "
#define KW_COLORS_HDR "KEYWORD COLORS"
#define HDR_COLORS "HEADER COLORS"
#define ADDHEADER_COMMENT N_("[ Use the AddHeader command to add colored headers in MESSAGE TEXT screen ]")
#define ADDINDEXTOKEN_COMMENT N_("[ Use the IndxHdr command to add colored tokens in MESSAGE INDEX screen ]")
#define EQ_COL 37

#define SPACE_BETWEEN_DOUBLEVARS 3
#define SAMPLE_LEADER "---------------------------"
#define SAMP1 "[Sample ]"
#define SAMP2 "[Default]"
#define SAMPEXC "[Exception]"
#define SBS 1	/* space between samples */
#define COLOR_BLOB "<    >"
#define COLOR_BLOB_TRAN "<TRAN>"
#define COLOR_BLOB_NORM "<NORM>"
#define COLOR_BLOB_NONE "<NONE>"
#define COLOR_BLOB_LEN 6
#define COLOR_INDENT 3
#define COLORNOSET "  [ Colors below may not be set until color is turned on above ]"


/*
 * The CONF_S's varmem field serves dual purposes.  The low two bytes
 * are reserved for the pre-defined color index (though only 8 are 
 * defined for the nonce, and the high order bits are for the index
 * of the particular SPEC_COLOR_S this CONF_S is associated with.
 * Capiche?
 */
#define	CFC_ICOLOR(V)		((V)->varmem & 0xffff)
#define	CFC_ICUST(V)		((V)->varmem >> 16)
#define	CFC_SET_COLOR(I, C)	(((I) << 16) | (C))
#define	CFC_ICUST_INC(V)	CFC_SET_COLOR(CFC_ICUST(V) + 1, CFC_ICOLOR(V))
#define	CFC_ICUST_DEC(V)	CFC_SET_COLOR(CFC_ICUST(V) - 1, CFC_ICOLOR(V))

#define	CFC_ICOLOR_NORM		(1000)
#define	CFC_ICOLOR_NONE		(1001)


extern int treat_color_vars_as_text;


/* exported prototypes */
void     color_config_screen(struct pine *, int);
int	 color_setting_tool(struct pine *, int, CONF_S **, unsigned);
char    *sampleexc_text(struct pine *, struct variable *);
int	 color_related_var(struct pine *, struct variable *);
int	 color_holding_var(struct pine *, struct variable *);
char	*sample_text(struct pine *, struct variable *);
char	*color_parenthetical(struct variable *);
void	 add_color_setting_disp(struct pine *, CONF_S **, struct variable *, CONF_S *,
			        struct key_menu *, struct key_menu *, HelpType,
			        int, int, char *, char *, int);


#endif /* PINE_COLORCONF_INCLUDED */