Style cleanup patches by John Scipione from bug 7052. (Modified header to have consistent style).

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40814 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Fredrik Holmqvist 2011-03-05 15:40:24 +00:00
parent 4d15b48647
commit 62a78b3566
2 changed files with 31 additions and 56 deletions

View File

@ -26,9 +26,10 @@ Except as contained in this notice, the name of Be Incorporated shall not be
used in advertising or otherwise to promote the sale, use or other dealings in
this Software without prior written authorization from Be Incorporated.
Tracker(TM), Be(R), BeOS(R), and BeIA(TM) are trademarks or registered trademarks
of Be Incorporated in the United States and other countries. Other brand product
names are registered trademarks or trademarks of their respective holders.
Tracker(TM), Be(R), BeOS(R), and BeIA(TM) are trademarks or registered
trademarks of Be Incorporated in the United States and other countries. Other
brand product names are registered trademarks or trademarks of their respective
holders.
All rights reserved.
*/
@ -60,8 +61,6 @@ All rights reserved.
#include "PublicCommands.h"
#include "ResourceSet.h"
#include "Switcher.h"
#include "TeamMenu.h"
#include "WindowMenuItem.h"
BLocker TBarApp::sSubscriberLock;
@ -72,8 +71,8 @@ BList TBarApp::sSubscribers;
const uint32 kShowBeMenu = 'BeMn';
const uint32 kShowTeamMenu = 'TmMn';
const BRect kIconSize(0.0f, 0.0f, 15.0f, 15.0f);
const BRect kIconRect(0.0f, 0.0f, 15.0f, 15.0f);
static const color_space kIconFormat = B_RGBA32;
@ -190,26 +189,19 @@ TBarApp::SaveSettings()
storedSettings.AddFloat("width", fSettings.width);
storedSettings.AddBool("showTime", fSettings.showTime);
storedSettings.AddPoint("switcherLoc", fSettings.switcherLoc);
storedSettings.AddInt32("recentAppsCount",
fSettings.recentAppsCount);
storedSettings.AddInt32("recentDocsCount",
fSettings.recentDocsCount);
storedSettings.AddBool("timeShowSeconds",
fSettings.timeShowSeconds);
storedSettings.AddInt32("recentAppsCount", fSettings.recentAppsCount);
storedSettings.AddInt32("recentDocsCount", fSettings.recentDocsCount);
storedSettings.AddBool("timeShowSeconds", fSettings.timeShowSeconds);
storedSettings.AddInt32("recentFoldersCount",
fSettings.recentFoldersCount);
storedSettings.AddBool("alwaysOnTop", fSettings.alwaysOnTop);
storedSettings.AddBool("timeFullDate", fSettings.timeFullDate);
storedSettings.AddBool("trackerAlwaysFirst",
fSettings.trackerAlwaysFirst);
storedSettings.AddBool("sortRunningApps",
fSettings.sortRunningApps);
storedSettings.AddBool("superExpando",
fSettings.superExpando);
storedSettings.AddBool("expandNewTeams",
fSettings.expandNewTeams);
storedSettings.AddBool("autoRaise",
fSettings.autoRaise);
storedSettings.AddBool("sortRunningApps", fSettings.sortRunningApps);
storedSettings.AddBool("superExpando", fSettings.superExpando);
storedSettings.AddBool("expandNewTeams", fSettings.expandNewTeams);
storedSettings.AddBool("autoRaise", fSettings.autoRaise);
storedSettings.AddBool("recentAppsEnabled",
fSettings.recentAppsEnabled);
storedSettings.AddBool("recentDocsEnabled",
@ -291,12 +283,9 @@ TBarApp::InitSettings()
&settings.trackerAlwaysFirst);
storedSettings.FindBool("sortRunningApps",
&settings.sortRunningApps);
storedSettings.FindBool("superExpando",
&settings.superExpando);
storedSettings.FindBool("expandNewTeams",
&settings.expandNewTeams);
storedSettings.FindBool("autoRaise",
&settings.autoRaise);
storedSettings.FindBool("superExpando", &settings.superExpando);
storedSettings.FindBool("expandNewTeams", &settings.expandNewTeams);
storedSettings.FindBool("autoRaise", &settings.autoRaise);
storedSettings.FindBool("recentAppsEnabled",
&settings.recentAppsEnabled);
storedSettings.FindBool("recentDocsEnabled",
@ -313,8 +302,6 @@ TBarApp::InitSettings()
void
TBarApp::MessageReceived(BMessage* message)
{
int32 count;
bool enabled;
switch (message->what) {
case 'gloc':
case 'sloc':
@ -353,6 +340,9 @@ TBarApp::MessageReceived(BMessage* message)
break;
case kUpdateRecentCounts:
int32 count;
bool enabled;
if (message->FindInt32("applications", &count) == B_OK)
fSettings.recentAppsCount = count;
if (message->FindBool("applicationsEnabled", &enabled) == B_OK)
@ -413,44 +403,35 @@ TBarApp::MessageReceived(BMessage* message)
break;
case kAlwaysTop:
fSettings.alwaysOnTop = !fSettings.alwaysOnTop;
fSettings.alwaysOnTop = !fSettings.alwaysOnTop;
fBarWindow->SetFeel(fSettings.alwaysOnTop ?
B_FLOATING_ALL_WINDOW_FEEL : B_NORMAL_WINDOW_FEEL);
break;
fBarWindow->SetFeel(fSettings.alwaysOnTop ?
B_FLOATING_ALL_WINDOW_FEEL : B_NORMAL_WINDOW_FEEL);
break;
case kAutoRaise:
{
fSettings.autoRaise = !fSettings.autoRaise;
TBarView* barView = static_cast<TBarApp*>(be_app)->BarView();
fBarWindow->Lock();
barView->UpdateAutoRaise();
BarView()->UpdateAutoRaise();
fBarWindow->Unlock();
break;
}
case kTrackerFirst:
{
fSettings.trackerAlwaysFirst = !fSettings.trackerAlwaysFirst;
TBarView* barView = static_cast<TBarApp*>(be_app)->BarView();
fBarWindow->Lock();
barView->UpdatePlacement();
BarView()->UpdatePlacement();
fBarWindow->Unlock();
break;
}
case kSortRunningApps:
{
fSettings.sortRunningApps = !fSettings.sortRunningApps;
TBarView* barView = static_cast<TBarApp*>(be_app)->BarView();
fBarWindow->Lock();
barView->UpdatePlacement();
BarView()->UpdatePlacement();
fBarWindow->Unlock();
break;
}
case kUnsubscribe:
{
@ -461,26 +442,20 @@ TBarApp::MessageReceived(BMessage* message)
}
case kSuperExpando:
{
fSettings.superExpando = !fSettings.superExpando;
TBarView* barView = static_cast<TBarApp*>(be_app)->BarView();
fBarWindow->Lock();
barView->UpdatePlacement();
BarView()->UpdatePlacement();
fBarWindow->Unlock();
break;
}
case kExpandNewTeams:
{
fSettings.expandNewTeams = !fSettings.expandNewTeams;
TBarView* barView = static_cast<TBarApp*>(be_app)->BarView();
fBarWindow->Lock();
barView->UpdatePlacement();
BarView()->UpdatePlacement();
fBarWindow->Unlock();
break;
}
case 'TASK':
fSwitcherMessenger.SendMessage(message);
@ -640,7 +615,7 @@ TBarApp::AddTeam(team_id team, uint32 flags, const char* sig, entry_ref* ref)
name = ref->name;
BarTeamInfo* barInfo = new BarTeamInfo(new BList(), flags, strdup(sig),
new BBitmap(kIconSize, kIconFormat), strdup(name.String()));
new BBitmap(kIconRect, kIconFormat), strdup(name.String()));
barInfo->teams->AddItem((void*)team);
if (appMime.GetIcon(barInfo->icon, B_MINI_ICON) != B_OK)
@ -686,7 +661,7 @@ TBarApp::RemoveTeam(team_id team)
int32 subsCount = sSubscribers.CountItems();
if (subsCount > 0) {
BMessage message((barInfo->teams->CountItems() == 1) ?
B_SOME_APP_QUIT : kRemoveTeam);
B_SOME_APP_QUIT : kRemoveTeam);
message.AddInt32("team", team);
for (int32 i = 0; i < subsCount; i++) {
@ -710,7 +685,7 @@ TBarApp::ShowPreferencesWindow()
{
if (fPreferencesWindow)
fPreferencesWindow->Activate();
else {
else {
fPreferencesWindow = new PreferencesWindow(BRect(0, 0, 320, 240));
fPreferencesWindow->Show();
}

View File

@ -141,7 +141,7 @@ class TBarApp : public BApplication {
static void Unsubscribe(const BMessenger &subscriber);
private:
void AddTeam(team_id team, uint32 flags, const char *sig, entry_ref *);
void AddTeam(team_id team, uint32 flags, const char* sig, entry_ref*);
void RemoveTeam(team_id);
void InitSettings();