Skip to content

Commit

Permalink
Merge pull request #7 from edbee/master
Browse files Browse the repository at this point in the history
Update our fork of edbee-lib with latest master
  • Loading branch information
vadi2 authored Nov 9, 2020
2 parents 93177ea + 5dbc329 commit 0f8823a
Show file tree
Hide file tree
Showing 57 changed files with 668 additions and 344 deletions.
6 changes: 4 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -40,5 +40,7 @@ edbee-test/edbee-test
.vscode

.vs/
edbee-lib/debug/
edbee-lib/release/
edbee-lib/edbee-lib_autogen/
edbee-lib/qslog/
edbee-test/edbee-test_autogen/
edbee-test/edbee-lib/qslog/
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,18 @@

edbee.lib:

- #112, Workaround for missing Qt::endl in Qt 5.12
- Support for sticky-selection in replaceSelection methods. (Required for InpuMethod entry)
- Improved TextEditorComponent::InputMethodEvent... It now support special chars entry like expected. (Option+e, e => ´ => é)
- ref #107, Several improvements (Thanks @sebcaux)
- Fixed gapvector destructor: it did not use an array delete.
- TextEditorWidget::setHorizontalScrollBar not emits the correct horizontalScrollBarChanged event.
- (Did not include the condition defines, for older Qt versions)
- ref #106, Missing round function on SuSE. (Changed to qRound)
- ref #99, Speed improvements for markAll. (Added beginChanges and endChanges, to prevent updating)
- fix #96, Added support for readonly mode, via widget->setReadonly() or controller->setReadonly
- fix #90, Fixed several Qt deprecation warnings. Chagned 0 to nullptr. Possible incompatibility with older releases!
- add #101, Support for JSON based grammar files.
- fix #67, PlacholderText support via TextEditorWidget::setPlaceholderText. (uses 70% opacity of foreground color)
- fix #98, Missing header include in Qt 5.15rc
- fix #94 (partial), Resource delete fix in TextDocumentscopes
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@ Of course it would also be nice to fill the editor with a file. you can use the

edbee::TextEditorWidget* widget = new edbee::TextEditorWidget();
edbee::TextDocumentSerializer serializer( widget->textDocument() );
if( !serializer.load( "your-filename.rb" ) ) {
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()) );
}

Expand Down
251 changes: 128 additions & 123 deletions edbee-lib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,167 +5,172 @@ IF(POLICY CMP0020)
CMAKE_POLICY(SET CMP0020 NEW)
ENDIF()

# hack?? https://stackoverflow.com/questions/31561309/cmake-warnings-under-os-x-macosx-rpath-is-not-specified-for-the-following-targe
set(CMAKE_MACOSX_RPATH 1)

PROJECT(edbee-lib)

add_subdirectory(../vendor/qslog/ qslog)

