Commit Graph

53 Commits

Author SHA1 Message Date
Thomas Goyne d0bcc2e22c Apply the line's shear to the x/y rotation grid 2013-12-15 08:06:50 -08:00
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 cb549e5aa9 Significantly speed up dragging lots of vector clip control points 2013-09-18 16:18:38 -07:00
Thomas Goyne 64ecd29169 Switch to using an intrusive list for the visual tool features
Slightly improves performance and eliminates a bunch of really clunky
passing around and storing of iterators.
2013-09-17 16:23:36 -07:00
Thomas Goyne e7306ae642 Release mouse capture from the visual tools when the zoom is changed 2013-02-08 20:37:43 -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 d49758edbf De-wxify AssOverride 2012-12-31 07:09:31 -08:00
Thomas Goyne 0b133de08f Remove pointless empty destructors
An explicit empty destructor is only needed when a class has a smart
pointer to an incomplete type.
2012-12-11 09:06:21 -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 b8b9bfdfb6 Fix non-pch compilation 2012-11-18 21:10:36 -08:00
Thomas Goyne 06aaaff16b NULL -> nullptr 2012-11-13 08:51:01 -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 e44c47c863 Remove $Id$ markers since git doesn't support them 2012-10-25 17:39:49 -07:00
Thomas Goyne e4a6092b36 Use signals for selection change notifications 2012-10-12 14:54:07 -07: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 34a87b1c1e Silence a pile of /W4 warnings
Originally committed to SVN as r6001.
2011-12-22 21:09:31 +00:00
Thomas Goyne 0aa553eb7c compilation fixes
Originally committed to SVN as r5824.
2011-11-07 04:14:09 +00:00
Thomas Goyne be77dc8307 Mostly rewrite the visual tools and related classes
Convert all coordinates within the visual tools to Vector2D, which has
been significantly extended. Eliminates a lot of issues with accumulated
rounding errors and simplifies a lot of code.

Modernize the visual tools' interactions with the rest of Aegisub by
connecting to signals directly rather than routing everything through
the video display and converting the main visual tool mode toolbar to
the command system.

Extract all references to OpenGL from the visual tools and move them to
OpenGLWrapper as a first step towards making it possible to implement an
alternative video renderer. In the process, eliminate all uses of OpenGL
immediate mode.

Fix a bunch of minor issues and general instability.

Originally committed to SVN as r5823.
2011-11-06 17:18:20 +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 256e098aa7 Remove header include order requirements
Originally committed to SVN as r5449.
2011-07-15 04:04:13 +00:00
Thomas Goyne df1dce3593 Kill SubtitlesGrid::ass and SubtitlesGrid::EditBox and convert everything that used them over to agi::Context
Originally committed to SVN as r5215.
2011-01-16 07:17:36 +00:00
Thomas Goyne d84b768171 Remove the 'audio' and 'grid' public members from VideoContext and migrate everything that used them over to Context
Originally committed to SVN as r5211.
2011-01-16 07:17:08 +00:00
Thomas Goyne a73091ef5c Coalesce visual tool changes
Originally committed to SVN as r4827.
2010-11-01 04:36:13 +00:00
Thomas Goyne 6432ea1f94 Remove the realtime visual tool option, as the threaded video display makes it pointless
Originally committed to SVN as r4825.
2010-10-26 04:12:10 +00:00
Thomas Goyne fde4a7815d Make the subtitle edit box auto-commit all changes
This happens to fix most of the undo issues, as it's now much harder to
have uncommitted changes to the file.

Closes #355 and #586.

Originally committed to SVN as r4699.
2010-07-20 03:11:11 +00:00
Thomas Goyne 5ed8bf89f6 Fix gcc build errors
Originally committed to SVN as r4658.
2010-07-06 19:33:09 +00:00
Thomas Goyne be1ed9e672 Make visual tools pass around iterators for everything related to visual features rather than a mix of pointers and indices, and clean up feature creation. Fixes a large pile of selection-related bugs.
Originally committed to SVN as r4648.
2010-06-30 06:29:14 +00:00
Thomas Goyne a3ff2cc746 Switch visual tools over to using GetSelectedSet for everything
Originally committed to SVN as r4632.
2010-06-28 07:39:36 +00:00
Thomas Goyne 5588cda268 Significantly revamp how visual tools interact with the rest of the program
Rather than just have a single Refresh method that gets called whenever
something happens that could possibly be of interest to the visual
tools, add seperate methods for signaling frame number changes and
changes to the file, and use the new SelectionController stuff for other
things that used to merit a Refresh. This eliminates a large amount of
redundant reparsing of lines which happened on paint, as well as a large
number of redundant repaints.

Frame data is now only uploaded to the video card when the frame number changes
rather than when anything at all changes, slightly improving performance when
using mesa's software opengl implementation.

Vector clip and drag tools now do a slightly better job of not
discarding the user's selection for no apparent reason, and strange
selection behavior from clicking on visual features should now be
entirely fixed.

Everything but the constructor and toolbar event handler in the visual
tool implementations are now private.

Originally committed to SVN as r4631.
2010-06-28 07:13:15 +00:00
Thomas Goyne caba46bf0b Remove features for deleted control points
Originally committed to SVN as r4620.
2010-06-27 07:53:14 +00:00
Niels Martin Hansen 70d41d31b2 Remove the SelectionChangeSubscriber mechanism from the grid and implement some basic selection change notification through SelectionController.
Change SelectionListener interface so it receives the set of lines added and removed from selection, instead of just the complete new selection.
Update VisualTool<> to use SelectionListener to receive selection change notifications.

