From 1532613c089fe69c1265fc087022dc0774203fda Mon Sep 17 00:00:00 2001 From: Tim Warren Date: Wed, 22 Apr 2015 10:09:43 -0400 Subject: [PATCH] Miscellaneous twiddling --- Makefile | 27 ++++++++++------ src/TyroApp.cpp | 20 ++++++++++-- src/TyroApp.h | 27 ---------------- src/definitions.h | 71 ++++++++++++++++++++--------------------- src/widgets/MainFrame.h | 1 - 5 files changed, 68 insertions(+), 78 deletions(-) delete mode 100644 src/TyroApp.h diff --git a/Makefile b/Makefile index 913d0b5..2668d25 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,7 @@ #Try using clang, if it's installed -ifneq ($(shell command -v clang),) +ifneq (command -v clang,) CC = clang - CXX = clang++ -std=c++98 + CXX = clang++ endif CXX += -Iinclude @@ -31,8 +31,11 @@ TESTS = $(patsubst %.cpp,%,$(TEST_SRC)) OS ?= $(shell uname -s) ifeq ($(OS),Darwin) - CXX += -mmacosx-version-min=10.5 + CXX += -std=c++98 -mmacosx-version-min=10.5 +else + CXX += -std=c++11 endif + ifeq ($(OS),Windows_NT) LDLIBS += -L/lib endif @@ -64,26 +67,30 @@ $(PROGRAM): run: ./build/Tyro -release: + +run-grind: + valgrind ./build/Tryo + +# Make optimized and striped executable +release: all + strip -SXx $(PROGRAM) ifeq ($(OS),Darwin) make Tyro.app endif ifeq ($(OS),Windows_NT) make exe endif -ifeq ($(OS),Linux) - make all -endif -# strip -sxX $(PROGRAM) + +# Windows resource linking msw_resource: $(WX_RES) resources/platform/msw/resource.rc -O coff -o resource.res exe: LDLIBS += resource.res exe: msw_resource all - + +# OS X application bundle Tyro.app: all resources/platform/osx/Info.plist - strip -SXx $(PROGRAM) SetFile -t APPL $(TARGET) -mkdir Tyro.app -mkdir Tyro.app/Contents diff --git a/src/TyroApp.cpp b/src/TyroApp.cpp index 04ac8bb..322e2a8 100644 --- a/src/TyroApp.cpp +++ b/src/TyroApp.cpp @@ -7,8 +7,22 @@ * License: **************************************************************/ -#include "common.h" -#include "TyroApp.h" +#include "wx_common.h" + +#include +#include + +class TyroApp : public wxApp +{ + friend class MainFrame; +public: + virtual bool OnInit(); + virtual int OnExit(); +private: +}; + +//************************************************************** + #include "widgets/MainFrame.h" IMPLEMENT_APP(TyroApp); @@ -18,7 +32,7 @@ bool TyroApp::OnInit() this->SetAppName(APP_NAME); this->SetVendorName(APP_VENDOR); - MainFrame* frame = new MainFrame(0L, "Tyro"); + MainFrame* frame = new MainFrame(0L, APP_NAME); SetTopWindow(frame); diff --git a/src/TyroApp.h b/src/TyroApp.h deleted file mode 100644 index a1fd646..0000000 --- a/src/TyroApp.h +++ /dev/null @@ -1,27 +0,0 @@ -/*************************************************************** - * Name: TyroApp.h - * Purpose: Defines Application Class - * Author: Timothy J Warren (tim@timshomepage.net) - * Created: 2015-03-30 - * Copyright: Timothy J Warren (https://timshomepage.net) - * License: - **************************************************************/ - -#ifndef TYROAPP_H -#define TYROAPP_H - -#include "wx_common.h" - -#include -#include - -class TyroApp : public wxApp -{ - friend class MainFrame; -public: - virtual bool OnInit(); - virtual int OnExit(); -private: -}; - -#endif // TYROAPP_H diff --git a/src/definitions.h b/src/definitions.h index 27e24bb..a6596d2 100644 --- a/src/definitions.h +++ b/src/definitions.h @@ -27,45 +27,42 @@ const wxString TYRO_OPEN_ERROR_CAPTION = "Open Failed"; typedef map StringConstMap; const wxString TYRO_FILE_OPEN_WILDCARDS = - _T("All files (*.*)|*.*|") - _T("Bash (*.sh, *.bsh) |*.sh;*.bsh|") - _T("Batch (*.bat, *.cmd, *.nt)|*.bat;*.cmd,*.nt|") - _T("C/C++ (*.c,*.cpp,*.h)| *.c;*.cc;*.cpp;*.cxx;*.cs;*.h;*.hh;*.hpp;*.hxx;*.sma;*.cp |") - _T("CSS (*.css)|*.css|") - _T("Fortran (*.f9*, *.f, *.for)|*.f9*;*.f,*.for|") - _T("HTML/XHTML (*.html, *.htm)|*.htm*|") - _T("Java (*.java)|*.java|") - _T("JavaScript(*.js)|*.js|") - _T("Makefile |Makefile;makefile.*;MAKEFILE;configure.*;*.mak|") - _T("Pascal (*.pas, *.inc, *.pp)|*.pas;*.inc;*.pp|") - _T("Perl (*.pl, *.cgi)|*.pl;*.pm;*.cgi;*.pod|") - _T("PHP (*.php)|*.php|") - _T("Ruby (*.rb)|*.rb|") - _T("SQL (*.sql)|*.sql|") - _T("TCL (*.tcl)|*.tcl|") - _T("Text (*.txt)|*.txt"); + "All files (*.*)|*|" + "Bash (*.sh, *.bsh) |*.sh;*.bsh|" + "Batch (*.bat, *.cmd, *.nt)|*.bat;*.cmd,*.nt|" + "C/C++ (*.c,*.cpp,*.h)| *.c;*.cc;*.cpp;*.cxx;*.cs;*.h;*.hh;*.hpp;*.hxx;*.sma;*.cp |" + "CSS (*.css)|*.css|" + "Fortran (*.f9*, *.f, *.for)|*.f9*;*.f,*.for|" + "HTML/XHTML (*.html, *.htm)|*.htm*|" + "Java (*.java)|*.java|" + "JavaScript(*.js)|*.js|" + "Makefile |Makefile;makefile.*;MAKEFILE;configure.*;*.mak|" + "Pascal (*.pas, *.inc, *.pp)|*.pas;*.inc;*.pp|" + "Perl (*.pl, *.cgi)|*.pl;*.pm;*.cgi;*.pod|" + "PHP (*.php)|*.php|" + "Ruby (*.rb)|*.rb|" + "SQL (*.sql)|*.sql|" + "TCL (*.tcl)|*.tcl|" + "Text (*.txt)|*.txt"; const wxString TYRO_FILE_SAVE_WILDCARDS = - _T("All files (*.*)|*.*|") - _T("Bash (*.sh, *.bsh) |*.sh;*.bsh|") - _T("Batch (*.bat, *.cmd, *.nt)|*.bat;*.cmd,*.nt|") - _T("C/C++ (*.c,*.cpp,*.h)| *.c;*.cc;*.cpp;*.cxx;*.cs;*.h;*.hh;*.hpp;*.hxx;*.sma;*.cp |") - _T("CSS (*.css)|*.css|") - _T("Fortran (*.f9*, *.f, *.for)|*.f9*;*.f,*.for|") - _T("HTML/XHTML (*.html, *.htm)|*.htm*|") - _T("Java (*.java)|*.java|") - _T("JavaScript(*.js)|*.js|") - _T("Makefile |Makefile;makefile.*;MAKEFILE;configure.*;*.mak|") - _T("Pascal (*.pas, *.inc, *.pp)|*.pas;*.inc;*.pp|") - _T("Perl (*.pl, *.cgi)|*.pl;*.pm;*.cgi;*.pod|") - _T("PHP (*.php)|*.php|") - _T("Ruby (*.rb)|*.rb|") - _T("SQL (*.sql)|*.sql|") - _T("TCL (*.tcl)|*.tcl|") - _T("Text (*.txt)|*.txt"); - - - + "All files (*.*)|*.*|" + "Bash (*.sh, *.bsh) |*.sh;*.bsh|" + "Batch (*.bat, *.cmd, *.nt)|*.bat;*.cmd,*.nt|" + "C/C++ (*.c,*.cpp,*.h)| *.c;*.cc;*.cpp;*.cxx;*.cs;*.h;*.hh;*.hpp;*.hxx;*.sma;*.cp |" + "CSS (*.css)|*.css|" + "Fortran (*.f9*, *.f, *.for)|*.f9*;*.f,*.for|" + "HTML/XHTML (*.html, *.htm)|*.htm*|" + "Java (*.java)|*.java|" + "JavaScript(*.js)|*.js|" + "Makefile |Makefile;makefile.*;MAKEFILE;configure.*;*.mak|" + "Pascal (*.pas, *.inc, *.pp)|*.pas;*.inc;*.pp|" + "Perl (*.pl, *.cgi)|*.pl;*.pm;*.cgi;*.pod|" + "PHP (*.php)|*.php|" + "Ruby (*.rb)|*.rb|" + "SQL (*.sql)|*.sql|" + "TCL (*.tcl)|*.tcl|" + "Text (*.txt)|*.txt"; #endif /* DEFINITIONS_H */ diff --git a/src/widgets/MainFrame.h b/src/widgets/MainFrame.h index 96d77c0..7d37a88 100644 --- a/src/widgets/MainFrame.h +++ b/src/widgets/MainFrame.h @@ -6,7 +6,6 @@ #define TYROMAIN_H #include "../wx_common.h" -#include "../TyroApp.h" #include #include