Commit Graph

51 Commits

Author SHA1 Message Date
Thomas Goyne 6fad60e58d Use NSDMIs where applicable 2013-12-11 18:50:12 -08:00
Thomas Goyne a7f4fb5b87 Run clang-modernize on things 2013-11-23 09:57:22 -08:00
Thomas Goyne 1e0f08c0ed Mostly purge wxWidgets from non-UI stuff
Use boost::filesystem::path for all paths, and std::string for all other
strings, converting to/from wxString as close to the actual uses of wx
as possible.

Where possible, replace the uses of non-UI wxWidgets functionality with
the additions to the standard library in C++11, or the equivalents in
boost.

Move the path token management logic to libaegisub (and rewrite it in
the process).

Add a basic thread pool based on asio and std::thread to libaegisub.

This touches nearly every file in the project and a nontrivial amount of
code had to be rewritten entirely, so there's probably a lot of broken
stuff.
2013-02-06 13:22:15 -08:00
Thomas Goyne 451de69e54 Trim whitespace from all of the style fields when parsing. Closes #1565. 2013-01-01 21:00:06 -08:00
Thomas Goyne b1cd2db023 Don't throw exceptions from destructors 2013-01-01 20:55:00 -08:00
Thomas Goyne 3ec82952f8 Partially de-wxify AssStyle 2012-12-31 07:09:31 -08:00
Thomas Goyne 9b44f92235 Make AssEntry purely a base class and add AssInfo
Now that all the other junk is being dropped from the file, script info
lines are the only thing left which was a concrete AssEntry, and
AssEntry wasn't actually a very good way to store them.
2012-12-07 18:55:29 -08:00
Thomas Goyne 96cf5ea7ed Kill the #ifndef AGI_PRE guards
They don't actually improve compilation performance and make it more
annoying to modify what things are in the precompiled header.
2012-12-02 06:33:29 -08:00
Thomas Goyne ff03fef2db Use the C++ versions of C headers 2012-12-01 17:24:59 -08:00
Thomas Goyne f337db86d3 Make AssStyle::UpdateData and GetSSAText less weird 2012-12-01 17:24:59 -08:00
Thomas Goyne 4e8e5b597c Change AssEntry::group to an enum 2012-11-25 14:01:50 -08:00
Thomas Goyne ea5428b65f Replace AssColor with agi::Color
Add agi::Color, and replace AssColor and all uses of wxColor that are
not immediately passed to/from wx with it.
2012-11-10 18:05:56 -08:00
Thomas Goyne ce05857bfa Use std::tr1::array for AssStyle::Margin
This eliminates the need for an explicit operator= on AssStyle.
2012-10-26 17:26:53 -07:00
Thomas Goyne e44c47c863 Remove $Id$ markers since git doesn't support them 2012-10-25 17:39:49 -07:00
Thomas Goyne ff6394c95e Throw only real exceptions from subtitle io stuff 2012-10-25 17:39:49 -07:00
Thomas Goyne c7fd04a739 Rename ASS -> Ass in symbol names
Most types and functions used Ass, but a decent number used ASS, so make
them consistent.
2012-10-16 09:52:19 -07:00
Thomas Goyne 7410e37e07 Fix some places where the margin count wasn't updated when removing ASS2 support 2012-10-12 14:54:09 -07:00
Thomas Goyne a1fad1f947 Drop support for ASS2
It is very unlikely that anyone has ever actually used ASS2 for
anything, and in practice it was not usable anyway as the bottom margin
was always either ignored or blindly overwritten.
2012-10-12 14:54:08 -07:00
cantabile 3193e05747 Use correct format specifier in AssColor::GetSSAFormatted()
Avoids a ton of assertion failures when saving SSA files.

