Commit Graph

1618 Commits

Author SHA1 Message Date
Michael Lotz
20a4e7265c * Changed the AGGTextRenderer to use the new UTF8 handling
* Added more char codes to is_white_space(), should be all I think

Sorry if I stepped on your toes Stephan, but I wanted these changes flushed before I leave for holidays :-).

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16501 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-02-23 09:04:26 +00:00
Jérôme Duval
dac2d29a21 don't create the directory if it doesn't exist, fix bug #207
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16467 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-02-19 16:42:51 +00:00
Stefano Ceccherini
7938b1158e Decorator() can be NULL in case the look is B_NO_BORDER_WINDOW_LOOK. Fixes bug 204
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16458 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-02-18 09:38:42 +00:00
Axel Dörfler
a9f98d52a3 When unhiding views, we need to update the clipping deep, or child views may be
omitted. This fixes bug #181, or at least the part of it I can reproduce.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16442 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-02-16 21:58:22 +00:00
Axel Dörfler
45a93d5d6b Fix for a bug I introduced with the last change: views were no longer removed at all!
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16440 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-02-16 20:58:58 +00:00
Axel Dörfler
62b5f42b35 * Fixed view deletion: _CreateSelf() and RemoveSelf() are now symmetrical, removing
all those error output from the app_server.
* AS_LAYER_DELETE now gets a token, no longer frightening choice of parent.
* Removed locking in RemoveChild(); it has to be called locked now.
* Removed AS_LAYER_DELETE_ROOT as it's no longer needed.
* Removed support from BView for being PR3 compatible.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16424 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-02-16 14:43:33 +00:00
Axel Dörfler
36e8fa618f The keyboard focus is now always updated if the message is a B_[UNMAPPED_]KEY_DOWN or a
B_MODIFIERS_CHANGED message.
This fixes bug #175 (which was probably caused by a bug in our old BMessage implementation,
see TODO item in line 141).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16414 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-02-15 18:38:39 +00:00
Axel Dörfler
966fbea627 A work-around for the Tracker desktop redraw problem of the previous change.
Should probably be cleaned up a little. This fixes bug #146.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16377 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-02-13 13:43:30 +00:00
Axel Dörfler
3dcbe9fc88 Implemented redrawing the desktop after color changes. Right now, it only works
correctly when Tracker is not running; obviously, the background is cleared in
Tracker before it had the chance of changing the view color.
Maybe the app_server needs to detect the background view of the desktop and
change the view color manually :-/


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16376 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-02-13 13:12:10 +00:00
Stefano Ceccherini
1afee82631 Even more BPicture support. We should have the basic to draw every picture used in our tree (for example, Tracker's navigator's buttons)
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16350 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-02-11 17:48:19 +00:00
Stefano Ceccherini
3da4d36c6a Added support for bitmaps in BPictures.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16348 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-02-11 15:21:29 +00:00
Stefano Ceccherini
f06f67c546 Implemented more BPicture related stuff. With this change, at least buttons can be drawn in pictures almost perfectly
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16344 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-02-10 22:20:32 +00:00
Stefano Ceccherini
38690d41b0 Renamed TPicture class to PicturePlayer
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16342 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-02-10 21:38:53 +00:00
Stefano Ceccherini
2c2773c4c3 Fixed a bug which prevented BPictures to be drawn. Small cleanup
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16341 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-02-10 21:18:53 +00:00
Axel Dörfler
a544829365 _PrepareUnicodeBuffer() no longer processes empty strings which should hide the
often seen error message.
I'll investigate if convert_from_utf8() is supposed to return an error for empty
strings.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16327 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-02-10 11:37:06 +00:00
Axel Dörfler
f877af82fe * Implemented private functions do_minimize_team(), and do_bring_to_front_team()
used by the Deskbar (for "Hide All" and "Show All"). The latter doesn't work
  correctly yet, though, it just maximizes all windows of that application.
* Added a TODO to ServerWindow AS_MINIMIZE_WINDOW on how to make it work correctly.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16315 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-02-09 18:53:36 +00:00
Axel Dörfler
995ab7b3c6 The server now differentiates between hidden and minimized - that concept somehow
got lost, before.
It might not work 100% correctly yet, but it works good enough to hide the Tracker
status window from the Deskbar, and thus, fixing bug #133.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16314 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-02-09 18:28:29 +00:00
Stephan Aßmus
ebae3c7d61 this fixes Chart leaving dirty stars in BDirectWindow mode... at least on my machine. Looks like BDirectWindow resizing is notably smoother on Haiku btw. :-)
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16311 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-02-09 15:07:56 +00:00
Stephan Aßmus
d365e2039e small cleanup
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16310 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-02-09 15:05:33 +00:00
Stephan Aßmus
76cf2ec33f turn off the blitting based MoveBy version, until it works better. The problem is that resizing views with children can invalidate parts which could still be copied by blitting when the child is moved because of FOLLOW modes. Or the problem is only with views that are moved and resized at the same time. I will find out later...
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16309 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-02-09 12:42:08 +00:00
Stephan Aßmus
b5182fe099 don't blit stuff arround on screen when moving or resizing invisible windows, this bug was most visibly triggered when navigating menus, since the menu window was reused and moved and resized when it was invisible, weird things could happen on the screen...
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16308 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-02-09 12:38:46 +00:00
Axel Dörfler
a92dff57f2 Stupid me - thanks to Michael Lotz for pointing that out :-)
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16307 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-02-09 11:27:06 +00:00
Axel Dörfler
2a47269907 SetWindowFocus() could reset the focus of a window that already had focus.
This fixes bug #128.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16305 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-02-09 10:44:02 +00:00
Stephan Aßmus
6697289d80 some changes supposed to speed up VESA mode on real hardware, based on my experience with optimizations in other parts
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16259 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-02-06 19:36:30 +00:00
Stephan Aßmus
95e29889f4 This fixes the update problems that I could observe. The client might have been not in sync with the server regarding window position and size, which in turn messed up the ConvertFromScreen() functions and also the view Bounds(). Therefor the current window geometry is also added to the information the client gets when starting an update session. I think the problem was there before my previous changes, just maybe less likely to be observed.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16258 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-02-06 19:34:36 +00:00
Stephan Aßmus
6134fcc936 * update the visible status of new children
* speed up from/to screen conversion of BRects and BRegions
* invisible views don't need updating


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16257 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-02-06 19:31:02 +00:00
Michael Lotz
9e7948f45e * Fixed locking of the FT_Face by moving it into Get/PutTransformedFace()
* Removed the FaceGetter as it was only needed for locking
* Cleaned up TruncateString()
* Fixed a typo in moreUTF8.h

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16252 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-02-06 17:42:18 +00:00
Axel Dörfler
8527f8ffbe The display resolution is now saved and restored. Probably doesn't handle non-default
modes right yet.
The settings are stored in B_USER_SETTINGS_DIRECTORY/system/app_server/workspaces.
They are currently saved as a flattened BMessage - we might want to switch to the
driver_settings format, though.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16249 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-02-06 13:36:46 +00:00
Axel Dörfler
d5ffccabb7 * Removed unused MakeBlendColor().
* At least 15 bit mode is broken, and should probably be removed.
* Cleanup - do we really need this class?


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16247 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-02-06 11:47:13 +00:00
Stephan Aßmus
bb160ab5f6 change the way the _UPDATE_ message is used: it is now a mere notification that some views need updating. The BWindow will then pull data from the server which views exactly and the update rect. Therefor, the server can append regions to the current update session even if an _UPDATE_ message has already been sent to the client. If multiple views are invalidated in the client, only one update session will be triggered instead of two with the old implementation. Some drawing defects can be observed, but I know how to reproduce them so I hope to fix them soon.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16245 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-02-06 10:28:30 +00:00
Stephan Aßmus
a7250011e8 more or less cosmetical fix
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16242 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-02-06 10:15:48 +00:00
Michael Lotz
db5734a452 More work on the BFont special functions.
* Reworked functions like GetEscapements(), GetBoundingBoxesAsString() and GetGlyphShapes() completely
* Made the ServerFont functions uniform in their prototypes and cleaned out unnecessary arguments
* Added new UTF8 handling functions to moreUTF8.h that are now used by ServerFont
* Put the common transformations of the FT_Face into an own GetTransformedFace() to lessen code duplication

In other words, ServerFont is now cleaned and handles UTF8 pretty efficiently. Some ToDo's are still left though.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16241 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-02-05 23:36:59 +00:00
Axel Dörfler
195e980ef1 * Cursors are now reference counted, so it shouldn't be possible anymore
to delete them accidently :)
* You should no longer call HWInterface::SetCursor(), but the new Desktop::SetCursor()
  if you need to change the cursor.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16238 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-02-05 19:43:44 +00:00
Axel Dörfler
aa1f543799 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
2006-02-05 18:14:14 +00:00
Axel Dörfler
73b3ea3cd7 Fixed a few more uninitialized variables.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16236 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-02-05 18:03:09 +00:00
Axel Dörfler
47f1b81ce2 * fCurrentWorkspace wasn't properly initialized.
* Removed AS_SET_SYSCURSOR_DEFAULTS handling for now.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16235 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-02-05 15:58:29 +00:00
Michael Lotz
739ccb9b2f Changed the way the pen location is applied to shapes according to Stephan, removing the slower matrix calculation.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16233 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-02-05 11:51:13 +00:00
Michael Lotz
7213cb626c * Changed DrawShape() to take the current pen location into account (Stephan please review that AGG part)
* Fixed GetEscapements() to return the correct values
* Corrected and enabled the rotate / shear transform for GetGlyphShapes() and GetEscapements()

The Iterview sample code demo is now working. If you play with it a bit you can also rotate the text.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16232 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-02-05 02:03:09 +00:00
Michael Lotz
bb96bd0a70 * Fixed GetGlyphShapes(). The BShapes that are outputted are correct now but the app_server still cannot draw them correctly.
* Changed the allocation to new for GetGlyphShapes() and GetEscapements() as the data is deleted in ServerApp.cpp
* Minor cleanup

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16231 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-02-04 22:20:00 +00:00
Axel Dörfler
ff3abf4d6f * Started a naive implementation of BView::SetViewCursor() server-side - doesn't
work though, as HWInterface can only draw B_RGB32 cursors...
* More build fixes for libbe_test target - it defines __HAIKU__ as well, now


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16211 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-02-02 20:19:29 +00:00
Axel Dörfler
f7969f54fb Fixed build in the test environment.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16210 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-02-02 20:08:16 +00:00
Stefano Ceccherini
667fa89b02 BDirectwindow is notified when workspace changes. Fixes bug #99
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16174 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-01-31 23:12:29 +00:00
Axel Dörfler
c7023acdc6 * Fixed B_AVOID_FRONT support in the app_server.
* Menu windows now use the kMenuWindowFeel feel (but still need the B_AVOID_FOCUS
  flag set, as that's currently independent from the feel).
* Minor cleanup in MenuWindow.cpp


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16150 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-01-30 13:40:22 +00:00
Axel Dörfler
304636cc5e Implemented kMenuWindowFeel, not that much tested, though.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16149 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-01-30 11:50:02 +00:00
Stefano Ceccherini
92071609a1 extended support for BPicture, still not working
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16006 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-01-18 21:29:29 +00:00
Stefano Ceccherini
af675e2c03 implemented some more stuff for bpicture support. In theory StrokeLine, Stroke/FillRect should work but in practice they don't.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16005 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-01-18 20:49:29 +00:00
Stefano Ceccherini
9cc00d82fb sync
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16003 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-01-17 21:39:41 +00:00
Stefano Ceccherini
9e8d2dd28b Removed PicturePlayer, it only contains code duplicated from TPicture. Some cleanups for BPicture. This commit also completes previous commit for BMenu
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16002 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-01-17 21:39:07 +00:00
Axel Dörfler
4ea667a0b0 Fixed possible crashing bug for B_NO_POINTER_HISTORY views.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15998 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-01-17 16:14:53 +00:00
Axel Dörfler
9a96efa92a Fixed build.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15977 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-01-16 14:43:50 +00:00
Stephan Aßmus
7023b103b3 I took the liberty to revert Stefanos patch in 15953 since you all seem busy, it is ok and even required for the Desktop window to be able to have focus
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15970 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-01-16 11:44:18 +00:00
Stefano Ceccherini
3532dd20d5 Now the kDesktopWindowFeel means also that the window doesn't want focus.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15953 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-01-15 19:36:16 +00:00
Stefano Ceccherini
ade091f23e Don't activate a window (in FFM mode) if it has the B_AVOID_FOCUS flag
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15945 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-01-14 22:51:10 +00:00
Stephan Aßmus
df19082398 * cleaned up ServerApp header a bit
* added support for nested cursor showing/hiding


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15926 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-01-12 11:59:24 +00:00
Stephan Aßmus
cf6fe303d6 * I decided having the cursor obscuring feature in the HWInterface class
was not such a bad idea after all.
* Reenabled obscuring the cursor in ServerApp.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15925 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-01-12 11:46:49 +00:00
Stephan Aßmus
74ae324849 * when the parent ServerApp of the focus window changes,
it's Activate() method is called, if there is no
  new focus app, the cursor is unhidden for safety. The
  most notable difference: After having run a screen
  saver, the cursor will be visible again.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15919 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-01-11 22:30:12 +00:00
Stephan Aßmus
bd5f895aa6 * made hiding and unhiding the cursor actually work
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15918 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-01-11 22:28:19 +00:00
Stephan Aßmus
b073091ab3 * small cleanups
* reworded Activate and commented out all code
  that actually tries to change the cusor shape


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15917 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-01-11 22:27:51 +00:00
Axel Dörfler
92b292f540 Implemented B_NO_POINTER_HISTORY. Window moving/resizing uses this mechanism
as well now, and makes quite a difference in Qemu.
Not tested for standard BViews, though.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15907 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-01-11 12:25:06 +00:00
Axel Dörfler
40be0d5583 Quick fix to make the Qemu experience less bad :-)
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15901 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-01-10 23:18:36 +00:00
Axel Dörfler
5143d99bb0 Removed timeout in the EventDispatcher, clarified TODO about the message queue
of messages that failed to be sent.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15899 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-01-10 20:47:16 +00:00
Stephan Aßmus
7afc7c5074 ServerFont:
* fixed weird pointer conversion in SetStyle()
* fixed a potential mix up in operator=() in case the
  other ServerFont has fStyle == NULL

