Commit Graph

44 Commits

Author SHA1 Message Date
Thomas Goyne a7f4fb5b87 Run clang-modernize on things 2013-11-23 09:57:22 -08:00
Thomas Goyne 95ef444c20 More unique_ptr 2013-10-27 13:07:19 -07:00
Thomas Goyne 72d4577d7d Kill scoped_ptr in favor of unique_ptr 2013-06-11 16:06:58 -07:00
Thomas Goyne f21a72992b Use unique_ptr for most non-wx owning pointers 2013-06-08 19:21:49 -07:00
Thomas Goyne 8e491a9ecc Add support for using standard button IDs from automation
Some example uses:

	-- ~special snowflake~ OK/Cancel
	aegisub.dialog.display(config, {ok='Accept', cancel='Cancel'})

	-- On OS X the 'Help' button will be just a left-aligned ?
	aegisub.dialog.display(config, {ok='OK', cancel='Cancel', help='Help'})

	-- Each button in its own subtable to preserve passed order
	-- Unnecessary when using only IDed buttons since the passed order will
	-- be ignored in favor of the platform-standard order
	aegisub.dialog.display(config,
	  {{ok='Accept'}, {cancel='Cancel'}, {help='Help'}, 'Another Button'})

In some cases the passed labels will be ignored in favor of the
platform-standard labels.

Available IDs:
	ok
	yes
	save
	apply
	close
	no
	cancel
	help
	context_help

Note that many combinations of button IDs do not make sense and may have
strange effects.

Buttons with an ID of 'cancel' return false, as if ESC was pressed. A
button with an ID of 'close' results in that button being triggered on
ESC rather than cancel.

Buttons with an ID of 'ok', 'yes' and 'save' are set as the default
affirmative button for the dialog.

Closes #1609.
2013-05-25 15:20:03 -07:00
Thomas Goyne 19854e207a Add native support for MoonScript 2013-05-03 17:57:32 -07:00
Thomas Goyne b2f5a993d9 Actually define __ipairs on LuaAssFile 2013-05-01 21:21:07 -07: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 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 2c1f593a13 Delete declarations of LuaParseTagData and LuaUnparseTagData 2012-11-26 07:11:30 -08:00
Thomas Goyne 59eae9ab85 Store the lines in LuaAssFile in a vector
This makes the implementation better match the exposed interface and
simplifies some of the code.
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 110c2358a6 Use validators for reading values from all lua controls
Fixes some issues with control values not being read back correctly.

Originally committed to SVN as r6533.
2012-03-07 01:30:52 +00:00
Thomas Goyne b59b3c56fc Add lua bindings for open and save standard dialogs
Originally committed to SVN as r6499.
2012-02-22 04:17:16 +00:00
Thomas Goyne c2d3c910c7 Replace some uses of "" with wxString()
Despite special-casing zero-length input, wxString("") takes over four
times as long as wxString() - and on a 10k line script, this change cuts
AssFile's copy constructor's runtime in half.

Originally committed to SVN as r6401.
2012-01-31 00:44:43 +00:00
Thomas Goyne a24f1692be Let macros update their help string from the validate function
If the second return value from the validate function exists and is a
non-empty string, replace the macro's help text with that string.

Revert r6327, as this is a better solution to the same problem.

Closes #1413.

Originally committed to SVN as r6352.
2012-01-25 00:21:37 +00:00
Thomas Goyne a939732d9c Add auto4lua support for dynamic help strings
Rather than passing a string as the second argument to
aegisub.register_macro, they can now pass a function which will be
called (with no arguments) to get a help string.

Originally committed to SVN as r6327.
2012-01-20 21:33:39 +00:00
Thomas Goyne 64c7043123 Add aegisub.cancel(), which immediates ends macro execution without applying any of the changes that have been made
Originally committed to SVN as r6325.
2012-01-20 21:33:20 +00:00
Thomas Goyne b36c70ca7d Move a pile of things that shouldn't be in headers out of the headers
Originally committed to SVN as r6308.
2012-01-18 20:08:42 +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 2fdbd86a7f Add aegisub.decode_path, which simply wraps StandardPaths::DecodePath
Originally committed to SVN as r6130.
2011-12-22 21:30:05 +00:00
Thomas Goyne 4a3f2b8412 Add aegisub.keyframes, which returns a table with all of the frame numbers which are keyframes
Originally committed to SVN as r6129.
2011-12-22 21:29:56 +00:00
Thomas Goyne 7f7aba1bcf Make cmd::Command::name const
Originally committed to SVN as r5769.
2011-10-24 20:17:57 +00:00
Thomas Goyne b55ff3f803 Switch auto4lua to a transactional model which applies changes to the subtitle file only if a macro runs to completion without errors or the user cancelling. Significantly improves behavior when the user cancels and fixes a race condition caused by committing on threads other than the GUI thread.
Originally committed to SVN as r5650.
2011-09-28 19:50:14 +00:00
Thomas Goyne a9dc1f045d Remove "Config" from the name of ScriptConfigDialog and friends as they're used for more than just config, and clean up the implementations.
Originally committed to SVN as r5645.
2011-09-28 19:49:27 +00:00
Thomas Goyne eec3d64221 Make automation macros standard commands and remove the Automation4::Feature base class as it's no longer a useful abstraction.
Originally committed to SVN as r5641.
2011-09-28 19:48:47 +00:00
Thomas Goyne 492a0d3046 Make Automation4::Script mostly pure abstract and clean up the implementation of LuaScript
Originally committed to SVN as r5640.
2011-09-28 19:48:37 +00:00
Thomas Goyne 53b6765dd8 Redesign DialogProgress
Add agi::ProgressSink and agi::BackgroundRunner interfaces to libaegisub
which represent a generic progress sink and a thing which calls funtions
that need progress sinks. Make DialogProgress implement
agi::BackgroundRunner, invoking the passed function on a worker thread
and giving it a progress sink to update the dialog with.