SET(SOURCES
edbee/util/mem/debug_new.cpp
edbee/util/mem/debug_allocs.cpp
edbee/util/simpleprofiler.cpp
edbee/util/textcodecdetector.cpp
edbee/util/lineending.cpp
edbee/texteditorwidget.cpp
edbee/views/textrenderer.cpp
edbee/models/textdocument.cpp
edbee/models/chardocument/chartextdocument.cpp
edbee/models/texteditorconfig.cpp
edbee/models/texteditorkeymap.cpp
edbee/models/textundostack.cpp
edbee/views/textcaretcache.cpp
edbee/models/textlexer.cpp
edbee/models/textrange.cpp
edbee/views/textselection.cpp
edbee/models/textdocumentscopes.cpp
edbee/lexers/grammartextlexer.cpp
edbee/util/gapvector.h
edbee/util/lineoffsetvector.cpp
edbee/models/textlinedata.cpp
edbee/models/textbuffer.cpp
edbee/models/chardocument/chartextbuffer.cpp
edbee/texteditorcontroller.cpp
edbee/texteditorcommand.cpp
edbee/commands/selectioncommand.cpp
edbee/commands/undocommand.cpp
edbee/commands/redocommand.cpp
edbee/commands/replaceselectioncommand.cpp
edbee/commands/commentcommand.cpp
edbee/commands/copycommand.cpp
edbee/commands/cutcommand.cpp
edbee/commands/pastecommand.cpp
edbee/io/textdocumentserializer.cpp
edbee/util/test.cpp
edbee/util/textcodec.cpp
edbee/io/tmlanguageparser.cpp
edbee/commands/debugcommand.cpp
edbee/util/regexp.cpp
edbee/io/tmthemeparser.cpp
edbee/io/baseplistparser.cpp
edbee/io/jsonparser.cpp
edbee/models/textgrammar.cpp
edbee/models/texteditorcommandmap.cpp
edbee/views/components/texteditorautocompletecomponent.cpp
edbee/views/components/texteditorcomponent.cpp
edbee/views/components/texteditorrenderer.cpp
edbee/views/components/textmargincomponent.cpp
edbee/views/texttheme.cpp
edbee/views/texteditorscrollarea.cpp
edbee/models/textsearcher.cpp
edbee/commands/findcommand.cpp
edbee/io/keymapparser.cpp
edbee/commands/tabcommand.cpp
edbee/edbee.cpp
edbee/models/textdocumentfilter.cpp
edbee/util/cascadingqvariantmap.cpp
edbee/commands/duplicatecommand.cpp
edbee/commands/findcommand.cpp
edbee/commands/movelinecommand.cpp
edbee/commands/newlinecommand.cpp
edbee/util/util.cpp
edbee/commands/pastecommand.cpp
edbee/commands/redocommand.cpp
edbee/commands/removecommand.cpp
edbee/commands/replaceselectioncommand.cpp
edbee/commands/selectioncommand.cpp
edbee/commands/tabcommand.cpp
edbee/commands/togglereadonlycommand.cpp
edbee/commands/undocommand.cpp
edbee/data/factorycommandmap.cpp
edbee/data/factorykeymap.cpp
edbee/edbee.cpp
edbee/io/baseplistparser.cpp
edbee/io/jsonparser.cpp
edbee/io/keymapparser.cpp
edbee/io/textdocumentserializer.cpp
edbee/io/tmlanguageparser.cpp
edbee/io/tmthemeparser.cpp
edbee/lexers/grammartextlexer.cpp
edbee/models/change.cpp
edbee/models/changes/abstractrangedchange.cpp
edbee/models/changes/linedatalistchange.cpp
edbee/models/changes/linedatachange.cpp
edbee/models/changes/linedatalistchange.cpp
edbee/models/changes/mergablechangegroup.cpp
edbee/models/changes/selectionchange.cpp
edbee/models/changes/textchange.cpp
edbee/models/changes/textchangewithcaret.cpp
edbee/models/changes/mergablechangegroup.cpp
edbee/commands/commentcommand.cpp
edbee/util/rangesetlineiterator.cpp
edbee/models/chardocument/chartextbuffer.cpp
edbee/models/chardocument/chartextdocument.cpp
edbee/models/dynamicvariables.cpp
edbee/util/rangelineiterator.cpp
edbee/data/factorykeymap.cpp
edbee/data/factorycommandmap.cpp
edbee/models/textautocompleteprovider.cpp
edbee/models/textbuffer.cpp
edbee/models/textdocument.cpp
edbee/models/textdocumentfilter.cpp
edbee/models/textdocumentscopes.cpp
edbee/models/texteditorcommandmap.cpp
edbee/models/texteditorconfig.cpp
edbee/models/texteditorkeymap.cpp
edbee/models/textgrammar.cpp
edbee/models/textlexer.cpp
edbee/models/textlinedata.cpp
edbee/models/textrange.cpp
edbee/models/textsearcher.cpp
edbee/models/textundostack.cpp
edbee/texteditorcommand.cpp
edbee/texteditorcontroller.cpp
edbee/texteditorwidget.cpp
edbee/util/cascadingqvariantmap.cpp
edbee/util/gapvector.h
edbee/util/lineending.cpp
edbee/util/lineoffsetvector.cpp
edbee/util/mem/debug_allocs.cpp
edbee/util/mem/debug_new.cpp
edbee/util/rangelineiterator.cpp
edbee/util/rangesetlineiterator.cpp
edbee/util/regexp.cpp
edbee/util/simpleprofiler.cpp
edbee/util/test.cpp
edbee/util/textcodec.cpp
edbee/util/textcodecdetector.cpp
edbee/util/util.cpp
edbee/views/components/texteditorautocompletecomponent.cpp
edbee/views/components/texteditorcomponent.cpp
edbee/views/components/texteditorrenderer.cpp
edbee/views/components/textmargincomponent.cpp
edbee/views/textcaretcache.cpp
edbee/views/texteditorscrollarea.cpp
edbee/views/textrenderer.cpp
edbee/views/textselection.cpp
edbee/views/texttheme.cpp
)