ServerWindow:
* the WindowLayer fTopLayer cannot be deleted by
  client request, just for safety reasons
* the link is flushed if there is no drawing engine,
  but this case is theoretical only
* deleting the ServerWindow object syncs with the
  client, so that when BBitmaps are deleted, they
  can be sure there are no pending messages (which
  would be executed in a nother thread)
* there is no timeout anymore when sending messages
  to the client, which made absolutely no sense

AGGTextRenderer:
* renamed fFontManager to fFontCache, because that's
  what it really is
* fLastFamilyAndStyle defaulted to the system plain
  font and therefor that font was never loaded when
  the font never changed meanwhile

DrawingMode:
* I'm not quite sure but I think there was the
  potential of a division by zero, at least I
  had crashes with "divide error"

HWInterface:
* fix update when the cursor shape changed in
  double buffered mode
 
ViewLayer:
* since the top layer is never really deleted
  before its time has come, it is not necessary
  to set it to NULL in the ViewLayer destructor

ViewLayer/WindowLayer:
* added a function to collect the view tokens
  that are affected by an update session

EventDispatcher:
* use the importance of the message for the timeout
  in _SendMessage()
* drop mouse moved events in the server if we're
  lagging behind more than 5 ms (Axel, maybe review)

View:
* there were some problems with the locking
  of the BWindow looper in RemoveSelf(), since
  this is called from the window destructor,
  also of BWindows from BBitmaps, which have
  never been run (this might need review), at
  least I seem to have solved the crashing
  problems introduced by actually deleting the
  view hirarchy in the BWindow destructor
* fixed _Draw() for being used non-recursively,
  temporarily disabled DrawAfterChildren, which
  didn't work yet anyways (because views cannot
  draw over children in the server yet)

Window:
* small cleanup when deleting shortcuts
* sync with the server when having send
  AS_DELETE_WINDOW (see ServerWindow above)
* fixed locking in Begin/EndViewTransaction()
* removed folding of _UPDATE_ messages, since
  there is only one ever in the queue
* set the fInTransaction flag during an update,
  I plan to use this in BView later to
  flush the link when drawing outside of an
  update
* BView::_Draw() is now called by view token,
  this gives the next leap forward in speed,
  the overhead because of drawing clean views
  was considerable



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15878 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-01-08 22:04:52 +00:00
Stephan Aßmus
1e1b86ef54 * make sure that fTopLayer is NULL when the top layer is deleted
* make sure layers are removed from the token space when the
  WindowLayer is deleted


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15852 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-01-06 17:17:54 +00:00
Stefano Ceccherini
7898383a8a Implemented AS_CREATE_PICTURE, started cleaning up Picture.cpp
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15843 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-01-05 10:27:29 +00:00
Stefano Ceccherini
8f3f25cf63 Merged the four AS_LAYER_DRAW_BITMAP handlers into just one handler
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15842 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-01-04 12:15:58 +00:00
Stefano Ceccherini
9c0c899e7d Added a copy constructor to ServerPicture. ServerPicture's constructors are private now, and can be called only from ServerApp (friend). Changed BList to a stl::stack which is better suited as a stack... Changed ServerApp::CreatePicture() to accept a picture to clone, instead of passing back a token which was never used anyway.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15840 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-01-04 09:49:47 +00:00
Stefano Ceccherini
ee6bcb7d78 Initial support for recording (some, for now) drawing events into a BPicture
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15838 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-01-04 07:30:38 +00:00
Ingo Weinhold
850f611735 Fixed GCC4 build.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15836 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-01-04 02:35:12 +00:00
Stefano Ceccherini
b41356006a Implement AS_CLONE_PICTURE handler, needed to copy bpictures server side. Not tested yet
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15826 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-01-03 16:41:00 +00:00
Axel Dörfler
a342fafcf4 Undo 15810 again; it messed up the window lists (as WindowLayer::InWorkspace() and WindowLayer::Workspaces() must be in sync).
Might reveal other problems in this area, that are worth looking into.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15823 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-01-03 16:12:52 +00:00
Stefano Ceccherini
cba9e9ece6 Moved picture handlers to DispatchViewMessage, otherwise they are never called as the view can be hidden
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15818 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-01-03 13:49:20 +00:00
Stefano Ceccherini
1c33148d10 Implemented handlers needed for Begin/EndPicture, and a handler for DrawPicture().
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15816 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-01-03 12:44:29 +00:00
Stephan Aßmus
0de2f00de7 updated some comments
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15814 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-01-03 12:07:11 +00:00
Axel Dörfler
cf48970b0f Initial workspace is a bad idea after all - why should debug alerts always open
on workspace 1 just because the system booted in that workspace? :-)
Now modal windows are opened on the current workspace.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15813 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-01-03 11:55:15 +00:00
Axel Dörfler
843bc3cd0d * Introduced an initial application workspace - should be retrieved differently,
though (ideally when launched).
* B_MODAL_APP_WINDOW_FEEL windows are now visible on the initial app workspace
  in case it has no other window visible. This fixes the missing BAlerts in
  the debug_server or just the "alert" command. Thanks to Stephan for pointing
  this out.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15811 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-01-03 11:39:03 +00:00
Axel Dörfler
574af5597c Floating windows start with 0 workspaces - probably didn't matter, though, as
freshly added windows are hidden anyway.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15810 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-01-03 11:36:45 +00:00
Stefano Ceccherini
69706266c5 Added SetPicture and Picture() to ViewLayer
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15809 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-01-03 10:30:08 +00:00
Stephan Aßmus
7324b0ceb8 invisible views are not allowed to draw
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15808 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-01-03 10:19:20 +00:00
Stefano Ceccherini
82b37bb257 Replace our current ServerPicture implementation with the one from Marc Flerackers. Currently it doesn't do anything as I commented out or removed most code, but it shows what we need to do
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15807 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-01-03 09:29:22 +00:00
Stefano Ceccherini
20c2f67293 Added Create/DeletePicture to ServerApp
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15802 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-01-03 08:08:20 +00:00
Stephan Aßmus
fd7d912ff6 * round of baseline position for DrawString()
-> fixes some clipping problems (because of
  hinting, the text was displayed at a rounded
  position anyways, but the clipping calculation
  was screwed up)
* take the drawing_mode and low color from the
  current state for drawing line arrays


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15800 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-01-02 18:11:15 +00:00
Stefano Ceccherini
a5e82db05a Commented out AS_LAYER_***_PICTURE handlers, as they don't do anything and can block the client
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15792 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-01-02 13:09:59 +00:00
Stephan Aßmus
21625cdc1b fix checks for when to draw something
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15789 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-01-02 12:45:07 +00:00
Stephan Aßmus
35cf9ee250 remove left overs
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15779 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-01-02 01:05:42 +00:00
Stephan Aßmus
e067fed541 Decorator::ResizeBy tells you the dirty region, DefaultDecorator::Draw() pays attention to the update rect, small clean ups along the way
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15778 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-01-02 01:03:31 +00:00
Stephan Aßmus
3155f89a0c blame SaveToPNG for not handling other colorspaces
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15777 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-01-02 01:00:12 +00:00
Stephan Aßmus
e644f39677 thought I would accelerate taking a screen shot, but it turned out I slowed it down, but I have yet to test this on Haiku somehow. The new code is commented out
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15776 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-01-02 00:58:37 +00:00
Stephan Aßmus
ec42af75e8 * fixed wrong byte order in DrawingModeAlphaCC
* added another optimized bitmap drawing routine
  for B_OP_ALPHA and BGR[A]32 bitmaps. When actual
  blending takes place, it is more than 1.7 times
  faster than R5, and about the same speed when
  the bitmap is fully opaque.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15761 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-12-31 01:03:26 +00:00
Stephan Aßmus
1fce337f89 cleaned up the code using templates and added optimized version for CMAP8 bitmaps and B_OP_OVER (to benefit Tracker)
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15760 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-12-30 23:41:57 +00:00
Stephan Aßmus
2de437fa29 The first stab at optimizing bitmap drawing,
with quite good results I might add. Drawing B_RGB32
bitmaps is more than 1.2 times faster than on R5, while
B_CMAP8 bitmaps are slightly slower. The optimization
is only for B_OP_COPY and unscaled bitmaps
(B_RGB32 and B_CMAP8). Drawing only parts of the bitmap
is supported. Adding optimization for scaled bitmaps
should be beneficial, since the generic version is 2 two
4 times slower. I think it gets even worse for partial
bitmaps.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15758 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-12-30 21:31:36 +00:00
Stephan Aßmus
d95c3678b9 the source buffer is const of course
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15757 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-12-30 21:26:24 +00:00
Axel Dörfler
9aad1a5754 Fixed some problems of the EventDispatcher I introduced since I've played
with the "EventMask" test app the last time:
* The focus view didn't get any mouse messages anymore if there was a permanent
  B_POINTER_EVENTS view.
* B_KEYBOARD_EVENTS now works again.
* B_MOUSE_WHEEL_CHANGED messages no do arrive their targets without prior
  keyboard input.
* Added TODO item that other focus messages don't go through to the app without
  keyboard input (fix only works for B_MOUSE_WHEEL_CHANGED).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15754 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-12-30 20:59:14 +00:00
Stephan Aßmus
002356d2c9 round off the destination view rect of the view bitmap to avoid problems with drawing the view color around it
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15753 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-12-30 19:56:42 +00:00
Stephan Aßmus
835a0aaf32 prevent drawing bitmaps at fractional offsets
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15732 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-12-29 19:31:43 +00:00
Stephan Aßmus
8d66d23e83 removed some of Axels TODOs and added some notes, avoid clipping operations if nothing needs to be drawn
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15731 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-12-29 19:30:48 +00:00
Axel Dörfler
fc6ec91732 Implemented AS_SET_DESKTOP_COLOR - the desktop is not redrawn yet, but freshly exposed
areas will be filled with the new color.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15724 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-12-29 18:09:07 +00:00
Axel Dörfler
55fd3336b6 * Fixed a bug in ServerApp: when a ServerWindow would take too long to quit,
it could crashed the server.
* ViewLayer now deletes the view bitmap on destruction, if any.
* BitmapManager::Delete() now also accepts NULL bitmaps.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15723 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-12-29 17:40:18 +00:00
Axel Dörfler
4c66abd6f2 Implemented basic server side BView::SetViewBitmap() support. Things like B_TILE_BITMAP
or even the resizing mode isn't done yet, though. See TODOs.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15720 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-12-29 16:46:02 +00:00
Axel Dörfler
4acb99b60f Implemented reference counting of ServerBitmaps, made constructor and destructor private,
as only the BitmapManager class is allowed to call them.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15718 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-12-29 15:36:18 +00:00
Axel Dörfler
93052717b0 Renamed AS_LAYER_GET_{DRAW|BLEND}_MODE to *_{DRAWING|BLENDING}_MODE.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15717 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-12-29 15:06:24 +00:00
Stephan Aßmus
cd2b129d07 * removed superflous LockSingleWindow() from WindowLayer::MoveBy()
and ResizeBy()
* WindowLayer::SetSizeLimits() needs to be called with the
  AllWindows lock held
