Merge branch 'master' into sam460ex

This commit is contained in:
François Revol
2013-01-20 23:57:00 +01:00
63 changed files with 2154 additions and 332 deletions
+2
View File
@@ -641,6 +641,7 @@ INPUT = . \
midi2 \
storage \
support \
translation \
../../headers/os/app \
../../headers/os/drivers/fs_interface.h \
../../headers/os/drivers/USB3.h \
@@ -652,6 +653,7 @@ INPUT = . \
../../headers/os/midi2 \
../../headers/os/storage \
../../headers/os/support \
../../headers/os/translation \
../../headers/posix/syslog.h \
../../src/kits/game/GameProducer.h
+10 -15
View File
@@ -26,13 +26,14 @@ body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,form,fieldset,input,textarea,
body {
color: #333333; /* mine shaft */
background-color: white;
font-size: 14.4px;
font-family: "DejaVu Sans", Arial, sans-serif;
}
h1, h2, h3, h4, h5, h6 {
color: #0c3762; /* madison */
margin-top: 0.5em;
margin-bottom: 0.5em;
margin-top: 1em;
margin-bottom: 1em;
}
h1 {
@@ -64,7 +65,6 @@ h5, h6 {
}
p {
font-size: 14.4px;
margin-top: 0.5em;
margin-bottom: 0.5em;
}
@@ -78,7 +78,6 @@ td, th {
vertical-align: top;
text-align: left;
padding: 4px;
font-size: 14.4px;
}
caption {
@@ -165,16 +164,16 @@ div.summary {
}
div.headertitle {
margin: 0 auto;
width: 59em;
}
div.headertitle div.title {
color: #0c3762; /* madison */
font-size: 1.2em;
font-size: 1.3em;
font-weight: bold;
margin-top: 0.5em;
margin-bottom: 0.5em;
border-bottom: dotted thin #c0c0c0; /* silver */
margin-top: 1em;
margin-bottom: 1em;
}
.ingroups {
@@ -252,7 +251,6 @@ div.contents {
}
div.contents ul, div.contents ol {
font-size: 14.4px;
line-height: 1.3;
}
@@ -295,7 +293,6 @@ div.contents span.keycap, div.contents span.keysym {
}
div.contents div.textblock {
width: 95%;
margin-bottom: 20px;
}
@@ -313,7 +310,7 @@ div.contents li {
}
div.contents dd {
font-size: 14.4px;
font-size: 12px;
}
div.contents dt {
@@ -323,13 +320,12 @@ div.contents dt {
/* The boxes from the userguide */
dl.note, dl.remark, dl.warning, dl.attention {
width: 100%;
border-style: solid;
border-width: 2px;
margin-top: 24px;
margin-bottom: 24px;
padding: 4px;
min-height: 64px;
min-height: 48px;
}
dl.note {
@@ -685,11 +681,10 @@ div.memproto {
padding: 4px;
background-color: #f3f3f3; /* concrete */
border: 1px solid #c0c0c0; /* silver */
font-size: 13px;
}
div.memproto table {
font-size: 13px;
font-size: 14.4px;
}
/* member table */
+7
View File
@@ -52,6 +52,8 @@
retrieving information from disk.
- The \ref support contains support classes to use in your application
including resources for thread safety, IO, and serialization.
- The \ref translation provides a framework for converting data streams
between media formats.
\section special_topics Special Topics
@@ -543,6 +545,11 @@ snooze_until(time - Latency(), B_SYSTEM_TIMEBASE);
- Error codes for all kits
\defgroup translation Translation Kit
\brief Provides a framework for converting data streams between media
formats.
\defgroup libbe (libbe.so)
File diff suppressed because it is too large Load Diff
+83 -10
View File
@@ -91,15 +91,79 @@
An open dialog looks similar but doesn't have a text box for the file name.
Creating a basic open or save panel is easy:
You generally construct a BFilePanel object in response to a user action
for example the user clicks on a "Open" or "Save"/"Save As" menu item.
Constructing an open or save panel is easy:
\code
BFilePanel* openPanel = new BFilePanel(B_OPEN_PANEL);
BFilePanel* savePanel = new BFilePanel(B_SAVE_PANEL);
\endcode
There are many options but they can generally be set after the object has
been constructed.
You can then call methods to indicate what directory to display, whether
or not multiple selections are allowed, whether or not the user is
allowed to open a directory, what target view to send send notifications,
and more. See the constructor for details.
You can modify the look of your BFilePanel object by calling the
SetButtonLabel() and SetSaveText() methods. If you want to change the look
even more radically you can get alter the panel's BWindow and BView
objects. You get the window by calling the Window() method. With a pointer
to the panel's BWindow object you can drill down to the various views
contained therein.
Once you have constructed and customized your BFilePanel object you should
call the Show() method to display the panel to the user.
When the user confirms or cancels a BMessage object is constructed and sent
to the target of the BFilePanel object. You can specify a different
target in the constructor or by calling the SetTarget() method.
<b>Open Notifications</b>
For open notifications the default target is \c be_app_messenger and is
caught by the RefsReceived() method The \c what field is set to
\c B_REFS_RECEIVED. You can set your own message by calling the
SetMessage() method; in this case the message will be sent to the target's
MessageReceived() method instead.
The \c refs field of the message contains an \c entry_ref structure
for each entry that the user has selected. The \c refs field is of
type \c B_REF_TYPE. If the selected entry is a symlink to a file you'll
need to dereference the file yourself. You can do this more easily by
turning the \c ref into a BEntry passing \c true into the \c traverse
argument like this:
\code
BEntry entry(ref, true);
\endcode
<b>Save Notifications</b>
Save notifications are always sent to the target's MessageReceived()
method unlike open notifications. The \c what field of the message is
set to \c B_SAVE_REQUESTED. The \c directory field contain a single
\c entry_ref structure that points to the directory that the entry is
saved to. The text that the user typed in the save panel's text view
is put in the \c name field and is of type \c B_STRING_TYPE.
<b>Cancel Notifications</b>
Cancel notifications are sent when the panel is hidden whether by the
user clicking the cancel button, closing the dialog, or confirming the
action (assuming hide-when-done is turned on).
Cancel notifications can be caught by the MessageReceived() method of
the target. The \c what field is set to \c B_CANCEL. The \c old_what
field is set to the previous what value which is useful if you have
overridden the default message. The \c what field of the message you
sent is put in the \c old_what field.
The \c source field is a pointer of \c B_POINTER_TYPE to the closed
BFilePanel object. When the BFilePanel object is closed it is not
destroyed, it is hidden instead. You can then delete the BFilePanel
object or leave it be and simply call Show() to use the panel next time
you need it.
*/
@@ -109,18 +173,27 @@
BMessage* message, BRefFilter* filter, bool modal, bool hideWhenDone)
\brief Creates and initializes a BFilePanel object.
The panel is not displayed until call the Show() method.
The constructor has many parameters but they may generally be set after
the object has been constructed. The only parameters that must be set
during construction are the \a mode, \a nodeFlavors, \a multipleSelection,
and \a modal parameters. The rest may be set after the object has been
constructed by the SetTarget(), SetPanelDirectory(), SetMessage(),
SetRefFilter(), and SetHideWhenDone() methods.
\param mode Either \c B_OPEN_PANEL or \c B_SAVE_PANEL.
\param mode Set to \c B_OPEN_PANEL for an open panal or \c B_SAVE_PANEL
for a save panel. Default is \c B_OPEN_PANEL.
\param target The BMessenger object that sends messages to the BLooper
or BHandler controlled by the file panel.
\param ref The directory to display, by default the current working
directory.
\param nodeFlavors Option flags, this applies to open panels only.
\param multipleSelection Determines whether or not the user is allowed
to select more than one item.
\param message Override the default message sent by the file panel.
\param filter Filter Hook function to call.
\param nodeFlavors One or more option flags, this applies to open panels only.
- \c B_FILE_NODE Can select files and symlinks to files.
- \c B_DIRECTORY_NODE Can select directories and symlinks to directories.
- \c B_SYMLINK_NODE Can select symlinks only.
\param multipleSelection Whether or not the user is allowed to select more
than one item to open. Save panels should always set this to \c false.
\param message Message sent by the file panel on confirms or cancels.
\param filter Hook method to call.
\param modal Whether or not the panel is modal, defaults to \c false.
\param hideWhenDone Set to \c false to keep the panel even after the user
confirms or cancels. The close button will hide the panel regardless.
+170
View File
@@ -0,0 +1,170 @@
/*
* Copyright 2002-2013 Haiku Inc.
* Distributed under the terms of the MIT License.
*
* Documentation by:
* John Scipione <[email protected]>
* Travis Smith
* Michael Wilber
* Corresponds to:
* /trunk/headers/os/translation/BitmapStream.h hrev45181
* /trunk/src/kits/translation/BitmapStream.cpp hrev45181
*/
/*!
\file BitmapStream.h
\brief BBitmapStream class definition.
*/
/*!
\class BBitmapStream
\ingroup translation
\ingroup libbe
\brief Provides for the conversion of a Translation Kit bitmap object to
a BBitmap.
BBitmapStream is limited subclass of BPositionIO that is good at reading
and writing Translation Kit bitmaps. The DetachBitmap() method
is the main method of this class as it returns the contents of the
Translation Kit bitmap object into a BBitmap.
In most cases you shouldn't have to use this class directly as
BTranslationUtils contains methods to load images from files and
resources.
*/
/*!
\fn BBitmapStream::BBitmapStream(BBitmap* bitmap)
\brief Initializes this object to either use the BBitmap passed to
it as the object to read/write to or to create a BBitmap when data
is written to this object.
If \a bitmap is \c NULL, a new BBitmap object is created when this object
is written to.
\param bitmap The bitmap object to read from/write to.
*/
/*!
\fn void BBitmapStream::~BBitmapStream()
\brief Destroys the object and the BBitmap object if attached.
*/
/*!
\fn ssize_t BBitmapStream::ReadAt(off_t pos, void* buffer, size_t size)
\brief Reads data from the stream into \a buffer at a specific position
and size.
The first sizeof(TranslatorBitmap) bytes are the bitmap header. The header
is always written out and read in as big endian byte order.
\param pos The position in the stream to read from.
\param buffer Where the data will be read into
\param size The amount of data to be read.
\return The amount of data written if the result is >= 0 or an error code.
\retval B_BAD_VALUE \a buffer is \c NULL or \a pos is invalid or the amount
read if the result >= 0
\retval B_NO_INIT There is no bitmap stored by the stream.
*/
/*!
\fn ssize_t BBitmapStream::WriteAt(off_t pos, const void* data,
size_t size)
\brief Writes data to the bitmap starting at a specific position and size.
The first sizeof(TranslatorBitmap) bytes of data must be the
TranslatorBitmap header in big endian byte order or the data
will not be written.
\param pos The position in the stream to write to \a data.
\param data The data to write to the stream.
\param size The size of the data to write to the stream.
\return The amount of data written if the result is >= 0 or an error code.
\retval B_BAD_VALUE Size is bad or data is \c NULL or \a pos is invalid.
\retval B_MISMATCHED_VALUES The bitmap header is bad.
\retval B_ERROR Error allocating memory or setting up big endian header,
*/
/*!
\fn off_t BBitmapStream::Seek(off_t position, uint32 seekMode)
\brief Changes the current stream position.
\param position The position offset.
\param seekMode Decides how the position offset is used:
- \c SEEK_CUR Position is added to current stream position.
- \c SEEK_END Position is added to the end stream position.
- \c SEEK_SET The stream position is set to position.
\return The new position offset if the result >= 0.
\retval B_BAD_VALUE \a position was bad.
*/
/*!
\fn off_t BBitmapStream::Position() const
\brief Gets the current stream position.
\returns The current stream position.
*/
/*!
\fn off_t BBitmapStream::Size() const
\brief Gets the current stream size.
\returns The current stream size.
*/
/*!
\fn status_t BBitmapStream::SetSize(off_t size)
\brief Sets the size of the data.
\param size The size to set the stream size to.
\return A status code, \c B_NO_ERROR on success or an error code.
\retval B_NO_ERROR (or \c B_OK) Size is a valid value.
\retval B_BAD_VALUE \a size is NOT a valid value.
*/
/*!
\fn status_t BBitmapStream::DetachBitmap(BBitmap** _bitmap)
\brief Sets \a _bitmap to point to the internal bitmap object.
The bitmap is not deleted when the BBitmapStream is deleted. After the
bitmap has been detached it is still used by the stream, but it is never
deleted by the stream.
Once you have called DetachBitmap() no further operations should be
performed on the BBitmapStream except to destroy the object.
\param _bitmap A BBitmap pointer that will be set to point to the internal
bitmap object.
\return A status code, \c B_OK on success or an error code.
\retval B_OK The bitmap was detached.
\retval B_BAD_VALUE _bitmap is \c NULL.
\retval B_ERROR The internal bitmap object is \c NULL or has already been
detached.
*/
/*!
\fn void BBitmapStream::SwapHeader(const TranslatorBitmap* source,
TranslatorBitmap* destination)
\brief Swaps the byte order of \a source, no matter the byte order, and
copies the result to \a destination.
\param source Data to be swapped.
\param destination Where the swapped data will be copied to.
*/