Cleanup: indentation of public/protected/private keywords

This commit is contained in:
Twan van Laarhoven
2020-05-12 21:57:37 +02:00
parent 86aec577a2
commit 0c3712b61a
167 changed files with 751 additions and 752 deletions
+1 -1
View File
@@ -23,7 +23,7 @@ enum AddingOrRemoving {ADD, REMOVE};
/// Adding or removing some objects from a vector
template <typename T>
class GenericAddAction {
public:
public:
GenericAddAction(AddingOrRemoving, const T& item, const vector<T>& container);
GenericAddAction(AddingOrRemoving, const vector<T>& items, const vector<T>& container);
+6 -6
View File
@@ -26,17 +26,17 @@ DECLARE_POINTER_TYPE(Keyword);
/// An Action the changes the keyword list of a set
class KeywordListAction : public Action {
public:
public:
inline KeywordListAction(Set& set) : set(set) {}
protected:
protected:
Set& set; // the set owns this action, so the set will not be destroyed before this
// therefore we don't need a smart pointer
};
/// Adding or removing a keyword from a set
class AddKeywordAction : public KeywordListAction {
public:
public:
AddKeywordAction(Set& set);
AddKeywordAction(AddingOrRemoving, Set& set, const KeywordP& keyword);
@@ -56,7 +56,7 @@ class AddKeywordAction : public KeywordListAction {
* - reminder text
*/
class KeywordTextValue : public FakeTextValue {
public:
public:
KeywordTextValue(const TextFieldP& field, Keyword* keyword, String* underlying, bool editable, bool untagged = false)
: FakeTextValue(field, underlying, editable, untagged)
, keyword(*keyword)
@@ -67,7 +67,7 @@ class KeywordTextValue : public FakeTextValue {
/// A FakeTextValue that is used to edit reminder text scripts
class KeywordReminderTextValue : public KeywordTextValue {
public:
public:
KeywordReminderTextValue(Set& set, const TextFieldP& field, Keyword* keyword, bool editable);
String errors; ///< Errors in the script
@@ -88,7 +88,7 @@ class KeywordReminderTextValue : public KeywordTextValue {
/// Changing the mode of a keyword
class ChangeKeywordModeAction : public Action {
public:
public:
ChangeKeywordModeAction(Keyword& keyword, const String& new_mode);
virtual String getName(bool to_undo) const;
+14 -14
View File
@@ -28,17 +28,17 @@ DECLARE_POINTER_TYPE(PackType);
/// An Action the changes the card list of a set
class CardListAction : public Action {
public:
public:
inline CardListAction(Set& set) : set(set) {}
protected:
protected:
Set& set; // the set owns this action, so the set will not be destroyed before this
// therefore we don't need a smart pointer
};
/// Adding a new card to a set
class AddCardAction : public CardListAction {
public:
public:
/// Add a newly allocated card
AddCardAction(Set& set);
AddCardAction(AddingOrRemoving, Set& set, const CardP& card);
@@ -54,7 +54,7 @@ class AddCardAction : public CardListAction {
/// Change the position of a card in the card list by swapping two cards
class ReorderCardsAction : public CardListAction {
public:
public:
ReorderCardsAction(Set& set, size_t card_id1, size_t card_id2);
virtual String getName(bool to_undo) const;
@@ -68,14 +68,14 @@ class ReorderCardsAction : public CardListAction {
/// An action that affects the rendering/display/look of a set or cards in the set
class DisplayChangeAction : public Action {
public:
public:
virtual String getName(bool to_undo) const;
virtual void perform(bool to_undo);
};
/// Changing the style of a a card
class ChangeCardStyleAction : public DisplayChangeAction {
public:
public:
ChangeCardStyleAction(const CardP& card, const StyleSheetP& stylesheet);
virtual String getName(bool to_undo) const;
@@ -90,13 +90,13 @@ class ChangeCardStyleAction : public DisplayChangeAction {
/// Changing the style of a set to that of a card
class ChangeSetStyleAction : public DisplayChangeAction {
public:
public:
ChangeSetStyleAction(Set& set, const CardP& card);
virtual String getName(bool to_undo) const;
virtual void perform(bool to_undo);
private:
private:
Set& set; ///< The affected set
CardP card; ///< The card whos stylesheet is copied to the set
StyleSheetP stylesheet; ///< The old stylesheet of the set
@@ -106,7 +106,7 @@ class ChangeSetStyleAction : public DisplayChangeAction {
/// Changing the styling of a card to become custom/non-custom
/** i.e. toggle card->has_styling */
class ChangeCardHasStylingAction : public DisplayChangeAction {
public:
public:
ChangeCardHasStylingAction(Set& set, const CardP& card);
virtual String getName(bool to_undo) const;
@@ -122,17 +122,17 @@ class ChangeCardHasStylingAction : public DisplayChangeAction {
/// An Action the changes the pack types of a set
class PackTypesAction : public Action {
public:
public:
inline PackTypesAction(Set& set) : set(set) {}
protected:
protected:
Set& set; // the set owns this action, so the set will not be destroyed before this
// therefore we don't need a smart pointer
};
/// Adding/removing a pack from a Set
class AddPackAction : public PackTypesAction {
public:
public:
/// Add a newly allocated card
AddPackAction(AddingOrRemoving, Set& set, const PackTypeP& pack);
@@ -144,14 +144,14 @@ class AddPackAction : public PackTypesAction {
/// Updating a pack in a Set
class ChangePackAction : public PackTypesAction {
public:
public:
/// Add a newly allocated card
ChangePackAction(Set& set, size_t pos, const PackTypeP& new_pack);
virtual String getName(bool to_undo) const;
virtual void perform(bool to_undo);
private:
private:
PackTypeP pack;
size_t pos;
};
+36 -36
View File
@@ -24,7 +24,7 @@ class SymbolPartAction : public Action {};
/// Anything that changes a set of parts
class SymbolPartsAction : public SymbolPartAction {
public:
public:
SymbolPartsAction(const set<SymbolPartP>& parts);
const set<SymbolPartP> parts; ///< Affected parts
@@ -37,7 +37,7 @@ class SymbolPartListAction : public SymbolPartAction {};
/// Move some symbol parts
class SymbolPartMoveAction : public SymbolPartsAction {
public:
public:
SymbolPartMoveAction(const set<SymbolPartP>& parts, const Vector2D& delta = Vector2D());
virtual String getName(bool to_undo) const;
@@ -46,13 +46,13 @@ class SymbolPartMoveAction : public SymbolPartsAction {
/// Update this action to move some more
void move(const Vector2D& delta);
private:
private:
Vector2D delta; ///< How much to move
Vector2D moved; ///< How much has been moved
Bounds bounds; ///< Bounding box of the thing we are moving
void movePart(SymbolPart& part); ///< Move a single part
public:
public:
bool constrain; ///< Constrain movement?
int snap; ///< Snap to grid?
};
@@ -61,13 +61,13 @@ class SymbolPartMoveAction : public SymbolPartsAction {
/// Transforming symbol parts using a matrix
class SymbolPartMatrixAction : public SymbolPartsAction {
public:
public:
SymbolPartMatrixAction(const set<SymbolPartP>& parts, const Vector2D& center);
/// Update this action to move some more
void move(const Vector2D& delta);
protected:
protected:
/// Perform the transformation using the given matrix
void transform(const Matrix2D& m);
void transform(SymbolPart& part, const Matrix2D& m);
@@ -77,7 +77,7 @@ class SymbolPartMatrixAction : public SymbolPartsAction {
/// Rotate some symbol parts
class SymbolPartRotateAction : public SymbolPartMatrixAction {
public:
public:
SymbolPartRotateAction(const set<SymbolPartP>& parts, const Vector2D& center);
virtual String getName(bool to_undo) const;
@@ -89,9 +89,9 @@ class SymbolPartRotateAction : public SymbolPartMatrixAction {
/// Update this action to rotate by a deltaAngle
void rotateBy(Radians deltaAngle);
private:
private:
Radians angle; ///< How much to rotate?
public:
public:
bool constrain; ///< Constrain movement?
};
@@ -100,7 +100,7 @@ class SymbolPartRotateAction : public SymbolPartMatrixAction {
/// Shear some symbol parts
class SymbolPartShearAction : public SymbolPartMatrixAction {
public:
public:
SymbolPartShearAction(const set<SymbolPartP>& parts, const Vector2D& center);
virtual String getName(bool to_undo) const;
@@ -109,7 +109,7 @@ class SymbolPartShearAction : public SymbolPartMatrixAction {
/// Change shear by a given amount
void move(const Vector2D& deltaShear);
private:
private:
Vector2D shear; ///< Shearing, shear.x == 0 || shear.y == 0
Vector2D moved;
void shearBy(const Vector2D& shear);
@@ -123,7 +123,7 @@ class SymbolPartShearAction : public SymbolPartMatrixAction {
/// Scale some symbol parts
class SymbolPartScaleAction : public SymbolPartsAction {
public:
public:
SymbolPartScaleAction(const set<SymbolPartP>& parts, int scaleX, int scaleY);
virtual String getName(bool to_undo) const;
@@ -134,7 +134,7 @@ class SymbolPartScaleAction : public SymbolPartsAction {
/// Update the action's effect
void update();
private:
private:
Vector2D old_min, old_size; ///< the original pos/size
Vector2D new_real_min, new_real_size; ///< the target pos/sizevoid shearBy(const Vector2D& shear)
Vector2D new_min, new_size; ///< the target pos/size after applying constrains
@@ -144,7 +144,7 @@ class SymbolPartScaleAction : public SymbolPartsAction {
void transformPart(SymbolPart&);
/// Transform a single vector
inline Vector2D transform(const Vector2D& v);
public:
public:
bool constrain; ///< Constrain movement?
int snap; ///< Snap to grid?
};
@@ -153,14 +153,14 @@ class SymbolPartScaleAction : public SymbolPartsAction {
/// Change the name of a symbol part
class CombiningModeAction : public SymbolPartsAction {
public:
public:
// All parts must be SymbolParts
CombiningModeAction(const set<SymbolPartP>& parts, SymbolShapeCombine mode);
virtual String getName(bool to_undo) const;
virtual void perform(bool to_undo);
private:
private:
void add(const SymbolPartP&, SymbolShapeCombine mode);
vector<pair<SymbolShapeP,SymbolShapeCombine> > parts; ///< Affected parts with new combining modes
};
@@ -169,14 +169,14 @@ class CombiningModeAction : public SymbolPartsAction {
/// Change the name of a symbol part
class SymbolPartNameAction : public SymbolPartAction {
public:
public:
SymbolPartNameAction(const SymbolPartP& part, const String& name, size_t old_cursor, size_t new_cursor);
virtual String getName(bool to_undo) const;
virtual void perform(bool to_undo);
virtual bool merge(const Action& action);
public:
public:
SymbolPartP part; ///< Affected part
String part_name; ///< New name
size_t old_cursor; ///< Cursor position
@@ -187,13 +187,13 @@ class SymbolPartNameAction : public SymbolPartAction {
/// Adding a part to a symbol, added at the front of the list (drawn on top)
class AddSymbolPartAction : public SymbolPartListAction {
public:
public:
AddSymbolPartAction(Symbol& symbol, const SymbolPartP& part);
virtual String getName(bool to_undo) const;
virtual void perform(bool to_undo);
private:
private:
Symbol& symbol; ///< Symbol to add the part to
SymbolPartP part; ///< Part to add
};
@@ -202,17 +202,17 @@ class AddSymbolPartAction : public SymbolPartListAction {
/// Removing parts from a symbol
class RemoveSymbolPartsAction : public SymbolPartListAction {
public:
public:
RemoveSymbolPartsAction(Symbol& symbol, const set<SymbolPartP>& parts);
virtual String getName(bool to_undo) const;
virtual void perform(bool to_undo);
private:
private:
Symbol& symbol;
/// Check for removals in a group
void check(SymbolGroup& group, const set<SymbolPartP>& parts);
public:
public:
/// A removal step
struct Removal {
inline Removal(SymbolGroup& parent, size_t pos, const SymbolPartP& removed)
@@ -222,7 +222,7 @@ class RemoveSymbolPartsAction : public SymbolPartListAction {
size_t pos;
SymbolPartP removed;
};
private:
private:
/// Removed parts, sorted by ascending pos
vector<Removal> removals;
};
@@ -231,7 +231,7 @@ class RemoveSymbolPartsAction : public SymbolPartListAction {
/// Duplicating parts in a symbol
class DuplicateSymbolPartsAction : public SymbolPartListAction {
public:
public:
DuplicateSymbolPartsAction(Symbol& symbol, const set<SymbolPartP>& parts);
virtual String getName(bool to_undo) const;
@@ -240,7 +240,7 @@ class DuplicateSymbolPartsAction : public SymbolPartListAction {
/// Fill a set with all the new parts
void getParts(set<SymbolPartP>& parts);
private:
private:
Symbol& symbol;
/// Duplicates of parts and their positions, sorted by ascending pos
vector<pair<SymbolPartP, size_t> > duplications;
@@ -251,28 +251,28 @@ class DuplicateSymbolPartsAction : public SymbolPartListAction {
/// Change the position of a part in a symbol, by moving a part.
class ReorderSymbolPartsAction : public SymbolPartListAction {
public:
public:
ReorderSymbolPartsAction(SymbolGroup& old_parent, size_t old_position, SymbolGroup& new_parent, size_t new_position);
virtual String getName(bool to_undo) const;
virtual void perform(bool to_undo);
private:
private:
SymbolGroup* old_parent, *new_parent;///< Parents to move from and to
public:
public:
size_t old_position, new_position; ///< Positions to move from and to
};
/// Break up a single group, and put its contents at a specific position
class UngroupReorderSymbolPartsAction : public SymbolPartListAction {
public:
public:
/// Remove all the given groups
UngroupReorderSymbolPartsAction(SymbolGroup& group_parent, size_t group_pos, SymbolGroup& target_parent, size_t target_pos);
virtual String getName(bool to_undo) const;
virtual void perform(bool to_undo);
private:
private:
SymbolGroup& group_parent;
size_t group_pos;
SymbolGroupP group; ///< Group to destroy
@@ -284,29 +284,29 @@ class UngroupReorderSymbolPartsAction : public SymbolPartListAction {
/// Group multiple symbol parts together
class GroupSymbolPartsActionBase : public SymbolPartListAction {
public:
public:
GroupSymbolPartsActionBase(SymbolGroup& root);
virtual void perform(bool to_undo);
protected:
protected:
SymbolGroup& root; ///< Symbol or group to group stuff in
vector<SymbolPartP> old_part_list; ///< Old part list of the symbol
};
/// Group multiple symbol parts together
class GroupSymbolPartsAction : public GroupSymbolPartsActionBase {
public:
public:
GroupSymbolPartsAction(SymbolGroup& root, const set<SymbolPartP>& parts, const SymbolGroupP& group);
virtual String getName(bool to_undo) const;
private:
private:
SymbolGroupP group;
};
/// Break up one or more SymbolGroups
class UngroupSymbolPartsAction : public GroupSymbolPartsActionBase {
public:
public:
/// Remove all the given groups
UngroupSymbolPartsAction(SymbolGroup& root, const set<SymbolPartP>& groups);
+4 -4
View File
@@ -301,13 +301,13 @@ double ssqrt(double x) {
// Remove a single control point
class SinglePointRemoveAction : public Action, public IntrusivePtrBase<SinglePointRemoveAction> {
public:
public:
SinglePointRemoveAction(const SymbolShapeP& shape, UInt position);
virtual String getName(bool to_undo) const { return _("Delete point"); }
virtual void perform(bool to_undo);
private:
private:
SymbolShapeP shape;
UInt position;
ControlPointP point; ///< Removed point
@@ -387,13 +387,13 @@ DECLARE_POINTER_TYPE(SinglePointRemoveAction);
// 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:
public:
ControlPointRemoveAction(const SymbolShapeP& shape, const set<ControlPointP>& to_delete);
virtual String getName(bool to_undo) const;
virtual void perform(bool to_undo);
private:
private:
vector<SinglePointRemoveActionP> removals;
};
+21 -21
View File
@@ -51,7 +51,7 @@ protected:
/// Moving a control point in a symbol
class ControlPointMoveAction : public ExtendableAction {
public:
public:
ControlPointMoveAction(const set<ControlPointP>& points);
virtual String getName(bool to_undo) const;
@@ -60,11 +60,11 @@ class ControlPointMoveAction : public ExtendableAction {
/// Update this action to move some more
void move(const Vector2D& delta);
private:
private:
set<ControlPointP> points; ///< Points to move
vector<Vector2D> oldValues; ///< Their old positions
Vector2D delta; ///< Amount we moved
public:
public:
bool constrain; ///< Constrain movement?
int snap; ///< Snap to grid?
};
@@ -73,7 +73,7 @@ class ControlPointMoveAction : public ExtendableAction {
/// Moving a handle(before/after) of a control point in a symbol
class HandleMoveAction : public ExtendableAction {
public:
public:
HandleMoveAction(const SelectedHandle& handle);
virtual String getName(bool to_undo) const;
@@ -82,12 +82,12 @@ class HandleMoveAction : public ExtendableAction {
/// Update this action to move some more
void move(const Vector2D& delta);
private:
private:
SelectedHandle handle; ///< The handle to move
Vector2D old_handle; ///< Old value of this handle
Vector2D old_other; ///< Old value of other handle, needed for contraints
Vector2D delta; ///< Amount we moved
public:
public:
bool constrain; ///< Constrain movement?
int snap; ///< Snap to grid?
};
@@ -96,7 +96,7 @@ class HandleMoveAction : public ExtendableAction {
/// Utility class to update a control point
class ControlPointUpdate {
public:
public:
ControlPointUpdate(const ControlPointP& pnt);
/// Perform or undo an update on this control point
@@ -112,13 +112,13 @@ class ControlPointUpdate {
/// Changing a line to a curve and vice versa
class SegmentModeAction : public Action {
public:
public:
SegmentModeAction(const ControlPointP& p1, const ControlPointP& p2, SegmentMode mode);
virtual String getName(bool to_undo) const;
virtual void perform(bool to_undo);
protected:
protected:
ControlPointUpdate point1, point2;
};
@@ -126,13 +126,13 @@ class SegmentModeAction : public Action {
/// Locking a control point
class LockModeAction : public Action {
public:
public:
LockModeAction(const ControlPointP& p, LockMode mode);
virtual String getName(bool to_undo) const;
virtual void perform(bool to_undo);
private:
private:
ControlPointUpdate point; ///< The affected point
};
@@ -142,7 +142,7 @@ class LockModeAction : public Action {
/** Inherits from SegmentModeAction because it also has that effect
*/
class CurveDragAction : public SegmentModeAction {
public:
public:
CurveDragAction(const ControlPointP& point1, const ControlPointP& point2);
virtual String getName(bool to_undo) const;
@@ -156,7 +156,7 @@ class CurveDragAction : public SegmentModeAction {
/// Insert a new point in a symbol shape
class ControlPointAddAction : public Action {
public:
public:
/// Insert a new point in shape, after position insertAfter_, at the time t on the segment
ControlPointAddAction(const SymbolShapeP& shape, UInt insert_after, double t);
@@ -165,7 +165,7 @@ class ControlPointAddAction : public Action {
inline ControlPointP getNewPoint() const { return new_point; }
private:
private:
SymbolShapeP shape; ///< SymbolShape we are in
ControlPointP new_point; ///< The point to insert
UInt insert_after; ///< Insert after index .. in the array
@@ -185,7 +185,7 @@ unique_ptr<Action> control_point_remove_action(const SymbolShapeP& shape, const
/// Moving the handle or the center of a symbol symmetry
class SymmetryMoveAction : public Action {
public:
public:
SymmetryMoveAction(SymbolSymmetry& symmetry, bool is_handle);
virtual String getName(bool to_undo) const;
@@ -194,12 +194,12 @@ class SymmetryMoveAction : public Action {
/// Update this action to move some more
void move(const Vector2D& delta);
private:
private:
SymbolSymmetry& symmetry; ///< Affected part
bool is_handle; ///< Move the handle or the center?
Vector2D delta; ///< Amount we moved
Vector2D original; ///< Original value
public:
public:
bool constrain; ///< Constrain movement?
int snap; ///< Snap to grid?
};
@@ -208,12 +208,12 @@ class SymmetryMoveAction : public Action {
/// Change the type of symmetry
class SymmetryTypeAction : public Action {
public:
public:
SymmetryTypeAction(SymbolSymmetry& symmetry, SymbolSymmetryType type);
virtual String getName(bool to_undo) const;
virtual void perform(bool to_undo);
private:
private:
SymbolSymmetry& symmetry;
SymbolSymmetryType type;
String old_name;
@@ -224,12 +224,12 @@ class SymmetryTypeAction : public Action {
/// Change the number of copies of a symmetry
class SymmetryCopiesAction : public Action {
public:
public:
SymmetryCopiesAction(SymbolSymmetry& symmetry, int copies);
virtual String getName(bool to_undo) const;
virtual void perform(bool to_undo);
private:
private:
SymbolSymmetry& symmetry;
int copies;
String old_name;
+2 -2
View File
@@ -54,7 +54,7 @@ inline void swap_value(MultipleChoiceValue& a, MultipleChoiceValue::ValueType& b
/// A ValueAction that swaps between old and new values
template <typename T, bool ALLOW_MERGE>
class SimpleValueAction : public ValueAction {
public:
public:
inline SimpleValueAction(const intrusive_ptr<T>& value, const typename T::ValueType& new_value)
: ValueAction(value), new_value(new_value)
{}
@@ -77,7 +77,7 @@ class SimpleValueAction : public ValueAction {
return false;
}
private:
private:
typename T::ValueType new_value;
};
+12 -12
View File
@@ -35,7 +35,7 @@ DECLARE_POINTER_TYPE(PackageChoiceValue);
/// An Action the changes a Value
class ValueAction : public Action {
public:
public:
inline ValueAction(const ValueP& value)
: valueP(value), card(nullptr), old_time_modified(wxDateTime::Now())
{}
@@ -48,7 +48,7 @@ class ValueAction : public Action {
const ValueP valueP; ///< The modified value
const Card* card; ///< The card the value is on, or null if it is not a card value
private:
private:
wxDateTime old_time_modified;
};
@@ -66,7 +66,7 @@ unique_ptr<ValueAction> value_action(const PackageChoiceValueP& value, const St
/// An action that changes a TextValue
class TextValueAction : public ValueAction {
public:
public:
TextValueAction(const TextValueP& value, size_t start, size_t end, size_t new_end, const Defaultable<String>& new_value, const String& name);
virtual String getName(bool to_undo) const;
@@ -77,7 +77,7 @@ class TextValueAction : public ValueAction {
/// The modified selection
size_t selection_start, selection_end;
private:
private:
inline TextValue& value() const;
size_t new_selection_end;
@@ -96,7 +96,7 @@ unique_ptr<TextValueAction> typing_action(const TextValueP& value, size_t start_
/// Toggle reminder text for a keyword on or off
class TextToggleReminderAction : public ValueAction {
public:
public:
TextToggleReminderAction(const TextValueP& value, size_t pos);
virtual String getName(bool to_undo) const;
@@ -112,17 +112,17 @@ class TextToggleReminderAction : public ValueAction {
/// A TextValueAction without the start and end stuff
class SimpleTextValueAction : public ValueAction {
public:
public:
SimpleTextValueAction(const Card* card, const TextValueP& value, const Defaultable<String>& new_value);
virtual void perform(bool to_undo);
bool merge(const SimpleTextValueAction& action);
private:
private:
Defaultable<String> new_value;
};
/// An action from "Replace All"; just a bunch of value actions performed in sequence
class ReplaceAllAction : public Action {
public:
public:
~ReplaceAllAction();
virtual String getName(bool to_undo) const;
@@ -135,7 +135,7 @@ class ReplaceAllAction : public Action {
/// Notification that a script caused a value to change
class ScriptValueEvent : public Action {
public:
public:
inline ScriptValueEvent(const Card* card, const Value* value) : card(card), value(value) {}
virtual String getName(bool to_undo) const;
@@ -147,7 +147,7 @@ class ScriptValueEvent : public Action {
/// Notification that a script caused a style to change
class ScriptStyleEvent : public Action {
public:
public:
inline ScriptStyleEvent(const StyleSheet* stylesheet, const Style* style)
: stylesheet(stylesheet), style(style)
{}
@@ -165,7 +165,7 @@ class ScriptStyleEvent : public Action {
/// A loose object for performing ValueActions on a certain value.
/** Used to reduce coupling */
class ValueActionPerformer {
public:
public:
ValueActionPerformer(const ValueP& value, Card* card, const SetP& set);
~ValueActionPerformer();
/// Perform an action. The performer takes ownerwhip of the action.
@@ -173,7 +173,7 @@ class ValueActionPerformer {
const ValueP value; ///< The value
Package& getLocalPackage();
private:
private:
Card* card; ///< Card the value is on (if any)
SetP set; ///< Set for the actions
};
+1 -1
View File
@@ -18,7 +18,7 @@ DECLARE_POINTER_TYPE(Card);
/// A script to add one or more cards to a set
class AddCardsScript : public IntrusivePtrBase<AddCardsScript> {
public:
public:
String name;
String description;
Scriptable<bool> enabled;
+1 -1
View File
@@ -26,7 +26,7 @@ DECLARE_POINTER_TYPE(StyleSheet);
/// A card from a card Set
class Card : public IntrusivePtrVirtualBase, public IntrusiveFromThis<Card> {
public:
public:
/// Default constructor, uses game_for_new_cards to make the game
Card();
/// Creates a card using the given game
+28 -28
View File
@@ -37,7 +37,7 @@ DECLARE_DYNAMIC_ARG(Value*, value_being_updated);
/// Information on how to store a value
class Field : public IntrusivePtrVirtualBase, public IntrusiveFromThis<Field> {
public:
public:
Field();
virtual ~Field();
@@ -70,7 +70,7 @@ class Field : public IntrusivePtrVirtualBase, public IntrusiveFromThis<Field> {
/// Add the given dependency to the dependet_scripts list for the variables this field depends on
virtual void initDependencies(Context& ctx, const Dependency& dep) const;
private:
private:
DECLARE_REFLECTION_VIRTUAL();
virtual void after_reading(Version ver);
friend void after_reading(Field& s, Version ver);
@@ -94,7 +94,7 @@ inline String type_name(const Field&) {
/// Style information needed to display a Value in a Field.
class Style : public IntrusivePtrVirtualBase, public IntrusiveFromThis<Style> {
public:
public:
Style(const FieldP&);
virtual ~Style();
@@ -162,7 +162,7 @@ class Style : public IntrusivePtrVirtualBase, public IntrusiveFromThis<Style> {
/** change_info is a subset of StyleChange flags */
void tellListeners(int changes);
private:
private:
DECLARE_REFLECTION_VIRTUAL();
/// Things that are listening to changes in this style
vector<StyleListener*> listeners;
@@ -193,14 +193,14 @@ void mark_dependency_member(const Style& style, const String& name, const Depend
/// An object that can respond when a style changes;
class StyleListener : public IntrusivePtrVirtualBase {
public:
public:
StyleListener(const StyleP& style);
virtual ~StyleListener();
/// Called when a (scripted) property of the viewed style has changed
/** changes is a combination of StyleChange flags */
virtual void onStyleChange(int changes) {}
protected:
protected:
const StyleP styleP; ///< The style we are listening to
};
@@ -208,17 +208,17 @@ class StyleListener : public IntrusivePtrVirtualBase {
/// A specific value 'in' a Field.
class Value : public IntrusivePtrVirtualBase {
public:
public:
inline Value(const FieldP& field) : fieldP(field) {}
virtual ~Value();
const FieldP fieldP; ///< Field this value is for, should have the right type!
Age last_script_update; ///< When where the scripts last updated? (by calling update)
String sort_value; ///< How this should be sorted.
/// Get a copy of this value
virtual ValueP clone() const = 0;
/// Convert this value to a string for use in tables
virtual String toString() const = 0;
/// Apply scripts to this value, return true if the value has changed
@@ -237,14 +237,14 @@ class Value : public IntrusivePtrVirtualBase {
inline String getSortKey() const {
return fieldP->sort_script ? sort_value : toString();
}
protected:
protected:
/// update() split into two functions;.
/** Derived classes should put their stuff in between if they need the age in scripts */
void updateAge();
void updateSortValue(Context& ctx);
private:
private:
DECLARE_REFLECTION_VIRTUAL();
};
@@ -260,11 +260,11 @@ inline String type_name(const Value&) {
// ----------------------------------------------------------------------------- : Utilities
#define DECLARE_FIELD_TYPE(Type) \
DECLARE_REFLECTION_OVERRIDE(); \
DECLARE_REFLECTION_OVERRIDE(); \
public: \
virtual ValueP newValue() override; \
virtual StyleP newStyle() override; \
virtual String typeName() const override
virtual ValueP newValue() override; \
virtual StyleP newStyle() override; \
virtual String typeName() const override
// implement newStyle and newValue
#define IMPLEMENT_FIELD_TYPE(Type, NAME) \
@@ -285,20 +285,20 @@ inline String type_name(const Value&) {
}
#define DECLARE_STYLE_TYPE(Type) \
DECLARE_REFLECTION_OVERRIDE(); \
DECLARE_REFLECTION_OVERRIDE(); \
public: \
DECLARE_HAS_FIELD(Type) \
StyleP clone() const override; \
ValueViewerP makeViewer(DataViewer& parent) override; \
ValueViewerP makeEditor(DataEditor& parent) override
DECLARE_HAS_FIELD(Type) \
StyleP clone() const override; \
ValueViewerP makeViewer(DataViewer& parent) override; \
ValueViewerP makeEditor(DataEditor& parent) override
#define DECLARE_VALUE_TYPE(Type,ValueType_) \
DECLARE_REFLECTION_OVERRIDE(); \
DECLARE_REFLECTION_OVERRIDE(); \
public: \
DECLARE_HAS_FIELD(Type) \
ValueP clone() const override; \
String toString() const override; \
typedef ValueType_ ValueType
DECLARE_HAS_FIELD(Type) \
ValueP clone() const override; \
String toString() const override; \
typedef ValueType_ ValueType
// implement field() which returns a field with the right (derived) type
#define DECLARE_HAS_FIELD(Type) \
+5 -5
View File
@@ -19,7 +19,7 @@ DECLARE_POINTER_TYPE(BooleanValue);
/// A field whos value is either true or false
class BooleanField : public ChoiceField {
public:
public:
BooleanField();
DECLARE_FIELD_TYPE(Boolean);
@@ -30,14 +30,14 @@ class BooleanField : public ChoiceField {
/// The Style for a BooleanField
class BooleanStyle : public ChoiceStyle {
public:
public:
BooleanStyle(const ChoiceFieldP& field);
DECLARE_HAS_FIELD(Boolean); // not DECLARE_STYLE_TYPE, because we use a normal ChoiceValueViewer/Editor
virtual StyleP clone() const;
// no extra data
private:
private:
DECLARE_REFLECTION();
};
@@ -45,14 +45,14 @@ class BooleanStyle : public ChoiceStyle {
/// The Value in a BooleanField
class BooleanValue : public ChoiceValue {
public:
public:
inline BooleanValue(const ChoiceFieldP& field) : ChoiceValue(field) {}
DECLARE_HAS_FIELD(Boolean);
virtual ValueP clone() const;
// no extra data
private:
private:
DECLARE_REFLECTION();
};
+3 -3
View File
@@ -26,7 +26,7 @@ DECLARE_POINTER_TYPE(ChoiceValue);
/// A field that contains a list of choices
class ChoiceField : public Field {
public:
public:
ChoiceField();
DECLARE_FIELD_TYPE(Choice);
@@ -53,7 +53,7 @@ enum ChoiceChoiceType {
/// An item that can be chosen for this field
class ChoiceField::Choice : public IntrusivePtrBase<ChoiceField::Choice> {
public:
public:
Choice();
Choice(const String& name);
@@ -184,7 +184,7 @@ public:
/// The Value in a ChoiceField
class ChoiceValue : public Value {
public:
public:
/// Create a value for the given field
/** If initial_first_choice then the first choice should be used in the absence of
an explicit initial value
+4 -4
View File
@@ -22,7 +22,7 @@ DECLARE_POINTER_TYPE(ColorValue);
/// A field for color values, it contains a list of choices for colors
class ColorField : public Field {
public:
public:
ColorField();
DECLARE_FIELD_TYPE(Color);
@@ -41,7 +41,7 @@ class ColorField : public Field {
/// A color that can be chosen for this field
class ColorField::Choice : public IntrusivePtrBase<ColorField::Choice> {
public:
public:
String name; ///< Name of the color
Color color; ///< The actual color
@@ -52,7 +52,7 @@ class ColorField::Choice : public IntrusivePtrBase<ColorField::Choice> {
/// The Style for a ColorField
class ColorStyle : public Style {
public:
public:
ColorStyle(const ColorFieldP& field);
DECLARE_STYLE_TYPE(Color);
@@ -70,7 +70,7 @@ class ColorStyle : public Style {
/// The Value in a ColorField
class ColorValue : public Value {
public:
public:
ColorValue(const ColorFieldP& field);
DECLARE_VALUE_TYPE(Color, Defaultable<Color>);
+3 -3
View File
@@ -22,7 +22,7 @@ DECLARE_POINTER_TYPE(ImageValue);
/// A field for image values
class ImageField : public Field {
public:
public:
// no extra data
DECLARE_FIELD_TYPE(Image);
};
@@ -31,7 +31,7 @@ class ImageField : public Field {
/// The Style for a ImageField
class ImageStyle : public Style {
public:
public:
inline ImageStyle(const ImageFieldP& field) : Style(field) {}
DECLARE_STYLE_TYPE(Image);
@@ -44,7 +44,7 @@ class ImageStyle : public Style {
/// The Value in a ImageField, i.e. an image
class ImageValue : public Value {
public:
public:
inline ImageValue(const ImageFieldP& field) : Value(field) {}
DECLARE_VALUE_TYPE(Image, LocalFileName);
+3 -3
View File
@@ -24,7 +24,7 @@ DECLARE_POINTER_TYPE(InfoValue);
/** These values are not editable, they are just headers, icons, labels, etc.
*/
class InfoField : public Field {
public:
public:
InfoField() { editable = false; }
DECLARE_FIELD_TYPE(Text);
@@ -37,7 +37,7 @@ class InfoField : public Field {
/// The Style for a InfoField
class InfoStyle : public Style {
public:
public:
InfoStyle(const InfoFieldP&);
DECLARE_STYLE_TYPE(Info);
@@ -55,7 +55,7 @@ class InfoStyle : public Style {
/// The Value in a InfoField
class InfoValue : public Value {
public:
public:
inline InfoValue(const InfoFieldP& field) : Value(field) {}
DECLARE_VALUE_TYPE(Info, String);
+4 -4
View File
@@ -19,7 +19,7 @@ DECLARE_POINTER_TYPE(MultipleChoiceValue);
/// A ChoiceField where multiple choices can be selected simultaniously
class MultipleChoiceField : public ChoiceField {
public:
public:
MultipleChoiceField();
DECLARE_FIELD_TYPE(MultipleChoiceField);
@@ -31,7 +31,7 @@ class MultipleChoiceField : public ChoiceField {
/// The Style for a MultipleChoiceField
class MultipleChoiceStyle : public ChoiceStyle {
public:
public:
MultipleChoiceStyle(const MultipleChoiceFieldP& field);
DECLARE_STYLE_TYPE(MultipleChoice);
@@ -48,7 +48,7 @@ class MultipleChoiceStyle : public ChoiceStyle {
* The choices must be ordered by id
*/
class MultipleChoiceValue : public ChoiceValue {
public:
public:
inline MultipleChoiceValue(const MultipleChoiceFieldP& field) : ChoiceValue(field, false) {}
DECLARE_HAS_FIELD(MultipleChoice);
virtual ValueP clone() const;
@@ -66,7 +66,7 @@ class MultipleChoiceValue : public ChoiceValue {
virtual bool update(Context&);
private:
private:
DECLARE_REFLECTION();
/// Put the value in normal form (all choices ordered, empty_name
+4 -4
View File
@@ -4,7 +4,7 @@
//| License: GNU General Public License 2 or later (see file COPYING) |
//+----------------------------------------------------------------------------+
#pragma once
#pragma once
// ----------------------------------------------------------------------------- : Includes
@@ -23,7 +23,7 @@ DECLARE_POINTER_TYPE(PackageChoiceValue);
/// A field for PackageChoice values, it contains a list of choices for PackageChoices
class PackageChoiceField : public Field {
public:
public:
PackageChoiceField() : required(true), empty_name(_("none")) {}
DECLARE_FIELD_TYPE(PackageChoice);
@@ -40,7 +40,7 @@ class PackageChoiceField : public Field {
/// The Style for a PackageChoiceField
class PackageChoiceStyle : public Style {
public:
public:
PackageChoiceStyle(const PackageChoiceFieldP& field);
DECLARE_STYLE_TYPE(PackageChoice);
@@ -53,7 +53,7 @@ class PackageChoiceStyle : public Style {
/// The Value in a PackageChoiceField
class PackageChoiceValue : public Value {
public:
public:
PackageChoiceValue(const PackageChoiceFieldP& field) : Value(field), package_name(field->initial) {}
DECLARE_VALUE_TYPE(PackageChoice, String);
+4 -4
View File
@@ -24,7 +24,7 @@ DECLARE_POINTER_TYPE(SymbolValue);
/// A field for image values
class SymbolField : public Field {
public:
public:
DECLARE_FIELD_TYPE(Symbol);
// no extra data
@@ -34,7 +34,7 @@ class SymbolField : public Field {
/// The Style for a SymbolField
class SymbolStyle : public Style {
public:
public:
inline SymbolStyle(const SymbolFieldP& field)
: Style(field)
, min_aspect_ratio(1), max_aspect_ratio(1)
@@ -48,7 +48,7 @@ class SymbolStyle : public Style {
/// Styling for a symbol variation, defines color, border, etc.
class SymbolVariation : public IntrusivePtrBase<SymbolVariation> {
public:
public:
SymbolVariation();
~SymbolVariation();
String name; ///< Name of this variation
@@ -64,7 +64,7 @@ class SymbolVariation : public IntrusivePtrBase<SymbolVariation> {
/// The Value in a SymbolField, i.e. a symbol
class SymbolValue : public Value {
public:
public:
inline SymbolValue(const SymbolFieldP& field) : Value(field) {}
DECLARE_VALUE_TYPE(Symbol, LocalFileName);
+4 -4
View File
@@ -30,7 +30,7 @@ DECLARE_POINTER_TYPE(LineLayout);
/// A field for values containing tagged text
class TextField : public Field {
public:
public:
TextField();
DECLARE_FIELD_TYPE(Text);
@@ -68,7 +68,7 @@ public:
/// The Style for a TextField
class TextStyle : public Style {
public:
public:
TextStyle(const TextFieldP&);
DECLARE_STYLE_TYPE(Text);
@@ -107,7 +107,7 @@ class TextStyle : public Style {
/// The Value in a TextField
class TextValue : public Value {
public:
public:
inline TextValue(const TextFieldP& field) : Value(field), last_update(1) {}
DECLARE_VALUE_TYPE(Text, Defaultable<String>);
@@ -122,7 +122,7 @@ class TextValue : public Value {
/// A 'fake' TextValue that is used to edit some other string
/** Used by TextCtrl */
class FakeTextValue : public TextValue {
public:
public:
/// Initialize the fake text value
/** underlying can be nullptr, in that case there is no underlying value */
FakeTextValue(const TextFieldP& field, String* underlying, bool editable, bool untagged);
+1 -1
View File
@@ -15,7 +15,7 @@
/// A filter function to determine which items are shown in a list
template <typename T>
class Filter : public IntrusivePtrVirtualBase {
public:
public:
typedef intrusive_ptr<T> TP;
virtual ~Filter() {}
+2 -2
View File
@@ -32,7 +32,7 @@ enum FontFlags
/// A font for rendering text
/** Contains additional information about scaling, color and shadow */
class Font : public IntrusivePtrBase<Font> {
public:
public:
Scriptable<String> name; ///< Name of the font
Scriptable<String> italic_name; ///< Font name for italic text (optional)
Scriptable<double> size; ///< Size of the font
@@ -65,7 +65,7 @@ class Font : public IntrusivePtrBase<Font> {
/// Convert this font to a wxFont
wxFont toWxFont(double scale) const;
private:
private:
DECLARE_REFLECTION();
};
+25 -25
View File
@@ -27,7 +27,7 @@ String card_rarity_code(const String& rarity);
/// Callback for updating a progress bar
class WithProgress {
public:
public:
virtual void onProgress(float progress, const String& message) = 0;
virtual ~WithProgress () {}
};
@@ -37,7 +37,7 @@ class AbortException {};
/// A dialog to show the progress of exporting
class ExportProgressDialog : public wxProgressDialog, public WithProgress {
public:
public:
ExportProgressDialog(Window* parent, const String& title, const String& message);
/// Update the progress bar
@@ -60,7 +60,7 @@ void ExportProgressDialog::onProgress(float progress, const String& message) {
/// An Apprentice database file, has read() and write() functions
class ApprDatabase {
public:
public:
ApprDatabase(WithProgress* progress_target, const String& name);
virtual ~ApprDatabase();
@@ -71,13 +71,13 @@ class ApprDatabase {
/// Finalize the writing, swap the actual and the temporary file
void commit();
protected:
protected:
virtual void doRead(wxInputStream&) = 0;
virtual void doWrite(wxOutputStream&) = 0;
WithProgress* progress_target; ///< Write progress information to here
private:
private:
bool in_progress; ///< Is writing in progress?
String filename; ///< Filename of database file
};
@@ -92,7 +92,7 @@ ApprDatabase::~ApprDatabase() {
// An exception is thrown while we were writing, clean up the temporary files
if (in_progress) {
// abort 'transaction'
wxRemoveFile(filename + _(".new"));
remove_file(filename + _(".new"));
}
}
@@ -106,7 +106,7 @@ void ApprDatabase::read() {
void ApprDatabase::write() {
// write to a .new file, doesn't commit yet
if (wxFileExists(filename + _(".new"))) {
wxRemoveFile(filename + _(".new"));
remove_file(filename + _(".new"));
}
wxFileOutputStream out(filename + _(".new"));
in_progress = true;
@@ -128,15 +128,15 @@ void ApprDatabase::commit() {
/// An Apprentice expansion database (Expan.dat)
class ApprExpansionDatabase : public ApprDatabase {
public:
public:
inline ApprExpansionDatabase(WithProgress* progress_target)
: ApprDatabase(progress_target, _("Expan.dat"))
{}
protected:
protected:
virtual void doRead(wxInputStream& in);
virtual void doWrite(wxOutputStream& out);
public:
public:
map<String,String> expansions; ///< code -> name
vector<String> order; ///< order of codes
};
@@ -181,25 +181,25 @@ void ApprExpansionDatabase::doWrite(wxOutputStream& out) {
// ----------------------------------------------------------------------------- : Format database
class ApprFormat {
public:
public:
ApprFormat(const String& name) : name(name) {}
String name, sets;
};
/// An Apprentice format database (Format.dat)
class ApprFormatDatabase : public ApprDatabase {
public:
public:
inline ApprFormatDatabase(WithProgress* progress_target)
: ApprDatabase(progress_target, _("Format.dat"))
{}
/// Remove a set code from all formats
void removeSet(const String& code);
protected:
protected:
virtual void doRead(wxInputStream& in);
virtual void doWrite(wxOutputStream& out);
private:
private:
vector<ApprFormat> formats;
};
@@ -253,7 +253,7 @@ void ApprFormatDatabase::doWrite(wxOutputStream& out) {
// An entry in the Distro database
class ApprDistro {
public:
public:
inline ApprDistro(int bc = 0, int bu = 0, int br = 0, int sc = 0, int su = 0, int sr = 0)
: bc(bc), bu(bu), br(br)
, sc(sc), su(su), sr(sr)
@@ -266,24 +266,24 @@ class ApprDistro {
void write(const String& code, wxTextOutputStream& tout);
private:
private:
void writeD(wxTextOutputStream& tout, const String& name, int c, int u, int r);
};
/// An Apprentice distribution database (Distro.dat)
class ApprDistroDatabase : public ApprDatabase {
public:
public:
inline ApprDistroDatabase(WithProgress* progress_target)
: ApprDatabase(progress_target, _("Distro.dat"))
{}
/// Remove a set code
void removeSet(const String& code);
protected:
protected:
virtual void doRead(wxInputStream& in);
virtual void doWrite(wxOutputStream& out);
public:
public:
map<String,ApprDistro> distros;
vector<String> order; // order of codes
};
@@ -357,18 +357,18 @@ DECLARE_POINTER_TYPE(ApprCardRecord);
/// An Apprentice card database (cardinfo.dat)
class ApprCardDatabase : public ApprDatabase {
public:
public:
inline ApprCardDatabase(WithProgress* progress_target)
: ApprDatabase(progress_target, _("sets\\cardinfo.dat"))
{}
/// Remove a set code
void removeSet(const String& code);
protected:
protected:
virtual void doRead(wxInputStream& in);
virtual void doWrite(wxOutputStream& out);
public:
public:
vector<ApprCardRecordP> cards;
};
@@ -377,7 +377,7 @@ class ApprCardDatabase : public ApprDatabase {
* and a head record at the bottom
*/
class ApprCardRecord : public IntrusivePtrBase<ApprCardRecord> {
public:
public:
String name, sets;
String type, cc, pt, text, flavor;
UInt data_pos;
@@ -579,13 +579,13 @@ void ApprCardDatabase::doWrite(wxOutputStream& out) {
/// Dialog for exporting a set to Apprentice
class ApprenticeExportWindow : public wxDialog, public WithProgress {
public:
public:
ApprenticeExportWindow(Window* parent, const SetP& set);
virtual void onProgress(float p, const String& message);
void doStep(const String& s, float size);
private:
private:
DECLARE_EVENT_TABLE();
SetP set;
+3 -3
View File
@@ -19,7 +19,7 @@ DECLARE_POINTER_TYPE(Keyword);
/// The data format for cards on the clipboard
class CardsDataObject : public wxTextDataObject {
public:
public:
/// Name of the format of MSE cards
static wxDataFormat format;
@@ -36,7 +36,7 @@ class CardsDataObject : public wxTextDataObject {
/// The data format for keywords on the clipboard
class KeywordDataObject : public wxTextDataObject {
public:
public:
/// Name of the format of MSE keywords
static wxDataFormat format;
@@ -52,7 +52,7 @@ class KeywordDataObject : public wxTextDataObject {
/// A DataObject for putting one or more cards on the clipboard, in multiple formats
class CardsOnClipboard : public wxDataObjectComposite {
public:
public:
CardsOnClipboard(const SetP& set, const vector<CardP>& cards);
};
+1 -1
View File
@@ -20,7 +20,7 @@ DECLARE_POINTER_TYPE(Card);
/// A filter for a specific file format
class FileFormat : public IntrusivePtrVirtualBase {
public:
public:
virtual ~FileFormat() {}
/// File extension used by this file format
virtual String extension() = 0;
+2 -2
View File
@@ -25,12 +25,12 @@ void export_image(const SetP& set, const CardP& card, const String& filename) {
}
class UnzoomedDataViewer : public DataViewer {
public:
public:
UnzoomedDataViewer(bool use_zoom_settings)
: use_zoom_settings(use_zoom_settings)
{}
virtual Rotation getRotation() const;
private:
private:
bool use_zoom_settings;
};
Rotation UnzoomedDataViewer::getRotation() const {
+1 -1
View File
@@ -21,7 +21,7 @@
/// The file format of MSE1 files
class MSE1FileFormat : public FileFormat {
public:
public:
virtual String extension() { return _("mse"); }
virtual String name() { return _("Magic Set Editor version 1 files (*.mse)"); }
virtual bool canImport() { return true; }
+1 -1
View File
@@ -15,7 +15,7 @@
/// The file format of MSE2 files
class MSE2FileFormat : public FileFormat {
public:
public:
virtual String extension() { return _("mse-set"); }
virtual String matches() { return _("*.mse-set;set"); }
virtual String name() { return _("Magic Set Editor sets (*.mse-set)"); }
+2 -2
View File
@@ -22,13 +22,13 @@
/// The file format of Mtg Editor files
class MtgEditorFileFormat : public FileFormat {
public:
public:
virtual String extension() { return _("set"); }
virtual String name() { return _("Mtg Editor files (*.set)"); }
virtual bool canImport() { return true; }
virtual bool canExport(const Game&) { return false; }
virtual SetP importSet(const String& filename);
private:
private:
// Filter: se filename -> image directory
// based on MtgEditor's: CardSet.getImageFolder
String filter1(const String& str);
+2 -2
View File
@@ -34,7 +34,7 @@ DECLARE_DYNAMIC_ARG(Game*, game_for_reading);
/// A description of a card game
class Game : public Packaged {
public:
public:
Game();
OptionalScript init_script; ///< Script of variables available to other scripts in this game
@@ -73,7 +73,7 @@ class Game : public Packaged {
virtual String typeName() const;
Version fileVersion() const;
protected:
protected:
virtual void validate(Version);
DECLARE_REFLECTION_OVERRIDE();
+2 -2
View File
@@ -76,7 +76,7 @@ struct dependency_check : public unary_function<bool, PackagedP> {
bool operator () (PackagedP package) {
return package->name() == dep->package && package->version >= dep->version;
}
private:
private:
PackageDependencyP dep;
};
@@ -268,7 +268,7 @@ DownloadableInstaller::DownloadableInstaller(const InstallerP& installer)
DownloadableInstaller::~DownloadableInstaller() {
if (!installer_file.empty()) {
wxRemoveFile(installer_file);
remove_file(installer_file);
}
}
+6 -6
View File
@@ -30,7 +30,7 @@ DECLARE_POINTER_TYPE(InstallablePackage);
/** Installers will be sent around the internet, etc. so they are fairly selfcontained.
*/
class Installer : public Packaged {
public:
public:
String prefered_filename; ///< What filename should be used (by default), when creating the installer
vector<PackageDescriptionP> packages; ///< Packages to install
@@ -42,7 +42,7 @@ class Installer : public Packaged {
*/
void addPackage(Packaged& package);
protected:
protected:
virtual String typeName() const;
virtual Version fileVersion() const;
virtual void validate(Version file_app_version);
@@ -56,7 +56,7 @@ class Installer : public Packaged {
* TODO: try to merge these!
*/
class PackageDescription : public IntrusivePtrBase<PackageDescription> {
public:
public:
PackageDescription();
PackageDescription(const Packaged& package);
@@ -80,7 +80,7 @@ class PackageDescription : public IntrusivePtrBase<PackageDescription> {
/// A description of the contents of an installer
class InstallerDescription : public IntrusivePtrBase<InstallerDescription> {
public:
public:
vector<PackageDescriptionP> packages;
DECLARE_REFLECTION();
@@ -88,7 +88,7 @@ class InstallerDescription : public IntrusivePtrBase<InstallerDescription> {
/// Information on an installer that can be downloaded
class DownloadableInstaller : public IntrusivePtrBase<DownloadableInstaller> {
public:
public:
DownloadableInstaller() : downloadable(true) {}
DownloadableInstaller(const InstallerP& installer);
~DownloadableInstaller();
@@ -133,7 +133,7 @@ inline bool flag(int flags, int flag) { return (flags & flag) == flag; }
/// A package that can be installed, or is already installed
class InstallablePackage : public IntrusivePtrVirtualBase {
public:
public:
/// A new package
InstallablePackage(const PackageDescriptionP&, const DownloadableInstallerP&);
/// An installed package
+1 -1
View File
@@ -245,7 +245,7 @@ void Keyword::prepare(const vector<KeywordParamP>& param_types, bool force) {
/// A node in a trie to match keywords
class KeywordTrie {
public:
public:
KeywordTrie();
~KeywordTrie();
+5 -5
View File
@@ -24,7 +24,7 @@ class Value;
// ----------------------------------------------------------------------------- : Keyword parameters
class ParamReferenceType : public IntrusivePtrBase<ParamReferenceType> {
public:
public:
String name; ///< Name of the parameter reference type
String description; ///< Description (for status bar)
StringScript script; ///< Code to insert into the reminder text script, input is the actual parameter name
@@ -34,7 +34,7 @@ class ParamReferenceType : public IntrusivePtrBase<ParamReferenceType> {
/// Parameter type of keywords
class KeywordParam : public IntrusivePtrBase<KeywordParam> {
public:
public:
KeywordParam();
String name; ///< Name of the parameter type
String description; ///< Description of the parameter type
@@ -73,7 +73,7 @@ class KeywordParam : public IntrusivePtrBase<KeywordParam> {
/// Information on when and how to use a keyword
class KeywordMode : public IntrusivePtrBase<KeywordMode> {
public:
public:
KeywordMode() : is_default(false) {}
String name; ///< Name of the mode
@@ -87,7 +87,7 @@ class KeywordMode : public IntrusivePtrBase<KeywordMode> {
/// A keyword for a set or a game
class Keyword : public IntrusivePtrVirtualBase {
public:
public:
Keyword() : fixed(false), valid(false) {}
String keyword; ///< The keyword, only for human use
@@ -183,7 +183,7 @@ private:
/// A script value containing the value of a keyword parameter
class KeywordParamValue : public ScriptValue {
public:
public:
KeywordParamValue(const String& type, const String& separator_before, const String& separator_after, const String& value)
: type_name(type), separator_before(separator_before), separator_after(separator_after), value(value)
{}
+8 -8
View File
@@ -39,7 +39,7 @@ enum PackSelectType
/// A card pack description for playtesting
class PackType : public IntrusivePtrBase<PackType> {
public:
public:
PackType();
String name; ///< Name of this pack
@@ -53,14 +53,14 @@ class PackType : public IntrusivePtrBase<PackType> {
/// Update scripts, returns true if there is a change
bool update(Context& ctx);
private:
private:
DECLARE_REFLECTION();
};
void after_reading(PackType&, Version);
/// An item in a PackType
class PackItem : public IntrusivePtrBase<PackItem> {
public:
public:
PackItem();
PackItem(const String& name, int amount);
@@ -71,7 +71,7 @@ class PackItem : public IntrusivePtrBase<PackItem> {
/// Update scripts, returns true if there is a change
bool update(Context& ctx);
private:
private:
DECLARE_REFLECTION();
};
@@ -84,7 +84,7 @@ inline String type_name(const PackType&) {
// A PackType that is instantiated for a particular Set,
// i.e. we now know the actual cards
class PackInstance : public IntrusivePtrBase<PackInstance> {
public:
public:
PackInstance(const PackType& pack_type, PackGenerator& parent);
/// Expect to pick this many copies from this pack, updates expected_copies
@@ -104,7 +104,7 @@ class PackInstance : public IntrusivePtrBase<PackInstance> {
inline size_t get_card_copies() const { return card_copies; }
inline double get_expected_copies() const { return expected_copies; }
private:
private:
const PackType& pack_type;
PackGenerator& parent;
int depth; //< 0 = no items, otherwise 1+max depth of items refered to
@@ -121,7 +121,7 @@ class PackInstance : public IntrusivePtrBase<PackInstance> {
};
class PackGenerator {
public:
public:
/// Reset the generator, possibly switching the set or reseeding
void reset(const SetP& set, int seed);
/// Reset the generator, but not the set
@@ -139,7 +139,7 @@ class PackGenerator {
// only for PackInstance
SetP set; ///< The set
mt19937 gen; ///< Random generator
private:
private:
/// Details for each PackType
map<String,PackInstanceP> instances;
int max_depth;
+5 -5
View File
@@ -36,7 +36,7 @@ typedef intrusive_ptr<OrderCache<CardP> > OrderCacheP;
/// A set of cards
class Set : public Packaged {
public:
public:
/// Create a set, the set should be open()ed later
Set();
/// Create a set using the given game
@@ -119,12 +119,12 @@ class Set : public Packaged {
/// Validate that the set is correctly loaded
virtual void validate(Version = app_version);
protected:
protected:
virtual VCSP getVCS() {
return vcs;
}
private:
private:
DECLARE_REFLECTION();
template <typename Handler>
void reflect_cards(Handler& handler);
@@ -154,7 +154,7 @@ void mark_dependency_member(const Set& set, const String& name, const Dependency
/** To listen to events, derived classes should override onAction(const Action&, bool undone)
*/
class SetView : public ActionListener {
public:
public:
SetView();
~SetView();
@@ -163,7 +163,7 @@ class SetView : public ActionListener {
/// Change the set that is being viewed
void setSet(const SetP& set);
protected:
protected:
/// The set that is currently being viewed, should not be modified directly!
SetP set;
+10 -10
View File
@@ -56,7 +56,7 @@ enum FilenameConflicts
/// Settings of a single column in the card list
class ColumnSettings {
public:
public:
ColumnSettings();
UInt width;
int position;
@@ -67,7 +67,7 @@ class ColumnSettings {
/// Settings for a Game
class GameSettings : public IntrusivePtrBase<GameSettings> {
public:
public:
GameSettings();
/// Where the settings have defaults, initialize with the values from the game
@@ -87,13 +87,13 @@ class GameSettings : public IntrusivePtrBase<GameSettings> {
int pack_seed;
DECLARE_REFLECTION();
private:
private:
bool initialized;
};
/// Settings for a StyleSheet
class StyleSheetSettings : public IntrusivePtrBase<StyleSheetSettings> {
public:
public:
StyleSheetSettings();
// Rendering/display settings
@@ -126,7 +126,7 @@ enum PageLayoutType
* Settings are loaded at startup, and stored at shutdown.
*/
class Settings {
public:
public:
/// Default constructor initializes default settings
Settings();
@@ -171,16 +171,16 @@ class Settings {
/// Get the settings object for a specific stylesheet
StyleSheetSettings& stylesheetSettingsFor(const StyleSheet& stylesheet);
private:
private:
map<String,GameSettingsP> game_settings;
map<String,StyleSheetSettingsP> stylesheet_settings;
public:
public:
StyleSheetSettings default_stylesheet_settings; ///< The default settings for stylesheets
// --------------------------------------------------- : Exports
private:
private:
DelayedIndexMaps<FieldP,ValueP> export_options;
public:
public:
/// Get the options for an export template
IndexMap<FieldP,ValueP>& exportOptionsFor(const ExportTemplate& export_template);
@@ -212,7 +212,7 @@ class Settings {
/// Store the settings in the standard location
void write();
private:
private:
/// Name of the settings file
String settingsFile();
/// Clear settings before reading them
+2 -2
View File
@@ -22,7 +22,7 @@ DECLARE_POINTER_TYPE(StatsCategory);
/// A dimension that can be plotted as an axis in a graph
/** Dimensions can be generated automatically based on card fields */
class StatsDimension : public IntrusivePtrBase<StatsDimension> {
public:
public:
StatsDimension();
StatsDimension(const Field&);
@@ -48,7 +48,7 @@ class StatsDimension : public IntrusivePtrBase<StatsDimension> {
/// A category for statistics
/** Can be generated automatically based on a dimension */
class StatsCategory : public IntrusivePtrBase<StatsCategory> {
public:
public:
StatsCategory();
StatsCategory(const StatsDimensionP&);
+2 -2
View File
@@ -25,7 +25,7 @@ DECLARE_DYNAMIC_ARG(StyleSheet*, stylesheet_for_reading);
/// A collection of style information for card and set fields
class StyleSheet : public Packaged {
public:
public:
StyleSheet();
GameP game; ///< The game this stylesheet is made for
@@ -67,7 +67,7 @@ class StyleSheet : public Packaged {
/// Validate the stylesheet
virtual void validate(Version = app_version);
protected:
protected:
DECLARE_REFLECTION();
};
+10 -10
View File
@@ -48,7 +48,7 @@ enum WhichHandle
/// A control point (corner) of a SymbolShape (polygon/bezier-gon)
class ControlPoint : public IntrusivePtrBase<ControlPoint> {
public:
public:
Vector2D pos; ///< position of the control point itself
Vector2D delta_before; ///< delta to bezier control point, for curve before point
Vector2D delta_after; ///< delta to bezier control point, for curve after point
@@ -80,7 +80,7 @@ class ControlPoint : public IntrusivePtrBase<ControlPoint> {
/// A specific handle of a ControlPoint
class SelectedHandle {
public:
public:
ControlPointP point; ///< the selected point
WhichHandle handle; ///< the selected handle of the point
@@ -109,7 +109,7 @@ class SelectedHandle {
/// Bounding box of a symbol part
class Bounds {
public:
public:
inline Bounds() : min(Vector2D::infinity()), max(-Vector2D::infinity()) {}
inline explicit Bounds(const Vector2D& p) : min(p), max(p) {}
inline Bounds(const Vector2D& min, const Vector2D& max) : min(min), max(max) {}
@@ -135,7 +135,7 @@ class Bounds {
/// A part of a symbol, not necesserly a shape
class SymbolPart : public IntrusivePtrVirtualBase {
public:
public:
/// Name/label for this part
String name;
/// Position and size of the part.
@@ -196,7 +196,7 @@ inline size_t mod(int a, size_t size) {
/// A single shape (polygon/bezier-gon) in a Symbol
class SymbolShape : public SymbolPart {
public:
public:
/// The points of this polygon
vector<ControlPointP> points;
/// How is this part combined with parts below it?
@@ -231,7 +231,7 @@ class SymbolShape : public SymbolPart {
/// A group of symbol parts
class SymbolGroup : public SymbolPart {
public:
public:
vector<SymbolPartP> parts; ///< The parts in this group, first item is on top
SymbolGroup();
@@ -259,7 +259,7 @@ enum SymbolSymmetryType
/// A mirror, reflecting the part of the symbol in the group
/** Can handle rotation symmetry with any number of reflections */
class SymbolSymmetry : public SymbolGroup {
public:
public:
SymbolSymmetryType kind; ///< What kind of symmetry
int copies; ///< How many times is the orignal reflected (including the original itself)
bool clip; ///< Clip the orignal so it doesn't intersect the mirror(s)
@@ -284,7 +284,7 @@ class SymbolSymmetry : public SymbolGroup {
/// An editable symbol, consists of any number of SymbolParts
class Symbol : public SymbolGroup {
public:
public:
/// Actions performed on this symbol and the parts in it
ActionStack actions;
@@ -304,7 +304,7 @@ SymbolP default_symbol();
/** To listen to events, derived classes should override onAction(const Action&, bool undone)
*/
class SymbolView : public ActionListener {
public:
public:
SymbolView();
~SymbolView();
@@ -313,7 +313,7 @@ class SymbolView : public ActionListener {
/// Change the symbol that is being viewed
void setSymbol(const SymbolP& symbol);
protected:
protected:
/// The symbol that is currently being viewed, should not be modified directly!
SymbolP symbol;
+2 -2
View File
@@ -60,7 +60,7 @@ IMPLEMENT_REFLECTION(SymbolFont) {
/// A symbol in a symbol font
class SymbolInFont : public IntrusivePtrBase<SymbolInFont> {
public:
public:
SymbolInFont();
/// Get a shrunk, zoomed image
@@ -89,7 +89,7 @@ class SymbolInFont : public IntrusivePtrBase<SymbolInFont> {
double text_margin_right;
double text_margin_top;
double text_margin_bottom;
private:
private:
ScriptableImage image; ///< The image for this symbol
double img_size; ///< Font size used by the image
wxSize actual_size; ///< Actual image size, only known after loading the image
+7 -7
View File
@@ -25,7 +25,7 @@ struct CharInfo;
/// A font that is drawn using images
class SymbolFont : public Packaged {
public:
public:
SymbolFont();
~SymbolFont();
@@ -37,7 +37,7 @@ class SymbolFont : public Packaged {
/// A symbol to be drawn
class DrawableSymbol {
public:
public:
inline DrawableSymbol(const String& text, const String& draw_text, SymbolInFont& symbol)
: text(text), draw_text(draw_text), symbol(&symbol)
{}
@@ -81,7 +81,7 @@ class SymbolFont : public Packaged {
/** Return the code representing the symbol */
String insertSymbolCode(int menu_id) const;
private:
private:
double img_size; ///< Font size that the images use
RealSize spacing; ///< Spacing between sybmols (for the default font size)
// writing text
@@ -102,7 +102,7 @@ class SymbolFont : public Packaged {
/// Size of a single symbol, including spacing
RealSize symbolSize (double font_size, const DrawableSymbol& sym);
public:
public:
/// The default size of symbols, including spacing
RealSize defaultSymbolSize(double font_size);
@@ -120,7 +120,7 @@ enum MenuItemType
/// Description of a menu to insert symbols from a symbol font into the text
class InsertSymbolMenu : public IntrusivePtrBase<InsertSymbolMenu> {
public:
public:
InsertSymbolMenu();
MenuItemType type;
@@ -143,7 +143,7 @@ class InsertSymbolMenu : public IntrusivePtrBase<InsertSymbolMenu> {
/// A reference to an actual symbol font
class SymbolFontRef {
public:
public:
SymbolFontRef();
// Script update
@@ -159,7 +159,7 @@ class SymbolFontRef {
Scriptable<Alignment> alignment; ///< Alignment of symbols in a line of text
SymbolFontP font; ///< The font, if it is loaded
private:
private:
DECLARE_REFLECTION();
/// (re)load the symbol font based on name
+3 -3
View File
@@ -20,7 +20,7 @@ DECLARE_POINTER_TYPE(AutoReplace);
/// A word in a WordList
class WordListWord : public IntrusivePtrBase<WordListWord> {
public:
public:
WordListWord();
String name; ///< Name of the list / the word
@@ -36,7 +36,7 @@ class WordListWord : public IntrusivePtrBase<WordListWord> {
/// A list of words for a drop down box
class WordList : public WordListWord {
public:
public:
DECLARE_REFLECTION();
};
@@ -44,7 +44,7 @@ class WordList : public WordListWord {
/// Autoreplace specific shortcut words
class AutoReplace : public IntrusivePtrVirtualBase {
public:
public:
AutoReplace();
bool enabled;