1 /* 2 * Copyright 2005-2008, Haiku, Inc. 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 10 #include "OffscreenWindow.h" 11 #include "ServerBitmap.h" 12 13 #include "OffscreenServerWindow.h" 14 15 16 OffscreenServerWindow::OffscreenServerWindow(const char *title, ServerApp *app, 17 port_id clientPort, port_id looperPort, int32 handlerID, 18 ServerBitmap* bitmap) 19 : ServerWindow(title, app, clientPort, looperPort, handlerID), 20 fBitmap(bitmap) 21 { 22 } 23 24 25 OffscreenServerWindow::~OffscreenServerWindow() 26 { 27 fBitmap->ReleaseReference(); 28 } 29 30 31 void 32 OffscreenServerWindow::SendMessageToClient(const BMessage* msg, int32 target, 33 bool usePreferred) const 34 { 35 // We're a special kind of window. The client BWindow thread is not running, 36 // so we cannot post messages to the client. In order to not mess arround 37 // with all the other code, we simply make this function virtual and 38 // don't do anything in this implementation. 39 } 40 41 42 Window* 43 OffscreenServerWindow::MakeWindow(BRect frame, const char* name, 44 window_look look, window_feel feel, uint32 flags, uint32 workspace) 45 { 46 return new OffscreenWindow(fBitmap, name, this); 47 } 48