[haiku-development] Re: Intercepting messages between the applications and App. Server

  • From: Rene Gollent <anevilyak@xxxxxxxxx>
  • To: haiku-development@xxxxxxxxxxxxx
  • Date: Fri, 20 Mar 2009 16:01:02 -0500

On Fri, Mar 20, 2009 at 3:53 PM, Yashasvi A.C. <yashasviac@xxxxxxxxx> wrote:
> I just built Haiku on Ubuntu and am opening Haiku through the VMWare virtual
> machine. I have a few questions that I wanted to ask:
> (1) How do you intercept messages between the App. Server and the
> application?
> (2) How do you intercept messages between and within applications?

For a given window, view, etc. (actually BHandler), you can attach an
object called a BMessageFilter. This can look at any message the
target receives, modify it, prevent it from being passed on to the
target, etc. In this case you'd mainly just be interested in looking
at them though. As such you could make a filter that looks for
B_MOUSE_DOWN messages, checks who the target is, and otherwise doesn't
interfere with message processing, which should give you the
information you need (which you can then send to another app or
wherever you need it to go for your implementation.

c.f. http://www.haiku-os.org/legacy-docs/bebook/BHandler_Overview.html
and http://www.haiku-os.org/legacy-docs/bebook/BMessageFilter_Overview.html
.

BView and BWindow are both BHandler subclasses and as such all the
message processing described there applies to them as well.

HTH,

Rene

Other related posts: