Compatibility updates step 1.

git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@815 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
coppro
2008-01-05 22:37:22 +00:00
parent aec798b8f6
commit 692ff43573
13 changed files with 866 additions and 825 deletions
+134 -128
View File
@@ -15,151 +15,157 @@ AM_LDFLAGS = @WX_LIBS@
magicseteditor_SOURCES = magicseteditor_SOURCES =
# The script used to generate is MakeAM.sh # The script used to generate is MakeAM.sh
magicseteditor_SOURCES += ./src/render/text/viewer.cpp magicseteditor_SOURCES += ./src/main.cpp
magicseteditor_SOURCES += ./src/render/text/compound.cpp magicseteditor_SOURCES += ./src/render/value/viewer.cpp
magicseteditor_SOURCES += ./src/render/text/symbol.cpp magicseteditor_SOURCES += ./src/render/value/image.cpp
magicseteditor_SOURCES += ./src/render/text/font.cpp magicseteditor_SOURCES += ./src/render/value/information.cpp
magicseteditor_SOURCES += ./src/render/text/element.cpp magicseteditor_SOURCES += ./src/render/value/package_choice.cpp
magicseteditor_SOURCES += ./src/render/value/symbol.cpp
magicseteditor_SOURCES += ./src/render/value/choice.cpp
magicseteditor_SOURCES += ./src/render/value/color.cpp
magicseteditor_SOURCES += ./src/render/value/text.cpp
magicseteditor_SOURCES += ./src/render/value/multiple_choice.cpp
magicseteditor_SOURCES += ./src/render/symbol/viewer.cpp magicseteditor_SOURCES += ./src/render/symbol/viewer.cpp
magicseteditor_SOURCES += ./src/render/symbol/filter.cpp magicseteditor_SOURCES += ./src/render/symbol/filter.cpp
magicseteditor_SOURCES += ./src/render/card/viewer.cpp magicseteditor_SOURCES += ./src/render/card/viewer.cpp
magicseteditor_SOURCES += ./src/render/value/viewer.cpp magicseteditor_SOURCES += ./src/render/text/viewer.cpp
magicseteditor_SOURCES += ./src/render/value/symbol.cpp magicseteditor_SOURCES += ./src/render/text/font.cpp
magicseteditor_SOURCES += ./src/render/value/multiple_choice.cpp magicseteditor_SOURCES += ./src/render/text/compound.cpp
magicseteditor_SOURCES += ./src/render/value/color.cpp magicseteditor_SOURCES += ./src/render/text/element.cpp
magicseteditor_SOURCES += ./src/render/value/image.cpp magicseteditor_SOURCES += ./src/render/text/symbol.cpp
magicseteditor_SOURCES += ./src/render/value/text.cpp magicseteditor_SOURCES += ./src/gui/value/image.cpp
magicseteditor_SOURCES += ./src/render/value/information.cpp magicseteditor_SOURCES += ./src/gui/value/information.cpp
magicseteditor_SOURCES += ./src/render/value/choice.cpp magicseteditor_SOURCES += ./src/gui/value/package_choice.cpp
magicseteditor_SOURCES += ./src/gfx/color.cpp magicseteditor_SOURCES += ./src/gui/value/symbol.cpp
magicseteditor_SOURCES += ./src/gfx/combine_image.cpp magicseteditor_SOURCES += ./src/gui/value/choice.cpp
magicseteditor_SOURCES += ./src/gfx/bezier.cpp magicseteditor_SOURCES += ./src/gui/value/color.cpp
magicseteditor_SOURCES += ./src/gfx/generated_image.cpp magicseteditor_SOURCES += ./src/gui/value/text.cpp
magicseteditor_SOURCES += ./src/gfx/rotate_image.cpp magicseteditor_SOURCES += ./src/gui/value/editor.cpp
magicseteditor_SOURCES += ./src/gfx/image_effects.cpp magicseteditor_SOURCES += ./src/gui/value/multiple_choice.cpp
magicseteditor_SOURCES += ./src/gfx/polynomial.cpp magicseteditor_SOURCES += ./src/gui/image_slice_window.cpp
magicseteditor_SOURCES += ./src/gfx/blend_image.cpp magicseteditor_SOURCES += ./src/gui/html_export_window.cpp
magicseteditor_SOURCES += ./src/gfx/resample_image.cpp magicseteditor_SOURCES += ./src/gui/about_window.cpp
magicseteditor_SOURCES += ./src/gfx/resample_text.cpp magicseteditor_SOURCES += ./src/gui/set/stats_panel.cpp
magicseteditor_SOURCES += ./src/gfx/mask_image.cpp magicseteditor_SOURCES += ./src/gui/set/cards_panel.cpp
magicseteditor_SOURCES += ./src/gui/set/panel.cpp
magicseteditor_SOURCES += ./src/gui/set/window.cpp
magicseteditor_SOURCES += ./src/gui/set/style_panel.cpp
magicseteditor_SOURCES += ./src/gui/set/keywords_panel.cpp
magicseteditor_SOURCES += ./src/gui/set/set_info_panel.cpp
magicseteditor_SOURCES += ./src/gui/images_export_window.cpp
magicseteditor_SOURCES += ./src/gui/symbol/basic_shape_editor.cpp
magicseteditor_SOURCES += ./src/gui/symbol/selection.cpp
magicseteditor_SOURCES += ./src/gui/symbol/control.cpp
magicseteditor_SOURCES += ./src/gui/symbol/window.cpp
magicseteditor_SOURCES += ./src/gui/symbol/editor.cpp
magicseteditor_SOURCES += ./src/gui/symbol/point_editor.cpp
magicseteditor_SOURCES += ./src/gui/symbol/part_list.cpp
magicseteditor_SOURCES += ./src/gui/symbol/select_editor.cpp
magicseteditor_SOURCES += ./src/gui/symbol/symmetry_editor.cpp
magicseteditor_SOURCES += ./src/gui/util.cpp
magicseteditor_SOURCES += ./src/gui/drop_down_list.cpp
magicseteditor_SOURCES += ./src/gui/update_checker.cpp
magicseteditor_SOURCES += ./src/gui/control/item_list.cpp
magicseteditor_SOURCES += ./src/gui/control/gallery_list.cpp
magicseteditor_SOURCES += ./src/gui/control/tree_list.cpp
magicseteditor_SOURCES += ./src/gui/control/text_ctrl.cpp
magicseteditor_SOURCES += ./src/gui/control/filtered_card_list.cpp
magicseteditor_SOURCES += ./src/gui/control/card_list_column_select.cpp
magicseteditor_SOURCES += ./src/gui/control/graph.cpp magicseteditor_SOURCES += ./src/gui/control/graph.cpp
magicseteditor_SOURCES += ./src/gui/control/select_card_list.cpp magicseteditor_SOURCES += ./src/gui/control/select_card_list.cpp
magicseteditor_SOURCES += ./src/gui/control/card_list.cpp magicseteditor_SOURCES += ./src/gui/control/card_list.cpp
magicseteditor_SOURCES += ./src/gui/control/image_card_list.cpp magicseteditor_SOURCES += ./src/gui/control/image_card_list.cpp
magicseteditor_SOURCES += ./src/gui/control/text_ctrl.cpp
magicseteditor_SOURCES += ./src/gui/control/card_editor.cpp
magicseteditor_SOURCES += ./src/gui/control/keyword_list.cpp
magicseteditor_SOURCES += ./src/gui/control/card_list_column_select.cpp
magicseteditor_SOURCES += ./src/gui/control/native_look_editor.cpp
magicseteditor_SOURCES += ./src/gui/control/filtered_card_list.cpp
magicseteditor_SOURCES += ./src/gui/control/package_list.cpp magicseteditor_SOURCES += ./src/gui/control/package_list.cpp
magicseteditor_SOURCES += ./src/gui/control/item_list.cpp magicseteditor_SOURCES += ./src/gui/control/card_editor.cpp
magicseteditor_SOURCES += ./src/gui/control/gallery_list.cpp magicseteditor_SOURCES += ./src/gui/control/native_look_editor.cpp
magicseteditor_SOURCES += ./src/gui/control/keyword_list.cpp
magicseteditor_SOURCES += ./src/gui/control/card_viewer.cpp magicseteditor_SOURCES += ./src/gui/control/card_viewer.cpp
magicseteditor_SOURCES += ./src/gui/value/symbol.cpp
magicseteditor_SOURCES += ./src/gui/value/multiple_choice.cpp
magicseteditor_SOURCES += ./src/gui/value/color.cpp
magicseteditor_SOURCES += ./src/gui/value/image.cpp
magicseteditor_SOURCES += ./src/gui/value/text.cpp
magicseteditor_SOURCES += ./src/gui/value/information.cpp
magicseteditor_SOURCES += ./src/gui/value/editor.cpp
magicseteditor_SOURCES += ./src/gui/value/choice.cpp
magicseteditor_SOURCES += ./src/gui/set/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/window.cpp
magicseteditor_SOURCES += ./src/gui/set/cards_panel.cpp
magicseteditor_SOURCES += ./src/gui/set/stats_panel.cpp
magicseteditor_SOURCES += ./src/gui/symbol/point_editor.cpp
magicseteditor_SOURCES += ./src/gui/symbol/control.cpp
magicseteditor_SOURCES += ./src/gui/symbol/part_list.cpp
magicseteditor_SOURCES += ./src/gui/symbol/select_editor.cpp
magicseteditor_SOURCES += ./src/gui/symbol/editor.cpp
magicseteditor_SOURCES += ./src/gui/symbol/basic_shape_editor.cpp
magicseteditor_SOURCES += ./src/gui/symbol/window.cpp
magicseteditor_SOURCES += ./src/gui/symbol/symmetry_editor.cpp
magicseteditor_SOURCES += ./src/gui/symbol/selection.cpp
magicseteditor_SOURCES += ./src/gui/about_window.cpp
magicseteditor_SOURCES += ./src/gui/new_window.cpp
magicseteditor_SOURCES += ./src/gui/drop_down_list.cpp
magicseteditor_SOURCES += ./src/gui/preferences_window.cpp
magicseteditor_SOURCES += ./src/gui/image_slice_window.cpp
magicseteditor_SOURCES += ./src/gui/card_select_window.cpp magicseteditor_SOURCES += ./src/gui/card_select_window.cpp
magicseteditor_SOURCES += ./src/gui/update_checker.cpp magicseteditor_SOURCES += ./src/gui/new_window.cpp
magicseteditor_SOURCES += ./src/gui/thumbnail_thread.cpp
magicseteditor_SOURCES += ./src/gui/icon_menu.cpp magicseteditor_SOURCES += ./src/gui/icon_menu.cpp
magicseteditor_SOURCES += ./src/gui/util.cpp magicseteditor_SOURCES += ./src/gui/preferences_window.cpp
magicseteditor_SOURCES += ./src/gui/auto_replace_window.cpp
magicseteditor_SOURCES += ./src/gui/welcome_window.cpp magicseteditor_SOURCES += ./src/gui/welcome_window.cpp
magicseteditor_SOURCES += ./src/gui/print_window.cpp magicseteditor_SOURCES += ./src/gui/print_window.cpp
magicseteditor_SOURCES += ./src/gui/html_export_window.cpp magicseteditor_SOURCES += ./src/gui/thumbnail_thread.cpp
magicseteditor_SOURCES += ./src/gui/images_export_window.cpp magicseteditor_SOURCES += ./src/gui/packages_window.cpp
magicseteditor_SOURCES += ./src/gui/auto_replace_window.cpp magicseteditor_SOURCES += ./src/util/error.cpp
magicseteditor_SOURCES += ./src/script/functions/basic.cpp magicseteditor_SOURCES += ./src/util/version.cpp
magicseteditor_SOURCES += ./src/script/functions/export.cpp magicseteditor_SOURCES += ./src/util/file_utils.cpp
magicseteditor_SOURCES += ./src/script/functions/image.cpp magicseteditor_SOURCES += ./src/util/age.cpp
magicseteditor_SOURCES += ./src/script/functions/editor.cpp magicseteditor_SOURCES += ./src/util/action_stack.cpp
magicseteditor_SOURCES += ./src/script/functions/english.cpp magicseteditor_SOURCES += ./src/util/tagged_string.cpp
magicseteditor_SOURCES += ./src/script/script_manager.cpp magicseteditor_SOURCES += ./src/util/spec_sort.cpp
magicseteditor_SOURCES += ./src/script/script.cpp magicseteditor_SOURCES += ./src/util/alignment.cpp
magicseteditor_SOURCES += ./src/script/value.cpp magicseteditor_SOURCES += ./src/util/string.cpp
magicseteditor_SOURCES += ./src/script/dependency.cpp magicseteditor_SOURCES += ./src/util/io/package.cpp
magicseteditor_SOURCES += ./src/script/image.cpp magicseteditor_SOURCES += ./src/util/io/reader.cpp
magicseteditor_SOURCES += ./src/script/context.cpp magicseteditor_SOURCES += ./src/util/io/writer.cpp
magicseteditor_SOURCES += ./src/script/scriptable.cpp magicseteditor_SOURCES += ./src/util/io/get_member.cpp
magicseteditor_SOURCES += ./src/script/parser.cpp magicseteditor_SOURCES += ./src/util/io/package_manager.cpp
magicseteditor_SOURCES += ./src/data/field/symbol.cpp magicseteditor_SOURCES += ./src/util/rotation.cpp
magicseteditor_SOURCES += ./src/data/field/multiple_choice.cpp magicseteditor_SOURCES += ./src/gfx/generated_image.cpp
magicseteditor_SOURCES += ./src/data/field/color.cpp magicseteditor_SOURCES += ./src/gfx/mask_image.cpp
magicseteditor_SOURCES += ./src/data/field/boolean.cpp magicseteditor_SOURCES += ./src/gfx/blend_image.cpp
magicseteditor_SOURCES += ./src/data/field/image.cpp magicseteditor_SOURCES += ./src/gfx/image_effects.cpp
magicseteditor_SOURCES += ./src/data/field/text.cpp magicseteditor_SOURCES += ./src/gfx/resample_image.cpp
magicseteditor_SOURCES += ./src/data/field/information.cpp magicseteditor_SOURCES += ./src/gfx/polynomial.cpp
magicseteditor_SOURCES += ./src/data/field/choice.cpp magicseteditor_SOURCES += ./src/gfx/color.cpp
magicseteditor_SOURCES += ./src/data/format/clipboard.cpp magicseteditor_SOURCES += ./src/gfx/bezier.cpp
magicseteditor_SOURCES += ./src/gfx/resample_text.cpp
magicseteditor_SOURCES += ./src/gfx/rotate_image.cpp
magicseteditor_SOURCES += ./src/gfx/combine_image.cpp
magicseteditor_SOURCES += ./src/data/font.cpp
magicseteditor_SOURCES += ./src/data/set.cpp
magicseteditor_SOURCES += ./src/data/action/symbol_part.cpp
magicseteditor_SOURCES += ./src/data/action/set.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/game.cpp
magicseteditor_SOURCES += ./src/data/field.cpp
magicseteditor_SOURCES += ./src/data/statistics.cpp
magicseteditor_SOURCES += ./src/data/stylesheet.cpp
magicseteditor_SOURCES += ./src/data/symbol_font.cpp
magicseteditor_SOURCES += ./src/data/pack.cpp
magicseteditor_SOURCES += ./src/data/symbol.cpp
magicseteditor_SOURCES += ./src/data/locale.cpp
magicseteditor_SOURCES += ./src/data/card.cpp
magicseteditor_SOURCES += ./src/data/settings.cpp
magicseteditor_SOURCES += ./src/data/word_list.cpp
magicseteditor_SOURCES += ./src/data/format/image.cpp magicseteditor_SOURCES += ./src/data/format/image.cpp
magicseteditor_SOURCES += ./src/data/format/html.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/mws.cpp
magicseteditor_SOURCES += ./src/data/format/image_to_symbol.cpp magicseteditor_SOURCES += ./src/data/format/image_to_symbol.cpp
magicseteditor_SOURCES += ./src/data/format/apprentice.cpp
magicseteditor_SOURCES += ./src/data/format/formats.cpp magicseteditor_SOURCES += ./src/data/format/formats.cpp
magicseteditor_SOURCES += ./src/data/format/mws.cpp
magicseteditor_SOURCES += ./src/data/format/apprentice.cpp
magicseteditor_SOURCES += ./src/data/format/mse2.cpp
magicseteditor_SOURCES += ./src/data/format/mtg_editor.cpp magicseteditor_SOURCES += ./src/data/format/mtg_editor.cpp
magicseteditor_SOURCES += ./src/data/action/keyword.cpp magicseteditor_SOURCES += ./src/data/format/mse1.cpp
magicseteditor_SOURCES += ./src/data/action/symbol.cpp magicseteditor_SOURCES += ./src/data/format/clipboard.cpp
magicseteditor_SOURCES += ./src/data/action/set.cpp
magicseteditor_SOURCES += ./src/data/action/symbol_part.cpp
magicseteditor_SOURCES += ./src/data/action/value.cpp
magicseteditor_SOURCES += ./src/data/locale.cpp
magicseteditor_SOURCES += ./src/data/settings.cpp
magicseteditor_SOURCES += ./src/data/game.cpp
magicseteditor_SOURCES += ./src/data/export_template.cpp
magicseteditor_SOURCES += ./src/data/field.cpp
magicseteditor_SOURCES += ./src/data/set.cpp
magicseteditor_SOURCES += ./src/data/installer.cpp
magicseteditor_SOURCES += ./src/data/symbol.cpp
magicseteditor_SOURCES += ./src/data/font.cpp
magicseteditor_SOURCES += ./src/data/card.cpp
magicseteditor_SOURCES += ./src/data/pack.cpp
magicseteditor_SOURCES += ./src/data/keyword.cpp magicseteditor_SOURCES += ./src/data/keyword.cpp
magicseteditor_SOURCES += ./src/data/stylesheet.cpp magicseteditor_SOURCES += ./src/data/field/image.cpp
magicseteditor_SOURCES += ./src/data/statistics.cpp magicseteditor_SOURCES += ./src/data/field/information.cpp
magicseteditor_SOURCES += ./src/data/symbol_font.cpp magicseteditor_SOURCES += ./src/data/field/package_choice.cpp
magicseteditor_SOURCES += ./src/data/word_list.cpp magicseteditor_SOURCES += ./src/data/field/boolean.cpp
magicseteditor_SOURCES += ./src/util/io/reader.cpp magicseteditor_SOURCES += ./src/data/field/symbol.cpp
magicseteditor_SOURCES += ./src/util/io/package_manager.cpp magicseteditor_SOURCES += ./src/data/field/choice.cpp
magicseteditor_SOURCES += ./src/util/io/get_member.cpp magicseteditor_SOURCES += ./src/data/field/color.cpp
magicseteditor_SOURCES += ./src/util/io/package.cpp magicseteditor_SOURCES += ./src/data/field/text.cpp
magicseteditor_SOURCES += ./src/util/io/writer.cpp magicseteditor_SOURCES += ./src/data/field/multiple_choice.cpp
magicseteditor_SOURCES += ./src/util/rotation.cpp magicseteditor_SOURCES += ./src/data/installer.cpp
magicseteditor_SOURCES += ./src/util/version.cpp magicseteditor_SOURCES += ./src/data/export_template.cpp
magicseteditor_SOURCES += ./src/util/action_stack.cpp magicseteditor_SOURCES += ./src/script/image.cpp
magicseteditor_SOURCES += ./src/util/string.cpp magicseteditor_SOURCES += ./src/script/dependency.cpp
magicseteditor_SOURCES += ./src/util/alignment.cpp magicseteditor_SOURCES += ./src/script/script_manager.cpp
magicseteditor_SOURCES += ./src/util/tagged_string.cpp magicseteditor_SOURCES += ./src/script/script.cpp
magicseteditor_SOURCES += ./src/util/error.cpp magicseteditor_SOURCES += ./src/script/functions/image.cpp
magicseteditor_SOURCES += ./src/util/age.cpp magicseteditor_SOURCES += ./src/script/functions/english.cpp
magicseteditor_SOURCES += ./src/util/spec_sort.cpp magicseteditor_SOURCES += ./src/script/functions/basic.cpp
magicseteditor_SOURCES += ./src/main.cpp magicseteditor_SOURCES += ./src/script/functions/export.cpp
magicseteditor_SOURCES += ./src/script/functions/editor.cpp
magicseteditor_SOURCES += ./src/script/parser.cpp
magicseteditor_SOURCES += ./src/script/value.cpp
magicseteditor_SOURCES += ./src/script/scriptable.cpp
magicseteditor_SOURCES += ./src/script/context.cpp
magicseteditor_SOURCES += ./src/code_template.cpp magicseteditor_SOURCES += ./src/code_template.cpp
+592 -556
View File
File diff suppressed because it is too large Load Diff

Before

Width:  |  Height:  |  Size: 7.3 KiB

After

Width:  |  Height:  |  Size: 7.3 KiB

+6 -6
View File
@@ -1,4 +1,4 @@
//+----------------------------------------------------------------------------+ // //+----------------------------------------------------------------------------+
//| Description: Magic Set Editor - Program to make Magic (tm) cards | //| Description: Magic Set Editor - Program to make Magic (tm) cards |
//| Copyright: (C) 2001 - 2007 Twan van Laarhoven | //| Copyright: (C) 2001 - 2007 Twan van Laarhoven |
//| License: GNU General Public License 2 or later (see file COPYING) | //| License: GNU General Public License 2 or later (see file COPYING) |
@@ -131,7 +131,7 @@ inline bool is_set(const Scriptable<double>& x) {
return x.isScripted() || x < 100000; return x.isScripted() || x < 100000;
} }
inline bool is_setw(const Scriptable<double>& x) { inline bool is_setw(const Scriptable<double>& x) {
return x.isScripted() || abs(x) > 0.001; return x.isScripted() || fabs(x) > 0.001;
} }
int Style::update(Context& ctx) { int Style::update(Context& ctx) {
@@ -187,11 +187,11 @@ int Style::update(Context& ctx) {
bool Style::isVisible() const { bool Style::isVisible() const {
return visible return visible
&& (width) > 0 && (width) > 0
&& abs(left) < 100000 && fabs(left) < 100000
&& abs(right) < 100000 && fabs(right) < 100000
&& (height) > 0 && (height) > 0
&& abs(top) < 100000 && fabs(top) < 100000
&& abs(bottom) < 100000; && fabs(bottom) < 100000;
} }
bool Style::hasSize() const { bool Style::hasSize() const {
int h = is_setw(width) + is_set(left) + is_set(right); int h = is_setw(width) + is_set(left) + is_set(right);
-17
View File
@@ -18,10 +18,6 @@ DEFINE_EVENT_TYPE(EVENT_GALLERY_ACTIVATE);
// ----------------------------------------------------------------------------- : GalleryList // ----------------------------------------------------------------------------- : GalleryList
const int MARGIN = 1; // margin between items (excluding border)
const int BORDER = 1; // border aroung items
const int SPACING = MARGIN + 2*BORDER; // distance between items
GalleryList::GalleryList(Window* parent, int id, int direction, bool always_focused) GalleryList::GalleryList(Window* parent, int id, int direction, bool always_focused)
: wxPanel(parent, id, wxDefaultPosition, wxDefaultSize, wxSUNKEN_BORDER | wxWANTS_CHARS | (direction == wxHORIZONTAL ? wxHSCROLL : wxVSCROLL) ) : wxPanel(parent, id, wxDefaultPosition, wxDefaultSize, wxSUNKEN_BORDER | wxWANTS_CHARS | (direction == wxHORIZONTAL ? wxHSCROLL : wxVSCROLL) )
, selection(NO_SELECTION) , selection(NO_SELECTION)
@@ -72,19 +68,6 @@ wxPoint GalleryList::itemPos(size_t item) const {
// ----------------------------------------------------------------------------- : Scrolling & sizing // ----------------------------------------------------------------------------- : Scrolling & sizing
int GalleryList::visibleEnd() const {
return visible_start + mainSize(GetClientSize());
}
int GalleryList::itemStart(size_t item) const {
return (int)item * (mainSize(item_size) + SPACING);
}
int GalleryList::itemEnd(size_t item) const {
return (int)(item + 1) * (mainSize(item_size) + SPACING) + MARGIN;
}
int GalleryList::mainSize(wxSize s) const {
return direction == wxHORIZONTAL ? s.x : s.y;
}
void GalleryList::scrollTo(int top, bool update_scrollbar) { void GalleryList::scrollTo(int top, bool update_scrollbar) {
wxSize cs = GetClientSize(); wxSize cs = GetClientSize();
int total_height = itemEnd(itemCount() - 1); int total_height = itemEnd(itemCount() - 1);
+19 -7
View File
@@ -73,25 +73,37 @@ class GalleryList : public wxPanel {
wxPoint itemPos(size_t item) const; wxPoint itemPos(size_t item) const;
/// Scroll to the given position (note: 'top' can also mean 'left') /// Scroll to the given position (note: 'top' can also mean 'left')
void GalleryList::scrollTo(int top, bool update_scrollbar = true); void scrollTo(int top, bool update_scrollbar = true);
/// Update the scrollbar(s) /// Update the scrollbar(s)
void GalleryList::updateScrollbar(); void updateScrollbar();
/// Redraw just a single item /// Redraw just a single item
void GalleryList::RefreshItem(size_t item); void RefreshItem(size_t item);
/// First visible pixel position /// First visible pixel position
int visible_start; int visible_start;
/// First no-longer-visible pixel position /// First no-longer-visible pixel position
inline int GalleryList::visibleEnd() const; inline int visibleEnd() const {
return visible_start + mainSize(GetClientSize());
}
/// Pixel position of an item /// Pixel position of an item
inline int GalleryList::itemStart(size_t item) const; inline int itemStart(size_t item) const {
inline int GalleryList::itemEnd(size_t item) const; return (int)item * (mainSize(item_size) + SPACING);
}
inline int itemEnd(size_t item) const {
return (int)(item + 1) * (mainSize(item_size) + SPACING) + MARGIN;
}
/// Main component of a size (i.e. in the direction of this list) /// Main component of a size (i.e. in the direction of this list)
inline int GalleryList::mainSize(wxSize s) const; inline int mainSize(wxSize s) const {
return direction == wxHORIZONTAL ? s.x : s.y;
}
protected: protected:
/// Send an event /// Send an event
void sendEvent(WXTYPE type); void sendEvent(WXTYPE type);
static const int MARGIN = 1; // margin between items (excluding border)
static const int BORDER = 1; // border aroung items
static const int SPACING = MARGIN + 2*BORDER; // distance between items
}; };
// ----------------------------------------------------------------------------- : EOF // ----------------------------------------------------------------------------- : EOF
+2 -2
View File
@@ -225,10 +225,10 @@ void TreeList::onChar(wxKeyEvent& ev) {
} }
} }
break; break;
} case WXK_PAGEUP: case WXK_PRIOR: { } case WXK_PAGEUP: {
ScrollToLine(first_line > visible_lines_t ? first_line - visible_lines_t : 0); ScrollToLine(first_line > visible_lines_t ? first_line - visible_lines_t : 0);
break; break;
} case WXK_PAGEDOWN: case WXK_NEXT: { } case WXK_PAGEDOWN: {
ScrollToLine(first_line + visible_lines_t); ScrollToLine(first_line + visible_lines_t);
break; break;
} case WXK_HOME: { } case WXK_HOME: {
+2 -2
View File
@@ -57,7 +57,7 @@ ImagesExportWindow::ImagesExportWindow(Window* parent, const SetP& set)
// ----------------------------------------------------------------------------- : Exporting the images // ----------------------------------------------------------------------------- : Exporting the images
void ExportCardImages::export(const SetP& set, wxFileName& fn, const String& filename_template, FilenameConflicts conflicts) { void ExportCardImages::exportImages(const SetP& set, wxFileName& fn, const String& filename_template, FilenameConflicts conflicts) {
// Script // Script
ScriptP filename_script = parse(filename_template, nullptr, true); ScriptP filename_script = parse(filename_template, nullptr, true);
// Export // Export
@@ -116,7 +116,7 @@ void ImagesExportWindow::onOk(wxCommandEvent&) {
if (name.empty()) return; if (name.empty()) return;
wxFileName fn(name); wxFileName fn(name);
// Export // Export
export(set, fn, gs.images_export_filename, gs.images_export_conflicts); exportImages(set, fn, gs.images_export_filename, gs.images_export_conflicts);
// Done // Done
EndModal(wxID_OK); EndModal(wxID_OK);
} }
+2 -1
View File
@@ -19,7 +19,8 @@ class wxFileName;
/// Export the cards in a set /// Export the cards in a set
class ExportCardImages { class ExportCardImages {
public: public:
void export(const SetP& set, wxFileName& filename, const String& filename_template, FilenameConflicts conflicts); void exportImages(const SetP& set, wxFileName& filename, const String& filename_template, FilenameConflicts conflicts);
virtual ~ExportCardImages() {}
protected: protected:
virtual bool exportCard(const CardP& card) const { return true; } virtual bool exportCard(const CardP& card) const { return true; }
}; };
+2 -1
View File
@@ -606,7 +606,8 @@ void PackagesWindow::onOk(wxCommandEvent& ev) {
packages.install(*ip); packages.install(*ip);
} }
// Done // Done
wxDialog::OnOK(ev); // Continue event propagation into the dialog window so that it closes.
ev.Skip();
} }
void PackagesWindow::onUpdateUI(wxUpdateUIEvent& ev) { void PackagesWindow::onUpdateUI(wxUpdateUIEvent& ev) {
+2 -2
View File
@@ -174,8 +174,8 @@ int MSE::OnRun() {
} }
wxFileName fn(path); wxFileName fn(path);
// export // export
ExportCardImages export; ExportCardImages exporter;
export.export(set, fn, out, CONFLICT_NUMBER_OVERWRITE); exporter.exportImages(set, fn, out, CONFLICT_NUMBER_OVERWRITE);
return EXIT_SUCCESS; return EXIT_SUCCESS;
} else { } else {
handle_error(_("Invalid command line argument:\n") + String(argv[1])); handle_error(_("Invalid command line argument:\n") + String(argv[1]));
+4 -5
View File
@@ -17,7 +17,6 @@
// ----------------------------------------------------------------------------- : AtomicInt : windows // ----------------------------------------------------------------------------- : AtomicInt : windows
#if defined(__WXMSW__) #if defined(__WXMSW__)
#ifdef _MSC_VER #ifdef _MSC_VER
extern "C" { extern "C" {
LONG __cdecl _InterlockedIncrement(LONG volatile *Addend); LONG __cdecl _InterlockedIncrement(LONG volatile *Addend);
@@ -61,16 +60,16 @@
typedef unsigned int AtomicIntEquiv; typedef unsigned int AtomicIntEquiv;
/// An integer that can be incremented and decremented atomicly /// An integer that can be incremented and decremented atomicly
class AtomicIntEquiv { class AtomicInt {
public: public:
AtomicIntEquiv(AtomicIntEquiv v) : v(v) {} AtomicInt(AtomicIntEquiv v) : v(v) {}
inline operator AtomicIntEquiv() const { inline operator AtomicIntEquiv() const {
return v; return v;
} }
inline AtomicIntEquiv operator ++ () { inline AtomicInt operator ++ () {
return __sync_add_and_fetch(&v,1); return __sync_add_and_fetch(&v,1);
} }
inline AtomicIntEquiv operator -- () { inline AtomicInt operator -- () {
return __sync_add_and_fetch(&v,(AtomicIntEquiv)-1); return __sync_add_and_fetch(&v,(AtomicIntEquiv)-1);
} }
private: private:
+9 -6
View File
@@ -149,6 +149,9 @@ inline shared_ptr<T> new_shared9(const A0& a0, const A1& a1, const A2& a2, const
// ----------------------------------------------------------------------------- : Intrusive pointer base // ----------------------------------------------------------------------------- : Intrusive pointer base
template <typename T> class IntrusivePtrBase;
template <typename T> void intrusive_ptr_add_ref(IntrusivePtrBase<T>*);
template <typename T> void intrusive_ptr_release(IntrusivePtrBase<T>*);
/// Base class for objects wishing to use intrusive_ptrs. /// Base class for objects wishing to use intrusive_ptrs.
/** There is no implicit virtual destructor, objects are destructed as type T /** There is no implicit virtual destructor, objects are destructed as type T
* Usage: * Usage:
@@ -171,19 +174,19 @@ inline shared_ptr<T> new_shared9(const A0& a0, const A1& a1, const A2& a2, const
} }
private: private:
AtomicInt ref_count; AtomicInt ref_count;
template <typename T> friend void intrusive_ptr_add_ref(IntrusivePtrBase*); friend void intrusive_ptr_add_ref <> (IntrusivePtrBase*);
template <typename T> friend void intrusive_ptr_release(IntrusivePtrBase*); friend void intrusive_ptr_release <> (IntrusivePtrBase*);
}; };
template <typename T> inline void intrusive_ptr_add_ref(IntrusivePtrBase<T>* p) { template <typename T> void intrusive_ptr_add_ref(IntrusivePtrBase<T>* p) {
++p->ref_count; ++(p->ref_count);
} }
template <typename T> inline void intrusive_ptr_release(IntrusivePtrBase<T>* p) {
template <typename T> void intrusive_ptr_release(IntrusivePtrBase<T>* p) {
if (--p->ref_count == 0) { if (--p->ref_count == 0) {
static_cast<T*>(p)->destroy(); static_cast<T*>(p)->destroy();
} }
} }
// ----------------------------------------------------------------------------- : Intrusive pointer base : virtual // ----------------------------------------------------------------------------- : Intrusive pointer base : virtual
/// IntrusivePtrBase with a virtual destructor /// IntrusivePtrBase with a virtual destructor