Originally committed to SVN as r6942.
2012-07-24 02:39:35 +00:00
Thomas Goyne b32515da80 Strip trailing whitespace from all cpp and h files
Originally committed to SVN as r6600.
2012-03-25 04:05:06 +00:00
Thomas Goyne 6f167e9293 Add functions for converting between SSA and ASS aligns to AssStyle
Originally committed to SVN as r6598.
2012-03-25 04:04:54 +00:00
Thomas Goyne 75ae053958 Make some stuff const
Originally committed to SVN as r6590.
2012-03-20 00:39:10 +00:00
Thomas Goyne 759b8433c1 Silence some clang warnings
Originally committed to SVN as r6558.
2012-03-10 02:16:08 +00:00
Thomas Goyne 1c2fb01f0a Copy the cached entry data in AssStyle's operator=. Closes #1453.
Originally committed to SVN as r6472.
2012-02-14 00:35:41 +00:00
Thomas Goyne a7d54f3d69 Make AssEntry::group const as it really should never change
Originally committed to SVN as r6408.
2012-02-01 00:47:38 +00:00
Thomas Goyne 92ae4a616e Fix truncation of all float fields in styles
Originally committed to SVN as r6367.
2012-01-26 20:17:31 +00:00
Thomas Goyne 15d49fb655 Revamp AssFile::AddLine and related functions to eliminate the statics and hopefully make it less brittle
Originally committed to SVN as r6231.
2012-01-08 01:34:30 +00:00
Thomas Goyne 4e06c198d0 Kill AssStyle::Get\SetMarginString, as it isn't really used for much of anything
Originally committed to SVN as r6221.
2012-01-08 01:33:26 +00:00
Thomas Goyne 7adbe07b4e Silence a bunch of PREFast warnings
Originally committed to SVN as r6162.
2011-12-26 22:20:49 +00:00
Thomas Goyne aba01b833a Allow nonintegral font sizes in styles
Originally committed to SVN as r6150.
2011-12-23 23:21:02 +00:00
Thomas Goyne eaf436657e Factor out a bunch of duplicated code in AssStyle::Parse
Originally committed to SVN as r6037.
2011-12-22 21:15:19 +00:00
Thomas Goyne 9eaad5f0b1 Document most of AssStyle and remove some unused code
Originally committed to SVN as r6036.
2011-12-22 21:15:10 +00:00
Thomas Goyne dbf3eea732 Remove pointless empty destructor from AssStyle
Originally committed to SVN as r6035.
2011-12-22 21:15:01 +00:00
Thomas Goyne d28c4c4d8b Kill AssEntry::Valid, as there wasn't actually any way to get a fully-constructed entry with it set to false
Originally committed to SVN as r6034.
2011-12-22 21:14:51 +00:00
Thomas Goyne ec9d50a43a Set shadow_w to the correct value in AssStyle's copy constructor
Originally committed to SVN as r5779.
2011-10-25 19:01:53 +00:00
Thomas Goyne cc147d1660 Eliminate uses of c_str made unnecessary by changed to wxString::Format in wx 2.9
Originally committed to SVN as r5612.
2011-09-28 19:43:48 +00:00
Thomas Goyne d990bbbb99 Eliminate all unnecessary uses of L and _T
Originally committed to SVN as r5611.
2011-09-28 19:43:11 +00:00
Thomas Goyne 46be23073e Fix a few gcc warnings
Originally committed to SVN as r4722.
2010-08-02 20:25:29 +00:00
Thomas Goyne 1da57a4be5 Make AssStyle::Clone ~15 times faster.
Originally committed to SVN as r4664.
2010-07-08 07:14:55 +00:00
Thomas Goyne c290b6b811 Silence some prefast warnings
Originally committed to SVN as r4472.
2010-06-11 02:24:59 +00:00
Thomas Goyne 2124a1dbd3 Rework how sorting works and add sorting by style
Rather than going through a ton of work to ensure that every AssEvent
has a sensible start time that happens to leave it in the right place
after sorting, simply sort only consecutive blocks of AssDialogues and
leave everything else untouched. Note that this results in different
behavior when there are multiple [Events] sections in a file -- rather
than moving lines between sections and keeping the number of lines per
section constant, each section keeps the lines it had.

As it's now easy to do, also add sorting by style name and end time.

Closes #614.

Originally committed to SVN as r4307.
2010-05-19 00:44:44 +00:00
Thomas Goyne 624df412ea Kill the horrifying PrettyFloat function and just use g instead of f everywhere it was used.
Originally committed to SVN as r4280.
2010-05-13 18:41:46 +00:00
Amar Takhar d348b4e33e Fix all the headers in *.cpp, this includes:
* Wrapping all headers that are in agi_pre.h with AGI_PRE.
 * Sorting alphabetically.

Originally committed to SVN as r3515.
2009-09-10 13:06:40 +00:00
Niels Martin Hansen b6a63c15e6 Adjust throwing of exceptions to the new style documented in exception.h.
(Good thing nothing is catching these yet, and it's the only case of "new style" exceptions being used.)

Originally committed to SVN as r3365.
2009-08-05 20:52:44 +00:00
Amar Takhar 6ee2f98349 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-29 22:59:22 +00:00
Amar Takhar 12aa34088a Switch all headers to using Doxygen and cleanup contact info
* Swap old email + website address with 'Aegisub Project http://www.aegisub.org/'
 * Set categories for all files (jfs)
 * Add descriptions for each file (jfs)
 * Add $Id$ keyword

Originally committed to SVN as r3310.
2009-07-29 05:43:02 +00:00
Niels Martin Hansen ff8c8e1817 Add exception.h declaring some base exception classes. For the sake of experimenting and showing the concept, change one (probably never thrown) exception to use the new style exceptions.
No new source files to compile, just a new header.

Originally committed to SVN as r3190.
2009-07-22 00:10:36 +00:00
Niels Martin Hansen a1677d3a2c The AssEntry::Clone() function ought to have been const all the time... make it. (Ugh, I had to make a const_cast in AssStyle::Clone().)
Originally committed to SVN as r3028.
2009-06-07 00:22:36 +00:00
Niels Martin Hansen 8ca726119f Fix #825 for good, I hope. Get some sense worked into the handling of AssEntry::StartMS and AssDialogue::Start using some private members and virtual getter/setter functions.
Originally committed to SVN as r2931.
2009-05-14 23:45:20 +00:00
Niels Martin Hansen 05e847b6d2 Make AssColor::Parse() also understand HTML colours with a bit of help from wx.
Originally committed to SVN as r2910.
2009-05-12 15:14:35 +00:00