mirror of https://github.com/odrling/Aegisub
Athenasub is operational again, although it now has memory leaks due to cyclical references.
Originally committed to SVN as r2365.
This commit is contained in:
parent
743527eeb8
commit
5b8ce78d40
|
@ -20,7 +20,7 @@
|
||||||
Name="Debug|Win32"
|
Name="Debug|Win32"
|
||||||
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
|
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
|
||||||
IntermediateDirectory="$(ConfigurationName)"
|
IntermediateDirectory="$(ConfigurationName)"
|
||||||
ConfigurationType="4"
|
ConfigurationType="2"
|
||||||
CharacterSet="1"
|
CharacterSet="1"
|
||||||
>
|
>
|
||||||
<Tool
|
<Tool
|
||||||
|
@ -42,8 +42,8 @@
|
||||||
Name="VCCLCompilerTool"
|
Name="VCCLCompilerTool"
|
||||||
AdditionalOptions="/MP"
|
AdditionalOptions="/MP"
|
||||||
Optimization="0"
|
Optimization="0"
|
||||||
AdditionalIncludeDirectories="include/aegilib"
|
AdditionalIncludeDirectories="include/athenasub;src"
|
||||||
PreprocessorDefinitions="WIN32;_DEBUG;_LIB"
|
PreprocessorDefinitions="WIN32;_DEBUG;_LIB;ATHENA_EXPORTS"
|
||||||
MinimalRebuild="true"
|
MinimalRebuild="true"
|
||||||
BasicRuntimeChecks="3"
|
BasicRuntimeChecks="3"
|
||||||
RuntimeLibrary="3"
|
RuntimeLibrary="3"
|
||||||
|
@ -67,11 +67,15 @@
|
||||||
Name="VCPreLinkEventTool"
|
Name="VCPreLinkEventTool"
|
||||||
/>
|
/>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCLibrarianTool"
|
Name="VCLinkerTool"
|
||||||
|
OutputFile="../bin/aegilib_d.dll"
|
||||||
/>
|
/>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCALinkTool"
|
Name="VCALinkTool"
|
||||||
/>
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCManifestTool"
|
||||||
|
/>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCXDCMakeTool"
|
Name="VCXDCMakeTool"
|
||||||
/>
|
/>
|
||||||
|
@ -81,6 +85,9 @@
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCFxCopTool"
|
Name="VCFxCopTool"
|
||||||
/>
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCAppVerifierTool"
|
||||||
|
/>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCPostBuildEventTool"
|
Name="VCPostBuildEventTool"
|
||||||
/>
|
/>
|
||||||
|
|
|
@ -48,4 +48,8 @@ namespace Athenasub {
|
||||||
return LibAthenaSub(CreateLib(hostName));
|
return LibAthenaSub(CreateLib(hostName));
|
||||||
//return LibAthenaSub(CreateLibAthenasub(hostName));
|
//return LibAthenaSub(CreateLibAthenasub(hostName));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
inline LibAthenaSub Create(const char* hostName) {
|
||||||
|
return LibAthenaSub(CreateLibAthenasub(hostName));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -106,7 +106,7 @@ namespace Athenasub {
|
||||||
friend class IAction;
|
friend class IAction;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual void ProcessActionList(ActionList actionList,int type=0) = 0;
|
virtual void ProcessActionList(CActionList &actionList,int type=0) = 0;
|
||||||
|
|
||||||
virtual String GetUndoMessage(const String owner=L"") const = 0;
|
virtual String GetUndoMessage(const String owner=L"") const = 0;
|
||||||
virtual String GetRedoMessage(const String owner=L"") const = 0;
|
virtual String GetRedoMessage(const String owner=L"") const = 0;
|
||||||
|
@ -255,12 +255,12 @@ namespace Athenasub {
|
||||||
virtual Entry Clone() const = 0;
|
virtual Entry Clone() const = 0;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
static PlainTextPtr GetAsPlain(EntryPtr ptr);
|
static PlainText GetAsPlain(Entry ptr);
|
||||||
static DialoguePtr GetAsDialogue(EntryPtr ptr);
|
static Dialogue GetAsDialogue(Entry ptr);
|
||||||
static DialogueConstPtr GetAsDialogue(EntryConstPtr ptr);
|
static DialogueConst GetAsDialogue(EntryConst ptr);
|
||||||
static StylePtr GetAsStyle(EntryPtr ptr);
|
static Style GetAsStyle(Entry ptr);
|
||||||
static AttachmentPtr GetAsFile(EntryPtr ptr);
|
static Attachment GetAsFile(Entry ptr);
|
||||||
static RawEntryPtr GetAsRaw(EntryPtr ptr);
|
static RawEntry GetAsRaw(Entry ptr);
|
||||||
*/
|
*/
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -273,7 +273,6 @@ namespace Athenasub {
|
||||||
|
|
||||||
// Type
|
// Type
|
||||||
SectionEntryType GetType() const { return SECTION_ENTRY_DIALOGUE; }
|
SectionEntryType GetType() const { return SECTION_ENTRY_DIALOGUE; }
|
||||||
Dialogue GetAsDialogue() { return Dialogue(this); }
|
|
||||||
|
|
||||||
// Capabilities
|
// Capabilities
|
||||||
virtual bool HasText() const { return false; }
|
virtual bool HasText() const { return false; }
|
||||||
|
@ -319,7 +318,6 @@ namespace Athenasub {
|
||||||
|
|
||||||
// Type
|
// Type
|
||||||
SectionEntryType GetType() const { return SECTION_ENTRY_STYLE; }
|
SectionEntryType GetType() const { return SECTION_ENTRY_STYLE; }
|
||||||
Style GetAsStyle() { return Style(this); }
|
|
||||||
|
|
||||||
// Read accessors
|
// Read accessors
|
||||||
virtual String GetName() const = 0;
|
virtual String GetName() const = 0;
|
||||||
|
|
|
@ -96,7 +96,7 @@ void CActionList::Start(const String name)
|
||||||
void CActionList::Finish()
|
void CActionList::Finish()
|
||||||
{
|
{
|
||||||
if (valid) {
|
if (valid) {
|
||||||
model->ProcessActionList(ActionList(this));
|
model->ProcessActionList(*this);
|
||||||
actions.clear();
|
actions.clear();
|
||||||
valid = false;
|
valid = false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -60,10 +60,11 @@ void CModel::DispatchNotifications(Notification notification) const
|
||||||
|
|
||||||
////////////////////////////
|
////////////////////////////
|
||||||
// Processes an action list
|
// Processes an action list
|
||||||
void CModel::ProcessActionList(ActionList _actionList,int type)
|
void CModel::ProcessActionList(CActionList &_actionList,int type)
|
||||||
{
|
{
|
||||||
// Copy the list
|
// Copy the list
|
||||||
shared_ptr<CActionList> actions = shared_ptr<CActionList>(new CActionList(*static_pointer_cast<CActionList>(_actionList)));
|
//shared_ptr<CActionList> actions = shared_ptr<CActionList>(new CActionList(*static_pointer_cast<CActionList>(_actionList)));
|
||||||
|
shared_ptr<CActionList> actions = shared_ptr<CActionList>(new CActionList(_actionList));
|
||||||
|
|
||||||
// Setup undo
|
// Setup undo
|
||||||
shared_ptr<CActionList> undo = shared_ptr<CActionList>(new CActionList(actions->model,actions->actionName,actions->owner,actions->undoAble));
|
shared_ptr<CActionList> undo = shared_ptr<CActionList>(new CActionList(actions->model,actions->actionName,actions->owner,actions->undoAble));
|
||||||
|
@ -224,7 +225,8 @@ void CModel::ActivateStack(ActionStack stack,bool isUndo,const String &owner)
|
||||||
(void) owner;
|
(void) owner;
|
||||||
|
|
||||||
// Process list
|
// Process list
|
||||||
ProcessActionList(stack.back(),isUndo?1:2);
|
//ProcessActionList(stack.back(),isUndo?1:2);
|
||||||
|
ProcessActionList(*static_pointer_cast<CActionList>(stack.back()),isUndo?1:2);
|
||||||
|
|
||||||
// Pop original
|
// Pop original
|
||||||
stack.pop_back();
|
stack.pop_back();
|
||||||
|
|
|
@ -62,7 +62,7 @@ namespace Athenasub {
|
||||||
bool readOnly;
|
bool readOnly;
|
||||||
Format format;
|
Format format;
|
||||||
|
|
||||||
void ProcessActionList(ActionList actionList,int type=0);
|
void ProcessActionList(CActionList &actionList,int type=0);
|
||||||
|
|
||||||
String GetUndoMessage(const String owner=L"") const;
|
String GetUndoMessage(const String owner=L"") const;
|
||||||
String GetRedoMessage(const String owner=L"") const;
|
String GetRedoMessage(const String owner=L"") const;
|
||||||
|
|
|
@ -50,15 +50,23 @@ int main()
|
||||||
|
|
||||||
try {
|
try {
|
||||||
// Set up the lib
|
// Set up the lib
|
||||||
cout << "Loading library... ";
|
if (false) {
|
||||||
HMODULE module = LoadLibrary(_T("athenasub.dll"));
|
cout << "Loading library... ";
|
||||||
if (!module) {
|
#ifdef WXDEBUG
|
||||||
cout << "Failed to load library, aborting.\n";
|
HMODULE module = LoadLibrary(_T("athenasub_d.dll"));
|
||||||
system("pause");
|
#else
|
||||||
return 1;
|
HMODULE module = LoadLibrary(_T("athenasub.dll"));
|
||||||
|
#endif
|
||||||
|
if (!module) {
|
||||||
|
cout << "Failed to load library, aborting.\n";
|
||||||
|
system("pause");
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
cout << "Done.\nCreating library...";
|
||||||
}
|
}
|
||||||
cout << "Done.\nCreating library...";
|
|
||||||
LibAthenaSub lib = Athenasub::Create(module,"Aegilib test program");
|
//LibAthenaSub lib = Athenasub::Create(module,"Aegilib test program");
|
||||||
|
LibAthenaSub lib = Athenasub::Create("Aegilib test program");
|
||||||
cout << "Done.\n";
|
cout << "Done.\n";
|
||||||
|
|
||||||
// Subtitles model
|
// Subtitles model
|
||||||
|
@ -133,6 +141,8 @@ int main()
|
||||||
control->SaveFile(L"subs_out2.ass",L"UTF-8");
|
control->SaveFile(L"subs_out2.ass",L"UTF-8");
|
||||||
control->Undo();
|
control->Undo();
|
||||||
control->SaveFile(L"subs_out3.ass",L"UTF-8");
|
control->SaveFile(L"subs_out3.ass",L"UTF-8");
|
||||||
|
|
||||||
|
system("pause");
|
||||||
}
|
}
|
||||||
|
|
||||||
catch (std::exception &e) {
|
catch (std::exception &e) {
|
||||||
|
|
Loading…
Reference in New Issue