2 * Copyright 2006, Haiku. All rights reserved.
3 * Distributed under the terms of the MIT License.
6 * Stephan Aßmus <superstippi@gmx.de>
13 #include "AddPathsCommand.h"
14 #include "AddStylesCommand.h"
15 #include "PathContainer.h"
17 #include "StyleContainer.h"
18 #include "VectorPath.h"
24 new_style(rgb_color color
, StyleContainer
* container
,
25 Style
** style
, AddStylesCommand
** command
)
27 *style
= new (nothrow
) Style(color
);
31 *command
= new (nothrow
) AddStylesCommand(
33 container
->CountStyles());
34 if (*command
== NULL
) {
45 new_path(PathContainer
* container
, VectorPath
** path
,
46 AddPathsCommand
** command
, VectorPath
* other
)
49 *path
= new (nothrow
) VectorPath(*other
);
51 *path
= new (nothrow
) VectorPath();
56 int32 insertIndex
= other
? container
->IndexOf(other
) + 1
57 : container
->CountPaths();
58 *command
= new (nothrow
) AddPathsCommand(
59 container
, paths
, 1, true, insertIndex
);
60 if (*command
== NULL
) {