Misc style changes

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15243 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Stefano Ceccherini 2005-11-30 17:56:56 +00:00
parent dd43887c95
commit 17adbf1f0c
5 changed files with 26 additions and 42 deletions

View File

@ -151,8 +151,8 @@ private:
BWindow* window_at(uint32 index, bool incl_menus) const;
status_t get_window_list(BList* list, bool incl_menus) const;
static int32 async_quit_entry(void*);
static BResources* _app_resources;
static BLocker _app_resources_lock;
static BResources* sAppResources;
static BLocker sAppResourcesLock;
const char* fAppName;
BPrivate::PortLink* fServerLink;

View File

@ -44,8 +44,8 @@ using namespace BPrivate;
BApplication *be_app = NULL;
BMessenger be_app_messenger;
BResources *BApplication::_app_resources = NULL;
BLocker BApplication::_app_resources_lock("_app_resources_lock");
BResources *BApplication::sAppResources = NULL;
BLocker BApplication::sAppResourcesLock("_app_resources_lock");
static property_info sPropertyInfo[] = {
@ -566,12 +566,8 @@ BApplication::MessageReceived(BMessage *message)
BMessage specifier;
int32 what;
const char *property = NULL;
bool scriptHandled = false;
if (message->GetCurrentSpecifier(&index, &specifier, &what, &property) == B_OK) {
if (ScriptReceived(message, index, &specifier, what, property))
scriptHandled = true;
}
if (!scriptHandled)
if (message->GetCurrentSpecifier(&index, &specifier, &what, &property) < B_OK)
|| !ScriptReceived(message, index, &specifier, what, property))
BLooper::MessageReceived(message);
break;
}
@ -761,15 +757,12 @@ BApplication::GetAppInfo(app_info *info) const
BResources *
BApplication::AppResources()
{
if (!_app_resources_lock.Lock())
return NULL;
BObjectLocker<BLocker> lock(sAppResourcesLock);
// BApplication caches its resources, so check
// if it already happened.
if (_app_resources != NULL) {
_app_resources_lock.Unlock();
return _app_resources;
}
if (sAppResources != NULL)
return sAppResources;
entry_ref ref;
bool found = false;
@ -792,13 +785,11 @@ BApplication::AppResources()
if (resources->SetTo(&file, false) < B_OK)
delete resources;
else
_app_resources = resources;
sAppResources = resources;
}
}
_app_resources_lock.Unlock();
return _app_resources;
return sAppResources;
}
@ -878,8 +869,6 @@ BApplication::DispatchMessage(BMessage *message, BHandler *handler)
}
// TODO: Handle these as well
// These two are handled by BTextView classes, so
// BApplication probably forwards these messages to them.
case _DISPOSE_DRAG_:
case _PING_:
puts("not yet handled message:");

View File

@ -673,7 +673,8 @@ BMessage: what = (0x0, or 0)
status_t
BHandler::StartWatching(BMessenger messenger, uint32 what)
{
fObserverList ? fObserverList : fObserverList = new _ObserverList;
if (fObserverList == NULL)
fObserverList = new _ObserverList;
return fObserverList->StartObserving(messenger, what);
}
@ -681,15 +682,15 @@ BHandler::StartWatching(BMessenger messenger, uint32 what)
status_t
BHandler::StartWatchingAll(BMessenger messenger)
{
fObserverList ? fObserverList : fObserverList = new _ObserverList;
return fObserverList->StartObserving(messenger, B_OBSERVER_OBSERVE_ALL);
return StartWatching(messenger, B_OBSERVER_OBSERVE_ALL);
}
status_t
BHandler::StopWatching(BMessenger messenger, uint32 what)
{
fObserverList ? fObserverList : fObserverList = new _ObserverList;
if (fObserverList == NULL)
fObserverList = new _ObserverList;
return fObserverList->StopObserving(messenger, what);
}
@ -697,8 +698,7 @@ BHandler::StopWatching(BMessenger messenger, uint32 what)
status_t
BHandler::StopWatchingAll(BMessenger messenger)
{
fObserverList ? fObserverList : fObserverList = new _ObserverList;
return fObserverList->StopObserving(messenger, B_OBSERVER_OBSERVE_ALL);
return StopWatching(messenger, B_OBSERVER_OBSERVE_ALL);
}
@ -721,7 +721,8 @@ BHandler::StartWatchingAll(BHandler *handler)
status_t
BHandler::StopWatching(BHandler *handler, uint32 what)
{
fObserverList ? fObserverList : fObserverList = new _ObserverList;
if (fObserverList == NULL)
fObserverList = new _ObserverList;
return fObserverList->StopObserving(handler, what);
}
@ -729,8 +730,7 @@ BHandler::StopWatching(BHandler *handler, uint32 what)
status_t
BHandler::StopWatchingAll(BHandler *handler)
{
fObserverList ? fObserverList : fObserverList = new _ObserverList;
return fObserverList->StopObserving(handler, B_OBSERVER_OBSERVE_ALL);
return StopWatching(handler, B_OBSERVER_OBSERVE_ALL);
}

View File

@ -1538,17 +1538,15 @@ BTextView::GetSelection(int32 *outStart, int32 *outEnd) const
void
BTextView::SetFontAndColor(const BFont *inFont, uint32 inMode,
const rgb_color *inColor)
BTextView::SetFontAndColor(const BFont *inFont, uint32 inMode, const rgb_color *inColor)
{
SetFontAndColor(fSelStart, fSelEnd, inFont, inMode, inColor);
}
void
BTextView::SetFontAndColor(int32 startOffset, int32 endOffset,
const BFont *inFont, uint32 inMode,
const rgb_color *inColor)
BTextView::SetFontAndColor(int32 startOffset, int32 endOffset, const BFont *inFont,
uint32 inMode, const rgb_color *inColor)
{
CALLED();
@ -2679,10 +2677,7 @@ BTextView::UnflattenRunArray(const void *data, int32 *outSize)
run_array->runs[i].font.SetSize(array->styles[i].size);
run_array->runs[i].font.SetShear(array->styles[i].shear);
run_array->runs[i].font.SetFace(array->styles[i].face);
run_array->runs[i].color.red = array->styles[i].red;
run_array->runs[i].color.green = array->styles[i].green;
run_array->runs[i].color.blue = array->styles[i].blue;
run_array->runs[i].color.alpha = array->styles[i].alpha;
run_array->runs[i].color = array->styles[i];
}
if (outSize)

View File

@ -3556,7 +3556,7 @@ BView::ResolveSpecifier(BMessage *msg, int32 index, BMessage *specifier,
BMessage replyMsg(B_MESSAGE_NOT_UNDERSTOOD);
replyMsg.AddInt32("error", B_NAME_NOT_FOUND);
replyMsg.AddString("message", "This window doesn't have a self");
replyMsg.AddString("message", "This window doesn't have a shelf");
msg->SendReply(&replyMsg);
return NULL;
}