App Server: Style fixes only

* 80 char limit fixes
* remove leading tabs/spaces
* Add some helpful pragmas
* Add some newlines to separate stuff
* Compare pointers to NULL explicitly
This commit is contained in:
John Scipione
2014-01-30 19:48:35 -05:00
parent 27b7673793
commit 3779f5cff7
3 changed files with 45 additions and 14 deletions
+3 -3
View File
@@ -246,8 +246,8 @@ public:
LinearSpec* GetLinearSpec() { return &fLinearSpec; } LinearSpec* GetLinearSpec() { return &fLinearSpec; }
/*! Create a new WindowArea from the crossing and add the window. */ /*! Create a new WindowArea from the crossing and add the window. */
bool AddWindow(SATWindow* window, Tab* left, Tab* top, bool AddWindow(SATWindow* window, Tab* left,
Tab* right, Tab* bottom); Tab* top, Tab* right, Tab* bottom);
/*! Add a window to an existing window area. */ /*! Add a window to an existing window area. */
bool AddWindow(SATWindow* window, WindowArea* area, bool AddWindow(SATWindow* window, WindowArea* area,
SATWindow* after = NULL); SATWindow* after = NULL);
@@ -259,7 +259,7 @@ public:
SATWindow* WindowAt(int32 index); SATWindow* WindowAt(int32 index);
const WindowAreaList& GetAreaList() { return fWindowAreaList; } const WindowAreaList& GetAreaList() { return fWindowAreaList; }
/*! \return a sorted tab list. */ /*! \return a sorted tab list. */
const TabList* HorizontalTabs(); const TabList* HorizontalTabs();
const TabList* VerticalTabs(); const TabList* VerticalTabs();
+40 -8
View File
@@ -22,6 +22,9 @@
using namespace std; using namespace std;
// #pragma mark - StackAndTile
StackAndTile::StackAndTile() StackAndTile::StackAndTile()
: :
fDesktop(NULL), fDesktop(NULL),
@@ -329,6 +332,7 @@ StackAndTile::WindowActivated(Window* window)
SATWindow* satWindow = GetSATWindow(window); SATWindow* satWindow = GetSATWindow(window);
if (satWindow == NULL) if (satWindow == NULL)
return; return;
_ActivateWindow(satWindow); _ActivateWindow(satWindow);
} }
@@ -339,9 +343,11 @@ StackAndTile::WindowSentBehind(Window* window, Window* behindOf)
SATWindow* satWindow = GetSATWindow(window); SATWindow* satWindow = GetSATWindow(window);
if (satWindow == NULL) if (satWindow == NULL)
return; return;
SATGroup* group = satWindow->GetGroup(); SATGroup* group = satWindow->GetGroup();
if (group == NULL) if (group == NULL)
return; return;
Desktop* desktop = satWindow->GetWindow()->Desktop(); Desktop* desktop = satWindow->GetWindow()->Desktop();
if (desktop == NULL) if (desktop == NULL)
return; return;
@@ -363,9 +369,11 @@ StackAndTile::WindowWorkspacesChanged(Window* window, uint32 workspaces)
SATWindow* satWindow = GetSATWindow(window); SATWindow* satWindow = GetSATWindow(window);
if (satWindow == NULL) if (satWindow == NULL)
return; return;
SATGroup* group = satWindow->GetGroup(); SATGroup* group = satWindow->GetGroup();
if (group == NULL) if (group == NULL)
return; return;
Desktop* desktop = satWindow->GetWindow()->Desktop(); Desktop* desktop = satWindow->GetWindow()->Desktop();
if (desktop == NULL) if (desktop == NULL)
return; return;
@@ -387,9 +395,11 @@ StackAndTile::WindowHidden(Window* window, bool fromMinimize)
SATWindow* satWindow = GetSATWindow(window); SATWindow* satWindow = GetSATWindow(window);
if (satWindow == NULL) if (satWindow == NULL)
return; return;
SATGroup* group = satWindow->GetGroup(); SATGroup* group = satWindow->GetGroup();
if (group == NULL) if (group == NULL)
return; return;
if (fromMinimize == false && group->CountItems() > 1) if (fromMinimize == false && group->CountItems() > 1)
group->RemoveWindow(satWindow, false); group->RemoveWindow(satWindow, false);
} }
@@ -401,9 +411,11 @@ StackAndTile::WindowMinimized(Window* window, bool minimize)
SATWindow* satWindow = GetSATWindow(window); SATWindow* satWindow = GetSATWindow(window);
if (satWindow == NULL) if (satWindow == NULL)
return; return;
SATGroup* group = satWindow->GetGroup(); SATGroup* group = satWindow->GetGroup();
if (group == NULL) if (group == NULL)
return; return;
Desktop* desktop = satWindow->GetWindow()->Desktop(); Desktop* desktop = satWindow->GetWindow()->Desktop();
if (desktop == NULL) if (desktop == NULL)
return; return;
@@ -455,11 +467,13 @@ StackAndTile::WindowFeelChanged(Window* window, window_feel feel)
if (feel == B_NORMAL_WINDOW_FEEL) if (feel == B_NORMAL_WINDOW_FEEL)
return; return;
SATWindow* satWindow = GetSATWindow(window); SATWindow* satWindow = GetSATWindow(window);
if (!satWindow) if (satWindow == NULL)
return; return;
SATGroup* group = satWindow->GetGroup(); SATGroup* group = satWindow->GetGroup();
if (!group) if (group == NULL)
return; return;
if (group->CountItems() > 1) if (group->CountItems() > 1)
group->RemoveWindow(satWindow, false); group->RemoveWindow(satWindow, false);
} }
@@ -521,10 +535,14 @@ StackAndTile::FindSATWindow(uint64 id)
if (window->Id() == id) if (window->Id() == id)
return window; return window;
} }
return NULL; return NULL;
} }
// #pragma mark - StackAndTile private methods
void void
StackAndTile::_StartSAT() StackAndTile::_StartSAT()
{ {
@@ -534,7 +552,7 @@ StackAndTile::_StartSAT()
// Remove window from the group. // Remove window from the group.
SATGroup* group = fCurrentSATWindow->GetGroup(); SATGroup* group = fCurrentSATWindow->GetGroup();
if (!group) if (group == NULL)
return; return;
group->RemoveWindow(fCurrentSATWindow, false); group->RemoveWindow(fCurrentSATWindow, false);
@@ -560,15 +578,21 @@ StackAndTile::_StopSAT()
void void
StackAndTile::_ActivateWindow(SATWindow* satWindow) StackAndTile::_ActivateWindow(SATWindow* satWindow)
{ {
if (satWindow == NULL)
return;
SATGroup* group = satWindow->GetGroup(); SATGroup* group = satWindow->GetGroup();
if (!group) if (group == NULL)
return; return;
Desktop* desktop = satWindow->GetWindow()->Desktop(); Desktop* desktop = satWindow->GetWindow()->Desktop();
if (!desktop) if (desktop == NULL)
return; return;
WindowArea* area = satWindow->GetWindowArea(); WindowArea* area = satWindow->GetWindowArea();
if (!area) if (area == NULL)
return; return;
area->MoveToTopLayer(satWindow); area->MoveToTopLayer(satWindow);
const WindowAreaList& areas = group->GetAreaList() ; const WindowAreaList& areas = group->GetAreaList() ;
@@ -576,6 +600,7 @@ StackAndTile::_ActivateWindow(SATWindow* satWindow)
WindowArea* currentArea = areas.ItemAt(i); WindowArea* currentArea = areas.ItemAt(i);
if (currentArea == area) if (currentArea == area)
continue; continue;
desktop->ActivateWindow(currentArea->TopWindow()->GetWindow()); desktop->ActivateWindow(currentArea->TopWindow()->GetWindow());
} }
@@ -670,11 +695,12 @@ GroupIterator::NextGroup()
break; break;
} }
fCurrentWindow = fCurrentWindow->PreviousWindow( fCurrentWindow = fCurrentWindow->PreviousWindow(
fCurrentWindow->CurrentWorkspace()); fCurrentWindow->CurrentWorkspace());
if (window->IsHidden() if (window->IsHidden()
|| strcmp(window->Title(), "Deskbar") == 0 || strcmp(window->Title(), "Deskbar") == 0
|| strcmp(window->Title(), "Desktop") == 0) || strcmp(window->Title(), "Desktop") == 0) {
continue; continue;
}
SATWindow* satWindow = fStackAndTile->GetSATWindow(window); SATWindow* satWindow = fStackAndTile->GetSATWindow(window);
group = satWindow->GetGroup(); group = satWindow->GetGroup();
@@ -685,6 +711,9 @@ GroupIterator::NextGroup()
} }
// #pragma mark - WindowIterator
WindowIterator::WindowIterator(SATGroup* group, bool reverseLayerOrder) WindowIterator::WindowIterator(SATGroup* group, bool reverseLayerOrder)
: :
fGroup(group), fGroup(group),
@@ -725,6 +754,9 @@ WindowIterator::NextWindow()
} }
// #pragma mark - WindowIterator private methods
SATWindow* SATWindow*
WindowIterator::_ReverseNextWindow() WindowIterator::_ReverseNextWindow()
{ {
+2 -3
View File
@@ -93,8 +93,8 @@ public:
bool SATKeyPressed() bool SATKeyPressed()
{ return fSATKeyPressed; } { return fSATKeyPressed; }
SATWindow* GetSATWindow(Window* window); SATWindow* GetSATWindow(Window* window);
SATWindow* FindSATWindow(uint64 id); SATWindow* FindSATWindow(uint64 id);
private: private:
void _StartSAT(); void _StartSAT();
@@ -141,7 +141,6 @@ public:
position. If reverseLayerOrder is false the bottommost window comes position. If reverseLayerOrder is false the bottommost window comes
first. */ first. */
SATWindow* NextWindow(); SATWindow* NextWindow();
private: private:
SATWindow* _ReverseNextWindow(); SATWindow* _ReverseNextWindow();