* I was observing weird behaviour with "unclickable" windows
  that I might have fixed by explicitly excluding invisible
  windows from Desktop::WindowAt(), there might be something
  wrong with the "current" window list though, Axel would know
* finally found the problem with "delayed background clearing"
* enabled delayed background clearing and removed unnecessary
  code. It should be more efficient, since it clears larger
  areas at once, and it solves the problem of views unable to
  draw into regions that are pending for another update - among
  other things, updates in resizing windows are more fluent, 
  especially for B_FULL_UPDATE_ON_RESIZE views. "Cut off" scroll
  bars should no longer appear when the view being scrolled takes
  too long to redraw.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15714 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-12-29 14:15:59 +00:00
Stephan Aßmus
f5b6cf65b2 * extracted the frame buffer memcpy routine from HWInterface.cpp
into a new frame_buffer_support.h
* added blend32 routine for blending a certain color with
  a scanline in the frame buffer
* added "solid" versions of B_OP_ALPHA drawing with
  B_ALPHA_OVERLAY alha function (blending on top of
  a non-transparent background such as the frame buffer)
* implemented an optimized shortcut for alpha blended
  FillRect() in Painter
* used the "packed" version of scanlines for shapes with
  an outline thicker than 4 pixels (and filled shapes anyways),
  this improves drawing speed when there are a few anti-aliased
  pixels at the beginning of a scanline, then a solid fill and
  some anti-aliased pixels at the end of the scanline. Such as
  large letters.

To summarize: The alpha blending in Painter seems to be about
1.45 times faster than on BeOS R5 which benefits drawing large
shapes. For example, drawing a large alpha blended rounded rect
is 1.28 times faster on the Haiku app_server. On the other hand,
B_OP_COPY is quite tough to beat. It is currently 10 times faster
on R5. But a great deal seems to be caused by the Painter
rasterization algorithm itself, since commenting out the actual
drawing doesn't gain any speed.
The other useful experience I collected was that reading and
writing and over the PCI bus in the same loop really hurts
performance. It is actually faster (like 1.8 times!!) to allocate
a second buffer, read from frame buffer into that, doing the
blending at the same time, then writing the buffer back to the
screen.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15698 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-12-28 19:53:00 +00:00
Stephan Aßmus
65b53cc601 quick fix for supporting B_TRANSPARENT_MAGIC pixels in CMAP8 bitmaps when drawing those with B_OP_ALPHA (composite, constant alpha)
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15677 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-12-26 17:41:18 +00:00
Stephan Aßmus
56a1266027 I never get those right the first time
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15672 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-12-25 22:43:02 +00:00
Stephan Aßmus
9d909e2556 first simplistic implementation of drag bitmaps, drawing modes need more work, drawing text into offscreen bitmaps seems to be broken for some weird reason, B_OP_COPY actually copies the alpha value of the color as well
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15671 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-12-25 22:17:17 +00:00
Stefano Ceccherini
5a077d3f0d Windowscreen sorta works. This should've waited till the end of Christmas holidays, but since I had to fix the build today...
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15670 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-12-25 10:45:39 +00:00
Stefano Ceccherini
51a523b147 implemented AS_GET_ACCELERANT/DRIVER_PATH and renamed the relative constants
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15666 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-12-24 16:25:47 +00:00
Stephan Aßmus
208e6678e3 small efficiency improvements - overall, the drawing speed of a usual BView, especially controls, is pretty much equal to R5 now (Drawing straight text, using StringWidth(), tons of AddLine()s, FillRect() etc) :-)
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15662 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-12-23 15:57:55 +00:00
Stephan Aßmus
cf434f8eec fixed comment
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15661 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-12-23 15:54:41 +00:00
Stephan Aßmus
8f30140c63 fixed opening windows in other workspaces than the current, keeps the window lists valid
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15639 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-12-21 13:50:45 +00:00
Stephan Aßmus
5659f08c68 fixed weird resize behaviour (the mouse cursor returns to the initial drag offset after the window has been resized more than the resize limits allow)
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15638 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-12-21 13:49:19 +00:00
Stephan Aßmus
3ca8cdfc07 remove empty functions which are no longer virtual anyways
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15636 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-12-21 11:23:37 +00:00
Stephan Aßmus
28f0e47c1a fix B_SUBPIXEL_PRECISE usage, animation in BitmapDrawing is smooth again
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15635 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-12-21 11:22:48 +00:00
Stephan Aßmus
464f836807 since this is potentially drawing to the frame buffer in the testenviroment too, we don't use memcpy anymore per se
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15634 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-12-21 11:21:56 +00:00
Stephan Aßmus
1f0a4ee8c7 removed unused stuff from Painter and DrawingEngine, fixed the deadlock when trying to use the (20 times faster) DrawingEngine version of StringWidth, the font is now usually ignored when taking on a DrawState in Painter... should add a little speed overall
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15628 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-12-20 22:39:54 +00:00
Stephan Aßmus
bee1ec1ee0 overall more correct, most importantly corrected a bug in content scrolling that caused view redraws to ignore the window content clipping
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15627 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-12-20 22:35:36 +00:00
Stephan Aßmus
3c0e5f8e8b added marking a ViewLayer dirty (ie if background needs to be cleared yet)
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15626 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-12-20 22:31:42 +00:00
Stephan Aßmus
a07317fc10 correctly figure out bits per pixel in the direct window info code, this fixes direct windows in the Accelerant test environment, added a note about how the all windows lock seems to be grabbed for the entire duration of a client update on R5, which cannot quite be the truth, because apps crashing in BView::Draw() would take lock up the app_server, added skipping the processing of drawing messages if the current drawing region is empty, added currently disabled code for clearing the view right before the client draws it... doesn't work for some reason unfortunately
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15625 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-12-20 22:30:02 +00:00
Stephan Aßmus
33ab390e50 currently, there is no mechanism to update the DrawingEngine to a changed frame buffer pointer, so the Window for the Accelerant based test environment is non-movable... will change later
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15624 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-12-20 22:25:20 +00:00
Stephan Aßmus
ef4635a3f9 added a few comments
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15623 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-12-20 22:23:48 +00:00
Stephan Aßmus
de0283f0f1 forgot to commit the heart of the new drawing_mode implementation. Sorry about that, guys. Thou shalt use svn status after doing huge changes...
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15600 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-12-20 08:16:04 +00:00
Stephan Aßmus
8d7b8e8ce7 complete rework of the drawing_modes implementation... I achieved a speedup of 8 to 9 times, tested with text rendering. Believe it or not, but the Haiku text rendering is now faster than R5 for B_OP_COPY at least. And there is quite some room for improvement yet. (faster text bounding box calculation, avoiding the double UTF8 conversion, etc)
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15596 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-12-19 21:22:03 +00:00
Stephan Aßmus
270b7f58b6 removed unnecessary locks
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15595 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-12-19 21:18:23 +00:00
Stephan Aßmus
1bcc09f226 small improvements here and there
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15594 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-12-19 21:18:01 +00:00
Stephan Aßmus
ce8ae4d8c2 _TriggerContentRedraw is now given the dirty region, so ProcessDirtyRegion does not have to be called for triggering window local redraws
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15593 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-12-19 21:16:23 +00:00
Stephan Aßmus
85e1d00d58 small style cleanup
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15592 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-12-19 21:14:16 +00:00
Axel Dörfler
39cc80346c * Implemented automatic font_directory creation for font_mappings.
* Minor cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15584 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-12-19 12:02:17 +00:00
Axel Dörfler
1bd3bb1d58 * Added fallback mappings for the default fonts - since we don't save the
mappings yet, that's a good way to test this functionality.
* Turns out the directory of the mappings must be known already - they
  should be added automatically, but I've added them manually for now
  (which is okay for the default system directory).
* Having more than one style with the same family in the mappings didn't
  work as planned - it now does.
* On my current system, time spend in the font manager constructor went
  down from 1.5 secs to around 12000 usecs (and I have only a moderate
  number of fonts installed, or so I thought - looks like the mappings
  were a good idea :-)) - and that directly cuts down the boot time.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15580 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-12-19 01:01:04 +00:00
Axel Dörfler
d0abcc6fd2 Windows now receive B_WORKSPACE_ACTIVATED and B_WORKSPACES_CHANGED messages again.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15547 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-12-15 16:42:12 +00:00
Stephan Aßmus
c676b8fcc6 now has a special version of B_OP_OVER for solid patterns as well, accelerated the alpha blending for B_OP_OVER.... these are the first shy steps of rewriting the drawing mode stuff... :-)
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15532 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-12-13 20:18:13 +00:00
Stephan Aßmus
2a867ee674 accelerated software cursor drawing 11 times
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15531 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-12-13 19:28:52 +00:00
Stefano Ceccherini
4fbc3f5803 Researched and implemented BDirectWindow::SupportsWindowMode() more
correctly, both for r5 and haiku


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15523 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-12-12 20:46:13 +00:00
Axel Dörfler
1eed15a2d2 ServerApp no longer kills ServerWindows when they don't respond, but drops into
the debugger - killing them only very rarely works out anyway.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15516 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-12-12 13:57:49 +00:00
Axel Dörfler
54527a9ad5 The ServerWindow now keeps the desktop (read) lock for up to 70 messages at once.
This should make drawing a bit smoother.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15515 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-12-12 13:53:35 +00:00
Axel Dörfler
58290b7b37 WindowLayer::ProcessDirtyRegions() no longer deadlock in case it can't send
the AS_REDRAW message.
The AS_REDRAW message is now only used as a notifier - it's arrival is not
critical anymore, IOW it's simply dropped when the queue is full.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15511 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-12-12 13:14:21 +00:00
Axel Dörfler
b02ce81171 You can now specify a timeout to MessageLooper::PostMessage().
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15510 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-12-12 13:12:51 +00:00
Axel Dörfler
61fed21b04 Renamed Write[Un]lockWindows() to [Un]lockAllWindows(), and Read[Un]lockWindows() to
[Un]lockSingleWindow().


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15509 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-12-12 10:41:31 +00:00
Axel Dörfler
bff84e78b7 This enables BDirectWindow support again.
It also fixed a bug in the old code - the handshake semaphores were created
acquirable, causing the BDirectWindow::DirectDaemonFunc() to call DirectConnected()
with an uninitialized buffer and way too early - this probably didn't show up
before since it called it before the BDirectWindow constructor ran through,
so that DirectConnected() would still point to the BDirectWindow version, and
not to the implemented one of its subclass...


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15505 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-12-11 21:46:35 +00:00
Axel Dörfler
bd09e99dbd Made the direct window test environment optional, since it crashes the Dano
app_server...
If you like to use it, define USE_DIRECT_WINDOW_TEST_MODE in the haiku_app_server
Jamfile.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15504 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-12-11 21:42:32 +00:00
Stephan Aßmus
60e12a12c5 no longer used
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15484 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-12-11 13:09:51 +00:00
Stephan Aßmus
3c2ffeb0d6 fixed one more drawing bug, it only showed because now the test environment uses hardware acceleration, FillRegion for the client irgnored the current clipping
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15483 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-12-11 13:03:53 +00:00
Stephan Aßmus
1b13861833 included the wrong header
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15482 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-12-11 13:00:29 +00:00
Stephan Aßmus
62b965a65f * got the "cloned accelerant" based DWindowHWInterface to work, though without
using the clipping info from a BDirectWindow... I made it so that the window
  used stays on top always, until I can think of something better. The other
  problem is that you should not move the window, since Painter doesn't update
  it's pointer into the frame buffer.
