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