Edbee는 QT 기반 편집기 구성 요소입니다. 다중 계수, TextMate Scoping/Grammar 및 강조 지원을 지원합니다.
Edbee의 기본 클래스는 QWIDGET이며 처음부터 작성되었으며 QT 기본 편집기 구성 요소를 기반으로하지 않습니다.
Edbee의 기본 웹 사이트는 http://edbee.net/에 있습니다. http://docs.edbee.net/에서 생성 된 문서를 찾을 수 있습니다.
이 저장소는 이전 Edbee 모 놀랍 저장소의 깨끗한 추출입니다. 이 라이브러리에는 데이터 파일이 포함되어 있지 않습니다. 그것을 사용하면 다음 예제만큼 쉬워야합니다.
# include " edbee/edbee.h "
edbee::TextEditorWidget* widget = new edbee::TextEditorWidget();불행히도 우리는 아직이 시점에 없습니다. 현재 Edbee 라이브러리는 기본 keymap 파일을로드하지 않고는 작동하지 않습니다.
구성 요소를 사용하는 것은 매우 쉽습니다. 먼저 Edbee 환경을 설정해야합니다. 이 프로세스는 라이브러리가 설정 파일의 위치를 알리기 위해 필요합니다.
# include " edbee/edbee.h "
// get the edbee instance
edbee::Edbee* tm = edbee::Edbee::instance();
// configure your paths
tm -> setKeyMapPath ( " location/of/your/keymap/ " );
tm -> setGrammarPath ( " location/of/your/syntaxfiles/ " );
tm -> setThemePath ( " location/of/your/themes/ " );
// initialize the library
tm -> init ();
// by registering a shutdown function on application exit you don't have to destroy the edbee
// resources yourself. It will result in a clean shutdown
tm -> autoShutDownOnAppExit ();그 후 당신은 갈 준비가되었습니다. 다음과 같은 위젯을 만들 수 있습니다.
edbee::TextEditorWidget* widget = new edbee::TextEditorWidget();물론 편집기를 파일로 채우는 것도 좋을 것입니다. 이를 위해 포함 된 시리얼 라이저를 사용할 수 있습니다.
# include " edbee/io/textdocumentserializer.h "
# include " edbee/texteditorwidget.h "
edbee::TextEditorWidget* widget = new edbee::TextEditorWidget();
edbee::TextDocumentSerializer serializer ( widget-> textDocument () );
QFile file ( QStringLiteral( " your-filename.rb " ) );
if ( !serializer.load( &file ) ) {
QMessageBox::warning ( this , tr ( " Error opening file " ), tr ( " Error opening file! n %1 " ). arg (serializer. errorString ()) );
}
TextFile을로드 한 후이 파일의 문법/언어를 감지하는 것이 좋습니다. Edbee 라이브러리는 확장자 기반 파일 형 감지를 사용합니다. 물론 자신만의 플러그인도 할 수도 있습니다.
# include " edbee/edbee.h "
# include " edbee/models/textdocument.h "
# include " edbee/models/textgrammar.h "
# include " edbee/texteditorwidget.h "
TextGrammarManager* grammarManager = edbee::Edbee::instance()-> grammarManager ();
TextGrammar* grammar = grammarManager-> detectGrammarWithFilename ( " a-ruby-file.rb " );
widget-> textDocument ()->setLanguagGrammar( grammar );Edbee는 AutoComplete를 지원합니다. 현재 매우 제한적이지만, 더 고급 자동 완성을 지원하기 위해 토대가 수행되었습니다.
자동 완성 제공 업체 (TextAutoCompleteProvider)를 쿼리하여 자동 완료 작업. TextDocument 레벨 및 Edbee :: instance () 레벨을 통해 전 세계적으로 TextAutoComembleTeProviderList가 있습니다.
현재 StringTextAutoCompleteProvider 만 구현됩니다. 문서 수준 및 Edbeel 레벨에 자동 완성 목록을 추가 할 수 있습니다.
미래에 대한 아이디어
현재 다음과 같은 키워드 목록을 설정할 수 있습니다.
# include " edbee/models/textautocompleteprovider.h "
StringTextAutoCompleteProvider* provider = new StringTextAutoCompleteProvider();
provider-> add ( " const " );
provider-> add ( " class " );
provider-> add ( " compare " );
// etc ...
// to add it Locally (specific to the given document)
textDocument-> autoCompleteProviderList ()->giveProvider(provider);
// to add it Globally:
Edbee::instance ()->autoCompleteProviderList()->giveProvider(provider);QT 프로젝트가 util.cpp와 같은 QT를 사용하면 객체 파일 콜리 허가를받을 수 있습니다. (MakeFile : 경고 : 대상 UTIL.O에 대한 명령을 우선합니다). 이에 대한 해결 방법은 다음 줄을 추가하고 있습니다 (Objects_dir는 선택 사항이지만 Qmake를 실행할 때 경고를 방지합니다).
CONFIG += object_parallel_to_source in your .pro file
OBJECTS_DIR = objects
Github를 통해 기여할 수 있습니다
물론 Twitter @gamecreature를 통해 저에게 연락하거나 https://github.com/gamecreature에 제공된 이메일-address를 통해 메시지를 보내면 기여할 수도 있습니다.
우리는 (http://issues.edbee.net/)에 고유 한 문제-트래커가 있지만 Github 문제 추적기를 통해 문제를보고하거나 메시지 https://github.com/gamecreature를 보낼 수 있습니다.