Commit graph

355 commits

Author SHA1 Message Date
Thomas Goyne 08983adc96 Move agi::Color parsing to its own file
Keeping all uses of boost.spirit in a single translation unit helps
avoid having it murder compile times, which requires that it be off by
itself.
2012-11-10 18:05:56 -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 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 a266d32ce4 Remove pointless GetString override in the list option values 2012-10-27 05:54:50 -07:00
Thomas Goyne e44c47c863 Remove $Id$ markers since git doesn't support them 2012-10-25 17:39:49 -07:00
Thomas Goyne 67c01d11f6 Delete unfinished and unused stuff from libaegisub 2012-10-25 17:39:49 -07:00
Thomas Goyne decbf06de3 Timestamp temporary files to reduce the chance of name collisions 2012-10-21 15:29:52 -07:00
Thomas Goyne b43f27396e Verify that creating the temp file for saving actually succeeded 2012-10-21 15:29:52 -07:00
Thomas Goyne 715c882a97 Actually check MoveFileEx's return value 2012-10-21 08:13:46 -07:00
Thomas Goyne da79178cc9 Add _tmp before the extension when saving
This makes it easier to open the temporary file if an error occurs at
some point in the saving process.
2012-10-21 08:04:06 -07:00
Thomas Goyne c7fb6a57a4 Remove the platform-specific agi::io implementations since they were nearly identical 2012-10-21 08:00:02 -07:00
Thomas Goyne 938ccfe39b Mark TimecodeRange::operator< as const 2012-10-16 15:53:49 -07:00
Thomas Goyne 682c7d5371 Fix an occasional crash on startup on Windows debug builds
Some of the debug iterator code seems to not like 'delete map[key]', so
change things a little to do things in a way that appears to be fine.
2012-10-16 09:51:31 -07:00
Thomas Goyne 53433426bb Fix some stuff from Coverity Scan
Mostly just bugs in unreachable code and stylistic things, but there's a
few incorrect reachable things that were working by coincidence and
gratuitous dynamic_casts.
2012-10-15 18:16:09 -07:00
Thomas Goyne a0c92f83f9 Fix some PVS-Studio warnings 2012-10-12 14:51:30 -07:00
Thomas Goyne 79ef194238 Fix compilation error with clang 2012-10-12 14:36:29 -07:00
Thomas Goyne 863e041d4d Honor the configured MRU limits
Actually use the limits set in the preferences dialog rather than always
limiting the MRU lists to 16.

Currently only the Find and Replace limits can be set to above 16 due to
how the open recent items commands are implemented.

Closes #1528.
2012-10-11 10:19:49 -07:00
Thomas Goyne 0a5fa6ff39 Don't use ARC in the Obj-C++ code
It never allocated any non-autoreleased objects so ARC wasn't actually
doing anything other than breaking compilation with gcc.
2012-09-29 22:10:45 -07:00
Thomas Goyne b0036b4d99 Statically link libaegisub
Dynamically linking it caused a steady stream of issues for no apparent
benefits.
2012-08-21 07:02:45 -07:00
Thomas Goyne 1e030289ad Revamp how version tagging works
Rather than having it be a configurable option, simply build in final
release mode if Aegisub is being built from a signed tag, and get the
version information from that tag.

Drop the version number from the OS X app bundle when not building from
a tag as it done everywhere else. Drop the arch suffix since ppc hasn't
been tested in years and isn't worth testing as it's only going to get
less relevant as time goes on.

Remove some redundant definitions in the build system.
2012-08-19 14:33:50 -07:00
Thomas Goyne e945c02151 Fix some warnings
Originally committed to SVN as r6919.
2012-06-25 14:21:32 +00:00
Thomas Goyne 0f071d978a Rewrite the OS X bundle utils in Obj-C++ and return std::strings rather than malloced char *
Originally committed to SVN as r6896.
2012-06-12 03:13:49 +00:00
Thomas Goyne dc5d6c9a4a Add missing include in unix/log.cpp and wrap includes in #ifndef LAGI_PRE
Originally committed to SVN as r6876.
2012-05-26 17:00:16 +00:00
cantabile 54a08a44c1 stdout log emitter: flush stdout after every printf() if stdout is not a terminal
This makes it possible to watch aegisub's output in realtime even if its
stdout is redirected to a file.

