2 * Copyright 2006, Haiku.
3 * Distributed under the terms of the MIT License.
6 * Ingo Weinhold <bonefish@cs.tu-berlin.de>
9 #include "AbstractLOAdapter.h"
13 #include <Messenger.h>
16 AbstractLOAdapter::AbstractLOAdapter(BHandler
* handler
)
23 AbstractLOAdapter::AbstractLOAdapter(const BMessenger
& messenger
)
25 fMessenger(new BMessenger(messenger
))
30 AbstractLOAdapter::~AbstractLOAdapter()
37 AbstractLOAdapter::DeliverMessage(BMessage
* message
)
40 if (BLooper
* looper
= fHandler
->Looper())
41 looper
->PostMessage(message
, fHandler
);
42 } else if (fMessenger
)
43 fMessenger
->SendMessage(message
);
48 AbstractLOAdapter::DeliverMessage(BMessage
& message
)
50 DeliverMessage(&message
);
55 AbstractLOAdapter::DeliverMessage(uint32 command
)
57 BMessage
message(command
);
58 DeliverMessage(&message
);