diff --git a/src/apps/icon-o-matic/CanvasView.h b/src/apps/icon-o-matic/CanvasView.h index a5bcaaefb7..72286c5b55 100644 --- a/src/apps/icon-o-matic/CanvasView.h +++ b/src/apps/icon-o-matic/CanvasView.h @@ -1,20 +1,27 @@ /* - * Copyright 2006, Haiku. + * Copyright 2006-2007, Haiku. * Distributed under the terms of the MIT License. * * Authors: * Stephan Aßmus */ - #ifndef CANVAS_VIEW_H #define CANVAS_VIEW_H + #include "Icon.h" #include "Scrollable.h" #include "StateView.h" + class BBitmap; -class IconRenderer; + +namespace BPrivate { +namespace Icon { + class IconRenderer; +} +} +using namespace BPrivate::Icon; enum { SNAPPING_OFF = 0, diff --git a/src/apps/icon-o-matic/MainWindow.h b/src/apps/icon-o-matic/MainWindow.h index d623eb0122..3d87b00d70 100644 --- a/src/apps/icon-o-matic/MainWindow.h +++ b/src/apps/icon-o-matic/MainWindow.h @@ -19,7 +19,6 @@ class BMenuBar; class BMenuItem; class CanvasView; class Document; -class Icon; class IconObjectListView; class IconEditorApp; class IconView; @@ -30,6 +29,13 @@ class StyleView; class SwatchGroup; class TransformerListView; +namespace BPrivate { +namespace Icon { + class Icon; +} +} +using namespace BPrivate::Icon; + class MultipleManipulatorState; enum { diff --git a/src/apps/icon-o-matic/Util.h b/src/apps/icon-o-matic/Util.h index 70e7149aad..b22eae3ddf 100644 --- a/src/apps/icon-o-matic/Util.h +++ b/src/apps/icon-o-matic/Util.h @@ -1,22 +1,30 @@ /* - * Copyright 2006, Haiku. All rights reserved. + * Copyright 2006-2007, Haiku. All rights reserved. * Distributed under the terms of the MIT License. * * Authors: * Stephan Aßmus */ - #ifndef UTIL_H #define UTIL_H + #include + class AddPathsCommand; class AddStylesCommand; -class PathContainer; -class Style; -class StyleContainer; -class VectorPath; + +namespace BPrivate { +namespace Icon { + class PathContainer; + class Style; + class StyleContainer; + class VectorPath; +} +} +using namespace BPrivate::Icon; + void new_style(rgb_color color, StyleContainer* container, Style** style, AddStylesCommand** command); @@ -24,5 +32,4 @@ void new_style(rgb_color color, StyleContainer* container, void new_path(PathContainer* container, VectorPath** path, AddPathsCommand** command, VectorPath* other = NULL); - -#endif // UTIL_H +#endif // UTIL_H diff --git a/src/apps/icon-o-matic/document/Document.cpp b/src/apps/icon-o-matic/document/Document.cpp index c6263d7b3c..02b63492e8 100644 --- a/src/apps/icon-o-matic/document/Document.cpp +++ b/src/apps/icon-o-matic/document/Document.cpp @@ -1,29 +1,33 @@ /* - * Copyright 2006, Haiku. + * Copyright 2006-2007, Haiku. * Distributed under the terms of the MIT License. * * Authors: * Stephan Aßmus */ + #include "Document.h" -#include -#include - -#include - #include "CommandStack.h" #include "DocumentSaver.h" #include "Icon.h" #include "Selection.h" +#include + +#include +#include + + using std::nothrow; +using namespace BPrivate::Icon; + // constructor Document::Document(const char* name) : RWLocker("document rw lock"), - fIcon(new (nothrow) ::Icon()), + fIcon(new (nothrow) BPrivate::Icon::Icon()), fCommandStack(new (nothrow) ::CommandStack()), fSelection(new (nothrow) ::Selection()), @@ -80,7 +84,7 @@ Document::SetExportSaver(::DocumentSaver* saver) // SetIcon void -Document::SetIcon(::Icon* icon) +Document::SetIcon(BPrivate::Icon::Icon* icon) { if (fIcon == icon) return; diff --git a/src/apps/icon-o-matic/document/Document.h b/src/apps/icon-o-matic/document/Document.h index 72c14127b9..b26bdf642a 100644 --- a/src/apps/icon-o-matic/document/Document.h +++ b/src/apps/icon-o-matic/document/Document.h @@ -1,24 +1,31 @@ /* - * Copyright 2006, Haiku. + * Copyright 2006-2007, Haiku. * Distributed under the terms of the MIT License. * * Authors: * Stephan Aßmus */ - #ifndef DOCUMENT_H #define DOCUMENT_H -#include #include "Observable.h" #include "RWLocker.h" +#include + struct entry_ref; +namespace BPrivate { +namespace Icon { + +class Icon; + +} // namespace Icon +} // namespace BPrivate + class CommandStack; class DocumentSaver; -class Icon; class Selection; class Document : public RWLocker, @@ -44,14 +51,14 @@ class Document : public RWLocker, inline ::DocumentSaver* ExportSaver() const { return fExportSaver; } - void SetIcon(::Icon* icon); - inline ::Icon* Icon() const + void SetIcon(BPrivate::Icon::Icon* icon); + inline BPrivate::Icon::Icon* Icon() const { return fIcon; } void MakeEmpty(bool includingSavers = true); private: - ::Icon* fIcon; + BPrivate::Icon::Icon* fIcon; ::CommandStack* fCommandStack; ::Selection* fSelection; diff --git a/src/apps/icon-o-matic/gui/GradientControl.h b/src/apps/icon-o-matic/gui/GradientControl.h index 16bdb8d367..96b9bf0ac6 100644 --- a/src/apps/icon-o-matic/gui/GradientControl.h +++ b/src/apps/icon-o-matic/gui/GradientControl.h @@ -1,22 +1,29 @@ /* - * Copyright 2006, Haiku. + * Copyright 2006-2007, Haiku. * Distributed under the terms of the MIT License. * * Authors: * Stephan Aßmus */ - #ifndef GRADIENT_CONTROL_H #define GRADIENT_CONTROL_H + #include + #if LIB_LAYOUT -#include +# include #endif +namespace BPrivate { +namespace Icon { + class Gradient; +} // namespace Icon +} // namespace BPrivate + enum { MSG_GRADIENT_CONTROL_FOCUS_CHANGED = 'gcfc', }; @@ -54,8 +61,9 @@ class GradientControl : virtual void FrameResized(float width, float height); // GradientControl - void SetGradient(const ::Gradient* gradient); - ::Gradient* Gradient() const + void SetGradient(const BPrivate::Icon::Gradient* + gradient); + BPrivate::Icon::Gradient* Gradient() const { return fGradient; } void SetCurrentStop(const rgb_color& color); @@ -73,7 +81,7 @@ class GradientControl : float _OffsetFor(BPoint where) const; void _UpdateCurrentColor() const; - ::Gradient* fGradient; + BPrivate::Icon::Gradient* fGradient; BBitmap* fGradientBitmap; int32 fDraggingStepIndex; int32 fCurrentStepIndex; diff --git a/src/apps/icon-o-matic/gui/IconView.h b/src/apps/icon-o-matic/gui/IconView.h index ac378135a3..1007ec3380 100644 --- a/src/apps/icon-o-matic/gui/IconView.h +++ b/src/apps/icon-o-matic/gui/IconView.h @@ -1,20 +1,27 @@ /* - * Copyright 2006, Haiku. + * Copyright 2006-2007, Haiku. * Distributed under the terms of the MIT License. * * Authors: * Stephan Aßmus */ - #ifndef ICON_VIEW_H #define ICON_VIEW_H -#include #include "Icon.h" +#include + + class BBitmap; -class IconRenderer; + +namespace BPrivate { +namespace Icon { + class IconRenderer; +} +} +using namespace BPrivate::Icon; class IconView : public BView, public IconListener { diff --git a/src/apps/icon-o-matic/gui/PathListView.h b/src/apps/icon-o-matic/gui/PathListView.h index 82cc465285..44ebb2d462 100644 --- a/src/apps/icon-o-matic/gui/PathListView.h +++ b/src/apps/icon-o-matic/gui/PathListView.h @@ -1,5 +1,5 @@ /* - * Copyright 2006, Haiku. + * Copyright 2006-2007, Haiku. * Distributed under the terms of the MIT License. * * Authors: @@ -8,20 +8,28 @@ #ifndef PATH_LIST_VIEW_H #define PATH_LIST_VIEW_H + #include "ListViews.h" #include "PathContainer.h" class BMenu; class BMenuItem; +namespace BPrivate { +namespace Icon { + class VectorPath; + class Shape; + class ShapeContainer; +} +} + class CommandStack; -class VectorPath; class PathListItem; class Selection; -class Shape; -class ShapeContainer; class ShapePathListener; +using namespace BPrivate::Icon; + class PathListView : public SimpleListView, public PathContainerListener { public: diff --git a/src/apps/icon-o-matic/gui/ShapeListView.h b/src/apps/icon-o-matic/gui/ShapeListView.h index ce0ccb77e1..f297407c08 100644 --- a/src/apps/icon-o-matic/gui/ShapeListView.h +++ b/src/apps/icon-o-matic/gui/ShapeListView.h @@ -1,24 +1,31 @@ /* - * Copyright 2006, Haiku. + * Copyright 2006-2007, Haiku. * Distributed under the terms of the MIT License. * * Authors: * Stephan Aßmus */ - #ifndef SHAPE_LIST_VIEW_H #define SHAPE_LIST_VIEW_H + #include "ListViews.h" #include "ShapeContainer.h" + class BMenu; class BMenuItem; class CommandStack; -class Shape; class ShapeListItem; class Selection; +namespace BPrivate { +namespace Icon { + class Shape; +} +} +using namespace BPrivate::Icon; + enum { MSG_ADD_SHAPE = 'adsh', }; diff --git a/src/apps/icon-o-matic/gui/StyleListView.h b/src/apps/icon-o-matic/gui/StyleListView.h index 248d970945..49e5e99416 100644 --- a/src/apps/icon-o-matic/gui/StyleListView.h +++ b/src/apps/icon-o-matic/gui/StyleListView.h @@ -1,28 +1,35 @@ /* - * Copyright 2006, Haiku. + * Copyright 2006-2007, Haiku. * Distributed under the terms of the MIT License. * * Authors: * Stephan Aßmus */ - #ifndef STYLE_LIST_VIEW_H #define STYLE_LIST_VIEW_H + #include "ListViews.h" #include "StyleContainer.h" + class BMenu; class BMenuItem; class CommandStack; class Selection; -class Shape; -class ShapeContainer; -class ShapeListener; class ShapeStyleListener; -class Style; class StyleListItem; +namespace BPrivate { +namespace Icon { + class Shape; + class ShapeContainer; + class ShapeListener; + class Style; +} +} +using namespace BPrivate::Icon; + class StyleListView : public SimpleListView, public StyleContainerListener { public: diff --git a/src/apps/icon-o-matic/gui/StyleView.h b/src/apps/icon-o-matic/gui/StyleView.h index 26c0f10d5c..bebf746df5 100644 --- a/src/apps/icon-o-matic/gui/StyleView.h +++ b/src/apps/icon-o-matic/gui/StyleView.h @@ -1,25 +1,32 @@ /* - * Copyright 2006, Haiku. + * Copyright 2006-2007, Haiku. * Distributed under the terms of the MIT License. * * Authors: * Stephan Aßmus */ - #ifndef STYLE_VIEW_H #define STYLE_VIEW_H -#include #include "Observer.h" +#include + + class BMenu; class BMenuField; class CommandStack; class CurrentColor; -class Gradient; class GradientControl; -class Style; + +namespace BPrivate { +namespace Icon { + class Gradient; + class Style; +} +} +using namespace BPrivate::Icon; // TODO: write lock the document when changing something... diff --git a/src/apps/icon-o-matic/gui/TransformerListView.h b/src/apps/icon-o-matic/gui/TransformerListView.h index 2dc96d80d7..ee6410c813 100644 --- a/src/apps/icon-o-matic/gui/TransformerListView.h +++ b/src/apps/icon-o-matic/gui/TransformerListView.h @@ -1,23 +1,29 @@ /* - * Copyright 2006, Haiku. + * Copyright 2006-2007, Haiku. * Distributed under the terms of the MIT License. * * Authors: * Stephan Aßmus */ - #ifndef TRANSFORMER_LIST_VIEW_H #define TRANSFORMER_LIST_VIEW_H + #include "ListViews.h" #include "Shape.h" + class BMenu; class CommandStack; -class Transformer; class TransformerItem; class Selection; +namespace BPrivate { +namespace Icon { + class Transformer; +} +} + class TransformerListView : public SimpleListView, public ShapeListener { public: diff --git a/src/apps/icon-o-matic/import_export/Exporter.h b/src/apps/icon-o-matic/import_export/Exporter.h index 94da134f99..f323cccbd3 100644 --- a/src/apps/icon-o-matic/import_export/Exporter.h +++ b/src/apps/icon-o-matic/import_export/Exporter.h @@ -1,21 +1,30 @@ /* - * Copyright 2006, Haiku. All rights reserved. + * Copyright 2006-2007, Haiku. All rights reserved. * Distributed under the terms of the MIT License. * * Authors: * Stephan Aßmus */ - #ifndef EXPORTER_H #define EXPORTER_H + #include #include class BPositionIO; class Document; + +namespace BPrivate { +namespace Icon { + class Icon; +} // namespace Icon +} // namespace BPrivate + +using namespace BPrivate::Icon; + class Exporter { public: Exporter(); diff --git a/src/apps/icon-o-matic/import_export/Importer.h b/src/apps/icon-o-matic/import_export/Importer.h index ed6849770f..6405f864b7 100644 --- a/src/apps/icon-o-matic/import_export/Importer.h +++ b/src/apps/icon-o-matic/import_export/Importer.h @@ -5,14 +5,23 @@ * Authors: * Stephan Aßmus */ - #ifndef IMPORTER_H #define IMPORTER_H + #include + +namespace BPrivate { +namespace Icon { + class Icon; +} // namespace Icon +} // namespace BPrivate + +using namespace BPrivate::Icon; + class Importer { public: Importer(); diff --git a/src/apps/icon-o-matic/import_export/flat_icon/FlatIconExporter.h b/src/apps/icon-o-matic/import_export/flat_icon/FlatIconExporter.h index e78d5f3588..56bfb20eeb 100644 --- a/src/apps/icon-o-matic/import_export/flat_icon/FlatIconExporter.h +++ b/src/apps/icon-o-matic/import_export/flat_icon/FlatIconExporter.h @@ -1,27 +1,34 @@ /* - * Copyright 2006, Haiku. All rights reserved. + * Copyright 2006-2007, Haiku. All rights reserved. * Distributed under the terms of the MIT License. * * Authors: * Stephan Aßmus */ - #ifndef FLAT_ICON_EXPORTER_H #define FLAT_ICON_EXPORTER_H + #include "Exporter.h" + class BMessage; class BNode; class BPositionIO; + +namespace BPrivate { +namespace Icon { + class Gradient; -class Icon; class LittleEndianBuffer; class PathContainer; class ShapeContainer; class StyleContainer; class VectorPath; +} // namespace Icon +} // namespace BPrivate + #define PRINT_STATISTICS 1 #if PRINT_STATISTICS diff --git a/src/apps/icon-o-matic/import_export/message/MessageExporter.h b/src/apps/icon-o-matic/import_export/message/MessageExporter.h index bdb2981c05..ffec1b4314 100644 --- a/src/apps/icon-o-matic/import_export/message/MessageExporter.h +++ b/src/apps/icon-o-matic/import_export/message/MessageExporter.h @@ -1,25 +1,30 @@ /* - * Copyright 2006, Haiku. All rights reserved. + * Copyright 2006-2007, Haiku. All rights reserved. * Distributed under the terms of the MIT License. * * Authors: * Stephan Aßmus */ - #ifndef MESSAGE_EXPORTER_H #define MESSAGE_EXPORTER_H + #include "Exporter.h" class BMessage; class BPositionIO; -class Icon; -class PathContainer; -class Shape; -class Style; -class StyleContainer; -class Transformer; -class VectorPath; + +namespace BPrivate { +namespace Icon { + class Icon; + class PathContainer; + class Shape; + class Style; + class StyleContainer; + class Transformer; + class VectorPath; +} +} class MessageExporter : public Exporter { public: diff --git a/src/apps/icon-o-matic/import_export/message/MessageImporter.h b/src/apps/icon-o-matic/import_export/message/MessageImporter.h index b9198c670c..f2481b106f 100644 --- a/src/apps/icon-o-matic/import_export/message/MessageImporter.h +++ b/src/apps/icon-o-matic/import_export/message/MessageImporter.h @@ -1,22 +1,27 @@ /* - * Copyright 2006, Haiku. All rights reserved. + * Copyright 2006-2007, Haiku. All rights reserved. * Distributed under the terms of the MIT License. * * Authors: * Stephan Aßmus */ - #ifndef MESSAGE_IMPORTER_H #define MESSAGE_IMPORTER_H + #include "Importer.h" class BMessage; class BPositionIO; -class Icon; -class PathContainer; -class ShapeContainer; -class StyleContainer; + +namespace BPrivate { +namespace Icon { + class Icon; + class PathContainer; + class ShapeContainer; + class StyleContainer; +} +} class MessageImporter : public Importer { public: diff --git a/src/apps/icon-o-matic/import_export/svg/DocumentBuilder.h b/src/apps/icon-o-matic/import_export/svg/DocumentBuilder.h index e5f7ddf348..c96b97aa78 100644 --- a/src/apps/icon-o-matic/import_export/svg/DocumentBuilder.h +++ b/src/apps/icon-o-matic/import_export/svg/DocumentBuilder.h @@ -41,15 +41,15 @@ #include "PathTokenizer.h" -class Icon; class SVGImporter; namespace BPrivate { namespace Icon { + class Icon; class Transformable; } } -using BPrivate::Icon::Transformable; +using namespace BPrivate::Icon; namespace agg { namespace svg { diff --git a/src/apps/icon-o-matic/import_export/svg/SVGExporter.h b/src/apps/icon-o-matic/import_export/svg/SVGExporter.h index 5e6b96d99b..8ca818acf1 100644 --- a/src/apps/icon-o-matic/import_export/svg/SVGExporter.h +++ b/src/apps/icon-o-matic/import_export/svg/SVGExporter.h @@ -1,28 +1,28 @@ /* - * Copyright 2006, Haiku. All rights reserved. + * Copyright 2006-2007, Haiku. All rights reserved. * Distributed under the terms of the MIT License. * * Authors: * Stephan Aßmus */ - #ifndef SVG_EXPORTER_H #define SVG_EXPORTER_H -#include #include "Exporter.h" -class Gradient; -class Shape; -class Style; +#include + namespace BPrivate { namespace Icon { + class Gradient; + class Shape; + class Style; class Transformable; } } -using BPrivate::Icon::Transformable; +using namespace BPrivate::Icon; class SVGExporter : public Exporter { public: diff --git a/src/apps/icon-o-matic/import_export/svg/SVGGradients.h b/src/apps/icon-o-matic/import_export/svg/SVGGradients.h index 6224b5a106..16e55ce886 100644 --- a/src/apps/icon-o-matic/import_export/svg/SVGGradients.h +++ b/src/apps/icon-o-matic/import_export/svg/SVGGradients.h @@ -1,22 +1,25 @@ /* - * Copyright 2006, Haiku. All rights reserved. + * Copyright 2006-2007, Haiku. All rights reserved. * Distributed under the terms of the MIT License. * * Authors: * Stephan Aßmus */ - - #ifndef SVG_GRADIENTS_H #define SVG_GRADIENTS_H -#include -#include #include #include -class Gradient; +#include +#include + +namespace BPrivate { +namespace Icon { + class Gradient; +} +} namespace agg { namespace svg { diff --git a/src/apps/icon-o-matic/shape/commands/AddPathsCommand.h b/src/apps/icon-o-matic/shape/commands/AddPathsCommand.h index e7d3956fd1..655086e94d 100644 --- a/src/apps/icon-o-matic/shape/commands/AddPathsCommand.h +++ b/src/apps/icon-o-matic/shape/commands/AddPathsCommand.h @@ -1,18 +1,24 @@ /* - * Copyright 2006, Haiku. + * Copyright 2006-2007, Haiku. * Distributed under the terms of the MIT License. * * Authors: * Stephan Aßmus */ - #ifndef ADD_PATHS_COMMAND_H #define ADD_PATHS_COMMAND_H + #include "Command.h" -class VectorPath; -class PathContainer; + +namespace BPrivate { +namespace Icon { + class VectorPath; + class PathContainer; +} +} +using namespace BPrivate::Icon; class AddPathsCommand : public Command { public: diff --git a/src/apps/icon-o-matic/shape/commands/AddPointCommand.h b/src/apps/icon-o-matic/shape/commands/AddPointCommand.h index 963b061005..d51ffcb01d 100644 --- a/src/apps/icon-o-matic/shape/commands/AddPointCommand.h +++ b/src/apps/icon-o-matic/shape/commands/AddPointCommand.h @@ -1,18 +1,19 @@ /* - * Copyright 2006, Haiku. + * Copyright 2006-2007, Haiku. * Distributed under the terms of the MIT License. * * Authors: * Stephan Aßmus */ - #ifndef ADD_POINT_COMMAND_H #define ADD_POINT_COMMAND_H -#include #include "PathCommand.h" +#include + + class AddPointCommand : public PathCommand { public: AddPointCommand(VectorPath* path, diff --git a/src/apps/icon-o-matic/shape/commands/AddShapesCommand.h b/src/apps/icon-o-matic/shape/commands/AddShapesCommand.h index 91de560edd..0d78c4de24 100644 --- a/src/apps/icon-o-matic/shape/commands/AddShapesCommand.h +++ b/src/apps/icon-o-matic/shape/commands/AddShapesCommand.h @@ -1,20 +1,27 @@ /* - * Copyright 2006, Haiku. + * Copyright 2006-2007, Haiku. * Distributed under the terms of the MIT License. * * Authors: * Stephan Aßmus */ - #ifndef ADD_SHAPES_COMMAND_H #define ADD_SHAPES_COMMAND_H + #include "Command.h" -class Shape; -class ShapeContainer; + class Selection; +namespace BPrivate { +namespace Icon { + class Shape; + class ShapeContainer; +} +} +using namespace BPrivate::Icon; + class AddShapesCommand : public Command { public: AddShapesCommand( diff --git a/src/apps/icon-o-matic/shape/commands/AddTransformersCommand.h b/src/apps/icon-o-matic/shape/commands/AddTransformersCommand.h index 461817f7de..5f6b392282 100644 --- a/src/apps/icon-o-matic/shape/commands/AddTransformersCommand.h +++ b/src/apps/icon-o-matic/shape/commands/AddTransformersCommand.h @@ -1,18 +1,24 @@ /* - * Copyright 2006, Haiku. + * Copyright 2006-2007, Haiku. * Distributed under the terms of the MIT License. * * Authors: * Stephan Aßmus */ - #ifndef ADD_TRANSFORMERS_COMMAND_H #define ADD_TRANSFORMERS_COMMAND_H + #include "Command.h" -class Shape; -class Transformer; + +namespace BPrivate { +namespace Icon { + class Shape; + class Transformer; +} +} +using namespace BPrivate::Icon; // TODO: make a templated "add items" command? diff --git a/src/apps/icon-o-matic/shape/commands/FreezeTransformationCommand.h b/src/apps/icon-o-matic/shape/commands/FreezeTransformationCommand.h index 346ff6c5ad..498b6cc39e 100644 --- a/src/apps/icon-o-matic/shape/commands/FreezeTransformationCommand.h +++ b/src/apps/icon-o-matic/shape/commands/FreezeTransformationCommand.h @@ -1,24 +1,24 @@ /* - * Copyright 2006, Haiku. + * Copyright 2006-2007, Haiku. * Distributed under the terms of the MIT License. * * Authors: * Stephan Aßmus */ - #ifndef FREEZE_TRANSFORMATION_COMMAND_H #define FREEZE_TRANSFORMATION_COMMAND_H + #include "Command.h" -class Shape; namespace BPrivate { namespace Icon { + class Shape; class Transformable; } } -using BPrivate::Icon::Transformable; +using namespace BPrivate::Icon; class FreezeTransformationCommand : public Command { public: diff --git a/src/apps/icon-o-matic/shape/commands/MovePathsCommand.h b/src/apps/icon-o-matic/shape/commands/MovePathsCommand.h index 6f3dad5519..be0369f732 100644 --- a/src/apps/icon-o-matic/shape/commands/MovePathsCommand.h +++ b/src/apps/icon-o-matic/shape/commands/MovePathsCommand.h @@ -1,20 +1,25 @@ /* - * Copyright 2006, Haiku. + * Copyright 2006-2007, Haiku. * Distributed under the terms of the MIT License. * * Authors: * Stephan Aßmus */ - #ifndef MOVE_SHAPES_COMMAND_H #define MOVE_SHAPES_COMMAND_H + #include "Command.h" // TODO: make a templated "move items" command? -class VectorPath; -class PathContainer; +namespace BPrivate { +namespace Icon { + class VectorPath; + class PathContainer; +} +} +using namespace BPrivate::Icon; class MovePathsCommand : public Command { public: diff --git a/src/apps/icon-o-matic/shape/commands/MoveShapesCommand.h b/src/apps/icon-o-matic/shape/commands/MoveShapesCommand.h index 3efcc7e7f8..6e0c836c55 100644 --- a/src/apps/icon-o-matic/shape/commands/MoveShapesCommand.h +++ b/src/apps/icon-o-matic/shape/commands/MoveShapesCommand.h @@ -1,20 +1,26 @@ /* - * Copyright 2006, Haiku. + * Copyright 2006-2007, Haiku. * Distributed under the terms of the MIT License. * * Authors: * Stephan Aßmus */ - #ifndef MOVE_SHAPES_COMMAND_H #define MOVE_SHAPES_COMMAND_H + #include "Command.h" + // TODO: make a templated "move items" command? -class Shape; -class ShapeContainer; +namespace BPrivate { +namespace Icon { + class Shape; + class ShapeContainer; +} +} +using namespace BPrivate::Icon; class MoveShapesCommand : public Command { public: diff --git a/src/apps/icon-o-matic/shape/commands/MoveTransformersCommand.h b/src/apps/icon-o-matic/shape/commands/MoveTransformersCommand.h index 8c36203ea1..e6ead77d5a 100644 --- a/src/apps/icon-o-matic/shape/commands/MoveTransformersCommand.h +++ b/src/apps/icon-o-matic/shape/commands/MoveTransformersCommand.h @@ -5,16 +5,21 @@ * Authors: * Stephan Aßmus */ - #ifndef MOVE_TRANSFORMERS_COMMAND_H #define MOVE_TRANSFORMERS_COMMAND_H + #include "Command.h" // TODO: make a templated "move items" command? -class Shape; -class Transformer; +namespace BPrivate { +namespace Icon { + class Shape; + class Transformer; +} +} +using namespace BPrivate::Icon; class MoveTransformersCommand : public Command { public: diff --git a/src/apps/icon-o-matic/shape/commands/NudgePointsCommand.h b/src/apps/icon-o-matic/shape/commands/NudgePointsCommand.h index 578f702850..b9a1723556 100644 --- a/src/apps/icon-o-matic/shape/commands/NudgePointsCommand.h +++ b/src/apps/icon-o-matic/shape/commands/NudgePointsCommand.h @@ -1,21 +1,26 @@ /* - * Copyright 2006, Haiku. + * Copyright 2006-2007, Haiku. * Distributed under the terms of the MIT License. * * Authors: * Stephan Aßmus */ - #ifndef NUDGE_POINTS_ACTION_H #define NUDGE_POINTS_ACTION_H -#include #include "TransformCommand.h" -class VectorPath; +#include -struct control_point; + +namespace BPrivate { +namespace Icon { + class VectorPath; + struct control_point; +} +} +using namespace BPrivate::Icon; class NudgePointsCommand : public TransformCommand { public: diff --git a/src/apps/icon-o-matic/shape/commands/PathCommand.h b/src/apps/icon-o-matic/shape/commands/PathCommand.h index aa44ecede0..2731add851 100644 --- a/src/apps/icon-o-matic/shape/commands/PathCommand.h +++ b/src/apps/icon-o-matic/shape/commands/PathCommand.h @@ -1,17 +1,23 @@ /* - * Copyright 2006, Haiku. + * Copyright 2006-2007, Haiku. * Distributed under the terms of the MIT License. * * Authors: * Stephan Aßmus */ - #ifndef PATH_COMMAND_H #define PATH_COMMAND_H + #include "Command.h" -class VectorPath; + +namespace BPrivate { +namespace Icon { + class VectorPath; +} +} +using namespace BPrivate::Icon; class PathCommand : public Command { public: diff --git a/src/apps/icon-o-matic/shape/commands/RemovePathsCommand.h b/src/apps/icon-o-matic/shape/commands/RemovePathsCommand.h index ecbd49c79a..305a245212 100644 --- a/src/apps/icon-o-matic/shape/commands/RemovePathsCommand.h +++ b/src/apps/icon-o-matic/shape/commands/RemovePathsCommand.h @@ -1,20 +1,26 @@ /* - * Copyright 2006, Haiku. + * Copyright 2006-2007, Haiku. * Distributed under the terms of the MIT License. * * Authors: * Stephan Aßmus */ - #ifndef REMOVE_PATHS_COMMAND_H #define REMOVE_PATHS_COMMAND_H -#include #include "Command.h" -class VectorPath; -class PathContainer; +#include + + +namespace BPrivate { +namespace Icon { + class VectorPath; + class PathContainer; +} +} +using namespace BPrivate::Icon; class RemovePathsCommand : public Command { public: diff --git a/src/apps/icon-o-matic/shape/commands/RemoveShapesCommand.h b/src/apps/icon-o-matic/shape/commands/RemoveShapesCommand.h index 1d74fc1f30..1729a48dfd 100644 --- a/src/apps/icon-o-matic/shape/commands/RemoveShapesCommand.h +++ b/src/apps/icon-o-matic/shape/commands/RemoveShapesCommand.h @@ -1,18 +1,24 @@ /* - * Copyright 2006, Haiku. + * Copyright 2006-2007, Haiku. * Distributed under the terms of the MIT License. * * Authors: * Stephan Aßmus */ - #ifndef REMOVE_SHAPES_COMMAND_H #define REMOVE_SHAPES_COMMAND_H + #include "Command.h" -class Shape; -class ShapeContainer; + +namespace BPrivate { +namespace Icon { + class Shape; + class ShapeContainer; +} +} +using namespace BPrivate::Icon; class RemoveShapesCommand : public Command { public: diff --git a/src/apps/icon-o-matic/shape/commands/RemoveTransformersCommand.h b/src/apps/icon-o-matic/shape/commands/RemoveTransformersCommand.h index b8fbadb819..786d27169f 100644 --- a/src/apps/icon-o-matic/shape/commands/RemoveTransformersCommand.h +++ b/src/apps/icon-o-matic/shape/commands/RemoveTransformersCommand.h @@ -1,18 +1,24 @@ /* - * Copyright 2006, Haiku. + * Copyright 2006-2007, Haiku. * Distributed under the terms of the MIT License. * * Authors: * Stephan Aßmus */ - #ifndef REMOVE_TRANSFORMERS_COMMAND_H #define REMOVE_TRANSFORMERS_COMMAND_H + #include "Command.h" -class Shape; -class Transformer; + +namespace BPrivate { +namespace Icon { + class Shape; + class Transformer; +} +} +using namespace BPrivate::Icon; // TODO: make a templated "remove items" command? diff --git a/src/apps/icon-o-matic/shape/commands/TransformPointsCommand.h b/src/apps/icon-o-matic/shape/commands/TransformPointsCommand.h index c1542fac48..8fddaf3c12 100644 --- a/src/apps/icon-o-matic/shape/commands/TransformPointsCommand.h +++ b/src/apps/icon-o-matic/shape/commands/TransformPointsCommand.h @@ -1,26 +1,26 @@ /* - * Copyright 2006, Haiku. All rights reserved. + * Copyright 2006-2007, Haiku. All rights reserved. * Distributed under the terms of the MIT License. * * Authors: * Stephan Aßmus */ - #ifndef TRANSFORM_POINTS_COMMAND_H #define TRANSFORM_POINTS_COMMAND_H + #include "TransformBox.h" #include "TransformCommand.h" -class VectorPath; -struct control_point; namespace BPrivate { namespace Icon { + struct control_point; class Transformable; + class VectorPath; } } -using BPrivate::Icon::Transformable; +using namespace BPrivate::Icon; class TransformPointsCommand : public TransformCommand, public TransformBoxListener { diff --git a/src/apps/icon-o-matic/shape/commands/UnassignPathCommand.h b/src/apps/icon-o-matic/shape/commands/UnassignPathCommand.h index 52bc37968d..fa5063ec1d 100644 --- a/src/apps/icon-o-matic/shape/commands/UnassignPathCommand.h +++ b/src/apps/icon-o-matic/shape/commands/UnassignPathCommand.h @@ -1,18 +1,24 @@ /* - * Copyright 2006, Haiku. + * Copyright 2006-2007, Haiku. * Distributed under the terms of the MIT License. * * Authors: * Stephan Aßmus */ - #ifndef UNASSIGN_PATH_COMMAND_H #define UNASSIGN_PATH_COMMAND_H + #include "Command.h" -class Shape; -class VectorPath; + +namespace BPrivate { +namespace Icon { + class Shape; + class VectorPath; +} +} +using namespace BPrivate::Icon; class UnassignPathCommand : public Command { public: diff --git a/src/apps/icon-o-matic/style/AddStylesCommand.h b/src/apps/icon-o-matic/style/AddStylesCommand.h index 655250fd00..802fa5750d 100644 --- a/src/apps/icon-o-matic/style/AddStylesCommand.h +++ b/src/apps/icon-o-matic/style/AddStylesCommand.h @@ -1,18 +1,24 @@ /* - * Copyright 2006, Haiku. + * Copyright 2006-2007, Haiku. * Distributed under the terms of the MIT License. * * Authors: * Stephan Aßmus */ - #ifndef ADD_STYLES_COMMAND_H #define ADD_STYLES_COMMAND_H + #include "Command.h" -class Style; -class StyleContainer; + +namespace BPrivate { +namespace Icon { + class Style; + class StyleContainer; +} +} +using namespace BPrivate::Icon; class AddStylesCommand : public Command { public: diff --git a/src/apps/icon-o-matic/style/AssignStyleCommand.h b/src/apps/icon-o-matic/style/AssignStyleCommand.h index 371fab715f..0dbff1eb0c 100644 --- a/src/apps/icon-o-matic/style/AssignStyleCommand.h +++ b/src/apps/icon-o-matic/style/AssignStyleCommand.h @@ -1,20 +1,26 @@ /* - * Copyright 2006, Haiku. All rights reserved. + * Copyright 2006-2007, Haiku. All rights reserved. * Distributed under the terms of the MIT License. * * Authors: * Stephan Aßmus */ - #ifndef ASSIGN_STYLE_COMMAND_H #define ASSIGN_STYLE_COMMAND_H -#include #include "Command.h" -class Shape; -class Style; +#include + + +namespace BPrivate { +namespace Icon { + class Shape; + class Style; +} +} +using namespace BPrivate::Icon; class AssignStyleCommand : public Command { public: diff --git a/src/apps/icon-o-matic/style/MoveStylesCommand.h b/src/apps/icon-o-matic/style/MoveStylesCommand.h index 1d9dc17faf..910bb530a2 100644 --- a/src/apps/icon-o-matic/style/MoveStylesCommand.h +++ b/src/apps/icon-o-matic/style/MoveStylesCommand.h @@ -1,20 +1,25 @@ /* - * Copyright 2006, Haiku. All rights reserved. + * Copyright 2006-2007, Haiku. All rights reserved. * Distributed under the terms of the MIT License. * * Authors: * Stephan Aßmus */ - #ifndef MOVE_STYLES_COMMAND_H #define MOVE_STYLES_COMMAND_H + #include "Command.h" // TODO: make a templated "move items" command? -class Style; -class StyleContainer; +namespace BPrivate { +namespace Icon { + class Style; + class StyleContainer; +} +} +using namespace BPrivate::Icon; class MoveStylesCommand : public Command { public: diff --git a/src/apps/icon-o-matic/style/RemoveStylesCommand.h b/src/apps/icon-o-matic/style/RemoveStylesCommand.h index 244762e5f7..0fc9d5894f 100644 --- a/src/apps/icon-o-matic/style/RemoveStylesCommand.h +++ b/src/apps/icon-o-matic/style/RemoveStylesCommand.h @@ -1,20 +1,26 @@ /* - * Copyright 2006, Haiku. All rights reserved. + * Copyright 2006-2007, Haiku. All rights reserved. * Distributed under the terms of the MIT License. * * Authors: * Stephan Aßmus */ - #ifndef REMOVE_STYLES_COMMAND_H #define REMOVE_STYLES_COMMAND_H -#include #include "Command.h" -class Style; -class StyleContainer; +#include + + +namespace BPrivate { +namespace Icon { + class Style; + class StyleContainer; +} +} +using namespace BPrivate::Icon; class RemoveStylesCommand : public Command { public: diff --git a/src/apps/icon-o-matic/style/SetColorCommand.h b/src/apps/icon-o-matic/style/SetColorCommand.h index 4cf4d3e98b..3977402135 100644 --- a/src/apps/icon-o-matic/style/SetColorCommand.h +++ b/src/apps/icon-o-matic/style/SetColorCommand.h @@ -1,19 +1,25 @@ /* - * Copyright 2006, Haiku. + * Copyright 2006-2007, Haiku. * Distributed under the terms of the MIT License. * * Authors: * Stephan Aßmus */ - #ifndef SET_COLOR_COMMAND_H #define SET_COLOR_COMMAND_H -#include #include "Command.h" -class Style; +#include + + +namespace BPrivate { +namespace Icon { + class Style; +} +} +using namespace BPrivate::Icon; class SetColorCommand : public Command { public: diff --git a/src/apps/icon-o-matic/style/SetGradientCommand.h b/src/apps/icon-o-matic/style/SetGradientCommand.h index 1691279664..accaaf7399 100644 --- a/src/apps/icon-o-matic/style/SetGradientCommand.h +++ b/src/apps/icon-o-matic/style/SetGradientCommand.h @@ -1,18 +1,24 @@ /* - * Copyright 2006, Haiku. + * Copyright 2006-2007, Haiku. * Distributed under the terms of the MIT License. * * Authors: * Stephan Aßmus */ - #ifndef SET_GRADIENT_COMMAND_H #define SET_GRADIENT_COMMAND_H + #include "Command.h" -class Gradient; -class Style; + +namespace BPrivate { +namespace Icon { + class Gradient; + class Style; +} +} +using namespace BPrivate::Icon; class SetGradientCommand : public Command { public: diff --git a/src/apps/icon-o-matic/transformable/TransformGradientBox.h b/src/apps/icon-o-matic/transformable/TransformGradientBox.h index e68ceccba1..6f40f74c76 100644 --- a/src/apps/icon-o-matic/transformable/TransformGradientBox.h +++ b/src/apps/icon-o-matic/transformable/TransformGradientBox.h @@ -1,19 +1,26 @@ /* - * Copyright 2006, Haiku. + * Copyright 2006-2007, Haiku. * Distributed under the terms of the MIT License. * * Authors: * Stephan Aßmus */ - #ifndef TRANSFORM_GRADIENT_BOX_H #define TRANSFORM_GRADIENT_BOX_H + #include "TransformBox.h" + class CanvasView; -class Gradient; -class Shape; + +namespace BPrivate { +namespace Icon { + class Gradient; + class Shape; +} +} +using namespace BPrivate::Icon; class TransformGradientBox : public TransformBox { public: diff --git a/src/apps/icon-o-matic/transformable/TransformObjectsCommand.h b/src/apps/icon-o-matic/transformable/TransformObjectsCommand.h index 912a054aa7..8f1e2756f1 100644 --- a/src/apps/icon-o-matic/transformable/TransformObjectsCommand.h +++ b/src/apps/icon-o-matic/transformable/TransformObjectsCommand.h @@ -1,23 +1,24 @@ /* - * Copyright 2006, Haiku. + * Copyright 2006-2007, Haiku. * Distributed under the terms of the MIT License. * * Authors: * Stephan Aßmus */ - #ifndef TRANSFORM_OBJECTS_COMMAND_H #define TRANSFORM_OBJECTS_COMMAND_H + #include "TransformBox.h" #include "TransformCommand.h" + namespace BPrivate { namespace Icon { class Transformable; } } -using BPrivate::Icon::Transformable; +using namespace BPrivate::Icon; class TransformObjectsCommand : public TransformCommand, public TransformBoxListener { diff --git a/src/apps/icon-o-matic/transformable/TransformPointsBox.h b/src/apps/icon-o-matic/transformable/TransformPointsBox.h index 0160c52b2d..7c2d6512cd 100644 --- a/src/apps/icon-o-matic/transformable/TransformPointsBox.h +++ b/src/apps/icon-o-matic/transformable/TransformPointsBox.h @@ -1,21 +1,27 @@ /* - * Copyright 2006, Haiku. All rights reserved. + * Copyright 2006-2007, Haiku. All rights reserved. * Distributed under the terms of the MIT License. * * Authors: * Stephan Aßmus */ - #ifndef TRANSFORM_POINTS_BOX_H #define TRANSFORM_POINTS_BOX_H + #include "CanvasTransformBox.h" + class CanvasView; class PathManipulator; -class VectorPath; -struct control_point; +namespace BPrivate { +namespace Icon { + class VectorPath; + struct control_point; +} +} +using namespace BPrivate::Icon; class TransformPointsBox : public CanvasTransformBox { public: diff --git a/src/apps/icon-o-matic/transformable/TransformShapesBox.h b/src/apps/icon-o-matic/transformable/TransformShapesBox.h index 5093e53f52..1036051048 100644 --- a/src/apps/icon-o-matic/transformable/TransformShapesBox.h +++ b/src/apps/icon-o-matic/transformable/TransformShapesBox.h @@ -1,17 +1,23 @@ /* - * Copyright 2006, Haiku. + * Copyright 2006-2007, Haiku. * Distributed under the terms of the MIT License. * * Authors: * Stephan Aßmus */ - #ifndef TRANSFORM_SHAPES_BOX_H #define TRANSFORM_SHAPES_BOX_H + #include "CanvasTransformBox.h" -class Shape; + +namespace BPrivate { +namespace Icon { + class Shape; +} +} +using namespace BPrivate::Icon; class TransformShapesBox : public CanvasTransformBox { public: diff --git a/src/libs/icon/Icon.h b/src/libs/icon/Icon.h index 209f980d74..0b21757090 100644 --- a/src/libs/icon/Icon.h +++ b/src/libs/icon/Icon.h @@ -1,25 +1,31 @@ /* - * Copyright 2006, Haiku. All rights reserved. + * Copyright 2007, Haiku. All rights reserved. * Distributed under the terms of the MIT License. * * Authors: * Stephan Aßmus */ - #ifndef ICON_H #define ICON_H -#ifdef ICON_O_MATIC -#include -# include "Observer.h" -# include "Referenceable.h" -#else -# include -#endif #include "ShapeContainer.h" +#ifdef ICON_O_MATIC +# include + +# include "Observer.h" +# include "Referenceable.h" +#else +# include +#endif + class BRect; + + +namespace BPrivate { +namespace Icon { + class PathContainer; class StyleContainer; @@ -84,4 +90,7 @@ class Icon { #endif }; -#endif // ICON_H +} // namespace Icon +} // namespace BPrivate + +#endif // ICON_H diff --git a/src/libs/icon/IconRenderer.h b/src/libs/icon/IconRenderer.h index f22d49a3ba..d25c1ad412 100644 --- a/src/libs/icon/IconRenderer.h +++ b/src/libs/icon/IconRenderer.h @@ -1,14 +1,14 @@ /* - * Copyright 2006, Haiku. + * Copyright 2006-2007, Haiku. * Distributed under the terms of the MIT License. * * Authors: * Stephan Aßmus */ - #ifndef ICON_RENDERER_H #define ICON_RENDERER_H + #include #include #include @@ -21,6 +21,11 @@ class BBitmap; class BRect; + + +namespace BPrivate { +namespace Icon { + class Icon; typedef agg::gamma_lut @@ -61,7 +66,7 @@ class IconRenderer { // used when no background bitmap // is set - const ::GammaTable& GammaTable() const + const BPrivate::Icon::GammaTable& GammaTable() const { return fGammaTable; } void Demultiply(); @@ -74,7 +79,7 @@ class IconRenderer { agg::rgba8 fBackgroundColor; const Icon* fIcon; - ::GammaTable fGammaTable; + BPrivate::Icon::GammaTable fGammaTable; RenderingBuffer fRenderingBuffer; PixelFormat fPixelFormat; @@ -91,4 +96,7 @@ class IconRenderer { Transformation fGlobalTransform; }; +} // namespace Icon +} // namespace BPrivate + #endif // ICON_RENDERER_H diff --git a/src/libs/icon/IconUtils.cpp b/src/libs/icon/IconUtils.cpp index 4fa6315bc8..b4e4df6449 100644 --- a/src/libs/icon/IconUtils.cpp +++ b/src/libs/icon/IconUtils.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2006, Haiku. All rights reserved. + * Copyright 2006-2007, Haiku. All rights reserved. * Distributed under the terms of the MIT License. * * Authors: @@ -7,6 +7,7 @@ * Ingo Weinhold */ + #include "IconUtils.h" #include @@ -22,8 +23,11 @@ #include "IconRenderer.h" #include "FlatIconImporter.h" + +using namespace BPrivate::Icon; using std::nothrow; + // GetIcon status_t BIconUtils::GetIcon(BNode* node, diff --git a/src/libs/icon/flat_icon/FlatIconFormat.cpp b/src/libs/icon/flat_icon/FlatIconFormat.cpp index 519e295ab9..abe1e7d294 100644 --- a/src/libs/icon/flat_icon/FlatIconFormat.cpp +++ b/src/libs/icon/flat_icon/FlatIconFormat.cpp @@ -1,20 +1,26 @@ /* - * Copyright 2006, Haiku. All rights reserved. + * Copyright 2006-2007, Haiku. All rights reserved. * Distributed under the terms of the MIT License. * * Authors: * Stephan Aßmus */ + #include "FlatIconFormat.h" #include "LittleEndianBuffer.h" + +namespace BPrivate { +namespace Icon { + const uint32 FLAT_ICON_MAGIC = 'ficn'; const char* kVectorAttrNodeName = "BEOS:ICON"; const char* kVectorAttrMimeName = "META:ICON"; + // read_coord bool read_coord(LittleEndianBuffer& buffer, float& coord) @@ -119,3 +125,6 @@ write_float_24(LittleEndianBuffer& buffer, float _value) && buffer.Write((uint8)((shortValue >> 8) & 0xff)) && buffer.Write((uint8)(shortValue & 0xff)); } + +} // namespace Icon +} // namespace BPrivate diff --git a/src/libs/icon/flat_icon/FlatIconFormat.h b/src/libs/icon/flat_icon/FlatIconFormat.h index b47046c77d..c2ba0624b9 100644 --- a/src/libs/icon/flat_icon/FlatIconFormat.h +++ b/src/libs/icon/flat_icon/FlatIconFormat.h @@ -1,16 +1,20 @@ /* - * Copyright 2006, Haiku. All rights reserved. + * Copyright 2006-2007, Haiku. All rights reserved. * Distributed under the terms of the MIT License. * * Authors: * Stephan Aßmus */ - #ifndef FLAT_ICON_FORMAT_H #define FLAT_ICON_FORMAT_H + #include + +namespace BPrivate { +namespace Icon { + extern const uint32 FLAT_ICON_MAGIC; extern const char* kVectorAttrNodeName; @@ -69,4 +73,7 @@ bool write_coord(LittleEndianBuffer& buffer, float coord); bool read_float_24(LittleEndianBuffer& buffer, float& value); bool write_float_24(LittleEndianBuffer& buffer, float value); -#endif // FLAT_ICON_FORMAT_H +} // namespace Icon +} // namespace BPrivate + +#endif // FLAT_ICON_FORMAT_H diff --git a/src/libs/icon/flat_icon/FlatIconImporter.h b/src/libs/icon/flat_icon/FlatIconImporter.h index 0f7e48e2f9..8d0d0a325e 100644 --- a/src/libs/icon/flat_icon/FlatIconImporter.h +++ b/src/libs/icon/flat_icon/FlatIconImporter.h @@ -1,22 +1,26 @@ /* - * Copyright 2006, Haiku. All rights reserved. + * Copyright 2006-2007, Haiku. All rights reserved. * Distributed under the terms of the MIT License. * * Authors: * Stephan Aßmus */ - #ifndef FLAT_ICON_IMPORTER_H #define FLAT_ICON_IMPORTER_H + #ifdef ICON_O_MATIC -# include "Importer.h" +# include "Importer.h" #else -# include +# include #endif class BMessage; class BPositionIO; + +namespace BPrivate { +namespace Icon { + class Icon; class LittleEndianBuffer; class PathContainer; @@ -58,4 +62,7 @@ class FlatIconImporter { ShapeContainer* shapes); }; -#endif // FLAT_ICON_IMPORTER_H +} // namespace Icon +} // namespace BPrivate + +#endif // FLAT_ICON_IMPORTER_H diff --git a/src/libs/icon/flat_icon/LittleEndianBuffer.cpp b/src/libs/icon/flat_icon/LittleEndianBuffer.cpp index 83fc48e2d5..26606c01a0 100644 --- a/src/libs/icon/flat_icon/LittleEndianBuffer.cpp +++ b/src/libs/icon/flat_icon/LittleEndianBuffer.cpp @@ -1,21 +1,25 @@ /* - * Copyright 2006, Haiku. All rights reserved. + * Copyright 2006-2007, Haiku. All rights reserved. * Distributed under the terms of the MIT License. * * Authors: * Stephan Aßmus */ -#include "LittleEndianBuffer.h" -#include -#include -#include +#include "LittleEndianBuffer.h" #include +#include +#include +#include + +using namespace BPrivate::Icon; + #define CHUNK_SIZE 256 + // constructor LittleEndianBuffer::LittleEndianBuffer() : fBuffer((uint8*)malloc(CHUNK_SIZE)), diff --git a/src/libs/icon/flat_icon/LittleEndianBuffer.h b/src/libs/icon/flat_icon/LittleEndianBuffer.h index 52f5f98ccb..3b3e035564 100644 --- a/src/libs/icon/flat_icon/LittleEndianBuffer.h +++ b/src/libs/icon/flat_icon/LittleEndianBuffer.h @@ -1,16 +1,20 @@ /* - * Copyright 2006, Haiku. All rights reserved. + * Copyright 2006-2007, Haiku. All rights reserved. * Distributed under the terms of the MIT License. * * Authors: * Stephan Aßmus */ - #ifndef LITTLE_ENDIAN_BUFFER_H #define LITTLE_ENDIAN_BUFFER_H + #include + +namespace BPrivate { +namespace Icon { + class LittleEndianBuffer { public: LittleEndianBuffer(); @@ -54,4 +58,7 @@ class LittleEndianBuffer { bool fOwnsBuffer; }; -#endif // LITTLE_ENDIAN_BUFFER_H +} // namespace Icon +} // namespace BPrivate + +#endif // LITTLE_ENDIAN_BUFFER_H diff --git a/src/libs/icon/flat_icon/PathCommandQueue.h b/src/libs/icon/flat_icon/PathCommandQueue.h index 025ef9b3af..4d899f610c 100644 --- a/src/libs/icon/flat_icon/PathCommandQueue.h +++ b/src/libs/icon/flat_icon/PathCommandQueue.h @@ -1,17 +1,22 @@ /* - * Copyright 2006, Haiku. All rights reserved. + * Copyright 2006-2007, Haiku. All rights reserved. * Distributed under the terms of the MIT License. * * Authors: * Stephan Aßmus */ - #ifndef PATH_COMMAND_QUEUE_H #define PATH_COMMAND_QUEUE_H + #include "LittleEndianBuffer.h" class BPoint; + + +namespace BPrivate { +namespace Icon { + class VectorPath; class PathCommandQueue { @@ -50,4 +55,7 @@ class PathCommandQueue { uint8 fCommandCount; }; -#endif // PATH_COMMAND_QUEUE_H +} // namespace Icon +} // namespace BPrivate + +#endif // PATH_COMMAND_QUEUE_H diff --git a/src/libs/icon/shape/PathContainer.h b/src/libs/icon/shape/PathContainer.h index a2e0101698..b1d336e18b 100644 --- a/src/libs/icon/shape/PathContainer.h +++ b/src/libs/icon/shape/PathContainer.h @@ -1,16 +1,20 @@ /* - * Copyright 2006, Haiku. + * Copyright 2006-2007, Haiku. * Distributed under the terms of the MIT License. * * Authors: * Stephan Aßmus */ - #ifndef PATH_CONTAINER_H #define PATH_CONTAINER_H + #include + +namespace BPrivate { +namespace Icon { + class VectorPath; #ifdef ICON_O_MATIC @@ -63,4 +67,7 @@ class PathContainer { #endif // ICON_O_MATIC }; -#endif // PATH_CONTAINER_H +} // namespace Icon +} // namespace BPrivate + +#endif // PATH_CONTAINER_H diff --git a/src/libs/icon/shape/Shape.h b/src/libs/icon/shape/Shape.h index 59c4b3ae03..66e11c4377 100644 --- a/src/libs/icon/shape/Shape.h +++ b/src/libs/icon/shape/Shape.h @@ -1,26 +1,30 @@ /* - * Copyright 2006, Haiku. All rights reserved. + * Copyright 2006-2007, Haiku. All rights reserved. * Distributed under the terms of the MIT License. * * Authors: * Stephan Aßmus */ - #ifndef SHAPE_H #define SHAPE_H -#include -#include #ifdef ICON_O_MATIC -# include "IconObject.h" -# include "Observer.h" +# include "IconObject.h" +# include "Observer.h" #endif #include "PathContainer.h" #include "PathSource.h" #include "Transformable.h" #include "VectorPath.h" +#include +#include + + +namespace BPrivate { +namespace Icon { + class Style; #ifdef ICON_O_MATIC @@ -159,4 +163,7 @@ class Shape : public BPrivate::Icon::Transformable { #endif }; -#endif // SHAPE_H +} // namespace Icon +} // namespace BPrivate + +#endif // SHAPE_H diff --git a/src/libs/icon/shape/ShapeContainer.h b/src/libs/icon/shape/ShapeContainer.h index 77c137b320..ffb8185ac4 100644 --- a/src/libs/icon/shape/ShapeContainer.h +++ b/src/libs/icon/shape/ShapeContainer.h @@ -1,16 +1,20 @@ /* - * Copyright 2006, Haiku. + * Copyright 2006-2007, Haiku. * Distributed under the terms of the MIT License. * * Authors: * Stephan Aßmus */ - #ifndef SHAPE_CONTAINER_H #define SHAPE_CONTAINER_H + #include + +namespace BPrivate { +namespace Icon { + class Shape; #ifdef ICON_O_MATIC @@ -63,4 +67,7 @@ class ShapeContainer { #endif // ICON_O_MATIC }; -#endif // SHAPE_CONTAINER_H +} // namespace Icon +} // namespace BPrivate + +#endif // SHAPE_CONTAINER_H diff --git a/src/libs/icon/shape/VectorPath.h b/src/libs/icon/shape/VectorPath.h index 1a76c600b3..e56f7f5a0b 100644 --- a/src/libs/icon/shape/VectorPath.h +++ b/src/libs/icon/shape/VectorPath.h @@ -5,28 +5,32 @@ * Authors: * Stephan Aßmus */ - #ifndef VECTOR_PATH_H #define VECTOR_PATH_H + +#include "Transformable.h" + +#include + #include #include -#include - -#include "Transformable.h" - #ifdef ICON_O_MATIC -# include -# include +# include "IconObject.h" -# include "IconObject.h" +# include +# include #endif // ICON_O_MATIC class BBitmap; class BMessage; class BView; + +namespace BPrivate { +namespace Icon { + struct control_point { BPoint point; // actual point on path BPoint point_in; // control point for incomming curve @@ -207,5 +211,7 @@ class VectorPath { mutable BRect fCachedBounds; }; -#endif // VECTOR_PATH_H +} // namespace Icon +} // namespace BPrivate +#endif // VECTOR_PATH_H diff --git a/src/libs/icon/style/Gradient.h b/src/libs/icon/style/Gradient.h index b359e7f4b8..aae25fcd20 100644 --- a/src/libs/icon/style/Gradient.h +++ b/src/libs/icon/style/Gradient.h @@ -1,16 +1,13 @@ /* - * Copyright 2006, Haiku. + * Copyright 2006-2007, Haiku. * Distributed under the terms of the MIT License. * * Authors: * Stephan Aßmus */ - #ifndef GRADIENT_H #define GRADIENT_H -#include -#include #ifdef ICON_O_MATIC # include @@ -20,8 +17,15 @@ #include "Transformable.h" +#include +#include + class BMessage; + +namespace BPrivate { +namespace Icon { + enum gradient_type { GRADIENT_LINEAR = 0, GRADIENT_CIRCULAR, @@ -121,5 +125,7 @@ class Gradient : public Transformable { bool fInheritTransformation; }; +} // namespace Icon +} // namespace BPrivate -#endif // GRADIENT_H +#endif // GRADIENT_H diff --git a/src/libs/icon/style/Style.h b/src/libs/icon/style/Style.h index a116971607..107bfa97eb 100644 --- a/src/libs/icon/style/Style.h +++ b/src/libs/icon/style/Style.h @@ -1,25 +1,29 @@ /* - * Copyright 2006, Haiku. + * Copyright 2006-2007, Haiku. * Distributed under the terms of the MIT License. * * Authors: * Stephan Aßmus */ - #ifndef STYLE_H #define STYLE_H + +#ifdef ICON_O_MATIC +# include "IconObject.h" +# include "Observer.h" +#endif + +#include "IconRenderer.h" + // TODO: put GammaTable into its own file + #include #include -#ifdef ICON_O_MATIC -# include "IconObject.h" -# include "Observer.h" -#endif -#include "IconRenderer.h" - // TODO: put GammaTable into its own file +namespace BPrivate { +namespace Icon { class Gradient; @@ -55,8 +59,9 @@ class Style { inline rgb_color Color() const { return fColor; } - void SetGradient(const ::Gradient* gradient); - ::Gradient* Gradient() const + void SetGradient(const BPrivate::Icon::Gradient* + gradient); + BPrivate::Icon::Gradient* Gradient() const { return fGradient; } const agg::rgba8* Colors() const @@ -67,7 +72,7 @@ class Style { private: rgb_color fColor; - ::Gradient* fGradient; + BPrivate::Icon::Gradient* fGradient; // hold gradient color array agg::rgba8* fColors; @@ -77,4 +82,9 @@ class Style { mutable bool fGammaCorrectedColorsValid; }; -#endif // STYLE_H +} // namespace Icon +} // namespace BPrivate + +using namespace BPrivate::Icon; + +#endif // STYLE_H diff --git a/src/libs/icon/style/StyleContainer.h b/src/libs/icon/style/StyleContainer.h index 7db3f68e02..3ef2a9163c 100644 --- a/src/libs/icon/style/StyleContainer.h +++ b/src/libs/icon/style/StyleContainer.h @@ -1,16 +1,20 @@ /* - * Copyright 2006, Haiku. + * Copyright 2006-2007, Haiku. * Distributed under the terms of the MIT License. * * Authors: * Stephan Aßmus */ - #ifndef STYLE_MANAGER_H #define STYLE_MANAGER_H + #include + +namespace BPrivate { +namespace Icon { + class Style; #ifdef ICON_O_MATIC @@ -62,4 +66,7 @@ class StyleContainer { #endif // ICON_O_MATIC }; -#endif // STYLE_MANAGER_H +} // namespace Icon +} // namespace BPrivate + +#endif // STYLE_MANAGER_H diff --git a/src/libs/icon/transformer/AffineTransformer.cpp b/src/libs/icon/transformer/AffineTransformer.cpp index 7dbfa5a9e3..9338d69e39 100644 --- a/src/libs/icon/transformer/AffineTransformer.cpp +++ b/src/libs/icon/transformer/AffineTransformer.cpp @@ -1,14 +1,13 @@ /* - * Copyright 2006, Haiku. + * Copyright 2006-2007, Haiku. * Distributed under the terms of the MIT License. * * Authors: * Stephan Aßmus */ -#include "AffineTransformer.h" -#include +#include "AffineTransformer.h" #ifdef ICON_O_MATIC # include @@ -18,9 +17,13 @@ # include "PropertyObject.h" #endif +#include + +using namespace BPrivate::Icon; using std::nothrow; + // constructor AffineTransformer::AffineTransformer(VertexSource& source) : Transformer(source, "Transformation"), diff --git a/src/libs/icon/transformer/AffineTransformer.h b/src/libs/icon/transformer/AffineTransformer.h index 7621d75b33..3f0f352cca 100644 --- a/src/libs/icon/transformer/AffineTransformer.h +++ b/src/libs/icon/transformer/AffineTransformer.h @@ -1,18 +1,22 @@ /* - * Copyright 2006, Haiku. + * Copyright 2006-2007, Haiku. * Distributed under the terms of the MIT License. * * Authors: * Stephan Aßmus */ - #ifndef AFFINE_TRANSFORMER_H #define AFFINE_TRANSFORMER_H + +#include "Transformer.h" + #include #include -#include "Transformer.h" + +namespace BPrivate { +namespace Icon { typedef agg::conv_transform Affine; @@ -54,4 +58,7 @@ class AffineTransformer : public Transformer, #endif }; -#endif // AFFINE_TRANSFORMER_H +} // namespace Icon +} // namespace BPrivate + +#endif // AFFINE_TRANSFORMER_H diff --git a/src/libs/icon/transformer/ContourTransformer.cpp b/src/libs/icon/transformer/ContourTransformer.cpp index 7c250f71bd..e5798c77b4 100644 --- a/src/libs/icon/transformer/ContourTransformer.cpp +++ b/src/libs/icon/transformer/ContourTransformer.cpp @@ -1,14 +1,13 @@ /* - * Copyright 2006, Haiku. + * Copyright 2006-2007, Haiku. * Distributed under the terms of the MIT License. * * Authors: * Stephan Aßmus */ -#include "ContourTransformer.h" -#include +#include "ContourTransformer.h" #ifdef ICON_O_MATIC # include @@ -19,8 +18,13 @@ # include "PropertyObject.h" #endif // ICON_O_MATIC +#include + + +using namespace BPrivate::Icon; using std::nothrow; + // constructor ContourTransformer::ContourTransformer(VertexSource& source) : Transformer(source, "Contour"), diff --git a/src/libs/icon/transformer/ContourTransformer.h b/src/libs/icon/transformer/ContourTransformer.h index 465e140d87..76fd376096 100644 --- a/src/libs/icon/transformer/ContourTransformer.h +++ b/src/libs/icon/transformer/ContourTransformer.h @@ -1,18 +1,22 @@ /* - * Copyright 2006, Haiku. + * Copyright 2006-2007, Haiku. * Distributed under the terms of the MIT License. * * Authors: * Stephan Aßmus */ - #ifndef CONTOUR_TRANSFORMER_H #define CONTOUR_TRANSFORMER_H -#include #include "Transformer.h" +#include + + +namespace BPrivate { +namespace Icon { + typedef agg::conv_contour Contour; class ContourTransformer : public Transformer, @@ -51,4 +55,7 @@ class ContourTransformer : public Transformer, #endif }; -#endif // CONTOUR_TRANSFORMER_H +} // namespace Icon +} // namespace BPrivate + +#endif // CONTOUR_TRANSFORMER_H diff --git a/src/libs/icon/transformer/PathSource.h b/src/libs/icon/transformer/PathSource.h index aa87e10763..10046738e8 100644 --- a/src/libs/icon/transformer/PathSource.h +++ b/src/libs/icon/transformer/PathSource.h @@ -1,19 +1,23 @@ /* - * Copyright 2006, Haiku. + * Copyright 2006-2007, Haiku. * Distributed under the terms of the MIT License. * * Authors: * Stephan Aßmus */ - #ifndef PATH_SOURCE_H #define PATH_SOURCE_H + #include "Transformer.h" #include "agg_path_storage.h" #include "agg_conv_curve.h" + +namespace BPrivate { +namespace Icon { + class PathContainer; class VectorPath; @@ -41,4 +45,7 @@ class PathSource : public VertexSource { AGGCurvedPath fAGGCurvedPath; }; -#endif // PATH_SOURCE_H +} // namespace Icon +} // namespace BPrivate + +#endif // PATH_SOURCE_H diff --git a/src/libs/icon/transformer/PerspectiveTransformer.cpp b/src/libs/icon/transformer/PerspectiveTransformer.cpp index d04d0f3689..066598eb00 100644 --- a/src/libs/icon/transformer/PerspectiveTransformer.cpp +++ b/src/libs/icon/transformer/PerspectiveTransformer.cpp @@ -1,21 +1,24 @@ /* - * Copyright 2006, Haiku. + * Copyright 2006-2007, Haiku. * Distributed under the terms of the MIT License. * * Authors: * Stephan Aßmus */ + #include "PerspectiveTransformer.h" #ifdef ICON_O_MATIC -# include +# include #endif #include +using namespace BPrivate::Icon; using std::nothrow; + // constructor PerspectiveTransformer::PerspectiveTransformer(VertexSource& source) : Transformer(source, "Perspective"), diff --git a/src/libs/icon/transformer/PerspectiveTransformer.h b/src/libs/icon/transformer/PerspectiveTransformer.h index 256b081cfb..12d1173c86 100644 --- a/src/libs/icon/transformer/PerspectiveTransformer.h +++ b/src/libs/icon/transformer/PerspectiveTransformer.h @@ -1,18 +1,22 @@ /* - * Copyright 2006, Haiku. + * Copyright 2006-2007, Haiku. * Distributed under the terms of the MIT License. * * Authors: * Stephan Aßmus */ - #ifndef PERSPECTIVE_TRANSFORMER_H #define PERSPECTIVE_TRANSFORMER_H + +#include "Transformer.h" + #include #include -#include "Transformer.h" + +namespace BPrivate { +namespace Icon { typedef agg::conv_transform Perspective; @@ -52,4 +56,7 @@ class PerspectiveTransformer : public Transformer, #endif }; -#endif // PERSPECTIVE_TRANSFORMER_H +} // namespace Icon +} // namespace BPrivate + +#endif // PERSPECTIVE_TRANSFORMER_H diff --git a/src/libs/icon/transformer/StrokeTransformer.cpp b/src/libs/icon/transformer/StrokeTransformer.cpp index 21792bb44b..4997a0e394 100644 --- a/src/libs/icon/transformer/StrokeTransformer.cpp +++ b/src/libs/icon/transformer/StrokeTransformer.cpp @@ -1,14 +1,13 @@ /* - * Copyright 2006, Haiku. + * Copyright 2006-2007, Haiku. * Distributed under the terms of the MIT License. * * Authors: * Stephan Aßmus */ -#include "StrokeTransformer.h" -#include +#include "StrokeTransformer.h" #ifdef ICON_O_MATIC # include @@ -19,8 +18,12 @@ # include "PropertyObject.h" #endif // ICON_O_MATIC +#include + +using namespace BPrivate::Icon; using std::nothrow; + // constructor StrokeTransformer::StrokeTransformer(VertexSource& source) : Transformer(source, "Stroke"), diff --git a/src/libs/icon/transformer/StrokeTransformer.h b/src/libs/icon/transformer/StrokeTransformer.h index a7c9859d32..7bb1ce4296 100644 --- a/src/libs/icon/transformer/StrokeTransformer.h +++ b/src/libs/icon/transformer/StrokeTransformer.h @@ -1,19 +1,23 @@ /* - * Copyright 2006, Haiku. + * Copyright 2006-2007, Haiku. * Distributed under the terms of the MIT License. * * Authors: * Stephan Aßmus */ - #ifndef STROKE_TRANSFORMER_H #define STROKE_TRANSFORMER_H -#include #include "Transformer.h" -typedef agg::conv_stroke Stroke; +#include + + +namespace BPrivate { +namespace Icon { + +typedef agg::conv_stroke Stroke; class StrokeTransformer : public Transformer, public Stroke { @@ -53,4 +57,7 @@ class StrokeTransformer : public Transformer, #endif }; -#endif // STROKE_TRANSFORMER_H +} // namespace Icon +} // namespace BPrivate + +#endif // STROKE_TRANSFORMER_H diff --git a/src/libs/icon/transformer/Transformer.cpp b/src/libs/icon/transformer/Transformer.cpp index 38deae5788..132b83db37 100644 --- a/src/libs/icon/transformer/Transformer.cpp +++ b/src/libs/icon/transformer/Transformer.cpp @@ -1,13 +1,18 @@ /* - * Copyright 2006, Haiku. + * Copyright 2006-2007, Haiku. * Distributed under the terms of the MIT License. * * Authors: * Stephan Aßmus */ + #include "Transformer.h" + +using namespace BPrivate::Icon; + + // constructor VertexSource::VertexSource() { diff --git a/src/libs/icon/transformer/Transformer.h b/src/libs/icon/transformer/Transformer.h index 4959861aa8..b16cd9cbb6 100644 --- a/src/libs/icon/transformer/Transformer.h +++ b/src/libs/icon/transformer/Transformer.h @@ -1,20 +1,24 @@ /* - * Copyright 2006, Haiku. + * Copyright 2006-2007, Haiku. * Distributed under the terms of the MIT License. * * Authors: * Stephan Aßmus */ - #ifndef TRANSFORMER_H #define TRANSFORMER_H + #ifdef ICON_O_MATIC -# include "IconObject.h" +# include "IconObject.h" #else -# include +# include #endif + +namespace BPrivate { +namespace Icon { + class VertexSource { public: VertexSource(); @@ -58,4 +62,7 @@ class Transformer : public VertexSource { VertexSource& fSource; }; -#endif // TRANSFORMER_H +} // namespace Icon +} // namespace BPrivate + +#endif // TRANSFORMER_H diff --git a/src/libs/icon/transformer/TransformerFactory.cpp b/src/libs/icon/transformer/TransformerFactory.cpp index 6943b45fe9..2b1b98fe2c 100644 --- a/src/libs/icon/transformer/TransformerFactory.cpp +++ b/src/libs/icon/transformer/TransformerFactory.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2006, Haiku. + * Copyright 2006-2007, Haiku. * Distributed under the terms of the MIT License. * * Authors: @@ -8,15 +8,18 @@ #include "TransformerFactory.h" -#ifdef ICON_O_MATIC -# include -#endif - #include "AffineTransformer.h" #include "ContourTransformer.h" #include "PerspectiveTransformer.h" #include "StrokeTransformer.h" +#ifdef ICON_O_MATIC +# include +#endif + +using namespace BPrivate::Icon; + + // TransformerFor Transformer* TransformerFactory::TransformerFor(uint32 type, VertexSource& source) diff --git a/src/libs/icon/transformer/TransformerFactory.h b/src/libs/icon/transformer/TransformerFactory.h index edd860f9d5..bec9a39978 100644 --- a/src/libs/icon/transformer/TransformerFactory.h +++ b/src/libs/icon/transformer/TransformerFactory.h @@ -1,17 +1,22 @@ /* - * Copyright 2006, Haiku. + * Copyright 2006-2007, Haiku. * Distributed under the terms of the MIT License. * * Authors: * Stephan Aßmus */ - #ifndef TRANSFORMER_FACTORY_H #define TRANSFORMER_FACTORY_H + #include class BMessage; + + +namespace BPrivate { +namespace Icon { + class Transformer; class VertexSource; @@ -32,4 +37,7 @@ class TransformerFactory { #endif // ICON_O_MATIC }; -#endif // TRANSFORMER_FACTORY_H +} // namespace Icon +} // namespace BPrivate + +#endif // TRANSFORMER_FACTORY_H