Originally committed to SVN as r6793.
2012-05-15 14:06:18 +00:00
Thomas Goyne 1d15bf273a Fix compilation failure from incomplete merging in r6692
Originally committed to SVN as r6696.
2012-04-12 15:40:25 +00:00
Thomas Goyne bdafd8f201 Reset to the platform-specific default option values rather than the global defaults
Originally committed to SVN as r6692.
2012-04-11 04:10:56 +00:00
Thomas Goyne b11e3d7f3a gcc 4.7 compilation fixes
Originally committed to SVN as r6647.
2012-04-03 17:38:45 +00:00
Thomas Goyne e6697b1923 Fix fallbacks for invalid characters when converting charsets
r6632 made ConverterImpl have a vtable, which makes the iconv_fallbacks
parent no longer the first thing in the object, so add an explicit cast.

Originally committed to SVN as r6639.
2012-03-31 00:28:55 +00:00
Thomas Goyne 028fd3b4ba Add line-wrapping logic to libaegisub
Originally committed to SVN as r6635.
2012-03-29 19:05:16 +00:00
Thomas Goyne f31d9a5a8b Add converter to ISO-6937-2
glibc's iconv implementation supports ISO-6937-2, but libiconv doesn't
due to that these days the only place it's used is in a few old subtitle
formats. As a result, on everything but linux we need our own converter.

Conversion from ISO-6937-2 is currently not supported.

Originally committed to SVN as r6632.
2012-03-29 19:04:49 +00:00
Thomas Goyne 71776940f6 Rewrite SMPTE timecode handling
Move SMPTE handling to agi::vfr::Framerate to get all of the interesting
logic dealing with timcodes in one place, and to make it testable.

Completely rewrite the SMPTE time conversions as testing them reveals
that they were incorrect in some cases.

Originally committed to SVN as r6631.
2012-03-29 19:04:36 +00:00
Thomas Goyne 0b9a21bf82 Hide SinkMessage's copy constructor and assignment operator
Originally committed to SVN as r6601.
2012-03-25 04:05:20 +00:00
Thomas Goyne 77e755d109 Allow duplicated timestamps as real files do have them; simply skip all but the last frame with the same timestamp
Originally committed to SVN as r6566.
2012-03-11 23:05:08 +00:00
Thomas Goyne 12511901a9 Fix bad string concatenation in a json parse error message
Originally committed to SVN as r6559.
2012-03-10 02:16:20 +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 7f8aecd7fa Use int64_t for progress reporting rather than int as it's what ffms2 requires. Fixes magic jumping progress bars during indexing.
Originally committed to SVN as r6556.
2012-03-10 01:00:13 +00:00
Thomas Goyne 0d45f98ae8 Cast time_ts passed to printf to a known type
Originally committed to SVN as r6510.
2012-02-23 19:28:00 +00:00
Thomas Goyne 6cf122dea2 Remove the time_t overload of UnknownElement and just cast to int64_t
Originally committed to SVN as r6508.
2012-02-23 19:27:42 +00:00
Thomas Goyne b9ddf00ead Add a scoped holder similar to scoped_ptr for handles that may or may not be pointers
Originally committed to SVN as r6491.
2012-02-20 18:22:04 +00:00
Thomas Goyne b8a7c6cb1e Remove scoped_ptr::swap
Originally committed to SVN as r6431.
2012-02-02 19:18:10 +00:00
Thomas Goyne 983ffc1e83 Add some dumb heuristics to detect binary files in the charset detector to avoid taking forever feeding hundreds of MB through it. Closes #1438.
Originally committed to SVN as r6405.
2012-01-31 04:03:55 +00:00
Thomas Goyne d68a395499 Open files in binary mode for charset detection
Originally committed to SVN as r6404.
2012-01-31 04:03:50 +00:00
Thomas Goyne f774f21903 Explicitly do nothing when an empty container is passed to delete_clear as it's oddly slow otherwise
Originally committed to SVN as r6402.
2012-01-31 00:44:55 +00:00
Thomas Goyne a4eb7ef528 Fix crash with empty hotkeys. Closes #1420.
Originally committed to SVN as r6360.
2012-01-25 19:07:18 +00:00
Thomas Goyne 46986c6944 Fix new[]/delete mismatch
Originally committed to SVN as r6306.
2012-01-18 20:08:24 +00:00
Thomas Goyne 3ed84ba70d Update distdir generation
The list of files to include was out of date and only included files
for dependencies which were actually enabled, and the script was
FreeBSD-specific.

