vfs: check userland buffers before reading them.
[haiku.git] / src / add-ons / translators / raw / ConfigView.cpp
bloba58678019f8e50420d817192995a2e98e2b076de
1 /*
2 * Copyright 2005-2007, Axel Dörfler, axeld@pinc-software.de. All rights reserved.
3 * Copyright 2009, Maxime Simon, maxime.simon@gmail.com. All rights reserved.
4 * Distributed under the terms of the MIT License.
5 */
8 #include "ConfigView.h"
9 #include "RAWTranslator.h"
11 #include <Catalog.h>
12 #include <CheckBox.h>
13 #include <LayoutBuilder.h>
14 #include <StringView.h>
16 #include <stdio.h>
17 #include <string.h>
19 #undef B_TRANSLATION_CONTEXT
20 #define B_TRANSLATION_CONTEXT "ConfigView"
22 const char* kShortName2 = B_TRANSLATE_MARK("RAWTranslator Settings");
25 ConfigView::ConfigView(uint32 flags)
26 : BView(kShortName2, flags)
28 SetViewUIColor(B_PANEL_BACKGROUND_COLOR);
30 BStringView *fTitle = new BStringView("title", B_TRANSLATE("RAW image translator"));
31 fTitle->SetFont(be_bold_font);
33 char version[256];
34 sprintf(version, B_TRANSLATE("Version %d.%d.%d, %s"),
35 int(B_TRANSLATION_MAJOR_VERSION(RAW_TRANSLATOR_VERSION)),
36 int(B_TRANSLATION_MINOR_VERSION(RAW_TRANSLATOR_VERSION)),
37 int(B_TRANSLATION_REVISION_VERSION(RAW_TRANSLATOR_VERSION)),
38 __DATE__);
39 BStringView *fVersion = new BStringView("version", version);
41 BStringView *fCopyright = new BStringView("copyright",
42 B_UTF8_COPYRIGHT "2007-2009 Haiku Inc.");
44 BStringView *fCopyright2 = new BStringView("copyright2",
45 B_TRANSLATE("Based on Dave Coffin's dcraw 8.63"));
47 BStringView *fCopyright3 = new BStringView("copyright3",
48 B_UTF8_COPYRIGHT "1997-2007 Dave Coffin");
50 // Build the layout
51 BLayoutBuilder::Group<>(this, B_VERTICAL, 0)
52 .SetInsets(B_USE_DEFAULT_SPACING)
53 .Add(fTitle)
54 .Add(fVersion)
55 .Add(fCopyright)
56 .AddGlue()
57 .Add(fCopyright2)
58 .Add(fCopyright3);
60 BFont font;
61 GetFont(&font);
62 SetExplicitPreferredSize(BSize((font.Size() * 233)/12, (font.Size() * 200)/12));
66 ConfigView::~ConfigView()