Commit Graph

56 Commits

Author SHA1 Message Date
Thomas Goyne a7f4fb5b87 Run clang-modernize on things 2013-11-23 09:57:22 -08:00
Thomas Goyne 1cdd461023 Separate UI state info from functional ASS info headers a bit
Prefix script info entries that are just storing Aegisub UI state with
"Aegisub ", and use a separate AssFile method to get/set them.
2013-10-07 17:57:16 -07:00
Thomas Goyne a0d3dbc550 Extract Loading/Saving/Undo stuff from AssFile
Add SubsController, which deals with things like what subtitle file is
currently open, rather than the contents of the current subtitle file.
Move the rest of the relevant logic from FrameMain there in addition to
all of the stuff from AssFile.
2013-02-06 13:22:32 -08:00
Thomas Goyne 9a146d1fc0 Remove AssFile::loaded since it isn't actually used for anything 2013-02-06 13:22:17 -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 3ec82952f8 Partially de-wxify AssStyle 2012-12-31 07:09:31 -08:00
Thomas Goyne fee60be5db Announce the set of lines changed in commits
Currently this is only populated when commits are amended, for the
simple reason that it's the only time that AssFile knows what lines
changed. It is probably worth expanding this in the future.
2012-12-17 09:32:42 -08:00
Thomas Goyne 090905056b Remove spaces in > > in nested templates 2012-12-11 10:58:28 -08:00
Thomas Goyne 009518271a Document a few things and kill all remaining placeholders 2012-12-02 13:08:42 -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 b94547aa71 Drop format and header lines from the in-memory file representation
They're just pointless cruft, so drop them from the file when parsing
and re-add them when saving as ASS or SSA.
2012-11-24 16:24:00 -08:00
Thomas Goyne 06aaaff16b NULL -> nullptr 2012-11-13 08:51:01 -08:00
Thomas Goyne 83761d881a Convert AssFile::Line to an intrusive list
Gives O(1) pointer -> iterator conversions, better memory usage, better
performance, and overall slightly simplifies the code using it.
2012-11-10 18:05:56 -08:00
Thomas Goyne 28175aadbe Switch to boost.container for containers of incomplete types
STL containers are not required to support incomplete types, and while
most implementations do, clang's libc++ does not.
2012-11-10 18:05:56 -08:00
Thomas Goyne 10f0f5fc7b Kill AssFile::AddComment and just add it when writing the file 2012-11-10 18:05:55 -08:00
Thomas Goyne e44c47c863 Remove $Id$ markers since git doesn't support them 2012-10-25 17:39:49 -07:00
Thomas Goyne 7b3f2d0414 Remove pointless #pragma once from ass_file.h 2012-10-16 09:53:30 -07:00
Thomas Goyne 9547bc4ef2 Move some stuff from AssFile::Load to FrameMain::LoadSubtitles
This is still not a very good place for it, but AssFile really shouldn't
be mucking around in global program state.
2012-10-16 09:53:28 -07:00
Thomas Goyne a53432736c Get wxMessageBox out of AssFile 2012-10-16 09:52:47 -07:00
Thomas Goyne 33dd0abc7f Kill AssFile::GetWildcardList
It did not actually simplify or clarify any of the code that called it.
2012-10-16 09:52:47 -07:00
Thomas Goyne 006f820aea Move ass parsing logic from AssFile to ASSSubtitleFormat 2012-10-16 09:52:19 -07:00
Thomas Goyne a0c92f83f9 Fix some PVS-Studio warnings 2012-10-12 14:51:30 -07:00
Thomas Goyne 11a4ede9a0 Add Layer to the things lines can be sorted by
Originally committed to SVN as r6939.
2012-07-23 00:44:44 +00:00
Thomas Goyne a03b37bdef Move the CanSave logic to the subtitle formats as it's obviously format-specific
Originally committed to SVN as r6625.
2012-03-28 23:58:40 +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 a0b4da90f7 Add commands and menu entries to sort only the selected lines. Closes #1457.
Originally committed to SVN as r6542.
2012-03-07 22:41:12 +00:00
Thomas Goyne e5e2b84b15 Ensure that loaded files always have a style and dialogue line
Fixes crashes and general brokenness when opening invalid files.

