mirror of
https://github.com/SpartanJ/eepp.git
synced 2026-07-16 15:52:55 +03:00
eepp: Pump version.
ecode: Added version number and Help menu. Moved all project source files into the "ecode" namespace.
This commit is contained in:
@@ -219,7 +219,7 @@ class EE_API Node : public Transformable {
|
||||
|
||||
void childsCloseAll();
|
||||
|
||||
std::string getId() const;
|
||||
const std::string& getId() const;
|
||||
|
||||
virtual Node* setId( const std::string& id );
|
||||
|
||||
|
||||
@@ -5,9 +5,9 @@
|
||||
#include <string>
|
||||
|
||||
#define EEPP_MAJOR_VERSION 2
|
||||
#define EEPP_MINOR_VERSION 3
|
||||
#define EEPP_MINOR_VERSION 4
|
||||
#define EEPP_PATCH_LEVEL 0
|
||||
#define EEPP_CODENAME "Anāgāmin"
|
||||
#define EEPP_CODENAME "Vimuttimagga"
|
||||
|
||||
/** The compiled version of the library */
|
||||
#define EEPP_VERSION( x ) \
|
||||
@@ -45,7 +45,10 @@ class EE_API Version {
|
||||
static std::string getCodename();
|
||||
|
||||
/** @return The build time of the library */
|
||||
static std::string getBuildTime();
|
||||
|
||||
static inline std::string getBuildTime() {
|
||||
return std::string( __DATE__ ) + " " + std::string( __TIME__ );
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace EE
|
||||
|
||||
@@ -1129,6 +1129,8 @@
|
||||
../../src/tools/ecode/uicodeeditorsplitter.hpp
|
||||
../../src/tools/ecode/uitreeviewglobalsearch.cpp
|
||||
../../src/tools/ecode/uitreeviewglobalsearch.hpp
|
||||
../../src/tools/ecode/version.cpp
|
||||
../../src/tools/ecode/version.hpp
|
||||
../../src/tools/ecode/widgetcommandexecuter.hpp
|
||||
../../src/tools/mapeditor/mapeditor.cpp
|
||||
../../src/tools/textureatlaseditor/textureatlaseditor.cpp
|
||||
|
||||
@@ -23,8 +23,4 @@ std::string Version::getCodename() {
|
||||
return std::string( EEPP_CODENAME );
|
||||
}
|
||||
|
||||
std::string Version::getBuildTime() {
|
||||
return std::string( __DATE__ ) + " " + std::string( __TIME__ );
|
||||
}
|
||||
|
||||
} // namespace EE
|
||||
|
||||
@@ -705,7 +705,7 @@ void Node::childsCloseAll() {
|
||||
writeNodeFlag( NODE_FLAG_CLOSING_CHILDREN, 0 );
|
||||
}
|
||||
|
||||
std::string Node::getId() const {
|
||||
const std::string& Node::getId() const {
|
||||
return mId;
|
||||
}
|
||||
|
||||
|
||||
@@ -8,6 +8,8 @@
|
||||
using namespace EE::Network;
|
||||
using json = nlohmann::json;
|
||||
|
||||
namespace ecode {
|
||||
|
||||
static PanelPosition panelPositionFromString( const std::string& str ) {
|
||||
if ( String::toLower( str ) == "right" )
|
||||
return PanelPosition::Right;
|
||||
@@ -389,3 +391,5 @@ void AppConfig::loadProject( std::string projectFolder, UICodeEditorSplitter* ed
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#ifndef APPCONFIG_HPP
|
||||
#define APPCONFIG_HPP
|
||||
#ifndef ECODE_APPCONFIG_HPP
|
||||
#define ECODE_APPCONFIG_HPP
|
||||
|
||||
#include "widgetcommandexecuter.hpp"
|
||||
#include <eepp/config.hpp>
|
||||
@@ -17,6 +17,8 @@ using namespace EE::UI::Tools;
|
||||
using namespace EE::System;
|
||||
using namespace EE::Window;
|
||||
|
||||
namespace ecode {
|
||||
|
||||
enum class PanelPosition { Left, Right };
|
||||
|
||||
struct UIConfig {
|
||||
@@ -125,4 +127,6 @@ struct AppConfig {
|
||||
std::shared_ptr<ThreadPool> pool );
|
||||
};
|
||||
|
||||
#endif // APPCONFIG_HPP
|
||||
} // namespace ecode
|
||||
|
||||
#endif // ECODE_APPCONFIG_HPP
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
#include "docsearchcontroller.hpp"
|
||||
#include "ecode.hpp"
|
||||
|
||||
namespace ecode {
|
||||
|
||||
DocSearchController::DocSearchController( UICodeEditorSplitter* editorSplitter, App* app ) :
|
||||
mEditorSplitter( editorSplitter ), mApp( app ) {}
|
||||
|
||||
@@ -369,3 +371,5 @@ SearchBarConfig DocSearchController::getSearchBarConfig() const {
|
||||
searchBarConfig.escapeSequence = escapeSequenceChk->isChecked();
|
||||
return searchBarConfig;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
#ifndef DOCSEARCHCONTROLLER_HPP
|
||||
#define DOCSEARCHCONTROLLER_HPP
|
||||
#ifndef ECODE_DOCSEARCHCONTROLLER_HPP
|
||||
#define ECODE_DOCSEARCHCONTROLLER_HPP
|
||||
|
||||
#include "appconfig.hpp"
|
||||
#include <eepp/ee.hpp>
|
||||
|
||||
namespace ecode {
|
||||
|
||||
struct SearchState {
|
||||
UICodeEditor* editor{ nullptr };
|
||||
String text;
|
||||
@@ -35,8 +37,7 @@ class DocSearchController {
|
||||
DocSearchController( UICodeEditorSplitter*, App* app );
|
||||
|
||||
void initSearchBar(
|
||||
UISearchBar* searchBar,
|
||||
const SearchBarConfig& searchBarConfig,
|
||||
UISearchBar* searchBar, const SearchBarConfig& searchBarConfig,
|
||||
std::unordered_map<std::string, std::string> keybindings = getDefaultKeybindings() );
|
||||
|
||||
void showFindView();
|
||||
@@ -67,4 +68,6 @@ class DocSearchController {
|
||||
String mLastSearch;
|
||||
};
|
||||
|
||||
#endif // DOCSEARCHCONTROLLER_HPP
|
||||
} // namespace ecode
|
||||
|
||||
#endif // ECODE_DOCSEARCHCONTROLLER_HPP
|
||||
|
||||
@@ -2,9 +2,12 @@
|
||||
#include "plugins/autocomplete/autocompleteplugin.hpp"
|
||||
#include "plugins/formatter/formatterplugin.hpp"
|
||||
#include "plugins/linter/linterplugin.hpp"
|
||||
#include "version.hpp"
|
||||
#include <algorithm>
|
||||
#include <args/args.hxx>
|
||||
|
||||
namespace ecode {
|
||||
|
||||
Clock globalClock;
|
||||
bool firstFrame = true;
|
||||
App* appInstance = nullptr;
|
||||
@@ -568,6 +571,27 @@ void App::setUIColorScheme( const ColorSchemePreference& colorScheme ) {
|
||||
mUISceneNode->setColorSchemePreference( colorScheme );
|
||||
}
|
||||
|
||||
UIMenu* App::createHelpMenu() {
|
||||
UIPopUpMenu* helpMenu = UIPopUpMenu::New();
|
||||
helpMenu->add( i18n( "ecode_source", "ecode source code..." ), findIcon( "github" ) )
|
||||
->setId( "ecode_source" );
|
||||
helpMenu->add( i18n( "about_ecode", "About ecode..." ) )->setId( "about_ecode" );
|
||||
helpMenu->addEventListener( Event::OnItemClicked, [&]( const Event* event ) {
|
||||
const std::string& id = event->getNode()->getId();
|
||||
|
||||
if ( "ecode_source" == id ) {
|
||||
Engine::instance()->openURL( "https://github.com/SpartanJ/ecode" );
|
||||
} else if ( "about_ecode" == id ) {
|
||||
String msg( ecode::Version::getVersionName() +
|
||||
" (codename: \"" + ecode::Version::getCodename() + "\")" );
|
||||
UIMessageBox* msgBox = UIMessageBox::New( UIMessageBox::OK, msg );
|
||||
msgBox->setTitle( i18n( "about_ecode", "About ecode..." ) );
|
||||
msgBox->show();
|
||||
}
|
||||
} );
|
||||
return helpMenu;
|
||||
}
|
||||
|
||||
UIMenu* App::createWindowMenu() {
|
||||
mWindowMenu = UIPopUpMenu::New();
|
||||
UIPopUpMenu* colorsMenu = UIPopUpMenu::New();
|
||||
@@ -2246,6 +2270,7 @@ void App::createSettingsMenu() {
|
||||
mSettingsMenu->addSubMenu( "View", nullptr, createViewMenu() );
|
||||
mSettingsMenu->addSubMenu( "Tools", nullptr, createToolsMenu() );
|
||||
mSettingsMenu->addSubMenu( "Window", nullptr, createWindowMenu() );
|
||||
mSettingsMenu->addSubMenu( "Help", findIcon( "help" ), createHelpMenu() );
|
||||
mSettingsMenu->addSeparator();
|
||||
mSettingsMenu->add( "Close", findIcon( "document-close" ), getKeybind( "close-doc" ) );
|
||||
mSettingsMenu->add( "Close Folder", findIcon( "document-close" ),
|
||||
@@ -2804,6 +2829,9 @@ void App::init( std::string file, const Float& pidelDensity, const std::string&
|
||||
contextSettings.SharedGLContext = true;
|
||||
mWindow = engine->createWindow( winSettings, contextSettings );
|
||||
|
||||
Log::info( "%s (codename: \"%s\") initializing", ecode::Version::getVersionName().c_str(),
|
||||
ecode::Version::getCodename().c_str() );
|
||||
|
||||
if ( mWindow->isOpen() ) {
|
||||
Log::info( "Window creation took: %.2fms", globalClock.getElapsedTime().asMilliseconds() );
|
||||
|
||||
@@ -3125,6 +3153,7 @@ void App::init( std::string file, const Float& pidelDensity, const std::string&
|
||||
{ "color-scheme", 0xebd4 },
|
||||
{ "global-settings", 0xedcf },
|
||||
{ "folder-user", 0xed84 },
|
||||
{ "help", 0xf045 },
|
||||
};
|
||||
for ( const auto& icon : icons )
|
||||
iconTheme->add( UIGlyphIcon::New( icon.first, iconFont, icon.second ) );
|
||||
@@ -3161,7 +3190,7 @@ void App::init( std::string file, const Float& pidelDensity, const std::string&
|
||||
{ "filetype-dockerfile", 61758 }, { "file", 61766 },
|
||||
{ "file-symlink", 61774 }, { "folder", 0xF23B },
|
||||
{ "folder-open", 0xF23C }, { "tree-expanded", 0xF11E },
|
||||
{ "tree-contracted", 0xF120 },
|
||||
{ "tree-contracted", 0xF120 }, { "github", 0xF184 },
|
||||
};
|
||||
for ( const auto& icon : mimeIcons )
|
||||
iconTheme->add( UIGlyphIcon::New( icon.first, mimeIconFont, icon.second ) );
|
||||
@@ -3313,3 +3342,5 @@ EE_MAIN_FUNC int main( int argc, char* argv[] ) {
|
||||
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
||||
} // namespace ecode
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#ifndef EE_TOOLS_CODEEDITOR_HPP
|
||||
#define EE_TOOLS_CODEEDITOR_HPP
|
||||
#ifndef ECODE_HPP
|
||||
#define ECODE_HPP
|
||||
|
||||
#include "appconfig.hpp"
|
||||
#include "docsearchcontroller.hpp"
|
||||
@@ -14,6 +14,8 @@
|
||||
#include <eepp/ee.hpp>
|
||||
#include <efsw/efsw.hpp>
|
||||
|
||||
namespace ecode {
|
||||
|
||||
class AutoCompletePlugin;
|
||||
class LinterPlugin;
|
||||
class FormatterPlugin;
|
||||
@@ -194,6 +196,8 @@ class App : public UICodeEditorSplitter::Client {
|
||||
|
||||
UIMenu* createWindowMenu();
|
||||
|
||||
UIMenu* createHelpMenu();
|
||||
|
||||
Drawable* findIcon( const std::string& name );
|
||||
|
||||
String i18n( const std::string& key, const String& def );
|
||||
@@ -268,4 +272,6 @@ class App : public UICodeEditorSplitter::Client {
|
||||
void setUIColorScheme( const ColorSchemePreference& colorScheme );
|
||||
};
|
||||
|
||||
#endif // EE_TOOLS_CODEEDITOR_HPP
|
||||
} // namespace ecode
|
||||
|
||||
#endif // ECODE_HPP
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
#include "filelocator.hpp"
|
||||
#include "ecode.hpp"
|
||||
|
||||
namespace ecode {
|
||||
|
||||
static int LOCATEBAR_MAX_VISIBLE_ITEMS = 18;
|
||||
static int LOCATEBAR_MAX_RESULTS = 100;
|
||||
|
||||
@@ -145,3 +147,5 @@ void FileLocator::showLocateBar() {
|
||||
}
|
||||
updateLocateBar();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
#ifndef FILELOCATOR_HPP
|
||||
#define FILELOCATOR_HPP
|
||||
#ifndef ECODE_FILELOCATOR_HPP
|
||||
#define ECODE_FILELOCATOR_HPP
|
||||
|
||||
#include "widgetcommandexecuter.hpp"
|
||||
#include <eepp/ee.hpp>
|
||||
|
||||
namespace ecode {
|
||||
|
||||
class App;
|
||||
|
||||
class FileLocator {
|
||||
@@ -31,4 +33,6 @@ class FileLocator {
|
||||
void updateLocateBar();
|
||||
};
|
||||
|
||||
#endif // FILELOCATOR_HPP
|
||||
} // namespace ecode
|
||||
|
||||
#endif // ECODE_FILELOCATOR_HPP
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
#include "filesystemlistener.hpp"
|
||||
|
||||
namespace ecode {
|
||||
|
||||
FileSystemListener::FileSystemListener( UICodeEditorSplitter* splitter,
|
||||
std::shared_ptr<FileSystemModel> fileSystemModel ) :
|
||||
mSplitter( splitter ), mFileSystemModel( fileSystemModel ) {}
|
||||
@@ -76,3 +78,5 @@ void FileSystemListener::notifyMove( const FileInfo& oldFile, const FileInfo& ne
|
||||
doc.notifyDocumentMoved( newFile.getFilepath() );
|
||||
} );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#ifndef FILESYSTEMLISTENER_HPP
|
||||
#define FILESYSTEMLISTENER_HPP
|
||||
#ifndef ECODE_FILESYSTEMLISTENER_HPP
|
||||
#define ECODE_FILESYSTEMLISTENER_HPP
|
||||
|
||||
#include "projectdirectorytree.hpp"
|
||||
#include <eepp/system/fileinfo.hpp>
|
||||
@@ -13,6 +13,8 @@ using namespace EE::UI;
|
||||
using namespace EE::UI::Models;
|
||||
using namespace EE::UI::Tools;
|
||||
|
||||
namespace ecode {
|
||||
|
||||
class FileSystemListener : public efsw::FileWatchListener {
|
||||
public:
|
||||
FileSystemListener( UICodeEditorSplitter* codeSplitter,
|
||||
@@ -39,4 +41,6 @@ class FileSystemListener : public efsw::FileWatchListener {
|
||||
void notifyMove( const FileInfo& oldFile, const FileInfo& newFile );
|
||||
};
|
||||
|
||||
#endif // FILESYSTEMLISTENER_HPP
|
||||
} // namespace ecode
|
||||
|
||||
#endif // ECODE_FILESYSTEMLISTENER_HPP
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
#include "ecode.hpp"
|
||||
#include "uitreeviewglobalsearch.hpp"
|
||||
|
||||
namespace ecode {
|
||||
static int LOCATEBAR_MAX_VISIBLE_ITEMS = 18;
|
||||
|
||||
GlobalSearchController::GlobalSearchController( UICodeEditorSplitter* editorSplitter,
|
||||
@@ -531,3 +532,5 @@ void GlobalSearchController::initGlobalSearchTree( UITreeViewGlobalSearch* searc
|
||||
}
|
||||
} );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,13 +1,15 @@
|
||||
#ifndef GLOBALSEARCHCONTROLLER_HPP
|
||||
#define GLOBALSEARCHCONTROLLER_HPP
|
||||
#ifndef ECODE_GLOBALSEARCHCONTROLLER_HPP
|
||||
#define ECODE_GLOBALSEARCHCONTROLLER_HPP
|
||||
|
||||
#include "appconfig.hpp"
|
||||
#include "projectsearch.hpp"
|
||||
#include <eepp/ee.hpp>
|
||||
|
||||
class App;
|
||||
namespace ecode {
|
||||
|
||||
class UIGlobalSearchBar;
|
||||
class UITreeViewGlobalSearch;
|
||||
class App;
|
||||
|
||||
class GlobalSearchController {
|
||||
public:
|
||||
@@ -77,4 +79,6 @@ class GlobalSearchController {
|
||||
void onLoadDone( const Variant& lineNum, const Variant& colNum );
|
||||
};
|
||||
|
||||
#endif // GLOBALSEARCHCONTROLLER_HPP
|
||||
} // namespace ecode
|
||||
|
||||
#endif // ECODE_GLOBALSEARCHCONTROLLER_HPP
|
||||
|
||||
@@ -2,6 +2,8 @@
|
||||
#include <eepp/core/string.hpp>
|
||||
#include <eepp/system/filesystem.hpp>
|
||||
|
||||
namespace ecode {
|
||||
|
||||
// Author: Robert A. van Engelen, engelen@genivia.com
|
||||
// Date: August 5, 2019
|
||||
// License: The Code Project Open License (CPOL)
|
||||
@@ -214,3 +216,5 @@ const std::string& IgnoreMatcherManager::getPath() const {
|
||||
eeASSERT( foundMatch() );
|
||||
return mMatcher->getPath();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#ifndef EE_TOOLS_IGNOREMATCHER_HPP
|
||||
#define EE_TOOLS_IGNOREMATCHER_HPP
|
||||
#ifndef ECODE_IGNOREMATCHER_HPP
|
||||
#define ECODE_IGNOREMATCHER_HPP
|
||||
|
||||
#include <eepp/system/filesystem.hpp>
|
||||
#include <memory>
|
||||
@@ -9,6 +9,8 @@
|
||||
using namespace EE;
|
||||
using namespace EE::System;
|
||||
|
||||
namespace ecode {
|
||||
|
||||
class IgnoreMatcher {
|
||||
public:
|
||||
IgnoreMatcher( const std::string& rootPath );
|
||||
@@ -56,4 +58,6 @@ class IgnoreMatcherManager {
|
||||
std::unique_ptr<IgnoreMatcher> mMatcher;
|
||||
};
|
||||
|
||||
#endif // EE_TOOLS_IGNOREMATCHER_HPP
|
||||
} // namespace ecode
|
||||
|
||||
#endif // ECODE_IGNOREMATCHER_HPP
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
#include "notificationcenter.hpp"
|
||||
|
||||
namespace ecode {
|
||||
|
||||
NotificationCenter::NotificationCenter( UILayout* layout ) : mLayout( layout ) {}
|
||||
|
||||
UITextView* NotificationCenter::addNotification( const String& text ) {
|
||||
@@ -20,3 +22,5 @@ UITextView* NotificationCenter::addNotification( const String& text ) {
|
||||
tv->runAction( sequence );
|
||||
return tv;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
#ifndef NOTIFICATIONCENTER_HPP
|
||||
#define NOTIFICATIONCENTER_HPP
|
||||
#ifndef ECODE_NOTIFICATIONCENTER_HPP
|
||||
#define ECODE_NOTIFICATIONCENTER_HPP
|
||||
|
||||
#include <eepp/ee.hpp>
|
||||
|
||||
namespace ecode {
|
||||
|
||||
class NotificationCenter {
|
||||
public:
|
||||
NotificationCenter( UILayout* layout );
|
||||
@@ -13,4 +15,6 @@ class NotificationCenter {
|
||||
UILayout* mLayout{ nullptr };
|
||||
};
|
||||
|
||||
#endif // NOTIFICATIONCENTER_HPP
|
||||
} // namespace ecode
|
||||
|
||||
#endif // ECODE_NOTIFICATIONCENTER_HPP
|
||||
|
||||
@@ -7,6 +7,8 @@
|
||||
using namespace EE::Graphics;
|
||||
using namespace EE::System;
|
||||
|
||||
namespace ecode {
|
||||
|
||||
#if EE_PLATFORM != EE_PLATFORM_EMSCRIPTEN || defined( __EMSCRIPTEN_PTHREADS__ )
|
||||
#define AUTO_COMPLETE_THREADED 1
|
||||
#else
|
||||
@@ -475,3 +477,5 @@ void AutoCompletePlugin::updateSuggestions( const std::string& symbol, UICodeEdi
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#ifndef AUTOCOMPLETEPLUGIN_HPP
|
||||
#define AUTOCOMPLETEPLUGIN_HPP
|
||||
#ifndef ECODE_AUTOCOMPLETEPLUGIN_HPP
|
||||
#define ECODE_AUTOCOMPLETEPLUGIN_HPP
|
||||
|
||||
#include <eepp/config.hpp>
|
||||
#include <eepp/system/clock.hpp>
|
||||
@@ -12,6 +12,8 @@ using namespace EE;
|
||||
using namespace EE::System;
|
||||
using namespace EE::UI;
|
||||
|
||||
namespace ecode {
|
||||
|
||||
class AutoCompletePlugin : public UICodeEditorPlugin {
|
||||
public:
|
||||
typedef std::unordered_set<std::string> SymbolsList;
|
||||
@@ -112,4 +114,6 @@ class AutoCompletePlugin : public UICodeEditorPlugin {
|
||||
void pickSuggestion( UICodeEditor* editor );
|
||||
};
|
||||
|
||||
#endif // AUTOCOMPLETEPLUGIN_HPP
|
||||
}
|
||||
|
||||
#endif // ECODE_AUTOCOMPLETEPLUGIN_HPP
|
||||
|
||||
@@ -8,6 +8,8 @@
|
||||
|
||||
using json = nlohmann::json;
|
||||
|
||||
namespace ecode {
|
||||
|
||||
#if EE_PLATFORM != EE_PLATFORM_EMSCRIPTEN || defined( __EMSCRIPTEN_PTHREADS__ )
|
||||
#define FORMATTER_THREADED 1
|
||||
#else
|
||||
@@ -206,3 +208,5 @@ FormatterPlugin::Formatter FormatterPlugin::supportsFormatter( std::shared_ptr<T
|
||||
}
|
||||
return {};
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#ifndef FORMATTERPLUGIN_HPP
|
||||
#define FORMATTERPLUGIN_HPP
|
||||
#ifndef ECODE_FORMATTERPLUGIN_HPP
|
||||
#define ECODE_FORMATTERPLUGIN_HPP
|
||||
|
||||
#include <eepp/config.hpp>
|
||||
#include <eepp/system/mutex.hpp>
|
||||
@@ -10,6 +10,8 @@ using namespace EE;
|
||||
using namespace EE::System;
|
||||
using namespace EE::UI;
|
||||
|
||||
namespace ecode {
|
||||
|
||||
class FormatterPlugin : public UICodeEditorPlugin {
|
||||
public:
|
||||
FormatterPlugin( const std::string& formatterPath, std::shared_ptr<ThreadPool> pool );
|
||||
@@ -54,4 +56,6 @@ class FormatterPlugin : public UICodeEditorPlugin {
|
||||
FormatterPlugin::Formatter supportsFormatter( std::shared_ptr<TextDocument> doc );
|
||||
};
|
||||
|
||||
#endif // FORMATTERPLUGIN_HPP
|
||||
}
|
||||
|
||||
#endif // ECODE_FORMATTERPLUGIN_HPP
|
||||
|
||||
@@ -11,6 +11,8 @@
|
||||
|
||||
using json = nlohmann::json;
|
||||
|
||||
namespace ecode {
|
||||
|
||||
#if EE_PLATFORM != EE_PLATFORM_EMSCRIPTEN || defined( __EMSCRIPTEN_PTHREADS__ )
|
||||
#define LINTER_THREADED 1
|
||||
#else
|
||||
@@ -497,3 +499,5 @@ void LinterPlugin::invalidateEditors( TextDocument* doc ) {
|
||||
it.first->invalidateDraw();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#ifndef LINTERPLUGIN_HPP
|
||||
#define LINTERPLUGIN_HPP
|
||||
#ifndef ECODE_LINTERPLUGIN_HPP
|
||||
#define ECODE_LINTERPLUGIN_HPP
|
||||
|
||||
#include <eepp/config.hpp>
|
||||
#include <eepp/system/mutex.hpp>
|
||||
@@ -10,6 +10,8 @@ using namespace EE;
|
||||
using namespace EE::System;
|
||||
using namespace EE::UI;
|
||||
|
||||
namespace ecode {
|
||||
|
||||
enum class LinterType { Notice, Warning, Error };
|
||||
|
||||
struct Linter {
|
||||
@@ -101,4 +103,6 @@ class LinterPlugin : public UICodeEditorPlugin {
|
||||
std::string getMatchString( const LinterType& type );
|
||||
};
|
||||
|
||||
#endif // LINTERPLUGIN_HPP
|
||||
}
|
||||
|
||||
#endif // ECODE_LINTERPLUGIN_HPP
|
||||
|
||||
@@ -2,6 +2,8 @@
|
||||
#include <algorithm>
|
||||
#include <eepp/system/filesystem.hpp>
|
||||
|
||||
namespace ecode {
|
||||
|
||||
ProjectDirectoryTree::ProjectDirectoryTree( const std::string& path,
|
||||
std::shared_ptr<ThreadPool> threadPool ) :
|
||||
mPath( path ), mPool( threadPool ), mIsReady( false ), mIgnoreMatcher( path ) {
|
||||
@@ -348,3 +350,5 @@ size_t ProjectDirectoryTree::findFileIndex( const std::string& path ) {
|
||||
}
|
||||
return std::string::npos;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#ifndef EE_TOOLS_PROJECTDIRECTORYTREE_HPP
|
||||
#define EE_TOOLS_PROJECTDIRECTORYTREE_HPP
|
||||
#ifndef ECODE_PROJECTDIRECTORYTREE_HPP
|
||||
#define ECODE_PROJECTDIRECTORYTREE_HPP
|
||||
|
||||
#include "ignorematcher.hpp"
|
||||
#include <eepp/system/luapattern.hpp>
|
||||
@@ -16,6 +16,8 @@ using namespace EE;
|
||||
using namespace EE::System;
|
||||
using namespace EE::UI::Models;
|
||||
|
||||
namespace ecode {
|
||||
|
||||
class FileListModel : public Model {
|
||||
public:
|
||||
FileListModel( const std::vector<std::string>& files, const std::vector<std::string>& names ) :
|
||||
@@ -121,4 +123,6 @@ class ProjectDirectoryTree {
|
||||
size_t findFileIndex( const std::string& path );
|
||||
};
|
||||
|
||||
#endif // EE_TOOLS_PROJECTDIRECTORYTREE_HPP
|
||||
}
|
||||
|
||||
#endif // ECODE_PROJECTDIRECTORYTREE_HPP
|
||||
|
||||
@@ -2,6 +2,8 @@
|
||||
#include <eepp/system/filesystem.hpp>
|
||||
#include <eepp/system/luapattern.hpp>
|
||||
|
||||
namespace ecode {
|
||||
|
||||
static int countNewLines( const std::string& text, const size_t& start, const size_t& end ) {
|
||||
const char* startPtr = text.c_str() + start;
|
||||
const char* endPtr = text.c_str() + end;
|
||||
@@ -185,3 +187,5 @@ void ProjectSearch::find( const std::vector<std::string> files, std::string stri
|
||||
} );
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#ifndef PROJECTSEARCH_HPP
|
||||
#define PROJECTSEARCH_HPP
|
||||
#ifndef ECODE_PROJECTSEARCH_HPP
|
||||
#define ECODE_PROJECTSEARCH_HPP
|
||||
|
||||
#include <eepp/core/string.hpp>
|
||||
#include <eepp/system/threadpool.hpp>
|
||||
@@ -14,6 +14,8 @@ using namespace EE::System;
|
||||
using namespace EE::UI::Doc;
|
||||
using namespace EE::UI::Models;
|
||||
|
||||
namespace ecode {
|
||||
|
||||
class ProjectSearch {
|
||||
public:
|
||||
struct ResultData {
|
||||
@@ -203,4 +205,6 @@ class ProjectSearch {
|
||||
const TextDocument::FindReplaceType& type = TextDocument::FindReplaceType::Normal );
|
||||
};
|
||||
|
||||
#endif // PROJECTSEARCH_HPP
|
||||
} // namespace ecode
|
||||
|
||||
#endif // ECODE_PROJECTSEARCH_HPP
|
||||
|
||||
@@ -7,6 +7,8 @@
|
||||
#include <eepp/ui/uiscenenode.hpp>
|
||||
#include <eepp/ui/uistyle.hpp>
|
||||
|
||||
namespace ecode {
|
||||
|
||||
UITreeViewGlobalSearch::UITreeViewGlobalSearch( const SyntaxColorScheme& colorScheme,
|
||||
bool searchReplace ) :
|
||||
UITreeView(), mColorScheme( colorScheme ), mSearchReplace( searchReplace ) {
|
||||
@@ -221,3 +223,5 @@ void UITreeViewCellGlobalSearch::updateCell( Model* ) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#ifndef UITREEVIEWGLOBALSEARCH_HPP
|
||||
#define UITREEVIEWGLOBALSEARCH_HPP
|
||||
#ifndef ECODE_UITREEVIEWGLOBALSEARCH_HPP
|
||||
#define ECODE_UITREEVIEWGLOBALSEARCH_HPP
|
||||
|
||||
#include "projectsearch.hpp"
|
||||
#include <eepp/ui/doc/syntaxcolorscheme.hpp>
|
||||
@@ -8,6 +8,8 @@
|
||||
using namespace EE::UI;
|
||||
using namespace EE::UI::Doc;
|
||||
|
||||
namespace ecode {
|
||||
|
||||
class UITreeViewCellGlobalSearch : public UITreeViewCell {
|
||||
public:
|
||||
static UITreeViewCellGlobalSearch* New( bool selectionEnabled ) {
|
||||
@@ -66,7 +68,8 @@ class UITreeViewGlobalSearch : public UITreeView {
|
||||
bool mSearchReplace{ false };
|
||||
|
||||
virtual Uint32 onKeyDown( const KeyEvent& event );
|
||||
|
||||
};
|
||||
|
||||
#endif // UITREEVIEWGLOBALSEARCH_HPP
|
||||
} // namespace ecode
|
||||
|
||||
#endif // ECODE_UITREEVIEWGLOBALSEARCH_HPP
|
||||
|
||||
26
src/tools/ecode/version.cpp
Normal file
26
src/tools/ecode/version.cpp
Normal file
@@ -0,0 +1,26 @@
|
||||
#include "version.hpp"
|
||||
#include <eepp/core/string.hpp>
|
||||
|
||||
namespace ecode {
|
||||
|
||||
Version Version::getVersion() {
|
||||
Version ver;
|
||||
ECODE_VERSION( &ver );
|
||||
return ver;
|
||||
}
|
||||
|
||||
Uint32 Version::getVersionNum() {
|
||||
Version ver = getVersion();
|
||||
return ECODE_VERSIONNUM( ver.major, ver.minor, ver.patch );
|
||||
}
|
||||
|
||||
std::string Version::getVersionName() {
|
||||
Version ver = getVersion();
|
||||
return String::format( "ecode version %d.%d.%d", ver.major, ver.minor, ver.patch );
|
||||
}
|
||||
|
||||
std::string Version::getCodename() {
|
||||
return std::string( ECODE_CODENAME );
|
||||
}
|
||||
|
||||
} // namespace ecode
|
||||
58
src/tools/ecode/version.hpp
Normal file
58
src/tools/ecode/version.hpp
Normal file
@@ -0,0 +1,58 @@
|
||||
#ifndef ECODE_VERSION_HPP
|
||||
#define ECODE_VERSION_HPP
|
||||
|
||||
#include <eepp/config.hpp>
|
||||
#include <string>
|
||||
|
||||
using namespace EE;
|
||||
|
||||
#define ECODE_MAJOR_VERSION 0
|
||||
#define ECODE_MINOR_VERSION 1
|
||||
#define ECODE_PATCH_LEVEL 0
|
||||
#define ECODE_CODENAME "Viriya"
|
||||
|
||||
/** The compiled version of the library */
|
||||
#define ECODE_VERSION( x ) \
|
||||
{ \
|
||||
( x )->major = ECODE_MAJOR_VERSION; \
|
||||
( x )->minor = ECODE_MINOR_VERSION; \
|
||||
( x )->patch = ECODE_PATCH_LEVEL; \
|
||||
}
|
||||
|
||||
#define ECODE_VERSIONNUM( X, Y, Z ) ( (X)*1000 + (Y)*100 + ( Z ) )
|
||||
|
||||
#define ECODE_COMPILEDVERSION \
|
||||
ECODE_VERSIONNUM( ECODE_MAJOR_VERSION, ECODE_MINOR_VERSION, ECODE_PATCH_LEVEL )
|
||||
|
||||
#define ECODE_VERSION_ATLEAST( X, Y, Z ) ( ECODE_COMPILEDVERSION >= ECODE_VERSIONNUM( X, Y, Z ) )
|
||||
|
||||
namespace ecode {
|
||||
|
||||
class Version {
|
||||
public:
|
||||
Uint8 major; /**< major version */
|
||||
Uint8 minor; /**< minor version */
|
||||
Uint8 patch; /**< update version */
|
||||
|
||||
/** @return The linked version of the library */
|
||||
static Version getVersion();
|
||||
|
||||
/** @return The linked version number of the library */
|
||||
static Uint32 getVersionNum();
|
||||
|
||||
/** @return The library version name: "eepp version major.minor.patch" */
|
||||
static std::string getVersionName();
|
||||
|
||||
/** @return The version codename */
|
||||
static std::string getCodename();
|
||||
|
||||
/** @return The build time of the library */
|
||||
|
||||
static inline std::string getBuildTime() {
|
||||
return std::string( __DATE__ ) + " " + std::string( __TIME__ );
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace ecode
|
||||
|
||||
#endif
|
||||
@@ -1,8 +1,10 @@
|
||||
#ifndef WIDGETCOMMANDEXECUTER_HPP
|
||||
#define WIDGETCOMMANDEXECUTER_HPP
|
||||
#ifndef ECODE_WIDGETCOMMANDEXECUTER_HPP
|
||||
#define ECODE_WIDGETCOMMANDEXECUTER_HPP
|
||||
|
||||
#include <eepp/ee.hpp>
|
||||
|
||||
namespace ecode {
|
||||
|
||||
class WidgetCommandExecuter {
|
||||
public:
|
||||
typedef std::function<void()> CommandCallback;
|
||||
@@ -75,4 +77,6 @@ class UIGlobalSearchBar : public UILinearLayout, public WidgetCommandExecuter {
|
||||
}
|
||||
};
|
||||
|
||||
#endif // WIDGETCOMMANDEXECUTER_HPP
|
||||
} // namespace ecode
|
||||
|
||||
#endif // ECODE_WIDGETCOMMANDEXECUTER_HPP
|
||||
|
||||
Reference in New Issue
Block a user