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.
@@ -738,10 +738,10 @@ EXAMPLE_RECURSIVE = NO
|
|||||||
# the \image command).
|
# the \image command).
|
||||||
|
|
||||||
IMAGE_PATH = . \
|
IMAGE_PATH = . \
|
||||||
interface \
|
interface/images \
|
||||||
keyboard \
|
keyboard \
|
||||||
midi2 \
|
midi2/images \
|
||||||
storage
|
storage/images
|
||||||
|
|
||||||
# The INPUT_FILTER tag can be used to specify a program that doxygen should
|
# The INPUT_FILTER tag can be used to specify a program that doxygen should
|
||||||
# invoke to filter for each input file. Doxygen will invoke the filter program
|
# invoke to filter for each input file. Doxygen will invoke the filter program
|
||||||
|
|||||||
@@ -1,9 +1,12 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2007 Niels Sascha Reedijk. All rights reserved.
|
* Copyright 2007 Niels Sascha Reedijk. All rights reserved.
|
||||||
|
* Copyright 2008-2013 Haiku, Inc. All rights reserved.
|
||||||
* Distributed under the terms of the MIT License.
|
* Distributed under the terms of the MIT License.
|
||||||
*
|
*
|
||||||
* Authors:
|
* Authors:
|
||||||
* Niels Sascha Reedijk, [email protected]
|
* Niels Sascha Reedijk, [email protected]
|
||||||
|
* John Scipione, [email protected]
|
||||||
|
*
|
||||||
* Proofreaders:
|
* Proofreaders:
|
||||||
* Alan Smale, [email protected]
|
* Alan Smale, [email protected]
|
||||||
*/
|
*/
|
||||||
@@ -67,8 +70,8 @@
|
|||||||
not only means that they get the same name, but also that the order
|
not only means that they get the same name, but also that the order
|
||||||
of the methods, variables, functions, etc. will have to be the same.
|
of the methods, variables, functions, etc. will have to be the same.
|
||||||
-# The root directory of the public API headers is at \c
|
-# The root directory of the public API headers is at \c
|
||||||
/trunk/headers/os. In a similar vein, the root of the documentation
|
headers/os. In a similar vein, the root of the documentation
|
||||||
files is at \c /trunk/docs/user. The subdirectory
|
files is at \c docs/user. The subdirectory
|
||||||
structure, or the division of kits, will also be replicated.
|
structure, or the division of kits, will also be replicated.
|
||||||
-# The name of the files is the same as the base of the header files,
|
-# The name of the files is the same as the base of the header files,
|
||||||
with the \c dox extension. So \c Something.h becomes \c
|
with the \c dox extension. So \c Something.h becomes \c
|
||||||
@@ -82,39 +85,50 @@
|
|||||||
|
|
||||||
\verbatim
|
\verbatim
|
||||||
/*
|
/*
|
||||||
* Copyright 2007 Niels Sascha Reedijk. All rights reserved.
|
* Copyright 2007-2013 Haiku, Inc. All rights reserved.
|
||||||
* Distributed under the terms of the MIT License.
|
* Distributed under the terms of the MIT License.
|
||||||
*
|
*
|
||||||
* Authors:
|
* Authors:
|
||||||
* Niels Sascha Reedijk, [email protected]
|
* Niels Sascha Reedijk, [email protected]
|
||||||
|
*
|
||||||
* Proofreaders:
|
* Proofreaders:
|
||||||
* Alan Smale, [email protected]
|
* Alan Smale, [email protected]
|
||||||
|
*
|
||||||
* Corresponds to:
|
* Corresponds to:
|
||||||
* /trunk/headers/os/support/String.h rev 19731
|
* headers/os/support/String.h rev 19731
|
||||||
* /trunk/src/kits/support/String.cpp rev 19731
|
* src/kits/support/String.cpp rev 19731
|
||||||
*/
|
*/
|
||||||
\endverbatim
|
\endverbatim
|
||||||
|
|
||||||
The example above has a few elements that you should take note of:
|
The example above has a few elements that you should take note of:
|
||||||
-# The header is put in a standard C comment, which is enclosed between \c
|
-# The header is put in a standard C comment, which is enclosed between
|
||||||
/* and \c *\/.
|
\verbatim
|
||||||
-# Every line starts with a whitespace and an asterix, followed by another
|
/*
|
||||||
|
\endverbatim
|
||||||
|
and
|
||||||
|
\verbatim
|
||||||
|
*/
|
||||||
|
\endverbatim
|
||||||
|
-# Every line starts with a whitespace and an asterisk followed by another
|
||||||
space. If the text is part of a category, such as <tt>Authors</tt>, put
|
space. If the text is part of a category, such as <tt>Authors</tt>, put
|
||||||
three spaces after the delimiter.
|
three spaces after the delimiter.
|
||||||
-# The first line is empty, then we get to the copyright notice. You may
|
-# The first line is empty, then we get to the copyright notice. You may
|
||||||
either retain the copyright yourself, or you can attribute to to Haiku
|
either retain the copyright yourself, or you can attribute to to Haiku
|
||||||
Inc. It's your choice. The next line is the \e MIT licence notice,
|
Inc. It's your choice. The next line is the \e MIT License notice,
|
||||||
followed by an empty line.
|
followed by an empty line.
|
||||||
-# Then there is a label <tt>Authors:</tt>, which is followed by
|
-# Then there is a label <tt>Authors:</tt>, which is followed by
|
||||||
lines with names and email addresses. The latter one is optional, but
|
lines with names and email addresses. The latter one is optional, but
|
||||||
recommended. Each author is preceeded by two tabs after the asterix.
|
recommended. Each author is proceeded by two tabs after the asterisk.
|
||||||
-# In the same vein there is the label <tt>Proofreaders:</tt> in case the
|
-# In the same vein there is the label <tt>Proofreaders:</tt> in case the
|
||||||
file has been proofread.
|
file has been proofread.
|
||||||
-# The final part is underneath the label <tt>Corresponds to:</tt>.
|
-# The final part is underneath the label <tt>Corresponds to:</tt>.
|
||||||
Underneath there is a list of files and their svn revisions that the
|
Underneath there is a list of files and their svn revisions that the
|
||||||
current documentation is known to correspond with.
|
current documentation is known to correspond with.
|
||||||
-# The header block ends with the \c *\/, where the asterix is aligned with
|
-# The header block ends with the
|
||||||
the ones above it.
|
\verbatim
|
||||||
|
*/
|
||||||
|
\endverbatim
|
||||||
|
where the asterisk is aligned with the ones above it.
|
||||||
|
|
||||||
\subsection formalrequirements_blocks Blocks
|
\subsection formalrequirements_blocks Blocks
|
||||||
|
|
||||||
@@ -126,13 +140,20 @@
|
|||||||
we need to reproduce them in our \c dox files.
|
we need to reproduce them in our \c dox files.
|
||||||
|
|
||||||
Blocks should adhere to the following standards:
|
Blocks should adhere to the following standards:
|
||||||
-# All blocks open with \c /*! and close with \c * /
|
-# All blocks open with
|
||||||
|
\verbatim
|
||||||
|
/*!
|
||||||
|
\endverbatim
|
||||||
|
and close with
|
||||||
|
\verbatim
|
||||||
|
*/
|
||||||
|
\endverbatim
|
||||||
-# The documentation is placed in between these markers.
|
-# The documentation is placed in between these markers.
|
||||||
-# All the contents in between the markers is indented by tabs. The tab
|
-# All the contents in between the markers is indented by tabs. The tab
|
||||||
length should be four.
|
length should be four.
|
||||||
-# Between blocks, there should be two empty lines.
|
-# Between blocks, there should be two empty lines.
|
||||||
-# The maximum width of the contents between blocks is 80 columns. <em>Try
|
-# The maximum width of the contents between blocks is 80 columns. <b>Try
|
||||||
not to cross this limit</em>, because it will severely limit
|
not to cross this limit</b>, because it will severely limit
|
||||||
readability.
|
readability.
|
||||||
|
|
||||||
Example:
|
Example:
|
||||||
@@ -253,7 +274,6 @@
|
|||||||
There are also a number of things that can be used in pages and member
|
There are also a number of things that can be used in pages and member
|
||||||
documentation. See the style section to find out the appropriate situations
|
documentation. See the style section to find out the appropriate situations
|
||||||
in which to use them.
|
in which to use them.
|
||||||
|
|
||||||
- \c \\note {text}
|
- \c \\note {text}
|
||||||
- \c \\attention {text}
|
- \c \\attention {text}
|
||||||
- \c \\warning {text}
|
- \c \\warning {text}
|
||||||
@@ -312,7 +332,7 @@
|
|||||||
same arguments as \c \\page, namely the \c \<name\> and the
|
same arguments as \c \\page, namely the \c \<name\> and the
|
||||||
<tt>(title)</tt>. If you need a deeper hierarchy you may use \c \\subsection
|
<tt>(title)</tt>. If you need a deeper hierarchy you may use \c \\subsection
|
||||||
and \c \\subsubsection, again, both with the same syntax. If you need to
|
and \c \\subsubsection, again, both with the same syntax. If you need to
|
||||||
distinguish between sections in subsubsections, you are able to use
|
distinguish between sections in sub-sub-sections, you are able to use
|
||||||
\c \\paragraph, which takes the same arguments.
|
\c \\paragraph, which takes the same arguments.
|
||||||
|
|
||||||
\note Before and after each of the commands above, you need to have an empty
|
\note Before and after each of the commands above, you need to have an empty
|
||||||
@@ -349,7 +369,7 @@
|
|||||||
|
|
||||||
\verbatim
|
\verbatim
|
||||||
/*!
|
/*!
|
||||||
\\name Appending Methods
|
\name Appending Methods
|
||||||
|
|
||||||
These methods append things to the object.
|
These methods append things to the object.
|
||||||
*/
|
*/
|
||||||
@@ -357,9 +377,12 @@
|
|||||||
|
|
||||||
//! \@{
|
//! \@{
|
||||||
|
|
||||||
... names of the methods ...
|
|
||||||
|
... methods ...
|
||||||
|
|
||||||
|
|
||||||
//! \@}
|
//! \@}
|
||||||
|
|
||||||
\endverbatim
|
\endverbatim
|
||||||
|
|
||||||
The block preceding the block opening marker, <tt>//! \@{</tt>, contains a
|
The block preceding the block opening marker, <tt>//! \@{</tt>, contains a
|
||||||
@@ -401,7 +424,7 @@
|
|||||||
Modules are defined in the main book, and you can add classes to them by
|
Modules are defined in the main book, and you can add classes to them by
|
||||||
using the \c \\ingroup command. This commands adds the class to the module
|
using the \c \\ingroup command. This commands adds the class to the module
|
||||||
and groups it on a separate page. At this moment, the group handling has yet
|
and groups it on a separate page. At this moment, the group handling has yet
|
||||||
to be finalised. For now, add the classes to the kit they belong in. In the
|
to be finalized. For now, add the classes to the kit they belong in. In the
|
||||||
future this might change.
|
future this might change.
|
||||||
|
|
||||||
Finally, it is a good idea to link between parts of the documentation. There
|
Finally, it is a good idea to link between parts of the documentation. There
|
||||||
@@ -431,9 +454,9 @@
|
|||||||
here, which means you should use the right names. So use \b method
|
here, which means you should use the right names. So use \b method
|
||||||
instead of function, and data member instead of variable (where
|
instead of function, and data member instead of variable (where
|
||||||
appropriate).
|
appropriate).
|
||||||
- Avoid informalism. Avoid constructs like 'if you want to
|
- Avoid in-formalism. Avoid constructs like 'if you want to
|
||||||
disconnect the object', but rather use 'to disconnect the object'. Avoid
|
disconnect the object', but rather use 'to disconnect the object'. Avoid
|
||||||
familiarisms, or jokes.
|
familiarizes, or jokes.
|
||||||
|
|
||||||
\remarks It isn't the goal to create dry, legal-style documentation. Just
|
\remarks It isn't the goal to create dry, legal-style documentation. Just
|
||||||
try to find a balance. Read through documentation that's already been
|
try to find a balance. Read through documentation that's already been
|
||||||
@@ -697,6 +720,7 @@
|
|||||||
There are also global comparison operators and global compare functions.
|
There are also global comparison operators and global compare functions.
|
||||||
You might need these in case you have a sort routine that takes a generic
|
You might need these in case you have a sort routine that takes a generic
|
||||||
comparison function, such as BList::SortItems().
|
comparison function, such as BList::SortItems().
|
||||||
|
|
||||||
See the String.h documentation file to see the specifics, as they are
|
See the String.h documentation file to see the specifics, as they are
|
||||||
basically the same as implemented in this class.
|
basically the same as implemented in this class.
|
||||||
*/
|
*/
|
||||||
@@ -706,5 +730,4 @@
|
|||||||
the members up into two groups and refers to other functions the developer
|
the members up into two groups and refers to other functions the developer
|
||||||
might be looking for. The hard limit is two (short) paragraphs. Using more
|
might be looking for. The hard limit is two (short) paragraphs. Using more
|
||||||
will not improve clarity.
|
will not improve clarity.
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -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.
|
* Distributed under the terms of the MIT License.
|
||||||
*
|
*
|
||||||
* Authors:
|
* Authors:
|
||||||
* John Scipione, [email protected]
|
* John Scipione, [email protected]
|
||||||
*
|
*
|
||||||
* Corresponds to:
|
* Corresponds to:
|
||||||
* /trunk/headers/os/app/Application.h rev 42794
|
* headers/os/app/Application.h rev 42794
|
||||||
* /trunk/src/kits/app/Application.cpp rev 42794
|
* src/kits/app/Application.cpp rev 42794
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\file Application.h
|
\file Application.h
|
||||||
|
\ingroup app
|
||||||
|
\ingroup libroot
|
||||||
\brief Provides the BApplication class.
|
\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.
|
* Distributed under the terms of the MIT License.
|
||||||
*
|
*
|
||||||
* Authors:
|
* Authors:
|
||||||
@@ -7,13 +7,15 @@
|
|||||||
* John Scipione, [email protected]
|
* John Scipione, [email protected]
|
||||||
*
|
*
|
||||||
* Corresponds to:
|
* Corresponds to:
|
||||||
* /trunk/headers/os/app/Clipboard.h rev 42274
|
* headers/os/app/Clipboard.h rev 42274
|
||||||
* /trunk/src/kits/app/Clipboard.cpp rev 42274
|
* src/kits/app/Clipboard.cpp rev 42274
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\file Clipboard.h
|
\file Clipboard.h
|
||||||
|
\ingroup app
|
||||||
|
\ingroup libroot
|
||||||
\brief Provides the BClipboard class.
|
\brief Provides the BClipboard class.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@@ -27,6 +29,7 @@
|
|||||||
/*!
|
/*!
|
||||||
\class BClipboard
|
\class BClipboard
|
||||||
\ingroup app
|
\ingroup app
|
||||||
|
\ingroup libbe
|
||||||
\brief Used for short-term data storage between documents and
|
\brief Used for short-term data storage between documents and
|
||||||
applications via copy and paste operations.
|
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.
|
* Distributed under the terms of the MIT License.
|
||||||
*
|
*
|
||||||
* Authors:
|
* Authors:
|
||||||
* John Scipione, [email protected]
|
* John Scipione, [email protected]
|
||||||
*
|
*
|
||||||
* Corresponds to:
|
* Corresponds to:
|
||||||
* /trunk/headers/os/app/Cursor.h hrev45039
|
* headers/os/app/Cursor.h hrev45039
|
||||||
* /trunk/src/kits/app/Cursor.cpp hrev45039
|
* src/kits/app/Cursor.cpp hrev45039
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\file Cursor.h
|
\file Cursor.h
|
||||||
|
\ingroup app
|
||||||
|
\ingroup libroot
|
||||||
\brief Provides the BCursor class.
|
\brief Provides the BCursor class.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@@ -200,6 +202,7 @@
|
|||||||
/*!
|
/*!
|
||||||
\class BCursor
|
\class BCursor
|
||||||
\ingroup app
|
\ingroup app
|
||||||
|
\ingroup libbe
|
||||||
\brief BCursor describes a view-wide or application-wide cursor.
|
\brief BCursor describes a view-wide or application-wide cursor.
|
||||||
|
|
||||||
\note As BeOS only supports 16x16 monochrome cursors, to see a nice
|
\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.
|
* Distributed under the terms of the MIT License.
|
||||||
*
|
*
|
||||||
* Authors:
|
* Authors:
|
||||||
* Niels Sascha Reedijk, [email protected]
|
* Niels Sascha Reedijk, [email protected]
|
||||||
*
|
*
|
||||||
* Corresponds to:
|
* Corresponds to:
|
||||||
* /trunk/headers/os/app/Handler.h rev 22577
|
* headers/os/app/Handler.h rev 22577
|
||||||
* /trunk/src/kits/app/Handler.cpp rev 21332
|
* src/kits/app/Handler.cpp rev 21332
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\file Handler.h
|
\file Handler.h
|
||||||
|
\ingroup app
|
||||||
|
\ingroup libroot
|
||||||
\brief Provides the BHandler class.
|
\brief Provides the BHandler class.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
///// Globals /////
|
///// Globals /////
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\def B_OBSERVE_WHAT_CHANGE
|
\def B_OBSERVE_WHAT_CHANGE
|
||||||
\brief Internal.
|
\brief Internal.
|
||||||
@@ -51,6 +55,7 @@
|
|||||||
/*!
|
/*!
|
||||||
\class BHandler
|
\class BHandler
|
||||||
\ingroup app
|
\ingroup app
|
||||||
|
\ingroup libbe
|
||||||
\brief Handles messages that are passed on by a BLooper.
|
\brief Handles messages that are passed on by a BLooper.
|
||||||
|
|
||||||
The BHandler class implements two important pieces of functionality. It
|
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.
|
* Distributed under the terms of the MIT License.
|
||||||
*
|
*
|
||||||
* Authors:
|
* Authors:
|
||||||
* Niels Sascha Reedijk, [email protected]
|
* Niels Sascha Reedijk, [email protected]
|
||||||
*
|
*
|
||||||
* Corresponds to:
|
* Corresponds to:
|
||||||
* /trunk/headers/os/app/Looper.h rev 21863
|
* headers/os/app/Looper.h rev 21863
|
||||||
* /trunk/src/kits/app/Looper.cpp rev 21864
|
* src/kits/app/Looper.cpp rev 21864
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\file Looper.h
|
\file Looper.h
|
||||||
|
\ingroup app
|
||||||
|
\ingroup libroot
|
||||||
\brief Provides the BLooper class.
|
\brief Provides the BLooper class.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@@ -25,6 +27,7 @@
|
|||||||
/*!
|
/*!
|
||||||
\class BLooper
|
\class BLooper
|
||||||
\ingroup app
|
\ingroup app
|
||||||
|
\ingroup libbe
|
||||||
\brief Receive and process messages in a separate thread.
|
\brief Receive and process messages in a separate thread.
|
||||||
|
|
||||||
When an object of this class is created, the message loop can be started
|
When an object of this class is created, the message loop can be started
|
||||||
|
|||||||
@@ -1,18 +1,20 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2007, Haiku, Inc. All Rights Reserved.
|
* Copyright 2007 Haiku, Inc. All rights reserved.
|
||||||
* Distributed under the terms of the MIT License.
|
* Distributed under the terms of the MIT License.
|
||||||
*
|
*
|
||||||
* Authors:
|
* Authors:
|
||||||
* Niels Sascha Reedijk, [email protected]
|
* Niels Sascha Reedijk, [email protected]
|
||||||
*
|
*
|
||||||
* Corresponds to:
|
* Corresponds to:
|
||||||
* /trunk/headers/os/app/Message.h rev 21562
|
* headers/os/app/Message.h rev 21562
|
||||||
* /trunk/src/kits/app/Message.cpp rev 22240
|
* src/kits/app/Message.cpp rev 22240
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\file Message.h
|
\file Message.h
|
||||||
|
\ingroup app
|
||||||
|
\ingroup libroot
|
||||||
\brief Provides the BMessage class.
|
\brief Provides the BMessage class.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@@ -90,6 +92,7 @@
|
|||||||
/*!
|
/*!
|
||||||
\class BMessage
|
\class BMessage
|
||||||
\ingroup app
|
\ingroup app
|
||||||
|
\ingroup libbe
|
||||||
\brief A container that can be send and received using the Haiku messaging
|
\brief A container that can be send and received using the Haiku messaging
|
||||||
subsystem.
|
subsystem.
|
||||||
|
|
||||||
|
|||||||
@@ -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.
|
* Distributed under the terms of the MIT License.
|
||||||
*
|
*
|
||||||
* Authors:
|
* Authors:
|
||||||
* Niels Sascha Reedijk, [email protected]
|
* Niels Sascha Reedijk, [email protected]
|
||||||
|
*
|
||||||
|
* Corresponds to:
|
||||||
|
* headers/os/app/MessageFilter.h
|
||||||
|
* src/kits/app/MessageFilter.cpp
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\file MessageFilter.h
|
\file MessageFilter.h
|
||||||
|
\ingroup app
|
||||||
|
\ingroup libroot
|
||||||
\brief Provides BMessageFilter class.
|
\brief Provides BMessageFilter class.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@@ -18,7 +24,7 @@
|
|||||||
\brief Return Codes and Protocol of the #filter_hook.
|
\brief Return Codes and Protocol of the #filter_hook.
|
||||||
|
|
||||||
These return codes should be used in your own filter_hook function, or by
|
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
|
\class BMessageFilter
|
||||||
\ingroup app
|
\ingroup app
|
||||||
|
\ingroup libbe
|
||||||
\brief Describes a message filter for BLooper and BHandler.
|
\brief Describes a message filter for BLooper and BHandler.
|
||||||
|
|
||||||
Objects of this class serve as a description of properties that incoming
|
Objects of this class serve as a description of properties that incoming
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2007, Haiku, Inc. All Rights Reserved.
|
* Copyright 2007, Haiku, Inc. All rights reserved.
|
||||||
* Distributed under the terms of the MIT License.
|
* Distributed under the terms of the MIT License.
|
||||||
*
|
*
|
||||||
* Authors:
|
* Authors:
|
||||||
@@ -12,6 +12,8 @@
|
|||||||
|
|
||||||
/*!
|
/*!
|
||||||
\file MessageQueue.h
|
\file MessageQueue.h
|
||||||
|
\ingroup app
|
||||||
|
\ingroup libroot
|
||||||
\brief Provides the BMessageQueue class.
|
\brief Provides the BMessageQueue class.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2007, Haiku, Inc. All Rights Reserved.
|
* Copyright 2007 Haiku, Inc. All rights reserved.
|
||||||
* Distributed under the terms of the MIT License.
|
* Distributed under the terms of the MIT License.
|
||||||
*
|
*
|
||||||
* Documentation by:
|
* Authors:
|
||||||
* Niels Sascha Reedijk <[email protected]>
|
* Niels Sascha Reedijk, [email protected]
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,12 +1,11 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2007, Haiku, Inc. All Rights Reserved.
|
* Copyright 2007 Haiku, Inc. All rights reserved.
|
||||||
* Distributed under the terms of the MIT License.
|
* Distributed under the terms of the MIT License.
|
||||||
*
|
*
|
||||||
* Authors:
|
* Authors:
|
||||||
* Niels Sascha Reedijk, [email protected]
|
* Niels Sascha Reedijk, [email protected]
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\page app_messaging Messaging Foundations
|
\page app_messaging Messaging Foundations
|
||||||
|
|
||||||
@@ -152,6 +151,4 @@
|
|||||||
\section app-messaging-sending Sending Messages
|
\section app-messaging-sending Sending Messages
|
||||||
|
|
||||||
To do...
|
To do...
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@@ -1,13 +1,13 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2008, Haiku. All rights reserved.
|
* Copyright 2008-2013 Haiku, Inc. All rights reserved.
|
||||||
* Distributed under the terms of the MIT License.
|
* Distributed under the terms of the MIT License.
|
||||||
*
|
*
|
||||||
* Authors:
|
* Authors:
|
||||||
* François Revol <[email protected]>
|
* François Revol, [email protected]
|
||||||
* Stephan Aßmus <[email protected]>
|
* Stephan Aßmus, [email protected]
|
||||||
* Braden Ewing <[email protected]>
|
* Braden Ewing, [email protected]
|
||||||
* Humdinger <[email protected]>
|
* Humdinger, [email protected]
|
||||||
* John Scipione <[email protected]>
|
* John Scipione, [email protected]
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* color names provided by: http://chir.ag/projects/name-that-color */
|
/* color names provided by: http://chir.ag/projects/name-that-color */
|
||||||
|
|||||||
@@ -1,75 +1,92 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2007, Haiku, Inc. All Rights Reserved.
|
* Copyright 2007 Haiku, Inc. All rights reserved.
|
||||||
* Distributed under the terms of the MIT License.
|
* Distributed under the terms of the MIT License.
|
||||||
*
|
*
|
||||||
* Documentation by:
|
* Authors:
|
||||||
* Niels Sascha Reedijk <[email protected]>
|
* Niels Sascha Reedijk, [email protected]
|
||||||
|
*
|
||||||
* Corresponds to:
|
* Corresponds to:
|
||||||
* /trunk/headers/os/drivers/USB3.h rev 19915
|
* headers/os/drivers/USB3.h rev 19915
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\file USB3.h
|
\file USB3.h
|
||||||
\ingroup drivers
|
\ingroup drivers
|
||||||
|
\ingroup libbe
|
||||||
\brief Interface for the USB module.
|
\brief Interface for the USB module.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\typedef struct usb_module_info usb_module_info
|
\typedef struct usb_module_info usb_module_info
|
||||||
\brief The main interface object. See the usb_module_info documentation.
|
\brief The main interface object. See the usb_module_info documentation.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\typedef uint32 usb_id
|
\typedef uint32 usb_id
|
||||||
\brief Uniquely identify various USB objects that are used in the module.
|
\brief Uniquely identify various USB objects that are used in the module.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\typedef usb_id usb_device
|
\typedef usb_id usb_device
|
||||||
\brief Uniquely identify USB devices.
|
\brief Uniquely identify USB devices.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\typedef usb_id usb_interface
|
\typedef usb_id usb_interface
|
||||||
\brief Uniquely identify USB interfaces.
|
\brief Uniquely identify USB interfaces.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\typedef usb_id usb_pipe
|
\typedef usb_id usb_pipe
|
||||||
\brief Uniquely identify USB pipes.
|
\brief Uniquely identify USB pipes.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\typedef struct usb_endpoint_info usb_endpoint_info
|
\typedef struct usb_endpoint_info usb_endpoint_info
|
||||||
\brief Container for USB endpoint descriptors.
|
\brief Container for USB endpoint descriptors.
|
||||||
\see Documentation for usb_endpoint_info.
|
\see Documentation for usb_endpoint_info.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\typedef struct usb_interface_info usb_interface_info
|
\typedef struct usb_interface_info usb_interface_info
|
||||||
\brief Container for USB interface descriptors.
|
\brief Container for USB interface descriptors.
|
||||||
\see Documentation for usb_interface_info.
|
\see Documentation for usb_interface_info.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\typedef struct usb_interface_list usb_interface_list
|
\typedef struct usb_interface_list usb_interface_list
|
||||||
\brief Container that holds a list of USB interface descriptors.
|
\brief Container that holds a list of USB interface descriptors.
|
||||||
\see Documentation for usb_interface_list.
|
\see Documentation for usb_interface_list.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\typedef struct usb_configuration_info usb_configuration_info
|
\typedef struct usb_configuration_info usb_configuration_info
|
||||||
\brief Container for USB configuration descriptors.
|
\brief Container for USB configuration descriptors.
|
||||||
\see Documentation for usb_configuration_info.
|
\see Documentation for usb_configuration_info.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
///// usb_notify_hooks /////
|
///// usb_notify_hooks /////
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\struct usb_notify_hooks
|
\struct usb_notify_hooks
|
||||||
|
\ingroup drivers
|
||||||
|
\ingroup libbe
|
||||||
\brief Hooks that the USB stack can callback in case of events.
|
\brief Hooks that the USB stack can callback in case of events.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\fn status_t (*usb_notify_hooks::device_added)(usb_device device, void **cookie)
|
\fn status_t (*usb_notify_hooks::device_added)(usb_device device, void **cookie)
|
||||||
\brief Called by the stack in case a device is added.
|
\brief Called by the stack in case a device is added.
|
||||||
@@ -89,6 +106,7 @@
|
|||||||
\see device_removed()
|
\see device_removed()
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\var status_t (*usb_notify_hooks::device_removed)(void *cookie)
|
\var status_t (*usb_notify_hooks::device_removed)(void *cookie)
|
||||||
\brief Called by the stack in case a device you are using is removed.
|
\brief Called by the stack in case a device you are using is removed.
|
||||||
@@ -102,10 +120,14 @@
|
|||||||
to return \c B_OK though.
|
to return \c B_OK though.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
///// usb_support_descriptor /////
|
///// usb_support_descriptor /////
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\struct usb_support_descriptor
|
\struct usb_support_descriptor
|
||||||
|
\ingroup drivers
|
||||||
|
\ingroup libbe
|
||||||
\brief Description of device descriptor that the driver can handle.
|
\brief Description of device descriptor that the driver can handle.
|
||||||
|
|
||||||
Support descriptors can be used to match any form of class, subclass or
|
Support descriptors can be used to match any form of class, subclass or
|
||||||
@@ -123,179 +145,233 @@
|
|||||||
this object.
|
this object.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\var usb_support_descriptor::dev_class
|
\var usb_support_descriptor::dev_class
|
||||||
\brief The supported device classes.
|
\brief The supported device classes.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\var usb_support_descriptor::dev_subclass
|
\var usb_support_descriptor::dev_subclass
|
||||||
\brief The supported device subclasses.
|
\brief The supported device subclasses.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\var usb_support_descriptor::dev_protocol
|
\var usb_support_descriptor::dev_protocol
|
||||||
\brief The supported device protocols.
|
\brief The supported device protocols.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\var usb_support_descriptor::vendor
|
\var usb_support_descriptor::vendor
|
||||||
\brief The supported device vendor.
|
\brief The supported device vendor.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\var usb_support_descriptor::product
|
\var usb_support_descriptor::product
|
||||||
\brief The supported device products.
|
\brief The supported device products.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
///// usb_endpoint_info /////
|
///// usb_endpoint_info /////
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\struct usb_endpoint_info
|
\struct usb_endpoint_info
|
||||||
|
\ingroup drivers
|
||||||
|
\ingroup libbe
|
||||||
\brief Container for endpoint descriptors and their Haiku USB stack
|
\brief Container for endpoint descriptors and their Haiku USB stack
|
||||||
identifiers.
|
identifiers.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\var usb_endpoint_descriptor *usb_endpoint_info::descr
|
\var usb_endpoint_descriptor *usb_endpoint_info::descr
|
||||||
\brief Pointer to the descriptor of the endpoint.
|
\brief Pointer to the descriptor of the endpoint.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\var usb_pipe usb_endpoint_info::handle
|
\var usb_pipe usb_endpoint_info::handle
|
||||||
\brief Handle to use when using the stack to transfer data to and from this
|
\brief Handle to use when using the stack to transfer data to and from this
|
||||||
endpoint.
|
endpoint.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
///// usb_interface_info /////
|
///// usb_interface_info /////
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\struct usb_interface_info
|
\struct usb_interface_info
|
||||||
|
\ingroup drivers
|
||||||
|
\ingroup libbe
|
||||||
\brief Container for interface descriptors and their Haiku USB stack
|
\brief Container for interface descriptors and their Haiku USB stack
|
||||||
identifiers.
|
identifiers.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
//! @{
|
//! @{
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\var usb_interface_descriptor *usb_interface_info::descr
|
\var usb_interface_descriptor *usb_interface_info::descr
|
||||||
\brief Pointer to the descriptor of the interface.
|
\brief Pointer to the descriptor of the interface.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\var usb_interface usb_interface_info::handle
|
\var usb_interface usb_interface_info::handle
|
||||||
\brief Handle to use when using the stack to manipulate this interface.
|
\brief Handle to use when using the stack to manipulate this interface.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
//! @}
|
//! @}
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\name Endpoints
|
\name Endpoints
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
//! @{
|
//! @{
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\var size_t usb_interface_info::endpoint_count
|
\var size_t usb_interface_info::endpoint_count
|
||||||
\brief The number of endpoints in this interface.
|
\brief The number of endpoints in this interface.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\var usb_endpoint_info *usb_interface_info::endpoint
|
\var usb_endpoint_info *usb_interface_info::endpoint
|
||||||
\brief An array of endpoints that are associated to this interface.
|
\brief An array of endpoints that are associated to this interface.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
//! @}
|
//! @}
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\name Unparsed descriptors
|
\name Unparsed descriptors
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
//! @{
|
//! @{
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\var size_t usb_interface_info::generic_count
|
\var size_t usb_interface_info::generic_count
|
||||||
\brief The number of unparsed descriptors in this interface.
|
\brief The number of unparsed descriptors in this interface.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\var usb_descriptor **usb_interface_info::generic
|
\var usb_descriptor **usb_interface_info::generic
|
||||||
\brief Unparsed descriptors in this interface.
|
\brief Unparsed descriptors in this interface.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
//! @}
|
//! @}
|
||||||
|
|
||||||
|
|
||||||
///// usb_interface_list /////
|
///// usb_interface_list /////
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\struct usb_interface_list
|
\struct usb_interface_list
|
||||||
|
\ingroup drivers
|
||||||
|
\ingroup libbe
|
||||||
\brief List of interfaces available to a configuration.
|
\brief List of interfaces available to a configuration.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\var size_t usb_interface_list::alt_count
|
\var size_t usb_interface_list::alt_count
|
||||||
\brief Number of available interfaces.
|
\brief Number of available interfaces.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\var usb_interface_info *usb_interface_list::alt
|
\var usb_interface_info *usb_interface_list::alt
|
||||||
\brief Array of available interfaces.
|
\brief Array of available interfaces.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\var usb_interface_info *usb_interface_list::active
|
\var usb_interface_info *usb_interface_list::active
|
||||||
\brief Pointer to active interface.
|
\brief Pointer to active interface.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
///// usb_configuration_info /////
|
///// usb_configuration_info /////
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\struct usb_configuration_info
|
\struct usb_configuration_info
|
||||||
|
\ingroup drivers
|
||||||
|
\ingroup libbe
|
||||||
\brief Container for a specific configuration descriptor of a device.
|
\brief Container for a specific configuration descriptor of a device.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\var usb_configuration_descriptor *usb_configuration_info::descr
|
\var usb_configuration_descriptor *usb_configuration_info::descr
|
||||||
\brief The configuration descriptor.
|
\brief The configuration descriptor.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\var size_t usb_configuration_info::interface_count
|
\var size_t usb_configuration_info::interface_count
|
||||||
\brief The number of interfaces in this configuration.
|
\brief The number of interfaces in this configuration.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\var usb_interface_list *usb_configuration_info::interface
|
\var usb_interface_list *usb_configuration_info::interface
|
||||||
\brief The list of interfaces available to this configuration.
|
\brief The list of interfaces available to this configuration.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
///// usb_iso_packet_descriptor /////
|
///// usb_iso_packet_descriptor /////
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\struct usb_iso_packet_descriptor
|
\struct usb_iso_packet_descriptor
|
||||||
|
\ingroup drivers
|
||||||
|
\ingroup libbe
|
||||||
\brief The descriptor for data packets of isochronous transfers.
|
\brief The descriptor for data packets of isochronous transfers.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\var int16 usb_iso_packet_descriptor::request_length
|
\var int16 usb_iso_packet_descriptor::request_length
|
||||||
\brief Length of the request.
|
\brief Length of the request.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\var int16 usb_iso_packet_descriptor::actual_length
|
\var int16 usb_iso_packet_descriptor::actual_length
|
||||||
\brief The USB stack writes the actual transferred length in this variable.
|
\brief The USB stack writes the actual transferred length in this variable.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\var status_t usb_iso_packet_descriptor::status
|
\var status_t usb_iso_packet_descriptor::status
|
||||||
\brief The status of the transfer.
|
\brief The status of the transfer.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
///// usb_callback_func /////
|
///// usb_callback_func /////
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\typedef typedef void (*usb_callback_func)(void *cookie, status_t status, void *data, size_t actualLength)
|
\typedef typedef void (*usb_callback_func)(void *cookie, status_t status,
|
||||||
|
void *data, size_t actualLength)
|
||||||
\brief Callback function for asynchronous transfers.
|
\brief Callback function for asynchronous transfers.
|
||||||
|
|
||||||
\param cookie The cookie you supplied when you queued the transfer.
|
\param cookie The cookie you supplied when you queued the transfer.
|
||||||
\param status The status of the transfer. This is one of the following:
|
\param status The status of the transfer. This is one of the following:
|
||||||
<table>
|
<table>
|
||||||
@@ -347,18 +423,24 @@
|
|||||||
\param actualLength The amount of bytes read or written during the transfer.
|
\param actualLength The amount of bytes read or written during the transfer.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
///// usb_module_info /////
|
///// usb_module_info /////
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\struct usb_module_info
|
\struct usb_module_info
|
||||||
|
\ingroup drivers
|
||||||
|
\ingroup libbe
|
||||||
\brief Interface for drivers to interact with Haiku's USB stack.
|
\brief Interface for drivers to interact with Haiku's USB stack.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\var usb_module_info::binfo
|
\var usb_module_info::binfo
|
||||||
\brief Instance of the bus_manager_info object.
|
\brief Instance of the bus_manager_info object.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\fn status_t (*usb_module_info::register_driver)(const char *driverName, const usb_support_descriptor *supportDescriptors, size_t supportDescriptorCount, const char *optionalRepublishDriverName)
|
\fn status_t (*usb_module_info::register_driver)(const char *driverName, const usb_support_descriptor *supportDescriptors, size_t supportDescriptorCount, const char *optionalRepublishDriverName)
|
||||||
\brief Register your driver.
|
\brief Register your driver.
|
||||||
@@ -396,6 +478,7 @@
|
|||||||
out of memory.
|
out of memory.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\fn status_t (*usb_module_info::install_notify)(const char *driverName, const usb_notify_hooks *hooks)
|
\fn status_t (*usb_module_info::install_notify)(const char *driverName, const usb_notify_hooks *hooks)
|
||||||
\brief Install notify hooks for your driver.
|
\brief Install notify hooks for your driver.
|
||||||
@@ -419,6 +502,7 @@
|
|||||||
\see uninstall_notify()
|
\see uninstall_notify()
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\fn status_t (*usb_module_info::uninstall_notify)(const char *driverName)
|
\fn status_t (*usb_module_info::uninstall_notify)(const char *driverName)
|
||||||
\brief Uninstall notify hooks for your driver.
|
\brief Uninstall notify hooks for your driver.
|
||||||
@@ -435,6 +519,7 @@
|
|||||||
\retval B_NAME_NOT_FOUND Invalid \a driverName.
|
\retval B_NAME_NOT_FOUND Invalid \a driverName.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\fn const usb_device_descriptor *(*usb_module_info::get_device_descriptor)(usb_device device)
|
\fn const usb_device_descriptor *(*usb_module_info::get_device_descriptor)(usb_device device)
|
||||||
\brief Get the device descriptor.
|
\brief Get the device descriptor.
|
||||||
@@ -443,6 +528,7 @@
|
|||||||
\return The standard usb_device_descriptor, or \c NULL in case of an error.
|
\return The standard usb_device_descriptor, or \c NULL in case of an error.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\fn const usb_configuration_info *(*usb_module_info::get_nth_configuration)(usb_device device, uint index)
|
\fn const usb_configuration_info *(*usb_module_info::get_nth_configuration)(usb_device device, uint index)
|
||||||
\brief Get a configuration descriptor by index.
|
\brief Get a configuration descriptor by index.
|
||||||
@@ -454,6 +540,7 @@
|
|||||||
\a id is invalid or the \a index is out of bounds.
|
\a id is invalid or the \a index is out of bounds.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\fn const usb_configuration_info *(*usb_module_info::get_configuration)(usb_device device)
|
\fn const usb_configuration_info *(*usb_module_info::get_configuration)(usb_device device)
|
||||||
\brief Get the current configuration.
|
\brief Get the current configuration.
|
||||||
@@ -463,6 +550,7 @@
|
|||||||
configuration descriptor, or it will return\c NULL if the \a id is invalid.
|
configuration descriptor, or it will return\c NULL if the \a id is invalid.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\fn status_t (*usb_module_info::set_configuration)(usb_device device, const usb_configuration_info *configuration)
|
\fn status_t (*usb_module_info::set_configuration)(usb_device device, const usb_configuration_info *configuration)
|
||||||
\brief Change the current configuration.
|
\brief Change the current configuration.
|
||||||
@@ -482,6 +570,7 @@
|
|||||||
Pass \c NULL to the parameter \a configuration if you want to do that.
|
Pass \c NULL to the parameter \a configuration if you want to do that.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\fn status_t (*usb_module_info::set_alt_interface)(usb_device device, const usb_interface_info *interface)
|
\fn status_t (*usb_module_info::set_alt_interface)(usb_device device, const usb_interface_info *interface)
|
||||||
\brief Set an alternative interface. Not implemented.
|
\brief Set an alternative interface. Not implemented.
|
||||||
@@ -489,6 +578,7 @@
|
|||||||
This method currently always returns \c B_ERROR.
|
This method currently always returns \c B_ERROR.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\fn status_t (*usb_module_info::set_feature)(usb_id handle, uint16 selector)
|
\fn status_t (*usb_module_info::set_feature)(usb_id handle, uint16 selector)
|
||||||
\brief Convenience function for standard control pipe set feature requests.
|
\brief Convenience function for standard control pipe set feature requests.
|
||||||
@@ -501,6 +591,7 @@
|
|||||||
positively, or an error code in case it failed.
|
positively, or an error code in case it failed.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\fn status_t (*usb_module_info::clear_feature)(usb_id handle, uint16 selector)
|
\fn status_t (*usb_module_info::clear_feature)(usb_id handle, uint16 selector)
|
||||||
\brief Convenience function for standard control pipe clear feature requests.
|
\brief Convenience function for standard control pipe clear feature requests.
|
||||||
@@ -508,6 +599,7 @@
|
|||||||
\see set_feature() to see how this method works.
|
\see set_feature() to see how this method works.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\fn status_t (*usb_module_info::get_status)(usb_id handle, uint16 *status)
|
\fn status_t (*usb_module_info::get_status)(usb_id handle, uint16 *status)
|
||||||
\brief Convenience function for standard usb status requests.
|
\brief Convenience function for standard usb status requests.
|
||||||
@@ -518,8 +610,11 @@
|
|||||||
responded positively, or an error code is returned in case it failed.
|
responded positively, or an error code is returned in case it failed.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\fn status_t (*usb_module_info::get_descriptor)(usb_device device, uint8 descriptorType, uint8 index, uint16 languageID, void *data, size_t dataLength, size_t *actualLength)
|
\fn status_t (*usb_module_info::get_descriptor)(usb_device device,
|
||||||
|
uint8 descriptorType, uint8 index, uint16 languageID, void *data,
|
||||||
|
size_t dataLength, size_t *actualLength)
|
||||||
\brief Convenience function to get a descriptor from a device.
|
\brief Convenience function to get a descriptor from a device.
|
||||||
|
|
||||||
\param[in] device The device you want to query.
|
\param[in] device The device you want to query.
|
||||||
@@ -532,13 +627,18 @@
|
|||||||
\param[in] dataLength The size of the buffer (in bytes).
|
\param[in] dataLength The size of the buffer (in bytes).
|
||||||
\param[out] actualLength A pointer to a variable in which the actual number
|
\param[out] actualLength A pointer to a variable in which the actual number
|
||||||
of bytes written can be stored.
|
of bytes written can be stored.
|
||||||
|
|
||||||
|
\returns A status code.
|
||||||
\retval B_OK The request succeeded, and the descriptor is written.
|
\retval B_OK The request succeeded, and the descriptor is written.
|
||||||
\retval B_DEV_INVALID_PIPE Invalid \a device parameter.
|
\retval B_DEV_INVALID_PIPE Invalid \a device parameter.
|
||||||
\retval "other errors" Request failed.
|
\retval "other errors" Request failed.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\fn status_t (*usb_module_info::send_request)(usb_device device, uint8 requestType, uint8 request, uint16 value, uint16 index, uint16 length, void *data, size_t *actualLength)
|
\fn status_t (*usb_module_info::send_request)(usb_device device,
|
||||||
|
uint8 requestType, uint8 request, uint16 value, uint16 index,
|
||||||
|
uint16 length, void *data, size_t *actualLength)
|
||||||
\brief Send a generic, synchronous request over the default control pipe.
|
\brief Send a generic, synchronous request over the default control pipe.
|
||||||
|
|
||||||
See queue_request() for an asynchronous version of this method.
|
See queue_request() for an asynchronous version of this method.
|
||||||
@@ -554,13 +654,16 @@
|
|||||||
\param[out] data The buffer where to put the result in.
|
\param[out] data The buffer where to put the result in.
|
||||||
\param[out] actualLength The actual numbers of bytes written.
|
\param[out] actualLength The actual numbers of bytes written.
|
||||||
|
|
||||||
|
\returns A status code.
|
||||||
\retval B_OK The request succeeded.
|
\retval B_OK The request succeeded.
|
||||||
\retval B_DEV_INVALID_PIPE Invalid \a device parameter.
|
\retval B_DEV_INVALID_PIPE Invalid \a device parameter.
|
||||||
\retval "other errors" Request failed.
|
\retval "other errors" Request failed.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\fn status_t (*usb_module_info::queue_interrupt)(usb_pipe pipe, void *data, size_t dataLength, usb_callback_func callback, void *callbackCookie)
|
\fn status_t (*usb_module_info::queue_interrupt)(usb_pipe pipe, void *data,
|
||||||
|
size_t dataLength, usb_callback_func callback, void *callbackCookie)
|
||||||
\brief Asynchronously queue an interrupt transfer.
|
\brief Asynchronously queue an interrupt transfer.
|
||||||
|
|
||||||
\param pipe The id of the pipe you want to query.
|
\param pipe The id of the pipe you want to query.
|
||||||
@@ -586,6 +689,7 @@
|
|||||||
a bulk transfer.
|
a bulk transfer.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\fn status_t (*usb_module_info::queue_bulk_v)(usb_pipe pipe, iovec *vector, size_t vectorCount, usb_callback_func callback, void *callbackCookie)
|
\fn status_t (*usb_module_info::queue_bulk_v)(usb_pipe pipe, iovec *vector, size_t vectorCount, usb_callback_func callback, void *callbackCookie)
|
||||||
\brief Asynchronously queue a bulk vector.
|
\brief Asynchronously queue a bulk vector.
|
||||||
@@ -597,6 +701,7 @@
|
|||||||
\param vectorCount The number of elements in the \a vector array.
|
\param vectorCount The number of elements in the \a vector array.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\fn status_t (*usb_module_info::queue_isochronous)(usb_pipe pipe, void *data, size_t dataLength, usb_iso_packet_descriptor *packetDesc, uint32 packetCount, uint32 *startingFrameNumber, uint32 flags, usb_callback_func callback, void *callbackCookie)
|
\fn status_t (*usb_module_info::queue_isochronous)(usb_pipe pipe, void *data, size_t dataLength, usb_iso_packet_descriptor *packetDesc, uint32 packetCount, uint32 *startingFrameNumber, uint32 flags, usb_callback_func callback, void *callbackCookie)
|
||||||
\brief Asynchronously queue a isochronous transfer. Not implemented.
|
\brief Asynchronously queue a isochronous transfer. Not implemented.
|
||||||
@@ -604,6 +709,7 @@
|
|||||||
This is not implemented in the current Haiku USB Stack.
|
This is not implemented in the current Haiku USB Stack.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\fn status_t (*usb_module_info::queue_request)(usb_device device, uint8 requestType, uint8 request, uint16 value, uint16 index, uint16 length, void *data, usb_callback_func callback, void *callbackCookie)
|
\fn status_t (*usb_module_info::queue_request)(usb_device device, uint8 requestType, uint8 request, uint16 value, uint16 index, uint16 length, void *data, usb_callback_func callback, void *callbackCookie)
|
||||||
\brief Asynchronously queue a control pipe request.
|
\brief Asynchronously queue a control pipe request.
|
||||||
@@ -622,6 +728,7 @@
|
|||||||
\retval B_DEV_INVALID_PIPE The \a device argument is invalid.
|
\retval B_DEV_INVALID_PIPE The \a device argument is invalid.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\fn status_t (*usb_module_info::set_pipe_policy)(usb_pipe pipe, uint8 maxNumQueuedPackets, uint16 maxBufferDurationMS, uint16 sampleSize)
|
\fn status_t (*usb_module_info::set_pipe_policy)(usb_pipe pipe, uint8 maxNumQueuedPackets, uint16 maxBufferDurationMS, uint16 sampleSize)
|
||||||
\brief Set some pipe features.
|
\brief Set some pipe features.
|
||||||
@@ -640,6 +747,7 @@
|
|||||||
isochronous pipe.
|
isochronous pipe.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\fn status_t (*usb_module_info::cancel_queued_transfers)(usb_pipe pipe)
|
\fn status_t (*usb_module_info::cancel_queued_transfers)(usb_pipe pipe)
|
||||||
\brief Cancel pending transfers on a pipe.
|
\brief Cancel pending transfers on a pipe.
|
||||||
@@ -658,6 +766,7 @@
|
|||||||
\retval "other errors" There was an error clearing the pipe.
|
\retval "other errors" There was an error clearing the pipe.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\fn status_t (*usb_module_info::usb_ioctl)(uint32 opcode, void *buffer, size_t bufferSize)
|
\fn status_t (*usb_module_info::usb_ioctl)(uint32 opcode, void *buffer, size_t bufferSize)
|
||||||
\brief Low level commands to the USB stack.
|
\brief Low level commands to the USB stack.
|
||||||
@@ -666,8 +775,10 @@
|
|||||||
currently no uses documented.
|
currently no uses documented.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
///// B_USB_MODULE_NAME /////
|
///// B_USB_MODULE_NAME /////
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\def B_USB_MODULE_NAME
|
\def B_USB_MODULE_NAME
|
||||||
\brief The identifier string for the USB Stack interface module.
|
\brief The identifier string for the USB Stack interface module.
|
||||||
|
|||||||
@@ -1,18 +1,23 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2007, Haiku, Inc. All Rights Reserved.
|
* Copyright 2007 Haiku, Inc. All rights reserved.
|
||||||
* Distributed under the terms of the MIT License.
|
* Distributed under the terms of the MIT License.
|
||||||
*
|
*
|
||||||
* Documentation by:
|
* Authors:
|
||||||
* Niels Sascha Reedijk <[email protected]>
|
* Niels Sascha Reedijk, [email protected]
|
||||||
|
*
|
||||||
* Corresponds to:
|
* Corresponds to:
|
||||||
* /trunk/headers/os/drivers/USB_spec.h rev 19915
|
* headers/os/drivers/USB_spec.h rev 19915
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\file USB_spec.h
|
\file USB_spec.h
|
||||||
|
\ingroup drivers
|
||||||
|
\ingroup libbe
|
||||||
\brief General definitions as defined by the USB standard.
|
\brief General definitions as defined by the USB standard.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\name Request Types: targets and direction
|
\name Request Types: targets and direction
|
||||||
|
|
||||||
@@ -23,50 +28,61 @@
|
|||||||
These are usually combined with a category (found on this page).
|
These are usually combined with a category (found on this page).
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
//! @{
|
//! @{
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\def USB_REQTYPE_DEVICE_IN
|
\def USB_REQTYPE_DEVICE_IN
|
||||||
\brief Device. In.
|
\brief Device. In.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\def USB_REQTYPE_DEVICE_OUT
|
\def USB_REQTYPE_DEVICE_OUT
|
||||||
\brief Device. Out.
|
\brief Device. Out.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\def USB_REQTYPE_INTERFACE_IN
|
\def USB_REQTYPE_INTERFACE_IN
|
||||||
\brief Interface. In.
|
\brief Interface. In.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\def USB_REQTYPE_INTERFACE_OUT
|
\def USB_REQTYPE_INTERFACE_OUT
|
||||||
\brief Interface. Out.
|
\brief Interface. Out.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\def USB_REQTYPE_ENDPOINT_IN
|
\def USB_REQTYPE_ENDPOINT_IN
|
||||||
\brief Endpoint. In.
|
\brief Endpoint. In.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\def USB_REQTYPE_ENDPOINT_OUT
|
\def USB_REQTYPE_ENDPOINT_OUT
|
||||||
\brief Endpoint. Out.
|
\brief Endpoint. Out.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\def USB_REQTYPE_OTHER_OUT
|
\def USB_REQTYPE_OTHER_OUT
|
||||||
\brief Other. Out.
|
\brief Other. Out.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\def USB_REQTYPE_OTHER_IN
|
\def USB_REQTYPE_OTHER_IN
|
||||||
\brief Other. In.
|
\brief Other. In.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
//! @}
|
//! @}
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\name Request Types: categories
|
\name Request Types: categories
|
||||||
|
|
||||||
@@ -77,35 +93,43 @@
|
|||||||
These are usually combined with a target and direction (found on this page).
|
These are usually combined with a target and direction (found on this page).
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
//! @{
|
//! @{
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\def USB_REQTYPE_STANDARD
|
\def USB_REQTYPE_STANDARD
|
||||||
\brief Request that adheres to the USB specifications.
|
\brief Request that adheres to the USB specifications.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\def USB_REQTYPE_CLASS
|
\def USB_REQTYPE_CLASS
|
||||||
\brief Request that adheres to the specifications of the class.
|
\brief Request that adheres to the specifications of the class.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\def USB_REQTYPE_VENDOR
|
\def USB_REQTYPE_VENDOR
|
||||||
\brief Request that is defined by the specifications of the vendor.
|
\brief Request that is defined by the specifications of the vendor.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\def USB_REQTYPE_RESERVED
|
\def USB_REQTYPE_RESERVED
|
||||||
\brief Reserved for special implementations.
|
\brief Reserved for special implementations.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\def USB_REQTYPE_MASK
|
\def USB_REQTYPE_MASK
|
||||||
\brief Constant that can be used as mask over the requesttype field.
|
\brief Constant that can be used as mask over the requesttype field.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
//! @}
|
//! @}
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\name Standard Request Values
|
\name Standard Request Values
|
||||||
|
|
||||||
@@ -119,65 +143,79 @@
|
|||||||
with the inner workings of the USB stack!
|
with the inner workings of the USB stack!
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
//! @{
|
//! @{
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\def USB_REQUEST_GET_STATUS
|
\def USB_REQUEST_GET_STATUS
|
||||||
\brief Get the status of a device.
|
\brief Get the status of a device.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\def USB_REQUEST_CLEAR_FEATURE
|
\def USB_REQUEST_CLEAR_FEATURE
|
||||||
\brief Clear a feature.
|
\brief Clear a feature.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\def USB_REQUEST_SET_FEATURE
|
\def USB_REQUEST_SET_FEATURE
|
||||||
\brief Set a feature.
|
\brief Set a feature.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\def USB_REQUEST_SET_ADDRESS
|
\def USB_REQUEST_SET_ADDRESS
|
||||||
\brief Set the device address.
|
\brief Set the device address.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\def USB_REQUEST_GET_DESCRIPTOR
|
\def USB_REQUEST_GET_DESCRIPTOR
|
||||||
\brief Get a descriptor.
|
\brief Get a descriptor.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\def USB_REQUEST_SET_DESCRIPTOR
|
\def USB_REQUEST_SET_DESCRIPTOR
|
||||||
\brief Update a descriptor to a supplied one.
|
\brief Update a descriptor to a supplied one.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\def USB_REQUEST_GET_CONFIGURATION
|
\def USB_REQUEST_GET_CONFIGURATION
|
||||||
\brief Get a configuration.
|
\brief Get a configuration.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\def USB_REQUEST_SET_CONFIGURATION
|
\def USB_REQUEST_SET_CONFIGURATION
|
||||||
\brief Set the configuration.
|
\brief Set the configuration.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\def USB_REQUEST_GET_INTERFACE
|
\def USB_REQUEST_GET_INTERFACE
|
||||||
\brief Request an interface descriptor.
|
\brief Request an interface descriptor.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\def USB_REQUEST_SET_INTERFACE
|
\def USB_REQUEST_SET_INTERFACE
|
||||||
\brief Set a specific interface.
|
\brief Set a specific interface.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\def USB_REQUEST_SYNCH_FRAME
|
\def USB_REQUEST_SYNCH_FRAME
|
||||||
\brief Synchronize a frame.
|
\brief Synchronize a frame.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
//! @}
|
//! @}
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\name Descriptor Constants
|
\name Descriptor Constants
|
||||||
|
|
||||||
@@ -186,57 +224,70 @@
|
|||||||
usb_module_info::get_descriptor() method.
|
usb_module_info::get_descriptor() method.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
//! @{
|
//! @{
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\def USB_DESCRIPTOR_DEVICE
|
\def USB_DESCRIPTOR_DEVICE
|
||||||
\brief Constant for the device descriptor.
|
\brief Constant for the device descriptor.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\def USB_DESCRIPTOR_CONFIGURATION
|
\def USB_DESCRIPTOR_CONFIGURATION
|
||||||
\brief Constant for a configuration descriptor.
|
\brief Constant for a configuration descriptor.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\def USB_DESCRIPTOR_STRING
|
\def USB_DESCRIPTOR_STRING
|
||||||
\brief Constant for a string descriptor.
|
\brief Constant for a string descriptor.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\def USB_DESCRIPTOR_INTERFACE
|
\def USB_DESCRIPTOR_INTERFACE
|
||||||
\brief Constant for an interface descriptor.
|
\brief Constant for an interface descriptor.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\def USB_DESCRIPTOR_ENDPOINT
|
\def USB_DESCRIPTOR_ENDPOINT
|
||||||
\brief Constant for an endpoint descriptor.
|
\brief Constant for an endpoint descriptor.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
//! @}
|
//! @}
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\name Feature Requests
|
\name Feature Requests
|
||||||
|
|
||||||
These constants refer to standard feature requests. You can use these using
|
These constants refer to standard feature requests. You can use these
|
||||||
the convenient usb_module_info::set_feature() and
|
using the convenient usb_module_info::set_feature() and
|
||||||
usb_module_info::clear_feature() methods.
|
usb_module_info::clear_feature() methods.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
//! @{
|
//! @{
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\def USB_FEATURE_DEVICE_REMOTE_WAKEUP
|
\def USB_FEATURE_DEVICE_REMOTE_WAKEUP
|
||||||
\brief Request a device to wakeup from remote calls.
|
\brief Request a device to wakeup from remote calls.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\def USB_FEATURE_ENDPOINT_HALT
|
\def USB_FEATURE_ENDPOINT_HALT
|
||||||
\brief Request for a specific endpoint to halt.
|
\brief Request for a specific endpoint to halt.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
//! @}
|
//! @}
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\name Endpoint Attributes
|
\name Endpoint Attributes
|
||||||
|
|
||||||
@@ -244,35 +295,43 @@
|
|||||||
field.
|
field.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
//! @{
|
//! @{
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\def USB_ENDPOINT_ATTR_CONTROL
|
\def USB_ENDPOINT_ATTR_CONTROL
|
||||||
\brief Endpoint facilitates control transfers.
|
\brief Endpoint facilitates control transfers.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\def USB_ENDPOINT_ATTR_ISOCHRONOUS
|
\def USB_ENDPOINT_ATTR_ISOCHRONOUS
|
||||||
\brief Endpoint facilitates isochronous transfers.
|
\brief Endpoint facilitates isochronous transfers.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\def USB_ENDPOINT_ATTR_BULK
|
\def USB_ENDPOINT_ATTR_BULK
|
||||||
\brief Endpoint facilitates bulk transfers.
|
\brief Endpoint facilitates bulk transfers.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\def USB_ENDPOINT_ATTR_INTERRUPT
|
\def USB_ENDPOINT_ATTR_INTERRUPT
|
||||||
\brief Endpoint facilitates interrupt transfers.
|
\brief Endpoint facilitates interrupt transfers.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\def USB_ENDPOINT_ATTR_MASK
|
\def USB_ENDPOINT_ATTR_MASK
|
||||||
\brief Constant to mask out transfer types.
|
\brief Constant to mask out transfer types.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
//! @}
|
//! @}
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\name Endpoint Address
|
\name Endpoint Address
|
||||||
|
|
||||||
@@ -280,17 +339,20 @@
|
|||||||
usb_endpoint_descriptor::address field.
|
usb_endpoint_descriptor::address field.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
//! @{
|
//! @{
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\def USB_ENDPOINT_ADDR_DIR_IN
|
\def USB_ENDPOINT_ADDR_DIR_IN
|
||||||
\brief The endpoint provides data for the driver.
|
\brief The endpoint provides data for the driver.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\def USB_ENDPOINT_ADDR_DIR_OUT
|
\def USB_ENDPOINT_ADDR_DIR_OUT
|
||||||
\brief The endpoint accepts data from the host.
|
\brief The endpoint accepts data from the host.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
//! @}
|
|
||||||
|
|
||||||
|
//! @}
|
||||||
|
|||||||
@@ -2,8 +2,6 @@
|
|||||||
\page drivers Drivers
|
\page drivers Drivers
|
||||||
|
|
||||||
\section topics Topics
|
\section topics Topics
|
||||||
|
|
||||||
- \ref fs_modules
|
- \ref fs_modules
|
||||||
- \ref usb_modules
|
- \ref usb_modules
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -14,6 +14,7 @@
|
|||||||
/*!
|
/*!
|
||||||
\file fs_interface.h
|
\file fs_interface.h
|
||||||
\ingroup drivers
|
\ingroup drivers
|
||||||
|
\ingroup libbe
|
||||||
\brief Provides an interface for file system modules.
|
\brief Provides an interface for file system modules.
|
||||||
|
|
||||||
See the \ref fs_modules "introduction to file system modules" for a guide on
|
See the \ref fs_modules "introduction to file system modules" for a guide on
|
||||||
|
|||||||
@@ -17,7 +17,6 @@
|
|||||||
a simple mechanism for one-time module initializations. The same module is
|
a simple mechanism for one-time module initializations. The same module is
|
||||||
used for accessing any volume of that FS type.
|
used for accessing any volume of that FS type.
|
||||||
|
|
||||||
|
|
||||||
\section objects File System Objects
|
\section objects File System Objects
|
||||||
|
|
||||||
There are several types of objects a FS module has to deal with directly or
|
There are several types of objects a FS module has to deal with directly or
|
||||||
|
|||||||
@@ -1,11 +1,12 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2007, Haiku, Inc. All Rights Reserved.
|
* Copyright 2007 Haiku Inc. All rights reserved.
|
||||||
* Distributed under the terms of the MIT License.
|
* Distributed under the terms of the MIT License.
|
||||||
*
|
*
|
||||||
* Documentation by:
|
* Authors:
|
||||||
* Niels Sascha Reedijk <[email protected]>
|
* Niels Sascha Reedijk, [email protected]
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\page usb_modules Writing drivers for USB devices
|
\page usb_modules Writing drivers for USB devices
|
||||||
|
|
||||||
@@ -13,8 +14,8 @@
|
|||||||
whole range of different computers and operating systems. It introduced a
|
whole range of different computers and operating systems. It introduced a
|
||||||
standard that was capable of getting rid of all the legacy systems, such as
|
standard that was capable of getting rid of all the legacy systems, such as
|
||||||
the LPT, the PS/2 and serial ports. The plug and play nature of the standard
|
the LPT, the PS/2 and serial ports. The plug and play nature of the standard
|
||||||
were revolutional at the time of it's introduction, and it changed the way
|
was revolutionary at the time of its introduction, and it changed the way
|
||||||
in which operating systems interacted with devices.
|
which operating systems interacted with devices.
|
||||||
|
|
||||||
With the grand standard that USB has become, Haiku has an implementation
|
With the grand standard that USB has become, Haiku has an implementation
|
||||||
of it. It supports both the USB 1.1 and USB 2.0 specifications, and when
|
of it. It supports both the USB 1.1 and USB 2.0 specifications, and when
|
||||||
@@ -50,9 +51,9 @@
|
|||||||
interacting with USB devices. It is important that the stack maintains a
|
interacting with USB devices. It is important that the stack maintains a
|
||||||
continually updated device grid, so that the driver modules are always
|
continually updated device grid, so that the driver modules are always
|
||||||
aware of the latest status. The stack should also facilitate communication
|
aware of the latest status. The stack should also facilitate communication
|
||||||
between drivers and the devices, by abstracting the actual transfering of
|
between drivers and the devices, by abstracting the actual transferring of
|
||||||
bits via the host controller hardware in the computer. The stack therefore
|
bits via the host controller hardware in the computer. The stack therefore
|
||||||
should implement a inituitive interface to give driver developers access to
|
should implement a intuitive interface to give driver developers access to
|
||||||
all features and possibilities the USB specification offers, and at the same
|
all features and possibilities the USB specification offers, and at the same
|
||||||
time it should abstract many of the small requirements and peculiarities of
|
time it should abstract many of the small requirements and peculiarities of
|
||||||
that specification.
|
that specification.
|
||||||
@@ -60,7 +61,7 @@
|
|||||||
The stack internally can be divided into two parts. The first part is the
|
The stack internally can be divided into two parts. The first part is the
|
||||||
core module. This module, called \c usb_busmanager, performs all the
|
core module. This module, called \c usb_busmanager, performs all the
|
||||||
operations required by the USB specification. For example, it performs the
|
operations required by the USB specification. For example, it performs the
|
||||||
necessary lowlevel initialization when new devices are connected, or all the
|
necessary low-level initialization when new devices are connected, or all the
|
||||||
requirements when it comes to performing transfers. The core module also
|
requirements when it comes to performing transfers. The core module also
|
||||||
is the module that provides the abstractions to driver developers. The other
|
is the module that provides the abstractions to driver developers. The other
|
||||||
part of the USB stack are the individual modules that control the different
|
part of the USB stack are the individual modules that control the different
|
||||||
@@ -72,7 +73,7 @@
|
|||||||
Thus, as a driver developer you are interfacing with the \c usb_busmanager
|
Thus, as a driver developer you are interfacing with the \c usb_busmanager
|
||||||
module. On Haiku, this module implements two API's. The \c v2 API, identical
|
module. On Haiku, this module implements two API's. The \c v2 API, identical
|
||||||
to the API offered by BeOS R5, can be found in the \c USB2.h file. However,
|
to the API offered by BeOS R5, can be found in the \c USB2.h file. However,
|
||||||
for new drivers, or for ports, the recomended API is the \c v3 API, defined
|
for new drivers, or for ports, the recommended API is the \c v3 API, defined
|
||||||
in the USB3.h file. This API is identical to the one provided by Zeta. The
|
in the USB3.h file. This API is identical to the one provided by Zeta. The
|
||||||
\c v2 API should be considered to be deprecated.
|
\c v2 API should be considered to be deprecated.
|
||||||
|
|
||||||
@@ -83,7 +84,8 @@
|
|||||||
those actions and will point you to their appropriate locations.
|
those actions and will point you to their appropriate locations.
|
||||||
|
|
||||||
\note The code examples are based on the \c usb_hid driver written by
|
\note The code examples are based on the \c usb_hid driver written by
|
||||||
Jerome Duval. Have a look at this driver for a complete working example.
|
Jerome Duval. Have a look at this driver for a complete working
|
||||||
|
example.
|
||||||
|
|
||||||
The following example gives an overview of the requirements to open the
|
The following example gives an overview of the requirements to open the
|
||||||
USB module, and to start your driver registration in order to receive
|
USB module, and to start your driver registration in order to receive
|
||||||
@@ -314,8 +316,8 @@ init_driver(void)
|
|||||||
|
|
||||||
status = usb->send_request(dev,
|
status = usb->send_request(dev,
|
||||||
USB_REQTYPE_INTERFACE_IN | USB_REQTYPE_CLASS,
|
USB_REQTYPE_INTERFACE_IN | USB_REQTYPE_CLASS,
|
||||||
USB_REQUEST_HID_GET_REPORT,
|
USB_REQUEST_HID_GET_REPORT, 0x0100 | report_id,
|
||||||
0x0100 | report_id, interfaceNumber, device->total_report_size,
|
interfaceNumber, device->total_report_size,
|
||||||
device->buffer, &actual);
|
device->buffer, &actual);
|
||||||
\endcode
|
\endcode
|
||||||
|
|
||||||
@@ -375,7 +377,6 @@ void
|
|||||||
uninit_driver(void)
|
uninit_driver(void)
|
||||||
{
|
{
|
||||||
usb->uninstall_notify(kDriverName);
|
usb->uninstall_notify(kDriverName);
|
||||||
|
|
||||||
put_module(B_USB_MODULE_NAME);
|
put_module(B_USB_MODULE_NAME);
|
||||||
}
|
}
|
||||||
\endcode
|
\endcode
|
||||||
|
|||||||
@@ -13,30 +13,38 @@
|
|||||||
|
|
||||||
/*!
|
/*!
|
||||||
\file DirectWindow.h
|
\file DirectWindow.h
|
||||||
|
\ingroup game
|
||||||
|
\ingroup libbe
|
||||||
\brief Provides the DirectWindow class.
|
\brief Provides the DirectWindow class.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\enum direct_buffer_state
|
\enum direct_buffer_state
|
||||||
|
|
||||||
Direct buffer state constants
|
Direct buffer state constants
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\enum direct_driver_state
|
\enum direct_driver_state
|
||||||
|
|
||||||
Direct driver state constants
|
Direct driver state constants
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\struct direct_buffer_info
|
\struct direct_buffer_info
|
||||||
|
\ingroup game
|
||||||
|
\ingroup libbe
|
||||||
|
|
||||||
Direct butter info struct
|
Direct butter info struct
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\var direct_buffer_info::buffer_state
|
\var direct_buffer_info::buffer_state
|
||||||
|
|
||||||
State of the direct buffer access privileges.
|
State of the direct buffer access privileges.
|
||||||
It can have one of the following values:
|
It can have one of the following values:
|
||||||
- \c B_DIRECT_MODE_MASK
|
- \c B_DIRECT_MODE_MASK
|
||||||
@@ -52,6 +60,7 @@
|
|||||||
|
|
||||||
/*!
|
/*!
|
||||||
\var direct_buffer_info::driver_state
|
\var direct_buffer_info::driver_state
|
||||||
|
|
||||||
State of the graphics card on which your direct window is displayed.
|
State of the graphics card on which your direct window is displayed.
|
||||||
There are two possible values:
|
There are two possible values:
|
||||||
- \c B_MODE_CHANGED The resolution or color depth has changed.
|
- \c B_MODE_CHANGED The resolution or color depth has changed.
|
||||||
@@ -61,72 +70,93 @@
|
|||||||
|
|
||||||
/*!
|
/*!
|
||||||
\var direct_buffer_info::bits
|
\var direct_buffer_info::bits
|
||||||
|
|
||||||
Pointer to the frame buffer in your team's memory space.
|
Pointer to the frame buffer in your team's memory space.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\var direct_buffer_info::pci_bits
|
\var direct_buffer_info::pci_bits
|
||||||
|
|
||||||
Pointer to the frame buffer in the PCI memory space. This value is
|
Pointer to the frame buffer in the PCI memory space. This value is
|
||||||
typically needed to control DMA.
|
typically needed to control DMA.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\var direct_buffer_info::bytes_per_row
|
\var direct_buffer_info::bytes_per_row
|
||||||
|
|
||||||
Number of bytes used to represent a single row of pixels in the frame buffer.
|
Number of bytes used to represent a single row of pixels in the frame buffer.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\var direct_buffer_info::bits_per_pixel
|
\var direct_buffer_info::bits_per_pixel
|
||||||
number of bits actually used to store a single pixel, including reserved,
|
|
||||||
|
Number of bits actually used to store a single pixel, including reserved,
|
||||||
unused, or alpha channel bits. This value is usually a multiple of eight.
|
unused, or alpha channel bits. This value is usually a multiple of eight.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\var direct_buffer_info::pixel_format
|
\var direct_buffer_info::pixel_format
|
||||||
|
|
||||||
The format used to encode a pixel as defined by the \c color_space type.
|
The format used to encode a pixel as defined by the \c color_space type.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\var direct_buffer_info::layout
|
\var direct_buffer_info::layout
|
||||||
|
|
||||||
Reserved for future use.
|
Reserved for future use.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\var direct_buffer_info::orientation
|
\var direct_buffer_info::orientation
|
||||||
|
|
||||||
Reserved for future use.
|
Reserved for future use.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\var direct_buffer_info::_reserved[9]
|
\var direct_buffer_info::_reserved[9]
|
||||||
|
|
||||||
Reserved for future use.
|
Reserved for future use.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\var direct_buffer_info::_dd_type_
|
\var direct_buffer_info::_dd_type_
|
||||||
|
|
||||||
Reserved for future use.
|
Reserved for future use.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\var direct_buffer_info::_dd_token_
|
\var direct_buffer_info::_dd_token_
|
||||||
|
|
||||||
Reserved for future use.
|
Reserved for future use.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\var direct_buffer_info::clip_list_count
|
\var direct_buffer_info::clip_list_count
|
||||||
|
|
||||||
Number of rectangles in \c clip_list.
|
Number of rectangles in \c clip_list.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\var direct_buffer_info::window_bounds
|
\var direct_buffer_info::window_bounds
|
||||||
|
|
||||||
Rectangle that defines the full content area of the window in screen
|
Rectangle that defines the full content area of the window in screen
|
||||||
coordinates.
|
coordinates.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\var direct_buffer_info::clip_bounds
|
\var direct_buffer_info::clip_bounds
|
||||||
|
|
||||||
Bounding rectangle of the visible part of the content area of the window
|
Bounding rectangle of the visible part of the content area of the window
|
||||||
in screen coordinates.
|
in screen coordinates.
|
||||||
*/
|
*/
|
||||||
@@ -134,6 +164,7 @@
|
|||||||
|
|
||||||
/*!
|
/*!
|
||||||
\var direct_buffer_info::clip_list
|
\var direct_buffer_info::clip_list
|
||||||
|
|
||||||
List of rectangles that together define the visible region of the content
|
List of rectangles that together define the visible region of the content
|
||||||
area of the window in screen coordinates.
|
area of the window in screen coordinates.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -13,6 +13,8 @@
|
|||||||
|
|
||||||
/*!
|
/*!
|
||||||
\file FileGameSound.h
|
\file FileGameSound.h
|
||||||
|
\ingroup game
|
||||||
|
\ingroup libbe
|
||||||
\brief Provides the BFileGameSound class.
|
\brief Provides the BFileGameSound class.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|||||||
@@ -5,8 +5,10 @@
|
|||||||
* Authors:
|
* Authors:
|
||||||
* Christopher ML Zumwalt May, [email protected]
|
* Christopher ML Zumwalt May, [email protected]
|
||||||
* Omri Barak
|
* Omri Barak
|
||||||
|
*
|
||||||
* Proofreaders:
|
* Proofreaders:
|
||||||
* John Scipione, [email protected]
|
* John Scipione, [email protected]
|
||||||
|
*
|
||||||
* Corresponds to:
|
* Corresponds to:
|
||||||
* src/kits/game/GameProducer.h rev 43514
|
* src/kits/game/GameProducer.h rev 43514
|
||||||
* src/kits/game/GameProducer.cpp rev 43514
|
* src/kits/game/GameProducer.cpp rev 43514
|
||||||
@@ -15,6 +17,8 @@
|
|||||||
|
|
||||||
/*!
|
/*!
|
||||||
\file GameProducer.h
|
\file GameProducer.h
|
||||||
|
\ingroup game
|
||||||
|
\ingroup libbe
|
||||||
\brief Provides the GameProducer class.
|
\brief Provides the GameProducer class.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,16 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2010 Haiku, Inc. All rights reserved.
|
||||||
|
* Distributed under the terms of the MIT License.
|
||||||
|
*
|
||||||
|
* Authors:
|
||||||
|
* Alex Wilson, [email protected]
|
||||||
|
*
|
||||||
|
* Corresponds to:
|
||||||
|
* headers/os/interface/AbstractLayout.h rev 39055
|
||||||
|
* src/kits/inteface/AbstractLayout.cpp rev 39055
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\class BAbstractLayout
|
\class BAbstractLayout
|
||||||
\ingroup interface
|
\ingroup interface
|
||||||
|
|||||||
@@ -1,9 +1,10 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2011, Haiku inc.
|
* Copyright 2011 Haiku Inc. All rights reserved.
|
||||||
* Distributed under the terms of the MIT License.
|
* Distributed under the terms of the MIT License.
|
||||||
*
|
*
|
||||||
* Documentation by:
|
* Authors:
|
||||||
* John Scipione <[email protected]>
|
* John Scipione, [email protected]
|
||||||
|
*
|
||||||
* Corresponds to:
|
* Corresponds to:
|
||||||
* /trunk/headers/os/interface/Alert.h rev 42274
|
* /trunk/headers/os/interface/Alert.h rev 42274
|
||||||
* /trunk/src/kits/interface/Alert.cpp rev 42274
|
* /trunk/src/kits/interface/Alert.cpp rev 42274
|
||||||
@@ -12,12 +13,17 @@
|
|||||||
|
|
||||||
/*!
|
/*!
|
||||||
\file Alert.h
|
\file Alert.h
|
||||||
|
\ingroup interface
|
||||||
|
\ingroup libbe
|
||||||
\brief BAlert class definition and support enums.
|
\brief BAlert class definition and support enums.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\enum alert_type
|
\enum alert_type
|
||||||
|
\ingroup interface
|
||||||
|
\ingroup libbe
|
||||||
|
|
||||||
Determines which icon (if any) is displayed in the alert dialog.
|
Determines which icon (if any) is displayed in the alert dialog.
|
||||||
Choose one option. If the constructor doesn't include an
|
Choose one option. If the constructor doesn't include an
|
||||||
alert_type argument than \c B_EMPTY_ALERT is used.
|
alert_type argument than \c B_EMPTY_ALERT is used.
|
||||||
@@ -25,35 +31,47 @@
|
|||||||
|
|
||||||
/*!
|
/*!
|
||||||
\var alert_type B_EMPTY_ALERT
|
\var alert_type B_EMPTY_ALERT
|
||||||
|
|
||||||
No icon
|
No icon
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\var alert_type B_INFO_ALERT
|
\var alert_type B_INFO_ALERT
|
||||||
|
|
||||||
\image html http://api.haiku-os.org/images/alert_info_32.png
|
\image html http://api.haiku-os.org/images/alert_info_32.png
|
||||||
|
|
||||||
Info icon
|
Info icon
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\var alert_type B_IDEA_ALERT
|
\var alert_type B_IDEA_ALERT
|
||||||
|
|
||||||
\image html http://api.haiku-os.org/images/alert_idea_32.png
|
\image html http://api.haiku-os.org/images/alert_idea_32.png
|
||||||
|
|
||||||
Idea icon
|
Idea icon
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\var alert_type B_WARNING_ALERT
|
\var alert_type B_WARNING_ALERT
|
||||||
|
|
||||||
\image html http://api.haiku-os.org/images/alert_warning_32.png
|
\image html http://api.haiku-os.org/images/alert_warning_32.png
|
||||||
|
|
||||||
Warning icon
|
Warning icon
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\var alert_type B_STOP_ALERT
|
\var alert_type B_STOP_ALERT
|
||||||
|
|
||||||
\image html http://api.haiku-os.org/images/alert_stop_32.png
|
\image html http://api.haiku-os.org/images/alert_stop_32.png
|
||||||
|
|
||||||
Stop icon
|
Stop icon
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\enum button_spacing
|
\enum button_spacing
|
||||||
|
\ingroup interface
|
||||||
|
\ingroup libbe
|
||||||
|
|
||||||
Determines how the buttons on the alert dialog are spaced relative
|
Determines how the buttons on the alert dialog are spaced relative
|
||||||
to each other. Choose one option. If the constructor doesn't include a
|
to each other. Choose one option. If the constructor doesn't include a
|
||||||
button_spacing argument than \c B_EVEN_SPACING is used.
|
button_spacing argument than \c B_EVEN_SPACING is used.
|
||||||
@@ -61,12 +79,14 @@
|
|||||||
|
|
||||||
/*!
|
/*!
|
||||||
\var button_spacing B_EVEN_SPACING
|
\var button_spacing B_EVEN_SPACING
|
||||||
|
|
||||||
If the alert dialog has more than one button than the buttons are
|
If the alert dialog has more than one button than the buttons are
|
||||||
spaced evenly across the bottom of the alert dialog.
|
spaced evenly across the bottom of the alert dialog.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\var button_spacing B_OFFSET_SPACING
|
\var button_spacing B_OFFSET_SPACING
|
||||||
|
|
||||||
If the alert dialog has more than one button than the leftmost button
|
If the alert dialog has more than one button than the leftmost button
|
||||||
is offset to the left-hand side of the dialog while the rest of the
|
is offset to the left-hand side of the dialog while the rest of the
|
||||||
buttons are grouped on the right. This is useful to separate off a
|
buttons are grouped on the right. This is useful to separate off a
|
||||||
|
|||||||
@@ -1,17 +1,21 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2011, Haiku inc.
|
* Copyright 2011 Haiku Inc. All rights reserved.
|
||||||
* Distributed under the terms of the MIT Licence.
|
* Distributed under the terms of the MIT License.
|
||||||
|
*
|
||||||
|
* Authors:
|
||||||
|
* Axel Dörfler, [email protected]
|
||||||
|
* John Scipione, [email protected]
|
||||||
*
|
*
|
||||||
* Documentation by:
|
|
||||||
* Axel Dörfler <[email protected]>
|
|
||||||
* John Scipione <[email protected]>
|
|
||||||
* Corresponds to:
|
* Corresponds to:
|
||||||
* /trunk/headers/os/interface/Bitmap.h rev 42274
|
* /trunk/headers/os/interface/Bitmap.h rev 42274
|
||||||
* /trunk/src/kits/interface/Bitmap.cpp rev 42274
|
* /trunk/src/kits/interface/Bitmap.cpp rev 42274
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\file Bitmap.h
|
\file Bitmap.h
|
||||||
|
\ingroup interface
|
||||||
|
\ingroup libbe
|
||||||
\brief Defines the BBitmap class and global operators and functions for
|
\brief Defines the BBitmap class and global operators and functions for
|
||||||
handling bitmaps.
|
handling bitmaps.
|
||||||
*/
|
*/
|
||||||
@@ -34,6 +38,7 @@
|
|||||||
|
|
||||||
An example of creating a new 32x32 pixel BBitmap object and assigning the
|
An example of creating a new 32x32 pixel BBitmap object and assigning the
|
||||||
icon of the current application looks like this:
|
icon of the current application looks like this:
|
||||||
|
|
||||||
\code
|
\code
|
||||||
BBitmap iconBitmap = new BBitmap(BRect(0, 0, 31, 31), B_RGBA32));
|
BBitmap iconBitmap = new BBitmap(BRect(0, 0, 31, 31), B_RGBA32));
|
||||||
appFileInfo.GetIcon(iconBitmap, B_LARGE_ICON);
|
appFileInfo.GetIcon(iconBitmap, B_LARGE_ICON);
|
||||||
|
|||||||
@@ -1,11 +1,12 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2010, Haiku inc.
|
* Copyright 2011 Haiku Inc. All rights reserved.
|
||||||
* Distributed under the terms of the MIT Licence.
|
* Distributed under the terms of the MIT License.
|
||||||
*
|
*
|
||||||
* Documentation by:
|
* Authors:
|
||||||
* Clark Gaeble
|
* Clark Gaeble
|
||||||
* Adrien Destugues <[email protected]>
|
* Adrien Destugues <[email protected]>
|
||||||
* John Scipione <[email protected]>
|
* John Scipione <[email protected]>
|
||||||
|
*
|
||||||
* Corresponds to:
|
* Corresponds to:
|
||||||
* /trunk/headers/os/interface/Box.h rev 42274
|
* /trunk/headers/os/interface/Box.h rev 42274
|
||||||
* /trunk/src/kits/interface/Box.cpp rev 42274
|
* /trunk/src/kits/interface/Box.cpp rev 42274
|
||||||
@@ -13,6 +14,8 @@
|
|||||||
|
|
||||||
/*!
|
/*!
|
||||||
\file Box.h
|
\file Box.h
|
||||||
|
\ingroup interface
|
||||||
|
\ingroup libbe
|
||||||
\brief Defines the BBox class
|
\brief Defines the BBox class
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@@ -20,6 +23,7 @@
|
|||||||
/*!
|
/*!
|
||||||
\class BBox
|
\class BBox
|
||||||
\ingroup interface
|
\ingroup interface
|
||||||
|
\ingroup libbe
|
||||||
\brief A rectangular view with a border and an optional label to group
|
\brief A rectangular view with a border and an optional label to group
|
||||||
related subviews visually.
|
related subviews visually.
|
||||||
|
|
||||||
|
|||||||
@@ -1,9 +1,10 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2011, Haiku inc.
|
* Copyright 2011 Haiku Inc. All rights reserved.
|
||||||
* Distributed under the terms of the MIT License.
|
* Distributed under the terms of the MIT License.
|
||||||
*
|
*
|
||||||
* Documentation by:
|
* Authors:
|
||||||
* John Scipione, [email protected]
|
* John Scipione, [email protected]
|
||||||
|
*
|
||||||
* Corresponds to:
|
* Corresponds to:
|
||||||
* /trunk/headers/os/interface/Button.h rev 42794
|
* /trunk/headers/os/interface/Button.h rev 42794
|
||||||
* /trunk/src/kits/interface/Button.cpp rev 42794
|
* /trunk/src/kits/interface/Button.cpp rev 42794
|
||||||
@@ -11,6 +12,8 @@
|
|||||||
|
|
||||||
/*!
|
/*!
|
||||||
\file Button.h
|
\file Button.h
|
||||||
|
\ingroup interface
|
||||||
|
\ingroup libbe
|
||||||
\brief Describes the BButton class.
|
\brief Describes the BButton class.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@@ -18,6 +21,7 @@
|
|||||||
/*!
|
/*!
|
||||||
\class BButton Button.h
|
\class BButton Button.h
|
||||||
\ingroup interface
|
\ingroup interface
|
||||||
|
\ingroup libbe
|
||||||
\brief A BButton is a labeled on-screen button.
|
\brief A BButton is a labeled on-screen button.
|
||||||
|
|
||||||
A BButton control is used to initiate an action. An action is activated
|
A BButton control is used to initiate an action. An action is activated
|
||||||
@@ -29,8 +33,8 @@
|
|||||||
|
|
||||||
A BButton, unlike other user interface elements such as check boxes and
|
A BButton, unlike other user interface elements such as check boxes and
|
||||||
radio buttons has only a single state. During a click event the
|
radio buttons has only a single state. During a click event the
|
||||||
BButton's value is set to \c 1, (\c B_CONTROL_ON) otherwise this value
|
BButton's value is set to 1, (\c B_CONTROL_ON) otherwise this value
|
||||||
is \c 0 (\c B_CONTROL_OFF).
|
is 0 (\c B_CONTROL_OFF).
|
||||||
|
|
||||||
BButton inherits from the BControl class.
|
BButton inherits from the BControl class.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -1,18 +1,22 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2011, Haiku inc.
|
* Copyright 2011 Haiku Inc. All rights reserved.
|
||||||
* Distributed under the terms of the MIT Licence.
|
* Distributed under the terms of the MIT License.
|
||||||
*
|
*
|
||||||
* Documentation by:
|
* Authors:
|
||||||
* Stephan Aßmus, [email protected]
|
* Stephan Aßmus, [email protected]
|
||||||
* Marc Flerackers, [email protected]
|
* Marc Flerackers, [email protected]
|
||||||
* John Scipione, [email protected]
|
* John Scipione, [email protected]
|
||||||
|
*
|
||||||
* Corresponds to:
|
* Corresponds to:
|
||||||
* /trunk/headers/os/interface/CheckBox.h rev 42794
|
* /trunk/headers/os/interface/CheckBox.h rev 42794
|
||||||
* /trunk/src/kits/interface/CheckBox.cpp rev 42794
|
* /trunk/src/kits/interface/CheckBox.cpp rev 42794
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\file CheckBox.h
|
\file CheckBox.h
|
||||||
|
\ingroup interface
|
||||||
|
\ingroup libbe
|
||||||
\brief Defines the BCheckBox class
|
\brief Defines the BCheckBox class
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|||||||
@@ -1,9 +1,10 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2011, Haiku inc.
|
* Copyright 2011 Haiku Inc. All rights reserved.
|
||||||
* Distributed under the terms of the MIT License.
|
* Distributed under the terms of the MIT License.
|
||||||
*
|
*
|
||||||
* Documentation by:
|
* Authors:
|
||||||
* John Scipione, [email protected]
|
* John Scipione, [email protected]
|
||||||
|
*
|
||||||
* Corresponds to:
|
* Corresponds to:
|
||||||
* /trunk/headers/os/interface/ColorControl.h rev 42794
|
* /trunk/headers/os/interface/ColorControl.h rev 42794
|
||||||
* /trunk/src/kits/interface/ColorControl.cpp rev 42794
|
* /trunk/src/kits/interface/ColorControl.cpp rev 42794
|
||||||
@@ -12,37 +13,48 @@
|
|||||||
|
|
||||||
/*!
|
/*!
|
||||||
\file ColorControl.h
|
\file ColorControl.h
|
||||||
|
\ingroup interface
|
||||||
|
\ingroup libbe
|
||||||
\brief BColorControl class definition and support enums.
|
\brief BColorControl class definition and support enums.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*! \enum color_control_layout
|
/*!
|
||||||
|
\enum color_control_layout
|
||||||
|
\ingroup interface
|
||||||
|
\ingroup libbe
|
||||||
|
|
||||||
Enumeration of the color control layout options.
|
Enumeration of the color control layout options.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\var color_control_layout B_CELLS_4x64
|
\var color_control_layout B_CELLS_4x64
|
||||||
cells are arranged in 4 columns, 64 rows.
|
|
||||||
|
Cells are arranged in 4 columns, 64 rows.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\var color_control_layout B_CELLS_8x32
|
\var color_control_layout B_CELLS_8x32
|
||||||
cells are arranged in 8 columns, 32 rows.
|
|
||||||
|
Cells are arranged in 8 columns, 32 rows.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\var color_control_layout B_CELLS_16x16
|
\var color_control_layout B_CELLS_16x16
|
||||||
cells are arranged in 16 columns, 16 rows.
|
|
||||||
|
Cells are arranged in 16 columns, 16 rows.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\var color_control_layout B_CELLS_32x8
|
\var color_control_layout B_CELLS_32x8
|
||||||
cells are arranged in 32 columns, 8 rows.
|
|
||||||
|
Cells are arranged in 32 columns, 8 rows.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\var color_control_layout B_CELLS_64x4
|
\var color_control_layout B_CELLS_64x4
|
||||||
cells are arranged in 64 columns, 4 rows.
|
|
||||||
|
Cells are arranged in 64 columns, 4 rows.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,29 +1,35 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2011, Haiku inc.
|
* Copyright 2011 Haiku Inc. All rights reserved.
|
||||||
* Distributed under the terms of the MIT License.
|
* Distributed under the terms of the MIT License.
|
||||||
*
|
*
|
||||||
* Documentation by:
|
* Authors:
|
||||||
* John Scipione, [email protected]
|
* John Scipione, [email protected]
|
||||||
|
*
|
||||||
* Corresponds to:
|
* Corresponds to:
|
||||||
* /trunk/headers/os/interface/Control.h rev 42794
|
* /trunk/headers/os/interface/Control.h rev 42794
|
||||||
* /trunk/src/kits/interface/Control.cpp rev 42794
|
* /trunk/src/kits/interface/Control.cpp rev 42794
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\file Control.h
|
\file Control.h
|
||||||
|
\ingroup interface
|
||||||
|
\ingroup libbe
|
||||||
\brief BControl class definition and support enums.
|
\brief BControl class definition and support enums.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\var B_CONTROL_ON
|
\var B_CONTROL_ON
|
||||||
Control on
|
|
||||||
|
Control on. Value equal to 1.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\var B_CONTROL_OFF
|
\var B_CONTROL_OFF
|
||||||
Control off
|
|
||||||
|
Control off. Value equal to 0.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2012 Haiku inc.
|
* Copyright 2011 Haiku Inc. All rights reserved.
|
||||||
* Distributed under the terms of the MIT License.
|
* Distributed under the terms of the MIT License.
|
||||||
*
|
*
|
||||||
* Documentation by:
|
* Authors:
|
||||||
* John Scipione, [email protected]
|
* John Scipione, [email protected]
|
||||||
*
|
*
|
||||||
* Corresponds to:
|
* Corresponds to:
|
||||||
@@ -12,6 +12,8 @@
|
|||||||
|
|
||||||
/*!
|
/*!
|
||||||
\file Dragger.h
|
\file Dragger.h
|
||||||
|
\ingroup interface
|
||||||
|
\ingroup libbe
|
||||||
\brief Provides the BDragger class.
|
\brief Provides the BDragger class.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|||||||
@@ -1,9 +1,10 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2013 Haiku inc.
|
* Copyright 2013 Haiku Inc. All rights reserved.
|
||||||
* Distributed under the terms of the MIT License.
|
* Distributed under the terms of the MIT License.
|
||||||
*
|
*
|
||||||
* Documentation by:
|
* Authors:
|
||||||
* John Scipione <[email protected]>
|
* John Scipione, [email protected]
|
||||||
|
*
|
||||||
* Corresponds to:
|
* Corresponds to:
|
||||||
* /trunk/headers/os/interface/Font.h hrev45178
|
* /trunk/headers/os/interface/Font.h hrev45178
|
||||||
* /trunk/src/kits/interface/Font.cpp hrev45178
|
* /trunk/src/kits/interface/Font.cpp hrev45178
|
||||||
@@ -12,6 +13,8 @@
|
|||||||
|
|
||||||
/*!
|
/*!
|
||||||
\file Font.h
|
\file Font.h
|
||||||
|
\ingroup interface
|
||||||
|
\ingroup libbe
|
||||||
\brief BFont class definition, unicode_block class definition, and
|
\brief BFont class definition, unicode_block class definition, and
|
||||||
font-related struct and enum definitions.
|
font-related struct and enum definitions.
|
||||||
*/
|
*/
|
||||||
@@ -19,12 +22,14 @@
|
|||||||
|
|
||||||
/*!
|
/*!
|
||||||
\var B_CHAR_SPACING
|
\var B_CHAR_SPACING
|
||||||
|
|
||||||
Position each character without adjustment. Best mode for printing.
|
Position each character without adjustment. Best mode for printing.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\var B_STRING_SPACING
|
\var B_STRING_SPACING
|
||||||
|
|
||||||
Optimizes the position of each character within it's space. Collisions
|
Optimizes the position of each character within it's space. Collisions
|
||||||
are unlikely but characters may touch each other. Best mode to use when
|
are unlikely but characters may touch each other. Best mode to use when
|
||||||
the screen needs to match what appears on the printed page.
|
the screen needs to match what appears on the printed page.
|
||||||
@@ -33,6 +38,7 @@
|
|||||||
|
|
||||||
/*!
|
/*!
|
||||||
\var B_BITMAP_SPACING
|
\var B_BITMAP_SPACING
|
||||||
|
|
||||||
The widths of the characters are chosen so that they never collide and
|
The widths of the characters are chosen so that they never collide and
|
||||||
rarely touch. Best mode for drawing small amounts of text.
|
rarely touch. Best mode for drawing small amounts of text.
|
||||||
*/
|
*/
|
||||||
@@ -40,225 +46,267 @@
|
|||||||
|
|
||||||
/*!
|
/*!
|
||||||
\var B_FIXED_SPACING
|
\var B_FIXED_SPACING
|
||||||
|
|
||||||
Positions characters at a constant width. Best mode for fixed-width fonts.
|
Positions characters at a constant width. Best mode for fixed-width fonts.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\enum font_direction
|
\enum font_direction
|
||||||
|
\ingroup interface
|
||||||
|
\ingroup libbe
|
||||||
|
|
||||||
Determines the direction of the text rendered by the font,
|
Determines the direction of the text rendered by the font,
|
||||||
left-to-right or right-to-left.
|
left-to-right or right-to-left.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\var font_direction B_FONT_LEFT_TO_RIGHT
|
\var font_direction B_FONT_LEFT_TO_RIGHT
|
||||||
|
|
||||||
Left to right.
|
Left to right.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\var font_direction B_FONT_RIGHT_TO_LEFT
|
\var font_direction B_FONT_RIGHT_TO_LEFT
|
||||||
|
|
||||||
Right to left.
|
Right to left.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\var B_DISABLE_ANTIALIASING
|
\var B_DISABLE_ANTIALIASING
|
||||||
|
|
||||||
Disable antialiasing. Used by BFont::Flags() and BFont::SetFlags().
|
Disable antialiasing. Used by BFont::Flags() and BFont::SetFlags().
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\var B_FORCE_ANTIALIASING
|
\var B_FORCE_ANTIALIASING
|
||||||
|
|
||||||
Force antialiasing. Used by BFont::Flags() and BFont::SetFlags().
|
Force antialiasing. Used by BFont::Flags() and BFont::SetFlags().
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\var B_TRUNCATE_END
|
\var B_TRUNCATE_END
|
||||||
|
|
||||||
Truncate from the end of the string.
|
Truncate from the end of the string.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\var B_TRUNCATE_BEGINNING
|
\var B_TRUNCATE_BEGINNING
|
||||||
|
|
||||||
Truncate from the beginning of the string.
|
Truncate from the beginning of the string.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\var B_TRUNCATE_MIDDLE
|
\var B_TRUNCATE_MIDDLE
|
||||||
|
|
||||||
Truncate from the middle of the string.
|
Truncate from the middle of the string.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\var B_TRUNCATE_SMART
|
\var B_TRUNCATE_SMART
|
||||||
|
|
||||||
Truncate while keeping each string unique.
|
Truncate while keeping each string unique.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\var B_UNICODE_UTF8
|
\var B_UNICODE_UTF8
|
||||||
|
|
||||||
UTF-8 font encoding.
|
UTF-8 font encoding.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\var B_ISO_8859_1
|
\var B_ISO_8859_1
|
||||||
|
|
||||||
ISO 8859-1 aka Latin 1 "Western European" font encoding.
|
ISO 8859-1 aka Latin 1 "Western European" font encoding.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\var B_ISO_8859_2
|
\var B_ISO_8859_2
|
||||||
|
|
||||||
ISO 8859-2 aka Latin 2 "Eastern European" font encoding.
|
ISO 8859-2 aka Latin 2 "Eastern European" font encoding.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\var B_ISO_8859_3
|
\var B_ISO_8859_3
|
||||||
|
|
||||||
ISO 8859-3 aka Latin 3 "South European" font encoding.
|
ISO 8859-3 aka Latin 3 "South European" font encoding.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\var B_ISO_8859_4
|
\var B_ISO_8859_4
|
||||||
|
|
||||||
ISO 8859-4 aka Latin 4 "Northern European" font encoding.
|
ISO 8859-4 aka Latin 4 "Northern European" font encoding.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\var B_ISO_8859_5
|
\var B_ISO_8859_5
|
||||||
|
|
||||||
ISO 8859-5 "Latin/Cyrillic" font encoding.
|
ISO 8859-5 "Latin/Cyrillic" font encoding.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\var B_ISO_8859_6
|
\var B_ISO_8859_6
|
||||||
|
|
||||||
ISO 8859-6 "Latin/Arabic" font encoding.
|
ISO 8859-6 "Latin/Arabic" font encoding.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\var B_ISO_8859_7
|
\var B_ISO_8859_7
|
||||||
|
|
||||||
ISO 8859-7 "Latin/Greek" font encoding.
|
ISO 8859-7 "Latin/Greek" font encoding.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\var B_ISO_8859_8
|
\var B_ISO_8859_8
|
||||||
|
|
||||||
ISO 8859-8 "Latin/Hebrew" font encoding.
|
ISO 8859-8 "Latin/Hebrew" font encoding.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\var B_ISO_8859_9
|
\var B_ISO_8859_9
|
||||||
|
|
||||||
ISO 8859-9 aka Latin 5 "Latin/Turkish" font encoding.
|
ISO 8859-9 aka Latin 5 "Latin/Turkish" font encoding.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\var B_ISO_8859_10
|
\var B_ISO_8859_10
|
||||||
|
|
||||||
ISO 8859-10 aka Latin 6 "Nordic" font encoding.
|
ISO 8859-10 aka Latin 6 "Nordic" font encoding.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\var B_MACINTOSH_ROMAN
|
\var B_MACINTOSH_ROMAN
|
||||||
|
|
||||||
Macintosh Roman font encoding.
|
Macintosh Roman font encoding.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\var B_HAS_TUNED_FONT
|
\var B_HAS_TUNED_FONT
|
||||||
flags for get_font_family() and get_font_style()
|
|
||||||
|
Flags for get_font_family() and get_font_style()
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\var B_IS_FIXED
|
\var B_IS_FIXED
|
||||||
|
|
||||||
flags for get_font_family() and get_font_style()
|
flags for get_font_family() and get_font_style()
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\var B_ITALIC_FACE
|
\var B_ITALIC_FACE
|
||||||
|
|
||||||
Italic font face flag.
|
Italic font face flag.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\var B_UNDERSCORE_FACE
|
\var B_UNDERSCORE_FACE
|
||||||
|
|
||||||
Underscore font face flag.
|
Underscore font face flag.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\var B_NEGATIVE_FACE
|
\var B_NEGATIVE_FACE
|
||||||
|
|
||||||
Negative font face flag.
|
Negative font face flag.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\var B_OUTLINED_FACE
|
\var B_OUTLINED_FACE
|
||||||
|
|
||||||
Outline font face flag.
|
Outline font face flag.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\var B_STRIKEOUT_FACE
|
\var B_STRIKEOUT_FACE
|
||||||
|
|
||||||
Strikeout font face flag.
|
Strikeout font face flag.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\var B_BOLD_FACE
|
\var B_BOLD_FACE
|
||||||
|
|
||||||
Bold font face flag.
|
Bold font face flag.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\var B_REGULAR_FACE
|
\var B_REGULAR_FACE
|
||||||
|
|
||||||
Regular font face flag.
|
Regular font face flag.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\var B_CONDENSED_FACE
|
\var B_CONDENSED_FACE
|
||||||
|
|
||||||
Condensed font face flag. Not in BeOS 5.
|
Condensed font face flag. Not in BeOS 5.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\var B_LIGHT_FACE
|
\var B_LIGHT_FACE
|
||||||
|
|
||||||
Light font face flag. Not in BeOS 5.
|
Light font face flag. Not in BeOS 5.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\var B_HEAVY_FACE
|
\var B_HEAVY_FACE
|
||||||
|
|
||||||
Heavy font face flag. Not in BeOS 5.
|
Heavy font face flag. Not in BeOS 5.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\enum font_metric_mode
|
\enum font_metric_mode
|
||||||
|
|
||||||
Font metric mode, screen or printing.
|
Font metric mode, screen or printing.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\var font_metric_mode B_SCREEN_METRIC
|
\var font_metric_mode B_SCREEN_METRIC
|
||||||
|
|
||||||
Screen font metric mode.
|
Screen font metric mode.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\var font_metric_mode B_PRINTING_METRIC
|
\var font_metric_mode B_PRINTING_METRIC
|
||||||
|
|
||||||
Printing font metric mode.
|
Printing font metric mode.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\enum font_file_format
|
\enum font_file_format
|
||||||
|
\ingroup interface
|
||||||
|
\ingroup libbe
|
||||||
|
|
||||||
Font file format, TrueType™ or PostScript™ Type1.
|
Font file format, TrueType™ or PostScript™ Type1.
|
||||||
|
|
||||||
\see BFont::FileFormat()
|
\see BFont::FileFormat()
|
||||||
@@ -266,17 +314,21 @@
|
|||||||
|
|
||||||
/*!
|
/*!
|
||||||
\var font_file_format B_TRUETYPE_WINDOWS
|
\var font_file_format B_TRUETYPE_WINDOWS
|
||||||
|
|
||||||
TrueType™ font file format.
|
TrueType™ font file format.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\var font_file_format B_POSTSCRIPT_TYPE1_WINDOWS
|
\var font_file_format B_POSTSCRIPT_TYPE1_WINDOWS
|
||||||
|
|
||||||
PostScript™ Type1 font file format.
|
PostScript™ Type1 font file format.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\class unicode_block
|
\class unicode_block
|
||||||
|
\ingroup interface
|
||||||
|
\ingroup libbe
|
||||||
\brief Describes the blocks of Unicode characters supported by a font.
|
\brief Describes the blocks of Unicode characters supported by a font.
|
||||||
|
|
||||||
\see BFont::Blocks()
|
\see BFont::Blocks()
|
||||||
@@ -392,6 +444,8 @@
|
|||||||
|
|
||||||
/*!
|
/*!
|
||||||
\struct edge_info
|
\struct edge_info
|
||||||
|
\ingroup interface
|
||||||
|
\ingroup libbe
|
||||||
\brief The distance that a character outline is inset from its escapement
|
\brief The distance that a character outline is inset from its escapement
|
||||||
boundaries.
|
boundaries.
|
||||||
|
|
||||||
@@ -404,20 +458,24 @@
|
|||||||
|
|
||||||
/*!
|
/*!
|
||||||
\var edge_info::left
|
\var edge_info::left
|
||||||
\brief The distance that the character outline is inset from the left
|
|
||||||
|
The distance that the character outline is inset from the left
|
||||||
escapement boundary.
|
escapement boundary.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\var edge_info::right
|
\var edge_info::right
|
||||||
\brief The distance that the character outline is inset from the right
|
|
||||||
|
The distance that the character outline is inset from the right
|
||||||
escapement boundary.
|
escapement boundary.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\struct font_height
|
\struct font_height
|
||||||
|
\ingroup interface
|
||||||
|
\ingroup libbe
|
||||||
\brief The amount of vertical space surrounding a character.
|
\brief The amount of vertical space surrounding a character.
|
||||||
|
|
||||||
\see BFont::GetHeight()
|
\see BFont::GetHeight()
|
||||||
@@ -426,24 +484,29 @@
|
|||||||
|
|
||||||
/*!
|
/*!
|
||||||
\var font_height::ascent
|
\var font_height::ascent
|
||||||
\brief The distance characters can ascend above the baseline.
|
|
||||||
|
The distance characters can ascend above the baseline.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\var font_height::descent
|
\var font_height::descent
|
||||||
\brief The distance characters can descend below the baseline.
|
|
||||||
|
The distance characters can descend below the baseline.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\var font_height::leading
|
\var font_height::leading
|
||||||
\brief The distance between lines, descent above to ascent below.
|
|
||||||
|
The distance between lines, descent above to ascent below.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\struct escapement_delta
|
\struct escapement_delta
|
||||||
|
\ingroup interface
|
||||||
|
\ingroup libbe
|
||||||
\brief The amount of horizontal space surrounding a character.
|
\brief The amount of horizontal space surrounding a character.
|
||||||
|
|
||||||
Escapements need to be multiplied by the font size to get the correct
|
Escapements need to be multiplied by the font size to get the correct
|
||||||
@@ -455,60 +518,72 @@
|
|||||||
|
|
||||||
/*!
|
/*!
|
||||||
\var escapement_delta::nonspace
|
\var escapement_delta::nonspace
|
||||||
\brief The amount of space surrounding a character with a visible glyph.
|
|
||||||
|
The amount of space surrounding a character with a visible glyph.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\var escapement_delta::space
|
\var escapement_delta::space
|
||||||
\brief The amount of space surrounding a whitespace character, for example
|
|
||||||
|
The amount of space surrounding a whitespace character, for example
|
||||||
\c B_TAB and \c B_SPACE.
|
\c B_TAB and \c B_SPACE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\struct font_cache_info
|
\struct font_cache_info
|
||||||
|
\ingroup interface
|
||||||
|
\ingroup libbe
|
||||||
\brief Font cache parameters.
|
\brief Font cache parameters.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\var font_cache_info::sheared_font_penalty
|
\var font_cache_info::sheared_font_penalty
|
||||||
\brief Sheared font penalty.
|
|
||||||
|
Sheared font penalty.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\var font_cache_info::rotated_font_penalty
|
\var font_cache_info::rotated_font_penalty
|
||||||
\brief Rotated font penalty.
|
|
||||||
|
Rotated font penalty.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\var font_cache_info::oversize_threshold
|
\var font_cache_info::oversize_threshold
|
||||||
\brief Oversize threshold.
|
|
||||||
|
Oversize threshold.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\var font_cache_info::oversize_penalty
|
\var font_cache_info::oversize_penalty
|
||||||
\brief Oversize penalty.
|
|
||||||
|
Oversize penalty.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\var font_cache_info::cache_size
|
\var font_cache_info::cache_size
|
||||||
\brief Cache size.
|
|
||||||
|
Cache size.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\var font_cache_info::spacing_size_threshold
|
\var font_cache_info::spacing_size_threshold
|
||||||
\brief Spacing size threshold.
|
|
||||||
|
Spacing size threshold.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\struct tuned_font_info
|
\struct tuned_font_info
|
||||||
|
\ingroup interface
|
||||||
|
\ingroup libbe
|
||||||
\brief Tuning information of fonts used to make it look better when
|
\brief Tuning information of fonts used to make it look better when
|
||||||
displayed on-screen.
|
displayed on-screen.
|
||||||
|
|
||||||
@@ -519,30 +594,35 @@
|
|||||||
|
|
||||||
/*!
|
/*!
|
||||||
\var tuned_font_info::size
|
\var tuned_font_info::size
|
||||||
\brief Font size.
|
|
||||||
|
Font size.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\var tuned_font_info::shear
|
\var tuned_font_info::shear
|
||||||
\brief Font shear.
|
|
||||||
|
Font shear.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\var tuned_font_info::rotation
|
\var tuned_font_info::rotation
|
||||||
\brief Font rotation.
|
|
||||||
|
Font rotation.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\var tuned_font_info::flags
|
\var tuned_font_info::flags
|
||||||
\brief Font flags.
|
|
||||||
|
Font flags.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\var tuned_font_info::face
|
\var tuned_font_info::face
|
||||||
\brief Font face.
|
|
||||||
|
Font face.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,17 +1,21 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2010, Haiku, Inc. All Rights Reserved.
|
* Copyright 2010 Haiku, Inc. All rights reserved.
|
||||||
* Distributed under the terms of the MIT License.
|
* Distributed under the terms of the MIT License.
|
||||||
*
|
*
|
||||||
* Documentation by:
|
* Authors:
|
||||||
* Alex Wilson <[email protected]>
|
* Alex Wilson, [email protected]
|
||||||
|
*
|
||||||
* Corresponds to:
|
* Corresponds to:
|
||||||
* /trunk/headers/os/interface/GridLayout.h rev 38207
|
* headers/os/interface/GridLayout.h rev 38207
|
||||||
* /trunk/src/kits/interface/GridLayout.cpp rev 38207
|
* src/kits/interface/GridLayout.cpp rev 38207
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\file GridLayout.h
|
\file GridLayout.h
|
||||||
|
\ingroup interface
|
||||||
|
\ingroup layout
|
||||||
|
\ingroup libbe
|
||||||
\brief Provides the BGridLayout class.
|
\brief Provides the BGridLayout class.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@@ -21,7 +25,6 @@
|
|||||||
\ingroup interface
|
\ingroup interface
|
||||||
\ingroup layout
|
\ingroup layout
|
||||||
\ingroup libbe
|
\ingroup libbe
|
||||||
|
|
||||||
\brief The BGridLayout class a BLayout subclass that arranges the items it
|
\brief The BGridLayout class a BLayout subclass that arranges the items it
|
||||||
holds in a grid.
|
holds in a grid.
|
||||||
|
|
||||||
|
|||||||
@@ -1,17 +1,21 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2010, Haiku, Inc. All Rights Reserved.
|
* Copyright 2010 Haiku, Inc. All rights reserved.
|
||||||
* Distributed under the terms of the MIT License.
|
* Distributed under the terms of the MIT License.
|
||||||
*
|
*
|
||||||
* Documentation by:
|
* Authors:
|
||||||
* Alex Wilson <[email protected]>
|
* Alex Wilson, [email protected]
|
||||||
|
*
|
||||||
* Corresponds to:
|
* Corresponds to:
|
||||||
* /trunk/headers/os/interface/GroupLayout.h rev 38207
|
* headers/os/interface/GroupLayout.h rev 38207
|
||||||
* /trunk/src/kits/interface/GroupLayout.cpp rev 38207
|
* src/kits/interface/GroupLayout.cpp rev 38207
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\file GroupLayout.h
|
\file GroupLayout.h
|
||||||
|
\ingroup interface
|
||||||
|
\ingroup layout
|
||||||
|
\ingroup libbe
|
||||||
\brief Describes the BGroupLayout class.
|
\brief Describes the BGroupLayout class.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@@ -47,7 +51,8 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*! \fn BGroupLayout::BGroupLayout(enum orientation orientation, float spacing)
|
/*!
|
||||||
|
\fn BGroupLayout::BGroupLayout(enum orientation orientation, float spacing)
|
||||||
\brief Creates a new BGroupLayout.
|
\brief Creates a new BGroupLayout.
|
||||||
|
|
||||||
\param orientation The #orientation of this BGroupLayout.
|
\param orientation The #orientation of this BGroupLayout.
|
||||||
@@ -55,52 +60,61 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*! \fn BGroupLayout::~BGroupLayout()
|
/*!
|
||||||
|
\fn BGroupLayout::~BGroupLayout()
|
||||||
\brief Destructor method.
|
\brief Destructor method.
|
||||||
|
|
||||||
Standard Destructor.
|
Standard Destructor.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*! \fn BGroupLayout::BGroupLayout(BMessage* from)
|
/*!
|
||||||
|
\fn BGroupLayout::BGroupLayout(BMessage* from)
|
||||||
\brief Archive constructor.
|
\brief Archive constructor.
|
||||||
|
|
||||||
\param from The message to construct the BGroupLayout from.
|
\param from The message to construct the BGroupLayout from.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*! \fn float BGroupLayout::Spacing() const
|
/*!
|
||||||
|
\fn float BGroupLayout::Spacing() const
|
||||||
\brief Get the amount of spacing (in pixels) between each item.
|
\brief Get the amount of spacing (in pixels) between each item.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*! \fn void BGroupLayout::SetSpacing(float spacing)
|
/*!
|
||||||
|
\fn void BGroupLayout::SetSpacing(float spacing)
|
||||||
\brief Set the amount of spacing (in pixels) between each item.
|
\brief Set the amount of spacing (in pixels) between each item.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*! \fn orientation BGroupLayout::Orientation() const
|
/*!
|
||||||
|
\fn orientation BGroupLayout::Orientation() const
|
||||||
\brief Get the #orientation of this BGroupLayout.
|
\brief Get the #orientation of this BGroupLayout.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*! \fn void BGroupLayout::SetOrientation(enum orientation orientation)
|
/*!
|
||||||
|
\fn void BGroupLayout::SetOrientation(enum orientation orientation)
|
||||||
\brief Set the #orientation of this BGroupLayout.
|
\brief Set the #orientation of this BGroupLayout.
|
||||||
\param orientation The new #orientation of this BGroupLayout.
|
\param orientation The new #orientation of this BGroupLayout.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*! \fn float BGroupLayout::ItemWeight(int32 index) const
|
/*!
|
||||||
|
\fn float BGroupLayout::ItemWeight(int32 index) const
|
||||||
\brief Get the weight of the item at \a index.
|
\brief Get the weight of the item at \a index.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*! \fn void BGroupLayout::SetItemWeight(int32 index, float weight)
|
/*!
|
||||||
|
\fn void BGroupLayout::SetItemWeight(int32 index, float weight)
|
||||||
\brief Set the weight of the item at \a index.
|
\brief Set the weight of the item at \a index.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*! \fn BLayoutItem* BGroupLayout::AddView(BView* child)
|
/*!
|
||||||
|
\fn BLayoutItem* BGroupLayout::AddView(BView* child)
|
||||||
\brief Adds \a child to this layout as the last item. In a vertical
|
\brief Adds \a child to this layout as the last item. In a vertical
|
||||||
BGroupLayout, \a child will be on the right, in a horizontal
|
BGroupLayout, \a child will be on the right, in a horizontal
|
||||||
BGroupLayout, \a child will be at the bottom.
|
BGroupLayout, \a child will be at the bottom.
|
||||||
@@ -109,27 +123,31 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*! \fn BLayoutItem* BGroupLayout::AddView(int32 index, BView* child)
|
/*!
|
||||||
|
\fn BLayoutItem* BGroupLayout::AddView(int32 index, BView* child)
|
||||||
\brief Adds \a child to this layout at \a index.
|
\brief Adds \a child to this layout at \a index.
|
||||||
|
|
||||||
\a child will have a weight of \c 1.0f.
|
\a child will have a weight of \c 1.0f.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*! \fn BLayoutItem* BGroupLayout::AddView(BView* child, float weight)
|
/*!
|
||||||
|
\fn BLayoutItem* BGroupLayout::AddView(BView* child, float weight)
|
||||||
\brief Adds \a child to the end of this layout with a weight of
|
\brief Adds \a child to the end of this layout with a weight of
|
||||||
\a weight.
|
\a weight.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*! \fn BLayoutItem* BGroupLayout::AddView(int32 index, BView* child,
|
/*!
|
||||||
|
\fn BLayoutItem* BGroupLayout::AddView(int32 index, BView* child,
|
||||||
float weight)
|
float weight)
|
||||||
\brief Adds \a child this layout at \a index with a weight of
|
\brief Adds \a child this layout at \a index with a weight of
|
||||||
\a weight.
|
\a weight.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*! \fn bool BGroupLayout::AddItem(BLayoutItem* item)
|
/*!
|
||||||
|
\fn bool BGroupLayout::AddItem(BLayoutItem* item)
|
||||||
\brief Adds \a item to this layout as the last item. In a vertical
|
\brief Adds \a item to this layout as the last item. In a vertical
|
||||||
BGroupLayout, \a item will be on the right, in a horizontal
|
BGroupLayout, \a item will be on the right, in a horizontal
|
||||||
BGroupLayout, \a item will be at the bottom.
|
BGroupLayout, \a item will be at the bottom.
|
||||||
@@ -138,20 +156,23 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*! \fn bool BGroupLayout::AddItem(int32 index, BLayoutItem* item)
|
/*!
|
||||||
|
\fn bool BGroupLayout::AddItem(int32 index, BLayoutItem* item)
|
||||||
\brief Adds \a item to this layout at \a index.
|
\brief Adds \a item to this layout at \a index.
|
||||||
|
|
||||||
\a item will have a weight of \c 1.0f.
|
\a item will have a weight of \c 1.0f.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*! \fn bool BGroupLayout::AddItem(BLayoutItem* item, float weight)
|
/*!
|
||||||
|
\fn bool BGroupLayout::AddItem(BLayoutItem* item, float weight)
|
||||||
\brief Adds \a item to the end of this layout with a weight of
|
\brief Adds \a item to the end of this layout with a weight of
|
||||||
\a weight.
|
\a weight.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*! \fn bool BGroupLayout::AddItem(int32 index, BLayoutItem* item, float weight)
|
/*!
|
||||||
|
\fn bool BGroupLayout::AddItem(int32 index, BLayoutItem* item, float weight)
|
||||||
\brief Adds \a item this layout at \a index with a weight of
|
\brief Adds \a item this layout at \a index with a weight of
|
||||||
\a weight.
|
\a weight.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -1,17 +1,20 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2011, Haiku, Inc. All Rights Reserved.
|
* Copyright 2011 Haiku, Inc. All rights reserved.
|
||||||
* Distributed under the terms of the MIT License.
|
* Distributed under the terms of the MIT License.
|
||||||
*
|
*
|
||||||
* Documentation by:
|
* Authors:
|
||||||
* Adrien Destugues <[email protected]>
|
* Adrien Destugues, [email protected]
|
||||||
|
*
|
||||||
* Corresponds to:
|
* Corresponds to:
|
||||||
* /trunk/headers/os/interface/IconUtils.h rev 42600
|
* headers/os/interface/IconUtils.h rev 42600
|
||||||
* /trunk/src/kits/interface/IconUtils.cpp rev 42600
|
* src/kits/interface/IconUtils.cpp rev 42600
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\file IconUtils.h
|
\file IconUtils.h
|
||||||
|
\ingroup interface
|
||||||
|
\ingroup libbe
|
||||||
\brief Vector icon handling utility class
|
\brief Vector icon handling utility class
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|||||||
@@ -1,20 +1,35 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2001-2011, Haiku, Inc. All rights reserved.
|
* Copyright 2011 Haiku, Inc. All rights reserved.
|
||||||
* Distributed under the terms of the MIT License.
|
* Distributed under the terms of the MIT License.
|
||||||
|
*
|
||||||
|
* Authors:
|
||||||
|
* John Scipione, [email protected]
|
||||||
|
*
|
||||||
|
* Corresponds to:
|
||||||
|
* headers/os/interface/InterfaceDefs.h rev 43230
|
||||||
|
* src/kits/interface/InterfaceDefs.cpp rev 43230
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\file InterfaceDefs.h
|
\file InterfaceDefs.h
|
||||||
|
\ingroup interface
|
||||||
|
\ingroup libbe
|
||||||
\brief Defines standard interface definitions for controls.
|
\brief Defines standard interface definitions for controls.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\enum border_style
|
\enum border_style
|
||||||
|
\ingroup interface
|
||||||
|
\ingroup libbe
|
||||||
|
|
||||||
Collection of flags that determine the border style drawn around a BBox.
|
Collection of flags that determine the border style drawn around a BBox.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*! \var border_style B_PLAIN_BORDER
|
|
||||||
|
/*!
|
||||||
|
\var border_style B_PLAIN_BORDER
|
||||||
|
|
||||||
\image html B_PLAIN_BORDER.png
|
\image html B_PLAIN_BORDER.png
|
||||||
|
|
||||||
@@ -23,7 +38,9 @@
|
|||||||
is raised slightly above the surrounding surface.
|
is raised slightly above the surrounding surface.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*! \var border_style B_FANCY_BORDER
|
|
||||||
|
/*!
|
||||||
|
\var border_style B_FANCY_BORDER
|
||||||
|
|
||||||
\image html B_FANCY_BORDER.png
|
\image html B_FANCY_BORDER.png
|
||||||
|
|
||||||
@@ -31,45 +48,61 @@
|
|||||||
in appearance on all four sides. This is the default appearance.
|
in appearance on all four sides. This is the default appearance.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*! \var border_style B_NO_BORDER
|
|
||||||
|
/*!
|
||||||
|
\var border_style B_NO_BORDER
|
||||||
|
|
||||||
No border.
|
No border.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\enum orientation
|
\enum orientation
|
||||||
|
|
||||||
Orientation flag sets the layout to either horizontal or vertical
|
Orientation flag sets the layout to either horizontal or vertical
|
||||||
alignment.
|
alignment.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\var orientation B_HORIZONTAL
|
\var orientation B_HORIZONTAL
|
||||||
|
|
||||||
Horizontal alignment
|
Horizontal alignment
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*! \var orientation B_VERTICAL
|
|
||||||
|
/*!
|
||||||
|
\var orientation B_VERTICAL
|
||||||
|
|
||||||
Vertical alignment
|
Vertical alignment
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\enum button_width
|
\enum button_width
|
||||||
|
|
||||||
Collection of flags that determine how wide to draw the buttons in a
|
Collection of flags that determine how wide to draw the buttons in a
|
||||||
BAlert dialog.
|
BAlert dialog.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\var button_width B_WIDTH_AS_USUAL
|
\var button_width B_WIDTH_AS_USUAL
|
||||||
|
|
||||||
Set the width of each button based on the standard width.
|
Set the width of each button based on the standard width.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\var button_width B_WIDTH_FROM_WIDEST
|
\var button_width B_WIDTH_FROM_WIDEST
|
||||||
|
|
||||||
Set the width of each button based on the width of the widest button.
|
Set the width of each button based on the width of the widest button.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\var button_width B_WIDTH_FROM_LABEL
|
\var button_width B_WIDTH_FROM_LABEL
|
||||||
|
|
||||||
Set the width of each button to accomidate the width of the button's
|
Set the width of each button to accomidate the width of the button's
|
||||||
label.
|
label.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -1,17 +1,21 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2010, Haiku, Inc. All Rights Reserved.
|
* Copyright 2010 Haiku Inc. All rights reserved.
|
||||||
* Distributed under the terms of the MIT License.
|
* Distributed under the terms of the MIT License.
|
||||||
*
|
*
|
||||||
* Documentation by:
|
* Authors:
|
||||||
* Alex Wilson <[email protected]>
|
* Alex Wilson, [email protected]
|
||||||
|
*
|
||||||
* Corresponds to:
|
* Corresponds to:
|
||||||
* /trunk/headers/os/interface/Layout.h rev 38207
|
* headers/os/interface/Layout.h rev 38207
|
||||||
* /trunk/src/kits/interface/Layout.cpp rev 38207
|
* src/kits/interface/Layout.cpp rev 38207
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\file Layout.h
|
\file Layout.h
|
||||||
|
\ingroup interface
|
||||||
|
\ingroup layout
|
||||||
|
\ingroup libbe
|
||||||
\brief Defines the BLayout class.
|
\brief Defines the BLayout 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.
|
* Distributed under the terms of the MIT License.
|
||||||
*
|
*
|
||||||
* Authors:
|
* Authors:
|
||||||
@@ -14,6 +14,9 @@
|
|||||||
|
|
||||||
/*!
|
/*!
|
||||||
\file GroupLayoutBuilder.h
|
\file GroupLayoutBuilder.h
|
||||||
|
\ingroup interface
|
||||||
|
\ingroup layout
|
||||||
|
\ingroup libbe
|
||||||
\brief Provides the BLayoutBuilder::Group<> class.
|
\brief Provides the BLayoutBuilder::Group<> class.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@@ -22,6 +25,7 @@
|
|||||||
\class BLayoutBuilder::Group<>
|
\class BLayoutBuilder::Group<>
|
||||||
\ingroup interface
|
\ingroup interface
|
||||||
\ingroup layout
|
\ingroup layout
|
||||||
|
\ingroup libbe
|
||||||
\brief BLayoutBuilder::Base subclass for building BGroupLayouts.
|
\brief BLayoutBuilder::Base subclass for building BGroupLayouts.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|||||||
@@ -1,13 +1,27 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2010, Haiku, Inc. All Rights Reserved.
|
* Copyright 2010 Haiku Inc. All rights reserved.
|
||||||
* Distributed under the terms of the MIT License.
|
* Distributed under the terms of the MIT License.
|
||||||
*
|
*
|
||||||
* Documentation by:
|
* Authors:
|
||||||
* Alex Wilson <[email protected]>
|
* Alex Wilson, [email protected]
|
||||||
|
*
|
||||||
|
* Corresponds to:
|
||||||
|
* headers/os/interface/LayoutBuilder.h rev 38207
|
||||||
|
* src/kits/interface/LayoutBuilder.cpp rev 38207
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*! \class BLayoutBuilder::Base<>
|
/*!
|
||||||
|
\file LayoutBuilder.h
|
||||||
|
\ingroup interface
|
||||||
|
\ingroup layout
|
||||||
|
\ingroup libbe
|
||||||
|
\brief Defines the BLayoutBuilder templates.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/*!
|
||||||
|
\class BLayoutBuilder::Base<>
|
||||||
\ingroup interface
|
\ingroup interface
|
||||||
\ingroup layout
|
\ingroup layout
|
||||||
\brief Base for all other layout builders in the BLayoutBuilder namespace.
|
\brief Base for all other layout builders in the BLayoutBuilder namespace.
|
||||||
|
|||||||
@@ -1,18 +1,22 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2010, Haiku, Inc. All Rights Reserved.
|
* Copyright 2010 Haiku, Inc. All rights reserved.
|
||||||
* Distributed under the terms of the MIT License.
|
* Distributed under the terms of the MIT License.
|
||||||
*
|
*
|
||||||
* Documentation by:
|
* Authors:
|
||||||
* Alex Wilson <[email protected]>
|
* Alex Wilson, [email protected]
|
||||||
|
*
|
||||||
* Corresponds to:
|
* Corresponds to:
|
||||||
* /trunk/headers/os/interface/LayoutItem.h rev 38207
|
* headers/os/interface/LayoutItem.h rev 38207
|
||||||
* /trunk/src/kits/interface/LayoutItem.cpp rev 38207
|
* src/kits/interface/LayoutItem.cpp rev 38207
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\file LayoutItem.h
|
\file LayoutItem.h
|
||||||
\brief Describes the BLayoutItem class
|
\ingroup interface
|
||||||
|
\ingroup layout
|
||||||
|
\ingroup libbe
|
||||||
|
\brief Describes the BLayoutItem class.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
@@ -21,7 +25,6 @@
|
|||||||
\ingroup interface
|
\ingroup interface
|
||||||
\ingroup layout
|
\ingroup layout
|
||||||
\ingroup libbe
|
\ingroup libbe
|
||||||
|
|
||||||
\brief Abstract class representing things that are positionable and
|
\brief Abstract class representing things that are positionable and
|
||||||
resizable by objects of the BLayout class.
|
resizable by objects of the BLayout class.
|
||||||
|
|
||||||
|
|||||||
@@ -1,11 +1,12 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2011, Haiku inc.
|
* Copyright 2011 Haiku, Inc. All rights reserved.
|
||||||
* Distributed under the terms of the MIT Licence.
|
* Distributed under the terms of the MIT License.
|
||||||
*
|
*
|
||||||
* Documentation by:
|
* Authors:
|
||||||
* Stefano Ceccherini, [email protected]
|
* Stefano Ceccherini, [email protected]
|
||||||
* Axel Dörfler, [email protected]
|
* Axel Dörfler, [email protected]
|
||||||
* John Scipione, [email protected]
|
* John Scipione, [email protected]
|
||||||
|
*
|
||||||
* Corresponds to:
|
* Corresponds to:
|
||||||
* /trunk/headers/os/interface/Screen.h rev 42759
|
* /trunk/headers/os/interface/Screen.h rev 42759
|
||||||
* /trunk/src/kits/interface/Screen.cpp rev 42759
|
* /trunk/src/kits/interface/Screen.cpp rev 42759
|
||||||
@@ -14,6 +15,8 @@
|
|||||||
|
|
||||||
/*!
|
/*!
|
||||||
\file Screen.h
|
\file Screen.h
|
||||||
|
\ingroup interface
|
||||||
|
\ingroup libbe
|
||||||
\brief Defines the BScreen class and support structures.
|
\brief Defines the BScreen class and support structures.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@@ -21,6 +24,7 @@
|
|||||||
/*!
|
/*!
|
||||||
\class BScreen
|
\class BScreen
|
||||||
\ingroup interface
|
\ingroup interface
|
||||||
|
\ingroup libbe
|
||||||
\brief The BScreen class provides methods to retrieve and change display
|
\brief The BScreen class provides methods to retrieve and change display
|
||||||
settings.
|
settings.
|
||||||
|
|
||||||
@@ -126,7 +130,8 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*! \fn color_space BScreen::ColorSpace()
|
/*!
|
||||||
|
\fn color_space BScreen::ColorSpace()
|
||||||
\brief Gets the color_space of the display.
|
\brief Gets the color_space of the display.
|
||||||
|
|
||||||
\return \c B_CMAP8, \c B_RGB15, \c B_RGB32, or \c B_NO_COLOR_SPACE
|
\return \c B_CMAP8, \c B_RGB15, \c B_RGB32, or \c B_NO_COLOR_SPACE
|
||||||
|
|||||||
@@ -1,17 +1,21 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2010, Haiku, Inc. All Rights Reserved.
|
* Copyright 2010 Haiku, Inc. All rights reserved.
|
||||||
* Distributed under the terms of the MIT License.
|
* Distributed under the terms of the MIT License.
|
||||||
*
|
*
|
||||||
* Documentation by:
|
* Authors:
|
||||||
* Alex Wilson <[email protected]>
|
* Alex Wilson, [email protected]
|
||||||
|
*
|
||||||
* Corresponds to:
|
* Corresponds to:
|
||||||
* /trunk/headers/os/interface/TwoDimensionalLayout.h rev 38207
|
* headers/os/interface/TwoDimensionalLayout.h rev 38207
|
||||||
* /trunk/src/kits/interface/TwoDimensionalLayout.cpp rev 38207
|
* src/kits/interface/TwoDimensionalLayout.cpp rev 38207
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\file TwoDimensionalLayout.h
|
\file TwoDimensionalLayout.h
|
||||||
|
\ingroup interface
|
||||||
|
\ingroup layout
|
||||||
|
\ingroup libbe
|
||||||
\brief Defines the BTwoDimensionalLayout class.
|
\brief Defines the BTwoDimensionalLayout class.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@@ -21,7 +25,6 @@
|
|||||||
\ingroup interface
|
\ingroup interface
|
||||||
\ingroup layout
|
\ingroup layout
|
||||||
\ingroup libbe
|
\ingroup libbe
|
||||||
|
|
||||||
\brief Abstract BLayout subclass arranging items within rows and columns.
|
\brief Abstract BLayout subclass arranging items within rows and columns.
|
||||||
|
|
||||||
This class manages all the tricky work of actually positioning/resizing
|
This class manages all the tricky work of actually positioning/resizing
|
||||||
|
|||||||
@@ -1,18 +1,21 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2011, Haiku inc.
|
* Copyright 2011 Haiku, Inc. All rights reserved.
|
||||||
* Distributed under the terms of the MIT License.
|
* Distributed under the terms of the MIT License.
|
||||||
*
|
*
|
||||||
* Documentation by:
|
* Authors:
|
||||||
* John Scipione, [email protected]
|
* John Scipione, [email protected]
|
||||||
|
*
|
||||||
* Corresponds to:
|
* Corresponds to:
|
||||||
* /trunk/headers/os/interface/View.h rev 42794
|
* headers/os/interface/View.h rev 42794
|
||||||
* /trunk/src/kits/interface/View.cpp rev 42794
|
* src/kits/interface/View.cpp rev 42794
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\file View.h
|
\file View.h
|
||||||
\brief BView class definition and support enums.
|
\ingroup interface
|
||||||
|
\ingroup libbe
|
||||||
|
\brief BView class definition and support data structures.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
@@ -20,7 +23,6 @@
|
|||||||
\class BView
|
\class BView
|
||||||
\ingroup interface
|
\ingroup interface
|
||||||
\ingroup libbe
|
\ingroup libbe
|
||||||
|
|
||||||
\brief View base class.
|
\brief View base class.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2010, Haiku, Inc. All Rights Reserved.
|
* Copyright 2010 Haiku, Inc. All rights reserved.
|
||||||
* Distributed under the terms of the MIT License.
|
* Distributed under the terms of the MIT License.
|
||||||
*
|
*
|
||||||
* Documentation by:
|
* Authors:
|
||||||
* Alex Wilson <[email protected]>
|
* Alex Wilson, [email protected]
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
@@ -12,15 +12,15 @@
|
|||||||
|
|
||||||
The Interface Kit holds all the classes you'll need to develop a GUI.
|
The Interface Kit holds all the classes you'll need to develop a GUI.
|
||||||
Building on the messaging facilities provided by the Application Kit,
|
Building on the messaging facilities provided by the Application Kit,
|
||||||
the Inteface Kit can be used to create a responsive and attractive graphical
|
the Interface Kit can be used to create a responsive and attractive
|
||||||
user interface.
|
graphical user interface.
|
||||||
|
|
||||||
The most important class in the Interface Kit is the BView class, which
|
The most important class in the Interface Kit is the BView class, which
|
||||||
handles drawing and user interaction. Pointer and keyboard events are
|
handles drawing and user interaction. Pointer and keyboard events are
|
||||||
processed in this class.
|
processed in this class.
|
||||||
|
|
||||||
Another important class is the BWindow class, which holds BViews and makes
|
Another important class is the BWindow class, which holds BViews and makes
|
||||||
them visibile to the user. The BWindow class also handles BView focusing
|
them visible to the user. The BWindow class also handles BView focusing
|
||||||
and BMessage dispatching, among other things.
|
and BMessage dispatching, among other things.
|
||||||
|
|
||||||
A new addition Haiku has added over the BeOS API is the Layout API, which
|
A new addition Haiku has added over the BeOS API is the Layout API, which
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2010, Haiku, Inc. All Rights Reserved.
|
* Copyright 2010 Haiku, Inc. All rights reserved.
|
||||||
* Distributed under the terms of the MIT License.
|
* Distributed under the terms of the MIT License.
|
||||||
*
|
*
|
||||||
* Documentation by:
|
* Authors:
|
||||||
* Alex Wilson <[email protected]>
|
* Alex Wilson, [email protected]
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
@@ -13,7 +13,8 @@
|
|||||||
Haiku's Layout API is centered around the BLayoutItem and BLayout classes.
|
Haiku's Layout API is centered around the BLayoutItem and BLayout classes.
|
||||||
The BLayoutItem class represents thing that can be managed by a BLayout,
|
The BLayoutItem class represents thing that can be managed by a BLayout,
|
||||||
which is itself a BLayoutItem. Before we go any further, it is a good idea
|
which is itself a BLayoutItem. Before we go any further, it is a good idea
|
||||||
to familiarize yourself with the different BLayouts available in Haiku:
|
to familiarize yourself with the different BLayout classes available in
|
||||||
|
Haiku:
|
||||||
\li BGroupLayout
|
\li BGroupLayout
|
||||||
\li BGridLayout
|
\li BGridLayout
|
||||||
\li BCardLayout
|
\li BCardLayout
|
||||||
@@ -21,14 +22,14 @@
|
|||||||
|
|
||||||
You'll notice that BSplitView is not actually a BLayout, but a BView. The
|
You'll notice that BSplitView is not actually a BLayout, but a BView. The
|
||||||
BSplitView class uses a custom BLayout behind the scenes, but because it
|
BSplitView class uses a custom BLayout behind the scenes, but because it
|
||||||
must also be able to draw, a BView is required. Other BLayouts have
|
must also be able to draw, a BView is required. Other BLayout objects have
|
||||||
BViews that can be used for convenience.
|
BView objects that can be used for convenience.
|
||||||
\li BGroupLayout : BGroupView
|
\li BGroupLayout : BGroupView
|
||||||
\li BGridLayout : BGridView
|
\li BGridLayout : BGridView
|
||||||
\li BCardLayout : BTabView (also provides on-screen tabs)
|
\li BCardLayout : BTabView (also provides on-screen tabs)
|
||||||
|
|
||||||
Although it is not necessary to use these classes to make use of the
|
Although it is not necessary to use these classes to make use of the
|
||||||
coresponding layouts, it does make things easier.
|
corresponding layouts, it does make things easier.
|
||||||
|
|
||||||
Once you have an understanding of what each BLayout does, you can start
|
Once you have an understanding of what each BLayout does, you can start
|
||||||
designing an interface with them. Let's consider a very simple window,
|
designing an interface with them. Let's consider a very simple window,
|
||||||
@@ -39,8 +40,7 @@
|
|||||||
So, let's review the BGroupLayout constructor:
|
So, let's review the BGroupLayout constructor:
|
||||||
|
|
||||||
\code
|
\code
|
||||||
BGroupLayout(enum orientation orientation, float spacing
|
BGroupLayout(enum orientation orientation, float spacing = B_USE_DEFAULT_SPACING)
|
||||||
= B_USE_DEFAULT_SPACING)
|
|
||||||
\endcode
|
\endcode
|
||||||
|
|
||||||
Because we only have one item in this layout, \c orientation and \c spacing
|
Because we only have one item in this layout, \c orientation and \c spacing
|
||||||
@@ -67,7 +67,7 @@ group->AddView(MakeStringView("Haiku rocks!"));
|
|||||||
|
|
||||||
That does it! Now we've got a BWindow with a horizontal BGroupLayout holding
|
That does it! Now we've got a BWindow with a horizontal BGroupLayout holding
|
||||||
a single BView. However, if we want to ensure that our BStringView is always
|
a single BView. However, if we want to ensure that our BStringView is always
|
||||||
centered in the window, we should give it an explict BAlignment. So that
|
centered in the window, we should give it an explicit BAlignment. So the
|
||||||
last line becomes:
|
last line becomes:
|
||||||
|
|
||||||
\code
|
\code
|
||||||
@@ -77,7 +77,7 @@ stringView->SetExplicitAlignment(BAlignment(B_ALIGN_HORIZONTAL_CENTER,
|
|||||||
\endcode
|
\endcode
|
||||||
|
|
||||||
Now our BStringView will always be right in the middle of the space
|
Now our BStringView will always be right in the middle of the space
|
||||||
alloted to it, which at the moment is the whole of \c window.
|
allotted to it, which at the moment is the whole of \c window.
|
||||||
|
|
||||||
Now let's take things one step further, and add a BMenuBar into the mix.
|
Now let's take things one step further, and add a BMenuBar into the mix.
|
||||||
|
|
||||||
@@ -118,8 +118,8 @@ group->AddItem(grid);
|
|||||||
\endcode
|
\endcode
|
||||||
|
|
||||||
You'll notice that we've added \c grid directly to \c group. This means that
|
You'll notice that we've added \c grid directly to \c group. This means that
|
||||||
any BViews we add to \c grid will become children of \c window, but will be
|
any BView objects we add to \c grid will become children of \c window, but
|
||||||
positioned by \c grid.
|
will be positioned by \c grid.
|
||||||
|
|
||||||
\code
|
\code
|
||||||
grid->AddView(MakeSmallButton(), 0, 0);
|
grid->AddView(MakeSmallButton(), 0, 0);
|
||||||
@@ -128,7 +128,7 @@ grid->AddView(MakeBigButton(), 0, 1, 2, 1);
|
|||||||
grid->AddView(MakeSmallButton(), 1, 2);
|
grid->AddView(MakeSmallButton(), 1, 2);
|
||||||
\endcode
|
\endcode
|
||||||
|
|
||||||
Now we've got a nice grid of BButtons, let's go over it quickly:
|
Now we've got a nice grid of BButton objects, let's go over it quickly:
|
||||||
\li \c grid has two columns and three rows.
|
\li \c grid has two columns and three rows.
|
||||||
\li The cells (0, 0), (1, 0), and (1, 2) hold small buttons
|
\li The cells (0, 0), (1, 0), and (1, 2) hold small buttons
|
||||||
\li The cells (0, 1) and (1, 1) hold a single button that spans both
|
\li The cells (0, 1) and (1, 1) hold a single button that spans both
|
||||||
@@ -156,6 +156,4 @@ BLayoutBuilder::Group<>(window, B_VERTICAL)
|
|||||||
This is only one way that you could build this layout, but it is probably
|
This is only one way that you could build this layout, but it is probably
|
||||||
the most succinct. Functionally, this is equivalent to all the previous
|
the most succinct. Functionally, this is equivalent to all the previous
|
||||||
code in this introduction.
|
code in this introduction.
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 8.8 KiB After Width: | Height: | Size: 8.8 KiB |
|
Before Width: | Height: | Size: 3.7 KiB After Width: | Height: | Size: 3.7 KiB |
|
Before Width: | Height: | Size: 9.4 KiB After Width: | Height: | Size: 9.4 KiB |
|
Before Width: | Height: | Size: 4.7 KiB After Width: | Height: | Size: 4.7 KiB |
|
Before Width: | Height: | Size: 6.0 KiB After Width: | Height: | Size: 6.0 KiB |
|
Before Width: | Height: | Size: 6.0 KiB After Width: | Height: | Size: 6.0 KiB |
|
Before Width: | Height: | Size: 6.4 KiB After Width: | Height: | Size: 6.4 KiB |
|
Before Width: | Height: | Size: 5.3 KiB After Width: | Height: | Size: 5.3 KiB |
|
Before Width: | Height: | Size: 3.4 KiB After Width: | Height: | Size: 3.4 KiB |
|
Before Width: | Height: | Size: 3.3 KiB After Width: | Height: | Size: 3.3 KiB |
@@ -26,7 +26,6 @@
|
|||||||
consider using one of the layout-related convenience classes (eg.
|
consider using one of the layout-related convenience classes (eg.
|
||||||
BGroupView for BGroupLayout).
|
BGroupView for BGroupLayout).
|
||||||
|
|
||||||
|
|
||||||
\section layout_layout_tips BLayout Tips
|
\section layout_layout_tips BLayout Tips
|
||||||
|
|
||||||
\li It is generally better to add BViews and BLayoutItems directly to the
|
\li It is generally better to add BViews and BLayoutItems directly to the
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2011-2012 Haiku, Inc. All Rights Reserved.
|
* Copyright 2011-2012 Haiku, Inc. All rights reserved.
|
||||||
* Distributed under the terms of the MIT License.
|
* Distributed under the terms of the MIT License.
|
||||||
*
|
*
|
||||||
* Authors:
|
* Authors:
|
||||||
@@ -8,13 +8,15 @@
|
|||||||
* Oliver Tappe, [email protected]
|
* Oliver Tappe, [email protected]
|
||||||
*
|
*
|
||||||
* Corresponds to:
|
* Corresponds to:
|
||||||
* /trunk/headers/os/locale/Catalog.h hrev45083
|
* headers/os/locale/Catalog.h hrev45083
|
||||||
* /trunk/src/kits/locale/Catalog.cpp hrev45083
|
* src/kits/locale/Catalog.cpp hrev45083
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\file Catalog.h
|
\file Catalog.h
|
||||||
|
\ingroup locale
|
||||||
|
\ingroup libbe
|
||||||
\brief Provides the BCatalog class.
|
\brief Provides the BCatalog 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.
|
* Distributed under the terms of the MIT License.
|
||||||
*
|
*
|
||||||
* Authors:
|
* Authors:
|
||||||
@@ -8,13 +8,15 @@
|
|||||||
* John Scipione, [email protected]
|
* John Scipione, [email protected]
|
||||||
*
|
*
|
||||||
* Corresponds to:
|
* Corresponds to:
|
||||||
* /trunk/headers/os/locale/Collator.h rev 42274
|
* headers/os/locale/Collator.h rev 42274
|
||||||
* /trunk/src/kits/locale/Collator.cpp rev 42274
|
* src/kits/locale/Collator.cpp rev 42274
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\file Collator.h
|
\file Collator.h
|
||||||
|
\ingroup locale
|
||||||
|
\ingroup libbe
|
||||||
\brief Provides the BCollator class.
|
\brief Provides the BCollator class.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@@ -22,6 +24,7 @@
|
|||||||
/*!
|
/*!
|
||||||
\class BCollator
|
\class BCollator
|
||||||
\ingroup locale
|
\ingroup locale
|
||||||
|
\ingroup libbe
|
||||||
\brief Class for handling locale-aware collation (sorting) of strings.
|
\brief Class for handling locale-aware collation (sorting) of strings.
|
||||||
|
|
||||||
BCollator is designed to handle collation (sorting) of strings. Unlike
|
BCollator is designed to handle collation (sorting) of strings. Unlike
|
||||||
|
|||||||
@@ -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.
|
* Distributed under the terms of the MIT License.
|
||||||
*
|
*
|
||||||
* Authors:
|
* Authors:
|
||||||
@@ -8,26 +8,31 @@
|
|||||||
* John Scipione, [email protected]
|
* John Scipione, [email protected]
|
||||||
*
|
*
|
||||||
* Corresponds to:
|
* Corresponds to:
|
||||||
* /trunk/headers/os/locale/Country.h rev 42274
|
* headers/os/locale/Country.h rev 42274
|
||||||
* /trunk/src/kits/locale/Country.cpp rev 42274
|
* src/kits/locale/Country.cpp rev 42274
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*! \file Country.h
|
/*!
|
||||||
|
\file Country.h
|
||||||
|
\ingroup locale
|
||||||
|
\ingroup libbe
|
||||||
\brief BCountry class definition.
|
\brief BCountry class definition.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*! \class BCountry
|
/*!
|
||||||
|
\class BCountry
|
||||||
\ingroup locale
|
\ingroup locale
|
||||||
\brief Class representing a country
|
\ingroup libbe
|
||||||
|
\brief Class representing a country.
|
||||||
|
|
||||||
BCountry provides all the information about a particular country.
|
BCountry provides information about a particular country including the
|
||||||
This includes the country flag (as an HVIF icon), the localized name
|
countries flag (as an HVIF icon), the localized name of the country,
|
||||||
of the country, and the ISO country code.
|
and the ISO country code.
|
||||||
|
|
||||||
Date, time, and numer formatting also depends to some extent on the
|
Date, time, and number formatting also depends to some extent on the
|
||||||
language used, so they are found in the BLocale class instead.
|
language used so they are found in the BLocale class instead.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
@@ -85,7 +90,7 @@
|
|||||||
The flag is stored in HVIF format so it can be rendered at any size and
|
The flag is stored in HVIF format so it can be rendered at any size and
|
||||||
color depth.
|
color depth.
|
||||||
|
|
||||||
\param result The BBitmap to drag the flag into.
|
\param result The BBitmap object to draw the flag into.
|
||||||
|
|
||||||
\returns \c B_OK if the drawing was successful.
|
\returns \c B_OK if the drawing was successful.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2011, Haiku. All rights reserved.
|
* Copyright 2011 Haiku, Inc. All rights reserved.
|
||||||
* Distributed under the terms of the MIT License.
|
* Distributed under the terms of the MIT License.
|
||||||
*
|
*
|
||||||
* Authors:
|
* Authors:
|
||||||
@@ -7,8 +7,16 @@
|
|||||||
* John Scipione, [email protected]
|
* John Scipione, [email protected]
|
||||||
*
|
*
|
||||||
* Corresponds to:
|
* Corresponds to:
|
||||||
* /trunk/headers/os/locale/DurationFormat.h hrev45084
|
* headers/os/locale/DurationFormat.h hrev45084
|
||||||
* /trunk/src/kits/locale/DurationFormat.cpp hrev45084
|
* src/kits/locale/DurationFormat.cpp hrev45084
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/*!
|
||||||
|
\file DurationFormat.h
|
||||||
|
\ingroup locale
|
||||||
|
\ingroup libbe
|
||||||
|
\brief Contains BDurationFormat class, a time interval formatter.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -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.
|
* Distributed under the terms of the MIT License.
|
||||||
*
|
*
|
||||||
* Authors:
|
* Authors:
|
||||||
@@ -15,12 +15,16 @@
|
|||||||
|
|
||||||
/*!
|
/*!
|
||||||
\file Locale.h
|
\file Locale.h
|
||||||
\brief Provides the BLocale class.
|
\ingroup locale
|
||||||
|
\ingroup libbe
|
||||||
|
\brief Provides the BLocale class, the base class of the Locale Kit.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*! \class BLocale
|
/*!
|
||||||
|
\class BLocale
|
||||||
\ingroup locale
|
\ingroup locale
|
||||||
|
\ingroup libbe
|
||||||
\brief Class for representing a locale and its settings.
|
\brief Class for representing a locale and its settings.
|
||||||
|
|
||||||
A locale is defined by the combination of a country and a language.
|
A locale is defined by the combination of a country and a language.
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2003-2010, Haiku. All rights reserved.
|
* Copyright 2003-2010 Haiku, Inc. All rights reserved.
|
||||||
* Distributed under the terms of the MIT License.
|
* Distributed under the terms of the MIT License.
|
||||||
*
|
*
|
||||||
* Authors:
|
* Authors:
|
||||||
@@ -8,15 +8,24 @@
|
|||||||
* Oliver Tappe, [email protected]
|
* Oliver Tappe, [email protected]
|
||||||
*
|
*
|
||||||
* Corresponds to:
|
* Corresponds to:
|
||||||
* /trunk/headers/os/locale/LocaleRoster.h rev 42274
|
* headers/os/locale/LocaleRoster.h rev 42274
|
||||||
* /trunk/src/kits/locale/LocaleRoster.cpp rev 42274
|
* src/kits/locale/LocaleRoster.cpp rev 42274
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/*!
|
||||||
|
\file LocaleRoster.h
|
||||||
|
\ingroup locale
|
||||||
|
\ingroup libbe
|
||||||
|
\brief Provides the BLocaleRoster class to access locale data.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\class BLocaleRoster
|
\class BLocaleRoster
|
||||||
\ingroup locale
|
\ingroup locale
|
||||||
\brief Main class for accessing the locale kit data
|
\ingroup libbe
|
||||||
|
\brief Main class for accessing the Locale Kit data.
|
||||||
|
|
||||||
The Locale Roster is the central part of the locale kit. It is a global
|
The Locale Roster is the central part of the locale kit. It is a global
|
||||||
object (\c be_locale_roster) storing all the useful locale data. Other
|
object (\c be_locale_roster) storing all the useful locale data. Other
|
||||||
|
|||||||
@@ -1,26 +1,30 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2011, Haiku inc.
|
* Copyright 2011 Haiku, Inc. All rights reserved.
|
||||||
* Distributed under the terms of the MIT Licence.
|
* Distributed under the terms of the MIT License.
|
||||||
|
*
|
||||||
|
* Authors:
|
||||||
|
* Adrien Destugues, [email protected]
|
||||||
|
* John Scipione, [email protected]
|
||||||
|
* Oliver Tappe, [email protected]
|
||||||
*
|
*
|
||||||
* Documentation by:
|
|
||||||
* Adrien Destugues <[email protected]>
|
|
||||||
* John Scipione <[email protected]>
|
|
||||||
* Oliver Tappe <[email protected]>
|
|
||||||
* Corresponds to:
|
* Corresponds to:
|
||||||
* /trunk/headers/os/locale/TimeZone.h rev 42274
|
* headers/os/locale/TimeZone.h rev 42274
|
||||||
* /trunk/src/kits/locale/TimeZone.cpp rev 42274
|
* src/kits/locale/TimeZone.cpp rev 42274
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\file TimeZone.h
|
\file TimeZone.h
|
||||||
\brief Provides for the BTimeZone class.
|
\ingroup locale
|
||||||
|
\ingroup libbe
|
||||||
|
\brief Provides the BTimeZone class.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\class BTimeZone
|
\class BTimeZone
|
||||||
\ingroup locale
|
\ingroup locale
|
||||||
|
\ingroup libbe
|
||||||
\brief Provides information about time zones.
|
\brief Provides information about time zones.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|||||||
@@ -1,20 +1,29 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2011, Haiku, Inc. All Rights Reserved.
|
* Copyright 2011 Haiku, Inc. All rights reserved.
|
||||||
* Distributed under the terms of the OpenBeOS License.
|
* Distributed under the terms of the OpenBeOS License.
|
||||||
*
|
*
|
||||||
* Authors:
|
* Authors:
|
||||||
* Axel Dörfler <[email protected]>
|
* Axel Dörfler, [email protected]
|
||||||
* John Scipione <[email protected]>
|
* John Scipione, [email protected]
|
||||||
*
|
*
|
||||||
* Corresponds to:
|
* Corresponds to:
|
||||||
* /trunk/headers/os/locale/UnicodeChar.h rev 42274
|
* headers/os/locale/UnicodeChar.h rev 42274
|
||||||
* /trunk/src/kits/locale/UnicodeChar.cpp rev 42274
|
* src/kits/locale/UnicodeChar.cpp rev 42274
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/*!
|
||||||
|
\file UnicodeChar.h
|
||||||
|
\ingroup locale
|
||||||
|
\ingroup libbe
|
||||||
|
\brief Provides the BUnicodeChar class.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\class BUnicodeChar
|
\class BUnicodeChar
|
||||||
\ingroup locale
|
\ingroup locale
|
||||||
|
\ingroup libbe
|
||||||
\brief Management of all information about characters.
|
\brief Management of all information about characters.
|
||||||
|
|
||||||
This class provide a set of tools for managing the whole set of characters
|
This class provide a set of tools for managing the whole set of characters
|
||||||
@@ -27,11 +36,12 @@
|
|||||||
instantiate it. You can call one of the methods passing in the character
|
instantiate it. You can call one of the methods passing in the character
|
||||||
that you want to be examined.
|
that you want to be examined.
|
||||||
|
|
||||||
Note all the function work with chars encoded in utf-32. This is not the
|
Note all the function work with chars encoded in UTF-32. This is not the
|
||||||
most usual way to handle characters, but it is the fastest. To convert an
|
most usual way to handle characters, but it is the fastest. To convert an
|
||||||
utf-8 string to an utf-32 character use the FromUTF8() method.
|
UTF-8 string to an UTF-32 character use the FromUTF8() method.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\fn static bool BUnicodeChar::IsAlpha(uint32 c)
|
\fn static bool BUnicodeChar::IsAlpha(uint32 c)
|
||||||
\brief Determine if \a c is alphabetic.
|
\brief Determine if \a c is alphabetic.
|
||||||
@@ -40,6 +50,7 @@
|
|||||||
alphabetic character.
|
alphabetic character.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\fn static bool BUnicodeChar::IsAlNum(uint32 c)
|
\fn static bool BUnicodeChar::IsAlNum(uint32 c)
|
||||||
\brief Determine if \a c is alphanumeric.
|
\brief Determine if \a c is alphanumeric.
|
||||||
@@ -48,6 +59,7 @@
|
|||||||
alphabetic or numeric character.
|
alphabetic or numeric character.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\fn static bool BUnicodeChar::IsDigit(uint32 c)
|
\fn static bool BUnicodeChar::IsDigit(uint32 c)
|
||||||
\brief Determine if \a c is numeric.
|
\brief Determine if \a c is numeric.
|
||||||
@@ -56,6 +68,7 @@
|
|||||||
number character.
|
number character.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\fn static bool BUnicodeChar::IsHexDigit(uint32 c)
|
\fn static bool BUnicodeChar::IsHexDigit(uint32 c)
|
||||||
\brief Determine if \a c is a hexadecimal digit.
|
\brief Determine if \a c is a hexadecimal digit.
|
||||||
@@ -64,6 +77,7 @@
|
|||||||
hexadecimal number character.
|
hexadecimal number character.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\fn static bool BUnicodeChar::IsUpper(uint32 c)
|
\fn static bool BUnicodeChar::IsUpper(uint32 c)
|
||||||
\brief Determine if \a c is uppercase.
|
\brief Determine if \a c is uppercase.
|
||||||
@@ -72,6 +86,7 @@
|
|||||||
uppercase character.
|
uppercase character.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\fn static bool BUnicodeChar::IsLower(uint32 c)
|
\fn static bool BUnicodeChar::IsLower(uint32 c)
|
||||||
\brief Determine if \a c is lowercase.
|
\brief Determine if \a c is lowercase.
|
||||||
@@ -80,6 +95,7 @@
|
|||||||
lowercase character.
|
lowercase character.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\fn static bool BUnicodeChar::IsSpace(uint32 c)
|
\fn static bool BUnicodeChar::IsSpace(uint32 c)
|
||||||
\brief Determine if \a c is a space.
|
\brief Determine if \a c is a space.
|
||||||
@@ -94,6 +110,7 @@
|
|||||||
\sa IsWhitespace()
|
\sa IsWhitespace()
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\fn static bool BUnicodeChar::IsWhitespace(uint32 c)
|
\fn static bool BUnicodeChar::IsWhitespace(uint32 c)
|
||||||
\brief Determine if \a c is whitespace.
|
\brief Determine if \a c is whitespace.
|
||||||
@@ -107,6 +124,7 @@
|
|||||||
\sa IsSpace()
|
\sa IsSpace()
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\fn static bool BUnicodeChar::IsControl(uint32 c)
|
\fn static bool BUnicodeChar::IsControl(uint32 c)
|
||||||
\brief Determine if \a c is a control character.
|
\brief Determine if \a c is a control character.
|
||||||
@@ -120,6 +138,7 @@
|
|||||||
\sa IsPrintable()
|
\sa IsPrintable()
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\fn static bool BUnicodeChar::IsPunctuation(uint32 c)
|
\fn static bool BUnicodeChar::IsPunctuation(uint32 c)
|
||||||
\brief Determine if \a c is punctuation character.
|
\brief Determine if \a c is punctuation character.
|
||||||
@@ -128,6 +147,7 @@
|
|||||||
punctuation character.
|
punctuation character.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\fn static bool BUnicodeChar::IsPrintable(uint32 c)
|
\fn static bool BUnicodeChar::IsPrintable(uint32 c)
|
||||||
\brief Determine if \a c is printable.
|
\brief Determine if \a c is printable.
|
||||||
@@ -140,6 +160,7 @@
|
|||||||
\sa IsControl()
|
\sa IsControl()
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\fn static bool BUnicodeChar::IsTitle(uint32 c)
|
\fn static bool BUnicodeChar::IsTitle(uint32 c)
|
||||||
\brief Determine if \a c is title case.
|
\brief Determine if \a c is title case.
|
||||||
@@ -150,6 +171,7 @@
|
|||||||
character.
|
character.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\fn static bool BUnicodeChar::IsDefined(uint32 c)
|
\fn static bool BUnicodeChar::IsDefined(uint32 c)
|
||||||
\brief Determine if \a c is defined.
|
\brief Determine if \a c is defined.
|
||||||
@@ -160,6 +182,7 @@
|
|||||||
\returns \c true if the specified unicode character is defined.
|
\returns \c true if the specified unicode character is defined.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\fn static bool BUnicodeChar::IsBase(uint32 c)
|
\fn static bool BUnicodeChar::IsBase(uint32 c)
|
||||||
\brief Determine if \a c can be used with a diacritic.
|
\brief Determine if \a c can be used with a diacritic.
|
||||||
@@ -170,6 +193,7 @@
|
|||||||
form character that can be used with a diacritic.
|
form character that can be used with a diacritic.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\fn static int8 BUnicodeChar::Type(uint32 c)
|
\fn static int8 BUnicodeChar::Type(uint32 c)
|
||||||
\brief Gets the type of a character.
|
\brief Gets the type of a character.
|
||||||
@@ -177,6 +201,7 @@
|
|||||||
\returns A member of the \c unicode_char_category enum.
|
\returns A member of the \c unicode_char_category enum.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\fn uint32 BUnicodeChar::ToLower(uint32 c)
|
\fn uint32 BUnicodeChar::ToLower(uint32 c)
|
||||||
\brief Transforms \a c to lowercase.
|
\brief Transforms \a c to lowercase.
|
||||||
@@ -184,6 +209,7 @@
|
|||||||
\returns The lowercase version of the specified unicode character.
|
\returns The lowercase version of the specified unicode character.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\fn uint32 BUnicodeChar::ToUpper(uint32 c)
|
\fn uint32 BUnicodeChar::ToUpper(uint32 c)
|
||||||
\brief Transforms \a c to uppercase.
|
\brief Transforms \a c to uppercase.
|
||||||
@@ -191,6 +217,7 @@
|
|||||||
\returns The uppercase version of the specified unicode character.
|
\returns The uppercase version of the specified unicode character.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\fn uint32 BUnicodeChar::ToTitle(uint32 c)
|
\fn uint32 BUnicodeChar::ToTitle(uint32 c)
|
||||||
\brief Transforms \a c to title case.
|
\brief Transforms \a c to title case.
|
||||||
@@ -198,6 +225,7 @@
|
|||||||
\returns The title case version of the specified unicode character.
|
\returns The title case version of the specified unicode character.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\fn int32 BUnicodeChar::DigitValue(uint32 c)
|
\fn int32 BUnicodeChar::DigitValue(uint32 c)
|
||||||
\brief Gets the numeric value \a c.
|
\brief Gets the numeric value \a c.
|
||||||
@@ -205,33 +233,37 @@
|
|||||||
\returns The numeric version of the specified unicode character.
|
\returns The numeric version of the specified unicode character.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\fn void BUnicodeChar::ToUTF8(uint32 c, char **out)
|
\fn void BUnicodeChar::ToUTF8(uint32 c, char **out)
|
||||||
\brief Transform a character to utf-8 encoding.
|
\brief Transform a character to UTF-8 encoding.
|
||||||
|
|
||||||
\returns The utf-8 encoding of the specified unicode character.
|
\returns The UTF-8 encoding of the specified unicode character.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\fn uint32 BUnicodeChar::FromUTF8(const char **in)
|
\fn uint32 BUnicodeChar::FromUTF8(const char **in)
|
||||||
\brief Transform a utf-8 string to an utf-32 character.
|
\brief Transform a UTF-8 string to an UTF-32 character.
|
||||||
|
|
||||||
If the string contains multiple characters, only the fist one is used.
|
If the string contains multiple characters, only the fist one is used.
|
||||||
This function updates the in pointer so that it points on the next
|
This function updates the in pointer so that it points on the next
|
||||||
character for the following call.
|
character for the following call.
|
||||||
|
|
||||||
\returns The utf-32 encoded version of \a in.
|
\returns The UTF-32 encoded version of \a in.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\fn size_t BUnicodeChar::UTF8StringLength(const char *str)
|
\fn size_t BUnicodeChar::UTF8StringLength(const char *str)
|
||||||
\brief Counts the characters in the given \c NUL terminated string.
|
\brief Counts the characters in the given \c NUL terminated string.
|
||||||
|
|
||||||
\returns the number of utf-8 characters in the \c NUL terminated string.
|
\returns the number of UTF-8 characters in the \c NUL terminated string.
|
||||||
|
|
||||||
\sa BString::CountChars()
|
\sa BString::CountChars()
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\fn size_t BUnicodeChar::UTF8StringLength(const char *str, size_t maxLength)
|
\fn size_t BUnicodeChar::UTF8StringLength(const char *str, size_t maxLength)
|
||||||
\brief Counts the characters in the given string up to \a maxLength
|
\brief Counts the characters in the given string up to \a maxLength
|
||||||
@@ -240,6 +272,6 @@
|
|||||||
The string does not need to be \c NUL terminated if you specify a
|
The string does not need to be \c NUL terminated if you specify a
|
||||||
\a maxLength that is shorter than the maximum length of the string.
|
\a maxLength that is shorter than the maximum length of the string.
|
||||||
|
|
||||||
\returns the number of utf-8 characters in the \c NUL terminated string
|
\returns the number of UTF-8 characters in the \c NUL terminated string
|
||||||
up to \a maxLength characters.
|
up to \a maxLength characters.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -1,24 +1,28 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2011, Haiku, Inc. All Rights Reserved.
|
* Copyright 2011 Haiku, Inc. All rights reserved.
|
||||||
* Distributed under the terms of the MIT License.
|
* Distributed under the terms of the MIT License.
|
||||||
*
|
*
|
||||||
* Authors:
|
* Authors:
|
||||||
* John Scipione, [email protected]
|
* John Scipione, [email protected]
|
||||||
*
|
*
|
||||||
* Corresponds to:
|
* Corresponds to:
|
||||||
* /trunk/headers/os/media/Buffer.h rev 42274
|
* headers/os/media/Buffer.h rev 42274
|
||||||
* /trunk/src/kits/media/Buffer.cpp rev 42274
|
* src/kits/media/Buffer.cpp rev 42274
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\file Buffer.h
|
\file Buffer.h
|
||||||
|
\ingroup media
|
||||||
|
\ingroup libbe
|
||||||
\brief Defines the buffer_clone_info struct and BBuffer class.
|
\brief Defines the buffer_clone_info struct and BBuffer class.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\struct buffer_clone_info
|
\struct buffer_clone_info
|
||||||
|
\ingroup media
|
||||||
|
\ingroup libbe
|
||||||
\brief A struct that stores where in memory a BBuffer object is in memory
|
\brief A struct that stores where in memory a BBuffer object is in memory
|
||||||
as well as the buffer flags.
|
as well as the buffer flags.
|
||||||
*/
|
*/
|
||||||
@@ -27,6 +31,7 @@
|
|||||||
/*!
|
/*!
|
||||||
\class BBuffer
|
\class BBuffer
|
||||||
\ingroup media
|
\ingroup media
|
||||||
|
\ingroup libbe
|
||||||
\brief A reference to a chunk of memory useful for sharing media data
|
\brief A reference to a chunk of memory useful for sharing media data
|
||||||
between applications and nodes.
|
between applications and nodes.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -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.
|
* Distributed under the terms of the MIT License.
|
||||||
*
|
*
|
||||||
* Authors:
|
* Authors:
|
||||||
* John Scipione, [email protected]
|
* John Scipione, [email protected]
|
||||||
*
|
*
|
||||||
* Corresponds to:
|
* Corresponds to:
|
||||||
* /trunk/headers/os/media/FileInterface.h hrev45081
|
* headers/os/media/FileInterface.h hrev45081
|
||||||
* /trunk/src/kits/media/FileInterface.cpp hrev45081
|
* src/kits/media/FileInterface.cpp hrev45081
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\file FileInterface.h
|
\file FileInterface.h
|
||||||
|
\ingroup media
|
||||||
|
\ingroup libbe
|
||||||
\brief Provides BFileInterface abstract class.
|
\brief Provides BFileInterface abstract class.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|||||||
@@ -1,48 +1,59 @@
|
|||||||
/*!
|
/*!
|
||||||
\file Midi2Defs.h
|
\file Midi2Defs.h
|
||||||
\brief Some definitions to define raw MIDI events.
|
|
||||||
\ingroup midi2
|
\ingroup midi2
|
||||||
|
\ingroup libbe
|
||||||
|
\brief Some definitions to define raw MIDI events.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\name Channel Message Masks
|
\name Channel Message Masks
|
||||||
\brief Some definitions to define the raw MIDI events.
|
\brief Some definitions to define the raw MIDI events.
|
||||||
|
|
||||||
The default implementation of BMidiLocalConsumer::Data() uses these constants
|
The default implementation of BMidiLocalConsumer::Data() uses these
|
||||||
to determine which event has been passed on. If you override that method, you
|
constants to determine which event has been passed on. If you override
|
||||||
may use the constants yourself.
|
that method, you may use the constants yourself.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
//! @{
|
//! @{
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\var B_NOTE_OFF
|
\var B_NOTE_OFF
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\var B_NOTE_ON
|
\var B_NOTE_ON
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\var B_KEY_PRESSURE
|
\var B_KEY_PRESSURE
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\var B_CONTROL_CHANGE
|
\var B_CONTROL_CHANGE
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\var B_PROGRAM_CHANGE
|
\var B_PROGRAM_CHANGE
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\var B_CHANNEL_PRESSURE
|
\var B_CHANNEL_PRESSURE
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\var B_PITCH_BEND
|
\var B_PITCH_BEND
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
//! @}
|
//! @}
|
||||||
|
|
||||||
|
|
||||||
@@ -50,68 +61,85 @@ may use the constants yourself.
|
|||||||
\name System Messages
|
\name System Messages
|
||||||
\brief Some definitions to define the raw MIDI system messages.
|
\brief Some definitions to define the raw MIDI system messages.
|
||||||
|
|
||||||
The default implementation of BMidiLocalConsumer::Data() uses these constants
|
The default implementation of BMidiLocalConsumer::Data() uses these
|
||||||
to determine which event system message has been passed on. See
|
constants to determine which event system message has been passed on.
|
||||||
BMidiLocalProducer::SpraySystemCommon() and BMidiLocalProducer::SpraySystemRealTime()
|
See BMidiLocalProducer::SpraySystemCommon() and
|
||||||
for more details on how and when to use these messages.
|
BMidiLocalProducer::SpraySystemRealTime() for more details on how and
|
||||||
|
when to use these messages.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
//! @{
|
//! @{
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\var B_SYS_EX_START
|
\var B_SYS_EX_START
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\var B_MIDI_TIME_CODE
|
\var B_MIDI_TIME_CODE
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\var B_SONG_POSITION
|
\var B_SONG_POSITION
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\var B_SONG_SELECT
|
\var B_SONG_SELECT
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\var B_CABLE_MESSAGE
|
\var B_CABLE_MESSAGE
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\var B_TUNE_REQUEST
|
\var B_TUNE_REQUEST
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\var B_SYS_EX_END
|
\var B_SYS_EX_END
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\var B_TIMING_CLOCK
|
\var B_TIMING_CLOCK
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\var B_START
|
\var B_START
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\var B_CONTINUE
|
\var B_CONTINUE
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\var B_STOP
|
\var B_STOP
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\var B_ACTIVE_SENSING
|
\var B_ACTIVE_SENSING
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\var B_SYSTEM_RESET
|
\var B_SYSTEM_RESET
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
//! @}
|
//! @}
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\name Controller Numbers
|
\name Controller Numbers
|
||||||
\brief Constants that represent specific controller messages.
|
\brief Constants that represent specific controller messages.
|
||||||
@@ -121,160 +149,196 @@ and BMidiLocalConsumer::ControlChange(). These constants represent the
|
|||||||
MIDI specification.
|
MIDI specification.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
//! @{
|
//! @{
|
||||||
|
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\var B_MODULATION
|
\var B_MODULATION
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\var B_BREATH_CONTROLLER
|
\var B_BREATH_CONTROLLER
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\var B_FOOT_CONTROLLER
|
\var B_FOOT_CONTROLLER
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\var B_PORTAMENTO_TIME
|
\var B_PORTAMENTO_TIME
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\var B_DATA_ENTRY
|
\var B_DATA_ENTRY
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\var B_MAIN_VOLUME
|
\var B_MAIN_VOLUME
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\var B_MIDI_BALANCE
|
\var B_MIDI_BALANCE
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\var B_PAN
|
\var B_PAN
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\var B_EXPRESSION_CTRL
|
\var B_EXPRESSION_CTRL
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\var B_GENERAL_CTRL_1
|
\var B_GENERAL_CTRL_1
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\var B_GENERAL_CTRL_2
|
\var B_GENERAL_CTRL_2
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\var B_GENERAL_CTRL_3
|
\var B_GENERAL_CTRL_3
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\var B_GENERAL_CTRL_4
|
\var B_GENERAL_CTRL_4
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\var B_SUSTAIN_PEDAL
|
\var B_SUSTAIN_PEDAL
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\var B_PORTAMENTO
|
\var B_PORTAMENTO
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\var B_SOSTENUTO
|
\var B_SOSTENUTO
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\var B_SOFT_PEDAL
|
\var B_SOFT_PEDAL
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\var B_HOLD_2
|
\var B_HOLD_2
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\var B_GENERAL_CTRL_5
|
\var B_GENERAL_CTRL_5
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\var B_GENERAL_CTRL_6
|
\var B_GENERAL_CTRL_6
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\var B_TEMPO_CHANGE
|
\var B_TEMPO_CHANGE
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\var B_GENERAL_CTRL_7
|
\var B_GENERAL_CTRL_7
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\var B_GENERAL_CTRL_8
|
\var B_GENERAL_CTRL_8
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\var B_EFFECTS_DEPTH
|
\var B_EFFECTS_DEPTH
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\var B_TREMOLO_DEPTH
|
\var B_TREMOLO_DEPTH
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\var B_CHORUS_DEPTH
|
\var B_CHORUS_DEPTH
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\var B_CELESTE_DEPTH
|
\var B_CELESTE_DEPTH
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\var B_PHASER_DEPTH
|
\var B_PHASER_DEPTH
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\var B_DATA_INCREMENT
|
\var B_DATA_INCREMENT
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\var B_DATA_DECREMENT
|
\var B_DATA_DECREMENT
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\var B_RESET_ALL_CONTROLLERS
|
\var B_RESET_ALL_CONTROLLERS
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\var B_LOCAL_CONTROL
|
\var B_LOCAL_CONTROL
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\var B_ALL_NOTES_OFF
|
\var B_ALL_NOTES_OFF
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\var B_OMNI_MODE_OFF
|
\var B_OMNI_MODE_OFF
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\var B_OMNI_MODE_ON
|
\var B_OMNI_MODE_ON
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\var B_MONO_MODE_ON
|
\var B_MONO_MODE_ON
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\var B_POLY_MODE_ON
|
\var B_POLY_MODE_ON
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
//! @}
|
//! @}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,323 @@
|
|||||||
|
/*!
|
||||||
|
\file MidiConsumer.h
|
||||||
|
\ingroup midi2
|
||||||
|
\ingroup libbe
|
||||||
|
\brief Defines consumer classes for the MIDI Kit.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/*!
|
||||||
|
\class BMidiConsumer MidiConsumer.h
|
||||||
|
\ingroup midi2
|
||||||
|
\ingroup libmidi2
|
||||||
|
\ingroup libbe
|
||||||
|
\brief Receives MIDI events from a producer
|
||||||
|
|
||||||
|
A consumer is an object that knows how to deal with incoming MIDI events. A
|
||||||
|
consumer can be connected to multiple producers at the same time. There is no
|
||||||
|
way to find out which producers are connected to this consumer just by looking
|
||||||
|
at the BMidiConsumer object; you will have to consult BMidiRoster for that.
|
||||||
|
|
||||||
|
A BMidiConsumer either represents a local consumer, i.e. a class extending from
|
||||||
|
BMidiLocalConsumer, or is a proxy for a remote object published by another app.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/*!
|
||||||
|
\fn bigtime_t BMidiConsumer::Latency() const
|
||||||
|
\brief Returns the latency of this consumer
|
||||||
|
|
||||||
|
The latency is measured in microseconds. Producers should attempt to get MIDI
|
||||||
|
events to this consumer by <I>(when - latency)</I>. You do this by subtracting
|
||||||
|
the latency from the performance time when you spray the events (provided that
|
||||||
|
you spray these events ahead of time, of course).
|
||||||
|
|
||||||
|
You cannot <I>set</I> the latency on a BMidiConsumer, only on a
|
||||||
|
BMidiLocalConsumer.
|
||||||
|
|
||||||
|
The latency issue gets slightly more complicated when multiple endpoints are
|
||||||
|
chained together, as in the following picture:
|
||||||
|
|
||||||
|
\verbatim
|
||||||
|
+-------+ +-------------+ +-------+
|
||||||
|
| | | | | |
|
||||||
|
| prodA |---->| consB prodB |---->| consC |
|
||||||
|
| | | | | |
|
||||||
|
+-------+ +-------------+ +-------+
|
||||||
|
appA appB (filter) appC
|
||||||
|
\endverbatim
|
||||||
|
|
||||||
|
Suppose consC has 200ms latency, and consB has 100ms latency. If consB simply
|
||||||
|
reports 100ms, then prodA will schedule its events for (t - 100), which is
|
||||||
|
really 200ms too late. (Of course, producers send out their events as soon as
|
||||||
|
possible, so depending on the load of the system, everything may work out just
|
||||||
|
fine.)
|
||||||
|
|
||||||
|
ConsB should report the latency of the consumer that is hooked up to its
|
||||||
|
output, consC, in addition to its own latency. In other words, the full
|
||||||
|
downstream latency. So, the reported latency in this case would be 300ms. This
|
||||||
|
also means that appB should change the latency of consB when prodB makes or
|
||||||
|
breaks a connection, and when consC reports a latency change. (If multiple
|
||||||
|
consumers are connected to prodB, you should take the slowest one.)
|
||||||
|
Unfortunately, the Midi Kit provides no easy mechanism for doing any of this,
|
||||||
|
so you are on your own here.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*!
|
||||||
|
\class BMidiLocalConsumer MidiConsumer.h
|
||||||
|
\ingroup midi2
|
||||||
|
\ingroup libmidi2
|
||||||
|
\ingroup libbe
|
||||||
|
\brief A consumer endpoint that is created by your own application.
|
||||||
|
|
||||||
|
If you want to create a consumer that reacts to MIDI events, you should
|
||||||
|
subclass BMidiLocalConsumer.
|
||||||
|
|
||||||
|
Each local consumer has its own thread that receives and dispatches the MIDI
|
||||||
|
events. Whenever MIDI data arrives, the Data() hook passes the MIDI event on to
|
||||||
|
a more specific hook function: NoteOn(), NoteOff(), SystemExclusive(), and so
|
||||||
|
on. Calls to these hook functions are serialized -- they will never have to be
|
||||||
|
re-entrant. They also should not be called from outside the thread that is
|
||||||
|
invoking them.
|
||||||
|
|
||||||
|
Your subclass can override any of the MIDI event hooks. BMidiLocalConsumer
|
||||||
|
doesn't provide default implementations for them, so you don't have to call a
|
||||||
|
hook's default implementation if you override it. For complete control, you can
|
||||||
|
also override Data().
|
||||||
|
|
||||||
|
Most hook functions take a channel argument. Even though MIDI channels are
|
||||||
|
really numbered 1 through 16, the hook functions work with channels 0 through
|
||||||
|
15. The performance time for the event is specified in microseconds relative to
|
||||||
|
the system time base. A performance time that is 0 (or really any time in the
|
||||||
|
past) means "play as soon as possible". See the \ref midi2time "introduction"
|
||||||
|
for more information about timing and consumers.
|
||||||
|
|
||||||
|
The thread driving the consumer's events is a very high priority real time
|
||||||
|
thread. Events should be handled as quickly as possible (not counting
|
||||||
|
snoozing). If non-time-critical computation is needed it may be wise to queue
|
||||||
|
events up for a lower priority thread to handle them external to the main event
|
||||||
|
thread.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/*!
|
||||||
|
\fn BMidiLocalConsumer::BMidiLocalConsumer(const char *name = NULL)
|
||||||
|
\brief Creates a new local consumer endpoint
|
||||||
|
|
||||||
|
The new endpoint is not visible to other applications until you Register() it.
|
||||||
|
|
||||||
|
You can tell the constructor what the name of the new consumer will be. If you
|
||||||
|
pass NULL (or use the default argument), then the consumer's name will be an
|
||||||
|
empty string. It won't be NULL, since endpoint names cannot be NULL.
|
||||||
|
|
||||||
|
There is no guarantee that the endpoint will be successfully created. For
|
||||||
|
example, the Midi Server may not be running. Therefore, you should always call
|
||||||
|
IsValid() after creating a new endpoint to make sure that everything went okay.
|
||||||
|
If not, Release() the object to reclaim memory and abort gracefully.
|
||||||
|
|
||||||
|
\code
|
||||||
|
MyConsumer* cons = new MyConsumer(...);
|
||||||
|
if (!cons->IsValid())
|
||||||
|
{
|
||||||
|
cons->Release();
|
||||||
|
...exit gracefully...
|
||||||
|
}
|
||||||
|
\endcode
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/*!
|
||||||
|
\fn void BMidiLocalConsumer::SetLatency(bigtime_t latency)
|
||||||
|
\brief Changes the published latency of the consumer.
|
||||||
|
|
||||||
|
\sa Latency()
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/*!
|
||||||
|
\fn int32 BMidiLocalConsumer::GetProducerID()
|
||||||
|
\brief Returns the ID of the producer that most recently sent a MIDI event to
|
||||||
|
this consumer.
|
||||||
|
|
||||||
|
You can call this from one of the hooks to determine which producer the event
|
||||||
|
came from.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/*!
|
||||||
|
\fn void BMidiLocalConsumer::SetTimeout(bigtime_t when, void* data)
|
||||||
|
\brief Requests that the Timeout() hook will be called at some point.
|
||||||
|
|
||||||
|
This method asks the consumer thread to call the Timeout() hook as soon as
|
||||||
|
possible after the timeout expires. For every call to SetTimeout(), the
|
||||||
|
Timeout() hook is only called once. Note: the term "timeout" may be a little
|
||||||
|
misleading; the hook will <I>always</I> be called, even if events are received
|
||||||
|
in the mean time. Apparently, this facility is handy for dealing with early
|
||||||
|
events.
|
||||||
|
|
||||||
|
Note that the event thread blocks on the consumer's port as long as no events
|
||||||
|
arrive. By default no timeout is set, and as a result the thread blocks
|
||||||
|
forever. Your call to SetTimeout() doesn't change this. The new timeout value
|
||||||
|
will go into effect the next time the thread tries to read from the port, i.e.
|
||||||
|
after the first event has been received. If no event ever comes in, the
|
||||||
|
Timeout() hook will never be called. This also means that you cannot cancel a
|
||||||
|
timeout once you have set it. To repeat, calling SetTimeout() only takes effect
|
||||||
|
after at least one new event has been received.
|
||||||
|
|
||||||
|
\param when An absolute time that's measured against the system clock.
|
||||||
|
|
||||||
|
\param data A pointer to a "cookie" that you can pass along to Timeout(). The
|
||||||
|
data is not copied, so you must ensure that the pointer remains valid until
|
||||||
|
Timeout() is called. You typically delete the data inside Timeout().
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/*!
|
||||||
|
\fn void BMidiLocalConsumer::Timeout(void* data)
|
||||||
|
\brief Hook function that is called per your own request.
|
||||||
|
|
||||||
|
\sa SetTimeout()
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*!
|
||||||
|
\fn void BMidiLocalConsumer::Data(uchar* data, size_t length, bool atomic,
|
||||||
|
bigtime_t time)
|
||||||
|
\brief Invoked when raw MIDI is received.
|
||||||
|
|
||||||
|
What the default implementation of Data() does depends on the value of atomic.
|
||||||
|
If atomic is true, the data received comprises a single MIDI event; i.e. one
|
||||||
|
status byte followed by the appropriate number of data bytes and nothing else.
|
||||||
|
In this case, Data() calls the event-specific hook function that corresponds to
|
||||||
|
that status byte. This optimization is used by the Midi Kit to allow faster
|
||||||
|
dispatch of events generated by the specific Spray functions from
|
||||||
|
BMidiLocalProducer.
|
||||||
|
|
||||||
|
If atomic is false, Data() ignores the MIDI event. If you want a consumer to
|
||||||
|
handle non-atomic events, you have to override Data() and program this
|
||||||
|
yourself. In that case, you probably also want to call the default
|
||||||
|
implementation to handle the "normal" MIDI events.
|
||||||
|
|
||||||
|
Data() is rarely overridden, but you can override it if you want to. If you do,
|
||||||
|
remember that the data buffer is owned by the Midi Kit. Do not attempt to
|
||||||
|
modify or free it, lest you wish to be laughed at by other developers.
|
||||||
|
|
||||||
|
\param data the MIDI event data
|
||||||
|
\param length byte size of the data buffer
|
||||||
|
\param atomic whether the data buffer contains a single complete MIDI event
|
||||||
|
\param time the requested performance time of the event
|
||||||
|
|
||||||
|
\sa BMidiLocalProducer::SprayData()
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/*!
|
||||||
|
\fn void BMidiLocalConsumer::NoteOff(uchar channel, uchar note,
|
||||||
|
uchar velocity, bigtime_t time)
|
||||||
|
\brief Invoked when a Note Off event is received.
|
||||||
|
|
||||||
|
\sa BMidiLocalProducer::SprayNoteOff()
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/*!
|
||||||
|
\fn void BMidiLocalConsumer::NoteOn(uchar channel, uchar note,
|
||||||
|
uchar velocity, bigtime_t time)
|
||||||
|
\brief Invoked when a Note On event is received.
|
||||||
|
|
||||||
|
\sa BMidiLocalProducer::SprayNoteOn()
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/*!
|
||||||
|
\fn void BMidiLocalConsumer::KeyPressure(uchar channel, uchar note,
|
||||||
|
uchar pressure, bigtime_t time)
|
||||||
|
\brief Invoked when a Polyphonic Pressure (Aftertouch) event is received.
|
||||||
|
|
||||||
|
\sa BMidiLocalProducer::SprayKeyPressure()
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/*!
|
||||||
|
\fn void BMidiLocalConsumer::ControlChange(uchar channel,
|
||||||
|
uchar controlNumber, uchar controlValue, bigtime_t time)
|
||||||
|
\brief Invoked when a Controller Change event is received.
|
||||||
|
|
||||||
|
\sa BMidiLocalProducer::SprayControlChange()
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/*!
|
||||||
|
\fn void BMidiLocalConsumer::ProgramChange(uchar channel,
|
||||||
|
uchar programNumber, bigtime_t time)
|
||||||
|
\brief Invoked when a Program Change event is received.
|
||||||
|
|
||||||
|
\sa BMidiLocalProducer::SprayProgramChange()
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/*!
|
||||||
|
\fn void BMidiLocalConsumer::ChannelPressure(uchar channel,
|
||||||
|
uchar pressure, bigtime_t time)
|
||||||
|
\brief Invoked when a Channel Pressure event is received.
|
||||||
|
|
||||||
|
\sa BMidiLocalProducer::SprayChannelPressure()
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/*!
|
||||||
|
\fn void BMidiLocalConsumer::PitchBend(uchar channel, uchar lsb,
|
||||||
|
uchar msb, bigtime_t time)
|
||||||
|
\brief Invoked when a Pitch Bend event is received.
|
||||||
|
|
||||||
|
\sa BMidiLocalProducer::SprayPitchBend()
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/*!
|
||||||
|
\fn void BMidiLocalConsumer::SystemExclusive(void* data, size_t length,
|
||||||
|
bigtime_t time)
|
||||||
|
\brief Invoked when a System Exclusive event is received.
|
||||||
|
|
||||||
|
The data does not include the sysex start and end control bytes
|
||||||
|
(0xF0 and 0xF7), only the payload of the sysex message.
|
||||||
|
|
||||||
|
The data belongs to the Midi Kit and is only valid for the duration of
|
||||||
|
this event. You may not modify or free it.
|
||||||
|
|
||||||
|
\sa BMidiLocalProducer::SpraySystemExclusive()
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/*!
|
||||||
|
\fn void BMidiLocalConsumer::SystemCommon(uchar status, uchar data1,
|
||||||
|
uchar data2, bigtime_t time)
|
||||||
|
\brief Invoked when a System Common event is received.
|
||||||
|
|
||||||
|
Not all data bytes are used for all common events. Unused bytes are
|
||||||
|
set to 0.
|
||||||
|
|
||||||
|
\sa BMidiLocalProducer::SpraySystemCommon()
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/*!
|
||||||
|
\fn void BMidiLocalConsumer::SystemRealTime(uchar status, bigtime_t time)
|
||||||
|
\brief Invoked when a Real Time event is received.
|
||||||
|
|
||||||
|
\sa BMidiLocalProducer::SpraySystemRealTime()
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/*!
|
||||||
|
\fn void BMidiLocalConsumer::TempoChange(int32 beatsPerMinute, bigtime_t time)
|
||||||
|
|
||||||
|
\brief Invoked when a Tempo Change event is received
|
||||||
|
\sa BMidiLocalProducer::SprayTempoChange()
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/*!
|
||||||
|
\fn void BMidiLocalConsumer::AllNotesOff(bool justChannel, bigtime_t time)
|
||||||
|
\brief Not used.
|
||||||
|
*/
|
||||||
@@ -0,0 +1,322 @@
|
|||||||
|
/*!
|
||||||
|
\file MidiEndpoint.h
|
||||||
|
\ingroup midi2
|
||||||
|
\ingroup libbe
|
||||||
|
\brief Defines the Baseclass of all MIDI consumers and producers.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/*!
|
||||||
|
\class BMidiEndpoint
|
||||||
|
\ingroup midi2
|
||||||
|
\ingroup libmidi2
|
||||||
|
\ingroup libbe
|
||||||
|
\brief Base class for all MIDI endpoints.
|
||||||
|
|
||||||
|
BMidiEndpoint is the abstract base class that represents either a
|
||||||
|
producer or consumer endpoint. It may be used to obtain the state, name,
|
||||||
|
properties, or system-wide ID of the object. BMidiEndpoint also provides
|
||||||
|
the ability to change the name and properties of endpoints that were
|
||||||
|
created locally.
|
||||||
|
|
||||||
|
Remember, you cannot call the destructor of BMidiEndpoint and its
|
||||||
|
subclasses directly. Endpoint objects are destructed automatically when
|
||||||
|
their reference count drops to zero. If necessary, the destructor of a
|
||||||
|
local endpoint first breaks off any connections and Unregister()'s the
|
||||||
|
endpoint before it is deleted. However, for good style and bonus points
|
||||||
|
you should really \link BMidiProducer::Disconnect() Disconnect() \endlink
|
||||||
|
and Unregister() the object yourself and not rely on the destructor to
|
||||||
|
do this.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*!
|
||||||
|
\fn const char* BMidiEndpoint::Name() const
|
||||||
|
\brief Returns the name of the endpoint.
|
||||||
|
|
||||||
|
The function never returns NULL. If you created a local endpoint by
|
||||||
|
passing a \c NULL name into its constructor (or passing no name,
|
||||||
|
which is the same thing), then Name() will return an empty string,
|
||||||
|
not \c NULL.
|
||||||
|
|
||||||
|
\sa SetName()
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*!
|
||||||
|
\fn void BMidiEndpoint::SetName(const char* name)
|
||||||
|
\brief Changes the name of the endpoint.
|
||||||
|
|
||||||
|
Names don't have to be unique, but it is recommended that you give any
|
||||||
|
endpoints you publish meaningful and unique names, so users can easily
|
||||||
|
recognize what each endpoint does. There is no limit to the size of
|
||||||
|
endpoint names.
|
||||||
|
|
||||||
|
Even though you can call this function on both remote and local objects,
|
||||||
|
you are only allowed to change the names of local endpoints; SetName()
|
||||||
|
calls on remote endpoints are ignored.
|
||||||
|
|
||||||
|
\param name The new name. If you pass \c NULL the name won't be changed.
|
||||||
|
|
||||||
|
\sa Name()
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*!
|
||||||
|
\fn int32 BMidiEndpoint::ID() const
|
||||||
|
\brief Returns the ID of the endpoint
|
||||||
|
|
||||||
|
An ID uniquely identifies an endpoint in the system. The ID is a signed
|
||||||
|
32-bit number that is assigned by the Midi Server when the endpoint is
|
||||||
|
created. (So even if a local endpoint is not published, it still has a
|
||||||
|
unique ID.) Valid IDs range from 1 to 0x7FFFFFFF, the largest value an
|
||||||
|
int32 can have. 0 and negative values are <b>not</b> valid IDs.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/*!
|
||||||
|
\fn bool BMidiEndpoint::IsProducer() const
|
||||||
|
\brief Determines whether this endpoint is a BMidiProducer
|
||||||
|
|
||||||
|
If it is, you can use a dynamic_cast to convert this object into a
|
||||||
|
producer:
|
||||||
|
|
||||||
|
\code
|
||||||
|
if (endp->IsProducer())
|
||||||
|
{
|
||||||
|
BMidiProducer* prod = dynamic_cast<BMidiProducer*>(endp);
|
||||||
|
|
||||||
|
....
|
||||||
|
|
||||||
|
}
|
||||||
|
\endcode
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/*!
|
||||||
|
\fn bool BMidiEndpoint::IsConsumer() const
|
||||||
|
\brief Determines whether this endpoint is a BMidiConsumer
|
||||||
|
|
||||||
|
If it is, you can use a dynamic_cast to convert this object into a consumer:
|
||||||
|
|
||||||
|
\code
|
||||||
|
if (endp->IsConsumer())
|
||||||
|
{
|
||||||
|
BMidiConsumer* cons = dynamic_cast<BMidiConsumer*>(endp);
|
||||||
|
|
||||||
|
....
|
||||||
|
|
||||||
|
}
|
||||||
|
\endcode
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/*!
|
||||||
|
\fn bool BMidiEndpoint::IsRemote() const
|
||||||
|
\brief Determines whether this endpoint is a proxy for a remote object.
|
||||||
|
|
||||||
|
An endpoint is "remote" when it is created by another application.
|
||||||
|
Obviously, the remote object is Register()'ed as well, otherwise you would
|
||||||
|
not be able to see it.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/*!
|
||||||
|
\fn bool BMidiEndpoint::IsLocal() const
|
||||||
|
\brief Determines whether this endpoint represents a local object
|
||||||
|
|
||||||
|
An endpoint is "local" when it is created by this application; in other
|
||||||
|
words, a BMidiLocalConsumer or BMidiLocalProducer.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/*!
|
||||||
|
\fn bool BMidiEndpoint::IsPersistent() const
|
||||||
|
\brief Not used.
|
||||||
|
|
||||||
|
The purpose of this function is unclear, and as a result it doesn't do
|
||||||
|
anything in the Haiku Midi Kit implementation.
|
||||||
|
|
||||||
|
\return \c false always.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/*!
|
||||||
|
\fn bool BMidiEndpoint::IsValid() const
|
||||||
|
\brief Determines whether the endpoint still exists.
|
||||||
|
|
||||||
|
Suppose you obtained a proxy object for a remote endpoint by querying the
|
||||||
|
BMidiRoster. What if the application that published this endpoint quits,
|
||||||
|
or less drastically, Unregister()'s that endpoint? Even though you still
|
||||||
|
have a BMidiEndpoint proxy object, the real endpoint no longer exists.
|
||||||
|
You can use IsValid() to check for this.
|
||||||
|
|
||||||
|
Don't worry, operations on invalid objects, such as GetProperties(), will
|
||||||
|
return an error code (typically B_ERROR), but not cause a crash. Local
|
||||||
|
objects are always are considered to be valid, even if you did not
|
||||||
|
Register() them. (The only time a local endpoint is not valid is when there
|
||||||
|
was a problem constructing it.)
|
||||||
|
|
||||||
|
If the application that created the remote endpoint crashes, then there is
|
||||||
|
no guarantee that the Midi Server immediately recognizes this. In that
|
||||||
|
case, IsValid() may still return true. Eventually, the stale endpoint will
|
||||||
|
be removed from the roster, though. From then on, IsValid() correctly
|
||||||
|
returns \c false.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/*!
|
||||||
|
\fn status_t BMidiEndpoint::Acquire()
|
||||||
|
\brief Increments the endpoint's reference count
|
||||||
|
|
||||||
|
Each BMidiEndpoint has a reference count associated with it, so that
|
||||||
|
BMidiRoster can do proper bookkeeping. Acquire() increments this reference
|
||||||
|
count, and Release() decrements it. Once the count reaches zero, the
|
||||||
|
endpoint is deleted.
|
||||||
|
|
||||||
|
When you are done with the endpoint, whether local or remote, you should
|
||||||
|
always Release() it!
|
||||||
|
|
||||||
|
Upon construction, local endpoints start with a reference count of 1. Any
|
||||||
|
objects you obtain from BMidiRoster using the NextXXX() or FindXXX()
|
||||||
|
functions have their reference counts incremented in the process. If you
|
||||||
|
forget to call Release(), the objects won't be properly cleaned up and
|
||||||
|
you'll make a fool out of yourself.
|
||||||
|
|
||||||
|
After you Release() an object, you are advised not to use it any further.
|
||||||
|
If you do, your app will probably crash. That also happens if you Release()
|
||||||
|
an object too many times.
|
||||||
|
|
||||||
|
Typically, you don't need to call Acquire(), unless you have two disparate
|
||||||
|
parts of your application working with the same endpoint, and you don't
|
||||||
|
want to have to keep track of who needs to Release() the endpoint. Now you
|
||||||
|
simply have both of them release it.
|
||||||
|
|
||||||
|
\return Always returns B_OK
|
||||||
|
|
||||||
|
\sa Release()
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*!
|
||||||
|
\fn status_t BMidiEndpoint::Release()
|
||||||
|
\brief Decrements the endpoint's reference count.
|
||||||
|
|
||||||
|
\return Always returns B_OK
|
||||||
|
|
||||||
|
\sa Acquire()
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*!
|
||||||
|
\fn status_t BMidiEndpoint::Register()
|
||||||
|
\brief Publishes the endpoint on the roster
|
||||||
|
|
||||||
|
MIDI objects created by an application are invisible to other applications
|
||||||
|
until they are published. To publish an object use the Register() method.
|
||||||
|
The corresponding Unregister() method will cause an object to once again
|
||||||
|
become invisible to remote applications.
|
||||||
|
|
||||||
|
BMidiRoster also has Register() and Unregister() methods. You may also use
|
||||||
|
those methods to publish or hide your endpoints; both do the same thing.
|
||||||
|
|
||||||
|
Although it is considered bad style, calling Register() on local endpoints
|
||||||
|
that are already registered won't mess things up. The Midi Server will
|
||||||
|
simply ignore your request. Likewise for Unregister()'ing more than once.
|
||||||
|
Attempts to Register() or Unregister() remote endpoints will fail, of
|
||||||
|
course.
|
||||||
|
|
||||||
|
If you are \link BMidiRoster::StartWatching() watching \endlink, you will
|
||||||
|
<b>not</b> receive notifications for any local endpoints you register or
|
||||||
|
unregister. Of course, other applications <I>will</I> be notified about
|
||||||
|
your endpoints.
|
||||||
|
|
||||||
|
Existing connections will not be broken when an object is unregistered,
|
||||||
|
but future remote connections will be denied. When objects are destroyed,
|
||||||
|
they automatically become unregistered.
|
||||||
|
|
||||||
|
\returns B_OK on success, or an error code (typically \c B_ERROR) if
|
||||||
|
something went wrong.
|
||||||
|
|
||||||
|
\sa Unregister()
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*!
|
||||||
|
\fn status_t BMidiEndpoint::Unregister()
|
||||||
|
\brief Hides the endpoint from the roster/
|
||||||
|
|
||||||
|
\sa Register()
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*!
|
||||||
|
\fn status_t BMidiEndpoint::SetProperties(const BMessage* props)
|
||||||
|
\brief Changes the properties of the endpoint
|
||||||
|
|
||||||
|
Endpoints can have properties, which is any kind of information that
|
||||||
|
might be useful to associate with a MIDI object. The properties are
|
||||||
|
stored in a BMessage.
|
||||||
|
|
||||||
|
Usage example:
|
||||||
|
|
||||||
|
\code
|
||||||
|
BMessage props;
|
||||||
|
if (endpoint->GetProperties(&props) == B_OK)
|
||||||
|
{
|
||||||
|
...add data to the message...
|
||||||
|
endpoint->SetProperties(&props);
|
||||||
|
}
|
||||||
|
\endcode
|
||||||
|
|
||||||
|
You are only allowed to call SetProperties() on a local object.
|
||||||
|
|
||||||
|
Properties should follow a protocol, so different applications will know
|
||||||
|
how to read each other's properties. The current protocol is very limited
|
||||||
|
-- it only allows you to associate icons with your endpoints. Be planned
|
||||||
|
to publish a more complete protocol that included additional information,
|
||||||
|
such as vendor/model names, copyright/version info, category, etc., but
|
||||||
|
they never got around to it.
|
||||||
|
|
||||||
|
<TABLE BORDER="1">
|
||||||
|
<TR><TD>property</TD><TD>Vector icon (raw data)</TD></TR>
|
||||||
|
<TR><TD>field name</TD><TD>"icon"</TD></TR>
|
||||||
|
<TR><TD>field type</TD><TD>'VICN'</TD></TR>
|
||||||
|
</TABLE>
|
||||||
|
|
||||||
|
This vector icon is available under Haiku only, and comes as raw data,
|
||||||
|
not a BBitmap. Before being able to display it, you first must render
|
||||||
|
the vector icon in the size of your choice.
|
||||||
|
|
||||||
|
<TABLE BORDER="1">
|
||||||
|
<TR><TD>property</TD><TD>Large (32x32) icon</TD></TR>
|
||||||
|
<TR><TD>field name</TD><TD>"be:large_icon"</TD></TR>
|
||||||
|
<TR><TD>field type</TD><TD>'ICON'</TD></TR>
|
||||||
|
</TABLE>
|
||||||
|
|
||||||
|
<TABLE BORDER="1">
|
||||||
|
<TR><TD>property</TD><TD>Small (16x16) icon</TD></TR>
|
||||||
|
<TR><TD>field name</TD><TD>"be:mini_icon"</TD></TR>
|
||||||
|
<TR><TD>field type</TD><TD>'MICN'</TD></TR>
|
||||||
|
</TABLE>
|
||||||
|
|
||||||
|
The MidiUtil package (downloadable from the OpenBeOS website) contains a
|
||||||
|
number of convenient functions to associate icons with endpoints, so you
|
||||||
|
don't have to write that code all over again.
|
||||||
|
|
||||||
|
\sa GetProperties()
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*!
|
||||||
|
\fn status_t BMidiEndpoint::GetProperties(BMessage* props) const
|
||||||
|
\brief Reads the properties of the endpoint
|
||||||
|
|
||||||
|
Usage example:
|
||||||
|
|
||||||
|
\code
|
||||||
|
BMessage props;
|
||||||
|
if (endpoint->GetProperties(&props) == B_OK)
|
||||||
|
{
|
||||||
|
...examine the contents of the message...
|
||||||
|
}
|
||||||
|
\endcode
|
||||||
|
|
||||||
|
Note that GetProperties() overwrites the contents of your BMessage.
|
||||||
|
|
||||||
|
\sa SetProperties()
|
||||||
|
*/
|
||||||
@@ -0,0 +1,359 @@
|
|||||||
|
/*!
|
||||||
|
\file MidiProducer.h
|
||||||
|
\ingroup midi2
|
||||||
|
\ingroup libbe
|
||||||
|
\brief Defines producer classes for the MIDI Kit.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/*!
|
||||||
|
\class BMidiProducer MidiProducer.h
|
||||||
|
\ingroup midi2
|
||||||
|
\ingroup libmidi2
|
||||||
|
\ingroup libbe
|
||||||
|
\brief Streams MIDI events to connected consumers.
|
||||||
|
|
||||||
|
A producer is an object that generate a stream of MIDI events. Each
|
||||||
|
producer has a list of BMidiConsumer objects to which it is connected,
|
||||||
|
and may be asked to connect to or disconnect from a BMidiConsumer. A
|
||||||
|
producer can spray its events to multiple consumers at the same time.
|
||||||
|
A BMidiProducer either represents a local producer, i.e. a class extending
|
||||||
|
from BMidiLocalProducer, or is a proxy for a remote object published by
|
||||||
|
another app.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/*!
|
||||||
|
\fn status_t BMidiProducer::Connect(BMidiConsumer* cons)
|
||||||
|
\brief Connects a consumer to this producer.
|
||||||
|
|
||||||
|
Establishes a connection between this producer and the specified consumer
|
||||||
|
endpoint. From now on, any events that this producer sprays will be sent
|
||||||
|
to that consumer. You may connect multiple consumers to a producer.
|
||||||
|
|
||||||
|
\return B_OK on success, or an error code when the connection could not be
|
||||||
|
established. If the consumer is a proxy for a remote object and that
|
||||||
|
object no longer exists, Connect() returns B_ERROR. It also returns
|
||||||
|
\c B_ERROR if you try to connect the same producer and consumer more
|
||||||
|
than once.
|
||||||
|
|
||||||
|
\sa Disconnect()
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/*!
|
||||||
|
\fn status_t BMidiProducer::Disconnect(BMidiConsumer* cons)
|
||||||
|
\brief Disconnects a consumer from this producer.
|
||||||
|
|
||||||
|
Terminates the connection between this producer and the specified consumer
|
||||||
|
endpoint. From now on, any events that this producer sprays no longer go
|
||||||
|
to that consumer.
|
||||||
|
|
||||||
|
\return B_OK on success, or an error code if there was no connection to break
|
||||||
|
\sa Connect()
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/*!
|
||||||
|
\fn bool BMidiProducer::IsConnected(BMidiConsumer* cons) const
|
||||||
|
\brief Determines whether a consumer is connected to this producer.
|
||||||
|
|
||||||
|
\sa Connect()
|
||||||
|
\sa Disconnect()
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/*!
|
||||||
|
\fn BList* BMidiProducer::Connections() const
|
||||||
|
\brief Returns a list with all connected consumers.
|
||||||
|
|
||||||
|
Returns a BList with pointers to BMidiEndpoint objects for all consumers
|
||||||
|
that are connected to this producer. You can examine the contents of the
|
||||||
|
list as follows:
|
||||||
|
\code
|
||||||
|
BList* list = prod->Connections();
|
||||||
|
for (int32 t = 0; t < list->CountItems(); ++t)
|
||||||
|
{
|
||||||
|
BMidiEndpoint* endp = (BMidiEndpoint*) list->ItemAt(t);
|
||||||
|
...do stuff...
|
||||||
|
endp->Release(); // yes, here too!
|
||||||
|
}
|
||||||
|
delete list;
|
||||||
|
\endcode
|
||||||
|
Every time you call this function, a new BList is allocated. The caller
|
||||||
|
(that is you) is responsible for freeing this list. The BMidiEndpoint
|
||||||
|
objects in the list have their reference counts bumped, so you need to
|
||||||
|
Release() them before you delete the list or they will go all leaky on
|
||||||
|
you.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/*!
|
||||||
|
\class BMidiLocalProducer MidiProducer.h
|
||||||
|
\ingroup midi2
|
||||||
|
\ingroup libmidi2
|
||||||
|
\ingroup libbe
|
||||||
|
\brief A producer endpoint that is created by your own application.
|
||||||
|
|
||||||
|
You create a BMidiLocalProducer if you want your application to send MIDI
|
||||||
|
events. You use the various spray functions to send events to all connected
|
||||||
|
consumers. If no consumers are connected to the producer, any calls to the
|
||||||
|
spray functions are ignored.
|
||||||
|
|
||||||
|
Most spray functions accept a channel argument. Even though MIDI channels are
|
||||||
|
really numbered 1 through 16, the spray functions work with channels 0 through
|
||||||
|
15. You can also specify the performance time for the event using the time
|
||||||
|
argument. Specify 0 (or any time in the past) to perform the event "now", i.e.
|
||||||
|
as soon as possible. You can also schedule events to be performed in the
|
||||||
|
future, by passing a time such as system_time() + 5000000, which means 5
|
||||||
|
seconds from now.
|
||||||
|
|
||||||
|
Unlike BMidiLocalConsumer, which should be subclassed almost always, you hardly
|
||||||
|
ever need to derive a class from BMidiLocalProducer. The only reason for
|
||||||
|
subclassing is when you need to know when the producer gets connected or
|
||||||
|
disconnected.
|
||||||
|
|
||||||
|
Also unlike consumers, local producers have no thread of control directly
|
||||||
|
associated with them. If you want to send out the MIDI events from a different
|
||||||
|
thread, you will have to create one yourself.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/*!
|
||||||
|
\fn BMidiLocalProducer::BMidiLocalProducer(const char *name = NULL)
|
||||||
|
\brief Creates a new local producer endpoint.
|
||||||
|
|
||||||
|
The new endpoint is not visible to other applications until you Register() it.
|
||||||
|
You can tell the constructor what the name of the new producer will be. If you
|
||||||
|
pass NULL (or use the default argument), then the producer's name will be an
|
||||||
|
empty string. It won't be NULL, since endpoint names cannot be NULL.
|
||||||
|
There is no guarantee that the endpoint will be successfully created. For
|
||||||
|
example, the Midi Server may not be running. Therefore, you should always call
|
||||||
|
IsValid() after creating a new endpoint to make sure that everything went okay.
|
||||||
|
If not, Release() the object to reclaim memory and abort gracefully.
|
||||||
|
\code
|
||||||
|
BMidiLocalProducer* prod = new BMidiLocalProducer(...);
|
||||||
|
if (!prod->IsValid())
|
||||||
|
{
|
||||||
|
prod->Release();
|
||||||
|
...exit gracefully...
|
||||||
|
}
|
||||||
|
\endcode
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/*!
|
||||||
|
\fn void BMidiLocalProducer::Connected(BMidiConsumer* cons)
|
||||||
|
\brief Invoked when a new consumer is connected to this producer
|
||||||
|
|
||||||
|
Although typical notifications (i.e. from BMidiRoster's "watching" facility)
|
||||||
|
are only sent if it is some other app that is performing the operation,
|
||||||
|
Connected() is also called if you are making the connection yourself.
|
||||||
|
If you override this hook, you don't have to call the default implementation,
|
||||||
|
because that does nothing.
|
||||||
|
|
||||||
|
\param cons The newly connected consumer. The reference count of the
|
||||||
|
consumer object is not increased, so you should not Release() it.
|
||||||
|
However, if you want to keep track of the consumer beyond this
|
||||||
|
function, you should first Acquire() it, and Release() it when you
|
||||||
|
are done.
|
||||||
|
|
||||||
|
\sa Disconnected()
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/*!
|
||||||
|
\fn void BMidiLocalProducer::Disconnected(BMidiConsumer* cons)
|
||||||
|
\brief Invoked when a consumer is disconnected from this producer.
|
||||||
|
|
||||||
|
\sa Connected()
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/*!
|
||||||
|
\fn void BMidiLocalProducer::SprayData(void* data, size_t length,
|
||||||
|
bool atomic = false, bigtime_t time = 0) const
|
||||||
|
\brief Sends raw MIDI data downstream to all connected consumers.
|
||||||
|
|
||||||
|
Typically you won't have to call SprayData(); the other spray functions
|
||||||
|
will do just fine. If you do call it, remember that you retain ownership
|
||||||
|
of the data and that you are responsible for freeing it at some point.
|
||||||
|
(Even though data is not declared const, the function does not change it.)
|
||||||
|
With atomic set to false, you can send a MIDI message in segments (perhaps
|
||||||
|
for a large sysex dump). However, when you do this, you are on your own.
|
||||||
|
The Midi Kit only tags the data as being non-atomic, but offers no]
|
||||||
|
additional support.
|
||||||
|
|
||||||
|
The default implementation of BMidiLocalConsumer completely ignores such
|
||||||
|
events. To handle non-atomic MIDI data, you should override the
|
||||||
|
BMidiLocalConsumer::Data() hook and process the MIDI event yourself. All of
|
||||||
|
BMidiLocalProducer's other spray functions always send atomic data.
|
||||||
|
|
||||||
|
\param data the MIDI event data.
|
||||||
|
\param length byte size of the data buffer.
|
||||||
|
\param atomic whether the data buffer contains a single complete
|
||||||
|
MIDI event.
|
||||||
|
\param time the required performance time of the event.
|
||||||
|
|
||||||
|
\sa BMidiLocalConsumer::Data()
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/*!
|
||||||
|
\fn void BMidiLocalProducer::SprayNoteOff(uchar channel, uchar note,
|
||||||
|
uchar velocity, bigtime_t time = 0) const
|
||||||
|
\brief Sends a Note Off event to all connected consumers.
|
||||||
|
|
||||||
|
\sa BMidiLocalConsumer::NoteOff()
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/*!
|
||||||
|
\fn void BMidiLocalProducer::SprayNoteOn(uchar channel, uchar note,
|
||||||
|
uchar velocity, bigtime_t time = 0) const
|
||||||
|
\brief Sends a Note On event to all connected consumers.
|
||||||
|
|
||||||
|
\sa BMidiLocalConsumer::NoteOn()
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/*!
|
||||||
|
\fn void BMidiLocalProducer::SprayKeyPressure(uchar channel, uchar note,
|
||||||
|
uchar pressure, bigtime_t time = 0) const
|
||||||
|
\brief Sends a Polyphonic Pressure (Aftertouch) event to all connected
|
||||||
|
consumers.
|
||||||
|
|
||||||
|
\sa BMidiLocalConsumer::KeyPressure()
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/*!
|
||||||
|
\fn void BMidiLocalProducer::SprayControlChange(uchar channel,
|
||||||
|
uchar controlNumber, uchar controlValue, bigtime_t time = 0) const
|
||||||
|
\brief Sends a Controller Change event to all connected consumers.
|
||||||
|
|
||||||
|
\sa Midi2Defs.h
|
||||||
|
\sa BMidiLocalConsumer::ControlChange()
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/*!
|
||||||
|
\fn void BMidiLocalProducer::SprayProgramChange(uchar channel,
|
||||||
|
uchar programNumber, bigtime_t time = 0) const
|
||||||
|
\brief Sends a Program Change event to all connected consumers.
|
||||||
|
|
||||||
|
\sa BMidiLocalConsumer::ProgramChange()
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/*!
|
||||||
|
\fn void BMidiLocalProducer::SprayChannelPressure(uchar channel,
|
||||||
|
uchar pressure, bigtime_t time = 0) const
|
||||||
|
\brief Sends a Channel Pressure event to all connected consumers.
|
||||||
|
|
||||||
|
\sa BMidiLocalConsumer::ChannelPressure()
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/*!
|
||||||
|
\fn void BMidiLocalProducer::SprayPitchBend(uchar channel, uchar lsb,
|
||||||
|
uchar msb, bigtime_t time = 0) const
|
||||||
|
\brief Sends a Pitch Bend event to all connected consumers.
|
||||||
|
|
||||||
|
\sa BMidiLocalConsumer::PitchBend()
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/*!
|
||||||
|
\fn void BMidiLocalProducer::SpraySystemExclusive(void* data,
|
||||||
|
size_t length, bigtime_t time = 0) const
|
||||||
|
\brief Sends a System Exclusive event to all connected consumers.
|
||||||
|
|
||||||
|
You retain ownership of the data and are responsible for freeing it. Even
|
||||||
|
though data is not declared const, the function does not change it. Even
|
||||||
|
though the amount of data may be quite large, this function always sends
|
||||||
|
sysex messages as an atomic block of data.
|
||||||
|
|
||||||
|
\sa BMidiLocalConsumer::SystemExclusive()
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/*!
|
||||||
|
\fn void BMidiLocalProducer::SpraySystemCommon(uchar status,\
|
||||||
|
uchar data1, uchar data2, bigtime_t time = 0) const
|
||||||
|
\brief Sends a System Common event to the connected consumers.
|
||||||
|
|
||||||
|
The status byte must be one of the following:
|
||||||
|
<table border="1">
|
||||||
|
<tr>
|
||||||
|
<td>0xF1</td>
|
||||||
|
<td>\c B_MIDI_TIME_CODE</td>
|
||||||
|
<td>data1 only</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>0xF2</td>
|
||||||
|
<td>\c B_SONG_POSITION</td>
|
||||||
|
<td>data1 and data2</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>0xF3</td>
|
||||||
|
<td>\c B_SONG_SELECT</td>
|
||||||
|
<td>data1 only</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>0xF5</td>
|
||||||
|
<td>\c B_CABLE_MESSAGE</td>
|
||||||
|
<td>data1 only</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>0xF6</td>
|
||||||
|
<td>\c B_TUNE_REQUEST</td>
|
||||||
|
<td>no data</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>0xF7</td>
|
||||||
|
<td>\c B_SYS_EX_END</td>
|
||||||
|
<td>no data</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
\sa BMidiLocalConsumer::SystemCommon()
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/*!
|
||||||
|
\fn void BMidiLocalProducer::SpraySystemRealTime(uchar status,
|
||||||
|
bigtime_t time = 0) const
|
||||||
|
\brief Sends a Real Time event to the connected consumers.
|
||||||
|
|
||||||
|
The status byte must be one of the following:
|
||||||
|
<table border="1">
|
||||||
|
<tr><td>0xf8</td><td>\c B_TIMING_CLOCK</td></tr>
|
||||||
|
<tr><td>0xfa</td><td>\c B_START</td></tr>
|
||||||
|
<tr><td>0xfb</td><td>\c B_CONTINUE</td></tr>
|
||||||
|
<tr><td>0xfc</td><td>\c B_STOP</td></tr>
|
||||||
|
<tr><td>0xfe</td><td>\c B_ACTIVE_SENSING</td></tr>
|
||||||
|
<tr><td>0xff</td><td>\c B_SYSTEM_RESET</td></tr>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
Because of their high priority, the MIDI specification allows real time
|
||||||
|
messages to "interleave" with other MIDI messages. A large sysex dump, for
|
||||||
|
example, may be interrupted by a real time event. The Midi Kit, however,
|
||||||
|
doesn't care. If you (or another producer) have just sent a big system
|
||||||
|
exclusive to a consumer, any following real time message will simply have
|
||||||
|
to wait until the consumer has dealt with the sysex.
|
||||||
|
|
||||||
|
\sa BMidiLocalConsumer::SystemRealTime()
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/*!
|
||||||
|
\fn void BMidiLocalProducer::SprayTempoChange(int32 bpm,
|
||||||
|
bigtime_t time = 0) const
|
||||||
|
\brief Sends a Tempo Change event to the connected consumers.
|
||||||
|
|
||||||
|
This kind of Tempo Change event is not really part of the MIDI spec,
|
||||||
|
rather it is an extension from the SMF (Standard MIDI File) format.
|
||||||
|
|
||||||
|
\sa BMidiLocalConsumer::TempoChange()
|
||||||
|
*/
|
||||||
@@ -0,0 +1,418 @@
|
|||||||
|
/*!
|
||||||
|
\file MidiRoster.h
|
||||||
|
\ingroup midi2
|
||||||
|
\ingroup libbe
|
||||||
|
\brief Defines the heart of the MIDI Kit: the MIDI Roster.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/*!
|
||||||
|
\enum BMidiOp
|
||||||
|
\ingroup midi2
|
||||||
|
\ingroup libbe
|
||||||
|
\brief Defines the status codes for MIDI Server notification messages.
|
||||||
|
|
||||||
|
These codes are used when you request notification as in
|
||||||
|
BMidiRoster::StartWatching(). Check against these codes to determine what
|
||||||
|
is happening. See the StartWatching() method for a more complete
|
||||||
|
description of the codes and their meaning.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/*!
|
||||||
|
\var B_MIDI_EVENT
|
||||||
|
\brief BMessage identifier of MIDI messages.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/*!
|
||||||
|
\class BMidiRoster MidiRoster.h
|
||||||
|
\ingroup midi2
|
||||||
|
\ingroup libmidi2
|
||||||
|
\ingroup libbe
|
||||||
|
\brief Interface to the system-wide Midi Roster.
|
||||||
|
|
||||||
|
BMidiRoster allows you to find available MIDI consumer and producer
|
||||||
|
objects. You can locate these objects using the iterative NextEndpoint(),
|
||||||
|
NextProducer(), and NextConsumer() methods or by requesting notification
|
||||||
|
messages to be sent with StartWatching(). Notification messages may
|
||||||
|
contain object IDs which can be resolved using the FindEndpoint(),
|
||||||
|
FindProducer(), and FindConsumer() methods.
|
||||||
|
|
||||||
|
The constructor and destructor of BMidiRoster are private, which means
|
||||||
|
that you cannot create or delete your own BMidiRoster objects. Every
|
||||||
|
application can have only one instance of BMidiRoster, which is
|
||||||
|
automatically created the very first time you use a Midi Kit function.
|
||||||
|
You can call BMidiRoster's functions like this:
|
||||||
|
\code
|
||||||
|
producer = BMidiRoster::FindProducer(someID);
|
||||||
|
\endcode
|
||||||
|
Or using the slightly more annoying:
|
||||||
|
\code
|
||||||
|
BMidiRoster* roster = BMidiRoster::MidiRoster();
|
||||||
|
if (roster != NULL)
|
||||||
|
{
|
||||||
|
producer = roster->FindProducer(someID);
|
||||||
|
}
|
||||||
|
\endcode
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/*!
|
||||||
|
\fn BMidiEndpoint* BMidiRoster::NextEndpoint(int32* id)
|
||||||
|
\brief Returns the next endpoint from the roster
|
||||||
|
|
||||||
|
The "next endpoint" means: the endpoint with the ID that follows \a id.
|
||||||
|
So if you set id to 3, the first possible endpoint it returns is
|
||||||
|
endpoint 4. No endpoint can have ID 0, so passing 0 gives you the first
|
||||||
|
endpoint. If you pass \c NULL instead of an ID, NextEndpoint() always
|
||||||
|
returns \c NULL. When the function returns, it sets \a id to the ID of the
|
||||||
|
endpoint that was found. If no more endpoints exist, NextEndpoint()
|
||||||
|
returns \c NULL and id is not changed. NextEndpoint() does <b>not</b>
|
||||||
|
return locally created endpoints, even if they are Register()'ed.
|
||||||
|
|
||||||
|
Usage example:
|
||||||
|
\code
|
||||||
|
int32 id = 0;
|
||||||
|
BMidiEndpoint* endp;
|
||||||
|
while ((endp = BMidiRoster::NextEndpoint(&id)) != NULL)
|
||||||
|
{
|
||||||
|
... do something with endpoint ...
|
||||||
|
endp->Release(); // don't forget!
|
||||||
|
}
|
||||||
|
\endcode
|
||||||
|
Remember that NextEndpoint() bumps the endpoint's reference count, so you
|
||||||
|
should always \link BMidiEndpoint::Release() Release() \endlink it when
|
||||||
|
you are done.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/*!
|
||||||
|
\fn BMidiProducer* BMidiRoster::NextProducer(int32* id)
|
||||||
|
\brief Returns the next producer from the roster.
|
||||||
|
|
||||||
|
Like NextEndpoint(), but only returns producer endpoints.
|
||||||
|
|
||||||
|
\sa NextConsumer
|
||||||
|
\sa NextEndpoint
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/*!
|
||||||
|
\fn BMidiConsumer* BMidiRoster::NextConsumer(int32* id)
|
||||||
|
\brief Returns the next consumer from the roster.
|
||||||
|
|
||||||
|
Like NextEndpoint(), but only returns consumer endpoints.
|
||||||
|
|
||||||
|
\sa NextProducer
|
||||||
|
\sa NextEndpoint
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/*!
|
||||||
|
\fn BMidiEndpoint* BMidiRoster::FindEndpoint(int32 id,
|
||||||
|
bool localOnly = false)
|
||||||
|
\brief Returns the endpoint with the specified \a id.
|
||||||
|
|
||||||
|
FindEndpoint() will always find <b>any</b> local endpoints created by this
|
||||||
|
application; they do not have to be published with Register() first. If
|
||||||
|
localOnly is false, FindEndpoint() also looks at remote endpoints,
|
||||||
|
otherwise only local endpoints will be resolved. Returns NULL if no such
|
||||||
|
endpoint could be found.
|
||||||
|
|
||||||
|
You should use a dynamic_cast to convert the BMidiEndpoint into a producer
|
||||||
|
or consumer:
|
||||||
|
\code
|
||||||
|
BMidiEndpoint* endp = ...;
|
||||||
|
BMidiProducer* prod = NULL;
|
||||||
|
BMidiConsumer* cons = NULL;
|
||||||
|
if (endp->IsProducer())
|
||||||
|
{
|
||||||
|
prod = dynamic_cast<BMidiProducer*>(endp);
|
||||||
|
}
|
||||||
|
else if (endp->IsConsumer())
|
||||||
|
{
|
||||||
|
cons = dynamic_cast<BMidiConsumer*>(endp);
|
||||||
|
}
|
||||||
|
\endcode
|
||||||
|
|
||||||
|
Remember that FindEndpoint() increments the endpoint's reference count,
|
||||||
|
so you should always \link BMidiEndpoint::Release() Release() \endlink
|
||||||
|
an endpoint when you are done with it:
|
||||||
|
\code
|
||||||
|
BMidiEndpoint* endp = BMidiRoster::FindEndpoint(someID);
|
||||||
|
if (endp != NULL)
|
||||||
|
{
|
||||||
|
...do stuff with the endpoint...
|
||||||
|
endp->Release();
|
||||||
|
}
|
||||||
|
\endcode
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/*!
|
||||||
|
\fn BMidiProducer* BMidiRoster::FindProducer(int32 id,
|
||||||
|
bool localOnly = false)
|
||||||
|
\brief Finds the producer with the specified \a id.
|
||||||
|
|
||||||
|
Like FindEndpoint(), but only looks for producer endpoints. Returns
|
||||||
|
\c NULL if no endpoint with that ID exists, or if that endpoint is not
|
||||||
|
a producer.
|
||||||
|
|
||||||
|
\sa FindConsumer
|
||||||
|
\sa FindEndpoint
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/*!
|
||||||
|
\fn BMidiConsumer* BMidiRoster::FindConsumer(int32 id,
|
||||||
|
bool localOnly = false)
|
||||||
|
\brief Finds the consumer with the specified \a id.
|
||||||
|
|
||||||
|
Like FindEndpoint(), but only looks for consumer endpoints. Returns
|
||||||
|
\c NULL if no endpoint with that ID exists, or if that endpoint is not
|
||||||
|
a consumer.
|
||||||
|
|
||||||
|
\sa FindProducer
|
||||||
|
\sa FindEndpoint
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/*!
|
||||||
|
\fn void BMidiRoster::StartWatching(const BMessenger* msngr)
|
||||||
|
\brief Start receiving notifications from the Midi Roster
|
||||||
|
|
||||||
|
When you start watching, BMidiRoster sends you notifications for all
|
||||||
|
currently \b published \c remote endpoints, and all the current
|
||||||
|
connections between them. (At this point, BMidiRoster does not let you
|
||||||
|
know about connections between unpublished endpoints, nor does it tell
|
||||||
|
you anything about your local endpoints, even though they may be
|
||||||
|
published.)
|
||||||
|
|
||||||
|
Thereafter, you'll receive notifications any time something important
|
||||||
|
happens to an object. The application that performs these operations is
|
||||||
|
itself not notified. The assumption here is that you already know about
|
||||||
|
these changes, because you are the one that is performing them.
|
||||||
|
|
||||||
|
The notifications are BMessages with code B_MIDI_EVENT. You specify the
|
||||||
|
BMessenger that will be used to send these messages. Each message contains
|
||||||
|
a field called be:op that describes the type of notification.
|
||||||
|
|
||||||
|
The "registered" and "unregistered" notifications are sent when a remote
|
||||||
|
endpoint Register()'s or Unregister()'s, respectively. You don't receive
|
||||||
|
these notifications when you register or unregister your local endpoints,
|
||||||
|
but the other apps will.
|
||||||
|
|
||||||
|
<table border="1">
|
||||||
|
<tr>
|
||||||
|
<td>be:op</td>
|
||||||
|
<td>int32</td>
|
||||||
|
<td>\c B_MIDI_REGISTERED</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>be:id</td>
|
||||||
|
<td>int32</td>
|
||||||
|
<td>id of the endpoint</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>be:type</td>
|
||||||
|
<td>string</td>
|
||||||
|
<td>"producer" or "consumer"</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
<table border="1">
|
||||||
|
<tr>
|
||||||
|
<td>be:op</td>
|
||||||
|
<td>int32</td>
|
||||||
|
<td>\c B_MIDI_UNREGISTERED</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>be:id</td>
|
||||||
|
<td>int32</td>
|
||||||
|
<td>id of the endpoint</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>be:type</td>
|
||||||
|
<td>string</td>
|
||||||
|
<td>"producer" or "consumer"</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
The "connected" and "disconnected" notifications are sent when a consumer
|
||||||
|
\link BMidiProducer::Connect() Connect()\endlink's to a producer, or when
|
||||||
|
they \link BMidiProducer::Disconnect() Disconnect() \endlink. You will
|
||||||
|
receive these notifications when \b any two endpoints connect or
|
||||||
|
disconnect, even if they are not published. (The purpose of which is
|
||||||
|
debatable.) You won't receive the notifications if you are the one making
|
||||||
|
the connection, even if both endpoints are remote. You \b will be notified
|
||||||
|
when another app connects one of your published endpoints.
|
||||||
|
<table border="1">
|
||||||
|
<tr>
|
||||||
|
<td>be:op</td>
|
||||||
|
<td>\c int32</td>
|
||||||
|
<td>\c B_MIDI_CONNECTED</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>be:producer</td>
|
||||||
|
<td>\c int32</td>
|
||||||
|
<td>id of the connector</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>be:consumer</td>
|
||||||
|
<td>\c int32</td>
|
||||||
|
<td>id of the connectee</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
<table border="1">
|
||||||
|
<tr>
|
||||||
|
<td>be:op</td>
|
||||||
|
<td>\c int32</td>
|
||||||
|
<td>\c B_MIDI_DISCONNECTED</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>be:producer</td>
|
||||||
|
<td>\c int32</td>
|
||||||
|
<td>id of the connector</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>be:consumer</td>
|
||||||
|
<td>int32</td>
|
||||||
|
<td>id of the connectee</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
the following notifications are sent when an endpoint's attributes are
|
||||||
|
changed. you receive these notifications only if another application is
|
||||||
|
changing one of its published endpoints.
|
||||||
|
|
||||||
|
<table border="1">
|
||||||
|
<tr>
|
||||||
|
<td>be:op</td>
|
||||||
|
<td>\c int32</td>
|
||||||
|
<td>\c B_MIDI_CHANGED_NAME</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>be:id</td>
|
||||||
|
<td>\c int32</td>
|
||||||
|
<td>id of the endpoint</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>be:type</td>
|
||||||
|
<td>string</td>
|
||||||
|
<td>"producer" or "consumer"</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>be:name</td>
|
||||||
|
<td>string</td>
|
||||||
|
<td>the endpoint's new name</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
<table border="1">
|
||||||
|
<tr>
|
||||||
|
<td>be:op</td>
|
||||||
|
<td>\c int32</td>
|
||||||
|
<td>\c B_MIDI_CHANGED_LATENCY</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>be:id</td>
|
||||||
|
<td>\c int32</td>
|
||||||
|
<td>id of the endpoint</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>be:type</td>
|
||||||
|
<td>string</td>
|
||||||
|
<td>"producer" or "consumer"</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>be:latency</td>
|
||||||
|
<td>int64</td>
|
||||||
|
<td>the new latency (microseconds)</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
<table border="1">
|
||||||
|
<tr>
|
||||||
|
<td>be:op</td>
|
||||||
|
<td>int32</td>
|
||||||
|
<td>\c B_MIDI_CHANGED_PROPERTIES</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>be:id</td>
|
||||||
|
<td>\c int32</td>
|
||||||
|
<td>id of the endpoint</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>be:type</td>
|
||||||
|
<td>string</td>
|
||||||
|
<td>"producer" or "consumer"</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>be:properties</td>
|
||||||
|
<td>bmessage</td>
|
||||||
|
<td>the new properties</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
Typical usage example:
|
||||||
|
|
||||||
|
\code
|
||||||
|
void MyView::AttachedToWindow()
|
||||||
|
{
|
||||||
|
BMessenger msgr(this);
|
||||||
|
BMidiRoster::StartWatching(&msgr);
|
||||||
|
}
|
||||||
|
void MyView::MessageReceived(BMessage* msg)
|
||||||
|
{
|
||||||
|
switch (msg->what)
|
||||||
|
{
|
||||||
|
case B_MIDI_EVENT:
|
||||||
|
HandleMidiEvent(msg);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
super::MessageReceived(msg);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
\endcode
|
||||||
|
|
||||||
|
For the possible midi options, see #BMidiOp
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/*!
|
||||||
|
\fn void BMidiRoster::StopWatching()
|
||||||
|
\brief Stop receiving notifications from the Midi Roster.
|
||||||
|
|
||||||
|
\sa StartWatching()
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/*!
|
||||||
|
\fn status_t BMidiRoster::Register(BMidiEndpoint* object)
|
||||||
|
\brief Publishes an endpoint to other applications.
|
||||||
|
|
||||||
|
Calls BMidiEndpoint's \link BMidiEndpoint::Register() Register() \endlink
|
||||||
|
method to publish an endpoint, which makes it visible to other
|
||||||
|
applications.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/*!
|
||||||
|
\fn status_t BMidiRoster::Unregister(BMidiEndpoint* object)
|
||||||
|
\brief Hides an endpoint from other applications.
|
||||||
|
|
||||||
|
Calls BMidiEndpoint's
|
||||||
|
\link BMidiEndpoint::Unregister() Unregister() \endlink method to hide
|
||||||
|
a previously published endpoint from other applications.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/*!
|
||||||
|
\fn BMidiRoster* BMidiRoster::MidiRoster()
|
||||||
|
\brief Returns a pointer to the only instance of BMidiRoster.
|
||||||
|
|
||||||
|
There is no real reason use this function, since all BMidiRoster's public
|
||||||
|
function are static.
|
||||||
|
*/
|
||||||
|
Before Width: | Height: | Size: 28 KiB After Width: | Height: | Size: 28 KiB |
@@ -1,291 +0,0 @@
|
|||||||
/*!
|
|
||||||
\class BMidiConsumer MidiConsumer.h
|
|
||||||
\ingroup midi2
|
|
||||||
\ingroup libmidi2
|
|
||||||
\brief Receives MIDI events from a producer
|
|
||||||
|
|
||||||
A consumer is an object that knows how to deal with incoming MIDI events. A
|
|
||||||
consumer can be connected to multiple producers at the same time. There is no
|
|
||||||
way to find out which producers are connected to this consumer just by looking
|
|
||||||
at the BMidiConsumer object; you will have to consult BMidiRoster for that.
|
|
||||||
|
|
||||||
A BMidiConsumer either represents a local consumer, i.e. a class extending from
|
|
||||||
BMidiLocalConsumer, or is a proxy for a remote object published by another app.
|
|
||||||
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*!
|
|
||||||
\fn bigtime_t BMidiConsumer::Latency() const
|
|
||||||
\brief Returns the latency of this consumer
|
|
||||||
|
|
||||||
The latency is measured in microseconds. Producers should attempt to get MIDI
|
|
||||||
events to this consumer by <I>(when - latency)</I>. You do this by subtracting
|
|
||||||
the latency from the performance time when you spray the events (provided that
|
|
||||||
you spray these events ahead of time, of course).
|
|
||||||
|
|
||||||
You cannot <I>set</I> the latency on a BMidiConsumer, only on a
|
|
||||||
BMidiLocalConsumer.
|
|
||||||
|
|
||||||
The latency issue gets slightly more complicated when multiple endpoints are
|
|
||||||
chained together, as in the following picture:
|
|
||||||
|
|
||||||
\verbatim
|
|
||||||
+-------+ +-------------+ +-------+
|
|
||||||
| | | | | |
|
|
||||||
| prodA |---->| consB prodB |---->| consC |
|
|
||||||
| | | | | |
|
|
||||||
+-------+ +-------------+ +-------+
|
|
||||||
appA appB (filter) appC
|
|
||||||
\endverbatim
|
|
||||||
|
|
||||||
Suppose consC has 200ms latency, and consB has 100ms latency. If consB simply
|
|
||||||
reports 100ms, then prodA will schedule its events for (t - 100), which is
|
|
||||||
really 200ms too late. (Of course, producers send out their events as soon as
|
|
||||||
possible, so depending on the load of the system, everything may work out just
|
|
||||||
fine.)
|
|
||||||
|
|
||||||
ConsB should report the latency of the consumer that is hooked up to its
|
|
||||||
output, consC, in addition to its own latency. In other words, the full
|
|
||||||
downstream latency. So, the reported latency in this case would be 300ms. This
|
|
||||||
also means that appB should change the latency of consB when prodB makes or
|
|
||||||
breaks a connection, and when consC reports a latency change. (If multiple
|
|
||||||
consumers are connected to prodB, you should take the slowest one.)
|
|
||||||
Unfortunately, the Midi Kit provides no easy mechanism for doing any of this,
|
|
||||||
so you are on your own here.
|
|
||||||
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*!
|
|
||||||
\class BMidiLocalConsumer MidiConsumer.h
|
|
||||||
\ingroup midi2
|
|
||||||
\ingroup libmidi2
|
|
||||||
\brief A consumer endpoint that is created by your own application
|
|
||||||
|
|
||||||
If you want to create a consumer that reacts to MIDI events, you should
|
|
||||||
subclass BMidiLocalConsumer.
|
|
||||||
|
|
||||||
Each local consumer has its own thread that receives and dispatches the MIDI
|
|
||||||
events. Whenever MIDI data arrives, the Data() hook passes the MIDI event on to
|
|
||||||
a more specific hook function: NoteOn(), NoteOff(), SystemExclusive(), and so
|
|
||||||
on. Calls to these hook functions are serialized -- they will never have to be
|
|
||||||
re-entrant. They also should not be called from outside the thread that is
|
|
||||||
invoking them.
|
|
||||||
|
|
||||||
Your subclass can override any of the MIDI event hooks. BMidiLocalConsumer
|
|
||||||
doesn't provide default implementations for them, so you don't have to call a
|
|
||||||
hook's default implementation if you override it. For complete control, you can
|
|
||||||
also override Data().
|
|
||||||
|
|
||||||
Most hook functions take a channel argument. Even though MIDI channels are
|
|
||||||
really numbered 1 through 16, the hook functions work with channels 0 through
|
|
||||||
15. The performance time for the event is specified in microseconds relative to
|
|
||||||
the system time base. A performance time that is 0 (or really any time in the
|
|
||||||
past) means "play as soon as possible". See the \ref midi2time "introduction"
|
|
||||||
for more information about timing and consumers.
|
|
||||||
|
|
||||||
The thread driving the consumer's events is a very high priority real time
|
|
||||||
thread. Events should be handled as quickly as possible (not counting
|
|
||||||
snoozing). If non-time-critical computation is needed it may be wise to queue
|
|
||||||
events up for a lower priority thread to handle them external to the main event
|
|
||||||
thread.
|
|
||||||
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*!
|
|
||||||
\fn BMidiLocalConsumer::BMidiLocalConsumer(const char *name = NULL)
|
|
||||||
\brief Creates a new local consumer endpoint
|
|
||||||
|
|
||||||
The new endpoint is not visible to other applications until you Register() it.
|
|
||||||
|
|
||||||
You can tell the constructor what the name of the new consumer will be. If you
|
|
||||||
pass NULL (or use the default argument), then the consumer's name will be an
|
|
||||||
empty string. It won't be NULL, since endpoint names cannot be NULL.
|
|
||||||
|
|
||||||
There is no guarantee that the endpoint will be successfully created. For
|
|
||||||
example, the Midi Server may not be running. Therefore, you should always call
|
|
||||||
IsValid() after creating a new endpoint to make sure that everything went okay.
|
|
||||||
If not, Release() the object to reclaim memory and abort gracefully.
|
|
||||||
|
|
||||||
\code
|
|
||||||
MyConsumer* cons = new MyConsumer(...);
|
|
||||||
if (!cons->IsValid())
|
|
||||||
{
|
|
||||||
cons->Release();
|
|
||||||
...exit gracefully...
|
|
||||||
}
|
|
||||||
\endcode
|
|
||||||
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*!
|
|
||||||
\fn void BMidiLocalConsumer::SetLatency(bigtime_t latency)
|
|
||||||
\brief Changes the published latency of the consumer
|
|
||||||
\sa Latency()
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*!
|
|
||||||
\fn int32 BMidiLocalConsumer::GetProducerID()
|
|
||||||
\brief Returns the ID of the producer that most recently sent a MIDI event to
|
|
||||||
this consumer
|
|
||||||
|
|
||||||
You can call this from one of the hooks to determine which producer the event
|
|
||||||
came from.
|
|
||||||
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*!
|
|
||||||
\fn void BMidiLocalConsumer::SetTimeout(bigtime_t when, void* data)
|
|
||||||
\brief Requests that the Timeout() hook will be called at some point
|
|
||||||
|
|
||||||
This method asks the consumer thread to call the Timeout() hook as soon as
|
|
||||||
possible after the timeout expires. For every call to SetTimeout(), the
|
|
||||||
Timeout() hook is only called once. Note: the term "timeout" may be a little
|
|
||||||
misleading; the hook will <I>always</I> be called, even if events are received
|
|
||||||
in the mean time. Apparently, this facility is handy for dealing with early
|
|
||||||
events.
|
|
||||||
|
|
||||||
Note that the event thread blocks on the consumer's port as long as no events
|
|
||||||
arrive. By default no timeout is set, and as a result the thread blocks
|
|
||||||
forever. Your call to SetTimeout() doesn't change this. The new timeout value
|
|
||||||
will go into effect the next time the thread tries to read from the port, i.e.
|
|
||||||
after the first event has been received. If no event ever comes in, the
|
|
||||||
Timeout() hook will never be called. This also means that you cannot cancel a
|
|
||||||
timeout once you have set it. To repeat, calling SetTimeout() only takes effect
|
|
||||||
after at least one new event has been received.
|
|
||||||
|
|
||||||
\param when An absolute time that's measured against the system clock.
|
|
||||||
|
|
||||||
\param data A pointer to a "cookie" that you can pass along to Timeout(). The
|
|
||||||
data is not copied, so you must ensure that the pointer remains valid until
|
|
||||||
Timeout() is called. You typically delete the data inside Timeout().
|
|
||||||
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*!
|
|
||||||
\fn void BMidiLocalConsumer::Timeout(void* data)
|
|
||||||
\brief Hook function that is called per your own request
|
|
||||||
\sa SetTimeout()
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*!
|
|
||||||
\fn void BMidiLocalConsumer::Data(
|
|
||||||
uchar* data, size_t length, bool atomic, bigtime_t time)
|
|
||||||
\brief Invoked when raw MIDI is received
|
|
||||||
|
|
||||||
What the default implementation of Data() does depends on the value of atomic.
|
|
||||||
If atomic is true, the data received comprises a single MIDI event; i.e. one
|
|
||||||
status byte followed by the appropriate number of data bytes and nothing else.
|
|
||||||
In this case, Data() calls the event-specific hook function that corresponds to
|
|
||||||
that status byte. This optimization is used by the Midi Kit to allow faster
|
|
||||||
dispatch of events generated by the specific Spray functions from
|
|
||||||
BMidiLocalProducer.
|
|
||||||
|
|
||||||
If atomic is false, Data() ignores the MIDI event. If you want a consumer to
|
|
||||||
handle non-atomic events, you have to override Data() and program this
|
|
||||||
yourself. In that case, you probably also want to call the default
|
|
||||||
implementation to handle the "normal" MIDI events.
|
|
||||||
|
|
||||||
Data() is rarely overridden, but you can override it if you want to. If you do,
|
|
||||||
remember that the data buffer is owned by the Midi Kit. Do not attempt to
|
|
||||||
modify or free it, lest you wish to be laughed at by other developers.
|
|
||||||
|
|
||||||
\param data the MIDI event data
|
|
||||||
\param length byte size of the data buffer
|
|
||||||
\param atomic whether the data buffer contains a single complete MIDI event
|
|
||||||
\param time the requested performance time of the event
|
|
||||||
|
|
||||||
\sa BMidiLocalProducer::SprayData()
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*!
|
|
||||||
\fn void BMidiLocalConsumer::NoteOff(
|
|
||||||
uchar channel, uchar note, uchar velocity, bigtime_t time)
|
|
||||||
\brief Invoked when a Note Off event is received
|
|
||||||
\sa BMidiLocalProducer::SprayNoteOff()
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*!
|
|
||||||
\fn void BMidiLocalConsumer::NoteOn(
|
|
||||||
uchar channel, uchar note, uchar velocity, bigtime_t time)
|
|
||||||
\brief Invoked when a Note On event is received
|
|
||||||
\sa BMidiLocalProducer::SprayNoteOn()
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*!
|
|
||||||
\fn void BMidiLocalConsumer::KeyPressure(
|
|
||||||
uchar channel, uchar note, uchar pressure, bigtime_t time)
|
|
||||||
\brief Invoked when a Polyphonic Pressure (Aftertouch) event is received
|
|
||||||
\sa BMidiLocalProducer::SprayKeyPressure()
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*!
|
|
||||||
\fn void BMidiLocalConsumer::ControlChange(
|
|
||||||
uchar channel, uchar controlNumber, uchar controlValue, bigtime_t time)
|
|
||||||
\brief Invoked when a Controller Change event is received
|
|
||||||
\sa BMidiLocalProducer::SprayControlChange()
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*!
|
|
||||||
\fn void BMidiLocalConsumer::ProgramChange(
|
|
||||||
uchar channel, uchar programNumber, bigtime_t time)
|
|
||||||
\brief Invoked when a Program Change event is received
|
|
||||||
\sa BMidiLocalProducer::SprayProgramChange()
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*!
|
|
||||||
\fn void BMidiLocalConsumer::ChannelPressure(
|
|
||||||
uchar channel, uchar pressure, bigtime_t time)
|
|
||||||
\brief Invoked when a Channel Pressure event is received
|
|
||||||
\sa BMidiLocalProducer::SprayChannelPressure()
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*!
|
|
||||||
\fn void BMidiLocalConsumer::PitchBend(
|
|
||||||
uchar channel, uchar lsb, uchar msb, bigtime_t time)
|
|
||||||
\brief Invoked when a Pitch Bend event is received
|
|
||||||
\sa BMidiLocalProducer::SprayPitchBend()
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*!
|
|
||||||
\fn void BMidiLocalConsumer::SystemExclusive(
|
|
||||||
void* data, size_t length, bigtime_t time)
|
|
||||||
\brief Invoked when a System Exclusive event is received
|
|
||||||
|
|
||||||
The data does not include the sysex start and end control bytes (0xF0 and 0xF7),
|
|
||||||
only the payload of the sysex message.
|
|
||||||
|
|
||||||
The data belongs to the Midi Kit and is only valid for the duration of this
|
|
||||||
event. You may not modify or free it.
|
|
||||||
|
|
||||||
\sa BMidiLocalProducer::SpraySystemExclusive()
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*!
|
|
||||||
\fn void BMidiLocalConsumer::SystemCommon(
|
|
||||||
uchar status, uchar data1, uchar data2, bigtime_t time)
|
|
||||||
\brief Invoked when a System Common event is received
|
|
||||||
|
|
||||||
Not all data bytes are used for all common events. Unused bytes are set to 0.
|
|
||||||
|
|
||||||
\sa BMidiLocalProducer::SpraySystemCommon()
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*!
|
|
||||||
\fn void BMidiLocalConsumer::SystemRealTime(
|
|
||||||
uchar status, bigtime_t time)
|
|
||||||
\brief Invoked when a Real Time event is received
|
|
||||||
\sa BMidiLocalProducer::SpraySystemRealTime()
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*!
|
|
||||||
\fn void BMidiLocalConsumer::TempoChange(int32 beatsPerMinute, bigtime_t time)
|
|
||||||
\brief Invoked when a Tempo Change event is received
|
|
||||||
\sa BMidiLocalProducer::SprayTempoChange()
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*!
|
|
||||||
\fn void BMidiLocalConsumer::AllNotesOff(bool justChannel, bigtime_t time)
|
|
||||||
\brief Not used
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
@@ -1,296 +0,0 @@
|
|||||||
/*!
|
|
||||||
\class BMidiEndpoint
|
|
||||||
\ingroup midi2
|
|
||||||
\ingroup libmidi2
|
|
||||||
\brief Base class for all MIDI endpoints
|
|
||||||
|
|
||||||
BMidiEndpoint is the abstract base class that represents either a producer or
|
|
||||||
consumer endpoint. It may be used to obtain the state, name, properties, or
|
|
||||||
system-wide ID of the object. BMidiEndpoint also provides the ability to change
|
|
||||||
the name and properties of endpoints that were created locally.
|
|
||||||
|
|
||||||
Remember, you cannot call the destructor of BMidiEndpoint and its subclasses
|
|
||||||
directly. Endpoint objects are destructed automatically when their reference
|
|
||||||
count drops to zero. If necessary, the destructor of a local endpoint first
|
|
||||||
breaks off any connections and Unregister()'s the endpoint before it is
|
|
||||||
deleted. However, for good style and bonus points you should really \link
|
|
||||||
BMidiProducer::Disconnect() Disconnect() \endlink and Unregister() the object
|
|
||||||
yourself and not rely on the destructor to do this.
|
|
||||||
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*!
|
|
||||||
\fn const char* BMidiEndpoint::Name() const
|
|
||||||
\brief Returns the name of the endpoint
|
|
||||||
|
|
||||||
The function never returns NULL. If you created a local endpoint by passing a
|
|
||||||
NULL name into its constructor (or passing no name, which is the same thing),
|
|
||||||
then Name() will return an empty string, not NULL.
|
|
||||||
|
|
||||||
\sa SetName()
|
|
||||||
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*!
|
|
||||||
\fn void BMidiEndpoint::SetName(const char* name)
|
|
||||||
\brief Changes the name of the endpoint.
|
|
||||||
|
|
||||||
Names don't have to be unique, but it is recommended that you give any
|
|
||||||
endpoints you publish meaningful and unique names, so users can easily
|
|
||||||
recognize what each endpoint does. There is no limit to the size of endpoint
|
|
||||||
names.
|
|
||||||
|
|
||||||
Even though you can call this function on both remote and local objects, you
|
|
||||||
are only allowed to change the names of local endpoints; SetName() calls on
|
|
||||||
remote endpoints are ignored.
|
|
||||||
|
|
||||||
\param name The new name. If you pass NULL, the name simply won't be changed.
|
|
||||||
|
|
||||||
\sa Name()
|
|
||||||
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*!
|
|
||||||
\fn int32 BMidiEndpoint::ID() const
|
|
||||||
\brief Returns the ID of the endpoint
|
|
||||||
|
|
||||||
An ID uniquely identifies an endpoint in the system. The ID is a signed 32-bit
|
|
||||||
number that is assigned by the Midi Server when the endpoint is created. (So
|
|
||||||
even if a local endpoint is not published, it still has a unique ID.) Valid IDs
|
|
||||||
range from 1 to 0x7FFFFFFF, the largest value an int32 can have. 0 and negative
|
|
||||||
values are <I>not</I> valid IDs.
|
|
||||||
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*!
|
|
||||||
\fn bool BMidiEndpoint::IsProducer() const
|
|
||||||
\brief Determines whether this endpoint is a BMidiProducer
|
|
||||||
|
|
||||||
If it is, you can use a dynamic_cast to convert this object into a producer:
|
|
||||||
|
|
||||||
\code
|
|
||||||
if (endp->IsProducer())
|
|
||||||
{
|
|
||||||
BMidiProducer* prod = dynamic_cast<BMidiProducer*>(endp);
|
|
||||||
....
|
|
||||||
}
|
|
||||||
\endcode
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*!
|
|
||||||
\fn bool BMidiEndpoint::IsConsumer() const
|
|
||||||
\brief Determines whether this endpoint is a BMidiConsumer
|
|
||||||
|
|
||||||
If it is, you can use a dynamic_cast to convert this object into a consumer:
|
|
||||||
|
|
||||||
\code
|
|
||||||
if (endp->IsConsumer())
|
|
||||||
{
|
|
||||||
BMidiConsumer* cons = dynamic_cast<BMidiConsumer*>(endp);
|
|
||||||
....
|
|
||||||
}
|
|
||||||
\endcode
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*!
|
|
||||||
\fn bool BMidiEndpoint::IsRemote() const
|
|
||||||
\brief Determines whether this endpoint is a proxy for a remote object
|
|
||||||
|
|
||||||
An endpoint is "remote" when it is created by another application. Obviously,
|
|
||||||
the remote object is Register()'ed as well, otherwise you would not be able to
|
|
||||||
see it.
|
|
||||||
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*!
|
|
||||||
\fn bool BMidiEndpoint::IsLocal() const
|
|
||||||
\brief Determines whether this endpoint represents a local object
|
|
||||||
|
|
||||||
An endpoint is "local" when it is created by this application; in other words,
|
|
||||||
a BMidiLocalConsumer or BMidiLocalProducer.
|
|
||||||
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*!
|
|
||||||
\fn bool BMidiEndpoint::IsPersistent() const
|
|
||||||
\brief Not used
|
|
||||||
|
|
||||||
The purpose of this function is unclear, and as a result it doesn't do anything
|
|
||||||
in the OpenBeOS implementation of the Midi Kit.
|
|
||||||
|
|
||||||
\return Always returns false.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*!
|
|
||||||
\fn bool BMidiEndpoint::IsValid() const
|
|
||||||
\brief Determines whether the endpoint still exists
|
|
||||||
|
|
||||||
Suppose you obtained a proxy object for a remote endpoint by querying the
|
|
||||||
BMidiRoster. What if the application that published this endpoint quits, or
|
|
||||||
less drastically, Unregister()'s that endpoint? Even though you still have a
|
|
||||||
BMidiEndpoint proxy object, the real endpoint no longer exists. You can use
|
|
||||||
IsValid() to check for this.
|
|
||||||
|
|
||||||
Don't worry, operations on invalid objects, such as GetProperties(), will
|
|
||||||
return an error code (typically B_ERROR), but not cause a crash. Local objects
|
|
||||||
are always are considered to be valid, even if you did not Register() them.
|
|
||||||
(The only time a local endpoint is not valid is when there was a problem
|
|
||||||
constructing it.)
|
|
||||||
|
|
||||||
If the application that created the remote endpoint crashes, then there is no
|
|
||||||
guarantee that the Midi Server immediately recognizes this. In that case,
|
|
||||||
IsValid() may still return true. Eventually, the stale endpoint will be removed
|
|
||||||
from the roster, though. From then on, IsValid() correctly returns false.
|
|
||||||
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*!
|
|
||||||
\fn status_t BMidiEndpoint::Acquire()
|
|
||||||
\brief Increments the endpoint's reference count
|
|
||||||
|
|
||||||
Each BMidiEndpoint has a reference count associated with it, so that
|
|
||||||
BMidiRoster can do proper bookkeeping. Acquire() increments this reference
|
|
||||||
count, and Release() decrements it. Once the count reaches zero, the endpoint
|
|
||||||
is deleted.
|
|
||||||
|
|
||||||
When you are done with the endpoint, whether local or remote, you should
|
|
||||||
<I>always</I> Release() it!
|
|
||||||
|
|
||||||
Upon construction, local endpoints start with a reference count of 1. Any
|
|
||||||
objects you obtain from BMidiRoster using the NextXXX() or FindXXX() functions
|
|
||||||
have their reference counts incremented in the process. If you forget to call
|
|
||||||
Release(), the objects won't be properly cleaned up and you'll make a fool out
|
|
||||||
of yourself.
|
|
||||||
|
|
||||||
After you Release() an object, you are advised not to use it any further. If
|
|
||||||
you do, your app will probably crash. That also happens if you Release() an
|
|
||||||
object too many times.
|
|
||||||
|
|
||||||
Typically, you don't need to call Acquire(), unless you have two disparate
|
|
||||||
parts of your application working with the same endpoint, and you don't want to
|
|
||||||
have to keep track of who needs to Release() the endpoint. Now you simply have
|
|
||||||
both of them release it.
|
|
||||||
|
|
||||||
\return Always returns B_OK
|
|
||||||
\sa Release()
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*!
|
|
||||||
\fn status_t BMidiEndpoint::Release()
|
|
||||||
\brief Decrements the endpoint's reference count
|
|
||||||
\return Always returns B_OK
|
|
||||||
\sa Acquire()
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*!
|
|
||||||
\fn status_t BMidiEndpoint::Register()
|
|
||||||
\brief Publishes the endpoint on the roster
|
|
||||||
|
|
||||||
MIDI objects created by an application are invisible to other applications
|
|
||||||
until they are published. To publish an object use the Register() method. The
|
|
||||||
corresponding Unregister() method will cause an object to once again become
|
|
||||||
invisible to remote applications.
|
|
||||||
|
|
||||||
BMidiRoster also has Register() and Unregister() methods. You may also use
|
|
||||||
those methods to publish or hide your endpoints; both do the same thing.
|
|
||||||
|
|
||||||
Although it is considered bad style, calling Register() on local endpoints that
|
|
||||||
are already registered won't mess things up. The Midi Server will simply ignore
|
|
||||||
your request. Likewise for Unregister()'ing more than once. Attempts to
|
|
||||||
Register() or Unregister() remote endpoints will fail, of course.
|
|
||||||
|
|
||||||
If you are \link BMidiRoster::StartWatching() watching \endlink, you will
|
|
||||||
<I>not</I> receive notifications for any local endpoints you register or
|
|
||||||
unregister. Of course, other applications <I>will</I> be notified about your
|
|
||||||
endpoints.
|
|
||||||
|
|
||||||
Existing connections will not be broken when an object is unregistered, but
|
|
||||||
future remote connections will be denied. When objects are destroyed, they
|
|
||||||
automatically become unregistered.
|
|
||||||
|
|
||||||
\return B_OK on success, or a negative error code (typically B_ERROR) if
|
|
||||||
something went wrong.
|
|
||||||
|
|
||||||
\sa Unregister()
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*!
|
|
||||||
\fn status_t BMidiEndpoint::Unregister()
|
|
||||||
\brief Hides the endpoint from the roster
|
|
||||||
\sa Register()
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*!
|
|
||||||
\fn status_t BMidiEndpoint::SetProperties(const BMessage* props)
|
|
||||||
\brief Changes the properties of the endpoint
|
|
||||||
|
|
||||||
Endpoints can have properties, which is any kind of information that might be
|
|
||||||
useful to associate with a MIDI object. The properties are stored in a
|
|
||||||
BMessage.
|
|
||||||
|
|
||||||
Usage example:
|
|
||||||
|
|
||||||
\code
|
|
||||||
BMessage props;
|
|
||||||
if (endpoint->GetProperties(&props) == B_OK)
|
|
||||||
{
|
|
||||||
...add data to the message...
|
|
||||||
endpoint->SetProperties(&props);
|
|
||||||
}
|
|
||||||
\endcode
|
|
||||||
|
|
||||||
You are only allowed to call SetProperties() on a local object.
|
|
||||||
|
|
||||||
Properties should follow a protocol, so different applications will know how to
|
|
||||||
read each other's properties. The current protocol is very limited -- it only
|
|
||||||
allows you to associate icons with your endpoints. Be planned to publish a more
|
|
||||||
complete protocol that included additional information, such as vendor/model
|
|
||||||
names, copyright/version info, category, etc., but they never got around to it.
|
|
||||||
|
|
||||||
<TABLE BORDER="1">
|
|
||||||
<TR><TD>property</TD><TD>Vector icon (raw data)</TD></TR>
|
|
||||||
<TR><TD>field name</TD><TD>"icon"</TD></TR>
|
|
||||||
<TR><TD>field type</TD><TD>'VICN'</TD></TR>
|
|
||||||
</TABLE>
|
|
||||||
|
|
||||||
This vector icon is available under Haiku only, and comes as raw data, not a BBitmap.
|
|
||||||
Before being able to display it, you first must render the vector icon in the size of
|
|
||||||
your choice.
|
|
||||||
|
|
||||||
<TABLE BORDER="1">
|
|
||||||
<TR><TD>property</TD><TD>Large (32x32) icon</TD></TR>
|
|
||||||
<TR><TD>field name</TD><TD>"be:large_icon"</TD></TR>
|
|
||||||
<TR><TD>field type</TD><TD>'ICON'</TD></TR>
|
|
||||||
</TABLE>
|
|
||||||
|
|
||||||
<TABLE BORDER="1">
|
|
||||||
<TR><TD>property</TD><TD>Small (16x16) icon</TD></TR>
|
|
||||||
<TR><TD>field name</TD><TD>"be:mini_icon"</TD></TR>
|
|
||||||
<TR><TD>field type</TD><TD>'MICN'</TD></TR>
|
|
||||||
</TABLE>
|
|
||||||
|
|
||||||
The MidiUtil package (downloadable from the OpenBeOS website) contains a number
|
|
||||||
of convenient functions to associate icons with endpoints, so you don't have to
|
|
||||||
write that code all over again.
|
|
||||||
|
|
||||||
\sa GetProperties()
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*!
|
|
||||||
\fn status_t BMidiEndpoint::GetProperties(BMessage* props) const
|
|
||||||
\brief Reads the properties of the endpoint
|
|
||||||
|
|
||||||
Usage example:
|
|
||||||
|
|
||||||
\code
|
|
||||||
BMessage props;
|
|
||||||
if (endpoint->GetProperties(&props) == B_OK)
|
|
||||||
{
|
|
||||||
...examine the contents of the message...
|
|
||||||
}
|
|
||||||
\endcode
|
|
||||||
|
|
||||||
Note that GetProperties() overwrites the contents of your BMessage.
|
|
||||||
|
|
||||||
\sa SetProperties()
|
|
||||||
*/
|
|
||||||
@@ -1,31 +0,0 @@
|
|||||||
*!
|
|
||||||
\file Midi2Defs.h
|
|
||||||
\ingroup midi2
|
|
||||||
\brief General Defines for the MIDI2 kit
|
|
||||||
|
|
||||||
Please see \ref midi2defs for more information.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*!
|
|
||||||
\file MidiConsumer.h
|
|
||||||
\ingroup midi2
|
|
||||||
\brief Defines consumer classes for the MIDI Kit
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*!
|
|
||||||
\file MidiProducer.h
|
|
||||||
\ingroup midi2
|
|
||||||
\brief Defines producer classes for the MIDI Kit
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*!
|
|
||||||
\file MidiEndpoint.h
|
|
||||||
\ingroup midi2
|
|
||||||
\brief Defines the Baseclass of all MIDI consumers and producers
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*!
|
|
||||||
\file MidiRoster.h
|
|
||||||
\ingroup midi2
|
|
||||||
\brief Defines the heart of the MIDI Kit: the MIDI Roster
|
|
||||||
*/
|
|
||||||
@@ -1,308 +0,0 @@
|
|||||||
/*!
|
|
||||||
\class BMidiProducer MidiProducer.h
|
|
||||||
\ingroup midi2
|
|
||||||
\ingroup libmidi2
|
|
||||||
\brief Streams MIDI events to connected consumers
|
|
||||||
|
|
||||||
A producer is an object that generate a stream of MIDI events. Each producer
|
|
||||||
has a list of BMidiConsumer objects to which it is connected, and may be asked
|
|
||||||
to connect to or disconnect from a BMidiConsumer. A producer can spray its
|
|
||||||
events to multiple consumers at the same time.
|
|
||||||
|
|
||||||
A BMidiProducer either represents a local producer, i.e. a class extending from
|
|
||||||
BMidiLocalProducer, or is a proxy for a remote object published by another app.
|
|
||||||
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*!
|
|
||||||
\fn status_t BMidiProducer::Connect(BMidiConsumer* cons)
|
|
||||||
\brief Connects a consumer to this producer
|
|
||||||
|
|
||||||
Establishes a connection between this producer and the specified consumer
|
|
||||||
endpoint. From now on, any events that this producer sprays will be sent to
|
|
||||||
that consumer. You may connect multiple consumers to a producer.
|
|
||||||
|
|
||||||
\return B_OK on success, or an error code when the connection could not be
|
|
||||||
established. If the consumer is a proxy for a remote object and that object no
|
|
||||||
longer exists, Connect() returns B_ERROR. It also returns B_ERROR if you try to
|
|
||||||
connect the same producer and consumer more than once.
|
|
||||||
|
|
||||||
\sa Disconnect()
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*!
|
|
||||||
\fn status_t BMidiProducer::Disconnect(BMidiConsumer* cons)
|
|
||||||
\brief Disconnects a consumer from this producer
|
|
||||||
|
|
||||||
Terminates the connection between this producer and the specified consumer
|
|
||||||
endpoint. From now on, any events that this producer sprays no longer go to
|
|
||||||
that consumer.
|
|
||||||
|
|
||||||
\return B_OK on success, or an error code if there was no connection to break
|
|
||||||
|
|
||||||
\sa Connect()
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*!
|
|
||||||
\fn bool BMidiProducer::IsConnected(BMidiConsumer* cons) const
|
|
||||||
\brief Determines whether a consumer is connected to this producer
|
|
||||||
\sa Connect()
|
|
||||||
\sa Disconnect()
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*!
|
|
||||||
\fn BList* BMidiProducer::Connections() const
|
|
||||||
\brief Returns a list with all connected consumers
|
|
||||||
|
|
||||||
Returns a BList with pointers to BMidiEndpoint objects for all consumers that
|
|
||||||
are connected to this producer. You can examine the contents of the list as
|
|
||||||
follows:
|
|
||||||
|
|
||||||
\code
|
|
||||||
BList* list = prod->Connections();
|
|
||||||
for (int32 t = 0; t < list->CountItems(); ++t)
|
|
||||||
{
|
|
||||||
BMidiEndpoint* endp = (BMidiEndpoint*) list->ItemAt(t);
|
|
||||||
...do stuff...
|
|
||||||
endp->Release(); // yes, here too!
|
|
||||||
}
|
|
||||||
delete list;
|
|
||||||
\endcode
|
|
||||||
|
|
||||||
Every time you call this function, a new BList is allocated. The caller (that
|
|
||||||
is you) is responsible for freeing this list. The BMidiEndpoint objects in the
|
|
||||||
list have their reference counts bumped, so you need to Release() them before
|
|
||||||
you delete the list or they will go all leaky on you.
|
|
||||||
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*!
|
|
||||||
\class BMidiLocalProducer MidiProducer.h
|
|
||||||
\ingroup midi2
|
|
||||||
\ingroup libmidi2
|
|
||||||
\brief A producer endpoint that is created by your own application
|
|
||||||
|
|
||||||
You create a BMidiLocalProducer if you want your application to send MIDI
|
|
||||||
events. You use the various spray functions to send events to all connected
|
|
||||||
consumers. If no consumers are connected to the producer, any calls to the
|
|
||||||
spray functions are ignored.
|
|
||||||
|
|
||||||
Most spray functions accept a channel argument. Even though MIDI channels are
|
|
||||||
really numbered 1 through 16, the spray functions work with channels 0 through
|
|
||||||
15. You can also specify the performance time for the event using the time
|
|
||||||
argument. Specify 0 (or any time in the past) to perform the event "now", i.e.
|
|
||||||
as soon as possible. You can also schedule events to be performed in the
|
|
||||||
future, by passing a time such as system_time() + 5000000, which means 5
|
|
||||||
seconds from now.
|
|
||||||
|
|
||||||
Unlike BMidiLocalConsumer, which should be subclassed almost always, you hardly
|
|
||||||
ever need to derive a class from BMidiLocalProducer. The only reason for
|
|
||||||
subclassing is when you need to know when the producer gets connected or
|
|
||||||
disconnected.
|
|
||||||
|
|
||||||
Also unlike consumers, local producers have no thread of control directly
|
|
||||||
associated with them. If you want to send out the MIDI events from a different
|
|
||||||
thread, you will have to create one yourself.
|
|
||||||
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*!
|
|
||||||
\fn BMidiLocalProducer::BMidiLocalProducer(const char *name = NULL)
|
|
||||||
\brief Creates a new local producer endpoint
|
|
||||||
|
|
||||||
The new endpoint is not visible to other applications until you Register() it.
|
|
||||||
|
|
||||||
You can tell the constructor what the name of the new producer will be. If you
|
|
||||||
pass NULL (or use the default argument), then the producer's name will be an
|
|
||||||
empty string. It won't be NULL, since endpoint names cannot be NULL.
|
|
||||||
|
|
||||||
There is no guarantee that the endpoint will be successfully created. For
|
|
||||||
example, the Midi Server may not be running. Therefore, you should always call
|
|
||||||
IsValid() after creating a new endpoint to make sure that everything went okay.
|
|
||||||
If not, Release() the object to reclaim memory and abort gracefully.
|
|
||||||
|
|
||||||
\code
|
|
||||||
BMidiLocalProducer* prod = new BMidiLocalProducer(...);
|
|
||||||
if (!prod->IsValid())
|
|
||||||
{
|
|
||||||
prod->Release();
|
|
||||||
...exit gracefully...
|
|
||||||
}
|
|
||||||
\endcode
|
|
||||||
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*!
|
|
||||||
\fn void BMidiLocalProducer::Connected(BMidiConsumer* cons)
|
|
||||||
\brief Invoked when a new consumer is connected to this producer
|
|
||||||
|
|
||||||
Although typical notifications (i.e. from BMidiRoster's "watching" facility)
|
|
||||||
are only sent if it is some other app that is performing the operation,
|
|
||||||
Connected() is also called if you are making the connection yourself.
|
|
||||||
|
|
||||||
If you override this hook, you don't have to call the default implementation,
|
|
||||||
because that does nothing.
|
|
||||||
|
|
||||||
\param cons The newly connected consumer. The reference count of the consumer
|
|
||||||
object is not increased, so you should not Release() it. However, if you want
|
|
||||||
to keep track of the consumer beyond this function, you should first Acquire()
|
|
||||||
it, and Release() it when you are done.
|
|
||||||
|
|
||||||
\sa Disconnected()
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*!
|
|
||||||
\fn void BMidiLocalProducer::Disconnected(BMidiConsumer* cons)
|
|
||||||
\brief Invoked when a consumer is disconnected from this producer
|
|
||||||
\sa Connected()
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*!
|
|
||||||
\fn void BMidiLocalProducer::SprayData(
|
|
||||||
void* data, size_t length, bool atomic = false, bigtime_t time = 0) const
|
|
||||||
\brief Sends raw MIDI data downstream to all connected consumers
|
|
||||||
|
|
||||||
Typically you won't have to call SprayData(); the other spray functions will do
|
|
||||||
just fine. If you do call it, remember that you retain ownership of the data
|
|
||||||
and that you are responsible for freeing it at some point. (Even though data is
|
|
||||||
not declared const, the function does not change it.)
|
|
||||||
|
|
||||||
With atomic set to false, you can send a MIDI message in segments (perhaps for
|
|
||||||
a large sysex dump). However, when you do this, you are on your own. The Midi
|
|
||||||
Kit only tags the data as being non-atomic, but offers no additional support.
|
|
||||||
The default implementation of BMidiLocalConsumer completely ignores such
|
|
||||||
events. To handle non-atomic MIDI data, you should override the
|
|
||||||
BMidiLocalConsumer::Data() hook and process the MIDI event yourself. All of
|
|
||||||
BMidiLocalProducer's other spray functions always send atomic data.
|
|
||||||
|
|
||||||
\param data the MIDI event data
|
|
||||||
\param length byte size of the data buffer
|
|
||||||
\param atomic whether the data buffer contains a single complete MIDI event
|
|
||||||
\param time the required performance time of the event
|
|
||||||
|
|
||||||
\sa BMidiLocalConsumer::Data()
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*!
|
|
||||||
\fn void BMidiLocalProducer::SprayNoteOff(
|
|
||||||
uchar channel, uchar note, uchar velocity, bigtime_t time = 0) const
|
|
||||||
\brief Sends a Note Off event to all connected consumers
|
|
||||||
\sa BMidiLocalConsumer::NoteOff()
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*!
|
|
||||||
\fn void BMidiLocalProducer::SprayNoteOn(
|
|
||||||
uchar channel, uchar note, uchar velocity, bigtime_t time = 0) const
|
|
||||||
\brief Sends a Note On event to all connected consumers
|
|
||||||
\sa BMidiLocalConsumer::NoteOn()
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*!
|
|
||||||
\fn void BMidiLocalProducer::SprayKeyPressure(
|
|
||||||
uchar channel, uchar note, uchar pressure, bigtime_t time = 0) const
|
|
||||||
\brief Sends a Polyphonic Pressure (Aftertouch) event to all connected
|
|
||||||
consumers
|
|
||||||
\sa BMidiLocalConsumer::KeyPressure()
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*!
|
|
||||||
\fn void BMidiLocalProducer::SprayControlChange(
|
|
||||||
uchar channel, uchar controlNumber, uchar controlValue,
|
|
||||||
bigtime_t time = 0) const
|
|
||||||
\brief Sends a Controller Change event to all connected consumers
|
|
||||||
|
|
||||||
\sa Midi2Defs.h
|
|
||||||
\sa BMidiLocalConsumer::ControlChange()
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*!
|
|
||||||
\fn void BMidiLocalProducer::SprayProgramChange(
|
|
||||||
uchar channel, uchar programNumber, bigtime_t time = 0) const
|
|
||||||
\brief Sends a Program Change event to all connected consumers
|
|
||||||
\sa BMidiLocalConsumer::ProgramChange()
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*!
|
|
||||||
\fn void BMidiLocalProducer::SprayChannelPressure(
|
|
||||||
uchar channel, uchar pressure, bigtime_t time = 0) const
|
|
||||||
\brief Sends a Channel Pressure event to all connected consumers
|
|
||||||
\sa BMidiLocalConsumer::ChannelPressure()
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*!
|
|
||||||
\fn void BMidiLocalProducer::SprayPitchBend(
|
|
||||||
uchar channel, uchar lsb, uchar msb, bigtime_t time = 0) const
|
|
||||||
\brief Sends a Pitch Bend event to all connected consumers
|
|
||||||
\sa BMidiLocalConsumer::PitchBend()
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*!
|
|
||||||
\fn void BMidiLocalProducer::SpraySystemExclusive(
|
|
||||||
void* data, size_t length, bigtime_t time = 0) const
|
|
||||||
\brief Sends a System Exclusive event to all connected consumers
|
|
||||||
|
|
||||||
You retain ownership of the data and are responsible for freeing it. Even
|
|
||||||
though data is not declared const, the function does not change it. Even though
|
|
||||||
the amount of data may be quite large, this function always sends sysex
|
|
||||||
messages as an atomic block of data.
|
|
||||||
|
|
||||||
\sa BMidiLocalConsumer::SystemExclusive()
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*!
|
|
||||||
\fn void BMidiLocalProducer::SpraySystemCommon(
|
|
||||||
uchar status, uchar data1, uchar data2, bigtime_t time = 0) const
|
|
||||||
\brief Sends a System Common event to the connected consumers
|
|
||||||
|
|
||||||
The status byte must be one of the following:
|
|
||||||
|
|
||||||
<TABLE BORDER="1">
|
|
||||||
<TR><TD>0xF1</TD><TD>B_MIDI_TIME_CODE</TD><TD>data1 only</TD></TR>
|
|
||||||
<TR><TD>0xF2</TD><TD>B_SONG_POSITION</TD><TD>data1 and data2</TD></TR>
|
|
||||||
<TR><TD>0xF3</TD><TD>B_SONG_SELECT</TD><TD>data1 only</TD></TR>
|
|
||||||
<TR><TD>0xF5</TD><TD>B_CABLE_MESSAGE</TD><TD>data1 only</TD></TR>
|
|
||||||
<TR><TD>0xF6</TD><TD>B_TUNE_REQUEST</TD><TD>no data</TD></TR>
|
|
||||||
<TR><TD>0xF7</TD><TD>B_SYS_EX_END</TD><TD>no data</TD></TR>
|
|
||||||
</TABLE>
|
|
||||||
|
|
||||||
\sa BMidiLocalConsumer::SystemCommon()
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*!
|
|
||||||
\fn void BMidiLocalProducer::SpraySystemRealTime(
|
|
||||||
uchar status, bigtime_t time = 0) const
|
|
||||||
\brief Sends a Real Time event to the connected consumers
|
|
||||||
|
|
||||||
The status byte must be one of the following:
|
|
||||||
|
|
||||||
<TABLE BORDER="1">
|
|
||||||
<TR><TD>0xF8</TD><TD>B_TIMING_CLOCK</TD></TR>
|
|
||||||
<TR><TD>0xFA</TD><TD>B_START</TD></TR>
|
|
||||||
<TR><TD>0xFB</TD><TD>B_CONTINUE</TD></TR>
|
|
||||||
<TR><TD>0xFC</TD><TD>B_STOP</TD></TR>
|
|
||||||
<TR><TD>0xFE</TD><TD>B_ACTIVE_SENSING</TD></TR>
|
|
||||||
<TR><TD>0xFF</TD><TD>B_SYSTEM_RESET</TD></TR>
|
|
||||||
</TABLE>
|
|
||||||
|
|
||||||
Because of their high priority, the MIDI specification allows real time
|
|
||||||
messages to "interleave" with other MIDI messages. A large sysex dump, for
|
|
||||||
example, may be interrupted by a real time event. The Midi Kit, however,
|
|
||||||
doesn't care. If you (or another producer) have just sent a big system
|
|
||||||
exclusive to a consumer, any following real time message will simply have to
|
|
||||||
wait until the consumer has dealt with the sysex.
|
|
||||||
|
|
||||||
\sa BMidiLocalConsumer::SystemRealTime()
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*!
|
|
||||||
\fn void BMidiLocalProducer::SprayTempoChange(
|
|
||||||
int32 bpm, bigtime_t time = 0) const
|
|
||||||
\brief Sends a Tempo Change event to the connected consumers.
|
|
||||||
|
|
||||||
This kind of Tempo Change event is not really part of the MIDI spec, rather
|
|
||||||
it is an extension from the SMF (Standard MIDI File) format.
|
|
||||||
|
|
||||||
\sa BMidiLocalConsumer::TempoChange()
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
@@ -1,309 +0,0 @@
|
|||||||
/*!
|
|
||||||
\var B_MIDI_EVENT
|
|
||||||
\ingroup midi2
|
|
||||||
\brief BMessage identifier of MIDI messages.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*!
|
|
||||||
\class BMidiRoster MidiRoster.h
|
|
||||||
\ingroup midi2
|
|
||||||
\ingroup libmidi2
|
|
||||||
\brief Interface to the system-wide Midi Roster
|
|
||||||
|
|
||||||
BMidiRoster allows you to find available MIDI consumer and producer objects.
|
|
||||||
You can locate these objects using the iterative NextEndpoint(),
|
|
||||||
NextProducer(), and NextConsumer() methods or by requesting notification
|
|
||||||
messages to be sent with StartWatching(). Notification messages may contain
|
|
||||||
object IDs which can be resolved using the FindEndpoint(), FindProducer(), and
|
|
||||||
FindConsumer() methods.
|
|
||||||
|
|
||||||
The constructor and destructor of BMidiRoster are private, which means that you
|
|
||||||
cannot create or delete your own BMidiRoster objects. Every application can
|
|
||||||
have only one instance of BMidiRoster, which is automatically created the very
|
|
||||||
first time you use a Midi Kit function.
|
|
||||||
|
|
||||||
You can call BMidiRoster's functions like this:
|
|
||||||
|
|
||||||
\code
|
|
||||||
producer = BMidiRoster::FindProducer(someID);
|
|
||||||
\endcode
|
|
||||||
|
|
||||||
Or using the slightly more annoying:
|
|
||||||
|
|
||||||
\code
|
|
||||||
BMidiRoster* roster = BMidiRoster::MidiRoster();
|
|
||||||
if (roster != NULL)
|
|
||||||
{
|
|
||||||
producer = roster->FindProducer(someID);
|
|
||||||
}
|
|
||||||
\endcode
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*!
|
|
||||||
\fn BMidiEndpoint* BMidiRoster::NextEndpoint(int32* id)
|
|
||||||
\brief Returns the next endpoint from the roster
|
|
||||||
|
|
||||||
The "next endpoint" means: the endpoint with the ID that follows id. So if you
|
|
||||||
set id to 3, the first possible endpoint it returns is endpoint 4. No endpoint
|
|
||||||
can have ID 0, so passing 0 gives you the first endpoint. If you pass NULL
|
|
||||||
instead of an ID, NextEndpoint() always returns NULL. When the function
|
|
||||||
returns, it sets id to the ID of the endpoint that was found. If no more
|
|
||||||
endpoints exist, NextEndpoint() returns NULL and id is not changed.
|
|
||||||
NextEndpoint() does <I>not</I> return locally created endpoints, even if they
|
|
||||||
are Register()'ed.
|
|
||||||
|
|
||||||
Usage example:
|
|
||||||
|
|
||||||
\code
|
|
||||||
int32 id = 0;
|
|
||||||
BMidiEndpoint* endp;
|
|
||||||
while ((endp = BMidiRoster::NextEndpoint(&id)) != NULL)
|
|
||||||
{
|
|
||||||
...do something with endpoint ...
|
|
||||||
endp->Release(); // don't forget!
|
|
||||||
}
|
|
||||||
\endcode
|
|
||||||
|
|
||||||
Remember that NextEndpoint() bumps the endpoint's reference count, so you
|
|
||||||
should always \link BMidiEndpoint::Release() Release() \endlink it when you are
|
|
||||||
done.
|
|
||||||
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*!
|
|
||||||
\fn BMidiProducer* BMidiRoster::NextProducer(int32* id)
|
|
||||||
\brief Returns the next producer from the roster
|
|
||||||
|
|
||||||
Like NextEndpoint(), but only returns producer endpoints.
|
|
||||||
|
|
||||||
\sa NextConsumer
|
|
||||||
\sa NextEndpoint
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*!
|
|
||||||
\fn BMidiConsumer* BMidiRoster::NextConsumer(int32* id)
|
|
||||||
\brief Returns the next consumer from the roster
|
|
||||||
|
|
||||||
Like NextEndpoint(), but only returns consumer endpoints.
|
|
||||||
|
|
||||||
\sa NextProducer
|
|
||||||
\sa NextEndpoint
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*!
|
|
||||||
\fn BMidiEndpoint* BMidiRoster::FindEndpoint(
|
|
||||||
int32 id, bool localOnly = false)
|
|
||||||
\brief Returns the endpoint with the specified ID
|
|
||||||
|
|
||||||
FindEndpoint() will always find <I>any</I> local endpoints created by this
|
|
||||||
application; they do not have to be published with Register() first. If
|
|
||||||
localOnly is false, FindEndpoint() also looks at remote endpoints, otherwise
|
|
||||||
only local endpoints will be resolved. Returns NULL if no such endpoint could
|
|
||||||
be found.
|
|
||||||
|
|
||||||
You should use a dynamic_cast to convert the BMidiEndpoint into a producer or
|
|
||||||
consumer:
|
|
||||||
|
|
||||||
\code
|
|
||||||
BMidiEndpoint* endp = ...;
|
|
||||||
BMidiProducer* prod = NULL;
|
|
||||||
BMidiConsumer* cons = NULL;
|
|
||||||
|
|
||||||
if (endp->IsProducer())
|
|
||||||
{
|
|
||||||
prod = dynamic_cast<BMidiProducer*>(endp);
|
|
||||||
}
|
|
||||||
else if (endp->IsConsumer())
|
|
||||||
{
|
|
||||||
cons = dynamic_cast<BMidiConsumer*>(endp);
|
|
||||||
}
|
|
||||||
\endcode
|
|
||||||
|
|
||||||
Remember that FindEndpoint() increments the endpoint's reference count, so you
|
|
||||||
should always \link BMidiEndpoint::Release() Release() \endlink an endpoint
|
|
||||||
when you are done with it:
|
|
||||||
|
|
||||||
\code
|
|
||||||
BMidiEndpoint* endp = BMidiRoster::FindEndpoint(someID);
|
|
||||||
if (endp != NULL)
|
|
||||||
{
|
|
||||||
...do stuff with the endpoint...
|
|
||||||
endp->Release();
|
|
||||||
}
|
|
||||||
\endcode
|
|
||||||
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*!
|
|
||||||
\fn BMidiProducer* BMidiRoster::FindProducer(
|
|
||||||
int32 id, bool localOnly = false)
|
|
||||||
\brief Finds the producer with the specified ID
|
|
||||||
|
|
||||||
Like FindEndpoint(), but only looks for producer endpoints. Returns NULL if no
|
|
||||||
endpoint with that ID exists, or if that endpoint is not a producer.
|
|
||||||
|
|
||||||
\sa FindConsumer
|
|
||||||
\sa FindEndpoint
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*!
|
|
||||||
\fn BMidiConsumer* BMidiRoster::FindConsumer(
|
|
||||||
int32 id, bool localOnly = false)
|
|
||||||
\brief Finds the consumer with the specified ID
|
|
||||||
|
|
||||||
Like FindEndpoint(), but only looks for consumer endpoints. Returns NULL if no
|
|
||||||
endpoint with that ID exists, or if that endpoint is not a consumer.
|
|
||||||
|
|
||||||
\sa FindProducer
|
|
||||||
\sa FindEndpoint
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*!
|
|
||||||
\fn void BMidiRoster::StartWatching(const BMessenger* msngr)
|
|
||||||
\brief Start receiving notifications from the Midi Roster
|
|
||||||
|
|
||||||
When you start watching, BMidiRoster sends you notifications for all currently
|
|
||||||
<I>published</I> <I>remote</I> endpoints, and all the current connections
|
|
||||||
between them. (At this point, BMidiRoster does not let you know about
|
|
||||||
connections between unpublished endpoints, nor does it tell you anything about
|
|
||||||
your local endpoints, even though they may be published.)
|
|
||||||
|
|
||||||
Thereafter, you'll receive notifications any time something important happens
|
|
||||||
to an object. The application that performs these operations is itself not
|
|
||||||
notified. The assumption here is that you already know about these changes,
|
|
||||||
because you are the one that is performing them.
|
|
||||||
|
|
||||||
The notifications are BMessages with code B_MIDI_EVENT. You specify the
|
|
||||||
BMessenger that will be used to send these messages. Each message contains a
|
|
||||||
field called be:op that describes the type of notification.
|
|
||||||
|
|
||||||
The "registered" and "unregistered" notifications are sent when a remote
|
|
||||||
endpoint Register()'s or Unregister()'s, respectively. You don't receive these
|
|
||||||
notifications when you register or unregister your local endpoints, but the
|
|
||||||
other apps will.
|
|
||||||
|
|
||||||
<TABLE BORDER="1">
|
|
||||||
<TR><TD>be:op</TD><TD>int32</TD><TD>B_MIDI_REGISTERED</TD></TR>
|
|
||||||
<TR><TD>be:id</TD><TD>int32</TD><TD>ID of the endpoint</TD></TR>
|
|
||||||
<TR><TD>be:type</TD><TD>string</TD><TD>"producer" or "consumer"</TD></TR>
|
|
||||||
</TABLE>
|
|
||||||
|
|
||||||
<TABLE BORDER="1">
|
|
||||||
<TR><TD>be:op</TD><TD>int32</TD><TD>B_MIDI_UNREGISTERED</TD></TR>
|
|
||||||
<TR><TD>be:id</TD><TD>int32</TD><TD>ID of the endpoint</TD></TR>
|
|
||||||
<TR><TD>be:type</TD><TD>string</TD><TD>"producer" or "consumer"</TD></TR>
|
|
||||||
</TABLE>
|
|
||||||
|
|
||||||
The "connected" and "disconnected" notifications are sent when a consumer \link
|
|
||||||
BMidiProducer::Connect() Connect()\endlink's to a producer, or when they \link
|
|
||||||
BMidiProducer::Disconnect() Disconnect() \endlink. You will receive these
|
|
||||||
notifications when <I>any</I> two endpoints connect or disconnect, even if they
|
|
||||||
are not published. (The purpose of which is debatable.) You won't receive the
|
|
||||||
notifications if you are the one making the connection, even if both endpoints
|
|
||||||
are remote. You <I>will</I> be notified when another app connects one of your
|
|
||||||
published endpoints.
|
|
||||||
|
|
||||||
<TABLE BORDER="1">
|
|
||||||
<TR><TD>be:op</TD><TD>int32</TD><TD>B_MIDI_CONNECTED</TD></TR>
|
|
||||||
<TR><TD>be:producer</TD><TD>int32</TD><TD>ID of the connector</TD></TR>
|
|
||||||
<TR><TD>be:consumer</TD><TD>int32</TD><TD>ID of the connectee</TD></TR>
|
|
||||||
</TABLE>
|
|
||||||
|
|
||||||
<TABLE BORDER="1">
|
|
||||||
<TR><TD>be:op</TD><TD>int32</TD><TD>B_MIDI_DISCONNECTED</TD></TR>
|
|
||||||
<TR><TD>be:producer</TD><TD>int32</TD><TD>ID of the connector</TD></TR>
|
|
||||||
<TR><TD>be:consumer</TD><TD>int32</TD><TD>ID of the connectee</TD></TR>
|
|
||||||
</TABLE>
|
|
||||||
|
|
||||||
The following notifications are sent when an endpoint's attributes are changed.
|
|
||||||
You receive these notifications only if another application is changing one of
|
|
||||||
its published endpoints.
|
|
||||||
|
|
||||||
<TABLE BORDER="1">
|
|
||||||
<TR><TD>be:op</TD><TD>int32</TD><TD>B_MIDI_CHANGED_NAME</TD></TR>
|
|
||||||
<TR><TD>be:id</TD><TD>int32</TD><TD>ID of the endpoint</TD></TR>
|
|
||||||
<TR><TD>be:type</TD><TD>string</TD><TD>"producer" or "consumer"</TD></TR>
|
|
||||||
<TR><TD>be:name</TD><TD>string</TD><TD>the endpoint's new name</TD></TR>
|
|
||||||
</TABLE>
|
|
||||||
|
|
||||||
<TABLE BORDER="1">
|
|
||||||
<TR><TD>be:op</TD><TD>int32</TD><TD>B_MIDI_CHANGED_LATENCY</TD></TR>
|
|
||||||
<TR><TD>be:id</TD><TD>int32</TD><TD>ID of the endpoint</TD></TR>
|
|
||||||
<TR><TD>be:type</TD><TD>string</TD><TD>"producer" or "consumer"</TD></TR>
|
|
||||||
<TR><TD>be:latency</TD><TD>int64</TD><TD>the new latency (microseconds)</TD></TR>
|
|
||||||
</TABLE>
|
|
||||||
|
|
||||||
<TABLE BORDER="1">
|
|
||||||
<TR><TD>be:op</TD><TD>int32</TD><TD>B_MIDI_CHANGED_PROPERTIES</TD></TR>
|
|
||||||
<TR><TD>be:id</TD><TD>int32</TD><TD>ID of the endpoint</TD></TR>
|
|
||||||
<TR><TD>be:type</TD><TD>string</TD><TD>"producer" or "consumer"</TD></TR>
|
|
||||||
<TR><TD>be:properties</TD><TD>BMessage</TD><TD>the new properties</TD></TR>
|
|
||||||
</TABLE>
|
|
||||||
|
|
||||||
Typical usage example:
|
|
||||||
|
|
||||||
\code
|
|
||||||
void MyView::AttachedToWindow()
|
|
||||||
{
|
|
||||||
BMessenger msgr(this);
|
|
||||||
BMidiRoster::StartWatching(&msgr);
|
|
||||||
}
|
|
||||||
|
|
||||||
void MyView::MessageReceived(BMessage* msg)
|
|
||||||
{
|
|
||||||
switch (msg->what)
|
|
||||||
{
|
|
||||||
case B_MIDI_EVENT:
|
|
||||||
HandleMidiEvent(msg);
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
super::MessageReceived(msg);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
\endcode
|
|
||||||
|
|
||||||
For the possible midi options, see #BMidiOp
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*!
|
|
||||||
\fn void BMidiRoster::StopWatching()
|
|
||||||
\brief Stop receiving notifications from the Midi Roster
|
|
||||||
\sa StartWatching()
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*!
|
|
||||||
\fn status_t BMidiRoster::Register(BMidiEndpoint* object)
|
|
||||||
\brief Publishes an endpoint to other applications
|
|
||||||
|
|
||||||
Calls BMidiEndpoint's \link BMidiEndpoint::Register() Register() \endlink
|
|
||||||
method to publish an endpoint, which makes it visible to other applications.
|
|
||||||
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*!
|
|
||||||
\fn status_t BMidiRoster::Unregister(BMidiEndpoint* object)
|
|
||||||
\brief Hides an endpoint from other applications
|
|
||||||
|
|
||||||
Calls BMidiEndpoint's \link BMidiEndpoint::Unregister() Unregister() \endlink
|
|
||||||
method to hide a previously published endpoint from other applications.
|
|
||||||
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*!
|
|
||||||
\fn BMidiRoster* BMidiRoster::MidiRoster()
|
|
||||||
\brief Returns a pointer to the only instance of BMidiRoster
|
|
||||||
|
|
||||||
There is no real reason use this function, since all BMidiRoster's public
|
|
||||||
function are static.
|
|
||||||
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*!
|
|
||||||
\enum BMidiOp
|
|
||||||
\brief Defines the status codes for MIDI Server notification messages.
|
|
||||||
|
|
||||||
These codes are used when you request notification as in BMidiRoster::StartWatching().
|
|
||||||
Check against these codes to determine what is happening. See the StartWatching() method
|
|
||||||
for a more complete description of the codes and their meaning.
|
|
||||||
*/
|
|
||||||
@@ -1,18 +1,21 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2011, Haiku inc.
|
* Copyright 2011 Haiku, Inc. All rights reserved.
|
||||||
* Distributed under the terms of the MIT Licence.
|
* Distributed under the terms of the MIT License.
|
||||||
|
*
|
||||||
|
* Authors:
|
||||||
|
* John Scipione, [email protected]
|
||||||
|
* Ingo Weinhold, [email protected]
|
||||||
*
|
*
|
||||||
* Documentation by:
|
|
||||||
* John Scipione <[email protected]>
|
|
||||||
* Ingo Weinhold <[email protected]>
|
|
||||||
* Corresponds to:
|
* Corresponds to:
|
||||||
* /trunk/headers/os/storage/AppFileInfo.h rev 42274
|
* headers/os/storage/AppFileInfo.h rev 42274
|
||||||
* /trunk/src/kits/storage/AppFileInfo.cpp rev 42274
|
* src/kits/storage/AppFileInfo.cpp rev 42274
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\file AppFileInfo.h
|
\file AppFileInfo.h
|
||||||
|
\ingroup storage
|
||||||
|
\ingroup libbe
|
||||||
\brief Provides the BAppFileInfo class.
|
\brief Provides the BAppFileInfo class.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@@ -20,6 +23,7 @@
|
|||||||
/*!
|
/*!
|
||||||
\class BAppFileInfo
|
\class BAppFileInfo
|
||||||
\ingroup storage
|
\ingroup storage
|
||||||
|
\ingroup libbe
|
||||||
\brief Provides access to the metadata associated with executables,
|
\brief Provides access to the metadata associated with executables,
|
||||||
libraries and add-ons.
|
libraries and add-ons.
|
||||||
|
|
||||||
|
|||||||
@@ -7,6 +7,7 @@
|
|||||||
* Ingo Weinhold, [email protected]
|
* Ingo Weinhold, [email protected]
|
||||||
* Axel Dörfler, [email protected]
|
* Axel Dörfler, [email protected]
|
||||||
* John Scipione, [email protected]
|
* John Scipione, [email protected]
|
||||||
|
*
|
||||||
* Corresponds to:
|
* Corresponds to:
|
||||||
* headers/os/storage/Directory.h hrev43528
|
* headers/os/storage/Directory.h hrev43528
|
||||||
* src/kits/storage/Directory.cpp hrev43528
|
* src/kits/storage/Directory.cpp hrev43528
|
||||||
@@ -15,6 +16,8 @@
|
|||||||
|
|
||||||
/*!
|
/*!
|
||||||
\file Directory.h
|
\file Directory.h
|
||||||
|
\ingroup storage
|
||||||
|
\ingroup libbe
|
||||||
\brief Provides the BDirectory class.
|
\brief Provides the BDirectory class.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|||||||
@@ -6,6 +6,7 @@
|
|||||||
* Tyler Dauwalder
|
* Tyler Dauwalder
|
||||||
* Simon Cusack, [email protected]
|
* Simon Cusack, [email protected]
|
||||||
* John Scipione, [email protected]
|
* John Scipione, [email protected]
|
||||||
|
*
|
||||||
* Corresponds to:
|
* Corresponds to:
|
||||||
* headers/os/storage/Entry.h hrev43528
|
* headers/os/storage/Entry.h hrev43528
|
||||||
* src/kits/storage/Entry.cpp hrev43528
|
* src/kits/storage/Entry.cpp hrev43528
|
||||||
@@ -14,12 +15,16 @@
|
|||||||
|
|
||||||
/*!
|
/*!
|
||||||
\file Entry.h
|
\file Entry.h
|
||||||
|
\ingroup storage
|
||||||
|
\ingroup libbe
|
||||||
\brief Provides the BEntry class and entry_ref implementations.
|
\brief Provides the BEntry class and entry_ref implementations.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\struct entry_ref
|
\struct entry_ref
|
||||||
|
\ingroup storage
|
||||||
|
\ingroup libbe
|
||||||
\brief A filesystem entry represented as a name in a concrete directory.
|
\brief A filesystem entry represented as a name in a concrete directory.
|
||||||
|
|
||||||
entry_refs may refer to pre-existing (concrete) files, as well as
|
entry_refs may refer to pre-existing (concrete) files, as well as
|
||||||
@@ -120,20 +125,23 @@
|
|||||||
|
|
||||||
/*!
|
/*!
|
||||||
\var dev_t entry_ref::device
|
\var dev_t entry_ref::device
|
||||||
\brief The device id of the storage device on which the entry resides
|
|
||||||
|
The device id of the storage device on which the entry resides.
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\var ino_t entry_ref::directory
|
\var ino_t entry_ref::directory
|
||||||
\brief The inode number of the directory in which the entry resides
|
|
||||||
|
The inode number of the directory in which the entry resides.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\var char *entry_ref::name
|
\var char *entry_ref::name
|
||||||
\brief The leaf name of the entry
|
|
||||||
|
The leaf name of the entry
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
@@ -250,7 +258,7 @@ BEntry entry("/boot/home/fido");
|
|||||||
\fn bool BEntry::Exists() const
|
\fn bool BEntry::Exists() const
|
||||||
\brief Returns whether or not the entry exists in the filesystem.
|
\brief Returns whether or not the entry exists in the filesystem.
|
||||||
|
|
||||||
\returns \c true if the entry exists, \c false if the entry does not exist.
|
\returns \c true if the entry exists, \c false if not.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -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.
|
* Distributed under the terms of the MIT License.
|
||||||
*
|
*
|
||||||
* Authors:
|
* Authors:
|
||||||
@@ -7,13 +7,15 @@
|
|||||||
* John Scipione, [email protected]
|
* John Scipione, [email protected]
|
||||||
*
|
*
|
||||||
* Corresponds to:
|
* Corresponds to:
|
||||||
* /trunk/headers/os/storage/EntryList.h rev 42794
|
* headers/os/storage/EntryList.h rev 42794
|
||||||
* /trunk/src/kits/storage/EntryList.cpp rev 42794
|
* src/kits/storage/EntryList.cpp rev 42794
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\file EntryList.h
|
\file EntryList.h
|
||||||
|
\ingroup storage
|
||||||
|
\ingroup libbe
|
||||||
\brief Defines the BEntryList class.
|
\brief Defines the BEntryList class.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|||||||
@@ -15,6 +15,8 @@
|
|||||||
|
|
||||||
/*!
|
/*!
|
||||||
\file File.h
|
\file File.h
|
||||||
|
\ingroup storage
|
||||||
|
\ingroup libbe
|
||||||
\brief Provides the BFile class.
|
\brief Provides the BFile class.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|||||||
@@ -13,42 +13,52 @@
|
|||||||
|
|
||||||
/*!
|
/*!
|
||||||
\file FilePanel.h
|
\file FilePanel.h
|
||||||
|
\ingroup storage
|
||||||
|
\ingroup libbe
|
||||||
\brief Provides the BFilePanel and BRefFilter classes and support enums.
|
\brief Provides the BFilePanel and BRefFilter classes and support enums.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\enum file_panel_mode
|
\enum file_panel_mode
|
||||||
Whether the file panel is a save or open panel.
|
\ingroup storage
|
||||||
|
\ingroup libbe
|
||||||
|
\brief Whether the file panel is a save or open panel.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\var file_panel_mode B_OPEN_PANEL
|
\var file_panel_mode B_OPEN_PANEL
|
||||||
|
|
||||||
Open panel
|
Open panel
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\var file_panel_mode B_SAVE_PANEL
|
\var file_panel_mode B_SAVE_PANEL
|
||||||
|
|
||||||
Save panel
|
Save panel
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\enum file_panel_button
|
\enum file_panel_button
|
||||||
List of buttons used by the file panel
|
\ingroup storage
|
||||||
|
\ingroup libbe
|
||||||
|
\brief List of buttons used by the file panel
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\var file_panel_button B_CANCEL_BUTTON
|
\var file_panel_button B_CANCEL_BUTTON
|
||||||
|
|
||||||
Cancel button
|
Cancel button
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\var file_panel_button B_DEFAULT_BUTTON
|
\var file_panel_button B_DEFAULT_BUTTON
|
||||||
|
|
||||||
Default button
|
Default button
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|||||||
@@ -1,9 +1,10 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2011, Haiku inc.
|
* Copyright 2011 Haiku Inc. All rights reserved.
|
||||||
* Distributed under the terms of the MIT Licence.
|
* Distributed under the terms of the MIT License.
|
||||||
*
|
*
|
||||||
* Documentation by:
|
* Documentation by:
|
||||||
* Adrien Destugues <[email protected]>
|
* Adrien Destugues, [email protected]
|
||||||
|
*
|
||||||
* Corresponds to:
|
* Corresponds to:
|
||||||
* /trunk/headers/os/storage/FindDirectory.h rev 42600
|
* /trunk/headers/os/storage/FindDirectory.h rev 42600
|
||||||
* /trunk/src/kits/storage/FindDirectory.cpp rev 42600
|
* /trunk/src/kits/storage/FindDirectory.cpp rev 42600
|
||||||
@@ -13,6 +14,7 @@
|
|||||||
/*!
|
/*!
|
||||||
\file FindDirectory.h
|
\file FindDirectory.h
|
||||||
\ingroup storage
|
\ingroup storage
|
||||||
|
\ingroup libbe
|
||||||
\brief Provides the find_directory function.
|
\brief Provides the find_directory function.
|
||||||
|
|
||||||
Haiku provides a set of directories for applications to use. These can be
|
Haiku provides a set of directories for applications to use. These can be
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2013 Haiku Inc.
|
* Copyright 2013 Haiku Inc. All rights reserved.
|
||||||
* Distributed under the terms of the MIT License.
|
* Distributed under the terms of the MIT License.
|
||||||
*
|
*
|
||||||
* Documentation by:
|
* Authors:
|
||||||
* Ingo Weinhold, [email protected]
|
* Ingo Weinhold, [email protected]
|
||||||
* John Scipione, [email protected]
|
* John Scipione, [email protected]
|
||||||
*
|
*
|
||||||
@@ -15,12 +15,15 @@
|
|||||||
/*!
|
/*!
|
||||||
\file Mime.h
|
\file Mime.h
|
||||||
\ingroup storage
|
\ingroup storage
|
||||||
|
\ingroup libbe
|
||||||
\brief Provides C and Haiku-only C++ MIME-type handling functions.
|
\brief Provides C and Haiku-only C++ MIME-type handling functions.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\enum icon_size
|
\enum icon_size
|
||||||
|
\ingroup storage
|
||||||
|
\ingroup libbe
|
||||||
\brief Legacy BeOS icon size constants.
|
\brief Legacy BeOS icon size constants.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@@ -62,26 +65,6 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
|
||||||
\fn status_t do_mime_update(int32 what, const char *path, int recursive,
|
|
||||||
int synchronous, int force)
|
|
||||||
\brief Helper function that contacts the registrar for mime update calls.
|
|
||||||
|
|
||||||
\param what The message identifier.
|
|
||||||
\param path The path to a file or directory, or \c NULL.
|
|
||||||
\param recursive Triggers recursive behavior if not \c NULL.
|
|
||||||
\param synchronous If not \c NULL update_mime_info() waits until the
|
|
||||||
operation is finished, otherwise it returns immediately and the
|
|
||||||
update is done asynchronously.
|
|
||||||
\param force Specifies how to handle files that already have MIME
|
|
||||||
information.
|
|
||||||
|
|
||||||
\returns A status code.
|
|
||||||
|
|
||||||
\see update_mime_info
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\fn int update_mime_info(const char *path, int recursive, int synchronous,
|
\fn int update_mime_info(const char *path, int recursive, int synchronous,
|
||||||
int force)
|
int force)
|
||||||
|
|||||||
@@ -7,6 +7,7 @@
|
|||||||
* Ingo Weinhold, [email protected]
|
* Ingo Weinhold, [email protected]
|
||||||
* Axel Dörfler, [email protected]
|
* Axel Dörfler, [email protected]
|
||||||
* John Scipione, [email protected]
|
* John Scipione, [email protected]
|
||||||
|
*
|
||||||
* Corresponds to:
|
* Corresponds to:
|
||||||
* headers/os/storage/MimeType.h hrev43528
|
* headers/os/storage/MimeType.h hrev43528
|
||||||
* src/kits/storage/MimeType.cpp hrev43528
|
* src/kits/storage/MimeType.cpp hrev43528
|
||||||
@@ -15,6 +16,8 @@
|
|||||||
|
|
||||||
/*!
|
/*!
|
||||||
\file MimeType.h
|
\file MimeType.h
|
||||||
|
\ingroup storage
|
||||||
|
\ingroup libbe
|
||||||
\brief Provides the BMimeType class.
|
\brief Provides the BMimeType class.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|||||||
@@ -1,11 +1,12 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2002-2011, Haiku Inc.
|
* Copyright 2002-2011 Haiku Inc. All rights reserved.
|
||||||
* Distributed under the terms of the MIT License.
|
* Distributed under the terms of the MIT License.
|
||||||
*
|
*
|
||||||
* Authors:
|
* Authors:
|
||||||
* Tyler Dauwalder, [email protected]
|
* Tyler Dauwalder, [email protected]
|
||||||
* John Scipione, [email protected]
|
* John Scipione, [email protected]
|
||||||
* Ingo Weinhold, [email protected]
|
* Ingo Weinhold, [email protected]
|
||||||
|
*
|
||||||
* Corresponds to:
|
* Corresponds to:
|
||||||
* /trunk/headers/os/app/Node.h rev 42803
|
* /trunk/headers/os/app/Node.h rev 42803
|
||||||
* /trunk/src/kits/app/Node.cpp rev 42803
|
* /trunk/src/kits/app/Node.cpp rev 42803
|
||||||
@@ -14,12 +15,16 @@
|
|||||||
|
|
||||||
/*!
|
/*!
|
||||||
\file Node.h
|
\file Node.h
|
||||||
|
\ingroup storage
|
||||||
|
\ingroup libbe
|
||||||
\brief Provides the BNode class and node_ref structure.
|
\brief Provides the BNode class and node_ref structure.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\struct node_ref
|
\struct node_ref
|
||||||
|
\ingroup storage
|
||||||
|
\ingroup libbe
|
||||||
\brief Reference structure to a particular vnode on a device.
|
\brief Reference structure to a particular vnode on a device.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@@ -71,6 +76,7 @@
|
|||||||
/*!
|
/*!
|
||||||
\class BNode
|
\class BNode
|
||||||
\ingroup storage
|
\ingroup storage
|
||||||
|
\ingroup libbe
|
||||||
\brief A BNode represents a chunk of data in the filesystem.
|
\brief A BNode represents a chunk of data in the filesystem.
|
||||||
|
|
||||||
The BNode class provides an interface for manipulating the data and
|
The BNode class provides an interface for manipulating the data and
|
||||||
@@ -82,18 +88,22 @@
|
|||||||
|
|
||||||
/*!
|
/*!
|
||||||
\var BNode::fFd
|
\var BNode::fFd
|
||||||
|
|
||||||
File descriptor for the given node.
|
File descriptor for the given node.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\var BNode::fAttrFd
|
\var BNode::fAttrFd
|
||||||
File descriptor for the attribute directory of the node. Initialized lazily.
|
|
||||||
|
File descriptor for the attribute directory of the node.
|
||||||
|
Initialized lazily.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\var BNode::fCStatus
|
\var BNode::fCStatus
|
||||||
|
|
||||||
The object's initialization status.
|
The object's initialization status.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 23 KiB After Width: | Height: | Size: 23 KiB |
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2007, Haiku, Inc. All Rights Reserved.
|
* Copyright 2007 Haiku, Inc. All rights reserved.
|
||||||
* Distributed under the terms of the MIT License.
|
* Distributed under the terms of the MIT License.
|
||||||
*
|
*
|
||||||
* Authors:
|
* Authors:
|
||||||
@@ -11,18 +11,22 @@
|
|||||||
* Thom Holwerda, [email protected]
|
* Thom Holwerda, [email protected]
|
||||||
*
|
*
|
||||||
* Corresponds to:
|
* Corresponds to:
|
||||||
* /trunk/headers/os/support/Archivable.h rev 37751
|
* headers/os/support/Archivable.h rev 37751
|
||||||
* /trunk/src/kits/support/Archivable.cpp rev 37751
|
* src/kits/support/Archivable.cpp rev 37751
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*! \file Archivable.h
|
/*!
|
||||||
|
\file Archivable.h
|
||||||
|
\ingroup support
|
||||||
|
\ingroup libbe
|
||||||
\brief Provides the BArchivable interface and declares the BArchiver and
|
\brief Provides the BArchivable interface and declares the BArchiver and
|
||||||
BUnarchiver classes.
|
BUnarchiver classes.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*! \class BArchivable
|
/*!
|
||||||
|
\class BArchivable
|
||||||
\ingroup support
|
\ingroup support
|
||||||
\ingroup libbe
|
\ingroup libbe
|
||||||
\brief Interface for objects that can be archived into a BMessage.
|
\brief Interface for objects that can be archived into a BMessage.
|
||||||
@@ -37,8 +41,8 @@
|
|||||||
disk. The objective of this interface, however, is to store objects that
|
disk. The objective of this interface, however, is to store objects that
|
||||||
will later be restored as new (but identical) objects. To illustrate this
|
will later be restored as new (but identical) objects. To illustrate this
|
||||||
point, BArchivable objects can be restored automatically to the correct
|
point, BArchivable objects can be restored automatically to the correct
|
||||||
class, whereas BFlattenables have a data type which you need to map to
|
class, whereas BFlattenable objects have a data type which you need to map
|
||||||
classes manually.
|
to classes manually.
|
||||||
|
|
||||||
Archiving is done with the Archive() method. If your class supports it, the
|
Archiving is done with the Archive() method. If your class supports it, the
|
||||||
caller can request it to store into a deep archive, meaning that all child
|
caller can request it to store into a deep archive, meaning that all child
|
||||||
@@ -65,12 +69,12 @@
|
|||||||
|
|
||||||
/*!
|
/*!
|
||||||
\fn BArchivable::BArchivable(BMessage* from)
|
\fn BArchivable::BArchivable(BMessage* from)
|
||||||
\brief Constructor. Does important behind-the-scenes work in the unarchiving
|
\brief Constructor. Does important behind-the-scenes work in the
|
||||||
process.
|
unarchiving process.
|
||||||
|
|
||||||
If you inherit this interface you should provide at least one constructor
|
If you inherit this interface you should provide at least one constructor
|
||||||
that takes one BMessage argument. In that constructor, you should call your
|
that takes one BMessage argument. In that constructor, you should call
|
||||||
parent class' archive constructor (even if your parent class is
|
your parent class' archive constructor (even if your parent class is
|
||||||
BArchivable).
|
BArchivable).
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@@ -184,13 +188,18 @@
|
|||||||
|
|
||||||
|
|
||||||
///// Global methods /////
|
///// Global methods /////
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\addtogroup support_globals
|
\addtogroup support_globals
|
||||||
@{
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*! \typedef typedef BArchivable* (*instantiation_func)(BMessage*)
|
//! @{
|
||||||
|
|
||||||
|
|
||||||
|
/*!
|
||||||
|
\typedef typedef BArchivable* (*instantiation_func)(BMessage*)
|
||||||
\brief Internal definition of a function that can instantiate objects that
|
\brief Internal definition of a function that can instantiate objects that
|
||||||
have been created with the BArchivable API.
|
have been created with the BArchivable API.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -1,13 +1,21 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2010, Haiku, Inc. All Rights Reserved.
|
* Copyright 2010 Haiku, Inc. All rights reserved.
|
||||||
* Distributed under the terms of the MIT License.
|
* Distributed under the terms of the MIT License.
|
||||||
*
|
*
|
||||||
* Author:
|
* Author:
|
||||||
* Alex Wilson, [email protected]
|
* Alex Wilson, [email protected]
|
||||||
*
|
*
|
||||||
* Corresponds to:
|
* Corresponds to:
|
||||||
* /trunk/headers/os/support/Archivable.h rev 37751
|
* headers/os/support/Archivable.h rev 37751
|
||||||
* /trunk/src/kits/support/Archivable.cpp rev 37751
|
* src/kits/support/Archivable.cpp rev 37751
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/*!
|
||||||
|
\file Archivable.h
|
||||||
|
\ingroup support
|
||||||
|
\ingroup libbe
|
||||||
|
\brief Contains BArchiver class.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,18 +1,23 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2007, Haiku, Inc. All Rights Reserved.
|
* Copyright 2007 Haiku, Inc. All rights reserved.
|
||||||
* Distributed under the terms of the MIT License.
|
* Distributed under the terms of the MIT License.
|
||||||
*
|
*
|
||||||
* Documentation by:
|
* Authors:
|
||||||
* Niels Sascha Reedijk <[email protected]>
|
* Niels Sascha Reedijk, [email protected]
|
||||||
|
*
|
||||||
* Corresponds to:
|
* Corresponds to:
|
||||||
* /trunk/headers/os/support/Autolock.h rev 19972
|
* headers/os/support/Autolock.h rev 19972
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\file Autolock.h
|
\file Autolock.h
|
||||||
|
\ingroup support
|
||||||
|
\ingroup libbe
|
||||||
\brief Implements a handy locking utility.
|
\brief Implements a handy locking utility.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\class BAutolock
|
\class BAutolock
|
||||||
\ingroup support
|
\ingroup support
|
||||||
@@ -37,11 +42,8 @@ status_t
|
|||||||
Receiver::HandleCall(Call *call)
|
Receiver::HandleCall(Call *call)
|
||||||
{
|
{
|
||||||
... work on call data ...
|
... work on call data ...
|
||||||
|
|
||||||
fDataLocker->Lock()
|
fDataLocker->Lock()
|
||||||
|
|
||||||
... perform changes ...
|
... perform changes ...
|
||||||
|
|
||||||
if (!success)
|
if (!success)
|
||||||
{
|
{
|
||||||
fDataLocker->Unlock();
|
fDataLocker->Unlock();
|
||||||
@@ -52,7 +54,6 @@ Receiver::HandleCall(Call *call)
|
|||||||
return B_OK;
|
return B_OK;
|
||||||
}
|
}
|
||||||
\endcode
|
\endcode
|
||||||
|
|
||||||
With the BAutolock this example can be rewritten as follows:
|
With the BAutolock this example can be rewritten as follows:
|
||||||
|
|
||||||
\code
|
\code
|
||||||
@@ -78,29 +79,35 @@ Receiver::HandleCall(Call *call)
|
|||||||
exit from the function is properly unlocked.
|
exit from the function is properly unlocked.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\fn BAutolock::BAutolock(BLooper *looper)
|
\fn BAutolock::BAutolock(BLooper *looper)
|
||||||
\brief Create an object and lock the BLooper
|
\brief Create an object and lock the BLooper
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\fn BAutolock::BAutolock(BLocker *locker)
|
\fn BAutolock::BAutolock(BLocker *locker)
|
||||||
\brief Create an object and lock the BLocker
|
\brief Create an object and lock the BLocker
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\fn BAutolock::BAutolock(BLocker &locker)
|
\fn BAutolock::BAutolock(BLocker &locker)
|
||||||
\brief Create an object and lock the BLocker
|
\brief Create an object and lock the BLocker
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\fn BAutolock::~BAutolock()
|
\fn BAutolock::~BAutolock()
|
||||||
\brief Destroy the object and unlock the associated BLocker or BLooper
|
\brief Destroy the object and unlock the associated BLocker or BLooper
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\fn bool BAutolock::IsLocked(void)
|
\fn bool BAutolock::IsLocked(void)
|
||||||
\brief Verify whether the associated BLocker or BLooper are actually locked.
|
\brief Verify whether the associated BLocker or BLooper are actually
|
||||||
|
locked.
|
||||||
|
|
||||||
Basically you may assume that when the object is created, you are
|
Basically you may assume that when the object is created, you are
|
||||||
almost always sure the actual locking succeeds. It might fail if the
|
almost always sure the actual locking succeeds. It might fail if the
|
||||||
|
|||||||
@@ -1,54 +1,61 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2007, Haiku, Inc. All Rights Reserved.
|
* Copyright 2007 Haiku, Inc. All rights reserved.
|
||||||
* Distributed under the terms of the MIT License.
|
* Distributed under the terms of the MIT License.
|
||||||
*
|
*
|
||||||
* Documentation by:
|
* Authors:
|
||||||
* Niels Sascha Reedijk <[email protected]>
|
* Niels Sascha Reedijk, [email protected]
|
||||||
|
*
|
||||||
* Corresponds to:
|
* Corresponds to:
|
||||||
* /trunk/headers/os/support/Beep.h rev 19972
|
* headers/os/support/Beep.h rev 19972
|
||||||
* /trunk/src/kits/support/Beep.cpp rev 20711
|
* src/kits/support/Beep.cpp rev 20711
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/////!!!!!! Note that the workings of the beep still aren't completely clear
|
/////!!!!!! Note that the workings of the beep still aren't completely clear
|
||||||
///// and not completely implemented, so this needs revision if everything
|
///// and not completely implemented, so this needs revision if everything
|
||||||
///// is finished.
|
///// is finished.
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\file Beep.h
|
\file Beep.h
|
||||||
|
\ingroup support
|
||||||
|
\ingroup libbe
|
||||||
\brief Functions to generate sounds from the computer.
|
\brief Functions to generate sounds from the computer.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\addtogroup support_globals
|
\addtogroup support_globals
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
//! @{
|
//! @{
|
||||||
|
|
||||||
/*! \fn status_t beep()
|
|
||||||
|
/*!
|
||||||
|
\fn status_t beep()
|
||||||
\brief Invoke the standard system beep to alert users.
|
\brief Invoke the standard system beep to alert users.
|
||||||
|
|
||||||
From Beep.h and in libbe.so.
|
From Beep.h and in libbe.so.
|
||||||
|
|
||||||
\see system_beep() and add_system_beep_event()
|
\see system_beep() and add_system_beep_event()
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*! \fn status_t system_beep(const char* eventName)
|
|
||||||
|
/*!
|
||||||
|
\fn status_t system_beep(const char* eventName)
|
||||||
\brief Invokes the sound for event \a eventName.
|
\brief Invokes the sound for event \a eventName.
|
||||||
|
|
||||||
You can add the events using add_system_beep_event().
|
You can add the events using add_system_beep_event().
|
||||||
|
|
||||||
From Beep.h and in libbe.so.
|
From Beep.h and in libbe.so.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*! \fn status_t add_system_beep_event(const char* eventName, uint32 flags = 0)
|
|
||||||
|
/*!
|
||||||
|
\fn status_t add_system_beep_event(const char* eventName, uint32 flags = 0)
|
||||||
\brief Adds an event to the media server.
|
\brief Adds an event to the media server.
|
||||||
|
|
||||||
Call this method to add a specific event to the media server.
|
Call this method to add a specific event to the media server.
|
||||||
|
|
||||||
From Beep.h and in libbe.so.
|
From Beep.h and in libbe.so.
|
||||||
|
|
||||||
\param eventName The name of the event.
|
\param eventName The name of the event.
|
||||||
\param flags Currently unused. Pass \c 0.
|
\param flags Currently unused. Pass \c 0.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
//! @}
|
//! @}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2007, Haiku, Inc. All Rights Reserved.
|
* Copyright 2007 Haiku, Inc. All rights reserved.
|
||||||
* Distributed under the terms of the MIT License.
|
* Distributed under the terms of the MIT License.
|
||||||
*
|
*
|
||||||
* Authors:
|
* Authors:
|
||||||
@@ -10,13 +10,15 @@
|
|||||||
* Thom Holwerda, [email protected]
|
* Thom Holwerda, [email protected]
|
||||||
*
|
*
|
||||||
* Corresponds to:
|
* Corresponds to:
|
||||||
* /trunk/headers/os/support/BlockCache.h rev 19972
|
* headers/os/support/BlockCache.h rev 19972
|
||||||
* /trunk/src/kits/support/BlockCache.cpp rev 4568
|
* src/kits/support/BlockCache.cpp rev 4568
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\file BlockCache.h
|
\file BlockCache.h
|
||||||
|
\ingroup support
|
||||||
|
\ingroup libbe
|
||||||
\brief Implements a mechanism to store and retrieve memory blocks.
|
\brief Implements a mechanism to store and retrieve memory blocks.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|||||||
@@ -1,20 +1,25 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2007, Haiku, Inc. All Rights Reserved.
|
* Copyright 2007,Haiku, Inc. All rights reserved.
|
||||||
* Distributed under the terms of the MIT License.
|
* Distributed under the terms of the MIT License.
|
||||||
*
|
*
|
||||||
* Documentation by:
|
* Authors:
|
||||||
* Niels Sascha Reedijk <[email protected]>
|
* Stefano Ceccherini, [email protected]
|
||||||
* Stefano Ceccherini ([email protected])
|
* Niels Sascha Reedijk, [email protected]
|
||||||
|
*
|
||||||
* Corresponds to:
|
* Corresponds to:
|
||||||
* /trunk/headers/os/support/BufferIO.h rev 19972
|
* headers/os/support/BufferIO.h rev 19972
|
||||||
* /trunk/src/kits/support/BufferIO.cpp rev 20510
|
* src/kits/support/BufferIO.cpp rev 20510
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\file BufferIO.h
|
\file BufferIO.h
|
||||||
|
\ingroup support
|
||||||
|
\ingroup libbe
|
||||||
\brief Provides the BBufferIO class.
|
\brief Provides the BBufferIO class.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\class BBufferIO
|
\class BBufferIO
|
||||||
\ingroup support
|
\ingroup support
|
||||||
@@ -22,35 +27,37 @@
|
|||||||
\brief A buffered adapter for BPositionIO objects.
|
\brief A buffered adapter for BPositionIO objects.
|
||||||
\author Stefano Ceccherini \<[email protected]\>
|
\author Stefano Ceccherini \<[email protected]\>
|
||||||
|
|
||||||
This class differs from other classes derived from BPositionIO in a sense that
|
This class differs from other classes derived from BPositionIO in a sense
|
||||||
it does not actually provide an actual entity to be read or written to, but
|
that it does not actually provide an actual entity to be read or written
|
||||||
rather acts like a "frontend" to a stream. This class especially comes in
|
to, but rather acts like a "frontend" to a stream. This class especially
|
||||||
handy when working with files that are constantly written and rewritten and
|
comes in handy when working with files that are constantly written and
|
||||||
where you want do this writing buffered so that the hard disk or the network
|
rewritten and where you want do this writing buffered so that the hard
|
||||||
will not have to be accessed so frequently.
|
disk or the network will not have to be accessed so frequently.
|
||||||
|
|
||||||
This class works as follows. After constructing a BBufferIO object that you
|
This class works as follows. After constructing a BBufferIO object that
|
||||||
want to be buffered, you can create this object. The constructor takes a
|
you want to be buffered, you can create this object. The constructor
|
||||||
\a stream parameter that points to the object to be buffered. You then use
|
takes a \a stream parameter that points to the object to be buffered.
|
||||||
this object as a proxy to the resource you want to read of or write to. As
|
|
||||||
soon as you use ReadAt(), the buffer will be initialised to the contents
|
You then use this object as a proxy to the resource you want to read
|
||||||
of the original stream,
|
of or write to. As soon as you use ReadAt(), the buffer will be
|
||||||
and subsequent calls to the positions within the buffer will not be
|
initialized to the contents of the original stream, and subsequent calls
|
||||||
routed to the original stream. In the same way WriteAt() will change
|
to the positions within the buffer will not be routed to the original
|
||||||
the data in the buffer, but not in the actual stream. In order to flush
|
stream. In the same way WriteAt() will change the data in the buffer,
|
||||||
the changes to the original stream, use the Flush() method. Deleting
|
but not in the actual stream. In order to flush the changes to the
|
||||||
the object when you are done with it will also flush the stream and
|
original stream, use the Flush() method. Deleting the object when you are
|
||||||
update the original stream.
|
done with it will also flush the stream and update the original stream.
|
||||||
|
|
||||||
\note This class is not meant to be used in cases where the
|
\note This class is not meant to be used in cases where the
|
||||||
original stream requires to be in a consistent state. Neither should this
|
original stream requires to be in a consistent state. Neither should
|
||||||
class be used as a way to perform 'atomic' writes, because the object
|
this class be used as a way to perform 'atomic' writes, because the
|
||||||
might need to do partial writes if it needs to 'move' the buffer. This
|
object might need to do partial writes if it needs to 'move' the
|
||||||
happens for instance if the original stream is bigger than the buffer.
|
buffer. This happens for instance if the original stream is bigger
|
||||||
|
than the buffer.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\fn BBufferIO::BBufferIO(BPositionIO *stream, size_t bufferSize, bool ownsStream)
|
\fn BBufferIO::BBufferIO(BPositionIO *stream, size_t bufferSize,
|
||||||
|
bool ownsStream)
|
||||||
\brief Initialize a BBufferIO object.
|
\brief Initialize a BBufferIO object.
|
||||||
|
|
||||||
The constructor will create a buffer of the given size
|
The constructor will create a buffer of the given size
|
||||||
@@ -76,9 +83,11 @@
|
|||||||
/*!
|
/*!
|
||||||
\fn ssize_t BBufferIO::ReadAt(off_t pos, void *buffer, size_t size)
|
\fn ssize_t BBufferIO::ReadAt(off_t pos, void *buffer, size_t size)
|
||||||
\brief Read the specified amount of bytes at the given position.
|
\brief Read the specified amount of bytes at the given position.
|
||||||
|
|
||||||
\param pos The offset into the stream where to read.
|
\param pos The offset into the stream where to read.
|
||||||
\param buffer A pointer to a buffer where to copy the read data.
|
\param buffer A pointer to a buffer where to copy the read data.
|
||||||
\param size The amount of bytes to read.
|
\param size The amount of bytes to read.
|
||||||
|
|
||||||
\return The amount of bytes actually read, or an error code.
|
\return The amount of bytes actually read, or an error code.
|
||||||
\retval B_NO_INIT The object is not associated with a valid BPositionIO
|
\retval B_NO_INIT The object is not associated with a valid BPositionIO
|
||||||
stream.
|
stream.
|
||||||
@@ -88,9 +97,11 @@
|
|||||||
/*!
|
/*!
|
||||||
\fn ssize_t BBufferIO::WriteAt(off_t pos, const void *buffer, size_t size)
|
\fn ssize_t BBufferIO::WriteAt(off_t pos, const void *buffer, size_t size)
|
||||||
\brief Write the specified amount of bytes at the given position.
|
\brief Write the specified amount of bytes at the given position.
|
||||||
|
|
||||||
\param pos The offset into the stream where to write.
|
\param pos The offset into the stream where to write.
|
||||||
\param buffer A pointer to a buffer which contains the data to write.
|
\param buffer A pointer to a buffer which contains the data to write.
|
||||||
\param size The amount of bytes to write.
|
\param size The amount of bytes to write.
|
||||||
|
|
||||||
\return The amount of bytes actually written, or an error code.
|
\return The amount of bytes actually written, or an error code.
|
||||||
\retval B_NO_INIT The object is not associated with a valid BPositionIO
|
\retval B_NO_INIT The object is not associated with a valid BPositionIO
|
||||||
stream.
|
stream.
|
||||||
@@ -107,17 +118,18 @@
|
|||||||
|
|
||||||
\param position The position where you want to seek.
|
\param position The position where you want to seek.
|
||||||
\param seekMode Can have three values:
|
\param seekMode Can have three values:
|
||||||
- \c SEEK_SET. The position passed is an offset from the beginning of the
|
- \c SEEK_SET The position passed is an offset from the beginning of
|
||||||
stream; in other words, the current position is set to position.
|
the stream; in other words, the current position is set to
|
||||||
For this mode, position should be a positive value.
|
position. For this mode, position should be a positive value.
|
||||||
- \c SEEK_CUR. The position argument is an offset from the current position;
|
- \c SEEK_CUR The position argument is an offset from the current
|
||||||
the value of the argument is added to the current position.
|
position; the value of the argument is added to the current
|
||||||
|
position.
|
||||||
- \c SEEK_END. The position argument is an offset from the end of the
|
- \c SEEK_END. The position argument is an offset from the end of the
|
||||||
stream. In this mode the position argument should be negative (or zero).
|
stream. In this mode the position argument should be negative
|
||||||
|
(or zero).
|
||||||
|
|
||||||
\return The current position as an offset in bytes from the beginning of
|
\return The current position as an offset in bytes from the beginning of
|
||||||
the stream.
|
the stream.
|
||||||
|
|
||||||
\retval B_NO_INIT The object is not associated with a valid BPositionIO
|
\retval B_NO_INIT The object is not associated with a valid BPositionIO
|
||||||
stream.
|
stream.
|
||||||
*/
|
*/
|
||||||
@@ -125,6 +137,7 @@
|
|||||||
/*!
|
/*!
|
||||||
\fn off_t BBufferIO::Position() const
|
\fn off_t BBufferIO::Position() const
|
||||||
\brief Return the current position in the stream.
|
\brief Return the current position in the stream.
|
||||||
|
|
||||||
\return The current position as an offset in bytes
|
\return The current position as an offset in bytes
|
||||||
from the beginning of the stream.
|
from the beginning of the stream.
|
||||||
\retval B_NO_INIT The object is not associated with a valid BPositionIO
|
\retval B_NO_INIT The object is not associated with a valid BPositionIO
|
||||||
@@ -134,7 +147,10 @@
|
|||||||
/*!
|
/*!
|
||||||
\fn status_t BBufferIO::SetSize(off_t size)
|
\fn status_t BBufferIO::SetSize(off_t size)
|
||||||
\brief Call the SetSize() function of the assigned BPositionIO stream.
|
\brief Call the SetSize() function of the assigned BPositionIO stream.
|
||||||
|
|
||||||
\param size The new size of the BPositionIO object.
|
\param size The new size of the BPositionIO object.
|
||||||
|
|
||||||
|
\returns A status code.
|
||||||
\retval B_OK The stream is resized.
|
\retval B_OK The stream is resized.
|
||||||
\retval B_NO_INIT The object is not associated with a valid BPositionIO
|
\retval B_NO_INIT The object is not associated with a valid BPositionIO
|
||||||
stream.
|
stream.
|
||||||
@@ -143,6 +159,7 @@
|
|||||||
/*!
|
/*!
|
||||||
\fn status_t BBufferIO::Flush()
|
\fn status_t BBufferIO::Flush()
|
||||||
\brief Write pending modifications to the stream.
|
\brief Write pending modifications to the stream.
|
||||||
|
|
||||||
\return The amount of bytes written, or if it failed it will return an error
|
\return The amount of bytes written, or if it failed it will return an error
|
||||||
code.
|
code.
|
||||||
*/
|
*/
|
||||||
@@ -151,6 +168,7 @@
|
|||||||
/*!
|
/*!
|
||||||
\fn BPositionIO *BBufferIO::Stream() const
|
\fn BPositionIO *BBufferIO::Stream() const
|
||||||
\brief Return a pointer to the stream specified on construction.
|
\brief Return a pointer to the stream specified on construction.
|
||||||
|
|
||||||
\return A pointer to the BPositionIO stream specified on construction.
|
\return A pointer to the BPositionIO stream specified on construction.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@@ -158,21 +176,27 @@
|
|||||||
/*!
|
/*!
|
||||||
\fn size_t BBufferIO::BufferSize() const
|
\fn size_t BBufferIO::BufferSize() const
|
||||||
\brief Return the size of the internal buffer.
|
\brief Return the size of the internal buffer.
|
||||||
|
|
||||||
\return The size of the buffer allocated by the object.
|
\return The size of the buffer allocated by the object.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\fn bool BBufferIO::OwnsStream() const
|
\fn bool BBufferIO::OwnsStream() const
|
||||||
\brief Tell if the BBufferIO object "owns" the specified stream.
|
\brief Tell if the BBufferIO object "owns" the specified stream.
|
||||||
|
|
||||||
\retval true The object "owns" the stream and will destroy it upon
|
\retval true The object "owns" the stream and will destroy it upon
|
||||||
destruction.
|
destruction.
|
||||||
\retval false The object does not own the stream.
|
\retval false The object does not own the stream.
|
||||||
|
|
||||||
\see SetOwnsStream()
|
\see SetOwnsStream()
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\fn void BBufferIO::SetOwnsStream(bool owns_stream)
|
\fn void BBufferIO::SetOwnsStream(bool owns_stream)
|
||||||
\brief Set the \c owns_stream property of the object.
|
\brief Set the \c owns_stream property of the object.
|
||||||
|
|
||||||
\param owns_stream If you pass \c true, the object will delete the stream
|
\param owns_stream If you pass \c true, the object will delete the stream
|
||||||
upon destruction, if you pass \c false it will not.
|
upon destruction, if you pass \c false it will not.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -1,17 +1,21 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2007, Haiku, Inc. All Rights Reserved.
|
* Copyright 2007 Haiku, Inc. All rights reserved.
|
||||||
* Distributed under the terms of the MIT License.
|
* Distributed under the terms of the MIT License.
|
||||||
*
|
*
|
||||||
* Documentation by:
|
* Authors:
|
||||||
* Niels Sascha Reedijk <[email protected]>
|
* Stefano Ceccherini, [email protected]
|
||||||
* Stefano Ceccherini ([email protected])
|
* Niels Sascha Reedijk, [email protected]
|
||||||
|
*
|
||||||
* Corresponds to:
|
* Corresponds to:
|
||||||
* /trunk/headers/os/support/DataIO.h rev 17981
|
* headers/os/support/DataIO.h rev 17981
|
||||||
* /trunk/src/kits/support/DataIO.cpp rev 20510
|
* src/kits/support/DataIO.cpp rev 20510
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\file DataIO.h
|
\file DataIO.h
|
||||||
|
\ingroup support
|
||||||
|
\ingroup libbe
|
||||||
\brief Defines abstract BDataIO and BPositionIO and the derived BMallocIO and BMemoryIO classes.
|
\brief Defines abstract BDataIO and BPositionIO and the derived BMallocIO and BMemoryIO classes.
|
||||||
|
|
||||||
Pure virtual BDataIO and BPositioIO classes provide
|
Pure virtual BDataIO and BPositioIO classes provide
|
||||||
@@ -21,8 +25,10 @@
|
|||||||
as does BFile in the Storage Kit.
|
as does BFile in the Storage Kit.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
///// BDataIO /////
|
///// BDataIO /////
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\class BDataIO
|
\class BDataIO
|
||||||
\ingroup support
|
\ingroup support
|
||||||
@@ -32,26 +38,29 @@
|
|||||||
|
|
||||||
The interface provided by this class applies to objects or data that are
|
The interface provided by this class applies to objects or data that are
|
||||||
limited to reading and writing data. Classes derived from this class should
|
limited to reading and writing data. Classes derived from this class should
|
||||||
reimplement both the Read() and Write() method from this class.
|
re-implement both the Read() and Write() method from this class.
|
||||||
|
|
||||||
Candidates of types of data or objects that should be derived from this class
|
Candidates of types of data or objects that should be derived from this class
|
||||||
are probably broadcasting media streams (which don't support reading at a
|
are probably broadcasting media streams (which don't support reading at a
|
||||||
certain point in the data) or network streams that output data continously.
|
certain point in the data) or network streams that output data continuously.
|
||||||
Objects and data that support more advanced operations like seeking or
|
Objects and data that support more advanced operations like seeking or
|
||||||
reading at writing at defined positions should derive their classes from
|
reading at writing at defined positions should derive their classes from
|
||||||
BPositionIO, which inherits this class.
|
BPositionIO, which inherits this class.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\fn BDataIO::BDataIO()
|
\fn BDataIO::BDataIO()
|
||||||
\brief This constructor does nothing.
|
\brief This constructor does nothing.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\fn BDataIO::~BDataIO()
|
\fn BDataIO::~BDataIO()
|
||||||
\brief This destructor does nothing.
|
\brief This destructor does nothing.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\fn virtual ssize_t BDataIO::Read(void *buffer, size_t size) = 0
|
\fn virtual ssize_t BDataIO::Read(void *buffer, size_t size) = 0
|
||||||
\brief Pure virtual to read data.
|
\brief Pure virtual to read data.
|
||||||
@@ -62,6 +71,7 @@
|
|||||||
in case of failure.
|
in case of failure.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\fn virtual ssize_t BDataIO::Write(const void *buffer, size_t size) = 0
|
\fn virtual ssize_t BDataIO::Write(const void *buffer, size_t size) = 0
|
||||||
\brief Pure virtual to write data.
|
\brief Pure virtual to write data.
|
||||||
@@ -72,7 +82,10 @@
|
|||||||
code in case of failure.
|
code in case of failure.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
//////////// BPositionIO
|
//////////// BPositionIO
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\class BPositionIO
|
\class BPositionIO
|
||||||
\ingroup support
|
\ingroup support
|
||||||
@@ -82,30 +95,33 @@
|
|||||||
|
|
||||||
The interface of this object applies to objects or data that allows
|
The interface of this object applies to objects or data that allows
|
||||||
position-aware reading and writing of data. Classes that derive from this
|
position-aware reading and writing of data. Classes that derive from this
|
||||||
class should at least reimplement ReadAt(), WriteAt(), Seek(), Position(),
|
class should at least re-implement ReadAt(), WriteAt(), Seek(), Position(),
|
||||||
SetSize() and GetSize() methods.
|
SetSize() and GetSize() methods.
|
||||||
|
|
||||||
A good example of a form of data that can derive from this object, are files.
|
A good example of a form of data that can derive from this object, are files.
|
||||||
The BFile class derives from BPositionIO and provides this interface to
|
The BFile class derives from BPositionIO and provides this interface to
|
||||||
files. If your object or data only supports linear reading and writing,
|
files. If your object or data only supports linear reading and writing,
|
||||||
consider deriving from the baseclass BDataIO.
|
consider deriving from the base-class BDataIO.
|
||||||
|
|
||||||
A final note, from BDataIO this class inherits Read() and Write(). The
|
A final note, from BDataIO this class inherits Read() and Write(). The
|
||||||
default implementation is to read or write the data at the current position
|
default implementation is to read or write the data at the current position
|
||||||
indicated by Position(). Reimplement the methods if you require a different
|
indicated by Position(). Re-implement the methods if you require a different
|
||||||
behaviour.
|
behavior.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\fn BPositionIO::BPositionIO()
|
\fn BPositionIO::BPositionIO()
|
||||||
\brief This constructor does nothing.
|
\brief This constructor does nothing.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\fn virtual BPositionIO::~BPositionIO()
|
\fn virtual BPositionIO::~BPositionIO()
|
||||||
\brief This destructor does nothing.
|
\brief This destructor does nothing.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\fn virtual ssize_t BPositionIO::Read(void *buffer, size_t size)
|
\fn virtual ssize_t BPositionIO::Read(void *buffer, size_t size)
|
||||||
\brief Read data from current position.
|
\brief Read data from current position.
|
||||||
@@ -116,6 +132,7 @@
|
|||||||
expected of this method.
|
expected of this method.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\fn virtual ssize_t BPositionIO::Write(const void *buffer, size_t size)
|
\fn virtual ssize_t BPositionIO::Write(const void *buffer, size_t size)
|
||||||
\brief Write data to the current position.
|
\brief Write data to the current position.
|
||||||
@@ -126,6 +143,7 @@
|
|||||||
expected of this method.
|
expected of this method.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\fn virtual ssize_t BPositionIO::ReadAt(off_t position, void *buffer, size_t size) = 0
|
\fn virtual ssize_t BPositionIO::ReadAt(off_t position, void *buffer, size_t size) = 0
|
||||||
\brief Pure virtual to read data from a certain position.
|
\brief Pure virtual to read data from a certain position.
|
||||||
@@ -136,6 +154,7 @@
|
|||||||
\return The amount of bytes actually read, or an error code.
|
\return The amount of bytes actually read, or an error code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\fn virtual ssize_t BPositionIO::WriteAt(off_t position, const void *buffer, size_t size) = 0
|
\fn virtual ssize_t BPositionIO::WriteAt(off_t position, const void *buffer, size_t size) = 0
|
||||||
\brief Pure virtual to write data to a certain position.
|
\brief Pure virtual to write data to a certain position.
|
||||||
@@ -146,6 +165,7 @@
|
|||||||
\return The amount of bytes actually written, or an error code.
|
\return The amount of bytes actually written, or an error code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\fn virtual off_t BPositionIO::Seek(off_t position, uint32 seekMode) = 0
|
\fn virtual off_t BPositionIO::Seek(off_t position, uint32 seekMode) = 0
|
||||||
\brief Pure virtual to move the cursor to a certain position.
|
\brief Pure virtual to move the cursor to a certain position.
|
||||||
@@ -162,6 +182,7 @@
|
|||||||
\return The new position.
|
\return The new position.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\fn virtual off_t BPositionIO::Position() const = 0
|
\fn virtual off_t BPositionIO::Position() const = 0
|
||||||
\brief Pure virtual to return the current position of the cursor.
|
\brief Pure virtual to return the current position of the cursor.
|
||||||
@@ -169,6 +190,7 @@
|
|||||||
\return Your implementation should return the current position of the cursor.
|
\return Your implementation should return the current position of the cursor.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\fn virtual status_t BPositionIO::SetSize(off_t size)
|
\fn virtual status_t BPositionIO::SetSize(off_t size)
|
||||||
\brief Set the size of the object or data.
|
\brief Set the size of the object or data.
|
||||||
@@ -180,6 +202,7 @@
|
|||||||
error code.
|
error code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\fn virtual status_t BPositionIO::GetSize(off_t* size) const
|
\fn virtual status_t BPositionIO::GetSize(off_t* size) const
|
||||||
\brief Get the size of the object or data.
|
\brief Get the size of the object or data.
|
||||||
@@ -196,7 +219,10 @@
|
|||||||
\see Seek()
|
\see Seek()
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
//////////// BMemoryIO
|
//////////// BMemoryIO
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\class BMemoryIO
|
\class BMemoryIO
|
||||||
\ingroup support
|
\ingroup support
|
||||||
@@ -216,6 +242,7 @@
|
|||||||
Position() interface from BPositionIO.
|
Position() interface from BPositionIO.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\fn BMemoryIO::BMemoryIO(void *data, size_t length)
|
\fn BMemoryIO::BMemoryIO(void *data, size_t length)
|
||||||
\brief Create a read/write object.
|
\brief Create a read/write object.
|
||||||
@@ -226,6 +253,7 @@
|
|||||||
implementation.
|
implementation.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\fn BMemoryIO::BMemoryIO(const void *buffer, size_t length)
|
\fn BMemoryIO::BMemoryIO(const void *buffer, size_t length)
|
||||||
\brief Create a read-only object.
|
\brief Create a read-only object.
|
||||||
@@ -235,11 +263,13 @@
|
|||||||
\see BMemoryIO(void *buffer, size_t length) for a read-write implementation.
|
\see BMemoryIO(void *buffer, size_t length) for a read-write implementation.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\fn BMemoryIO::~BMemoryIO()
|
\fn BMemoryIO::~BMemoryIO()
|
||||||
\brief The destructor does nothing.
|
\brief The destructor does nothing.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\fn ssize_t BMemoryIO::ReadAt(off_t pos, void *buffer, size_t size)
|
\fn ssize_t BMemoryIO::ReadAt(off_t pos, void *buffer, size_t size)
|
||||||
\brief Read from a given position.
|
\brief Read from a given position.
|
||||||
@@ -252,6 +282,7 @@
|
|||||||
construction is invalid.
|
construction is invalid.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\fn ssize_t BMemoryIO::WriteAt(off_t pos, const void *buffer, size_t size)
|
\fn ssize_t BMemoryIO::WriteAt(off_t pos, const void *buffer, size_t size)
|
||||||
\brief Write at a given position.
|
\brief Write at a given position.
|
||||||
@@ -265,6 +296,7 @@
|
|||||||
construction is invalid.
|
construction is invalid.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\fn off_t BMemoryIO::Seek(off_t position, uint32 seek_mode)
|
\fn off_t BMemoryIO::Seek(off_t position, uint32 seek_mode)
|
||||||
\brief Move the cursor to a given position.
|
\brief Move the cursor to a given position.
|
||||||
@@ -280,11 +312,13 @@
|
|||||||
\return The new position.
|
\return The new position.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\fn off_t BMemoryIO::Position() const
|
\fn off_t BMemoryIO::Position() const
|
||||||
\brief Return the current position.
|
\brief Return the current position.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\fn status_t BMemoryIO::SetSize(off_t size)
|
\fn status_t BMemoryIO::SetSize(off_t size)
|
||||||
\brief Resize the buffer.
|
\brief Resize the buffer.
|
||||||
@@ -304,7 +338,10 @@
|
|||||||
\retval B_ERROR The \c size is larger than the size of the buffer.
|
\retval B_ERROR The \c size is larger than the size of the buffer.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
//////////// BMallocIO
|
//////////// BMallocIO
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\class BMallocIO
|
\class BMallocIO
|
||||||
\ingroup support
|
\ingroup support
|
||||||
@@ -329,17 +366,20 @@
|
|||||||
provide, have a look at BMemoryIO.
|
provide, have a look at BMemoryIO.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\fn BMallocIO::BMallocIO()
|
\fn BMallocIO::BMallocIO()
|
||||||
\brief Create a new memory buffer with block size 256.
|
\brief Create a new memory buffer with block size 256.
|
||||||
\see SetBlockSize()
|
\see SetBlockSize()
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\fn BMallocIO::~BMallocIO()
|
\fn BMallocIO::~BMallocIO()
|
||||||
\brief Destroy the object and free the internal buffer.
|
\brief Destroy the object and free the internal buffer.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\fn ssize_t BMallocIO::ReadAt(off_t pos, void *buffer, size_t size)
|
\fn ssize_t BMallocIO::ReadAt(off_t pos, void *buffer, size_t size)
|
||||||
\brief Read data at a certain position.
|
\brief Read data at a certain position.
|
||||||
@@ -351,6 +391,7 @@
|
|||||||
the provided \a buffer is invalid.
|
the provided \a buffer is invalid.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\fn ssize_t BMallocIO::WriteAt(off_t pos, const void *buffer, size_t size)
|
\fn ssize_t BMallocIO::WriteAt(off_t pos, const void *buffer, size_t size)
|
||||||
\brief Write data to a certain position.
|
\brief Write data to a certain position.
|
||||||
@@ -362,6 +403,7 @@
|
|||||||
\a buffer is invalid.
|
\a buffer is invalid.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\fn off_t BMallocIO::Seek(off_t position, uint32 seekMode)
|
\fn off_t BMallocIO::Seek(off_t position, uint32 seekMode)
|
||||||
\brief Move the cursor to a given position.
|
\brief Move the cursor to a given position.
|
||||||
@@ -376,11 +418,13 @@
|
|||||||
\return The new position.
|
\return The new position.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\fn off_t BMallocIO::Position() const
|
\fn off_t BMallocIO::Position() const
|
||||||
\brief Return the position of the cursor.
|
\brief Return the position of the cursor.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\fn status_t BMallocIO::SetSize(off_t size)
|
\fn status_t BMallocIO::SetSize(off_t size)
|
||||||
\brief Change the size of the buffer.
|
\brief Change the size of the buffer.
|
||||||
@@ -393,6 +437,7 @@
|
|||||||
\retval B_NO_MEMORY Failed to allocate the necessary memory.
|
\retval B_NO_MEMORY Failed to allocate the necessary memory.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\fn void BMallocIO::SetBlockSize(size_t blockSize)
|
\fn void BMallocIO::SetBlockSize(size_t blockSize)
|
||||||
\brief Change the block size to a certain value.
|
\brief Change the block size to a certain value.
|
||||||
@@ -405,6 +450,7 @@
|
|||||||
\param blockSize The new block size.
|
\param blockSize The new block size.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\fn const void *BMallocIO::Buffer() const
|
\fn const void *BMallocIO::Buffer() const
|
||||||
\brief Return a pointer to the internal buffer.
|
\brief Return a pointer to the internal buffer.
|
||||||
@@ -413,6 +459,7 @@
|
|||||||
make sure you don't change anything since it doesn't belong to you.
|
make sure you don't change anything since it doesn't belong to you.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\fn size_t BMallocIO::BufferLength() const
|
\fn size_t BMallocIO::BufferLength() const
|
||||||
\brief Return the number of bytes in the buffer.
|
\brief Return the number of bytes in the buffer.
|
||||||
@@ -421,4 +468,3 @@
|
|||||||
is allocated in blocks the actual size of the buffer may be greater, but this
|
is allocated in blocks the actual size of the buffer may be greater, but this
|
||||||
method only returns the number of bytes that are actually used.
|
method only returns the number of bytes that are actually used.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|||||||
@@ -1,19 +1,24 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2007, Haiku, Inc. All Rights Reserved.
|
* Copyright 2007 Haiku, Inc. All rights reserved.
|
||||||
* Distributed under the terms of the MIT License.
|
* Distributed under the terms of the MIT License.
|
||||||
*
|
*
|
||||||
* Documentation written by:
|
* Authors:
|
||||||
* Niels Sascha Reedijk <[email protected]>
|
* Niels Sascha Reedijk <[email protected]>
|
||||||
|
*
|
||||||
* Corresponds to:
|
* Corresponds to:
|
||||||
* /trunk/headers/os/support/Flattenable.h rev 19972
|
* headers/os/support/Flattenable.h rev 19972
|
||||||
* /trunk/src/kits/support/Flattenable.cpp rev 12963
|
* src/kits/support/Flattenable.cpp rev 12963
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\file Flattenable.h
|
\file Flattenable.h
|
||||||
|
\ingroup support
|
||||||
|
\ingroup libbe
|
||||||
\brief Provides the BFlattenable interface
|
\brief Provides the BFlattenable interface
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\class BFlattenable
|
\class BFlattenable
|
||||||
\ingroup support
|
\ingroup support
|
||||||
@@ -99,30 +104,33 @@ public:
|
|||||||
that provide the flattening interface.
|
that provide the flattening interface.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\fn virtual bool BFlattenable::IsFixedSize() const = 0
|
\fn virtual bool BFlattenable::IsFixedSize() const
|
||||||
\brief Pure virtual that should return whether or not flattened objects of
|
\brief Pure virtual that should return whether or not flattened objects of
|
||||||
this type always have a fixed size.
|
this type always have a fixed size.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*!
|
|
||||||
\fn virtual type_code BFlattenable::TypeCode() const = 0
|
|
||||||
\brief Pure virtual that should return which type_code this class flattens
|
|
||||||
to.
|
|
||||||
|
|
||||||
\return Either one of the existing typecodes, found in TypeConstants.h,
|
/*!
|
||||||
<em>if your class actually is compatible to those formats</em>, or a custom
|
\fn virtual type_code BFlattenable::TypeCode() const
|
||||||
four byte integer constant.
|
\brief Pure virtual that returns the type_code this class flattens to.
|
||||||
|
|
||||||
|
\return Either one of the existing typecodes found in TypeConstants.h
|
||||||
|
if your class actually is compatible to those formats, or a
|
||||||
|
custom four-byte integer constant if not.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\fn virtual ssize_t BFlattenable::FlattenedSize() const = 0
|
\fn virtual ssize_t BFlattenable::FlattenedSize() const
|
||||||
\brief Pure virtual that should return the size of the flattened object in
|
\brief Pure virtual that should return the size of the flattened object in
|
||||||
bytes.
|
bytes.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\fn virtual status_t BFlattenable::Flatten(void* buffer, ssize_t size) const = 0
|
\fn virtual status_t BFlattenable::Flatten(void* buffer, ssize_t size) const
|
||||||
\brief Pure virtual that should flatten the object into the supplied
|
\brief Pure virtual that should flatten the object into the supplied
|
||||||
\a buffer.
|
\a buffer.
|
||||||
|
|
||||||
@@ -132,25 +140,31 @@ public:
|
|||||||
|
|
||||||
\param buffer The buffer to flatten in.
|
\param buffer The buffer to flatten in.
|
||||||
\param size The size of the buffer.
|
\param size The size of the buffer.
|
||||||
|
|
||||||
\retval B_OK The object was flattened.
|
\retval B_OK The object was flattened.
|
||||||
\retval B_NO_MEMORY The buffer was smaller than required.
|
\retval B_NO_MEMORY The buffer was smaller than required.
|
||||||
\retval B_BAD_VALUE The buffer was a \c NULL pointer.
|
\retval B_BAD_VALUE The buffer was a \c NULL pointer.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\fn bool BFlattenable::AllowsTypeCode(type_code code) const
|
\fn bool BFlattenable::AllowsTypeCode(type_code code) const
|
||||||
\brief Return whether or not the supplied type_code is supported.
|
\brief Get whether or not the supplied type_code is supported.
|
||||||
|
|
||||||
This default implementation checks the \a code argument against the type_code
|
This default implementation checks the \a code argument against the type_code
|
||||||
returned by TypeCode().
|
returned by TypeCode().
|
||||||
|
|
||||||
\param code The type_code constant you want to check for.
|
\param code The type_code constant you want to check for.
|
||||||
|
|
||||||
|
\returns Whether or not the supplied type_code is supported.
|
||||||
\retval true The type_code is supported.
|
\retval true The type_code is supported.
|
||||||
\retval false The type_code is not supported.
|
\retval false The type_code is not supported.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\fn virtual status_t BFlattenable::Unflatten(type_code code, const void* buffer, ssize_t size) = 0
|
\fn virtual status_t BFlattenable::Unflatten(type_code code,
|
||||||
|
const void* buffer, ssize_t size)
|
||||||
\brief Pure virtual that should unflatten the buffer and put the contents
|
\brief Pure virtual that should unflatten the buffer and put the contents
|
||||||
into the current object.
|
into the current object.
|
||||||
|
|
||||||
@@ -160,11 +174,14 @@ public:
|
|||||||
\param code The type_code this data is.
|
\param code The type_code this data is.
|
||||||
\param buffer The buffer to unflatten the data from.
|
\param buffer The buffer to unflatten the data from.
|
||||||
\param size The size of the data.
|
\param size The size of the data.
|
||||||
|
|
||||||
|
\returns A status code.
|
||||||
\retval B_OK The object is unflattened.
|
\retval B_OK The object is unflattened.
|
||||||
\retval B_BAD_VALUE The \a buffer pointer is \c NULL or the data is invalid.
|
\retval B_BAD_VALUE The \a buffer pointer is \c NULL or the data is invalid.
|
||||||
\retval B_BAD_TYPE You don't support data with this \a code.
|
\retval B_BAD_TYPE You don't support data with this \a code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\fn virtual BFlattenable::~BFlattenable()
|
\fn virtual BFlattenable::~BFlattenable()
|
||||||
\brief Destructor. Does nothing.
|
\brief Destructor. Does nothing.
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2007, Haiku, Inc. All Rights Reserved.
|
* Copyright 2007 Haiku, Inc. All rights reserved.
|
||||||
* Distributed under the terms of the MIT License.
|
* Distributed under the terms of the MIT License.
|
||||||
*
|
*
|
||||||
* Authors:
|
* Authors:
|
||||||
@@ -11,13 +11,15 @@
|
|||||||
* John Drinkwater, [email protected]
|
* John Drinkwater, [email protected]
|
||||||
*
|
*
|
||||||
* Corresponds to:
|
* Corresponds to:
|
||||||
* /trunk/headers/os/support/List.h rev 19972
|
* headers/os/support/List.h rev 19972
|
||||||
* /trunk/src/kits/support/List.cpp rev 18649
|
* src/kits/support/List.cpp rev 18649
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\file List.h
|
\file List.h
|
||||||
|
\ingroup support
|
||||||
|
\ingroup libbe
|
||||||
\brief Defines the BList class.
|
\brief Defines the BList class.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@@ -54,7 +56,6 @@
|
|||||||
the items in the list.
|
the items in the list.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\fn BList::BList(int32 count = 20)
|
\fn BList::BList(int32 count = 20)
|
||||||
\brief Create a new list with a number of empty slots.
|
\brief Create a new list with a number of empty slots.
|
||||||
@@ -77,13 +78,11 @@
|
|||||||
\param count The size of the blocks allocated in memory.
|
\param count The size of the blocks allocated in memory.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\fn BList::BList(const BList& anotherList)
|
\fn BList::BList(const BList& anotherList)
|
||||||
\brief Copy constructor. Copy a complete list into this one.
|
\brief Copy constructor. Copy a complete list into this one.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\fn BList::~BList()
|
\fn BList::~BList()
|
||||||
\brief Destroy the list.
|
\brief Destroy the list.
|
||||||
@@ -92,21 +91,17 @@
|
|||||||
only the list will be freed, not the objects that are held in it.
|
only the list will be freed, not the objects that are held in it.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\fn BList& BList::operator=(const BList &list)
|
\fn BList& BList::operator=(const BList &list)
|
||||||
\brief Copy another list into this object.
|
\brief Copy another list into this object.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\name Adding and Removing Items
|
\name Adding and Removing Items
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
//! @{
|
//! @{
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\fn bool BList::AddItem(void *item, int32 index)
|
\fn bool BList::AddItem(void *item, int32 index)
|
||||||
\brief Add an item at a certain position.
|
\brief Add an item at a certain position.
|
||||||
@@ -119,7 +114,6 @@
|
|||||||
\see AddItem(void *item)
|
\see AddItem(void *item)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\fn bool BList::AddItem(void *item)
|
\fn bool BList::AddItem(void *item)
|
||||||
\brief Append an item to the list.
|
\brief Append an item to the list.
|
||||||
@@ -130,7 +124,6 @@
|
|||||||
\see AddItem(void *item, int32 index)
|
\see AddItem(void *item, int32 index)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\fn bool BList::AddList(const BList *list, int32 index)
|
\fn bool BList::AddList(const BList *list, int32 index)
|
||||||
\brief Add items from another list to this list at a certain position.
|
\brief Add items from another list to this list at a certain position.
|
||||||
@@ -147,7 +140,6 @@
|
|||||||
\see AddList(const BList *list)
|
\see AddList(const BList *list)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\fn bool BList::AddList(const BList *list)
|
\fn bool BList::AddList(const BList *list)
|
||||||
\brief Append a list to this list.
|
\brief Append a list to this list.
|
||||||
@@ -162,7 +154,6 @@
|
|||||||
\see AddList(const BList *list, int32 index)
|
\see AddList(const BList *list, int32 index)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\fn bool BList::RemoveItem(void *item)
|
\fn bool BList::RemoveItem(void *item)
|
||||||
\brief Remove an item from the list.
|
\brief Remove an item from the list.
|
||||||
@@ -173,7 +164,6 @@
|
|||||||
\see RemoveItem(int32 index)
|
\see RemoveItem(int32 index)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\fn void * BList::RemoveItem(int32 index)
|
\fn void * BList::RemoveItem(int32 index)
|
||||||
\brief Remove the item at \a index from the list.
|
\brief Remove the item at \a index from the list.
|
||||||
@@ -184,7 +174,6 @@
|
|||||||
\see RemoveItem(void *item)
|
\see RemoveItem(void *item)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\fn bool BList::RemoveItems(int32 index, int32 count)
|
\fn bool BList::RemoveItems(int32 index, int32 count)
|
||||||
\brief Remove a number of items starting at a certain position.
|
\brief Remove a number of items starting at a certain position.
|
||||||
@@ -198,7 +187,6 @@
|
|||||||
\retval false Failed to remove the items because the index was invalid.
|
\retval false Failed to remove the items because the index was invalid.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\fn bool BList::ReplaceItem(int32 index, void *newItem)
|
\fn bool BList::ReplaceItem(int32 index, void *newItem)
|
||||||
\brief Replace an item with another one.
|
\brief Replace an item with another one.
|
||||||
@@ -209,7 +197,6 @@
|
|||||||
\retval false The index was invalid.
|
\retval false The index was invalid.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\fn void BList::MakeEmpty()
|
\fn void BList::MakeEmpty()
|
||||||
\brief Clear all the items from the list.
|
\brief Clear all the items from the list.
|
||||||
@@ -217,18 +204,14 @@
|
|||||||
Please note that this does not free the items.
|
Please note that this does not free the items.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
//! @}
|
//! @}
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\name Reordering Items
|
\name Reordering Items
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
//! @{
|
//! @{
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\fn void BList::SortItems(int (*compareFunc)(const void *, const void *))
|
\fn void BList::SortItems(int (*compareFunc)(const void *, const void *))
|
||||||
\brief Sort the items with the use of a supplied comparison function.
|
\brief Sort the items with the use of a supplied comparison function.
|
||||||
@@ -239,7 +222,6 @@
|
|||||||
For an example, see the Compare(const BString *, const BString *) function.
|
For an example, see the Compare(const BString *, const BString *) function.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\fn bool BList::SwapItems(int32 indexA, int32 indexB)
|
\fn bool BList::SwapItems(int32 indexA, int32 indexB)
|
||||||
\brief Swap two items.
|
\brief Swap two items.
|
||||||
@@ -250,7 +232,6 @@
|
|||||||
\retval false Swap failed because one of the indexes was invalid.
|
\retval false Swap failed because one of the indexes was invalid.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\fn bool BList::MoveItem(int32 fromIndex, int32 toIndex)
|
\fn bool BList::MoveItem(int32 fromIndex, int32 toIndex)
|
||||||
\brief Move an item to a new place
|
\brief Move an item to a new place
|
||||||
@@ -272,18 +253,14 @@ A C D E F G B H I J
|
|||||||
\retval false Move failed due to the indexes being invalid.
|
\retval false Move failed due to the indexes being invalid.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
//! @}
|
//! @}
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\name Retrieving Items
|
\name Retrieving Items
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
//! @{
|
//! @{
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\fn void *BList::ItemAt(int32 index) const
|
\fn void *BList::ItemAt(int32 index) const
|
||||||
\brief Get an item.
|
\brief Get an item.
|
||||||
@@ -294,7 +271,6 @@ A C D E F G B H I J
|
|||||||
\see ItemAtFast(int32 index) const
|
\see ItemAtFast(int32 index) const
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\fn void *BList::FirstItem() const
|
\fn void *BList::FirstItem() const
|
||||||
\brief Get the first item.
|
\brief Get the first item.
|
||||||
@@ -303,7 +279,6 @@ A C D E F G B H I J
|
|||||||
\see LastItem() const
|
\see LastItem() const
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\fn void *BList::ItemAtFast(int32 index) const
|
\fn void *BList::ItemAtFast(int32 index) const
|
||||||
\brief Get an item.
|
\brief Get an item.
|
||||||
@@ -315,7 +290,6 @@ A C D E F G B H I J
|
|||||||
\return A pointer to the item.
|
\return A pointer to the item.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\fn void *BList::LastItem() const
|
\fn void *BList::LastItem() const
|
||||||
\brief Get the last item.
|
\brief Get the last item.
|
||||||
@@ -323,7 +297,6 @@ A C D E F G B H I J
|
|||||||
\see FirstItem() const
|
\see FirstItem() const
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\fn void *BList::Items() const
|
\fn void *BList::Items() const
|
||||||
\brief Return the internal list of objects.
|
\brief Return the internal list of objects.
|
||||||
@@ -343,24 +316,19 @@ A C D E F G B H I J
|
|||||||
\return The internal list of pointers.
|
\return The internal list of pointers.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
//! @}
|
//! @}
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\name Querying for Items
|
\name Querying for Items
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
//! @{
|
//! @{
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\fn bool BList::HasItem(void *item) const
|
\fn bool BList::HasItem(void *item) const
|
||||||
\brief Check if an item is in the list.
|
\brief Check if an item is in the list.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\fn int32 BList::IndexOf(void *item) const
|
\fn int32 BList::IndexOf(void *item) const
|
||||||
\brief Get the index of an item.
|
\brief Get the index of an item.
|
||||||
@@ -368,30 +336,24 @@ A C D E F G B H I J
|
|||||||
\return The index of the item, or -1 when the item is not in the list.
|
\return The index of the item, or -1 when the item is not in the list.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\fn int32 BList::CountItems() const
|
\fn int32 BList::CountItems() const
|
||||||
\brief Get the number of items in the list.
|
\brief Get the number of items in the list.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\fn bool BList::IsEmpty() const
|
\fn bool BList::IsEmpty() const
|
||||||
\brief Check if there are items in the list.
|
\brief Check if there are items in the list.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
//! @}
|
//! @}
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\name Iterating over the List
|
\name Iterating over the List
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
//! @{
|
//! @{
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\fn void BList::DoForEach(bool (*func)(void* item))
|
\fn void BList::DoForEach(bool (*func)(void* item))
|
||||||
\brief Perform an action on every item in the list.
|
\brief Perform an action on every item in the list.
|
||||||
@@ -404,7 +366,6 @@ A C D E F G B H I J
|
|||||||
\see DoForEach(bool (*func)(void* item, void* arg2), void *arg2)
|
\see DoForEach(bool (*func)(void* item, void* arg2), void *arg2)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\fn void BList::DoForEach(bool (*func)(void* item, void* arg2), void *arg2)
|
\fn void BList::DoForEach(bool (*func)(void* item, void* arg2), void *arg2)
|
||||||
\brief Perform an action on every item in the list with an argument.
|
\brief Perform an action on every item in the list with an argument.
|
||||||
@@ -419,5 +380,4 @@ A C D E F G B H I J
|
|||||||
\see DoForEach(bool (*func)(void* item))
|
\see DoForEach(bool (*func)(void* item))
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
//! @}
|
//! @}
|
||||||
|
|||||||
@@ -1,16 +1,19 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2007, Haiku, Inc. All Rights Reserved.
|
* Copyright 2007 Haiku, Inc. All rights reserved.
|
||||||
* Distributed under the terms of the MIT License.
|
* Distributed under the terms of the MIT License.
|
||||||
*
|
*
|
||||||
* Documentation by:
|
* Authors:
|
||||||
* Niels Sascha Reedijk <[email protected]>
|
* Niels Sascha Reedijk, [email protected]
|
||||||
|
*
|
||||||
* Corresponds to:
|
* Corresponds to:
|
||||||
* /trunk/headers/os/support/Locker.h rev 19972
|
* headers/os/support/Locker.h rev 19972
|
||||||
* /trunk/src/kits/support/Locker.cpp rev 13826
|
* src/kits/support/Locker.cpp rev 13826
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\file Locker.h
|
\file Locker.h
|
||||||
|
\ingroup support
|
||||||
|
\ingroup libbe
|
||||||
\brief Provides locking class BLocker.
|
\brief Provides locking class BLocker.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@@ -93,9 +96,10 @@
|
|||||||
|
|
||||||
Create a new BLocker with benaphore-style locking.
|
Create a new BLocker with benaphore-style locking.
|
||||||
|
|
||||||
\param name A NULL-terminated string that contains the name of the semaphore.
|
\param name A NULL-terminated string that contains the name of the
|
||||||
Note that the length of the names are limited to B_OS_NAME_LENGTH constant,
|
semaphore. Note that the length of the names are limited to
|
||||||
which includes the \c \\0 character.
|
\c B_OS_NAME_LENGTH constant, which includes the \c \\0
|
||||||
|
character.
|
||||||
|
|
||||||
\see BLocker(const char* name, bool benaphoreStyle) for all the options.
|
\see BLocker(const char* name, bool benaphoreStyle) for all the options.
|
||||||
*/
|
*/
|
||||||
@@ -107,29 +111,30 @@
|
|||||||
Creates a BLocker with the default name of <tt>some BLocker</tt>.
|
Creates a BLocker with the default name of <tt>some BLocker</tt>.
|
||||||
|
|
||||||
\note For debugging purposes, it's extremely convenient to actually give a
|
\note For debugging purposes, it's extremely convenient to actually give a
|
||||||
name to the object. In case of a deadlock, it's easier to track down which
|
name to the object. In case of a deadlock, it's easier to track down
|
||||||
BLocker object might have caused the problems.
|
which BLocker object might have caused the problems.
|
||||||
|
|
||||||
\param benaphoreStyle If you pass \c true, the locker will be in benaphore
|
\param benaphoreStyle If you pass \c true, the locker will be in benaphore
|
||||||
style (which is the default option for other constructors). If you pass
|
style (which is the default option for other constructors). If you
|
||||||
\c false, the object will completely rely on semaphores for it's
|
pass \c false, the object will completely rely on semaphores for
|
||||||
functioning.
|
it's functioning.
|
||||||
|
|
||||||
\see BLocker(const char* name, bool benaphoreStyle) if you also want to set a
|
\see BLocker(const char* name, bool benaphoreStyle) if you also want
|
||||||
name.
|
to set a name.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\fn BLocker::BLocker(const char* name, bool benaphoreStyle)
|
\fn BLocker::BLocker(const char* name, bool benaphoreStyle)
|
||||||
\brief Constructor.
|
\brief Constructor.
|
||||||
|
|
||||||
\param name A NULL-terminated string that contains the name of the semaphore.
|
\param name A NULL-terminated string that contains the name of the
|
||||||
Note that the length of the names are limited to B_OS_NAME_LENGTH constant,
|
semaphore. Note that the length of the names are limited to
|
||||||
which includes the \c \\0 character.
|
\c B_OS_NAME_LENGTH constant, which includes the \c \\0
|
||||||
|
character.
|
||||||
\param benaphoreStyle If you pass \c true, the locker will be in benaphore
|
\param benaphoreStyle If you pass \c true, the locker will be in benaphore
|
||||||
style (which is the default option for other constructors). If you pass
|
style (which is the default option for other constructors). If
|
||||||
\c false, the object will completely rely on semaphores for it's
|
you pass \c false, the object will completely rely on semaphores
|
||||||
functioning.
|
for its functioning.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
@@ -147,8 +152,8 @@
|
|||||||
|
|
||||||
\retval true Lock acquired succesfully.
|
\retval true Lock acquired succesfully.
|
||||||
\retval false Failed to acquire the lock. Most probable cause is that the
|
\retval false Failed to acquire the lock. Most probable cause is that the
|
||||||
object is deleted. This frees the semaphore and releases the pending Lock()
|
object is deleted. This frees the semaphore and releases the
|
||||||
requests.
|
pending Lock() requests.
|
||||||
|
|
||||||
\see LockWithTimeout(bigtime_t timeout), Unlock()
|
\see LockWithTimeout(bigtime_t timeout), Unlock()
|
||||||
*/
|
*/
|
||||||
@@ -157,8 +162,8 @@
|
|||||||
\fn status_t BLocker::LockWithTimeout(bigtime_t timeout)
|
\fn status_t BLocker::LockWithTimeout(bigtime_t timeout)
|
||||||
\brief Add a lock request and block until we get it or until it times out.
|
\brief Add a lock request and block until we get it or until it times out.
|
||||||
|
|
||||||
\param timeout This is a timeout in microseconds (one millionth of a second),
|
\param timeout This is a timeout in microseconds (one millionth of a
|
||||||
\e relative from now.
|
second) relative to now.
|
||||||
|
|
||||||
\see Lock(), Unlock()
|
\see Lock(), Unlock()
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -1,57 +1,71 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2007, Haiku, Inc. All Rights Reserved.
|
* Copyright 2007 Haiku, Inc. All rights reserved.
|
||||||
* Distributed under the terms of the MIT License.
|
* Distributed under the terms of the MIT License.
|
||||||
*
|
*
|
||||||
* Documentation by:
|
* Authors:
|
||||||
* Niels Sascha Reedijk <[email protected]>
|
* Niels Sascha Reedijk, [email protected]
|
||||||
|
*
|
||||||
* Corresponds to:
|
* Corresponds to:
|
||||||
* /trunk/headers/os/support/SupportDefs.h rev 35018
|
* headers/os/support/SupportDefs.h rev 35018
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\file SupportDefs.h
|
\file SupportDefs.h
|
||||||
\ingroup support
|
\ingroup support
|
||||||
|
\ingroup libbe
|
||||||
\brief Defines basic types and definitions for the Haiku API.
|
\brief Defines basic types and definitions for the Haiku API.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\name Fixed-Size Integer Types
|
\name Fixed-Size Integer Types
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
//! @{
|
//! @{
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\typedef typedef __haiku_int8 int8
|
\typedef typedef __haiku_int8 int8
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\typedef typedef __haiku_uint8 uint8
|
\typedef typedef __haiku_uint8 uint8
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\typedef typedef __haiku_int16 int16
|
\typedef typedef __haiku_int16 int16
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\typedef typedef __haiku_uint16 uint16
|
\typedef typedef __haiku_uint16 uint16
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\typedef typedef __haiku_int32 int32
|
\typedef typedef __haiku_int32 int32
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\typedef typedef __haiku_uint32 uint32
|
\typedef typedef __haiku_uint32 uint32
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\typedef typedef __haiku_int64 int64
|
\typedef typedef __haiku_int64 int64
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\typedef typedef __haiku_uint64 uint64
|
\typedef typedef __haiku_uint64 uint64
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
//! @}
|
//! @}
|
||||||
|
|
||||||
|
|
||||||
@@ -59,40 +73,50 @@
|
|||||||
\name Fixed-size Volatile Types
|
\name Fixed-size Volatile Types
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
//! @{
|
//! @{
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\typedef typedef volatile int8 vint8
|
\typedef typedef volatile int8 vint8
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\typedef typedef volatile uint8 vuint8
|
\typedef typedef volatile uint8 vuint8
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\typedef typedef volatile int16 vint16
|
\typedef typedef volatile int16 vint16
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\typedef typedef volatile uint16 vuint16
|
\typedef typedef volatile uint16 vuint16
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\typedef typedef volatile int32 vint32
|
\typedef typedef volatile int32 vint32
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\typedef typedef volatile uint32 vuint32
|
\typedef typedef volatile uint32 vuint32
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\typedef typedef volatile int64 vint64
|
\typedef typedef volatile int64 vint64
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\typedef typedef volatile uint64 vuint64
|
\typedef typedef volatile uint64 vuint64
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
//! @}
|
//! @}
|
||||||
|
|
||||||
|
|
||||||
@@ -100,399 +124,509 @@
|
|||||||
\name Short-hand Volatile Type Names
|
\name Short-hand Volatile Type Names
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
//! @{
|
//! @{
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\typedef typedef volatile long vlong
|
\typedef typedef volatile long vlong
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\typedef typedef volatile int vint
|
\typedef typedef volatile int vint
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\typedef typedef volatile short vshort
|
\typedef typedef volatile short vshort
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\typedef typedef volatile char vchar
|
\typedef typedef volatile char vchar
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\typedef typedef volatile unsigned long vulong
|
\typedef typedef volatile unsigned long vulong
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\typedef typedef volatile unsigned int vuint
|
\typedef typedef volatile unsigned int vuint
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\typedef typedef volatile unsigned short vushort
|
\typedef typedef volatile unsigned short vushort
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\typedef typedef volatile unsigned char vuchar
|
\typedef typedef volatile unsigned char vuchar
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
//! @}
|
//! @}
|
||||||
|
|
||||||
|
|
||||||
/*! \name Character Type Formats */
|
/*!
|
||||||
|
\name Character Type Formats
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
//! @{
|
//! @{
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\typedef typedef unsigned char uchar
|
\typedef typedef unsigned char uchar
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\typedef typedef unsigned short unichar
|
\typedef typedef unsigned short unichar
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
//! @}
|
//! @}
|
||||||
|
|
||||||
/*! \name Descriptive Type Formats */
|
|
||||||
|
/*!
|
||||||
|
\name Descriptive Type Formats
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
//! @{
|
//! @{
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\typedef typedef int32 status_t
|
\typedef typedef int32 status_t
|
||||||
\brief Represents one of the status codes defined in Error.h
|
\brief Represents one of the status codes defined in Error.h
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\typedef typedef int64 bigtime_t
|
\typedef typedef int64 bigtime_t
|
||||||
\brief Represents time. The unit depends on the context of the function.
|
\brief Represents time. The unit depends on the context of the function.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\typedef typedef int64 nanotime_t
|
\typedef typedef int64 nanotime_t
|
||||||
\brief Represents time in nanoseconds.
|
\brief Represents time in nanoseconds.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\typedef typedef uint32 type_code
|
\typedef typedef uint32 type_code
|
||||||
\brief Represents a certain type of data. See TypeConstants.h for
|
\brief Represents a certain type of data. See TypeConstants.h for
|
||||||
possible values.
|
possible values.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\typedef typedef uint32 perform_code
|
\typedef typedef uint32 perform_code
|
||||||
\brief Unused. Defined by Be to support 'hidden' commands or
|
\brief Defined to support 'hidden' commands or extensions to classes.
|
||||||
extensions to classes. The Haiku API has none of these.
|
|
||||||
|
The Haiku API has none of these.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
//! @}
|
//! @}
|
||||||
|
|
||||||
|
|
||||||
/*! \name Format strings for printf()/scanf() */
|
/*!
|
||||||
|
\name Format strings for printf() and scanf()
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
//! @{
|
//! @{
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\def B_PRId8
|
\def B_PRId8
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\def B_PRIi8
|
\def B_PRIi8
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\def B_PRId16
|
\def B_PRId16
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\def B_PRIi16
|
\def B_PRIi16
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\def B_PRId32
|
\def B_PRId32
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\def B_PRIi32
|
\def B_PRIi32
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\def B_PRId64
|
\def B_PRId64
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\def B_PRIi64
|
\def B_PRIi64
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\def B_PRIu8
|
\def B_PRIu8
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\def B_PRIo8
|
\def B_PRIo8
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\def B_PRIx8
|
\def B_PRIx8
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\def B_PRIX8
|
\def B_PRIX8
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\def B_PRIu16
|
\def B_PRIu16
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\def B_PRIo16
|
\def B_PRIo16
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\def B_PRIx16
|
\def B_PRIx16
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\def B_PRIX16
|
\def B_PRIX16
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\def B_PRIu32
|
\def B_PRIu32
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\def B_PRIo32
|
\def B_PRIo32
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\def B_PRIx32
|
\def B_PRIx32
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\def B_PRIX32
|
\def B_PRIX32
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\def B_PRIu64
|
\def B_PRIu64
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\def B_PRIo64
|
\def B_PRIo64
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\def B_PRIx64
|
\def B_PRIx64
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\def B_PRIX64
|
\def B_PRIX64
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\def B_SCNd8
|
\def B_SCNd8
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\def B_SCNi8
|
\def B_SCNi8
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\def B_SCNd16
|
\def B_SCNd16
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\def B_SCNi16
|
\def B_SCNi16
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\def B_SCNd32
|
\def B_SCNd32
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\def B_SCNi32
|
\def B_SCNi32
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\def B_SCNd64
|
\def B_SCNd64
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\def B_SCNi64
|
\def B_SCNi64
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\def B_SCNu8
|
\def B_SCNu8
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\def B_SCNo8
|
\def B_SCNo8
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\def B_SCNx8
|
\def B_SCNx8
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\def B_SCNu16
|
\def B_SCNu16
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\def B_SCNo16
|
\def B_SCNo16
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\def B_SCNx16
|
\def B_SCNx16
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\def B_SCNu32
|
\def B_SCNu32
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\def B_SCNo32
|
\def B_SCNo32
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\def B_SCNx32
|
\def B_SCNx32
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\def B_SCNu64
|
\def B_SCNu64
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\def B_SCNo64
|
\def B_SCNo64
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\def B_SCNx64
|
\def B_SCNx64
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
//! @}
|
//! @}
|
||||||
|
|
||||||
|
|
||||||
/*! \name Format strings for several standard types */
|
/*!
|
||||||
|
\name Format strings for several standard types
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
//! @{
|
//! @{
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\def B_PRIuSIZE
|
\def B_PRIuSIZE
|
||||||
\brief size_t
|
\brief size_t
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\def B_PRIoSIZE
|
\def B_PRIoSIZE
|
||||||
\brief size_t
|
\brief size_t
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\def B_PRIxSIZE
|
\def B_PRIxSIZE
|
||||||
\brief size_t
|
\brief size_t
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\def B_PRIXSIZE
|
\def B_PRIXSIZE
|
||||||
\brief size_t
|
\brief size_t
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\def B_PRIdSSIZE
|
\def B_PRIdSSIZE
|
||||||
\brief ssize_t
|
\brief ssize_t
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\def B_PRIiSSIZE
|
\def B_PRIiSSIZE
|
||||||
\brief ssize_t
|
\brief ssize_t
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\def B_PRIuADDR
|
\def B_PRIuADDR
|
||||||
\brief addr_t
|
\brief addr_t
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\def B_PRIoADDR
|
\def B_PRIoADDR
|
||||||
\brief addr_t
|
\brief addr_t
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\def B_PRIxADDR
|
\def B_PRIxADDR
|
||||||
\brief addr_t
|
\brief addr_t
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\def B_PRIXADDR
|
\def B_PRIXADDR
|
||||||
\brief addr_t
|
\brief addr_t
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\def B_PRIdOFF
|
\def B_PRIdOFF
|
||||||
\brief off_t
|
\brief off_t
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\def B_PRIiOFF
|
\def B_PRIiOFF
|
||||||
\brief off_t
|
\brief off_t
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\def B_PRIdDEV
|
\def B_PRIdDEV
|
||||||
\brief dev_t
|
\brief dev_t
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\def B_PRIiDEV
|
\def B_PRIiDEV
|
||||||
\brief dev_t
|
\brief dev_t
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\def B_PRIdINO
|
\def B_PRIdINO
|
||||||
\brief ino_t
|
\brief ino_t
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\def B_PRIiINO
|
\def B_PRIiINO
|
||||||
\brief ino_t
|
\brief ino_t
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\def B_PRIdTIME
|
\def B_PRIdTIME
|
||||||
\brief time_t
|
\brief time_t
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\def B_PRIiTIME
|
\def B_PRIiTIME
|
||||||
\brief time_t
|
\brief time_t
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
//! @}
|
//! @}
|
||||||
|
|
||||||
|
|
||||||
//////////////// Odds and ends
|
//////////////// Odds and ends
|
||||||
|
|
||||||
/*! \var const char *B_EMPTY_STRING
|
|
||||||
|
/*!
|
||||||
|
\var const char *B_EMPTY_STRING
|
||||||
\brief Defines an empty string. Currently defined as the string "".
|
\brief Defines an empty string. Currently defined as the string "".
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*! \def min_c(a,b)
|
|
||||||
|
/*!
|
||||||
|
\def min_c(a,b)
|
||||||
\brief Returns the minimum of the values a and b.
|
\brief Returns the minimum of the values a and b.
|
||||||
|
|
||||||
\note When including this header in a C file, use the C equivalent called
|
\note When including this header in a C file, use the C equivalent called
|
||||||
\c min(a,b).
|
\c min(a,b).
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*! \def max_c(a,b)
|
|
||||||
|
/*!
|
||||||
|
\def max_c(a,b)
|
||||||
\brief Returns the maximum of values a and b.
|
\brief Returns the maximum of values a and b.
|
||||||
|
|
||||||
\note When including this header in a C file, use the C equivalent called
|
\note When including this header in a C file, use the C equivalent called
|
||||||
\c max(a,b).
|
\c max(a,b).
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*! \def NULL
|
|
||||||
\brief Defines the constant \c NULL if it hasn't been defined
|
/*!
|
||||||
anywhere before.
|
\def NULL
|
||||||
|
\brief Defines the constant \c NULL if it hasn't already been defined.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/*!
|
||||||
|
\addtogroup support_globals
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*! \addtogroup support_globals */
|
|
||||||
|
|
||||||
//! @{
|
//! @{
|
||||||
|
|
||||||
|
|
||||||
/*! \fn int32 atomic_set(vint32 *value, int32 newValue)
|
/*! \fn int32 atomic_set(vint32 *value, int32 newValue)
|
||||||
\brief Atomically set the variable \a value to \a newvalue.
|
\brief Atomically set the variable \a value to \a newvalue.
|
||||||
|
|
||||||
@@ -503,11 +637,15 @@
|
|||||||
|
|
||||||
\return The original value of \c value.
|
\return The original value of \c value.
|
||||||
|
|
||||||
\sa atomic_set64() for a version that works on \c long \c long
|
\sa atomic_set64() for a version that works on \c long \c long.
|
||||||
\sa atomic_test_and_set(), atomic_add(), atomic_and(), atomic_or(),
|
\sa atomic_test_and_set()
|
||||||
atomic_get()
|
\sa atomic_add()
|
||||||
|
\sa atomic_and()
|
||||||
|
\sa atomic_or(),
|
||||||
|
\sa atomic_get()
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*! \fn int32 atomic_test_and_set(vint32 *value, int32 newValue,
|
/*! \fn int32 atomic_test_and_set(vint32 *value, int32 newValue,
|
||||||
int32 testAgainst)
|
int32 testAgainst)
|
||||||
\brief Atomically set the variable \a value to \a newValue if the current
|
\brief Atomically set the variable \a value to \a newValue if the current
|
||||||
@@ -520,11 +658,17 @@
|
|||||||
|
|
||||||
\return The original value of \c value.
|
\return The original value of \c value.
|
||||||
|
|
||||||
\sa atomic_test_and_set64() for a version that works on \c long \c long
|
\sa atomic_test_and_set64() for a version that works on \c long \c long.
|
||||||
\sa atomic_set(), atomic_add(), atomic_and(), atomic_or(), atomic_get()
|
\sa atomic_set()
|
||||||
|
\sa atomic_add()
|
||||||
|
\sa atomic_and()
|
||||||
|
\sa atomic_or()
|
||||||
|
\sa atomic_get()
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*! \fn int32 atomic_add(vint32 *value, int32 addValue)
|
|
||||||
|
/*!
|
||||||
|
\fn int32 atomic_add(vint32 *value, int32 addValue)
|
||||||
\brief Atomically add the value of \a addValue to \a value.
|
\brief Atomically add the value of \a addValue to \a value.
|
||||||
|
|
||||||
This is a thread-safe way of performing the \c *value \c += \c addValue
|
This is a thread-safe way of performing the \c *value \c += \c addValue
|
||||||
@@ -534,11 +678,15 @@
|
|||||||
|
|
||||||
\return The original value of \c value.
|
\return The original value of \c value.
|
||||||
|
|
||||||
\sa atomic_add64() for a version that works on \c long \c long
|
\sa atomic_add64() for a version that works on \c long \c long.
|
||||||
\sa atomic_set(), atomic_test_and_set(), atomic_and(), atomic_or(),
|
\sa atomic_set()
|
||||||
atomic_get()
|
\sa atomic_test_and_set()
|
||||||
|
\sa atomic_and()
|
||||||
|
\sa atomic_or()
|
||||||
|
\sa atomic_get()
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*! \fn int32 atomic_and(vint32 *value, int32 andValue)
|
/*! \fn int32 atomic_and(vint32 *value, int32 andValue)
|
||||||
\brief Atomically perform a bitwise AND operation of \a andValue to the
|
\brief Atomically perform a bitwise AND operation of \a andValue to the
|
||||||
variable \a andValue.
|
variable \a andValue.
|
||||||
@@ -550,13 +698,18 @@
|
|||||||
|
|
||||||
\return The original value of \c value.
|
\return The original value of \c value.
|
||||||
|
|
||||||
\sa atomic_and64() for a version that works on \c long \c long
|
\sa atomic_and64() for a version that works on \c long \c long.
|
||||||
\sa atomic_set(), atomic_test_and_set(), atomic_add(), atomic_or(),
|
\sa atomic_set()
|
||||||
atomic_get()
|
\sa atomic_test_and_set()
|
||||||
|
\sa atomic_add()
|
||||||
|
\sa atomic_or()
|
||||||
|
\sa atomic_get()
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*! \fn int32 atomic_or(vint32 *value, int32 orValue)
|
|
||||||
|
/*!
|
||||||
|
\fn int32 atomic_or(vint32 *value, int32 orValue)
|
||||||
\brief Atomically perform a bitwise OR operation of \a orValue to the
|
\brief Atomically perform a bitwise OR operation of \a orValue to the
|
||||||
variable \a andValue.
|
variable \a andValue.
|
||||||
|
|
||||||
@@ -567,12 +720,17 @@
|
|||||||
|
|
||||||
\return The original value of \c value.
|
\return The original value of \c value.
|
||||||
|
|
||||||
\sa atomic_or64() for a version that works on \c long \c long
|
\sa atomic_or64() for a version that works on \c long \c long.
|
||||||
\sa atomic_set(), atomic_test_and_set(), atomic_add(), atomic_and(),
|
\sa atomic_set()
|
||||||
atomic_get()
|
\sa atomic_test_and_set()
|
||||||
|
\sa atomic_add()
|
||||||
|
\sa atomic_and()
|
||||||
|
\sa atomic_get()
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*! \fn int32 atomic_get(vint32 *value)
|
|
||||||
|
/*!
|
||||||
|
\fn int32 atomic_get(vint32 *value)
|
||||||
\brief Atomically return the value of \c value.
|
\brief Atomically return the value of \c value.
|
||||||
|
|
||||||
This is a thread-safe way of reading the contents of the \c value
|
This is a thread-safe way of reading the contents of the \c value
|
||||||
@@ -582,12 +740,17 @@
|
|||||||
|
|
||||||
\return The original value of \c value.
|
\return The original value of \c value.
|
||||||
|
|
||||||
\sa atomic_get64() for a version that works on \c long \c long
|
\sa atomic_get64() for a version that works on \c long \c long.
|
||||||
\sa atomic_set(), atomic_test_and_set(), atomic_add(), atomic_and(),
|
\sa atomic_set()
|
||||||
atomic_or()
|
\sa atomic_test_and_set()
|
||||||
|
\sa atomic_add()
|
||||||
|
\sa atomic_and()
|
||||||
|
\sa atomic_or()
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*! \fn int64 atomic_set64(vint64 *value, int64 newValue)
|
|
||||||
|
/*!
|
||||||
|
\fn int64 atomic_set64(vint64 *value, int64 newValue)
|
||||||
\brief Atomically set the variable \a value to \a newvalue.
|
\brief Atomically set the variable \a value to \a newvalue.
|
||||||
|
|
||||||
This is a thread-safe way of performing the \c *value \c = \c newValue
|
This is a thread-safe way of performing the \c *value \c = \c newValue
|
||||||
@@ -597,12 +760,17 @@
|
|||||||
|
|
||||||
\return The original value of \c value.
|
\return The original value of \c value.
|
||||||
|
|
||||||
\sa atomic_set() for a version that works on an \c int32
|
\sa atomic_set() for a version that works on an \c int32.
|
||||||
\sa atomic_test_and_set64(), atomic_add64(), atomic_and64(),
|
\sa atomic_test_and_set64()
|
||||||
atomic_or64(), atomic_get64()
|
\sa atomic_add64()
|
||||||
|
\sa atomic_and64()
|
||||||
|
\sa atomic_or64()
|
||||||
|
\sa atomic_get64()
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*! \fn int64 atomic_test_and_set64(vint64 *value, int64 newValue,
|
|
||||||
|
/*!
|
||||||
|
\fn int64 atomic_test_and_set64(vint64 *value, int64 newValue,
|
||||||
int64 testAgainst)
|
int64 testAgainst)
|
||||||
\brief Atomically set the variable \a value to \a newValue if the current
|
\brief Atomically set the variable \a value to \a newValue if the current
|
||||||
value is \a testAgainst.
|
value is \a testAgainst.
|
||||||
@@ -614,12 +782,17 @@
|
|||||||
|
|
||||||
\return The original value of \c value.
|
\return The original value of \c value.
|
||||||
|
|
||||||
\sa atomic_test_and_set() for a version that works on an \c int32
|
\sa atomic_test_and_set() for a version that works on an \c int32.
|
||||||
\sa atomic_set64(), atomic_add64(), atomic_and64(),
|
\sa atomic_set64()
|
||||||
atomic_or64(), atomic_get64()
|
\sa atomic_add64()
|
||||||
|
\sa atomic_and64()
|
||||||
|
\sa atomic_or64()
|
||||||
|
\sa atomic_get64()
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*! \fn int64 atomic_add64(vint64 *value, int64 addValue)
|
|
||||||
|
/*!
|
||||||
|
\fn int64 atomic_add64(vint64 *value, int64 addValue)
|
||||||
\brief Atomically add the value of \a addValue to \a value.
|
\brief Atomically add the value of \a addValue to \a value.
|
||||||
|
|
||||||
This is a thread-safe way of performing the \c *value \c += \c addValue
|
This is a thread-safe way of performing the \c *value \c += \c addValue
|
||||||
@@ -629,12 +802,17 @@
|
|||||||
|
|
||||||
\return The original value of \c value.
|
\return The original value of \c value.
|
||||||
|
|
||||||
\sa atomic_add() for a version that works on an \c int32
|
\sa atomic_add() for a version that works on an \c int32.
|
||||||
\sa atomic_set64(), atomic_test_and_set64(), atomic_and64(),
|
\sa atomic_set64()
|
||||||
atomic_or64(), atomic_get64()
|
\sa atomic_test_and_set64()
|
||||||
|
\sa atomic_and64()
|
||||||
|
\sa atomic_or64()
|
||||||
|
\sa atomic_get64()
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*! \fn int64 atomic_and64(vint64 *value, int64 andValue)
|
|
||||||
|
/*!
|
||||||
|
\fn int64 atomic_and64(vint64 *value, int64 andValue)
|
||||||
\brief Atomically perform a bitwise AND operation of \a andValue to the
|
\brief Atomically perform a bitwise AND operation of \a andValue to the
|
||||||
variable \a andValue.
|
variable \a andValue.
|
||||||
|
|
||||||
@@ -645,11 +823,15 @@
|
|||||||
|
|
||||||
\return The original value of \c value.
|
\return The original value of \c value.
|
||||||
|
|
||||||
\sa atomic_and() for a version that works on an \c int32
|
\sa atomic_and() for a version that works on an \c int32.
|
||||||
\sa atomic_set64(), atomic_test_and_set64(), atomic_add64(),
|
\sa atomic_set64()
|
||||||
atomic_or64(), atomic_get64()
|
\sa atomic_test_and_set64()
|
||||||
|
\sa atomic_add64()
|
||||||
|
\sa atomic_or64()
|
||||||
|
\sa atomic_get64()
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*! \fn int64 atomic_or64(vint64 *value, int64 orValue)
|
/*! \fn int64 atomic_or64(vint64 *value, int64 orValue)
|
||||||
\brief Atomically perform a bitwise OR operation of \a orValue to the
|
\brief Atomically perform a bitwise OR operation of \a orValue to the
|
||||||
variable \a andValue.
|
variable \a andValue.
|
||||||
@@ -661,12 +843,17 @@
|
|||||||
|
|
||||||
\return The original value of \c value.
|
\return The original value of \c value.
|
||||||
|
|
||||||
\sa atomic_or() for a version that works on an \c int32
|
\sa atomic_or() for a version that works on an \c int32.
|
||||||
\sa atomic_set64(), atomic_test_and_set64(), atomic_add64(), atomic_and64(),
|
\sa atomic_set64()
|
||||||
atomic_get64()
|
\sa atomic_test_and_set64()
|
||||||
|
\sa atomic_add64()
|
||||||
|
\sa atomic_and64()
|
||||||
|
\sa atomic_get64()
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*! \fn int64 atomic_get64(vint64 *value)
|
|
||||||
|
/*!
|
||||||
|
\fn int64 atomic_get64(vint64 *value)
|
||||||
\brief Atomically return the value of \c value.
|
\brief Atomically return the value of \c value.
|
||||||
|
|
||||||
This is a thread-safe way of reading the contents of the \c value
|
This is a thread-safe way of reading the contents of the \c value
|
||||||
@@ -676,29 +863,43 @@
|
|||||||
|
|
||||||
\return The original value of \c value.
|
\return The original value of \c value.
|
||||||
|
|
||||||
\sa atomic_get() for a version that works on an \c int32
|
\sa atomic_get() for a version that works on an \c int32.
|
||||||
\sa atomic_set64(), atomic_test_and_set64(), atomic_add64(),
|
\sa atomic_set64()
|
||||||
atomic_and64(), atomic_or64()
|
\sa atomic_test_and_set64()
|
||||||
|
\sa atomic_add64()
|
||||||
|
\sa atomic_and64()
|
||||||
|
\sa atomic_or64()
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
//! @}
|
//! @}
|
||||||
|
|
||||||
/*! \fn void* get_stack_frame(void)
|
|
||||||
|
/*!
|
||||||
|
\fn void* get_stack_frame(void)
|
||||||
\brief Internal function.
|
\brief Internal function.
|
||||||
\internal
|
\internal
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*! \name Deprecated defines */
|
|
||||||
|
/*!
|
||||||
|
\name Deprecated defines
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
//! @{
|
//! @{
|
||||||
|
|
||||||
/*! \def FALSE
|
|
||||||
|
/*!
|
||||||
|
\def FALSE
|
||||||
\brief Obsolete. Use \c false.
|
\brief Obsolete. Use \c false.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*! \def TRUE
|
|
||||||
|
/*!
|
||||||
|
\def TRUE
|
||||||
\brief Obsolete. Use \c true.
|
\brief Obsolete. Use \c true.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
//! @}
|
|
||||||
|
|
||||||
|
//! @}
|
||||||
|
|||||||