This change (temporarily, I hope) breaks feature selection in visual drag mode, when changing selection via the grid. This is caused by the grid selection change first clearing the entire selection, which sends a separate notification about selection clear. This causes the last visual feature to be deselected, and then the visual tool base reselects the active line, causing a new notification for selection to be sent. The active line happens to be the newly clicked line, and the selection notification enters during the externalChange guard being set, and is then ignored for feature update purposes. When control returns to the original SelectRow call in the grid, the line to be selected has already been selected and then nothing happens.
The best fix is to avoid two notifications being required to deselect all then reselect one line in the first place, so making the grid selection handling saner is the best fix.

Originally committed to SVN as r4602.
2010-06-26 04:38:02 +00:00
Thomas Goyne 5338a60cdb Fix compilation errors when not using precompiled headers
Originally committed to SVN as r4511.
2010-06-14 19:26:27 +00:00
Thomas Goyne 83e35ac63d Only rerender the video display on mouse events if display will actually change
Originally committed to SVN as r4456.
2010-06-07 07:24:30 +00:00
Thomas Goyne 625ce943f5 Cache OptionValue objects used by the video display
Originally committed to SVN as r4425.
2010-06-04 03:07:33 +00:00
Thomas Goyne e120ecc190 Make move/pos toggle modify all selected lines
Originally committed to SVN as r4364.
2010-05-26 07:17:46 +00:00
Thomas Goyne 877eabdce7 Fix selection issues with visual features
Selections in drag mode now follow the following rules:

 * If a line is selected in the grid, at least one visual feature
   corresponding to the line is selected.

 * If a line has any features selected, that line is selected in the
   grid.

In addition, all control points now start out selected in the vector
clip tool, and all tools should no longer discard the current selection
at unpredictable or unintended times.

Updates #513.

Originally committed to SVN as r4363.
2010-05-26 07:17:39 +00:00
Thomas Goyne 1e975eee89 Add double-click positioning to drag visual tool.
Sets the last clicked-on feature to the double-clicked spot and applies
the same relative movement to all other selected lines (including ones
not visible on the current frame).

Updates #513.

Originally committed to SVN as r4350.
2010-05-23 08:53:27 +00:00
Thomas Goyne 23972b10bc Add selection and control of multiple visual features
Make all visual tools support selecting and manipulating multiple visual
features at once, allowing multiple lines to be moved at once, entire
vector clips to be translated, etc. Controls:

  - Left click: Select control clicked control only
  - Ctrl-left click: Add/remove control to selection
  - Drag control (with or without ctrl): Move all selected controls,
    after setting/adding to selection if target is not in the selection
  - Click on no control: Clear selection

Lots of little stuff to fix still.

Updates #513.

Originally committed to SVN as r4322.
2010-05-20 08:55:58 +00:00
Thomas Goyne a282393b47 Template VisualTool on the type of draggable features to use
Originally committed to SVN as r4320.
2010-05-20 08:55:46 +00:00
Thomas Goyne 2ef8302a6d Add boost/shared_pointer.hpp to the precompiled header
Originally committed to SVN as r4319.
2010-05-20 08:55:41 +00:00
Thomas Goyne 40a0c8994a Simplify the VisualTool interface a bit.
Originally committed to SVN as r4318.
2010-05-20 08:55:35 +00:00
Thomas Goyne e023831134 Detangle the visual tools from SubsEditBox a bit by making changes to the file no longer go through the edit box.
Originally committed to SVN as r4317.
2010-05-20 08:55:29 +00:00
Thomas Goyne 34a7d21a42 Kill the redundant VisualToolEvent nonsense and make the drag tool just use OnSubTool like the vector clip mode.
Originally committed to SVN as r4316.
2010-05-20 08:55:23 +00:00
Thomas Goyne 2ec4a97dbb Fix bad coordinate conversion in the clip visual tool
Originally committed to SVN as r4315.
2010-05-20 08:55:18 +00:00
Thomas Goyne 2c876e79c3 Make visual tools use only screen coordinates.
Previously the visual typesetting tools and the overlay mask used
several coordinate frames, converting between them in many places in
inconsistent ways.  This elimiates all uses of coordinate frames other
than screen and script, and makes the conversion done in one place, and
only when parsing or serializing ASS.

This fixes:

 - A few minor rounding errors

 - Horrible brokeness when only part of the video frame is being
   displayed, due to higher levels of zoom than fit onscreen or panning
   the video

 - Distortion of the visual typesetting tools when the combination of
   overridden aspect ratio, script resolution, and video resolution did
   not result in square pixels.

 - Resolution-dependence of the visual typesetting tools, which resulted
   in some tools becoming hard to use at zooms outside the range of
   100-200%.

 - Some draggable controls used the mouse's script coordinates,
   resulting in noticable jerky movement at high zoom levels or when
   using strange script resolutions.

Closes #966.

Originally committed to SVN as r4289.
2010-05-16 06:39:11 +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 84996c927f Add a whole slew of missing includes, prior to r3509 config_unix.h used to include stdwx.h, now that I'm fixing the headers I removed it which caused issues when not using precompiled headers.
Originally committed to SVN as r3512.
2009-09-10 05:25:25 +00:00
Thomas Goyne 1a4e7375fd Add some documentation to VideoDisplay and clean up the includes a bit.
Originally committed to SVN as r3501.
2009-09-10 01:41:34 +00:00