* Now the test environment is running at pretty much the same speed as it would
  under Haiku, completely by-passing the BeOS app_server. It shows that Painter
  needs to be optimized for writing to graphics memory, and also that we need to
  figure out a way to distribute update sessions more equally. What happens is
  this: The first invalidation of a window triggers an update on the client
  side... the client cannot keep up with drawing, since it is pretty much
  blocked all the time because the desktop thread moves a window and because
  the clipping constantly changes. In the meantime, new update request are
  added to the pending session because the client has still not finished with
  the current session. Only when things settle a bit, the next update session
  can be startet. On the bright side of things, the earlier problems with
  scrolling seem to be fixed for good.
* some documentation updates on Painter


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15478 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-12-10 21:45:41 +00:00
Ingo Weinhold
b4add623a4 Fixed gcc4 build.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15475 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-12-10 20:16:41 +00:00
Ingo Weinhold
a41a0db6f2 Solved linkage problems. Virtual destructors apparently shouldn't be defined
inline. Commented undefined virtual methods. BBitmapBuffer is still used, so
is ViewHWInterface.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15472 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-12-10 17:48:00 +00:00
Stephan Aßmus
17a4024ca9 classes needed for the new cloned Accelerant based test environment
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15470 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-12-10 16:43:38 +00:00
Axel Dörfler
71b550889e Moved dw_sync_data to a private header DirectWindowPrivate.h and renamed it to direct_window_sync_data.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15469 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-12-10 15:36:38 +00:00
Axel Dörfler
ab6a6bed3a * Renamed direct window commands
* Removed unused cruft from ServerProtocol.h


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15468 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-12-10 15:23:02 +00:00
Axel Dörfler
fc70d6db87 * Renamed AS_LAYER_INVAL_{REGION|RECT} to *_INVALIDATE_*.
* Removed unused AS_LAYER_INVALIDATE.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15467 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-12-10 15:12:28 +00:00
Axel Dörfler
a447191925 The fWindowLock is now responsible for all window activities - no need to sometimes
lock the Desktop itself, and sometimes not - that also fixes some potential deadlock
situations.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15463 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-12-10 13:47:13 +00:00
Stephan Aßmus
7be34d3eb2 * removed CopyRegionList, as it made no sense
* finally nailed that much hated bug where the
  wrong background underneath the cursor was restored.
  I always looked for this in the wrong place -
  of course, you cannot blit regions on top
  of the cursor and expect the backup of the
  background to be magically valid still... ;-)


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15461 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-12-10 10:42:26 +00:00
Stephan Aßmus
f3faa3c29d * renamed _MarkContentDirty() to _TransferToUpdateSession()
to avoid any confusion with MarkContentDirty()
* hopyfully fixed all drawing defects that could be
  observed with CopyBits()ing and ScrollTo()ing, the fix
  is definitely valid, and I cannot see any more problems
  in Tracker either... hopefully this is it.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15458 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-12-10 08:05:25 +00:00
Axel Dörfler
3ea966eee3 Some cleanup, removed some remaining RootLayer references.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15453 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-12-09 17:32:32 +00:00
Axel Dörfler
0b4b0f97ba Although it's not that clean, mouse clicks are now going through to the
WorkspacesLayer again.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15452 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-12-09 17:25:32 +00:00
Axel Dörfler
ce8c4d79fc The Workspaces window is now updated again. Only mouse clicks don't work yet.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15451 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-12-09 16:20:01 +00:00
Axel Dörfler
52d2c710bf * Workspace offsets weren't correct (only for the first workspace).
* No longer draws hidden windows.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15450 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-12-09 16:19:18 +00:00
Axel Dörfler
9d34a4b6d7 * No longer activates a window on first click if B_WILL_ACCEPT_FIRST_CLICK is set.
* minor cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15449 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-12-09 15:40:30 +00:00
Axel Dörfler
a7e201435f Now draws something again, it's just not updated on changes yet.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15448 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-12-09 15:39:20 +00:00
Axel Dörfler
e566030298 * SetFocusWindow() now makes sure no hidden window is taken as focus window...
* When switching workspaces, usually the focus switches to the front window.
  This no longer happens in case a floating window had focus and is still visible
  in the new workspace - in that case, focus is kept with the floating window.
* SetFocusWindow() now chooses the topmost window in case the specified window
  has either a modal or there is no front window.
Desktop::RemoveWindow() now makes sure the window is hidden before removing it.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15447 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-12-09 14:23:51 +00:00
Axel Dörfler
159fdf2038 * added a fOriginalFlags that contains the unaltered flags as set by the client
* when changing feel, the original flags are now restored.
* added B_SAME_POSITION_IN_ALL_WORKSPACES to valid flags, so that they can be
  set by the user.
