App Kit: style changes.
No functional change intended. Focused on documented classes only. * Update copyright information. * whitespace fixes. * pointer style * Rename some variables, msg => message, form => what * Need consistent variable names to make documentation easier, allows us to use \copydoc or \copydetails instead of repeating ourselves over and over again.
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2001-2009, Haiku Inc.
|
||||
* Copyright 2001-2014 Haiku, Inc. All rights reserved.
|
||||
* Distributed under the terms of the MIT License.
|
||||
*/
|
||||
#ifndef _APPLICATION_H
|
||||
@@ -21,8 +21,10 @@ class BMessageRunner;
|
||||
class BResources;
|
||||
class BServer;
|
||||
class BWindow;
|
||||
|
||||
struct app_info;
|
||||
|
||||
|
||||
namespace BPrivate {
|
||||
class PortLink;
|
||||
class ServerMemoryAllocator;
|
||||
@@ -151,9 +153,11 @@ private:
|
||||
bool fReadyToRunCalled;
|
||||
};
|
||||
|
||||
|
||||
// Global Objects
|
||||
|
||||
extern BApplication* be_app;
|
||||
extern BMessenger be_app_messenger;
|
||||
|
||||
|
||||
#endif // _APPLICATION_H
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
/*
|
||||
* Copyright 2001-2007, Haiku Inc. All Rights Reserved.
|
||||
* Copyright 2001-2014 Haiku, Inc. All rights reserved.
|
||||
* Distributed under the terms of the MIT License.
|
||||
*
|
||||
* Authors:
|
||||
* Erik Jaesler ([email protected])
|
||||
* Erik Jaesler, [email protected]
|
||||
*/
|
||||
#ifndef _HANDLER_H
|
||||
#define _HANDLER_H
|
||||
@@ -55,8 +55,8 @@ public:
|
||||
void UnlockLooper();
|
||||
|
||||
// Scripting
|
||||
virtual BHandler* ResolveSpecifier(BMessage* msg, int32 index,
|
||||
BMessage* specifier, int32 form,
|
||||
virtual BHandler* ResolveSpecifier(BMessage* message, int32 index,
|
||||
BMessage* specifier, int32 what,
|
||||
const char* property);
|
||||
virtual status_t GetSupportedSuites(BMessage* data);
|
||||
|
||||
@@ -77,7 +77,8 @@ public:
|
||||
virtual status_t Perform(perform_code d, void* arg);
|
||||
|
||||
// Notifier calls
|
||||
virtual void SendNotices(uint32 what, const BMessage* notice = NULL);
|
||||
virtual void SendNotices(uint32 what,
|
||||
const BMessage* notice = NULL);
|
||||
bool IsWatched() const;
|
||||
|
||||
private:
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
/*
|
||||
* Copyright 2001-2008, Haiku Inc. All Rights Reserved.
|
||||
* Copyright 2001-2014 Haiku, Inc. All rights reserved.
|
||||
* Distributed under the terms of the MIT License.
|
||||
*
|
||||
* Authors:
|
||||
* Erik Jaesler ([email protected])
|
||||
* Erik Jaesler, [email protected]
|
||||
*/
|
||||
#ifndef _LOOPER_H
|
||||
#define _LOOPER_H
|
||||
@@ -30,7 +30,7 @@ class BLooper : public BHandler {
|
||||
public:
|
||||
BLooper(const char* name = NULL,
|
||||
int32 priority = B_NORMAL_PRIORITY,
|
||||
int32 port_capacity
|
||||
int32 portCapacity
|
||||
= B_LOOPER_PORT_DEFAULT_CAPACITY);
|
||||
virtual ~BLooper();
|
||||
|
||||
@@ -86,8 +86,8 @@ public:
|
||||
sem_id Sem() const;
|
||||
|
||||
// Scripting
|
||||
virtual BHandler* ResolveSpecifier(BMessage* msg, int32 index,
|
||||
BMessage* specifier, int32 form,
|
||||
virtual BHandler* ResolveSpecifier(BMessage* message, int32 index,
|
||||
BMessage* specifier, int32 what,
|
||||
const char* property);
|
||||
virtual status_t GetSupportedSuites(BMessage* data);
|
||||
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
/*
|
||||
* Copyright 2005-2012, Haiku Inc. All Rights Reserved.
|
||||
* Copyright 2005-2014 Haiku, Inc. All rights reserved.
|
||||
* Distributed under the terms of the MIT License.
|
||||
*
|
||||
* Authors:
|
||||
* Michael Lotz <[email protected]>
|
||||
* Michael Lotz, [email protected]
|
||||
*/
|
||||
#ifndef _MESSAGE_H
|
||||
#define _MESSAGE_H
|
||||
@@ -141,7 +141,7 @@ public:
|
||||
status_t AddString(const char* name, const char* string);
|
||||
status_t AddString(const char* name,
|
||||
const BString& string);
|
||||
status_t AddStrings(const char *name,
|
||||
status_t AddStrings(const char* name,
|
||||
const BStringList& list);
|
||||
status_t AddInt8(const char* name, int8 value);
|
||||
status_t AddUInt8(const char* name, uint8 value);
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
/*
|
||||
* Copyright 2001-2005, Haiku.
|
||||
* Copyright 2001-2014 Haiku, Inc. All rights reserved.
|
||||
* Distributed under the terms of the MIT License.
|
||||
*
|
||||
* Authors:
|
||||
* Erik Jaesler ([email protected])
|
||||
* Erik Jaesler, [email protected]
|
||||
*/
|
||||
#ifndef _MESSAGE_FILTER_H
|
||||
#define _MESSAGE_FILTER_H
|
||||
@@ -14,17 +14,19 @@
|
||||
|
||||
class BMessage;
|
||||
|
||||
// filter_hook Return Codes and Protocol ---------------------------------------
|
||||
|
||||
// filter_hook Return Codes and Protocol
|
||||
enum filter_result {
|
||||
B_SKIP_MESSAGE,
|
||||
B_DISPATCH_MESSAGE
|
||||
};
|
||||
|
||||
|
||||
typedef filter_result (*filter_hook)
|
||||
(BMessage* message, BHandler** target, BMessageFilter* filter);
|
||||
|
||||
|
||||
// BMessageFilter invocation criteria ------------------------------------------
|
||||
// BMessageFilter invocation criteria
|
||||
enum message_delivery {
|
||||
B_ANY_DELIVERY,
|
||||
B_DROPPED_DELIVERY,
|
||||
@@ -38,47 +40,49 @@ enum message_source {
|
||||
};
|
||||
|
||||
|
||||
// BMessageFilter Class --------------------------------------------------------
|
||||
class BMessageFilter {
|
||||
public:
|
||||
BMessageFilter(uint32 what,
|
||||
filter_hook func = NULL);
|
||||
BMessageFilter(message_delivery delivery,
|
||||
message_source source, filter_hook func = NULL);
|
||||
BMessageFilter(message_delivery delivery,
|
||||
message_source source, uint32 what,
|
||||
filter_hook func = NULL);
|
||||
BMessageFilter(const BMessageFilter& filter);
|
||||
BMessageFilter(const BMessageFilter* filter);
|
||||
virtual ~BMessageFilter();
|
||||
public:
|
||||
BMessageFilter(uint32 what,
|
||||
filter_hook func = NULL);
|
||||
BMessageFilter(message_delivery delivery,
|
||||
message_source source, filter_hook func = NULL);
|
||||
BMessageFilter(message_delivery delivery,
|
||||
message_source source, uint32 what,
|
||||
filter_hook func = NULL);
|
||||
BMessageFilter(const BMessageFilter& filter);
|
||||
BMessageFilter(const BMessageFilter* filter);
|
||||
virtual ~BMessageFilter();
|
||||
|
||||
BMessageFilter& operator=(const BMessageFilter& from);
|
||||
BMessageFilter& operator=(const BMessageFilter& from);
|
||||
|
||||
// Hook function; ignored if filter_hook is non-NULL
|
||||
virtual filter_result Filter(BMessage* message, BHandler** _target);
|
||||
// Hook function; ignored if filter_hook is non-NULL
|
||||
virtual filter_result Filter(BMessage* message, BHandler** _target);
|
||||
|
||||
message_delivery MessageDelivery() const;
|
||||
message_source MessageSource() const;
|
||||
uint32 Command() const;
|
||||
bool FiltersAnyCommand() const;
|
||||
BLooper* Looper() const;
|
||||
message_delivery MessageDelivery() const;
|
||||
message_source MessageSource() const;
|
||||
uint32 Command() const;
|
||||
bool FiltersAnyCommand() const;
|
||||
BLooper* Looper() const;
|
||||
|
||||
private:
|
||||
friend class BLooper;
|
||||
friend class BHandler;
|
||||
private:
|
||||
friend class BLooper;
|
||||
friend class BHandler;
|
||||
|
||||
virtual void _ReservedMessageFilter1();
|
||||
virtual void _ReservedMessageFilter2();
|
||||
virtual void _ReservedMessageFilter1();
|
||||
virtual void _ReservedMessageFilter2();
|
||||
|
||||
void SetLooper(BLooper* owner);
|
||||
filter_hook FilterFunction() const;
|
||||
bool fFiltersAny;
|
||||
uint32 fWhat;
|
||||
message_delivery fDelivery;
|
||||
message_source fSource;
|
||||
BLooper *fLooper;
|
||||
filter_hook fFilterFunction;
|
||||
uint32 _reserved[3];
|
||||
void SetLooper(BLooper* owner);
|
||||
filter_hook FilterFunction() const;
|
||||
|
||||
bool fFiltersAny;
|
||||
uint32 fWhat;
|
||||
message_delivery fDelivery;
|
||||
message_source fSource;
|
||||
BLooper* fLooper;
|
||||
filter_hook fFilterFunction;
|
||||
|
||||
uint32 _reserved[3];
|
||||
};
|
||||
|
||||
|
||||
#endif // _MESSAGE_FILTER_H
|
||||
|
||||
@@ -1,57 +1,58 @@
|
||||
/*
|
||||
* Copyright 2001-2007, Haiku, Inc. All Rights Reserved.
|
||||
* Copyright 2001-2014 Haiku, Inc. All rights reserved.
|
||||
* Distributed under the terms of the MIT License.
|
||||
*/
|
||||
#ifndef _MESSAGE_QUEUE_H
|
||||
#define _MESSAGE_QUEUE_H
|
||||
#ifndef _MESSAGE_QUEUE_H
|
||||
#define _MESSAGE_QUEUE_H
|
||||
|
||||
|
||||
#include <Locker.h>
|
||||
#include <Message.h>
|
||||
/* For convenience */
|
||||
// For convenience
|
||||
|
||||
|
||||
class BMessageQueue {
|
||||
public:
|
||||
BMessageQueue();
|
||||
virtual ~BMessageQueue();
|
||||
public:
|
||||
BMessageQueue();
|
||||
virtual ~BMessageQueue();
|
||||
|
||||
void AddMessage(BMessage* message);
|
||||
void RemoveMessage(BMessage* message);
|
||||
void AddMessage(BMessage* message);
|
||||
void RemoveMessage(BMessage* message);
|
||||
|
||||
int32 CountMessages() const;
|
||||
bool IsEmpty() const;
|
||||
int32 CountMessages() const;
|
||||
bool IsEmpty() const;
|
||||
|
||||
BMessage* FindMessage(int32 index) const;
|
||||
BMessage* FindMessage(uint32 what, int32 index = 0) const;
|
||||
BMessage* FindMessage(int32 index) const;
|
||||
BMessage* FindMessage(uint32 what, int32 index = 0) const;
|
||||
|
||||
bool Lock();
|
||||
void Unlock();
|
||||
bool IsLocked() const;
|
||||
bool Lock();
|
||||
void Unlock();
|
||||
bool IsLocked() const;
|
||||
|
||||
BMessage *NextMessage();
|
||||
bool IsNextMessage(const BMessage* message) const;
|
||||
BMessage* NextMessage();
|
||||
bool IsNextMessage(const BMessage* message) const;
|
||||
|
||||
private:
|
||||
// Reserved space in the vtable for future changes to BMessageQueue
|
||||
virtual void _ReservedMessageQueue1();
|
||||
virtual void _ReservedMessageQueue2();
|
||||
virtual void _ReservedMessageQueue3();
|
||||
private:
|
||||
// Reserved space in the vtable for future changes to BMessageQueue
|
||||
virtual void _ReservedMessageQueue1();
|
||||
virtual void _ReservedMessageQueue2();
|
||||
virtual void _ReservedMessageQueue3();
|
||||
|
||||
BMessageQueue(const BMessageQueue &);
|
||||
BMessageQueue &operator=(const BMessageQueue &);
|
||||
BMessageQueue(const BMessageQueue &);
|
||||
BMessageQueue& operator=(const BMessageQueue &);
|
||||
|
||||
bool IsLocked();
|
||||
// this needs to be exported for R5 compatibility and should
|
||||
// be dropped as soon as possible
|
||||
bool IsLocked();
|
||||
// this needs to be exported for R5 compatibility and should
|
||||
// be dropped as soon as possible
|
||||
|
||||
private:
|
||||
BMessage* fHead;
|
||||
BMessage* fTail;
|
||||
int32 fMessageCount;
|
||||
mutable BLocker fLock;
|
||||
private:
|
||||
BMessage* fHead;
|
||||
BMessage* fTail;
|
||||
int32 fMessageCount;
|
||||
mutable BLocker fLock;
|
||||
|
||||
uint32 _reserved[3];
|
||||
uint32 _reserved[3];
|
||||
};
|
||||
|
||||
|
||||
#endif // _MESSAGE_QUEUE_H
|
||||
|
||||
Reference in New Issue
Block a user