vfs: check userland buffers before reading them.
[haiku.git] / src / apps / overlayimage / OverlayWindow.cpp
blob0b05a5ab9012f872a60ae5086e678542273909b0
1 /*
2 * Copyright 1999-2010, Be Incorporated. All Rights Reserved.
3 * This file may be used under the terms of the Be Sample Code License.
5 * OverlayImage is based on the code presented in this article:
6 * http://www.haiku-os.org/documents/dev/replishow_a_replicable_image_viewer
8 * Authors:
9 * Seth Flexman
10 * Hartmuth Reh
11 * Humdinger <humdingerb@gmail.com>
14 #include "OverlayView.h"
15 #include "OverlayWindow.h"
17 #include <Application.h>
18 #include <Catalog.h>
19 #include <Locale.h>
20 #include <String.h>
22 #undef B_TRANSLATION_CONTEXT
23 #define B_TRANSLATION_CONTEXT "Main window"
26 OverlayWindow::OverlayWindow()
28 BWindow(BRect(50, 50, 500, 200), B_TRANSLATE_SYSTEM_NAME("OverlayImage"),
29 B_TITLED_WINDOW, B_NOT_RESIZABLE | B_NOT_ZOOMABLE)
31 OverlayView *replView = new OverlayView(Bounds());
32 AddChild(replView);
34 BView *bgView = new BView(Bounds(), "bgView", B_FOLLOW_ALL, B_WILL_DRAW);
35 bgView->SetViewUIColor(B_PANEL_BACKGROUND_COLOR);
36 AddChild(bgView);
40 bool
41 OverlayWindow::QuitRequested()
43 be_app->PostMessage(B_QUIT_REQUESTED);
44 return true;