Makefile and formatting tweaks

This commit is contained in:
Tim Warren 2015-04-23 11:03:50 -04:00
parent 57cafd1fe1
commit a3e7c1b1f0
6 changed files with 36 additions and 33 deletions

View File

@ -52,7 +52,7 @@ build:
@mkdir -p build
sftp_o:
$(CXX) $(CXXFLAGS) $(LDLIBS) -c -o src/network/SFTP.o src/network/SFTP.cpp
$(CXX) -static $(CXXFLAGS) $(LDLIBS) -c -o src/network/SFTP.o src/network/SFTP.cpp
$(TYRO_LIB): build sftp_o
$(TYRO_LIB): OBJECTS += src/network/SFTP.o
@ -105,7 +105,7 @@ Tyro.app: all resources/platform/osx/Info.plist
cp resources/platform/osx/tyro.icns Tyro.app/Contents/Resources/
$(TESTS): $(TYRO_LIB)
$(foreach var, $(TEST_SRC), $(CXX) $(CXXFLAGS) $(var) $(TYRO_LIB) -o $(patsubst %.cpp,%, $(var));)
$(foreach var, $(TEST_SRC), $(CXX) $(CXXFLAGS) $(var) $(TYRO_LIB) $(LDLIBS) -o $(patsubst %.cpp,%, $(var));)
.PHONY: tests
tests: $(TESTS)

View File

