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 #ifndef NEDIT_HIGHLIGHT_H_INCLUDED
28 #define NEDIT_HIGHLIGHT_H_INCLUDED
29
30 #include "nedit.h"
31
32 #include <X11/Intrinsic.h>
33
34
35 #define PARSE_SUBPATS_FROM_START 1
36 #define DEFER_PARSING 2
37 #define COLOR_ONLY 4
38
39
40
41 #define ASCII_A ((
char)
65)
42
43
44 typedef struct {
45 char *name;
46 char *startRE;
47 char *endRE;
48 char *errorRE;
49 char *style;
50 char *subPatternOf;
51 int flags;
52 } highlightPattern;
53
54
55 typedef struct {
56 char *languageMode;
57 int lineContext;
58 int charContext;
59 int nPatterns;
60 highlightPattern *patterns;
61 } patternSet;
62
63 void SyntaxHighlightModifyCB(
int pos,
int nInserted,
int nDeleted,
64 int nRestyled,
const char *deletedText,
void *cbArg);
65 void StartHighlighting(WindowInfo *window,
int warn);
66 void StopHighlighting(WindowInfo *window);
67 void AttachHighlightToWidget(Widget widget, WindowInfo *window);
68 void FreeHighlightingData(WindowInfo *window);
69 void RemoveWidgetHighlight(Widget widget);
70 void UpdateHighlightStyles(WindowInfo *window, Boolean redisplay);
71 int TestHighlightPatterns(patternSet *patSet);
72 Pixel AllocateColor(Widget w,
const char *colorName);
73 void SetParseColorError(
int value);
74 XftColor ParseXftColor(Display *display, Colormap colormap, Pixel foreground,
int depth,
const char *colorName);
75 Pixel AllocColor(Widget w,
const char *colorName,
int *r,
int *g,
int *b);
76 XftColor AllocXftColor(Widget w,
const char *colorName);
77 void* GetHighlightInfo(WindowInfo *window,
int pos);
78 highlightPattern *FindPatternOfWindow(WindowInfo *window,
char *name);
79 int HighlightCodeOfPos(WindowInfo *window,
int pos);
80 int HighlightLengthOfCodeFromPos(WindowInfo *window,
int pos,
int *checkCode);
81 int StyleLengthOfCodeFromPos(WindowInfo *window,
int pos,
const char **checkStyleName);
82 char *HighlightNameOfCode(WindowInfo *window,
int hCode);
83 char *HighlightStyleOfCode(WindowInfo *window,
int hCode);
84 XftColor HighlightColorValueOfCode(WindowInfo *window,
int hCode,
85 int *r,
int *g,
int *b);
86 XftColor GetHighlightBGColorOfCode(WindowInfo *window,
int hCode,
87 int *r,
int *g,
int *b);
88
89 XftColor LightenColor(XftColor color);
90
91 #endif
92