Rewrite Automation4::ProgressSink, LuaThreadedCall and all related
classes to be based on agi::ProgressSink. Automation now simply uses
DialogProgress (although that's merely an implementation detail) and
adds a single method to route dialog opening from the worker thread to
the GUI thread.

Originally committed to SVN as r5634.
2011-09-28 19:47:40 +00:00
Thomas Goyne 2ca9392942 Set more finely-grained commit types from LuaAssFile rather than always using COMMIT_NEW
Originally committed to SVN as r5631.
2011-09-28 19:47:12 +00:00
Thomas Goyne 08a61c7fd4 Refactor LuaAssFile's implementation
Switch to 1-based indices to match Lua rather than converting back and
forth all over the place.

Eliminate a bunch of duplicated code.

Fix a few memory leaks.

Automatically set an undo point at the end of a macro if there are any
uncommited changes.

Originally committed to SVN as r5630.
2011-09-28 19:47:03 +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 c10e9e3a5b Make video and audio providers throw typed exceptions.
Don't display error messages and try other providers when the user
cancels loading a file.

Remove files from the MRU lists if they can't be found.

Closes #717.

Originally committed to SVN as r4717.
2010-08-02 06:32:01 +00:00
Thomas Goyne acba2c6b63 Rewrite VFR handling in Aegisub.
Kill vfr.h and vfr.cpp and use the libaegisub versions of them instead.

Rather than the globals VFR_Input and VFR_Output, everything related to
frame rate is now part of the video context. Most things which used to
use VFR_Output now call VideoContext::TimeAtFrame etc.; video providers,
rather than modifying VFR_Input directly, now have getters for their
frame rates which VideoContext calls. Read-only public access to
VFR_Input and VFR_Output are still provided (hopefully temporarily) for
a few things which were awkward to do through VideoContext.

The Avisynth provider now might correctly handle VFR MKVs which can be
opened with DirectShowSource but not DSS2.

Rework keyframe handling as well, so that it continues to match the vfr
handling in design and implementation.

Originally committed to SVN as r4662.
2010-07-08 04:29:04 +00:00
Niels Martin Hansen a71b83f61c Add some docstrings to Auto4 LuaAssFile class.
Originally committed to SVN as r4595.
2010-06-24 19:32:23 +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
Thomas Goyne b5064f8fc9 Replace lua's default lua module loader with one which uses our UTF-8-supporting script reader.
Originally committed to SVN as r4060.
2010-01-28 01:13:13 +00:00
Amar Takhar fa9c8c17f8 Remove 35 of the 39 pragma once added in r3538. I didn't realise so many would be not required. This patch isn't tested on windows, I'll fix it after the buildbot takes a run at it.
Originally committed to SVN as r3539.
2009-09-18 03:01:51 +00:00
Amar Takhar 11e1935d76 Remove include guards in favour of '#pragma once'. Normally I would use an include guard however #pragama once is easier to spot and we already used it in mst of our files, this is for the sake of consistency until they're removed.
Originally committed to SVN as r3538.
2009-09-18 02:48:31 +00:00
Amar Takhar 8504b4790d Remove '#pragma once' from 84 files that don't need it. Thanks to Plorkyeran for testing this on windows. The next step is to detangle the remaining files that currently require it.
Originally committed to SVN as r3533.
2009-09-11 18:51:48 +00:00
Amar Takhar 774fb0f674 Fix all the headers in *., this includes:
* Wrapping all headers that are in agi_pre.h with AGI_PRE.
  * Sorting alphabetically.
  * Same operation as r3515.

Note: This is broken when precompiled headers are not in use, I'll fix that after this commit so the two changes don't get jumbled up.

Originally committed to SVN as r3525.
2009-09-11 02:36:34 +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
Rodrigo Braz Monteiro 6106546f74 Fixed windows project.
Originally committed to SVN as r2766.
2009-03-14 20:52:01 +00:00
Amar Takhar 91d73ec8ea SVN Transition Step 3/7
1. cd aegisub/
  2. svn mv *cpp *h src/
  3. svn mv Makefile.am MatroskaParser.c auto4_perldata.inc bitmaps boost \
     changelog.txt config gl include libosxutil libresrc md5.c msvc mythes.cxx \
     mythes.hxx res.rc src/
  4. cd ..
  5. svn mv FFmpegSource2/ INSTALL Makefile.am README  acinclude.m4 \
     autogen.sh automation/ bin build configure.in desktop dummy.txt lib \
     libass/ m4macros/ packages/ po/ scripts/ universalchardet/ aegisub/
  6. mkdir -p docs/wiki_convert
  7. svn add docs/wiki_convert
  8. cd docs
  9. svn mv aegisub_convert_docs.pl convert.bat output wiki_convert/

* See r2749 for full description.

Originally committed to SVN as r2752.
2009-03-08 08:30:39 +00:00