From 851799d1b6771662f30c0a6f47042ff579f0e18a Mon Sep 17 00:00:00 2001 From: coppro Date: Fri, 23 Mar 2007 00:57:06 +0000 Subject: [PATCH] Fixed some bugs to make GCC work. I needed to change SimpleValueAction to take the function as a variable as opposed to a template parameter - GCC won't accept pointers from a base class in templates. git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@231 0fc631ac-6414-0410-93d0-97cfa31319b6 --- Makefile | 135 ++++++++++++++++++++------ Makefile.am | 13 ++- src/config.h.in | 2 +- src/data/action/value.cpp | 16 +-- src/data/font.cpp | 2 +- src/data/format/image.cpp | 2 +- src/data/game.cpp | 4 +- src/data/symbol_font.cpp | 10 +- src/gui/about_window.cpp | 2 +- src/gui/control/gallery_list.hpp | 2 +- src/gui/symbol/basic_shape_editor.cpp | 2 +- src/gui/symbol/control.cpp | 4 +- src/gui/util.cpp | 4 +- src/render/symbol/viewer.cpp | 2 +- src/render/text/element.cpp | 2 +- src/render/value/choice.cpp | 2 +- src/render/value/image.cpp | 2 +- src/render/value/symbol.cpp | 2 +- src/script/functions/basic.cpp | 6 +- src/script/functions/editor.cpp | 2 +- src/script/functions/english.cpp | 3 +- src/script/to_value.hpp | 2 +- src/script/value.cpp | 6 +- src/util/for_each.hpp | 102 +++++++++---------- src/util/io/package.cpp | 6 +- src/util/locale.hpp | 3 + src/util/rotation.cpp | 6 +- 27 files changed, 215 insertions(+), 129 deletions(-) diff --git a/Makefile b/Makefile index a8487199..d47bc934 100644 --- a/Makefile +++ b/Makefile @@ -74,6 +74,7 @@ am_magicseteditor_OBJECTS = ./src/render/text/viewer.$(OBJEXT) \ ./src/render/value/symbol.$(OBJEXT) \ ./src/render/value/multiple_choice.$(OBJEXT) \ ./src/render/value/choice.$(OBJEXT) \ + ./src/render/value/information.$(OBJEXT) \ ./src/gfx/rotate_image.$(OBJEXT) ./src/gfx/color.$(OBJEXT) \ ./src/gfx/bezier.$(OBJEXT) ./src/gfx/combine_image.$(OBJEXT) \ ./src/gfx/image_effects.$(OBJEXT) \ @@ -93,6 +94,8 @@ am_magicseteditor_OBJECTS = ./src/render/text/viewer.$(OBJEXT) \ ./src/gui/control/package_list.$(OBJEXT) \ ./src/gui/control/gallery_list.$(OBJEXT) \ ./src/gui/control/card_viewer.$(OBJEXT) \ + ./src/gui/control/item_list.$(OBJEXT) \ + ./src/gui/control/keyword_list.$(OBJEXT) \ ./src/gui/set/style_panel.$(OBJEXT) \ ./src/gui/set/panel.$(OBJEXT) \ ./src/gui/set/set_info_panel.$(OBJEXT) \ @@ -112,7 +115,8 @@ am_magicseteditor_OBJECTS = ./src/render/text/viewer.$(OBJEXT) \ ./src/gui/value/symbol.$(OBJEXT) \ ./src/gui/value/multiple_choice.$(OBJEXT) \ ./src/gui/value/editor.$(OBJEXT) \ - ./src/gui/value/choice.$(OBJEXT) ./src/gui/util.$(OBJEXT) \ + ./src/gui/value/choice.$(OBJEXT) \ + ./src/gui/value/information.$(OBJEXT) ./src/gui/util.$(OBJEXT) \ ./src/gui/card_select_window.$(OBJEXT) \ ./src/gui/about_window.$(OBJEXT) \ ./src/gui/update_checker.$(OBJEXT) \ @@ -124,7 +128,12 @@ am_magicseteditor_OBJECTS = ./src/render/text/viewer.$(OBJEXT) \ ./src/gui/drop_down_list.$(OBJEXT) \ ./src/gui/image_slice_window.$(OBJEXT) \ ./src/script/script_manager.$(OBJEXT) \ - ./src/script/script.$(OBJEXT) ./src/script/functions.$(OBJEXT) \ + ./src/script/script.$(OBJEXT) \ + ./src/script/functions/basic.$(OBJEXT) \ + ./src/script/functions/export.$(OBJEXT) \ + ./src/script/functions/image.$(OBJEXT) \ + ./src/script/functions/editor.$(OBJEXT) \ + ./src/script/functions/english.$(OBJEXT) \ ./src/script/value.$(OBJEXT) ./src/script/dependency.$(OBJEXT) \ ./src/script/image.$(OBJEXT) ./src/script/context.$(OBJEXT) \ ./src/script/scriptable.$(OBJEXT) \ @@ -135,6 +144,7 @@ am_magicseteditor_OBJECTS = ./src/render/text/viewer.$(OBJEXT) \ ./src/data/field/symbol.$(OBJEXT) \ ./src/data/field/multiple_choice.$(OBJEXT) \ ./src/data/field/choice.$(OBJEXT) \ + ./src/data/field/information.$(OBJEXT) \ ./src/data/format/clipboard.$(OBJEXT) \ ./src/data/format/image.$(OBJEXT) \ ./src/data/format/html.$(OBJEXT) \ @@ -155,6 +165,7 @@ am_magicseteditor_OBJECTS = ./src/render/text/viewer.$(OBJEXT) \ ./src/data/keyword.$(OBJEXT) ./src/data/stylesheet.$(OBJEXT) \ ./src/data/statistics.$(OBJEXT) ./src/data/set.$(OBJEXT) \ ./src/data/symbol_font.$(OBJEXT) \ + ./src/data/export_template.$(OBJEXT) \ ./src/util/io/get_member.$(OBJEXT) \ ./src/util/io/reader.$(OBJEXT) \ ./src/util/io/package_manager.$(OBJEXT) \ @@ -298,7 +309,8 @@ magicseteditor_SOURCES = ./src/render/text/viewer.cpp \ ./src/render/value/viewer.cpp ./src/render/value/image.cpp \ ./src/render/value/text.cpp ./src/render/value/symbol.cpp \ ./src/render/value/multiple_choice.cpp \ - ./src/render/value/choice.cpp ./src/gfx/rotate_image.cpp \ + ./src/render/value/choice.cpp \ + ./src/render/value/information.cpp ./src/gfx/rotate_image.cpp \ ./src/gfx/color.cpp ./src/gfx/bezier.cpp \ ./src/gfx/combine_image.cpp ./src/gfx/image_effects.cpp \ ./src/gfx/polynomial.cpp ./src/gfx/blend_image.cpp \ @@ -316,6 +328,8 @@ magicseteditor_SOURCES = ./src/render/text/viewer.cpp \ ./src/gui/control/package_list.cpp \ ./src/gui/control/gallery_list.cpp \ ./src/gui/control/card_viewer.cpp \ + ./src/gui/control/item_list.cpp \ + ./src/gui/control/keyword_list.cpp \ ./src/gui/set/style_panel.cpp ./src/gui/set/panel.cpp \ ./src/gui/set/set_info_panel.cpp \ ./src/gui/set/keywords_panel.cpp ./src/gui/set/window.cpp \ @@ -328,25 +342,31 @@ magicseteditor_SOURCES = ./src/render/text/viewer.cpp \ ./src/gui/value/image.cpp ./src/gui/value/text.cpp \ ./src/gui/value/symbol.cpp ./src/gui/value/multiple_choice.cpp \ ./src/gui/value/editor.cpp ./src/gui/value/choice.cpp \ - ./src/gui/util.cpp ./src/gui/card_select_window.cpp \ - ./src/gui/about_window.cpp ./src/gui/update_checker.cpp \ - ./src/gui/thumbnail_thread.cpp ./src/gui/icon_menu.cpp \ - ./src/gui/new_window.cpp ./src/gui/preferences_window.cpp \ - ./src/gui/welcome_window.cpp ./src/gui/print_window.cpp \ - ./src/gui/drop_down_list.cpp ./src/gui/image_slice_window.cpp \ + ./src/gui/value/information.cpp ./src/gui/util.cpp \ + ./src/gui/card_select_window.cpp ./src/gui/about_window.cpp \ + ./src/gui/update_checker.cpp ./src/gui/thumbnail_thread.cpp \ + ./src/gui/icon_menu.cpp ./src/gui/new_window.cpp \ + ./src/gui/preferences_window.cpp ./src/gui/welcome_window.cpp \ + ./src/gui/print_window.cpp ./src/gui/drop_down_list.cpp \ + ./src/gui/image_slice_window.cpp \ ./src/script/script_manager.cpp ./src/script/script.cpp \ - ./src/script/functions.cpp ./src/script/value.cpp \ + ./src/script/functions/basic.cpp \ + ./src/script/functions/export.cpp \ + ./src/script/functions/image.cpp \ + ./src/script/functions/editor.cpp \ + ./src/script/functions/english.cpp ./src/script/value.cpp \ ./src/script/dependency.cpp ./src/script/image.cpp \ ./src/script/context.cpp ./src/script/scriptable.cpp \ ./src/script/parser.cpp ./src/data/field/color.cpp \ ./src/data/field/boolean.cpp ./src/data/field/image.cpp \ ./src/data/field/text.cpp ./src/data/field/symbol.cpp \ ./src/data/field/multiple_choice.cpp \ - ./src/data/field/choice.cpp ./src/data/format/clipboard.cpp \ - ./src/data/format/image.cpp ./src/data/format/html.cpp \ - ./src/data/format/mse1.cpp ./src/data/format/mse2.cpp \ - ./src/data/format/mws.cpp ./src/data/format/apprentice.cpp \ - ./src/data/format/formats.cpp ./src/data/format/mtg_editor.cpp \ + ./src/data/field/choice.cpp ./src/data/field/information.cpp \ + ./src/data/format/clipboard.cpp ./src/data/format/image.cpp \ + ./src/data/format/html.cpp ./src/data/format/mse1.cpp \ + ./src/data/format/mse2.cpp ./src/data/format/mws.cpp \ + ./src/data/format/apprentice.cpp ./src/data/format/formats.cpp \ + ./src/data/format/mtg_editor.cpp \ ./src/data/format/image_to_symbol.cpp \ ./src/data/action/symbol.cpp ./src/data/action/set.cpp \ ./src/data/action/symbol_part.cpp ./src/data/action/value.cpp \ @@ -355,14 +375,14 @@ magicseteditor_SOURCES = ./src/render/text/viewer.cpp \ ./src/data/card.cpp ./src/data/field.cpp \ ./src/data/keyword.cpp ./src/data/stylesheet.cpp \ ./src/data/statistics.cpp ./src/data/set.cpp \ - ./src/data/symbol_font.cpp ./src/util/io/get_member.cpp \ - ./src/util/io/reader.cpp ./src/util/io/package_manager.cpp \ - ./src/util/io/package.cpp ./src/util/io/writer.cpp \ - ./src/util/rotation.cpp ./src/util/tagged_string.cpp \ - ./src/util/action_stack.cpp ./src/util/string.cpp \ - ./src/util/alignment.cpp ./src/util/version.cpp \ - ./src/util/error.cpp ./src/util/age.cpp ./src/main.cpp \ - ./src/code_template.cpp + ./src/data/symbol_font.cpp ./src/data/export_template.cpp \ + ./src/util/io/get_member.cpp ./src/util/io/reader.cpp \ + ./src/util/io/package_manager.cpp ./src/util/io/package.cpp \ + ./src/util/io/writer.cpp ./src/util/rotation.cpp \ + ./src/util/tagged_string.cpp ./src/util/action_stack.cpp \ + ./src/util/string.cpp ./src/util/alignment.cpp \ + ./src/util/version.cpp ./src/util/error.cpp ./src/util/age.cpp \ + ./src/main.cpp ./src/code_template.cpp all: all-am .SUFFIXES: @@ -497,6 +517,9 @@ src/render/value/$(DEPDIR)/$(am__dirstamp): src/render/value/$(DEPDIR)/$(am__dirstamp) ./src/render/value/choice.$(OBJEXT): src/render/value/$(am__dirstamp) \ src/render/value/$(DEPDIR)/$(am__dirstamp) +./src/render/value/information.$(OBJEXT): \ + src/render/value/$(am__dirstamp) \ + src/render/value/$(DEPDIR)/$(am__dirstamp) src/gfx/$(am__dirstamp): @$(mkdir_p) ./src/gfx @: > src/gfx/$(am__dirstamp) @@ -564,6 +587,12 @@ src/gui/control/$(DEPDIR)/$(am__dirstamp): ./src/gui/control/card_viewer.$(OBJEXT): \ src/gui/control/$(am__dirstamp) \ src/gui/control/$(DEPDIR)/$(am__dirstamp) +./src/gui/control/item_list.$(OBJEXT): \ + src/gui/control/$(am__dirstamp) \ + src/gui/control/$(DEPDIR)/$(am__dirstamp) +./src/gui/control/keyword_list.$(OBJEXT): \ + src/gui/control/$(am__dirstamp) \ + src/gui/control/$(DEPDIR)/$(am__dirstamp) src/gui/set/$(am__dirstamp): @$(mkdir_p) ./src/gui/set @: > src/gui/set/$(am__dirstamp) @@ -628,6 +657,8 @@ src/gui/value/$(DEPDIR)/$(am__dirstamp): src/gui/value/$(DEPDIR)/$(am__dirstamp) ./src/gui/value/choice.$(OBJEXT): src/gui/value/$(am__dirstamp) \ src/gui/value/$(DEPDIR)/$(am__dirstamp) +./src/gui/value/information.$(OBJEXT): src/gui/value/$(am__dirstamp) \ + src/gui/value/$(DEPDIR)/$(am__dirstamp) src/gui/$(am__dirstamp): @$(mkdir_p) ./src/gui @: > src/gui/$(am__dirstamp) @@ -668,8 +699,27 @@ src/script/$(DEPDIR)/$(am__dirstamp): src/script/$(DEPDIR)/$(am__dirstamp) ./src/script/script.$(OBJEXT): src/script/$(am__dirstamp) \ src/script/$(DEPDIR)/$(am__dirstamp) -./src/script/functions.$(OBJEXT): src/script/$(am__dirstamp) \ - src/script/$(DEPDIR)/$(am__dirstamp) +src/script/functions/$(am__dirstamp): + @$(mkdir_p) ./src/script/functions + @: > src/script/functions/$(am__dirstamp) +src/script/functions/$(DEPDIR)/$(am__dirstamp): + @$(mkdir_p) ./src/script/functions/$(DEPDIR) + @: > src/script/functions/$(DEPDIR)/$(am__dirstamp) +./src/script/functions/basic.$(OBJEXT): \ + src/script/functions/$(am__dirstamp) \ + src/script/functions/$(DEPDIR)/$(am__dirstamp) +./src/script/functions/export.$(OBJEXT): \ + src/script/functions/$(am__dirstamp) \ + src/script/functions/$(DEPDIR)/$(am__dirstamp) +./src/script/functions/image.$(OBJEXT): \ + src/script/functions/$(am__dirstamp) \ + src/script/functions/$(DEPDIR)/$(am__dirstamp) +./src/script/functions/editor.$(OBJEXT): \ + src/script/functions/$(am__dirstamp) \ + src/script/functions/$(DEPDIR)/$(am__dirstamp) +./src/script/functions/english.$(OBJEXT): \ + src/script/functions/$(am__dirstamp) \ + src/script/functions/$(DEPDIR)/$(am__dirstamp) ./src/script/value.$(OBJEXT): src/script/$(am__dirstamp) \ src/script/$(DEPDIR)/$(am__dirstamp) ./src/script/dependency.$(OBJEXT): src/script/$(am__dirstamp) \ @@ -703,6 +753,9 @@ src/data/field/$(DEPDIR)/$(am__dirstamp): src/data/field/$(DEPDIR)/$(am__dirstamp) ./src/data/field/choice.$(OBJEXT): src/data/field/$(am__dirstamp) \ src/data/field/$(DEPDIR)/$(am__dirstamp) +./src/data/field/information.$(OBJEXT): \ + src/data/field/$(am__dirstamp) \ + src/data/field/$(DEPDIR)/$(am__dirstamp) src/data/format/$(am__dirstamp): @$(mkdir_p) ./src/data/format @: > src/data/format/$(am__dirstamp) @@ -778,6 +831,8 @@ src/data/$(DEPDIR)/$(am__dirstamp): src/data/$(DEPDIR)/$(am__dirstamp) ./src/data/symbol_font.$(OBJEXT): src/data/$(am__dirstamp) \ src/data/$(DEPDIR)/$(am__dirstamp) +./src/data/export_template.$(OBJEXT): src/data/$(am__dirstamp) \ + src/data/$(DEPDIR)/$(am__dirstamp) src/util/io/$(am__dirstamp): @$(mkdir_p) ./src/util/io @: > src/util/io/$(am__dirstamp) @@ -838,11 +893,13 @@ mostlyclean-compile: -rm -f ./src/data/action/symbol_part.$(OBJEXT) -rm -f ./src/data/action/value.$(OBJEXT) -rm -f ./src/data/card.$(OBJEXT) + -rm -f ./src/data/export_template.$(OBJEXT) -rm -f ./src/data/field.$(OBJEXT) -rm -f ./src/data/field/boolean.$(OBJEXT) -rm -f ./src/data/field/choice.$(OBJEXT) -rm -f ./src/data/field/color.$(OBJEXT) -rm -f ./src/data/field/image.$(OBJEXT) + -rm -f ./src/data/field/information.$(OBJEXT) -rm -f ./src/data/field/multiple_choice.$(OBJEXT) -rm -f ./src/data/field/symbol.$(OBJEXT) -rm -f ./src/data/field/text.$(OBJEXT) @@ -886,6 +943,8 @@ mostlyclean-compile: -rm -f ./src/gui/control/gallery_list.$(OBJEXT) -rm -f ./src/gui/control/graph.$(OBJEXT) -rm -f ./src/gui/control/image_card_list.$(OBJEXT) + -rm -f ./src/gui/control/item_list.$(OBJEXT) + -rm -f ./src/gui/control/keyword_list.$(OBJEXT) -rm -f ./src/gui/control/native_look_editor.$(OBJEXT) -rm -f ./src/gui/control/package_list.$(OBJEXT) -rm -f ./src/gui/control/select_card_list.$(OBJEXT) @@ -917,6 +976,7 @@ mostlyclean-compile: -rm -f ./src/gui/value/color.$(OBJEXT) -rm -f ./src/gui/value/editor.$(OBJEXT) -rm -f ./src/gui/value/image.$(OBJEXT) + -rm -f ./src/gui/value/information.$(OBJEXT) -rm -f ./src/gui/value/multiple_choice.$(OBJEXT) -rm -f ./src/gui/value/symbol.$(OBJEXT) -rm -f ./src/gui/value/text.$(OBJEXT) @@ -933,13 +993,18 @@ mostlyclean-compile: -rm -f ./src/render/value/choice.$(OBJEXT) -rm -f ./src/render/value/color.$(OBJEXT) -rm -f ./src/render/value/image.$(OBJEXT) + -rm -f ./src/render/value/information.$(OBJEXT) -rm -f ./src/render/value/multiple_choice.$(OBJEXT) -rm -f ./src/render/value/symbol.$(OBJEXT) -rm -f ./src/render/value/text.$(OBJEXT) -rm -f ./src/render/value/viewer.$(OBJEXT) -rm -f ./src/script/context.$(OBJEXT) -rm -f ./src/script/dependency.$(OBJEXT) - -rm -f ./src/script/functions.$(OBJEXT) + -rm -f ./src/script/functions/basic.$(OBJEXT) + -rm -f ./src/script/functions/editor.$(OBJEXT) + -rm -f ./src/script/functions/english.$(OBJEXT) + -rm -f ./src/script/functions/export.$(OBJEXT) + -rm -f ./src/script/functions/image.$(OBJEXT) -rm -f ./src/script/image.$(OBJEXT) -rm -f ./src/script/parser.$(OBJEXT) -rm -f ./src/script/script.$(OBJEXT) @@ -966,6 +1031,7 @@ distclean-compile: include ./src/$(DEPDIR)/code_template.Po include ./src/$(DEPDIR)/main.Po include ./src/data/$(DEPDIR)/card.Po +include ./src/data/$(DEPDIR)/export_template.Po include ./src/data/$(DEPDIR)/field.Po include ./src/data/$(DEPDIR)/font.Po include ./src/data/$(DEPDIR)/game.Po @@ -985,6 +1051,7 @@ include ./src/data/field/$(DEPDIR)/boolean.Po include ./src/data/field/$(DEPDIR)/choice.Po include ./src/data/field/$(DEPDIR)/color.Po include ./src/data/field/$(DEPDIR)/image.Po +include ./src/data/field/$(DEPDIR)/information.Po include ./src/data/field/$(DEPDIR)/multiple_choice.Po include ./src/data/field/$(DEPDIR)/symbol.Po include ./src/data/field/$(DEPDIR)/text.Po @@ -1028,6 +1095,8 @@ include ./src/gui/control/$(DEPDIR)/filtered_card_list.Po include ./src/gui/control/$(DEPDIR)/gallery_list.Po include ./src/gui/control/$(DEPDIR)/graph.Po include ./src/gui/control/$(DEPDIR)/image_card_list.Po +include ./src/gui/control/$(DEPDIR)/item_list.Po +include ./src/gui/control/$(DEPDIR)/keyword_list.Po include ./src/gui/control/$(DEPDIR)/native_look_editor.Po include ./src/gui/control/$(DEPDIR)/package_list.Po include ./src/gui/control/$(DEPDIR)/select_card_list.Po @@ -1050,6 +1119,7 @@ include ./src/gui/value/$(DEPDIR)/choice.Po include ./src/gui/value/$(DEPDIR)/color.Po include ./src/gui/value/$(DEPDIR)/editor.Po include ./src/gui/value/$(DEPDIR)/image.Po +include ./src/gui/value/$(DEPDIR)/information.Po include ./src/gui/value/$(DEPDIR)/multiple_choice.Po include ./src/gui/value/$(DEPDIR)/symbol.Po include ./src/gui/value/$(DEPDIR)/text.Po @@ -1064,19 +1134,24 @@ include ./src/render/text/$(DEPDIR)/viewer.Po include ./src/render/value/$(DEPDIR)/choice.Po include ./src/render/value/$(DEPDIR)/color.Po include ./src/render/value/$(DEPDIR)/image.Po +include ./src/render/value/$(DEPDIR)/information.Po include ./src/render/value/$(DEPDIR)/multiple_choice.Po include ./src/render/value/$(DEPDIR)/symbol.Po include ./src/render/value/$(DEPDIR)/text.Po include ./src/render/value/$(DEPDIR)/viewer.Po include ./src/script/$(DEPDIR)/context.Po include ./src/script/$(DEPDIR)/dependency.Po -include ./src/script/$(DEPDIR)/functions.Po include ./src/script/$(DEPDIR)/image.Po include ./src/script/$(DEPDIR)/parser.Po include ./src/script/$(DEPDIR)/script.Po include ./src/script/$(DEPDIR)/script_manager.Po include ./src/script/$(DEPDIR)/scriptable.Po include ./src/script/$(DEPDIR)/value.Po +include ./src/script/functions/$(DEPDIR)/basic.Po +include ./src/script/functions/$(DEPDIR)/editor.Po +include ./src/script/functions/$(DEPDIR)/english.Po +include ./src/script/functions/$(DEPDIR)/export.Po +include ./src/script/functions/$(DEPDIR)/image.Po include ./src/util/$(DEPDIR)/action_stack.Po include ./src/util/$(DEPDIR)/age.Po include ./src/util/$(DEPDIR)/alignment.Po @@ -1342,6 +1417,8 @@ distclean-generic: -rm -f src/render/value/$(am__dirstamp) -rm -f src/script/$(DEPDIR)/$(am__dirstamp) -rm -f src/script/$(am__dirstamp) + -rm -f src/script/functions/$(DEPDIR)/$(am__dirstamp) + -rm -f src/script/functions/$(am__dirstamp) -rm -f src/util/$(DEPDIR)/$(am__dirstamp) -rm -f src/util/$(am__dirstamp) -rm -f src/util/io/$(DEPDIR)/$(am__dirstamp) @@ -1356,7 +1433,7 @@ clean-am: clean-binPROGRAMS clean-generic mostlyclean-am distclean: distclean-am -rm -f $(am__CONFIG_DISTCLEAN_FILES) - -rm -rf ./src/$(DEPDIR) ./src/data/$(DEPDIR) ./src/data/action/$(DEPDIR) ./src/data/field/$(DEPDIR) ./src/data/format/$(DEPDIR) ./src/gfx/$(DEPDIR) ./src/gui/$(DEPDIR) ./src/gui/control/$(DEPDIR) ./src/gui/set/$(DEPDIR) ./src/gui/symbol/$(DEPDIR) ./src/gui/value/$(DEPDIR) ./src/render/card/$(DEPDIR) ./src/render/symbol/$(DEPDIR) ./src/render/text/$(DEPDIR) ./src/render/value/$(DEPDIR) ./src/script/$(DEPDIR) ./src/util/$(DEPDIR) ./src/util/io/$(DEPDIR) + -rm -rf ./src/$(DEPDIR) ./src/data/$(DEPDIR) ./src/data/action/$(DEPDIR) ./src/data/field/$(DEPDIR) ./src/data/format/$(DEPDIR) ./src/gfx/$(DEPDIR) ./src/gui/$(DEPDIR) ./src/gui/control/$(DEPDIR) ./src/gui/set/$(DEPDIR) ./src/gui/symbol/$(DEPDIR) ./src/gui/value/$(DEPDIR) ./src/render/card/$(DEPDIR) ./src/render/symbol/$(DEPDIR) ./src/render/text/$(DEPDIR) ./src/render/value/$(DEPDIR) ./src/script/$(DEPDIR) ./src/script/functions/$(DEPDIR) ./src/util/$(DEPDIR) ./src/util/io/$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-hdr distclean-tags @@ -1384,7 +1461,7 @@ installcheck-am: maintainer-clean: maintainer-clean-am -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -rf $(top_srcdir)/autom4te.cache - -rm -rf ./src/$(DEPDIR) ./src/data/$(DEPDIR) ./src/data/action/$(DEPDIR) ./src/data/field/$(DEPDIR) ./src/data/format/$(DEPDIR) ./src/gfx/$(DEPDIR) ./src/gui/$(DEPDIR) ./src/gui/control/$(DEPDIR) ./src/gui/set/$(DEPDIR) ./src/gui/symbol/$(DEPDIR) ./src/gui/value/$(DEPDIR) ./src/render/card/$(DEPDIR) ./src/render/symbol/$(DEPDIR) ./src/render/text/$(DEPDIR) ./src/render/value/$(DEPDIR) ./src/script/$(DEPDIR) ./src/util/$(DEPDIR) ./src/util/io/$(DEPDIR) + -rm -rf ./src/$(DEPDIR) ./src/data/$(DEPDIR) ./src/data/action/$(DEPDIR) ./src/data/field/$(DEPDIR) ./src/data/format/$(DEPDIR) ./src/gfx/$(DEPDIR) ./src/gui/$(DEPDIR) ./src/gui/control/$(DEPDIR) ./src/gui/set/$(DEPDIR) ./src/gui/symbol/$(DEPDIR) ./src/gui/value/$(DEPDIR) ./src/render/card/$(DEPDIR) ./src/render/symbol/$(DEPDIR) ./src/render/text/$(DEPDIR) ./src/render/value/$(DEPDIR) ./src/script/$(DEPDIR) ./src/script/functions/$(DEPDIR) ./src/util/$(DEPDIR) ./src/util/io/$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic diff --git a/Makefile.am b/Makefile.am index 0fa41651..0ef3616b 100644 --- a/Makefile.am +++ b/Makefile.am @@ -53,6 +53,8 @@ magicseteditor_SOURCES += ./src/gui/control/filtered_card_list.cpp magicseteditor_SOURCES += ./src/gui/control/package_list.cpp magicseteditor_SOURCES += ./src/gui/control/gallery_list.cpp magicseteditor_SOURCES += ./src/gui/control/card_viewer.cpp +magicseteditor_SOURCES += ./src/gui/control/item_list.cpp +magicseteditor_SOURCES += ./src/gui/control/keyword_list.cpp magicseteditor_SOURCES += ./src/gui/set/style_panel.cpp magicseteditor_SOURCES += ./src/gui/set/panel.cpp magicseteditor_SOURCES += ./src/gui/set/set_info_panel.cpp @@ -89,17 +91,17 @@ magicseteditor_SOURCES += ./src/gui/drop_down_list.cpp magicseteditor_SOURCES += ./src/gui/image_slice_window.cpp magicseteditor_SOURCES += ./src/script/script_manager.cpp magicseteditor_SOURCES += ./src/script/script.cpp +magicseteditor_SOURCES += ./src/script/functions/basic.cpp +magicseteditor_SOURCES += ./src/script/functions/export.cpp +magicseteditor_SOURCES += ./src/script/functions/image.cpp +magicseteditor_SOURCES += ./src/script/functions/editor.cpp +magicseteditor_SOURCES += ./src/script/functions/english.cpp magicseteditor_SOURCES += ./src/script/value.cpp magicseteditor_SOURCES += ./src/script/dependency.cpp magicseteditor_SOURCES += ./src/script/image.cpp magicseteditor_SOURCES += ./src/script/context.cpp magicseteditor_SOURCES += ./src/script/scriptable.cpp magicseteditor_SOURCES += ./src/script/parser.cpp -magicseteditor_SOURCES += ./src/script/functions/basic.cpp -magicseteditor_SOURCES += ./src/script/functions/image.cpp -magicseteditor_SOURCES += ./src/script/functions/editor.cpp -magicseteditor_SOURCES += ./src/script/functions/export.cpp -magicseteditor_SOURCES += ./src/script/functions/english.cpp magicseteditor_SOURCES += ./src/data/field/color.cpp magicseteditor_SOURCES += ./src/data/field/boolean.cpp magicseteditor_SOURCES += ./src/data/field/image.cpp @@ -134,6 +136,7 @@ magicseteditor_SOURCES += ./src/data/stylesheet.cpp magicseteditor_SOURCES += ./src/data/statistics.cpp magicseteditor_SOURCES += ./src/data/set.cpp magicseteditor_SOURCES += ./src/data/symbol_font.cpp +magicseteditor_SOURCES += ./src/data/export_template.cpp magicseteditor_SOURCES += ./src/util/io/get_member.cpp magicseteditor_SOURCES += ./src/util/io/reader.cpp magicseteditor_SOURCES += ./src/util/io/package_manager.cpp diff --git a/src/config.h.in b/src/config.h.in index fee9ef2c..e50a6dd0 100644 --- a/src/config.h.in +++ b/src/config.h.in @@ -91,5 +91,5 @@ /* Define to rpl_malloc if the replacement function should be used. */ #undef malloc -/* Define to `unsigned' if does not define. */ +/* Define to `unsigned int' if does not define. */ #undef size_t diff --git a/src/data/action/value.cpp b/src/data/action/value.cpp index 379f15e8..3c2b4628 100644 --- a/src/data/action/value.cpp +++ b/src/data/action/value.cpp @@ -25,11 +25,12 @@ String ValueAction::getName(bool to_undo) const { // ----------------------------------------------------------------------------- : Simple /// A ValueAction that swaps between old and new values -template +template class SimpleValueAction : public ValueAction { public: - inline SimpleValueAction(const shared_ptr& value, const typename T::ValueType& new_value) + inline SimpleValueAction(const shared_ptr& value, const typename T::ValueType& new_value, typename T::ValueType T::*member) : ValueAction(value), new_value(new_value) + , member(member) {} virtual void perform(bool to_undo) { @@ -50,13 +51,14 @@ class SimpleValueAction : public ValueAction { private: typename T::ValueType new_value; + typename T::ValueType T::*member; }; -ValueAction* value_action(const ChoiceValueP& value, const Defaultable& new_value) { return new SimpleValueAction (value, new_value); } -ValueAction* value_action(const MultipleChoiceValueP& value, const Defaultable& new_value) { return new SimpleValueAction(value, new_value); } -ValueAction* value_action(const ColorValueP& value, const Defaultable& new_value) { return new SimpleValueAction (value, new_value); } -ValueAction* value_action(const ImageValueP& value, const FileName& new_value) { return new SimpleValueAction(value, new_value); } -ValueAction* value_action(const SymbolValueP& value, const FileName& new_value) { return new SimpleValueAction(value, new_value); } +ValueAction* value_action(const ChoiceValueP& value, const Defaultable& new_value) { return new SimpleValueAction (value, new_value, &ChoiceValue::value); } +ValueAction* value_action(const MultipleChoiceValueP& value, const Defaultable& new_value) { return new SimpleValueAction(value, new_value, &MultipleChoiceValue::value); } +ValueAction* value_action(const ColorValueP& value, const Defaultable& new_value) { return new SimpleValueAction (value, new_value, &ColorValue::value); } +ValueAction* value_action(const ImageValueP& value, const FileName& new_value) { return new SimpleValueAction(value, new_value, &ImageValue::filename); } +ValueAction* value_action(const SymbolValueP& value, const FileName& new_value) { return new SimpleValueAction(value, new_value, &SymbolValue::filename); } // ----------------------------------------------------------------------------- : Text diff --git a/src/data/font.cpp b/src/data/font.cpp index 95c1d959..da35249f 100644 --- a/src/data/font.cpp +++ b/src/data/font.cpp @@ -48,7 +48,7 @@ void reflect_font(Reader& tag, Font& font) { REFLECT(weight); REFLECT(style); if (!name.empty()) font.font.SetFaceName(name); - if (size > 0) font.font.SetPointSize(font.size = size); + if (size > 0) font.font.SetPointSize((int) (font.size = size)); if (!weight.empty()) font.font.SetWeight(weight == _("bold") ? wxBOLD : wxNORMAL); if (!style.empty()) font.font.SetWeight(style == _("italic") ? wxITALIC : wxNORMAL); } diff --git a/src/data/format/image.cpp b/src/data/format/image.cpp index 0132e4bd..53cbf314 100644 --- a/src/data/format/image.cpp +++ b/src/data/format/image.cpp @@ -34,7 +34,7 @@ Bitmap export_bitmap(const SetP& set, const CardP& card) { } RealSize size = viewer.getRotation().getExternalSize(); // create bitmap & dc - Bitmap bitmap(size.width, size.height); + Bitmap bitmap((int) size.width, (int) size.height); if (!bitmap.Ok()) throw InternalError(_("Unable to create bitmap")); wxMemoryDC dc; dc.SelectObject(bitmap); diff --git a/src/data/game.cpp b/src/data/game.cpp index c8012109..063936bd 100644 --- a/src/data/game.cpp +++ b/src/data/game.cpp @@ -21,8 +21,8 @@ DECLARE_TYPEOF_COLLECTION(StatsDimensionP); IMPLEMENT_DYNAMIC_ARG(Game*, game_for_reading, nullptr); Game::Game() - : dependencies_initialized(false) - , has_keywords(false) + : has_keywords(false) + , dependencies_initialized(false) {} GameP Game::byName(const String& name) { diff --git a/src/data/symbol_font.cpp b/src/data/symbol_font.cpp index 1c367625..ccb7f09c 100644 --- a/src/data/symbol_font.cpp +++ b/src/data/symbol_font.cpp @@ -99,8 +99,8 @@ class SymbolInFont { }; SymbolInFont::SymbolInFont() - : actual_size(0,0) - , enabled(true) + : enabled(true) + , actual_size(0,0) { assert(symbol_font_for_reading()); img_size = symbol_font_for_reading()->img_size; @@ -118,8 +118,8 @@ Bitmap SymbolInFont::getBitmap(Context& ctx, Package& pkg, double size) { Image img = image.generate(ctx, pkg)->image; actual_size = wxSize(img.GetWidth(), img.GetHeight()); // scale to match expected size - Image resampled_image(actual_size.GetWidth() * size / img_size, - actual_size.GetHeight() * size / img_size, false); + Image resampled_image((int) (actual_size.GetWidth() * size / img_size), + (int) (actual_size.GetHeight() * size / img_size), false); if (!resampled_image.Ok()) return Bitmap(1,1); resample(img, resampled_image); // convert to bitmap, store for later use @@ -145,7 +145,7 @@ RealSize SymbolInFont::size(Context& ctx, Package& pkg, double size) { // we don't know what size the image will be getBitmap(ctx, pkg, size); } - return wxSize(actual_size * size / img_size); + return wxSize(actual_size * (int) (size) / (int) (img_size)); } void SymbolInFont::update(Context& ctx) { diff --git a/src/gui/about_window.cpp b/src/gui/about_window.cpp index 0d7b2022..c3362ce3 100644 --- a/src/gui/about_window.cpp +++ b/src/gui/about_window.cpp @@ -67,8 +67,8 @@ END_EVENT_TABLE () HoverButton::HoverButton(Window* parent, int id, const String& name, const Color& background) : wxControl(parent, id, wxDefaultPosition, wxDefaultSize, wxNO_BORDER ) , hover(false), focus(false), mouse_down(false), key_down(false) - , last_drawn(nullptr) , background(background) + , last_drawn(nullptr) { loadBitmaps(name); SetSize(DoGetBestSize()); diff --git a/src/gui/control/gallery_list.hpp b/src/gui/control/gallery_list.hpp index f408bd0f..35b70910 100644 --- a/src/gui/control/gallery_list.hpp +++ b/src/gui/control/gallery_list.hpp @@ -38,8 +38,8 @@ class GalleryList : public wxScrolledWindow { static const size_t NO_SELECTION = (size_t)-1; size_t selection; ///< The selected item, or NO_SELECTION if there is no selection wxSize item_size; ///< The size of a single item - int scroll_increment; ///< How large are the scroll steps? int direction; ///< Direction of the list, can be wxHORIZONTAL or wxVERTICAL + int scroll_increment; ///< How large are the scroll steps? /// Redraw the list after changing the selection or the number of items void update(); diff --git a/src/gui/symbol/basic_shape_editor.cpp b/src/gui/symbol/basic_shape_editor.cpp index dc60f228..6399aa5d 100644 --- a/src/gui/symbol/basic_shape_editor.cpp +++ b/src/gui/symbol/basic_shape_editor.cpp @@ -16,8 +16,8 @@ SymbolBasicShapeEditor::SymbolBasicShapeEditor(SymbolControl* control) : SymbolEditorBase(control) - , drawing(false) , mode(ID_SHAPE_CIRCLE) + , drawing(false) { control->SetCursor(*wxCROSS_CURSOR); } diff --git a/src/gui/symbol/control.cpp b/src/gui/symbol/control.cpp index 02bae4f1..cfdeb795 100644 --- a/src/gui/symbol/control.cpp +++ b/src/gui/symbol/control.cpp @@ -152,7 +152,7 @@ void SymbolControl::draw(DC& dc) { wxSize s = dc.GetSize(); int lines = settings.symbol_grid_size; for (int i = 0 ; i <= lines ; ++i) { - int x = rotation.trS((double)i/lines-0.0001); + int x = (int) rotation.trS(i/lines-0.0001); //dc.SetPen(Color(0, i%5 == 0 ? 64 : 31, 0)); //dc.SetPen(Color(i%5 == 0 ? 64 : 31, 0, 0)); dc.SetLogicalFunction(wxAND); @@ -270,4 +270,4 @@ BEGIN_EVENT_TABLE(SymbolControl, wxControl) EVT_KEY_UP (SymbolControl::onKeyChange) EVT_KEY_DOWN (SymbolControl::onKeyChange) EVT_CHAR (SymbolControl::onChar) -END_EVENT_TABLE () \ No newline at end of file +END_EVENT_TABLE () diff --git a/src/gui/util.cpp b/src/gui/util.cpp index a7e810f9..02c9d73c 100644 --- a/src/gui/util.cpp +++ b/src/gui/util.cpp @@ -85,13 +85,13 @@ Image load_resource_image(const String& name) { char* data = (char *)::LockResource(hData); if ( !data ) throw InternalError(String::Format(_("Resource cannot be locked: %s"), name)); - + int len = ::SizeofResource(wxGetInstance(), hResource); wxMemoryInputStream stream(data, len); return wxImage(stream); #elif defined(__linux__) static String path = wxStandardPaths::Get().GetDataDir() + _("/resource/"); - String file = path + name; // if the name is in upper case, fix the call + String file = path + name; wxImage resource; if (wxFileExists(file + _(".png"))) resource.LoadFile(file + _(".png")); else if (wxFileExists(file + _(".bmp"))) resource.LoadFile(file + _(".bmp")); diff --git a/src/render/symbol/viewer.cpp b/src/render/symbol/viewer.cpp index a91f163b..27180ca6 100644 --- a/src/render/symbol/viewer.cpp +++ b/src/render/symbol/viewer.cpp @@ -186,7 +186,7 @@ void SymbolViewer::drawSymbolPart(const SymbolPart& part, DC* border, DC* interi // white/black border->SetBrush(Color(borderCol, borderCol, borderCol)); } - border->SetPen(wxPen(*wxWHITE, rotation.trS(border_radius))); + border->SetPen(wxPen(*wxWHITE, (int) rotation.trS(border_radius))); border->DrawPolygon((int)points.size(), &points[0]); } // draw interior diff --git a/src/render/text/element.cpp b/src/render/text/element.cpp index ca0e79cc..0ce33055 100644 --- a/src/render/text/element.cpp +++ b/src/render/text/element.cpp @@ -133,4 +133,4 @@ RealSize CompoundTextElement::charSize(RotatedDC& dc, double scale, size_t index return elements.charSize(rot, scale, index); } -*/ \ No newline at end of file +*/ diff --git a/src/render/value/choice.cpp b/src/render/value/choice.cpp index 678f8960..33facb64 100644 --- a/src/render/value/choice.cpp +++ b/src/render/value/choice.cpp @@ -30,7 +30,7 @@ void ChoiceValueViewer::draw(RotatedDC& dc) { i = img.update(viewer.getContext(), *viewer.stylesheet, 0, 0); } else { i = img.update(viewer.getContext(), *viewer.stylesheet, - dc.trS(style().width), dc.trS(style().height), + (int) dc.trS(style().width), (int) dc.trS(style().height), style().alignment == ALIGN_STRETCH ? ASPECT_STRETCH : ASPECT_FIT ); } diff --git a/src/render/value/image.cpp b/src/render/value/image.cpp index e0af0a3d..2fa69235 100644 --- a/src/render/value/image.cpp +++ b/src/render/value/image.cpp @@ -70,7 +70,7 @@ void ImageValueViewer::onStyleChange() { void ImageValueViewer::loadMask(const Rotation& rot) const { if (style().mask_filename().empty()) return; // no mask - int w = rot.trS(style().width), h = rot.trS(style().height); + int w = (int) rot.trS(style().width), h = (int) rot.trS(style().height); if (alpha_mask && alpha_mask->size == wxSize(w,h)) return; // mask loaded and right size // (re) load the mask Image image; diff --git a/src/render/value/symbol.cpp b/src/render/value/symbol.cpp index 49b9a5b2..ef6cae2d 100644 --- a/src/render/value/symbol.cpp +++ b/src/render/value/symbol.cpp @@ -30,7 +30,7 @@ void SymbolValueViewer::draw(RotatedDC& dc) { // render and filter variations FOR_EACH(variation, style().variations) { Image img = render_symbol(symbol, *variation->filter, variation->border_radius); - Image resampled(wh, wh, false); + Image resampled((int) wh, (int) wh, false); resample(img, resampled); symbols.push_back(Bitmap(resampled)); } diff --git a/src/script/functions/basic.cpp b/src/script/functions/basic.cpp index 86f533e2..17c76998 100644 --- a/src/script/functions/basic.cpp +++ b/src/script/functions/basic.cpp @@ -60,13 +60,13 @@ SCRIPT_FUNCTION(contains) { SCRIPT_RULE_1(format, String, format) { String fmt = _("%") + replace_all(format, _("%"), _("")); // determine type expected by format string - if (format.find_first_of(_("DdIiOoXx")) != String.npos) { + if (format.find_first_of(_("DdIiOoXx")) != String::npos) { SCRIPT_PARAM(int, input); SCRIPT_RETURN(String::Format(fmt, input)); - } else if (format.find_first_of(_("EeFfGg")) != String.npos) { + } else if (format.find_first_of(_("EeFfGg")) != String::npos) { SCRIPT_PARAM(double, input); SCRIPT_RETURN(String::Format(fmt, input)); - } else if (format.find_first_of(_("Ss")) != String.npos) { + } else if (format.find_first_of(_("Ss")) != String::npos) { SCRIPT_PARAM(String, input); SCRIPT_RETURN(format_string(fmt, input)); } else { diff --git a/src/script/functions/editor.cpp b/src/script/functions/editor.cpp index d855c754..20544939 100644 --- a/src/script/functions/editor.cpp +++ b/src/script/functions/editor.cpp @@ -136,4 +136,4 @@ SCRIPT_FUNCTION_DEPENDENCIES(combined_editor) { void init_script_editor_functions(Context& ctx) { ctx.setVariable(_("forward editor"), script_combined_editor); // combatability ctx.setVariable(_("combined editor"), script_combined_editor); -} \ No newline at end of file +} diff --git a/src/script/functions/english.cpp b/src/script/functions/english.cpp index 30165a08..9f0dbacf 100644 --- a/src/script/functions/english.cpp +++ b/src/script/functions/english.cpp @@ -33,6 +33,7 @@ String english_number(int i) { case 18: return _("eighteen"); case 20: return _("twenty"); case 30: return _("thirty"); + case 40: return _("forty"); case 50: return _("fifty"); case 80: return _("eighty"); default: { @@ -40,7 +41,7 @@ String english_number(int i) { // number too large, keep as digits return (String() << i); } else if (i < 20) { - return english_number(i%10) + english_number(10); + return english_number(i%10) + _("teen"); } else if (i % 10 == 0) { return english_number(i/10) + _("ty"); } else { diff --git a/src/script/to_value.hpp b/src/script/to_value.hpp index a340e138..d5d8c2bf 100644 --- a/src/script/to_value.hpp +++ b/src/script/to_value.hpp @@ -205,7 +205,7 @@ inline ScriptValueP to_script(long v) { return to_script((int) v); } ScriptValueP to_script(double v); ScriptValueP to_script(const String& v); ScriptValueP to_script(const Color& v); -inline ScriptValueP to_script(bool v) { return v ? script_true : script_false; } +inline ScriptValueP to_script(bool v) { return v ? script_true : script_false; } template inline ScriptValueP to_script(const vector* v) { return new_intrusive1 > >(v); } template diff --git a/src/script/value.cpp b/src/script/value.cpp index 8e565f7d..49cbfd83 100644 --- a/src/script/value.cpp +++ b/src/script/value.cpp @@ -245,21 +245,21 @@ class ScriptCustomCollectionIterator : public ScriptIterator { : pos(0), col(col), colP(colP) {} virtual ScriptValueP next() { if (pos < col->size()) { - return to_script(col->at(pos++)); + return col->at(pos++); } else { return ScriptValueP(); } } private: size_t pos; - ScriptValueP colP; // for ownership of the collection const vector* col; + ScriptValueP colP; // for ownership of the collection }; ScriptValueP ScriptCustomCollection::getMember(const String& name) const { long index; if (name.ToLong(&index) && index >= 0 && (size_t)index < value.size()) { - return to_script(value.at(index)); + return value.at(index); } else { return ScriptValue::getMember(name); } diff --git a/src/util/for_each.hpp b/src/util/for_each.hpp index 19ad20db..9aba9d5a 100644 --- a/src/util/for_each.hpp +++ b/src/util/for_each.hpp @@ -53,35 +53,35 @@ #define TYPEOF_CREF(Value) TypeOf::const_reference /// Declare typeof magic for a specific type - #define DECLARE_TYPEOF(T) \ + #define DECLARE_TYPEOF(T) \ template<> struct TypeOf { \ - typedef T type; \ - typedef T::iterator iterator; \ - typedef T::const_iterator const_iterator; \ - typedef T::reverse_iterator reverse_iterator; \ - typedef T::const_reverse_iterator const_reverse_iterator; \ - typedef T::reference reference; \ - typedef T::const_reference const_reference; \ + typedef T type; \ + typedef T::iterator iterator; \ + typedef T::const_iterator const_iterator; \ + typedef T::reverse_iterator reverse_iterator; \ + typedef T::const_reverse_iterator const_reverse_iterator; \ + typedef T::reference reference; \ + typedef T::const_reference const_reference; \ } /// Declare typeof magic for a specific type that doesn't support reverse iterators - #define DECLARE_TYPEOF_NO_REV(T) \ + #define DECLARE_TYPEOF_NO_REV(T) \ template<> struct TypeOf { \ - typedef T type; \ - typedef T::iterator iterator; \ - typedef T::const_iterator const_iterator; \ - typedef T::reference reference; \ - typedef T::const_reference const_reference; \ + typedef T type; \ + typedef T::iterator iterator; \ + typedef T::const_iterator const_iterator; \ + typedef T::reference reference; \ + typedef T::const_reference const_reference; \ } /// Declare typeof magic for a specific type, using const iterators - #define DECLARE_TYPEOF_CONST(T) \ + #define DECLARE_TYPEOF_CONST(T) \ template<> struct TypeOf { \ - typedef T type; \ - typedef T::const_iterator iterator; \ - typedef T::const_iterator const_iterator; \ - typedef T::const_reverse_iterator reverse_iterator; \ - typedef T::const_reverse_iterator const_reverse_iterator; \ - typedef T::const_reference reference; \ - typedef T::const_reference const_reference; \ + typedef T type; \ + typedef T::const_iterator iterator; \ + typedef T::const_iterator const_iterator; \ + typedef T::const_reverse_iterator reverse_iterator; \ + typedef T::const_reverse_iterator const_reverse_iterator; \ + typedef T::const_reference reference; \ + typedef T::const_reference const_reference; \ } /// Declare typeof magic for a specific std::vector type @@ -103,33 +103,33 @@ /// Iterate over a collection, using an iterator it of type Type /** Usage: FOR_EACH_IT_T(Type,it,collect) { body-of-loop } */ -#define FOR_EACH_IT_T(Type,Iterator,Collection) \ - for(Type Iterator = Collection.begin() ; \ +#define FOR_EACH_IT_T(Type,Iterator,Collection) \ + for(Type Iterator = Collection.begin() ; \ Iterator != Collection.end() ; \ ++Iterator) /// Iterate over a collection whos type must be declared with DECLARE_TYPEOF /** Usage: FOR_EACH_IT(it,collect) { body-of-loop } */ -#define FOR_EACH_IT(Iterator,Collection) \ +#define FOR_EACH_IT(Iterator,Collection) \ FOR_EACH_IT_T(TYPEOF_IT(Collection), Iterator, Collection) /// Iterate over a collection whos type must be declared with DECLARE_TYPEOF /** Uses a const_iterator * Usage: FOR_EACH_IT(it,collect) { body-of-loop } */ -#define FOR_EACH_CONST_IT(Iterator,Collection) \ +#define FOR_EACH_CONST_IT(Iterator,Collection) \ FOR_EACH_IT_T(TYPEOF_CIT(Collection), Iterator, Collection) /// Iterate over a collection in whos type must be declared with DECLARE_TYPEOF /** Iterates using a reverse_iterator * Usage: FOR_EACH_REVERSE_IT(it,collect) { body-of-loop } */ -#define FOR_EACH_REVERSE_IT(Iterator,Collection) \ - for(TYPEOF_RIT(Collection) \ - Iterator = Collection.rbegin() ; \ - Iterator != Collection.rend() ; \ - ++Iterator) +#define FOR_EACH_REVERSE_IT(Iterator,Collection) \ + for(TYPEOF_RIT(Collection) \ + Iterator = Collection.rbegin() ; \ + Iterator != Collection.rend() ; \ + ++Iterator) // ----------------------------------------------------------------------------- : Looping macros @@ -140,32 +140,32 @@ * To do this we use a nested for loop that is only executed once, and which is optimized away. * To terminate this loop we need an extra bool, which we set to false after the first iteration. */ -#define FOR_EACH_T(TypeIt,TypeElem,Elem,Collection, begin, end) \ - for(std::pair Elem##_IT(Collection.begin(), true) ; \ - Elem##_IT.second && Elem##_IT.first != Collection.end() ; \ - ++Elem##_IT.first, Elem##_IT.second = !Elem##_IT.second) \ - for(TypeElem Elem = *Elem##_IT.first ; \ - Elem##_IT.second ; \ +#define FOR_EACH_T(TypeIt,TypeElem,Elem,Collection, begin, end) \ + for(std::pair Elem##_IT(Collection.begin(), true) ; \ + Elem##_IT.second && Elem##_IT.first != Collection.end() ; \ + ++Elem##_IT.first, Elem##_IT.second = !Elem##_IT.second) \ + for(TypeElem Elem = *Elem##_IT.first ; \ + Elem##_IT.second ; \ Elem##_IT.second = false) /// Iterate over a collection whos type must be declared with DECLARE_TYPEOF /** Usage: FOR_EACH(e,collect) { body-of-loop } */ -#define FOR_EACH(Elem,Collection) \ +#define FOR_EACH(Elem,Collection) \ FOR_EACH_T(TYPEOF_IT(Collection), TYPEOF_REF(Collection), Elem, Collection, begin, end) /// Iterate over a collection whos type must be declared with DECLARE_TYPEOF /** Uses a const iterator * Usage: FOR_EACH_CONST(e,collect) { body-of-loop } */ -#define FOR_EACH_CONST(Elem,Collection) \ +#define FOR_EACH_CONST(Elem,Collection) \ FOR_EACH_T(TYPEOF_CIT(Collection), TYPEOF_CREF(Collection), Elem, Collection, begin, end) /// Iterate over a collection whos type must be declared with DECLARE_TYPEOF /** Iterates using a reverse_iterator * Usage: FOR_EACH_REVERSE(e,collect) { body-of-loop } */ -#define FOR_EACH_REVERSE(Elem,Collection) \ +#define FOR_EACH_REVERSE(Elem,Collection) \ FOR_EACH_T(TYPEOF_RIT(Collection), TYPEOF_REF(Collection), Elem, Collection, rbegin, rend) /// Iterate over a collection whos type must be declared with DECLARE_TYPEOF @@ -181,31 +181,31 @@ * Note: This has got to be one of the craziest pieces of code I have ever written :) * It is just an extension of the idea of FOR_EACH_T. */ -#define FOR_EACH_2_T(TypeIt1,TypeElem1,Elem1,Coll1,TypeIt2,TypeElem2,Elem2,Coll2) \ +#define FOR_EACH_2_T(TypeIt1,TypeElem1,Elem1,Coll1,TypeIt2,TypeElem2,Elem2,Coll2) \ for(std::pair, bool> \ - Elem1##_IT(make_pair(Coll1.begin(), Coll2.begin()), true) ; \ - Elem1##_IT.first.first != Coll1.end() && \ - Elem1##_IT.first.second != Coll2.end() ; \ - ++Elem1##_IT.first.first, ++Elem1##_IT.first.second, \ - Elem1##_IT.second = true) \ + Elem1##_IT(make_pair(Coll1.begin(), Coll2.begin()), true) ; \ + Elem1##_IT.first.first != Coll1.end() && \ + Elem1##_IT.first.second != Coll2.end() ; \ + ++Elem1##_IT.first.first, ++Elem1##_IT.first.second, \ + Elem1##_IT.second = true) \ for(TypeElem1 Elem1 = *Elem1##_IT.first.first ; \ - Elem1##_IT.second ; \ - Elem1##_IT.second = false) \ + Elem1##_IT.second ; \ + Elem1##_IT.second = false) \ for(TypeElem2 Elem2 = *Elem1##_IT.first.second ; \ - Elem1##_IT.second ; \ + Elem1##_IT.second ; \ Elem1##_IT.second = false) /// Iterate over two collections in parallel, their type must be declared with DECLARE_TYPEOF. /** Usage: FOR_EACH_2(e1,collect1, e2,collect2) { body-of-loop } */ -#define FOR_EACH_2(Elem1,Collection1, Elem2,Collection2) \ +#define FOR_EACH_2(Elem1,Collection1, Elem2,Collection2) \ FOR_EACH_2_T(TYPEOF_IT(Collection1), TYPEOF_REF(Collection1), Elem1, Collection1, \ TYPEOF_IT(Collection2), TYPEOF_REF(Collection2), Elem2, Collection2) /// Iterate over two constants collections in parallel, their type must be declared with DECLARE_TYPEOF. /** Usage: FOR_EACH_2_CONST(e1,collect1, e2,collect2) { body-of-loop } */ -#define FOR_EACH_2_CONST(Elem1,Collection1, Elem2,Collection2) \ +#define FOR_EACH_2_CONST(Elem1,Collection1, Elem2,Collection2) \ FOR_EACH_2_T(TYPEOF_CIT(Collection1), TYPEOF_CREF(Collection1), Elem1, Collection1, \ TYPEOF_CIT(Collection2), TYPEOF_CREF(Collection2), Elem2, Collection2) diff --git a/src/util/io/package.cpp b/src/util/io/package.cpp index 615cb0a8..57e26150 100644 --- a/src/util/io/package.cpp +++ b/src/util/io/package.cpp @@ -125,7 +125,7 @@ void Package::saveAs(const String& name, bool removeUnused) { // ----------------------------------------------------------------------------- : Package : inside -/* +#if 0 /// Class that is a wxZipInputStream over a wxFileInput stream /** Note that wxFileInputStream is also a base class, because it must be constructed first * This class requires a patch in wxWidgets (2.5.4) @@ -136,7 +136,7 @@ void Package::saveAs(const String& name, bool removeUnused) { * It seems that in 2.6.3 this is no longer necessary (TODO: test) * * NOTE: Not used with wx 2.6.3, since it doesn't support seeking - * / + */ class ZipFileInputStream : private wxFileInputStream, public wxZipInputStream { public: ZipFileInputStream(const String& filename, wxZipEntry* entry) @@ -146,7 +146,7 @@ class ZipFileInputStream : private wxFileInputStream, public wxZipInputStream { OpenEntry(*entry); } }; -*/ +#endif InputStreamP Package::openIn(const String& file) { if (!file.empty() && file.GetChar(0) == _('/')) { diff --git a/src/util/locale.hpp b/src/util/locale.hpp index 0206c163..edaef22e 100644 --- a/src/util/locale.hpp +++ b/src/util/locale.hpp @@ -115,6 +115,9 @@ inline String format_string(const String& format, const String& a0) { inline String format_string(const String& format, const String& a0, const String& a1) { return String::Format(format, a0.c_str(), a1.c_str()); } +inline String format_string(const String& format, const String& a0, const String& a1, const String& a2) { + return String::Format(format, a0.c_str(), a1.c_str(), a2.c_str()); +} // ----------------------------------------------------------------------------- : EOF #endif diff --git a/src/util/rotation.cpp b/src/util/rotation.cpp index ffd7e32a..f2e972a4 100644 --- a/src/util/rotation.cpp +++ b/src/util/rotation.cpp @@ -131,14 +131,14 @@ void RotatedDC::DrawText (const String& text, const RealPoint& pos) { draw_resampled_text(dc, r_ext, revX(), revY(), angle, text); } else { RealPoint p_ext = tr(pos); - dc.DrawRotatedText(text, p_ext.x, p_ext.y, angle); + dc.DrawRotatedText(text, (int) p_ext.x, (int) p_ext.y, angle); } } void RotatedDC::DrawBitmap(const Bitmap& bitmap, const RealPoint& pos) { if (angle == 0) { RealPoint p_ext = tr(pos); - dc.DrawBitmap(bitmap, p_ext.x, p_ext.y, true); + dc.DrawBitmap(bitmap, (int) p_ext.x, (int) p_ext.y, true); } else { DrawImage(bitmap.ConvertToImage(), pos); } @@ -175,7 +175,7 @@ void RotatedDC::SetFont(const wxFont& font) { SetFont(font, font.GetPointSize()); } void RotatedDC::SetFont(wxFont font, double size) { - font.SetPointSize(trS(size) * (high_quality ? text_scaling : 1)); + font.SetPointSize((int) (trS(size) * (high_quality ? text_scaling : 1))); dc.SetFont(font); }