* fixed masking out invalid flags (actually all but the valid flags were kept...)
* everytime B_SAME_POSITION_IN_ALL_WORKSPACES can be set (either in SetFlags()
  or in SetFeel() the position is propagated to all window lists.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15441 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-12-09 14:06:30 +00:00
Axel Dörfler
ccfb624b7a Minor cleanup.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15438 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-12-09 14:03:00 +00:00
Axel Dörfler
aa203e8d5f If the focus window became invisible because of changing its feel, focus is now
reset to the front window.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15436 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-12-09 13:30:47 +00:00
Axel Dörfler
c81a228fca * SetWindowFeel() now respects the position of the window, and changes it, if necessary.
* renamed workspaces_on_workspace() to workspace_in_workspaces() (was even wrong before).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15435 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-12-09 13:28:28 +00:00
Axel Dörfler
34227d2c34 A couple of changes related to modal and floating windows:
* Desktop::SetWindowFeel() is now working, but doesn't respect the window
  position yet (ie. floating windows would have to be moved to front).
* WindowLayer::Workspaces() now always reflects exactly the lists it's in
  (at least after Desktop::AddWindow() has been called). WindowList::AddWindow()
  and RemoveWindow() now update this flag to be correct at all times.
* Fixed Desktop::_ChangeWindowWorkspaces() to not set the current workspace
  for windows that are not on the current workspace, and vice versa.
  It also would hide windows that were already hidden, and tried to show
  windows that actually were hidden (did no other harm than triggering
  a rebuild of the global clipping).
* Floating windows now work as expected.
* Desktop::SetFocusWindow() won't give a window focus that has a modal.
* Renamed OnWorkspace() to InWorkspace().
* ServerApp::InWorkspace() now works correctly, added ServerApp::Workspaces()
  as well.
* WindowLayer::SubsetWorkspaces() returns the workspaces mask this modal or
  floating window should be in.
* New window flag B_SAME_POSITION_IN_ALL_WORKSPACES should work as well.
* Floating and modal windows now have always set this flag.
* Added a WindowList::HasWindow() method.
* Desktop windows (windows with the desktop feel) can now have focus again
  (I accidently broke that before).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15434 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-12-09 13:17:43 +00:00
Stefano Ceccherini
78d0941945 small change, still commented out, though
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15430 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-12-09 09:10:34 +00:00
Stephan Aßmus
939fb4077c fix scrolling of BViews that rely on app_server painting the background, remove a forgotten debug output in ViewLayer, reimplemented setting the window title during runtime, fix Decorator redraw on pressing buttons - though I was lazy on that one... it works, but as the TODOs say, it would be better integrated directly in the Decorator class than being handled by WindowLayer
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15429 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-12-08 22:15:12 +00:00
Axel Dörfler
72994381f2 Windows currently being dragged now follow workspace switches.
Desktop::_ChangeWindowWorkspaces() and SetWorkspace() didn't lock the window list,
but should have.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15421 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-12-08 14:45:42 +00:00
Axel Dörfler
799c100e79 That would be a bug indeed.
* ShowWindow() and HideWindow() now also work correctly for windows not
  on the current workspace.
* Reverted WindowList::RemoveWindow() - if it is used wrongly, it should
  better crash the server for now, so that we can iron out the bugs.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15420 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-12-08 13:32:54 +00:00
Axel Dörfler
e83820ed57 Merged app_server_new_clipping branch changes r15290 to 15418 back into trunk.
Also fixed Jamfile for the test environment.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15419 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-12-08 12:41:19 +00:00
Axel Dörfler
c072e9f1f5 * BWindow::AddToSubset()/RemoveFromSubset() no longer send their team ID; this
is known by the server, anyway.
* B_MODAL_SUBSET_WINDOW_FEEL now also works as expected.
* Renamed AS_REM_FROM_SUBSET to AS_REMOVE_FROM_SUBSET.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15285 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-12-02 16:07:02 +00:00
Axel Dörfler
b2d24b66da * B_MODAL_APP_WINDOW_FEEL windows now also work correctly.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15284 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-12-02 15:48:21 +00:00
Axel Dörfler
4c0269b979 * WindowLayer::OnWorkspace() should now work correctly for all window feels.
* introduced ServerApp::OnWorkspace().
* moved AS_CREATE_[OFFSCREEN_]WINDOW into its own method, ServerApp::_CreateWindow().


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15283 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-12-02 15:42:28 +00:00
Axel Dörfler
48ccf5abef Some work to get modal/floating windows back:
* B_{FLOATING|MODAL}_ALL_WINDOW_FEEL now works as expected
* reintroduced the concepts of subsets of modal/floating windows - does only
  work correctly for subset "all" window feels.
* RootLayer::_SetFront() now deals correctly with modal windows
* renamed RootLayer *WindowLayer() methods to *Window()


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15282 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-12-02 15:06:14 +00:00
Axel Dörfler
fc21e33e46 * B_NOT_H_RESIZABLE/B_NOT_V_RESIZABLE are now correctly supported by the decorators.
* Introduced methods WindowLayer::IsModal() and IsFloating().
* Invalid flags for the current feel are now filtered out, like B_AVOID_FOCUS for
  modal windows.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15280 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-12-02 10:35:01 +00:00
Axel Dörfler
42e1c25d01 "Oops, I did it again": AS_SET_FLAGS returned B_BAD_VALUE on valid flags
and B_OK on invalid.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15273 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-12-01 18:35:38 +00:00
Axel Dörfler
aecd5eefaf * the check for a valid feel was wrong, reported by Michael Lotz.
* also followed Michael's suggestion (more or less) and moved the
  look/feel/flags checks into separate methods.
* on construction, invalid look/feel/flags values are now corrected.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15269 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-12-01 15:58:04 +00:00
Axel Dörfler
6b86db1c42 Changing window flags that affect the look does now also work more or less fine.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15268 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-12-01 15:02:11 +00:00
Axel Dörfler
85f8bb71c7 * You can now change the look of a window on the fly.
* renamed some Decorator functions like GetLook() to Look().
* renamed _look to fLook and _flags to fFlags.
* removed the feel from decorators - they don't need to know
  or care about the feel.
* the DefaultDecorator didn't allow resizing of modal windows.
* DefaultDecorator::SetTitle() no longer clears the passed
  in updateRegion, it just fills it (so that you can call
  more than one of these methods after the other, and still
  get a correct update region).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15266 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-12-01 14:56:01 +00:00
Axel Dörfler
57be286609 * when moving/resizing windows on another workspace, the Workspaces window
has to be udpated anyway.
* some work towards being able to set a window's look/feel/flags on-the-fly.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15265 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-12-01 13:59:04 +00:00
Axel Dörfler
5d32708515 Implemented B_AVOID_FOCUS support.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15262 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-12-01 12:31:05 +00:00
Axel Dörfler
85096c8acb Some cleanup:
* look/feel are now window_look/window_feel instead of int32.
* removed the level stuff, I don't think this is needed.
* some other minor stuff.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15261 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-12-01 12:07:28 +00:00
Axel Dörfler
649e929c7a Added drawing the window titles to the Workspace window - but I disabled
it, as it slows down window moving noticeably.
To provide a good Workspaces window functionality, we should probably let
WindowLayer take care of the updates itself - that would simplify the whole
thing a lot.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15260 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-12-01 11:43:04 +00:00
Axel Dörfler
a1d0e588b9 Another use of clipping regions to eliminate flickering. Maybe I have to come
up with something better though, when the window titles are drawn as well...


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15259 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-12-01 10:41:01 +00:00
Axel Dörfler
19d801a6b6 Moving/resizing is now routed over the desktop as well.
This also allows the workspaces layer for these actions, which is now done as well.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15258 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-12-01 10:31:30 +00:00
Axel Dörfler
a8b49ab310 Implemented AS_COUNT_WORKSPACES and AS_SET_WORKSPACE_COUNT server side.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15253 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-11-30 22:48:13 +00:00
Axel Dörfler
5ca8477eca * the Workspace class is now hidden and put into Workspace::Private; the new
Workspace class is a simple accessor to this class that takes care about
  locking (currently, it's just the desktop lock, maybe it'll stay that way).
* WorkspacesLayer now displays the window thumbs again.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15250 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-11-30 19:56:44 +00:00
Axel Dörfler
ed656a3a9b You must not have RootLayer locked when calling any method from EventDispatcher;
just another case of troublesome generic RootLayer locking in ServerWindow
(I'm looking forward to get rid of this).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15249 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-11-30 19:51:43 +00:00
Axel Dörfler
dd43887c95 Forgot to remove the Unlock(), thanks to Stephan for pointing this out.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15242 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-11-30 16:22:18 +00:00
Axel Dörfler
a631158a62 Reenabled most of the workspaces functionality - the Workspaces window doesn't
show any windows, but everything else seems to work fine.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15241 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-11-30 15:47:01 +00:00
Axel Dörfler
92766f93e2 EventDispatcher::_Unset() did not wait for the event looper thread under BeOS, as
wait_for_thread() always returns B_BAD_ADDRESS when the second argument is NULL
(it works fine under Haiku).
Instead of enqueuing a B_QUIT_REQUESTED message, InputStream now directly quits
when the 'quit' code is read from the port (B_QUIT_REQUESTED was never handled
by the event loop either, it just didn't get noticed because of the wrong
wait_for_thread() usage).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15240 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-11-30 15:31:33 +00:00
Axel Dörfler
66fdfb907b Some preparations to reactivate the workspace feature.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15239 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-11-30 11:19:20 +00:00
Axel Dörfler
15918e4fa5 * new windows now get a fake B_MOUSE_MOVED message in case they are opened
directly under the mouse cursor.
* Added Desktop::ShowWindow() and HideWindow().


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15238 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-11-30 10:45:01 +00:00
Axel Dörfler
a9b83b752c Added a bit of documentation to the EventDispatcher.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15229 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-11-29 17:00:08 +00:00
Axel Dörfler
f89b4c9a23 Have I said input event handling is done?
* didn't realize that mouse events always go to the view under the mouse, not
  only if its the focus window (FFM can really do harm, after all :-)).
* removed a TODO from the list: EventDispatcher::Target is now a public
  class EventTarget, and every ServerWindow has one.
* as a result, EventDispatcher no longer manages targets itself, it
  just maintains a list of them. You no longer set messengers, you
  only set targets.
* customization of the message filters, they no longer inherit from
  BMessageFilter (but EventFilter).
* a message target is no longer set explicetly anywhere, it's only
  changed in the message filters if needed.
* therefore, no more locking mess in the EventDispatcher needed.
* this also made the EventDispatcher::fLastFocus stuff superfluous.
* moved the RootLayer::MouseEventHandler() into the message filter.
* Replaced RootLayer::_ChildAt() with WindowAt().
* WindowLayer now has an idea if it has focus or not, it no longer needs
  to query the RootLayer for this - maybe we should rename "focus" to
  "active", though (as far as layers are concerned).
* the "_view_token" data is now added from the EventDispatcher, not
  the (Window)Layer class anymore.
* removed Layer::MouseWheelChanged() as we currently don't need it
  (if the need arises, we can add it back later again)
* there is still no mouse moved message sent when opening a window
  under the cursor, though...


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15228 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-11-29 16:01:41 +00:00
Axel Dörfler
27adb96962 Massive RootLayer & Workspace tearing:
* workspace switch and subset windows functionality temporarily removed
  (away with that mess!).
* no more RevealWMState() - we now have methods like ActivateWindow()
  and SendWindowBehind() that do all the work - just a little cleaner
  and with less overhead.
* Workspace is now a pretty passive class - it only stores configurations
  of the windows and screens.
* added an evil work-around for a locking problem (in RootLayer::_SetFocus()).
* I'll plan to move pretty much all of the remaining root layer functionality
  to Desktop - so that the all regions lock is only held in case clipping
  regions are affected.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15207 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-11-28 23:36:59 +00:00
Axel Dörfler
8fc80f17d9 refactored a _AddChildToList() and a _RemoveChildFromList() out of AddChild() and
RemoveChild() (very similar to what BView does).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15206 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-11-28 23:27:20 +00:00
Jérôme Duval
ae0a90cedb SetAppCursor also sets cursor status
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15205 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-11-28 23:13:16 +00:00
Axel Dörfler
3f5eacff02 Quick and dirty hack to let those font rendering problems disappear - I don't really
know what's going on, but this appears to fix it. And since we'll get a new glyph
layout backend sooner or later, I don't want to mess with that stuff again.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15176 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-11-26 22:26:50 +00:00
Axel Dörfler
a7b93468cc SendMessageToClient() now gives a little more info in case sending failed.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15174 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-11-26 20:35:58 +00:00
Axel Dörfler
485b948731 Removed "Active" stuff from Workspaces state.
As a side effect, the desktop is now clickable again.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15173 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-11-26 20:22:30 +00:00
Axel Dörfler
df36243372 Now sends B_SCREEN_CHANGED messages to all windows when the screen resolution changes.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15167 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-11-26 16:56:52 +00:00
Axel Dörfler
6e9ab86fc5 Added a ColorSpace() method.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15166 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-11-26 16:55:23 +00:00
Axel Dörfler
26b02ddc80 The input_server is now notified when the screen resolution is changed.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15165 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-11-26 16:22:06 +00:00
Axel Dörfler
b635c022cb Don't check if the requested display mode is in the mode list - just ask the
graphics add-on if it can handle it.
This fixes setting the screen resolution natively. Unfortunately, that's not
all (the input_server still constraints the cursor position to the previous
resolution...). Also, there is apparently no B_SCREEN_CHANGED sent.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15164 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-11-26 15:52:22 +00:00
Axel Dörfler
39b345c7b6 Added temporary hack so that windows don't get mouse messages if the cursor
is not over them - this should be better integrated with the rest of the
code (later, when we don't rely on RootLayer for everything anymore).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15151 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-11-25 16:11:19 +00:00
Axel Dörfler
fa2c53ed52 Added very simple and annoying profiling mechanism to ServerWindow's message
processing (enabled when PROFILE_MESSAGE_LOOP is defined).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15150 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-11-25 15:35:47 +00:00
Axel Dörfler
67e79bf45a A message looper can now have a death semaphore, ServerWindow now uses them.
ServerApp now waits up to 3 seconds for windows before killing them - it now
waits on the death semaphore, and only kills a window if it didn't quit fast
enough.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15147 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-11-25 13:49:29 +00:00
Axel Dörfler
85d981378a Quick fix for our broken locking model:
The mouse filter needs to lock RootLayer, but the event dispatcher lock is held
during that time, too, so that the focus cannot change in the mean time.
On the other side, ServerWindow needs to lock the event dispatcher when adding
or removing a listener, or for AS_GET_MOUSE - but since it always helds the
root layer lock during message dispatching this easily resulted in a deadlock.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15146 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-11-25 12:50:21 +00:00
Stephan Aßmus
23f32b1552 corrected and cleaned up coordinate conversion. conversion from or to parent coords doesn't actually require a parent, directly using fScrollingOffset, uses less stack memory now and should be faster (especially when converting regions, because those were offsetted twice)
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15136 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-11-24 21:23:33 +00:00
Axel Dörfler
1863b5b6a4 Removed the "owner" stuff from Layer - it already knows its window.
Layer no longer knows anything about its subclass WindowLayer.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15131 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-11-24 17:59:49 +00:00
Axel Dörfler
14e1abfe7d Made Layer::_AllRedraw() virtual so that it doesn't need this ugly hack to
send _UPDATE_ messages (WindowLayer now overrides that method).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15129 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-11-24 17:54:14 +00:00
Axel Dörfler
4b813bf267 Renamed WinBorder to WindowLayer, and OffscreenWinBorder to OffscreenWindowLayer.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15128 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-11-24 17:45:26 +00:00
Axel Dörfler
2430abdd9a Some minor cleanup.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15127 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-11-24 17:12:32 +00:00
Axel Dörfler
0a9634a6f4 Minor cleanup: removed unused stuff.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15126 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-11-24 16:55:17 +00:00
Axel Dörfler
5afc064831 In anticipation of Stippi's new clipping code, I refactored the EventDispatcher
a bit:
* listeners are now managed per target (ie. per messenger) (by the Target class)
* therefore, the fFocusTokens/fLastFocusTokens lists are no longer needed; every
  Target knows its listeners already.
* this also fixes the obvious bug that the focus window's views would get both
  keyboard and pointer events, no matter which of them they originally wanted.
* renamed event_target to event_listener (there was actually a mix up in naming
  before - to the outside it was "listener", and internally, "target" was used)
* WinBorder::MouseMoved()/MouseUp() now also add the view token to the message;
  the messages weren't received by the target before (unless the view used
  tracking via BView::SetMouseEventMask()...) - maybe the client should only
  update fLastMouseMoved on B_MOUSE_MOVED events, and direct B_MOUSE_UP/DOWN
  (plus wheel changes) always to fLastMouseMoved...
* some cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15123 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-11-24 16:04:29 +00:00
Axel Dörfler
5d29bfa5fa * Moved change_winBorder_feel() into GoChangeWinBorderFeel() and removed the former.
* Renamed GoChangeWinBorderFeel() to ChangeWinBorderFeel().


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15114 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-11-24 13:26:26 +00:00
Axel Dörfler
bde8b9c6e0 * Layers are now put into an application wide token space that mirrors the
client's token space.
* finding layers by token is now O(1) instead of O(n) (as they are looked
  up in the token space).
* removed Layer::FindView() as it's no longer needed (or should be used).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15113 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-11-24 13:14:49 +00:00
Axel Dörfler
46b7964e5c Got rid of "cnt" debugging stuff.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15110 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-11-24 12:22:55 +00:00
Axel Dörfler
343e4ff465 Got rid of fAdFlags whatever that was meant to be.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15109 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-11-24 12:21:07 +00:00
Axel Dörfler
5ed0556236 * Got rid of the frightening Layer::fCurrent/RootLayer::fWinBorderIndex as well as
NextChild() and PreviousChild() - the current WinBorder list is now rebuilt on every
  change; this is not perfect, and only a temporary solution (but cleaner than the
  previous one).
* Introduced Layer::PreviousLayer()/NextLayer() methods that return the previous resp.
  the next sibling.
* Moved {show|hide}_winBorder() into {Show|Hide}WinBorder() and got rid of the former.
* Renamed Layer::fServerWin to fWindow.
* removed some unused stuff, minor cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15108 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-11-24 12:19:11 +00:00
Axel Dörfler
5a67ef6634 Removed broken Layer::LayerAt() semantics (for recursive == false),
and introduced a RootLayer::_ChildAt() that is used instead.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15097 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-11-23 22:01:49 +00:00
Axel Dörfler
a8d44b6fea Quick fix for the broken focus changing I introduced earlier.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15096 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-11-23 21:52:36 +00:00
Axel Dörfler
6450b76dd4 Next big step in the event handling:
* RootLayer's mouse event processing is now at its minimum - the
  EventDispatcher handles them now. As a result, a window will now
  get only one message per event.
* RootLayer adds "_view_token" to mouse moved messages that specify
  the view currently under the cursor.
* There is now a mouse event layer in RootLayer that gets preferred
  when it's set - this is now used for the window moving instead of
  the previous mechanism.
* changed the previous DistributeMessage() to an UnpackMessage()
  method following Adi's suggestion.
* caveat: some things might be functionally broken in RootLayer now
  because of removing the mouse notification stuff.
* "be:transit" handling is now done completely client side by
  BWindow::_SanitizeMessage(() (similar to what the input_server does).
  This should also make the mechanism pretty robust, since every
  B_MOUSE_MOVED message can now trigger the view transit (in case a
  message is lost). B_WINDOW_ACTIVATED messages should be generated
  client side as well.
* renamed AS_LAYER_GET_MOUSE_COORDS to AS_GET_MOUSE as it's not a
  layer specific command, and also gets the mouse buttons.
* B_MOUSE_* messages from the up server now contain only a "screen_where"
  field; "where" (in window's coordinates) and "be:view_where" are
  added in BMessage::_SanitizeMessage().
* messages that don't have a valid target in the looper are now
  dropped instead of being sent to the looper - this should be done
  in BLooper as well, though.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15087 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-11-23 15:17:58 +00:00
Axel Dörfler
876a3803df * removed adding "be:transit" stuff in the EventDispatcher - this is now only done
client side (or will be, with the next commit).
* added GetMouse() functionality.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15084 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-11-23 11:27:09 +00:00
Axel Dörfler
b361534e3c Filter out some fields in the message that we may set ourselves.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15078 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-11-22 20:34:02 +00:00
Axel Dörfler
b095201503 * changed the way a message is forwarded to the focus view (instead of adding
a suspend focus field to the message, there is now a "feed focus" field in
  case the message should be forwarded).
* added a comment to the BPoint version of _FindView() (since it's broken)
* _DistributeMessage() is now called after _DetermineTarget() - so that it
  can prevent sending the message twice to the focus view.
* removed BWindow::DoUpdate() as it's no longer used.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15066 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-11-22 12:49:35 +00:00
Axel Dörfler
82d8744887 * now all event targets of the focus window get into the focus list - that
way, we always send only one message per event, no matter how many targets
  there are in the window (the focus event list was not always maintained
  correctly before, too).
* the current mouse filter eats all B_MOUSE_UP events, and therefore, the
  temporary event targets were never removed.
* changed the way BWindow::_DistributeMessage() recognizes if it should forward
  the event - not yet final, though.
* naming is now more consistent (events -> event_mask).
* some minor cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15058 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-11-21 16:25:23 +00:00
Axel Dörfler
51a16ce830 No longer needed.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15049 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-11-20 17:26:25 +00:00
Axel Dörfler
4ceb1e519c * reverted Adi's premature changes to BWindow and restored _DetermineTarget() and
task_looper() again.
* removed BMessenger::fPreferred - whenever you had to specify "usePreferred" separately,
  you don't have to do that anymore - use B_PREFERRED_TOKEN instead.
* fixed BTokenSpace::GetToken() semantics: it will no longer touch the "object" argument
  in case of failure.
* Introduced a BWindow::_DistributeMessage() that will be part of the event dispatcher
  counterpart to the app_server (the other will be _DetermineTarget()).
* Made it easier to use Michael's Message4 implementation: just add the following line
  to your UserBuildConfig:
	AppendToConfigVar DEFINES : HAIKU_TOP src : USING_MESSAGE4 : global ;
* Introduced ServerWindow::HandlerMessenger() and FocusMessenger() - the first will
  target the client handler, while the other will target the preferred handler of the
  client looper (usually the view having focus).
* Fixed dano message unflattening in the Message4 code.
* Changed BMessage::PrintToStream() to no longer use macros in the Message4 implementation.
* I hope that's all - it's a huge change, but it's all connected.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15046 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-11-20 16:24:23 +00:00
Axel Dörfler
d1071ff01b Removed Utils.cpp - it's not really useful anymore.
Note, I temporarily kept the Utils.h in, because I have other local changes to be
committed soon (sorry for this, but it shouldn't harm).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15043 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-11-20 16:09:16 +00:00
Axel Dörfler
ae3ba51fc1 Some minor fixes.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15042 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-11-20 16:03:11 +00:00
Axel Dörfler
ece36066af Removed third argument from calls to ServerWindow::SendMessageToClient() - it's predefined
to "false" anyway, and will be removed shortly.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15041 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-11-20 15:52:48 +00:00
Stephan Aßmus
b223f78041 fixes origin and scale handling, it behaves mostly like R5 now (it is used for drawing only, yes not mouse coords or anything else). Also fixes offscreen layers clipping rebuilding when the user defined clipping is added or changed
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15040 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-11-20 15:10:18 +00:00
Adi Oanca
2899b880f6 Uncommented a correct piece of code. B_FRAME_RESIZED/MOVED are sent more accurately. Renamed AddToViewsWithInvalidCoords, SendViewCoordUpdateMsg into _AddToViewsWithInvalidCoords, _SendViewCoordUpdateMsg.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15036 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-11-19 21:16:57 +00:00
Adi Oanca
8e81fc4919 Some cleanup. Removed do_Hide, do_Show and do_CopyBits
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15034 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-11-19 18:25:27 +00:00
Axel Dörfler
55d6d70ee5 * EventDispatcher::AddListener() now honors the BView semantics and will only
update the options in case the specified eventMask was zero.
* Added missing EventDispatcher::RemoveTemporaryTarget().
* Layers setting their event mask are now added to the EventDispatcher.
* The RootLayer is no longer contacted for SetEventMask() - it still handles
  SetMouseEventMask(), tough - as a result, SetEventMask() temporarily doesn't
  work anymore.
* Added Layer::ViewToken() method.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15023 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-11-18 15:50:30 +00:00
Ingo Weinhold
63ea9a2870 Missing "using std::nothrow".
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15021 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-11-18 14:20:38 +00:00
Axel Dörfler
6b95c59bd8 Renamed myRootLayer variable to rootLayer.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15019 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-11-18 13:56:35 +00:00
Axel Dörfler
fa26723bb2 * Moved workspace keyboard switch and dump screen capability from RootLayer
into a Desktop keyboard filter.
* Removed keyboard handling code from RootLayer and Layer.
* Renamed Desktop::ActiveRootLayer() to RootLayer() as there is only one
  root layer per desktop.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15018 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-11-18 13:51:32 +00:00
Axel Dörfler
f68598780e * the keyboard events are now using the new EventDispatcher, B_KEYBOARD_EVENTS don't
work yet, though, as the dispatcher is not yet notified about those.
* no more mouse cursor jumping - the cursor will now start in the middle of the screen;
  this should be part of the initial input_server handshake, though.
* ServerWindow can now return a BMessenger of its client window.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15017 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-11-18 13:21:07 +00:00
Axel Dörfler
8d8f5950d0 Some cleanup, mostly GetHWInterface() to HWInterface().
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15016 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-11-18 12:26:20 +00:00
Axel Dörfler
1b120ea94a Turns out there were a couple of problems:
* RootLayer still set the mouse cursor...
* mixed up "x" and "y" in the cursor thread
* but that didn't get noticed, as B_RELEASE_ALL doesn't seem to work
  (will look into that next)!

The cursor finally works as good as expected in Qemu :-)


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15013 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-11-18 11:50:34 +00:00
Axel Dörfler
f759822327 * the new input event dispatcher is now actually used, although it doesn't
distribute any messages to the clients yet.
* removed the working thread from RootLayer - for now, its event handlers are
  still called using input filters in the new event dispatcher, though (to
  get things started).
* ServerApp is now using a BMessenger to identify its client, and no longer
  stores the port/token separately.
* the input_server handshake is a bit simpler now, as it can now just reply
  to the app_server message, removed unused code from ServerProtocol.h
* calmed down the MultiLocker (it always printed thread statistics on startup,
  because it's compiled in debug mode).
* removed the cursor thread stuff from AppServer.cpp
* the new event dispatcher now uses a cursor thread when supported (only in
  native mode, not in the test environment), although it improves cursor
  movement under Qemu, the effect is not as good as expected - this might
  need some more investigations (might just be a thread priority problem).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15012 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-11-18 11:30:06 +00:00
Axel Dörfler
b9e43e2c12 Just another manager - not yet used, though.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15011 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-11-18 09:43:37 +00:00
Axel Dörfler
0307fbb17d Implemented support for Set[Mouse]EventMask() functionality - still untested, though.
Also supports the B_SUSPEND_VIEW_FOCUS options, B_NO_POINTER_HISTORY is not yet there,
and B_LOCK_WINDOW_FOCUS has to be implemented somewhere else (its outside of the
scope of this class).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15007 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-11-17 18:46:55 +00:00
Axel Dörfler
0e29f57a22 Fixed the app_server build in the test environment.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15005 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-11-17 18:43:08 +00:00
Axel Dörfler
afe5450a83 * Fixed the most obvious copy&paste bugs.
* no longer allocates focus messengers on the heap but keeps them around.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14992 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-11-17 16:08:04 +00:00
Axel Dörfler
08f35604b0 The basics of the new event handling - not yet connected to anything, and therefore
neither used nor tested. It's not even complete yet (support for Set[Mouse]EventMask()
is missing), but it will get there :)


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14990 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-11-17 14:58:19 +00:00
Axel Dörfler
6226d5f7cd The Desktop's message port now gets the same name as its looper.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14988 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-11-17 14:56:12 +00:00
Axel Dörfler
aabcf63973 When using "Message4", we don't need to flatten the BMessage into another buffer anymore.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14956 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-11-16 14:34:56 +00:00
Stephan Aßmus
02ed46b0de * fixes the cursor handling after Axels changes, it crashed on real HW.
Axel, I think you didn't realise that _CursorFrame() gave and
invalid BRect for fCursorVisible=false, but that rect was used
to create the backup area, so it was buggy at that place. I removed
your checks for fCursorVisible in SetCursor() for cleaner code, but
left it in MoveCursor() because it might save a few cycles.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14954 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-11-16 10:29:06 +00:00
Axel Dörfler
6c17d02551 * Introduced a new handshake between input_server and app_server, and some
temporary handling code in the app_server.
* RootLayer no longer creates the input_server messaging port - this is now
  the responsibility of the input_server.
* Moved AS_CREATE_[OFFSCREEN_]WINDOW from ServerApp::_MessageLooper() to
  _DispatchMessage().
* The RootLayer thread is now started as soon as the input_server is there.
* removed or disabled any input_server stuff in the AppServer class.
* removed old message commmands to the app_server.
* Removed the R5_CURSOR_COMM and HAIKU_APPSERVER_COMM definitions: the
  input_server is now automatically built correctly depending on the target.
* InputServer::EventLoop() plays now safe and checks for error conditions.
* InputServer::EnqueueDeviceMessage() seems to leak memory, added TODO about
  this.
* InputServer event loop messaging uses ports for inner-app communication - why?
* The InputServer event loop thread is no longer killed on exit, it just quits
  when its port is gone.
* Minor cleanup in input_server.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14949 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-11-15 19:59:53 +00:00
Axel Dörfler
af8899c4bf Added support for not visible cursors - defaults to invisible now!
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14948 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-11-15 19:50:19 +00:00
Stephan Aßmus
8f90c77db9 a quick fix for offscreen layers drawing region, ie BitmapDrawing works again
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14937 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-11-15 11:18:33 +00:00
Stephan Aßmus
a7ab4a2642 fix activation of windows
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14933 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-11-15 01:42:58 +00:00
Axel Dörfler
f375b21da5 Forgot to remove IPoint.h - it's no longer needed.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14926 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-11-14 19:48:16 +00:00
Axel Dörfler
be05d56c7e * the app_server now uses a global token space - this should later be changed to
have different token spaces depending on the scope of its objects.
* removed TokenHandler - we're now using BTokenSpace instead.
* removed unused IPoint.cpp - if we ever need it again, it can still easily be
  resurrected from the dead.
* some cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14925 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-11-14 19:46:20 +00:00
Axel Dörfler
614de12d9c * the decorator knows best which region to update when changing the title, so
it must now fill the updateRegion parameter of SetTitle().
* WinBorder::SetName() is now greatly simplified and achieves better results
  due to that.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14923 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-11-14 18:16:01 +00:00
Adi Oanca
9a3090b0ed this fixes the problem Axel signaled with the OK button in terminal's about box
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14922 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-11-14 18:10:54 +00:00
Axel Dörfler
a436bab2da Renamed fVisible2 and fFullVisible2 to fVisible and fFullVisible.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14921 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-11-14 17:56:51 +00:00
Axel Dörfler
5df853ea79 * Renamed Layer::GetWantedRegion() to GetOnScreenRegion().
* minor cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14920 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-11-14 17:50:39 +00:00
Axel Dörfler
618c515c4c * pruned Layer::PruneTree()
* the Layer destructor now deletes all of the layer's children
* WinBorder no longer has to delete its top layer, as it's also its child.
* minor cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14919 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-11-14 17:39:33 +00:00
Axel Dörfler
b66d753712 * Prepared the BScreen and BPrivateScreen class to be used with multiple monitors.
* BPrivateScreen now buffers its frame for 0.1 seconds (so that calling it several
  times in a row is both consistent and cheap).
* Added GetFrameBufferConfig() call to the HW interface (and implemented it).
* Added server commands AS_VALID_SCREEN_ID, AS_GET_NEXT_SCREEN_ID, and
  AS_GET_FRAME_BUFFER_CONFIG.
* BPrivateScreen::BaseAddress() and BPrivateScreen::BytesPerRow() are now working.
* minor cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14915 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-11-14 14:36:12 +00:00
Axel Dörfler
d9525baaf5 * Forgot to update Screen.h with the last commit...
* Introduced and implemented AS_GET_SCREEN_ID_FROM_WINDOW - it only returns B_MAIN_SCREEN_ID,
  though.
* renamed ServerWindow::fHandlerToken to fClientToken.
* The BScreen(BWindow *) constructor now really asks the server for the screen ID.
* ServerApp::fWindowList is now a BObjectList.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14910 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-11-14 12:08:21 +00:00
Axel Dörfler
a817d6ad5a * (tried to) implemented RootLayer::ResizeBy() and activated AS_SET_SCREEN_MODE again;
it works in the test environment, but I haven't yet tested it on real hardware.
* moved PrivateScreen.h to src/kits/interface/ - it's not used outside of that one.
* moved reading the color map from the BPrivateScreen constructor to the ColorMap()
  method.
* improved/cleaned server/client communication for the screen stuff a tiny bit.
* fixed the GetBitmap() method I implemented yesterday.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14908 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-11-14 11:01:02 +00:00
Stefano Ceccherini
d2718b5d34 we write family and style as an uint32, so we should read it as an uint32 too
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14906 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-11-13 21:54:41 +00:00
Axel Dörfler
8bd2c11fc4 Moved the declaration of roundf() to HaikuBuildCompatibility.h - it's missing from
math.h but exported by libroot.so.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14903 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-11-13 19:43:42 +00:00
Axel Dörfler
8b794301de Changed the way the app_server is built:
* no more libappserver.so - this breaks the "Appearance" application, but that
  has to be fixed some day later.
* the drawing stuff is now built in its own directory as libasdrawing.a.
* TEST_MODE defaults to "0" if not defined yet - it's overridden in the test
  build now, not in the main build.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14896 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-11-13 15:40:21 +00:00
Axel Dörfler
96709e443e One more now superfluous roundf() removed.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14895 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-11-13 14:09:55 +00:00
Michael Lotz
cf10934e5f Introducing Message4. The changes to the related sources are ifdefed with USING_MESSAGE4 which is defined in Message4.h. To use Message4 the Message4.cpp, Message4.h, MessageUtils4.cpp, MessageUtils4.h and MessagePrivate4.h have to be linked to their counterparts without 4 suffix. Then MessageBody.cpp and MessageField.cpp have to be commented out in the app kit Jamfile and r5_message.cpp has to be added. There remain some bugs to be found. Feel free to change that.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14882 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-11-13 11:31:07 +00:00
Stephan Aßmus
4cfc480f5d no longer valid with new way of setting user clipping
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14881 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-11-13 00:24:37 +00:00
Ingo Weinhold
758b1d0e05 Fixes that make Haiku build with gcc 4. Mainly out of the following
categories:
* Missing includes (like <stdlib.h> and <string.h>).
* Linking against $(TARGET_LIBSTDC++) instead of libstdc++.r4.so.
* Local variables shadowing parameters.
* Default parameters in function definitions (as opposed to function
  declarations).
* All C++ stuff (nothrow, map, set, vector, min, max,...) must be imported
  explicitly from the std:: namespace now.
* "new (sometype)[...]" must read "new sometype[...]", even if sometype is
  something like "const char *".
* __FUNCTION__ is no longer a string literal (but a string expression), i.e.
  'printf(__FUNCTION__ ": ...\n")' is invalid code.
* A type cast results in a non-lvalue. E.g. "(char *)buffer += bytes"
  is an invalid expression.
* "friend class SomeClass" only works when SomeClass is known before.
  Otherwise the an inner class with that name is considered as friend.
  gcc 4 is much pickier about scopes.
* gcc 4 is generally stricter with respect to type conversions in C.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14878 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-11-12 23:27:14 +00:00
Ingo Weinhold
56436a1ab8 GCC 4 fix. Might have changed the semantics, but I refuse to hurt
my brain by trying to understand code using gotos. People, learn
structured programming!


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14870 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-11-12 17:49:05 +00:00
Stefano Ceccherini
25922abe74 reduced the directwindow semaphore timeout to half a second. Now we checks for < B_OK in the semaphore acquisition, to handle every error condition
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14860 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-11-12 11:00:57 +00:00
Axel Dörfler
2b7b3ade5c Added more or less empty "begin/end transaction" handling in ServerWindow.
Right now, only the updates are disabled as a start. I am not sure what else
we can do here, but there probably is something :-)


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14855 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-11-11 14:25:12 +00:00
Axel Dörfler
dfd5b49996 * last change set window title to "Unnamed Window" if the title was empty - but
that's probably not wanted, as a window without a title is perfectly okay.
* AS_CREATE_WINDOW will now return a proper error code on failure.
* The title read from the link is no longer adopted by the ServerWindow constructor,
  but copied - while the previous version was a bit faster, this is a lot cleaner.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14851 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-11-11 13:06:22 +00:00
Axel Dörfler
13e525e302 WinBorder::SetName() now also triggers rebuilding the decorator region - IOW BWindow::SetTitle()
should now work as expected.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14849 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-11-11 11:03:33 +00:00
Stefano Ceccherini
df555388b9 Don't look for bugs in other people's code. The bug is in your code. IOW BDirectWindow apps now work fine :)
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14848 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-11-11 00:45:45 +00:00
Stephan Aßmus
c5522d81d8 * added SetUserClipping() and DrawingRegion(), which is used for
handling client defined clipping. The client clipping stays in local coords,
  which greatly simplyfies things. We ought to find a way to reduce the number
  of regions needed per Layer. I just added another one...
* renamed a few "lay"s to "child".
* used the new client added clipping in ServerWindow


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14847 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-11-11 00:19:32 +00:00
Stephan Aßmus
41f78f7884 the current clipping is the combined user defined clipping from all previous states
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14846 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-11-11 00:14:58 +00:00
Stefano Ceccherini
b2cc1487d1 Send notifications for directwindow when a window is moved
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14843 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-11-11 00:10:03 +00:00
Axel Dörfler
8f5f0ec4b1 * fixed case for WinBorder::MouseDown() if there is no layer below the mouse - might
not even be a valid condition, but seems to happen.
* style cleanup...


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14841 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-11-10 22:30:43 +00:00
Adi Oanca
e2ad4ab9b2 Not in mood for too much coding, I had a look through the code tonight. And guess what? Like Stefano
the other day, I discovered, not a bug, but how to invalidate only the area that requires it when
changing window order (selecting or moving to back a window). Stuppid me, that stuff didn't worked
because I forgot how windows were arranged in the list returned by Workspace::GetWMState(). I was
iterating the wrong way! :-)



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14839 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-11-10 21:52:59 +00:00
Axel Dörfler
0964291534 Added message filter to the CardView; it now intercepts all messages, so that "Command-Q"
will no longer quit the haiku_app_server, but the application running in the server.
"Print Key" now also works as expected.
Only switching workspaces continues to use "Control-Fx" in the test environment. Under
Haiku, it now uses "Command-Fx" as on BeOS.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14834 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-11-10 18:37:55 +00:00
Axel Dörfler
c12196d47b * Removing fonts now works as expected.
* removing a font family or style now always goes through the font manager.
* removed FreeType "cache" remains (it wasn't used, anyway, and won't be used
  by us).
