- Change help version to 5.4DEV
[nedit.git] / source / highlight.h
blob3ef16c3cb98342c3a5d7b1b61ac344454f5b48b0
1 /* $Id: highlight.h,v 1.9 2002/11/08 20:22:45 edg Exp $ */
3 #ifndef NEDIT_HIGHLIGHT_H_INCLUDED
4 #define NEDIT_HIGHLIGHT_H_INCLUDED
6 #include "nedit.h"
8 #include <X11/Intrinsic.h>
10 /* Pattern flags for modifying pattern matching behavior */
11 #define PARSE_SUBPATS_FROM_START 1
12 #define DEFER_PARSING 2
13 #define COLOR_ONLY 4
15 /* Pattern specification structure */
16 typedef struct {
17 char *name;
18 char *startRE;
19 char *endRE;
20 char *errorRE;
21 char *style;
22 char *subPatternOf;
23 int flags;
24 } highlightPattern;
26 /* Header for a set of patterns */
27 typedef struct {
28 char *languageMode;
29 int lineContext;
30 int charContext;
31 int nPatterns;
32 highlightPattern *patterns;
33 } patternSet;
35 void SyntaxHighlightModifyCB(int pos, int nInserted, int nDeleted,
36 int nRestyled, char *deletedText, void *cbArg);
37 void StartHighlighting(WindowInfo *window, int warn);
38 void StopHighlighting(WindowInfo *window);
39 void AttachHighlightToWidget(Widget widget, WindowInfo *window);
40 void FreeHighlightingData(WindowInfo *window);
41 void RemoveWidgetHighlight(Widget widget);
42 void UpdateHighlightStyles(WindowInfo *window);
43 int TestHighlightPatterns(patternSet *patSet);
44 Pixel AllocColor(Widget w, const char *colorName, int *r, int *g, int *b);
45 void* GetHighlightInfo(WindowInfo *window, int pos);
46 highlightPattern *FindPatternOfWindow(WindowInfo *window, char *name);
47 int HighlightCodeOfPos(WindowInfo *window, int pos);
48 int HighlightLengthOfCodeFromPos(WindowInfo *window, int pos, int *checkCode);
49 char *HighlightNameOfCode(WindowInfo *window, int hCode);
50 char *HighlightStyleOfCode(WindowInfo *window, int hCode);
51 char *HighlightColorOfCode(WindowInfo *window, int hCode);
52 char *HighlightBackgroundColorOfCode(WindowInfo *window, int hCode);
53 Pixel HighlightColorValueOfCode(WindowInfo *window, int hCode,
54 int *r, int *g, int *b);
55 Pixel GetHighlightBGColorOfCode(WindowInfo *window, int hCode,
56 int *r, int *g, int *b);
57 int HighlightCodeIsBold(WindowInfo *window, int hCode);
58 int HighlightCodeIsItalic(WindowInfo *window, int hCode);
60 #endif /* NEDIT_HIGHLIGHT_H_INCLUDED */