diff --git a/src/data/action/symbol_part.cpp b/src/data/action/symbol_part.cpp index 5379fc53..58f1e048 100644 --- a/src/data/action/symbol_part.cpp +++ b/src/data/action/symbol_part.cpp @@ -324,7 +324,6 @@ void SinglePointRemoveAction::perform(bool toUndo) { } DECLARE_POINTER_TYPE(SinglePointRemoveAction); -DECLARE_TYPEOF_COLLECTION(SinglePointRemoveActionP); // Remove a set of points from a symbol part. diff --git a/src/data/card.cpp b/src/data/card.cpp new file mode 100644 index 00000000..34492c5e --- /dev/null +++ b/src/data/card.cpp @@ -0,0 +1,36 @@ +//+----------------------------------------------------------------------------+ +//| 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 +#include +#include + +// ----------------------------------------------------------------------------- : Card + +IMPLEMENT_DYNAMIC_ARG(Game*, game_for_new_cards, nullptr); + +Card::Card() { + if (!game_for_new_cards()) { + throw InternalError(_("game_for_new_cards not set")); + } + data.init(game_for_new_cards()->cardFields); +} + +Card::Card(const Game& game) { + data.init(game.cardFields); +} + +String Card::identification() const { + return _("TODO"); +} + +IMPLEMENT_REFLECTION(Card) { + REFLECT(notes); +} + diff --git a/src/data/card.hpp b/src/data/card.hpp new file mode 100644 index 00000000..56314e1f --- /dev/null +++ b/src/data/card.hpp @@ -0,0 +1,53 @@ +//+----------------------------------------------------------------------------+ +//| 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_DATA_CARD +#define HEADER_DATA_CARD + +// ----------------------------------------------------------------------------- : Includes + +#include +#include +#include + +class Game; +DECLARE_POINTER_TYPE(Field); +DECLARE_POINTER_TYPE(Value); +DECLARE_POINTER_TYPE(CardStyle); + +// ----------------------------------------------------------------------------- : Card + +/// Game that is used for cards constructed with the default constructor +DECLARE_DYNAMIC_ARG(Game*, game_for_new_cards); + +/// A card from a card Set +class Card { + public: + /// Default constructor, uses game_for_new_cards to make the game + Card(); + /// Creates a card using the given game + Card(const Game& game); + + /// Get an identification of the card, an identification is something like a name, title, etc. + String identification() const; + + private: + /// The values on the fields of the card + /// The indices should correspond to the cardFields in the Game + IndexMap data; + + /// Notes for this card + String notes; + + /// Alternative style to use for this card + /// Optional, if not set use the card style from the set + CardStyleP style; + + DECLARE_REFLECTION(); +}; + +// ----------------------------------------------------------------------------- : EOF +#endif diff --git a/src/data/field.cpp b/src/data/field.cpp new file mode 100644 index 00000000..9d0c9aea --- /dev/null +++ b/src/data/field.cpp @@ -0,0 +1,16 @@ +//+----------------------------------------------------------------------------+ +//| 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 + +// ----------------------------------------------------------------------------- : Field +// ----------------------------------------------------------------------------- : Value + +void initObject(const FieldP& field, ValueP& value) { + value = new_shared(); +} diff --git a/src/data/field.hpp b/src/data/field.hpp new file mode 100644 index 00000000..35f6940a --- /dev/null +++ b/src/data/field.hpp @@ -0,0 +1,32 @@ +//+----------------------------------------------------------------------------+ +//| 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_DATA_FIELD +#define HEADER_DATA_FIELD + +// ----------------------------------------------------------------------------- : Includes + +#include + +#ifndef HEADER_DATA_CARD +DECLARE_POINTER_TYPE(Field); +DECLARE_POINTER_TYPE(Value); +#endif + +// ----------------------------------------------------------------------------- : Field + +class Field { + public: + UInt index; // used by IndexMap +}; + +class Value { +}; + +void initObject(const FieldP&, ValueP&); + +// ----------------------------------------------------------------------------- : EOF +#endif diff --git a/src/data/game.cpp b/src/data/game.cpp new file mode 100644 index 00000000..86cb241c --- /dev/null +++ b/src/data/game.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 + +// ----------------------------------------------------------------------------- : Game diff --git a/src/data/game.hpp b/src/data/game.hpp new file mode 100644 index 00000000..57538389 --- /dev/null +++ b/src/data/game.hpp @@ -0,0 +1,29 @@ +//+----------------------------------------------------------------------------+ +//| 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_DATA_GAME +#define HEADER_DATA_GAME + +// ----------------------------------------------------------------------------- : Includes + +#include + +#ifndef HEADER_DATA_CARD +DECLARE_POINTER_TYPE(Field); +#endif + +// ----------------------------------------------------------------------------- : Game + +class Game { + public: + String fullName; + String iconFilename; + vector setFields; + vector cardFields; +}; + +// ----------------------------------------------------------------------------- : EOF +#endif diff --git a/src/data/set.cpp b/src/data/set.cpp new file mode 100644 index 00000000..643807f0 --- /dev/null +++ b/src/data/set.cpp @@ -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) | +//+----------------------------------------------------------------------------+ + +// ----------------------------------------------------------------------------- : Includes + +#include +#include + +// ----------------------------------------------------------------------------- : Set + +IMPLEMENT_REFLECTION(Set) { + WITH_DYNAMIC_ARG(game_for_new_cards, game.get()) { + REFLECT_N("card", cards); + } +} + +// ----------------------------------------------------------------------------- : SetView + +SetView::SetView() {} + +SetView::~SetView() { + if (set) set->actions.removeListener(this); +} + +void SetView::setSet(const SetP& newSet) { + // no longer listening to old set + if (set) set->actions.removeListener(this); + set = newSet; + // start listening to new set + if (set) set->actions.addListener(this); + onChangeSet(); +} diff --git a/src/data/set.hpp b/src/data/set.hpp new file mode 100644 index 00000000..b1e1db9a --- /dev/null +++ b/src/data/set.hpp @@ -0,0 +1,61 @@ +//+----------------------------------------------------------------------------+ +//| 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_DATA_SET +#define HEADER_DATA_SET + +// ----------------------------------------------------------------------------- : Includes + +#include +#include +#include + +DECLARE_POINTER_TYPE(Card); +DECLARE_POINTER_TYPE(Set); +DECLARE_POINTER_TYPE(Game); + +// ----------------------------------------------------------------------------- : Set + +/// A set of cards +class Set { + public: + /// The game this set uses + GameP game; + /// The cards in the set + vector cards; + /// Actions performed on this set and the cards in it + ActionStack actions; + + DECLARE_REFLECTION(); +}; + + +// ----------------------------------------------------------------------------- : SetView + +/// A 'view' of a Set, is notified when the Set is updated +/** To listen to events, derived classes should override onAction(const Action&) + */ +class SetView : public ActionListener { + public: + SetView(); + ~SetView(); + + /// Get the set that is currently being viewed + inline SetP getSet() { return set; } + /// Change the set that is being viewed + void setSet(const SetP& set); + + protected: + /// The set that is currently being viewed, should not be modified directly! + SetP set; + + /// Called when another set is being viewn (using setSet) + virtual void onChangeSet() {} +}; + + +// ----------------------------------------------------------------------------- : EOF +#endif diff --git a/src/data/symbol.cpp b/src/data/symbol.cpp index 15e5cb4d..f1b22c5f 100644 --- a/src/data/symbol.cpp +++ b/src/data/symbol.cpp @@ -163,21 +163,15 @@ IMPLEMENT_REFLECTION(Symbol) { SymbolView::SymbolView() {} -SymbolView::SymbolView(SymbolP symbol) - : symbol(symbol) -{ - if (symbol) symbol->actions.addListener(this); -} - SymbolView::~SymbolView() { if (symbol) symbol->actions.removeListener(this); } -void SymbolView::setSymbol(SymbolP newSymbol) { +void SymbolView::setSymbol(const SymbolP& newSymbol) { // no longer listening to old symbol if (symbol) symbol->actions.removeListener(this); symbol = newSymbol; // start listening to new symbol if (symbol) symbol->actions.addListener(this); - onSymbolChange(); + onChangeSymbol(); } diff --git a/src/data/symbol.hpp b/src/data/symbol.hpp index 84745533..c2707c8d 100644 --- a/src/data/symbol.hpp +++ b/src/data/symbol.hpp @@ -17,8 +17,6 @@ DECLARE_POINTER_TYPE(ControlPoint); DECLARE_POINTER_TYPE(SymbolPart); DECLARE_POINTER_TYPE(Symbol); -DECLARE_TYPEOF_COLLECTION(ControlPointP); -DECLARE_TYPEOF_COLLECTION(SymbolPartP); // ----------------------------------------------------------------------------- : ControlPoint @@ -168,23 +166,24 @@ class Symbol { // ----------------------------------------------------------------------------- : SymbolView /// A 'view' of a symbol, is notified when the symbol is updated +/** To listen to events, derived classes should override onAction(const Action&) + */ class SymbolView : public ActionListener { public: SymbolView(); - SymbolView(SymbolP symbol); ~SymbolView(); /// Get the symbol that is currently being viewed inline SymbolP getSymbol() { return symbol; } /// Change the symbol that is being viewed - void setSymbol(SymbolP symbol); + void setSymbol(const SymbolP& symbol); protected: /// The symbol that is currently being viewed, should not be modified directly! SymbolP symbol; - /// Called when the associated symbol is changed, but not when it is initially set! - virtual void onSymbolChange() {} + /// Called when another symbol is being viewn (using setSymbol) + virtual void onChangeSymbol() {} }; diff --git a/src/gui/symbol/control.cpp b/src/gui/symbol/control.cpp index eddf9884..52eb9aa0 100644 --- a/src/gui/symbol/control.cpp +++ b/src/gui/symbol/control.cpp @@ -24,7 +24,7 @@ SymbolControl::SymbolControl(SymbolWindow* parent, int id, const SymbolP& symbol , SymbolViewer(symbol) , parent(parent) { - switchEditor(new_shared2(this, false)); + onChangeSymbol(); } void SymbolControl::switchEditor(const SymbolEditorBaseP& e) { @@ -34,7 +34,7 @@ void SymbolControl::switchEditor(const SymbolEditorBaseP& e) { Refresh(false); } -void SymbolControl::onSymbolChange() { +void SymbolControl::onChangeSymbol() { selectedParts.clear(); switchEditor(new_shared2(this, false)); Refresh(false); diff --git a/src/gui/symbol/control.hpp b/src/gui/symbol/control.hpp index 23f4b12c..034c7eae 100644 --- a/src/gui/symbol/control.hpp +++ b/src/gui/symbol/control.hpp @@ -26,7 +26,7 @@ class SymbolControl : public wxControl, public SymbolViewer { public: SymbolControl(SymbolWindow* parent, int id, const SymbolP& symbol); - virtual void onSymbolChange(); + virtual void onChangeSymbol(); virtual void onAction(const Action&); diff --git a/src/gui/symbol/editor.hpp b/src/gui/symbol/editor.hpp index 04998e92..0b1a7384 100644 --- a/src/gui/symbol/editor.hpp +++ b/src/gui/symbol/editor.hpp @@ -43,9 +43,9 @@ class SymbolEditorBase { // --------------------------------------------------- : UI - /// Init extra toolbar items and menus needed for this panel + /// Init extra toolbar items and menus needed for this editor virtual void initUI(wxToolBar* tb, wxMenuBar* mb) {} - /// Destroy the extra items added by initUI + /// Destroy the extra items added by initUI. virtual void destroyUI(wxToolBar* tb, wxMenuBar* mb) {} /// Update the UI by enabling/disabling items virtual void onUpdateUI(wxUpdateUIEvent& ev) {} diff --git a/src/gui/symbol/part_list.cpp b/src/gui/symbol/part_list.cpp index 8693de52..de77be7f 100644 --- a/src/gui/symbol/part_list.cpp +++ b/src/gui/symbol/part_list.cpp @@ -16,7 +16,6 @@ SymbolPartList::SymbolPartList(Window* parent, int id, SymbolP symbol) : wxListCtrl(parent, id, wxDefaultPosition, wxDefaultSize, wxLC_REPORT | wxLC_NO_HEADER | wxLC_VIRTUAL | wxLC_EDIT_LABELS) - , SymbolView(symbol) { // Create image list wxImageList* images = new wxImageList(16,16); @@ -30,12 +29,13 @@ SymbolPartList::SymbolPartList(Window* parent, int id, SymbolP symbol) AssignImageList(images, wxIMAGE_LIST_SMALL); // create columns InsertColumn(0, _("Name")); - update(); + // view symbol + setSymbol(symbol); } // ----------------------------------------------------------------------------- : View events -void SymbolPartList::onSymbolChange() { +void SymbolPartList::onChangeSymbol() { update(); } diff --git a/src/gui/symbol/part_list.hpp b/src/gui/symbol/part_list.hpp index 3a504f44..7d644f73 100644 --- a/src/gui/symbol/part_list.hpp +++ b/src/gui/symbol/part_list.hpp @@ -36,7 +36,7 @@ class SymbolPartList : public wxListCtrl, public SymbolView { void selectParts(const set& sel); /// Another symbol is being viewed - void onSymbolChange(); + void onChangeSymbol(); /// Event handler for changes to the symbol virtual void onAction(const Action& a); diff --git a/src/gui/symbol/viewer.cpp b/src/gui/symbol/viewer.cpp index 55fd7133..64c3b6ca 100644 --- a/src/gui/symbol/viewer.cpp +++ b/src/gui/symbol/viewer.cpp @@ -12,9 +12,10 @@ SymbolViewer::SymbolViewer(const SymbolP& symbol, double borderRadius) : borderRadius(borderRadius) - , SymbolView(symbol) , rotation(0, RealRect(0,0,500,500)) -{} +{ + setSymbol(symbol); +} // ----------------------------------------------------------------------------- : Drawing diff --git a/src/gui/symbol/window.cpp b/src/gui/symbol/window.cpp index e38bac9a..97ea0643 100644 --- a/src/gui/symbol/window.cpp +++ b/src/gui/symbol/window.cpp @@ -15,34 +15,6 @@ #include #include -// ----------------------------------------------------------------------------- : Window ids - -enum SymIDs -{ idFileNew = wxID_NEW -, idFileOpen = wxID_OPEN -, idFileSave = wxID_SAVE -, idFileSaveAs = wxID_SAVEAS -, idFileStore = 0 -, idFileExit = wxID_EXIT - -, idExtraTools = 1000 -, idExtraToolsMax = idExtraTools + 500 - -, idEditUndo = wxID_UNDO -, idEditRedo = wxID_REDO -, idEditDuplicate = 1100 // idExtraTools + 100 - -, idModeSelect = idFileStore + 1 -, idModeRotate -, idModePoints -, idModeShapes -, idModePaint -, idModeMax - -, idPartList -, idControl -}; - // ------------------------------------------------------------------------------------------------ : Default symbol // A default symbol part, a square, moved by d @@ -218,17 +190,17 @@ void SymbolWindow::onExtraTool(wxCommandEvent& ev) { void SymbolWindow::onUpdateUI(wxUpdateUIEvent& ev) { switch(ev.GetId()) { // file menu - case idFileStore: { + case ID_FILE_STORE: { // ev.Enable(value); break; // undo/redo - } case idEditUndo: { + } case ID_EDIT_UNDO: { ev.Enable(control->getSymbol()->actions.canUndo()); String label = control->getSymbol()->actions.undoName(); ev.SetText(label + _("\tCtrl+Z")); GetToolBar()->SetToolShortHelp(ID_EDIT_UNDO, label); break; - } case idEditRedo: { + } case ID_EDIT_REDO: { ev.Enable(control->getSymbol()->actions.canRedo()); String label = control->getSymbol()->actions.redoName(); ev.SetText(label + _("\tF4")); diff --git a/src/mse.vcproj b/src/mse.vcproj index 91423a94..96201014 100644 --- a/src/mse.vcproj +++ b/src/mse.vcproj @@ -320,28 +320,22 @@ RelativePath=".\gui\util.hpp"> + RelativePath=".\gui\set\panel.hpp"> - - - - - - + RelativePath=".\gui\set\stats_panel.cpp"> + RelativePath=".\gui\set\stats_panel.hpp"> + + + + + + + + + + + + @@ -632,6 +638,9 @@ + + diff --git a/src/util/dynamic_arg.hpp b/src/util/dynamic_arg.hpp new file mode 100644 index 00000000..510b70b0 --- /dev/null +++ b/src/util/dynamic_arg.hpp @@ -0,0 +1,68 @@ +//+----------------------------------------------------------------------------+ +//| 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_UTIL_DYNAMIC_ARG +#define HEADER_UTIL_DYNAMIC_ARG + +/** @file util/dynamic_arg.hpp + * + * @brief Support for 'dynamicly scopped' arguments. + * This header + */ + +// ----------------------------------------------------------------------------- : Includes + +#include + +// ----------------------------------------------------------------------------- : Dynamic argument + +#ifdef _MSC_VER +# define THREAD_LOCAL __declspec(thread) +#else +# define THREAD_LOCAL __thread +#endif + +/// Declare a dynamic argument. +/** The value of the argument can be got with: name() + * To change the value use WITH_DYNAMIC_ARG(name, newValue) { ... } + * To be used in a header file. Use IMPLEMENT_DYN_ARG in a source file + */ +#define DECLARE_DYNAMIC_ARG(Type, name) \ + extern THREAD_LOCAL Type name##_private; \ + inline Type name() { return name##_private; } \ + class name##_changer { \ + public: \ + inline name##_changer(Type const& newValue) \ + : oldValue(name##_private) { \ + name##_private = newValue; \ + } \ + inline ~name##_changer() { \ + name##_private = oldValue; \ + } \ + inline operator bool() { return true; } \ + private: \ + Type oldValue; \ + } + +/// Implementation of a dynamic argument +#define IMPLEMENT_DYNAMIC_ARG(Type, name, initial) \ + THREAD_LOCAL Type name##_private = initial; + +/// Locally change the value of a dynamic argument +/** Usage: + * @code + * // here name() == old value + * WITH_DYNAMIC_ARG(name, newValue) { + * // here name() == newValue + * } + * // here name() == old value + * @endcode + */ +#define WITH_DYNAMIC_ARG(name, value) \ + if (name##_changer(value)) + +// ----------------------------------------------------------------------------- : EOF +#endif diff --git a/src/util/for_each.hpp b/src/util/for_each.hpp index 2b3124f4..cdccdb5f 100644 --- a/src/util/for_each.hpp +++ b/src/util/for_each.hpp @@ -41,34 +41,39 @@ #define TYPEOF_CIT(Value) TypeOf::const_iterator /// The type of a reverse iterator #define TYPEOF_RIT(Value) TypeOf::reverse_iterator - /// The type of a value + /// The type of a reference #define TYPEOF_REF(Value) TypeOf::reference + /// The type of a const reference + #define TYPEOF_CREF(Value) TypeOf::const_reference /// Declare typeof magic for a specific type #define DECLARE_TYPEOF(T) \ template<> struct TypeOf { \ - typedef T type; \ - typedef T::iterator iterator; \ - typedef T::const_iterator const_iterator; \ + typedef T type; \ + typedef T::iterator iterator; \ + typedef T::const_iterator const_iterator; \ typedef T::reverse_iterator reverse_iterator; \ - typedef T::reference reference; \ + 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) \ template<> struct TypeOf { \ - typedef T type; \ - typedef T::iterator iterator; \ - typedef T::const_iterator const_iterator; \ - typedef T::reference 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) \ 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_reference reference; \ + typedef T type; \ + typedef T::const_iterator iterator; \ + typedef T::const_iterator const_iterator; \ + typedef T::reverse_iterator reverse_iterator; \ + typedef T::const_reference reference; \ + typedef T::const_reference const_reference; \ } @@ -134,6 +139,13 @@ #define FOR_EACH(Elem,Collection) \ FOR_EACH_T(TYPEOF_IT(Collection), TYPEOF_REF(Collection), Elem, Collection) +/// 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) \ + FOR_EACH_T(TYPEOF_CIT(Collection), TYPEOF_CREF(Collection), Elem, Collection) + /// 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 } diff --git a/src/util/index_map.hpp b/src/util/index_map.hpp index dd422953..c8bc9f7d 100644 --- a/src/util/index_map.hpp +++ b/src/util/index_map.hpp @@ -16,7 +16,7 @@ /// A kind of map of K->V, with the following properties: /** - K must have a unique member ->index of type UInt * - There must exist a function initObject(K, V&) - * that stores a new V object for a given key in v + * that stores a new V object for a given key in the reference * - O(1) inserts and lookups */ template @@ -35,10 +35,10 @@ class IndexMap : private vector { void init(const vector& keys) { if (!this->empty()) return; this->reserve(keys.size()); - FOR_EACH(it, keys) { - Key& k = *it; - if (k->index >= this->size()) this->resize(k->index + 1); - initObject(k, (*this)[k->index]); + FOR_EACH_CONST(key, keys) { + assert(key); + if (key->index >= this->size()) this->resize(key->index + 1); + initObject(key, (*this)[key->index]); } } diff --git a/src/util/prec.hpp b/src/util/prec.hpp index cd3d901d..58db78e7 100644 --- a/src/util/prec.hpp +++ b/src/util/prec.hpp @@ -9,7 +9,7 @@ /** @file util/prec.hpp * - * Precompiled header, and aliasses for common types + * @brief Precompiled header, and aliasses for common types */ // ----------------------------------------------------------------------------- : Compiler specific diff --git a/src/util/reflect.hpp b/src/util/reflect.hpp index 6a6fd77a..2ba56eed 100644 --- a/src/util/reflect.hpp +++ b/src/util/reflect.hpp @@ -20,7 +20,8 @@ // ----------------------------------------------------------------------------- : Declaring reflection /// Declare that a class supports reflection -/// Reflection allows the member variables of a class to be inspected at runtime. +/** Reflection allows the member variables of a class to be inspected at runtime. + */ #define DECLARE_REFLECTION() \ protected: \ template void reflect_impl(Tag& tag); \ diff --git a/src/util/smart_ptr.hpp b/src/util/smart_ptr.hpp index 82eb461e..f6c7ea78 100644 --- a/src/util/smart_ptr.hpp +++ b/src/util/smart_ptr.hpp @@ -14,6 +14,7 @@ // ----------------------------------------------------------------------------- : Includes +#include #include using namespace boost; @@ -22,7 +23,8 @@ using namespace boost; /// Declares the type TypeP as a shared_ptr #define DECLARE_POINTER_TYPE(Type) \ class Type; \ - typedef shared_ptr Type##P + typedef shared_ptr Type##P; \ + DECLARE_TYPEOF_COLLECTION(Type##P) // ----------------------------------------------------------------------------- : Creating diff --git a/src/util/string.hpp b/src/util/string.hpp index ba2bf05a..6572b0f9 100644 --- a/src/util/string.hpp +++ b/src/util/string.hpp @@ -14,6 +14,7 @@ // ----------------------------------------------------------------------------- : Includes +#include "prec.hpp" #include "for_each.hpp" #include #include diff --git a/src/util/window_id.hpp b/src/util/window_id.hpp index 62a23525..83957b44 100644 --- a/src/util/window_id.hpp +++ b/src/util/window_id.hpp @@ -7,6 +7,11 @@ #ifndef HEADER_UTIL_WINDOW_ID #define HEADER_UTIL_WINDOW_ID +/** @file util/window_id.hpp + * + * @brief Enumerations of all window ids used. + */ + // ----------------------------------------------------------------------------- : Includes // ----------------------------------------------------------------------------- : Menu ids