2003-02-12 04:11:55 +03:00
|
|
|
//------------------------------------------------------------------------------
|
|
|
|
// Copyright (c) 2001-2002, OpenBeOS
|
|
|
|
//
|
|
|
|
// Permission is hereby granted, free of charge, to any person obtaining a
|
|
|
|
// copy of this software and associated documentation files (the "Software"),
|
|
|
|
// to deal in the Software without restriction, including without limitation
|
|
|
|
// the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
|
|
|
// and/or sell copies of the Software, and to permit persons to whom the
|
|
|
|
// Software is furnished to do so, subject to the following conditions:
|
|
|
|
//
|
|
|
|
// The above copyright notice and this permission notice shall be included in
|
|
|
|
// all copies or substantial portions of the Software.
|
|
|
|
//
|
|
|
|
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
|
|
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
|
|
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
|
|
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
|
|
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
|
|
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
|
|
|
// DEALINGS IN THE SOFTWARE.
|
|
|
|
//
|
|
|
|
// File Name: ServerWindow.h
|
|
|
|
// Author: DarkWyrm <bpmagic@columbus.rr.com>
|
|
|
|
// Description: Shadow BWindow class
|
|
|
|
//
|
|
|
|
//------------------------------------------------------------------------------
|
2003-02-07 15:53:57 +03:00
|
|
|
#ifndef _SERVERWIN_H_
|
|
|
|
#define _SERVERWIN_H_
|
|
|
|
|
|
|
|
#include <SupportDefs.h>
|
|
|
|
#include <GraphicsDefs.h>
|
|
|
|
#include <OS.h>
|
|
|
|
#include <Locker.h>
|
|
|
|
#include <Rect.h>
|
|
|
|
#include <String.h>
|
|
|
|
|
|
|
|
class BString;
|
2003-02-12 04:11:55 +03:00
|
|
|
class BMessenger;
|
2003-02-07 15:53:57 +03:00
|
|
|
class BPoint;
|
|
|
|
class ServerApp;
|
|
|
|
class Decorator;
|
|
|
|
class PortLink;
|
2003-02-14 04:53:53 +03:00
|
|
|
class WinBorder;
|
2003-02-20 16:13:01 +03:00
|
|
|
class Workspace;
|
2003-02-07 15:53:57 +03:00
|
|
|
|
|
|
|
class ServerWindow
|
|
|
|
{
|
|
|
|
public:
|
2003-02-12 04:11:55 +03:00
|
|
|
ServerWindow(BRect rect, const char *string, uint32 wlook, uint32 wfeel,
|
|
|
|
uint32 wflags, ServerApp *winapp, port_id winport, uint32 index);
|
2003-02-07 15:53:57 +03:00
|
|
|
~ServerWindow(void);
|
|
|
|
|
2003-02-12 04:11:55 +03:00
|
|
|
void ReplaceDecorator(void);
|
|
|
|
void Quit(void);
|
|
|
|
const char *GetTitle(void);
|
|
|
|
ServerApp *GetApp(void);
|
2003-02-07 15:53:57 +03:00
|
|
|
void Show(void);
|
|
|
|
void Hide(void);
|
2003-02-12 04:11:55 +03:00
|
|
|
bool IsHidden(void);
|
2003-02-07 15:53:57 +03:00
|
|
|
void SetFocus(bool value);
|
|
|
|
bool HasFocus(void);
|
2003-02-12 04:11:55 +03:00
|
|
|
void RequestDraw(BRect rect);
|
2003-02-07 15:53:57 +03:00
|
|
|
|
|
|
|
void WorkspaceActivated(int32 NewDesktop, const BPoint Resolution, color_space CSpace);
|
|
|
|
void WindowActivated(bool Active);
|
|
|
|
void ScreenModeChanged(const BPoint Resolution, color_space CSpace);
|
|
|
|
|
2003-02-12 04:11:55 +03:00
|
|
|
void SetFrame(const BRect &rect);
|
|
|
|
BRect Frame(void);
|
|
|
|
|
|
|
|
status_t Lock(void);
|
|
|
|
void Unlock(void);
|
|
|
|
bool IsLocked(void);
|
|
|
|
|
|
|
|
void DispatchMessage(int32 code, int8 *msgbuffer);
|
|
|
|
static int32 MonitorWin(void *data);
|
2003-02-07 15:53:57 +03:00
|
|
|
static void HandleMouseEvent(int32 code, int8 *buffer);
|
2003-02-12 04:11:55 +03:00
|
|
|
static void HandleKeyEvent(int32 code, int8 *buffer);
|
|
|
|
void Loop(void);
|
2003-02-20 16:13:01 +03:00
|
|
|
|
|
|
|
int32 GetWorkspaceIndex(void) { return _workspace_index; }
|
|
|
|
Workspace *GetWorkspace(void) { return _workspace; }
|
2003-02-07 15:53:57 +03:00
|
|
|
|
|
|
|
protected:
|
|
|
|
friend ServerApp;
|
2003-02-14 04:53:53 +03:00
|
|
|
friend WinBorder;
|
|
|
|
|
2003-02-07 15:53:57 +03:00
|
|
|
BString *_title;
|
|
|
|
int32 _look, _feel, _flags;
|
2003-02-20 16:13:01 +03:00
|
|
|
int32 _workspace_index;
|
|
|
|
Workspace *_workspace;
|
2003-02-07 15:53:57 +03:00
|
|
|
bool _active;
|
2003-02-12 04:11:55 +03:00
|
|
|
|
2003-02-07 15:53:57 +03:00
|
|
|
ServerApp *_app;
|
2003-02-12 04:11:55 +03:00
|
|
|
|
2003-02-07 15:53:57 +03:00
|
|
|
Decorator *_decorator;
|
2003-02-14 04:53:53 +03:00
|
|
|
WinBorder *_winborder;
|
2003-02-07 15:53:57 +03:00
|
|
|
|
|
|
|
thread_id _monitorthread;
|
2003-02-12 04:11:55 +03:00
|
|
|
port_id _receiver; // Messages from window
|
|
|
|
port_id _sender; // Messages to window
|
2003-02-07 15:53:57 +03:00
|
|
|
PortLink *_winlink,*_applink;
|
2003-02-12 04:11:55 +03:00
|
|
|
BLocker _locker;
|
2003-02-07 15:53:57 +03:00
|
|
|
BRect _frame;
|
2003-02-20 03:59:41 +03:00
|
|
|
bool _hidecount;
|
2003-02-12 04:11:55 +03:00
|
|
|
uint32 _token;
|
2003-02-07 15:53:57 +03:00
|
|
|
};
|
|
|
|
|
2003-02-20 16:13:01 +03:00
|
|
|
void ActivateWindow(ServerWindow *oldwin,ServerWindow *newwin);
|
2003-02-07 15:53:57 +03:00
|
|
|
|
|
|
|
|
|
|
|
#endif
|