diff --git a/aegilib/aegilib.vcproj b/aegilib/aegilib.vcproj index 133c9aa5c..82dd8e39f 100644 --- a/aegilib/aegilib.vcproj +++ b/aegilib/aegilib.vcproj @@ -157,18 +157,18 @@ + + + + - - - - @@ -217,6 +217,10 @@ + + @@ -237,10 +241,6 @@ RelativePath=".\include\aegilib\exception.h" > - - @@ -431,6 +431,10 @@ > + + diff --git a/aegilib/include/aegilib/action.h b/aegilib/include/aegilib/action.h index c5187fec4..7fb6a07b9 100644 --- a/aegilib/include/aegilib/action.h +++ b/aegilib/include/aegilib/action.h @@ -27,17 +27,17 @@ // // ----------------------------------------------------------------------------- // -// AEGISUB/GORGONSUB +// AEGISUB/ATHENASUB // // Website: http://www.aegisub.net // Contact: mailto:amz@aegisub.net // #pragma once -#include "gorgonstring.h" +#include "athenastring.h" #include "selection.h" -namespace Gorgonsub { +namespace Athenasub { // Prototypes class Model; class Entry; diff --git a/aegilib/include/aegilib/actionlist.h b/aegilib/include/aegilib/actionlist.h index d18350074..2c32351a7 100644 --- a/aegilib/include/aegilib/actionlist.h +++ b/aegilib/include/aegilib/actionlist.h @@ -27,7 +27,7 @@ // // ----------------------------------------------------------------------------- // -// AEGISUB/GORGONSUB +// AEGISUB/ATHENASUB // // Website: http://www.aegisub.net // Contact: mailto:amz@aegisub.net @@ -36,11 +36,11 @@ #pragma once #include #include "action.h" -#include "gorgonstring.h" +#include "athenastring.h" #include "section_entry.h" #include "selection.h" -namespace Gorgonsub { +namespace Athenasub { // Prototypes class Controller; diff --git a/aegilib/include/aegilib/gorgonstring.h b/aegilib/include/aegilib/athenastring.h similarity index 97% rename from aegilib/include/aegilib/gorgonstring.h rename to aegilib/include/aegilib/athenastring.h index 8ef01a473..5d2ca8b7b 100644 --- a/aegilib/include/aegilib/gorgonstring.h +++ b/aegilib/include/aegilib/athenastring.h @@ -27,7 +27,7 @@ // // ----------------------------------------------------------------------------- // -// AEGISUB/GORGONSUB +// AEGISUB/ATHENASUB // // Website: http://www.aegisub.net // Contact: mailto:amz@aegisub.net @@ -38,7 +38,7 @@ #include #include -namespace Gorgonsub { +namespace Athenasub { // Define the string type used throughout this library //typedef std::basic_string String; diff --git a/aegilib/include/aegilib/gorgonsub.h b/aegilib/include/aegilib/athenasub.h similarity index 93% rename from aegilib/include/aegilib/gorgonsub.h rename to aegilib/include/aegilib/athenasub.h index 49f4c40d5..f9b44e8ee 100644 --- a/aegilib/include/aegilib/gorgonsub.h +++ b/aegilib/include/aegilib/athenasub.h @@ -27,20 +27,25 @@ // // ----------------------------------------------------------------------------- // -// AEGISUB/GORGONSUB +// AEGISUB/ATHENASUB // // Website: http://www.aegisub.net // Contact: mailto:amz@aegisub.net // #pragma once + +#ifndef UNICODE +#error "This library requires unicode support." +#endif + #include "tr1.h" #include "exception.h" #include "model.h" #include "view.h" #include "controller.h" #include "notification.h" -#include "gorgonstring.h" +#include "athenastring.h" #include "format.h" #include "format_handler.h" #include "format_manager.h" @@ -48,7 +53,7 @@ #include "section.h" #include "section_entry_dialogue.h" #include "section_entry_style.h" -#include "gorgontime.h" +#include "athenatime.h" #include "colour.h" #include "utils.h" #include "version.h" diff --git a/aegilib/include/aegilib/gorgontime.h b/aegilib/include/aegilib/athenatime.h similarity index 97% rename from aegilib/include/aegilib/gorgontime.h rename to aegilib/include/aegilib/athenatime.h index 15663c62f..165e2b96c 100644 --- a/aegilib/include/aegilib/gorgontime.h +++ b/aegilib/include/aegilib/athenatime.h @@ -27,17 +27,17 @@ // // ----------------------------------------------------------------------------- // -// AEGISUB/GORGONSUB +// AEGISUB/ATHENASUB // // Website: http://www.aegisub.net // Contact: mailto:amz@aegisub.net // #pragma once -#include "gorgonstring.h" +#include "athenastring.h" #include "utils.h" -namespace Gorgonsub { +namespace Athenasub { // Time class class Time { diff --git a/aegilib/include/aegilib/colour.h b/aegilib/include/aegilib/colour.h index 1a78d63ff..5fb33b79f 100644 --- a/aegilib/include/aegilib/colour.h +++ b/aegilib/include/aegilib/colour.h @@ -27,16 +27,16 @@ // // ----------------------------------------------------------------------------- // -// AEGISUB/GORGONSUB +// AEGISUB/ATHENASUB // // Website: http://www.aegisub.net // Contact: mailto:amz@aegisub.net // #pragma once -#include "gorgonstring.h" +#include "athenastring.h" -namespace Gorgonsub { +namespace Athenasub { // Colour class class Colour { diff --git a/aegilib/include/aegilib/controller.h b/aegilib/include/aegilib/controller.h index d45f86c45..7944137c2 100644 --- a/aegilib/include/aegilib/controller.h +++ b/aegilib/include/aegilib/controller.h @@ -27,18 +27,18 @@ // // ----------------------------------------------------------------------------- // -// AEGISUB/GORGONSUB +// AEGISUB/ATHENASUB // // Website: http://www.aegisub.net // Contact: mailto:amz@aegisub.net // #pragma once -#include "gorgonstring.h" +#include "athenastring.h" #include "tr1.h" #include "format.h" -namespace Gorgonsub { +namespace Athenasub { // Prototypes class Model; diff --git a/aegilib/include/aegilib/deltacoder.h b/aegilib/include/aegilib/deltacoder.h index 16b511b76..31ef5131c 100644 --- a/aegilib/include/aegilib/deltacoder.h +++ b/aegilib/include/aegilib/deltacoder.h @@ -27,7 +27,7 @@ // // ----------------------------------------------------------------------------- // -// AEGISUB/GORGONSUB +// AEGISUB/ATHENASUB // // Website: http://www.aegisub.net // Contact: mailto:amz@aegisub.net @@ -36,7 +36,7 @@ #pragma once #include "tr1.h" -namespace Gorgonsub { +namespace Athenasub { // Void pointer prototyle typedef shared_ptr VoidPtr; diff --git a/aegilib/include/aegilib/exception.h b/aegilib/include/aegilib/exception.h index 4a674e4b8..8da6491a6 100644 --- a/aegilib/include/aegilib/exception.h +++ b/aegilib/include/aegilib/exception.h @@ -27,7 +27,7 @@ // // ----------------------------------------------------------------------------- // -// AEGISUB/GORGONSUB +// AEGISUB/ATHENASUB // // Website: http://www.aegisub.net // Contact: mailto:amz@aegisub.net @@ -35,10 +35,10 @@ #pragma once -#include "gorgonstring.h" +#include "athenastring.h" #include -namespace Gorgonsub { +namespace Athenasub { // Exception class class Exception : public std::exception { @@ -54,6 +54,7 @@ namespace Gorgonsub { Invalid_Token, Out_Of_Range, Invalid_Section, + Internal_Error, TODO }; @@ -72,7 +73,7 @@ namespace Gorgonsub { } #ifdef _MSC_VER -#define THROW_GORGON_EXCEPTION(code) throw Gorgonsub::Exception(code,__FILE__,__LINE__) +#define THROW_ATHENA_EXCEPTION(code) throw Athenasub::Exception(code,__FILE__,__LINE__) #else -#define THROW_GORGON_EXCEPTION(code) throw Gorgonsub::Exception(code) +#define THROW_ATHENA_EXCEPTION(code) throw Athenasub::Exception(code) #endif diff --git a/aegilib/include/aegilib/fastbuffer.h b/aegilib/include/aegilib/fastbuffer.h index be073d2f0..54b1629b5 100644 --- a/aegilib/include/aegilib/fastbuffer.h +++ b/aegilib/include/aegilib/fastbuffer.h @@ -39,7 +39,7 @@ #include "utils.h" -namespace Gorgonsub { +namespace Athenasub { // Fast buffer class template class FastBuffer { diff --git a/aegilib/include/aegilib/format.h b/aegilib/include/aegilib/format.h index 041b2088b..9bc44d135 100644 --- a/aegilib/include/aegilib/format.h +++ b/aegilib/include/aegilib/format.h @@ -27,18 +27,18 @@ // // ----------------------------------------------------------------------------- // -// AEGISUB/GORGONSUB +// AEGISUB/ATHENASUB // // Website: http://www.aegisub.net // Contact: mailto:amz@aegisub.net // #pragma once -#include "gorgonstring.h" +#include "athenastring.h" #include "tr1.h" #include "section_entry.h" -namespace Gorgonsub { +namespace Athenasub { // Prototypes class FormatHandler; class Model; diff --git a/aegilib/include/aegilib/format_handler.h b/aegilib/include/aegilib/format_handler.h index 2f171e917..37424f4d1 100644 --- a/aegilib/include/aegilib/format_handler.h +++ b/aegilib/include/aegilib/format_handler.h @@ -27,18 +27,18 @@ // // ----------------------------------------------------------------------------- // -// AEGISUB/GORGONSUB +// AEGISUB/ATHENASUB // // Website: http://www.aegisub.net // Contact: mailto:amz@aegisub.net // #pragma once -#include "gorgonstring.h" +#include "athenastring.h" #include "model.h" #include "tr1.h" -namespace Gorgonsub { +namespace Athenasub { // Format handler interface class FormatHandler { diff --git a/aegilib/include/aegilib/format_manager.h b/aegilib/include/aegilib/format_manager.h index 920395c7b..ce59382a3 100644 --- a/aegilib/include/aegilib/format_manager.h +++ b/aegilib/include/aegilib/format_manager.h @@ -27,7 +27,7 @@ // // ----------------------------------------------------------------------------- // -// AEGISUB/GORGONSUB +// AEGISUB/ATHENASUB // // Website: http://www.aegisub.net // Contact: mailto:amz@aegisub.net @@ -36,7 +36,7 @@ #pragma once #include "format.h" -namespace Gorgonsub { +namespace Athenasub { // Format manager class class FormatManager { diff --git a/aegilib/include/aegilib/model.h b/aegilib/include/aegilib/model.h index e0da018ac..6061c62f5 100644 --- a/aegilib/include/aegilib/model.h +++ b/aegilib/include/aegilib/model.h @@ -27,7 +27,7 @@ // // ----------------------------------------------------------------------------- // -// AEGISUB/GORGONSUB +// AEGISUB/ATHENASUB // // Website: http://www.aegisub.net // Contact: mailto:amz@aegisub.net @@ -40,7 +40,7 @@ #include "actionlist.h" #include "section.h" -namespace Gorgonsub { +namespace Athenasub { // Prototypes class View; diff --git a/aegilib/include/aegilib/notification.h b/aegilib/include/aegilib/notification.h index dd4fcd40c..6649375f4 100644 --- a/aegilib/include/aegilib/notification.h +++ b/aegilib/include/aegilib/notification.h @@ -27,7 +27,7 @@ // // ----------------------------------------------------------------------------- // -// AEGISUB/GORGONSUB +// AEGISUB/ATHENASUB // // Website: http://www.aegisub.net // Contact: mailto:amz@aegisub.net @@ -38,7 +38,7 @@ #include "model.h" #include "notification.h" -namespace Gorgonsub { +namespace Athenasub { // Notification class class Notification { diff --git a/aegilib/include/aegilib/section.h b/aegilib/include/aegilib/section.h index 990ded267..33da6b397 100644 --- a/aegilib/include/aegilib/section.h +++ b/aegilib/include/aegilib/section.h @@ -27,20 +27,20 @@ // // ----------------------------------------------------------------------------- // -// AEGISUB/GORGONSUB +// AEGISUB/ATHENASUB // // Website: http://www.aegisub.net // Contact: mailto:amz@aegisub.net // #pragma once -#include "gorgonstring.h" +#include "athenastring.h" #include "section_entry.h" #include "tr1.h" #include #include -namespace Gorgonsub { +namespace Athenasub { // Section class class Section { diff --git a/aegilib/include/aegilib/section_entry.h b/aegilib/include/aegilib/section_entry.h index ad33fe4ef..087c805b8 100644 --- a/aegilib/include/aegilib/section_entry.h +++ b/aegilib/include/aegilib/section_entry.h @@ -27,18 +27,18 @@ // // ----------------------------------------------------------------------------- // -// AEGISUB/GORGONSUB +// AEGISUB/ATHENASUB // // Website: http://www.aegisub.net // Contact: mailto:amz@aegisub.net // #pragma once -#include "gorgonstring.h" +#include "athenastring.h" #include "tr1.h" #include "deltacoder.h" -namespace Gorgonsub { +namespace Athenasub { // Types enum SectionEntryType { diff --git a/aegilib/include/aegilib/section_entry_dialogue.h b/aegilib/include/aegilib/section_entry_dialogue.h index 3e7b66ecd..1625a9bf6 100644 --- a/aegilib/include/aegilib/section_entry_dialogue.h +++ b/aegilib/include/aegilib/section_entry_dialogue.h @@ -27,7 +27,7 @@ // // ----------------------------------------------------------------------------- // -// AEGISUB/GORGONSUB +// AEGISUB/ATHENASUB // // Website: http://www.aegisub.net // Contact: mailto:amz@aegisub.net @@ -36,17 +36,17 @@ #pragma once #include "exception.h" -#include "gorgontime.h" +#include "athenatime.h" #include "section_entry.h" -namespace Gorgonsub { +namespace Athenasub { // Dialogue class class Dialogue : public Entry { private: static const bool dodgeWarning = true; - void ThrowUnsupported() const { if (dodgeWarning) THROW_GORGON_EXCEPTION(Exception::Unsupported_Format_Feature); } + void ThrowUnsupported() const { if (dodgeWarning) THROW_ATHENA_EXCEPTION(Exception::Unsupported_Format_Feature); } public: // Destructor diff --git a/aegilib/include/aegilib/section_entry_style.h b/aegilib/include/aegilib/section_entry_style.h index e2b0b5b40..8f8f095fd 100644 --- a/aegilib/include/aegilib/section_entry_style.h +++ b/aegilib/include/aegilib/section_entry_style.h @@ -27,7 +27,7 @@ // // ----------------------------------------------------------------------------- // -// AEGISUB/GORGONSUB +// AEGISUB/ATHENASUB // // Website: http://www.aegisub.net // Contact: mailto:amz@aegisub.net @@ -40,13 +40,13 @@ #include "section_entry.h" -namespace Gorgonsub { +namespace Athenasub { // Style class class Style : public Entry { private: static const bool dodgeWarning = true; - void ThrowUnsupported() const { if (dodgeWarning) THROW_GORGON_EXCEPTION(Exception::Unsupported_Format_Feature); } + void ThrowUnsupported() const { if (dodgeWarning) THROW_ATHENA_EXCEPTION(Exception::Unsupported_Format_Feature); } public: // Destructor diff --git a/aegilib/include/aegilib/selection.h b/aegilib/include/aegilib/selection.h index 0ebfe6260..aa5f938f9 100644 --- a/aegilib/include/aegilib/selection.h +++ b/aegilib/include/aegilib/selection.h @@ -27,7 +27,7 @@ // // ----------------------------------------------------------------------------- // -// AEGISUB/GORGONSUB +// AEGISUB/ATHENASUB // // Website: http://www.aegisub.net // Contact: mailto:amz@aegisub.net @@ -36,7 +36,7 @@ #pragma once #include -namespace Gorgonsub { +namespace Athenasub { // Range class class Range { diff --git a/aegilib/include/aegilib/serialize.h b/aegilib/include/aegilib/serialize.h index ff2abf5c8..f468c9cf4 100644 --- a/aegilib/include/aegilib/serialize.h +++ b/aegilib/include/aegilib/serialize.h @@ -27,16 +27,16 @@ // // ----------------------------------------------------------------------------- // -// AEGISUB/GORGONSUB +// AEGISUB/ATHENASUB // // Website: http://www.aegisub.net // Contact: mailto:amz@aegisub.net // #pragma once -#include "gorgonstring.h" +#include "athenastring.h" -namespace Gorgonsub { +namespace Athenasub { // Interface to serialize classes class SerializeText { public: diff --git a/aegilib/include/aegilib/tokenizer.h b/aegilib/include/aegilib/tokenizer.h index b937cf29e..ad57b9fd5 100644 --- a/aegilib/include/aegilib/tokenizer.h +++ b/aegilib/include/aegilib/tokenizer.h @@ -27,17 +27,17 @@ // // ----------------------------------------------------------------------------- // -// AEGISUB/GORGONSUB +// AEGISUB/ATHENASUB // // Website: http://www.aegisub.net // Contact: mailto:amz@aegisub.net // #pragma once -#include "gorgonstring.h" +#include "athenastring.h" #include "tr1.h" -namespace Gorgonsub { +namespace Athenasub { // Tokenizer class class Tokenizer { diff --git a/aegilib/include/aegilib/tr1.h b/aegilib/include/aegilib/tr1.h index 5ff081330..d72facbe7 100644 --- a/aegilib/include/aegilib/tr1.h +++ b/aegilib/include/aegilib/tr1.h @@ -27,7 +27,7 @@ // // ----------------------------------------------------------------------------- // -// AEGISUB/GORGONSUB +// AEGISUB/ATHENASUB // // Website: http://www.aegisub.net // Contact: mailto:amz@aegisub.net @@ -42,7 +42,7 @@ #include #include -namespace Gorgonsub { +namespace Athenasub { using std::tr1::shared_ptr; using std::tr1::weak_ptr; using std::tr1::array; diff --git a/aegilib/include/aegilib/utils.h b/aegilib/include/aegilib/utils.h index e415c29d2..7641870ee 100644 --- a/aegilib/include/aegilib/utils.h +++ b/aegilib/include/aegilib/utils.h @@ -27,7 +27,7 @@ // // ----------------------------------------------------------------------------- // -// AEGISUB/GORGONSUB +// AEGISUB/ATHENASUB // // Website: http://www.aegisub.net // Contact: mailto:amz@aegisub.net @@ -35,7 +35,7 @@ #pragma once -#include "gorgonstring.h" +#include "athenastring.h" ///////////// @@ -67,7 +67,7 @@ T Mid(T a,T b,T c) //////////////////// // Helper functions -namespace Gorgonsub { +namespace Athenasub { // Convert a string to an integer int StringToInt(const String &str); diff --git a/aegilib/include/aegilib/version.h b/aegilib/include/aegilib/version.h index 95c561e7e..5fd975010 100644 --- a/aegilib/include/aegilib/version.h +++ b/aegilib/include/aegilib/version.h @@ -27,7 +27,7 @@ // // ----------------------------------------------------------------------------- // -// AEGISUB/GORGONSUB +// AEGISUB/ATHENASUB // // Website: http://www.aegisub.net // Contact: mailto:amz@aegisub.net @@ -35,11 +35,11 @@ #pragma once -#include "gorgonstring.h" +#include "athenastring.h" //////////////////// // Helper functions -namespace Gorgonsub { +namespace Athenasub { // Version String GetLibraryName(); diff --git a/aegilib/include/aegilib/view.h b/aegilib/include/aegilib/view.h index baab03278..f37092141 100644 --- a/aegilib/include/aegilib/view.h +++ b/aegilib/include/aegilib/view.h @@ -27,17 +27,17 @@ // // ----------------------------------------------------------------------------- // -// AEGISUB/GORGONSUB +// AEGISUB/ATHENASUB // // Website: http://www.aegisub.net // Contact: mailto:amz@aegisub.net // #pragma once -#include "gorgonstring.h" +#include "athenastring.h" #include -namespace Gorgonsub { +namespace Athenasub { // Prototypes class Model; class Notification; diff --git a/aegilib/src/action.cpp b/aegilib/src/action.cpp index 0103a9879..4b6282dcc 100644 --- a/aegilib/src/action.cpp +++ b/aegilib/src/action.cpp @@ -27,14 +27,14 @@ // // ----------------------------------------------------------------------------- // -// AEGISUB/GORGONSUB +// AEGISUB/ATHENASUB // // Website: http://www.aegisub.net // Contact: mailto:amz@aegisub.net // -#include "gorgonsub.h" -using namespace Gorgonsub; +#include "athenasub.h" +using namespace Athenasub; //////////////////////////////// @@ -104,7 +104,7 @@ void ActionRemove::Execute(Model &model) { // Find the section to remote it from String sect = section; - if (sect.IsEmpty()) THROW_GORGON_EXCEPTION(Exception::TODO); // TODO + if (sect.IsEmpty()) THROW_ATHENA_EXCEPTION(Exception::TODO); // TODO SectionPtr section = GetSection(model,sect); // Remove the line diff --git a/aegilib/src/actionlist.cpp b/aegilib/src/actionlist.cpp index b81ed7fe3..fa8b2cfd0 100644 --- a/aegilib/src/actionlist.cpp +++ b/aegilib/src/actionlist.cpp @@ -27,14 +27,14 @@ // // ----------------------------------------------------------------------------- // -// AEGISUB/GORGONSUB +// AEGISUB/ATHENASUB // // Website: http://www.aegisub.net // Contact: mailto:amz@aegisub.net // -#include "Gorgonsub.h" -using namespace Gorgonsub; +#include "Athenasub.h" +using namespace Athenasub; /////////////// @@ -58,7 +58,7 @@ ActionList::~ActionList() // Add an action to the queue void ActionList::AddAction(const ActionPtr action) { - if (!valid) THROW_GORGON_EXCEPTION(Exception::Invalid_ActionList); + if (!valid) THROW_ATHENA_EXCEPTION(Exception::Invalid_ActionList); actions.push_back(action); if (actions.size() > 2) { int a = 0; @@ -71,7 +71,7 @@ void ActionList::AddAction(const ActionPtr action) // Add an action to the start of the queue void ActionList::AddActionStart(const ActionPtr action) { - if (!valid) THROW_GORGON_EXCEPTION(Exception::Invalid_ActionList); + if (!valid) THROW_ATHENA_EXCEPTION(Exception::Invalid_ActionList); actions.push_front(action); if (actions.size() > 2) { int a = 0; diff --git a/aegilib/src/colour.cpp b/aegilib/src/colour.cpp index 017d452af..a583b8f41 100644 --- a/aegilib/src/colour.cpp +++ b/aegilib/src/colour.cpp @@ -27,15 +27,15 @@ // // ----------------------------------------------------------------------------- // -// AEGISUB/GORGONSUB +// AEGISUB/ATHENASUB // // Website: http://www.aegisub.net // Contact: mailto:amz@aegisub.net // -#include "Gorgonsub.h" -using namespace Gorgonsub; +#include "Athenasub.h" +using namespace Athenasub; //////////////// diff --git a/aegilib/src/controller.cpp b/aegilib/src/controller.cpp index 5d7cd784c..26a443e25 100644 --- a/aegilib/src/controller.cpp +++ b/aegilib/src/controller.cpp @@ -27,15 +27,15 @@ // // ----------------------------------------------------------------------------- // -// AEGISUB/GORGONSUB +// AEGISUB/ATHENASUB // // Website: http://www.aegisub.net // Contact: mailto:amz@aegisub.net // #include "controller.h" -#include "Gorgonsub.h" -using namespace Gorgonsub; +#include "Athenasub.h" +using namespace Athenasub; /////////////// @@ -60,7 +60,6 @@ void Controller::LoadFile(const String filename,const String encoding) { const FormatPtr handler = FormatManager::GetFormatFromFilename(filename,true); wxFFileInputStream stream(filename); - //wxBufferedInputStream buffer(stream); model.Load(stream,handler,encoding); } @@ -71,7 +70,6 @@ void Controller::SaveFile(const String filename,const String encoding) { const FormatPtr handler = FormatManager::GetFormatFromFilename(filename,true); wxFFileOutputStream stream(filename); - //wxBufferedOutputStream buffer(stream); model.Save(stream,handler,encoding); } @@ -122,7 +120,7 @@ DialogueConstPtr Controller::GetDialogue(size_t n) const { // TODO (void) n; - THROW_GORGON_EXCEPTION(Exception::TODO); + THROW_ATHENA_EXCEPTION(Exception::TODO); } @@ -132,7 +130,7 @@ DialogueConstPtr Controller::GetStyle(size_t n) const { // TODO (void) n; - THROW_GORGON_EXCEPTION(Exception::TODO); + THROW_ATHENA_EXCEPTION(Exception::TODO); } @@ -144,7 +142,7 @@ StyleConstPtr Controller::GetStyle(String name) const StylePtr dummy = CreateStyle(); String section = dummy->GetDefaultGroup(); SectionPtr sect = model.GetSection(section); - if (!sect) THROW_GORGON_EXCEPTION(Exception::Invalid_Section); + if (!sect) THROW_ATHENA_EXCEPTION(Exception::Invalid_Section); // Return from index return dynamic_pointer_cast (sect->GetFromIndex(name)); @@ -156,6 +154,6 @@ StyleConstPtr Controller::GetStyle(String name) const EntryConstPtr Controller::GetEntry(size_t n,String section) const { SectionPtr sect = model.GetSection(section); - if (!sect) THROW_GORGON_EXCEPTION(Exception::Invalid_Section); + if (!sect) THROW_ATHENA_EXCEPTION(Exception::Invalid_Section); return sect->GetEntry(n); } diff --git a/aegilib/src/exception.cpp b/aegilib/src/exception.cpp index f171ecb6a..bf4372e31 100644 --- a/aegilib/src/exception.cpp +++ b/aegilib/src/exception.cpp @@ -27,14 +27,14 @@ // // ----------------------------------------------------------------------------- // -// AEGISUB/GORGONSUB +// AEGISUB/ATHENASUB // // Website: http://www.aegisub.net // Contact: mailto:amz@aegisub.net // #include "exception.h" -using namespace Gorgonsub; +using namespace Athenasub; //////////////// @@ -67,6 +67,7 @@ const char* Exception::GetMessageChar(int code) case Invalid_Token: return "Invalid type for this token."; case Out_Of_Range: return "Out of range."; case Invalid_Section: return "Invalid section."; + case Internal_Error: return "Internal error."; case TODO: return "TODO"; } return "Invalid code."; diff --git a/aegilib/src/format_manager.cpp b/aegilib/src/format_manager.cpp index f28907729..3a043d920 100644 --- a/aegilib/src/format_manager.cpp +++ b/aegilib/src/format_manager.cpp @@ -27,7 +27,7 @@ // // ----------------------------------------------------------------------------- // -// AEGISUB/GORGONSUB +// AEGISUB/ATHENASUB // // Website: http://www.aegisub.net // Contact: mailto:amz@aegisub.net @@ -36,7 +36,7 @@ #include "format_manager.h" #include "formats/format_ass.h" #include -using namespace Gorgonsub; +using namespace Athenasub; //////// diff --git a/aegilib/src/formats/format_ass.cpp b/aegilib/src/formats/format_ass.cpp index 6a37a6c96..e875b3ce2 100644 --- a/aegilib/src/formats/format_ass.cpp +++ b/aegilib/src/formats/format_ass.cpp @@ -27,7 +27,7 @@ // // ----------------------------------------------------------------------------- // -// AEGISUB/GORGONSUB +// AEGISUB/ATHENASUB // // Website: http://www.aegisub.net // Contact: mailto:amz@aegisub.net @@ -42,7 +42,7 @@ #include "../text_file_writer.h" #include #include -using namespace Gorgonsub; +using namespace Athenasub; /////// @@ -139,6 +139,9 @@ void FormatHandlerASS::Load(wxInputStream &file,const String encoding) EntryPtr entry = MakeEntry(cur,section,version); if (entry) section->AddEntry(entry); } + + // Ensure validity + MakeValid(); } @@ -316,7 +319,7 @@ void FormatHandlerASS::ProcessGroup(String cur,String &curGroup,int &version) { if (versionString == _T("v4.00")) trueVersion = 0; else if (versionString == _T("v4.00+")) trueVersion = 1; else if (versionString == _T("v4.00++")) trueVersion = 2; - else THROW_GORGON_EXCEPTION(Exception::Unknown_Format); + else THROW_ATHENA_EXCEPTION(Exception::Unknown_Format); if (trueVersion != version) { // TODO: issue warning? version = trueVersion; @@ -361,3 +364,37 @@ void FormatHandlerASS::WriteSection(TextFileWriter &writer,SectionPtr section) writer.WriteLineToFile(serial->ToText(formatVersion)); } } + + +/////////////////////// +// Validate the format +void FormatHandlerASS::MakeValid() +{ + // Only ASS supported right now + if (formatVersion != 1) THROW_ATHENA_EXCEPTION(Exception::TODO); + + // Check for [Script Info] + SectionPtr section = GetSection(L"Script Info"); + if (!section) AddSection(L"Script Info"); + section = GetSection(L"Script Info"); + if (!section) THROW_ATHENA_EXCEPTION(Exception::Internal_Error); + + // Check if necessary variables are available + if (section->GetProperty(L"PlayResX").IsEmpty()) section->SetProperty(L"PlayResX",L"384"); // These two mystical values come from Substation Alpha + if (section->GetProperty(L"PlayResY").IsEmpty()) section->SetProperty(L"PlayResY",L"288"); // 288 is half of 576, the PAL resolution, and 384 makes it 4:3 + section->SetProperty(L"ScriptType",L"v4.00+"); + + // Get [V4+ Styles] + section = GetSection(L"V4+ Styles"); + if (!section) AddSection(L"V4+ Styles"); + section = GetSection(L"V4+ Styles"); + if (!section) THROW_ATHENA_EXCEPTION(Exception::Internal_Error); + section->SetProperty(L"Format",L"Name, Fontname, Fontsize, PrimaryColour, SecondaryColour, OutlineColour, BackColour, Bold, Italic, Underline, StrikeOut, ScaleX, ScaleY, Spacing, Angle, BorderStyle, Outline, Shadow, Alignment, MarginL, MarginR, MarginV, Encoding"); + + // Get [Events] + section = GetSection(L"Events"); + if (!section) AddSection(L"Events"); + section = GetSection(L"Events"); + if (!section) THROW_ATHENA_EXCEPTION(Exception::Internal_Error); + section->SetProperty(L"Format",L"Layer, Start, End, Style, Actor, MarginL, MarginR, MarginV, Effect, Text"); +} diff --git a/aegilib/src/formats/format_ass.h b/aegilib/src/formats/format_ass.h index 7a23cd7ee..9dc1057d3 100644 --- a/aegilib/src/formats/format_ass.h +++ b/aegilib/src/formats/format_ass.h @@ -27,7 +27,7 @@ // // ----------------------------------------------------------------------------- // -// AEGISUB/GORGONSUB +// AEGISUB/ATHENASUB // // Website: http://www.aegisub.net // Contact: mailto:amz@aegisub.net @@ -43,7 +43,7 @@ #include "section_entry_style.h" #include "tr1.h" -namespace Gorgonsub { +namespace Athenasub { // Prototypes class Model; @@ -57,6 +57,7 @@ namespace Gorgonsub { EntryPtr MakeEntry(const String &data,SectionPtr section,int version); void ProcessGroup(String cur,String &curGroup,int &version); void WriteSection(TextFileWriter &writer,SectionPtr section); + void MakeValid(); public: FormatHandlerASS(Model &model,int version); diff --git a/aegilib/src/formats/format_ass_dialogue.cpp b/aegilib/src/formats/format_ass_dialogue.cpp index 1b09d02a3..180902b0e 100644 --- a/aegilib/src/formats/format_ass_dialogue.cpp +++ b/aegilib/src/formats/format_ass_dialogue.cpp @@ -27,7 +27,7 @@ // // ----------------------------------------------------------------------------- // -// AEGISUB/GORGONSUB +// AEGISUB/ATHENASUB // // Website: http://www.aegisub.net // Contact: mailto:amz@aegisub.net @@ -36,7 +36,7 @@ #include "format_ass_dialogue.h" #include "tokenizer.h" #include "utils.h" -using namespace Gorgonsub; +using namespace Athenasub; //////////////// @@ -57,7 +57,7 @@ DialogueASS::DialogueASS(const String &data,int version) if (version > 2) version = 0; } if (!valid) { - THROW_GORGON_EXCEPTION(Exception::Parse_Error); + THROW_ATHENA_EXCEPTION(Exception::Parse_Error); } } diff --git a/aegilib/src/formats/format_ass_dialogue.h b/aegilib/src/formats/format_ass_dialogue.h index 97a095635..eebbeeda6 100644 --- a/aegilib/src/formats/format_ass_dialogue.h +++ b/aegilib/src/formats/format_ass_dialogue.h @@ -27,19 +27,19 @@ // // ----------------------------------------------------------------------------- // -// AEGISUB/GORGONSUB +// AEGISUB/ATHENASUB // // Website: http://www.aegisub.net // Contact: mailto:amz@aegisub.net // #pragma once -#include "gorgonstring.h" +#include "athenastring.h" #include "section_entry_dialogue.h" #include "format_ass_dialogue_delta.h" #include "serialize.h" -namespace Gorgonsub { +namespace Athenasub { // Dialogue class DialogueASS : public Dialogue, public SerializeText { diff --git a/aegilib/src/formats/format_ass_dialogue_delta.cpp b/aegilib/src/formats/format_ass_dialogue_delta.cpp index a259d6992..e5c05580c 100644 --- a/aegilib/src/formats/format_ass_dialogue_delta.cpp +++ b/aegilib/src/formats/format_ass_dialogue_delta.cpp @@ -27,7 +27,7 @@ // // ----------------------------------------------------------------------------- // -// AEGISUB/GORGONSUB +// AEGISUB/ATHENASUB // // Website: http://www.aegisub.net // Contact: mailto:amz@aegisub.net @@ -41,7 +41,7 @@ #include #endif -using namespace Gorgonsub; +using namespace Athenasub; //////////////////////////////////// // Encode delta between two entries diff --git a/aegilib/src/formats/format_ass_dialogue_delta.h b/aegilib/src/formats/format_ass_dialogue_delta.h index 51c3392da..f2c323518 100644 --- a/aegilib/src/formats/format_ass_dialogue_delta.h +++ b/aegilib/src/formats/format_ass_dialogue_delta.h @@ -27,7 +27,7 @@ // // ----------------------------------------------------------------------------- // -// AEGISUB/GORGONSUB +// AEGISUB/ATHENASUB // // Website: http://www.aegisub.net // Contact: mailto:amz@aegisub.net @@ -36,7 +36,7 @@ #pragma once #include "deltacoder.h" -namespace Gorgonsub { +namespace Athenasub { // Delta coder class DialogueASS; diff --git a/aegilib/src/formats/format_ass_plain.h b/aegilib/src/formats/format_ass_plain.h index 8e2b64d92..b59621ef5 100644 --- a/aegilib/src/formats/format_ass_plain.h +++ b/aegilib/src/formats/format_ass_plain.h @@ -27,7 +27,7 @@ // // ----------------------------------------------------------------------------- // -// AEGISUB/GORGONSUB +// AEGISUB/ATHENASUB // // Website: http://www.aegisub.net // Contact: mailto:amz@aegisub.net @@ -37,7 +37,7 @@ #include "section_entry.h" #include "serialize.h" -namespace Gorgonsub { +namespace Athenasub { // Raw line class PlainASS : public PlainText, public SerializeText { diff --git a/aegilib/src/formats/format_ass_style.cpp b/aegilib/src/formats/format_ass_style.cpp index 8bdd2966f..9ad5c0bfa 100644 --- a/aegilib/src/formats/format_ass_style.cpp +++ b/aegilib/src/formats/format_ass_style.cpp @@ -27,7 +27,7 @@ // // ----------------------------------------------------------------------------- // -// AEGISUB/GORGONSUB +// AEGISUB/ATHENASUB // // Website: http://www.aegisub.net // Contact: mailto:amz@aegisub.net @@ -36,7 +36,7 @@ #include "format_ass_style.h" #include "tokenizer.h" #include "utils.h" -using namespace Gorgonsub; +using namespace Athenasub; //////////////// @@ -55,7 +55,7 @@ StyleASS::StyleASS(String data,int version) version++; if (version > 2) version = 0; } - if (!valid) THROW_GORGON_EXCEPTION(Exception::Parse_Error); + if (!valid) THROW_ATHENA_EXCEPTION(Exception::Parse_Error); } diff --git a/aegilib/src/formats/format_ass_style.h b/aegilib/src/formats/format_ass_style.h index 91de444e1..dc57190d0 100644 --- a/aegilib/src/formats/format_ass_style.h +++ b/aegilib/src/formats/format_ass_style.h @@ -27,7 +27,7 @@ // // ----------------------------------------------------------------------------- // -// AEGISUB/GORGONSUB +// AEGISUB/ATHENASUB // // Website: http://www.aegisub.net // Contact: mailto:amz@aegisub.net @@ -38,7 +38,7 @@ #include "serialize.h" #include "tr1.h" -namespace Gorgonsub { +namespace Athenasub { // Style class StyleASS : public Style, public SerializeText { diff --git a/aegilib/src/model.cpp b/aegilib/src/model.cpp index 3b6a0cb9a..f454802ec 100644 --- a/aegilib/src/model.cpp +++ b/aegilib/src/model.cpp @@ -27,14 +27,14 @@ // // ----------------------------------------------------------------------------- // -// AEGISUB/GORGONSUB +// AEGISUB/ATHENASUB // // Website: http://www.aegisub.net // Contact: mailto:amz@aegisub.net // -#include "Gorgonsub.h" -using namespace Gorgonsub; +#include "Athenasub.h" +using namespace Athenasub; ///////////////////////////////////////////////////////// @@ -99,12 +99,12 @@ void Model::Load(wxInputStream &input,const FormatPtr _format,const String encod // TODO // No format found - THROW_GORGON_EXCEPTION(Exception::No_Format_Handler); + THROW_ATHENA_EXCEPTION(Exception::No_Format_Handler); } // Get handler FormatHandlerPtr handler = _format->GetHandler(*this); - if (!handler) THROW_GORGON_EXCEPTION(Exception::No_Format_Handler); + if (!handler) THROW_ATHENA_EXCEPTION(Exception::No_Format_Handler); // Clear the model first Clear(); @@ -124,12 +124,12 @@ void Model::Save(wxOutputStream &output,const FormatPtr _format,const String enc // Use another format if (_format && _format != format) { // TODO - THROW_GORGON_EXCEPTION(Exception::TODO); + THROW_ATHENA_EXCEPTION(Exception::TODO); } // Get handler FormatHandlerPtr handler = format->GetHandler(*this); - if (!handler) THROW_GORGON_EXCEPTION(Exception::No_Format_Handler); + if (!handler) THROW_ATHENA_EXCEPTION(Exception::No_Format_Handler); // Load handler->Save(output,encoding); @@ -141,7 +141,7 @@ void Model::Save(wxOutputStream &output,const FormatPtr _format,const String enc void Model::AddSection(String name) { SectionPtr prev = GetSection(name); - if (prev) THROW_GORGON_EXCEPTION(Exception::Section_Already_Exists); + if (prev) THROW_ATHENA_EXCEPTION(Exception::Section_Already_Exists); sections.push_back(SectionPtr(new Section(name))); } diff --git a/aegilib/src/section.cpp b/aegilib/src/section.cpp index 06bf222a8..21a6f8f32 100644 --- a/aegilib/src/section.cpp +++ b/aegilib/src/section.cpp @@ -27,7 +27,7 @@ // // ----------------------------------------------------------------------------- // -// AEGISUB/GORGONSUB +// AEGISUB/ATHENASUB // // Website: http://www.aegisub.net // Contact: mailto:amz@aegisub.net @@ -35,7 +35,7 @@ #include "section.h" -using namespace Gorgonsub; +using namespace Athenasub; /////////////// diff --git a/aegilib/src/section_entry.cpp b/aegilib/src/section_entry.cpp index 28be77765..d97811d99 100644 --- a/aegilib/src/section_entry.cpp +++ b/aegilib/src/section_entry.cpp @@ -27,7 +27,7 @@ // // ----------------------------------------------------------------------------- // -// AEGISUB/GORGONSUB +// AEGISUB/ATHENASUB // // Website: http://www.aegisub.net // Contact: mailto:amz@aegisub.net @@ -37,7 +37,7 @@ #include "section_entry.h" #include "section_entry_dialogue.h" #include "section_entry_style.h" -using namespace Gorgonsub; +using namespace Athenasub; ///////////////////////////////// diff --git a/aegilib/src/selection.cpp b/aegilib/src/selection.cpp index 83c26320a..4a4200134 100644 --- a/aegilib/src/selection.cpp +++ b/aegilib/src/selection.cpp @@ -27,14 +27,14 @@ // // ----------------------------------------------------------------------------- // -// AEGISUB/GORGONSUB +// AEGISUB/ATHENASUB // // Website: http://www.aegisub.net // Contact: mailto:amz@aegisub.net // -#include "gorgonsub.h" -using namespace Gorgonsub; +#include "athenasub.h" +using namespace Athenasub; /////////////// @@ -60,7 +60,7 @@ void Selection::RemoveRange(const Range &range) { // TODO (void) range; - THROW_GORGON_EXCEPTION(Exception::TODO); + THROW_ATHENA_EXCEPTION(Exception::TODO); } @@ -159,5 +159,5 @@ void Selection::RemoveSelection (const Selection ¶m) size_t Range::GetLine(size_t n) const { if (start+n < end) return start+n; - else THROW_GORGON_EXCEPTION(Exception::Out_Of_Range); + else THROW_ATHENA_EXCEPTION(Exception::Out_Of_Range); } diff --git a/aegilib/src/text_file_reader.cpp b/aegilib/src/text_file_reader.cpp index ae693cf1e..f09e90536 100644 --- a/aegilib/src/text_file_reader.cpp +++ b/aegilib/src/text_file_reader.cpp @@ -40,7 +40,7 @@ #include #include #include "text_file_reader.h" -using namespace Gorgonsub; +using namespace Athenasub; #ifdef WITH_UNIVCHARDET #include "charset_detect.h" @@ -49,7 +49,7 @@ using namespace Gorgonsub; /////////////// // Constructor -TextFileReader::TextFileReader(wxInputStream &stream,Gorgonsub::String enc,bool _trim,bool prefetch) +TextFileReader::TextFileReader(wxInputStream &stream,Athenasub::String enc,bool _trim,bool prefetch) : file(stream) { // Setup @@ -177,7 +177,7 @@ void ParseLine(FastBuffer &_buffer,wxInputStream &file,wxString &stringBuffer ////////////////////////// // Reads a line from file -Gorgonsub::String TextFileReader::ActuallyReadLine() +Athenasub::String TextFileReader::ActuallyReadLine() { wxString stringBuffer; size_t bufAlloc = 1024; @@ -213,7 +213,7 @@ bool TextFileReader::HasMoreLines() //////////////////////////////// // Ensure that charset is valid -void TextFileReader::EnsureValid(Gorgonsub::String enc) +void TextFileReader::EnsureValid(Athenasub::String enc) { if (enc == _T("unknown") || enc == _T("UTF-32BE") || enc == _T("UTF-32LE")) { wxString error = _T("Character set "); diff --git a/aegilib/src/text_file_reader.h b/aegilib/src/text_file_reader.h index 54596cc56..005e60596 100644 --- a/aegilib/src/text_file_reader.h +++ b/aegilib/src/text_file_reader.h @@ -38,12 +38,12 @@ // Headers -#include "Gorgonsub.h" +#include "Athenasub.h" #include "fastbuffer.h" #include -namespace Gorgonsub { +namespace Athenasub { // Text file reader class TextFileReader { diff --git a/aegilib/src/text_file_writer.cpp b/aegilib/src/text_file_writer.cpp index c58b18749..1c3fdcf74 100644 --- a/aegilib/src/text_file_writer.cpp +++ b/aegilib/src/text_file_writer.cpp @@ -39,7 +39,7 @@ #include #include "text_file_writer.h" #include "utils.h" -using namespace Gorgonsub; +using namespace Athenasub; /////////////// @@ -65,7 +65,7 @@ TextFileWriter::~TextFileWriter() { ///////////////// // Write to file -void TextFileWriter::WriteLineToFile(Gorgonsub::String line,bool addLineBreak) { +void TextFileWriter::WriteLineToFile(Athenasub::String line,bool addLineBreak) { // Add line break wxString temp = line; if (addLineBreak && Is16) temp += _T("\r\n"); diff --git a/aegilib/src/text_file_writer.h b/aegilib/src/text_file_writer.h index 9d79371b4..52a0905ba 100644 --- a/aegilib/src/text_file_writer.h +++ b/aegilib/src/text_file_writer.h @@ -35,11 +35,11 @@ #pragma once -#include "Gorgonsub.h" +#include "Athenasub.h" #include -namespace Gorgonsub { +namespace Athenasub { class TextFileWriter { private: wxString encoding; @@ -58,6 +58,6 @@ namespace Gorgonsub { TextFileWriter(wxOutputStream &stream,String encoding=_T("")); ~TextFileWriter(); - void WriteLineToFile(Gorgonsub::String line,bool addLineBreak=true); + void WriteLineToFile(Athenasub::String line,bool addLineBreak=true); }; } diff --git a/aegilib/src/time.cpp b/aegilib/src/time.cpp index e1749ebeb..8bc32a491 100644 --- a/aegilib/src/time.cpp +++ b/aegilib/src/time.cpp @@ -27,14 +27,14 @@ // // ----------------------------------------------------------------------------- // -// AEGISUB/GORGONSUB +// AEGISUB/ATHENASUB // // Website: http://www.aegisub.net // Contact: mailto:amz@aegisub.net // -#include "Gorgonsub.h" -using namespace Gorgonsub; +#include "Athenasub.h" +using namespace Athenasub; ////////////////////// diff --git a/aegilib/src/tokenizer.cpp b/aegilib/src/tokenizer.cpp index 9a73cfffb..2b5699efa 100644 --- a/aegilib/src/tokenizer.cpp +++ b/aegilib/src/tokenizer.cpp @@ -27,7 +27,7 @@ // // ----------------------------------------------------------------------------- // -// AEGISUB/GORGONSUB +// AEGISUB/ATHENASUB // // Website: http://www.aegisub.net // Contact: mailto:amz@aegisub.net @@ -37,7 +37,7 @@ #include "exception.h" #include "utils.h" #include -using namespace Gorgonsub; +using namespace Athenasub; /////////////// // Constructor @@ -72,7 +72,7 @@ int Tokenizer::GetPosition() String Tokenizer::GetString(bool trim) { // Has any more? - if (!HasMoreTokens()) THROW_GORGON_EXCEPTION(Exception::Invalid_Token); + if (!HasMoreTokens()) THROW_ATHENA_EXCEPTION(Exception::Invalid_Token); // Find token size_t len = string.Length(); diff --git a/aegilib/src/utils.cpp b/aegilib/src/utils.cpp index f82b30816..4dd3a4964 100644 --- a/aegilib/src/utils.cpp +++ b/aegilib/src/utils.cpp @@ -27,7 +27,7 @@ // // ----------------------------------------------------------------------------- // -// AEGISUB/GORGONSUB +// AEGISUB/ATHENASUB // // Website: http://www.aegisub.net // Contact: mailto:amz@aegisub.net @@ -35,12 +35,12 @@ #include "utils.h" -using namespace Gorgonsub; +using namespace Athenasub; ////////////////////////////////// // Convert a string to an integer -int Gorgonsub::StringToInt(const String &str) +int Athenasub::StringToInt(const String &str) { size_t len = str.Length(); int value = 0; @@ -55,7 +55,7 @@ int Gorgonsub::StringToInt(const String &str) ////////////////////////////////////// // Converts a substring to an integer -int Gorgonsub::SubStringToInteger(const String &str,size_t start,size_t end) +int Athenasub::SubStringToInteger(const String &str,size_t start,size_t end) { int value = 0; int chr; @@ -69,7 +69,7 @@ int Gorgonsub::SubStringToInteger(const String &str,size_t start,size_t end) //////////////// // Pretty float -String Gorgonsub::PrettyFloat(String src) { +String Athenasub::PrettyFloat(String src) { if (src.Contains(_T("."))) { size_t len = src.Length(); while (src.Right(1) == _T("0")) { @@ -84,27 +84,27 @@ String Gorgonsub::PrettyFloat(String src) { return src; } -String Gorgonsub::PrettyFloatF(float src) { return Gorgonsub::PrettyFloat(wxString::Format(_T("%f"),src)); } -String Gorgonsub::PrettyFloatD(double src) { return Gorgonsub::PrettyFloat(wxString::Format(_T("%f"),src)); } +String Athenasub::PrettyFloatF(float src) { return Athenasub::PrettyFloat(wxString::Format(_T("%f"),src)); } +String Athenasub::PrettyFloatD(double src) { return Athenasub::PrettyFloat(wxString::Format(_T("%f"),src)); } /////////////////// // Float to string -String Gorgonsub::FloatToString(double value) { +String Athenasub::FloatToString(double value) { return PrettyFloat(wxString::Format(_T("%f"),value)); } ///////////////// // Int to string -String Gorgonsub::IntegerToString(int value) { +String Athenasub::IntegerToString(int value) { return wxString::Format(_T("%i"),value); } //////////////////////////// // Fast writing to a string -void Gorgonsub::WriteNumber(wxChar *&dst,wxChar *temp,int number,int pad,size_t &pos) { +void Athenasub::WriteNumber(wxChar *&dst,wxChar *temp,int number,int pad,size_t &pos) { // Write number backwards first int div, value; size_t len; @@ -134,7 +134,7 @@ void Gorgonsub::WriteNumber(wxChar *&dst,wxChar *temp,int number,int pad,size_t ///////////////// // Trim a string -const wxChar *Gorgonsub::StringPtrTrim(wxChar *chr,size_t len,size_t startPos) +const wxChar *Athenasub::StringPtrTrim(wxChar *chr,size_t len,size_t startPos) { // String metrics wxChar *read = chr; @@ -168,7 +168,7 @@ const wxChar *Gorgonsub::StringPtrTrim(wxChar *chr,size_t len,size_t startPos) return chr + start; } -const wxChar *Gorgonsub::StringTrim(wxString &str,size_t startPos) +const wxChar *Athenasub::StringTrim(wxString &str,size_t startPos) { // Get a pointer to the string data wxChar *chr = const_cast (str.c_str()); @@ -178,7 +178,7 @@ const wxChar *Gorgonsub::StringTrim(wxString &str,size_t startPos) ////////////////////////////////////////////////// // Compares a string to a constant, ignoring case -bool Gorgonsub::AsciiStringCompareNoCase(const wxString &str1,const wxChar *str2) +bool Athenasub::AsciiStringCompareNoCase(const wxString &str1,const wxChar *str2) { const wxChar *src = str1.c_str(); wxChar c1,c2; @@ -204,7 +204,7 @@ bool Gorgonsub::AsciiStringCompareNoCase(const wxString &str1,const wxChar *str2 /////////////////////////////////////////////// // Get the UTF-8 length out of a UTF-16 string -size_t Gorgonsub::GetUTF8Len(const wchar_t *utf16) +size_t Athenasub::GetUTF8Len(const wchar_t *utf16) { size_t len = 0; wchar_t curChar = utf16[0]; @@ -234,7 +234,7 @@ size_t Gorgonsub::GetUTF8Len(const wchar_t *utf16) /////////////////////////// // Convert UTF-16 to UTF-8 -size_t Gorgonsub::UTF16toUTF8(const wchar_t *utf16,char *utf8) +size_t Athenasub::UTF16toUTF8(const wchar_t *utf16,char *utf8) { wchar_t curChar = 1; size_t value; diff --git a/aegilib/src/version.cpp b/aegilib/src/version.cpp index 09653f28a..0e0bb4cd7 100644 --- a/aegilib/src/version.cpp +++ b/aegilib/src/version.cpp @@ -27,7 +27,7 @@ // // ----------------------------------------------------------------------------- // -// AEGISUB/GORGONSUB +// AEGISUB/ATHENASUB // // Website: http://www.aegisub.net // Contact: mailto:amz@aegisub.net @@ -35,21 +35,21 @@ #include "version.h" -#include "gorgonstring.h" -using namespace Gorgonsub; +#include "athenastring.h" +using namespace Athenasub; //////////////// // Library data -String Gorgonsub::GetLibraryName() +String Athenasub::GetLibraryName() { - return _T("Gorgonsub"); + return _T("Athenasub"); } -String Gorgonsub::GetLibraryVersionString() +String Athenasub::GetLibraryVersionString() { - return _T("Gorgonsub v0.x - EXPERIMENTAL"); + return _T("Athenasub v0.x - EXPERIMENTAL"); } -String Gorgonsub::GetLibraryURL() +String Athenasub::GetLibraryURL() { return _T("http://www.aegisub.net"); } @@ -60,22 +60,22 @@ String Gorgonsub::GetLibraryURL() static String* hostName = NULL; static String* hostURL = NULL; -void Gorgonsub::SetHostApplicationName(const String name) +void Athenasub::SetHostApplicationName(const String name) { if (!hostName) hostName = new String(); *hostName = name; } -void Gorgonsub::SetHostApplicationURL(const String url) +void Athenasub::SetHostApplicationURL(const String url) { if (!hostURL) hostURL = new String(); *hostURL = url; } -String Gorgonsub::GetHostApplicationName() +String Athenasub::GetHostApplicationName() { if (hostName) return *hostName; return L"unknown application"; } -String Gorgonsub::GetHostApplicationURL() +String Athenasub::GetHostApplicationURL() { if (hostURL) return *hostURL; return L""; diff --git a/aegilib/src/view.cpp b/aegilib/src/view.cpp index c483cd620..7a39b56c2 100644 --- a/aegilib/src/view.cpp +++ b/aegilib/src/view.cpp @@ -27,14 +27,14 @@ // // ----------------------------------------------------------------------------- // -// AEGISUB/GORGONSUB +// AEGISUB/ATHENASUB // // Website: http://www.aegisub.net // Contact: mailto:amz@aegisub.net // -#include "Gorgonsub.h" -using namespace Gorgonsub; +#include "Athenasub.h" +using namespace Athenasub; void View::Register(Model &model) { diff --git a/aegilib/test/src/main.cpp b/aegilib/test/src/main.cpp index 3b33c90a1..d32c6cca3 100644 --- a/aegilib/test/src/main.cpp +++ b/aegilib/test/src/main.cpp @@ -33,7 +33,7 @@ // Contact: mailto:amz@aegisub.net // -#include +#include #include #include #include @@ -43,14 +43,14 @@ int main() { using namespace std; - using namespace Gorgonsub; + using namespace Athenasub; - cout << "Gorgonsub test program by amz.\n\n"; + cout << "Athenasub test program by amz.\n\n"; try { // Set up the lib FormatManager::InitializeFormats(); - Gorgonsub::SetHostApplicationName(L"Aegilib test program"); + Athenasub::SetHostApplicationName(L"Aegilib test program"); // Subtitles model Model subs; diff --git a/aegilib/test/src/text_file_reader.h b/aegilib/test/src/text_file_reader.h index cf2b084c4..cf11f515e 100644 --- a/aegilib/test/src/text_file_reader.h +++ b/aegilib/test/src/text_file_reader.h @@ -72,15 +72,15 @@ private: void SetEncodingConfiguration(); public: - TextFileReader(Gorgonsub::String filename,Gorgonsub::String encoding=_T(""),bool trim=true); + TextFileReader(Athenasub::String filename,Athenasub::String encoding=_T(""),bool trim=true); ~TextFileReader(); - Gorgonsub::String ReadLineFromFile(); + Athenasub::String ReadLineFromFile(); bool HasMoreLines(); - static void EnsureValid(const Gorgonsub::String encoding); - Gorgonsub::String GetCurrentEncoding(); - static Gorgonsub::String GetEncoding(const Gorgonsub::String filename); + static void EnsureValid(const Athenasub::String encoding); + Athenasub::String GetCurrentEncoding(); + static Athenasub::String GetEncoding(const Athenasub::String filename); }; diff --git a/aegilib/test/src/text_file_writer.h b/aegilib/test/src/text_file_writer.h index 848c8fc38..190efd161 100644 --- a/aegilib/test/src/text_file_writer.h +++ b/aegilib/test/src/text_file_writer.h @@ -65,10 +65,10 @@ private: void SetEncoding(); public: - TextFileWriter(Gorgonsub::String filename,Gorgonsub::String encoding=_T("")); + TextFileWriter(Athenasub::String filename,Athenasub::String encoding=_T("")); ~TextFileWriter(); - void WriteLineToFile(Gorgonsub::String line,bool addLineBreak=true); + void WriteLineToFile(Athenasub::String line,bool addLineBreak=true); }; diff --git a/aegilib/todo.txt b/aegilib/todo.txt index 89cb57177..3be9e9ea2 100644 --- a/aegilib/todo.txt +++ b/aegilib/todo.txt @@ -1,4 +1,4 @@ -Todo for Gorgonsub: +Todo for Athenasub: ------------------- x = done @@ -6,7 +6,8 @@ x = done . = partially done = not done -* = not necessary +* = features not present in current Aegisub, therefore have low priority + (which doesn't mean that they won't be implemented before the others... >_>) ------------------- @@ -14,7 +15,7 @@ x = done [x] Text file reader/writer [ ] Automatic character set detection [ ] Conversion between subtitle formats -[ ] Format comformity checks +[x] Format comformity checks [ ] Override tag support [:] ASS format support [ ] ASS override tags @@ -23,6 +24,7 @@ x = done [ ] DVD subtitles support (*) [ ] Blu-Ray subtitles support (*) [ ] OCR support (through Tesseract) (*) +[ ] Logging system [:] Time helper class [:] Colour helper class