From 8e9a322a98fb1bfe9ab55d6e45a90b48a57c6459 Mon Sep 17 00:00:00 2001 From: Yevgen Muntyan <17531749+muntyan@users.noreply.github.com> Date: Sat, 22 Oct 2016 13:10:01 -0700 Subject: [PATCH] Fix non-scintilla build --- CMakeLists.txt | 2 +- api/CMakeLists.txt | 16 +++++------ moo/CMakeLists.txt | 4 ++- moo/mooedit/mooedit.cmake | 28 +++++++++++++------ moo/mooedit/mooedit.cpp | 4 ++- moo/mooedit/mooeditconfig.cpp | 4 ++- moo/mooedit/mooeditfiltersettings.cpp | 4 ++- moo/mooedit/mooeditor-private.h | 4 ++- moo/mooedit/mooeditprefs.cpp | 4 ++- moo/mooedit/mooeditprefspage.cpp | 4 ++- moo/mooedit/mooeditwindow.cpp | 5 ++-- moo/mooedit/mootext-private.h | 4 ++- moo/mooedit/mootextbuffer.c | 6 ++-- moo/mooedit/mootextbuffer.h | 4 ++- moo/mooedit/mootextview.c | 4 ++- moo/mooedit/mootextview.h | 6 ++-- moo/mooedit/{ => native}/moolang-private.h | 6 ++-- moo/mooedit/{ => native}/moolang.cpp | 4 ++- moo/mooedit/{ => native}/moolang.h | 0 moo/mooedit/{ => native}/moolangmgr-private.h | 4 ++- moo/mooedit/{ => native}/moolangmgr.cpp | 6 ++-- moo/mooedit/{ => native}/moolangmgr.h | 6 ++-- moo/mooedit/{ => native}/mootextstylescheme.c | 4 ++- moo/mooedit/{ => native}/mootextstylescheme.h | 0 moo/moolua/moo-lua-api.h | 4 ++- .../usertools/moooutputfilterregex.cpp | 4 ++- 26 files changed, 97 insertions(+), 44 deletions(-) rename moo/mooedit/{ => native}/moolang-private.h (91%) rename moo/mooedit/{ => native}/moolang.cpp (97%) rename moo/mooedit/{ => native}/moolang.h (100%) rename moo/mooedit/{ => native}/moolangmgr-private.h (94%) rename moo/mooedit/{ => native}/moolangmgr.cpp (99%) rename moo/mooedit/{ => native}/moolangmgr.h (96%) rename moo/mooedit/{ => native}/mootextstylescheme.c (98%) rename moo/mooedit/{ => native}/mootextstylescheme.h (100%) diff --git a/CMakeLists.txt b/CMakeLists.txt index c7006b04..70378839 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -223,7 +223,7 @@ add_subdirectory(api) #add_subdirectory(po) #add_subdirectory(po-gsv) -set(MOO_USE_SCI TRUE CACHE BOOL "Use Scintilla") +set(MOO_USE_SCI FALSE CACHE BOOL "Use Scintilla") if(MOO_USE_SCI) add_definitions(-DMOO_USE_SCI=1) add_subdirectory(scintilla) diff --git a/api/CMakeLists.txt b/api/CMakeLists.txt index bafc5aa8..6fce7176 100644 --- a/api/CMakeLists.txt +++ b/api/CMakeLists.txt @@ -94,12 +94,12 @@ SET(source_files ../moo/mooedit/moofold.h ../moo/mooedit/mooindenter.c ../moo/mooedit/mooindenter.h - ../moo/mooedit/moolang.c - ../moo/mooedit/moolang.h - ../moo/mooedit/moolangmgr.c - ../moo/mooedit/moolangmgr.h - ../moo/mooedit/moolangmgr-private.h - ../moo/mooedit/moolang-private.h + ../moo/mooedit/native/moolang.c + ../moo/mooedit/native/moolang.h + ../moo/mooedit/native/moolangmgr.c + ../moo/mooedit/native/moolangmgr.h + ../moo/mooedit/native/moolangmgr-private.h + ../moo/mooedit/native/moolang-private.h ../moo/mooedit/moolinebuffer.c ../moo/mooedit/moolinebuffer.h ../moo/mooedit/moolinemark.c @@ -122,8 +122,8 @@ SET(source_files ../moo/mooedit/mootextsearch.c ../moo/mooedit/mootextsearch.h ../moo/mooedit/mootextsearch-private.h - ../moo/mooedit/mootextstylescheme.c - ../moo/mooedit/mootextstylescheme.h + ../moo/mooedit/native/mootextstylescheme.c + ../moo/mooedit/native/mootextstylescheme.h ../moo/mooedit/mootextview.c ../moo/mooedit/mootextview.h ../moo/mooedit/mootextview-input.c diff --git a/moo/CMakeLists.txt b/moo/CMakeLists.txt index 70e23b8e..ff96f3f6 100644 --- a/moo/CMakeLists.txt +++ b/moo/CMakeLists.txt @@ -57,7 +57,9 @@ include(moocpp/moocpp.cmake) include(mooutils/mooutils.cmake) include(mooedit/mooedit.cmake) include(moofileview/moofileview.cmake) -include(gtksourceview/gtksourceview.cmake) +if(NOT MOO_USE_SCI) + include(gtksourceview/gtksourceview.cmake) +endif() if(NOT MOO_OS_WIN32) include(eggsmclient/eggsmclient.cmake) endif() diff --git a/moo/mooedit/mooedit.cmake b/moo/mooedit/mooedit.cmake index b7f324b5..9b926c52 100644 --- a/moo/mooedit/mooedit.cmake +++ b/moo/mooedit/mooedit.cmake @@ -1,5 +1,19 @@ LIST(APPEND moo_edit_enum_headers mooedit/mooedit-enums.h) +SET(mooedit_gtksourceview_sources + mooedit/native/moolang-private.h + mooedit/native/moolang.cpp + mooedit/native/moolang.h + mooedit/native/moolangmgr-private.h + mooedit/native/moolangmgr.cpp + mooedit/native/moolangmgr.h + mooedit/native/mootextstylescheme.c + mooedit/native/mootextstylescheme.h +) + +SET(mooedit_sci_sources +) + SET(mooedit_sources mooedit/mooedit.cmake ${moo_edit_enum_headers} @@ -61,12 +75,6 @@ SET(mooedit_sources mooedit/moofold.h mooedit/mooindenter.cpp mooedit/mooindenter.h - mooedit/moolang-private.h - mooedit/moolang.cpp - mooedit/moolang.h - mooedit/moolangmgr-private.h - mooedit/moolangmgr.cpp - mooedit/moolangmgr.h mooedit/moolinebuffer.c mooedit/moolinebuffer.h mooedit/moolinemark.c @@ -90,14 +98,18 @@ SET(mooedit_sources mooedit/mootextsearch-private.h mooedit/mootextsearch.c mooedit/mootextsearch.h - mooedit/mootextstylescheme.c - mooedit/mootextstylescheme.h mooedit/mootextview-input.c mooedit/mootextview-private.h mooedit/mootextview.c mooedit/mootextview.h ) +if(MOO_USE_SCI) + list(APPEND mooedit_sources ${mooedit_sci_sources}) +else() + list(APPEND mooedit_sources ${mooedit_gtksourceview_sources}) +endif() + # SET(built_mooedit_sources mooedit/mooedit-enum-types.h.stamp mooedit/mooedit-enum-types.c.stamp) # add_custom_command(OUTPUT mooedit/mooedit-enum-types.h.stamp diff --git a/moo/mooedit/mooedit.cpp b/moo/mooedit/mooedit.cpp index 0b188071..e8b90443 100644 --- a/moo/mooedit/mooedit.cpp +++ b/moo/mooedit/mooedit.cpp @@ -46,7 +46,9 @@ #include "mooedit/mooeditor-impl.h" #include "mooedit/mooedittab-impl.h" #include "mooedit/mooeditwindow-impl.h" -#include "mooedit/moolangmgr.h" +#ifndef MOO_USE_SCI +#include "mooedit/native/moolangmgr.h" +#endif // !MOO_USE_SCI #include "marshals.h" #include "mooutils/mooutils-fs.h" #include "mooutils/mooi18n.h" diff --git a/moo/mooedit/mooeditconfig.cpp b/moo/mooedit/mooeditconfig.cpp index e1743ace..af13e354 100644 --- a/moo/mooedit/mooeditconfig.cpp +++ b/moo/mooedit/mooeditconfig.cpp @@ -14,7 +14,9 @@ */ #include "mooedit/mooeditconfig.h" -#include "mooedit/moolang.h" +#ifndef MOO_USE_SCI +#include "mooedit/native/moolang.h" +#endif // !MOO_USE_SCI #include "mooedit/mooeditprefs.h" #include "mooutils/mooutils-gobject.h" #include "mooutils/mooutils-debug.h" diff --git a/moo/mooedit/mooeditfiltersettings.cpp b/moo/mooedit/mooeditfiltersettings.cpp index 00c0337e..7f933e07 100644 --- a/moo/mooedit/mooeditfiltersettings.cpp +++ b/moo/mooedit/mooeditfiltersettings.cpp @@ -16,7 +16,9 @@ #include "mooedit/mooeditfiltersettings.h" #include "mooedit/mooeditprefs.h" #include "mooedit/mooeditaction.h" -#include "mooedit/moolang.h" +#ifndef MOO_USE_SCI +#include "mooedit/native/moolang.h" +#endif // !MOO_USE_SCI #include "mooedit/mooeditconfig.h" #include "mooedit/mooedit.h" #include "mooutils/mooprefs.h" diff --git a/moo/mooedit/mooeditor-private.h b/moo/mooedit/mooeditor-private.h index aca3082b..9496c484 100644 --- a/moo/mooedit/mooeditor-private.h +++ b/moo/mooedit/mooeditor-private.h @@ -17,7 +17,9 @@ #define MOO_EDITOR_PRIVATE_H #include "mooedit/mooeditor-impl.h" -#include "mooedit/moolangmgr.h" +#ifndef MOO_USE_SCI +#include "mooedit/native/moolangmgr.h" +#endif // !MOO_USE_SCI G_BEGIN_DECLS diff --git a/moo/mooedit/mooeditprefs.cpp b/moo/mooedit/mooeditprefs.cpp index 6de4b028..dd4a422f 100644 --- a/moo/mooedit/mooeditprefs.cpp +++ b/moo/mooedit/mooeditprefs.cpp @@ -20,7 +20,9 @@ #include "mooedit/mootextview-private.h" #include "mooedit/mooedit-enums.h" #include "mooedit/mootextbuffer.h" -#include "mooedit/moolangmgr.h" +#ifndef MOO_USE_SCI +#include "mooedit/native/moolangmgr.h" +#endif // !MOO_USE_SCI #include "mooutils/mooencodings.h" #include "mooutils/mooi18n.h" #include diff --git a/moo/mooedit/mooeditprefspage.cpp b/moo/mooedit/mooeditprefspage.cpp index 32a2ca85..58547cc0 100644 --- a/moo/mooedit/mooeditprefspage.cpp +++ b/moo/mooedit/mooeditprefspage.cpp @@ -16,7 +16,9 @@ #include "mooedit/mooedit-impl.h" #include "mooedit/mooeditor-impl.h" #include "mooedit/mooeditprefs.h" -#include "mooedit/moolangmgr.h" +#ifndef MOO_USE_SCI +#include "mooedit/native/moolangmgr.h" +#endif // !MOO_USE_SCI #include "mooedit/mooeditfiltersettings.h" #include "mooutils/mooprefsdialog.h" #include "mooutils/moostock.h" diff --git a/moo/mooedit/mooeditwindow.cpp b/moo/mooedit/mooeditwindow.cpp index c061e071..c4d37317 100644 --- a/moo/mooedit/mooeditwindow.cpp +++ b/moo/mooedit/mooeditwindow.cpp @@ -29,13 +29,14 @@ #include "mooedit/mooeditview-impl.h" #include "mooedit/mooedittab-impl.h" #include "mooedit/mooeditfiltersettings.h" -#include "mooedit/moolang.h" +#ifndef MOO_USE_SCI +#include "mooedit/native/moolangmgr.h" +#endif // !MOO_USE_SCI #include "mooedit/mootextbuffer.h" #include "mooedit/mooeditprefs.h" #include "mooedit/mooplugin.h" #include "mooedit/mooeditaction.h" #include "mooedit/mooeditbookmark.h" -#include "mooedit/moolangmgr.h" #include "mooutils/moonotebook.h" #include "mooutils/moostock.h" #include "marshals.h" diff --git a/moo/mooedit/mootext-private.h b/moo/mooedit/mootext-private.h index ee8699df..6d37e93b 100644 --- a/moo/mooedit/mootext-private.h +++ b/moo/mooedit/mootext-private.h @@ -18,7 +18,9 @@ #include "mooedit/moofold.h" #include "mooedit/moolinebuffer.h" -#include "mooedit/mootextstylescheme.h" +#ifndef MOO_USE_SCI +#include +#endif // !MOO_USE_SCI G_BEGIN_DECLS diff --git a/moo/mooedit/mootextbuffer.c b/moo/mooedit/mootextbuffer.c index aa11cb16..a5cf1c78 100644 --- a/moo/mooedit/mootextbuffer.c +++ b/moo/mooedit/mootextbuffer.c @@ -19,8 +19,10 @@ #include "mooedit/mootextiter.h" #include "mooedit/mootext-private.h" -#include "mooedit/moolang-private.h" -#include "mooedit/mootextstylescheme.h" +#ifndef MOO_USE_SCI +#include "mooedit/native/moolang-private.h" +#include +#endif // !MOO_USE_SCI #include "marshals.h" #include "mooutils/mooundo.h" #include "mooutils/mooutils-gobject.h" diff --git a/moo/mooedit/mootextbuffer.h b/moo/mooedit/mootextbuffer.h index eaaa639c..d5016e3f 100644 --- a/moo/mooedit/mootextbuffer.h +++ b/moo/mooedit/mootextbuffer.h @@ -17,7 +17,9 @@ #define MOO_TEXT_BUFFER_H #include -#include +#ifndef MOO_USE_SCI +#include "mooedit/native/moolang.h" +#endif // !MOO_USE_SCI #include G_BEGIN_DECLS diff --git a/moo/mooedit/mootextview.c b/moo/mooedit/mootextview.c index 532bf715..97c1f859 100644 --- a/moo/mooedit/mootextview.c +++ b/moo/mooedit/mootextview.c @@ -24,7 +24,9 @@ #include "mooedit/mootextfind.h" #include "mooedit/mootext-private.h" #include "mooedit/mooeditprefs.h" -#include "mooedit/moolangmgr.h" +#ifndef MOO_USE_SCI +#include "mooedit/native/moolangmgr.h" +#endif // !MOO_USE_SCI #include "mooedit/mooeditwindow.h" #include "mooedit/mooedit.h" #include "marshals.h" diff --git a/moo/mooedit/mootextview.h b/moo/mooedit/mootextview.h index 2747b346..60285350 100644 --- a/moo/mooedit/mootextview.h +++ b/moo/mooedit/mootextview.h @@ -17,9 +17,11 @@ #include #include -#include +#ifndef MOO_USE_SCI +#include "mooedit/native/moolangmgr.h" +#include +#endif // !MOO_USE_SCI #include -#include #include G_BEGIN_DECLS diff --git a/moo/mooedit/moolang-private.h b/moo/mooedit/native/moolang-private.h similarity index 91% rename from moo/mooedit/moolang-private.h rename to moo/mooedit/native/moolang-private.h index 76da2cfb..6b96d627 100644 --- a/moo/mooedit/moolang-private.h +++ b/moo/mooedit/native/moolang-private.h @@ -17,8 +17,10 @@ #define MOO_LANG_PRIVATE_H #include "gtksourceview/gtksourceview-api.h" -#include "mooedit/moolang.h" -#include "mooedit/moolangmgr.h" +#ifndef MOO_USE_SCI +#include "mooedit/native/moolang.h" +#include "mooedit/native/moolangmgr.h" +#endif // !MOO_USE_SCI #include "mooedit/mooeditconfig.h" G_BEGIN_DECLS diff --git a/moo/mooedit/moolang.cpp b/moo/mooedit/native/moolang.cpp similarity index 97% rename from moo/mooedit/moolang.cpp rename to moo/mooedit/native/moolang.cpp index 9d656c89..f6821e89 100644 --- a/moo/mooedit/moolang.cpp +++ b/moo/mooedit/native/moolang.cpp @@ -16,7 +16,9 @@ #ifdef HAVE_CONFIG_H #include "config.h" #endif -#include "mooedit/moolang-private.h" +#ifndef MOO_USE_SCI +#include "mooedit/native/moolang-private.h" +#endif // !MOO_USE_SCI #include "mooutils/mooi18n.h" #include #include diff --git a/moo/mooedit/moolang.h b/moo/mooedit/native/moolang.h similarity index 100% rename from moo/mooedit/moolang.h rename to moo/mooedit/native/moolang.h diff --git a/moo/mooedit/moolangmgr-private.h b/moo/mooedit/native/moolangmgr-private.h similarity index 94% rename from moo/mooedit/moolangmgr-private.h rename to moo/mooedit/native/moolangmgr-private.h index 02f98797..dc3473f2 100644 --- a/moo/mooedit/moolangmgr-private.h +++ b/moo/mooedit/native/moolangmgr-private.h @@ -16,7 +16,9 @@ #ifndef MOO_LANG_MGR_PRIVATE_H #define MOO_LANG_MGR_PRIVATE_H -#include "mooedit/moolangmgr.h" +#ifndef MOO_USE_SCI +#include "mooedit/native/moolangmgr.h" +#endif // !MOO_USE_SCI #include "mooedit/mooeditconfig.h" #include "gtksourceview/gtksourceview-api.h" diff --git a/moo/mooedit/moolangmgr.cpp b/moo/mooedit/native/moolangmgr.cpp similarity index 99% rename from moo/mooedit/moolangmgr.cpp rename to moo/mooedit/native/moolangmgr.cpp index cdb091ef..1da821bf 100644 --- a/moo/mooedit/moolangmgr.cpp +++ b/moo/mooedit/native/moolangmgr.cpp @@ -16,8 +16,10 @@ #ifdef HAVE_CONFIG_H #include "config.h" #endif -#include "mooedit/moolangmgr-private.h" -#include "mooedit/moolang-private.h" +#ifndef MOO_USE_SCI +#include "mooedit/native/moolang-private.h" +#include "mooedit/native/moolangmgr-private.h" +#endif // !MOO_USE_SCI #include "mooedit/mooeditprefs.h" #include "mooutils/mooutils-misc.h" #include "mooutils/mooutils-fs.h" diff --git a/moo/mooedit/moolangmgr.h b/moo/mooedit/native/moolangmgr.h similarity index 96% rename from moo/mooedit/moolangmgr.h rename to moo/mooedit/native/moolangmgr.h index 9d4f1f16..66f3b13f 100644 --- a/moo/mooedit/moolangmgr.h +++ b/moo/mooedit/native/moolangmgr.h @@ -16,8 +16,10 @@ #ifndef MOO_LANG_MGR_H #define MOO_LANG_MGR_H -#include -#include +#ifndef MOO_USE_SCI +#include "mooedit/native/moolang.h" +#include +#endif // !MOO_USE_SCI #include G_BEGIN_DECLS diff --git a/moo/mooedit/mootextstylescheme.c b/moo/mooedit/native/mootextstylescheme.c similarity index 98% rename from moo/mooedit/mootextstylescheme.c rename to moo/mooedit/native/mootextstylescheme.c index 70c71168..06d83056 100644 --- a/moo/mooedit/mootextstylescheme.c +++ b/moo/mooedit/native/mootextstylescheme.c @@ -13,7 +13,9 @@ * License along with medit. If not, see . */ -#include "mooedit/mootextstylescheme.h" +#ifndef MOO_USE_SCI +#include +#endif // !MOO_USE_SCI #include "mooedit/mootextview.h" #include "mooutils/mooi18n.h" #include "gtksourceview/gtksourceview-api.h" diff --git a/moo/mooedit/mootextstylescheme.h b/moo/mooedit/native/mootextstylescheme.h similarity index 100% rename from moo/mooedit/mootextstylescheme.h rename to moo/mooedit/native/mootextstylescheme.h diff --git a/moo/moolua/moo-lua-api.h b/moo/moolua/moo-lua-api.h index b6adeeeb..ae0aba6c 100644 --- a/moo/moolua/moo-lua-api.h +++ b/moo/moolua/moo-lua-api.h @@ -35,7 +35,9 @@ #include "mooedit/mooeditaction.h" #include "mooedit/mooeditaction-factory.h" #include "mooedit/mootextbuffer.h" -#include "mooedit/moolangmgr.h" +#ifndef MOO_USE_SCI +#include "mooedit/native/moolangmgr.h" +#endif // !MOO_USE_SCI #include "mooedit/mooeditfileinfo.h" #include "mooedit/mooedit-script.h" #include "mooedit/mooedittab.h" diff --git a/moo/plugins/usertools/moooutputfilterregex.cpp b/moo/plugins/usertools/moooutputfilterregex.cpp index fc3e8238..d7e5ff27 100644 --- a/moo/plugins/usertools/moooutputfilterregex.cpp +++ b/moo/plugins/usertools/moooutputfilterregex.cpp @@ -17,7 +17,9 @@ #include "moocommand.h" #include "../support/moocmdview.h" #include "mooedit/mooeditprefs.h" -#include "mooedit/moolangmgr.h" +#ifndef MOO_USE_SCI +#include "mooedit/native/moolangmgr.h" +#endif // !MOO_USE_SCI #include "mooutils/mooutils-gobject.h" #include "mooutils/mooutils-misc.h" #include "mooutils/moomarkup.h"