2011-07-27 07:36:15 +02:00
|
|
|
// Copyright (c) 2011, Thomas Goyne <plorkyeran@aegisub.org>
|
2006-01-16 22:02:54 +01:00
|
|
|
//
|
2011-07-27 07:36:15 +02:00
|
|
|
// Permission to use, copy, modify, and distribute this software for any
|
|
|
|
// purpose with or without fee is hereby granted, provided that the above
|
|
|
|
// copyright notice and this permission notice appear in all copies.
|
2006-01-16 22:02:54 +01:00
|
|
|
//
|
2011-07-27 07:36:15 +02:00
|
|
|
// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
|
|
// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
|
|
// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
|
|
// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
|
|
// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
|
|
// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
|
|
// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
2006-01-16 22:02:54 +01:00
|
|
|
//
|
2009-07-29 07:43:02 +02:00
|
|
|
// Aegisub Project http://www.aegisub.org/
|
|
|
|
|
2011-12-26 23:21:19 +01:00
|
|
|
#include <libaegisub/exception.h>
|
2012-03-13 00:34:54 +01:00
|
|
|
#include <libaegisub/signal.h>
|
|
|
|
|
2013-06-10 15:58:13 +02:00
|
|
|
#include <memory>
|
2014-04-14 19:58:46 +02:00
|
|
|
#include <vector>
|
|
|
|
#include <wx/dialog.h>
|
2012-12-02 19:24:49 +01:00
|
|
|
|
2011-01-16 08:17:08 +01:00
|
|
|
namespace agi { struct Context; }
|
2006-01-16 22:02:54 +01:00
|
|
|
class AssDialogue;
|
2012-12-02 19:24:49 +01:00
|
|
|
class AssDialogueBlock;
|
2011-07-27 07:36:15 +02:00
|
|
|
class PersistLocation;
|
2012-03-13 00:34:45 +01:00
|
|
|
class SubsTextEditCtrl;
|
2011-07-27 07:36:15 +02:00
|
|
|
class wxCheckBox;
|
2014-05-30 21:39:39 +02:00
|
|
|
class wxStaticText;
|
|
|
|
class wxStyledTextCtrl;
|
2006-01-16 22:02:54 +01:00
|
|
|
|
2012-12-02 22:08:42 +01:00
|
|
|
/// Assistant for translating subtitles in one language to another language
|
2014-03-13 02:39:07 +01:00
|
|
|
class DialogTranslation final : public wxDialog {
|
2011-07-27 07:36:15 +02:00
|
|
|
agi::Context *c;
|
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-30 00:59:22 +02:00
|
|
|
|
2012-03-13 00:34:54 +01:00
|
|
|
agi::signal::Connection file_change_connection;
|
2012-10-05 05:22:54 +02:00
|
|
|
agi::signal::Connection active_line_connection;
|
2012-03-13 00:34:54 +01:00
|
|
|
|
2011-07-27 07:36:15 +02:00
|
|
|
/// The active line
|
|
|
|
AssDialogue *active_line;
|
2012-12-02 19:24:49 +01:00
|
|
|
/// The parsed dialogue blocks for the active line
|
2014-04-14 19:58:46 +02:00
|
|
|
std::vector<std::unique_ptr<AssDialogueBlock>> blocks;
|
2012-03-13 00:34:45 +01:00
|
|
|
/// Which dialogue block in the active line is currently being translated
|
2013-12-12 01:29:48 +01:00
|
|
|
size_t cur_block = 0;
|
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-30 00:59:22 +02:00
|
|
|
|
2011-07-27 07:36:15 +02:00
|
|
|
/// Total number of dialogue lines in the file
|
|
|
|
size_t line_count;
|
2006-01-16 22:02:54 +01:00
|
|
|
|
2012-03-13 00:34:54 +01:00
|
|
|
/// Should active line change announcements be ignored?
|
2013-12-12 01:29:48 +01:00
|
|
|
bool switching_lines = false;
|
2012-03-13 00:34:54 +01:00
|
|
|
|
2011-07-27 07:36:15 +02:00
|
|
|
wxStaticText *line_number_display;
|
2014-05-30 21:39:39 +02:00
|
|
|
wxStyledTextCtrl *original_text;
|
2012-03-13 00:34:45 +01:00
|
|
|
SubsTextEditCtrl *translated_text;
|
2011-07-27 07:36:15 +02:00
|
|
|
wxCheckBox *seek_video;
|
2006-01-16 22:02:54 +01:00
|
|
|
|
2013-06-10 15:58:13 +02:00
|
|
|
std::unique_ptr<PersistLocation> persist;
|
2006-01-16 22:02:54 +01:00
|
|
|
|
2011-07-27 07:36:15 +02:00
|
|
|
void OnPlayAudioButton(wxCommandEvent &);
|
|
|
|
void OnPlayVideoButton(wxCommandEvent &);
|
|
|
|
void OnKeyDown(wxKeyEvent &evt);
|
2012-03-13 00:34:54 +01:00
|
|
|
void OnExternalCommit(int commit_type);
|
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-30 00:59:22 +02:00
|
|
|
|
2011-07-27 07:36:15 +02:00
|
|
|
void UpdateDisplay();
|
2006-01-16 22:02:54 +01:00
|
|
|
|
2012-03-13 00:34:54 +01:00
|
|
|
void OnActiveLineChanged(AssDialogue *new_line);
|
|
|
|
|
2006-01-16 22:02:54 +01:00
|
|
|
public:
|
2011-07-27 07:36:15 +02:00
|
|
|
DialogTranslation(agi::Context *context);
|
|
|
|
~DialogTranslation();
|
2006-01-16 22:02:54 +01:00
|
|
|
|
2011-07-27 07:36:15 +02:00
|
|
|
bool NextBlock();
|
|
|
|
bool PrevBlock();
|
|
|
|
void Commit(bool next);
|
|
|
|
void InsertOriginal();
|
2011-12-26 23:21:19 +01:00
|
|
|
|
2014-06-11 00:12:12 +02:00
|
|
|
struct NothingToTranslate { };
|
2006-01-16 22:02:54 +01:00
|
|
|
};
|