* renamed SharedObject to ReferenceCounting as that's what it does.
* the default fonts weren't deleted on shutdown.
* added temporary work-around for waiting until a newly created entry is complete
  (just waits a moment...) - this will be fixed once Haiku supports this in a
  better way.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14833 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-11-10 17:32:35 +00:00
Axel Dörfler
831a01f893 FontStyles are now also orded, but not alphabetically: their faces determine
the order, regular fonts come first, then bold, and then italics.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14828 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-11-10 15:48:37 +00:00
Axel Dörfler
36a37b76d6 The font family list is now sorted - besides the obvious advantage for the user,
this also allows binary searching the families (which is now done, too).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14826 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-11-10 15:33:18 +00:00
Axel Dörfler
2522a90fd1 Even more font stuff:
* the node monitor is now working - fonts can only be added yet, though
* deleting a FontFamily did not work before, as the last style to be
  removed tried to delete the family again.
* "luckily", FontFamilies and FontStyles were not deleted at all before.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14824 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-11-10 14:52:26 +00:00
Axel Dörfler
174b20a89a Adds the concept of owning the table entries - before, they were always owned,
now it defaults to not-owning.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14823 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-11-10 14:49:24 +00:00
Stephan Aßmus
5211328a37 turn off on-screen debugging for now, the errors it reported are not that critical, and printing the debug info itself could lead to problems
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14820 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-11-10 13:38:22 +00:00
Stephan Aßmus
0d660a960b handle errors when reading from the link, at least for the bigger items, it should be enough to just check the error in the last call to Read(), since previous errors are kept in the Link
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14819 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-11-10 13:37:08 +00:00
Axel Dörfler
7c3d8ad0c7 * added a call to png_set_strip_alpha() which could fix the alpha channel
problem we're seeing (at least I couldn't reproduce the problem anymore).
* SaveToPNG() now returns an error code.
* cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14813 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-11-09 23:52:27 +00:00
Adi Oanca
76d68e8ad8 More cleanup.
* moved code from Layer::do_MoveBy/do_ResizeBy/do_ScrollBy into
Layer::MoveBy/ResizeBy/ScrollBy()
* removed do_Move/Resize/ScrollBy()
* removed WinBorder::_ResizeBy()