Originally committed to SVN as r6298.
2012-01-14 18:46:43 +00:00
Thomas Goyne 5774e87248 Add files which were missed in r6278
Originally committed to SVN as r6283.
2012-01-13 14:37:15 +00:00
Thomas Goyne 7dd6cfe37d Derive agi::acs exceptions from agi::FileSystemError and friends rather than having two sets of errors for the same thing
Originally committed to SVN as r6278.
2012-01-12 22:31:54 +00:00
Thomas Goyne 3c62a38c7a Replace MyThes thesaurus implementation with a custom one
Fixes a pile of unicode-related issues, such as dictionaries in a path
which does not fit into the system's local charset, and significantly
cuts down on the amount of code.

Originally committed to SVN as r6250.
2012-01-08 01:36:50 +00:00
Thomas Goyne e2d31b708e Split the json log writing into a seperate class from LogSink
Originally committed to SVN as r6248.
2012-01-08 01:36:23 +00:00
Thomas Goyne d148bbbf2a Make agi::log::LogSink take ownership of the emitters passed to it
Originally committed to SVN as r6246.
2012-01-08 01:36:09 +00:00
Thomas Goyne d2d28401bd Change how local config mode works
Rather than loading both the local and user config files and saving to
the local directory if an option is set, simply try to load the local
config file, and if it exists switch to local mode and never even touch
the user file.

Originally committed to SVN as r6244.
2012-01-08 01:35:56 +00:00
Thomas Goyne 56337beb11 Use OutputDebugStringW rather than OutputDebugStringA in the windows debug logging so that unicode actually works
Originally committed to SVN as r6242.
2012-01-08 01:35:43 +00:00
Thomas Goyne 0113b33d66 Always build with -g and optionally strip the debugging symbols on install so that crash backtraces aren't completely meaningless
Originally committed to SVN as r6201.
2012-01-08 01:04:05 +00:00
Thomas Goyne 84d1315736 Write the config and MRU files to ?data in portable mode rather than ?user
Originally committed to SVN as r6187.
2011-12-30 01:21:03 +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 7adbe07b4e Silence a bunch of PREFast warnings
Originally committed to SVN as r6162.
2011-12-26 22:20:49 +00:00
Thomas Goyne 77cf1f7583 Handle Windows newlines in line_iterator on non-Windows
Originally committed to SVN as r6141.
2011-12-22 21:31:48 +00:00
Thomas Goyne 1fbf2ef218 Remove pointless operator=, copy constructor and destructor from agi::vfr::Framerate
Originally committed to SVN as r6120.
2011-12-22 21:28:23 +00:00
Thomas Goyne 93ce90cbf9 Store a numerator and denominator in agi::vfr::Framerate rather than a fps. Fixes minor rounding issues with 24000/1001 and 30000/1001 frame rates.
Originally committed to SVN as r6115.
2011-12-22 21:27:35 +00:00
Thomas Goyne fe090969f4 Actually use the value from the "Always" context in Hotkey::GetHotkey
Originally committed to SVN as r6113.
2011-12-22 21:27:17 +00:00
Thomas Goyne 7bb749b51f Return the name of the command found or an empty string if none from Hotkey::Scan rather than using an out reference
Originally committed to SVN as r6112.
2011-12-22 21:27:06 +00:00
Thomas Goyne 022c711409 Clear the command output variable when a hotkey fails to match to be safe
Originally committed to SVN as r6111.
2011-12-22 21:26:57 +00:00
Thomas Goyne 71109a87e1 Replace most inappropriate uses of LDFLAGS with LIBS
Originally committed to SVN as r6097.
2011-12-22 21:24:40 +00:00
Thomas Goyne 48526bf341 Delete libmedia
It's nowhere close to working and just getting further away from working
as time goes on.

