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
+2 -2
View File
@@ -151,8 +151,8 @@ private:
BWindow* window_at(uint32 index, bool incl_menus) const; BWindow* window_at(uint32 index, bool incl_menus) const;
status_t get_window_list(BList* list, bool incl_menus) const; status_t get_window_list(BList* list, bool incl_menus) const;
static int32 async_quit_entry(void*); static int32 async_quit_entry(void*);
static BResources* _app_resources; static BResources* sAppResources;
static BLocker _app_resources_lock; static BLocker sAppResourcesLock;
const char* fAppName; const char* fAppName;
BPrivate::PortLink* fServerLink; BPrivate::PortLink* fServerLink;
+9 -20
View File
@@ -44,8 +44,8 @@ using namespace BPrivate;
BApplication *be_app = NULL; BApplication *be_app = NULL;
BMessenger be_app_messenger; BMessenger be_app_messenger;
BResources *BApplication::_app_resources = NULL; BResources *BApplication::sAppResources = NULL;
BLocker BApplication::_app_resources_lock("_app_resources_lock"); BLocker BApplication::sAppResourcesLock("_app_resources_lock");
static property_info sPropertyInfo[] = { static property_info sPropertyInfo[] = {
@@ -566,12 +566,8 @@ BApplication::MessageReceived(BMessage *message)
BMessage specifier; BMessage specifier;
int32 what; int32 what;
const char *property = NULL; const char *property = NULL;
bool scriptHandled = false; if (message->GetCurrentSpecifier(&index, &specifier, &what, &property) < B_OK)
if (message->GetCurrentSpecifier(&index, &specifier, &what, &property) == B_OK) { || !ScriptReceived(message, index, &specifier, what, property))
if (ScriptReceived(message, index, &specifier, what, property))
scriptHandled = true;
}
if (!scriptHandled)
BLooper::MessageReceived(message); BLooper::MessageReceived(message);
break; break;
} }
@@ -761,15 +757,12 @@ BApplication::GetAppInfo(app_info *info) const
BResources * BResources *
BApplication::AppResources() BApplication::AppResources()
{ {
if (!_app_resources_lock.Lock()) BObjectLocker<BLocker> lock(sAppResourcesLock);
return NULL;
// BApplication caches its resources, so check // BApplication caches its resources, so check
// if it already happened. // if it already happened.
if (_app_resources != NULL) { if (sAppResources != NULL)
_app_resources_lock.Unlock(); return sAppResources;
return _app_resources;
}
entry_ref ref; entry_ref ref;
bool found = false; bool found = false;
@@ -792,13 +785,11 @@ BApplication::AppResources()
if (resources->SetTo(&file, false) < B_OK) if (resources->SetTo(&file, false) < B_OK)
delete resources; delete resources;
else else
_app_resources = resources; sAppResources = resources;
} }
} }
_app_resources_lock.Unlock(); return sAppResources;
return _app_resources;
} }
@@ -878,8 +869,6 @@ BApplication::DispatchMessage(BMessage *message, BHandler *handler)
} }
// TODO: Handle these as well // TODO: Handle these as well
// These two are handled by BTextView classes, so
// BApplication probably forwards these messages to them.
case _DISPOSE_DRAG_: case _DISPOSE_DRAG_:
case _PING_: case _PING_:
puts("not yet handled message:"); puts("not yet handled message:");
+9 -9
View File
@@ -673,7 +673,8 @@ BMessage: what = (0x0, or 0)
status_t status_t
BHandler::StartWatching(BMessenger messenger, uint32 what) BHandler::StartWatching(BMessenger messenger, uint32 what)
{ {
fObserverList ? fObserverList : fObserverList = new _ObserverList; if (fObserverList == NULL)
fObserverList = new _ObserverList;
return fObserverList->StartObserving(messenger, what); return fObserverList->StartObserving(messenger, what);
} }
@@ -681,15 +682,15 @@ BHandler::StartWatching(BMessenger messenger, uint32 what)
status_t status_t
BHandler::StartWatchingAll(BMessenger messenger) BHandler::StartWatchingAll(BMessenger messenger)
{ {
fObserverList ? fObserverList : fObserverList = new _ObserverList; return StartWatching(messenger, B_OBSERVER_OBSERVE_ALL);
return fObserverList->StartObserving(messenger, B_OBSERVER_OBSERVE_ALL);
} }
status_t status_t
BHandler::StopWatching(BMessenger messenger, uint32 what) BHandler::StopWatching(BMessenger messenger, uint32 what)
{ {
fObserverList ? fObserverList : fObserverList = new _ObserverList; if (fObserverList == NULL)
fObserverList = new _ObserverList;
return fObserverList->StopObserving(messenger, what); return fObserverList->StopObserving(messenger, what);
} }
@@ -697,8 +698,7 @@ BHandler::StopWatching(BMessenger messenger, uint32 what)
status_t status_t
BHandler::StopWatchingAll(BMessenger messenger) BHandler::StopWatchingAll(BMessenger messenger)
{ {
fObserverList ? fObserverList : fObserverList = new _ObserverList; return StopWatching(messenger, B_OBSERVER_OBSERVE_ALL);
return fObserverList->StopObserving(messenger, B_OBSERVER_OBSERVE_ALL);
} }
@@ -721,7 +721,8 @@ BHandler::StartWatchingAll(BHandler *handler)
status_t status_t
BHandler::StopWatching(BHandler *handler, uint32 what) BHandler::StopWatching(BHandler *handler, uint32 what)
{ {
fObserverList ? fObserverList : fObserverList = new _ObserverList; if (fObserverList == NULL)
fObserverList = new _ObserverList;
return fObserverList->StopObserving(handler, what); return fObserverList->StopObserving(handler, what);
} }
@@ -729,8 +730,7 @@ BHandler::StopWatching(BHandler *handler, uint32 what)
status_t status_t
BHandler::StopWatchingAll(BHandler *handler) BHandler::StopWatchingAll(BHandler *handler)
{ {
fObserverList ? fObserverList : fObserverList = new _ObserverList; return StopWatching(handler, B_OBSERVER_OBSERVE_ALL);
return fObserverList->StopObserving(handler, B_OBSERVER_OBSERVE_ALL);
} }
+4 -9
View File
@@ -1538,17 +1538,15 @@ BTextView::GetSelection(int32 *outStart, int32 *outEnd) const
void void
BTextView::SetFontAndColor(const BFont *inFont, uint32 inMode, BTextView::SetFontAndColor(const BFont *inFont, uint32 inMode, const rgb_color *inColor)
const rgb_color *inColor)
{ {
SetFontAndColor(fSelStart, fSelEnd, inFont, inMode, inColor); SetFontAndColor(fSelStart, fSelEnd, inFont, inMode, inColor);
} }
void void
BTextView::SetFontAndColor(int32 startOffset, int32 endOffset, BTextView::SetFontAndColor(int32 startOffset, int32 endOffset, const BFont *inFont,
const BFont *inFont, uint32 inMode, uint32 inMode, const rgb_color *inColor)
const rgb_color *inColor)
{ {
CALLED(); 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.SetSize(array->styles[i].size);
run_array->runs[i].font.SetShear(array->styles[i].shear); run_array->runs[i].font.SetShear(array->styles[i].shear);
run_array->runs[i].font.SetFace(array->styles[i].face); 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 = array->styles[i];
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;
} }
if (outSize) if (outSize)
+1 -1
View File
@@ -3556,7 +3556,7 @@ BView::ResolveSpecifier(BMessage *msg, int32 index, BMessage *specifier,
BMessage replyMsg(B_MESSAGE_NOT_UNDERSTOOD); BMessage replyMsg(B_MESSAGE_NOT_UNDERSTOOD);
replyMsg.AddInt32("error", B_NAME_NOT_FOUND); 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); msg->SendReply(&replyMsg);
return NULL; return NULL;
} }