2006-12-28 22:18:35 +01:00
|
|
|
// Copyright (c) 2006, Niels Martin Hansen
|
|
|
|
// 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/
|
2006-12-28 22:18:35 +01:00
|
|
|
//
|
2009-07-29 07:43:02 +02:00
|
|
|
// $Id$
|
|
|
|
|
|
|
|
/// @file auto4_lua.h
|
|
|
|
/// @see auto4_lua.cpp
|
|
|
|
/// @ingroup scripting
|
|
|
|
///
|
2006-12-28 22:18:35 +01:00
|
|
|
|
2009-09-11 04:36:34 +02:00
|
|
|
#ifndef AGI_PRE
|
2006-12-28 22:18:35 +01:00
|
|
|
#include <wx/event.h>
|
2009-09-11 04:36:34 +02:00
|
|
|
#include <wx/thread.h>
|
|
|
|
#endif
|
|
|
|
|
2010-05-21 03:13:36 +02:00
|
|
|
#include "compat.h"
|
2009-09-11 04:36:34 +02:00
|
|
|
#include "auto4_base.h"
|
2008-03-05 05:10:20 +01:00
|
|
|
|
2011-09-28 21:48:47 +02:00
|
|
|
#include "command/command.h"
|
2006-12-28 22:18:35 +01:00
|
|
|
|
2011-09-28 21:47:03 +02:00
|
|
|
class AssEntry;
|
2006-12-28 22:18:35 +01:00
|
|
|
class wxWindow;
|
2011-09-28 21:48:47 +02:00
|
|
|
struct lua_State;
|
2010-07-08 06:29:04 +02:00
|
|
|
namespace agi { namespace vfr { class Framerate; } }
|
2006-12-28 22:18:35 +01:00
|
|
|
|
|
|
|
namespace Automation4 {
|
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
|
|
|
/// @class LuaAssFile
|
2010-06-24 21:32:23 +02:00
|
|
|
/// @brief Object wrapping an AssFile object for modification through Lua
|
2006-12-28 22:18:35 +01:00
|
|
|
class LuaAssFile {
|
2010-06-24 21:32:23 +02:00
|
|
|
/// Pointer to file being modified
|
2006-12-28 22:18:35 +01:00
|
|
|
AssFile *ass;
|
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-24 21:32:23 +02:00
|
|
|
/// Lua state the object exists in
|
2006-12-28 22:18:35 +01:00
|
|
|
lua_State *L;
|
|
|
|
|
2010-06-24 21:32:23 +02:00
|
|
|
/// Is the feature this object is created for read-only?
|
2006-12-28 22:18:35 +01:00
|
|
|
bool can_modify;
|
2011-09-28 21:47:03 +02:00
|
|
|
/// Is the feature allowed to set undo points?
|
2006-12-28 22:18:35 +01:00
|
|
|
bool can_set_undo;
|
2011-09-28 21:47:03 +02:00
|
|
|
/// throws an error if modification is disallowed
|
|
|
|
void CheckAllowModify();
|
|
|
|
|
2011-09-28 21:47:12 +02:00
|
|
|
/// How ass file been modified by the script since the last commit
|
|
|
|
int modification_type;
|
|
|
|
|
2011-09-28 21:47:03 +02:00
|
|
|
/// Reference count used to avoid deleting this until both lua and the
|
|
|
|
/// calling C++ code are done with it
|
|
|
|
int references;
|
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-24 21:32:23 +02:00
|
|
|
/// Cursor for last access into file
|
2006-12-28 22:18:35 +01:00
|
|
|
std::list<AssEntry*>::iterator last_entry_ptr;
|
2010-06-24 21:32:23 +02:00
|
|
|
/// Index for last access into file
|
2006-12-28 22:18:35 +01:00
|
|
|
int last_entry_id;
|
2011-09-28 21:47:03 +02:00
|
|
|
/// Move last_entry_ptr to 1-based index n
|
|
|
|
void SeekCursorTo(int n);
|
|
|
|
|
|
|
|
int ObjectIndexRead(lua_State *L);
|
|
|
|
void ObjectIndexWrite(lua_State *L);
|
|
|
|
int ObjectGetLen(lua_State *L);
|
|
|
|
void ObjectDelete(lua_State *L);
|
|
|
|
void ObjectDeleteRange(lua_State *L);
|
|
|
|
void ObjectAppend(lua_State *L);
|
|
|
|
void ObjectInsert(lua_State *L);
|
|
|
|
void ObjectGarbageCollect(lua_State *L);
|
|
|
|
|
|
|
|
int LuaParseTagData(lua_State *L);
|
|
|
|
int LuaUnparseTagData(lua_State *L);
|
|
|
|
int LuaParseKaraokeData(lua_State *L);
|
|
|
|
|
|
|
|
void LuaSetUndoPoint(lua_State *L);
|
|
|
|
|
|
|
|
// LuaAssFile can only be deleted by the reference count hitting zero
|
|
|
|
~LuaAssFile() { }
|
2006-12-28 22:18:35 +01:00
|
|
|
public:
|
2011-09-28 21:47:03 +02:00
|
|
|
static LuaAssFile *GetObjPointer(lua_State *L, int idx);
|
2006-12-28 22:18:35 +01:00
|
|
|
|
2011-09-28 21:47:03 +02:00
|
|
|
/// makes a Lua representation of AssEntry and places on the top of the stack
|
|
|
|
static void AssEntryToLua(lua_State *L, AssEntry *e);
|
|
|
|
/// assumes a Lua representation of AssEntry on the top of the stack, and creates an AssEntry object of it
|
|
|
|
static AssEntry *LuaToAssEntry(lua_State *L);
|
|
|
|
|
|
|
|
/// @brief Signal that the script using this file is now done running
|
|
|
|
/// @param set_undo If there's any uncommitted changes to the file,
|
|
|
|
/// they will be automatically committed with this
|
|
|
|
/// description
|
|
|
|
void ProcessingComplete(wxString const& undo_description = "");
|
|
|
|
|
|
|
|
/// Constructor
|
|
|
|
/// @param L lua state
|
|
|
|
/// @param ass File to wrap
|
|
|
|
/// @param can_modify Is modifying the file allowed?
|
|
|
|
/// @param can_set_undo Is setting undo points allowed?
|
|
|
|
LuaAssFile(lua_State *L, AssFile *ass, bool can_modify = false, bool can_set_undo = false);
|
2006-12-28 22:18:35 +01:00
|
|
|
};
|
|
|
|
|
2011-09-28 21:47:40 +02:00
|
|
|
class LuaProgressSink {
|
2006-12-28 22:18:35 +01:00
|
|
|
lua_State *L;
|
|
|
|
|
|
|
|
static int LuaSetProgress(lua_State *L);
|
|
|
|
static int LuaSetTask(lua_State *L);
|
|
|
|
static int LuaSetTitle(lua_State *L);
|
|
|
|
static int LuaGetCancelled(lua_State *L);
|
|
|
|
static int LuaDebugOut(lua_State *L);
|
|
|
|
static int LuaDisplayDialog(lua_State *L);
|
|
|
|
|
|
|
|
public:
|
2011-09-28 21:47:40 +02:00
|
|
|
LuaProgressSink(lua_State *L, ProgressSink *ps, bool allow_config_dialog = true);
|
|
|
|
~LuaProgressSink();
|
2006-12-28 22:18:35 +01:00
|
|
|
|
2011-09-28 21:47:40 +02:00
|
|
|
static ProgressSink* GetObjPointer(lua_State *L, int idx);
|
2006-12-28 22:18:35 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
|
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 LuaConfigDialogControl
|
|
|
|
/// @brief DOCME
|
|
|
|
///
|
|
|
|
/// DOCME
|
2006-12-28 22:18:35 +01:00
|
|
|
class LuaConfigDialogControl {
|
|
|
|
public:
|
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
|
2006-12-28 22:18:35 +01:00
|
|
|
wxControl *cw; // control window
|
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
|
|
|
|
|
|
|
|
/// DOCME
|
2006-12-28 22:18:35 +01:00
|
|
|
wxString name, hint;
|
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
|
|
|
|
|
|
|
|
/// DOCME
|
|
|
|
|
|
|
|
/// DOCME
|
|
|
|
|
|
|
|
/// DOCME
|
2006-12-28 22:18:35 +01:00
|
|
|
int x, y, width, height;
|
|
|
|
|
|
|
|
virtual wxControl *Create(wxWindow *parent) = 0;
|
|
|
|
virtual void ControlReadBack() = 0;
|
|
|
|
virtual void LuaReadBack(lua_State *L) = 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
|
|
|
|
|
|
|
/// @brief DOCME
|
|
|
|
/// @return
|
|
|
|
///
|
2007-04-04 02:01:17 +02:00
|
|
|
virtual bool CanSerialiseValue() { return false; }
|
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
|
|
|
|
|
|
|
/// @brief DOCME
|
|
|
|
/// @return
|
|
|
|
///
|
2011-09-28 21:43:11 +02:00
|
|
|
virtual wxString SerialiseValue() { return ""; }
|
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
|
|
|
|
|
|
|
/// @brief DOCME
|
|
|
|
/// @param serialised
|
|
|
|
///
|
2007-04-04 02:01:17 +02:00
|
|
|
virtual void UnserialiseValue(const wxString &serialised) { }
|
|
|
|
|
2006-12-28 22:18:35 +01:00
|
|
|
LuaConfigDialogControl(lua_State *L);
|
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
|
|
|
|
|
|
|
/// @brief DOCME
|
|
|
|
///
|
2007-01-15 16:27:13 +01:00
|
|
|
virtual ~LuaConfigDialogControl() { }
|
2006-12-28 22:18:35 +01:00
|
|
|
};
|
|
|
|
|
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 LuaConfigDialog
|
|
|
|
/// @brief DOCME
|
|
|
|
///
|
|
|
|
/// DOCME
|
2006-12-28 22:18:35 +01:00
|
|
|
class LuaConfigDialog : public ScriptConfigDialog {
|
|
|
|
private:
|
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
|
2006-12-28 22:18:35 +01:00
|
|
|
std::vector<LuaConfigDialogControl*> controls;
|
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
|
2006-12-28 22:18:35 +01:00
|
|
|
std::vector<wxString> buttons;
|
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
|
2006-12-28 22:18:35 +01:00
|
|
|
bool use_buttons;
|
|
|
|
|
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 ButtonEventHandler
|
|
|
|
/// @brief DOCME
|
|
|
|
///
|
|
|
|
/// DOCME
|
2006-12-28 22:18:35 +01:00
|
|
|
class ButtonEventHandler : public wxEvtHandler {
|
|
|
|
public:
|
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
|
2006-12-28 22:18:35 +01:00
|
|
|
int *button_pushed;
|
|
|
|
void OnButtonPush(wxCommandEvent &evt);
|
|
|
|
};
|
|
|
|
|
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
|
2006-12-28 22:18:35 +01:00
|
|
|
ButtonEventHandler *button_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
|
|
|
|
|
|
|
/// DOCME
|
2006-12-28 22:18:35 +01:00
|
|
|
int button_pushed;
|
|
|
|
|
|
|
|
protected:
|
|
|
|
wxWindow* CreateWindow(wxWindow *parent);
|
|
|
|
|
|
|
|
public:
|
|
|
|
LuaConfigDialog(lua_State *_L, bool include_buttons);
|
|
|
|
virtual ~LuaConfigDialog();
|
|
|
|
int LuaReadBack(lua_State *L); // read back internal structure to lua structures
|
|
|
|
|
2007-04-04 02:01:17 +02:00
|
|
|
wxString Serialise();
|
|
|
|
void Unserialise(const wxString &serialised);
|
|
|
|
|
2006-12-28 22:18:35 +01:00
|
|
|
void ReadBack(); // from auto4 base
|
|
|
|
};
|
|
|
|
|
2011-09-28 21:48:47 +02:00
|
|
|
class LuaFeature {
|
|
|
|
int myid;
|
2006-12-28 22:18:35 +01:00
|
|
|
protected:
|
|
|
|
lua_State *L;
|
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
|
|
|
|
2006-12-28 22:18:35 +01:00
|
|
|
void RegisterFeature();
|
2011-09-28 21:48:47 +02:00
|
|
|
void UnregisterFeature();
|
2006-12-28 22:18:35 +01:00
|
|
|
|
2011-09-28 21:48:47 +02:00
|
|
|
void GetFeatureFunction(const char *function);
|
2006-12-28 22:18:35 +01:00
|
|
|
void ThrowError();
|
2011-09-28 21:48:47 +02:00
|
|
|
|
|
|
|
LuaFeature(lua_State *L);
|
2006-12-28 22:18:35 +01:00
|
|
|
};
|
|
|
|
|
2011-09-28 21:47:40 +02:00
|
|
|
void LuaThreadedCall(lua_State *L, int nargs, int nresults, wxString const& title, wxWindow *parent, bool can_open_config);
|
2006-12-28 22:18:35 +01:00
|
|
|
|
2011-09-28 21:48:47 +02:00
|
|
|
class LuaCommand : public cmd::Command, private LuaFeature {
|
|
|
|
std::string cmd_name;
|
|
|
|
wxString display;
|
|
|
|
wxString help;
|
|
|
|
int cmd_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-09-28 21:48:47 +02:00
|
|
|
LuaCommand(lua_State *L);
|
2006-12-28 22:18:35 +01:00
|
|
|
public:
|
2011-09-28 21:48:47 +02:00
|
|
|
~LuaCommand();
|
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-09-28 21:48:47 +02:00
|
|
|
const char* name() { return cmd_name.c_str(); }
|
|
|
|
wxString StrMenu(const agi::Context *) const { return display; }
|
|
|
|
wxString StrDisplay(const agi::Context *) const { return display; }
|
|
|
|
wxString StrHelp() const { return help; }
|
2006-12-28 22:18:35 +01:00
|
|
|
|
2011-09-28 21:48:47 +02:00
|
|
|
int Type() const { return cmd_type; }
|
2006-12-28 22:18:35 +01:00
|
|
|
|
2011-09-28 21:48:47 +02:00
|
|
|
void operator()(agi::Context *c);
|
|
|
|
bool Validate(const agi::Context *c);
|
|
|
|
virtual bool IsActive(const 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
|
|
|
|
2011-09-28 21:48:47 +02:00
|
|
|
static int LuaRegister(lua_State *L);
|
|
|
|
};
|
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-09-28 21:48:47 +02:00
|
|
|
class LuaExportFilter : public ExportFilter, private LuaFeature {
|
|
|
|
bool has_config;
|
2006-12-28 22:18:35 +01:00
|
|
|
LuaConfigDialog *config_dialog;
|
|
|
|
|
|
|
|
protected:
|
2011-09-28 21:48:47 +02:00
|
|
|
LuaExportFilter(lua_State *L);
|
2006-12-28 22:18:35 +01:00
|
|
|
|
2011-09-28 21:48:47 +02:00
|
|
|
ScriptConfigDialog* GenerateConfigDialog(wxWindow *parent, agi::Context *c);
|
2006-12-28 22:18:35 +01:00
|
|
|
public:
|
|
|
|
static int LuaRegister(lua_State *L);
|
|
|
|
|
2011-09-28 21:48:47 +02:00
|
|
|
virtual ~LuaExportFilter() { }
|
2007-05-04 03:43:00 +02:00
|
|
|
|
2006-12-28 22:18:35 +01:00
|
|
|
void ProcessSubs(AssFile *subs, wxWindow *export_dialog);
|
|
|
|
};
|
|
|
|
|
2011-09-28 21:48:37 +02:00
|
|
|
class LuaScript : public Script {
|
|
|
|
lua_State *L;
|
|
|
|
|
|
|
|
wxString name;
|
|
|
|
wxString description;
|
|
|
|
wxString author;
|
|
|
|
wxString version;
|
|
|
|
|
2011-09-28 21:48:47 +02:00
|
|
|
std::vector<cmd::Command*> macros;
|
|
|
|
std::vector<ExportFilter*> filters;
|
2011-09-28 21:48:37 +02:00
|
|
|
|
|
|
|
/// load script and create internal structures etc.
|
|
|
|
void Create();
|
|
|
|
/// destroy internal structures, unreg features and delete environment
|
|
|
|
void Destroy();
|
|
|
|
|
|
|
|
static int LuaTextExtents(lua_State *L);
|
|
|
|
static int LuaInclude(lua_State *L);
|
|
|
|
static int LuaModuleLoader(lua_State *L);
|
|
|
|
static int LuaFrameFromMs(lua_State *L);
|
|
|
|
static int LuaMsFromFrame(lua_State *L);
|
|
|
|
static int LuaVideoSize(lua_State *L);
|
|
|
|
|
|
|
|
public:
|
|
|
|
LuaScript(const wxString &filename);
|
|
|
|
~LuaScript();
|
|
|
|
|
2011-09-28 21:48:47 +02:00
|
|
|
void RegisterCommand(LuaCommand *command);
|
|
|
|
void UnregisterCommand(LuaCommand *command);
|
|
|
|
void RegisterFilter(LuaExportFilter *filter);
|
2011-09-28 21:48:37 +02:00
|
|
|
|
2011-09-28 21:48:47 +02:00
|
|
|
static LuaScript* GetScriptObject(lua_State *L);
|
2011-09-28 21:48:37 +02:00
|
|
|
|
|
|
|
// Script implementation
|
|
|
|
void Reload();
|
|
|
|
|
|
|
|
wxString GetName() const { return name; }
|
|
|
|
wxString GetDescription() const { return description; }
|
|
|
|
wxString GetAuthor() const { return author; }
|
|
|
|
wxString GetVersion() const { return version; }
|
|
|
|
bool GetLoadedState() const { return L != 0; }
|
|
|
|
|
2011-09-28 21:48:47 +02:00
|
|
|
std::vector<cmd::Command*> GetMacros() const { return macros; }
|
|
|
|
std::vector<ExportFilter*> GetFilters() const { return filters; }
|
|
|
|
std::vector<SubtitleFormat*> GetFormats() const { return std::vector<SubtitleFormat*>(); }
|
2011-09-28 21:48:37 +02:00
|
|
|
};
|
2006-12-28 22:18:35 +01:00
|
|
|
};
|