Developer Release Notes: BeOS Release 4, The App Kit
Developer Release Notes
BeOS Release 4
Bug Fixes
-
BMessage::FindRef() now reports
B_NAME_NOT_FOUND when it can't find an entry_ref field with
the given name (within the message).
It used to return B_ERROR.
-
When you re-launch a B_EXCLUSIVE_LAUNCH application from the command line,
the command line arguments are sent to the already-running app in a
B_ARGV_RECEIVED message, as they should be.
In R3, the message wasn't
sent.
- The race condition between (a) finding a BHandler's looper and (b) locking the looper has been squished with the new BHandler::LockLooper() function. See BHandler, below.
BApplication
- New static AppResources()
function returns the BResources
object for your application -- even if you don't have a
be_app object.
- BApplication now archives its pulse rate.
BClipboard
- New Revert() function refreshes a BClipboard's local data by re-reading it from the underlying clipboard. You use this function if you make a change to your BClipboard's data (the BMessage returned by Data()), but then decide to back out of the change. In other words, you call Revert() rather than Commit().
BHandler
-
The new
LockLooper()
function finds a BHandler's
looper and locks it in a single atomic action.
There's also
a version with a timeout:
LockLooperWithTimeout()
You use the function if you are finding a BHandler's looper simply to lock it. This is a common practice over in the window world:
/* DON'T DO THIS ANYMORE */
window = view->Window();
if (window->Lock()) {
...
window->Unlock();
}/* DO THIS INSTEAD */
if (view->LockLooper()) {
...
view->UnlockLooper();
} - As shown here, there's also a complementary UnlockLooper() function.
BMessage
- A new version of SendReply() lets you set the target of the reply as a BMessenger object.
BMessageRunner
- New BMessageRunner class is like a combination of BInvoker and Pulse(): It repeatedly sends a message to a target.
BMessenger
- A new version of SendMessage() lets you set the target of the reply as a BMessenger object.
BPropertyInfo
- The
BPropertyInfo constructor
has an new
value_info
array argument. The
array supplies information
about the values (commands and data) that the scripting suite
recognizes:
struct value_info {
char *name;
uint32 value;
value_kind kind;
char *usage;
uint32 extra_data;
};The most important use of the value_info structure is to augment a suite's list of recognized commands. Your scriptable app is no longer limited to the set of commands (B_SET_PROPERTY, B_GET_PROPERTY, and so on) provided by Be.
- The new Properties()
function
replaces the old PropertyInfo() function.
- The property_info
struct
has been augmented to carry type information:
struct property_info {
char *name;
uint32 commands[10];
uint32 specifiers[10];
char *usage;
uint32 extra_data;
uint32 types[10];//New
compound_type ctypes[3]; //New
};For more information, including the definition of the new compound_type structure, see the BPropertyInfo documentation.
- The new Values() function
returns a list of value_info
structures (as set in the constructor).
- The new CountProperties() and CountValues() functions do what they say.
BRoster
- New
StartWatching() and
StopWatching()
functions let your
application register
for notifications of changes to the Roster's list of apps.
You can ask to be told
when apps are launched, activated, and quit by passing the following
as the second argument to StartWatching():
- B_REQUEST_LAUNCHED
- B_REQUEST_ACTIVATED
- B_REQUEST_QUIT
The Roster tells you about these events by sending a message to your designated messenger (the first argument to StartWatching()). The command constants are:
- B_SOME_APP_LAUNCHED
- B_SOME_APP_ACTIVATED
- B_SOME_APP_QUIT
The message format is the same regardless of the type of activity that's being reported:
Field Type Meaning "be:signature" B_STRING_TYPE The application signature. "be:team" B_INT32_TYPE The app's team id. "be:thread" B_INT32_TYPE The id of the app's main thread. "be:flags" B_INT32_TYPE The app's app flags. "be:ref" B_REF_TYPE The entry_ref of the app's executable file. - A new version of Broadcast() lets you set the target of the reply as a BMessenger object.
Copyright © 1998 Be, Inc. All rights reserved.