git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14810 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-11-09 20:14:52 +00:00
Axel Dörfler
90dfa70739 * ServerFont now also adopts the FontStyle's face and direction on
construction.
* ServerFont::SetStyle() now adopts the style's face and direction, too.
* Started a more sane handling of ServerFont::SetFace() (at least there's
  a to-do comment :-)).
* Minor cleanup (GetStyle() -> Style(), GetFamily() -> Family(),
  GetPath() -> Path()).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14809 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-11-09 20:10:40 +00:00
Axel Dörfler
2fe84ae95f Now AS_GET_DEFAULT_SYSTEM_FONT actually returns the default font as used
by the app_server (ie. also if it's a fallback font).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14805 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-11-09 19:22:21 +00:00
Axel Dörfler
974dd00c85 The font manager now has default fonts for bold/fixed as well - these are now used
in the DesktopSettings as defaults, too (but can be changed there).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14804 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-11-09 19:16:25 +00:00
Axel Dörfler
16f782ccbd Implemented AS_SET_SYSTEM_FONT.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14803 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-11-09 19:14:13 +00:00
Axel Dörfler
d0a688ee92 Introduced and implemented new font command AS_GET_DEFAULT_SYSTEM_FONT that returns
the default fonts of the app_server.
Moved some font command implementations around to group them a bit better.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14800 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-11-09 18:34:48 +00:00
Stephan Aßmus
2b97fe884d now updates BView::PenLocation() correctly after DrawString(), stuff like DrawChar('a') is working nicely now, for rotated text much better then in BeOS in fact because of subpixel precision in pen location
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14794 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-11-09 16:55:08 +00:00
Stephan Aßmus
f8e33ed5bd fixed current pen position, thanks to Stefano for spotting this one, I looked very hard in the same place, but didn't see it :-)
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14787 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-11-09 13:28:15 +00:00
Stefano Ceccherini
ba48e86927 Removed leftover
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14786 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-11-08 23:55:27 +00:00
Stefano Ceccherini
e16b3f2972 friend is bad. Protected, even.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14785 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-11-08 23:48:13 +00:00
Axel Dörfler
e3343885bb Even if Adi really don't like it, it's perfectly okay to resize or move a layer before
adding it to its parent.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14784 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-11-08 23:48:06 +00:00
Stefano Ceccherini
8fbbd37f83 Added some code for notifying client BDirectWindows that the window was moved or resized. Currently commented because of other problems. Looks like the windows bounds are not changed if a MoveBy() is called before the window is shown. Removed unneeded includes. Small changes
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14783 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-11-08 23:26:47 +00:00
Stefano Ceccherini
602d0ba42c Remove IPoint.cpp from the build as no one needs it
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14782 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-11-08 23:25:31 +00:00
Axel Dörfler
d08f8a6e68 Upon construction, the font is not locked by the drawing engine, so we better lock it ourselves.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14781 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-11-08 19:29:05 +00:00
Axel Dörfler
5e4d267b5e The FontStyles are already deleted when deconstructing the family list - the
styles hash table shouldn't try to delete them again.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14780 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-11-08 19:04:01 +00:00
Adi Oanca
02414ebd4e Cleanup.
* removed old Convert{To|From}{Parent|Top} methods. They were replaced by
Convert{To|From}{Parent|Screen}(type *data)
* removed some unused methods from Layer class.
* re-aranged Layer's class declaration - grouped methods
* made all Layer's members private.
* renamed a few private methods from method_name _MethodName




git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14778 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-11-08 17:38:07 +00:00
Axel Dörfler
ec9b3f7ca1 The font manager now utilizes a hash table to look up fonts by ID.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14777 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-11-08 16:49:33 +00:00
Stefano Ceccherini
0266d3fd18 Made ServerWindow::_HandleDirectConnection() a public method. It will be called from WinBorder too.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14773 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-11-08 08:32:32 +00:00
Axel Dörfler
3a222bcbec Adi's changes broke layer resizing before they are attached to the layer hierarchy.
Also fixed a drop into the debugger when starting Tracker: fRootLayer is now NULL
in the constructor of WinBorder - which is not fatal, as we only wanted to get
the screen size (which was formerly managed by RootLayer).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14772 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-11-08 01:39:59 +00:00
Stephan Aßmus
971ed3de1e * origin in DrawState is now the summed up origin, when setting it,
use the origin from the previous state as a start
* this fixes scrolling again (minus redrawing too much stuff,
  this is left for Adi :-)


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14770 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-11-08 01:16:15 +00:00
Adi Oanca
d4e4f29a42 Cleanup after the old clipping code. Removed a few methods as others took their place. More cleanup to follow on tomorrow. :-)
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14764 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-11-07 21:24:53 +00:00
Adi Oanca
2c8cfe2dfc Bye-bye old clipping codesvn update Some cleanup to follow.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14760 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-11-07 19:01:12 +00:00
Adi Oanca
d7467f6923 Fixed resize limits problem
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14758 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-11-07 18:09:49 +00:00
Axel Dörfler
474f33d137 Added missing header, applied style guide.
This file should probably still removed one day, or at least most of its functions
should either go away or somewhere else.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14754 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-11-07 17:16:09 +00:00
Axel Dörfler
91c82a4957 Added missing newline.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14753 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-11-07 17:00:36 +00:00
Axel Dörfler
e37155c670 * The font list is now cached client-side. The app_server is only queried for
updates.
* Optimized retrieving the font list from the server.
* This greatly simplifies the app_server communication for getting the font
  list as well - there are now only 2 commands instead of 6.
