* Got rid of the "Layer" part of WindowLayer, ViewLayer, WorkspacesLayer

(now WorkspacesView), OffscreenWindowLayer.
* Renamed ServerScreen.cpp/h to Screen.cpp/h (the class was already called
  Screen).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24303 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler 2008-03-08 12:45:54 +00:00
parent b0121f5117
commit 953d895e02
27 changed files with 1004 additions and 1002 deletions

View File

@ -18,16 +18,16 @@
#include "DrawingEngine.h"
#include "HWInterface.h"
#include "InputManager.h"
#include "Screen.h"
#include "ServerApp.h"
#include "ServerConfig.h"
#include "ServerCursor.h"
#include "ServerScreen.h"
#include "ServerWindow.h"
#include "SystemPalette.h"
#include "WindowPrivate.h"
#include "WindowLayer.h"
#include "Window.h"
#include "Workspace.h"
#include "WorkspacesLayer.h"
#include "WorkspacesView.h"
#include <ViewPrivate.h>
#include <WindowInfo.h>
@ -239,7 +239,7 @@ MouseFilter::Filter(BMessage* message, EventTarget** _target, int32* _viewToken,
int32 viewToken = B_NULL_TOKEN;
WindowLayer* window = fDesktop->MouseEventWindow();
Window* window = fDesktop->MouseEventWindow();
if (window == NULL)
window = fDesktop->WindowAt(where);
@ -667,7 +667,7 @@ Desktop::_ActivateApp(team_id team)
// search for an unhidden window to give focus to
for (WindowLayer* window = fAllWindows.FirstWindow(); window != NULL;
for (Window* window = fAllWindows.FirstWindow(); window != NULL;
window = window->NextWindow(kAllWindowList)) {
// if window is a normal window of the team, and not hidden,
// we've found our target
@ -752,13 +752,13 @@ Desktop::RedrawBackground()
BRegion redraw;
WindowLayer* window = _CurrentWindows().FirstWindow();
Window* window = _CurrentWindows().FirstWindow();
if (window->Feel() == kDesktopWindowFeel) {
redraw = window->VisibleContentRegion();
// look for desktop background view, and update its background color
// TODO: is there a better way to do this?
ViewLayer* view = window->TopLayer();
View* view = window->TopLayer();
if (view != NULL)
view = view->FirstChild();
@ -909,7 +909,7 @@ Desktop::_SetWorkspace(int32 index)
BRegion dirty;
for (WindowLayer* window = _CurrentWindows().FirstWindow();
for (Window* window = _CurrentWindows().FirstWindow();
window != NULL; window = window->NextWindow(previousIndex)) {
// store current position in Workspace anchor
window->Anchor(previousIndex).position = window->Frame().LeftTop();
@ -935,7 +935,7 @@ Desktop::_SetWorkspace(int32 index)
WindowList windows(kWorkingList);
BList previousRegions;
for (WindowLayer* window = _Windows(index).FirstWindow();
for (Window* window = _Windows(index).FirstWindow();
window != NULL; window = window->NextWindow(index)) {
BPoint position = window->Anchor(index).position;
@ -989,7 +989,7 @@ Desktop::_SetWorkspace(int32 index)
_RebuildClippingForAllWindows(stillAvailableOnScreen);
_SetBackground(stillAvailableOnScreen);
for (WindowLayer* window = _Windows(index).FirstWindow(); window != NULL;
for (Window* window = _Windows(index).FirstWindow(); window != NULL;
window = window->NextWindow(index)) {
// send B_WORKSPACE_ACTIVATED message
window->WorkspaceActivated(index, true);
@ -1006,7 +1006,7 @@ Desktop::_SetWorkspace(int32 index)
// Catch order changes in the new workspaces window list
int32 i = 0;
for (WindowLayer* window = windows.FirstWindow(); window != NULL;
for (Window* window = windows.FirstWindow(); window != NULL;
window = window->NextWindow(kWorkingList), i++) {
BRegion* region = (BRegion*)previousRegions.ItemAt(i);
region->ExclusiveInclude(&window->VisibleRegion());
@ -1066,7 +1066,7 @@ Desktop::ScreenChanged(Screen* screen, bool makeDefault)
update.AddInt32("mode", screen->ColorSpace());
// TODO: currently ignores the screen argument!
for (WindowLayer* window = fAllWindows.FirstWindow(); window != NULL;
for (Window* window = fAllWindows.FirstWindow(); window != NULL;
window = window->NextWindow(kAllWindowList)) {
window->ServerWindow()->SendMessageToClient(&update);
}
@ -1085,7 +1085,7 @@ Desktop::ScreenChanged(Screen* screen, bool makeDefault)
}
// #pragma mark - Methods for WindowLayer manipulation
// #pragma mark - Methods for Window manipulation
WindowList&
@ -1104,14 +1104,14 @@ Desktop::_Windows(int32 index)
void
Desktop::_UpdateFloating(int32 previousWorkspace, int32 nextWorkspace,
WindowLayer* mouseEventWindow)
Window* mouseEventWindow)
{
if (previousWorkspace == -1)
previousWorkspace = fCurrentWorkspace;
if (nextWorkspace == -1)
nextWorkspace = previousWorkspace;
for (WindowLayer* floating = fSubsetWindows.FirstWindow(); floating != NULL;
for (Window* floating = fSubsetWindows.FirstWindow(); floating != NULL;
floating = floating->NextWindow(kSubsetList)) {
// we only care about app/subset floating windows
if (floating->Feel() != B_FLOATING_SUBSET_WINDOW_FEEL
@ -1161,7 +1161,7 @@ Desktop::_UpdateBack()
{
fBack = NULL;
for (WindowLayer* window = _CurrentWindows().FirstWindow();
for (Window* window = _CurrentWindows().FirstWindow();
window != NULL; window = window->NextWindow(fCurrentWorkspace)) {
if (window->IsHidden() || window->Feel() == kDesktopWindowFeel)
continue;
@ -1185,7 +1185,7 @@ Desktop::_UpdateFront(bool updateFloating)
{
fFront = NULL;
for (WindowLayer* window = _CurrentWindows().LastWindow();
for (Window* window = _CurrentWindows().LastWindow();
window != NULL; window = window->PreviousWindow(fCurrentWorkspace)) {
if (window->IsHidden() || window->IsFloating() || !window->SupportsFront())
continue;
@ -1215,7 +1215,7 @@ Desktop::_UpdateFronts(bool updateFloating)
EventTarget*
Desktop::KeyboardEventTarget()
{
WindowLayer* window = _CurrentWindows().LastWindow();
Window* window = _CurrentWindows().LastWindow();
while (window != NULL && window->IsHidden()) {
window = window->PreviousWindow(fCurrentWorkspace);
}
@ -1230,12 +1230,12 @@ Desktop::KeyboardEventTarget()
bool
Desktop::_WindowHasModal(WindowLayer* window)
Desktop::_WindowHasModal(Window* window)
{
if (window == NULL)
return false;
for (WindowLayer* modal = fSubsetWindows.FirstWindow(); modal != NULL;
for (Window* modal = fSubsetWindows.FirstWindow(); modal != NULL;
modal = modal->NextWindow(kSubsetList)) {
// only visible modal windows count
if (!modal->IsModal() || modal->IsHidden())
@ -1253,10 +1253,10 @@ Desktop::_WindowHasModal(WindowLayer* window)
You must at least hold a single window lock when calling this method.
*/
void
Desktop::_WindowChanged(WindowLayer* window)
Desktop::_WindowChanged(Window* window)
{
for (uint32 i = fWorkspacesViews.CountItems(); i-- > 0;) {
WorkspacesLayer* view = fWorkspacesViews.ItemAt(i);
WorkspacesView* view = fWorkspacesViews.ItemAt(i);
view->WindowChanged(window);
}
}
@ -1266,17 +1266,17 @@ Desktop::_WindowChanged(WindowLayer* window)
You must at least hold a single window lock when calling this method.
*/
void
Desktop::_WindowRemoved(WindowLayer* window)
Desktop::_WindowRemoved(Window* window)
{
for (uint32 i = fWorkspacesViews.CountItems(); i-- > 0;) {
WorkspacesLayer* view = fWorkspacesViews.ItemAt(i);
WorkspacesView* view = fWorkspacesViews.ItemAt(i);
view->WindowRemoved(window);
}
}
void
Desktop::AddWorkspacesView(WorkspacesLayer* view)
Desktop::AddWorkspacesView(WorkspacesView* view)
{
if (view->Window() == NULL || view->Window()->IsHidden())
return;
@ -1291,7 +1291,7 @@ Desktop::AddWorkspacesView(WorkspacesLayer* view)
void
Desktop::RemoveWorkspacesView(WorkspacesLayer* view)
Desktop::RemoveWorkspacesView(WorkspacesView* view)
{
if (!LockAllWindows())
return;
@ -1311,7 +1311,7 @@ Desktop::RemoveWorkspacesView(WorkspacesLayer* view)
Windows must not be locked when calling this method.
*/
void
Desktop::_SendFakeMouseMoved(WindowLayer* window)
Desktop::_SendFakeMouseMoved(Window* window)
{
int32 viewToken = B_NULL_TOKEN;
EventTarget* target = NULL;
@ -1346,7 +1346,7 @@ Desktop::_SendFakeMouseMoved(WindowLayer* window)
void
Desktop::SetFocusWindow(WindowLayer* focus)
Desktop::SetFocusWindow(Window* focus)
{
if (!LockAllWindows())
return;
@ -1445,7 +1445,7 @@ Desktop::_BringWindowsToFront(WindowList& windows, int32 list,
// visible of the window
BRegion clean;
for (WindowLayer* window = windows.FirstWindow(); window != NULL;
for (Window* window = windows.FirstWindow(); window != NULL;
window = window->NextWindow(list)) {
if (wereVisible)
clean.Include(&window->VisibleRegion());
@ -1463,7 +1463,7 @@ Desktop::_BringWindowsToFront(WindowList& windows, int32 list,
// redraw what became visible of the window(s)
BRegion dirty;
for (WindowLayer* window = windows.FirstWindow(); window != NULL;
for (Window* window = windows.FirstWindow(); window != NULL;
window = window->NextWindow(list)) {
dirty.Include(&window->VisibleRegion());
}
@ -1487,7 +1487,7 @@ Desktop::_BringWindowsToFront(WindowList& windows, int32 list,
of their subset.
*/
void
Desktop::ActivateWindow(WindowLayer* window)
Desktop::ActivateWindow(Window* window)
{
STRACE(("ActivateWindow(%p, %s)\n", window, window ? window->Title() : "<none>"));
@ -1533,7 +1533,7 @@ Desktop::ActivateWindow(WindowLayer* window)
if (window == FrontWindow()) {
// see if there is a normal B_AVOID_FRONT window still in front of us
WindowLayer* avoidsFront = window->NextWindow(fCurrentWorkspace);
Window* avoidsFront = window->NextWindow(fCurrentWorkspace);
while (avoidsFront && avoidsFront->IsNormal()
&& (avoidsFront->Flags() & B_AVOID_FRONT) == 0) {
avoidsFront = avoidsFront->NextWindow(fCurrentWorkspace);
@ -1554,7 +1554,7 @@ Desktop::ActivateWindow(WindowLayer* window)
BRegion clean(window->VisibleRegion());
WindowList windows(kWorkingList);
WindowLayer* frontmost = window->Frontmost();
Window* frontmost = window->Frontmost();
_CurrentWindows().RemoveWindow(window);
windows.AddWindow(window);
@ -1564,8 +1564,8 @@ Desktop::ActivateWindow(WindowLayer* window)
// (ie. they are staying in front of them, but they are
// not supposed to change their order because of that)
WindowLayer* nextModal;
for (WindowLayer* modal = frontmost; modal != NULL; modal = nextModal) {
Window* nextModal;
for (Window* modal = frontmost; modal != NULL; modal = nextModal) {
// get the next modal window
nextModal = modal->NextWindow(fCurrentWorkspace);
while (nextModal != NULL && !nextModal->IsModal()) {
@ -1588,7 +1588,7 @@ Desktop::ActivateWindow(WindowLayer* window)
void
Desktop::SendWindowBehind(WindowLayer* window, WindowLayer* behindOf)
Desktop::SendWindowBehind(Window* window, Window* behindOf)
{
// TODO: should the "not in current workspace" be handled anyway?
// (the code below would have to be changed then, though)
@ -1607,7 +1607,7 @@ Desktop::SendWindowBehind(WindowLayer* window, WindowLayer* behindOf)
BRegion dirty(window->VisibleRegion());
// detach window and re-attach at desired position
WindowLayer* backmost = window->Backmost(behindOf);
Window* backmost = window->Backmost(behindOf);
_CurrentWindows().RemoveWindow(window);
_CurrentWindows().AddWindow(window, backmost
@ -1639,7 +1639,7 @@ Desktop::SendWindowBehind(WindowLayer* window, WindowLayer* behindOf)
void
Desktop::ShowWindow(WindowLayer* window)
Desktop::ShowWindow(Window* window)
{
if (!window->IsHidden())
return;
@ -1676,7 +1676,7 @@ Desktop::ShowWindow(WindowLayer* window)
void
Desktop::HideWindow(WindowLayer* window)
Desktop::HideWindow(Window* window)
{
if (window->IsHidden())
return;
@ -1704,10 +1704,10 @@ Desktop::HideWindow(WindowLayer* window)
if (window->HasWorkspacesViews()) {
// remove workspaces views from this window
BObjectList<WorkspacesLayer> list(false);
BObjectList<WorkspacesView> list(false);
window->FindWorkspacesViews(list);
while (WorkspacesLayer* view = list.RemoveItemAt(0)) {
while (WorkspacesView* view = list.RemoveItemAt(0)) {
fWorkspacesViews.RemoveItem(view);
}
}
@ -1721,10 +1721,10 @@ Desktop::HideWindow(WindowLayer* window)
/*!
Shows the window on the screen - it does this independently of the
WindowLayer::IsHidden() state.
Window::IsHidden() state.
*/
void
Desktop::_ShowWindow(WindowLayer* window, bool affectsOtherWindows)
Desktop::_ShowWindow(Window* window, bool affectsOtherWindows)
{
BRegion background;
_RebuildClippingForAllWindows(background);
@ -1746,10 +1746,10 @@ Desktop::_ShowWindow(WindowLayer* window, bool affectsOtherWindows)
/*!
Hides the window from the screen - it does this independently of the
WindowLayer::IsHidden() state.
Window::IsHidden() state.
*/
void
Desktop::_HideWindow(WindowLayer* window)
Desktop::_HideWindow(Window* window)
{
// after rebuilding the clipping,
// this window will not have a visible
@ -1770,7 +1770,7 @@ Desktop::_HideWindow(WindowLayer* window)
void
Desktop::MoveWindowBy(WindowLayer* window, float x, float y, int32 workspace)
Desktop::MoveWindowBy(Window* window, float x, float y, int32 workspace)
{
if (!LockAllWindows())
return;
@ -1836,7 +1836,7 @@ Desktop::MoveWindowBy(WindowLayer* window, float x, float y, int32 workspace)
void
Desktop::ResizeWindowBy(WindowLayer* window, float x, float y)
Desktop::ResizeWindowBy(Window* window, float x, float y)
{
if (!LockAllWindows())
return;
@ -1877,7 +1877,7 @@ Desktop::ResizeWindowBy(WindowLayer* window, float x, float y)
bool
Desktop::SetWindowTabLocation(WindowLayer* window, float location)
Desktop::SetWindowTabLocation(Window* window, float location)
{
if (!LockAllWindows())
return false;
@ -1901,8 +1901,7 @@ Desktop::SetWindowTabLocation(WindowLayer* window, float location)
bool
Desktop::SetWindowDecoratorSettings(WindowLayer* window,
const BMessage& settings)
Desktop::SetWindowDecoratorSettings(Window* window, const BMessage& settings)
{
// TODO: almost exact code duplication to above function...
@ -1934,7 +1933,7 @@ Desktop::SetWindowDecoratorSettings(WindowLayer* window,
SetWorkspace().
*/
void
Desktop::_UpdateSubsetWorkspaces(WindowLayer* window, int32 previousIndex,
Desktop::_UpdateSubsetWorkspaces(Window* window, int32 previousIndex,
int32 newIndex)
{
STRACE(("_UpdateSubsetWorkspaces(window %p, %s)\n", window, window->Title()));
@ -1943,7 +1942,7 @@ Desktop::_UpdateSubsetWorkspaces(WindowLayer* window, int32 previousIndex,
if (!window->IsNormal() || window->IsHidden())
return;
for (WindowLayer* subset = fSubsetWindows.FirstWindow(); subset != NULL;
for (Window* subset = fSubsetWindows.FirstWindow(); subset != NULL;
subset = subset->NextWindow(kSubsetList)) {
if (subset->Feel() == B_MODAL_ALL_WINDOW_FEEL
|| subset->Feel() == B_FLOATING_ALL_WINDOW_FEEL) {
@ -1975,7 +1974,7 @@ Desktop::_UpdateSubsetWorkspaces(WindowLayer* window, int32 previousIndex,
\brief Adds or removes the window to or from the workspaces it's on.
*/
void
Desktop::_ChangeWindowWorkspaces(WindowLayer* window, uint32 oldWorkspaces,
Desktop::_ChangeWindowWorkspaces(Window* window, uint32 oldWorkspaces,
uint32 newWorkspaces)
{
// apply changes to the workspaces' window lists
@ -2025,7 +2024,7 @@ Desktop::_ChangeWindowWorkspaces(WindowLayer* window, uint32 oldWorkspaces,
void
Desktop::SetWindowWorkspaces(WindowLayer* window, uint32 workspaces)
Desktop::SetWindowWorkspaces(Window* window, uint32 workspaces)
{
LockAllWindows();
@ -2046,7 +2045,7 @@ Desktop::SetWindowWorkspaces(WindowLayer* window, uint32 workspaces)
via ShowWindow().
*/
void
Desktop::AddWindow(WindowLayer *window)
Desktop::AddWindow(Window *window)
{
LockAllWindows();
@ -2068,7 +2067,7 @@ Desktop::AddWindow(WindowLayer *window)
void
Desktop::RemoveWindow(WindowLayer *window)
Desktop::RemoveWindow(Window *window)
{
LockAllWindows();
@ -2089,7 +2088,7 @@ Desktop::RemoveWindow(WindowLayer *window)
bool
Desktop::AddWindowToSubset(WindowLayer* subset, WindowLayer* window)
Desktop::AddWindowToSubset(Window* subset, Window* window)
{
if (!subset->AddToSubset(window))
return false;
@ -2100,7 +2099,7 @@ Desktop::AddWindowToSubset(WindowLayer* subset, WindowLayer* window)
void
Desktop::RemoveWindowFromSubset(WindowLayer* subset, WindowLayer* window)
Desktop::RemoveWindowFromSubset(Window* subset, Window* window)
{
subset->RemoveFromSubset(window);
_ChangeWindowWorkspaces(subset, subset->Workspaces(), subset->SubsetWorkspaces());
@ -2108,7 +2107,7 @@ Desktop::RemoveWindowFromSubset(WindowLayer* subset, WindowLayer* window)
void
Desktop::SetWindowLook(WindowLayer *window, window_look newLook)
Desktop::SetWindowLook(Window *window, window_look newLook)
{
if (window->Look() == newLook)
return;
@ -2133,7 +2132,7 @@ Desktop::SetWindowLook(WindowLayer *window, window_look newLook)
void
Desktop::SetWindowFeel(WindowLayer *window, window_feel newFeel)
Desktop::SetWindowFeel(Window *window, window_feel newFeel)
{
if (window->Feel() == newFeel)
return;
@ -2168,10 +2167,10 @@ Desktop::SetWindowFeel(WindowLayer *window, window_feel newFeel)
if (i == fCurrentWorkspace && window->IsVisible())
visibleBefore = window->VisibleRegion();
WindowLayer* backmost = window->Backmost(_Windows(i).LastWindow(), i);
Window* backmost = window->Backmost(_Windows(i).LastWindow(), i);
if (backmost != NULL) {
// check if the backmost window is really behind it
WindowLayer* previous = window->PreviousWindow(i);
Window* previous = window->PreviousWindow(i);
while (previous != NULL) {
if (previous == backmost)
break;
@ -2187,10 +2186,10 @@ Desktop::SetWindowFeel(WindowLayer *window, window_feel newFeel)
}
}
WindowLayer* frontmost = window->Frontmost(_Windows(i).FirstWindow(), i);
Window* frontmost = window->Frontmost(_Windows(i).FirstWindow(), i);
if (frontmost != NULL) {
// check if the frontmost window is really in front of it
WindowLayer* next = window->NextWindow(i);
Window* next = window->NextWindow(i);
while (next != NULL) {
if (next == frontmost)
break;
@ -2232,7 +2231,7 @@ Desktop::SetWindowFeel(WindowLayer *window, window_feel newFeel)
void
Desktop::SetWindowFlags(WindowLayer *window, uint32 newFlags)
Desktop::SetWindowFlags(Window *window, uint32 newFlags)
{
if (window->Flags() == newFlags)
return;
@ -2257,7 +2256,7 @@ Desktop::SetWindowFlags(WindowLayer *window, uint32 newFlags)
void
Desktop::SetWindowTitle(WindowLayer *window, const char* title)
Desktop::SetWindowTitle(Window *window, const char* title)
{
if (!LockAllWindows())
return;
@ -2281,10 +2280,10 @@ Desktop::SetWindowTitle(WindowLayer *window, const char* title)
Returns the window under the mouse cursor.
You need to have acquired the All Windows lock when calling this method.
*/
WindowLayer*
Window*
Desktop::WindowAt(BPoint where)
{
for (WindowLayer* window = _CurrentWindows().LastWindow(); window;
for (Window* window = _CurrentWindows().LastWindow(); window;
window = window->PreviousWindow(fCurrentWorkspace)) {
if (window->IsVisible() && window->VisibleRegion().Contains(where))
return window;
@ -2295,14 +2294,14 @@ Desktop::WindowAt(BPoint where)
void
Desktop::SetMouseEventWindow(WindowLayer* window)
Desktop::SetMouseEventWindow(Window* window)
{
fMouseEventWindow = window;
}
void
Desktop::SetViewUnderMouse(const WindowLayer* window, int32 viewToken)
Desktop::SetViewUnderMouse(const Window* window, int32 viewToken)
{
fWindowUnderMouse = window;
fViewUnderMouse = viewToken;
@ -2310,7 +2309,7 @@ Desktop::SetViewUnderMouse(const WindowLayer* window, int32 viewToken)
int32
Desktop::ViewUnderMouse(const WindowLayer* window)
Desktop::ViewUnderMouse(const Window* window)
{
if (window != NULL && fWindowUnderMouse == window)
return fViewUnderMouse;
@ -2319,10 +2318,10 @@ Desktop::ViewUnderMouse(const WindowLayer* window)
}
WindowLayer *
Desktop::FindWindowLayerByClientToken(int32 token, team_id teamID)
Window *
Desktop::FindWindowByClientToken(int32 token, team_id teamID)
{
for (WindowLayer *window = fAllWindows.FirstWindow(); window != NULL;
for (Window *window = fAllWindows.FirstWindow(); window != NULL;
window = window->NextWindow(kAllWindowList)) {
if (window->ServerWindow()->ClientToken() == token
&& window->ServerWindow()->ClientTeam() == teamID) {
@ -2341,7 +2340,7 @@ Desktop::MinimizeApplication(team_id team)
// Just minimize all windows of that application
for (WindowLayer *window = fAllWindows.FirstWindow(); window != NULL;
for (Window *window = fAllWindows.FirstWindow(); window != NULL;
window = window->NextWindow(kAllWindowList)) {
if (window->ServerWindow()->ClientTeam() != team)
continue;
@ -2358,7 +2357,7 @@ Desktop::BringApplicationToFront(team_id team)
// TODO: for now, just maximize all windows of that application
for (WindowLayer *window = fAllWindows.FirstWindow(); window != NULL;
for (Window *window = fAllWindows.FirstWindow(); window != NULL;
window = window->NextWindow(kAllWindowList)) {
if (window->ServerWindow()->ClientTeam() != team)
continue;
@ -2377,7 +2376,7 @@ Desktop::WindowAction(int32 windowToken, int32 action)
LockAllWindows();
::ServerWindow* serverWindow;
WindowLayer* window;
Window* window;
if (BPrivate::gDefaultTokens.GetToken(windowToken,
B_SERVER_TOKEN, (void**)&serverWindow) != B_OK
|| (window = serverWindow->Window()) == NULL) {
@ -2405,7 +2404,7 @@ Desktop::WriteWindowList(team_id team, BPrivate::LinkSender& sender)
int32 count = 0;
for (WindowLayer *window = fAllWindows.FirstWindow(); window != NULL;
for (Window *window = fAllWindows.FirstWindow(); window != NULL;
window = window->NextWindow(kAllWindowList)) {
if (team < B_OK || window->ServerWindow()->ClientTeam() == team)
count++;
@ -2416,7 +2415,7 @@ Desktop::WriteWindowList(team_id team, BPrivate::LinkSender& sender)
sender.StartMessage(B_OK);
sender.Attach<int32>(count);
for (WindowLayer *window = fAllWindows.FirstWindow(); window != NULL;
for (Window *window = fAllWindows.FirstWindow(); window != NULL;
window = window->NextWindow(kAllWindowList)) {
if (team >= B_OK && window->ServerWindow()->ClientTeam() != team)
continue;
@ -2483,7 +2482,7 @@ Desktop::_RebuildClippingForAllWindows(BRegion& stillAvailableOnScreen)
stillAvailableOnScreen = fScreenRegion;
// set clipping of each window
for (WindowLayer* window = _CurrentWindows().LastWindow(); window != NULL;
for (Window* window = _CurrentWindows().LastWindow(); window != NULL;
window = window->PreviousWindow(fCurrentWorkspace)) {
if (!window->IsHidden()) {
window->SetClipping(&stillAvailableOnScreen);
@ -2498,7 +2497,7 @@ void
Desktop::_TriggerWindowRedrawing(BRegion& newDirtyRegion)
{
// send redraw messages to all windows intersecting the dirty region
for (WindowLayer* window = _CurrentWindows().LastWindow(); window != NULL;
for (Window* window = _CurrentWindows().LastWindow(); window != NULL;
window = window->PreviousWindow(fCurrentWorkspace)) {
if (!window->IsHidden()
&& newDirtyRegion.Intersects(window->VisibleRegion().Frame()))

View File

@ -13,8 +13,8 @@
#include "CursorManager.h"
#include "EventDispatcher.h"
#include "Screen.h"
#include "ScreenManager.h"
#include "ServerScreen.h"
#include "VirtualScreen.h"
#include "DesktopSettings.h"
#include "MessageLooper.h"
@ -44,7 +44,8 @@ class BMessage;
class DrawingEngine;
class HWInterface;
class ServerApp;
class WorkspacesLayer;
class Window;
class WorkspacesView;
struct server_read_only_memory;
namespace BPrivate {
@ -109,55 +110,55 @@ class Desktop : public MessageLooper, public ScreenOwner {
{ return fWorkspaces[index]; }
status_t SetWorkspacesCount(int32 newCount);
// WindowLayer methods
// Window methods
void ActivateWindow(WindowLayer* window);
void SendWindowBehind(WindowLayer* window,
WindowLayer* behindOf = NULL);
void ActivateWindow(Window* window);
void SendWindowBehind(Window* window,
Window* behindOf = NULL);
void ShowWindow(WindowLayer* window);
void HideWindow(WindowLayer* window);
void ShowWindow(Window* window);
void HideWindow(Window* window);
void MoveWindowBy(WindowLayer* window, float x, float y,
void MoveWindowBy(Window* window, float x, float y,
int32 workspace = -1);
void ResizeWindowBy(WindowLayer* window, float x, float y);
bool SetWindowTabLocation(WindowLayer* window, float location);
bool SetWindowDecoratorSettings(WindowLayer* window,
void ResizeWindowBy(Window* window, float x, float y);
bool SetWindowTabLocation(Window* window, float location);
bool SetWindowDecoratorSettings(Window* window,
const BMessage& settings);
void SetWindowWorkspaces(WindowLayer* window,
void SetWindowWorkspaces(Window* window,
uint32 workspaces);
void AddWindow(WindowLayer* window);
void RemoveWindow(WindowLayer* window);
void AddWindow(Window* window);
void RemoveWindow(Window* window);
bool AddWindowToSubset(WindowLayer* subset,
WindowLayer* window);
void RemoveWindowFromSubset(WindowLayer* subset,
WindowLayer* window);
bool AddWindowToSubset(Window* subset,
Window* window);
void RemoveWindowFromSubset(Window* subset,
Window* window);
void SetWindowLook(WindowLayer* window, window_look look);
void SetWindowFeel(WindowLayer* window, window_feel feel);
void SetWindowFlags(WindowLayer* window, uint32 flags);
void SetWindowTitle(WindowLayer* window, const char* title);
void SetWindowLook(Window* window, window_look look);
void SetWindowFeel(Window* window, window_feel feel);
void SetWindowFlags(Window* window, uint32 flags);
void SetWindowTitle(Window* window, const char* title);
WindowLayer* FocusWindow() const { return fFocus; }
WindowLayer* FrontWindow() const { return fFront; }
WindowLayer* BackWindow() const { return fBack; }
Window* FocusWindow() const { return fFocus; }
Window* FrontWindow() const { return fFront; }
Window* BackWindow() const { return fBack; }
WindowLayer* WindowAt(BPoint where);
Window* WindowAt(BPoint where);
WindowLayer* MouseEventWindow() const { return fMouseEventWindow; }
void SetMouseEventWindow(WindowLayer* window);
Window* MouseEventWindow() const { return fMouseEventWindow; }
void SetMouseEventWindow(Window* window);
void SetViewUnderMouse(const WindowLayer* window, int32 viewToken);
int32 ViewUnderMouse(const WindowLayer* window);
void SetViewUnderMouse(const Window* window, int32 viewToken);
int32 ViewUnderMouse(const Window* window);
void SetFocusWindow(WindowLayer* window = NULL);
void SetFocusWindow(Window* window = NULL);
EventTarget* KeyboardEventTarget();
WindowLayer* FindWindowLayerByClientToken(int32 token, team_id teamID);
//WindowLayer* FindWindowLayerByServerToken(int32 token);
Window* FindWindowByClientToken(int32 token,
team_id teamID);
#if USE_MULTI_LOCKER
bool LockSingleWindow() { return fWindowLock.ReadLock(); }
@ -181,8 +182,8 @@ class Desktop : public MessageLooper, public ScreenOwner {
void RedrawBackground();
void StoreWorkspaceConfiguration(int32 index);
void AddWorkspacesView(WorkspacesLayer* view);
void RemoveWorkspacesView(WorkspacesLayer* view);
void AddWorkspacesView(WorkspacesView* view);
void RemoveWorkspacesView(WorkspacesView* view);
void MinimizeApplication(team_id team);
void BringApplicationToFront(team_id team);
@ -196,19 +197,19 @@ class Desktop : public MessageLooper, public ScreenOwner {
private:
void _LaunchInputServer();
void _SetWorkspace(int32 index);
void _ShowWindow(WindowLayer* window,
void _ShowWindow(Window* window,
bool affectsOtherWindows = true);
void _HideWindow(WindowLayer* window);
void _HideWindow(Window* window);
void _UpdateSubsetWorkspaces(WindowLayer* window,
void _UpdateSubsetWorkspaces(Window* window,
int32 previousIndex = -1,
int32 newIndex = -1);
void _ChangeWindowWorkspaces(WindowLayer* window,
void _ChangeWindowWorkspaces(Window* window,
uint32 oldWorkspaces, uint32 newWorkspaces);
void _BringWindowsToFront(WindowList& windows,
int32 list, bool wereVisible);
status_t _ActivateApp(team_id team);
void _SendFakeMouseMoved(WindowLayer* window = NULL);
void _SendFakeMouseMoved(Window* window = NULL);
void _RebuildClippingForAllWindows(BRegion& stillAvailableOnScreen);
void _TriggerWindowRedrawing(BRegion& newDirtyRegion);
@ -216,14 +217,14 @@ class Desktop : public MessageLooper, public ScreenOwner {
void _UpdateFloating(int32 previousWorkspace = -1,
int32 nextWorkspace = -1,
WindowLayer* mouseEventWindow = NULL);
Window* mouseEventWindow = NULL);
void _UpdateBack();
void _UpdateFront(bool updateFloating = true);
void _UpdateFronts(bool updateFloating = true);
bool _WindowHasModal(WindowLayer* window);
bool _WindowHasModal(Window* window);
void _WindowChanged(WindowLayer* window);
void _WindowRemoved(WindowLayer* window);
void _WindowChanged(Window* window);
void _WindowRemoved(Window* window);
void _GetLooperName(char* name, size_t size);
void _PrepareQuit();
@ -258,7 +259,7 @@ class Desktop : public MessageLooper, public ScreenOwner {
WindowList fAllWindows;
WindowList fSubsetWindows;
WindowList fFocusList;
BObjectList<WorkspacesLayer> fWorkspacesViews;
BObjectList<WorkspacesView> fWorkspacesViews;
Screen* fActiveScreen;
@ -273,15 +274,15 @@ class Desktop : public MessageLooper, public ScreenOwner {
BRegion fBackgroundRegion;
BRegion fScreenRegion;
WindowLayer* fMouseEventWindow;
const WindowLayer* fWindowUnderMouse;
Window* fMouseEventWindow;
const Window* fWindowUnderMouse;
int32 fViewUnderMouse;
BPoint fLastMousePosition;
int32 fLastMouseButtons;
WindowLayer* fFocus;
WindowLayer* fFront;
WindowLayer* fBack;
Window* fFocus;
Window* fFront;
Window* fBack;
};
#endif // DESKTOP_H

View File

@ -39,27 +39,27 @@ Server app_server :
MessageLooper.cpp
MultiLocker.cpp
OffscreenServerWindow.cpp
OffscreenWindowLayer.cpp
OffscreenWindow.cpp
PNGDump.cpp
ProfileMessageSupport.cpp
RAMLinkMsgReader.cpp
RGBColor.cpp
RegionPool.cpp
Screen.cpp
ScreenManager.cpp
ServerApp.cpp
ServerBitmap.cpp
ServerCursor.cpp
ServerFont.cpp
ServerPicture.cpp
ServerScreen.cpp
ServerWindow.cpp
SystemPalette.cpp
ViewLayer.cpp
View.cpp
VirtualScreen.cpp
WindowLayer.cpp
Window.cpp
WindowList.cpp
Workspace.cpp
WorkspacesLayer.cpp
WorkspacesView.cpp
# libraries
:

View File

@ -1,5 +1,5 @@
/*
* Copyright 2005, Haiku, Inc. All rights reserved.
* Copyright 2005-2008, Haiku, Inc. All rights reserved.
* Distributed under the terms of the MIT License.
*
* Authors:
@ -7,32 +7,29 @@
*/
#include "OffscreenWindowLayer.h"
#include "OffscreenWindow.h"
#include "ServerBitmap.h"
#include "OffscreenServerWindow.h"
OffscreenServerWindow::OffscreenServerWindow(const char *title,
ServerApp *app,
port_id clientPort,
port_id looperPort,
int32 handlerID,
ServerBitmap* bitmap)
OffscreenServerWindow::OffscreenServerWindow(const char *title, ServerApp *app,
port_id clientPort, port_id looperPort, int32 handlerID,
ServerBitmap* bitmap)
: ServerWindow(title, app, clientPort, looperPort, handlerID),
fBitmap(bitmap)
fBitmap(bitmap)
{
}
// destructor
OffscreenServerWindow::~OffscreenServerWindow()
{
}
// SendMessageToClient
void
OffscreenServerWindow::SendMessageToClient(const BMessage* msg, int32 target,
bool usePreferred) const
bool usePreferred) const
{
// We're a special kind of window. The client BWindow thread is not running,
// so we cannot post messages to the client. In order to not mess arround
@ -41,9 +38,9 @@ OffscreenServerWindow::SendMessageToClient(const BMessage* msg, int32 target,
}
WindowLayer*
OffscreenServerWindow::MakeWindowLayer(BRect frame, const char* name,
Window*
OffscreenServerWindow::MakeWindow(BRect frame, const char* name,
window_look look, window_feel feel, uint32 flags, uint32 workspace)
{
return new OffscreenWindowLayer(fBitmap, name, this);
return new OffscreenWindow(fBitmap, name, this);
}

View File

@ -1,5 +1,5 @@
/*
* Copyright 2005, Haiku, Inc. All rights reserved.
* Copyright 2005-2008, Haiku, Inc. All rights reserved.
* Distributed under the terms of the MIT License.
*
* Authors:
@ -13,26 +13,23 @@
class OffscreenServerWindow : public ServerWindow {
public:
OffscreenServerWindow(const char *title,
ServerApp *app,
port_id clientPort,
port_id looperPort,
int32 handlerID,
ServerBitmap* bitmap);
virtual ~OffscreenServerWindow();
public:
OffscreenServerWindow(const char *title, ServerApp *app,
port_id clientPort, port_id looperPort,
int32 handlerID, ServerBitmap* bitmap);
virtual ~OffscreenServerWindow();
// util methods.
virtual void SendMessageToClient(const BMessage* msg,
int32 target = B_NULL_TOKEN,
bool usePreferred = false) const;
virtual void SendMessageToClient(const BMessage* msg,
int32 target = B_NULL_TOKEN,
bool usePreferred = false) const;
virtual WindowLayer* MakeWindowLayer(BRect frame, const char* name,
window_look look, window_feel feel, uint32 flags,
uint32 workspace);
virtual ::Window* MakeWindow(BRect frame, const char* name,
window_look look, window_feel feel, uint32 flags,
uint32 workspace);
private:
ServerBitmap* fBitmap;
private:
ServerBitmap* fBitmap;
};
#endif // OFFSCREEN_SERVER_WINDOW_H

View File

@ -1,5 +1,5 @@
/*
* Copyright 2005, Haiku, Inc. All rights reserved.
* Copyright 2005-2008, Haiku, Inc. All rights reserved.
* Distributed under the terms of the MIT license.
*
* Author:
@ -7,24 +7,25 @@
*/
#include "BitmapHWInterface.h"
#include "DrawingEngine.h"
#include "OffscreenWindowLayer.h"
#include "ServerBitmap.h"
#include <Debug.h>
#include "DebugInfoManager.h"
#include "OffscreenWindow.h"
#include <stdio.h>
#include <Debug.h>
OffscreenWindowLayer::OffscreenWindowLayer(ServerBitmap* bitmap,
#include "BitmapHWInterface.h"
#include "DebugInfoManager.h"
#include "DrawingEngine.h"
#include "ServerBitmap.h"
OffscreenWindow::OffscreenWindow(ServerBitmap* bitmap,
const char* name, ::ServerWindow* window)
: WindowLayer(bitmap->Bounds(), name,
: Window(bitmap->Bounds(), name,
B_NO_BORDER_WINDOW_LOOK, B_NORMAL_WINDOW_FEEL,
0, 0, window, new DrawingEngine()),
fBitmap(bitmap),
fHWInterface(new BitmapHWInterface(fBitmap))
fBitmap(bitmap),
fHWInterface(new BitmapHWInterface(fBitmap))
{
fHWInterface->Initialize();
GetDrawingEngine()->SetHWInterface(fHWInterface);
@ -37,7 +38,7 @@ OffscreenWindowLayer::OffscreenWindowLayer(ServerBitmap* bitmap,
}
OffscreenWindowLayer::~OffscreenWindowLayer()
OffscreenWindow::~OffscreenWindow()
{
fHWInterface->LockExclusiveAccess();
// Unlike normal Layers, we own the DrawingEngine instance

View File

@ -0,0 +1,32 @@
/*
* Copyright 2005-2008, Haiku, Inc. All rights reserved.
* Distributed under the terms of the MIT license.
*
* Author:
* Stephan Aßmus <superstippi@gmx.de>
*/
#ifndef OFFSCREEN_WINDOW_H
#define OFFSCREEN_WINDOW_H
#include "Window.h"
class BitmapHWInterface;
class ServerBitmap;
class OffscreenWindow : public Window {
public:
OffscreenWindow(ServerBitmap* bitmap,
const char* name, ::ServerWindow* window);
virtual ~OffscreenWindow();
virtual bool IsOffscreenWindow() const
{ return true; }
private:
ServerBitmap* fBitmap;
BitmapHWInterface* fHWInterface;
};
#endif // OFFSCREEN_WINDOW_H

View File

@ -1,33 +0,0 @@
/*
* Copyright 2005, Haiku, Inc. All rights reserved.
* Distributed under the terms of the MIT license.
*
* Author:
* Stephan Aßmus <superstippi@gmx.de>
*/
#ifndef OFFSCREEN_WINBORDER_H
#define OFFSCREEN_WINBORDER_H
#include "WindowLayer.h"
class BitmapHWInterface;
class ServerBitmap;
class OffscreenWindowLayer : public WindowLayer {
public:
OffscreenWindowLayer(ServerBitmap* bitmap,
const char* name,
::ServerWindow* window);
virtual ~OffscreenWindowLayer();
virtual bool IsOffscreenWindow() const
{ return true; }
private:
ServerBitmap* fBitmap;
BitmapHWInterface* fHWInterface;
};
#endif // OFFSCREEN_WINBORDER_H

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2001-2007, Haiku, Inc.
* Copyright (c) 2001-2008, Haiku, Inc.
* Distributed under the terms of the MIT license.
*
* Authors:
@ -9,7 +9,7 @@
*/
#include "ServerScreen.h"
#include "Screen.h"
#include "BitmapManager.h"
#include "DrawingEngine.h"

View File

@ -1,5 +1,5 @@
/*
* Copyright 2005, Haiku.
* Copyright 2005-2008, Haiku.
* Distributed under the terms of the MIT License.
*
* Authors:
@ -11,8 +11,8 @@
#include "ScreenManager.h"
#include "Screen.h"
#include "ServerConfig.h"
#include "ServerScreen.h"
#include <Autolock.h>
#include <Entry.h>

View File

@ -30,16 +30,16 @@
#include "InputManager.h"
#include "OffscreenServerWindow.h"
#include "RAMLinkMsgReader.h"
#include "Screen.h"
#include "ServerApp.h"
#include "ServerBitmap.h"
#include "ServerConfig.h"
#include "ServerCursor.h"
#include "ServerPicture.h"
#include "ServerScreen.h"
#include "ServerTokenSpace.h"
#include "ServerWindow.h"
#include "SystemPalette.h"
#include "WindowLayer.h"
#include "Window.h"
#include <FontPrivate.h>
#include <MessengerPrivate.h>
@ -444,7 +444,7 @@ ServerApp::_DispatchMessage(int32 code, BPrivate::LinkReceiver& link)
for (int32 i = fWindowList.CountItems(); i-- > 0;) {
ServerWindow* serverWindow = fWindowList.ItemAt(i);
WindowLayer* window = serverWindow->Window();
Window* window = serverWindow->Window();
if (window == NULL || window->IsOffscreenWindow())
continue;
@ -2666,7 +2666,7 @@ ServerApp::InWorkspace(int32 index) const
for (int32 i = fWindowList.CountItems(); i-- > 0;) {
ServerWindow* serverWindow = fWindowList.ItemAt(i);
const WindowLayer* window = serverWindow->Window();
const Window* window = serverWindow->Window();
if (window == NULL || window->IsOffscreenWindow())
continue;
@ -2693,7 +2693,7 @@ ServerApp::Workspaces() const
for (int32 i = fWindowList.CountItems(); i-- > 0;) {
ServerWindow* serverWindow = fWindowList.ItemAt(i);
const WindowLayer* window = serverWindow->Window();
const Window* window = serverWindow->Window();
if (window == NULL || window->IsOffscreenWindow())
continue;

View File

@ -1,5 +1,5 @@
/*
* Copyright 2001-2007, Haiku.
* Copyright 2001-2008, Haiku.
* Distributed under the terms of the MIT License.
*
* Authors:
@ -15,8 +15,8 @@
#include "ServerFont.h"
#include "ServerPicture.h"
#include "ServerTokenSpace.h"
#include "ViewLayer.h"
#include "WindowLayer.h"
#include "View.h"
#include "Window.h"
#include <LinkReceiver.h>
#include <OffsetFile.h>
@ -47,7 +47,7 @@ class ShapePainter : public BShapeIterator {
virtual status_t IterateBezierTo(int32 bezierCount, BPoint *bezierPts);
virtual status_t IterateClose();
void Draw(ViewLayer *view, BRect frame, bool filled);
void Draw(View *view, BRect frame, bool filled);
private:
stack<uint32> fOpStack;
@ -109,7 +109,7 @@ ShapePainter::IterateClose(void)
}
void
ShapePainter::Draw(ViewLayer *view, BRect frame, bool filled)
ShapePainter::Draw(View *view, BRect frame, bool filled)
{
// We're going to draw the currently iterated shape.
int32 opCount, ptCount;
@ -177,14 +177,14 @@ nop()
static void
move_pen_by(ViewLayer *view, BPoint delta)
move_pen_by(View *view, BPoint delta)
{
view->CurrentState()->SetPenLocation(view->CurrentState()->PenLocation() + delta);
}
static void
stroke_line(ViewLayer *view, BPoint start, BPoint end)
stroke_line(View *view, BPoint start, BPoint end)
{
BPoint penPos = end;
@ -200,7 +200,7 @@ stroke_line(ViewLayer *view, BPoint start, BPoint end)
static void
stroke_rect(ViewLayer *view, BRect rect)
stroke_rect(View *view, BRect rect)
{
view->ConvertToScreenForDrawing(&rect);
view->Window()->GetDrawingEngine()->StrokeRect(rect);
@ -208,7 +208,7 @@ stroke_rect(ViewLayer *view, BRect rect)
static void
fill_rect(ViewLayer *view, BRect rect)
fill_rect(View *view, BRect rect)
{
view->ConvertToScreenForDrawing(&rect);
view->Window()->GetDrawingEngine()->FillRect(rect);
@ -216,7 +216,7 @@ fill_rect(ViewLayer *view, BRect rect)
static void
stroke_round_rect(ViewLayer *view, BRect rect, BPoint radii)
stroke_round_rect(View *view, BRect rect, BPoint radii)
{
view->ConvertToScreenForDrawing(&rect);
view->Window()->GetDrawingEngine()->DrawRoundRect(rect, radii.x, radii.y,
@ -225,7 +225,7 @@ stroke_round_rect(ViewLayer *view, BRect rect, BPoint radii)
static void
fill_round_rect(ViewLayer *view, BRect rect, BPoint radii)
fill_round_rect(View *view, BRect rect, BPoint radii)
{
view->ConvertToScreenForDrawing(&rect);
view->Window()->GetDrawingEngine()->DrawRoundRect(rect, radii.x, radii.y,
@ -234,7 +234,7 @@ fill_round_rect(ViewLayer *view, BRect rect, BPoint radii)
static void
stroke_bezier(ViewLayer *view, const BPoint *viewPoints)
stroke_bezier(View *view, const BPoint *viewPoints)
{
BPoint points[4];
view->ConvertToScreenForDrawing(points, viewPoints, 4);
@ -244,7 +244,7 @@ stroke_bezier(ViewLayer *view, const BPoint *viewPoints)
static void
fill_bezier(ViewLayer *view, const BPoint *viewPoints)
fill_bezier(View *view, const BPoint *viewPoints)
{
BPoint points[4];
view->ConvertToScreenForDrawing(points, viewPoints, 4);
@ -254,8 +254,8 @@ fill_bezier(ViewLayer *view, const BPoint *viewPoints)
static void
stroke_arc(ViewLayer *view, BPoint center, BPoint radii, float startTheta,
float arcTheta)
stroke_arc(View *view, BPoint center, BPoint radii, float startTheta,
float arcTheta)
{
BRect rect(center.x - radii.x, center.y - radii.y, center.x + radii.x - 1,
center.y + radii.y - 1);
@ -265,8 +265,8 @@ stroke_arc(ViewLayer *view, BPoint center, BPoint radii, float startTheta,
static void
fill_arc(ViewLayer *view, BPoint center, BPoint radii, float startTheta,
float arcTheta)
fill_arc(View *view, BPoint center, BPoint radii, float startTheta,
float arcTheta)
{
BRect rect(center.x - radii.x, center.y - radii.y, center.x + radii.x - 1,
center.y + radii.y - 1);
@ -276,7 +276,7 @@ fill_arc(ViewLayer *view, BPoint center, BPoint radii, float startTheta,
static void
stroke_ellipse(ViewLayer *view, BPoint center, BPoint radii)
stroke_ellipse(View *view, BPoint center, BPoint radii)
{
BRect rect(center.x - radii.x, center.y - radii.y, center.x + radii.x - 1,
center.y + radii.y - 1);
@ -286,7 +286,7 @@ stroke_ellipse(ViewLayer *view, BPoint center, BPoint radii)
static void
fill_ellipse(ViewLayer *view, BPoint center, BPoint radii)
fill_ellipse(View *view, BPoint center, BPoint radii)
{
BRect rect(center.x - radii.x, center.y - radii.y, center.x + radii.x - 1,
center.y + radii.y - 1);
@ -296,11 +296,13 @@ fill_ellipse(ViewLayer *view, BPoint center, BPoint radii)
static void
stroke_polygon(ViewLayer *view, int32 numPoints, const BPoint *viewPoints, bool isClosed)
stroke_polygon(View *view, int32 numPoints, const BPoint *viewPoints,
bool isClosed)
{
if (numPoints <= 0) {
if (numPoints <= 0)
return;
} else if (numPoints <= 200) {
if (numPoints <= 200) {
// fast path: no malloc/free, also avoid constructor/destructor calls
char data[200 * sizeof(BPoint)];
BPoint *points = (BPoint *)data;
@ -331,11 +333,12 @@ stroke_polygon(ViewLayer *view, int32 numPoints, const BPoint *viewPoints, bool
static void
fill_polygon(ViewLayer *view, int32 numPoints, const BPoint *viewPoints)
fill_polygon(View *view, int32 numPoints, const BPoint *viewPoints)
{
if (numPoints <= 0) {
if (numPoints <= 0)
return;
} else if (numPoints <= 200) {
if (numPoints <= 200) {
// fast path: no malloc/free, also avoid constructor/destructor calls
char data[200 * sizeof(BPoint)];
BPoint *points = (BPoint *)data;
@ -366,7 +369,7 @@ fill_polygon(ViewLayer *view, int32 numPoints, const BPoint *viewPoints)
static void
stroke_shape(ViewLayer *view, const BShape *shape)
stroke_shape(View *view, const BShape *shape)
{
ShapePainter drawShape;
@ -376,7 +379,7 @@ stroke_shape(ViewLayer *view, const BShape *shape)
static void
fill_shape(ViewLayer *view, const BShape *shape)
fill_shape(View *view, const BShape *shape)
{
ShapePainter drawShape;
@ -386,7 +389,7 @@ fill_shape(ViewLayer *view, const BShape *shape)
static void
draw_string(ViewLayer *view, const char *string, float deltaSpace,
draw_string(View *view, const char *string, float deltaSpace,
float deltaNonSpace)
{
// NOTE: the picture data was recorded with a "set pen location" command
@ -407,10 +410,11 @@ draw_string(ViewLayer *view, const char *string, float deltaSpace,
static void
draw_pixels(ViewLayer *view, BRect src, BRect dest, int32 width, int32 height,
int32 bytesPerRow, int32 pixelFormat, int32 flags, const void *data)
draw_pixels(View *view, BRect src, BRect dest, int32 width, int32 height,
int32 bytesPerRow, int32 pixelFormat, int32 flags, const void *data)
{
UtilityBitmap bitmap(BRect(0, 0, width - 1, height - 1), (color_space)pixelFormat, flags, bytesPerRow);
UtilityBitmap bitmap(BRect(0, 0, width - 1, height - 1),
(color_space)pixelFormat, flags, bytesPerRow);
if (!bitmap.IsValid())
return;
@ -424,7 +428,7 @@ draw_pixels(ViewLayer *view, BRect src, BRect dest, int32 width, int32 height,
static void
draw_picture(ViewLayer *view, BPoint where, int32 token)
draw_picture(View *view, BPoint where, int32 token)
{
ServerPicture *picture = view->Window()->ServerWindow()->App()->FindPicture(token);
if (picture != NULL) {
@ -435,7 +439,7 @@ draw_picture(ViewLayer *view, BPoint where, int32 token)
static void
set_clipping_rects(ViewLayer *view, const BRect *rects, uint32 numRects)
set_clipping_rects(View *view, const BRect *rects, uint32 numRects)
{
// TODO: This might be too slow, we should copy the rects
// directly to BRegion's internal data
@ -447,8 +451,8 @@ set_clipping_rects(ViewLayer *view, const BRect *rects, uint32 numRects)
static void
clip_to_picture(ViewLayer *view, BPicture *picture, BPoint pt,
bool clip_to_inverse_picture)
clip_to_picture(View *view, BPicture *picture, BPoint pt,
bool clip_to_inverse_picture)
{
printf("ClipToPicture(picture, BPoint(%.2f, %.2f), %s)\n", pt.x, pt.y,
clip_to_inverse_picture ? "inverse" : "");
@ -456,14 +460,14 @@ clip_to_picture(ViewLayer *view, BPicture *picture, BPoint pt,
static void
push_state(ViewLayer *view)
push_state(View *view)
{
view->PushState();
}
static void
pop_state(ViewLayer *view)
pop_state(View *view)
{
view->PopState();
@ -477,40 +481,40 @@ pop_state(ViewLayer *view)
// TODO: Be smart and actually take advantage of these methods:
// only apply state changes when they are called
static void
enter_state_change(ViewLayer *view)
enter_state_change(View *view)
{
}
static void
exit_state_change(ViewLayer *view)
exit_state_change(View *view)
{
view->Window()->ServerWindow()->ResyncDrawState();
}
static void
enter_font_state(ViewLayer *view)
enter_font_state(View *view)
{
}
static void
exit_font_state(ViewLayer *view)
exit_font_state(View *view)
{
view->Window()->GetDrawingEngine()->SetFont(view->CurrentState()->Font());
}
static void
set_origin(ViewLayer *view, BPoint pt)
set_origin(View *view, BPoint pt)
{
view->CurrentState()->SetOrigin(pt);
}
static void
set_pen_location(ViewLayer *view, BPoint pt)
set_pen_location(View *view, BPoint pt)
{
view->CurrentState()->SetPenLocation(pt);
// the DrawingEngine/Painter does not need to be updated, since this
@ -520,7 +524,7 @@ set_pen_location(ViewLayer *view, BPoint pt)
static void
set_drawing_mode(ViewLayer *view, drawing_mode mode)
set_drawing_mode(View *view, drawing_mode mode)
{
view->CurrentState()->SetDrawingMode(mode);
view->Window()->GetDrawingEngine()->SetDrawingMode(mode);
@ -528,7 +532,7 @@ set_drawing_mode(ViewLayer *view, drawing_mode mode)
static void
set_line_mode(ViewLayer *view, cap_mode capMode, join_mode joinMode, float miterLimit)
set_line_mode(View *view, cap_mode capMode, join_mode joinMode, float miterLimit)
{
DrawState *state = view->CurrentState();
state->SetLineCapMode(capMode);
@ -539,7 +543,7 @@ set_line_mode(ViewLayer *view, cap_mode capMode, join_mode joinMode, float miter
static void
set_pen_size(ViewLayer *view, float size)
set_pen_size(View *view, float size)
{
view->CurrentState()->SetPenSize(size);
view->Window()->GetDrawingEngine()->SetPenSize(view->CurrentState()->PenSize());
@ -549,7 +553,7 @@ set_pen_size(ViewLayer *view, float size)
static void
set_fore_color(ViewLayer *view, rgb_color color)
set_fore_color(View *view, rgb_color color)
{
view->CurrentState()->SetHighColor(color);
view->Window()->GetDrawingEngine()->SetHighColor(color);
@ -557,7 +561,7 @@ set_fore_color(ViewLayer *view, rgb_color color)
static void
set_back_color(ViewLayer *view, rgb_color color)
set_back_color(View *view, rgb_color color)
{
view->CurrentState()->SetLowColor(color);
view->Window()->GetDrawingEngine()->SetLowColor(color);
@ -565,7 +569,7 @@ set_back_color(ViewLayer *view, rgb_color color)
static void
set_stipple_pattern(ViewLayer *view, pattern p)
set_stipple_pattern(View *view, pattern p)
{
view->CurrentState()->SetPattern(Pattern(p));
view->Window()->GetDrawingEngine()->SetPattern(p);
@ -573,7 +577,7 @@ set_stipple_pattern(ViewLayer *view, pattern p)
static void
set_scale(ViewLayer *view, float scale)
set_scale(View *view, float scale)
{
view->CurrentState()->SetScale(scale);
view->Window()->ServerWindow()->ResyncDrawState();
@ -584,7 +588,7 @@ set_scale(ViewLayer *view, float scale)
static void
set_font_family(ViewLayer *view, const char *family)
set_font_family(View *view, const char *family)
{
// TODO: Implement
// Can we have a ServerFont::SetFamily() which accepts a string ?
@ -592,7 +596,7 @@ set_font_family(ViewLayer *view, const char *family)
static void
set_font_style(ViewLayer *view, const char *style)
set_font_style(View *view, const char *style)
{
// TODO: Implement
// Can we have a ServerFont::SetStyle() which accepts a string ?
@ -600,7 +604,7 @@ set_font_style(ViewLayer *view, const char *style)
static void
set_font_spacing(ViewLayer *view, int32 spacing)
set_font_spacing(View *view, int32 spacing)
{
ServerFont font;
font.SetSpacing(spacing);
@ -609,7 +613,7 @@ set_font_spacing(ViewLayer *view, int32 spacing)
static void
set_font_size(ViewLayer *view, float size)
set_font_size(View *view, float size)
{
ServerFont font;
font.SetSize(size);
@ -618,7 +622,7 @@ set_font_size(ViewLayer *view, float size)
static void
set_font_rotate(ViewLayer *view, float rotation)
set_font_rotate(View *view, float rotation)
{
ServerFont font;
font.SetRotation(rotation);
@ -627,7 +631,7 @@ set_font_rotate(ViewLayer *view, float rotation)
static void
set_font_encoding(ViewLayer *view, int32 encoding)
set_font_encoding(View *view, int32 encoding)
{
ServerFont font;
font.SetEncoding(encoding);
@ -636,7 +640,7 @@ set_font_encoding(ViewLayer *view, int32 encoding)
static void
set_font_flags(ViewLayer *view, int32 flags)
set_font_flags(View *view, int32 flags)
{
ServerFont font;
font.SetFlags(flags);
@ -645,7 +649,7 @@ set_font_flags(ViewLayer *view, int32 flags)
static void
set_font_shear(ViewLayer *view, float shear)
set_font_shear(View *view, float shear)
{
ServerFont font;
font.SetShear(shear);
@ -654,7 +658,7 @@ set_font_shear(ViewLayer *view, float shear)
static void
set_font_face(ViewLayer *view, int32 face)
set_font_face(View *view, int32 face)
{
ServerFont font;
font.SetFace(face);
@ -663,7 +667,7 @@ set_font_face(ViewLayer *view, int32 face)
static void
set_blending_mode(ViewLayer *view, int16 alphaSrcMode, int16 alphaFncMode)
set_blending_mode(View *view, int16 alphaSrcMode, int16 alphaFncMode)
{
view->CurrentState()->SetBlendingMode((source_alpha)alphaSrcMode, (alpha_function)alphaFncMode);
}
@ -813,7 +817,7 @@ ServerPicture::ExitStateChange()
void
ServerPicture::SyncState(ViewLayer *view)
ServerPicture::SyncState(View *view)
{
// TODO: Finish this
EnterStateChange();
@ -903,7 +907,7 @@ ServerPicture::SetFontFromLink(BPrivate::LinkReceiver& link)
void
ServerPicture::Play(ViewLayer *view)
ServerPicture::Play(View *view)
{
// TODO: for now: then change PicturePlayer to accept a BPositionIO object
BMallocIO *mallocIO = dynamic_cast<BMallocIO *>(fData);

View File

@ -1,18 +1,27 @@
#ifndef __SERVER_PICTURE_H
#define __SERVER_PICTURE_H
/*
* Copyright 2001-2008, Haiku.
* Distributed under the terms of the MIT License.
*
* Authors:
* DarkWyrm <bpmagic@columbus.rr.com>
* Stefano Ceccherini <stefano.ceccherini@gmail.com>
*/
#ifndef SERVER_PICTURE_H
#define SERVER_PICTURE_H
#include <DataIO.h>
#include <PictureDataWriter.h>
#include <PortLink.h>
// TODO: For some reason, the forward declaration "class BPrivate::PortLink" causes compiling errors
class ServerApp;
class ViewLayer;
class BPrivate::LinkReceiver;
class View;
namespace BPrivate {
class LinkReceiver;
class PortLink;
}
class BList;
class ServerPicture : public PictureDataWriter {
public:
int32 Token() { return fToken; }
@ -20,10 +29,10 @@ public:
void EnterStateChange();
void ExitStateChange();
void SyncState(ViewLayer *view);
void SyncState(View *view);
void SetFontFromLink(BPrivate::LinkReceiver& link);
void Play(ViewLayer *view);
void Play(View *view);
void Usurp(ServerPicture *newPicture);
ServerPicture* StepDown();
@ -50,4 +59,4 @@ friend class ServerApp;
ServerPicture *fUsurped;
};
#endif // __SERVER_PICTURE_H
#endif // SERVER_PICTURE_H

File diff suppressed because it is too large Load Diff

View File

@ -1,5 +1,5 @@
/*
* Copyright 2001-2006, Haiku.
* Copyright 2001-2008, Haiku.
* Distributed under the terms of the MIT License.
*
* Authors:
@ -36,9 +36,9 @@ class BMessage;
class Desktop;
class ServerApp;
class Decorator;
class WindowLayer;
class Window;
class Workspace;
class ViewLayer;
class View;
class ServerPicture;
struct direct_window_data;
struct window_info;
@ -70,20 +70,22 @@ public:
void NotifyZoom();
// util methods.
const BMessenger& FocusMessenger() const { return fFocusMessenger; }
const BMessenger& HandlerMessenger() const { return fHandlerMessenger; }
const BMessenger& FocusMessenger() const
{ return fFocusMessenger; }
const BMessenger& HandlerMessenger() const
{ return fHandlerMessenger; }
status_t SendMessageToClient(const BMessage* msg,
int32 target = B_NULL_TOKEN) const;
virtual WindowLayer* MakeWindowLayer(BRect frame, const char* name,
window_look look, window_feel feel, uint32 flags,
uint32 workspace);
virtual ::Window* MakeWindow(BRect frame, const char* name,
window_look look, window_feel feel,
uint32 flags, uint32 workspace);
// to who we belong. who do we own. our title.
inline ServerApp* App() const { return fServerApp; }
::Desktop* Desktop() const { return fDesktop; }
::WindowLayer* Window() const;
::Window* Window() const;
void SetTitle(const char* newTitle);
inline const char* Title() const { return fTitle; }
@ -104,8 +106,8 @@ public:
void ResyncDrawState();
private:
ViewLayer* _CreateLayerTree(BPrivate::LinkReceiver &link,
ViewLayer **_parent);
View* _CreateView(BPrivate::LinkReceiver &link,
View **_parent);
void _Show();
void _Hide();
@ -124,23 +126,22 @@ private:
status_t _EnableDirectWindowMode();
void _SetCurrentLayer(ViewLayer* view);
void _UpdateDrawState(ViewLayer* view);
void _SetCurrentView(View* view);
void _UpdateDrawState(View* view);
bool _MessageNeedsAllWindowsLocked(uint32 code) const;
// TODO: Move me elsewhere
status_t PictureToRegion(ServerPicture *picture,
BRegion &,
bool inverse,
BPoint where);
BRegion& region, bool inverse,
BPoint where);
private:
char* fTitle;
::Desktop* fDesktop;
ServerApp* fServerApp;
WindowLayer* fWindowLayer;
::Window* fWindow;
bool fWindowAddedToDesktop;
team_id fClientTeam;
@ -157,7 +158,7 @@ private:
int32 fServerToken;
int32 fClientToken;
ViewLayer* fCurrentLayer;
View* fCurrentView;
BRegion fCurrentDrawingRegion;
bool fCurrentDrawingRegionValid;

View File

@ -11,7 +11,7 @@
*/
#include "ViewLayer.h"
#include "View.h"
#include "BitmapManager.h"
#include "Desktop.h"
@ -22,7 +22,7 @@
#include "ServerCursor.h"
#include "ServerPicture.h"
#include "ServerWindow.h"
#include "WindowLayer.h"
#include "Window.h"
#include "drawing_support.h"
@ -71,7 +71,7 @@ resize_frame(IntRect& frame, uint32 resizingMode, int32 x, int32 y)
// #pragma mark -
ViewLayer::ViewLayer(IntRect frame, IntPoint scrollingOffset, const char* name,
View::View(IntRect frame, IntPoint scrollingOffset, const char* name,
int32 token, uint32 resizeMode, uint32 flags)
:
fName(name),
@ -116,7 +116,7 @@ ViewLayer::ViewLayer(IntRect frame, IntPoint scrollingOffset, const char* name,
}
ViewLayer::~ViewLayer()
View::~View()
{
if (fViewBitmap != NULL)
gBitmapManager->DeleteBitmap(fViewBitmap);
@ -130,9 +130,9 @@ ViewLayer::~ViewLayer()
fCursor->Release();
// iterate over children and delete each one
ViewLayer* layer = fFirstChild;
View* layer = fFirstChild;
while (layer) {
ViewLayer* toast = layer;
View* toast = layer;
layer = layer->fNextSibling;
delete toast;
}
@ -140,7 +140,7 @@ ViewLayer::~ViewLayer()
IntRect
ViewLayer::Bounds() const
View::Bounds() const
{
IntRect bounds(fScrollingOffset.x, fScrollingOffset.y,
fScrollingOffset.x + fFrame.Width(),
@ -150,7 +150,7 @@ ViewLayer::Bounds() const
void
ViewLayer::ConvertToVisibleInTopView(IntRect* bounds) const
View::ConvertToVisibleInTopView(IntRect* bounds) const
{
*bounds = *bounds & Bounds();
// NOTE: this step is necessary even if we don't have a parent!
@ -162,7 +162,7 @@ ViewLayer::ConvertToVisibleInTopView(IntRect* bounds) const
void
ViewLayer::AttachedToWindow(WindowLayer* window)
View::AttachedToWindow(::Window* window)
{
fWindow = window;
@ -177,13 +177,13 @@ ViewLayer::AttachedToWindow(WindowLayer* window)
}
// attach child views as well
for (ViewLayer* child = FirstChild(); child; child = child->NextSibling())
for (View* child = FirstChild(); child; child = child->NextSibling())
child->AttachedToWindow(window);
}
void
ViewLayer::DetachedFromWindow()
View::DetachedFromWindow()
{
// remove view from local token space
if (fWindow != NULL)
@ -191,7 +191,7 @@ ViewLayer::DetachedFromWindow()
fWindow = NULL;
// detach child views as well
for (ViewLayer* child = FirstChild(); child; child = child->NextSibling())
for (View* child = FirstChild(); child; child = child->NextSibling())
child->DetachedFromWindow();
}
@ -200,10 +200,10 @@ ViewLayer::DetachedFromWindow()
void
ViewLayer::AddChild(ViewLayer* layer)
View::AddChild(View* layer)
{
if (layer->fParent) {
printf("ViewLayer::AddChild() - ViewLayer already has a parent\n");
printf("View::AddChild() - View already has a parent\n");
return;
}
@ -243,10 +243,10 @@ ViewLayer::AddChild(ViewLayer* layer)
bool
ViewLayer::RemoveChild(ViewLayer* layer)
View::RemoveChild(View* layer)
{
if (layer->fParent != this) {
printf("ViewLayer::RemoveChild(%p - %s) - ViewLayer is not child of "
printf("View::RemoveChild(%p - %s) - View is not child of "
"this (%p) layer!\n", layer, layer ? layer->Name() : NULL, this);
return false;
}
@ -300,8 +300,8 @@ ViewLayer::RemoveChild(ViewLayer* layer)
}
ViewLayer*
ViewLayer::TopLayer()
View*
View::TopLayer()
{
// returns the top level view of the hirarchy,
// it doesn't have to be the top level of a window
@ -314,10 +314,10 @@ ViewLayer::TopLayer()
uint32
ViewLayer::CountChildren(bool deep) const
View::CountChildren(bool deep) const
{
uint32 count = 0;
for (ViewLayer* child = FirstChild(); child; child = child->NextSibling()) {
for (View* child = FirstChild(); child; child = child->NextSibling()) {
count++;
if (deep) {
count += child->CountChildren(deep);
@ -328,9 +328,9 @@ ViewLayer::CountChildren(bool deep) const
void
ViewLayer::CollectTokensForChildren(BList* tokenMap) const
View::CollectTokensForChildren(BList* tokenMap) const
{
for (ViewLayer* child = FirstChild(); child; child = child->NextSibling()) {
for (View* child = FirstChild(); child; child = child->NextSibling()) {
tokenMap->AddItem((void*)child);
child->CollectTokensForChildren(tokenMap);
}
@ -339,7 +339,7 @@ ViewLayer::CollectTokensForChildren(BList* tokenMap) const
#if 0
bool
ViewLayer::MarkAt(DrawingEngine* engine, const BPoint& where, int32 level)
View::MarkAt(DrawingEngine* engine, const BPoint& where, int32 level)
{
BRect rect(fFrame.left, fFrame.top, fFrame.right, fFrame.bottom);
@ -353,7 +353,7 @@ ViewLayer::MarkAt(DrawingEngine* engine, const BPoint& where, int32 level)
bool found = false;
for (ViewLayer* child = FirstChild(); child; child = child->NextSibling()) {
for (View* child = FirstChild(); child; child = child->NextSibling()) {
found |= child->MarkAt(engine, where, level + 1);
}
@ -377,7 +377,7 @@ ViewLayer::MarkAt(DrawingEngine* engine, const BPoint& where, int32 level)
void
ViewLayer::FindViews(uint32 flags, BObjectList<ViewLayer>& list, int32& left)
View::FindViews(uint32 flags, BObjectList<View>& list, int32& left)
{
if ((Flags() & flags) == flags) {
list.AddItem(this);
@ -385,7 +385,7 @@ ViewLayer::FindViews(uint32 flags, BObjectList<ViewLayer>& list, int32& left)
return;
}
for (ViewLayer* child = FirstChild(); child; child = child->NextSibling()) {
for (View* child = FirstChild(); child; child = child->NextSibling()) {
child->FindViews(flags, list, left);
if (left == 0)
break;
@ -393,8 +393,8 @@ ViewLayer::FindViews(uint32 flags, BObjectList<ViewLayer>& list, int32& left)
}
ViewLayer*
ViewLayer::ViewAt(const BPoint& where)
View*
View::ViewAt(const BPoint& where)
{
if (!fVisible)
return NULL;
@ -406,8 +406,8 @@ ViewLayer::ViewAt(const BPoint& where)
if (!frame.Contains(where))
return NULL;
for (ViewLayer* child = FirstChild(); child; child = child->NextSibling()) {
ViewLayer* layer = child->ViewAt(where);
for (View* child = FirstChild(); child; child = child->NextSibling()) {
View* layer = child->ViewAt(where);
if (layer != NULL)
return layer;
}
@ -420,14 +420,14 @@ ViewLayer::ViewAt(const BPoint& where)
void
ViewLayer::SetName(const char* string)
View::SetName(const char* string)
{
fName.SetTo(string);
}
void
ViewLayer::SetFlags(uint32 flags)
View::SetFlags(uint32 flags)
{
fFlags = flags;
fDrawState->SetSubPixelPrecise(fFlags & B_SUBPIXEL_PRECISE);
@ -435,7 +435,7 @@ ViewLayer::SetFlags(uint32 flags)
void
ViewLayer::SetDrawingOrigin(BPoint origin)
View::SetDrawingOrigin(BPoint origin)
{
fDrawState->SetOrigin(origin);
@ -446,7 +446,7 @@ ViewLayer::SetDrawingOrigin(BPoint origin)
BPoint
ViewLayer::DrawingOrigin() const
View::DrawingOrigin() const
{
BPoint origin(fDrawState->Origin());
float scale = Scale();
@ -459,7 +459,7 @@ ViewLayer::DrawingOrigin() const
void
ViewLayer::SetScale(float scale)
View::SetScale(float scale)
{
fDrawState->SetScale(scale);
@ -470,14 +470,14 @@ ViewLayer::SetScale(float scale)
float
ViewLayer::Scale() const
View::Scale() const
{
return CurrentState()->Scale();
}
void
ViewLayer::SetUserClipping(const BRegion* region)
View::SetUserClipping(const BRegion* region)
{
fDrawState->SetClippingRegion(region);
@ -487,7 +487,7 @@ ViewLayer::SetUserClipping(const BRegion* region)
void
ViewLayer::SetViewBitmap(ServerBitmap* bitmap, IntRect sourceRect,
View::SetViewBitmap(ServerBitmap* bitmap, IntRect sourceRect,
IntRect destRect, int32 resizingMode, int32 options)
{
if (fViewBitmap != NULL) {
@ -520,7 +520,7 @@ ViewLayer::SetViewBitmap(ServerBitmap* bitmap, IntRect sourceRect,
::Overlay*
ViewLayer::_Overlay() const
View::_Overlay() const
{
if (fViewBitmap == NULL)
return NULL;
@ -530,7 +530,7 @@ ViewLayer::_Overlay() const
void
ViewLayer::_UpdateOverlayView() const
View::_UpdateOverlayView() const
{
Overlay* overlay = _Overlay();
if (overlay == NULL)
@ -548,7 +548,7 @@ ViewLayer::_UpdateOverlayView() const
be nice to have a better solution for this, though.
*/
void
ViewLayer::UpdateOverlay()
View::UpdateOverlay()
{
if (!IsVisible())
return;
@ -558,7 +558,7 @@ ViewLayer::UpdateOverlay()
} else {
// recursively ask children of this view
for (ViewLayer* child = FirstChild(); child; child = child->NextSibling()) {
for (View* child = FirstChild(); child; child = child->NextSibling()) {
child->UpdateOverlay();
}
}
@ -569,7 +569,7 @@ ViewLayer::UpdateOverlay()
void
ViewLayer::ConvertToParent(BPoint* point) const
View::ConvertToParent(BPoint* point) const
{
// remove scrolling offset and convert to parent coordinate space
point->x += fFrame.left - fScrollingOffset.x;
@ -578,7 +578,7 @@ ViewLayer::ConvertToParent(BPoint* point) const
void
ViewLayer::ConvertToParent(IntPoint* point) const
View::ConvertToParent(IntPoint* point) const
{
// remove scrolling offset and convert to parent coordinate space
point->x += fFrame.left - fScrollingOffset.x;
@ -587,7 +587,7 @@ ViewLayer::ConvertToParent(IntPoint* point) const
void
ViewLayer::ConvertToParent(BRect* rect) const
View::ConvertToParent(BRect* rect) const
{
// remove scrolling offset and convert to parent coordinate space
rect->OffsetBy(fFrame.left - fScrollingOffset.x,
@ -596,7 +596,7 @@ ViewLayer::ConvertToParent(BRect* rect) const
void
ViewLayer::ConvertToParent(IntRect* rect) const
View::ConvertToParent(IntRect* rect) const
{
// remove scrolling offset and convert to parent coordinate space
rect->OffsetBy(fFrame.left - fScrollingOffset.x,
@ -605,7 +605,7 @@ ViewLayer::ConvertToParent(IntRect* rect) const
void
ViewLayer::ConvertToParent(BRegion* region) const
View::ConvertToParent(BRegion* region) const
{
// remove scrolling offset and convert to parent coordinate space
region->OffsetBy(fFrame.left - fScrollingOffset.x,
@ -614,7 +614,7 @@ ViewLayer::ConvertToParent(BRegion* region) const
void
ViewLayer::ConvertFromParent(BPoint* point) const
View::ConvertFromParent(BPoint* point) const
{
// convert from parent coordinate space amd add scrolling offset
point->x += fScrollingOffset.x - fFrame.left;
@ -623,7 +623,7 @@ ViewLayer::ConvertFromParent(BPoint* point) const
void
ViewLayer::ConvertFromParent(IntPoint* point) const
View::ConvertFromParent(IntPoint* point) const
{
// convert from parent coordinate space amd add scrolling offset
point->x += fScrollingOffset.x - fFrame.left;
@ -632,7 +632,7 @@ ViewLayer::ConvertFromParent(IntPoint* point) const
void
ViewLayer::ConvertFromParent(BRect* rect) const
View::ConvertFromParent(BRect* rect) const
{
// convert from parent coordinate space amd add scrolling offset
rect->OffsetBy(fScrollingOffset.x - fFrame.left,
@ -641,7 +641,7 @@ ViewLayer::ConvertFromParent(BRect* rect) const
void
ViewLayer::ConvertFromParent(IntRect* rect) const
View::ConvertFromParent(IntRect* rect) const
{
// convert from parent coordinate space amd add scrolling offset
rect->OffsetBy(fScrollingOffset.x - fFrame.left,
@ -650,7 +650,7 @@ ViewLayer::ConvertFromParent(IntRect* rect) const
void
ViewLayer::ConvertFromParent(BRegion* region) const
View::ConvertFromParent(BRegion* region) const
{
// convert from parent coordinate space amd add scrolling offset
region->OffsetBy(fScrollingOffset.x - fFrame.left,
@ -659,7 +659,7 @@ ViewLayer::ConvertFromParent(BRegion* region) const
//! converts a point from local to screen coordinate system
void
ViewLayer::ConvertToScreen(BPoint* pt) const
View::ConvertToScreen(BPoint* pt) const
{
ConvertToParent(pt);
@ -670,7 +670,7 @@ ViewLayer::ConvertToScreen(BPoint* pt) const
//! converts a point from local to screen coordinate system
void
ViewLayer::ConvertToScreen(IntPoint* pt) const
View::ConvertToScreen(IntPoint* pt) const
{
ConvertToParent(pt);
@ -681,7 +681,7 @@ ViewLayer::ConvertToScreen(IntPoint* pt) const
//! converts a rect from local to screen coordinate system
void
ViewLayer::ConvertToScreen(BRect* rect) const
View::ConvertToScreen(BRect* rect) const
{
BPoint offset(0.0, 0.0);
ConvertToScreen(&offset);
@ -692,7 +692,7 @@ ViewLayer::ConvertToScreen(BRect* rect) const
//! converts a rect from local to screen coordinate system
void
ViewLayer::ConvertToScreen(IntRect* rect) const
View::ConvertToScreen(IntRect* rect) const
{
BPoint offset(0.0, 0.0);
ConvertToScreen(&offset);
@ -703,7 +703,7 @@ ViewLayer::ConvertToScreen(IntRect* rect) const
//! converts a region from local to screen coordinate system
void
ViewLayer::ConvertToScreen(BRegion* region) const
View::ConvertToScreen(BRegion* region) const
{
BPoint offset(0.0, 0.0);
ConvertToScreen(&offset);
@ -714,7 +714,7 @@ ViewLayer::ConvertToScreen(BRegion* region) const
//! converts a point from screen to local coordinate system
void
ViewLayer::ConvertFromScreen(BPoint* pt) const
View::ConvertFromScreen(BPoint* pt) const
{
ConvertFromParent(pt);
@ -725,7 +725,7 @@ ViewLayer::ConvertFromScreen(BPoint* pt) const
//! converts a point from screen to local coordinate system
void
ViewLayer::ConvertFromScreen(IntPoint* pt) const
View::ConvertFromScreen(IntPoint* pt) const
{
ConvertFromParent(pt);
@ -736,7 +736,7 @@ ViewLayer::ConvertFromScreen(IntPoint* pt) const
//! converts a rect from screen to local coordinate system
void
ViewLayer::ConvertFromScreen(BRect* rect) const
View::ConvertFromScreen(BRect* rect) const
{
BPoint offset(0.0, 0.0);
ConvertFromScreen(&offset);
@ -747,7 +747,7 @@ ViewLayer::ConvertFromScreen(BRect* rect) const
//! converts a rect from screen to local coordinate system
void
ViewLayer::ConvertFromScreen(IntRect* rect) const
View::ConvertFromScreen(IntRect* rect) const
{
BPoint offset(0.0, 0.0);
ConvertFromScreen(&offset);
@ -758,7 +758,7 @@ ViewLayer::ConvertFromScreen(IntRect* rect) const
//! converts a region from screen to local coordinate system
void
ViewLayer::ConvertFromScreen(BRegion* region) const
View::ConvertFromScreen(BRegion* region) const
{
BPoint offset(0.0, 0.0);
ConvertFromScreen(&offset);
@ -769,7 +769,7 @@ ViewLayer::ConvertFromScreen(BRegion* region) const
//! converts a point from local *drawing* to screen coordinate system
void
ViewLayer::ConvertToScreenForDrawing(BPoint* point) const
View::ConvertToScreenForDrawing(BPoint* point) const
{
fDrawState->Transform(point);
// NOTE: from here on, don't use the
@ -780,7 +780,7 @@ ViewLayer::ConvertToScreenForDrawing(BPoint* point) const
//! converts a rect from local *drawing* to screen coordinate system
void
ViewLayer::ConvertToScreenForDrawing(BRect* rect) const
View::ConvertToScreenForDrawing(BRect* rect) const
{
fDrawState->Transform(rect);
// NOTE: from here on, don't use the
@ -791,7 +791,7 @@ ViewLayer::ConvertToScreenForDrawing(BRect* rect) const
//! converts a region from local *drawing* to screen coordinate system
void
ViewLayer::ConvertToScreenForDrawing(BRegion* region) const
View::ConvertToScreenForDrawing(BRegion* region) const
{
fDrawState->Transform(region);
// NOTE: from here on, don't use the
@ -802,7 +802,7 @@ ViewLayer::ConvertToScreenForDrawing(BRegion* region) const
//! converts points from local *drawing* to screen coordinate system
void
ViewLayer::ConvertToScreenForDrawing(BPoint* dst, const BPoint* src, int32 num) const
View::ConvertToScreenForDrawing(BPoint* dst, const BPoint* src, int32 num) const
{
// TODO: optimize this, it should be smarter
while (num--) {
@ -819,7 +819,7 @@ ViewLayer::ConvertToScreenForDrawing(BPoint* dst, const BPoint* src, int32 num)
//! converts rects from local *drawing* to screen coordinate system
void
ViewLayer::ConvertToScreenForDrawing(BRect* dst, const BRect* src, int32 num) const
View::ConvertToScreenForDrawing(BRect* dst, const BRect* src, int32 num) const
{
// TODO: optimize this, it should be smarter
while (num--) {
@ -836,7 +836,7 @@ ViewLayer::ConvertToScreenForDrawing(BRect* dst, const BRect* src, int32 num) co
//! converts regions from local *drawing* to screen coordinate system
void
ViewLayer::ConvertToScreenForDrawing(BRegion* dst, const BRegion* src, int32 num) const
View::ConvertToScreenForDrawing(BRegion* dst, const BRegion* src, int32 num) const
{
// TODO: optimize this, it should be smarter
while (num--) {
@ -853,7 +853,7 @@ ViewLayer::ConvertToScreenForDrawing(BRegion* dst, const BRegion* src, int32 num
//! converts a point from screen to local coordinate system
void
ViewLayer::ConvertFromScreenForDrawing(BPoint* point) const
View::ConvertFromScreenForDrawing(BPoint* point) const
{
ConvertFromScreen(point);
fDrawState->InverseTransform(point);
@ -864,7 +864,7 @@ ViewLayer::ConvertFromScreenForDrawing(BPoint* point) const
void
ViewLayer::MoveBy(int32 x, int32 y, BRegion* dirtyRegion)
View::MoveBy(int32 x, int32 y, BRegion* dirtyRegion)
{
if (x == 0 && y == 0)
return;
@ -937,7 +937,7 @@ ViewLayer::MoveBy(int32 x, int32 y, BRegion* dirtyRegion)
void
ViewLayer::ResizeBy(int32 x, int32 y, BRegion* dirtyRegion)
View::ResizeBy(int32 x, int32 y, BRegion* dirtyRegion)
{
if (x == 0 && y == 0)
return;
@ -969,7 +969,7 @@ ViewLayer::ResizeBy(int32 x, int32 y, BRegion* dirtyRegion)
if ((fFlags & B_DRAW_ON_CHILDREN) == 0) {
// exclude children, they are expected to
// include their own dirty regions in ParentResized()
for (ViewLayer* child = FirstChild(); child;
for (View* child = FirstChild(); child;
child = child->NextSibling()) {
if (!child->IsVisible())
continue;
@ -988,7 +988,7 @@ ViewLayer::ResizeBy(int32 x, int32 y, BRegion* dirtyRegion)
}
// layout the children
for (ViewLayer* child = FirstChild(); child; child = child->NextSibling())
for (View* child = FirstChild(); child; child = child->NextSibling())
child->ParentResized(x, y, dirtyRegion);
// view bitmap
@ -1004,7 +1004,7 @@ ViewLayer::ResizeBy(int32 x, int32 y, BRegion* dirtyRegion)
void
ViewLayer::ParentResized(int32 x, int32 y, BRegion* dirtyRegion)
View::ParentResized(int32 x, int32 y, BRegion* dirtyRegion)
{
IntRect newFrame = fFrame;
resize_frame(newFrame, fResizeMode & 0x0000ffff, x, y);
@ -1029,7 +1029,7 @@ ViewLayer::ParentResized(int32 x, int32 y, BRegion* dirtyRegion)
void
ViewLayer::ScrollBy(int32 x, int32 y, BRegion* dirtyRegion)
View::ScrollBy(int32 x, int32 y, BRegion* dirtyRegion)
{
if (!fVisible || !fWindow) {
fScrollingOffset.x += x;
@ -1087,7 +1087,7 @@ ViewLayer::ScrollBy(int32 x, int32 y, BRegion* dirtyRegion)
void
ViewLayer::CopyBits(IntRect src, IntRect dst, BRegion& windowContentClipping)
View::CopyBits(IntRect src, IntRect dst, BRegion& windowContentClipping)
{
if (!fVisible || !fWindow)
return;
@ -1167,7 +1167,7 @@ ViewLayer::CopyBits(IntRect src, IntRect dst, BRegion& windowContentClipping)
void
ViewLayer::PushState()
View::PushState()
{
fDrawState = fDrawState->PushState();
fDrawState->SetSubPixelPrecise(fFlags & B_SUBPIXEL_PRECISE);
@ -1175,7 +1175,7 @@ ViewLayer::PushState()
void
ViewLayer::PopState()
View::PopState()
{
if (fDrawState->PreviousState() == NULL) {
fprintf(stderr, "WARNING: User called BView(%s)::PopState(), "
@ -1196,7 +1196,7 @@ ViewLayer::PopState()
void
ViewLayer::SetEventMask(uint32 eventMask, uint32 options)
View::SetEventMask(uint32 eventMask, uint32 options)
{
fEventMask = eventMask;
fEventOptions = options;
@ -1204,7 +1204,7 @@ ViewLayer::SetEventMask(uint32 eventMask, uint32 options)
void
ViewLayer::SetCursor(ServerCursor *cursor)
View::SetCursor(ServerCursor *cursor)
{
if (cursor == fCursor)
return;
@ -1222,14 +1222,14 @@ ViewLayer::SetCursor(ServerCursor *cursor)
void
ViewLayer::SetPicture(ServerPicture *picture)
View::SetPicture(ServerPicture *picture)
{
fPicture = picture;
}
void
ViewLayer::Draw(DrawingEngine* drawingEngine, BRegion* effectiveClipping,
View::Draw(DrawingEngine* drawingEngine, BRegion* effectiveClipping,
BRegion* windowContentClipping, bool deep)
{
if (!fVisible) {
@ -1266,7 +1266,7 @@ ViewLayer::Draw(DrawingEngine* drawingEngine, BRegion* effectiveClipping,
rect.OffsetBy(-(rect.Width() + 1), 0.0);
}
// XXX: locking removed because the WindowLayer keeps the engine locked
// XXX: locking removed because the Window keeps the engine locked
// because it keeps track of syncing right now
// lock the drawing engine for as long as we need the clipping
@ -1357,7 +1357,7 @@ ViewLayer::Draw(DrawingEngine* drawingEngine, BRegion* effectiveClipping,
// let children draw
if (deep) {
for (ViewLayer* child = FirstChild(); child; child = child->NextSibling()) {
for (View* child = FirstChild(); child; child = child->NextSibling()) {
child->Draw(drawingEngine, effectiveClipping,
windowContentClipping, deep);
}
@ -1369,21 +1369,21 @@ ViewLayer::Draw(DrawingEngine* drawingEngine, BRegion* effectiveClipping,
void
ViewLayer::MouseDown(BMessage* message, BPoint where)
View::MouseDown(BMessage* message, BPoint where)
{
// empty hook method
}
void
ViewLayer::MouseUp(BMessage* message, BPoint where)
View::MouseUp(BMessage* message, BPoint where)
{
// empty hook method
}
void
ViewLayer::MouseMoved(BMessage* message, BPoint where)
View::MouseMoved(BMessage* message, BPoint where)
{
// empty hook method
}
@ -1393,7 +1393,7 @@ ViewLayer::MouseMoved(BMessage* message, BPoint where)
void
ViewLayer::SetHidden(bool hidden)
View::SetHidden(bool hidden)
{
if (fHidden != hidden) {
fHidden = hidden;
@ -1426,19 +1426,19 @@ ViewLayer::SetHidden(bool hidden)
bool
ViewLayer::IsHidden() const
View::IsHidden() const
{
return fHidden;
}
void
ViewLayer::UpdateVisibleDeep(bool parentVisible)
View::UpdateVisibleDeep(bool parentVisible)
{
bool wasVisible = fVisible;
fVisible = parentVisible && !fHidden;
for (ViewLayer* child = FirstChild(); child; child = child->NextSibling())
for (View* child = FirstChild(); child; child = child->NextSibling())
child->UpdateVisibleDeep(fVisible);
// overlay handling
@ -1458,18 +1458,18 @@ ViewLayer::UpdateVisibleDeep(bool parentVisible)
void
ViewLayer::MarkBackgroundDirty()
View::MarkBackgroundDirty()
{
if (fBackgroundDirty)
return;
fBackgroundDirty = true;
for (ViewLayer* child = FirstChild(); child; child = child->NextSibling())
for (View* child = FirstChild(); child; child = child->NextSibling())
child->MarkBackgroundDirty();
}
void
ViewLayer::AddTokensForLayersInRegion(BMessage* message, BRegion& region,
View::AddTokensForLayersInRegion(BMessage* message, BRegion& region,
BRegion* windowContentClipping)
{
if (!fVisible)
@ -1478,7 +1478,7 @@ ViewLayer::AddTokensForLayersInRegion(BMessage* message, BRegion& region,
if (region.Intersects(ScreenClipping(windowContentClipping).Frame()))
message->AddInt32("_token", fToken);
for (ViewLayer* child = FirstChild(); child; child = child->NextSibling()) {
for (View* child = FirstChild(); child; child = child->NextSibling()) {
child->AddTokensForLayersInRegion(message, region,
windowContentClipping);
}
@ -1486,7 +1486,7 @@ ViewLayer::AddTokensForLayersInRegion(BMessage* message, BRegion& region,
void
ViewLayer::AddTokensForLayersInRegion(BPrivate::PortLink& link, BRegion& region,
View::AddTokensForLayersInRegion(BPrivate::PortLink& link, BRegion& region,
BRegion* windowContentClipping)
{
if (!fVisible)
@ -1500,16 +1500,16 @@ ViewLayer::AddTokensForLayersInRegion(BPrivate::PortLink& link, BRegion& region,
if (region.Intersects(ScreenClipping(windowContentClipping).Frame()))
link.Attach<int32>(fToken);
for (ViewLayer* child = FirstChild(); child; child = child->NextSibling()) {
for (View* child = FirstChild(); child; child = child->NextSibling()) {
child->AddTokensForLayersInRegion(link, region, windowContentClipping);
}
}
void
ViewLayer::PrintToStream() const
View::PrintToStream() const
{
printf("ViewLayer: %s\n", Name());
printf("View: %s\n", Name());
printf(" fToken: %ld\n", fToken);
printf(" fFrame: IntRect(%ld, %ld, %ld, %ld)\n", fFrame.left, fFrame.top, fFrame.right, fFrame.bottom);
printf(" fScrollingOffset: IntPoint(%ld, %ld)\n", fScrollingOffset.x, fScrollingOffset.y);
@ -1531,12 +1531,12 @@ ViewLayer::PrintToStream() const
void
ViewLayer::RebuildClipping(bool deep)
View::RebuildClipping(bool deep)
{
// the clipping spans over the bounds area
fLocalClipping.Set((clipping_rect)Bounds());
if (ViewLayer* child = FirstChild()) {
if (View* child = FirstChild()) {
// if this view does not draw over children,
// exclude all children from the clipping
if ((fFlags & B_DRAW_ON_CHILDREN) == 0) {
@ -1581,7 +1581,7 @@ ViewLayer::RebuildClipping(bool deep)
BRegion&
ViewLayer::ScreenClipping(BRegion* windowContentClipping, bool force) const
View::ScreenClipping(BRegion* windowContentClipping, bool force) const
{
if (!fScreenClippingValid || force) {
fScreenClipping = fLocalClipping;
@ -1604,14 +1604,14 @@ ViewLayer::ScreenClipping(BRegion* windowContentClipping, bool force) const
fScreenClipping.IntersectWith(windowContentClipping);
fScreenClippingValid = true;
}
//printf("###ViewLayer(%s)::ScreenClipping():\n", Name());
//printf("###View(%s)::ScreenClipping():\n", Name());
//fScreenClipping.PrintToStream();
return fScreenClipping;
}
void
ViewLayer::InvalidateScreenClipping()
View::InvalidateScreenClipping()
{
// TODO: appearantly, we are calling ScreenClipping() on
// views who's parents don't have a valid screen clipping yet,
@ -1631,21 +1631,21 @@ ViewLayer::InvalidateScreenClipping()
fScreenClippingValid = false;
// invalidate the childrens screen clipping as well
for (ViewLayer* child = FirstChild(); child; child = child->NextSibling()) {
for (View* child = FirstChild(); child; child = child->NextSibling()) {
child->InvalidateScreenClipping();
}
}
void
ViewLayer::_MoveScreenClipping(int32 x, int32 y, bool deep)
View::_MoveScreenClipping(int32 x, int32 y, bool deep)
{
if (fScreenClippingValid)
fScreenClipping.OffsetBy(x, y);
if (deep) {
// move the childrens screen clipping as well
for (ViewLayer* child = FirstChild(); child; child = child->NextSibling()) {
for (View* child = FirstChild(); child; child = child->NextSibling()) {
child->_MoveScreenClipping(x, y, deep);
}
}

View File

@ -9,8 +9,8 @@
* Stephan Aßmus <superstippi@gmx.de>
* Marcus Overhagen <marcus@overhagen.de>
*/
#ifndef VIEW_LAYER_H
#define VIEW_LAYER_H
#ifndef VIEW_H
#define VIEW_H
#include "IntRect.h"
@ -30,18 +30,17 @@ namespace BPrivate {
class DrawState;
class DrawingEngine;
class Overlay;
class WindowLayer;
class Window;
class ServerBitmap;
class ServerCursor;
class ServerPicture;
class ViewLayer {
class View {
public:
ViewLayer(IntRect frame, IntPoint scrollingOffset,
View(IntRect frame, IntPoint scrollingOffset,
const char* name, int32 token,
uint32 resizeMode, uint32 flags);
virtual ~ViewLayer();
virtual ~View();
int32 Token() const
{ return fToken; }
@ -77,34 +76,34 @@ class ViewLayer {
// clips to each views bounds
void ConvertToVisibleInTopView(IntRect* bounds) const;
virtual void AttachedToWindow(WindowLayer* window);
virtual void AttachedToWindow(::Window* window);
virtual void DetachedFromWindow();
WindowLayer* Window() const { return fWindow; }
::Window* Window() const { return fWindow; }
// tree stuff
void AddChild(ViewLayer* layer);
bool RemoveChild(ViewLayer* layer);
void AddChild(View* layer);
bool RemoveChild(View* layer);
inline ViewLayer* Parent() const
inline View* Parent() const
{ return fParent; }
inline ViewLayer* FirstChild() const
inline View* FirstChild() const
{ return fFirstChild; }
inline ViewLayer* LastChild() const
inline View* LastChild() const
{ return fLastChild; }
inline ViewLayer* PreviousSibling() const
inline View* PreviousSibling() const
{ return fPreviousSibling; }
inline ViewLayer* NextSibling() const
inline View* NextSibling() const
{ return fNextSibling; }
ViewLayer* TopLayer();
View* TopLayer();
uint32 CountChildren(bool deep = false) const;
void CollectTokensForChildren(BList* tokenMap) const;
void FindViews(uint32 flags,
BObjectList<ViewLayer>& list, int32& left);
void FindViews(uint32 flags, BObjectList<View>& list,
int32& left);
ViewLayer* ViewAt(const BPoint& where);
View* ViewAt(const BPoint& where);
// coordinate conversion
void ConvertToParent(BPoint* point) const;
@ -155,7 +154,7 @@ class ViewLayer {
BRegion* dirtyRegion);
void CopyBits(IntRect src, IntRect dst,
BRegion& windowContentClipping);
BRegion& windowContentClipping);
const BRegion& LocalClipping() const { return fLocalClipping; }
@ -270,13 +269,13 @@ class ViewLayer {
uint32 fEventMask;
uint32 fEventOptions;
WindowLayer* fWindow;
ViewLayer* fParent;
::Window* fWindow;
View* fParent;
ViewLayer* fFirstChild;
ViewLayer* fPreviousSibling;
ViewLayer* fNextSibling;
ViewLayer* fLastChild;
View* fFirstChild;
View* fPreviousSibling;
View* fNextSibling;
View* fLastChild;
ServerCursor* fCursor;
ServerPicture* fPicture;
@ -286,8 +285,6 @@ class ViewLayer {
mutable BRegion fScreenClipping;
mutable bool fScreenClippingValid;
};
#endif // LAYER_H
#endif // VIEW_H

View File

@ -10,7 +10,7 @@
*/
#include "WindowLayer.h"
#include "Window.h"
#include "DebugInfoManager.h"
#include "Decorator.h"
@ -23,7 +23,7 @@
#include "ServerApp.h"
#include "ServerWindow.h"
#include "Workspace.h"
#include "WorkspacesLayer.h"
#include "WorkspacesView.h"
#include <ViewPrivate.h>
#include <WindowPrivate.h>
@ -68,7 +68,7 @@ using std::nothrow;
// the update session, which tells us the cause of the update
WindowLayer::WindowLayer(const BRect& frame, const char *name,
Window::Window(const BRect& frame, const char *name,
window_look look, window_feel feel, uint32 flags, uint32 workspaces,
::ServerWindow* window, DrawingEngine* drawingEngine)
:
@ -167,14 +167,14 @@ WindowLayer::WindowLayer(const BRect& frame, const char *name,
}
}
STRACE(("WindowLayer %p, %s:\n", this, Name()));
STRACE(("Window %p, %s:\n", this, Name()));
STRACE(("\tFrame: (%.1f, %.1f, %.1f, %.1f)\n", fFrame.left, fFrame.top,
fFrame.right, fFrame.bottom));
STRACE(("\tWindow %s\n", window ? window->Title() : "NULL"));
}
WindowLayer::~WindowLayer()
Window::~Window()
{
if (fTopLayer)
fTopLayer->DetachedFromWindow();
@ -185,7 +185,7 @@ WindowLayer::~WindowLayer()
void
WindowLayer::SetClipping(BRegion* stillAvailableOnScreen)
Window::SetClipping(BRegion* stillAvailableOnScreen)
{
// this function is only called from the Desktop thread
@ -203,7 +203,7 @@ WindowLayer::SetClipping(BRegion* stillAvailableOnScreen)
void
WindowLayer::GetFullRegion(BRegion* region)
Window::GetFullRegion(BRegion* region)
{
// TODO: if someone needs to call this from
// the outside, the clipping needs to be readlocked!
@ -215,7 +215,7 @@ WindowLayer::GetFullRegion(BRegion* region)
// GetBorderRegion
void
WindowLayer::GetBorderRegion(BRegion* region)
Window::GetBorderRegion(BRegion* region)
{
// TODO: if someone needs to call this from
// the outside, the clipping needs to be readlocked!
@ -234,7 +234,7 @@ WindowLayer::GetBorderRegion(BRegion* region)
void
WindowLayer::GetContentRegion(BRegion* region)
Window::GetContentRegion(BRegion* region)
{
// TODO: if someone needs to call this from
// the outside, the clipping needs to be readlocked!
@ -248,7 +248,7 @@ WindowLayer::GetContentRegion(BRegion* region)
BRegion&
WindowLayer::VisibleContentRegion()
Window::VisibleContentRegion()
{
// TODO: if someone needs to call this from
// the outside, the clipping needs to be readlocked!
@ -266,7 +266,7 @@ WindowLayer::VisibleContentRegion()
void
WindowLayer::_PropagatePosition()
Window::_PropagatePosition()
{
if ((fFlags & B_SAME_POSITION_IN_ALL_WORKSPACES) == 0)
return;
@ -278,7 +278,7 @@ WindowLayer::_PropagatePosition()
void
WindowLayer::MoveBy(int32 x, int32 y)
Window::MoveBy(int32 x, int32 y)
{
// this function is only called from the desktop thread
@ -323,7 +323,7 @@ WindowLayer::MoveBy(int32 x, int32 y)
void
WindowLayer::ResizeBy(int32 x, int32 y, BRegion* dirtyRegion)
Window::ResizeBy(int32 x, int32 y, BRegion* dirtyRegion)
{
// this function is only called from the desktop thread
@ -385,7 +385,7 @@ WindowLayer::ResizeBy(int32 x, int32 y, BRegion* dirtyRegion)
void
WindowLayer::ScrollViewBy(ViewLayer* view, int32 dx, int32 dy)
Window::ScrollViewBy(View* view, int32 dx, int32 dy)
{
// this is executed in ServerWindow with the Readlock
// held
@ -413,7 +413,7 @@ WindowLayer::ScrollViewBy(ViewLayer* view, int32 dx, int32 dy)
//! Takes care of invalidating parts that could not be copied
void
WindowLayer::CopyContents(BRegion* region, int32 xOffset, int32 yOffset)
Window::CopyContents(BRegion* region, int32 xOffset, int32 yOffset)
{
// executed in ServerWindow thread with the read lock held
if (!IsVisible())
@ -485,7 +485,7 @@ WindowLayer::CopyContents(BRegion* region, int32 xOffset, int32 yOffset)
void
WindowLayer::SetTopLayer(ViewLayer* topLayer)
Window::SetTopLayer(View* topLayer)
{
fTopLayer = topLayer;
@ -509,29 +509,29 @@ WindowLayer::SetTopLayer(ViewLayer* topLayer)
}
ViewLayer*
WindowLayer::ViewAt(const BPoint& where)
View*
Window::ViewAt(const BPoint& where)
{
return fTopLayer->ViewAt(where);
}
window_anchor&
WindowLayer::Anchor(int32 index)
Window::Anchor(int32 index)
{
return fAnchor[index];
}
WindowLayer*
WindowLayer::NextWindow(int32 index) const
Window*
Window::NextWindow(int32 index) const
{
return fAnchor[index].next;
}
WindowLayer*
WindowLayer::PreviousWindow(int32 index) const
Window*
Window::PreviousWindow(int32 index) const
{
return fAnchor[index].previous;
}
@ -541,7 +541,7 @@ WindowLayer::PreviousWindow(int32 index) const
void
WindowLayer::GetEffectiveDrawingRegion(ViewLayer* layer, BRegion& region)
Window::GetEffectiveDrawingRegion(View* layer, BRegion& region)
{
if (!fEffectiveDrawingRegionValid) {
fEffectiveDrawingRegion = VisibleContentRegion();
@ -554,7 +554,7 @@ WindowLayer::GetEffectiveDrawingRegion(ViewLayer* layer, BRegion& region)
fEffectiveDrawingRegion.IntersectWith(&fCurrentUpdateSession->DirtyRegion());
} else {
// not in update, the view can draw everywhere
//printf("WindowLayer(%s)::GetEffectiveDrawingRegion(for %s) - outside update\n", Title(), layer->Name());
//printf("Window(%s)::GetEffectiveDrawingRegion(for %s) - outside update\n", Title(), layer->Name());
}
fEffectiveDrawingRegionValid = true;
@ -574,14 +574,14 @@ WindowLayer::GetEffectiveDrawingRegion(ViewLayer* layer, BRegion& region)
bool
WindowLayer::DrawingRegionChanged(ViewLayer* layer) const
Window::DrawingRegionChanged(View* layer) const
{
return !fEffectiveDrawingRegionValid || !layer->IsScreenClippingValid();
}
void
WindowLayer::ProcessDirtyRegion(BRegion& region)
Window::ProcessDirtyRegion(BRegion& region)
{
// if this is exectuted in the desktop thread,
// it means that the window thread currently
@ -610,7 +610,7 @@ WindowLayer::ProcessDirtyRegion(BRegion& region)
void
WindowLayer::RedrawDirtyRegion()
Window::RedrawDirtyRegion()
{
// executed from ServerWindow with the read lock held
@ -639,7 +639,7 @@ WindowLayer::RedrawDirtyRegion()
void
WindowLayer::MarkDirty(BRegion& regionOnScreen)
Window::MarkDirty(BRegion& regionOnScreen)
{
// for marking any part of the desktop dirty
// this will get write access to the global
@ -651,7 +651,7 @@ WindowLayer::MarkDirty(BRegion& regionOnScreen)
void
WindowLayer::MarkContentDirty(BRegion& regionOnScreen)
Window::MarkContentDirty(BRegion& regionOnScreen)
{
// for triggering AS_REDRAW
// since this won't affect other windows, read locking
@ -667,7 +667,7 @@ WindowLayer::MarkContentDirty(BRegion& regionOnScreen)
void
WindowLayer::MarkContentDirtyAsync(BRegion& regionOnScreen)
Window::MarkContentDirtyAsync(BRegion& regionOnScreen)
{
// NOTE: see comments in ProcessDirtyRegion()
if (fHidden)
@ -685,7 +685,7 @@ WindowLayer::MarkContentDirtyAsync(BRegion& regionOnScreen)
void
WindowLayer::InvalidateView(ViewLayer* layer, BRegion& layerRegion)
Window::InvalidateView(View* layer, BRegion& layerRegion)
{
if (layer && IsVisible() && layer->IsVisible()) {
@ -707,7 +707,7 @@ WindowLayer::InvalidateView(ViewLayer* layer, BRegion& layerRegion)
// DisableUpdateRequests
void
WindowLayer::DisableUpdateRequests()
Window::DisableUpdateRequests()
{
fUpdatesEnabled = false;
}
@ -715,7 +715,7 @@ WindowLayer::DisableUpdateRequests()
// EnableUpdateRequests
void
WindowLayer::EnableUpdateRequests()
Window::EnableUpdateRequests()
{
fUpdatesEnabled = true;
if (!fUpdateRequested && fPendingUpdateSession->IsUsed())
@ -726,15 +726,15 @@ WindowLayer::EnableUpdateRequests()
void
WindowLayer::MouseDown(BMessage* message, BPoint where, int32* _viewToken)
Window::MouseDown(BMessage* message, BPoint where, int32* _viewToken)
{
// TODO: move into Decorator
if (!fBorderRegionValid)
GetBorderRegion(&fBorderRegion);
// default action is to drag the WindowLayer
// default action is to drag the Window
if (fBorderRegion.Contains(where)) {
// clicking WindowLayer visible area
// clicking Window visible area
click_type action = DEC_DRAG;
@ -830,11 +830,11 @@ WindowLayer::MouseDown(BMessage* message, BPoint where, int32* _viewToken)
}
} else {
// click was inside the window contents
if (ViewLayer* view = ViewAt(where)) {
if (View* view = ViewAt(where)) {
if (HasModal())
return;
// clicking a simple ViewLayer
// clicking a simple View
if (!IsFocus()) {
DesktopSettings desktopSettings(fDesktop);
@ -864,7 +864,7 @@ WindowLayer::MouseDown(BMessage* message, BPoint where, int32* _viewToken)
void
WindowLayer::MouseUp(BMessage* message, BPoint where, int32* _viewToken)
Window::MouseUp(BMessage* message, BPoint where, int32* _viewToken)
{
bool invalidate = false;
if (fDecorator) {
@ -924,7 +924,7 @@ WindowLayer::MouseUp(BMessage* message, BPoint where, int32* _viewToken)
fIsResizing = false;
fIsSlidingTab = false;
if (ViewLayer* view = ViewAt(where)) {
if (View* view = ViewAt(where)) {
if (HasModal())
return;
@ -935,7 +935,7 @@ WindowLayer::MouseUp(BMessage* message, BPoint where, int32* _viewToken)
void
WindowLayer::MouseMoved(BMessage *message, BPoint where, int32* _viewToken,
Window::MouseMoved(BMessage *message, BPoint where, int32* _viewToken,
bool isLatestMouseMoved)
{
#if 0
@ -949,7 +949,7 @@ WindowLayer::MouseMoved(BMessage *message, BPoint where, int32* _viewToken,
}
#endif
ViewLayer* view = ViewAt(where);
View* view = ViewAt(where);
if (view != NULL)
*_viewToken = view->Token();
@ -1070,7 +1070,7 @@ WindowLayer::MouseMoved(BMessage *message, BPoint where, int32* _viewToken,
void
WindowLayer::WorkspaceActivated(int32 index, bool active)
Window::WorkspaceActivated(int32 index, bool active)
{
if (!active)
fWindow->HandleDirectConnection(B_DIRECT_STOP);
@ -1088,7 +1088,7 @@ WindowLayer::WorkspaceActivated(int32 index, bool active)
void
WindowLayer::WorkspacesChanged(uint32 oldWorkspaces, uint32 newWorkspaces)
Window::WorkspacesChanged(uint32 oldWorkspaces, uint32 newWorkspaces)
{
fWorkspaces = newWorkspaces;
@ -1102,7 +1102,7 @@ WindowLayer::WorkspacesChanged(uint32 oldWorkspaces, uint32 newWorkspaces)
void
WindowLayer::Activated(bool active)
Window::Activated(bool active)
{
BMessage msg(B_WINDOW_ACTIVATED);
msg.AddBool("active", active);
@ -1114,7 +1114,7 @@ WindowLayer::Activated(bool active)
void
WindowLayer::SetTitle(const char* name, BRegion& dirty)
Window::SetTitle(const char* name, BRegion& dirty)
{
// rebuild the clipping for the title area
// and redraw it.
@ -1131,7 +1131,7 @@ WindowLayer::SetTitle(const char* name, BRegion& dirty)
void
WindowLayer::SetFocus(bool focus)
Window::SetFocus(bool focus)
{
// executed from Desktop thread
// it holds the clipping write lock,
@ -1154,7 +1154,7 @@ WindowLayer::SetFocus(bool focus)
void
WindowLayer::SetHidden(bool hidden)
Window::SetHidden(bool hidden)
{
// the desktop takes care of dirty regions
if (fHidden != hidden) {
@ -1168,7 +1168,7 @@ WindowLayer::SetHidden(bool hidden)
void
WindowLayer::SetMinimized(bool minimized)
Window::SetMinimized(bool minimized)
{
if (minimized == fMinimized)
return;
@ -1178,7 +1178,7 @@ WindowLayer::SetMinimized(bool minimized)
bool
WindowLayer::IsVisible() const
Window::IsVisible() const
{
if (IsOffscreenWindow())
return true;
@ -1195,7 +1195,7 @@ WindowLayer::IsVisible() const
void
WindowLayer::SetSizeLimits(int32 minWidth, int32 maxWidth,
Window::SetSizeLimits(int32 minWidth, int32 maxWidth,
int32 minHeight, int32 maxHeight)
{
if (minWidth < 0)
@ -1220,7 +1220,7 @@ WindowLayer::SetSizeLimits(int32 minWidth, int32 maxWidth,
void
WindowLayer::GetSizeLimits(int32* minWidth, int32* maxWidth,
Window::GetSizeLimits(int32* minWidth, int32* maxWidth,
int32* minHeight, int32* maxHeight) const
{
*minWidth = fMinWidth;
@ -1231,7 +1231,7 @@ WindowLayer::GetSizeLimits(int32* minWidth, int32* maxWidth,
bool
WindowLayer::SetTabLocation(float location, BRegion& dirty)
Window::SetTabLocation(float location, BRegion& dirty)
{
bool ret = false;
if (fDecorator) {
@ -1244,7 +1244,7 @@ WindowLayer::SetTabLocation(float location, BRegion& dirty)
float
WindowLayer::TabLocation() const
Window::TabLocation() const
{
if (fDecorator)
return fDecorator->TabLocation();
@ -1253,7 +1253,7 @@ WindowLayer::TabLocation() const
bool
WindowLayer::SetDecoratorSettings(const BMessage& settings, BRegion& dirty)
Window::SetDecoratorSettings(const BMessage& settings, BRegion& dirty)
{
bool ret = false;
if (fDecorator) {
@ -1266,7 +1266,7 @@ WindowLayer::SetDecoratorSettings(const BMessage& settings, BRegion& dirty)
bool
WindowLayer::GetDecoratorSettings(BMessage* settings)
Window::GetDecoratorSettings(BMessage* settings)
{
if (fDecorator)
return fDecorator->GetSettings(settings);
@ -1276,7 +1276,7 @@ WindowLayer::GetDecoratorSettings(BMessage* settings)
void
WindowLayer::SetLook(window_look look, BRegion* updateRegion)
Window::SetLook(window_look look, BRegion* updateRegion)
{
if (fDecorator == NULL && look != B_NO_BORDER_WINDOW_LOOK) {
// we need a new decorator
@ -1314,7 +1314,7 @@ WindowLayer::SetLook(window_look look, BRegion* updateRegion)
void
WindowLayer::SetFeel(window_feel feel)
Window::SetFeel(window_feel feel)
{
// if the subset list is no longer needed, clear it
if ((fFeel == B_MODAL_SUBSET_WINDOW_FEEL || fFeel == B_FLOATING_SUBSET_WINDOW_FEEL)
@ -1336,7 +1336,7 @@ WindowLayer::SetFeel(window_feel feel)
void
WindowLayer::SetFlags(uint32 flags, BRegion* updateRegion)
Window::SetFlags(uint32 flags, BRegion* updateRegion)
{
fOriginalFlags = flags;
fFlags = flags & ValidWindowFlags(fFeel);
@ -1366,14 +1366,14 @@ WindowLayer::SetFlags(uint32 flags, BRegion* updateRegion)
specified \a index.
*/
bool
WindowLayer::InWorkspace(int32 index) const
Window::InWorkspace(int32 index) const
{
return (fWorkspaces & (1UL << index)) != 0;
}
bool
WindowLayer::SupportsFront()
Window::SupportsFront()
{
if (fFeel == kDesktopWindowFeel
|| fFeel == kMenuWindowFeel
@ -1385,30 +1385,30 @@ WindowLayer::SupportsFront()
bool
WindowLayer::IsModal() const
Window::IsModal() const
{
return IsModalFeel(fFeel);
}
bool
WindowLayer::IsFloating() const
Window::IsFloating() const
{
return IsFloatingFeel(fFeel);
}
bool
WindowLayer::IsNormal() const
Window::IsNormal() const
{
return !IsFloatingFeel(fFeel) && !IsModalFeel(fFeel);
}
bool
WindowLayer::HasModal() const
Window::HasModal() const
{
for (WindowLayer* window = NextWindow(fCurrentWorkspace); window != NULL;
for (Window* window = NextWindow(fCurrentWorkspace); window != NULL;
window = window->NextWindow(fCurrentWorkspace)) {
if (window->IsHidden() || !window->IsModal())
continue;
@ -1425,8 +1425,8 @@ WindowLayer::HasModal() const
this window can get.
Returns NULL is this window can be the backmost window.
*/
WindowLayer*
WindowLayer::Backmost(WindowLayer* window, int32 workspace)
Window*
Window::Backmost(Window* window, int32 workspace)
{
if (workspace == -1)
workspace = fCurrentWorkspace;
@ -1454,8 +1454,8 @@ WindowLayer::Backmost(WindowLayer* window, int32 workspace)
this window can get.
Returns NULL if this window can be the frontmost window.
*/
WindowLayer*
WindowLayer::Frontmost(WindowLayer* first, int32 workspace)
Window*
Window::Frontmost(Window* first, int32 workspace)
{
if (workspace == -1)
workspace = fCurrentWorkspace;
@ -1466,7 +1466,7 @@ WindowLayer::Frontmost(WindowLayer* first, int32 workspace)
if (first == NULL)
first = NextWindow(workspace);
for (WindowLayer* window = first; window != NULL;
for (Window* window = first; window != NULL;
window = window->NextWindow(workspace)) {
if (window->IsHidden() || window == this)
continue;
@ -1480,21 +1480,21 @@ WindowLayer::Frontmost(WindowLayer* first, int32 workspace)
bool
WindowLayer::AddToSubset(WindowLayer* window)
Window::AddToSubset(Window* window)
{
return fSubsets.AddItem(window);
}
void
WindowLayer::RemoveFromSubset(WindowLayer* window)
Window::RemoveFromSubset(Window* window)
{
fSubsets.RemoveItem(window);
}
bool
WindowLayer::HasInSubset(const WindowLayer* window) const
Window::HasInSubset(const Window* window) const
{
if (window == NULL || fFeel == window->Feel()
|| fFeel == B_NORMAL_WINDOW_FEEL)
@ -1531,11 +1531,10 @@ WindowLayer::HasInSubset(const WindowLayer* window) const
/*! \brief Collects all workspaces views in this window and puts it into \a list
*/
void
WindowLayer::FindWorkspacesViews(BObjectList<WorkspacesLayer>& list) const
Window::FindWorkspacesViews(BObjectList<WorkspacesView>& list) const
{
int32 count = fWorkspacesViewCount;
TopLayer()->FindViews(kWorkspacesViewFlag, (BObjectList<ViewLayer>&)list,
count);
fTopLayer->FindViews(kWorkspacesViewFlag, (BObjectList<View>&)list, count);
}
@ -1546,14 +1545,14 @@ WindowLayer::FindWorkspacesViews(BObjectList<WorkspacesLayer>& list) const
to have a subset as front window to be visible.
*/
uint32
WindowLayer::SubsetWorkspaces() const
Window::SubsetWorkspaces() const
{
if (fFeel == B_MODAL_ALL_WINDOW_FEEL
|| fFeel == B_FLOATING_ALL_WINDOW_FEEL)
return B_ALL_WORKSPACES;
if (fFeel == B_FLOATING_APP_WINDOW_FEEL) {
WindowLayer* front = fDesktop->FrontWindow();
Window* front = fDesktop->FrontWindow();
if (front != NULL && front->IsNormal()
&& front->ServerWindow()->App() == ServerWindow()->App())
return ServerWindow()->App()->Workspaces();
@ -1577,7 +1576,7 @@ WindowLayer::SubsetWorkspaces() const
uint32 workspaces = 0;
bool hasNormalFront = false;
for (int32 i = 0; i < fSubsets.CountItems(); i++) {
WindowLayer* window = fSubsets.ItemAt(i);
Window* window = fSubsets.ItemAt(i);
if (!window->IsHidden())
workspaces |= window->Workspaces();
@ -1600,7 +1599,7 @@ WindowLayer::SubsetWorkspaces() const
/*static*/
bool
WindowLayer::IsValidLook(window_look look)
Window::IsValidLook(window_look look)
{
return look == B_TITLED_WINDOW_LOOK
|| look == B_DOCUMENT_WINDOW_LOOK
@ -1615,7 +1614,7 @@ WindowLayer::IsValidLook(window_look look)
/*static*/
bool
WindowLayer::IsValidFeel(window_feel feel)
Window::IsValidFeel(window_feel feel)
{
return feel == B_NORMAL_WINDOW_FEEL
|| feel == B_MODAL_SUBSET_WINDOW_FEEL
@ -1632,7 +1631,7 @@ WindowLayer::IsValidFeel(window_feel feel)
/*static*/
bool
WindowLayer::IsModalFeel(window_feel feel)
Window::IsModalFeel(window_feel feel)
{
return feel == B_MODAL_SUBSET_WINDOW_FEEL
|| feel == B_MODAL_APP_WINDOW_FEEL
@ -1642,7 +1641,7 @@ WindowLayer::IsModalFeel(window_feel feel)
/*static*/
bool
WindowLayer::IsFloatingFeel(window_feel feel)
Window::IsFloatingFeel(window_feel feel)
{
return feel == B_FLOATING_SUBSET_WINDOW_FEEL
|| feel == B_FLOATING_APP_WINDOW_FEEL
@ -1652,7 +1651,7 @@ WindowLayer::IsFloatingFeel(window_feel feel)
/*static*/
uint32
WindowLayer::ValidWindowFlags()
Window::ValidWindowFlags()
{
return B_NOT_MOVABLE | B_NOT_CLOSABLE | B_NOT_ZOOMABLE
| B_NOT_MINIMIZABLE | B_NOT_RESIZABLE
@ -1671,7 +1670,7 @@ WindowLayer::ValidWindowFlags()
/*static*/
uint32
WindowLayer::ValidWindowFlags(window_feel feel)
Window::ValidWindowFlags(window_feel feel)
{
uint32 flags = ValidWindowFlags();
if (IsModalFeel(feel))
@ -1686,7 +1685,7 @@ WindowLayer::ValidWindowFlags(window_feel feel)
// _ShiftPartOfRegion
void
WindowLayer::_ShiftPartOfRegion(BRegion* region, BRegion* regionToShift,
Window::_ShiftPartOfRegion(BRegion* region, BRegion* regionToShift,
int32 xOffset, int32 yOffset)
{
BRegion* common = fRegionPool.GetRegion(*regionToShift);
@ -1706,7 +1705,7 @@ WindowLayer::_ShiftPartOfRegion(BRegion* region, BRegion* regionToShift,
void
WindowLayer::_TriggerContentRedraw(BRegion& dirtyContentRegion)
Window::_TriggerContentRedraw(BRegion& dirtyContentRegion)
{
if (IsVisible() && dirtyContentRegion.CountRects() > 0) {
// put this into the pending dirty region
@ -1742,7 +1741,7 @@ WindowLayer::_TriggerContentRedraw(BRegion& dirtyContentRegion)
void
WindowLayer::_DrawBorder()
Window::_DrawBorder()
{
// this is executed in the window thread, but only
// in respond to a REDRAW message having been received, the
@ -1790,7 +1789,7 @@ fWindow->ResyncDrawState();
the clipping lock held
*/
void
WindowLayer::_TransferToUpdateSession(BRegion* contentDirtyRegion)
Window::_TransferToUpdateSession(BRegion* contentDirtyRegion)
{
if (contentDirtyRegion->CountRects() <= 0)
return;
@ -1832,7 +1831,7 @@ WindowLayer::_TransferToUpdateSession(BRegion* contentDirtyRegion)
// _SendUpdateMessage
void
WindowLayer::_SendUpdateMessage()
Window::_SendUpdateMessage()
{
if (!fUpdatesEnabled)
return;
@ -1846,11 +1845,11 @@ WindowLayer::_SendUpdateMessage()
void
WindowLayer::BeginUpdate(BPrivate::PortLink& link)
Window::BeginUpdate(BPrivate::PortLink& link)
{
// NOTE: since we might "shift" parts of the
// internal dirty regions from the desktop thread
// in response to WindowLayer::ResizeBy(), which
// in response to Window::ResizeBy(), which
// might move arround views, the user of this function
// needs to hold the global clipping lock so that the internal
// dirty regions are not messed with from the Desktop thread
@ -1872,7 +1871,7 @@ WindowLayer::BeginUpdate(BPrivate::PortLink& link)
// TODO: each view could be drawn individually
// right before carrying out the first drawing
// command from the client during an update
// (ViewLayer::IsBackgroundDirty() can be used
// (View::IsBackgroundDirty() can be used
// for this)
if (!fContentRegionValid)
_UpdateContentRegion();
@ -1928,13 +1927,13 @@ WindowLayer::BeginUpdate(BPrivate::PortLink& link)
printf("BeginUpdate() but no update requested!!\n");
link.StartMessage(B_ERROR);
link.Flush();
fprintf(stderr, "WindowLayer::BeginUpdate() - no update requested!\n");
fprintf(stderr, "Window::BeginUpdate() - no update requested!\n");
}
}
void
WindowLayer::EndUpdate()
Window::EndUpdate()
{
// NOTE: see comment in _BeginUpdate()
@ -1954,7 +1953,7 @@ WindowLayer::EndUpdate()
void
WindowLayer::_UpdateContentRegion()
Window::_UpdateContentRegion()
{
fContentRegion.Set(fFrame);
@ -1971,7 +1970,7 @@ WindowLayer::_UpdateContentRegion()
click_type
WindowLayer::_ActionFor(const BMessage* msg) const
Window::_ActionFor(const BMessage* msg) const
{
if (fDecorator == NULL)
return DEC_NONE;
@ -1993,7 +1992,7 @@ WindowLayer::_ActionFor(const BMessage* msg) const
void
WindowLayer::_ObeySizeLimits()
Window::_ObeySizeLimits()
{
// make sure we even have valid size limits
if (fMaxWidth < fMinWidth)
@ -2038,7 +2037,7 @@ WindowLayer::_ObeySizeLimits()
// #pragma mark - UpdateSession
WindowLayer::UpdateSession::UpdateSession()
Window::UpdateSession::UpdateSession()
: fDirtyRegion(),
fInUse(false),
fCause(0)
@ -2046,34 +2045,34 @@ WindowLayer::UpdateSession::UpdateSession()
}
WindowLayer::UpdateSession::~UpdateSession()
Window::UpdateSession::~UpdateSession()
{
}
void
WindowLayer::UpdateSession::Include(BRegion* additionalDirty)
Window::UpdateSession::Include(BRegion* additionalDirty)
{
fDirtyRegion.Include(additionalDirty);
}
void
WindowLayer::UpdateSession::Exclude(BRegion* dirtyInNextSession)
Window::UpdateSession::Exclude(BRegion* dirtyInNextSession)
{
fDirtyRegion.Exclude(dirtyInNextSession);
}
void
WindowLayer::UpdateSession::MoveBy(int32 x, int32 y)
Window::UpdateSession::MoveBy(int32 x, int32 y)
{
fDirtyRegion.OffsetBy(x, y);
}
void
WindowLayer::UpdateSession::SetUsed(bool used)
Window::UpdateSession::SetUsed(bool used)
{
fInUse = used;
if (!fInUse) {
@ -2084,7 +2083,7 @@ WindowLayer::UpdateSession::SetUsed(bool used)
void
WindowLayer::UpdateSession::AddCause(uint8 cause)
Window::UpdateSession::AddCause(uint8 cause)
{
fCause |= cause;
}

View File

@ -8,14 +8,14 @@
* Stephan Aßmus <superstippi@gmx.de>
* Axel Dörfler, axeld@pinc-software.de
*/
#ifndef WINDOW_LAYER_H
#define WINDOW_LAYER_H
#ifndef WINDOW_H
#define WINDOW_H
#include "Decorator.h"
#include "ViewLayer.h"
#include "RegionPool.h"
#include "ServerWindow.h"
#include "View.h"
#include "WindowList.h"
#include <ObjectList.h>
@ -31,7 +31,7 @@ class Decorator;
class Desktop;
class DrawingEngine;
class EventDispatcher;
class WorkspacesLayer;
class WorkspacesView;
// TODO: move this into a proper place
#define AS_REDRAW 'rdrw'
@ -41,22 +41,21 @@ enum {
UPDATE_EXPOSE = 0x02,
};
class WindowLayer {
class Window {
public:
WindowLayer(const BRect& frame,
const char *name, window_look look,
window_feel feel, uint32 flags,
uint32 workspaces,
::ServerWindow* window,
DrawingEngine* drawingEngine);
virtual ~WindowLayer();
Window(const BRect& frame, const char *name,
window_look look, window_feel feel,
uint32 flags, uint32 workspaces,
::ServerWindow* window,
DrawingEngine* drawingEngine);
virtual ~Window();
BRect Frame() const { return fFrame; }
const char* Title() const { return fTitle.String(); }
window_anchor& Anchor(int32 index);
WindowLayer* NextWindow(int32 index) const;
WindowLayer* PreviousWindow(int32 index) const;
Window* NextWindow(int32 index) const;
Window* PreviousWindow(int32 index) const;
::Desktop* Desktop() const { return fDesktop; }
::Decorator* Decorator() const { return fDecorator; }
@ -71,7 +70,7 @@ public:
BRegion& VisibleContentRegion();
// TODO: not protected by a lock, but noone should need this anyways
// make private? when used inside WindowLayer, it has the ReadLock()
// make private? when used inside Window, it has the ReadLock()
void GetFullRegion(BRegion* region);
void GetBorderRegion(BRegion* region);
void GetContentRegion(BRegion* region);
@ -79,18 +78,16 @@ public:
void MoveBy(int32 x, int32 y);
void ResizeBy(int32 x, int32 y, BRegion* dirtyRegion);
void ScrollViewBy(ViewLayer* view, int32 dx, int32 dy);
void ScrollViewBy(View* view, int32 dx, int32 dy);
void SetTopLayer(ViewLayer* topLayer);
ViewLayer* TopLayer() const { return fTopLayer; }
// TODO: only used for WorkspacesLayer, can go away if we do
// this differently one day
ViewLayer* ViewAt(const BPoint& where);
void SetTopLayer(View* topLayer);
View* TopLayer() const { return fTopLayer; }
View* ViewAt(const BPoint& where);
virtual bool IsOffscreenWindow() const { return false; }
void GetEffectiveDrawingRegion(ViewLayer* layer, BRegion& region);
bool DrawingRegionChanged(ViewLayer* layer) const;
void GetEffectiveDrawingRegion(View* layer, BRegion& region);
bool DrawingRegionChanged(View* layer) const;
// generic version, used by the Desktop
void ProcessDirtyRegion(BRegion& regionOnScreen);
@ -103,7 +100,7 @@ public:
void MarkContentDirty(BRegion& regionOnScreen);
void MarkContentDirtyAsync(BRegion& regionOnScreen);
// shortcut for invalidating just one view
void InvalidateView(ViewLayer* view, BRegion& layerRegion);
void InvalidateView(View* view, BRegion& layerRegion);
void DisableUpdateRequests();
void EnableUpdateRequests();
@ -130,7 +127,7 @@ public:
{ fRegionPool.Recycle(region); }
void CopyContents(BRegion* region,
int32 xOffset, int32 yOffset);
int32 xOffset, int32 yOffset);
void MouseDown(BMessage* message, BPoint where, int32* _viewToken);
void MouseUp(BMessage* message, BPoint where, int32* _viewToken);
@ -200,13 +197,15 @@ public:
bool HasModal() const;
WindowLayer* Frontmost(WindowLayer* first = NULL, int32 workspace = -1);
WindowLayer* Backmost(WindowLayer* first = NULL, int32 workspace = -1);
Window* Frontmost(Window* first = NULL,
int32 workspace = -1);
Window* Backmost(Window* first = NULL,
int32 workspace = -1);
bool AddToSubset(WindowLayer* window);
void RemoveFromSubset(WindowLayer* window);
bool HasInSubset(const WindowLayer* window) const;
bool SameSubset(WindowLayer* window);
bool AddToSubset(Window* window);
void RemoveFromSubset(Window* window);
bool HasInSubset(const Window* window) const;
bool SameSubset(Window* window);
uint32 SubsetWorkspaces() const;
bool HasWorkspacesViews() const
@ -216,7 +215,7 @@ public:
void RemoveWorkspacesView()
{ fWorkspacesViewCount--; }
void FindWorkspacesViews(
BObjectList<WorkspacesLayer>& list) const;
BObjectList<WorkspacesView>& list) const;
static bool IsValidLook(window_look look);
static bool IsValidFeel(window_feel feel);
@ -230,8 +229,9 @@ protected:
friend class Desktop;
// TODO: for now (list management)
void _ShiftPartOfRegion(BRegion* region, BRegion* regionToShift,
int32 xOffset, int32 yOffset);
void _ShiftPartOfRegion(BRegion* region,
BRegion* regionToShift, int32 xOffset,
int32 yOffset);
// different types of drawing
void _TriggerContentRedraw(BRegion& dirty);
@ -280,7 +280,7 @@ protected:
::RegionPool fRegionPool;
BObjectList<WindowLayer> fSubsets;
BObjectList<Window> fSubsets;
// TODO: remove those some day (let the decorator handle that stuff)
bool fIsClosing : 1;
@ -292,7 +292,7 @@ protected:
bool fActivateOnMouseUp : 1;
::Decorator* fDecorator;
ViewLayer* fTopLayer;
View* fTopLayer;
::ServerWindow* fWindow;
DrawingEngine* fDrawingEngine;
::Desktop* fDesktop;
@ -366,4 +366,4 @@ protected:
int32 fWorkspacesViewCount;
};
#endif // WINDOW_LAYER_H
#endif // WINDOW_H

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2005-2006, Haiku, Inc.
* Copyright (c) 2005-2008, Haiku, Inc.
* Distributed under the terms of the MIT license.
*
* Authors:
@ -8,7 +8,7 @@
#include "DesktopSettings.h"
#include "WindowLayer.h"
#include "Window.h"
const BPoint kInvalidWindowPosition = BPoint(INFINITY, INFINITY);
@ -52,7 +52,7 @@ WindowList::SetIndex(int32 index)
given, it will be inserted right before that window.
*/
void
WindowList::AddWindow(WindowLayer* window, WindowLayer* before)
WindowList::AddWindow(Window* window, Window* before)
{
window_anchor& windowAnchor = window->Anchor(fIndex);
@ -88,7 +88,7 @@ WindowList::AddWindow(WindowLayer* window, WindowLayer* before)
void
WindowList::RemoveWindow(WindowLayer* window)
WindowList::RemoveWindow(Window* window)
{
window_anchor& windowAnchor = window->Anchor(fIndex);
@ -117,7 +117,7 @@ WindowList::RemoveWindow(WindowLayer* window)
bool
WindowList::HasWindow(WindowLayer* window) const
WindowList::HasWindow(Window* window) const
{
if (window == NULL)
return false;

View File

@ -13,29 +13,29 @@
#include <Point.h>
class WindowLayer;
class Window;
class WindowList {
public:
WindowList(int32 index = 0);
~WindowList();
public:
WindowList(int32 index = 0);
~WindowList();
void SetIndex(int32 index);
int32 Index() const { return fIndex; }
void SetIndex(int32 index);
int32 Index() const { return fIndex; }
Window* FirstWindow() { return fFirstWindow; }
Window* LastWindow() { return fLastWindow; }
void AddWindow(Window* window, Window* before = NULL);
void RemoveWindow(Window* window);
bool HasWindow(Window* window) const;
WindowLayer* FirstWindow() { return fFirstWindow; }
WindowLayer* LastWindow() { return fLastWindow; }
void AddWindow(WindowLayer* window, WindowLayer* before = NULL);
void RemoveWindow(WindowLayer* window);
bool HasWindow(WindowLayer* window) const;
private:
int32 fIndex;
WindowLayer* fFirstWindow;
WindowLayer* fLastWindow;
private:
int32 fIndex;
Window* fFirstWindow;
Window* fLastWindow;
};
enum window_lists {
@ -50,9 +50,9 @@ enum window_lists {
struct window_anchor {
window_anchor();
WindowLayer* next;
WindowLayer* previous;
BPoint position;
Window* next;
Window* previous;
BPoint position;
};
extern const BPoint kInvalidWindowPosition;

View File

@ -1,5 +1,5 @@
/*
* Copyright 2005-2007, Haiku.
* Copyright 2005-2008, Haiku.
* Distributed under the terms of the MIT License.
*
* Authors:
@ -10,7 +10,7 @@
#include "Desktop.h"
#include "Workspace.h"
#include "WorkspacePrivate.h"
#include "WindowLayer.h"
#include "Window.h"
#include <math.h>
#include <stdio.h>
@ -116,7 +116,7 @@ Workspace::SetColor(const rgb_color& color, bool makeDefault)
status_t
Workspace::GetNextWindow(WindowLayer*& _window, BPoint& _leftTop)
Workspace::GetNextWindow(Window*& _window, BPoint& _leftTop)
{
if (fCurrent == NULL)
fCurrent = fWorkspace.Windows().FirstWindow();
@ -138,7 +138,7 @@ Workspace::GetNextWindow(WindowLayer*& _window, BPoint& _leftTop)
status_t
Workspace::GetPreviousWindow(WindowLayer*& _window, BPoint& _leftTop)
Workspace::GetPreviousWindow(Window*& _window, BPoint& _leftTop)
{
if (fCurrent == NULL)
fCurrent = fWorkspace.Windows().LastWindow();

View File

@ -1,5 +1,5 @@
/*
* Copyright 2005-2007, Haiku.
* Copyright 2005-2008, Haiku.
* Distributed under the terms of the MIT License.
*
* Authors:
@ -13,7 +13,7 @@
class Desktop;
class WindowLayer;
class Window;
class Workspace {
@ -26,8 +26,8 @@ class Workspace {
bool IsCurrent() const
{ return fCurrentWorkspace; }
status_t GetNextWindow(WindowLayer*& _window, BPoint& _leftTop);
status_t GetPreviousWindow(WindowLayer*& _window, BPoint& _leftTop);
status_t GetNextWindow(Window*& _window, BPoint& _leftTop);
status_t GetPreviousWindow(Window*& _window, BPoint& _leftTop);
void RewindWindows();
class Private;
@ -35,7 +35,7 @@ class Workspace {
private:
Workspace::Private& fWorkspace;
Desktop& fDesktop;
WindowLayer* fCurrent;
Window* fCurrent;
bool fCurrentWorkspace;
};

View File

@ -1,5 +1,5 @@
/*
* Copyright 2005, Haiku.
* Copyright 2005-2008, Haiku.
* Distributed under the terms of the MIT License.
*
* Authors:
@ -51,8 +51,8 @@ class Workspace::Private {
void _SetDefaults();
WindowList fWindows;
WindowLayer* fFront;
WindowLayer* fFocus;
Window* fFront;
Window* fFocus;
BObjectList<display_info> fDisplays;

View File

@ -8,20 +8,20 @@
*/
#include "WorkspacesLayer.h"
#include "WorkspacesView.h"
#include "AppServer.h"
#include "Desktop.h"
#include "DrawingEngine.h"
#include "WindowLayer.h"
#include "Window.h"
#include "Workspace.h"
#include <WindowPrivate.h>
WorkspacesLayer::WorkspacesLayer(BRect frame, BPoint scrollingOffset,
WorkspacesView::WorkspacesView(BRect frame, BPoint scrollingOffset,
const char* name, int32 token, uint32 resizeMode, uint32 flags)
: ViewLayer(frame, scrollingOffset, name, token, resizeMode, flags),
: View(frame, scrollingOffset, name, token, resizeMode, flags),
fSelectedWindow(NULL),
fSelectedWorkspace(-1),
fHasMoved(false)
@ -31,15 +31,15 @@ WorkspacesLayer::WorkspacesLayer(BRect frame, BPoint scrollingOffset,
}
WorkspacesLayer::~WorkspacesLayer()
WorkspacesView::~WorkspacesView()
{
}
void
WorkspacesLayer::AttachedToWindow(WindowLayer* window)
WorkspacesView::AttachedToWindow(::Window* window)
{
ViewLayer::AttachedToWindow(window);
View::AttachedToWindow(window);
window->AddWorkspacesView();
window->Desktop()->AddWorkspacesView(this);
@ -47,17 +47,17 @@ WorkspacesLayer::AttachedToWindow(WindowLayer* window)
void
WorkspacesLayer::DetachedFromWindow()
WorkspacesView::DetachedFromWindow()
{
fWindow->Desktop()->RemoveWorkspacesView(this);
fWindow->RemoveWorkspacesView();
ViewLayer::DetachedFromWindow();
View::DetachedFromWindow();
}
void
WorkspacesLayer::_GetGrid(int32& columns, int32& rows)
WorkspacesView::_GetGrid(int32& columns, int32& rows)
{
DesktopSettings settings(Window()->Desktop());
@ -78,7 +78,7 @@ WorkspacesLayer::_GetGrid(int32& columns, int32& rows)
\brief Returns the frame of the screen for the specified workspace.
*/
BRect
WorkspacesLayer::_ScreenFrame(int32 i)
WorkspacesView::_ScreenFrame(int32 i)
{
return Window()->Desktop()->VirtualScreen().Frame();
}
@ -89,7 +89,7 @@ WorkspacesLayer::_ScreenFrame(int32 i)
workspaces layer.
*/
BRect
WorkspacesLayer::_WorkspaceAt(int32 i)
WorkspacesView::_WorkspaceAt(int32 i)
{
int32 columns, rows;
_GetGrid(columns, rows);
@ -126,7 +126,7 @@ WorkspacesLayer::_WorkspaceAt(int32 i)
an empty rectangle is returned, and \a index is set to -1.
*/
BRect
WorkspacesLayer::_WorkspaceAt(BPoint where, int32& index)
WorkspacesView::_WorkspaceAt(BPoint where, int32& index)
{
int32 columns, rows;
_GetGrid(columns, rows);
@ -143,7 +143,7 @@ WorkspacesLayer::_WorkspaceAt(BPoint where, int32& index)
BRect
WorkspacesLayer::_WindowFrame(const BRect& workspaceFrame,
WorkspacesView::_WindowFrame(const BRect& workspaceFrame,
const BRect& screenFrame, const BRect& windowFrame,
BPoint windowPosition)
{
@ -164,9 +164,9 @@ WorkspacesLayer::_WindowFrame(const BRect& workspaceFrame,
void
WorkspacesLayer::_DrawWindow(DrawingEngine* drawingEngine, const BRect& workspaceFrame,
const BRect& screenFrame, WindowLayer* window, BPoint windowPosition,
BRegion& backgroundRegion, bool active)
WorkspacesView::_DrawWindow(DrawingEngine* drawingEngine,
const BRect& workspaceFrame, const BRect& screenFrame, ::Window* window,
BPoint windowPosition, BRegion& backgroundRegion, bool active)
{
if (window->Feel() == kDesktopWindowFeel || window->IsHidden())
return;
@ -226,7 +226,7 @@ WorkspacesLayer::_DrawWindow(DrawingEngine* drawingEngine, const BRect& workspac
// draw title
// TODO: disabled because it's much too slow this way - the mini-window
// functionality should probably be moved into the WindowLayer class,
// functionality should probably be moved into the Window class,
// so that it has only to be recalculated on demand. With double buffered
// windows, this would also open up the door to have a more detailed
// preview.
@ -252,7 +252,7 @@ WorkspacesLayer::_DrawWindow(DrawingEngine* drawingEngine, const BRect& workspac
void
WorkspacesLayer::_DrawWorkspace(DrawingEngine* drawingEngine,
WorkspacesView::_DrawWorkspace(DrawingEngine* drawingEngine,
BRegion& redraw, int32 index)
{
BRect rect = _WorkspaceAt(index);
@ -288,7 +288,7 @@ WorkspacesLayer::_DrawWorkspace(DrawingEngine* drawingEngine,
// We draw from top down and cut the window out of the clipping region
// which reduces the flickering
WindowLayer* window;
::Window* window;
BPoint leftTop;
while (workspace.GetPreviousWindow(window, leftTop) == B_OK) {
_DrawWindow(drawingEngine, rect, screenFrame, window,
@ -303,14 +303,14 @@ WorkspacesLayer::_DrawWorkspace(DrawingEngine* drawingEngine,
void
WorkspacesLayer::_DarkenColor(rgb_color& color) const
WorkspacesView::_DarkenColor(rgb_color& color) const
{
color = tint_color(color, B_DARKEN_2_TINT);
}
void
WorkspacesLayer::_Invalidate() const
WorkspacesView::_Invalidate() const
{
BRect frame = Bounds();
ConvertToScreen(&frame);
@ -321,7 +321,7 @@ WorkspacesLayer::_Invalidate() const
void
WorkspacesLayer::Draw(DrawingEngine* drawingEngine, BRegion* effectiveClipping,
WorkspacesView::Draw(DrawingEngine* drawingEngine, BRegion* effectiveClipping,
BRegion* windowContentClipping, bool deep)
{
// we can only draw within our own area
@ -377,7 +377,7 @@ WorkspacesLayer::Draw(DrawingEngine* drawingEngine, BRegion* effectiveClipping,
void
WorkspacesLayer::MouseDown(BMessage* message, BPoint where)
WorkspacesView::MouseDown(BMessage* message, BPoint where)
{
// reset tracking variables
fSelectedWorkspace = -1;
@ -400,7 +400,7 @@ WorkspacesLayer::MouseDown(BMessage* message, BPoint where)
BRect screenFrame = _ScreenFrame(index);
WindowLayer* window;
::Window* window;
BRect windowFrame;
BPoint leftTop;
while (workspace.GetPreviousWindow(window, leftTop) == B_OK) {
@ -453,7 +453,7 @@ WorkspacesLayer::MouseDown(BMessage* message, BPoint where)
void
WorkspacesLayer::MouseUp(BMessage* message, BPoint where)
WorkspacesView::MouseUp(BMessage* message, BPoint where)
{
if (!fHasMoved && fSelectedWorkspace >= 0) {
int32 index;
@ -473,7 +473,7 @@ WorkspacesLayer::MouseUp(BMessage* message, BPoint where)
void
WorkspacesLayer::MouseMoved(BMessage* message, BPoint where)
WorkspacesView::MouseMoved(BMessage* message, BPoint where)
{
if (fSelectedWindow == NULL && fSelectedWorkspace < 0)
return;
@ -537,7 +537,7 @@ WorkspacesLayer::MouseMoved(BMessage* message, BPoint where)
void
WorkspacesLayer::WindowChanged(WindowLayer* window)
WorkspacesView::WindowChanged(::Window* window)
{
// TODO: be smarter about this!
_Invalidate();
@ -545,7 +545,7 @@ WorkspacesLayer::WindowChanged(WindowLayer* window)
void
WorkspacesLayer::WindowRemoved(WindowLayer* window)
WorkspacesView::WindowRemoved(::Window* window)
{
if (fSelectedWindow == window)
fSelectedWindow = NULL;

View File

@ -5,23 +5,21 @@
* Authors:
* Axel Dörfler, axeld@pinc-software.de
*/
#ifndef WORKSPACES_LAYER_H
#define WORKSPACES_LAYER_H
#ifndef WORKSPACES_VIEW_H
#define WORKSPACES_VIEW_H
#include "ViewLayer.h"
class WindowLayer;
#include "View.h"
class WorkspacesLayer : public ViewLayer {
class WorkspacesView : public View {
public:
WorkspacesLayer(BRect frame, BPoint scrollingOffset,
WorkspacesView(BRect frame, BPoint scrollingOffset,
const char* name, int32 token, uint32 resize,
uint32 flags);
virtual ~WorkspacesLayer();
virtual ~WorkspacesView();
virtual void AttachedToWindow(WindowLayer* window);
virtual void AttachedToWindow(::Window* window);
virtual void DetachedFromWindow();
virtual void Draw(DrawingEngine* drawingEngine,
@ -32,8 +30,8 @@ public:
virtual void MouseUp(BMessage* message, BPoint where);
virtual void MouseMoved(BMessage* message, BPoint where);
void WindowChanged(WindowLayer* window);
void WindowRemoved(WindowLayer* window);
void WindowChanged(::Window* window);
void WindowRemoved(::Window* window);
private:
void _GetGrid(int32& columns, int32& rows);
@ -46,7 +44,7 @@ private:
void _DrawWindow(DrawingEngine* drawingEngine,
const BRect& workspaceFrame, const BRect& screenFrame,
WindowLayer* window, BPoint windowPosition,
::Window* window, BPoint windowPosition,
BRegion& backgroundRegion, bool active);
void _DrawWorkspace(DrawingEngine* drawingEngine,
BRegion& redraw, int32 index);
@ -55,10 +53,10 @@ private:
void _Invalidate() const;
private:
WindowLayer* fSelectedWindow;
::Window* fSelectedWindow;
int32 fSelectedWorkspace;
bool fHasMoved;
BPoint fLeftTopOffset;
};
#endif // WORKSPACES_LAYER_H
#endif // WORKSPACES_VIEW_H