Originally committed to SVN as r6479.
2012-02-16 21:21:35 +00:00
Thomas Goyne 3b0d2ae8e6 Add effect and actor to the things that lines can be sorted by
Originally committed to SVN as r6400.
2012-01-31 00:44:34 +00:00
Thomas Goyne 2094814077 Save the current row and scroll position in the file and restore it when the file is reopened. Closes #1417.
Originally committed to SVN as r6362.
2012-01-25 19:07:36 +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 8fdd5d987e Remove the encoding parameter from AssFile::SaveMemory, as it only supports utf-8, and simplify the implementation
Originally committed to SVN as r6220.
2012-01-08 01:33:19 +00:00
Thomas Goyne cae10121ed Fix a bunch of -pedantic stuff
Originally committed to SVN as r6181.
2011-12-28 21:27:06 +00:00
Thomas Goyne 2ad0342103 Make AssFile::GetScriptInfo slightly less dumb
Originally committed to SVN as r5775.
2011-10-25 01:16:36 +00:00
Thomas Goyne ab52f9a441 Move most of the autosave logic to AssFile and only autosave if there's actually been changes since the last autosave
Originally committed to SVN as r5680.
2011-09-29 18:17:27 +00:00
Thomas Goyne df100fb5a5 Pass a project context to AssExportFilter::GetConfigDialogWindow so that export filters don't have to use things like AssFile::top and VideoContext::Get
Originally committed to SVN as r5629.
2011-09-28 19:46:53 +00:00
Thomas Goyne 67ab06e830 Add an optional argument to AssFile::Commit which indicates that only a single line was changed. Currently used only to cut down on file copies when coalescing.
Originally committed to SVN as r5614.
2011-09-28 19:44:24 +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 934a5b24eb Refine the commit types
Switch to a bitmask with much more finely-grained information about what
changed in the commit, fixing a few potential correctness problems and
significantly improving the performance of several scenarios where commits
are spammed very frequently.

Originally committed to SVN as r5590.
2011-09-15 05:16:32 +00:00
Thomas Goyne 7155ace1d9 Fix merge error in ass_file.h
Originally committed to SVN as r5573.
2011-08-27 07:28:04 +00:00
Thomas Goyne ccf9f64818 Make Assfile::SetScriptInfo slightly less slow
Originally committed to SVN as r5569.
2011-08-27 06:42:10 +00:00
Thomas Goyne 7210ea17d8 Add pre-save signal to AssFile and move most of the logic in FrameMain::SaveSubtitles to slots for this signal
Originally committed to SVN as r5207.
2011-01-16 07:16:40 +00:00
Thomas Goyne 59300cbc27 Add a subtitle open signal and move most of the logic in FrameMain::LoadSubtitles to slots for this signal.
Originally committed to SVN as r5206.
2011-01-16 07:16:33 +00:00
Thomas Goyne a566955047 Rename signals.h to signal.h
Originally committed to SVN as r5075.
2010-12-31 21:02:42 +00:00
Thomas Goyne 6d2b941e76 Rework how committing changes works
Rather than everything having to separately commit changes to the ass
and then tell the subs grid to notify various parts of Aegisub about the
changes, committing the AssFile now triggers an event which objects
listen for.

AssFile::Commit now also has an argument to indicate what sorts of
changes were made to the file. For now these types are very broad.

Originally committed to SVN as r4901.
2010-12-07 19:09:28 +00:00
Thomas Goyne 002aad0b29 Don't call CompressForStack on copied AssFiles as the parsed data isn't copied in the first place.
Originally committed to SVN as r4671.
2010-07-11 03:31:19 +00:00
Thomas Goyne 2e5dc176db Rewrite Undo/Redo code
Make the undo and redo stacks non-static members of AssFile, making it
theoretically possible to have multiple open AssFiles with working undo.

Slightly improve tracking of whether the file is modified: saving,
making a change, then undoing the change now results in the file being
shown as unmodified as with most programs with undo.

Add basic undo coalescing support.

Originally committed to SVN as r4667.
2010-07-09 07:31:34 +00:00
Thomas Goyne a40b9c4b91 Simplify and speed up AssFile's copy constructor and assignment operator.
Originally committed to SVN as r4565.
2010-06-22 00:03:33 +00:00
Thomas Goyne 8086fae633 Document AssFile's public methods
Originally committed to SVN as r4524.
2010-06-16 06:20:14 +00:00
Thomas Goyne f064624ecd Simplify charset detection
Originally committed to SVN as r4419.
2010-06-03 20:31:43 +00:00
Amar Takhar 40e12403d5 Merge all changes from the libaegisub branch into trunk, the effective range is r4175:4330. All options have been re-done and now use Cajun to support a json-backed format.
Initial support for low-level access and file I/O methods are included as well.

Originally committed to SVN as r4331.
2010-05-21 01:13:36 +00:00