From 326fbe89610423da35dd80c1460058a21a7e9794 Mon Sep 17 00:00:00 2001 From: Niels Martin Hansen Date: Wed, 3 Jan 2007 21:18:19 +0000 Subject: [PATCH] Misc fixes for building on GCC Originally committed to SVN as r697. --- aegisub/Makefile.am | 3 ++- aegisub/ass_style.cpp | 2 +- aegisub/ass_style.h | 2 +- aegisub/auto4_base.cpp | 2 +- aegisub/auto4_base.h | 4 ++-- aegisub/auto4_lua.cpp | 6 +++--- aegisub/auto4_lua.h | 6 +++--- aegisub/auto4_lua_dialog.cpp | 4 ++-- aegisub/dialog_options.cpp | 1 + 9 files changed, 16 insertions(+), 14 deletions(-) diff --git a/aegisub/Makefile.am b/aegisub/Makefile.am index 1aee107e3..c4ced848c 100644 --- a/aegisub/Makefile.am +++ b/aegisub/Makefile.am @@ -46,6 +46,7 @@ aegisub_SOURCES = \ dialog_automation.cpp \ dialog_colorpicker.cpp \ dialog_export.cpp \ + dialog_fonts_collector.cpp \ dialog_hotkeys.cpp \ dialog_jumpto.cpp \ dialog_options.cpp \ @@ -68,7 +69,6 @@ aegisub_SOURCES = \ export_fixstyle.cpp \ export_framerate.cpp \ fft.cpp \ - fonts_collector.cpp \ frame_main.cpp \ frame_main_events.cpp \ hilimod_textctrl.cpp \ @@ -78,6 +78,7 @@ aegisub_SOURCES = \ main.cpp \ md5.c \ mkv_wrap.cpp \ + mythes.cxx \ options.cpp \ spellchecker.cpp \ spellchecker_hunspell.cpp \ diff --git a/aegisub/ass_style.cpp b/aegisub/ass_style.cpp index 3f091123e..6a66dc0ee 100644 --- a/aegisub/ass_style.cpp +++ b/aegisub/ass_style.cpp @@ -118,7 +118,7 @@ wxColour AssColor::GetWXColor() { ////////////////////// // Sets color from wx -void AssColor::SetWXColor(wxColor &color) { +void AssColor::SetWXColor(const wxColor &color) { r = color.Red(); g = color.Green(); b = color.Blue(); diff --git a/aegisub/ass_style.h b/aegisub/ass_style.h index 221549846..f8ec41f4b 100644 --- a/aegisub/ass_style.h +++ b/aegisub/ass_style.h @@ -55,7 +55,7 @@ public: AssColor(wxColour &color); wxColor GetWXColor(); // Return as a wxColor - void SetWXColor(wxColor &color); // Sets from a wxColor + void SetWXColor(const wxColor &color); // Sets from a wxColor void ParseASS(const wxString value); // Parse ASS-style color void ParseSSA(const wxString value); // Parse SSA-style color wxString GetASSFormatted(bool alpha,bool stripped=false,bool isStyle=false); // Gets color formated in ASS format diff --git a/aegisub/auto4_base.cpp b/aegisub/auto4_base.cpp index 7f2cfe56d..4d79ba2fd 100644 --- a/aegisub/auto4_base.cpp +++ b/aegisub/auto4_base.cpp @@ -146,7 +146,7 @@ namespace Automation4 { for (unsigned int i = 0; i < text.length(); i++) { int a, b, c, d; thedc.GetTextExtent(text[i], &a, &b, &c, &d); - width += a + spacing; + width += a + style->spacing; height = b > height ? b : height; descent = c > descent ? c : descent; extlead= d > extlead ? d : extlead; diff --git a/aegisub/auto4_base.h b/aegisub/auto4_base.h index ecd8f1524..35661a2d3 100644 --- a/aegisub/auto4_base.h +++ b/aegisub/auto4_base.h @@ -109,8 +109,8 @@ namespace Automation4 { const wxString& GetDescription() const; - virtual bool Validate(AssFile *subs, std::vector &selected, int active) = 0; - virtual void Process(AssFile *subs, std::vector &selected, int active, wxWindow *progress_parent) = 0; + virtual bool Validate(AssFile *subs, const std::vector &selected, int active) = 0; + virtual void Process(AssFile *subs, const std::vector &selected, int active, wxWindow * const progress_parent) = 0; }; diff --git a/aegisub/auto4_lua.cpp b/aegisub/auto4_lua.cpp index e7092d9a4..44750be66 100644 --- a/aegisub/auto4_lua.cpp +++ b/aegisub/auto4_lua.cpp @@ -478,7 +478,7 @@ namespace Automation4 { lua_remove(L, -2); } - void LuaFeature::CreateIntegerArray(std::vector &ints) + void LuaFeature::CreateIntegerArray(const std::vector &ints) { // create an array-style table with an integer vector in it // leave the new table on top of the stack @@ -533,7 +533,7 @@ namespace Automation4 { lua_pop(L, 1); } - bool LuaFeatureMacro::Validate(AssFile *subs, std::vector &selected, int active) + bool LuaFeatureMacro::Validate(AssFile *subs, const std::vector &selected, int active) { if (no_validate) return true; @@ -557,7 +557,7 @@ namespace Automation4 { return result; } - void LuaFeatureMacro::Process(AssFile *subs, std::vector &selected, int active, wxWindow *progress_parent) + void LuaFeatureMacro::Process(AssFile *subs, const std::vector &selected, int active, wxWindow * const progress_parent) { GetFeatureFunction(1); // 1 = processing function diff --git a/aegisub/auto4_lua.h b/aegisub/auto4_lua.h index e6351f363..5da02dc29 100644 --- a/aegisub/auto4_lua.h +++ b/aegisub/auto4_lua.h @@ -162,7 +162,7 @@ namespace Automation4 { void RegisterFeature(); void GetFeatureFunction(int functionid); - void CreateIntegerArray(std::vector &ints); + void CreateIntegerArray(const std::vector &ints); void ThrowError(); }; @@ -213,8 +213,8 @@ namespace Automation4 { static int LuaRegister(lua_State *L); virtual ~LuaFeatureMacro() { } - virtual bool Validate(AssFile *subs, std::vector &selected, int active); - virtual void Process(AssFile *subs, std::vector &selected, int active, wxWindow *progress_parent); + virtual bool Validate(AssFile *subs, const std::vector &selected, int active); + virtual void Process(AssFile *subs, const std::vector &selected, int active, wxWindow * const progress_parent); }; diff --git a/aegisub/auto4_lua_dialog.cpp b/aegisub/auto4_lua_dialog.cpp index 0d3fec062..a488d7c79 100644 --- a/aegisub/auto4_lua_dialog.cpp +++ b/aegisub/auto4_lua_dialog.cpp @@ -236,7 +236,7 @@ nospin: if (hasspin) { return cw = new wxSpinCtrl(parent, -1, wxString::Format(_T("%d"), value), wxDefaultPosition, wxDefaultSize, min, max, value); } else { - return cw = new wxTextCtrl(parent, -1, text, wxDefaultPosition, wxDefaultSize, 0, IntTextValidator()); + return cw = new wxTextCtrl(parent, -1, text, wxDefaultPosition, wxDefaultSize, 0); //, IntTextValidator()); } } @@ -281,7 +281,7 @@ nospin: typedef wxValidator FloatTextValidator; wxControl *Create(wxWindow *parent) { - return cw = new wxTextCtrl(parent, -1, text, wxDefaultPosition, wxDefaultSize, 0, FloatTextValidator()); + return cw = new wxTextCtrl(parent, -1, text, wxDefaultPosition, wxDefaultSize, 0); //, FloatTextValidator()); } void ControlReadBack() diff --git a/aegisub/dialog_options.cpp b/aegisub/dialog_options.cpp index 9a4936d95..3d67766b1 100644 --- a/aegisub/dialog_options.cpp +++ b/aegisub/dialog_options.cpp @@ -41,6 +41,7 @@ #include #endif #include "options.h" +#include #include "frame_main.h" #include "main.h" #include "validators.h"