1 /* $Id: highlight.h,v 1.16 2008/01/04 22:11:03 yooden Exp $ */
2 /*******************************************************************************
4 * highlight.h -- Nirvana Editor Syntax Highlighting Header File *
6 * Copyright 2003 The NEdit Developers *
8 * This is free software; you can redistribute it and/or modify it under the *
9 * terms of the GNU General Public License as published by the Free Software *
10 * Foundation; either version 2 of the License, or (at your option) any later *
11 * version. In addition, you may distribute versions of this program linked to *
12 * Motif or Open Motif. See README for details. *
14 * This software is distributed in the hope that it will be useful, but WITHOUT *
15 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or *
16 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for *
19 * You should have received a copy of the GNU General Public License along with *
20 * software; if not, write to the Free Software Foundation, Inc., 59 Temple *
21 * Place, Suite 330, Boston, MA 02111-1307 USA *
23 * Nirvana Text Editor *
26 *******************************************************************************/
28 #ifndef NEDIT_HIGHLIGHT_H_INCLUDED
29 #define NEDIT_HIGHLIGHT_H_INCLUDED
33 #include <X11/Intrinsic.h>
35 /* Pattern flags for modifying pattern matching behavior */
36 #define PARSE_SUBPATS_FROM_START 1
37 #define DEFER_PARSING 2
40 /* Don't use plain 'A' or 'B' for style indices, it causes problems
41 with EBCDIC coding (possibly negative offsets when subtracting 'A'). */
42 #define ASCII_A ((char)65)
44 /* Pattern specification structure */
55 /* Header for a set of patterns */
61 highlightPattern
*patterns
;
64 void SyntaxHighlightModifyCB(int pos
, int nInserted
, int nDeleted
,
65 int nRestyled
, const char *deletedText
, void *cbArg
);
66 void StartHighlighting(WindowInfo
*window
, int warn
);
67 void StopHighlighting(WindowInfo
*window
);
68 void AttachHighlightToWidget(Widget widget
, WindowInfo
*window
);
69 void FreeHighlightingData(WindowInfo
*window
);
70 void RemoveWidgetHighlight(Widget widget
);
71 void UpdateHighlightStyles(WindowInfo
*window
);
72 int TestHighlightPatterns(patternSet
*patSet
);
73 Pixel
AllocateColor(Widget w
, const char *colorName
);
74 Pixel
AllocColor(Widget w
, const char *colorName
, int *r
, int *g
, int *b
);
75 void* GetHighlightInfo(WindowInfo
*window
, int pos
);
76 highlightPattern
*FindPatternOfWindow(WindowInfo
*window
, char *name
);
77 int HighlightCodeOfPos(WindowInfo
*window
, int pos
);
78 int HighlightLengthOfCodeFromPos(WindowInfo
*window
, int pos
, int *checkCode
);
79 int StyleLengthOfCodeFromPos(WindowInfo
*window
, int pos
, const char **checkStyleName
);
80 char *HighlightNameOfCode(WindowInfo
*window
, int hCode
);
81 char *HighlightStyleOfCode(WindowInfo
*window
, int hCode
);
82 Pixel
HighlightColorValueOfCode(WindowInfo
*window
, int hCode
,
83 int *r
, int *g
, int *b
);
84 Pixel
GetHighlightBGColorOfCode(WindowInfo
*window
, int hCode
,
85 int *r
, int *g
, int *b
);
87 #endif /* NEDIT_HIGHLIGHT_H_INCLUDED */