[haiku-development] Overview Messaging Application Kit

  • From: "Niels Reedijk" <niels.reedijk@xxxxxxxxx>
  • To: haiku-development@xxxxxxxxxxxxx, haiku-doc@xxxxxxxxxxxxx
  • Date: Sun, 15 Jul 2007 12:38:45 +0200

(Note: this is a crosspost on the haiku-development list, the
haiku-doc list and the blog on haiku-os.org. Comments on the technical
accuracy should be posted on the development list, comments on the
organisational aspect within the documentation team on the doc mailing
list).

Hi all,

I just uploaded a blog post
(http://haiku-os.org/blog/nielx/2007-07-15/overview_of_messaging_in_the_application_kit)
with an overview
(http://haiku-os.org/files/screenshots/Messaging_0.png) of the
messaging classes in the application kit, mind map style.

I hope some of the original developers may shed some light on the
technical accuracy of this work. I'm also interested if anyone has a
good overview of the scripting capabilities, and is willing to help me
out with documenting that properly.

I incorporated BMessage, BMessenger, BLooper, BHandler, BInvoker,
BMessageQueue, BMessageRunner and BMessageFilter.

I have a technical issue with the handling of handlers by BLooper
(which might be a bug). In BLooper::AddHandler (line 320) a handler is
chained to the last in the queue. Say I have three handlers: A (the
looper itself), B and C. Now I call A->SetNextHandler(C) (Handler.cpp
line 296). This means A that if A doesn't handle the message, C will
be next (as per Handler.cpp line 249). However, in line 1170 of
Looper.cpp (in task_looper()), only one handler is called. If handler
A is called, handler B will always be skipped. Is this the intended
behaviour, or should BHander::SetNextHandler() or task_looper() make
sure that always all handlers will be called?

Same thing with setting a preferred handler by the way. If I set it to
B, A will never be called.

Thanks for all the hints.

Niels

Other related posts: