2007-01-08 22:11:06 +01:00
|
|
|
// Copyright (c) 2007, Rodrigo Braz Monteiro
|
|
|
|
// All rights reserved.
|
|
|
|
//
|
|
|
|
// Redistribution and use in source and binary forms, with or without
|
|
|
|
// modification, are permitted provided that the following conditions are met:
|
|
|
|
//
|
|
|
|
// * Redistributions of source code must retain the above copyright notice,
|
|
|
|
// this list of conditions and the following disclaimer.
|
|
|
|
// * Redistributions in binary form must reproduce the above copyright notice,
|
|
|
|
// this list of conditions and the following disclaimer in the documentation
|
|
|
|
// and/or other materials provided with the distribution.
|
|
|
|
// * Neither the name of the Aegisub Group nor the names of its contributors
|
|
|
|
// may be used to endorse or promote products derived from this software
|
|
|
|
// without specific prior written permission.
|
|
|
|
//
|
|
|
|
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
|
|
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
|
|
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
|
|
// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
|
|
|
// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
|
|
|
// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
|
|
|
// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
|
|
|
// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
|
|
|
// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
|
|
|
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
|
|
|
// POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
//
|
2009-07-29 07:43:02 +02:00
|
|
|
// Aegisub Project http://www.aegisub.org/
|
2007-01-08 22:11:06 +01:00
|
|
|
//
|
2009-07-29 07:43:02 +02:00
|
|
|
// $Id$
|
|
|
|
|
|
|
|
/// @file visual_tool.h
|
|
|
|
/// @see visual_tool.cpp
|
|
|
|
/// @ingroup visual_ts
|
2007-01-08 22:11:06 +01:00
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
2009-09-11 04:36:34 +02:00
|
|
|
#ifndef AGI_PRE
|
2010-06-14 21:26:27 +02:00
|
|
|
#include <map>
|
2010-05-26 09:17:39 +02:00
|
|
|
#include <set>
|
2010-06-14 21:26:27 +02:00
|
|
|
#include <vector>
|
2009-09-11 04:36:34 +02:00
|
|
|
|
2007-09-12 01:22:26 +02:00
|
|
|
#include <wx/log.h>
|
2009-09-10 07:25:25 +02:00
|
|
|
#include <wx/event.h>
|
|
|
|
#include <wx/button.h>
|
2009-09-11 04:36:34 +02:00
|
|
|
#endif
|
|
|
|
|
2010-05-26 09:17:39 +02:00
|
|
|
#include "base_grid.h"
|
2007-01-21 07:30:19 +01:00
|
|
|
#include "gl_wrap.h"
|
|
|
|
|
2007-01-08 22:11:06 +01:00
|
|
|
class AssDialogue;
|
2010-06-28 09:13:15 +02:00
|
|
|
class SubtitlesGrid;
|
2011-01-16 08:17:08 +01:00
|
|
|
class VideoDisplay;
|
2010-05-16 08:39:11 +02:00
|
|
|
struct VideoState;
|
2010-06-04 05:07:33 +02:00
|
|
|
namespace agi {
|
2011-01-16 08:17:08 +01:00
|
|
|
struct Context;
|
2010-06-04 05:07:33 +02:00
|
|
|
class OptionValue;
|
|
|
|
}
|
2007-07-04 06:24:47 +02:00
|
|
|
|
2010-05-20 10:55:46 +02:00
|
|
|
/// First window id for visualsubtoolbar items
|
2007-07-07 07:51:18 +02:00
|
|
|
#define VISUAL_SUB_TOOL_START 1300
|
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
|
|
|
|
2010-05-20 10:55:46 +02:00
|
|
|
/// Last window id for visualsubtoolbar items
|
2007-07-07 07:51:18 +02:00
|
|
|
#define VISUAL_SUB_TOOL_END (VISUAL_SUB_TOOL_START+100)
|
|
|
|
|
2010-05-20 10:55:46 +02:00
|
|
|
class IVisualTool : public OpenGLWrapper {
|
|
|
|
protected:
|
|
|
|
/// DOCME
|
|
|
|
static const wxColour colour[4];
|
|
|
|
public:
|
|
|
|
virtual void OnMouseEvent(wxMouseEvent &event)=0;
|
|
|
|
virtual void OnSubTool(wxCommandEvent &)=0;
|
2010-06-07 09:24:30 +02:00
|
|
|
virtual bool Update()=0;
|
2010-05-20 10:55:46 +02:00
|
|
|
virtual void Draw()=0;
|
|
|
|
virtual void Refresh()=0;
|
2010-06-28 09:13:15 +02:00
|
|
|
virtual void SetFrame(int frame)=0;
|
2010-05-20 10:55:46 +02:00
|
|
|
virtual ~IVisualTool() { };
|
|
|
|
};
|
|
|
|
|
2010-06-30 08:29:14 +02:00
|
|
|
struct ltaddr {
|
|
|
|
template<class T>
|
|
|
|
bool operator()(T lft, T rgt) const {
|
|
|
|
return &*lft < &*rgt;
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
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
|
|
|
/// DOCME
|
|
|
|
/// @class VisualTool
|
|
|
|
/// @brief DOCME
|
|
|
|
/// DOCME
|
2010-05-20 10:55:46 +02:00
|
|
|
template<class FeatureType>
|
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 06:38:02 +02:00
|
|
|
class VisualTool : public IVisualTool, protected SubtitleSelectionListener {
|
2010-06-30 08:29:14 +02:00
|
|
|
protected:
|
2010-07-06 21:33:09 +02:00
|
|
|
typedef FeatureType Feature;
|
2010-06-30 08:29:14 +02:00
|
|
|
typedef typename std::list<FeatureType>::iterator feature_iterator;
|
|
|
|
typedef typename std::list<FeatureType>::const_iterator feature_const_iterator;
|
2010-05-20 10:55:35 +02:00
|
|
|
private:
|
2010-05-20 10:55:58 +02:00
|
|
|
int dragStartX; /// Starting x coordinate of the current drag, if any
|
|
|
|
int dragStartY; /// Starting y coordinate of the current drag, if any
|
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
|
|
|
|
2010-11-01 05:36:13 +01:00
|
|
|
int commitId;
|
|
|
|
|
2010-06-30 08:29:14 +02:00
|
|
|
/// Set curFeature to the topmost feature under the mouse, or end() if there
|
|
|
|
/// are none
|
2010-05-26 09:17:39 +02:00
|
|
|
void GetHighlightedFeature();
|
2007-01-08 22:11:06 +01:00
|
|
|
|
2010-06-28 09:13:15 +02:00
|
|
|
/// @brief Get the dialogue line currently in the edit box
|
|
|
|
/// @return NULL if the line is not active on the current frame
|
|
|
|
AssDialogue *GetActiveDialogueLine();
|
|
|
|
|
2010-06-30 08:29:14 +02:00
|
|
|
typedef typename std::set<feature_iterator, ltaddr>::iterator selection_iterator;
|
2010-05-16 08:39:11 +02:00
|
|
|
|
2010-06-30 08:29:14 +02:00
|
|
|
std::set<feature_iterator, ltaddr> selFeatures; /// Currently selected visual features
|
2010-06-28 09:13:15 +02:00
|
|
|
std::map<AssDialogue*, int> lineSelCount; /// Number of selected features for each line
|
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
|
|
|
|
2010-05-20 10:55:58 +02:00
|
|
|
bool selChanged; /// Has the selection already been changed in the current click?
|
2010-06-28 09:13:15 +02:00
|
|
|
|
|
|
|
/// @brief Called when a hold is begun
|
|
|
|
/// @return Should the hold actually happen?
|
|
|
|
virtual bool InitializeHold() { return false; }
|
|
|
|
/// @brief Called on every mouse event during a hold
|
|
|
|
virtual void UpdateHold() { }
|
|
|
|
/// @brief Called at the end of a hold
|
|
|
|
virtual void CommitHold() { }
|
|
|
|
|
|
|
|
/// @brief Called at the beginning of a drag
|
|
|
|
/// @param feature The visual feature clicked on
|
|
|
|
/// @return Should the drag happen?
|
2010-06-30 08:29:14 +02:00
|
|
|
virtual bool InitializeDrag(feature_iterator feature) { return true; }
|
2010-06-28 09:13:15 +02:00
|
|
|
/// @brief Called on every mouse event during a drag
|
|
|
|
/// @param feature The current feature to process; not necessarily the one clicked on
|
2010-06-30 08:29:14 +02:00
|
|
|
virtual void UpdateDrag(feature_iterator feature) { }
|
2010-06-28 09:13:15 +02:00
|
|
|
/// @brief Called at the end of a drag
|
2010-06-30 08:29:14 +02:00
|
|
|
virtual void CommitDrag(feature_iterator feature) { }
|
2010-06-28 09:13:15 +02:00
|
|
|
|
|
|
|
/// Called when the file is changed by something other than a visual tool
|
|
|
|
virtual void OnFileChanged() { DoRefresh(); }
|
|
|
|
/// Called when the frame number changes
|
|
|
|
virtual void OnFrameChanged() { }
|
|
|
|
/// Called when curDiag changes
|
|
|
|
virtual void OnLineChanged() { DoRefresh(); }
|
|
|
|
/// Generic refresh to simplify tools which do the same thing for any
|
|
|
|
/// external change (i.e. almost all of them). Called only by the above
|
|
|
|
/// methods.
|
|
|
|
virtual void DoRefresh() { }
|
|
|
|
|
|
|
|
/// @brief Called when there's stuff
|
|
|
|
/// @return Should the display rerender?
|
|
|
|
virtual bool Update() { return false; };
|
|
|
|
/// @brief Draw stuff
|
|
|
|
virtual void Draw()=0;
|
|
|
|
|
2010-05-20 10:55:58 +02:00
|
|
|
protected:
|
2010-06-30 08:29:14 +02:00
|
|
|
/// Read-only reference to the set of selected features for subclasses
|
|
|
|
const std::set<feature_iterator, ltaddr> &selectedFeatures;
|
|
|
|
typedef typename std::set<feature_iterator, ltaddr>::const_iterator sel_iterator;
|
2011-01-16 08:17:36 +01:00
|
|
|
agi::Context *c;
|
2010-05-20 10:55:58 +02:00
|
|
|
VideoDisplay *parent; /// VideoDisplay which this belongs to, used to frame conversion
|
|
|
|
bool holding; /// Is a hold currently in progress?
|
2010-06-28 09:13:15 +02:00
|
|
|
AssDialogue *curDiag; /// Active dialogue line; NULL if it is not visible on the current frame
|
2010-05-20 10:55:58 +02:00
|
|
|
bool dragging; /// Is a drag currently in progress?
|
2010-05-26 09:17:39 +02:00
|
|
|
bool externalChange; /// Only invalid drag lists when refreshing due to external changes
|
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
|
|
|
|
2010-06-30 08:29:14 +02:00
|
|
|
feature_iterator curFeature; /// Topmost feature under the mouse; generally only valid during a drag
|
|
|
|
std::list<FeatureType> features; /// List of features which are drawn and can be clicked on
|
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
|
|
|
|
2010-06-28 09:13:15 +02:00
|
|
|
int frameNumber; /// Current frame number
|
2010-05-20 10:55:58 +02:00
|
|
|
VideoState const& video; /// Mouse and video information
|
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
|
|
|
|
2010-05-20 10:55:58 +02:00
|
|
|
bool leftClick; /// Is a left click event currently being processed?
|
|
|
|
bool leftDClick; /// Is a left double click event currently being processed?
|
|
|
|
bool shiftDown; /// Is shift down?
|
|
|
|
bool ctrlDown; /// Is ctrl down?
|
|
|
|
bool altDown; /// Is alt down?
|
2007-06-30 23:56:15 +02:00
|
|
|
|
2007-01-08 22:11:06 +01:00
|
|
|
void GetLinePosition(AssDialogue *diag,int &x,int &y);
|
2007-01-09 07:25:25 +01:00
|
|
|
void GetLinePosition(AssDialogue *diag,int &x,int &y,int &orgx,int &orgy);
|
2007-07-04 02:36:04 +02:00
|
|
|
void GetLineMove(AssDialogue *diag,bool &hasMove,int &x1,int &y1,int &x2,int &y2,int &t1,int &t2);
|
2007-01-09 07:25:25 +01:00
|
|
|
void GetLineRotation(AssDialogue *diag,float &rx,float &ry,float &rz);
|
2007-01-10 22:01:47 +01:00
|
|
|
void GetLineScale(AssDialogue *diag,float &scalX,float &scalY);
|
2008-09-10 18:13:54 +02:00
|
|
|
void GetLineClip(AssDialogue *diag,int &x1,int &y1,int &x2,int &y2,bool &inverse);
|
|
|
|
wxString GetLineVectorClip(AssDialogue *diag,int &scale,bool &inverse);
|
2010-05-20 10:55:29 +02:00
|
|
|
void SetOverride(AssDialogue* line, wxString tag, wxString value);
|
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
|
|
|
|
2010-05-26 09:17:39 +02:00
|
|
|
/// Draw all of the features in the list
|
2007-07-01 09:09:37 +02:00
|
|
|
void DrawAllFeatures();
|
2010-05-26 09:17:39 +02:00
|
|
|
/// @brief Commit the current file state
|
|
|
|
/// @param message Description of changes for undo
|
2011-09-28 21:43:11 +02:00
|
|
|
void Commit(wxString message = "");
|
2007-01-08 22:11:06 +01:00
|
|
|
|
2010-05-26 09:17:39 +02:00
|
|
|
/// @brief Add a feature (and its line) to the selection
|
|
|
|
/// @param i Index in the feature list
|
2010-06-30 08:29:14 +02:00
|
|
|
void AddSelection(feature_iterator feat);
|
2010-06-28 09:13:15 +02:00
|
|
|
|
2010-05-26 09:17:39 +02:00
|
|
|
/// @brief Remove a feature from the selection
|
|
|
|
/// @param i Index in the feature list
|
|
|
|
/// Also deselects lines if all features for that line have been deselected
|
2010-06-30 08:29:14 +02:00
|
|
|
void RemoveSelection(feature_iterator feat);
|
2010-06-28 09:13:15 +02:00
|
|
|
|
|
|
|
/// @brief Set the selection to a single feature, deselecting everything else
|
|
|
|
/// @param i Index in the feature list
|
2010-06-30 08:29:14 +02:00
|
|
|
void SetSelection(feature_iterator feat);
|
2010-06-28 09:13:15 +02:00
|
|
|
|
2010-05-26 09:17:39 +02:00
|
|
|
/// @brief Clear the selection
|
2010-06-28 09:13:15 +02:00
|
|
|
void ClearSelection();
|
2010-05-26 09:17:39 +02:00
|
|
|
|
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 06:38:02 +02:00
|
|
|
// SubtitleSelectionListener implementation
|
2010-06-28 09:13:15 +02:00
|
|
|
void OnActiveLineChanged(AssDialogue *new_line);
|
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 06:38:02 +02:00
|
|
|
virtual void OnSelectedSetChanged(const Selection &lines_added, const Selection &lines_removed) { }
|
|
|
|
|
2007-01-08 22:11:06 +01:00
|
|
|
public:
|
2010-05-20 10:55:58 +02:00
|
|
|
/// @brief Handler for all mouse events
|
|
|
|
/// @param event Shockingly enough, the mouse event
|
2007-07-01 02:19:55 +02:00
|
|
|
void OnMouseEvent(wxMouseEvent &event);
|
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
|
|
|
|
2010-05-20 10:55:58 +02:00
|
|
|
/// @brief Event handler for the subtoolbar
|
|
|
|
virtual void OnSubTool(wxCommandEvent &) { }
|
2010-06-28 09:13:15 +02:00
|
|
|
|
|
|
|
/// @brief Signal that the file has changed
|
2007-07-01 09:09:37 +02:00
|
|
|
void Refresh();
|
2010-06-28 09:13:15 +02:00
|
|
|
/// @brief Signal that the current frame number has changed
|
|
|
|
/// @param newFrameNumber The new frame number
|
|
|
|
void SetFrame(int newFrameNumber);
|
|
|
|
|
2007-01-11 07:15:56 +01:00
|
|
|
|
2010-05-20 10:55:58 +02:00
|
|
|
/// @brief Constructor
|
|
|
|
/// @param parent The VideoDisplay to use for coordinate conversion
|
|
|
|
/// @param video Video and mouse information passing blob
|
2011-01-16 08:17:08 +01:00
|
|
|
VisualTool(VideoDisplay *parent, agi::Context *context, VideoState const& video);
|
2010-05-20 10:55:58 +02:00
|
|
|
|
|
|
|
/// @brief Destructor
|
2007-07-01 02:19:55 +02:00
|
|
|
virtual ~VisualTool();
|
2007-01-08 22:11:06 +01:00
|
|
|
};
|