⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 highlightdata.c

📁 nedit 是一款linux下的开发源码的功能强大的编辑器
💻 C
📖 第 1 页 / 共 5 页
字号:
static const char CVSID[] = "$Id: highlightData.c,v 1.52.2.3 2003/08/24 19:02:15 yooden Exp $";/********************************************************************************									       ** highlightData.c -- Maintain, and allow user to edit, highlight pattern list  **		     used for syntax highlighting			       **									       ** Copyright (C) 1999 Mark Edel						       **									       ** This is free software; you can redistribute it and/or modify it under the    ** terms of the GNU General Public License as published by the Free Software    ** Foundation; either version 2 of the License, or (at your option) any later   ** version.							               ** 									       ** This software 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 ** software; if not, write to the Free Software Foundation, Inc., 59 Temple     ** Place, Suite 330, Boston, MA  02111-1307 USA		                       **									       ** Nirvana Text Editor	    						       ** April, 1997								       **									       ** Written by Mark Edel							       **									       ********************************************************************************/#ifdef HAVE_CONFIG_H#include "../config.h"#endif#include "highlightData.h"#include "textBuf.h"#include "nedit.h"#include "highlight.h"#include "regularExp.h"#include "preferences.h"#include "help.h"#include "window.h"#include "regexConvert.h"#include "../util/misc.h"#include "../util/DialogF.h"#include "../util/managedList.h"#include <stdio.h>#include <string.h>#include <limits.h>#ifdef VMS#include "../util/VMSparam.h"#else#ifndef __MVS__#include <sys/param.h>#endif#endif /*VMS*/#include <Xm/Xm.h>#include <Xm/Form.h>#include <Xm/Frame.h>#include <Xm/Text.h>#include <Xm/LabelG.h>#include <Xm/PushB.h>#include <Xm/ToggleB.h>#include <Xm/RowColumn.h>#include <Xm/SeparatoG.h>#ifdef HAVE_DEBUG_H#include "../debug.h"#endif/* Maximum allowed number of styles (also limited by representation of   styles as a byte - 'b') */#define MAX_HIGHLIGHT_STYLES 128/* Maximum number of patterns allowed in a pattern set (regular expression   limitations are probably much more restrictive).  */#define MAX_PATTERNS 127/* Names for the fonts that can be used for syntax highlighting */#define N_FONT_TYPES 4enum fontTypes {PLAIN_FONT, ITALIC_FONT, BOLD_FONT, BOLD_ITALIC_FONT};static const char *FontTypeNames[N_FONT_TYPES] =   {"Plain", "Italic", "Bold", "Bold Italic"};typedef struct {    char *name;    char *color;    char *bgColor;    int font;} highlightStyleRec;static int styleError(const char *stringStart, const char *stoppedAt,       const char *message);#if 0static int lookupNamedPattern(patternSet *p, char *patternName);#endifstatic int lookupNamedStyle(const char *styleName);static highlightPattern *readHighlightPatterns(char **inPtr, int withBraces,       char **errMsg, int *nPatterns);static int readHighlightPattern(char **inPtr, char **errMsg,    	highlightPattern *pattern);static patternSet *readDefaultPatternSet(const char *langModeName);static int isDefaultPatternSet(patternSet *patSet);static patternSet *readPatternSet(char **inPtr, int convertOld);static patternSet *highlightError(char *stringStart, char *stoppedAt,    	const char *message);static char *intToStr(int i);static char *createPatternsString(patternSet *patSet, char *indentStr);static void setStyleByName(const char *style);static void hsDestroyCB(Widget w, XtPointer clientData, XtPointer callData);static void hsOkCB(Widget w, XtPointer clientData, XtPointer callData);static void hsApplyCB(Widget w, XtPointer clientData, XtPointer callData);static void hsDismissCB(Widget w, XtPointer clientData, XtPointer callData);static highlightStyleRec *copyHighlightStyleRec(highlightStyleRec *hs);static void *hsGetDisplayedCB(void *oldItem, int explicitRequest, int *abort,    	void *cbArg);static void hsSetDisplayedCB(void *item, void *cbArg);static highlightStyleRec *readHSDialogFields(int silent);static void hsFreeItemCB(void *item);static void freeHighlightStyleRec(highlightStyleRec *hs);static int hsDialogEmpty(void);static int updateHSList(void);static void updateHighlightStyleMenu(void);static void convertOldPatternSet(patternSet *patSet);static void convertPatternExpr(char **patternRE, char *patSetName,	char *patName, int isSubsExpr);static Widget createHighlightStylesMenu(Widget parent);static void destroyCB(Widget w, XtPointer clientData, XtPointer callData);static void langModeCB(Widget w, XtPointer clientData, XtPointer callData);static void lmDialogCB(Widget w, XtPointer clientData, XtPointer callData);static void styleDialogCB(Widget w, XtPointer clientData, XtPointer callData);static void patTypeCB(Widget w, XtPointer clientData, XtPointer callData);static void matchTypeCB(Widget w, XtPointer clientData, XtPointer callData);static int checkHighlightDialogData(void);static void updateLabels(void);static void okCB(Widget w, XtPointer clientData, XtPointer callData);static void applyCB(Widget w, XtPointer clientData, XtPointer callData);static void checkCB(Widget w, XtPointer clientData, XtPointer callData);static void restoreCB(Widget w, XtPointer clientData, XtPointer callData);

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -