diff --git a/src/code_template.cpp b/src/code_template.cpp new file mode 100644 index 00000000..86173366 --- /dev/null +++ b/src/code_template.cpp @@ -0,0 +1,11 @@ +//+----------------------------------------------------------------------------+ +//| Description: Magic Set Editor - Program to make Magic (tm) cards | +//| Copyright: (C) 2001 - 2006 Twan van Laarhoven | +//| License: GNU General Public License 2 or later (see file COPYING) | +//+----------------------------------------------------------------------------+ + +// ----------------------------------------------------------------------------- : Includes + +#include + +// ----------------------------------------------------------------------------- : diff --git a/src/code_template.hpp b/src/code_template.hpp new file mode 100644 index 00000000..d18fcb67 --- /dev/null +++ b/src/code_template.hpp @@ -0,0 +1,18 @@ +//+----------------------------------------------------------------------------+ +//| Description: Magic Set Editor - Program to make Magic (tm) cards | +//| Copyright: (C) 2001 - 2006 Twan van Laarhoven | +//| License: GNU General Public License 2 or later (see file COPYING) | +//+----------------------------------------------------------------------------+ + +#ifndef HEADER_ +#define HEADER_ + +// ----------------------------------------------------------------------------- : Includes + +#include + +// ----------------------------------------------------------------------------- : + + +// ----------------------------------------------------------------------------- : EOF +#endif diff --git a/src/data/action/symbol.hpp b/src/data/action/symbol.hpp index 3ab1977d..e06a0001 100644 --- a/src/data/action/symbol.hpp +++ b/src/data/action/symbol.hpp @@ -40,11 +40,11 @@ class SymbolPartMoveAction : public SymbolPartAction { void move(const Vector2D& delta); private: - set parts; //^ Parts to move - Vector2D delta; //^ How much to move - Vector2D moved; //^ How much has been moved + set parts; ///< Parts to move + Vector2D delta; ///< How much to move + Vector2D moved; ///< How much has been moved public: - bool constrain; //^ Constrain movement? + bool constrain; ///< Constrain movement? }; // ----------------------------------------------------------------------------- : Rotating symbol parts @@ -61,8 +61,8 @@ class SymbolPartMatrixAction : public SymbolPartAction { /// Perform the transformation using the given matrix void transform(const Vector2D& mx, const Vector2D& my); - set parts; //^ Parts to transform - Vector2D center; //^ Center to transform around + set parts; ///< Parts to transform + Vector2D center; ///< Center to transform around }; /// Rotate some symbol parts @@ -80,9 +80,9 @@ class SymbolPartRotateAction : public SymbolPartMatrixAction { void rotateBy(double deltaAngle); private: - double angle; //^ How much to rotate? + double angle; ///< How much to rotate? public: - bool constrain; //^ Constrain movement? + bool constrain; ///< Constrain movement? }; @@ -100,10 +100,10 @@ class SymbolPartShearAction : public SymbolPartMatrixAction { void move(const Vector2D& deltaShear); private: - Vector2D shear; //^ Shearing, shear.x == 0 || shear.y == 0 + Vector2D shear; ///< Shearing, shear.x == 0 || shear.y == 0 void shearBy(const Vector2D& shear); public: - bool constrain; //^ Constrain movement? + bool constrain; ///< Constrain movement? }; @@ -123,11 +123,11 @@ class SymbolPartScaleAction : public SymbolPartAction { void update(); private: - set parts; //^ Parts to scale - Vector2D oldMin, oldSize; //^ the original pos/size - Vector2D newRealMin, newRealSize; //^ the target pos/sizevoid shearBy(const Vector2D& shear) - Vector2D newMin, newSize; //^ the target pos/size after applying constrains - int scaleX, scaleY; //^ to what corner are we attached? + set parts; ///< Parts to scale + Vector2D oldMin, oldSize; ///< the original pos/size + Vector2D newRealMin, newRealSize; ///< the target pos/sizevoid shearBy(const Vector2D& shear) + Vector2D newMin, newSize; ///< the target pos/size after applying constrains + int scaleX, scaleY; ///< to what corner are we attached? /// Transform everything in the parts void transformAll(); /// Transform a single vector @@ -135,7 +135,7 @@ class SymbolPartScaleAction : public SymbolPartAction { return (v - oldMin).div(oldSize).mul(newSize) + newMin; } public: - bool constrain; //^ Constrain movement? + bool constrain; ///< Constrain movement? }; // ----------------------------------------------------------------------------- : Change combine mode @@ -149,7 +149,7 @@ class CombiningModeAction : public SymbolPartListAction { virtual void perform(bool toUndo); private: - vector > parts; //^ Affected parts with new combining modes + vector > parts; ///< Affected parts with new combining modes }; // ----------------------------------------------------------------------------- : Change name @@ -163,14 +163,13 @@ class SymbolPartNameAction : public SymbolPartListAction { virtual void perform(bool toUndo); private: - SymbolPartP part; //^ Affected part - String partName; //^ New name + SymbolPartP part; ///< Affected part + String partName; ///< New name }; // ----------------------------------------------------------------------------- : Add symbol part -/// Adding a part to a symbol, added at the front of the list -/// front = drawn on top +/// Adding a part to a symbol, added at the front of the list (drawn on top) class AddSymbolPartAction : public SymbolPartListAction { public: AddSymbolPartAction(Symbol& symbol, const SymbolPartP& part); @@ -179,8 +178,8 @@ class AddSymbolPartAction : public SymbolPartListAction { virtual void perform(bool toUndo); private: - Symbol& symbol; //^ Symbol to add the part to - SymbolPartP part; //^ Part to add + Symbol& symbol; ///< Symbol to add the part to + SymbolPartP part; ///< Part to add }; // ----------------------------------------------------------------------------- : Remove symbol part @@ -221,8 +220,7 @@ class DuplicateSymbolPartsAction : public SymbolPartListAction { // ----------------------------------------------------------------------------- : Reorder symbol parts -/// Change the position of a part in a symbol. -/// This is done by swapping two parts. +/// Change the position of a part in a symbol, by swapping two parts. class ReorderSymbolPartsAction : public SymbolPartListAction { public: ReorderSymbolPartsAction(Symbol& symbol, size_t partId1, size_t partId2); @@ -231,9 +229,9 @@ class ReorderSymbolPartsAction : public SymbolPartListAction { virtual void perform(bool toUndo); private: - Symbol& symbol; //^ Symbol to swap the parts in + Symbol& symbol; ///< Symbol to swap the parts in public: - size_t partId1, partId2; //^ Indeces of parts to swap + size_t partId1, partId2; ///< Indeces of parts to swap }; diff --git a/src/data/action/symbol_part.cpp b/src/data/action/symbol_part.cpp index 5875e946..5379fc53 100644 --- a/src/data/action/symbol_part.cpp +++ b/src/data/action/symbol_part.cpp @@ -253,8 +253,8 @@ class SinglePointRemoveAction : public Action { private: SymbolPartP part; UInt position; - ControlPointP point; //^ Removed point - ControlPointUpdate point1, point2; //^ Points before/after + ControlPointP point; ///< Removed point + ControlPointUpdate point1, point2; ///< Points before/after }; SinglePointRemoveAction::SinglePointRemoveAction(const SymbolPartP& part, UInt position) @@ -327,9 +327,9 @@ DECLARE_POINTER_TYPE(SinglePointRemoveAction); DECLARE_TYPEOF_COLLECTION(SinglePointRemoveActionP); -/// Remove a set of points from a symbol part -/// Internally represented as a list of Single Point Remove Actions -/// Not all points mat be removed, at least two points must remain +// Remove a set of points from a symbol part. +// Internally represented as a list of Single Point Remove Actions. +// Not all points mat be removed, at least two points must remain. class ControlPointRemoveAction : public Action { public: ControlPointRemoveAction(const SymbolPartP& part, const set& toDelete); diff --git a/src/data/action/symbol_part.hpp b/src/data/action/symbol_part.hpp index d0f1e637..984be169 100644 --- a/src/data/action/symbol_part.hpp +++ b/src/data/action/symbol_part.hpp @@ -38,11 +38,11 @@ class ControlPointMoveAction : public Action { void move(const Vector2D& delta); private: - set points; //^ Points to move - vector oldValues; //^ Their old positions - Vector2D delta; //^ Amount we moved + set points; ///< Points to move + vector oldValues; ///< Their old positions + Vector2D delta; ///< Amount we moved public: - bool constrain; //^ Constrain movement? + bool constrain; ///< Constrain movement? }; // ----------------------------------------------------------------------------- : Move handle @@ -59,12 +59,12 @@ class HandleMoveAction : public Action { void move(const Vector2D& delta); private: - SelectedHandle handle; //^ The handle to move - Vector2D oldHandle; //^ Old value of this handle - Vector2D oldOther; //^ Old value of other handle, needed for contraints - Vector2D delta; //^ Amount we moved + SelectedHandle handle; ///< The handle to move + Vector2D oldHandle; ///< Old value of this handle + Vector2D oldOther; ///< Old value of other handle, needed for contraints + Vector2D delta; ///< Amount we moved public: - bool constrain; //^ Constrain movement? + bool constrain; ///< Constrain movement? }; // ----------------------------------------------------------------------------- : Segment mode @@ -108,7 +108,7 @@ class LockModeAction : public Action { virtual void perform(bool toUndo); private: - ControlPointUpdate point; //^ The affected point + ControlPointUpdate point; ///< The affected point }; // ----------------------------------------------------------------------------- : Move curve @@ -141,10 +141,10 @@ class ControlPointAddAction : public Action { inline ControlPointP getNewPoint() const { return newPoint; } private: - SymbolPartP part; //^ SymbolPart we are in - ControlPointP newPoint; //^ The point to insert - UInt insertAfter; //^ Insert after index .. in the array - ControlPointUpdate point1, point2; //^ Update the points around the new point + SymbolPartP part; ///< SymbolPart we are in + ControlPointP newPoint; ///< The point to insert + UInt insertAfter; ///< Insert after index .. in the array + ControlPointUpdate point1, point2; ///< Update the points around the new point }; // ----------------------------------------------------------------------------- : Remove control point diff --git a/src/data/symbol.hpp b/src/data/symbol.hpp index 231d516b..84745533 100644 --- a/src/data/symbol.hpp +++ b/src/data/symbol.hpp @@ -26,9 +26,9 @@ DECLARE_TYPEOF_COLLECTION(SymbolPartP); /** Specificly: the relation between deltaBefore and deltaAfter */ enum LockMode -{ LOCK_FREE //^ no locking -, LOCK_DIR //^ deltaBefore = x * deltaAfter -, LOCK_SIZE //^ deltaBefore = -deltaAfter +{ LOCK_FREE ///< no locking +, LOCK_DIR ///< deltaBefore = x * deltaAfter +, LOCK_SIZE ///< deltaBefore = -deltaAfter }; /// Is the segment between two ControlPoints a line or a curve? @@ -39,7 +39,7 @@ enum SegmentMode /// To refer to a specific handle of a control point enum WhichHandle -{ HANDLE_NONE = 0 //^ point is not selected +{ HANDLE_NONE = 0 ///< point is not selected , HANDLE_MAIN , HANDLE_BEFORE , HANDLE_AFTER @@ -48,9 +48,9 @@ enum WhichHandle /// A control point (corner) of a SymbolPart (polygon/bezier-gon) class ControlPoint { public: - Vector2D pos; //^ position of the control point itself - Vector2D deltaBefore; //^ delta to bezier control point, for curve before point - Vector2D deltaAfter; //^ delta to bezier control point, for curve after point + Vector2D pos; ///< position of the control point itself + Vector2D deltaBefore; ///< delta to bezier control point, for curve before point + Vector2D deltaAfter; ///< delta to bezier control point, for curve after point SegmentMode segmentBefore, segmentAfter; LockMode lock; @@ -80,8 +80,8 @@ class ControlPoint { /// A specific handle of a ControlPoint class SelectedHandle { public: - ControlPointP point; //^ the selected point - WhichHandle handle; //^ the selected handle of the point + ControlPointP point; ///< the selected point + WhichHandle handle; ///< the selected handle of the point // SelectedHandle SelectedHandle() : handle(HANDLE_NONE) {} diff --git a/src/gfx/gfx.hpp b/src/gfx/gfx.hpp index bd66863c..ac92cf6f 100644 --- a/src/gfx/gfx.hpp +++ b/src/gfx/gfx.hpp @@ -101,9 +101,9 @@ void drawCombineImage(DC& dc, UInt x, UInt y, const Image& img, ImageCombine com // ----------------------------------------------------------------------------- : Utility -inline int bot(int x) { return max(0, x); } //^ bottom range check for color values -inline int top(int x) { return min(255, x); } //^ top range check for color values -inline int col(int x) { return top(bot(x)); } //^ top and bottom range check for color values +inline int bot(int x) { return max(0, x); } ///< bottom range check for color values +inline int top(int x) { return min(255, x); } ///< top range check for color values +inline int col(int x) { return top(bot(x)); } ///< top and bottom range check for color values // ----------------------------------------------------------------------------- : EOF #endif diff --git a/src/gui/icon_menu.cpp b/src/gui/icon_menu.cpp new file mode 100644 index 00000000..258fc82e --- /dev/null +++ b/src/gui/icon_menu.cpp @@ -0,0 +1,77 @@ +//+----------------------------------------------------------------------------+ +//| Description: Magic Set Editor - Program to make Magic (tm) cards | +//| Copyright: (C) 2001 - 2006 Twan van Laarhoven | +//| License: GNU General Public License 2 or later (see file COPYING) | +//+----------------------------------------------------------------------------+ + +// ----------------------------------------------------------------------------- : Includes + +#include "icon_menu.hpp" + +// ----------------------------------------------------------------------------- : generateDisabledImage + +// Generate an image to use for the disabled state of menu items +Image generateDisabledImage(const Image& imgIn) { + // Some system colors + Color trans(1,2,3); // mask color used by bitmaps as 'transparent' + Color light = wxSystemSettings::GetColour(wxSYS_COLOUR_3DHIGHLIGHT); + Color shadow = wxSystemSettings::GetColour(wxSYS_COLOUR_3DSHADOW); + // generate disabled bitmap + Image imgOut(16, 16); + imgOut.SetMaskColour(1,2,3); + Byte *in = imgIn.GetData(), *out = imgOut.GetData(); + // For each pixel... + for (int y = 0 ; y < 16 ; ++y) { + for (int x = 0 ; x < 16 ; ++x) { + // is the pixel mask color or white? + Color in1 = trans, in2 = trans; + if (x<15 && y<15) in1 = Color(in[0], in[1], in[2]); + // and the pixel to the left+up? + if (x>0 && y>0 ) in2 = Color(in[0 - 3*17], in[1 - 3*17], in[2 - 3*17]); + // determine output color + Color col; + if (in1 != trans && in1 != light) col = shadow; + else if (in2 != trans && in2 != light) col = light; + else col = trans; + out[0] = col.Red(); + out[1] = col.Green(); + out[2] = col.Blue(); + in += 3; + out += 3; + } + } + return imgOut; +} + + +// ----------------------------------------------------------------------------- : IconMenu + +void IconMenu::Append(int id, const String& resource, const String& text, const String& help, int style, wxMenu* submenu) { + // load bitmap + Bitmap bitmap(resource); + bitmap = bitmap.GetSubBitmap(wxRect(0,0,16,16)); + Image disabledImage = generateDisabledImage(bitmap.ConvertToImage()); + // add menu item + wxMenuItem* item = new wxMenuItem(this, id, text, help, style, submenu); + item->SetBitmaps(bitmap, bitmap); + item->SetDisabledBitmap(disabledImage); + wxMenu::Append(item); +} + +void IconMenu::Append(int id, const String& text, const String& help) { + wxMenuItem* item = new wxMenuItem (this, id, text, help); + item->SetBitmap(wxNullBitmap); + wxMenu::Append(item); +} + +void IconMenu::Append(int id, const String& text, wxMenu* submenu, const String& help) { + wxMenuItem* item = new wxMenuItem (this, id, text, help, wxITEM_NORMAL, submenu); + item->SetBitmap(wxNullBitmap); + wxMenu::Append(item); +} + +void IconMenu::Insert(size_t pos, int id, const String& text, const String& help) { + wxMenuItem* item = new wxMenuItem (this, id, text, help); + item->SetBitmap(wxNullBitmap); + wxMenu::Insert(pos, item); +} diff --git a/src/gui/icon_menu.hpp b/src/gui/icon_menu.hpp new file mode 100644 index 00000000..dd8eae6e --- /dev/null +++ b/src/gui/icon_menu.hpp @@ -0,0 +1,35 @@ +//+----------------------------------------------------------------------------+ +//| Description: Magic Set Editor - Program to make Magic (tm) cards | +//| Copyright: (C) 2001 - 2006 Twan van Laarhoven | +//| License: GNU General Public License 2 or later (see file COPYING) | +//+----------------------------------------------------------------------------+ + +#ifndef HEADER_GUI_ICON_MENU +#define HEADER_GUI_ICON_MENU + +// ----------------------------------------------------------------------------- : Includes + +#include "../util/prec.hpp" + +// ----------------------------------------------------------------------------- : IconMenu + +/// Helper class for menus with icons +/** This class functions just like a normal wxMenu. + * The difference is that Append takes an extra parameter: + * the resource name of the bitmap to use. + * Bitmaps are resized (cut) to 16x16 pixels. + */ +class IconMenu : public wxMenu { + public: + /// Append a menu item, with an image (loaded from a resource) + void Append(int id, const String& resource, const String& text, const String& help, int style = wxITEM_NORMAL, wxMenu* submenu = nullptr); + /// Append a menu item, without an image + void Append(int id, const String& text, const String& help); + /// Append a menu item, without an image + void Append(int id, const String& text, wxMenu* submenu, const String& help); + /// Insert a menu item, without an image + void Insert(size_t pos, int id, const String& text, const String& help); +}; + +// ----------------------------------------------------------------------------- : EOF +#endif diff --git a/src/gui/symbol/point_editor.hpp b/src/gui/symbol/point_editor.hpp index fdca6037..09ff6932 100644 --- a/src/gui/symbol/point_editor.hpp +++ b/src/gui/symbol/point_editor.hpp @@ -43,11 +43,11 @@ class SymbolPointEditor : public SymbolEditorBase { void drawHandleCircle(DC& dc, UInt px, UInt py); enum WhichPen { - PEN_NORMAL, //^ Pen for normal handles - PEN_HOVER, //^ Pen for hovered handles - PEN_LINE, //^ Pen for the line to handles - PEN_MAIN, //^ Pen for the main handle - PEN_NEW_POINT //^ Pen for the new point + PEN_NORMAL, ///< Pen for normal handles + PEN_HOVER, ///< Pen for hovered handles + PEN_LINE, ///< Pen for the line to handles + PEN_MAIN, ///< Pen for the main handle + PEN_NEW_POINT ///< Pen for the new point }; /// Retrieve a pen for the drawing of parts of handles wxPen handlePen(WhichPen p, LockMode lock); @@ -91,11 +91,11 @@ class SymbolPointEditor : public SymbolEditorBase { // Selection enum Selection { - SELECTED_NONE, //^ no selection - SELECTED_POINTS, //^ some points are selected - SELECTED_HANDLE, //^ a handle is selected - SELECTED_LINE, //^ a line is selected - SELECTED_NEW_POINT //^ a new point on a line (used for hovering) + SELECTED_NONE, ///< no selection + SELECTED_POINTS, ///< some points are selected + SELECTED_HANDLE, ///< a handle is selected + SELECTED_LINE, ///< a line is selected + SELECTED_NEW_POINT ///< a new point on a line (used for hovering) }; Selection selection; // points diff --git a/src/gui/symbol/viewer.hpp b/src/gui/symbol/viewer.hpp index 9f4dd11b..b5531fee 100644 --- a/src/gui/symbol/viewer.hpp +++ b/src/gui/symbol/viewer.hpp @@ -32,7 +32,7 @@ class SymbolViewer : public SymbolView { // --------------------------------------------------- : Point translation - Rotation rotation; //^ Object that handles rotation, scaling and translation + Rotation rotation; ///< Object that handles rotation, scaling and translation // --------------------------------------------------- : Drawing diff --git a/src/gui/symbol/window.hpp b/src/gui/symbol/window.hpp index d4fa2244..807a9dba 100644 --- a/src/gui/symbol/window.hpp +++ b/src/gui/symbol/window.hpp @@ -35,8 +35,8 @@ class SymbolWindow : public Frame { /// Actual initialisation void init(Window* parent, SymbolP symbol); - SymbolControl* control; //^ The control for editing/displaying the symbol - SymbolPartList* parts; //^ A list of parts in the symbol + SymbolControl* control; ///< The control for editing/displaying the symbol + SymbolPartList* parts; ///< A list of parts in the symbol // when editing a symbol field // SymbolValueP value @@ -65,7 +65,7 @@ class SymbolWindow : public Frame { /// Activating a part: open the point editor void onActivateFromList(wxListEvent& ev); - bool inSelectionEvent; //^ Prevent recursion in onSelect... + bool inSelectionEvent; ///< Prevent recursion in onSelect... public: void onSelectFromControl(); diff --git a/src/main.cpp b/src/main.cpp new file mode 100644 index 00000000..dd4fcd9d --- /dev/null +++ b/src/main.cpp @@ -0,0 +1,50 @@ +//+----------------------------------------------------------------------------+ +//| Description: Magic Set Editor - Program to make Magic (tm) cards | +//| Copyright: (C) 2001 - 2006 Twan van Laarhoven | +//| License: GNU General Public License 2 or later (see file COPYING) | +//+----------------------------------------------------------------------------+ + +// ----------------------------------------------------------------------------- : Includes + +#include "util/prec.hpp" +#include + +// ----------------------------------------------------------------------------- : Main function/class + +/// The application class for MSE. +/** This class is used by wxWidgets as a kind of 'main function' + */ +class MSE : public wxApp { + public: + /// Main startup function of the program + bool OnInit(); + /// On exit: write the settings to the config file + int OnExit(); + /// On exception: display error message + bool OnExceptionInMainLoop(); +}; + +IMPLEMENT_APP(MSE) + +// ----------------------------------------------------------------------------- : Initialization + +bool MSE::OnInit() { + wxInitAllImageHandlers(); + //initFileFilters() + Window* wnd = new SymbolWindow(0); + wnd->Show(); + return true; +} + +// ----------------------------------------------------------------------------- : Exit + +int MSE::OnExit() { +// settings.write(); + return 0; +} + +// ----------------------------------------------------------------------------- : Exception handling + +bool MSE::OnExceptionInMainLoop() { + return true; +} diff --git a/src/mse.vcproj b/src/mse.vcproj index a483a613..91423a94 100644 --- a/src/mse.vcproj +++ b/src/mse.vcproj @@ -347,6 +347,12 @@ + + + + Elem##_IT(Collection.rbegin(), true) ; \ Elem##_IT.first != Collection.rend() ; \ @@ -139,8 +147,9 @@ Elem##_IT.second = false) /// Iterate over two collection in parallel -/// Usage: FOR_EACH_2_T(TypeIt1,TypeElem1,e1,collect1,TypeIt2,TypeElem2,e2,collect2) { body-of-loop } -/** Note: This has got to be one of the craziest pieces of code I have ever written :) +/** Usage: FOR_EACH_2_T(TypeIt1,TypeElem1,e1,collect1,TypeIt2,TypeElem2,e2,collect2) { body-of-loop } + * + * 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) \ @@ -157,9 +166,9 @@ 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 } +/// 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) \ FOR_EACH_2_T(TYPEOF_IT(Collection1), TYPEOF_REF(Collection1), Elem1, Collection1, \ TYPEOF_IT(Collection2), TYPEOF_REF(Collection2), Elem2, Collection2) diff --git a/src/util/io/reader.hpp b/src/util/io/reader.hpp index 25043289..2d597db0 100644 --- a/src/util/io/reader.hpp +++ b/src/util/io/reader.hpp @@ -156,9 +156,9 @@ class EnumReader { inline bool isDone() const { return done; } private: - String read; //^ The string to match to a value name - bool first; //^ Has the first (default) value been matched? - bool done; //^ Was anything matched? + String read; ///< The string to match to a value name + bool first; ///< Has the first (default) value been matched? + bool done; ///< Was anything matched? }; // ----------------------------------------------------------------------------- : EOF diff --git a/src/util/io/writer.hpp b/src/util/io/writer.hpp index 86a8439c..fac5a288 100644 --- a/src/util/io/writer.hpp +++ b/src/util/io/writer.hpp @@ -124,7 +124,7 @@ class EnumWriter { } private: - Writer& writer; //^ The writer to write output to + Writer& writer; ///< The writer to write output to }; // ----------------------------------------------------------------------------- : EOF diff --git a/src/util/reflect.hpp b/src/util/reflect.hpp index 0be19806..6a6fd77a 100644 --- a/src/util/reflect.hpp +++ b/src/util/reflect.hpp @@ -9,7 +9,7 @@ /** @file util/reflect.hpp * - * Reflection of classes, currently reflection is used for (de)serialization. + * @brief Reflection of classes, currently reflection is used for (de)serialization. */ // ----------------------------------------------------------------------------- : Includes @@ -41,18 +41,18 @@ // ----------------------------------------------------------------------------- : Implementing reflection /// Implement the refelection of a class type Cls -/// Reflection allows the member variables of a class to be inspected at runtime. -/// -/// Currently creates the methods: -/// - Reader::handle(Cls&) -/// - Writer::handle(Cls&) -/** Usage: - * \begincode +/** Reflection allows the member variables of a class to be inspected at runtime. + * + * Currently creates the methods: + * - Reader::handle(Cls&) + * - Writer::handle(Cls&) + * Usage: + * @code * IMPLEMENT_REFLECTION(MyClass) { * REFLECT(a_variable_in_my_class); * REFLECT(another_variable_in_my_class); * } - * \endcode + * @endcode */ #define IMPLEMENT_REFLECTION(Cls) \ REFLECT_OBJECT_READER(Cls) \ @@ -80,12 +80,12 @@ /// Implement the refelection of a enumeration type Enum /** Usage: - * \begincode + * @code * IMPLEMENT_REFLECTION_ENUM(MyEnum) { * VALUE(value_of_enum_1); * VALUE(value_of_enum_2); * } - * \endcode + * @endcode * * When reading the first value declared is the default value * diff --git a/src/util/rotation.hpp b/src/util/rotation.hpp index 5f935009..d0405b5b 100644 --- a/src/util/rotation.hpp +++ b/src/util/rotation.hpp @@ -53,10 +53,10 @@ class Rotation { RealPoint trInv(const RealPoint& p) const; private: - int angle; //^ The angle of rotation in degrees (counterclockwise) - RealSize size; //^ Size of the rectangle, in external coordinates - RealPoint origin; //^ tr(0,0) - double zoom; //^ Zoom factor, zoom = 2.0 means that 1 internal = 2 external + int angle; ///< The angle of rotation in degrees (counterclockwise) + RealSize size; ///< Size of the rectangle, in external coordinates + RealPoint origin; ///< tr(0,0) + double zoom; ///< Zoom factor, zoom = 2.0 means that 1 internal = 2 external /// Is the rotation sideways (90 or 270 degrees)? // Note: angle & 2 == 0 for angle in {0, 180} and != 0 for angle in {90, 270) @@ -75,11 +75,11 @@ class Rotation { /// An object that changes a rotation RIIA style /** Usage: - * \begincode + * @code * Rotation a, b; * Rotater(a,b); * a.tr(x) // now acts as a.tr(b.tr(x)) - * \endcode + * @endcode */ class Rotater { /// Compose a rotation by onto the rotation rot diff --git a/src/util/smart_ptr.hpp b/src/util/smart_ptr.hpp index 4287c0e5..82eb461e 100644 --- a/src/util/smart_ptr.hpp +++ b/src/util/smart_ptr.hpp @@ -7,9 +7,9 @@ #ifndef HEADER_UTIL_SMART_PTR #define HEADER_UTIL_SMART_PTR -/** @file util/shared_ptr.hpp +/** @file util/smart_ptr.hpp * - * Utilities related to boost smart pointers + * @brief Utilities related to boost smart pointers */ // ----------------------------------------------------------------------------- : Includes diff --git a/src/util/string.hpp b/src/util/string.hpp index 6572b0f9..ba2bf05a 100644 --- a/src/util/string.hpp +++ b/src/util/string.hpp @@ -14,7 +14,6 @@ // ----------------------------------------------------------------------------- : Includes -#include "prec.hpp" #include "for_each.hpp" #include #include diff --git a/src/util/vector2d.cpp b/src/util/vector2d.cpp new file mode 100644 index 00000000..3c8c7e9c --- /dev/null +++ b/src/util/vector2d.cpp @@ -0,0 +1,12 @@ +//+----------------------------------------------------------------------------+ +//| Description: Magic Set Editor - Program to make Magic (tm) cards | +//| Copyright: (C) 2001 - 2006 Twan van Laarhoven | +//| License: GNU General Public License 2 or later (see file COPYING) | +//+----------------------------------------------------------------------------+ + +// ----------------------------------------------------------------------------- : Includes + +#include +#include "for_each.hpp" + +// ----------------------------------------------------------------------------- : IO