Misc fixes for building on GCC

Originally committed to SVN as r697.
This commit is contained in:
Niels Martin Hansen 2007-01-03 21:18:19 +00:00
parent 8d069ffad5
commit 326fbe8961
9 changed files with 16 additions and 14 deletions

View File

@ -46,6 +46,7 @@ aegisub_SOURCES = \
dialog_automation.cpp \ dialog_automation.cpp \
dialog_colorpicker.cpp \ dialog_colorpicker.cpp \
dialog_export.cpp \ dialog_export.cpp \
dialog_fonts_collector.cpp \
dialog_hotkeys.cpp \ dialog_hotkeys.cpp \
dialog_jumpto.cpp \ dialog_jumpto.cpp \
dialog_options.cpp \ dialog_options.cpp \
@ -68,7 +69,6 @@ aegisub_SOURCES = \
export_fixstyle.cpp \ export_fixstyle.cpp \
export_framerate.cpp \ export_framerate.cpp \
fft.cpp \ fft.cpp \
fonts_collector.cpp \
frame_main.cpp \ frame_main.cpp \
frame_main_events.cpp \ frame_main_events.cpp \
hilimod_textctrl.cpp \ hilimod_textctrl.cpp \
@ -78,6 +78,7 @@ aegisub_SOURCES = \
main.cpp \ main.cpp \
md5.c \ md5.c \
mkv_wrap.cpp \ mkv_wrap.cpp \
mythes.cxx \
options.cpp \ options.cpp \
spellchecker.cpp \ spellchecker.cpp \
spellchecker_hunspell.cpp \ spellchecker_hunspell.cpp \

View File

@ -118,7 +118,7 @@ wxColour AssColor::GetWXColor() {
////////////////////// //////////////////////
// Sets color from wx // Sets color from wx
void AssColor::SetWXColor(wxColor &color) { void AssColor::SetWXColor(const wxColor &color) {
r = color.Red(); r = color.Red();
g = color.Green(); g = color.Green();
b = color.Blue(); b = color.Blue();

View File

@ -55,7 +55,7 @@ public:
AssColor(wxColour &color); AssColor(wxColour &color);
wxColor GetWXColor(); // Return as a wxColor 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 ParseASS(const wxString value); // Parse ASS-style color
void ParseSSA(const wxString value); // Parse SSA-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 wxString GetASSFormatted(bool alpha,bool stripped=false,bool isStyle=false); // Gets color formated in ASS format

View File

@ -146,7 +146,7 @@ namespace Automation4 {
for (unsigned int i = 0; i < text.length(); i++) { for (unsigned int i = 0; i < text.length(); i++) {
int a, b, c, d; int a, b, c, d;
thedc.GetTextExtent(text[i], &a, &b, &c, &d); thedc.GetTextExtent(text[i], &a, &b, &c, &d);
width += a + spacing; width += a + style->spacing;
height = b > height ? b : height; height = b > height ? b : height;
descent = c > descent ? c : descent; descent = c > descent ? c : descent;
extlead= d > extlead ? d : extlead; extlead= d > extlead ? d : extlead;

View File

@ -109,8 +109,8 @@ namespace Automation4 {
const wxString& GetDescription() const; const wxString& GetDescription() const;
virtual bool Validate(AssFile *subs, std::vector<int> &selected, int active) = 0; virtual bool Validate(AssFile *subs, const std::vector<int> &selected, int active) = 0;
virtual void Process(AssFile *subs, std::vector<int> &selected, int active, wxWindow *progress_parent) = 0; virtual void Process(AssFile *subs, const std::vector<int> &selected, int active, wxWindow * const progress_parent) = 0;
}; };

View File

@ -478,7 +478,7 @@ namespace Automation4 {
lua_remove(L, -2); lua_remove(L, -2);
} }
void LuaFeature::CreateIntegerArray(std::vector<int> &ints) void LuaFeature::CreateIntegerArray(const std::vector<int> &ints)
{ {
// create an array-style table with an integer vector in it // create an array-style table with an integer vector in it
// leave the new table on top of the stack // leave the new table on top of the stack
@ -533,7 +533,7 @@ namespace Automation4 {
lua_pop(L, 1); lua_pop(L, 1);
} }
bool LuaFeatureMacro::Validate(AssFile *subs, std::vector<int> &selected, int active) bool LuaFeatureMacro::Validate(AssFile *subs, const std::vector<int> &selected, int active)
{ {
if (no_validate) if (no_validate)
return true; return true;
@ -557,7 +557,7 @@ namespace Automation4 {
return result; return result;
} }
void LuaFeatureMacro::Process(AssFile *subs, std::vector<int> &selected, int active, wxWindow *progress_parent) void LuaFeatureMacro::Process(AssFile *subs, const std::vector<int> &selected, int active, wxWindow * const progress_parent)
{ {
GetFeatureFunction(1); // 1 = processing function GetFeatureFunction(1); // 1 = processing function

View File

@ -162,7 +162,7 @@ namespace Automation4 {
void RegisterFeature(); void RegisterFeature();
void GetFeatureFunction(int functionid); void GetFeatureFunction(int functionid);
void CreateIntegerArray(std::vector<int> &ints); void CreateIntegerArray(const std::vector<int> &ints);
void ThrowError(); void ThrowError();
}; };
@ -213,8 +213,8 @@ namespace Automation4 {
static int LuaRegister(lua_State *L); static int LuaRegister(lua_State *L);
virtual ~LuaFeatureMacro() { } virtual ~LuaFeatureMacro() { }
virtual bool Validate(AssFile *subs, std::vector<int> &selected, int active); virtual bool Validate(AssFile *subs, const std::vector<int> &selected, int active);
virtual void Process(AssFile *subs, std::vector<int> &selected, int active, wxWindow *progress_parent); virtual void Process(AssFile *subs, const std::vector<int> &selected, int active, wxWindow * const progress_parent);
}; };

View File

@ -236,7 +236,7 @@ nospin:
if (hasspin) { if (hasspin) {
return cw = new wxSpinCtrl(parent, -1, wxString::Format(_T("%d"), value), wxDefaultPosition, wxDefaultSize, min, max, value); return cw = new wxSpinCtrl(parent, -1, wxString::Format(_T("%d"), value), wxDefaultPosition, wxDefaultSize, min, max, value);
} else { } 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; typedef wxValidator FloatTextValidator;
wxControl *Create(wxWindow *parent) 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() void ControlReadBack()

View File

@ -41,6 +41,7 @@
#include <wx/treebook.h> #include <wx/treebook.h>
#endif #endif
#include "options.h" #include "options.h"
#include <wx/spinctrl.h>
#include "frame_main.h" #include "frame_main.h"
#include "main.h" #include "main.h"
#include "validators.h" #include "validators.h"