From 4d815344528fec7e009b221e871187285e3b8903 Mon Sep 17 00:00:00 2001 From: Rick Blommers Date: Mon, 7 Jan 2019 16:01:22 +0100 Subject: [PATCH 1/7] fix #79, Using backtab on empty document causes Q_ASSERT failure --- CHANGELOG.md | 1 + edbee-lib/edbee/commands/tabcommand.cpp | 1 + 2 files changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 097fc03..3b16437 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ edbee.lib: +- fix #79, Using backtab on empty document causes Q_ASSERT failure - ref #66, Automatic grouping of Changes that happen in repond of another event. (Crash in setText()) - add #60, Basic support for auto complete. - add #59, Shift+Delete should perform a cut diff --git a/edbee-lib/edbee/commands/tabcommand.cpp b/edbee-lib/edbee/commands/tabcommand.cpp index 04ba74b..9937c86 100644 --- a/edbee-lib/edbee/commands/tabcommand.cpp +++ b/edbee-lib/edbee/commands/tabcommand.cpp @@ -71,6 +71,7 @@ void TabCommand::indent( TextEditorController* controller ) int endOffset = offset; for( int j=0; j= doc->length()) break; QChar chr = doc->charAt(off); if( chr != ' ' && chr != '\t' ) break; From 198eb20f55103407af88ca178ef24ceab35cd61a Mon Sep 17 00:00:00 2001 From: Rick Blommers Date: Mon, 11 Feb 2019 07:37:13 +0100 Subject: [PATCH 2/7] ref #76, Memory Leak detection will only be used if EDBEE_DEBUG is defined! --- edbee-lib/edbee-lib.pro | 3 +++ edbee-lib/edbee/util/mem/debug_new.h | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/edbee-lib/edbee-lib.pro b/edbee-lib/edbee-lib.pro index bc46fee..d758c4c 100644 --- a/edbee-lib/edbee-lib.pro +++ b/edbee-lib/edbee-lib.pro @@ -10,6 +10,9 @@ TARGET = edbee TEMPLATE = lib CONFIG += staticlib +# Define EDBEE_BEGUG to enable memory debugging +DEFINES += EDBEE_DEBUG + # DEFINE 'EDBEE_SANITIZE' to enable santitize bounds checks EDBEE_SANITIZE = $$(EDBEE_SANITIZE) !isEmpty( EDBEE_SANITIZE ) { diff --git a/edbee-lib/edbee/util/mem/debug_new.h b/edbee-lib/edbee/util/mem/debug_new.h index a943f89..8f4059e 100644 --- a/edbee-lib/edbee/util/mem/debug_new.h +++ b/edbee-lib/edbee/util/mem/debug_new.h @@ -13,8 +13,8 @@ //#endif //#include "memoryleak.h" -#if defined(QT_DEBUG) && !defined(__MINGW32__) - +// #if defined(QT_DEBUG) && !defined(__MINGW32__) && defined(EDBEE_DEBUG) +#if defined(EDBEE_DEBUG) #define EDBEE_DEBUG_NEW_ACTIVE void* debug_malloc (size_t size, const char* file, const int line); From 993a3794ebff876a51e9f8480752159f4c20c088 Mon Sep 17 00:00:00 2001 From: Bruno Pedrosa Date: Wed, 20 Feb 2019 10:25:59 +0100 Subject: [PATCH 3/7] Support to build edbee-lib dynamically --- .gitignore | 5 +- edbee-lib/edbee-lib.pri | 307 +++++++++--------- edbee-lib/edbee/commands/commentcommand.h | 4 +- edbee-lib/edbee/commands/copycommand.h | 4 +- edbee-lib/edbee/commands/cutcommand.h | 4 +- edbee-lib/edbee/commands/debugcommand.h | 4 +- edbee-lib/edbee/commands/duplicatecommand.h | 4 +- edbee-lib/edbee/commands/findcommand.h | 4 +- edbee-lib/edbee/commands/movelinecommand.h | 4 +- edbee-lib/edbee/commands/newlinecommand.h | 4 +- edbee-lib/edbee/commands/pastecommand.h | 4 +- edbee-lib/edbee/commands/redocommand.h | 4 +- edbee-lib/edbee/commands/removecommand.h | 4 +- .../edbee/commands/replaceselectioncommand.h | 4 +- edbee-lib/edbee/commands/selectioncommand.h | 4 +- edbee-lib/edbee/commands/tabcommand.h | 4 +- edbee-lib/edbee/commands/undocommand.h | 4 +- edbee-lib/edbee/data/factorycommandmap.h | 5 +- edbee-lib/edbee/data/factorykeymap.h | 5 +- edbee-lib/edbee/edbee.h | 4 +- edbee-lib/edbee/exports.h | 13 + edbee-lib/edbee/io/baseplistparser.h | 5 +- edbee-lib/edbee/io/jsonparser.h | 5 +- edbee-lib/edbee/io/keymapparser.h | 7 +- edbee-lib/edbee/io/textdocumentserializer.h | 8 +- edbee-lib/edbee/io/tmlanguageparser.h | 4 +- edbee-lib/edbee/io/tmthemeparser.h | 4 +- edbee-lib/edbee/lexers/grammartextlexer.h | 4 +- edbee-lib/edbee/models/change.h | 13 +- .../models/changes/abstractrangedchange.h | 4 +- .../edbee/models/changes/linedatachange.h | 4 +- .../edbee/models/changes/linedatalistchange.h | 4 +- .../models/changes/mergablechangegroup.h | 4 +- .../edbee/models/changes/selectionchange.h | 4 +- edbee-lib/edbee/models/changes/textchange.h | 4 +- .../models/changes/textchangewithcaret.h | 4 +- .../models/chardocument/chartextbuffer.h | 4 +- .../models/chardocument/chartextdocument.h | 4 +- edbee-lib/edbee/models/dynamicvariables.h | 12 +- .../edbee/models/textautocompleteprovider.h | 19 +- edbee-lib/edbee/models/textbuffer.h | 9 +- edbee-lib/edbee/models/textdocument.h | 4 +- edbee-lib/edbee/models/textdocumentfilter.h | 5 +- edbee-lib/edbee/models/textdocumentscopes.h | 26 +- edbee-lib/edbee/models/texteditorcommandmap.h | 4 +- edbee-lib/edbee/models/texteditorconfig.h | 4 +- edbee-lib/edbee/models/texteditorkeymap.h | 11 +- edbee-lib/edbee/models/textgrammar.h | 11 +- edbee-lib/edbee/models/textlexer.h | 5 +- edbee-lib/edbee/models/textlinedata.h | 12 +- edbee-lib/edbee/models/textrange.h | 12 +- edbee-lib/edbee/models/textsearcher.h | 4 +- edbee-lib/edbee/models/textundostack.h | 4 +- edbee-lib/edbee/texteditorcommand.h | 5 +- edbee-lib/edbee/texteditorcontroller.h | 4 +- edbee-lib/edbee/texteditorwidget.h | 4 +- edbee-lib/edbee/util/cascadingqvariantmap.h | 5 +- edbee-lib/edbee/util/gapvector.h | 10 +- edbee-lib/edbee/util/lineending.h | 5 +- edbee-lib/edbee/util/lineoffsetvector.h | 5 +- edbee-lib/edbee/util/mem/debug_allocs.h | 5 +- edbee-lib/edbee/util/rangelineiterator.h | 5 +- edbee-lib/edbee/util/rangesetlineiterator.h | 5 +- edbee-lib/edbee/util/regexp.h | 8 +- edbee-lib/edbee/util/simpleprofiler.h | 5 +- edbee-lib/edbee/util/test.h | 15 +- edbee-lib/edbee/util/textcodec.h | 10 +- edbee-lib/edbee/util/textcodecdetector.h | 5 +- edbee-lib/edbee/util/util.h | 5 +- .../texteditorautocompletecomponent.h | 4 +- .../views/components/texteditorcomponent.h | 4 +- .../views/components/texteditorrenderer.h | 5 +- .../views/components/textmargincomponent.h | 7 +- edbee-lib/edbee/views/textcaretcache.h | 5 +- edbee-lib/edbee/views/texteditorscrollarea.h | 4 +- edbee-lib/edbee/views/textrenderer.h | 4 +- edbee-lib/edbee/views/textselection.h | 4 +- edbee-lib/edbee/views/texttheme.h | 11 +- 78 files changed, 447 insertions(+), 329 deletions(-) create mode 100644 edbee-lib/edbee/exports.h diff --git a/.gitignore b/.gitignore index f7e147e..0aa00b5 100644 --- a/.gitignore +++ b/.gitignore @@ -20,6 +20,9 @@ Makefile *-build-* edbee-lib-doxydocs +edbee-lib_dll.pro +lib +dll # cmake ignores CMakeCache.txt @@ -38,4 +41,4 @@ edbee-test/edbee-test .vs/ edbee-lib/debug/ -edbee-lib/release/ \ No newline at end of file +edbee-lib/release/ diff --git a/edbee-lib/edbee-lib.pri b/edbee-lib/edbee-lib.pri index 7c1c35e..0814921 100644 --- a/edbee-lib/edbee-lib.pri +++ b/edbee-lib/edbee-lib.pri @@ -3,161 +3,162 @@ INCLUDEPATH += $$PWD SOURCES += \ - $$PWD/edbee/util/mem/debug_new.cpp \ - $$PWD/edbee/util/mem/debug_allocs.cpp \ - $$PWD/edbee/util/simpleprofiler.cpp \ - $$PWD/edbee/util/textcodecdetector.cpp \ - $$PWD/edbee/util/lineending.cpp \ - $$PWD/edbee/texteditorwidget.cpp \ - $$PWD/edbee/views/textrenderer.cpp \ - $$PWD/edbee/models/textdocument.cpp \ - $$PWD/edbee/models/chardocument/chartextdocument.cpp \ - $$PWD/edbee/models/texteditorconfig.cpp \ - $$PWD/edbee/models/texteditorkeymap.cpp \ - $$PWD/edbee/models/textundostack.cpp \ - $$PWD/edbee/views/textcaretcache.cpp \ - $$PWD/edbee/models/textlexer.cpp \ - $$PWD/edbee/models/textrange.cpp \ - $$PWD/edbee/views/textselection.cpp \ - $$PWD/edbee/models/textdocumentscopes.cpp \ - $$PWD/edbee/lexers/grammartextlexer.cpp \ - $$PWD/edbee/util/gapvector.h \ - $$PWD/edbee/util/lineoffsetvector.cpp \ - $$PWD/edbee/models/textlinedata.cpp \ - $$PWD/edbee/models/textbuffer.cpp \ - $$PWD/edbee/models/chardocument/chartextbuffer.cpp \ - $$PWD/edbee/texteditorcontroller.cpp \ - $$PWD/edbee/texteditorcommand.cpp \ - $$PWD/edbee/commands/selectioncommand.cpp \ - $$PWD/edbee/commands/undocommand.cpp \ - $$PWD/edbee/commands/redocommand.cpp \ - $$PWD/edbee/commands/replaceselectioncommand.cpp \ - $$PWD/edbee/commands/copycommand.cpp \ - $$PWD/edbee/commands/cutcommand.cpp \ - $$PWD/edbee/commands/pastecommand.cpp \ - $$PWD/edbee/io/textdocumentserializer.cpp \ - $$PWD/edbee/util/test.cpp \ - $$PWD/edbee/util/textcodec.cpp \ - $$PWD/edbee/io/tmlanguageparser.cpp \ - $$PWD/edbee/commands/debugcommand.cpp \ - $$PWD/edbee/util/regexp.cpp \ - $$PWD/edbee/io/tmthemeparser.cpp \ - $$PWD/edbee/io/baseplistparser.cpp \ - $$PWD/edbee/io/jsonparser.cpp \ - $$PWD/edbee/models/textgrammar.cpp \ - $$PWD/edbee/models/texteditorcommandmap.cpp \ - $$PWD/edbee/views/components/texteditorautocompletecomponent.cpp \ - $$PWD/edbee/views/components/texteditorcomponent.cpp \ - $$PWD/edbee/views/components/texteditorrenderer.cpp \ - $$PWD/edbee/views/components/textmargincomponent.cpp \ - $$PWD/edbee/views/texttheme.cpp \ - $$PWD/edbee/views/texteditorscrollarea.cpp \ - $$PWD/edbee/models/textsearcher.cpp \ - $$PWD/edbee/commands/findcommand.cpp \ - $$PWD/edbee/io/keymapparser.cpp \ - $$PWD/edbee/commands/tabcommand.cpp \ - $$PWD/edbee/edbee.cpp \ - $$PWD/edbee/models/textdocumentfilter.cpp \ - $$PWD/edbee/util/cascadingqvariantmap.cpp \ - $$PWD/edbee/commands/duplicatecommand.cpp \ - $$PWD/edbee/commands/newlinecommand.cpp \ - $$PWD/edbee/util/util.cpp \ - $$PWD/edbee/commands/removecommand.cpp \ - $$PWD/edbee/models/change.cpp \ - $$PWD/edbee/models/changes/abstractrangedchange.cpp \ - $$PWD/edbee/models/changes/linedatalistchange.cpp \ - $$PWD/edbee/models/changes/linedatachange.cpp \ - $$PWD/edbee/models/changes/selectionchange.cpp \ - $$PWD/edbee/models/changes/textchange.cpp \ - $$PWD/edbee/models/changes/textchangewithcaret.cpp \ - $$PWD/edbee/models/changes/mergablechangegroup.cpp \ - $$PWD/edbee/commands/commentcommand.cpp \ - $$PWD/edbee/util/rangesetlineiterator.cpp \ - $$PWD/edbee/models/dynamicvariables.cpp \ - $$PWD/edbee/util/rangelineiterator.cpp \ - $$PWD/edbee/data/factorykeymap.cpp \ - $$PWD/edbee/data/factorycommandmap.cpp \ - $$PWD/edbee/commands/movelinecommand.cpp \ - $$PWD/edbee/models/textautocompleteprovider.cpp + $$PWD/edbee/commands/commentcommand.cpp \ + $$PWD/edbee/commands/copycommand.cpp \ + $$PWD/edbee/commands/cutcommand.cpp \ + $$PWD/edbee/commands/debugcommand.cpp \ + $$PWD/edbee/commands/duplicatecommand.cpp \ + $$PWD/edbee/commands/findcommand.cpp \ + $$PWD/edbee/commands/movelinecommand.cpp \ + $$PWD/edbee/commands/newlinecommand.cpp \ + $$PWD/edbee/commands/pastecommand.cpp \ + $$PWD/edbee/commands/redocommand.cpp \ + $$PWD/edbee/commands/removecommand.cpp \ + $$PWD/edbee/commands/replaceselectioncommand.cpp \ + $$PWD/edbee/commands/selectioncommand.cpp \ + $$PWD/edbee/commands/tabcommand.cpp \ + $$PWD/edbee/commands/undocommand.cpp \ + $$PWD/edbee/data/factorycommandmap.cpp \ + $$PWD/edbee/data/factorykeymap.cpp \ + $$PWD/edbee/edbee.cpp \ + $$PWD/edbee/io/baseplistparser.cpp \ + $$PWD/edbee/io/jsonparser.cpp \ + $$PWD/edbee/io/keymapparser.cpp \ + $$PWD/edbee/io/textdocumentserializer.cpp \ + $$PWD/edbee/io/tmlanguageparser.cpp \ + $$PWD/edbee/io/tmthemeparser.cpp \ + $$PWD/edbee/lexers/grammartextlexer.cpp \ + $$PWD/edbee/models/change.cpp \ + $$PWD/edbee/models/changes/abstractrangedchange.cpp \ + $$PWD/edbee/models/changes/linedatachange.cpp \ + $$PWD/edbee/models/changes/linedatalistchange.cpp \ + $$PWD/edbee/models/changes/mergablechangegroup.cpp \ + $$PWD/edbee/models/changes/selectionchange.cpp \ + $$PWD/edbee/models/changes/textchange.cpp \ + $$PWD/edbee/models/changes/textchangewithcaret.cpp \ + $$PWD/edbee/models/chardocument/chartextbuffer.cpp \ + $$PWD/edbee/models/chardocument/chartextdocument.cpp \ + $$PWD/edbee/models/dynamicvariables.cpp \ + $$PWD/edbee/models/textautocompleteprovider.cpp \ + $$PWD/edbee/models/textbuffer.cpp \ + $$PWD/edbee/models/textdocument.cpp \ + $$PWD/edbee/models/textdocumentfilter.cpp \ + $$PWD/edbee/models/textdocumentscopes.cpp \ + $$PWD/edbee/models/texteditorcommandmap.cpp \ + $$PWD/edbee/models/texteditorconfig.cpp \ + $$PWD/edbee/models/texteditorkeymap.cpp \ + $$PWD/edbee/models/textgrammar.cpp \ + $$PWD/edbee/models/textlexer.cpp \ + $$PWD/edbee/models/textlinedata.cpp \ + $$PWD/edbee/models/textrange.cpp \ + $$PWD/edbee/models/textsearcher.cpp \ + $$PWD/edbee/models/textundostack.cpp \ + $$PWD/edbee/texteditorcommand.cpp \ + $$PWD/edbee/texteditorcontroller.cpp \ + $$PWD/edbee/texteditorwidget.cpp \ + $$PWD/edbee/util/cascadingqvariantmap.cpp \ + $$PWD/edbee/util/gapvector.h \ + $$PWD/edbee/util/lineending.cpp \ + $$PWD/edbee/util/lineoffsetvector.cpp \ + $$PWD/edbee/util/mem/debug_allocs.cpp \ + $$PWD/edbee/util/mem/debug_new.cpp \ + $$PWD/edbee/util/rangelineiterator.cpp \ + $$PWD/edbee/util/rangesetlineiterator.cpp \ + $$PWD/edbee/util/regexp.cpp \ + $$PWD/edbee/util/simpleprofiler.cpp \ + $$PWD/edbee/util/test.cpp \ + $$PWD/edbee/util/textcodec.cpp \ + $$PWD/edbee/util/textcodecdetector.cpp \ + $$PWD/edbee/util/util.cpp \ + $$PWD/edbee/views/components/texteditorautocompletecomponent.cpp \ + $$PWD/edbee/views/components/texteditorcomponent.cpp \ + $$PWD/edbee/views/components/texteditorrenderer.cpp \ + $$PWD/edbee/views/components/textmargincomponent.cpp \ + $$PWD/edbee/views/textcaretcache.cpp \ + $$PWD/edbee/views/texteditorscrollarea.cpp \ + $$PWD/edbee/views/textrenderer.cpp \ + $$PWD/edbee/views/textselection.cpp \ + $$PWD/edbee/views/texttheme.cpp HEADERS += \ - $$PWD/edbee/util/logging.h \ - $$PWD/edbee/util/mem/debug_new.h \ - $$PWD/edbee/util/mem/debug_allocs.h \ - $$PWD/edbee/util/simpleprofiler.h \ - $$PWD/edbee/util/textcodecdetector.h \ - $$PWD/edbee/util/lineending.h \ - $$PWD/edbee/texteditorwidget.h \ - $$PWD/edbee/views/textrenderer.h \ - $$PWD/edbee/models/textdocument.h \ - $$PWD/edbee/models/chardocument/chartextdocument.h \ - $$PWD/edbee/models/texteditorconfig.h \ - $$PWD/edbee/models/texteditorkeymap.h \ - $$PWD/edbee/models/textundostack.h \ - $$PWD/edbee/texteditorcontroller.h \ - $$PWD/edbee/views/textcaretcache.h \ - $$PWD/edbee/models/textlexer.h \ - $$PWD/edbee/models/textrange.h \ - $$PWD/edbee/views/textselection.h \ - $$PWD/edbee/models/textdocumentscopes.h \ - $$PWD/edbee/lexers/grammartextlexer.h \ - $$PWD/edbee/util/lineoffsetvector.h \ - $$PWD/edbee/models/textlinedata.h \ - $$PWD/edbee/models/textbuffer.h \ - $$PWD/edbee/models/chardocument/chartextbuffer.h \ - $$PWD/edbee/texteditorcommand.h \ - $$PWD/edbee/commands/selectioncommand.h \ - $$PWD/edbee/commands/undocommand.h \ - $$PWD/edbee/commands/redocommand.h \ - $$PWD/edbee/commands/replaceselectioncommand.h \ - $$PWD/edbee/commands/copycommand.h \ - $$PWD/edbee/commands/cutcommand.h \ - $$PWD/edbee/commands/pastecommand.h \ - $$PWD/edbee/models/textdocumentfilter.h \ - $$PWD/edbee/debug.h \ - $$PWD/edbee/io/textdocumentserializer.h \ - $$PWD/edbee/util/test.h \ - $$PWD/edbee/util/textcodec.h \ - $$PWD/edbee/io/tmlanguageparser.h \ - $$PWD/edbee/commands/debugcommand.h \ - $$PWD/edbee/util/regexp.h \ - $$PWD/edbee/io/tmthemeparser.h \ - $$PWD/edbee/io/baseplistparser.h \ - $$PWD/edbee/io/jsonparser.h \ - $$PWD/edbee/models/textgrammar.h \ - $$PWD/edbee/models/texteditorcommandmap.h \ - $$PWD/edbee/views/components/texteditorautocompletecomponent.h \ - $$PWD/edbee/views/components/texteditorcomponent.h \ - $$PWD/edbee/views/components/texteditorrenderer.h \ - $$PWD/edbee/views/components/textmargincomponent.h \ - $$PWD/edbee/views/texttheme.h \ - $$PWD/edbee/views/texteditorscrollarea.h \ - $$PWD/edbee/models/textsearcher.h \ - $$PWD/edbee/commands/findcommand.h \ - $$PWD/edbee/io/keymapparser.h \ - $$PWD/edbee/commands/tabcommand.h \ - $$PWD/edbee/edbee.h \ - $$PWD/edbee/util/cascadingqvariantmap.h \ - $$PWD/edbee/commands/duplicatecommand.h \ - $$PWD/edbee/commands/newlinecommand.h \ - $$PWD/edbee/util/util.h \ - $$PWD/edbee/commands/removecommand.h \ - $$PWD/edbee/models/change.h \ - $$PWD/edbee/models/changes/abstractrangedchange.h \ - $$PWD/edbee/models/changes/linedatalistchange.h \ - $$PWD/edbee/models/changes/linedatachange.h \ - $$PWD/edbee/models/changes/selectionchange.h \ - $$PWD/edbee/models/changes/textchange.h \ - $$PWD/edbee/models/changes/textchangewithcaret.h \ - $$PWD/edbee/models/changes/mergablechangegroup.h \ - $$PWD/edbee/commands/commentcommand.h \ - $$PWD/edbee/util/rangesetlineiterator.h \ - $$PWD/edbee/models/dynamicvariables.h \ - $$PWD/edbee/util/rangelineiterator.h \ - $$PWD/edbee/data/factorykeymap.h \ - $$PWD/edbee/data/factorycommandmap.h \ - $$PWD/edbee/commands/movelinecommand.h \ - $$PWD/edbee/models/textautocompleteprovider.h + $$PWD/edbee/commands/commentcommand.h \ + $$PWD/edbee/commands/copycommand.h \ + $$PWD/edbee/commands/cutcommand.h \ + $$PWD/edbee/commands/debugcommand.h \ + $$PWD/edbee/commands/duplicatecommand.h \ + $$PWD/edbee/commands/findcommand.h \ + $$PWD/edbee/commands/movelinecommand.h \ + $$PWD/edbee/commands/newlinecommand.h \ + $$PWD/edbee/commands/pastecommand.h \ + $$PWD/edbee/commands/redocommand.h \ + $$PWD/edbee/commands/removecommand.h \ + $$PWD/edbee/commands/replaceselectioncommand.h \ + $$PWD/edbee/commands/selectioncommand.h \ + $$PWD/edbee/commands/tabcommand.h \ + $$PWD/edbee/commands/undocommand.h \ + $$PWD/edbee/data/factorycommandmap.h \ + $$PWD/edbee/data/factorykeymap.h \ + $$PWD/edbee/debug.h \ + $$PWD/edbee/edbee.h \ + $$PWD/edbee/exports.h \ + $$PWD/edbee/io/baseplistparser.h \ + $$PWD/edbee/io/jsonparser.h \ + $$PWD/edbee/io/keymapparser.h \ + $$PWD/edbee/io/textdocumentserializer.h \ + $$PWD/edbee/io/tmlanguageparser.h \ + $$PWD/edbee/io/tmthemeparser.h \ + $$PWD/edbee/lexers/grammartextlexer.h \ + $$PWD/edbee/models/change.h \ + $$PWD/edbee/models/changes/abstractrangedchange.h \ + $$PWD/edbee/models/changes/linedatachange.h \ + $$PWD/edbee/models/changes/linedatalistchange.h \ + $$PWD/edbee/models/changes/mergablechangegroup.h \ + $$PWD/edbee/models/changes/selectionchange.h \ + $$PWD/edbee/models/changes/textchange.h \ + $$PWD/edbee/models/changes/textchangewithcaret.h \ + $$PWD/edbee/models/chardocument/chartextbuffer.h \ + $$PWD/edbee/models/chardocument/chartextdocument.h \ + $$PWD/edbee/models/dynamicvariables.h \ + $$PWD/edbee/models/textautocompleteprovider.h \ + $$PWD/edbee/models/textbuffer.h \ + $$PWD/edbee/models/textdocument.h \ + $$PWD/edbee/models/textdocumentfilter.h \ + $$PWD/edbee/models/textdocumentscopes.h \ + $$PWD/edbee/models/texteditorcommandmap.h \ + $$PWD/edbee/models/texteditorconfig.h \ + $$PWD/edbee/models/texteditorkeymap.h \ + $$PWD/edbee/models/textgrammar.h \ + $$PWD/edbee/models/textlexer.h \ + $$PWD/edbee/models/textlinedata.h \ + $$PWD/edbee/models/textrange.h \ + $$PWD/edbee/models/textsearcher.h \ + $$PWD/edbee/models/textundostack.h \ + $$PWD/edbee/texteditorcommand.h \ + $$PWD/edbee/texteditorcontroller.h \ + $$PWD/edbee/texteditorwidget.h \ + $$PWD/edbee/util/cascadingqvariantmap.h \ + $$PWD/edbee/util/lineending.h \ + $$PWD/edbee/util/lineoffsetvector.h \ + $$PWD/edbee/util/logging.h \ + $$PWD/edbee/util/mem/debug_allocs.h \ + $$PWD/edbee/util/mem/debug_new.h \ + $$PWD/edbee/util/rangelineiterator.h \ + $$PWD/edbee/util/rangesetlineiterator.h \ + $$PWD/edbee/util/regexp.h \ + $$PWD/edbee/util/simpleprofiler.h \ + $$PWD/edbee/util/test.h \ + $$PWD/edbee/util/textcodec.h \ + $$PWD/edbee/util/textcodecdetector.h \ + $$PWD/edbee/util/util.h \ + $$PWD/edbee/views/components/texteditorautocompletecomponent.h \ + $$PWD/edbee/views/components/texteditorcomponent.h \ + $$PWD/edbee/views/components/texteditorrenderer.h \ + $$PWD/edbee/views/components/textmargincomponent.h \ + $$PWD/edbee/views/textcaretcache.h \ + $$PWD/edbee/views/texteditorscrollarea.h \ + $$PWD/edbee/views/textrenderer.h \ + $$PWD/edbee/views/textselection.h \ + $$PWD/edbee/views/texttheme.h ## Extra dependencies ##==================== diff --git a/edbee-lib/edbee/commands/commentcommand.h b/edbee-lib/edbee/commands/commentcommand.h index 3ac246f..e042e57 100644 --- a/edbee-lib/edbee/commands/commentcommand.h +++ b/edbee-lib/edbee/commands/commentcommand.h @@ -5,6 +5,8 @@ #pragma once +#include "edbee/exports.h" + #include #include "edbee/texteditorcommand.h" @@ -16,7 +18,7 @@ class TextEditorController; /// This command is used for commenting / decommenting a line /// We cannot implement this truely at the moment, we first need support for making /// scope-based 'environment-variables' so we can creating something like TM_COMMENT_START -class CommentCommand : public TextEditorCommand +class EDBEE_EXPORT CommentCommand : public TextEditorCommand { public: CommentCommand( bool block ); diff --git a/edbee-lib/edbee/commands/copycommand.h b/edbee-lib/edbee/commands/copycommand.h index ad5d806..3830ab1 100644 --- a/edbee-lib/edbee/commands/copycommand.h +++ b/edbee-lib/edbee/commands/copycommand.h @@ -5,6 +5,8 @@ #pragma once +#include "edbee/exports.h" + #include #include "edbee/texteditorcommand.h" @@ -15,7 +17,7 @@ class TextEditorController; /// This command is used for copying data to the clipboard -class CopyCommand : public TextEditorCommand +class EDBEE_EXPORT CopyCommand : public TextEditorCommand { public: static const QString EDBEE_TEXT_TYPE; diff --git a/edbee-lib/edbee/commands/cutcommand.h b/edbee-lib/edbee/commands/cutcommand.h index db125a3..f38215f 100644 --- a/edbee-lib/edbee/commands/cutcommand.h +++ b/edbee-lib/edbee/commands/cutcommand.h @@ -5,6 +5,8 @@ #pragma once +#include "edbee/exports.h" + #include "edbee/texteditorcommand.h" namespace edbee { @@ -16,7 +18,7 @@ class TextEditorController; /// and places onto the clipboard. /// /// When pressing cut without selection, the full line is cut -class CutCommand : public TextEditorCommand +class EDBEE_EXPORT CutCommand : public TextEditorCommand { public: virtual void execute( TextEditorController* controller ); diff --git a/edbee-lib/edbee/commands/debugcommand.h b/edbee-lib/edbee/commands/debugcommand.h index 665f32b..26d98e2 100644 --- a/edbee-lib/edbee/commands/debugcommand.h +++ b/edbee-lib/edbee/commands/debugcommand.h @@ -5,13 +5,15 @@ #pragma once +#include "edbee/exports.h" + #include "edbee/texteditorcommand.h" namespace edbee { /// A debug command, for simply suppling/dumping some editor state information to the console -class DebugCommand : public TextEditorCommand +class EDBEE_EXPORT DebugCommand : public TextEditorCommand { public: diff --git a/edbee-lib/edbee/commands/duplicatecommand.h b/edbee-lib/edbee/commands/duplicatecommand.h index eeb6d66..0c9323d 100644 --- a/edbee-lib/edbee/commands/duplicatecommand.h +++ b/edbee-lib/edbee/commands/duplicatecommand.h @@ -5,6 +5,8 @@ #pragma once +#include "edbee/exports.h" + #include "edbee/texteditorcommand.h" @@ -13,7 +15,7 @@ namespace edbee { /// The Duplicate command. /// Duplicates the selected line or text /// -class DuplicateCommand : public TextEditorCommand +class EDBEE_EXPORT DuplicateCommand : public TextEditorCommand { public: virtual void execute( TextEditorController* controller ); diff --git a/edbee-lib/edbee/commands/findcommand.h b/edbee-lib/edbee/commands/findcommand.h index 7973e9e..3ebe16e 100644 --- a/edbee-lib/edbee/commands/findcommand.h +++ b/edbee-lib/edbee/commands/findcommand.h @@ -5,11 +5,13 @@ #pragma once +#include "edbee/exports.h" + #include "edbee/texteditorcommand.h" namespace edbee { -class FindCommand : public TextEditorCommand +class EDBEE_EXPORT FindCommand : public TextEditorCommand { public: diff --git a/edbee-lib/edbee/commands/movelinecommand.h b/edbee-lib/edbee/commands/movelinecommand.h index d7ba423..ed920d4 100644 --- a/edbee-lib/edbee/commands/movelinecommand.h +++ b/edbee-lib/edbee/commands/movelinecommand.h @@ -1,11 +1,13 @@ #pragma once +#include "edbee/exports.h" + #include "edbee/texteditorcommand.h" namespace edbee { /// moves -class MoveLineCommand : public TextEditorCommand +class EDBEE_EXPORT MoveLineCommand : public TextEditorCommand { public: MoveLineCommand( int direction ); diff --git a/edbee-lib/edbee/commands/newlinecommand.h b/edbee-lib/edbee/commands/newlinecommand.h index 5c9f465..f6cef0f 100644 --- a/edbee-lib/edbee/commands/newlinecommand.h +++ b/edbee-lib/edbee/commands/newlinecommand.h @@ -5,6 +5,8 @@ #pragma once +#include "edbee/exports.h" + #include "edbee/texteditorcommand.h" @@ -15,7 +17,7 @@ class TextRange; /// Inserts a newline. /// When smarttab is enabled it also inser leading tabs/spaces -class NewlineCommand : public TextEditorCommand +class EDBEE_EXPORT NewlineCommand : public TextEditorCommand { public: enum NewLineType { diff --git a/edbee-lib/edbee/commands/pastecommand.h b/edbee-lib/edbee/commands/pastecommand.h index 90d2f82..7edd904 100644 --- a/edbee-lib/edbee/commands/pastecommand.h +++ b/edbee-lib/edbee/commands/pastecommand.h @@ -5,6 +5,8 @@ #pragma once +#include "edbee/exports.h" + #include "edbee/texteditorcommand.h" namespace edbee { @@ -16,7 +18,7 @@ class TextEditorController; /// There are two special cases: /// - there's a line cutting/pasing mode to copy complete lines /// - when the number of carets is equal to the number of lines, every line is pasted at a caret -class PasteCommand : public TextEditorCommand +class EDBEE_EXPORT PasteCommand : public TextEditorCommand { public: PasteCommand(); diff --git a/edbee-lib/edbee/commands/redocommand.h b/edbee-lib/edbee/commands/redocommand.h index 2509e1f..1bf533b 100644 --- a/edbee-lib/edbee/commands/redocommand.h +++ b/edbee-lib/edbee/commands/redocommand.h @@ -5,12 +5,14 @@ #pragma once +#include "edbee/exports.h" + #include #include "edbee/texteditorcommand.h" namespace edbee { -class RedoCommand : public TextEditorCommand +class EDBEE_EXPORT RedoCommand : public TextEditorCommand { public: RedoCommand(bool soft=false); diff --git a/edbee-lib/edbee/commands/removecommand.h b/edbee-lib/edbee/commands/removecommand.h index 09808a3..acc72a7 100644 --- a/edbee-lib/edbee/commands/removecommand.h +++ b/edbee-lib/edbee/commands/removecommand.h @@ -5,6 +5,8 @@ #pragma once +#include "edbee/exports.h" + #include "edbee/texteditorcommand.h" namespace edbee { @@ -24,7 +26,7 @@ class TextRangeSet; /// When spaces are used for tabs the behaviour is different. If the caret is left of /// the first non-space character, it will move 1 column to the left, depending on the tabsize /// -class RemoveCommand : public TextEditorCommand +class EDBEE_EXPORT RemoveCommand : public TextEditorCommand { public: enum RemoveMode { diff --git a/edbee-lib/edbee/commands/replaceselectioncommand.h b/edbee-lib/edbee/commands/replaceselectioncommand.h index 889a9bc..bfedd3d 100644 --- a/edbee-lib/edbee/commands/replaceselectioncommand.h +++ b/edbee-lib/edbee/commands/replaceselectioncommand.h @@ -5,12 +5,14 @@ #pragma once +#include "edbee/exports.h" + #include "edbee/texteditorcommand.h" namespace edbee { /// This command can be used to replace the current selection with a given text -class ReplaceSelectionCommand : public TextEditorCommand +class EDBEE_EXPORT ReplaceSelectionCommand : public TextEditorCommand { public: ReplaceSelectionCommand( const QString& text, int caolesceId ); diff --git a/edbee-lib/edbee/commands/selectioncommand.h b/edbee-lib/edbee/commands/selectioncommand.h index c8ee77b..d356a63 100644 --- a/edbee-lib/edbee/commands/selectioncommand.h +++ b/edbee-lib/edbee/commands/selectioncommand.h @@ -5,13 +5,15 @@ #pragma once +#include "edbee/exports.h" + #include "edbee/texteditorcommand.h" namespace edbee { /// The selection command is used to move the caret and anchors to /// make selections and move the carets around -class SelectionCommand : public TextEditorCommand +class EDBEE_EXPORT SelectionCommand : public TextEditorCommand { public: enum SelectionType { diff --git a/edbee-lib/edbee/commands/tabcommand.h b/edbee-lib/edbee/commands/tabcommand.h index 77d60c6..1e8b700 100644 --- a/edbee-lib/edbee/commands/tabcommand.h +++ b/edbee-lib/edbee/commands/tabcommand.h @@ -5,12 +5,14 @@ #pragma once +#include "edbee/exports.h" + #include "edbee/texteditorcommand.h" namespace edbee { /// For inserting/executing forward and backwards tabs -class TabCommand : public TextEditorCommand +class EDBEE_EXPORT TabCommand : public TextEditorCommand { public: /// The possible directions of the tab command diff --git a/edbee-lib/edbee/commands/undocommand.h b/edbee-lib/edbee/commands/undocommand.h index 5892f8a..d3726d3 100644 --- a/edbee-lib/edbee/commands/undocommand.h +++ b/edbee-lib/edbee/commands/undocommand.h @@ -5,12 +5,14 @@ #pragma once +#include "edbee/exports.h" + #include #include "edbee/texteditorcommand.h" namespace edbee { -class UndoCommand : public TextEditorCommand +class EDBEE_EXPORT UndoCommand : public TextEditorCommand { public: UndoCommand( bool soft= false ); diff --git a/edbee-lib/edbee/data/factorycommandmap.h b/edbee-lib/edbee/data/factorycommandmap.h index 4f0d512..95776f0 100644 --- a/edbee-lib/edbee/data/factorycommandmap.h +++ b/edbee-lib/edbee/data/factorycommandmap.h @@ -5,14 +5,15 @@ #pragma once +#include "edbee/exports.h" + namespace edbee { class TextEditorCommandMap; /// This class contains the factory edbee command map -class FactoryCommandMap -{ +class EDBEE_EXPORT FactoryCommandMap { public: void fill(TextEditorCommandMap* cm ); }; diff --git a/edbee-lib/edbee/data/factorykeymap.h b/edbee-lib/edbee/data/factorykeymap.h index 9b5f9f4..0d2a1ce 100644 --- a/edbee-lib/edbee/data/factorykeymap.h +++ b/edbee-lib/edbee/data/factorykeymap.h @@ -5,6 +5,8 @@ #pragma once +#include "edbee/exports.h" + namespace edbee { class TextEditorKeyMap; @@ -12,8 +14,7 @@ class TextEditorKeyMap; /** * This class can fill the texteditor keymap with the factory defaults */ -class FactoryKeyMap -{ +class EDBEE_EXPORT FactoryKeyMap { public: void fill(TextEditorKeyMap* km ); }; diff --git a/edbee-lib/edbee/edbee.h b/edbee-lib/edbee/edbee.h index f3a2ed7..ad94555 100644 --- a/edbee-lib/edbee/edbee.h +++ b/edbee-lib/edbee/edbee.h @@ -5,6 +5,8 @@ #pragma once +#include "edbee/exports.h" + #include namespace edbee { @@ -22,7 +24,7 @@ class TextThemeManager; /// The texteditor manager, /// It manages all singleton objects for the editor /// It performs the initialization and shutdown code for all editors -class Edbee : public QObject +class EDBEE_EXPORT Edbee : public QObject { Q_OBJECT private: diff --git a/edbee-lib/edbee/exports.h b/edbee-lib/edbee/exports.h new file mode 100644 index 0000000..0524434 --- /dev/null +++ b/edbee-lib/edbee/exports.h @@ -0,0 +1,13 @@ +#pragma once + +#include + +#ifdef EDBEE_SHARED + #ifdef EDBEE_EXPORT_SYMBOLS + # define EDBEE_EXPORT Q_DECL_EXPORT + #else + # define EDBEE_EXPORT Q_DECL_IMPORT + #endif +#else + # define EDBEE_EXPORT +#endif diff --git a/edbee-lib/edbee/io/baseplistparser.h b/edbee-lib/edbee/io/baseplistparser.h index 9c0d5e0..7599fc0 100644 --- a/edbee-lib/edbee/io/baseplistparser.h +++ b/edbee-lib/edbee/io/baseplistparser.h @@ -5,6 +5,8 @@ #pragma once +#include "edbee/exports.h" + #include #include #include @@ -16,8 +18,7 @@ class QXmlStreamReader; namespace edbee { /// A general plist xml-file parser -class BasePListParser -{ +class EDBEE_EXPORT BasePListParser { public: BasePListParser(); virtual ~BasePListParser(); diff --git a/edbee-lib/edbee/io/jsonparser.h b/edbee-lib/edbee/io/jsonparser.h index c07cef7..1a74558 100644 --- a/edbee-lib/edbee/io/jsonparser.h +++ b/edbee-lib/edbee/io/jsonparser.h @@ -5,6 +5,8 @@ #pragma once +#include "edbee/exports.h" + #include class QIODevice; @@ -14,8 +16,7 @@ namespace edbee { /// A Json Parser that supports strings in json sources! /// standard json doesn't support comments. This class strips the comments before passing it to qt /// the comments are replaced by spaces, this way the line-numbers and column numbers will stay the same -class JsonParser -{ +class EDBEE_EXPORT JsonParser { public: JsonParser(); virtual ~JsonParser(); diff --git a/edbee-lib/edbee/io/keymapparser.h b/edbee-lib/edbee/io/keymapparser.h index bc51126..5342c8a 100644 --- a/edbee-lib/edbee/io/keymapparser.h +++ b/edbee-lib/edbee/io/keymapparser.h @@ -3,6 +3,10 @@ * Author Rick Blommers */ +#pragma once + +#include "edbee/exports.h" + #include #include #include @@ -41,8 +45,7 @@ class TextEditorKeyMap; /// Context is still not completely thought over but it is used to make certain keybindings /// context specific. Think for example of keybindings only used for given language /// -class KeyMapParser -{ +class EDBEE_EXPORT KeyMapParser { public: KeyMapParser(); virtual ~KeyMapParser(); diff --git a/edbee-lib/edbee/io/textdocumentserializer.h b/edbee-lib/edbee/io/textdocumentserializer.h index 33d998c..5189d22 100644 --- a/edbee-lib/edbee/io/textdocumentserializer.h +++ b/edbee-lib/edbee/io/textdocumentserializer.h @@ -5,6 +5,8 @@ #pragma once +#include "edbee/exports.h" + #include class QIODevice; @@ -14,8 +16,7 @@ namespace edbee { class TextDocument; class TextDocumentSerializer; -class TextDocumentSerializerFilter -{ +class EDBEE_EXPORT TextDocumentSerializerFilter { public: /// A special filter class to filter lines while saving /// @param serializer the text serialzer @@ -27,8 +28,7 @@ class TextDocumentSerializerFilter /// A class used to load/save a text-file from and to an IODevice -class TextDocumentSerializer -{ +class EDBEE_EXPORT TextDocumentSerializer { public: TextDocumentSerializer( TextDocument* textDocument ); diff --git a/edbee-lib/edbee/io/tmlanguageparser.h b/edbee-lib/edbee/io/tmlanguageparser.h index def4289..d118ddd 100644 --- a/edbee-lib/edbee/io/tmlanguageparser.h +++ b/edbee-lib/edbee/io/tmlanguageparser.h @@ -5,6 +5,8 @@ #pragma once +#include "edbee/exports.h" + #include #include #include @@ -23,7 +25,7 @@ class TextGrammarManager; class TextGrammarRule; /// For parsing a Textmate Language -class TmLanguageParser : public BasePListParser +class EDBEE_EXPORT TmLanguageParser : public BasePListParser { public: TmLanguageParser(); diff --git a/edbee-lib/edbee/io/tmthemeparser.h b/edbee-lib/edbee/io/tmthemeparser.h index 12d4331..b068d54 100644 --- a/edbee-lib/edbee/io/tmthemeparser.h +++ b/edbee-lib/edbee/io/tmthemeparser.h @@ -5,6 +5,8 @@ #pragma once +#include "edbee/exports.h" + #include #include #include @@ -15,7 +17,7 @@ namespace edbee { class TextTheme; -class TmThemeParser : public BasePListParser +class EDBEE_EXPORT TmThemeParser : public BasePListParser { public: TmThemeParser(); diff --git a/edbee-lib/edbee/lexers/grammartextlexer.h b/edbee-lib/edbee/lexers/grammartextlexer.h index c2c937b..1adfaa5 100644 --- a/edbee-lib/edbee/lexers/grammartextlexer.h +++ b/edbee-lib/edbee/lexers/grammartextlexer.h @@ -5,6 +5,8 @@ #pragma once +#include "edbee/exports.h" + #include #include #include @@ -23,7 +25,7 @@ class TextGrammar; class TextGrammarRule; /// A simple lexer matches texts with simple regular expressions -class GrammarTextLexer : public TextLexer +class EDBEE_EXPORT GrammarTextLexer : public TextLexer { public: GrammarTextLexer( TextDocumentScopes* scopes ); diff --git a/edbee-lib/edbee/models/change.h b/edbee-lib/edbee/models/change.h index 8853c18..ca98a38 100644 --- a/edbee-lib/edbee/models/change.h +++ b/edbee-lib/edbee/models/change.h @@ -5,6 +5,8 @@ #pragma once +#include "edbee/exports.h" + #include #include @@ -15,8 +17,7 @@ class TextEditorController; /// A basic change -class Change -{ +class EDBEE_EXPORT Change { public: virtual ~Change(); @@ -41,7 +42,7 @@ class Change /// A textdocument change -class DocumentChange : public Change +class EDBEE_EXPORT DocumentChange : public Change { public: }; @@ -51,7 +52,7 @@ class DocumentChange : public Change /// a document text-change that doesn't do anyhting :-) -class EmptyDocumentChange : public Change +class EDBEE_EXPORT EmptyDocumentChange : public Change { public: virtual bool isPersistenceRequired(); @@ -65,7 +66,7 @@ class EmptyDocumentChange : public Change /// A textcontroller command. This can ALSO be a document command -class ControllerChange : public Change +class EDBEE_EXPORT ControllerChange : public Change { public: ControllerChange( TextEditorController* controller ); @@ -81,7 +82,7 @@ class ControllerChange : public Change /// An undoable-command-group -class ChangeGroup : public ControllerChange +class EDBEE_EXPORT ChangeGroup : public ControllerChange { public: ChangeGroup( TextEditorController* controller ); diff --git a/edbee-lib/edbee/models/changes/abstractrangedchange.h b/edbee-lib/edbee/models/changes/abstractrangedchange.h index bb35ce8..62e3e9e 100644 --- a/edbee-lib/edbee/models/changes/abstractrangedchange.h +++ b/edbee-lib/edbee/models/changes/abstractrangedchange.h @@ -5,6 +5,8 @@ #pragma once +#include "edbee/exports.h" + #include "edbee/models/change.h" namespace edbee { @@ -12,7 +14,7 @@ namespace edbee { /// This is an abstract class for ranged changes /// This are changes (text changes and line changes) that span a range in an array. /// These ranges share a common alogrithm for performing merges, detecting overlaps etc. -class AbstractRangedChange : public Change +class EDBEE_EXPORT AbstractRangedChange : public Change { public: virtual ~AbstractRangedChange(); diff --git a/edbee-lib/edbee/models/changes/linedatachange.h b/edbee-lib/edbee/models/changes/linedatachange.h index 06e33ee..8df3a8a 100644 --- a/edbee-lib/edbee/models/changes/linedatachange.h +++ b/edbee-lib/edbee/models/changes/linedatachange.h @@ -5,6 +5,8 @@ #pragma once +#include "edbee/exports.h" + #include "edbee/models/change.h" namespace edbee { @@ -13,7 +15,7 @@ class TextDocument; class TextLineData; /// a class to handle line-data textchanges -class LineDataChange : public Change +class EDBEE_EXPORT LineDataChange : public Change { public: LineDataChange(int line, int field); diff --git a/edbee-lib/edbee/models/changes/linedatalistchange.h b/edbee-lib/edbee/models/changes/linedatalistchange.h index 8a6f0b2..c0ee275 100644 --- a/edbee-lib/edbee/models/changes/linedatalistchange.h +++ b/edbee-lib/edbee/models/changes/linedatalistchange.h @@ -5,6 +5,8 @@ #pragma once +#include "edbee/exports.h" + #include #include "edbee/models/changes/abstractrangedchange.h" @@ -16,7 +18,7 @@ class TextLineDataList; /// A full line data text change. This means the growing or shrinking of the line data buffer /// It stores the old-data list that needs to be remebered for undoing -class LineDataListChange : public AbstractRangedChange +class EDBEE_EXPORT LineDataListChange : public AbstractRangedChange { public: LineDataListChange( TextLineDataManager* manager, int offset , int lenght, int newLength ); diff --git a/edbee-lib/edbee/models/changes/mergablechangegroup.h b/edbee-lib/edbee/models/changes/mergablechangegroup.h index 6ebd7eb..8b116f8 100644 --- a/edbee-lib/edbee/models/changes/mergablechangegroup.h +++ b/edbee-lib/edbee/models/changes/mergablechangegroup.h @@ -5,6 +5,8 @@ #pragma once +#include "edbee/exports.h" + #include "edbee/models/change.h" namespace edbee { @@ -20,7 +22,7 @@ class TextRangeSet; /// This is a complete rewrite of the earlier implementation. This implemenation /// simply adds all changes to a group. It tries to compress the changes that are compressable /// This group has 1 previous selection and 1 next selection. All selection changes are 'removed' and only the last and first state is stored. -class MergableChangeGroup : public ChangeGroup +class EDBEE_EXPORT MergableChangeGroup : public ChangeGroup { public: MergableChangeGroup( TextEditorController* controller ); diff --git a/edbee-lib/edbee/models/changes/selectionchange.h b/edbee-lib/edbee/models/changes/selectionchange.h index a7f418e..bf315cd 100644 --- a/edbee-lib/edbee/models/changes/selectionchange.h +++ b/edbee-lib/edbee/models/changes/selectionchange.h @@ -5,6 +5,8 @@ #pragma once +#include "edbee/exports.h" + #include "edbee/models/change.h" namespace edbee { @@ -14,7 +16,7 @@ class TextEditorController; class TextRangeSet; /// Move the caret / and selection commands -class SelectionChange: public ControllerChange +class EDBEE_EXPORT SelectionChange : public ControllerChange { public: diff --git a/edbee-lib/edbee/models/changes/textchange.h b/edbee-lib/edbee/models/changes/textchange.h index 4254613..1ce300b 100644 --- a/edbee-lib/edbee/models/changes/textchange.h +++ b/edbee-lib/edbee/models/changes/textchange.h @@ -5,6 +5,8 @@ #pragma once +#include "edbee/exports.h" + #include #include "edbee/models/changes/abstractrangedchange.h" @@ -15,7 +17,7 @@ namespace edbee { /// /// This class re-uses the variables offset/length and text. Depending on the undo/redo state /// these variables contain the new data or the changed data -class TextChange : public AbstractRangedChange +class EDBEE_EXPORT TextChange : public AbstractRangedChange { public: TextChange(int offset, int length, const QString& text ); diff --git a/edbee-lib/edbee/models/changes/textchangewithcaret.h b/edbee-lib/edbee/models/changes/textchangewithcaret.h index 781547d..f590db2 100644 --- a/edbee-lib/edbee/models/changes/textchangewithcaret.h +++ b/edbee-lib/edbee/models/changes/textchangewithcaret.h @@ -5,6 +5,8 @@ #pragma once +#include "edbee/exports.h" + #include "textchange.h" namespace edbee { @@ -12,7 +14,7 @@ namespace edbee { /// A single text-change with an extra offset which represents the location of the caret. /// Currently this class is passed a TextDocumentFilter which enables it to alter the caret position /// I'm in doubt if we really need to implement it this way. -class TextChangeWithCaret : public TextChange +class EDBEE_EXPORT TextChangeWithCaret : public TextChange { public: TextChangeWithCaret( int offset, int length, const QString& text, int caret ); diff --git a/edbee-lib/edbee/models/chardocument/chartextbuffer.h b/edbee-lib/edbee/models/chardocument/chartextbuffer.h index 12530de..902f6aa 100644 --- a/edbee-lib/edbee/models/chardocument/chartextbuffer.h +++ b/edbee-lib/edbee/models/chardocument/chartextbuffer.h @@ -5,6 +5,8 @@ #pragma once +#include "edbee/exports.h" + #include "edbee/models/textbuffer.h" #include "edbee/util/gapvector.h" #include "edbee/util/lineoffsetvector.h" @@ -13,7 +15,7 @@ namespace edbee { /// This textbuffer implementation uses QChars for storing the data. -class CharTextBuffer : public TextBuffer +class EDBEE_EXPORT CharTextBuffer : public TextBuffer { public: CharTextBuffer( QObject* parent=0); diff --git a/edbee-lib/edbee/models/chardocument/chartextdocument.h b/edbee-lib/edbee/models/chardocument/chartextdocument.h index dcbae8e..aa3e227 100644 --- a/edbee-lib/edbee/models/chardocument/chartextdocument.h +++ b/edbee-lib/edbee/models/chardocument/chartextdocument.h @@ -5,6 +5,8 @@ #pragma once +#include "edbee/exports.h" + #include #include @@ -21,7 +23,7 @@ class TextLineDataManager; class TextBufferChange; /// A plain textdocument. A document with simple character-buffer implementation -class CharTextDocument : public TextDocument +class EDBEE_EXPORT CharTextDocument : public TextDocument { Q_OBJECT diff --git a/edbee-lib/edbee/models/dynamicvariables.h b/edbee-lib/edbee/models/dynamicvariables.h index f91e14f..dd981da 100644 --- a/edbee-lib/edbee/models/dynamicvariables.h +++ b/edbee-lib/edbee/models/dynamicvariables.h @@ -5,6 +5,8 @@ #pragma once +#include "edbee/exports.h" + #include #include #include @@ -16,8 +18,7 @@ class TextScopeList; class TextScopeSelector; /// The abstract base class for a dynamic variable -class DynamicVariable -{ +class EDBEE_EXPORT DynamicVariable { public: virtual ~DynamicVariable(); virtual QVariant value() const = 0; @@ -28,7 +29,7 @@ class DynamicVariable /// A static dynamic variable :P -class BasicDynamicVariable : public DynamicVariable +class EDBEE_EXPORT BasicDynamicVariable : public DynamicVariable { public: BasicDynamicVariable( const QVariant& value ); @@ -43,7 +44,7 @@ class BasicDynamicVariable : public DynamicVariable /// A class that specifies a dynamic variabele with a scope selector -class ScopedDynamicVariable : public BasicDynamicVariable +class EDBEE_EXPORT ScopedDynamicVariable : public BasicDynamicVariable { public: ScopedDynamicVariable( const QVariant& value, TextScopeSelector* selector = 0 ); @@ -62,8 +63,7 @@ class ScopedDynamicVariable : public BasicDynamicVariable /// This class is used for remembering/managing dynamic variables /// This are a kind of environment variables that are dependent on the given context -class DynamicVariables -{ +class EDBEE_EXPORT DynamicVariables { public: DynamicVariables(); virtual ~DynamicVariables(); diff --git a/edbee-lib/edbee/models/textautocompleteprovider.h b/edbee-lib/edbee/models/textautocompleteprovider.h index d386a23..a50bebf 100644 --- a/edbee-lib/edbee/models/textautocompleteprovider.h +++ b/edbee-lib/edbee/models/textautocompleteprovider.h @@ -1,5 +1,7 @@ #pragma once +#include "edbee/exports.h" + #include #include @@ -11,8 +13,7 @@ class TextRange; /// An autocomplete item that's being returned /// Currently simply a string. /// It's placed in a seperate class for future extentions (LSP: https://github.com/Microsoft/language-server-protocol/blob/master/protocol.md#textDocument_completion) -class TextAutoCompleteItem -{ +class EDBEE_EXPORT TextAutoCompleteItem { public: TextAutoCompleteItem( const QString& label ); QString label() const; @@ -25,8 +26,7 @@ class TextAutoCompleteItem /// A base autocomplete provider -class TextAutoCompleteProvider -{ +class EDBEE_EXPORT TextAutoCompleteProvider { public: virtual ~TextAutoCompleteProvider() {} virtual QList findAutoCompleteItemsForRange( TextDocument* document, const TextRange& range, const QString& word ) = 0; @@ -34,7 +34,7 @@ class TextAutoCompleteProvider /// a fixed stringlist autocompleter -class StringTextAutoCompleteProvider : public TextAutoCompleteProvider +class EDBEE_EXPORT StringTextAutoCompleteProvider : public TextAutoCompleteProvider { public: virtual ~StringTextAutoCompleteProvider(); @@ -65,7 +65,7 @@ class StringTextAutoCompleteProvider : public TextAutoCompleteProvider /// -> Scope Autocompleter /// -> .. add custom global providers .. /// -class TextAutoCompleteProviderList : public TextAutoCompleteProvider +class EDBEE_EXPORT TextAutoCompleteProviderList : public TextAutoCompleteProvider { public: TextAutoCompleteProviderList( TextAutoCompleteProvider* parentProvider=0); @@ -84,7 +84,7 @@ class TextAutoCompleteProviderList : public TextAutoCompleteProvider /* /// a grammar based autocomplete list -class ScopeBasedTextAutoCompleteProvider : public TextAutoCompleteProvider +class EDBEE_EXPORT ScopeBasedTextAutoCompleteProvider : public TextAutoCompleteProvider { public: virtual QList findAutoCompleteItemsForRange( TextDocument* document, TextRange& range ); @@ -95,7 +95,7 @@ class ScopeBasedTextAutoCompleteProvider : public TextAutoCompleteProvider /// a texteditor widget specific provider -class TextEditorSpecificTextAutoCompleteProvider : public TextAutoCompleteProvider +class EDBEE_EXPORT TextEditorSpecificTextAutoCompleteProvider : public TextAutoCompleteProvider { public: virtual QList findAutoCompleteItemsForRange( TextDocument* document, TextRange& range ); @@ -106,8 +106,7 @@ class TextEditorSpecificTextAutoCompleteProvider : public TextAutoCompleteProvid /// This class is used to manage the automcomplete provider -class TextAutoCompleteManager -{ +class EDBEE_EXPORT TextAutoCompleteManager { public: TextAutoCompleteManager(); virtual ~TextAutoCompleteProvider(); diff --git a/edbee-lib/edbee/models/textbuffer.h b/edbee-lib/edbee/models/textbuffer.h index 2792fb8..ac85049 100644 --- a/edbee-lib/edbee/models/textbuffer.h +++ b/edbee-lib/edbee/models/textbuffer.h @@ -5,6 +5,8 @@ #pragma once +#include "edbee/exports.h" + #include #include #include @@ -19,7 +21,7 @@ class TextLineData; class LineOffsetVector; -class TextBufferChangeData : public QSharedData +class EDBEE_EXPORT TextBufferChangeData : public QSharedData { public: TextBufferChangeData( TextBuffer* buffer, int off, int len, const QChar* text, int textlen ); @@ -42,8 +44,7 @@ class TextBufferChangeData : public QSharedData /// This clas represents a text buffer change and is used to pass around between events /// This is a shareddata object so the data can be thrown between different threads (delayed emit-support)_ /// TODO: Still problematic maybe the QChar* text pointer. It is possible that this pointer is being freed. -class TextBufferChange -{ +class EDBEE_EXPORT TextBufferChange { public: TextBufferChange(); TextBufferChange( TextBuffer* buffer, int off, int len, const QChar* text, int textlen ); @@ -65,7 +66,7 @@ class TextBufferChange }; /// This class represents the textbuffer of the editor -class TextBuffer : public QObject +class EDBEE_EXPORT TextBuffer : public QObject { Q_OBJECT diff --git a/edbee-lib/edbee/models/textdocument.h b/edbee-lib/edbee/models/textdocument.h index ef46c76..de7a60e 100644 --- a/edbee-lib/edbee/models/textdocument.h +++ b/edbee-lib/edbee/models/textdocument.h @@ -5,6 +5,8 @@ #pragma once +#include "edbee/exports.h" + #include #include @@ -38,7 +40,7 @@ class TextUndoStack; /// - the textdocument scopes, these are the language-dependent scopes found in the current document /// - A textlexer, which is used for (re-)building the textdocument scopes. /// -class TextDocument : public QObject +class EDBEE_EXPORT TextDocument : public QObject { Q_OBJECT diff --git a/edbee-lib/edbee/models/textdocumentfilter.h b/edbee-lib/edbee/models/textdocumentfilter.h index c0590c0..e40dbd7 100644 --- a/edbee-lib/edbee/models/textdocumentfilter.h +++ b/edbee-lib/edbee/models/textdocumentfilter.h @@ -5,6 +5,8 @@ #pragma once +#include "edbee/exports.h" + class QString; class QStringList; @@ -17,8 +19,7 @@ class TextDocument; class TextRangeSet; -class TextDocumentFilter -{ +class EDBEE_EXPORT TextDocumentFilter { public: virtual ~TextDocumentFilter(); diff --git a/edbee-lib/edbee/models/textdocumentscopes.h b/edbee-lib/edbee/models/textdocumentscopes.h index 5b3b837..ca1ef28 100644 --- a/edbee-lib/edbee/models/textdocumentscopes.h +++ b/edbee-lib/edbee/models/textdocumentscopes.h @@ -5,6 +5,8 @@ #pragma once +#include "edbee/exports.h" + #include #include #include @@ -33,8 +35,7 @@ typedef short TextScopeAtomId; /// This class defines a full text-scope. A full textscope is textscope /// with one ore more scoped-elements -class TextScope -{ +class EDBEE_EXPORT TextScope { public: const QString name(); int atomCount(); @@ -58,7 +59,7 @@ class TextScope /// A list of text-scopes. /// on a certian location, usually more then one scope is available on a given location -class TextScopeList : public QVector +class EDBEE_EXPORT TextScopeList : public QVector { public: TextScopeList(); @@ -110,8 +111,7 @@ class TextScopeList : public QVector /// composite: «expression» ([|&-] «expression»)* /// selector: «composite» (',' «composite»)* /// -class TextScopeSelector -{ +class EDBEE_EXPORT TextScopeSelector { public: TextScopeSelector( const QString& selector ); virtual ~TextScopeSelector(); @@ -138,8 +138,7 @@ class TextScopeSelector /// These text are converted to a list of numbers /// 12.3.24 /// -class TextScopeManager -{ +class EDBEE_EXPORT TextScopeManager { public: TextScopeManager(); virtual ~TextScopeManager(); @@ -175,7 +174,7 @@ class TextScopeManager /// A base scoped text range -class ScopedTextRange : public TextRange +class EDBEE_EXPORT ScopedTextRange : public TextRange { public: ScopedTextRange( int anchor, int caret, TextScope* scope ); @@ -200,7 +199,7 @@ class ScopedTextRange : public TextRange /// A line based ScopedText range, that referenes a multi-line text-reference -class MultiLineScopedTextRangeReference : public ScopedTextRange +class EDBEE_EXPORT MultiLineScopedTextRangeReference : public ScopedTextRange { public: MultiLineScopedTextRangeReference( MultiLineScopedTextRange& range ); @@ -220,8 +219,7 @@ class MultiLineScopedTextRangeReference : public ScopedTextRange /// a list of textscopes /// This class is used for single-line scopes /// (Todo, this needs to be optimized) -class ScopedTextRangeList -{ +class EDBEE_EXPORT ScopedTextRangeList { Q_DISABLE_COPY(ScopedTextRangeList) public: @@ -254,7 +252,7 @@ class ScopedTextRangeList /// This class 'defines' a single document scope -class MultiLineScopedTextRange : public ScopedTextRange +class EDBEE_EXPORT MultiLineScopedTextRange : public ScopedTextRange { public: MultiLineScopedTextRange(int anchor, int caret, TextScope* scope); @@ -279,7 +277,7 @@ class MultiLineScopedTextRange : public ScopedTextRange /// This is a set of scoped textranges. This set is used /// to remember parsed language ranges -class MultiLineScopedTextRangeSet : public TextRangeSetBase +class EDBEE_EXPORT MultiLineScopedTextRangeSet : public TextRangeSetBase { public: MultiLineScopedTextRangeSet( TextDocument* textDocument, TextDocumentScopes* textDocumentScopes ); @@ -322,7 +320,7 @@ class MultiLineScopedTextRangeSet : public TextRangeSetBase /// This class is used to 'contain' all document scope information -class TextDocumentScopes : public QObject +class EDBEE_EXPORT TextDocumentScopes : public QObject { Q_OBJECT diff --git a/edbee-lib/edbee/models/texteditorcommandmap.h b/edbee-lib/edbee/models/texteditorcommandmap.h index caa1910..6e3b5b6 100644 --- a/edbee-lib/edbee/models/texteditorcommandmap.h +++ b/edbee-lib/edbee/models/texteditorcommandmap.h @@ -5,6 +5,8 @@ #pragma once +#include "edbee/exports.h" + #include #include #include @@ -16,7 +18,7 @@ class TextEditorCommand; /// This is a texteditor map. This is used to map Command-Names to commands /// This class is the owner of the the given commands -class TextEditorCommandMap : public QObject +class EDBEE_EXPORT TextEditorCommandMap : public QObject { Q_OBJECT public: diff --git a/edbee-lib/edbee/models/texteditorconfig.h b/edbee-lib/edbee/models/texteditorconfig.h index a2f7dbe..f4a3796 100644 --- a/edbee-lib/edbee/models/texteditorconfig.h +++ b/edbee-lib/edbee/models/texteditorconfig.h @@ -5,6 +5,8 @@ #pragma once +#include "edbee/exports.h" + #include #include #include @@ -14,7 +16,7 @@ namespace edbee { /// General configuration settings of the text editor -class TextEditorConfig : public QObject +class EDBEE_EXPORT TextEditorConfig : public QObject { Q_OBJECT diff --git a/edbee-lib/edbee/models/texteditorkeymap.h b/edbee-lib/edbee/models/texteditorkeymap.h index 82832b5..147d5d3 100644 --- a/edbee-lib/edbee/models/texteditorkeymap.h +++ b/edbee-lib/edbee/models/texteditorkeymap.h @@ -5,6 +5,8 @@ #pragma once +#include "edbee/exports.h" + #include #include #include @@ -17,8 +19,7 @@ class TextEditorController; /// A contexted keysequence /// This contains a keysequence and optionally a given context -class TextEditorKey -{ +class EDBEE_EXPORT TextEditorKey { public: TextEditorKey( const QKeySequence& seq ); TextEditorKey* clone() const; @@ -36,8 +37,7 @@ class TextEditorKey /// A text editor key map /// This key map, maps key-sequences to action-names. -class TextEditorKeyMap -{ +class EDBEE_EXPORT TextEditorKeyMap { public: TextEditorKeyMap( TextEditorKeyMap* parentKeyMap=0 ); @@ -78,8 +78,7 @@ class TextEditorKeyMap /// There can be different keymaps for different file-types/ /// The keymap manager manages all the available keymaps /// There's ALWAYS a keymap with the name "" -class TextKeyMapManager -{ +class EDBEE_EXPORT TextKeyMapManager { public: TextKeyMapManager(); virtual ~TextKeyMapManager(); diff --git a/edbee-lib/edbee/models/textgrammar.h b/edbee-lib/edbee/models/textgrammar.h index 2e85c24..936d0c1 100644 --- a/edbee-lib/edbee/models/textgrammar.h +++ b/edbee-lib/edbee/models/textgrammar.h @@ -5,6 +5,8 @@ #pragma once +#include "edbee/exports.h" + #include #include #include @@ -21,8 +23,7 @@ class Edbee; /// defines a single grammar rule -class TextGrammarRule -{ +class EDBEE_EXPORT TextGrammarRule { public: /// the instructions @@ -122,8 +123,7 @@ class TextGrammarRule /// This class defines a single language grammar -class TextGrammar -{ +class EDBEE_EXPORT TextGrammar { public: TextGrammar( const QString& name, const QString& displayName ); @@ -154,8 +154,7 @@ class TextGrammar /// This class is used to manage all 'grammers' used by the lexers -class TextGrammarManager -{ +class EDBEE_EXPORT TextGrammarManager { protected: TextGrammarManager(); virtual ~TextGrammarManager(); diff --git a/edbee-lib/edbee/models/textlexer.h b/edbee-lib/edbee/models/textlexer.h index a5b04d5..f41f576 100644 --- a/edbee-lib/edbee/models/textlexer.h +++ b/edbee-lib/edbee/models/textlexer.h @@ -5,6 +5,8 @@ #pragma once +#include "edbee/exports.h" + #include "edbee/models/textbuffer.h" namespace edbee { @@ -14,8 +16,7 @@ class TextDocument; class TextDocumentScopes; /// This is a single lexer -class TextLexer -{ +class EDBEE_EXPORT TextLexer { public: TextLexer( TextDocumentScopes* scopes ); virtual ~TextLexer() {} diff --git a/edbee-lib/edbee/models/textlinedata.h b/edbee-lib/edbee/models/textlinedata.h index cf973d0..dc7627e 100644 --- a/edbee-lib/edbee/models/textlinedata.h +++ b/edbee-lib/edbee/models/textlinedata.h @@ -5,6 +5,8 @@ #pragma once +#include "edbee/exports.h" + #include #include "edbee/util/gapvector.h" @@ -25,8 +27,7 @@ class TextLineDataManager; /// A text line item reference -class TextLineData -{ +class EDBEE_EXPORT TextLineData { public: TextLineData() {} virtual ~TextLineData() {} @@ -35,7 +36,7 @@ class TextLineData /// a simple class to store a QString in a line template -class BasicTextLineData : public TextLineData +class EDBEE_EXPORT BasicTextLineData : public TextLineData { public: BasicTextLineData( const T& val ) : value_(val) {} @@ -52,8 +53,7 @@ typedef BasicTextLineData QStringTextLineData; //------- /// the line data items -class TextLineDataList -{ +class EDBEE_EXPORT TextLineDataList { public: TextLineDataList( ); virtual ~TextLineDataList(); @@ -72,7 +72,7 @@ class TextLineDataList //------- /// This manager manages all line definitions -class TextLineDataManager : public QObject +class EDBEE_EXPORT TextLineDataManager : public QObject { Q_OBJECT diff --git a/edbee-lib/edbee/models/textrange.h b/edbee-lib/edbee/models/textrange.h index e3289cb..ccd4c7d 100644 --- a/edbee-lib/edbee/models/textrange.h +++ b/edbee-lib/edbee/models/textrange.h @@ -5,6 +5,8 @@ #pragma once +#include "edbee/exports.h" + #include #include @@ -26,8 +28,7 @@ class TextDocument; /// a[b>cdef (anchor=1, caret=2) => "b" /// a "b" /// -class TextRange -{ +class EDBEE_EXPORT TextRange { public: TextRange( int anchor=0, int caret=0 ) : anchor_(anchor), caret_(caret) {} @@ -102,8 +103,7 @@ class TextRange /// Except when the changing_ flag is != 0. The sorting and merging only happens /// when changing is 0. This way it possible to add/update muliple rages without the direct /// performance hit of sorting and merging. -class TextRangeSetBase -{ +class EDBEE_EXPORT TextRangeSetBase { public: TextRangeSetBase(TextDocument* doc); virtual ~TextRangeSetBase() {} @@ -196,7 +196,7 @@ class TextRangeSetBase /// The basic textrange class. A simple class of textrange with a simple vector implementation -class TextRangeSet : public TextRangeSetBase +class EDBEE_EXPORT TextRangeSet : public TextRangeSetBase { public: TextRangeSet( TextDocument* doc ); @@ -235,7 +235,7 @@ class TextRangeSet : public TextRangeSetBase /// /// The delete mode is used to tell the rangeset if 'deleted' ranges need to be deleted /// or simply need to be moved -class DynamicTextRangeSet : public QObject, public TextRangeSet +class EDBEE_EXPORT DynamicTextRangeSet : public QObject, public TextRangeSet { Q_OBJECT diff --git a/edbee-lib/edbee/models/textsearcher.h b/edbee-lib/edbee/models/textsearcher.h index ddd02c9..567b86c 100644 --- a/edbee-lib/edbee/models/textsearcher.h +++ b/edbee-lib/edbee/models/textsearcher.h @@ -5,6 +5,8 @@ #pragma once +#include "edbee/exports.h" + #include #include "edbee/models/textrange.h" @@ -20,7 +22,7 @@ class TextEditorWidget; /// It remembers the current searchTerm that is used for searching /// The textsearcher component has got several option. Like case sensitivity /// regular expressions etc. -class TextSearcher : public QObject +class EDBEE_EXPORT TextSearcher : public QObject { Q_OBJECT public: diff --git a/edbee-lib/edbee/models/textundostack.h b/edbee-lib/edbee/models/textundostack.h index b7ea0ee..f60da60 100644 --- a/edbee-lib/edbee/models/textundostack.h +++ b/edbee-lib/edbee/models/textundostack.h @@ -5,6 +5,8 @@ #pragma once +#include "edbee/exports.h" + #include #include #include @@ -47,7 +49,7 @@ class ChangeGroup; /// /// ~~~~ -class TextUndoStack : public QObject +class EDBEE_EXPORT TextUndoStack : public QObject { Q_OBJECT diff --git a/edbee-lib/edbee/texteditorcommand.h b/edbee-lib/edbee/texteditorcommand.h index 99ed845..4ce8ddf 100644 --- a/edbee-lib/edbee/texteditorcommand.h +++ b/edbee-lib/edbee/texteditorcommand.h @@ -5,6 +5,8 @@ #pragma once +#include "edbee/exports.h" + #include namespace edbee { @@ -47,8 +49,7 @@ enum CoalesceId { /// /// These commands can be placed in the TextEditorCommandMap with a given name /// By linking this command-name in the Keymap you can register keyboard operations this way -class TextEditorCommand -{ +class EDBEE_EXPORT TextEditorCommand { public: TextEditorCommand(); virtual ~TextEditorCommand(); diff --git a/edbee-lib/edbee/texteditorcontroller.h b/edbee-lib/edbee/texteditorcontroller.h index f58ce26..c89002f 100644 --- a/edbee-lib/edbee/texteditorcontroller.h +++ b/edbee-lib/edbee/texteditorcontroller.h @@ -5,6 +5,8 @@ #pragma once +#include "edbee/exports.h" + #include #include @@ -34,7 +36,7 @@ class UndoableTextCommand; /// The texteditor works via the controller. The controller is the central point/mediater /// which maps/controls all messages between the different editor componenents -class TextEditorController : public QObject +class EDBEE_EXPORT TextEditorController : public QObject { Q_OBJECT public: diff --git a/edbee-lib/edbee/texteditorwidget.h b/edbee-lib/edbee/texteditorwidget.h index 09757f4..e5a295f 100644 --- a/edbee-lib/edbee/texteditorwidget.h +++ b/edbee-lib/edbee/texteditorwidget.h @@ -5,6 +5,8 @@ #pragma once +#include "edbee/exports.h" + //#include #include #include @@ -30,7 +32,7 @@ class TextSelection; /// This is the general edbee widget /// This core functionality of this widget is divided in several seperate /// compnents. (TextEditorComponent: the main editor, TextMarginComponent: the sidebar with line numbers) -class TextEditorWidget : public QWidget +class EDBEE_EXPORT TextEditorWidget : public QWidget { Q_OBJECT public: diff --git a/edbee-lib/edbee/util/cascadingqvariantmap.h b/edbee-lib/edbee/util/cascadingqvariantmap.h index 1788316..8b1564e 100644 --- a/edbee-lib/edbee/util/cascadingqvariantmap.h +++ b/edbee-lib/edbee/util/cascadingqvariantmap.h @@ -5,6 +5,8 @@ #pragma once +#include "edbee/exports.h" + #include namespace edbee { @@ -13,8 +15,7 @@ namespace edbee { /// /// When retrieving an item, it fist tries to find the item at this level, if it does't find /// the item it tries the parent item -class CascadingQVariantMap -{ +class EDBEE_EXPORT CascadingQVariantMap { public: explicit CascadingQVariantMap( CascadingQVariantMap* parent = 0); void deleteParents(); diff --git a/edbee-lib/edbee/util/gapvector.h b/edbee-lib/edbee/util/gapvector.h index 37851f2..8b8d8c5 100644 --- a/edbee-lib/edbee/util/gapvector.h +++ b/edbee-lib/edbee/util/gapvector.h @@ -5,6 +5,8 @@ #pragma once +#include "edbee/exports.h" + #include #include @@ -16,8 +18,7 @@ namespace edbee { /// This class is used to define a gap vector. A Gapvector is split in 2 parts. where the gap /// is moved to the insertation/changing point. So reducing the movement of fields template -class GapVector -{ +class EDBEE_EXPORT GapVector { public: GapVector( int capacity=16 ) : items_(0), capacity_(0), gapBegin_(0), gapEnd_(0) { items_ = new T[capacity]; @@ -408,7 +409,7 @@ class GapVector /// The character vecor to use -class QCharGapVector : public GapVector +class EDBEE_EXPORT QCharGapVector : public GapVector { public: @@ -471,8 +472,7 @@ class QCharGapVector : public GapVector /// (for debugging purposes) that isn't a gapv /// This class is only used for debugging issuess with the gapvector template -class NoGapVector -{ +class EDBEE_EXPORT NoGapVector { public: NoGapVector( int capacity=16 ) { Q_UNUSED(capacity); diff --git a/edbee-lib/edbee/util/lineending.h b/edbee-lib/edbee/util/lineending.h index e4f6a9b..a8a334c 100644 --- a/edbee-lib/edbee/util/lineending.h +++ b/edbee-lib/edbee/util/lineending.h @@ -5,12 +5,13 @@ #pragma once +#include "edbee/exports.h" + namespace edbee { /// A special class to perform line-ending detection -class LineEnding -{ +class EDBEE_EXPORT LineEnding { public: enum Type { diff --git a/edbee-lib/edbee/util/lineoffsetvector.h b/edbee-lib/edbee/util/lineoffsetvector.h index f16f694..cac7b5e 100644 --- a/edbee-lib/edbee/util/lineoffsetvector.h +++ b/edbee-lib/edbee/util/lineoffsetvector.h @@ -5,6 +5,8 @@ #pragma once +#include "edbee/exports.h" + #include #include "gapvector.h" @@ -23,8 +25,7 @@ class TextBufferChange; /// text this way usually only results in the changine of the offset delta. Which means speeeed /// /// The line offset pointed at by each index is the first character in the given line. -class LineOffsetVector -{ +class EDBEE_EXPORT LineOffsetVector { public: /// a structure to describe the line change that happend // struct LineChange { diff --git a/edbee-lib/edbee/util/mem/debug_allocs.h b/edbee-lib/edbee/util/mem/debug_allocs.h index cae4977..76d31eb 100644 --- a/edbee-lib/edbee/util/mem/debug_allocs.h +++ b/edbee-lib/edbee/util/mem/debug_allocs.h @@ -8,6 +8,8 @@ /// Altered to use QT API #pragma once +#include "edbee/exports.h" + class QMutex; //#if !defined(__APPLE__) @@ -31,8 +33,7 @@ struct DebugAllocation }; /// This class is used to remember all memory leakds -class DebugAllocationList -{ +class EDBEE_EXPORT DebugAllocationList { public: DebugAllocationList(); diff --git a/edbee-lib/edbee/util/rangelineiterator.h b/edbee-lib/edbee/util/rangelineiterator.h index 449aa08..84c6007 100644 --- a/edbee-lib/edbee/util/rangelineiterator.h +++ b/edbee-lib/edbee/util/rangelineiterator.h @@ -5,6 +5,8 @@ #pragma once +#include "edbee/exports.h" + namespace edbee { @@ -27,8 +29,7 @@ class TextRange; /// } /// /// @endcode -class RangeLineIterator -{ +class EDBEE_EXPORT RangeLineIterator { public: RangeLineIterator( TextDocument* doc, const TextRange& range ); RangeLineIterator( TextDocument* doc, int start, int end ); diff --git a/edbee-lib/edbee/util/rangesetlineiterator.h b/edbee-lib/edbee/util/rangesetlineiterator.h index f73c450..2af9b62 100644 --- a/edbee-lib/edbee/util/rangesetlineiterator.h +++ b/edbee-lib/edbee/util/rangesetlineiterator.h @@ -5,6 +5,8 @@ #pragma once +#include "edbee/exports.h" + namespace edbee { class TextRangeSet; @@ -21,8 +23,7 @@ class TextRangeSet; /// } /// /// @endcode -class RangeSetLineIterator -{ +class EDBEE_EXPORT RangeSetLineIterator { public: RangeSetLineIterator( TextRangeSet* rangeSet ); diff --git a/edbee-lib/edbee/util/regexp.h b/edbee-lib/edbee/util/regexp.h index ad26906..574427e 100644 --- a/edbee-lib/edbee/util/regexp.h +++ b/edbee-lib/edbee/util/regexp.h @@ -5,14 +5,15 @@ #pragma once +#include "edbee/exports.h" + #include namespace edbee { /// The minimal engine we currently require for handling regexpt. /// It may grow in the future -class RegExpEngine -{ +class EDBEE_EXPORT RegExpEngine { public: virtual ~RegExpEngine() {} virtual QString pattern() = 0; @@ -33,8 +34,7 @@ class RegExpEngine /// A class for matching QStrings with the Oniguruma API /// We need this Regular Expression library to be able to support tmLanguages fully /// I tried to make this class as close as possible to the QRegExp library -class RegExp -{ +class EDBEE_EXPORT RegExp { public: enum Engine { EngineOniguruma = 1, diff --git a/edbee-lib/edbee/util/simpleprofiler.h b/edbee-lib/edbee/util/simpleprofiler.h index e219b47..b628759 100644 --- a/edbee-lib/edbee/util/simpleprofiler.h +++ b/edbee-lib/edbee/util/simpleprofiler.h @@ -5,6 +5,8 @@ #pragma once +#include "edbee/exports.h" + //#include "config.h" #include @@ -37,8 +39,7 @@ namespace edbee { /// A simple profiler class that can be used to profile certain parts of the code. /// I've introduced this class as a poor-mans profiler. Because currently valgrand and other profilers /// don't seem to run smoothly on my mac. They crash .. -class SimpleProfiler -{ +class EDBEE_EXPORT SimpleProfiler { public: diff --git a/edbee-lib/edbee/util/test.h b/edbee-lib/edbee/util/test.h index b1e7746..cb3618e 100644 --- a/edbee-lib/edbee/util/test.h +++ b/edbee-lib/edbee/util/test.h @@ -5,6 +5,8 @@ #pragma once +#include "edbee/exports.h" + #include #include #include @@ -44,8 +46,7 @@ QString toQString( const T& obj ) /// This method represents a test result -class TestResult -{ +class EDBEE_EXPORT TestResult { public: enum Status { Passed, Failed, Skipped @@ -158,7 +159,7 @@ class TestResult /// A simple unit test. Every private slot is called for a test /// -class TestCase : public QObject +class EDBEE_EXPORT TestCase : public QObject { Q_OBJECT public: @@ -204,8 +205,7 @@ private slots: /// This is the basic outputhandler. /// The basic outputhandler simply executes a qDebug with the given information -class OutputHandler -{ +class EDBEE_EXPORT OutputHandler { public: explicit OutputHandler(); @@ -250,7 +250,7 @@ class OutputHandler //============================================================================= /// This is the main test engine -class TestEngine : public QObject +class EDBEE_EXPORT TestEngine : public QObject { Q_OBJECT public: @@ -311,8 +311,7 @@ inline TestEngine& engine() template -class Test -{ +class EDBEE_EXPORT Test { public: QSharedPointer child; diff --git a/edbee-lib/edbee/util/textcodec.h b/edbee-lib/edbee/util/textcodec.h index 6078e0e..af142b0 100644 --- a/edbee-lib/edbee/util/textcodec.h +++ b/edbee-lib/edbee/util/textcodec.h @@ -3,6 +3,10 @@ * Author Rick Blommers */ +#pragma once + +#include "edbee/exports.h" + #include #include #include @@ -15,8 +19,7 @@ class TextCodec; /// The codec manager is used for managing codecs /// You shouldnt' instantiatie this class, it's better to access the /// codec manager instantiated via the edbee::Edbee -class TextCodecManager -{ +class EDBEE_EXPORT TextCodecManager { public: TextCodecManager(); ~TextCodecManager(); @@ -34,8 +37,7 @@ class TextCodecManager /// This class represents a single text codec /// The codec has a name and contains methods to create encoders and decoders -class TextCodec -{ +class EDBEE_EXPORT TextCodec { public: TextCodec( const QString& name, const QTextCodec* codec, QTextCodec::ConversionFlags flags ); const QTextCodec* codec(); diff --git a/edbee-lib/edbee/util/textcodecdetector.h b/edbee-lib/edbee/util/textcodecdetector.h index eb3cab8..bf2fcc0 100644 --- a/edbee-lib/edbee/util/textcodecdetector.h +++ b/edbee-lib/edbee/util/textcodecdetector.h @@ -5,6 +5,8 @@ #pragma once +#include "edbee/exports.h" + class QByteArray; @@ -28,8 +30,7 @@ class TextCodec; /// /// TextCodecDetector detector( QByteArray) ; /// TextCodec encoding = detector.guessEncoding( QByteArray arr, QTextCode fallback ); -class TextCodecDetector -{ +class EDBEE_EXPORT TextCodecDetector { public: diff --git a/edbee-lib/edbee/util/util.h b/edbee-lib/edbee/util/util.h index 6450c08..dffaaa3 100644 --- a/edbee-lib/edbee/util/util.h +++ b/edbee-lib/edbee/util/util.h @@ -5,6 +5,8 @@ #pragma once +#include "edbee/exports.h" + #include class QString; @@ -15,8 +17,7 @@ namespace edbee { /// The purpose of this class is to put 'global' function that don't quite fit on other places /// /// You can use this class like this: Util().converTabsToSpaces() -class Util -{ +class EDBEE_EXPORT Util { public: QString convertTabsToSpaces( const QString& str, int tabSize ); QList tabColumnOffsets( const QString& str, int tabSize ); diff --git a/edbee-lib/edbee/views/components/texteditorautocompletecomponent.h b/edbee-lib/edbee/views/components/texteditorautocompletecomponent.h index c449521..b8611bd 100644 --- a/edbee-lib/edbee/views/components/texteditorautocompletecomponent.h +++ b/edbee-lib/edbee/views/components/texteditorautocompletecomponent.h @@ -1,5 +1,7 @@ #pragma once +#include "edbee/exports.h" + #include #include @@ -19,7 +21,7 @@ class TextRange; /// An autocomplete list /// Which receives it's autocomplete list from the document -class TextEditorAutoCompleteComponent : public QWidget +class EDBEE_EXPORT TextEditorAutoCompleteComponent : public QWidget { Q_OBJECT public: diff --git a/edbee-lib/edbee/views/components/texteditorcomponent.h b/edbee-lib/edbee/views/components/texteditorcomponent.h index ffe55c3..5a2f3ec 100644 --- a/edbee-lib/edbee/views/components/texteditorcomponent.h +++ b/edbee-lib/edbee/views/components/texteditorcomponent.h @@ -5,6 +5,8 @@ #pragma once +#include "edbee/exports.h" + #include #include @@ -22,7 +24,7 @@ class TextSelection; /// This is the main texteditor-component (which is the true editor) /// This is the QWidget that recieves the keypresses, mouse presses etc. -class TextEditorComponent : public QWidget +class EDBEE_EXPORT TextEditorComponent : public QWidget { Q_OBJECT public: diff --git a/edbee-lib/edbee/views/components/texteditorrenderer.h b/edbee-lib/edbee/views/components/texteditorrenderer.h index c7bc9d7..9a9d989 100644 --- a/edbee-lib/edbee/views/components/texteditorrenderer.h +++ b/edbee-lib/edbee/views/components/texteditorrenderer.h @@ -5,6 +5,8 @@ #pragma once +#include "edbee/exports.h" + class QLinearGradient; class QPainter; class QRect; @@ -14,8 +16,7 @@ namespace edbee { class TextRenderer; class TextTheme; -class TextEditorRenderer -{ +class EDBEE_EXPORT TextEditorRenderer { public: TextEditorRenderer( TextRenderer *renderer ); virtual ~TextEditorRenderer(); diff --git a/edbee-lib/edbee/views/components/textmargincomponent.h b/edbee-lib/edbee/views/components/textmargincomponent.h index 049f0ef..8a19c94 100644 --- a/edbee-lib/edbee/views/components/textmargincomponent.h +++ b/edbee-lib/edbee/views/components/textmargincomponent.h @@ -5,6 +5,8 @@ #pragma once +#include "edbee/exports.h" + #include class QEvent; @@ -22,8 +24,7 @@ class TextTheme; /// The textmargin component delegate /// You can override the methods in the class for adding functionality to the text-margin component -class TextMarginComponentDelegate -{ +class EDBEE_EXPORT TextMarginComponentDelegate { public: TextMarginComponentDelegate(); virtual ~TextMarginComponentDelegate() {} @@ -50,7 +51,7 @@ class TextMarginComponentDelegate /// The margin/line-number component /// This class is used for rendering line-numbers etc -class TextMarginComponent : public QWidget +class EDBEE_EXPORT TextMarginComponent : public QWidget { Q_OBJECT diff --git a/edbee-lib/edbee/views/textcaretcache.h b/edbee-lib/edbee/views/textcaretcache.h index 2258901..6edb13f 100644 --- a/edbee-lib/edbee/views/textcaretcache.h +++ b/edbee-lib/edbee/views/textcaretcache.h @@ -5,6 +5,8 @@ #pragma once +#include "edbee/exports.h" + #include @@ -16,8 +18,7 @@ class TextRenderer; class TextRangeSet; /// A special cache. For remembering the x-coordinates of the carets -class TextCaretCache -{ +class EDBEE_EXPORT TextCaretCache { public: TextCaretCache( TextDocument* doc, TextRenderer* renderer ); diff --git a/edbee-lib/edbee/views/texteditorscrollarea.h b/edbee-lib/edbee/views/texteditorscrollarea.h index d45c66e..f65d78d 100644 --- a/edbee-lib/edbee/views/texteditorscrollarea.h +++ b/edbee-lib/edbee/views/texteditorscrollarea.h @@ -5,6 +5,8 @@ #pragma once +#include "edbee/exports.h" + #include class QLinearGradient; @@ -15,7 +17,7 @@ namespace edbee { class PrivateShadowWidget; /// A special scrollarea that makes it possible to add components to the margins of it -class TextEditorScrollArea : public QScrollArea +class EDBEE_EXPORT TextEditorScrollArea : public QScrollArea { Q_OBJECT public: diff --git a/edbee-lib/edbee/views/textrenderer.h b/edbee-lib/edbee/views/textrenderer.h index 6a83a82..6303422 100644 --- a/edbee-lib/edbee/views/textrenderer.h +++ b/edbee-lib/edbee/views/textrenderer.h @@ -5,6 +5,8 @@ #pragma once +#include "edbee/exports.h" + #include #include #include @@ -32,7 +34,7 @@ class TextThemeStyler; /// A class for rendering the text /// TODO: Currently this class is also used for positioning text. This probably should be moved in a class of its own -class TextRenderer : public QObject +class EDBEE_EXPORT TextRenderer : public QObject { Q_OBJECT diff --git a/edbee-lib/edbee/views/textselection.h b/edbee-lib/edbee/views/textselection.h index 6095a53..5022f79 100644 --- a/edbee-lib/edbee/views/textselection.h +++ b/edbee-lib/edbee/views/textselection.h @@ -5,6 +5,8 @@ #pragma once +#include "edbee/exports.h" + #include "edbee/models/textrange.h" namespace edbee { @@ -21,7 +23,7 @@ class TextEditorController; /// side. Because we support variable font widts.. /// Also 'remembering' the caret screen-x and -y positions isn't relevant for a docuemnt. That is /// stuff that needs to be placed in the view side -class TextSelection : public TextRangeSet +class EDBEE_EXPORT TextSelection : public TextRangeSet { public: TextSelection( TextEditorController* controller ); diff --git a/edbee-lib/edbee/views/texttheme.h b/edbee-lib/edbee/views/texttheme.h index 0c1be87..456a1ac 100644 --- a/edbee-lib/edbee/views/texttheme.h +++ b/edbee-lib/edbee/views/texttheme.h @@ -5,6 +5,8 @@ #pragma once +#include "edbee/exports.h" + #include #include #include @@ -32,8 +34,7 @@ class TextScopeSelector; //================================================= -class TextThemeRule -{ +class EDBEE_EXPORT TextThemeRule { public: TextThemeRule(const QString& name, const QString& selector, QColor foreground=QColor(), QColor background=QColor(), bool bold=false, bool italic=false, bool underline=false ); virtual ~TextThemeRule(); @@ -65,7 +66,7 @@ class TextThemeRule //================================================= /// This class defines a single theme -class TextTheme : public QObject +class EDBEE_EXPORT TextTheme : public QObject { public: TextTheme(); @@ -154,7 +155,7 @@ class TextTheme : public QObject /// This class is used to return the style formats for rendering the texts -class TextThemeStyler : public QObject +class EDBEE_EXPORT TextThemeStyler : public QObject { Q_OBJECT @@ -200,7 +201,7 @@ private slots: /// This class is used to manage load 'themes'. /// This method loads only loads a theme if requested. /// It will list all available theme when -class TextThemeManager : public QObject +class EDBEE_EXPORT TextThemeManager : public QObject { Q_OBJECT From 2436c23d3fc1159b717d01cdc80f88631655127f Mon Sep 17 00:00:00 2001 From: Rick Blommers Date: Tue, 5 Mar 2019 09:10:19 +0100 Subject: [PATCH 4/7] Improves #82, Ctrl+Drag mouse while expands the last caret (allows multiple caret selections with mouse). --- CHANGELOG.md | 1 + edbee-lib/edbee/commands/selectioncommand.cpp | 11 ++++++++--- edbee-lib/edbee/commands/selectioncommand.h | 6 +++--- edbee-lib/edbee/texteditorcontroller.cpp | 11 +++++++---- edbee-lib/edbee/texteditorcontroller.h | 4 ++-- .../edbee/views/components/texteditorcomponent.cpp | 8 +++++--- 6 files changed, 26 insertions(+), 15 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3b16437..aa2e13e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ edbee.lib: +- Improves #82, Ctrl+Drag mouse while expands the last caret (allows multiple caret selections with mouse). - fix #79, Using backtab on empty document causes Q_ASSERT failure - ref #66, Automatic grouping of Changes that happen in repond of another event. (Crash in setText()) - add #60, Basic support for auto complete. diff --git a/edbee-lib/edbee/commands/selectioncommand.cpp b/edbee-lib/edbee/commands/selectioncommand.cpp index f8a7efb..7c2fd63 100644 --- a/edbee-lib/edbee/commands/selectioncommand.cpp +++ b/edbee-lib/edbee/commands/selectioncommand.cpp @@ -23,10 +23,11 @@ namespace edbee { /// @param unit the unit of this command /// @param amount the number of steps /// @param keepSelection when true the anchor stays put (and the selection is expanded) -SelectionCommand::SelectionCommand( SelectionType unit, int amount, bool keepSelection ) +SelectionCommand::SelectionCommand(SelectionType unit, int amount, bool keepSelection , int rangeIndex) : unit_(unit) , amount_(amount) , keepSelection_(keepSelection) + , rangeIndex_(rangeIndex) { } @@ -118,8 +119,12 @@ void SelectionCommand::execute( TextEditorController* controller ) break; } case MoveCaretToExactOffset: - sel->toSingleRange(); - sel->range(0).setCaret(amount_); + if( rangeIndex_ >= 0 ) { + sel->range(rangeIndex_).setCaret(amount_); + } else { + sel->toSingleRange(); + sel->range(0).setCaret(amount_); + } break; case SelectAll: diff --git a/edbee-lib/edbee/commands/selectioncommand.h b/edbee-lib/edbee/commands/selectioncommand.h index d356a63..098da65 100644 --- a/edbee-lib/edbee/commands/selectioncommand.h +++ b/edbee-lib/edbee/commands/selectioncommand.h @@ -44,7 +44,7 @@ class EDBEE_EXPORT SelectionCommand : public TextEditorCommand }; public: - explicit SelectionCommand( SelectionType unit, int amount=0, bool keepSelection=false ); + explicit SelectionCommand( SelectionType unit, int amount=0, bool keepSelection=false, int rangeIndex = -1 ); virtual ~SelectionCommand(); virtual int commandId(); @@ -56,14 +56,14 @@ class EDBEE_EXPORT SelectionCommand : public TextEditorCommand SelectionType unit() { return unit_; } int amount() { return amount_; } bool keepSelection() { return keepSelection_; } + int rangeIndex() { return rangeIndex_; } private: SelectionType unit_; int amount_; bool keepSelection_; - - + int rangeIndex_; }; diff --git a/edbee-lib/edbee/texteditorcontroller.cpp b/edbee-lib/edbee/texteditorcontroller.cpp index fd189a1..f80e963 100644 --- a/edbee-lib/edbee/texteditorcontroller.cpp +++ b/edbee-lib/edbee/texteditorcontroller.cpp @@ -621,7 +621,9 @@ void TextEditorController::replaceRangeSet(TextRangeSet& rangeSet, const QString /// For example: /// moveCaretTo( 2, 1 ) => Moves the caret to the 3rd line and 2nd column /// moveCaretTo( -1, -2 ) => Moves the caret to the character before the last character -void TextEditorController::moveCaretTo(int line, int col, bool keepAnchors ) +/// +/// The rangeIndex is used to specify which range to move.. (Defaults to -1 which changes to a single range) +void TextEditorController::moveCaretTo(int line, int col, bool keepAnchors, int rangeIndex ) { if( line < 0) { line = textDocument()->lineCount() + line; @@ -638,17 +640,18 @@ void TextEditorController::moveCaretTo(int line, int col, bool keepAnchors ) //textDocument()->offsetFromLineAndColumn(line,col) - return moveCaretToOffset( offset , keepAnchors ); + return moveCaretToOffset( offset , keepAnchors, rangeIndex ); } /// Moves the caret to the given offset /// @param offset the offset to move the caret to /// @param keepAnchors should the anchors stay at the current position (extending the selection range) -void TextEditorController::moveCaretToOffset(int offset, bool keepAnchors) +/// The rangeIndex is used to specify which range to move.. (Defaults to -1 which changes to a single range) +void TextEditorController::moveCaretToOffset(int offset, bool keepAnchors, int rangeIndex) { // SelectionCommand* command = new SelectionCommand( SelectionCommand::MoveCaretToExactOffset, offset, keepAnchors ); - SelectionCommand command( SelectionCommand::MoveCaretToExactOffset, offset, keepAnchors ); + SelectionCommand command( SelectionCommand::MoveCaretToExactOffset, offset, keepAnchors, rangeIndex ); return executeCommand( &command ); } diff --git a/edbee-lib/edbee/texteditorcontroller.h b/edbee-lib/edbee/texteditorcontroller.h index c89002f..dd4e61f 100644 --- a/edbee-lib/edbee/texteditorcontroller.h +++ b/edbee-lib/edbee/texteditorcontroller.h @@ -126,8 +126,8 @@ public slots: virtual void replaceRangeSet(TextRangeSet& rangeSet, const QStringList& texts, int coalesceId=0 ); // caret movements - virtual void moveCaretTo( int line, int col, bool keepAnchors ); - virtual void moveCaretToOffset( int offset, bool keepAnchors ); + virtual void moveCaretTo( int line, int col, bool keepAnchors, int rangeIndex=-1 ); + virtual void moveCaretToOffset( int offset, bool keepAnchors, int rangeIndex=-1 ); virtual void addCaretAt( int line, int col); virtual void addCaretAtOffset( int offset ); virtual void changeAndGiveTextSelection(TextRangeSet* rangeSet , int coalesceId = 0); diff --git a/edbee-lib/edbee/views/components/texteditorcomponent.cpp b/edbee-lib/edbee/views/components/texteditorcomponent.cpp index e13a4ef..9fbd4f5 100644 --- a/edbee-lib/edbee/views/components/texteditorcomponent.cpp +++ b/edbee-lib/edbee/views/components/texteditorcomponent.cpp @@ -452,8 +452,6 @@ void TextEditorComponent::mouseMoveEvent(QMouseEvent* event ) if( event->buttons() & Qt::LeftButton ) { TextRenderer* renderer = textRenderer(); -// int x = renderer->widgetXToXpos( event->x() + horizontalScrollBar()->value() ); -// int y = renderer->widgetYToYpos( event->y() + verticalScrollBar()->value() ); int x = event->x(); int y = event->y(); @@ -462,7 +460,11 @@ void TextEditorComponent::mouseMoveEvent(QMouseEvent* event ) if( line >= 0 ) { col = renderer->columnIndexForXpos( line, x ); } if( line < 0 ) { line = 0; } - controller()->moveCaretTo( line, col, true ); + if( event->modifiers() & Qt::ControlModifier) { + controller()->moveCaretTo( line, col, true, controller()->textSelection()->rangeCount() - 1 ); + } else { + controller()->moveCaretTo( line, col, true ); + } } QWidget::mouseMoveEvent(event); } From 8c2f3eefc05a38f9f14a14d7a5237f31a5cf25cb Mon Sep 17 00:00:00 2001 From: Rick Blommers Date: Tue, 2 Apr 2019 21:05:14 +0200 Subject: [PATCH 5/7] Moved the TextLineDataManager to the core TextDocument --- CHANGELOG.md | 1 + edbee-lib/edbee/models/chardocument/chartextdocument.cpp | 5 +---- edbee-lib/edbee/models/chardocument/chartextdocument.h | 4 ---- edbee-lib/edbee/models/textdocument.cpp | 9 +++++++++ edbee-lib/edbee/models/textdocument.h | 7 +++++-- 5 files changed, 16 insertions(+), 10 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 953f526..8ef0be0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ edbee.lib: +- Moved the TextLineDataManager to the core TextDocument - add #60, Basic support for auto complete. - add #59, Shift+Delete should perform a cut - add #56, Added move line up/down commands. diff --git a/edbee-lib/edbee/models/chardocument/chartextdocument.cpp b/edbee-lib/edbee/models/chardocument/chartextdocument.cpp index 58ef494..1b37635 100644 --- a/edbee-lib/edbee/models/chardocument/chartextdocument.cpp +++ b/edbee-lib/edbee/models/chardocument/chartextdocument.cpp @@ -31,7 +31,6 @@ CharTextDocument::CharTextDocument(QObject *object) : TextDocument(object) , config_(0) , textBuffer_(0) - , textLineDataManager_(0) , textScopes_(0) , textLexer_(0) , textCodecRef_(0) @@ -44,7 +43,6 @@ CharTextDocument::CharTextDocument(QObject *object) textBuffer_ = new CharTextBuffer(); config_ = new TextEditorConfig(); - textLineDataManager_ = new TextLineDataManager(); textScopes_ = new TextDocumentScopes( this ); textCodecRef_ = Edbee::instance()->codecManager()->codecForName("UTF-8"); @@ -77,7 +75,6 @@ CharTextDocument::~CharTextDocument() delete textUndoStack_; delete textLexer_; delete textScopes_; - delete textLineDataManager_; delete textBuffer_; delete config_; } @@ -154,7 +151,7 @@ void CharTextDocument::textBufferChanged(const TextBufferChange& change) // execute the line change if( !isUndoOrRedoRunning() ) { - Change* lineDataChange = textLineDataManager_->createLinesReplacedChange( change.line()+1, change.lineCount(), change.newLineCount() ); + Change* lineDataChange = lineDataManager()->createLinesReplacedChange( change.line()+1, change.lineCount(), change.newLineCount() ); if( lineDataChange ) { executeAndGiveChange( lineDataChange, true ); } diff --git a/edbee-lib/edbee/models/chardocument/chartextdocument.h b/edbee-lib/edbee/models/chardocument/chartextdocument.h index dcbae8e..3457334 100644 --- a/edbee-lib/edbee/models/chardocument/chartextdocument.h +++ b/edbee-lib/edbee/models/chardocument/chartextdocument.h @@ -33,9 +33,6 @@ Q_OBJECT /// This method should return the active textbuffer virtual TextBuffer* buffer() const; - /// this method can be used to give a 'custom' line data item to a given line - virtual TextLineDataManager* lineDataManager() { return textLineDataManager_; } - /// Should return the document-scopes of this document virtual TextDocumentScopes* scopes() { return textScopes_; } @@ -86,7 +83,6 @@ protected slots: TextEditorConfig* config_; ///< The text editor configuration TextBuffer* textBuffer_; ///< The textbuffers - TextLineDataManager* textLineDataManager_; ///< A class for managing text line data items TextDocumentScopes* textScopes_; ///< The text document scopes TextLexer* textLexer_; ///< The lexer used for finding the scopes diff --git a/edbee-lib/edbee/models/textdocument.cpp b/edbee-lib/edbee/models/textdocument.cpp index d9d06ea..d785af6 100644 --- a/edbee-lib/edbee/models/textdocument.cpp +++ b/edbee-lib/edbee/models/textdocument.cpp @@ -28,13 +28,16 @@ TextDocument::TextDocument( QObject* obj ) : QObject(obj) , documentFilter_(0) , documentFilterRef_(0) + , textLineDataManager_(0) { + textLineDataManager_ = new TextLineDataManager(); } /// Destroys the textdocument TextDocument::~TextDocument() { + delete textLineDataManager_; delete documentFilter_; } @@ -51,6 +54,12 @@ void TextDocument::setLineDataFieldsPerLine( int count ) textUndoStack()->clear(); } +void TextDocument::giveLineDataManager(TextLineDataManager *manager) +{ + delete textLineDataManager_; + textLineDataManager_ = manager; +} + /// This method gives a given data item to a text line void TextDocument::giveLineData(int line, int field, TextLineData* dataItem) diff --git a/edbee-lib/edbee/models/textdocument.h b/edbee-lib/edbee/models/textdocument.h index a0526cc..0c471bf 100644 --- a/edbee-lib/edbee/models/textdocument.h +++ b/edbee-lib/edbee/models/textdocument.h @@ -59,7 +59,8 @@ Q_OBJECT virtual void setLineDataFieldsPerLine( int count ); /// this method can be used to give a 'custom' line data item to a given line - virtual TextLineDataManager* lineDataManager() = 0; + virtual TextLineDataManager* lineDataManager() { return textLineDataManager_; } + virtual void giveLineDataManager(TextLineDataManager* manager); virtual void giveLineData( int line, int field, TextLineData* dataItem ); virtual TextLineData* getLineData( int line, int field ); // virtual TextLineData* takeLineData( int line, int field ) = 0; @@ -167,9 +168,11 @@ Q_OBJECT private: - TextDocumentFilter* documentFilter_; ///< The document filter if the filter is owned TextDocumentFilter* documentFilterRef_; ///< The reference to the document filter. + + TextLineDataManager* textLineDataManager_; ///< A class for managing text line data items + }; } // edbee From d9b32e6097eb4ff812212fb3f18141704c3b8e0a Mon Sep 17 00:00:00 2001 From: Rick Blommers Date: Wed, 3 Apr 2019 11:52:48 +0200 Subject: [PATCH 6/7] fix #84, Customize the autoScrollMargin --- CHANGELOG.md | 1 + edbee-lib/edbee/texteditorwidget.cpp | 15 ++++++++++++++- edbee-lib/edbee/texteditorwidget.h | 3 +++ 3 files changed, 18 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1ca4c8b..3a8ecd8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ edbee.lib: +- fix #84, Customize the autoScrollMargin - Moved the TextLineDataManager to the core TextDocument - Improves #82, Ctrl+Drag mouse while expands the last caret (allows multiple caret selections with mouse). - fix #79, Using backtab on empty document causes Q_ASSERT failure diff --git a/edbee-lib/edbee/texteditorwidget.cpp b/edbee-lib/edbee/texteditorwidget.cpp index 875998f..d426db7 100644 --- a/edbee-lib/edbee/texteditorwidget.cpp +++ b/edbee-lib/edbee/texteditorwidget.cpp @@ -53,6 +53,7 @@ TextEditorWidget::TextEditorWidget( QWidget* parent) , scrollAreaRef_(0) , editCompRef_(0) , autoCompleteCompRef_(0) + , autoScrollMargin_(50) { // auto initialize edbee if this hasn't been done alread Edbee::instance()->autoInit(); @@ -117,7 +118,7 @@ TextEditorWidget::~TextEditorWidget() /// @param yPosIn the position in text-editor 'coordinates' void TextEditorWidget::scrollPositionVisible(int xPosIn, int yPosIn) { - scrollAreaRef_->ensureVisible( xPosIn, yPosIn ); + scrollAreaRef_->ensureVisible(xPosIn, yPosIn, autoScrollMargin_, autoScrollMargin_); } @@ -251,6 +252,18 @@ void TextEditorWidget::setHorizontalScrollBar(QScrollBar* scrollBar) emit verticalScrollBarChanged( scrollBar ); } +/// Returns the auto scroll margin +int TextEditorWidget::autoScrollMargin() const +{ + return autoScrollMargin_; +} + +/// Sets the auto scrollmargin +void TextEditorWidget::setAutoScrollMargin(int amount) +{ + autoScrollMargin_ = amount; +} + /// This mehtod is called when a resize happens /// @param event the event of the editor widget diff --git a/edbee-lib/edbee/texteditorwidget.h b/edbee-lib/edbee/texteditorwidget.h index e5a295f..7c7f175 100644 --- a/edbee-lib/edbee/texteditorwidget.h +++ b/edbee-lib/edbee/texteditorwidget.h @@ -61,6 +61,8 @@ class EDBEE_EXPORT TextEditorWidget : public QWidget QScrollBar* verticalScrollBar() const; void setVerticalScrollBar( QScrollBar* scrollBar ); void setHorizontalScrollBar( QScrollBar* scrollBar ); + int autoScrollMargin() const; + void setAutoScrollMargin(int amount=50); protected: @@ -100,6 +102,7 @@ public slots: TextMarginComponent* marginCompRef_; ///< The margin components TextEditorAutoCompleteComponent* autoCompleteCompRef_; ///< The autocomplete list widget + int autoScrollMargin_; //< Customize the autoscroll margin }; } // edbee From dfd32526fce28c94d02aa5b4a70c7dac43ba72d4 Mon Sep 17 00:00:00 2001 From: Rick Blommers Date: Mon, 24 Jun 2019 06:55:08 +0200 Subject: [PATCH 7/7] fix #89, Replace deprecated qSort with std::sort --- CHANGELOG.md | 1 + edbee-lib/edbee/models/textdocumentscopes.cpp | 2 +- edbee-lib/edbee/models/textgrammar.cpp | 2 +- edbee-lib/edbee/models/textrange.cpp | 2 +- edbee-lib/edbee/util/simpleprofiler.cpp | 2 +- edbee-lib/edbee/util/textcodec.cpp | 2 +- 6 files changed, 6 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3a8ecd8..f024b64 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ edbee.lib: +- fix #89, Replace qSort with std::sort - fix #84, Customize the autoScrollMargin - Moved the TextLineDataManager to the core TextDocument - Improves #82, Ctrl+Drag mouse while expands the last caret (allows multiple caret selections with mouse). diff --git a/edbee-lib/edbee/models/textdocumentscopes.cpp b/edbee-lib/edbee/models/textdocumentscopes.cpp index f6025c3..ca10ef8 100644 --- a/edbee-lib/edbee/models/textdocumentscopes.cpp +++ b/edbee-lib/edbee/models/textdocumentscopes.cpp @@ -687,7 +687,7 @@ void MultiLineScopedTextRangeSet::toSingleRange() /// This method sorts all ranges void MultiLineScopedTextRangeSet::sortRanges() { - qSort( scopedRangeList_.begin(), scopedRangeList_.end(), MultiLineScopedTextRange::lessThan ); + std::sort(scopedRangeList_.begin(), scopedRangeList_.end(), MultiLineScopedTextRange::lessThan); } diff --git a/edbee-lib/edbee/models/textgrammar.cpp b/edbee-lib/edbee/models/textgrammar.cpp index ebdf9ae..d8ddf73 100644 --- a/edbee-lib/edbee/models/textgrammar.cpp +++ b/edbee-lib/edbee/models/textgrammar.cpp @@ -381,7 +381,7 @@ static bool grammarsDisplayNameSorterLessThen( const TextGrammar* g1, const Text QList TextGrammarManager::grammarsSortedByDisplayName() { QList results = grammarMap_.values(); - qSort( results.begin(), results.end(), grammarsDisplayNameSorterLessThen ); + std::sort(results.begin(), results.end(), grammarsDisplayNameSorterLessThen); return results; } diff --git a/edbee-lib/edbee/models/textrange.cpp b/edbee-lib/edbee/models/textrange.cpp index da4a5a7..362918d 100644 --- a/edbee-lib/edbee/models/textrange.cpp +++ b/edbee-lib/edbee/models/textrange.cpp @@ -1099,7 +1099,7 @@ void TextRangeSet::toSingleRange() /// Sorts the ranges void TextRangeSet::sortRanges() { - qSort(selectionRanges_.begin(), selectionRanges_.end(), TextRange::lessThan ); + std::sort(selectionRanges_.begin(), selectionRanges_.end(), TextRange::lessThan); } diff --git a/edbee-lib/edbee/util/simpleprofiler.cpp b/edbee-lib/edbee/util/simpleprofiler.cpp index b816a09..1e4d452 100644 --- a/edbee-lib/edbee/util/simpleprofiler.cpp +++ b/edbee-lib/edbee/util/simpleprofiler.cpp @@ -86,7 +86,7 @@ void SimpleProfiler::dumpResults() { QList items = statsMap_.values(); if( items.length() > 0 ) { - qSort( items.begin(), items.end(), sortByDuration ); + std::sort(items.begin(), items.end(), sortByDuration); qlog_info() << ""; qlog_info() << "Profiler Results"; diff --git a/edbee-lib/edbee/util/textcodec.cpp b/edbee-lib/edbee/util/textcodec.cpp index cb023ab..6915b86 100644 --- a/edbee-lib/edbee/util/textcodec.cpp +++ b/edbee-lib/edbee/util/textcodec.cpp @@ -27,7 +27,7 @@ TextCodecManager::TextCodecManager() // append the items QList names = QTextCodec::availableCodecs(); - qSort(names); + std::sort(names.begin(), names.end()); foreach( QByteArray name, names) { QTextCodec* codec = QTextCodec::codecForName(name); if( !codecRefMap_.contains( codec->name() ) ) {