2006-01-16 22:02:54 +01:00
|
|
|
// Copyright (c) 2005, Rodrigo Braz Monteiro
|
|
|
|
// All rights reserved.
|
|
|
|
//
|
|
|
|
// Redistribution and use in source and binary forms, with or without
|
|
|
|
// modification, are permitted provided that the following conditions are met:
|
|
|
|
//
|
|
|
|
// * Redistributions of source code must retain the above copyright notice,
|
|
|
|
// this list of conditions and the following disclaimer.
|
|
|
|
// * Redistributions in binary form must reproduce the above copyright notice,
|
|
|
|
// this list of conditions and the following disclaimer in the documentation
|
|
|
|
// and/or other materials provided with the distribution.
|
|
|
|
// * Neither the name of the Aegisub Group nor the names of its contributors
|
|
|
|
// may be used to endorse or promote products derived from this software
|
|
|
|
// without specific prior written permission.
|
|
|
|
//
|
|
|
|
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
|
|
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
|
|
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
|
|
// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
|
|
|
// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
|
|
|
// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
|
|
|
// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
|
|
|
// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
|
|
|
// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
|
|
|
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
|
|
|
// POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
//
|
2009-07-29 07:43:02 +02:00
|
|
|
// Aegisub Project http://www.aegisub.org/
|
2006-01-16 22:02:54 +01:00
|
|
|
//
|
2009-07-29 07:43:02 +02:00
|
|
|
// $Id$
|
|
|
|
|
|
|
|
/// @file ass_dialogue.h
|
|
|
|
/// @see ass_dialogue.cpp
|
|
|
|
/// @ingroup subs_storage
|
|
|
|
///
|
2006-01-16 22:02:54 +01:00
|
|
|
|
2009-09-11 04:36:34 +02:00
|
|
|
#ifndef AGI_PRE
|
2006-01-16 22:02:54 +01:00
|
|
|
#include <vector>
|
2009-09-11 04:36:34 +02:00
|
|
|
#endif
|
|
|
|
|
2006-01-16 22:02:54 +01:00
|
|
|
#include "ass_entry.h"
|
|
|
|
#include "ass_time.h"
|
|
|
|
|
|
|
|
enum ASS_BlockType {
|
|
|
|
BLOCK_BASE,
|
|
|
|
BLOCK_PLAIN,
|
|
|
|
BLOCK_OVERRIDE,
|
|
|
|
BLOCK_DRAWING
|
|
|
|
};
|
|
|
|
|
2010-06-24 03:24:43 +02:00
|
|
|
class AssOverrideParameter;
|
|
|
|
class AssOverrideTag;
|
2006-01-16 22:02:54 +01:00
|
|
|
|
Note: This was done using a script! it's far from perfect but 95% of the work has been done already formatting-wise.
Document all functions, class, struct, union, enum, macro, variable, typedefs. This isn't the actual document in itself but empty documentation using any old documentation if it was there.
This was done using exuberant ctags to get tag info, then a TCL script to parse/remove old comments and convert them into Doxygen-style.
Some notes:
* Anything labeled 'DOCME' needs to be documented, @param and @return have been left blank as it would be annoying to delete the 'DOCME' from every one of those.
* Some multiline comments may have been munged into single line comments
* Leave the /// comments above global variables with a space, if they're harder to read then we'll be less likey to use them.
* Enum comments can go after the enumeration itself '[value] /// comment'
* include/aegisub/*.h haven't been converted yet, this will be done in a later commit
* Some documentation blocks are in the wrong place, in the .h when it should be in the .cpp, or vice versa.
See http://devel.aegisub.org/wiki/Doxygen for some details on Doxygen and a 'style guide'.
Originally committed to SVN as r3312.
2009-07-30 00:59:22 +02:00
|
|
|
/// DOCME
|
|
|
|
/// @class AssDialogueBlock
|
|
|
|
|
|
|
|
/// @brief AssDialogue Blocks
|
|
|
|
///
|
|
|
|
/// A block is each group in the text field of an AssDialogue
|
2009-07-30 05:36:53 +02:00
|
|
|
/// @verbatim
|
Note: This was done using a script! it's far from perfect but 95% of the work has been done already formatting-wise.
Document all functions, class, struct, union, enum, macro, variable, typedefs. This isn't the actual document in itself but empty documentation using any old documentation if it was there.
This was done using exuberant ctags to get tag info, then a TCL script to parse/remove old comments and convert them into Doxygen-style.
Some notes:
* Anything labeled 'DOCME' needs to be documented, @param and @return have been left blank as it would be annoying to delete the 'DOCME' from every one of those.
* Some multiline comments may have been munged into single line comments
* Leave the /// comments above global variables with a space, if they're harder to read then we'll be less likey to use them.
* Enum comments can go after the enumeration itself '[value] /// comment'
* include/aegisub/*.h haven't been converted yet, this will be done in a later commit
* Some documentation blocks are in the wrong place, in the .h when it should be in the .cpp, or vice versa.
See http://devel.aegisub.org/wiki/Doxygen for some details on Doxygen and a 'style guide'.
Originally committed to SVN as r3312.
2009-07-30 00:59:22 +02:00
|
|
|
/// Yes, I {\i1}am{\i0} here.
|
|
|
|
///
|
|
|
|
/// Gets split in five blocks:
|
|
|
|
/// "Yes, I " (Plain)
|
2009-07-30 05:36:53 +02:00
|
|
|
/// "\\i1" (Override)
|
Note: This was done using a script! it's far from perfect but 95% of the work has been done already formatting-wise.
Document all functions, class, struct, union, enum, macro, variable, typedefs. This isn't the actual document in itself but empty documentation using any old documentation if it was there.
This was done using exuberant ctags to get tag info, then a TCL script to parse/remove old comments and convert them into Doxygen-style.
Some notes:
* Anything labeled 'DOCME' needs to be documented, @param and @return have been left blank as it would be annoying to delete the 'DOCME' from every one of those.
* Some multiline comments may have been munged into single line comments
* Leave the /// comments above global variables with a space, if they're harder to read then we'll be less likey to use them.
* Enum comments can go after the enumeration itself '[value] /// comment'
* include/aegisub/*.h haven't been converted yet, this will be done in a later commit
* Some documentation blocks are in the wrong place, in the .h when it should be in the .cpp, or vice versa.
See http://devel.aegisub.org/wiki/Doxygen for some details on Doxygen and a 'style guide'.
Originally committed to SVN as r3312.
2009-07-30 00:59:22 +02:00
|
|
|
/// "am" (Plain)
|
2009-07-30 05:36:53 +02:00
|
|
|
/// "\\i0" (Override)
|
Note: This was done using a script! it's far from perfect but 95% of the work has been done already formatting-wise.
Document all functions, class, struct, union, enum, macro, variable, typedefs. This isn't the actual document in itself but empty documentation using any old documentation if it was there.
This was done using exuberant ctags to get tag info, then a TCL script to parse/remove old comments and convert them into Doxygen-style.
Some notes:
* Anything labeled 'DOCME' needs to be documented, @param and @return have been left blank as it would be annoying to delete the 'DOCME' from every one of those.
* Some multiline comments may have been munged into single line comments
* Leave the /// comments above global variables with a space, if they're harder to read then we'll be less likey to use them.
* Enum comments can go after the enumeration itself '[value] /// comment'
* include/aegisub/*.h haven't been converted yet, this will be done in a later commit
* Some documentation blocks are in the wrong place, in the .h when it should be in the .cpp, or vice versa.
See http://devel.aegisub.org/wiki/Doxygen for some details on Doxygen and a 'style guide'.
Originally committed to SVN as r3312.
2009-07-30 00:59:22 +02:00
|
|
|
/// " here." (Plain)
|
|
|
|
///
|
|
|
|
/// Also note how {}s are discarded.
|
2011-12-26 23:21:08 +01:00
|
|
|
/// Override blocks are further divided in AssOverrideTags.
|
Note: This was done using a script! it's far from perfect but 95% of the work has been done already formatting-wise.
Document all functions, class, struct, union, enum, macro, variable, typedefs. This isn't the actual document in itself but empty documentation using any old documentation if it was there.
This was done using exuberant ctags to get tag info, then a TCL script to parse/remove old comments and convert them into Doxygen-style.
Some notes:
* Anything labeled 'DOCME' needs to be documented, @param and @return have been left blank as it would be annoying to delete the 'DOCME' from every one of those.
* Some multiline comments may have been munged into single line comments
* Leave the /// comments above global variables with a space, if they're harder to read then we'll be less likey to use them.
* Enum comments can go after the enumeration itself '[value] /// comment'
* include/aegisub/*.h haven't been converted yet, this will be done in a later commit
* Some documentation blocks are in the wrong place, in the .h when it should be in the .cpp, or vice versa.
See http://devel.aegisub.org/wiki/Doxygen for some details on Doxygen and a 'style guide'.
Originally committed to SVN as r3312.
2009-07-30 00:59:22 +02:00
|
|
|
///
|
|
|
|
/// The GetText() method generates a new value for the "text" field from
|
|
|
|
/// the other fields in the specific class, and returns the new value.
|
2009-07-30 05:36:53 +02:00
|
|
|
/// @endverbatim
|
2006-01-16 22:02:54 +01:00
|
|
|
class AssDialogueBlock {
|
2011-12-26 23:21:08 +01:00
|
|
|
protected:
|
|
|
|
/// Text of this block
|
2006-01-16 22:02:54 +01:00
|
|
|
wxString text;
|
2011-12-26 23:21:08 +01:00
|
|
|
public:
|
|
|
|
AssDialogueBlock(wxString const& text) : text(text) { }
|
2010-06-24 03:24:43 +02:00
|
|
|
virtual ~AssDialogueBlock() { }
|
2006-01-16 22:02:54 +01:00
|
|
|
|
2012-03-20 01:39:10 +01:00
|
|
|
virtual ASS_BlockType GetType() const = 0;
|
2008-01-14 01:30:00 +01:00
|
|
|
virtual wxString GetText() { return text; }
|
2006-01-16 22:02:54 +01:00
|
|
|
};
|
|
|
|
|
Note: This was done using a script! it's far from perfect but 95% of the work has been done already formatting-wise.
Document all functions, class, struct, union, enum, macro, variable, typedefs. This isn't the actual document in itself but empty documentation using any old documentation if it was there.
This was done using exuberant ctags to get tag info, then a TCL script to parse/remove old comments and convert them into Doxygen-style.
Some notes:
* Anything labeled 'DOCME' needs to be documented, @param and @return have been left blank as it would be annoying to delete the 'DOCME' from every one of those.
* Some multiline comments may have been munged into single line comments
* Leave the /// comments above global variables with a space, if they're harder to read then we'll be less likey to use them.
* Enum comments can go after the enumeration itself '[value] /// comment'
* include/aegisub/*.h haven't been converted yet, this will be done in a later commit
* Some documentation blocks are in the wrong place, in the .h when it should be in the .cpp, or vice versa.
See http://devel.aegisub.org/wiki/Doxygen for some details on Doxygen and a 'style guide'.
Originally committed to SVN as r3312.
2009-07-30 00:59:22 +02:00
|
|
|
/// @class AssDialogueBlockPlain
|
|
|
|
/// @brief DOCME
|
|
|
|
///
|
|
|
|
/// DOCME
|
2006-01-16 22:02:54 +01:00
|
|
|
class AssDialogueBlockPlain : public AssDialogueBlock {
|
|
|
|
public:
|
2012-03-20 01:39:10 +01:00
|
|
|
ASS_BlockType GetType() const { return BLOCK_PLAIN; }
|
2012-01-31 01:44:43 +01:00
|
|
|
AssDialogueBlockPlain(wxString const& text = wxString()) : AssDialogueBlock(text) { }
|
2006-01-16 22:02:54 +01:00
|
|
|
};
|
|
|
|
|
Note: This was done using a script! it's far from perfect but 95% of the work has been done already formatting-wise.
Document all functions, class, struct, union, enum, macro, variable, typedefs. This isn't the actual document in itself but empty documentation using any old documentation if it was there.
This was done using exuberant ctags to get tag info, then a TCL script to parse/remove old comments and convert them into Doxygen-style.
Some notes:
* Anything labeled 'DOCME' needs to be documented, @param and @return have been left blank as it would be annoying to delete the 'DOCME' from every one of those.
* Some multiline comments may have been munged into single line comments
* Leave the /// comments above global variables with a space, if they're harder to read then we'll be less likey to use them.
* Enum comments can go after the enumeration itself '[value] /// comment'
* include/aegisub/*.h haven't been converted yet, this will be done in a later commit
* Some documentation blocks are in the wrong place, in the .h when it should be in the .cpp, or vice versa.
See http://devel.aegisub.org/wiki/Doxygen for some details on Doxygen and a 'style guide'.
Originally committed to SVN as r3312.
2009-07-30 00:59:22 +02:00
|
|
|
/// @class AssDialogueBlockDrawing
|
|
|
|
/// @brief DOCME
|
|
|
|
///
|
|
|
|
/// DOCME
|
2006-01-16 22:02:54 +01:00
|
|
|
class AssDialogueBlockDrawing : public AssDialogueBlock {
|
|
|
|
public:
|
Note: This was done using a script! it's far from perfect but 95% of the work has been done already formatting-wise.
Document all functions, class, struct, union, enum, macro, variable, typedefs. This isn't the actual document in itself but empty documentation using any old documentation if it was there.
This was done using exuberant ctags to get tag info, then a TCL script to parse/remove old comments and convert them into Doxygen-style.
Some notes:
* Anything labeled 'DOCME' needs to be documented, @param and @return have been left blank as it would be annoying to delete the 'DOCME' from every one of those.
* Some multiline comments may have been munged into single line comments
* Leave the /// comments above global variables with a space, if they're harder to read then we'll be less likey to use them.
* Enum comments can go after the enumeration itself '[value] /// comment'
* include/aegisub/*.h haven't been converted yet, this will be done in a later commit
* Some documentation blocks are in the wrong place, in the .h when it should be in the .cpp, or vice versa.
See http://devel.aegisub.org/wiki/Doxygen for some details on Doxygen and a 'style guide'.
Originally committed to SVN as r3312.
2009-07-30 00:59:22 +02:00
|
|
|
/// DOCME
|
2006-01-16 22:02:54 +01:00
|
|
|
int Scale;
|
|
|
|
|
2012-03-20 01:39:10 +01:00
|
|
|
ASS_BlockType GetType() const { return BLOCK_DRAWING; }
|
2012-03-10 03:16:08 +01:00
|
|
|
AssDialogueBlockDrawing(wxString const& text, int scale) : AssDialogueBlock(text), Scale(scale) { }
|
2007-10-18 04:47:13 +02:00
|
|
|
void TransformCoords(int trans_x,int trans_y,double mult_x,double mult_y);
|
2006-01-16 22:02:54 +01:00
|
|
|
};
|
|
|
|
|
Note: This was done using a script! it's far from perfect but 95% of the work has been done already formatting-wise.
Document all functions, class, struct, union, enum, macro, variable, typedefs. This isn't the actual document in itself but empty documentation using any old documentation if it was there.
This was done using exuberant ctags to get tag info, then a TCL script to parse/remove old comments and convert them into Doxygen-style.
Some notes:
* Anything labeled 'DOCME' needs to be documented, @param and @return have been left blank as it would be annoying to delete the 'DOCME' from every one of those.
* Some multiline comments may have been munged into single line comments
* Leave the /// comments above global variables with a space, if they're harder to read then we'll be less likey to use them.
* Enum comments can go after the enumeration itself '[value] /// comment'
* include/aegisub/*.h haven't been converted yet, this will be done in a later commit
* Some documentation blocks are in the wrong place, in the .h when it should be in the .cpp, or vice versa.
See http://devel.aegisub.org/wiki/Doxygen for some details on Doxygen and a 'style guide'.
Originally committed to SVN as r3312.
2009-07-30 00:59:22 +02:00
|
|
|
/// @class AssDialogueBlockOverride
|
|
|
|
/// @brief DOCME
|
|
|
|
///
|
|
|
|
/// DOCME
|
2006-01-16 22:02:54 +01:00
|
|
|
class AssDialogueBlockOverride : public AssDialogueBlock {
|
|
|
|
public:
|
2012-01-31 01:44:43 +01:00
|
|
|
AssDialogueBlockOverride(wxString const& text = wxString()) : AssDialogueBlock(text) { }
|
2006-01-16 22:02:54 +01:00
|
|
|
~AssDialogueBlockOverride();
|
Note: This was done using a script! it's far from perfect but 95% of the work has been done already formatting-wise.
Document all functions, class, struct, union, enum, macro, variable, typedefs. This isn't the actual document in itself but empty documentation using any old documentation if it was there.
This was done using exuberant ctags to get tag info, then a TCL script to parse/remove old comments and convert them into Doxygen-style.
Some notes:
* Anything labeled 'DOCME' needs to be documented, @param and @return have been left blank as it would be annoying to delete the 'DOCME' from every one of those.
* Some multiline comments may have been munged into single line comments
* Leave the /// comments above global variables with a space, if they're harder to read then we'll be less likey to use them.
* Enum comments can go after the enumeration itself '[value] /// comment'
* include/aegisub/*.h haven't been converted yet, this will be done in a later commit
* Some documentation blocks are in the wrong place, in the .h when it should be in the .cpp, or vice versa.
See http://devel.aegisub.org/wiki/Doxygen for some details on Doxygen and a 'style guide'.
Originally committed to SVN as r3312.
2009-07-30 00:59:22 +02:00
|
|
|
|
|
|
|
/// DOCME
|
2006-01-16 22:02:54 +01:00
|
|
|
std::vector<AssOverrideTag*> Tags;
|
|
|
|
|
Note: This was done using a script! it's far from perfect but 95% of the work has been done already formatting-wise.
Document all functions, class, struct, union, enum, macro, variable, typedefs. This isn't the actual document in itself but empty documentation using any old documentation if it was there.
This was done using exuberant ctags to get tag info, then a TCL script to parse/remove old comments and convert them into Doxygen-style.
Some notes:
* Anything labeled 'DOCME' needs to be documented, @param and @return have been left blank as it would be annoying to delete the 'DOCME' from every one of those.
* Some multiline comments may have been munged into single line comments
* Leave the /// comments above global variables with a space, if they're harder to read then we'll be less likey to use them.
* Enum comments can go after the enumeration itself '[value] /// comment'
* include/aegisub/*.h haven't been converted yet, this will be done in a later commit
* Some documentation blocks are in the wrong place, in the .h when it should be in the .cpp, or vice versa.
See http://devel.aegisub.org/wiki/Doxygen for some details on Doxygen and a 'style guide'.
Originally committed to SVN as r3312.
2009-07-30 00:59:22 +02:00
|
|
|
|
|
|
|
/// @brief DOCME
|
2012-03-25 06:05:06 +02:00
|
|
|
/// @return
|
Note: This was done using a script! it's far from perfect but 95% of the work has been done already formatting-wise.
Document all functions, class, struct, union, enum, macro, variable, typedefs. This isn't the actual document in itself but empty documentation using any old documentation if it was there.
This was done using exuberant ctags to get tag info, then a TCL script to parse/remove old comments and convert them into Doxygen-style.
Some notes:
* Anything labeled 'DOCME' needs to be documented, @param and @return have been left blank as it would be annoying to delete the 'DOCME' from every one of those.
* Some multiline comments may have been munged into single line comments
* Leave the /// comments above global variables with a space, if they're harder to read then we'll be less likey to use them.
* Enum comments can go after the enumeration itself '[value] /// comment'
* include/aegisub/*.h haven't been converted yet, this will be done in a later commit
* Some documentation blocks are in the wrong place, in the .h when it should be in the .cpp, or vice versa.
See http://devel.aegisub.org/wiki/Doxygen for some details on Doxygen and a 'style guide'.
Originally committed to SVN as r3312.
2009-07-30 00:59:22 +02:00
|
|
|
///
|
2012-03-20 01:39:10 +01:00
|
|
|
ASS_BlockType GetType() const { return BLOCK_OVERRIDE; }
|
2006-01-16 22:02:54 +01:00
|
|
|
wxString GetText();
|
|
|
|
void ParseTags(); // Parses tags
|
2010-06-04 05:08:04 +02:00
|
|
|
void AddTag(wxString const& tag);
|
2009-08-01 05:27:13 +02:00
|
|
|
|
|
|
|
/// Type of callback function passed to ProcessParameters
|
|
|
|
typedef void (*ProcessParametersCallback)(wxString,int,AssOverrideParameter*,void *);
|
2012-03-25 06:05:06 +02:00
|
|
|
/// @brief Process parameters via callback
|
2009-08-01 05:27:13 +02:00
|
|
|
/// @param callback The callback function to call per tag paramer
|
|
|
|
/// @param userData User data to pass to callback function
|
|
|
|
void ProcessParameters(ProcessParametersCallback callback,void *userData);
|
2006-01-16 22:02:54 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
|
Note: This was done using a script! it's far from perfect but 95% of the work has been done already formatting-wise.
Document all functions, class, struct, union, enum, macro, variable, typedefs. This isn't the actual document in itself but empty documentation using any old documentation if it was there.
This was done using exuberant ctags to get tag info, then a TCL script to parse/remove old comments and convert them into Doxygen-style.
Some notes:
* Anything labeled 'DOCME' needs to be documented, @param and @return have been left blank as it would be annoying to delete the 'DOCME' from every one of those.
* Some multiline comments may have been munged into single line comments
* Leave the /// comments above global variables with a space, if they're harder to read then we'll be less likey to use them.
* Enum comments can go after the enumeration itself '[value] /// comment'
* include/aegisub/*.h haven't been converted yet, this will be done in a later commit
* Some documentation blocks are in the wrong place, in the .h when it should be in the .cpp, or vice versa.
See http://devel.aegisub.org/wiki/Doxygen for some details on Doxygen and a 'style guide'.
Originally committed to SVN as r3312.
2009-07-30 00:59:22 +02:00
|
|
|
|
|
|
|
/// DOCME
|
|
|
|
/// @class AssDialogue
|
|
|
|
/// @brief DOCME
|
|
|
|
///
|
|
|
|
/// DOCME
|
2006-01-16 22:02:54 +01:00
|
|
|
class AssDialogue : public AssEntry {
|
2010-07-08 09:14:55 +02:00
|
|
|
wxString GetData(bool ssa) const;
|
2006-01-16 22:02:54 +01:00
|
|
|
public:
|
Note: This was done using a script! it's far from perfect but 95% of the work has been done already formatting-wise.
Document all functions, class, struct, union, enum, macro, variable, typedefs. This isn't the actual document in itself but empty documentation using any old documentation if it was there.
This was done using exuberant ctags to get tag info, then a TCL script to parse/remove old comments and convert them into Doxygen-style.
Some notes:
* Anything labeled 'DOCME' needs to be documented, @param and @return have been left blank as it would be annoying to delete the 'DOCME' from every one of those.
* Some multiline comments may have been munged into single line comments
* Leave the /// comments above global variables with a space, if they're harder to read then we'll be less likey to use them.
* Enum comments can go after the enumeration itself '[value] /// comment'
* include/aegisub/*.h haven't been converted yet, this will be done in a later commit
* Some documentation blocks are in the wrong place, in the .h when it should be in the .cpp, or vice versa.
See http://devel.aegisub.org/wiki/Doxygen for some details on Doxygen and a 'style guide'.
Originally committed to SVN as r3312.
2009-07-30 00:59:22 +02:00
|
|
|
|
2010-05-19 02:44:44 +02:00
|
|
|
/// Contains information about each block of text
|
|
|
|
std::vector<AssDialogueBlock*> Blocks;
|
|
|
|
|
|
|
|
/// Is this a comment line?
|
|
|
|
bool Comment;
|
|
|
|
/// Layer number
|
|
|
|
int Layer;
|
|
|
|
/// Margins: 0 = Left, 1 = Right, 2 = Top (Vertical), 3 = Bottom
|
|
|
|
int Margin[4];
|
|
|
|
/// Starting time
|
|
|
|
AssTime Start;
|
|
|
|
/// Ending time
|
|
|
|
AssTime End;
|
|
|
|
/// Style name
|
|
|
|
wxString Style;
|
|
|
|
/// Actor name
|
|
|
|
wxString Actor;
|
|
|
|
/// Effect name
|
|
|
|
wxString Effect;
|
|
|
|
/// Raw text data
|
|
|
|
wxString Text;
|
2006-01-16 22:02:54 +01:00
|
|
|
|
2010-07-08 09:14:55 +02:00
|
|
|
ASS_EntryType GetType() const { return ENTRY_DIALOGUE; }
|
2006-02-27 03:23:50 +01:00
|
|
|
|
2010-06-24 03:24:43 +02:00
|
|
|
/// @brief Parse raw ASS data into everything else
|
|
|
|
/// @param data ASS line
|
|
|
|
/// @param version ASS version to try first (4, 4+, ASS2)
|
|
|
|
/// @return Did it successfully parse?
|
|
|
|
bool Parse(wxString data,int version=1);
|
|
|
|
/// Parse text as ASS to generate block information
|
|
|
|
void ParseASSTags();
|
|
|
|
/// Clear all blocks, ALWAYS call this after you're done processing tags
|
|
|
|
void ClearBlocks();
|
2007-04-14 17:26:46 +02:00
|
|
|
|
2012-03-25 06:05:06 +02:00
|
|
|
/// @brief Process parameters via callback
|
2010-06-24 03:24:43 +02:00
|
|
|
/// @param callback The callback function to call per tag parameter
|
2009-08-01 05:27:13 +02:00
|
|
|
/// @param userData User data to pass to callback function
|
2010-06-24 03:24:43 +02:00
|
|
|
void ProcessParameters(AssDialogueBlockOverride::ProcessParametersCallback callback,void *userData=NULL);
|
|
|
|
/// Strip all ASS tags from the text
|
|
|
|
void StripTags();
|
|
|
|
/// Strip a specific ASS tag from the text
|
|
|
|
void StripTag(wxString tagName);
|
|
|
|
/// Get text without tags
|
|
|
|
wxString GetStrippedText() const;
|
|
|
|
|
|
|
|
/// If blocks have been parsed, update the text from their current value
|
|
|
|
void UpdateText();
|
2010-07-08 09:14:55 +02:00
|
|
|
const wxString GetEntryData() const;
|
2010-06-24 03:24:43 +02:00
|
|
|
/// Do nothing
|
2011-12-24 01:36:30 +01:00
|
|
|
void SetEntryData(wxString const&) { }
|
2010-06-24 03:24:43 +02:00
|
|
|
|
2010-07-20 05:11:11 +02:00
|
|
|
template<int which>
|
|
|
|
void SetMarginString(const wxString value) { SetMarginString(value, which);}
|
2012-03-25 06:05:06 +02:00
|
|
|
/// @brief Set a margin
|
2010-06-24 03:24:43 +02:00
|
|
|
/// @param value New value of the margin
|
|
|
|
/// @param which 0 = left, 1 = right, 2 = vertical/top, 3 = bottom
|
|
|
|
void SetMarginString(const wxString value,int which);
|
|
|
|
/// @brief Get a margin
|
|
|
|
/// @param which 0 = left, 1 = right, 2 = vertical/top, 3 = bottom
|
|
|
|
/// @param pad Pad the number to four digits
|
2010-07-08 09:14:55 +02:00
|
|
|
wxString GetMarginString(int which,bool pad=true) const;
|
2010-06-24 03:24:43 +02:00
|
|
|
/// Get the line as SSA rather than ASS
|
2010-07-08 09:14:55 +02:00
|
|
|
wxString GetSSAText() const;
|
2010-06-24 03:24:43 +02:00
|
|
|
/// Does this line collide with the passed line?
|
2012-03-20 01:39:10 +01:00
|
|
|
bool CollidesWith(const AssDialogue *target) const;
|
2006-01-16 22:02:54 +01:00
|
|
|
|
2009-06-07 02:22:36 +02:00
|
|
|
AssEntry *Clone() const;
|
2006-02-27 10:07:08 +01:00
|
|
|
|
2006-01-16 22:02:54 +01:00
|
|
|
AssDialogue();
|
2010-06-22 02:03:11 +02:00
|
|
|
AssDialogue(AssDialogue const&);
|
2007-01-08 02:00:44 +01:00
|
|
|
AssDialogue(wxString data,int version=1);
|
2006-01-16 22:02:54 +01:00
|
|
|
~AssDialogue();
|
|
|
|
};
|