SET(HEADERS
edbee/util/logging.h
edbee/util/mem/debug_new.h
edbee/util/mem/debug_allocs.h
edbee/util/simpleprofiler.h
edbee/util/textcodecdetector.h
edbee/util/lineending.h
edbee/texteditorwidget.h
edbee/views/textrenderer.h
edbee/models/textdocument.h
edbee/models/chardocument/chartextdocument.h
edbee/models/texteditorconfig.h
edbee/models/texteditorkeymap.h
edbee/models/textundostack.h
edbee/texteditorcontroller.h
edbee/views/textcaretcache.h
edbee/models/textlexer.h
edbee/models/textrange.h
edbee/views/textselection.h
edbee/models/textdocumentscopes.h
edbee/lexers/grammartextlexer.h
edbee/util/lineoffsetvector.h
edbee/models/textlinedata.h
edbee/models/textbuffer.h
edbee/models/chardocument/chartextbuffer.h
edbee/texteditorcommand.h
edbee/commands/selectioncommand.h
edbee/commands/undocommand.h
edbee/commands/redocommand.h
edbee/commands/replaceselectioncommand.h
edbee/commands/commentcommand.h
edbee/commands/copycommand.h
edbee/commands/cutcommand.h
edbee/commands/pastecommand.h
edbee/models/textdocumentfilter.h
edbee/debug.h
edbee/io/textdocumentserializer.h
edbee/util/test.h
edbee/util/textcodec.h
edbee/io/tmlanguageparser.h
edbee/commands/debugcommand.h
edbee/util/regexp.h
edbee/io/tmthemeparser.h
edbee/io/baseplistparser.h
edbee/io/jsonparser.h
edbee/models/textgrammar.h
edbee/models/texteditorcommandmap.h
edbee/views/components/texteditorautocompletecomponent.h
edbee/views/components/texteditorcomponent.h
edbee/views/components/texteditorrenderer.h
edbee/views/components/textmargincomponent.h
edbee/views/texttheme.h
edbee/views/texteditorscrollarea.h
edbee/models/textsearcher.h
edbee/commands/findcommand.h
edbee/io/keymapparser.h
edbee/commands/tabcommand.h
edbee/edbee.h
edbee/util/cascadingqvariantmap.h
edbee/commands/duplicatecommand.h
edbee/commands/findcommand.h
edbee/commands/movelinecommand.h
edbee/commands/newlinecommand.h
edbee/util/util.h
edbee/commands/pastecommand.h
edbee/commands/redocommand.h
edbee/commands/removecommand.h
edbee/commands/replaceselectioncommand.h
edbee/commands/selectioncommand.h
edbee/commands/tabcommand.h
edbee/commands/togglereadonlycommand.h
edbee/commands/undocommand.h
edbee/data/factorycommandmap.h
edbee/data/factorykeymap.h
edbee/debug.h
edbee/edbee.h
edbee/io/baseplistparser.h
edbee/io/jsonparser.h
edbee/io/keymapparser.h
edbee/io/textdocumentserializer.h
edbee/io/tmlanguageparser.h
edbee/io/tmthemeparser.h
edbee/lexers/grammartextlexer.h
edbee/models/change.h
edbee/models/changes/abstractrangedchange.h
edbee/models/changes/linedatalistchange.h
edbee/models/changes/linedatachange.h
edbee/models/changes/linedatalistchange.h
edbee/models/changes/mergablechangegroup.h
edbee/models/changes/selectionchange.h
edbee/models/changes/textchange.h
edbee/models/changes/textchangewithcaret.h
edbee/models/changes/mergablechangegroup.h
edbee/commands/commentcommand.h
edbee/util/rangesetlineiterator.h
edbee/models/chardocument/chartextbuffer.h
edbee/models/chardocument/chartextdocument.h
edbee/models/dynamicvariables.h
edbee/util/rangelineiterator.h
edbee/data/factorykeymap.h
edbee/data/factorycommandmap.h
edbee/models/textautocompleteprovider.h
edbee/models/textbuffer.h
edbee/models/textdocument.h
edbee/models/textdocumentfilter.h
edbee/models/textdocumentscopes.h
edbee/models/texteditorcommandmap.h
edbee/models/texteditorconfig.h
edbee/models/texteditorkeymap.h
edbee/models/textgrammar.h
edbee/models/textlexer.h
edbee/models/textlinedata.h
edbee/models/textrange.h
edbee/models/textsearcher.h
edbee/models/textundostack.h
edbee/texteditorcommand.h
edbee/texteditorcontroller.h
edbee/texteditorwidget.h
edbee/util/cascadingqvariantmap.h
edbee/util/lineending.h
edbee/util/lineoffsetvector.h
edbee/util/logging.h
edbee/util/mem/debug_allocs.h
edbee/util/mem/debug_new.h
edbee/util/rangelineiterator.h
edbee/util/rangesetlineiterator.h
edbee/util/regexp.h
edbee/util/simpleprofiler.h
edbee/util/test.h
edbee/util/textcodec.h
edbee/util/textcodecdetector.h
edbee/util/util.h
edbee/views/components/texteditorautocompletecomponent.h
edbee/views/components/texteditorcomponent.h
edbee/views/components/texteditorrenderer.h
edbee/views/components/textmargincomponent.h
edbee/views/textcaretcache.h
edbee/views/texteditorscrollarea.h
edbee/views/textrenderer.h
edbee/views/textselection.h
edbee/views/texttheme.h
)

