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

📄 qsteproper.h

📁 porting scintilla to qt
💻 H
字号:
#ifndef _qsteproper_h_#define _qsteproper_h_#include "properfile.h"#include "filepath.h"#include "Scintilla.h"#include "stringlist.h"#include "constants.h"class QSteEditor;#define POSTIFX ".properties"#define importMax 50#include <list>using namespace std;extern int IntFromHexByte(const char *hexByte);extern int IntFromHexDigit(int ch);class QSteGlobalProper;class QSteLexProper;class _QSTE_DLL_ QSteProper :public PropSetFile {	friend class QSteGlobalProper;public:	QSteProper();	QSteProper(const char *filename,const char *workdir = "");	virtual ~QSteProper();	bool saveToFile(const char *filename);	bool writeIn(const char *key,const char *val,bool in = true);	bool addIn(const char *key,const char *val,bool in = true);	bool loadFromFile(const char *filename,const char *workdir = "");	bool isInitialized(){return initialized;}	std::string getWorkDir(){return m_workdir;}	std::string getFileName(){return m_filename;}private:	FilePath importFiles[importMax];	bool initialized;	std::string m_filename;	std::string m_workdir;};class _QSTE_DLL_ QSteLexProper : public QSteProper{	friend class QSteGlobalProper;public:	QSteLexProper(const char *filename);	~QSteLexProper();	SString getKeyWordsList();	SString getKeyWord(int index = 0);	const char *getLexPostfix();	const char *getLanguageType();	void setSuperPs(QSteProper *sps);	inline int getShowDegree(){return m_showdegree;}	inline void setShowDegree(){m_showdegree++;}private:	void setLanguageType(const char *type);	std::string m_type;	int m_showdegree;};class _QSTE_DLL_ QSteAbbrevProper : public QSteProper{public:	QSteAbbrevProper(const char *filename);	~QSteAbbrevProper();	SString getAbbrev(const char *abb);	bool addAbbrev(const char *abb,const char *str);private:	void setLanguageType(const char *type);	std::string m_type;	int m_showdegree;};class _QSTE_DLL_ QSteGlobalProper : public QSteProper{public:	QSteGlobalProper(const char *filename,const char *workdir);	~QSteGlobalProper();	QSteLexProper *getLexPointer(const char* extension);	QSteLexProper *getLexFromPostfix(const char *fix); 	QSteLexProper *getLexFromIndex(int index); 	QSteLexProper *getLexFromName(const char *name); 	QSteAbbrevProper *getAbbvFromPostfix(const char *fix);	QSteAbbrevProper *getAbbvFromName(const char *name);	inline int getShowDegree(){return m_showdegree;}	inline void setShowDegree(){m_showdegree++;}	void addAutoCompleteWords(SString acword,SString *wordlist,QSteEditor *curr);	void addEditorToList(QSteEditor *editor);	void delEditorToList(QSteEditor *editor);private:	void initialize();	QSteLexProper *lexPointer[importMax];	int m_showdegree;	std::list<QSteEditor*> m_steeditorlist;	QSteAbbrevProper *m_abbv;};struct StyleAndWords {	int styleNumber;	SString words;	bool IsEmpty() { return words.length() == 0; }	bool IsSingleChar() { return words.length() == 1; }};class QSteStyleDefinition {public:	SString font;	int size;	SString fore;	SString back;	bool bold;	bool italics;	bool eolfilled;	bool underlined;	int caseForce;	bool visible;	bool changeable;	enum flags { sdNone = 0, sdFont = 0x1, sdSize = 0x2, sdFore = 0x4, sdBack = 0x8,sdBold = 0x10, sdItalics = 0x20, sdEOLFilled = 0x40, sdUnderlined = 0x80,sdCaseForce = 0x100, sdVisible = 0x200, sdChangeable = 0x400} specified;public:	QSteStyleDefinition(const char *definition);	bool parseStyleDefinition(const char *definition);	long foreAsLong() const;	long backAsLong() const;};extern bool IsBrace(char ch);extern bool includes(const StyleAndWords &symbols, const SString value);extern long ColourFromString(const SString &str);extern const char *propertiesToForward[];#endif

⌨️ 快捷键说明

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