@ -45,7 +45,8 @@
"file_pattern": "*.c;*.cc;*.cpp;*.cxx;*.cs;*.h;*.hh;*.hpp;*.hxx;*.xpm",
"keywords": [
"alignof and and_eq bitand bitor break case catch compl const_cast continue default delete do dynamic_cast else false for goto if namespace new not not_eq nullptr operator or or_eq reinterpret_cast return sizeof static_assert static_cast switch this throw true try typedef typeid using while xor xor_eq NULL",
"alignas asm auto bool char char16_t char32_t class const constexpr decltype double enum explicit export extern final float friend inline int long mutable noexcept override private protected public register short signed static struct template thread_local typename union unsigned virtual void volatile wchar_t"
"alignas asm auto bool char char16_t char32_t class const constexpr decltype double enum explicit export extern final float friend inline int long mutable noexcept override private protected public register short signed static struct template thread_local typename union unsigned virtual void volatile wchar_t",
"abstract access author copyright deprecated deprec example exception global ignore internal license link name package param return see since static staticvar subpackage throws todo version"
],
"lexer_map": [
"default", "comment", "comment_line", "comment_doc", "number", "keyword1", "string", "character", "uuid", "preprocessor", "operator", "identifier", "string_eol", "default", "regex", "comment_special", "keyword2", "keyword3", "error"
@ -223,7 +224,7 @@
""
],
"lexer_map": [
"default", "keyword1", "parameter", "keyword2", "identifier", "number", "string_eol", "string", "value", "comment", "label", "default", "default", "default", "script", "default", "default", "default", "default", "value"
"default", "keyword1", "error", "keyword2", "error", "number", "string", "string", "default", "comment", "preprocessor", "keyword1", "keyword3", "keyword3", "keyword4", "keyword5", "keyword6", "preprocessor", "keyword7"
]
},
"yaml": {

View File

@ -48,8 +48,8 @@
"parameter": [0, 43, 54],
"regex": [7, 54, 66],
"uuid": [0, 43, 54],
"value": [7, 54, 66],
"preprocessor": [181, 137, 0],
"value": [0, 43, 54],
"preprocessor": [88, 110, 117],
"script": [88, 110, 117],
"variable": [203, 75, 22],
"error": [220, 50, 47]
@ -59,7 +59,8 @@
"keyword2": true,
"operator": true,
"label": true,
"error": true
"error": true,
"preprocessor": true
},
"italic": {
"error": true

View File

@ -2,7 +2,7 @@
* A common header for global includes
*/
#ifndef TYRO_COMMON_H
#define TYRO_COMMON_H
#define TYRO_COMMON_H
// C++ Standard Lib includes
#include <iostream>

View File

@ -80,6 +80,7 @@ void EditPane::Highlight(wxString filePath)
// Some basic properties to set
this->SetProperty("technology", "2");
this->SetProperty("error.inline", "0");
this->SetProperty("styling.within.preprocessor", "1");
this->SetProperty("font.quality", "3"); // LCD Optimized
// Apply the theme
@ -96,24 +97,25 @@ void EditPane::Highlight(wxString filePath)
this->SetMarginSensitive(MARGIN_FOLD, true);
this->SetMarginMask(MARGIN_FOLD, wxSTC_MASK_FOLDERS);
this->MarkerDefine (wxSTC_MARKNUM_FOLDER, wxSTC_MARK_BOXPLUSCONNECTED, "WHITE", "BLACK");
this->MarkerDefine (wxSTC_MARKNUM_FOLDEROPEN, wxSTC_MARK_BOXMINUSCONNECTED, "WHITE", "BLACK");
this->MarkerDefine (wxSTC_MARKNUM_FOLDERSUB, wxSTC_MARK_VLINE, "BLACK", "BLACK");
this->MarkerDefine (wxSTC_MARKNUM_FOLDEREND, wxSTC_MARK_CIRCLEPLUSCONNECTED, "WHITE", "BLACK");
this->MarkerDefine (wxSTC_MARKNUM_FOLDEROPENMID, wxSTC_MARK_CIRCLEMINUSCONNECTED, "WHITE", "BLACK");
this->MarkerDefine (wxSTC_MARKNUM_FOLDERMIDTAIL, wxSTC_MARK_TCORNER, "BLACK", "BLACK");
this->MarkerDefine (wxSTC_MARKNUM_FOLDERTAIL, wxSTC_MARK_LCORNER, "BLACK", "BLACK");
this->MarkerDefine (wxSTC_MARKNUM_FOLDEROPEN, wxSTC_MARK_BOXMINUSCONNECTED, "WHITE", "BLACK");
this->MarkerDefine (wxSTC_MARKNUM_FOLDERSUB, wxSTC_MARK_VLINE, "BLACK", "BLACK");
this->MarkerDefine (wxSTC_MARKNUM_FOLDEREND, wxSTC_MARK_CIRCLEPLUSCONNECTED, "WHITE", "BLACK");
this->MarkerDefine (wxSTC_MARKNUM_FOLDEROPENMID, wxSTC_MARK_CIRCLEMINUSCONNECTED, "WHITE", "BLACK");
this->MarkerDefine (wxSTC_MARKNUM_FOLDERMIDTAIL, wxSTC_MARK_TCORNER, "BLACK", "BLACK");
this->MarkerDefine (wxSTC_MARKNUM_FOLDERTAIL, wxSTC_MARK_LCORNER, "BLACK", "BLACK");
this->SetLayoutCache (wxSTC_CACHE_CARET);
//this->SetViewWhiteSpace(wxSTC_WS_VISIBLEALWAYS);
this->SetLayoutCache (wxSTC_CACHE_NONE);
this->SetUseHorizontalScrollBar(1);
// set spaces and indention
this->SetTabWidth(4);
this->SetTabWidth(4);
bool use_tabs = (lang != "yaml");
this->SetUseTabs(use_tabs);
this->SetTabIndents(true);
this->SetBackSpaceUnIndents(true);
this->SetUseTabs(use_tabs);
this->SetTabIndents(true);
this->SetBackSpaceUnIndents(true);
}
/**
@ -151,7 +153,12 @@ void EditPane::ApplyTheme(string lang, string theme)
wxLogDebug(output.str().c_str());
}
int offset_count = 0;//(lang == "php") ? 104 : 0;
if (lang == "php")
{
//this->SetLexerLanguage("php");
}
int offset_count = (lang == "php") ? 104 : 0;
// Do the appropriate mappings to load the selected theme
this->_ApplyTheme(lexer_map, offset_count);
@ -268,11 +275,6 @@ bool EditPane::SaveFile(const wxString &filename)
return false;
}
bool EditPane::IsModified()
{
return this->GetModify();
}
/**
* Check that the current file can be opened
*
@ -338,12 +340,12 @@ void EditPane::BindEvents()
void EditPane::OnMarginClick(wxStyledTextEvent& event)
{
if (event.GetMargin() == MARGIN_FOLD) {
int lineClick = this->LineFromPosition (event.GetPosition());
int levelClick = this->GetFoldLevel (lineClick);
if ((levelClick & wxSTC_FOLDLEVELHEADERFLAG) > 0) {
this->ToggleFold (lineClick);
}
}
int lineClick = this->LineFromPosition (event.GetPosition());
int levelClick = this->GetFoldLevel (lineClick);
if ((levelClick & wxSTC_FOLDLEVELHEADERFLAG) > 0) {
this->ToggleFold (lineClick);
}
}
}
/**

View File

@ -27,7 +27,6 @@ public:
void Highlight(wxString filePath);
bool SaveFile();
bool SaveFile(const wxString &filename);
bool IsModified();
void ApplyTheme(string lang, string theme="Solarized");
private:
StringConstMap lexerMap;