mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-10 04:57:00 -04:00
(sorry for making this all one commit)
Fiddled with the backbone for scripts some more. VCS are now suppported in sets but configuration/non-svn-systems missing Linux build now uses precompiled headers (build time--) A couple warning fixes too. git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@1427 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
rm Makefile.am;
|
||||
echo "
|
||||
echo '
|
||||
#+----------------------------------------------------------------------------+
|
||||
#| Description: Magic Set Editor - Program to make Magic (tm) cards |
|
||||
#| Copyright: (C) 2001 - 2008 Twan van Laarhoven and \"coppro\" |
|
||||
#| Copyright: (C) 2001 - 2008 Twan van Laarhoven and "coppro" |
|
||||
#| License: GNU General Public License 2 or later (see file COPYING) |
|
||||
#+----------------------------------------------------------------------------+
|
||||
|
||||
@@ -12,13 +12,30 @@ echo "
|
||||
AUTOMAKE_OPTIONS = subdir-objects
|
||||
|
||||
bin_PROGRAMS = magicseteditor
|
||||
AM_CXXFLAGS = @WX_CXXFLAGS@ \$(BOOST_CXXFLAGS) -DUNICODE -I . -Wall
|
||||
AM_LDFLAGS = @WX_LIBS@ \$(BOOST_LDFLAGS)
|
||||
AM_CXXFLAGS = @WX_CXXFLAGS@ $(BOOST_CXXFLAGS) -DUNICODE -I . -Wall
|
||||
AM_LDFLAGS = @WX_LIBS@ $(BOOST_LDFLAGS)
|
||||
|
||||
magicseteditor_LDADD = \$(BOOST_REGEX_LIB)
|
||||
.hpp.gch:
|
||||
target=`echo $@ | sed "s|.gch$$|.hpp|"`;\
|
||||
depbase=`echo $$target | sed "s|[^/]*\$$|$(DEPDIR)/&|;s|\\.hpp\$$||"`;\
|
||||
$(CXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpch -c $$target &&\
|
||||
$(am__mv) $$depbase.Tpch $$depbase.Pch
|
||||
touch $@
|
||||
.gch.o:
|
||||
gcc -x c - -c -o $@ <<<""
|
||||
|
||||
magicseteditor_LDADD = $(BOOST_REGEX_LIB)
|
||||
magicseteditor_CXXFLAGS = -fpch-deps $(AM_CXXFLAGS)
|
||||
magicseteditor_SOURCES =
|
||||
|
||||
# The script used to generate is MakeAM.sh " > Makefile.am;
|
||||
if GLIBCPP_BUILD_PCH
|
||||
clean-local:
|
||||
rm -f ./src/util/prec.hpp.gch
|
||||
rm -f ./src/util/prec.gch
|
||||
include ./src/util/$(DEPDIR)/prec.Pch
|
||||
magicseteditor_SOURCES += ./src/util/prec.gch
|
||||
endif
|
||||
|
||||
# The script used to generate is MakeAM.sh' > Makefile.am;
|
||||
|
||||
find . -name *.cpp | sed "s/\./magicseteditor_SOURCES += ./" >> Makefile.am;
|
||||
|
||||
+206
@@ -0,0 +1,206 @@
|
||||
|
||||
#+----------------------------------------------------------------------------+
|
||||
#| Description: Magic Set Editor - Program to make Magic (tm) cards |
|
||||
#| Copyright: (C) 2001 - 2008 Twan van Laarhoven and "coppro" |
|
||||
#| License: GNU General Public License 2 or later (see file COPYING) |
|
||||
#+----------------------------------------------------------------------------+
|
||||
|
||||
# This file is generated by MakeAM.sh. DO NOT EDIT!
|
||||
|
||||
# This flag allows us to use subdirectories:
|
||||
AUTOMAKE_OPTIONS = subdir-objects
|
||||
|
||||
bin_PROGRAMS = magicseteditor
|
||||
AM_CXXFLAGS = @WX_CXXFLAGS@ $(BOOST_CXXFLAGS) -DUNICODE -I . -Wall
|
||||
AM_LDFLAGS = @WX_LIBS@ $(BOOST_LDFLAGS)
|
||||
|
||||
.hpp.gch:
|
||||
target=`echo $@ | sed "s|.gch$$|.hpp|"`;\
|
||||
depbase=`echo $$target | sed "s|[^/]*\$$|$(DEPDIR)/&|;s|\\.hpp\$$||"`;\
|
||||
$(CXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpch -c $$target &&\
|
||||
$(am__mv) $$depbase.Tpch $$depbase.Pch
|
||||
touch $@
|
||||
.gch.o:
|
||||
gcc -x c - -c -o $@ <<<""
|
||||
|
||||
magicseteditor_LDADD = $(BOOST_REGEX_LIB)
|
||||
magicseteditor_CXXFLAGS = -fpch-deps $(AM_CXXFLAGS)
|
||||
magicseteditor_SOURCES =
|
||||
|
||||
if GLIBCPP_BUILD_PCH
|
||||
clean-local:
|
||||
rm -f ./src/util/prec.hpp.gch
|
||||
rm -f ./src/util/prec.gch
|
||||
include ./src/util/$(DEPDIR)/prec.Pch
|
||||
magicseteditor_SOURCES += ./src/util/prec.gch
|
||||
endif
|
||||
|
||||
# The script used to generate is MakeAM.sh
|
||||
magicseteditor_SOURCES += ./src/util/version.cpp
|
||||
magicseteditor_SOURCES += ./src/util/alignment.cpp
|
||||
magicseteditor_SOURCES += ./src/util/rotation.cpp
|
||||
magicseteditor_SOURCES += ./src/util/tagged_string.cpp
|
||||
magicseteditor_SOURCES += ./src/util/spell_checker.cpp
|
||||
magicseteditor_SOURCES += ./src/util/vcs/subversion.cpp
|
||||
magicseteditor_SOURCES += ./src/util/vcs.cpp
|
||||
magicseteditor_SOURCES += ./src/util/regex.cpp
|
||||
magicseteditor_SOURCES += ./src/util/spec_sort.cpp
|
||||
magicseteditor_SOURCES += ./src/util/io/get_member.cpp
|
||||
magicseteditor_SOURCES += ./src/util/io/package_manager.cpp
|
||||
magicseteditor_SOURCES += ./src/util/io/writer.cpp
|
||||
magicseteditor_SOURCES += ./src/util/io/reader.cpp
|
||||
magicseteditor_SOURCES += ./src/util/io/package.cpp
|
||||
magicseteditor_SOURCES += ./src/util/action_stack.cpp
|
||||
magicseteditor_SOURCES += ./src/util/error.cpp
|
||||
magicseteditor_SOURCES += ./src/util/age.cpp
|
||||
magicseteditor_SOURCES += ./src/util/file_utils.cpp
|
||||
magicseteditor_SOURCES += ./src/util/string.cpp
|
||||
magicseteditor_SOURCES += ./src/gfx/color.cpp
|
||||
magicseteditor_SOURCES += ./src/gfx/mask_image.cpp
|
||||
magicseteditor_SOURCES += ./src/gfx/rotate_image.cpp
|
||||
magicseteditor_SOURCES += ./src/gfx/image_effects.cpp
|
||||
magicseteditor_SOURCES += ./src/gfx/resample_text.cpp
|
||||
magicseteditor_SOURCES += ./src/gfx/combine_image.cpp
|
||||
magicseteditor_SOURCES += ./src/gfx/polynomial.cpp
|
||||
magicseteditor_SOURCES += ./src/gfx/bezier.cpp
|
||||
magicseteditor_SOURCES += ./src/gfx/generated_image.cpp
|
||||
magicseteditor_SOURCES += ./src/gfx/resample_image.cpp
|
||||
magicseteditor_SOURCES += ./src/gfx/blend_image.cpp
|
||||
magicseteditor_SOURCES += ./src/main.cpp
|
||||
magicseteditor_SOURCES += ./src/render/card/viewer.cpp
|
||||
magicseteditor_SOURCES += ./src/render/text/compound.cpp
|
||||
magicseteditor_SOURCES += ./src/render/text/symbol.cpp
|
||||
magicseteditor_SOURCES += ./src/render/text/font.cpp
|
||||
magicseteditor_SOURCES += ./src/render/text/viewer.cpp
|
||||
magicseteditor_SOURCES += ./src/render/text/element.cpp
|
||||
magicseteditor_SOURCES += ./src/render/symbol/filter.cpp
|
||||
magicseteditor_SOURCES += ./src/render/symbol/viewer.cpp
|
||||
magicseteditor_SOURCES += ./src/render/value/multiple_choice.cpp
|
||||
magicseteditor_SOURCES += ./src/render/value/symbol.cpp
|
||||
magicseteditor_SOURCES += ./src/render/value/color.cpp
|
||||
magicseteditor_SOURCES += ./src/render/value/package_choice.cpp
|
||||
magicseteditor_SOURCES += ./src/render/value/viewer.cpp
|
||||
magicseteditor_SOURCES += ./src/render/value/text.cpp
|
||||
magicseteditor_SOURCES += ./src/render/value/information.cpp
|
||||
magicseteditor_SOURCES += ./src/render/value/choice.cpp
|
||||
magicseteditor_SOURCES += ./src/render/value/image.cpp
|
||||
magicseteditor_SOURCES += ./src/script/scriptable.cpp
|
||||
magicseteditor_SOURCES += ./src/script/profiler.cpp
|
||||
magicseteditor_SOURCES += ./src/script/script_manager.cpp
|
||||
magicseteditor_SOURCES += ./src/script/functions/spelling.cpp
|
||||
magicseteditor_SOURCES += ./src/script/functions/english.cpp
|
||||
magicseteditor_SOURCES += ./src/script/functions/basic.cpp
|
||||
magicseteditor_SOURCES += ./src/script/functions/construction.cpp
|
||||
magicseteditor_SOURCES += ./src/script/functions/regex.cpp
|
||||
magicseteditor_SOURCES += ./src/script/functions/editor.cpp
|
||||
magicseteditor_SOURCES += ./src/script/functions/image.cpp
|
||||
magicseteditor_SOURCES += ./src/script/functions/export.cpp
|
||||
magicseteditor_SOURCES += ./src/script/context.cpp
|
||||
magicseteditor_SOURCES += ./src/script/dependency.cpp
|
||||
magicseteditor_SOURCES += ./src/script/value.cpp
|
||||
magicseteditor_SOURCES += ./src/script/script.cpp
|
||||
magicseteditor_SOURCES += ./src/script/parser.cpp
|
||||
magicseteditor_SOURCES += ./src/script/image.cpp
|
||||
magicseteditor_SOURCES += ./src/data/statistics.cpp
|
||||
magicseteditor_SOURCES += ./src/data/add_cards_script.cpp
|
||||
magicseteditor_SOURCES += ./src/data/locale.cpp
|
||||
magicseteditor_SOURCES += ./src/data/card.cpp
|
||||
magicseteditor_SOURCES += ./src/data/symbol.cpp
|
||||
magicseteditor_SOURCES += ./src/data/game.cpp
|
||||
magicseteditor_SOURCES += ./src/data/font.cpp
|
||||
magicseteditor_SOURCES += ./src/data/symbol_font.cpp
|
||||
magicseteditor_SOURCES += ./src/data/stylesheet.cpp
|
||||
magicseteditor_SOURCES += ./src/data/format/html.cpp
|
||||
magicseteditor_SOURCES += ./src/data/format/mse1.cpp
|
||||
magicseteditor_SOURCES += ./src/data/format/mse2.cpp
|
||||
magicseteditor_SOURCES += ./src/data/format/apprentice.cpp
|
||||
magicseteditor_SOURCES += ./src/data/format/clipboard.cpp
|
||||
magicseteditor_SOURCES += ./src/data/format/image_to_symbol.cpp
|
||||
magicseteditor_SOURCES += ./src/data/format/mws.cpp
|
||||
magicseteditor_SOURCES += ./src/data/format/image.cpp
|
||||
magicseteditor_SOURCES += ./src/data/format/mtg_editor.cpp
|
||||
magicseteditor_SOURCES += ./src/data/format/formats.cpp
|
||||
magicseteditor_SOURCES += ./src/data/settings.cpp
|
||||
magicseteditor_SOURCES += ./src/data/keyword.cpp
|
||||
magicseteditor_SOURCES += ./src/data/export_template.cpp
|
||||
magicseteditor_SOURCES += ./src/data/field.cpp
|
||||
magicseteditor_SOURCES += ./src/data/word_list.cpp
|
||||
magicseteditor_SOURCES += ./src/data/field/multiple_choice.cpp
|
||||
magicseteditor_SOURCES += ./src/data/field/symbol.cpp
|
||||
magicseteditor_SOURCES += ./src/data/field/color.cpp
|
||||
magicseteditor_SOURCES += ./src/data/field/package_choice.cpp
|
||||
magicseteditor_SOURCES += ./src/data/field/boolean.cpp
|
||||
magicseteditor_SOURCES += ./src/data/field/text.cpp
|
||||
magicseteditor_SOURCES += ./src/data/field/information.cpp
|
||||
magicseteditor_SOURCES += ./src/data/field/choice.cpp
|
||||
magicseteditor_SOURCES += ./src/data/field/image.cpp
|
||||
magicseteditor_SOURCES += ./src/data/installer.cpp
|
||||
magicseteditor_SOURCES += ./src/data/set.cpp
|
||||
magicseteditor_SOURCES += ./src/data/action/symbol_part.cpp
|
||||
magicseteditor_SOURCES += ./src/data/action/symbol.cpp
|
||||
magicseteditor_SOURCES += ./src/data/action/keyword.cpp
|
||||
magicseteditor_SOURCES += ./src/data/action/value.cpp
|
||||
magicseteditor_SOURCES += ./src/data/action/set.cpp
|
||||
magicseteditor_SOURCES += ./src/data/pack.cpp
|
||||
magicseteditor_SOURCES += ./src/gui/new_window.cpp
|
||||
magicseteditor_SOURCES += ./src/gui/update_checker.cpp
|
||||
magicseteditor_SOURCES += ./src/gui/icon_menu.cpp
|
||||
magicseteditor_SOURCES += ./src/gui/util.cpp
|
||||
magicseteditor_SOURCES += ./src/gui/image_slice_window.cpp
|
||||
magicseteditor_SOURCES += ./src/gui/preferences_window.cpp
|
||||
magicseteditor_SOURCES += ./src/gui/card_select_window.cpp
|
||||
magicseteditor_SOURCES += ./src/gui/symbol/control.cpp
|
||||
magicseteditor_SOURCES += ./src/gui/symbol/point_editor.cpp
|
||||
magicseteditor_SOURCES += ./src/gui/symbol/symmetry_editor.cpp
|
||||
magicseteditor_SOURCES += ./src/gui/symbol/select_editor.cpp
|
||||
magicseteditor_SOURCES += ./src/gui/symbol/basic_shape_editor.cpp
|
||||
magicseteditor_SOURCES += ./src/gui/symbol/editor.cpp
|
||||
magicseteditor_SOURCES += ./src/gui/symbol/window.cpp
|
||||
magicseteditor_SOURCES += ./src/gui/symbol/part_list.cpp
|
||||
magicseteditor_SOURCES += ./src/gui/symbol/selection.cpp
|
||||
magicseteditor_SOURCES += ./src/gui/set/cards_panel.cpp
|
||||
magicseteditor_SOURCES += ./src/gui/set/style_panel.cpp
|
||||
magicseteditor_SOURCES += ./src/gui/set/set_info_panel.cpp
|
||||
magicseteditor_SOURCES += ./src/gui/set/keywords_panel.cpp
|
||||
magicseteditor_SOURCES += ./src/gui/set/panel.cpp
|
||||
magicseteditor_SOURCES += ./src/gui/set/stats_panel.cpp
|
||||
magicseteditor_SOURCES += ./src/gui/set/random_pack_panel.cpp
|
||||
magicseteditor_SOURCES += ./src/gui/set/window.cpp
|
||||
magicseteditor_SOURCES += ./src/gui/thumbnail_thread.cpp
|
||||
magicseteditor_SOURCES += ./src/gui/welcome_window.cpp
|
||||
magicseteditor_SOURCES += ./src/gui/value/multiple_choice.cpp
|
||||
magicseteditor_SOURCES += ./src/gui/value/symbol.cpp
|
||||
magicseteditor_SOURCES += ./src/gui/value/color.cpp
|
||||
magicseteditor_SOURCES += ./src/gui/value/package_choice.cpp
|
||||
magicseteditor_SOURCES += ./src/gui/value/editor.cpp
|
||||
magicseteditor_SOURCES += ./src/gui/value/text.cpp
|
||||
magicseteditor_SOURCES += ./src/gui/value/information.cpp
|
||||
magicseteditor_SOURCES += ./src/gui/value/choice.cpp
|
||||
magicseteditor_SOURCES += ./src/gui/value/image.cpp
|
||||
magicseteditor_SOURCES += ./src/gui/images_export_window.cpp
|
||||
magicseteditor_SOURCES += ./src/gui/print_window.cpp
|
||||
magicseteditor_SOURCES += ./src/gui/control/card_editor.cpp
|
||||
magicseteditor_SOURCES += ./src/gui/control/package_list.cpp
|
||||
magicseteditor_SOURCES += ./src/gui/control/native_look_editor.cpp
|
||||
magicseteditor_SOURCES += ./src/gui/control/keyword_list.cpp
|
||||
magicseteditor_SOURCES += ./src/gui/control/graph.cpp
|
||||
magicseteditor_SOURCES += ./src/gui/control/card_list.cpp
|
||||
magicseteditor_SOURCES += ./src/gui/control/gallery_list.cpp
|
||||
magicseteditor_SOURCES += ./src/gui/control/item_list.cpp
|
||||
magicseteditor_SOURCES += ./src/gui/control/filtered_card_list.cpp
|
||||
magicseteditor_SOURCES += ./src/gui/control/image_card_list.cpp
|
||||
magicseteditor_SOURCES += ./src/gui/control/card_viewer.cpp
|
||||
magicseteditor_SOURCES += ./src/gui/control/tree_list.cpp
|
||||
magicseteditor_SOURCES += ./src/gui/control/text_ctrl.cpp
|
||||
magicseteditor_SOURCES += ./src/gui/control/card_list_column_select.cpp
|
||||
magicseteditor_SOURCES += ./src/gui/control/select_card_list.cpp
|
||||
magicseteditor_SOURCES += ./src/gui/package_update_list.cpp
|
||||
magicseteditor_SOURCES += ./src/gui/about_window.cpp
|
||||
magicseteditor_SOURCES += ./src/gui/drop_down_list.cpp
|
||||
magicseteditor_SOURCES += ./src/gui/auto_replace_window.cpp
|
||||
magicseteditor_SOURCES += ./src/gui/packages_window.cpp
|
||||
magicseteditor_SOURCES += ./src/gui/html_export_window.cpp
|
||||
magicseteditor_SOURCES += ./src/cli/win32_cli_wrapper.cpp
|
||||
magicseteditor_SOURCES += ./src/cli/cli_main.cpp
|
||||
magicseteditor_SOURCES += ./src/cli/text_io_handler.cpp
|
||||
magicseteditor_SOURCES += ./src/code_template.cpp
|
||||
+3287
-726
File diff suppressed because it is too large
Load Diff
Vendored
+1644
File diff suppressed because it is too large
Load Diff
@@ -598,6 +598,8 @@ LIBOBJS
|
||||
EGREP
|
||||
GREP
|
||||
CPP
|
||||
GLIBCPP_BUILD_PCH_FALSE
|
||||
GLIBCPP_BUILD_PCH_TRUE
|
||||
WX_RESCOMP
|
||||
WX_VERSION
|
||||
WX_LIBS_STATIC
|
||||
@@ -4910,6 +4912,17 @@ if test "${HAVE_WX}" != 1; then
|
||||
" "$LINENO" 5
|
||||
fi
|
||||
|
||||
# Check for precompiled headers
|
||||
# TODO: Deal with braindead GCC and actually check
|
||||
if test "x$CXX" = "xg++"; then
|
||||
GLIBCPP_BUILD_PCH_TRUE=
|
||||
GLIBCPP_BUILD_PCH_FALSE='#'
|
||||
else
|
||||
GLIBCPP_BUILD_PCH_TRUE='#'
|
||||
GLIBCPP_BUILD_PCH_FALSE=
|
||||
fi
|
||||
|
||||
|
||||
# Checks for header files.
|
||||
|
||||
# Checks for typedefs, structures, and compiler characteristics.
|
||||
@@ -5813,6 +5826,10 @@ if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then
|
||||
as_fn_error "conditional \"am__fastdepCC\" was never defined.
|
||||
Usually this means the macro was only invoked conditionally." "$LINENO" 5
|
||||
fi
|
||||
if test -z "${GLIBCPP_BUILD_PCH_TRUE}" && test -z "${GLIBCPP_BUILD_PCH_FALSE}"; then
|
||||
as_fn_error "conditional \"GLIBCPP_BUILD_PCH\" was never defined.
|
||||
Usually this means the macro was only invoked conditionally." "$LINENO" 5
|
||||
fi
|
||||
|
||||
: ${CONFIG_STATUS=./config.status}
|
||||
ac_write_fail=0
|
||||
|
||||
+5
-1
@@ -11,7 +11,7 @@ AC_CONFIG_SRCDIR([src/main.cpp])
|
||||
# TODO: Actually use the config header
|
||||
AC_CONFIG_HEADER([src/config.h])
|
||||
|
||||
AM_INIT_AUTOMAKE([-Wall foreign])
|
||||
AM_INIT_AUTOMAKE([foreign])
|
||||
|
||||
# Checks for programs.
|
||||
if test -n "${CXXFLAGS}"; then
|
||||
@@ -56,6 +56,10 @@ if test "${HAVE_WX}" != 1; then
|
||||
])
|
||||
fi
|
||||
|
||||
# Check for precompiled headers
|
||||
# TODO: Deal with braindead GCC and actually check
|
||||
AM_CONDITIONAL(GLIBCPP_BUILD_PCH, test "x$CXX" = "xg++")
|
||||
|
||||
# Checks for header files.
|
||||
|
||||
# Checks for typedefs, structures, and compiler characteristics.
|
||||
|
||||
@@ -79,6 +79,9 @@
|
||||
/* Define to the one symbol short name of this package. */
|
||||
#undef PACKAGE_TARNAME
|
||||
|
||||
/* Define to the home page for this package. */
|
||||
#undef PACKAGE_URL
|
||||
|
||||
/* Define to the version of this package. */
|
||||
#undef PACKAGE_VERSION
|
||||
|
||||
|
||||
+5
-1
@@ -29,11 +29,13 @@ DECLARE_TYPEOF_NO_REV(IndexMap<FieldP COMMA ValueP>);
|
||||
|
||||
Set::Set()
|
||||
: script_manager(new SetScriptManager(*this))
|
||||
, vcs (new_intrusive<VCS>())
|
||||
{}
|
||||
|
||||
Set::Set(const GameP& game)
|
||||
: game(game)
|
||||
, script_manager(new SetScriptManager(*this))
|
||||
, vcs (new_intrusive<VCS>())
|
||||
{
|
||||
data.init(game->set_fields);
|
||||
}
|
||||
@@ -42,6 +44,7 @@ Set::Set(const StyleSheetP& stylesheet)
|
||||
: game(stylesheet->game)
|
||||
, stylesheet(stylesheet)
|
||||
, script_manager(new SetScriptManager(*this))
|
||||
, vcs (new_intrusive<VCS>())
|
||||
{
|
||||
data.init(game->set_fields);
|
||||
}
|
||||
@@ -186,6 +189,7 @@ IMPLEMENT_REFLECTION(Set) {
|
||||
REFLECT(pack_types);
|
||||
}
|
||||
reflect_set_info_get_member(tag,data);
|
||||
REFLECT_NO_SCRIPT_N("version control", vcs);
|
||||
REFLECT(apprentice_code);
|
||||
}
|
||||
|
||||
@@ -206,7 +210,7 @@ void Set::reflect_cards<Writer> (Writer& tag) {
|
||||
int i = 0;
|
||||
|
||||
while (used.find(full_name) != used.end()) {
|
||||
full_name = filename << _(".") << ++i;
|
||||
full_name = String(filename) << _(".") << ++i;
|
||||
}
|
||||
used.insert(full_name);
|
||||
|
||||
|
||||
@@ -61,6 +61,7 @@ class Set : public Packaged {
|
||||
|
||||
ActionStack actions; ///< Actions performed on this set and the cards in it
|
||||
KeywordDatabase keyword_db; ///< Database for matching keywords, must be cleared when keywords change
|
||||
VCSP vcs; ///< The version control system to use
|
||||
|
||||
/// A context for performing scripts
|
||||
/** Should only be used from the main thread! */
|
||||
@@ -120,6 +121,11 @@ class Set : public Packaged {
|
||||
/// Validate that the set is correctly loaded
|
||||
virtual void validate(Version = app_version);
|
||||
|
||||
protected:
|
||||
virtual VCSP getVCS() {
|
||||
return vcs;
|
||||
}
|
||||
|
||||
private:
|
||||
DECLARE_REFLECTION();
|
||||
template <typename Tag>
|
||||
|
||||
@@ -193,7 +193,7 @@ class SetCombineImage : public SimpleFilterImage {
|
||||
/// Saturate/desaturate an image
|
||||
class SaturateImage : public SimpleFilterImage {
|
||||
public:
|
||||
inline SaturateImage(const GeneratedImageP& image, double alpha)
|
||||
inline SaturateImage(const GeneratedImageP& image, double amount)
|
||||
: SimpleFilterImage(image), amount(amount)
|
||||
{}
|
||||
virtual Image generate(const Options& opt) const;
|
||||
|
||||
+15
-9
@@ -51,7 +51,7 @@ ScriptValueP Context::eval(const Script& script, bool useScope) {
|
||||
// Evaluate the current instruction
|
||||
Instruction i = *instr++;
|
||||
// If a scope is created, destroy it at end of block.
|
||||
scoped_ptr<LocalScope> scope;
|
||||
scoped_ptr<LocalScope> new_scope;
|
||||
|
||||
switch (i.instr) {
|
||||
case I_NOP: break;
|
||||
@@ -126,7 +126,7 @@ ScriptValueP Context::eval(const Script& script, bool useScope) {
|
||||
}
|
||||
|
||||
// Function call
|
||||
case I_CALL: scope.reset(new LocalScope(*this)); //new scope
|
||||
case I_CALL: new_scope.reset(new LocalScope(*this)); //new scope
|
||||
case I_TAILCALL: {
|
||||
// prepare arguments
|
||||
for (unsigned int j = 0 ; j < i.data ; ++j) {
|
||||
@@ -144,7 +144,7 @@ ScriptValueP Context::eval(const Script& script, bool useScope) {
|
||||
Profiler prof(timer, function);
|
||||
#endif
|
||||
// get function and call
|
||||
stack.back() = stack.back()->eval(*this);
|
||||
stack.back() = stack.back()->eval(*this, false);
|
||||
// finish profiling
|
||||
#if USE_SCRIPT_PROFILING
|
||||
//profile_add(function, timer.time());
|
||||
@@ -366,7 +366,14 @@ class ScriptCompose : public ScriptValue {
|
||||
|
||||
virtual ScriptType type() const { return SCRIPT_FUNCTION; }
|
||||
virtual String typeName() const { return _("function composition"); }
|
||||
virtual ScriptValueP eval(Context& ctx) const {
|
||||
|
||||
virtual ScriptValueP dependencies(Context& ctx, const Dependency& dep) const {
|
||||
ctx.setVariable(SCRIPT_VAR_input, a->dependencies(ctx, dep));
|
||||
return b->dependencies(ctx, dep);
|
||||
}
|
||||
|
||||
protected:
|
||||
virtual ScriptValueP do_eval(Context& ctx, bool openScope) const {
|
||||
#if USE_SCRIPT_PROFILING
|
||||
Timer timer;
|
||||
{
|
||||
@@ -382,14 +389,13 @@ class ScriptCompose : public ScriptValue {
|
||||
return b->eval(ctx);
|
||||
}
|
||||
#else
|
||||
// Always open a scope for a; variables it makes need to be
|
||||
// cleared for b's call.
|
||||
ctx.setVariable(SCRIPT_VAR_input, a->eval(ctx));
|
||||
return b->eval(ctx);
|
||||
return b->eval(ctx, openScope);
|
||||
#endif
|
||||
}
|
||||
virtual ScriptValueP dependencies(Context& ctx, const Dependency& dep) const {
|
||||
ctx.setVariable(SCRIPT_VAR_input, a->dependencies(ctx, dep));
|
||||
return b->dependencies(ctx, dep);
|
||||
}
|
||||
|
||||
private:
|
||||
ScriptValueP a,b;
|
||||
};
|
||||
|
||||
@@ -173,8 +173,6 @@ ScriptValueP Context::dependencies(const Dependency& dep, const Script& script)
|
||||
|
||||
// Analyze the current instruction
|
||||
Instruction i = *instr++;
|
||||
// If a scope is created, destroy it at end of block.
|
||||
scoped_ptr<LocalScope> scope;
|
||||
switch (i.instr) {
|
||||
case I_NOP: break;
|
||||
// Push a constant (as normal)
|
||||
@@ -263,8 +261,10 @@ ScriptValueP Context::dependencies(const Dependency& dep, const Script& script)
|
||||
}
|
||||
|
||||
// Function call (as normal)
|
||||
case I_CALL: scope.reset(new LocalScope(*this)); //new scope
|
||||
case I_TAILCALL: {
|
||||
// Don't optimize tail calls; we may not jump as we normally do
|
||||
case I_CALL: case I_TAILCALL: {
|
||||
// open a new scope
|
||||
LocalScope new_scope(*this);
|
||||
// prepare arguments
|
||||
for (unsigned int j = 0 ; j < i.data ; ++j) {
|
||||
setVariable((Variable)instr[i.data - j - 1].data, stack.back());
|
||||
|
||||
@@ -59,10 +59,10 @@
|
||||
{ return SCRIPT_FUNCTION; } \
|
||||
virtual String typeName() const \
|
||||
{ return _("built-in function '") _(#name) _("'"); } \
|
||||
virtual ScriptValueP eval(Context&) const; \
|
||||
virtual ScriptValueP do_eval(Context&, bool) const; \
|
||||
}; \
|
||||
ScriptValueP script_##name(new ScriptBuiltIn_##name); \
|
||||
ScriptValueP ScriptBuiltIn_##name::eval(Context& ctx) const
|
||||
ScriptValueP ScriptBuiltIn_##name::do_eval(Context& ctx, bool) const
|
||||
|
||||
/// Return a value from a SCRIPT_FUNCTION
|
||||
#define SCRIPT_RETURN(value) return to_script(value)
|
||||
@@ -160,7 +160,8 @@ inline Type from_script(const ScriptValueP& v, Variable var) {
|
||||
inline ScriptRule_##funname(const type1& name1) : name1(name1) {} \
|
||||
virtual ScriptType type() const { return SCRIPT_FUNCTION; } \
|
||||
virtual String typeName() const { return _(#funname)_("_rule"); } \
|
||||
virtual ScriptValueP eval(Context& ctx) const; \
|
||||
protected: \
|
||||
virtual ScriptValueP do_eval(Context& ctx, bool) const; \
|
||||
private: \
|
||||
type1 name1; \
|
||||
}; \
|
||||
@@ -172,7 +173,7 @@ inline Type from_script(const ScriptValueP& v, Variable var) {
|
||||
SCRIPT_PARAM_N(type1, str1, name1); \
|
||||
return ScriptRule_##funname(name1).eval(ctx); \
|
||||
} \
|
||||
ScriptValueP ScriptRule_##funname::eval(Context& ctx) const
|
||||
ScriptValueP ScriptRule_##funname::do_eval(Context& ctx, bool) const
|
||||
|
||||
/// Utility for defining a script rule with two parameters
|
||||
#define SCRIPT_RULE_2(funname, type1, name1, type2, name2) \
|
||||
@@ -199,8 +200,9 @@ inline Type from_script(const ScriptValueP& v, Variable var) {
|
||||
: name1(name1), name2(name2) {} \
|
||||
virtual ScriptType type() const { return SCRIPT_FUNCTION; } \
|
||||
virtual String typeName() const { return _(#funname)_("_rule"); } \
|
||||
virtual ScriptValueP eval(Context& ctx) const; \
|
||||
dep \
|
||||
protected: \
|
||||
virtual ScriptValueP do_eval(Context& ctx, bool) const; \
|
||||
private: \
|
||||
type1 name1; \
|
||||
type2 name2; \
|
||||
@@ -216,7 +218,7 @@ inline Type from_script(const ScriptValueP& v, Variable var) {
|
||||
return ScriptRule_##funname(name1, name2).eval(ctx); \
|
||||
} \
|
||||
more \
|
||||
ScriptValueP ScriptRule_##funname::eval(Context& ctx) const
|
||||
ScriptValueP ScriptRule_##funname::do_eval(Context& ctx, bool) const
|
||||
|
||||
#define SCRIPT_RULE_2_DEPENDENCIES(name) \
|
||||
ScriptValueP ScriptRule_##name::dependencies(Context& ctx, const Dependency& dep) const
|
||||
|
||||
@@ -89,8 +89,8 @@ ScriptType Script::type() const {
|
||||
String Script::typeName() const {
|
||||
return _("function");
|
||||
}
|
||||
ScriptValueP Script::eval(Context& ctx) const {
|
||||
return ctx.eval(*this);
|
||||
ScriptValueP Script::do_eval(Context& ctx, bool openScope) const {
|
||||
return ctx.eval(*this, openScope);
|
||||
}
|
||||
ScriptValueP Script::dependencies(Context& ctx, const Dependency& dep) const {
|
||||
return ctx.dependencies(dep, *this);
|
||||
@@ -239,11 +239,12 @@ String Script::dumpInstr(unsigned int pos, Instruction i) const {
|
||||
const Instruction* Script::backtraceSkip(const Instruction* instr, int to_skip) const {
|
||||
unsigned int initial = instr - &instructions[0];
|
||||
for (;instr >= &instructions[0] &&
|
||||
(to_skip || // we have something to skip
|
||||
(to_skip || (// we have something to skip
|
||||
instr >= &instructions[1] && (
|
||||
(instr-1)->instr == I_JUMP // always look inside a jump
|
||||
|| (instr-1)->instr == I_NOP // and skip nops
|
||||
)
|
||||
)
|
||||
) ; --instr) {
|
||||
// skip an instruction
|
||||
switch (instr->instr) {
|
||||
@@ -317,7 +318,7 @@ const Instruction* Script::backtraceSkip(const Instruction* instr, int to_skip)
|
||||
}
|
||||
|
||||
String Script::instructionName(const Instruction* instr) const {
|
||||
if (instr < &instructions[0] || instr >= &instructions[instructions.size()]) return _("??\?");
|
||||
if (instr < &instructions[0] || instr >= &instructions[0] + instructions.size()) return _("??\?");
|
||||
if (instr->instr == I_GET_VAR) {
|
||||
return variable_to_string((Variable)instr->data);
|
||||
} else if (instr->instr == I_MEMBER_C) {
|
||||
|
||||
@@ -165,7 +165,6 @@ class Script : public ScriptValue {
|
||||
|
||||
virtual ScriptType type() const;
|
||||
virtual String typeName() const;
|
||||
virtual ScriptValueP eval(Context& ctx) const;
|
||||
virtual ScriptValueP dependencies(Context& ctx, const Dependency&) const;
|
||||
|
||||
/// Add a jump instruction, later comeFrom should be called on the returned value
|
||||
@@ -195,6 +194,9 @@ class Script : public ScriptValue {
|
||||
/// Output an instruction in a human readable format
|
||||
String dumpInstr(unsigned int pos, Instruction i) const;
|
||||
|
||||
protected:
|
||||
virtual ScriptValueP do_eval(Context& ctx, bool openScope) const;
|
||||
|
||||
private:
|
||||
/// Data of the instructions that make up this script
|
||||
vector<Instruction> instructions;
|
||||
|
||||
+11
-3
@@ -84,9 +84,12 @@ class ScriptDelayedError : public ScriptValue {
|
||||
// these can propagate the error
|
||||
virtual ScriptValueP getMember(const String& name) const;
|
||||
virtual ScriptValueP dependencyMember(const String& name, const Dependency&) const;
|
||||
virtual ScriptValueP eval(Context&) const;
|
||||
virtual ScriptValueP dependencies(Context&, const Dependency&) const;
|
||||
virtual ScriptValueP makeIterator(const ScriptValueP& thisP) const;
|
||||
|
||||
protected:
|
||||
virtual ScriptValueP do_eval(Context&, bool openScope) const;
|
||||
|
||||
private:
|
||||
ScriptError error; // the error message
|
||||
};
|
||||
@@ -349,7 +352,6 @@ class ScriptClosure : public ScriptValue {
|
||||
|
||||
virtual ScriptType type() const;
|
||||
virtual String typeName() const;
|
||||
virtual ScriptValueP eval(Context& ctx) const;
|
||||
virtual ScriptValueP dependencies(Context& ctx, const Dependency& dep) const;
|
||||
|
||||
/// Add a binding
|
||||
@@ -365,6 +367,9 @@ class ScriptClosure : public ScriptValue {
|
||||
/// The default argument bindings
|
||||
vector<pair<Variable,ScriptValueP> > bindings;
|
||||
|
||||
protected:
|
||||
virtual ScriptValueP do_eval(Context& ctx, bool openScope) const;
|
||||
|
||||
private:
|
||||
/// Apply the bindings in a context
|
||||
void applyBindings(Context& ctx) const;
|
||||
@@ -376,7 +381,10 @@ class ScriptRule : public ScriptValue {
|
||||
inline ScriptRule(const ScriptValueP& fun) : fun(fun) {}
|
||||
virtual ScriptType type() const;
|
||||
virtual String typeName() const;
|
||||
virtual ScriptValueP eval(Context& ctx) const;
|
||||
|
||||
protected:
|
||||
virtual ScriptValueP do_eval(Context& ctx, bool openScope) const;
|
||||
|
||||
private:
|
||||
ScriptValueP fun;
|
||||
};
|
||||
|
||||
@@ -25,7 +25,7 @@ ScriptValue::operator bool() const { throw Script
|
||||
ScriptValue::operator double() const { throw ScriptErrorConversion(typeName(), _TYPE_("double" )); }
|
||||
ScriptValue::operator AColor() const { throw ScriptErrorConversion(typeName(), _TYPE_("color" )); }
|
||||
ScriptValue::operator wxDateTime() const { throw ScriptErrorConversion(typeName(), _TYPE_("date" )); }
|
||||
ScriptValueP ScriptValue::eval(Context&) const { return delay_error(ScriptErrorConversion(typeName(), _TYPE_("function"))); }
|
||||
ScriptValueP ScriptValue::do_eval(Context&, bool) const { return delay_error(ScriptErrorConversion(typeName(), _TYPE_("function"))); }
|
||||
ScriptValueP ScriptValue::next(ScriptValueP* key_out) { throw InternalError(_("Can't convert from ")+typeName()+_(" to iterator")); }
|
||||
ScriptValueP ScriptValue::makeIterator(const ScriptValueP&) const { return delay_error(ScriptErrorConversion(typeName(), _TYPE_("collection"))); }
|
||||
int ScriptValue::itemCount() const { throw ScriptErrorConversion(typeName(), _TYPE_("collection")); }
|
||||
@@ -113,7 +113,7 @@ int ScriptDelayedError::itemCount() const { throw error; }
|
||||
CompareWhat ScriptDelayedError::compareAs(String&, void const*&) const { throw error; }
|
||||
ScriptValueP ScriptDelayedError::getMember(const String&) const { return new_intrusive1<ScriptDelayedError>(error); }
|
||||
ScriptValueP ScriptDelayedError::dependencyMember(const String&, const Dependency&) const { return new_intrusive1<ScriptDelayedError>(error); }
|
||||
ScriptValueP ScriptDelayedError::eval(Context&) const { return new_intrusive1<ScriptDelayedError>(error); }
|
||||
ScriptValueP ScriptDelayedError::do_eval(Context&, bool) const { return new_intrusive1<ScriptDelayedError>(error); }
|
||||
ScriptValueP ScriptDelayedError::dependencies(Context&, const Dependency&) const { return new_intrusive1<ScriptDelayedError>(error); }
|
||||
ScriptValueP ScriptDelayedError::makeIterator(const ScriptValueP& thisP) const { return thisP; }
|
||||
|
||||
@@ -370,7 +370,9 @@ class ScriptNil : public ScriptValue {
|
||||
virtual GeneratedImageP toImage(const ScriptValueP&) const {
|
||||
return new_intrusive<BlankImage>();
|
||||
}
|
||||
virtual ScriptValueP eval(Context& ctx) const {
|
||||
|
||||
protected:
|
||||
virtual ScriptValueP do_eval(Context& ctx, bool) const {
|
||||
// nil(input) == input
|
||||
return ctx.getVariable(SCRIPT_VAR_input);
|
||||
}
|
||||
@@ -513,10 +515,10 @@ ScriptValueP ScriptClosure::simplify() {
|
||||
return fun->simplifyClosure(*this);
|
||||
}
|
||||
|
||||
ScriptValueP ScriptClosure::eval(Context& ctx) const {
|
||||
LocalScope scope(ctx);
|
||||
ScriptValueP ScriptClosure::do_eval(Context& ctx, bool openScope) const {
|
||||
scoped_ptr<LocalScope> scope(openScope ? new LocalScope(ctx) : nullptr);
|
||||
applyBindings(ctx);
|
||||
return fun->eval(ctx);
|
||||
return fun->eval(ctx, openScope);
|
||||
}
|
||||
ScriptValueP ScriptClosure::dependencies(Context& ctx, const Dependency& dep) const {
|
||||
LocalScope scope(ctx);
|
||||
@@ -534,6 +536,6 @@ void ScriptClosure::applyBindings(Context& ctx) const {
|
||||
|
||||
ScriptType ScriptRule::type() const { return SCRIPT_FUNCTION; }
|
||||
String ScriptRule::typeName() const { return fun->typeName() + _(" rule"); }
|
||||
ScriptValueP ScriptRule::eval(Context& ctx) const {
|
||||
ScriptValueP ScriptRule::do_eval(Context& ctx, bool openScope) const {
|
||||
return ctx.makeClosure(fun);
|
||||
}
|
||||
|
||||
@@ -97,7 +97,9 @@ class ScriptValue : public IntrusivePtrBaseWithDelete {
|
||||
virtual ScriptValueP dependencyName(const ScriptValue& container, const Dependency&) const;
|
||||
|
||||
/// Evaluate this value (if it is a function)
|
||||
virtual ScriptValueP eval(Context&) const;
|
||||
ScriptValueP eval(Context& ctx, bool openScope = true) const {
|
||||
return do_eval(ctx, openScope);
|
||||
}
|
||||
/// Mark the scripts that this function depends on
|
||||
/** Return value is an abstract version of the return value of eval */
|
||||
virtual ScriptValueP dependencies(Context&, const Dependency&) const;
|
||||
@@ -117,6 +119,9 @@ class ScriptValue : public IntrusivePtrBaseWithDelete {
|
||||
virtual int itemCount() const;
|
||||
/// Get a member at the given index
|
||||
virtual ScriptValueP getIndex(int index) const;
|
||||
|
||||
protected:
|
||||
virtual ScriptValueP do_eval(Context& ctx, bool openScope) const;
|
||||
};
|
||||
|
||||
extern ScriptValueP script_nil; ///< The preallocated nil value
|
||||
|
||||
@@ -513,7 +513,6 @@ IMPLEMENT_REFLECTION(Packaged) {
|
||||
Packaged::Packaged()
|
||||
: position_hint(100000)
|
||||
, fully_loaded(true)
|
||||
, vcs(nullptr)
|
||||
{}
|
||||
|
||||
InputStreamP Packaged::openIconFile() {
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
#include <util/dynamic_arg.hpp>
|
||||
#include <util/error.hpp>
|
||||
#include <util/file_utils.hpp>
|
||||
#include <util/io/vcs.hpp>
|
||||
#include <util/vcs.hpp>
|
||||
|
||||
class Package;
|
||||
class wxFileInputStream;
|
||||
@@ -143,7 +143,7 @@ class Package : public IntrusivePtrVirtualBase {
|
||||
}
|
||||
|
||||
protected:
|
||||
// TODO: I dislike this very much. There ought to be a better way.
|
||||
// TODO: I dislike putting this here very much. There ought to be a better way.
|
||||
virtual VCSP getVCS() { return new_intrusive<VCS>(); }
|
||||
|
||||
// --------------------------------------------------- : Private stuff
|
||||
@@ -219,7 +219,6 @@ class Packaged : public Package {
|
||||
String icon_filename; ///< Filename of icon to use in package lists
|
||||
vector<PackageDependencyP> dependencies; ///< Dependencies of this package
|
||||
int position_hint; ///< A hint for the package list
|
||||
VCSP vcs; ///< The version control system to use
|
||||
|
||||
/// Get an input stream for the package icon, if there is any
|
||||
InputStreamP openIconFile();
|
||||
@@ -243,10 +242,6 @@ class Packaged : public Package {
|
||||
}
|
||||
|
||||
protected:
|
||||
virtual VCSP getVCS() {
|
||||
return vcs;
|
||||
}
|
||||
|
||||
/// filename of the data file, and extension of the package file
|
||||
virtual String typeName() const = 0;
|
||||
/// Can be overloaded to do validation after loading
|
||||
|
||||
+1
-1
@@ -20,7 +20,7 @@ void Regex::assign(const String& code) {
|
||||
} catch (const boost::regex_error& e) {
|
||||
/// TODO: be more precise
|
||||
throw ScriptError(String::Format(_("Error while compiling regular expression: '%s'\nAt position: %d\n%s"),
|
||||
code.c_str(), e.position(), String(e.what(), IF_UNICODE(wxConvUTF8,String::npos))));
|
||||
code.c_str(), e.position(), String(e.what(), IF_UNICODE(wxConvUTF8,String::npos)).c_str()));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -12,11 +12,13 @@ case $UID in
|
||||
0)
|
||||
INSTALL_DIR='/usr/local/share/magicseteditor/';
|
||||
EXEC_SYMLINK='/usr/local/bin/magicseteditor';
|
||||
FONTS_DIR='/usr/local/share/fonts/';;
|
||||
FONTS_DIR='/usr/local/share/fonts/';
|
||||
CHMOD='chmod +x';;
|
||||
*)
|
||||
INSTALL_DIR='$HOME/.magicseteditor/';
|
||||
EXEC_SYMLINK='$HOME/bin/magicseteditor';
|
||||
FONTS_DIR='$HOME/.fonts/';;
|
||||
FONTS_DIR='$HOME/.fonts/';
|
||||
CHMOD='chmod u+x';;
|
||||
esac
|
||||
|
||||
if [ "$MSE_INSTALL_DIR" != "" ]; then
|
||||
@@ -49,5 +51,6 @@ echo "Installing...";
|
||||
|
||||
mkdir "$INSTALL_DIR";
|
||||
cp -r program/* "$INSTALL_DIR";
|
||||
$CHMOD "$INSTALL_DIR/magicseteditor";
|
||||
cp fonts/* "$FONTS_DIR";
|
||||
ln -s "$INSTALL_DIR/magicseteditor" "$EXEC_SYMLINK"
|
||||
|
||||
Reference in New Issue
Block a user