2 * Copyright 2004-2010, Axel Dörfler, axeld@pinc-software.de.
3 * Distributed under the terms of the MIT License.
11 #include <Application.h>
14 #include <TranslatorRoster.h>
16 #include "TranslatorWindow.h"
20 #include "RTFTranslator.h"
22 #undef B_TRANSLATION_CONTEXT
23 #define B_TRANSLATION_CONTEXT "main"
27 main(int argc
, char** argv
)
30 // Convert input files to plain text directly
31 BFileIO
output(stdout
);
34 for (int i
= 1; i
< argc
; i
++) {
36 status_t status
= input
.SetTo(argv
[i
], B_READ_ONLY
);
39 "RTFTranslator:Could not open file \"%s\": %s\n",
40 argv
[i
], strerror(status
));
45 RTF::Parser
parser(input
);
48 status
= parser
.Parse(header
);
51 "RTFTranslator:Could not convert file \"%s\": %s\n",
52 argv
[i
], strerror(status
));
57 convert_to_plain_text(header
, output
);
63 BApplication
app("application/x-vnd.Haiku-RTFTranslator");
66 result
= LaunchTranslatorWindow(new RTFTranslator
,
67 B_TRANSLATE("RTF Settings"), BRect(0, 0, 225, 175));