FIND_PACKAGE(Qt5Core REQUIRED)
Expand Down
2 changes: 2 additions & 0 deletions edbee-lib/edbee-lib.pri
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ SOURCES += \
$$PWD/edbee/commands/replaceselectioncommand.cpp \
$$PWD/edbee/commands/selectioncommand.cpp \
$$PWD/edbee/commands/tabcommand.cpp \
$$PWD/edbee/commands/togglereadonlycommand.cpp \
$$PWD/edbee/commands/undocommand.cpp \
$$PWD/edbee/data/factorycommandmap.cpp \
$$PWD/edbee/data/factorykeymap.cpp \
Expand Down Expand Up @@ -95,6 +96,7 @@ HEADERS += \
$$PWD/edbee/commands/replaceselectioncommand.h \
$$PWD/edbee/commands/selectioncommand.h \
$$PWD/edbee/commands/tabcommand.h \
$$PWD/edbee/commands/togglereadonlycommand.h \
$$PWD/edbee/commands/undocommand.h \
$$PWD/edbee/data/factorycommandmap.h \
$$PWD/edbee/data/factorykeymap.h \
Expand Down
5 changes: 5 additions & 0 deletions edbee-lib/edbee/commands/copycommand.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,4 +55,9 @@ QString CopyCommand::toString()
return "CopyCommand";
}

bool CopyCommand::readonly()
{
return true;
}

} // edbee
5 changes: 3 additions & 2 deletions edbee-lib/edbee/commands/copycommand.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,9 @@ class EDBEE_EXPORT CopyCommand : public TextEditorCommand
static const QString EDBEE_TEXT_TYPE;

public:
virtual void execute( TextEditorController* controller );
virtual QString toString();
virtual void execute( TextEditorController* controller ) override;
virtual QString toString() override;
virtual bool readonly() override;
};


Expand Down
5 changes: 5 additions & 0 deletions edbee-lib/edbee/commands/debugcommand.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@ QString DebugCommand::toString()
return "DebugCommand";
}

bool DebugCommand::readonly()
{
return true;
}

/// This method dumps the scopes
void DebugCommand::dumpScopes( TextEditorController* controller )
{
Expand Down
5 changes: 3 additions & 2 deletions edbee-lib/edbee/commands/debugcommand.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,9 @@ class EDBEE_EXPORT DebugCommand : public TextEditorCommand

DebugCommand( DebugCommandType command );

virtual void execute( TextEditorController* controller );
virtual QString toString();
virtual void execute(TextEditorController* controller) override;
virtual QString toString() override;
virtual bool readonly() override;

protected:

Expand Down
Loading

0 comments on commit 0f8823a

Please sign in to comment.