xref: /haiku/src/apps/icon-o-matic/shape/commands/ReversePathCommand.cpp (revision 83b1a68c52ba3e0e8796282759f694b7fdddf06d)
1 /*
2  * Copyright 2006, Haiku. All rights reserved.
3  * Distributed under the terms of the MIT License.
4  *
5  * Authors:
6  *		Stephan Aßmus <superstippi@gmx.de>
7  */
8 
9 #include "ReversePathCommand.h"
10 
11 #include <stdio.h>
12 
13 #include <Catalog.h>
14 #include <Locale.h>
15 
16 #include "VectorPath.h"
17 
18 
19 #undef B_TRANSLATION_CONTEXT
20 #define B_TRANSLATION_CONTEXT "Icon-O-Matic-ReversePathCmd"
21 
22 
23 // constructor
24 ReversePathCommand::ReversePathCommand(VectorPath* path)
25 	: PathCommand(path)
26 {
27 }
28 
29 // destructor
30 ReversePathCommand::~ReversePathCommand()
31 {
32 }
33 
34 // Perform
35 status_t
36 ReversePathCommand::Perform()
37 {
38 	fPath->Reverse();
39 
40 	return B_OK;
41 }
42 
43 // Undo
44 status_t
45 ReversePathCommand::Undo()
46 {
47 	return Perform();
48 }
49 
50 // GetName
51 void
52 ReversePathCommand::GetName(BString& name)
53 {
54 	name << B_TRANSLATE("Reverse Path");
55 }
56