Originally committed to SVN as r6096.
2011-12-22 21:24:20 +00:00
Thomas Goyne b66357bfb8 Fix warning on x64 unix
Originally committed to SVN as r6087.
2011-12-22 21:22:58 +00:00
Thomas Goyne 464f652ea4 Eliminate a bunch of weird bogusness with various environment variables
Originally committed to SVN as r6076.
2011-12-22 21:21:20 +00:00
Thomas Goyne 863e7070a6 Add a bunch of missing config.h includes
Originally committed to SVN as r6072.
2011-12-22 21:20:44 +00:00
Thomas Goyne 96aa9e2629 Use libaegisub io code in AssAttachment rather than wx's
Originally committed to SVN as r6039.
2011-12-22 21:15:37 +00:00
Thomas Goyne b29606759a Only include character encodings actually supported by the iconv implementation used in the list returned from GetEncodingsList
Originally committed to SVN as r6026.
2011-12-22 21:13:39 +00:00
Thomas Goyne 10255ae201 Overload operator<< for UnknownElement as gcc complains about abiguous calls otherwise
Originally committed to SVN as r6024.
2011-12-22 21:13:22 +00:00
Thomas Goyne 61b1741376 Remove all the json::Reader::Read overloads, as we never actually use them
Originally committed to SVN as r6021.
2011-12-22 21:12:55 +00:00
Thomas Goyne ba1d1596de Eliminate a pile of duplicated code in elements.cpp
Originally committed to SVN as r6020.
2011-12-22 21:12:46 +00:00
Thomas Goyne 07da6f6f1b Split json::Number into json::Double and json::Integer
Trying to decide whether an option should be an int or double after
discarding the differences between "1.0" and "1" simply isn't possible,
and even if an option was initialized correctly, if it was changed to a
round number it could get written as an int and break later.

Also convert cajun to tabs because three spaces to indent is terrible.

