1/* 2 * Copyright 2009, Haiku Inc. All rights reserved. 3 * Distributed under the terms of the MIT License. 4 * 5 * Authors: 6 * Alexandre Deckner <alex@zappotek.com> 7 */ 8 9#include "MainWindow.h" 10#include "RenderView.h" 11 12#include <Application.h> 13#include <MenuBar.h> 14#include <MenuItem.h> 15 16#include <stdio.h> 17 18MainWindow::MainWindow(BRect frame, const char* title) 19 : 20 BDirectWindow(frame, title, B_TITLED_WINDOW_LOOK, B_NORMAL_WINDOW_FEEL, 0) 21{ 22 fRenderView = new RenderView(Bounds()); 23 fRenderView->SetViewColor(0, 0, 0); 24 25 AddChild(fRenderView); 26 Show(); 27} 28 29 30MainWindow::~MainWindow() 31{ 32} 33 34 35bool 36MainWindow::QuitRequested() 37{ 38 be_app->PostMessage(B_QUIT_REQUESTED); 39 return true; 40} 41 42 43void 44MainWindow::MessageReceived(BMessage* message) 45{ 46 switch (message->what) { 47 default: 48 BDirectWindow::MessageReceived(message); 49 } 50} 51 52 53void 54MainWindow::DirectConnected(direct_buffer_info* info) 55{ 56 fRenderView->DirectConnected(info); 57} 58