Big docs cleanup.
* Fixed headers including: - All rights reserved not All Rights Reserved. - name, [email protected] not name <[email protected]> - tabs and spaces - Authors: not Documented by: * Renamed string.dox to String.dox * Renamed midixxx.dox files to MidiXxx.dox * Moved images into images subdirectories and updated Doxfile. * Re-format all files with tabs instead of spaces. * Fix many spelling mistakes. * Added all files, classes, structs, and enums to libbe group.
This commit is contained in:
@@ -1,18 +1,20 @@
|
||||
/*
|
||||
* Copyright 2011, Haiku, Inc. All Rights Reserved.
|
||||
* Copyright 2011 Haiku, Inc. All rights reserved.
|
||||
* Distributed under the terms of the MIT License.
|
||||
*
|
||||
* Authors:
|
||||
* John Scipione, [email protected]
|
||||
*
|
||||
* Corresponds to:
|
||||
* /trunk/headers/os/app/Application.h rev 42794
|
||||
* /trunk/src/kits/app/Application.cpp rev 42794
|
||||
* headers/os/app/Application.h rev 42794
|
||||
* src/kits/app/Application.cpp rev 42794
|
||||
*/
|
||||
|
||||
|
||||
/*!
|
||||
\file Application.h
|
||||
\ingroup app
|
||||
\ingroup libroot
|
||||
\brief Provides the BApplication class.
|
||||
*/
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2011, Haiku, Inc. All Rights Reserved.
|
||||
* Copyright 2011 Haiku, Inc. All rights reserved.
|
||||
* Distributed under the terms of the MIT License.
|
||||
*
|
||||
* Authors:
|
||||
@@ -7,13 +7,15 @@
|
||||
* John Scipione, [email protected]
|
||||
*
|
||||
* Corresponds to:
|
||||
* /trunk/headers/os/app/Clipboard.h rev 42274
|
||||
* /trunk/src/kits/app/Clipboard.cpp rev 42274
|
||||
* headers/os/app/Clipboard.h rev 42274
|
||||
* src/kits/app/Clipboard.cpp rev 42274
|
||||
*/
|
||||
|
||||
|
||||
/*!
|
||||
\file Clipboard.h
|
||||
\ingroup app
|
||||
\ingroup libroot
|
||||
\brief Provides the BClipboard class.
|
||||
*/
|
||||
|
||||
@@ -27,6 +29,7 @@
|
||||
/*!
|
||||
\class BClipboard
|
||||
\ingroup app
|
||||
\ingroup libbe
|
||||
\brief Used for short-term data storage between documents and
|
||||
applications via copy and paste operations.
|
||||
|
||||
|
||||
@@ -1,18 +1,20 @@
|
||||
/*
|
||||
* Copyright 2012 Haiku, Inc. All Rights Reserved.
|
||||
* Copyright 2012 Haiku, Inc. All rights reserved.
|
||||
* Distributed under the terms of the MIT License.
|
||||
*
|
||||
* Authors:
|
||||
* John Scipione, [email protected]
|
||||
*
|
||||
* Corresponds to:
|
||||
* /trunk/headers/os/app/Cursor.h hrev45039
|
||||
* /trunk/src/kits/app/Cursor.cpp hrev45039
|
||||
* headers/os/app/Cursor.h hrev45039
|
||||
* src/kits/app/Cursor.cpp hrev45039
|
||||
*/
|
||||
|
||||
|
||||
/*!
|
||||
\file Cursor.h
|
||||
\ingroup app
|
||||
\ingroup libroot
|
||||
\brief Provides the BCursor class.
|
||||
*/
|
||||
|
||||
@@ -200,6 +202,7 @@
|
||||
/*!
|
||||
\class BCursor
|
||||
\ingroup app
|
||||
\ingroup libbe
|
||||
\brief BCursor describes a view-wide or application-wide cursor.
|
||||
|
||||
\note As BeOS only supports 16x16 monochrome cursors, to see a nice
|
||||
|
||||
@@ -1,22 +1,26 @@
|
||||
/*
|
||||
* Copyright 2007, Haiku, Inc. All Rights Reserved.
|
||||
* Copyright 2007 Haiku, Inc. All rights reserved.
|
||||
* Distributed under the terms of the MIT License.
|
||||
*
|
||||
* Authors:
|
||||
* Niels Sascha Reedijk, [email protected]
|
||||
*
|
||||
* Corresponds to:
|
||||
* /trunk/headers/os/app/Handler.h rev 22577
|
||||
* /trunk/src/kits/app/Handler.cpp rev 21332
|
||||
* headers/os/app/Handler.h rev 22577
|
||||
* src/kits/app/Handler.cpp rev 21332
|
||||
*/
|
||||
|
||||
/*!
|
||||
\file Handler.h
|
||||
\ingroup app
|
||||
\ingroup libroot
|
||||
\brief Provides the BHandler class.
|
||||
*/
|
||||
|
||||
|
||||
///// Globals /////
|
||||
|
||||
|
||||
/*!
|
||||
\def B_OBSERVE_WHAT_CHANGE
|
||||
\brief Internal.
|
||||
@@ -51,6 +55,7 @@
|
||||
/*!
|
||||
\class BHandler
|
||||
\ingroup app
|
||||
\ingroup libbe
|
||||
\brief Handles messages that are passed on by a BLooper.
|
||||
|
||||
The BHandler class implements two important pieces of functionality. It
|
||||
|
||||
@@ -1,17 +1,19 @@
|
||||
/*
|
||||
* Copyright 2008, Haiku, Inc. All Rights Reserved.
|
||||
* Copyright 2008 Haiku, Inc. All rights reserved.
|
||||
* Distributed under the terms of the MIT License.
|
||||
*
|
||||
* Authors:
|
||||
* Niels Sascha Reedijk, [email protected]
|
||||
*
|
||||
* Corresponds to:
|
||||
* /trunk/headers/os/app/Looper.h rev 21863
|
||||
* /trunk/src/kits/app/Looper.cpp rev 21864
|
||||
* headers/os/app/Looper.h rev 21863
|
||||
* src/kits/app/Looper.cpp rev 21864
|
||||
*/
|
||||
|
||||
/*!
|
||||
\file Looper.h
|
||||
\ingroup app
|
||||
\ingroup libroot
|
||||
\brief Provides the BLooper class.
|
||||
*/
|
||||
|
||||
@@ -25,6 +27,7 @@
|
||||
/*!
|
||||
\class BLooper
|
||||
\ingroup app
|
||||
\ingroup libbe
|
||||
\brief Receive and process messages in a separate thread.
|
||||
|
||||
When an object of this class is created, the message loop can be started
|
||||
|
||||
+200
-197
File diff suppressed because it is too large
Load Diff
@@ -1,14 +1,20 @@
|
||||
/*
|
||||
* Copyright 2007, Haiku, Inc. All Rights Reserved.
|
||||
* Copyright 2007 Haiku, Inc. All rights reserved.
|
||||
* Distributed under the terms of the MIT License.
|
||||
*
|
||||
* Authors:
|
||||
* Niels Sascha Reedijk, [email protected]
|
||||
*
|
||||
* Corresponds to:
|
||||
* headers/os/app/MessageFilter.h
|
||||
* src/kits/app/MessageFilter.cpp
|
||||
*/
|
||||
|
||||
|
||||
/*!
|
||||
\file MessageFilter.h
|
||||
\ingroup app
|
||||
\ingroup libroot
|
||||
\brief Provides BMessageFilter class.
|
||||
*/
|
||||
|
||||
@@ -18,7 +24,7 @@
|
||||
\brief Return Codes and Protocol of the #filter_hook.
|
||||
|
||||
These return codes should be used in your own filter_hook function, or by
|
||||
your overrided BMessageFilter::Filter() function.
|
||||
your overridden BMessageFilter::Filter() method.
|
||||
*/
|
||||
|
||||
|
||||
@@ -137,6 +143,7 @@
|
||||
/*!
|
||||
\class BMessageFilter
|
||||
\ingroup app
|
||||
\ingroup libbe
|
||||
\brief Describes a message filter for BLooper and BHandler.
|
||||
|
||||
Objects of this class serve as a description of properties that incoming
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
/*
|
||||
* Copyright 2007, Haiku, Inc. All Rights Reserved.
|
||||
* Copyright 2007, Haiku, Inc. All rights reserved.
|
||||
* Distributed under the terms of the MIT License.
|
||||
*
|
||||
* Authors:
|
||||
* Niels Sascha Reedijk, [email protected]
|
||||
*
|
||||
* Niels Sascha Reedijk, [email protected]
|
||||
*
|
||||
* Corresponds to:
|
||||
* /trunk/headers/os/app/MessageQueue.h rev 19956
|
||||
* /trunk/src/kits/app/MessageQueue.cpp rev 19956
|
||||
@@ -12,6 +12,8 @@
|
||||
|
||||
/*!
|
||||
\file MessageQueue.h
|
||||
\ingroup app
|
||||
\ingroup libroot
|
||||
\brief Provides the BMessageQueue class.
|
||||
*/
|
||||
|
||||
|
||||
@@ -1,21 +1,21 @@
|
||||
/*
|
||||
* Copyright 2007, Haiku, Inc. All Rights Reserved.
|
||||
* Copyright 2007 Haiku, Inc. All rights reserved.
|
||||
* Distributed under the terms of the MIT License.
|
||||
*
|
||||
* Documentation by:
|
||||
* Niels Sascha Reedijk <[email protected]>
|
||||
* Authors:
|
||||
* Niels Sascha Reedijk, [email protected]
|
||||
*/
|
||||
|
||||
|
||||
/*!
|
||||
\page app_intro Introduction to the Application Kit.
|
||||
|
||||
|
||||
The Application Kit should be your starting point if you want to write
|
||||
native Haiku applications with a GUI. The application kit does
|
||||
exactly as its name suggests; it is the basis for Haiku applications. You
|
||||
should read through this document and the documents referenced here before
|
||||
moving on to any other part of the API.
|
||||
|
||||
|
||||
The Application Kit classes can be divided into two groups: the "messaging"
|
||||
classes and the "system interaction" classes. The larger group contains
|
||||
the messaging classes. Have a look at the \link app_messaging
|
||||
@@ -29,7 +29,7 @@
|
||||
- BMessageQueue
|
||||
- BMessageRunner
|
||||
- BMessenger
|
||||
|
||||
|
||||
The second group is the system interaction classes. These classes
|
||||
provide hooks for your application to interact with the rest of the system.
|
||||
The most important class is BApplication. This is a list of all the
|
||||
|
||||
@@ -1,15 +1,14 @@
|
||||
/*
|
||||
* Copyright 2007, Haiku, Inc. All Rights Reserved.
|
||||
* Copyright 2007 Haiku, Inc. All rights reserved.
|
||||
* Distributed under the terms of the MIT License.
|
||||
*
|
||||
* Authors:
|
||||
* Niels Sascha Reedijk, [email protected]
|
||||
*/
|
||||
|
||||
|
||||
/*!
|
||||
\page app_messaging Messaging Foundations
|
||||
|
||||
|
||||
One of the foundations of the Haiku API is the messaging system. This
|
||||
framework is the basis for the efficient multithreaded Haiku applications,
|
||||
because it solves one of the fundamental issues of multithreading: it
|
||||
@@ -17,21 +16,21 @@
|
||||
framework allows inter-application messaging as well as
|
||||
intra-application messaging, and it will always use the most effective
|
||||
mechanism for the communication automatically.
|
||||
|
||||
|
||||
This page will introduce you to the subject of messaging. It is meant as a
|
||||
broad overview to the classes, rather than a tutorial. If you are looking
|
||||
for effective messaging techniques or a tutorial on messaging, have a look
|
||||
at the developer section of the Haiku website.
|
||||
|
||||
|
||||
<b>Table of contents</b>
|
||||
- Overview of the Messaging Classes
|
||||
- Receiving and Handling Messages
|
||||
- Sending messages
|
||||
|
||||
|
||||
\section app_messaging_overview Overview of the Messaging Classes
|
||||
|
||||
|
||||
\subsection app_messaging_overview_bmessage BMessage
|
||||
|
||||
|
||||
The BMessage class is the class that is in the center of all the messenger
|
||||
operations, because it represents a message. A message is nothing more than
|
||||
an object that contains:
|
||||
@@ -49,15 +48,15 @@
|
||||
context. The Haiku API defines several messages and their required data
|
||||
members. Several applications provide a scripting interface with defined
|
||||
message syntax. You can do the same for your application.
|
||||
|
||||
|
||||
\subsection app_messaging_overview_blooper BLooper
|
||||
|
||||
|
||||
Objects of the BLooper type are objects that run message loops. Every
|
||||
object runs in its own thread. The BLooper objects continually check for
|
||||
incoming messages. To process the messages, the looper looks for message
|
||||
handlers that handle the messages within the thread's context. Message
|
||||
handling within a looper is synchronous.
|
||||
|
||||
|
||||
BLooper inherits BHandler, the base class for message handling. However, it
|
||||
is possible to chain additional handlers to the object. For example, if you
|
||||
have an application that understands different networking protocols, and
|
||||
@@ -65,23 +64,23 @@
|
||||
can provide handlers that you can chain in your general message parser
|
||||
thread. See AddHandler() and SetPreferredHandler() for information on
|
||||
handlers.
|
||||
|
||||
|
||||
Messages can be posted to the looper by using the object's PostMessage()
|
||||
method. This method puts the message in the BMessageQueue of the looper.
|
||||
Since PostMessage() is asynchronous, the message might not be handled
|
||||
immediately. See \ref app_messaging_overview_bmessenger "BMessenger"
|
||||
for a synchronous implementation.
|
||||
|
||||
|
||||
Loopers can have a generic filter that discards messages based on
|
||||
user-definable characteristics. The BMessageFilter class provides the
|
||||
foundation for the qualifying of messages. See AddCommonFilterList() and
|
||||
SetCommonFilterList() for more information.
|
||||
|
||||
|
||||
To get the most out of the functionality of BLooper, it is usually
|
||||
subclassed to create a self-contained event 'machine'. Most of the time,
|
||||
these subclasses also perform the message handling, which is possible
|
||||
due to the fact that it is also a subclass of BHandler.
|
||||
|
||||
|
||||
In the Haiku API, there are two major classes that inherit BLooper:
|
||||
the base application class, BApplication, and the window class, BWindow.
|
||||
Because they inherit BLooper, each application and each window has its
|
||||
@@ -90,47 +89,47 @@
|
||||
event handling that requires more processing power, is done within its own
|
||||
BLooper context. Networking usually qualifies as a candidate for its own
|
||||
thread.
|
||||
|
||||
|
||||
\subsection app_messaging_overview_bhandler BHandler
|
||||
|
||||
|
||||
Objects of the BHandler type are associated to BLoopers. When they are
|
||||
created, they should be passed to the BLooper::AddHandler() method of the
|
||||
looper they want to handle messages for. They can then either be set as
|
||||
preferred handlers (by chaining them with BLooper::SetPreferredHandler()),
|
||||
or they can be added to other BHandlers with the SetNextHandler() method.
|
||||
|
||||
|
||||
The magic of the class happens in the MessageReceived() method. In your
|
||||
subclasses you override this method, to check the incoming BMessage.
|
||||
Usually, you check the \c what member of the message in a switch statement.
|
||||
If your handler cannot handle the object, it will pass the message on to
|
||||
the parent class.
|
||||
|
||||
|
||||
\warning Don't forget to actuall call the MessageReceived() method of the
|
||||
base class. Failing to do this will mean that the message chain will
|
||||
not completely be followed, which can lead to unhandled messages. There
|
||||
might be some internal system messages that the Haiku API classes
|
||||
handle, and not actually handling these messages could lead to
|
||||
inconsistent internal behavior.
|
||||
|
||||
|
||||
\subsection app_messaging_overview_bmessenger BMessenger
|
||||
|
||||
|
||||
BMessenger objects can send messages to both local and remote targets. For
|
||||
local targets, a BMessenger provides an advantage over directly calling
|
||||
the BLooper::PostMessage() method: some variants of the
|
||||
BMessenger::SendMessage() methods allow for synchronous replies. So, the
|
||||
call will actually verify the handling thread processes the message, and
|
||||
reply to the sender.
|
||||
|
||||
|
||||
The other feature of BMessenger is that it is able to be constructed with
|
||||
the signature of another application as argument. This allows the messenger
|
||||
to pass messages to other applications. It facilitates inter-application
|
||||
communication.
|
||||
|
||||
|
||||
\subsection app_messaging-overview-other Other messaging classes
|
||||
|
||||
|
||||
There are several convenience classes supplied with the application kit,
|
||||
which can make your life easier in some specific cases.
|
||||
|
||||
|
||||
- BInvoker binds together a message and a target. By calling
|
||||
BInvoker::Invoke(), the message will be sent. This class is inherited by
|
||||
the controls in the interface kit, such as BButton.
|
||||
@@ -146,12 +145,10 @@
|
||||
Filter() \endlink method.
|
||||
|
||||
\section app-messaging-receiving Receiving Messages
|
||||
|
||||
|
||||
To do...
|
||||
|
||||
|
||||
\section app-messaging-sending Sending Messages
|
||||
|
||||
|
||||
To do...
|
||||
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user