Originally committed to SVN as r6018.
2011-12-22 21:12:25 +00:00
Thomas Goyne daff67b150 Simply log errors and continue when type errors occur while loading the user config file, rather than only loading the portion of the file before the error
Originally committed to SVN as r6017.
2011-12-22 21:12:15 +00:00
Thomas Goyne d7ae51a5af Remove some unused members of agi::Options
Originally committed to SVN as r6016.
2011-12-22 21:12:06 +00:00
Thomas Goyne 2f73b55b64 Delete agi::Options::DumpAll declaration, as the definition doesn't exist
Originally committed to SVN as r6015.
2011-12-22 21:11:57 +00:00
Thomas Goyne 4c3d191de8 Significantly simplify agi::Options::PutOption
Originally committed to SVN as r6014.
2011-12-22 21:11:46 +00:00
Thomas Goyne 56165305a4 Change the check for duplicate keys when writing the options file to an assertion as it can't actually happen
Originally committed to SVN as r6013.
2011-12-22 21:11:38 +00:00
Thomas Goyne 4823706206 Fix some spelling errors in comments in option.h
Originally committed to SVN as r6012.
2011-12-22 21:11:29 +00:00
Thomas Goyne a7a159288f Make agi::Options's one protected member private, as agi::Option is not designed to be inherited from
Originally committed to SVN as r6011.
2011-12-22 21:11:21 +00:00
Thomas Goyne ef3414931f Fix off-by-one error in MRU::GetEntry
Originally committed to SVN as r6009.
2011-12-22 21:11:01 +00:00
Thomas Goyne d0ee3029de Make the MRU tests significantly less worthless
Originally committed to SVN as r6008.
2011-12-22 21:10:50 +00:00
Thomas Goyne 522e634122 Simplify some uses of cajun types and eliminate some copies
Originally committed to SVN as r6007.
2011-12-22 21:10:41 +00:00
Thomas Goyne 9cbaa01e63 Update and significantly expand the cajun tests
Originally committed to SVN as r6006.
2011-12-22 21:10:32 +00:00
Thomas Goyne 3097dc634e Only automatically convert json objects to other types when they are uninitialized
Originally committed to SVN as r6005.
2011-12-22 21:10:22 +00:00
Thomas Goyne a78417177a Move cajun implementations from .inl files included by the headers to .cpp files
Originally committed to SVN as r6004.
2011-12-22 21:10:10 +00:00
Thomas Goyne c601351a50 Silence a pile of prefast warnings in cajun
Originally committed to SVN as r6003.
2011-12-22 21:10:00 +00:00
Thomas Goyne 34a87b1c1e Silence a pile of /W4 warnings
Originally committed to SVN as r6001.
2011-12-22 21:09:31 +00:00
Thomas Goyne dfc68a4db9 Make the int/double option type detection slightly less broken
Choosing between int and double based on whether the default value is an
int is dumb and broken enough, but with the "ceil" the detection didn't
even work for negative numbers.

Originally committed to SVN as r5937.
2011-11-29 23:18:34 +00:00
Thomas Goyne 893ec95841 Don't load the FPS from Aegisub keyframes. The format breaks vfr and setting the fps should be done with timecode files.
Originally committed to SVN as r5900.
2011-11-20 17:35:00 +00:00
Thomas Goyne 0b742ef3c1 Add operator unspecified-bool-type to agi::scoped_ptr
Originally committed to SVN as r5844.
2011-11-12 01:23:09 +00:00
Thomas Goyne 1073b3f7f0 Remove bogus (and pointless) initialization in the glibc iconv-backed converter
Originally committed to SVN as r5833.
2011-11-08 03:44:46 +00:00
Thomas Goyne 2f394a7792 Fix compilation with clang (but not linking because wxAny is currently broken with it)
Originally committed to SVN as r5826.
2011-11-07 06:18:34 +00:00
Thomas Goyne 5176ae4407 Flush hotkeys after they're modified
Originally committed to SVN as r5821.
2011-11-06 17:18:08 +00:00
Thomas Goyne 092ecafe58 Make ConfigVisitor::AddOptionValue less dumb
Originally committed to SVN as r5818.
2011-11-04 19:42:50 +00:00
Thomas Goyne 8fcd3daf28 Rewrite the array config visitor so that it doesn't need the OptionValueList base class
Originally committed to SVN as r5817.
2011-11-04 19:42:40 +00:00
Thomas Goyne 84c545b978 Return const references from OptionValue::GetList* rather than taking an output parameter. Eliminates some copies of lists and makes the calling code less awkward.
Originally committed to SVN as r5816.
2011-11-04 19:42:31 +00:00
Thomas Goyne ba2794b2fe Replace some const strings with const references to strings
Originally committed to SVN as r5815.
2011-11-04 19:42:21 +00:00
Thomas Goyne 579203989b Remove pointless explicit empty constructors from OptionValue base classes
Originally committed to SVN as r5813.
2011-11-04 19:42:04 +00:00