* Moved extra font flags creation from ServerApp to FontStyle::Flags().


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14751 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-11-07 16:19:40 +00:00
Ingo Weinhold
ca9e5772c3 * Reintroduced third LinkAgainst parameter <mapLibs>, defaulting to true.
Library names are now mapped for all targets but "host" (not only for
  "haiku") -- added one more level of indirection to achieve that.
  (TARGET_LIBRARY_NAME_MAP -> *_LIBRARY_NAME_MAP_*).
* Renamed build/HaikuBuildCompatibility.h to BeOSBuildCompatibility.h
  (auto-included when compiling something that uses the Be API for platform
  "host" on anon-BeOS platform), and introduced build/HaikuBuildCompatibility.h,
  which can be included when compiling something that can be built for both,
  Haiku and BeOS compatible platforms.
* Introduced libhaikucompat.a, a library that adds a few functions existing
  under Haiku, but not under BeOS.
* New rule AddSubDirSupportedPlatforms.
* Renamed libopenbeos.so to libbe_haiku.so.
* Introduced new target platform "libbe_test", which is basically equivalent
  to a BeOS compatible host platform target, with the exception, that instead
  of the host platform's libbe.so a special build of Haiku's libbe.so
  (libbe_haiku.so (formerly known as libopenbeos.so)) is used. Furthermore
  Haiku's public app, interface, storage, and support kit headers are used
  when compiling. This replaces the less nice way in which the test app server
  and applications for this test environment were built.
  When building for platform "libbe_test", the library name "be" is
  autotranslated to "libbe_haiku.so". Thus most applications don't need
  special fiddling when them building them for the app server test environment;
  usually an "AddSubDirSupportedPlatforms libbe_test ;" will suffice.
* Reduced the dependencies of <syscalls.h> and fixed problems caused by this
  (e.g. source files not including the needed headers directly).



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14749 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-11-07 16:07:25 +00:00
Axel Dörfler
b2cc345461 More font work:
* Simplified server communication a bit: instead of separate queries for font
  direction, "is fixed", ... there is now a private extra flags field that is
  filled on demand.
* The server command names now describe what the command does, and are not simply
  named after the BFont method (AS_SET_FAMILY_AND_STYLE vs. AS_GET_FAMILY_AND_STYLE_IDS).
* Replaced B_SET_SYSFONT_{PLAIN|BOLD|FIXED} with a single B_GET_SYSTEM_FONTS.
* Rewrote Font.h and added our license.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14741 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-11-07 11:02:39 +00:00
Stephan Aßmus
0118ad76e1 * Painter uses the line_cap and join_mode settings of DrawState
* Painter implements DrawShape for stroking and filling BShape data
* Painter uses clipping to avoid problems with huge coordinates, the R5 app_server can be crashed by this.
  -> this should be added to more places as well like text rendering
* DrawingEngine uses the Painter to draw BShape data


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14735 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-11-07 01:23:40 +00:00
Stephan Aßmus
b574c74121 opList is uint32
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14733 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-11-07 01:17:40 +00:00
Stephan Aßmus
7dd038f405 calling _ResizeBy with zero offset doesn't do anything
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14731 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-11-07 01:16:12 +00:00
Stephan Aßmus
19ae7ecce0 sorry, forgotten in previous commit
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14730 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-11-07 01:14:47 +00:00
Stephan Aßmus
a38aedd980 no longer needed, moved to painter test folder
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14729 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-11-07 01:13:12 +00:00
Stephan Aßmus
f9129d56a7 updated license header
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14728 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-11-07 01:11:58 +00:00
Stephan Aßmus
c00fc4e31a default to B_MITER_JOIN too
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14727 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-11-07 01:11:02 +00:00
Axel Dörfler
86ad4b9c5e First steps into on-demand font scanning. When you've installed lots of fonts, this
will speed up launching the app_server considerably (once it's done).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14720 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-11-06 18:58:09 +00:00
Adi Oanca
ac4f06c5c6 Fixed invalidation with new clipping code. Only what's needed is
redrawn/invalidated now, with a single exception which I am working
on(when changing the front window the whole window area is invalidated
not just the region that became visible). The old Clipping code is broken
now. I will remove it in the next days.

Actual changes:
* removed Layer::GetWantedRegion() - was badly implemented.
* made Layer::_GetWantedRegion public and renamed it to: you guessed! :-)

* introduced Layer::MarkForRebuild(), TriggerRebuild(). You want to
calculate the new clipping regions, mark an area and then call
TRiggerRebuild() which will rebuild the visible regions for the current
Layer and all its descendants.

* for a Layer to redraw some parts of it, use
RootLayer::MarkForRedraw() to mark a region and then
RootLayer::TriggerRedraw() to see the changes (or send _UPDATE_ message in
case of a WinBorder).






git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14719 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-11-06 17:47:06 +00:00
Marcus Overhagen
4b1aabf67e I don't know why, but when starting Tracker there is no root layer here
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14717 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-11-05 21:24:51 +00:00
Jérôme Duval
428ebf6d5f myRootLayer can be NULL for offscreen bitmaps, fixes crash on Media preferences
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14711 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-11-04 22:48:51 +00:00
Stephan Aßmus
b2f2cb6203 simplified coordinate conversion from/to screen by removing duplicated code, Adi was there a reason to check for RootLayer before conversion or was this left-over?
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14709 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-11-04 19:51:38 +00:00
Stephan Aßmus
d79939116c fixed build for old clipping
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14708 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-11-04 19:50:34 +00:00
Stephan Aßmus
e7869c4c74 renamed DisplayDriverPainter to DrawingEngine, removed tons of duplicated code, and - guess what - found some bugs while doing so... but nothing critical. This patch removes the former DisplayDriver API from libappserver.so, which I think breaks Decorator plug-ins for now
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14707 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-11-04 18:22:22 +00:00
Marcus Overhagen
f38c001e56 Assigned names to "some BLocker"s to aid debugging.
Small cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14703 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-11-04 16:56:15 +00:00
Stephan Aßmus
6ed894182f renamed DisplayDriverPainter.* to DrawingEngine.*
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14695 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-11-04 15:54:16 +00:00
Stephan Aßmus
58468dfed0 first step of geting rid of abstract DisplayDriver base class for less development overhead, DisplayDriverPainter is renamed to DrawingEngine
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14694 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-11-04 15:23:54 +00:00
Stephan Aßmus
13cff625f0 cleanup and removable of large portions of code duplication, fCurrentLayer and fCurrentLayer->CurrentState() are checked in _DispatchMessage already, so _DispatchGraphicsMessage() assumes they are valid
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14691 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-11-04 13:45:16 +00:00
Stephan Aßmus
55e764c7f6 update license
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14690 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-11-04 13:41:44 +00:00
Stephan Aßmus
e422da6973 fix build for old clipping
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14688 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-11-04 13:39:12 +00:00
Axel Dörfler
962b688433 Forgot to update Layer::Scale(), too.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14687 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-11-04 13:27:41 +00:00
Axel Dörfler
cb24f13bb0 The current graphics state of a Layer can now be retrieved by the new CurrentState() method.
ServerWindow is now using that method instead of directly accessing a Layer member.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14684 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-11-04 12:15:36 +00:00
Axel Dörfler
2c2fd7b237 Fixed scale calculation. The scaling is still ignored for the drawing coordinations.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14682 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-11-04 12:01:44 +00:00
Axel Dörfler
1be1c7ccdf Fixed (again) the crash that happened when you quit the app_server in the test environment.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14681 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-11-04 11:57:43 +00:00
Axel Dörfler
aca4f50d1e Merged DrawData and LayerData to one class DrawState.
Removed that ambiguous second copy constructor and moved push state functionality
into a separate PushState() method. 


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14679 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-11-04 11:37:28 +00:00
Axel Dörfler
5abd5613d6 LayerData::prevState is now called fPreviousState and is now private. Added new method
PopState() to make this possible.
When a new layer is created, the font state of the desktop will now be set: this fixes
a bug I introduced when separating the font manager's default font and the desktop's
default font.
The scaling stuff looks pretty broken to me.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14675 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-11-04 09:52:56 +00:00
Axel Dörfler
7490bd32f1 Now also uses the fallback family when the usual default font couldn't be found.
This hides a problem with the view states that the next commit will fix :)


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14674 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-11-04 09:49:25 +00:00
Axel Dörfler
05bd1efe5b * the FontManager is now a looper (but doesn't do anything useful yet).
* moved the system default font functionality into the DesktopSettings class.
* ServerFont::SetStyle() is now a public method.
* Improved font fallback routines: they will never end up without a font if
  there is at least one font installed.
* fixed some minor bugs in the DecorManager.
* Decorator now get a DesktopSettings object passed - dunno if that's a good
  idea (since we'll have to open the DesktopSettings header), but it works
  for now (and something like this is probably needed anyway).
* a clean ServerFont is now set to the system default font - and not to the
  (user chosen) desktop default font anymore (since the font manager doesn't
  know about that one).
* Improved font directory scanning in the font manager a bit, it's now using
  find_directory() instead of hard-coded paths.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14666 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-11-03 17:03:36 +00:00
Axel Dörfler
8365d9ecd2 * A ServerFont is now always valid, bye-bye ServerFont::InitCheck().
* The FontFamily is no longer reference counting itself.
* SharedObject is now more useful and destructs itself when unused.
* Fixed FontStyle::GetHeight()/ServerFont::GetHeight() semantics.
* Simplified ServerFont constructors.
* Removed wrong function descriptions.
* FontStyleHeight is no longer used: the FontStyle is calculating the
  base font height on construction - this reduces the resolution a bit,
  but it's hopefully not causing any troubles (doesn't look like it,
  at least).
* A FontStyle now removes itself from its family on destruction.
* More cleanup, removed unused stuff like FontStyleHeight.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14657 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-11-03 13:10:28 +00:00
Axel Dörfler
c9ff9a39d0 ServerFont::StringWidth() did not set the size of the face, and could therefore
return wrong results. Activated it again to work-around the possible font deadlock.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14654 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-11-03 00:04:18 +00:00