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_style.h
|
|
|
|
/// @see ass_style.cpp
|
|
|
|
/// @ingroup subs_storage
|
|
|
|
///
|
2006-01-16 22:02:54 +01:00
|
|
|
|
2009-09-11 04:36:34 +02:00
|
|
|
#ifndef AGI_PRE
|
2007-09-12 01:22:26 +02:00
|
|
|
#include <wx/colour.h>
|
2009-09-11 04:36:34 +02:00
|
|
|
#endif
|
|
|
|
|
2006-01-16 22:02:54 +01:00
|
|
|
#include "ass_entry.h"
|
|
|
|
|
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 AssColor
|
|
|
|
/// @brief DOCME
|
|
|
|
///
|
|
|
|
/// DOCME
|
2010-07-08 09:14:55 +02:00
|
|
|
struct AssColor {
|
|
|
|
int r; ///< Red component
|
|
|
|
int g; ///< Green component
|
|
|
|
int b; ///< Blue component
|
|
|
|
int a; ///< Alpha component
|
2006-01-16 22:02:54 +01:00
|
|
|
|
|
|
|
AssColor();
|
2010-07-08 09:14:55 +02:00
|
|
|
AssColor(int r, int g, int b, int a = 0);
|
|
|
|
AssColor(const wxColour &color);
|
2006-01-16 22:02:54 +01:00
|
|
|
|
2010-07-08 09:14:55 +02:00
|
|
|
bool operator==(const AssColor &col) const;
|
|
|
|
bool operator!=(const AssColor &col) const;
|
2007-04-17 01:41:06 +02:00
|
|
|
|
2006-01-16 22:02:54 +01:00
|
|
|
wxColor GetWXColor(); // Return as a wxColor
|
2007-01-03 22:18:19 +01:00
|
|
|
void SetWXColor(const wxColor &color); // Sets from a wxColor
|
2011-12-26 23:20:49 +01:00
|
|
|
void Parse(wxString const& value); // Parse SSA or ASS-style color
|
2010-07-08 09:14:55 +02:00
|
|
|
wxString GetASSFormatted(bool alpha,bool stripped=false,bool isStyle=false) const; // Gets color formated in ASS format
|
|
|
|
wxString GetSSAFormatted() const;
|
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 AssStyle
|
|
|
|
/// @brief DOCME
|
|
|
|
///
|
|
|
|
/// DOCME
|
2006-01-16 22:02:54 +01:00
|
|
|
class AssStyle : public AssEntry {
|
2011-12-22 22:15:10 +01:00
|
|
|
// Parses raw ASS/SSA data into everything else
|
|
|
|
bool Parse(wxString data,int version=1);
|
2006-01-16 22:02:54 +01:00
|
|
|
public:
|
2011-12-22 22:15:10 +01:00
|
|
|
wxString name; ///< Name of the style; must be case-insensitively unique within a file despite being case-sensitive
|
|
|
|
wxString font; ///< Font face name
|
|
|
|
double fontsize; ///< Font size
|
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
|
|
|
|
2011-12-22 22:15:10 +01:00
|
|
|
AssColor primary; ///< Default text color
|
|
|
|
AssColor secondary; ///< Text color for not-yet-reached karaoke syllables
|
|
|
|
AssColor outline; ///< Outline color
|
|
|
|
AssColor shadow; ///< Shadow color
|
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
|
|
|
|
2006-01-16 22:02:54 +01:00
|
|
|
bool bold;
|
|
|
|
bool italic;
|
|
|
|
bool underline;
|
|
|
|
bool strikeout;
|
|
|
|
|
2011-12-22 22:15:10 +01:00
|
|
|
double scalex; ///< Font x scale with 100 = 100%
|
|
|
|
double scaley; ///< Font y scale with 100 = 100%
|
|
|
|
double spacing; ///< Additional spacing between characters in pixels
|
|
|
|
double angle; ///< Counterclockwise z rotation in degrees
|
|
|
|
int borderstyle; ///< 1: Normal; 3: Opaque box; others are unused in Aegisub
|
|
|
|
double outline_w; ///< Outline width in pixels
|
|
|
|
double shadow_w; ///< Shadow distance in pixels
|
|
|
|
int alignment; ///< \an-style line alignment
|
|
|
|
int Margin[4]; ///< Left/Right/Vertical/Unused margins in pixels
|
|
|
|
int encoding; ///< ASS font encoding needed for some non-unicode fonts
|
|
|
|
int relativeTo; ///< ASS2 extension; do not use
|
|
|
|
|
|
|
|
/// Update the raw line data after one or more of the public members have been changed
|
|
|
|
void UpdateData();
|
|
|
|
|
|
|
|
/// @brief Get a list of valid ASS font encodings
|
2007-04-17 00:13:09 +02:00
|
|
|
static void GetEncodings(wxArrayString &encodingStrings);
|
|
|
|
|
2006-01-16 22:02:54 +01:00
|
|
|
AssStyle();
|
2007-01-08 02:00:44 +01:00
|
|
|
AssStyle(wxString data,int version=1);
|
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
|
|
|
|
2011-12-22 22:15:10 +01:00
|
|
|
wxString GetSSAText() const;
|
|
|
|
ASS_EntryType GetType() const { return ENTRY_STYLE; }
|
|
|
|
AssEntry *Clone() const;
|
|
|
|
};
|