Some work on cursors:

* Fixed a myriad of bugs all over the place, ranging from locking errors to
  deleting objects that don't belong to the one deleting them (hello HWInterface!)
* Almost all ServerWindow cursor stuff was broken; I've replaced all commands
  to set a cursor with a single one AS_SET_CURSOR.
* Renamed some cursor commands.
* Changed the (broken) way ServerApp::fAppCursor was maintained - the application
  cursor is now NULL as long as possible.
* Removed superfluous ServerCursor app signature stuff.
* The BApplication will no longer duplicate the default/I-beam cursors, it will
  just reuse the default ones which now have fixed tokens.
* As a result, changing the cursor is now working as expected, closing bug #102.
* Rewrote Cursor.h, renamed private members to match our style guide.
* Minor cleanup.

What's still left to be done is reference counting the cursor objects to make them
work right and reliable.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16237 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler
2006-02-05 18:14:14 +00:00
parent 73b3ea3cd7
commit aa1f543799
18 changed files with 333 additions and 482 deletions
+12 -22
View File
@@ -666,13 +666,11 @@ BApplication::IsCursorHidden() const
void
BApplication::SetCursor(const void *cursor)
BApplication::SetCursor(const void *cursorData)
{
// BeBook sez: If you want to call SetCursor() without forcing an immediate
// sync of the Application Server, you have to use a BCursor.
// By deductive reasoning, this function forces a sync. =)
BCursor Cursor(cursor);
SetCursor(&Cursor, true);
BCursor cursor(cursorData);
SetCursor(&cursor, true);
// forces the cursor to be sync'ed
}
@@ -680,14 +678,14 @@ void
BApplication::SetCursor(const BCursor *cursor, bool sync)
{
BPrivate::AppServerLink link;
int32 code = SERVER_FALSE;
link.StartMessage(AS_SET_CURSOR_BCURSOR);
link.StartMessage(AS_SET_CURSOR);
link.Attach<bool>(sync);
link.Attach<int32>(cursor->m_serverToken);
if (sync)
link.Attach<int32>(cursor->fServerToken);
if (sync) {
int32 code;
link.FlushWithReply(code);
else
} else
link.Flush();
}
@@ -695,24 +693,16 @@ BApplication::SetCursor(const BCursor *cursor, bool sync)
int32
BApplication::CountWindows() const
{
// BeBook sez: The windows list includes all windows explicitely created by
// the app ... but excludes private windows create by Be
// classes.
// I'm taking this to include private menu windows, thus the incl_menus
// param is false.
return count_windows(false);
// we're ignoring menu windows
}
BWindow *
BApplication::WindowAt(int32 index) const
{
// BeBook sez: The windows list includes all windows explicitely created by
// the app ... but excludes private windows create by Be
// classes.
// I'm taking this to include private menu windows, thus the incl_menus
// param is false.
return window_at(index, false);
// we're ignoring menu windows
}