Fixed cursor bug; made some cursor handlers temporaly unavailable. :-D - this is part of moving PollerThread into RootLayer class.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10852 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -130,15 +130,14 @@ AppServer::AppServer(void)
|
|||||||
gui_colorset.SetToDefaults();
|
gui_colorset.SetToDefaults();
|
||||||
|
|
||||||
InitDecorators();
|
InitDecorators();
|
||||||
|
|
||||||
|
// Create the cursor manager. Object declared in CursorManager.cpp
|
||||||
|
cursormanager= new CursorManager();
|
||||||
|
|
||||||
// Set up the Desktop
|
// Set up the Desktop
|
||||||
desktop= new Desktop();
|
desktop= new Desktop();
|
||||||
desktop->Init();
|
desktop->Init();
|
||||||
|
|
||||||
// Create the cursor manager. Object declared in CursorManager.cpp
|
|
||||||
cursormanager= new CursorManager();
|
|
||||||
cursormanager->SetCursor(B_CURSOR_DEFAULT);
|
|
||||||
|
|
||||||
// Create the bitmap allocator. Object declared in BitmapManager.cpp
|
// Create the bitmap allocator. Object declared in BitmapManager.cpp
|
||||||
bitmapmanager= new BitmapManager();
|
bitmapmanager= new BitmapManager();
|
||||||
|
|
||||||
|
|||||||
@@ -99,6 +99,8 @@ void CursorHandler::MoveTo(const BPoint &pt)
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
fCursorPos=pt;
|
fCursorPos=pt;
|
||||||
|
if (!fSavedData)
|
||||||
|
debugger("NULL savedata\n");
|
||||||
fDriver->CopyBitmap(fSavedData,fSavedData->Bounds(),fOldPosition,&(fDriver->fDrawData));
|
fDriver->CopyBitmap(fSavedData,fSavedData->Bounds(),fOldPosition,&(fDriver->fDrawData));
|
||||||
fPosition.OffsetTo(fCursorPos.x-fCursor->GetHotSpot().x,
|
fPosition.OffsetTo(fCursorPos.x-fCursor->GetHotSpot().x,
|
||||||
fCursorPos.y-fCursor->GetHotSpot().y);
|
fCursorPos.y-fCursor->GetHotSpot().y);
|
||||||
|
|||||||
@@ -24,8 +24,6 @@
|
|||||||
// Description: Handles the system's cursor infrastructure
|
// Description: Handles the system's cursor infrastructure
|
||||||
//
|
//
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
#include "DisplayDriver.h"
|
|
||||||
#include "Desktop.h"
|
|
||||||
#include "CursorManager.h"
|
#include "CursorManager.h"
|
||||||
#include "ServerCursor.h"
|
#include "ServerCursor.h"
|
||||||
#include "CursorData.h"
|
#include "CursorData.h"
|
||||||
@@ -175,121 +173,6 @@ void CursorManager::RemoveAppCursors(team_id team)
|
|||||||
Unlock();
|
Unlock();
|
||||||
}
|
}
|
||||||
|
|
||||||
//! Wrapper around the DisplayDriver ShowCursor call
|
|
||||||
void CursorManager::ShowCursor(void)
|
|
||||||
{
|
|
||||||
Lock();
|
|
||||||
|
|
||||||
DisplayDriver *driver = desktop->ActiveScreen()->DDriver();
|
|
||||||
driver->ShowCursor();
|
|
||||||
Unlock();
|
|
||||||
}
|
|
||||||
|
|
||||||
//! Wrapper around the DisplayDriver HideCursor call
|
|
||||||
void CursorManager::HideCursor(void)
|
|
||||||
{
|
|
||||||
Lock();
|
|
||||||
|
|
||||||
DisplayDriver *driver = desktop->ActiveScreen()->DDriver();
|
|
||||||
driver->HideCursor();
|
|
||||||
Unlock();
|
|
||||||
}
|
|
||||||
|
|
||||||
//! Wrapper around the DisplayDriver ObscureCursor call
|
|
||||||
void CursorManager::ObscureCursor(void)
|
|
||||||
{
|
|
||||||
Lock();
|
|
||||||
|
|
||||||
DisplayDriver *driver = desktop->ActiveScreen()->DDriver();
|
|
||||||
driver->ObscureCursor();
|
|
||||||
Unlock();
|
|
||||||
}
|
|
||||||
|
|
||||||
/*!
|
|
||||||
\brief Set the screen's cursor
|
|
||||||
\param token ID of the screen's new cursor
|
|
||||||
*/
|
|
||||||
void CursorManager::SetCursor(int32 token)
|
|
||||||
{
|
|
||||||
Lock();
|
|
||||||
ServerCursor *c=FindCursor(token);
|
|
||||||
if(c)
|
|
||||||
{
|
|
||||||
DisplayDriver *driver = desktop->ActiveScreen()->DDriver();
|
|
||||||
driver->SetCursor(c);
|
|
||||||
fCurrentWhich=B_CURSOR_OTHER;
|
|
||||||
}
|
|
||||||
Unlock();
|
|
||||||
}
|
|
||||||
|
|
||||||
void CursorManager::SetCursor(cursor_which which)
|
|
||||||
{
|
|
||||||
Lock();
|
|
||||||
|
|
||||||
DisplayDriver *driver = desktop->ActiveScreen()->DDriver();
|
|
||||||
switch(which)
|
|
||||||
{
|
|
||||||
case B_CURSOR_DEFAULT:
|
|
||||||
{
|
|
||||||
driver->SetCursor(fDefaultCursor);
|
|
||||||
fCurrentWhich=which;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case B_CURSOR_TEXT:
|
|
||||||
{
|
|
||||||
driver->SetCursor(fTextCursor);
|
|
||||||
fCurrentWhich=which;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case B_CURSOR_MOVE:
|
|
||||||
{
|
|
||||||
driver->SetCursor(fMoveCursor);
|
|
||||||
fCurrentWhich=which;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case B_CURSOR_DRAG:
|
|
||||||
{
|
|
||||||
driver->SetCursor(fDragCursor);
|
|
||||||
fCurrentWhich=which;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case B_CURSOR_RESIZE:
|
|
||||||
{
|
|
||||||
driver->SetCursor(fResizeCursor);
|
|
||||||
fCurrentWhich=which;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case B_CURSOR_RESIZE_NWSE:
|
|
||||||
{
|
|
||||||
driver->SetCursor(fNWSECursor);
|
|
||||||
fCurrentWhich=which;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case B_CURSOR_RESIZE_NESW:
|
|
||||||
{
|
|
||||||
driver->SetCursor(fNESWCursor);
|
|
||||||
fCurrentWhich=which;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case B_CURSOR_RESIZE_NS:
|
|
||||||
{
|
|
||||||
driver->SetCursor(fNSCursor);
|
|
||||||
fCurrentWhich=which;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case B_CURSOR_RESIZE_EW:
|
|
||||||
{
|
|
||||||
driver->SetCursor(fEWCursor);
|
|
||||||
fCurrentWhich=which;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
Unlock();
|
|
||||||
}
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\brief Sets all the cursors from a specified CursorSet
|
\brief Sets all the cursors from a specified CursorSet
|
||||||
\param path Path to the cursor set
|
\param path Path to the cursor set
|
||||||
|
|||||||
@@ -41,6 +41,46 @@
|
|||||||
|
|
||||||
static Blitter blitter;
|
static Blitter blitter;
|
||||||
|
|
||||||
|
int8 default_cursor_data[] = {
|
||||||
|
16,1,0,0,
|
||||||
|
255,224, // ***********-----
|
||||||
|
128,16, // *----------*----
|
||||||
|
128,16, // *----------*----
|
||||||
|
128,96, // *--------**-----
|
||||||
|
128,16, // *----------*----
|
||||||
|
128,8, // *-----------*---
|
||||||
|
128,8, // *-----------*---
|
||||||
|
128,16, // *----------*----
|
||||||
|
128,32, // *---------*-----
|
||||||
|
144,64, // *--*-----*------
|
||||||
|
144,128, // *--*----*-------
|
||||||
|
105,0, // -**-*--*--------
|
||||||
|
6,0, // -----**---------
|
||||||
|
|
||||||
|
0,0, // ----------------
|
||||||
|
0,0, // ----------------
|
||||||
|
0,0, // ----------------
|
||||||
|
|
||||||
|
// default_cursor mask - black pixels are always opaque
|
||||||
|
255,224,
|
||||||
|
255,240,
|
||||||
|
255,240,
|
||||||
|
255,224,
|
||||||
|
255,240,
|
||||||
|
255,248,
|
||||||
|
255,248,
|
||||||
|
255,240,
|
||||||
|
255,224,
|
||||||
|
255,192,
|
||||||
|
255,128,
|
||||||
|
111,0,
|
||||||
|
6,0,
|
||||||
|
|
||||||
|
0,0,
|
||||||
|
0,0,
|
||||||
|
0,0
|
||||||
|
};
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\brief Sets up internal variables needed by all DisplayDriver subclasses
|
\brief Sets up internal variables needed by all DisplayDriver subclasses
|
||||||
|
|
||||||
@@ -51,7 +91,7 @@ DisplayDriver::DisplayDriver(void) :
|
|||||||
fCursorHandler(this)
|
fCursorHandler(this)
|
||||||
{
|
{
|
||||||
_locker=new BLocker();
|
_locker=new BLocker();
|
||||||
|
fCursorHandler.SetCursor(new ServerCursor(default_cursor_data));
|
||||||
// _is_cursor_hidden=false;
|
// _is_cursor_hidden=false;
|
||||||
// _is_cursor_obscured=false;
|
// _is_cursor_obscured=false;
|
||||||
// _cursor=NULL;
|
// _cursor=NULL;
|
||||||
|
|||||||
@@ -59,7 +59,6 @@
|
|||||||
|
|
||||||
//#define DISPLAYDRIVER_TEST_HACK
|
//#define DISPLAYDRIVER_TEST_HACK
|
||||||
|
|
||||||
|
|
||||||
RootLayer::RootLayer(const char *name, int32 workspaceCount,
|
RootLayer::RootLayer(const char *name, int32 workspaceCount,
|
||||||
Desktop *desktop, DisplayDriver *driver)
|
Desktop *desktop, DisplayDriver *driver)
|
||||||
: Layer(BRect(0,0,0,0), name, 0, B_FOLLOW_ALL, B_WILL_DRAW, driver)
|
: Layer(BRect(0,0,0,0), name, 0, B_FOLLOW_ALL, B_WILL_DRAW, driver)
|
||||||
@@ -77,7 +76,7 @@ RootLayer::RootLayer(const char *name, int32 workspaceCount,
|
|||||||
fActiveWorkspace = NULL;
|
fActiveWorkspace = NULL;
|
||||||
fRows = 0;
|
fRows = 0;
|
||||||
fColumns = 0;
|
fColumns = 0;
|
||||||
|
|
||||||
// TODO: this should eventually be replaced by a method to convert the monitor
|
// TODO: this should eventually be replaced by a method to convert the monitor
|
||||||
// number to an index in the name, i.e. workspace_settings_1 for screen #1
|
// number to an index in the name, i.e. workspace_settings_1 for screen #1
|
||||||
ReadWorkspaceData(WORKSPACE_DATA_LIST);
|
ReadWorkspaceData(WORKSPACE_DATA_LIST);
|
||||||
|
|||||||
@@ -33,6 +33,7 @@
|
|||||||
|
|
||||||
#include "Layer.h"
|
#include "Layer.h"
|
||||||
#include "FMWList.h"
|
#include "FMWList.h"
|
||||||
|
#include "CursorHandler.h"
|
||||||
|
|
||||||
class RGBColor;
|
class RGBColor;
|
||||||
class Workspace;
|
class Workspace;
|
||||||
|
|||||||
@@ -40,6 +40,7 @@
|
|||||||
#include "BitmapManager.h"
|
#include "BitmapManager.h"
|
||||||
#include "BGet++.h"
|
#include "BGet++.h"
|
||||||
#include "CursorManager.h"
|
#include "CursorManager.h"
|
||||||
|
|
||||||
#include "Desktop.h"
|
#include "Desktop.h"
|
||||||
#include "DisplayDriver.h"
|
#include "DisplayDriver.h"
|
||||||
#include "FontServer.h"
|
#include "FontServer.h"
|
||||||
@@ -268,10 +269,13 @@ void ServerApp::Activate(bool value)
|
|||||||
//! Sets the cursor to the application cursor, if any.
|
//! Sets the cursor to the application cursor, if any.
|
||||||
void ServerApp::SetAppCursor(void)
|
void ServerApp::SetAppCursor(void)
|
||||||
{
|
{
|
||||||
|
debugger("ServerApp::SetAppCursor() not yet available\n");
|
||||||
|
/*
|
||||||
if(fAppCursor)
|
if(fAppCursor)
|
||||||
cursormanager->SetCursor(fAppCursor->ID());
|
cursormanager->SetCursor(fAppCursor->ID());
|
||||||
else
|
else
|
||||||
cursormanager->SetCursor(B_CURSOR_DEFAULT);
|
cursormanager->SetCursor(B_CURSOR_DEFAULT);
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
@@ -754,21 +758,24 @@ void ServerApp::DispatchMessage(int32 code, LinkMsgReader &msg)
|
|||||||
case AS_SHOW_CURSOR:
|
case AS_SHOW_CURSOR:
|
||||||
{
|
{
|
||||||
STRACE(("ServerApp %s: Show Cursor\n",fSignature.String()));
|
STRACE(("ServerApp %s: Show Cursor\n",fSignature.String()));
|
||||||
cursormanager->ShowCursor();
|
debugger("AS_SHOW_CURSOR: not yet available\n");
|
||||||
|
// cursormanager->ShowCursor();
|
||||||
fCursorHidden=false;
|
fCursorHidden=false;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case AS_HIDE_CURSOR:
|
case AS_HIDE_CURSOR:
|
||||||
{
|
{
|
||||||
STRACE(("ServerApp %s: Hide Cursor\n",fSignature.String()));
|
STRACE(("ServerApp %s: Hide Cursor\n",fSignature.String()));
|
||||||
cursormanager->HideCursor();
|
debugger("AS_HIDE_CURSOR: not yet available\n");
|
||||||
|
// cursormanager->HideCursor();
|
||||||
fCursorHidden=true;
|
fCursorHidden=true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case AS_OBSCURE_CURSOR:
|
case AS_OBSCURE_CURSOR:
|
||||||
{
|
{
|
||||||
STRACE(("ServerApp %s: Obscure Cursor\n",fSignature.String()));
|
STRACE(("ServerApp %s: Obscure Cursor\n",fSignature.String()));
|
||||||
cursormanager->ObscureCursor();
|
debugger("AS_OBSCURE_CURSOR: not yet available\n");
|
||||||
|
// cursormanager->ObscureCursor();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case AS_QUERY_CURSOR_HIDDEN:
|
case AS_QUERY_CURSOR_HIDDEN:
|
||||||
@@ -803,7 +810,8 @@ void ServerApp::DispatchMessage(int32 code, LinkMsgReader &msg)
|
|||||||
fAppCursor->SetOwningTeam(fClientTeamID);
|
fAppCursor->SetOwningTeam(fClientTeamID);
|
||||||
fAppCursor->SetAppSignature(fSignature.String());
|
fAppCursor->SetAppSignature(fSignature.String());
|
||||||
cursormanager->AddCursor(fAppCursor);
|
cursormanager->AddCursor(fAppCursor);
|
||||||
cursormanager->SetCursor(fAppCursor->ID());
|
debugger("AS_SET_CURSOR_DATA: not yet available\n");
|
||||||
|
// cursormanager->SetCursor(fAppCursor->ID());
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case AS_SET_CURSOR_BCURSOR:
|
case AS_SET_CURSOR_BCURSOR:
|
||||||
@@ -822,7 +830,8 @@ void ServerApp::DispatchMessage(int32 code, LinkMsgReader &msg)
|
|||||||
if(sync)
|
if(sync)
|
||||||
msg.Read<int32>(&replyport);
|
msg.Read<int32>(&replyport);
|
||||||
|
|
||||||
cursormanager->SetCursor(ctoken);
|
debugger("AS_SET_CURSOR_BCURSOR: not yet available\n");
|
||||||
|
// cursormanager->SetCursor(ctoken);
|
||||||
|
|
||||||
if(sync)
|
if(sync)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1012,7 +1012,8 @@ void ServerWindow::DispatchMessage(int32 code, LinkMsgReader &link)
|
|||||||
|
|
||||||
link.Read<int32>(&token);
|
link.Read<int32>(&token);
|
||||||
|
|
||||||
cursormanager->SetCursor(token);
|
debugger("AS_LAYER_CURSOR: not yet available\n");
|
||||||
|
// cursormanager->SetCursor(token);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user