Ticket #7052: Deskbar Style Changes and Refactoring 4.diff

File Deskbar Style Changes and Refactoring 4.diff, 123.1 KB (added by jscipione, 13 years ago)

This patch is big vim style checker found even more style issues including that the Open Tracker license broke the 80 char limit in almost every file! yeah! Also more evil spaces deleted, more 80 char limit fixes, more spaces around binary operators. Single line comments get indented *after* the line they affect as per style guide.

  • src/apps/deskbar/BarApp.cpp

    diff --git a/src/apps/deskbar/BarApp.cpp b/src/apps/deskbar/BarApp.cpp
    index 2647068..ffc1398 100644
    a b Except as contained in this notice, the name of Be Incorporated shall not be  
    2626used in advertising or otherwise to promote the sale, use or other dealings in
    2727this Software without prior written authorization from Be Incorporated.
    2828
    29 Tracker(TM), Be(R), BeOS(R), and BeIA(TM) are trademarks or registered trademarks
    30 of Be Incorporated in the United States and other countries. Other brand product
    31 names are registered trademarks or trademarks of their respective holders.
     29Tracker(TM), Be(R), BeOS(R), and BeIA(TM) are trademarks or registered
     30trademarks of Be Incorporated in the United States and other countries. Other
     31brand product names are registered trademarks or trademarks of their respective
     32holders.
    3233All rights reserved.
    3334*/
    3435
    All rights reserved.  
    6061#include "PublicCommands.h"
    6162#include "ResourceSet.h"
    6263#include "Switcher.h"
    63 #include "TeamMenu.h"
    64 #include "WindowMenuItem.h"
    6564
    6665
    6766BLocker TBarApp::sSubscriberLock;
    BList TBarApp::sSubscribers;  
    7271const uint32 kShowBeMenu = 'BeMn';
    7372const uint32 kShowTeamMenu = 'TmMn';
    7473
    75 const BRect kIconSize(0.0f, 0.0f, 15.0f, 15.0f);
    7674
     75const BRect kIconRect(0.0f, 0.0f, 15.0f, 15.0f);
    7776static const color_space kIconFormat = B_RGBA32;
    7877
    7978
    TBarApp::SaveSettings()  
    190189        storedSettings.AddFloat("width", fSettings.width);
    191190        storedSettings.AddBool("showTime", fSettings.showTime);
    192191        storedSettings.AddPoint("switcherLoc", fSettings.switcherLoc);
    193         storedSettings.AddInt32("recentAppsCount",
    194             fSettings.recentAppsCount);
    195         storedSettings.AddInt32("recentDocsCount",
    196             fSettings.recentDocsCount);
    197         storedSettings.AddBool("timeShowSeconds",
    198             fSettings.timeShowSeconds);
     192        storedSettings.AddInt32("recentAppsCount", fSettings.recentAppsCount);
     193        storedSettings.AddInt32("recentDocsCount", fSettings.recentDocsCount);
     194        storedSettings.AddBool("timeShowSeconds", fSettings.timeShowSeconds);
    199195        storedSettings.AddInt32("recentFoldersCount",
    200196            fSettings.recentFoldersCount);
    201197        storedSettings.AddBool("alwaysOnTop", fSettings.alwaysOnTop);
    202198        storedSettings.AddBool("timeFullDate", fSettings.timeFullDate);
    203199        storedSettings.AddBool("trackerAlwaysFirst",
    204200            fSettings.trackerAlwaysFirst);
    205         storedSettings.AddBool("sortRunningApps",
    206             fSettings.sortRunningApps);
    207         storedSettings.AddBool("superExpando",
    208             fSettings.superExpando);
    209         storedSettings.AddBool("expandNewTeams",
    210             fSettings.expandNewTeams);
    211         storedSettings.AddBool("autoRaise",
    212             fSettings.autoRaise);
     201        storedSettings.AddBool("sortRunningApps", fSettings.sortRunningApps);
     202        storedSettings.AddBool("superExpando", fSettings.superExpando);
     203        storedSettings.AddBool("expandNewTeams", fSettings.expandNewTeams);
     204        storedSettings.AddBool("autoRaise", fSettings.autoRaise);
    213205        storedSettings.AddBool("recentAppsEnabled",
    214206            fSettings.recentAppsEnabled);
    215207        storedSettings.AddBool("recentDocsEnabled",
    TBarApp::InitSettings()  
    291283                &settings.trackerAlwaysFirst);
    292284            storedSettings.FindBool("sortRunningApps",
    293285                &settings.sortRunningApps);
    294             storedSettings.FindBool("superExpando",
    295                 &settings.superExpando);
    296             storedSettings.FindBool("expandNewTeams",
    297                 &settings.expandNewTeams);
    298             storedSettings.FindBool("autoRaise",
    299                 &settings.autoRaise);
     286            storedSettings.FindBool("superExpando", &settings.superExpando);
     287            storedSettings.FindBool("expandNewTeams", &settings.expandNewTeams);
     288            storedSettings.FindBool("autoRaise", &settings.autoRaise);
    300289            storedSettings.FindBool("recentAppsEnabled",
    301290                &settings.recentAppsEnabled);
    302291            storedSettings.FindBool("recentDocsEnabled",
    TBarApp::InitSettings()  
    313302void
    314303TBarApp::MessageReceived(BMessage* message)
    315304{
    316     int32 count;
    317     bool enabled;
    318305    switch (message->what) {
    319306        case 'gloc':
    320307        case 'sloc':
    TBarApp::MessageReceived(BMessage* message)  
    353340            break;
    354341
    355342        case kUpdateRecentCounts:
     343            int32 count;
     344            bool enabled;
     345
    356346            if (message->FindInt32("applications", &count) == B_OK)
    357347                fSettings.recentAppsCount = count;
    358348            if (message->FindBool("applicationsEnabled", &enabled) == B_OK)
    TBarApp::MessageReceived(BMessage* message)  
    413403            break;
    414404
    415405        case kAlwaysTop:
    416             fSettings.alwaysOnTop = !fSettings.alwaysOnTop;
     406            fSettings.alwaysOnTop = !fSettings.alwaysOnTop;
    417407
    418             fBarWindow->SetFeel(fSettings.alwaysOnTop ?
    419                 B_FLOATING_ALL_WINDOW_FEEL : B_NORMAL_WINDOW_FEEL);
    420             break;
     408            fBarWindow->SetFeel(fSettings.alwaysOnTop ?
     409                B_FLOATING_ALL_WINDOW_FEEL : B_NORMAL_WINDOW_FEEL);
     410            break;
    421411
    422412        case kAutoRaise:
    423         {
    424413            fSettings.autoRaise = !fSettings.autoRaise;
    425414
    426             TBarView* barView = static_cast<TBarApp*>(be_app)->BarView();
    427415            fBarWindow->Lock();
    428             barView->UpdateAutoRaise();
     416            BarView()->UpdateAutoRaise();
    429417            fBarWindow->Unlock();
    430418            break;
    431         }
    432419
    433420        case kTrackerFirst:
    434         {
    435421            fSettings.trackerAlwaysFirst = !fSettings.trackerAlwaysFirst;
    436422
    437             TBarView* barView = static_cast<TBarApp*>(be_app)->BarView();
    438423            fBarWindow->Lock();
    439             barView->UpdatePlacement();
     424            BarView()->UpdatePlacement();
    440425            fBarWindow->Unlock();
    441426            break;
    442         }
    443427
    444428        case kSortRunningApps:
    445         {
    446429            fSettings.sortRunningApps = !fSettings.sortRunningApps;
    447430
    448             TBarView* barView = static_cast<TBarApp*>(be_app)->BarView();
    449431            fBarWindow->Lock();
    450             barView->UpdatePlacement();
     432            BarView()->UpdatePlacement();
    451433            fBarWindow->Unlock();
    452434            break;
    453         }
    454435
    455436        case kUnsubscribe:
    456437        {
    TBarApp::MessageReceived(BMessage* message)  
    461442        }
    462443
    463444        case kSuperExpando:
    464         {
    465445            fSettings.superExpando = !fSettings.superExpando;
    466446
    467             TBarView* barView = static_cast<TBarApp*>(be_app)->BarView();
    468447            fBarWindow->Lock();
    469             barView->UpdatePlacement();
     448            BarView()->UpdatePlacement();
    470449            fBarWindow->Unlock();
    471450            break;
    472         }
    473451
    474452        case kExpandNewTeams:
    475         {
    476453            fSettings.expandNewTeams = !fSettings.expandNewTeams;
    477454
    478             TBarView* barView = static_cast<TBarApp*>(be_app)->BarView();
    479455            fBarWindow->Lock();
    480             barView->UpdatePlacement();
     456            BarView()->UpdatePlacement();
    481457            fBarWindow->Unlock();
    482458            break;
    483         }
    484459
    485460        case 'TASK':
    486461            fSwitcherMessenger.SendMessage(message);
    TBarApp::AddTeam(team_id team, uint32 flags, const char* sig, entry_ref* ref)  
    636611    BAppFileInfo appMime(&file);
    637612
    638613    BarTeamInfo* barInfo = new BarTeamInfo(new BList(), flags, strdup(sig),
    639         new BBitmap(kIconSize, kIconFormat), strdup(ref->name));
     614        new BBitmap(kIconRect, kIconFormat), strdup(ref->name));
    640615
    641616    barInfo->teams->AddItem((void*)team);
    642617    if (appMime.GetIcon(barInfo->icon, B_MINI_ICON) != B_OK)
    TBarApp::RemoveTeam(team_id team)  
    682657            int32 subsCount = sSubscribers.CountItems();
    683658            if (subsCount > 0) {
    684659                BMessage message((barInfo->teams->CountItems() == 1) ?
    685                      B_SOME_APP_QUIT : kRemoveTeam);
     660                    B_SOME_APP_QUIT : kRemoveTeam);
    686661
    687662                message.AddInt32("team", team);
    688663                for (int32 i = 0; i < subsCount; i++) {
    TBarApp::ShowPreferencesWindow()  
    706681{
    707682    if (fPreferencesWindow)
    708683        fPreferencesWindow->Activate();
    709     else {
     684    else {
    710685        fPreferencesWindow = new PreferencesWindow(BRect(0, 0, 320, 240));
    711686        fPreferencesWindow->Show();
    712687    }
  • src/apps/deskbar/BarApp.h

    diff --git a/src/apps/deskbar/BarApp.h b/src/apps/deskbar/BarApp.h
    index 6f15838..c3fd47b 100644
    a b class TBarApp : public BApplication {  
    141141        static void Unsubscribe(const BMessenger &subscriber);
    142142
    143143    private:
    144         void AddTeam(team_id team, uint32 flags, const char *sig, entry_ref *);
     144        void AddTeam(team_id team, uint32 flags, const char *sig, entry_ref*);
    145145        void RemoveTeam(team_id);
    146146
    147147        void InitSettings();
  • src/apps/deskbar/BarMenuBar.cpp

    diff --git a/src/apps/deskbar/BarMenuBar.cpp b/src/apps/deskbar/BarMenuBar.cpp
    index b246eb3..333e06a 100644
    a b Except as contained in this notice, the name of Be Incorporated shall not be  
    2626used in advertising or otherwise to promote the sale, use or other dealings in
    2727this Software without prior written authorization from Be Incorporated.
    2828
    29 Tracker(TM), Be(R), BeOS(R), and BeIA(TM) are trademarks or registered trademarks
    30 of Be Incorporated in the United States and other countries. Other brand product
    31 names are registered trademarks or trademarks of their respective holders.
     29Tracker(TM), Be(R), BeOS(R), and BeIA(TM) are trademarks or registered
     30trademarks of Be Incorporated in the United States and other countries. Other
     31brand product names are registered trademarks or trademarks of their respective
     32holders.
    3233All rights reserved.
    3334*/
    3435
    TBarMenuBar::SmartResize(float width, float height)  
    7879        BRect frame = Frame();
    7980        width = frame.Width();
    8081        height = frame.Height();
    81     } else 
     82    } else
    8283        ResizeTo(width, height);
    8384
    8485    width -= 1;
    TBarMenuBar::SmartResize(float width, float height)  
    9697void
    9798TBarMenuBar::AddTeamMenu()
    9899{
    99     if (CountItems() > 1) 
     100    if (CountItems() > 1)
    100101        return;
    101102
    102103    BRect frame(Frame());
    TBarMenuBar::AddTeamMenu()  
    112113void
    113114TBarMenuBar::RemoveTeamMenu()
    114115{
    115     if (CountItems() < 2) 
     116    if (CountItems() < 2)
    116117        return;
    117118
    118119    if (fAppListMenuItem) {
    TBarMenuBar::RemoveTeamMenu()  
    121122        fAppListMenuItem = NULL;
    122123    }
    123124
    124     BRect frame = Frame(); 
     125    BRect frame = Frame();
    125126    SmartResize(frame.Width(), frame.Height());
    126127}
    127128
    init_tracking_hook(BMenuItem* item, bool (*hookFunction)(BMenu*, void*),  
    179180        return;
    180181
    181182    BMenu* windowMenu = item->Submenu();
    182     if (windowMenu)
    183         //  have a menu, set the tracking hook
    184         windowMenu->SetTrackingHook(hookFunction, state);                   
     183    if (windowMenu) {
     184        // have a menu, set the tracking hook
     185        windowMenu->SetTrackingHook(hookFunction, state);
     186    }
    185187}
    186188
    187189
    TBarMenuBar::InitTrackingHook(bool (*hookFunction)(BMenu*, void*),  
    192194    BPoint loc;
    193195    uint32 buttons;
    194196    GetMouse(&loc, &buttons);
    195     //  set the hook functions for the two menus
    196     //  will always have the be menu
    197     //  may have the app menu as well (mini mode)
    198     if (fBeMenuItem->Frame().Contains(loc) || both) 
     197    // set the hook functions for the two menus
     198    // will always have the be menu
     199    // may have the app menu as well (mini mode)
     200    if (fBeMenuItem->Frame().Contains(loc) || both)
    199201        init_tracking_hook(fBeMenuItem, hookFunction, state);
    200202
    201     if (fAppListMenuItem && (fAppListMenuItem->Frame().Contains(loc) || both)) 
     203    if (fAppListMenuItem && (fAppListMenuItem->Frame().Contains(loc) || both))
    202204        init_tracking_hook(fAppListMenuItem, hookFunction, state);
    203205}
    204206
  • src/apps/deskbar/BarMenuBar.h

    diff --git a/src/apps/deskbar/BarMenuBar.h b/src/apps/deskbar/BarMenuBar.h
    index ef21df1..f748882 100644
    a b Except as contained in this notice, the name of Be Incorporated shall not be  
    2626used in advertising or otherwise to promote the sale, use or other dealings in
    2727this Software without prior written authorization from Be Incorporated.
    2828
    29 Tracker(TM), Be(R), BeOS(R), and BeIA(TM) are trademarks or registered trademarks
    30 of Be Incorporated in the United States and other countries. Other brand product
    31 names are registered trademarks or trademarks of their respective holders.
     29Tracker(TM), Be(R), BeOS(R), and BeIA(TM) are trademarks or registered
     30trademarks of Be Incorporated in the United States and other countries. Other
     31brand product names are registered trademarks or trademarks of their respective
     32holders.
    3233All rights reserved.
    3334*/
    3435
    35 //  Be Menu, used in vertical mode, expanded and mini
    36 //      in mini mode will have team menu next to Be menu
    37 //      Be menu in horizontal mode is embedded in ExpandoMenuBar
     36// Be Menu, used in vertical mode, expanded and mini
     37//   - in mini mode will have team menu next to Be menu
     38//   - Be menu in horizontal mode is embedded in ExpandoMenuBar
    3839
    3940#ifndef BARMENUBAR_H
    4041#define BARMENUBAR_H
    class TBarMenuBar : public BMenuBar {  
    6364
    6465        void InitTrackingHook(bool (* hookfunction)(BMenu*, void*), void* state,
    6566            bool both = false);
    66    
     67
    6768    private:
    6869        TBarView* fBarView;
    6970        TBarMenuTitle* fBeMenuItem;
  • src/apps/deskbar/BarMenuTitle.cpp

    diff --git a/src/apps/deskbar/BarMenuTitle.cpp b/src/apps/deskbar/BarMenuTitle.cpp
    index df8b0d2..84c2d91 100644
    a b Except as contained in this notice, the name of Be Incorporated shall not be  
    2626used in advertising or otherwise to promote the sale, use or other dealings in
    2727this Software without prior written authorization from Be Incorporated.
    2828
    29 Tracker(TM), Be(R), BeOS(R), and BeIA(TM) are trademarks or registered trademarks
    30 of Be Incorporated in the United States and other countries. Other brand product
    31 names are registered trademarks or trademarks of their respective holders.
     29Tracker(TM), Be(R), BeOS(R), and BeIA(TM) are trademarks or registered
     30trademarks of Be Incorporated in the United States and other countries. Other
     31brand product names are registered trademarks or trademarks of their respective
     32holders.
    3233All rights reserved.
    3334*/
    3435
    TBarMenuTitle::DrawContent()  
    116117
    117118    if (be_control_look != NULL) {
    118119        menu->SetDrawingMode(B_OP_ALPHA);
    119    
     120
    120121        if (fIcon != NULL) {
    121122            BRect dstRect(fIcon->Bounds());
    122123            dstRect.OffsetTo(frame.LeftTop());
    123124            dstRect.OffsetBy(rintf(((frame.Width() - dstRect.Width()) / 2)
    124125                - 1.0f), rintf(((frame.Height() - dstRect.Height()) / 2)
    125126                - 0.0f));
    126    
     127
    127128            menu->DrawBitmapAsync(fIcon, dstRect);
    128129        }
    129130        return;
    TBarMenuTitle::Invoke(BMessage* message)  
    200201        BLooper* looper = barview->Looper();
    201202        if (looper->Lock()) {
    202203            // tell barview to add the refs to the be menu
    203             barview->HandleBeMenu(NULL);           
     204            barview->HandleBeMenu(NULL);
    204205            looper->Unlock();
    205206        }
    206207    }
    207        
     208
    208209    return BMenuItem::Invoke(message);
    209210}
    210211
  • src/apps/deskbar/BarMenuTitle.h

    diff --git a/src/apps/deskbar/BarMenuTitle.h b/src/apps/deskbar/BarMenuTitle.h
    index be7aa99..543cc51 100644
    a b Except as contained in this notice, the name of Be Incorporated shall not be  
    2626used in advertising or otherwise to promote the sale, use or other dealings in
    2727this Software without prior written authorization from Be Incorporated.
    2828
    29 Tracker(TM), Be(R), BeOS(R), and BeIA(TM) are trademarks or registered trademarks
    30 of Be Incorporated in the United States and other countries. Other brand product
    31 names are registered trademarks or trademarks of their respective holders.
     29Tracker(TM), Be(R), BeOS(R), and BeIA(TM) are trademarks or registered
     30trademarks of Be Incorporated in the United States and other countries. Other
     31brand product names are registered trademarks or trademarks of their respective
     32holders.
    3233All rights reserved.
    3334*/
    3435
    class BMenu;  
    4647
    4748class TBarMenuTitle : public BMenuItem {
    4849public:
    49     TBarMenuTitle(float width,float height, const BBitmap* icon,
    50         BMenu* menu, bool inexpando = false);
     50    TBarMenuTitle(float width, float height, const BBitmap* icon,
     51        BMenu* menu, bool inexpando = false);
    5152    virtual ~TBarMenuTitle();
    5253
    5354    void SetWidthHeight(float width, float height);
    5455    void Draw();
    5556
    5657    status_t Invoke(BMessage* message);
    57        
     58
    5859protected:
    5960    void DrawContent();
    6061    void GetContentSize(float* width, float* height);
    private:  
    6364    float fWidth;
    6465    float fHeight;
    6566    bool fInExpando;
    66     const BBitmap* fIcon;   
     67    const BBitmap* fIcon;
    6768};
    6869
    6970#endif /* BARMENUTITLE_H */
  • src/apps/deskbar/BarView.cpp

    diff --git a/src/apps/deskbar/BarView.cpp b/src/apps/deskbar/BarView.cpp
    index 53dfeec..cac3472 100644
    a b Except as contained in this notice, the name of Be Incorporated shall not be  
    2626used in advertising or otherwise to promote the sale, use or other dealings in
    2727this Software without prior written authorization from Be Incorporated.
    2828
    29 Tracker(TM), Be(R), BeOS(R), and BeIA(TM) are trademarks or registered trademarks
    30 of Be Incorporated in the United States and other countries. Other brand product
    31 names are registered trademarks or trademarks of their respective holders.
     29Tracker(TM), Be(R), BeOS(R), and BeIA(TM) are trademarks or registered
     30trademarks of Be Incorporated in the United States and other countries. Other
     31brand product names are registered trademarks or trademarks of their respective
     32holders.
    3233All rights reserved.
    3334*/
    3435
    TBarView::Draw(BRect)  
    135136    rgb_color light = tint_color(ViewColor(), B_LIGHTEN_2_TINT);
    136137
    137138    SetHighColor(hilite);
    138     if (AcrossTop()) 
     139    if (AcrossTop())
    139140        StrokeLine(bounds.LeftBottom(), bounds.RightBottom());
    140     else if (AcrossBottom()) 
     141    else if (AcrossBottom())
    141142        StrokeLine(bounds.LeftTop(), bounds.RightTop());
    142143
    143144    if (Vertical() && Expando()) {
    TBarView::MessageReceived(BMessage* message)  
    166167            // so that I can follow the common pathway
    167168            // for adding icons to the tray
    168169            int32 id;
    169             AddItem(new BMessage(*message), B_DESKBAR_TRAY, &id); 
     170            AddItem(new BMessage(*message), B_DESKBAR_TRAY, &id);
    170171            break;
    171172        }
    172173
    TBarView::PlaceBeMenu()  
    206207        fBarMenuBar = NULL;
    207208    }
    208209
    209     //  top or bottom expando mode has Be menu built in for tracking
    210     //  only for vertical mini or expanded
    211     //  mini mode will have team menu added as part of BarMenuBar
     210    // top or bottom expando mode has Be menu built in for tracking
     211    // only for vertical mini or expanded
     212    // mini mode will have team menu added as part of BarMenuBar
    212213    if (fVertical && !fBarMenuBar) {
    213214        //  create the Be menu
    214215        BRect mbarFrame(Bounds());
    TBarView::PlaceBeMenu()  
    217218        AddChild(fBarMenuBar);
    218219    }
    219220
    220     //  if there isn't a bemenu at this point,
    221     //  DB should be in top/bottom mode, else error
     221    // if there isn't a bemenu at this point,
     222    // DB should be in top/bottom mode, else error
    222223    if (!fBarMenuBar)
    223224        return;
    224        
     225
    225226    float width = sMinimumWindowWidth;
    226227    BPoint loc(B_ORIGIN);
    227228    BRect menuFrame(fBarMenuBar->Frame());
    TBarView::PlaceBeMenu()  
    237238        else
    238239            width = floorf(width) / 2;
    239240        loc = Bounds().LeftTop();
    240     } else
     241    } else {
    241242        // mini mode, BeMenu next to team menu
    242243        fBarMenuBar->AddTeamMenu();
     244    }
    243245
    244246    fBarMenuBar->SmartResize(width, menuFrame.Height());
    245247    fBarMenuBar->MoveTo(loc);
    TBarView::PlaceTray(bool, bool, BRect screenFrame)  
    257259        fDragRegion->MoveTo(statusLoc);
    258260
    259261        if (!fReplicantTray->IsHidden())
    260             fReplicantTray->Hide(); 
     262            fReplicantTray->Hide();
    261263
    262264        return;
    263265    }
    264266
    265267    if (fReplicantTray->IsHidden())
    266         fReplicantTray->Show(); 
     268        fReplicantTray->Show();
    267269
    268270    if (fTrayLocation != 0) {
    269271        fReplicantTray->SetMultiRow(fVertical);
    TBarView::GetPreferredWindowSize(BRect screenFrame, float* width, float* height)  
    347349        }
    348350    } else {
    349351        // four corners
    350         if (fTrayLocation != 0)     
     352        if (fTrayLocation != 0)
    351353            windowHeight = fDragRegion->Frame().bottom;
    352354        else
    353355            windowHeight = fBarMenuBar->Frame().bottom;
    TBarView::SaveSettings()  
    404406    settings->state = (uint32)State();
    405407    settings->width = 0;
    406408    settings->showTime = ShowingClock();
    407    
     409
    408410    fReplicantTray->RememberClockSettings();
    409     settings->alwaysOnTop = (Window()->Feel() & B_FLOATING_ALL_WINDOW_FEEL)
    410         != 0;
     411    settings->alwaysOnTop
     412        = (Window()->Feel() & B_FLOATING_ALL_WINDOW_FEEL) != 0;
    411413}
    412414
    413415
    TBarView::UpdateAutoRaise()  
    424426void
    425427TBarView::UpdatePlacement()
    426428{
    427     ChangeState(fState, fVertical, fLeft, fTop);   
     429    ChangeState(fState, fVertical, fLeft, fTop);
    428430}
    429431
    430432
    TBarView::ChangeState(int32 state, bool vertical, bool left, bool top)  
    455457    BString* signature = NULL;
    456458    if (fVertical && Expando()
    457459        && static_cast<TBarApp*>(be_app)->Settings()->superExpando) {
    458         // Get a list of the signatures of expanded apps. Can't use 
     460        // Get a list of the signatures of expanded apps. Can't use
    459461        // team_id because there can be more than one team per application
    460462        if (fVertical && Expando() && vertical && fExpando) {
    461463            for (int index = 0; index < fExpando->CountItems(); index++) {
    TBarView::ChangeState(int32 state, bool vertical, bool left, bool top)  
    469471        }
    470472    }
    471473
    472     PlaceApplicationBar(screenFrame);
    473     SizeWindow(screenFrame);
    474     PositionWindow(screenFrame);
    475     Window()->UpdateIfNeeded();
     474    PlaceApplicationBar(screenFrame);
     475    SizeWindow(screenFrame);
     476    PositionWindow(screenFrame);
     477    Window()->UpdateIfNeeded();
    476478
    477479    // Re-expand those apps.
    478480    if (expandedItems.CountItems() > 0) {
    TBarView::ChangeState(int32 state, bool vertical, bool left, bool top)  
    505507}
    506508
    507509
    508 //  window placement functions
     510// window placement functions
    509511
    510512bool
    511513TBarView::Vertical() const
    TBarView::State() const  
    558560
    559561// optional functionality functions
    560562
    561 bool 
     563bool
    562564TBarView::MilTime() const
    563565{
    564566    return fShowInterval;
    void  
    586588TBarView::CacheDragData(const BMessage* incoming)
    587589{
    588590    if (!incoming)
    589         return; 
     591        return;
    590592
    591593    if (Dragging() && SpringLoadedFolderCompareMessages(incoming, fDragMessage))
    592594        return;
    init_tracking_hook(BMenuItem* item,  
    614616
    615617status_t
    616618TBarView::DragStart()
    617 {   
     619{
    618620    if (!Dragging())
    619621        return B_OK;
    620622
    TBarView::DragStart()  
    624626
    625627    if (fExpando && fExpando->Frame().Contains(loc)) {
    626628        ConvertToScreen(&loc);
    627         BPoint expandoLocation = fExpando->ConvertFromScreen(loc);     
     629        BPoint expandoLocation = fExpando->ConvertFromScreen(loc);
    628630        TTeamMenuItem* item = fExpando->TeamItemAtPoint(expandoLocation);
    629631
    630632        if (fLastDragItem)
    TBarView::DragStart()  
    634636            if (item == fLastDragItem)
    635637                return B_OK;
    636638
    637             fLastDragItem = item;       
    638         }                   
     639            fLastDragItem = item;
     640        }
    639641    }
    640642
    641643    return B_OK;
    TBarView::MenuTrackingHook(BMenu* menu, void* castToThis)  
    676678
    677679            if (bemenu && bemenu->LockLooper()) {
    678680                bemenu->ConvertFromScreen(&location);
    679                 if (bemenu->Frame().Contains(location)) 
     681                if (bemenu->Frame().Contains(location))
    680682                    endMenu = false;
    681683
    682684                bemenu->UnlockLooper();
    TBarView::MenuTrackingHook(BMenu* menu, void* castToThis)  
    685687            if (endMenu && expando) {
    686688                expando->ConvertFromScreen(&location);
    687689                BMenuItem* item = expando->TeamItemAtPoint(location);
    688                 if (item) 
     690                if (item)
    689691                    endMenu = false;
    690692            }
    691693            barview->UnlockLooper();
    TBarView::AppCanHandleTypes(const char* signature)  
    757759    if (appmime.GetAppHint(&hintref) != B_OK)
    758760        return false;
    759761
    760     // an app was found, now see if it supports any of 
     762    // an app was found, now see if it supports any of
    761763    // the refs in the message
    762764    BFile file(&hintref, O_RDONLY);
    763765    BAppFileInfo fileinfo(&file);
    TBarView::AppCanHandleTypes(const char* signature)  
    768770
    769771    int32 count = fCachedTypesList->CountItems();
    770772    for (int32 i = 0 ; i < count ; i++) {
    771         if (fileinfo.IsSupportedType(fCachedTypesList->ItemAt(i)->String())) 
     773        if (fileinfo.IsSupportedType(fCachedTypesList->ItemAt(i)->String()))
    772774            return true;
    773775    }
    774776
    TBarView::ItemExists(const char* name, DeskbarShelf)  
    910912
    911913int32
    912914TBarView::CountItems(DeskbarShelf)
    913 {   
    914     return fReplicantTray->IconCount(); 
    915 }   
     915{
     916    return fReplicantTray->IconCount();
     917}
    916918
    917919
    918920status_t
  • src/apps/deskbar/BarView.h

    diff --git a/src/apps/deskbar/BarView.h b/src/apps/deskbar/BarView.h
    index a481445..8f4e5b8 100644
    a b Except as contained in this notice, the name of Be Incorporated shall not be  
    2626used in advertising or otherwise to promote the sale, use or other dealings in
    2727this Software without prior written authorization from Be Incorporated.
    2828
    29 Tracker(TM), Be(R), BeOS(R), and BeIA(TM) are trademarks or registered trademarks
    30 of Be Incorporated in the United States and other countries. Other brand product
    31 names are registered trademarks or trademarks of their respective holders.
     29Tracker(TM), Be(R), BeOS(R), and BeIA(TM) are trademarks or registered
     30trademarks of Be Incorporated in the United States and other countries. Other
     31brand product names are registered trademarks or trademarks of their respective
     32holders.
    3233All rights reserved.
    3334*/
    3435
    class TBarView : public BView {  
    9899        void CacheDragData(const BMessage* incoming);
    99100        status_t DragStart();
    100101        static bool MenuTrackingHook(BMenu* menu, void* castToThis);
    101         void DragStop(bool full=false);
     102        void DragStop(bool full = false);
    102103        TrackingHookData* GetTrackingHookData();
    103104        bool Dragging() const;
    104105        const BMessage* DragMessage() const;
  • src/apps/deskbar/BarWindow.cpp

    diff --git a/src/apps/deskbar/BarWindow.cpp b/src/apps/deskbar/BarWindow.cpp
    index 26b02b7..7702e84 100644
    a b Except as contained in this notice, the name of Be Incorporated shall not be  
    2626used in advertising or otherwise to promote the sale, use or other dealings in
    2727this Software without prior written authorization from Be Incorporated.
    2828
    29 Tracker(TM), Be(R), BeOS(R), and BeIA(TM) are trademarks or registered trademarks
    30 of Be Incorporated in the United States and other countries. Other brand product
    31 names are registered trademarks or trademarks of their respective holders.
     29Tracker(TM), Be(R), BeOS(R), and BeIA(TM) are trademarks or registered
     30trademarks of Be Incorporated in the United States and other countries. Other
     31brand product names are registered trademarks or trademarks of their respective
     32holders.
    3233All rights reserved.
    3334*/
    3435
    All rights reserved.  
    5859#include <MessagePrivate.h>
    5960
    6061
    61 // This is a very ugly hack to be able to call the private BMenuBar::StartMenuBar()
    62 // method from the TBarWindow::ShowBeMenu() method.
     62// This is a very ugly hack to be able to call the private
     63// BMenuBar::StartMenuBar() method from the TBarWindow::ShowBeMenu() method.
    6364// Don't do this at home -- but why the hell is this method private?
    6465#if __MWERKS__
    6566    #define BMenuBar_StartMenuBar_Hack StartMenuBar__8BMenuBarFlbbP5BRect
    All rights reserved.  
    7071#else
    7172#   error "You may want to port this ugly hack to your compiler ABI"
    7273#endif
    73 extern "C" void BMenuBar_StartMenuBar_Hack(BMenuBar*,int32,bool,bool,BRect*);
     74extern "C" void
     75    BMenuBar_StartMenuBar_Hack(BMenuBar*, int32, bool, bool, BRect*);
    7476
    7577
    7678TBeMenu* TBarWindow::sBeMenu = NULL;
    TBarWindow::ShowBeMenu()  
    312314    if (menuBar == NULL)
    313315        return;
    314316
    315     BMenuBar_StartMenuBar_Hack(menuBar,0,true,true,NULL);
     317    BMenuBar_StartMenuBar_Hack(menuBar, 0, true, true, NULL);
    316318}
    317319
    318320
    TBarWindow::ShowTeamMenu()  
    326328    if (KeyMenuBar() == NULL)
    327329        return;
    328330
    329     BMenuBar_StartMenuBar_Hack(KeyMenuBar(),index,true,true,NULL);
     331    BMenuBar_StartMenuBar_Hack(KeyMenuBar(), index, true, true, NULL);
    330332}
    331333
    332334
    333 /** determines the actual location of the window */
     335// determines the actual location of the window
    334336
    335337deskbar_location
    336338TBarWindow::DeskbarLocation() const
    TBarWindow::AddItem(BMessage* message)  
    552554        if (err < B_OK)
    553555            delete archive;
    554556    } else if (message->FindRef("addon", &ref) == B_OK) {
    555         //
    556557        //  exposing the name of the view here is not so great
    557558        TReplicantTray* tray
    558559            = dynamic_cast<TReplicantTray*>(FindView("Status"));
    TBarWindow::RemoveItem(BMessage* message)  
    579580    int32 id;
    580581    const char* name;
    581582
    582     //  ids ought to be unique across all shelves, assuming, of course,
    583     //  that sometime in the future there may be more than one
     583    // ids ought to be unique across all shelves, assuming, of course,
     584    // that sometime in the future there may be more than one
    584585#if SHELF_AWARE
    585586    if (message->FindInt32("shelf", (int32*)&shelf) == B_OK) {
    586587        if (message->FindString("name", &name) == B_OK)
    TBarWindow::RemoveItem(BMessage* message)  
    589590#endif
    590591        if (message->FindInt32("id", &id) == B_OK) {
    591592            fBarView->RemoveItem(id);
    592         //  remove the following two lines if and when the
    593         //  shelf option returns
     593        // remove the following two lines if and when the
     594        // shelf option returns
    594595        } else if (message->FindString("name", &name) == B_OK)
    595596            fBarView->RemoveItem(name, B_DESKBAR_TRAY);
    596597
    TBarWindow::_IsFocusMessage(BMessage* message)  
    632633
    633634    return true;
    634635}
     636
  • src/apps/deskbar/BarWindow.h

    diff --git a/src/apps/deskbar/BarWindow.h b/src/apps/deskbar/BarWindow.h
    index ac27410..73568f1 100644
    a b Except as contained in this notice, the name of Be Incorporated shall not be  
    2626used in advertising or otherwise to promote the sale, use or other dealings in
    2727this Software without prior written authorization from Be Incorporated.
    2828
    29 Tracker(TM), Be(R), BeOS(R), and BeIA(TM) are trademarks or registered trademarks
    30 of Be Incorporated in the United States and other countries. Other brand product
    31 names are registered trademarks or trademarks of their respective holders.
     29Tracker(TM), Be(R), BeOS(R), and BeIA(TM) are trademarks or registered
     30trademarks of Be Incorporated in the United States and other countries. Other
     31brand product names are registered trademarks or trademarks of their respective
     32holders.
    3233All rights reserved.
    3334*/
    3435#ifndef BAR_WINDOW_H
  • src/apps/deskbar/BeMenu.cpp

    diff --git a/src/apps/deskbar/BeMenu.cpp b/src/apps/deskbar/BeMenu.cpp
    index 7f22518..005fb07 100644
    a b Except as contained in this notice, the name of Be Incorporated shall not be  
    2626used in advertising or otherwise to promote the sale, use or other dealings in
    2727this Software without prior written authorization from Be Incorporated.
    2828
    29 Tracker(TM), Be(R), BeOS(R), and BeIA(TM) are trademarks or registered trademarks
    30 of Be Incorporated in the United States and other countries. Other brand product
    31 names are registered trademarks or trademarks of their respective holders.
     29Tracker(TM), Be(R), BeOS(R), and BeIA(TM) are trademarks or registered
     30trademarks of Be Incorporated in the United States and other countries. Other
     31brand product names are registered trademarks or trademarks of their respective
     32holders.
    3233All rights reserved.
    3334*/
    3435
    TRecentsMenu::~TRecentsMenu()  
    476477void
    477478TRecentsMenu::DetachedFromWindow()
    478479{
    479     //
    480     //  BNavMenu::DetachedFromWindow sets the TypesList to NULL
    481     //
     480    // BNavMenu::DetachedFromWindow sets the TypesList to NULL
    482481    BMenu::DetachedFromWindow();
    483482}
    484483
  • src/apps/deskbar/BeMenu.h

    diff --git a/src/apps/deskbar/BeMenu.h b/src/apps/deskbar/BeMenu.h
    index 276275d..9612a04 100644
    a b Except as contained in this notice, the name of Be Incorporated shall not be  
    2626used in advertising or otherwise to promote the sale, use or other dealings in
    2727this Software without prior written authorization from Be Incorporated.
    2828
    29 Tracker(TM), Be(R), BeOS(R), and BeIA(TM) are trademarks or registered trademarks
    30 of Be Incorporated in the United States and other countries. Other brand product
    31 names are registered trademarks or trademarks of their respective holders.
     29Tracker(TM), Be(R), BeOS(R), and BeIA(TM) are trademarks or registered
     30trademarks of Be Incorporated in the United States and other countries. Other
     31brand product names are registered trademarks or trademarks of their respective
     32holders.
    3233All rights reserved.
    3334*/
    3435
    All rights reserved.  
    4243class TBarView;
    4344
    4445enum recent_type {
    45     kRecentDocuments    = 0,
     46    kRecentDocuments = 0,
    4647    kRecentApplications,
    4748    kRecentFolders,
    4849    kRecentAppDocuments
    class TRecentsMenu : public BNavMenu {  
    7677
    7778        int32           fItemIndex;
    7879        BMessage        fRecentList;
    79        
     80
    8081        TBarView        *fBarView;
    8182};
    8283
    class TBeMenu : public BNavMenu {  
    102103        void            AttachedToWindow();
    103104        void            DetachedFromWindow();
    104105
    105         void            ResetTargets();     
     106        void            ResetTargets();
    106107
    107108        static BMessenger DefaultTarget();
    108109
    class TBeMenu : public BNavMenu {  
    118119
    119120        bool            AddStandardBeMenuItems();
    120121
    121     private:       
    122         virtual bool    StartBuildingItemList();
     122    private:
     123        virtual bool    StartBuildingItemList();
    123124        virtual void    DoneBuildingItemList();
    124         virtual bool    AddNextItem();
    125         virtual void    ClearMenuBuildingState();
     125        virtual bool    AddNextItem();
     126        virtual void    ClearMenuBuildingState();
    126127
    127         //  to keep track of the menu building state
    128         State           fAddState; 
    129         TBarView        *fBarView;
     128        // to keep track of the menu building state
     129        State           fAddState;
     130        TBarView*       fBarView;
    130131};
    131132
    132133#endif  /* _BE_MENU_H_ */
  • src/apps/deskbar/CalendarMenuWindow.cpp

    diff --git a/src/apps/deskbar/CalendarMenuWindow.cpp b/src/apps/deskbar/CalendarMenuWindow.cpp
    index 7cdbb61..c7af6d1 100644
    a b using BPrivate::B_WEEK_START_SUNDAY;  
    2424using BPrivate::B_WEEK_START_MONDAY;
    2525
    2626
    27 // #pragma mark -- FlatButton
     27//  #pragma mark -- FlatButton
    2828
    2929
    3030class FlatButton : public BButton {
    FlatButton::Draw(BRect updateRect)  
    6666}
    6767
    6868
    69 // #pragma mark -- CalendarMenuWindow
     69//  #pragma mark -- CalendarMenuWindow
    7070
    7171
    7272enum {
  • src/apps/deskbar/CalendarMenuWindow.h

    diff --git a/src/apps/deskbar/CalendarMenuWindow.h b/src/apps/deskbar/CalendarMenuWindow.h
    index 57b627e..1ac0a78 100644
    a b class BStringView;  
    1717namespace BPrivate {
    1818    class BCalendarView;
    1919}
    20 using BPrivate::BCalendarView;
     20
     21    using BPrivate::BCalendarView;
    2122
    2223
    2324class CalendarMenuWindow : public BWindow {
    public:  
    2526                    CalendarMenuWindow(BPoint where);
    2627    virtual         ~CalendarMenuWindow();
    2728
    28     virtual void    Show();
    29     virtual void    WindowActivated(bool active);
    30     virtual void    MessageReceived(BMessage* message);
     29    virtual void    Show();
     30    virtual void    WindowActivated(bool active);
     31    virtual void    MessageReceived(BMessage* message);
    3132
    3233private:
    3334    void            _UpdateUI(const BDate& date);
  • src/apps/deskbar/DeskBarUtils.cpp

    diff --git a/src/apps/deskbar/DeskBarUtils.cpp b/src/apps/deskbar/DeskBarUtils.cpp
    index 151fd60..791a809 100644
    a b Except as contained in this notice, the name of Be Incorporated shall not be  
    2626used in advertising or otherwise to promote the sale, use or other dealings in
    2727this Software without prior written authorization from Be Incorporated.
    2828
    29 Tracker(TM), Be(R), BeOS(R), and BeIA(TM) are trademarks or registered trademarks
    30 of Be Incorporated in the United States and other countries. Other brand product
    31 names are registered trademarks or trademarks of their respective holders.
     29Tracker(TM), Be(R), BeOS(R), and BeIA(TM) are trademarks or registered
     30trademarks of Be Incorporated in the United States and other countries. Other
     31brand product names are registered trademarks or trademarks of their respective
     32holders.
    3233All rights reserved.
    3334*/
    3435
    AddRefsToBeMenu(const BMessage* m, entry_ref* subdirectory)  
    6061        int32 count = 0;
    6162        uint32 type = 0;
    6263        entry_ref ref;
    63        
     64
    6465        m->GetInfo("refs", &type, &count);
    6566        if (count <= 0)
    6667            return;
    67            
     68
    6869        BPath path;
    6970        BSymLink link;
    7071        BDirectory dir;
    AddRefsToBeMenu(const BMessage* m, entry_ref* subdirectory)  
    7273            ref = *subdirectory;
    7374            BEntry entry(&ref);
    7475            if (entry.Exists()) {
    75                 //  if the ref is a file
    76                 //  get the parent and convert it to a ref
     76                // if the ref is a file get the parent and convert it to a ref
    7777                if (entry.IsFile()) {
    7878                    BEntry parent;
    7979                    entry.GetParent(&parent);
    AddRefsToBeMenu(const BMessage* m, entry_ref* subdirectory)  
    8181                }
    8282            } else
    8383                return;
    84                
     84
    8585            dir.SetTo(&ref);
    8686        } else {
    8787            if (find_directory(B_USER_DESKBAR_DIRECTORY, &path) == B_OK)
    AddRefsToBeMenu(const BMessage* m, entry_ref* subdirectory)  
    8989            else
    9090                return;
    9191        }
    92            
     92
    9393        for (long i = 0; i < count; i++) {
    9494            if (m->FindRef("refs", i, &ref) == B_NO_ERROR) {
    95 
    9695                BEntry entry(&ref);
    9796                entry.GetPath(&path);
    98                
     97
    9998                dir.CreateSymLink(ref.name, path.Path(), &link);
    10099            }
    101100        }
  • src/apps/deskbar/DeskBarUtils.h

    diff --git a/src/apps/deskbar/DeskBarUtils.h b/src/apps/deskbar/DeskBarUtils.h
    index 1f05c83..b35ad56 100644
    a b Except as contained in this notice, the name of Be Incorporated shall not be  
    2626used in advertising or otherwise to promote the sale, use or other dealings in
    2727this Software without prior written authorization from Be Incorporated.
    2828
    29 Tracker(TM), Be(R), BeOS(R), and BeIA(TM) are trademarks or registered trademarks
    30 of Be Incorporated in the United States and other countries. Other brand product
    31 names are registered trademarks or trademarks of their respective holders.
     29Tracker(TM), Be(R), BeOS(R), and BeIA(TM) are trademarks or registered
     30trademarks of Be Incorporated in the United States and other countries. Other
     31brand product names are registered trademarks or trademarks of their respective
     32holders.
    3233All rights reserved.
    3334*/
    3435
  • src/apps/deskbar/ExpandoMenuBar.cpp

    diff --git a/src/apps/deskbar/ExpandoMenuBar.cpp b/src/apps/deskbar/ExpandoMenuBar.cpp
    index 0fd4483..1622b67 100644
    a b Except as contained in this notice, the name of Be Incorporated shall not be  
    2626used in advertising or otherwise to promote the sale, use or other dealings in
    2727this Software without prior written authorization from Be Incorporated.
    2828
    29 Tracker(TM), Be(R), BeOS(R), and BeIA(TM) are trademarks or registered trademarks
    30 of Be Incorporated in the United States and other countries. Other brand product
    31 names are registered trademarks or trademarks of their respective holders.
     29Tracker(TM), Be(R), BeOS(R), and BeIA(TM) are trademarks or registered
     30trademarks of Be Incorporated in the United States and other countries. Other
     31brand product names are registered trademarks or trademarks of their respective
     32holders.
    3233All rights reserved.
    3334*/
    3435
    TExpandoMenuBar::AttachedToWindow()  
    118119            R_BeLogoIcon);
    119120        if (logoBitmap != NULL)
    120121            fBeMenuWidth = logoBitmap->Bounds().Width() + 16;
    121         fBeMenuItem = new TBarMenuTitle(fBeMenuWidth, Frame().Height(),
    122             logoBitmap, beMenu, true);
     122        fBeMenuItem = new TBarMenuTitle(fBeMenuWidth, Frame().Height(),
     123            logoBitmap, beMenu, true);
    123124        AddItem(fBeMenuItem);
    124125
    125126        fSeparatorItem = new TTeamMenuItem(kSepItemWidth, height, fVertical);
    TExpandoMenuBar::RemoveTeam(team_id team, bool partial)  
    584585                RemoveItem(i);
    585586
    586587                if (fVertical) {
    587                     //  instead of resizing the window here and there in the
    588                     //  code the resize method will be centered in one place
    589                     //  thus, the same behavior (good or bad) will be used
    590                     //  whereever window sizing is done
     588                    // instead of resizing the window here and there in the
     589                    // code the resize method will be centered in one place
     590                    // thus, the same behavior (good or bad) will be used
     591                    // whereever window sizing is done
    591592                    fBarView->SizeWindow(BScreen(Window()).Frame());
    592593                } else
    593594                    CheckItemSizes(-1);
    TExpandoMenuBar::CheckItemSizes(int32 delta)  
    613614
    614615    if (!fBarView->Vertical()) {
    615616        // in this case there are 2 extra items:
    616         //      The Be Menu
    617         //      The little separator item
     617        //   - The Be Menu
     618        //   - The little separator item
    618619        fullWidth = fullWidth - (sMinimumWindowWidth * 2)
    619620            + (fBeMenuWidth + kSepItemWidth);
    620621        width -= (fBeMenuWidth + kSepItemWidth);
    TExpandoMenuBar::CheckItemSizes(int32 delta)  
    624625    if (delta >= 0 && fullWidth > width) {
    625626        fOverflow = true;
    626627        reset = true;
    627         newWidth = floorf(width/count);
     628        newWidth = floorf(width / count);
    628629    } else if (delta < 0 && fOverflow) {
    629630        reset = true;
    630631        if (fullWidth > width)
    631             newWidth = floorf(width/count);
     632            newWidth = floorf(width / count);
    632633        else
    633634            newWidth = sMinimumWindowWidth;
    634635    }
    void  
    713714TExpandoMenuBar::CheckForSizeOverrun()
    714715{
    715716    BRect screenFrame = (BScreen(Window())).Frame();
    716     if (fVertical)
    717         fIsScrolling = Window()->Frame().bottom > screenFrame.bottom;
    718     else
    719         fIsScrolling = false;
     717
     718    fIsScrolling = fVertical ? Window()->Frame().bottom > screenFrame.bottom
     719        : false;
    720720}
    721721
    722722
    TExpandoMenuBar::monitor_team_windows(void* arg)  
    744744            // Set all WindowMenuItems to require an update.
    745745            TWindowMenuItem* item = NULL;
    746746            for (int32 i = 0; i < totalItems; i++) {
    747                 if (!teamMenu->SubmenuAt(i)){
     747                if (!teamMenu->SubmenuAt(i)) {
    748748                    item = static_cast<TWindowMenuItem*>(teamMenu->ItemAt(i));
    749749                    item->SetRequireUpdate();
    750750                }
    TExpandoMenuBar::monitor_team_windows(void* arg)  
    814814
    815815            // Remove any remaining items which require an update.
    816816            for (int32 i = 0; i < totalItems; i++) {
    817                 if (!teamMenu->SubmenuAt(i)){
     817                if (!teamMenu->SubmenuAt(i)) {
    818818                    item = static_cast<TWindowMenuItem*>(teamMenu->ItemAt(i));
    819819                    if (item && item->RequiresUpdate()) {
    820820                        item = static_cast<TWindowMenuItem*>
  • src/apps/deskbar/ExpandoMenuBar.h

    diff --git a/src/apps/deskbar/ExpandoMenuBar.h b/src/apps/deskbar/ExpandoMenuBar.h
    index 928555c..6a96559 100644
    a b Except as contained in this notice, the name of Be Incorporated shall not be  
    2626used in advertising or otherwise to promote the sale, use or other dealings in
    2727this Software without prior written authorization from Be Incorporated.
    2828
    29 Tracker(TM), Be(R), BeOS(R), and BeIA(TM) are trademarks or registered trademarks
    30 of Be Incorporated in the United States and other countries. Other brand product
    31 names are registered trademarks or trademarks of their respective holders.
     29Tracker(TM), Be(R), BeOS(R), and BeIA(TM) are trademarks or registered
     30trademarks of Be Incorporated in the United States and other countries. Other
     31brand product names are registered trademarks or trademarks of their respective
     32holders.
    3233All rights reserved.
    3334*/
    3435#ifndef EXPANDO_MENU_BAR_H
    3536#define EXPANDO_MENU_BAR_H
    3637
    37 //  application list
    38 //  top level at window
    39 //  in expanded mode horizontal and vertical
     38// application list
     39// top level at window
     40// in expanded mode horizontal and vertical
    4041
    4142
    4243#include <MenuBar.h>
  • src/apps/deskbar/LICENSE

    diff --git a/src/apps/deskbar/LICENSE b/src/apps/deskbar/LICENSE
    index 6992c78..dc84944 100644
    a b Except as contained in this notice, the name of Be Incorporated shall not be  
    2525used in advertising or otherwise to promote the sale, use or other dealings in
    2626this Software without prior written authorization from Be Incorporated.
    2727
    28 Tracker(TM), Be(R), BeOS(R), and BeIA(TM) are trademarks or registered trademarks
    29 of Be Incorporated in the United States and other countries. Other brand product
    30 names are registered trademarks or trademarks of their respective holders.
     28Tracker(TM), Be(R), BeOS(R), and BeIA(TM) are trademarks or registered
     29trademarks of Be Incorporated in the United States and other countries. Other
     30brand product names are registered trademarks or trademarks of their respective
     31holders.
    3132All rights reserved.
  • src/apps/deskbar/PreferencesWindow.cpp

    diff --git a/src/apps/deskbar/PreferencesWindow.cpp b/src/apps/deskbar/PreferencesWindow.cpp
    index aecbba7..bb378f1 100644
    a b PreferencesWindow::PreferencesWindow(BRect frame)  
    3535    // Controls
    3636    fMenuRecentDocuments = new BCheckBox(B_TRANSLATE("Recent documents:"),
    3737        new BMessage(kUpdateRecentCounts));
    38     fMenuRecentApplications = new BCheckBox(
    39         B_TRANSLATE("Recent applications:"),
     38    fMenuRecentApplications = new BCheckBox(B_TRANSLATE("Recent applications:"),
    4039        new BMessage(kUpdateRecentCounts));
    4140    fMenuRecentFolders = new BCheckBox(B_TRANSLATE("Recent folders:"),
    4241        new BMessage(kUpdateRecentCounts));
    PreferencesWindow::PreferencesWindow(BRect frame)  
    5251        new BMessage(kSortRunningApps));
    5352    fAppsSortTrackerFirst = new BCheckBox(B_TRANSLATE("Tracker always first"),
    5453        new BMessage(kTrackerFirst));
    55     fAppsShowExpanders = new BCheckBox(
    56         B_TRANSLATE("Show application expander"),
     54    fAppsShowExpanders = new BCheckBox(B_TRANSLATE("Show application expander"),
    5755        new BMessage(kSuperExpando));
    5856    fAppsExpandNew = new BCheckBox(B_TRANSLATE("Expand new applications"),
    5957        new BMessage(kExpandNewTeams));
    PreferencesWindow::PreferencesWindow(BRect frame)  
    8381
    8482    // Values
    8583    TBarApp* barApp = static_cast<TBarApp*>(be_app);
    86     desk_settings* appSettings = barApp->Settings();;
     84    desk_settings* appSettings = barApp->Settings();
    8785
    8886    fAppsSort->SetValue(appSettings->sortRunningApps);
    8987    fAppsSortTrackerFirst->SetValue(appSettings->trackerAlwaysFirst);
  • src/apps/deskbar/PreferencesWindow.h

    diff --git a/src/apps/deskbar/PreferencesWindow.h b/src/apps/deskbar/PreferencesWindow.h
    index 9bacafd..a45005c 100644
    a b public:  
    2828                            PreferencesWindow(BRect frame);
    2929                            ~PreferencesWindow();
    3030
    31     virtual void            MessageReceived(BMessage* message);
    32     virtual void            WindowActivated(bool active);
     31    virtual void            MessageReceived(BMessage* message);
     32    virtual void            WindowActivated(bool active);
    3333
    3434private:
    3535            void            _UpdateRecentCounts();
  • src/apps/deskbar/ResourceSet.cpp

    diff --git a/src/apps/deskbar/ResourceSet.cpp b/src/apps/deskbar/ResourceSet.cpp
    index 6bbb33b..fc9369c 100644
    a b Except as contained in this notice, the name of Be Incorporated shall not be  
    2626used in advertising or otherwise to promote the sale, use or other dealings in
    2727this Software without prior written authorization from Be Incorporated.
    2828
    29 Tracker(TM), Be(R), BeOS(R), and BeIA(TM) are trademarks or registered trademarks
    30 of Be Incorporated in the United States and other countries. Other brand product
    31 names are registered trademarks or trademarks of their respective holders.
     29Tracker(TM), Be(R), BeOS(R), and BeIA(TM) are trademarks or registered
     30trademarks of Be Incorporated in the United States and other countries. Other
     31brand product names are registered trademarks or trademarks of their respective
     32holders.
    3233All rights reserved.
    3334*/
    3435
    namespace TResourcePrivate {  
    7071            :   fDeleteOK(false)
    7172        {
    7273        }
    73        
     74
    7475        virtual ~TypeObject()
    7576        {
    7677            if (!fDeleteOK)
    7778                debugger("deleting object owned by BResourceSet");
    7879        }
    79        
     80
    8081        void Delete()
    8182        {
    8283            fDeleteOK = true;
    8384        }
    84        
     85
    8586    private:
    8687        TypeObject(const TypeObject &);
    8788        TypeObject &operator=(const TypeObject &);
    8889        bool operator==(const TypeObject &);
    8990        bool operator!=(const TypeObject &);
    90        
     91
    9192        bool fDeleteOK;
    9293    };
    93    
     94
    9495    class BitmapTypeItem : public BBitmap, public TypeObject {
    9596    public:
    9697        BitmapTypeItem(BRect bounds, uint32 flags, color_space depth,
    97             int32 bytesPerRow=B_ANY_BYTES_PER_ROW, screen_id screenID
     98            int32 bytesPerRow = B_ANY_BYTES_PER_ROW, screen_id screenID
    9899            = B_MAIN_SCREEN_ID)
    99100            :   BBitmap(bounds, flags, depth, bytesPerRow, screenID)
    100101        {
    101102        }
    102        
     103
    103104        BitmapTypeItem(const BBitmap* source, bool accepts_views = false,
    104105            bool need_contiguous = false)
    105106            :   BBitmap(source, accepts_views, need_contiguous)
    106107        {
    107108        }
    108        
     109
    109110        BitmapTypeItem(BMessage* data)
    110111            :   BBitmap(data)
    111112        {
    112113        }
    113        
     114
    114115        virtual ~BitmapTypeItem()
    115116        {
    116117        }
    117118    };
    118    
     119
    119120    class StringBlockTypeItem : public TStringBlock, public TypeObject {
    120121    public:
    121122        StringBlockTypeItem(BDataIO* data)
    122123            :   TStringBlock(data)
    123124        {
    124125        }
    125        
     126
    126127        StringBlockTypeItem(const void* block, size_t size)
    127128            :   TStringBlock(block, size)
    128129        {
    129130        }
    130        
     131
    131132        virtual ~StringBlockTypeItem()
    132133        {
    133134        }
    134135    };
    135    
     136
    136137    class TypeItem {
    137138    public:
    138139        TypeItem(int32 id, const char* name, const void* data, size_t size)
    139             : fID(id), fName(name),
    140               fData(const_cast<void*>(data)), fSize(size), fObject(0),
    141               fOwnData(false), fSourceIsFile(false)
     140            :   fID(id), fName(name),
     141                fData(const_cast<void*>(data)), fSize(size), fObject(0),
     142                fOwnData(false), fSourceIsFile(false)
    142143        {
    143144        }
    144        
     145
    145146        TypeItem(int32 id, const char* name, BFile* file)
    146147            :   fID(id),
    147148                fName(name),
    namespace TResourcePrivate {  
    162163                }
    163164            }
    164165        }
    165        
     166
    166167        virtual ~TypeItem()
    167168        {
    168169            if (fOwnData) {
    namespace TResourcePrivate {  
    172173            }
    173174            SetObject(NULL);
    174175        }
    175        
     176
    176177        int32 ID() const
    177             { return fID; }
     178        {
     179            return fID;
     180        }
    178181
    179182        const char* Name() const
    180             { return fName.String(); }
     183        {
     184            return fName.String();
     185        }
    181186
    182187        const void* Data() const
    183             { return fData; }
     188        {
     189            return fData;
     190        }
    184191
    185192        size_t Size() const
    186             { return fSize; }
    187        
     193        {
     194            return fSize;
     195        }
     196
    188197        void SetObject(TypeObject* object)
    189198        {
    190199            if (object == fObject)
    namespace TResourcePrivate {  
    195204        }
    196205
    197206        TypeObject* Object() const
    198             { return fObject; }
    199        
     207        {
     208            return fObject;
     209        }
     210
    200211        void SetSourceIsFile(bool state)
    201             { fSourceIsFile = state; }
     212        {
     213            fSourceIsFile = state;
     214        }
    202215
    203216        bool SourceIsFile() const
    204             { return fSourceIsFile; }
    205        
     217        {
     218            return fSourceIsFile;
     219        }
     220
    206221    private:
    207222        int32 fID;
    208223        BString fName;
    namespace TResourcePrivate {  
    212227        bool fOwnData;
    213228        bool fSourceIsFile;
    214229    };
    215    
     230
    216231    static bool FreeTypeItemFunc(void* item)
    217232    {
    218233        delete reinterpret_cast<TypeItem*>(item);
    namespace TResourcePrivate {  
    225240            :   fType(type)
    226241        {
    227242        }
    228        
     243
    229244        virtual ~TypeList()
    230245        {
    231246            fItems.DoForEach(FreeTypeItemFunc);
    232247            fItems.MakeEmpty();
    233248        }
    234        
     249
    235250        type_code Type() const
    236             { return fType; }
    237        
     251        {
     252            return fType;
     253        }
     254
    238255        TypeItem* FindItemByID(int32 id)
    239256        {
    240257            for (int32 i = 0; i < fItems.CountItems(); i++ ) {
    namespace TResourcePrivate {  
    254271            }
    255272            return NULL;
    256273        }
    257        
     274
    258275        void AddItem(TypeItem* item)
    259276        {
    260277            fItems.AddItem(item);
    261278        }
    262        
     279
    263280    private:
    264281        type_code fType;
    265282        BList fItems;
    266283    };
    267 
    268284}
    269285
    270 using namespace TResourcePrivate;
     286    using namespace TResourcePrivate;
    271287
    272288//  #pragma mark -
    273289// ----------------------------- TStringBlock -----------------------------
    TStringBlock::TStringBlock(BDataIO* data)  
    282298    fStrings = (char*)malloc(1024);
    283299    size_t pos = 0;
    284300    ssize_t amount;
    285     while ((amount=data->Read(fStrings + pos, 1024)) == 1024) {
     301    while ((amount = data->Read(fStrings + pos, 1024)) == 1024) {
    286302        pos += amount;
    287303        fStrings = (char*)realloc(fStrings, pos + 1024);
    288304    }
    289305    if (amount > 0)
    290306        pos += amount;
    291    
     307
    292308    fNumEntries = PreIndex(fStrings, amount);
    293309    fIndex = (size_t*)malloc(sizeof(size_t) * fNumEntries);
    294310    MakeIndex(fStrings, amount, fNumEntries, fIndex);
    TStringBlock::TStringBlock(const void* block, size_t size)  
    304320{
    305321    fIndex = (size_t*)const_cast<void*>(block);
    306322    fStrings = (char*)const_cast<void*>(block);
    307    
     323
    308324    // Figure out how many entries there are.
    309325    size_t last_off = 0;
    310326    while (fIndex[fNumEntries] > last_off && fIndex[fNumEntries] < size ) {
    size_t  
    339355TStringBlock::PreIndex(char* strings, ssize_t len)
    340356{
    341357    size_t count = 0;
    342    
    343358    char* orig = strings;
    344359    char* end = strings + len;
    345360    bool in_cr = false;
    346361    bool first = true;
    347362    bool skipping = false;
     363
    348364    while (orig < end) {
    349365        if (*orig == '\n' || *orig == '\r' || *orig == 0) {
    350366            if (!in_cr && *orig == '\r')
    TStringBlock::PreIndex(char* strings, ssize_t len)  
    371387                case '\\':
    372388                    *strings = '\\';
    373389                    break;
    374                    
     390
    375391                case '\n':
    376392                    *strings = '\n';
    377393                    break;
    378                    
     394
    379395                case '\r':
    380396                    *strings = '\r';
    381397                    break;
    382                    
     398
    383399                case '\t':
    384400                    *strings = '\t';
    385401                    break;
    386                    
     402
    387403                default:
    388404                    *strings = *orig;
    389405                    break;
    390406            }
    391         } else 
     407        } else
    392408            *strings = *orig;
    393409
    394410        orig++;
    395411        strings++;
    396412    }
    397    
    398413    return count;
    399414}
    400415
    TStringBlock::MakeIndex(const char* strings, ssize_t len,  
    405420{
    406421    *resultingIndex++ = 0;
    407422    indexLength--;
    408    
     423
    409424    ssize_t pos = 0;
    410425    while (pos < len && indexLength > 0) {
    411426        if (strings[pos] == 0 ) {
    TResourceSet::AddResources(BResources* RESOURCES_ONLY(resources))  
    475490#if USE_RESOURCES
    476491    if (!resources)
    477492        return B_BAD_VALUE;
    478    
     493
    479494    BAutolock lock(&fLock);
    480495    status_t err = fResources.AddItem(resources) ? B_OK : B_ERROR;
    481496    if (err != B_OK)
    TResourceSet::AddDirectory(const char* fullPath)  
    499514        delete path;
    500515        return err;
    501516    }
    502    
     517
    503518    BAutolock lock(&fLock);
    504519    err = fDirectories.AddItem(path) ? B_OK : B_ERROR;
    505520    if (err != B_OK)
    TResourceSet::AddEnvDirectory(const char* in, const char* defaultValue)  
    514529{
    515530    BString buf;
    516531    status_t err = ExpandString(&buf, in);
    517    
     532
    518533    if (err != B_OK) {
    519534        if (defaultValue)
    520535            return AddDirectory(defaultValue);
    521536        return err;
    522537    }
    523    
     538
    524539    return AddDirectory(buf.String());
    525540}
    526541
    status_t  
    529544TResourceSet::ExpandString(BString* out, const char* in)
    530545{
    531546    const char* start = in;
     547
    532548    while (*in) {
    533549        if (*in == '$') {
    534550            if (start < in)
    535                  out->Append(start, (int32)(in - start));
    536            
     551                out->Append(start, (int32)(in - start));
     552
    537553            in++;
    538554            char variableName[1024];
    539555            size_t i = 0;
    TResourceSet::ExpandString(BString* out, const char* in)  
    545561                if (*in)
    546562                    in++;
    547563
    548             } else
    549                 while ((isalnum(*in) || *in == '_') && i
    550                     < sizeof(variableName) - 1)
     564            } else {
     565                while ((isalnum(*in) || *in == '_')
     566                    && i < sizeof(variableName) - 1)
    551567                    variableName[i++] = *in++;
    552            
     568            }
     569
    553570            start = in;
    554            
    555571            variableName[i] = '\0';
    556            
     572
    557573            const char* val = getenv(variableName);
    558574            if (!val) {
    559575                PRINT(("Error: env var %s not found.\n", &variableName[0]));
    560576                return B_NAME_NOT_FOUND;
    561577            }
    562            
     578
    563579            status_t err = ExpandString(out, val);
    564580            if (err != B_OK)
    565581                return err;
    566            
     582
    567583        } else if (*in == '\\') {
    568584            if (start < in)
    569585                out->Append(start, (int32)(in - start));
    TResourceSet::ExpandString(BString* out, const char* in)  
    576592
    577593    if (start < in)
    578594        out->Append(start, (int32)(in - start));
    579    
     595
    580596    return B_OK;
    581597}
    582598
    const void*  
    585601TResourceSet::FindResource(type_code type, int32 id, size_t* outSize)
    586602{
    587603    TypeItem* item = FindItemID(type, id);
    588    
     604
    589605    if (outSize)
    590606        *outSize = item ? item->Size() : 0;
    591607
    const void*  
    597613TResourceSet::FindResource(type_code type, const char* name, size_t* outSize)
    598614{
    599615    TypeItem* item = FindItemName(type, name);
    600    
     616
    601617    if (outSize)
    602618        *outSize = item ? item->Size() : 0;
    603619
    TResourceSet::FindStringBlock(type_code type, const char* name)  
    632648    return ReturnStringBlockItem(FindItemName(type, name));
    633649}
    634650
    635    
     651
    636652const char*
    637653TResourceSet::FindString(type_code type, int32 id, uint32 index)
    638654{
    639655    const TStringBlock* stringBlock = FindStringBlock(type, id);
     656
    640657    if (!stringBlock)
    641658        return NULL;
    642659
    const char*  
    648665TResourceSet::FindString(type_code type, const char* name, uint32 index)
    649666{
    650667    const TStringBlock* stringBlock = FindStringBlock(type, name);
     668
    651669    if (!stringBlock)
    652670        return NULL;
    653671
    654672    return stringBlock->String(index);
    655673}
    656674
    657    
     675
    658676TypeList*
    659677TResourceSet::FindTypeList(type_code type)
    660678{
    661679    BAutolock lock(&fLock);
    662    
     680
    663681    int32 count = fTypes.CountItems();
    664682    for (int32 i = 0; i < count; i++ ) {
    665683        TypeList* list = (TypeList*)fTypes.ItemAt(i);
    666684        if (list && list->Type() == type)
    667685            return list;
    668686    }
    669    
     687
    670688    return NULL;
    671689}
    672690
    TResourceSet::FindItemID(type_code type, int32 id)  
    676694{
    677695    TypeList* list = FindTypeList(type);
    678696    TypeItem* item = NULL;
    679    
    680     if (list) item = list->FindItemByID(id);
    681    
     697
     698    if (list)
     699        item = list->FindItemByID(id);
     700
    682701    if (!item)
    683702        item = LoadResource(type, id, 0, &list);
    684    
     703
    685704    return item;
    686705}
    687706
    TResourceSet::FindItemName(type_code type, const char* name)  
    691710{
    692711    TypeList* list = FindTypeList(type);
    693712    TypeItem* item = NULL;
    694    
     713
    695714    if (list)
    696715        item = list->FindItemByName(name);
    697    
     716
    698717    if (!item)
    699718        item = LoadResource(type, -1, name, &list);
    700    
     719
    701720    return item;
    702721}
    703722
    TResourceSet::LoadResource(type_code type, int32 id, const char* name,  
    707726    TypeList** inOutList)
    708727{
    709728    TypeItem* item = NULL;
    710    
     729
    711730    if (name) {
    712731        BEntry entry;
    713        
     732
    714733        // If a named resource, first look in directories.
    715734        fLock.Lock();
    716735        int32 count = fDirectories.CountItems();
    TResourceSet::LoadResource(type_code type, int32 id, const char* name,  
    731750        }
    732751        fLock.Unlock();
    733752    }
    734    
     753
    735754#if USE_RESOURCES
    736755    if (!item) {
    737756        // Look through resource objects for data.
    TResourceSet::LoadResource(type_code type, int32 id, const char* name,  
    746765                    data = resource->LoadResource(type, id, &size);
    747766                else if (name != NULL)
    748767                    data = resource->LoadResource(type, name, &size);
    749                    
     768
    750769                if (data && size) {
    751770                    item = new TypeItem(id, name, data, size);
    752771                    item->SetSourceIsFile(false);
    TResourceSet::ReturnBitmapItem(type_code, TypeItem* from)  
    787806{
    788807    if (!from)
    789808        return NULL;
    790    
     809
    791810    TypeObject* obj = from->Object();
    792811    BitmapTypeItem* bitmap = dynamic_cast<BitmapTypeItem*>(obj);
    793812    if (bitmap)
    TResourceSet::ReturnBitmapItem(type_code, TypeItem* from)  
    803822    // Try to read as an archived bitmap.
    804823    stream.Seek(0, SEEK_SET);
    805824    BMessage archive;
    806     if (archive.Unflatten(&stream) == B_OK ) {
     825    if (archive.Unflatten(&stream) == B_OK) {
    807826        bitmap = new BitmapTypeItem(&archive);
    808827        if (bitmap && bitmap->InitCheck() != B_OK) {
    809             bitmap->Delete();   // allows us to delete this bitmap...
     828            bitmap->Delete();
     829                // allows us to delete this bitmap...
    810830            delete bitmap;
    811831            bitmap = NULL;
    812832        }
    TResourceSet::ReturnBitmapItem(type_code, TypeItem* from)  
    815835    if (bitmap) {
    816836        BAutolock lock(&fLock);
    817837        if (from->Object() != NULL) {
    818             // Whoops!  Someone snuck in under us.
     838            // Whoops! Someone snuck in under us.
    819839            bitmap->Delete();
    820840            delete bitmap;
    821841            bitmap = dynamic_cast<BitmapTypeItem*>(from->Object());
    822         } else 
     842        } else
    823843            from->SetObject(bitmap);
    824844    }
    825845
    TResourceSet::ReturnStringBlockItem(TypeItem* from)  
    832852{
    833853    if (!from)
    834854        return NULL;
    835    
     855
    836856    TypeObject* obj = from->Object();
    837857    StringBlockTypeItem* stringBlock = dynamic_cast<StringBlockTypeItem*>(obj);
    838858    if (stringBlock)
    839859        return stringBlock;
    840    
     860
    841861    // Can't change an existing object.
    842862    if (obj)
    843863        return NULL;
    844    
     864
    845865    // Don't have a string block in the item -- we'll create one.
    846866    if (from->SourceIsFile() ) {
    847867        BMemoryIO stream(from->Data(), from->Size());
    848868        stringBlock = new StringBlockTypeItem(&stream);
    849869    } else
    850870        stringBlock = new StringBlockTypeItem(from->Data(), from->Size());
    851    
     871
    852872    if (stringBlock) {
    853873        BAutolock lock(&fLock);
    854874        if (from->Object() != NULL) {
    855             // Whoops!  Someone snuck in under us.
     875            // Whoops! Someone snuck in under us.
    856876            delete stringBlock;
    857877            stringBlock = dynamic_cast<StringBlockTypeItem*>(from->Object());
    858878        } else
    859879            from->SetObject(stringBlock);
    860880    }
    861    
     881
    862882    return stringBlock;
    863883}
    864884
    TResourceSet::ReturnStringBlockItem(TypeItem* from)  
    867887
    868888
    869889namespace TResourcePrivate {
    870 
    871890    TResourceSet* gResources = NULL;
    872891    BLocker gResourceLocker;
    873    
    874892}
    875893
    876894
    AppResSet()  
    880898    // If already have it, return immediately.
    881899    if (gResources)
    882900        return gResources;
    883    
     901
    884902    // Don't have 'em, lock access to make 'em.
    885903    if (!gResourceLocker.Lock())
    886904        return NULL;
    AppResSet()  
    889907        gResourceLocker.Unlock();
    890908        return gResources;
    891909    }
    892    
     910
    893911    // Make 'em.
    894912    gResources = new TResourceSet;
    895913    gResources->AddResources(BApplication::AppResources());
  • src/apps/deskbar/ResourceSet.h

    diff --git a/src/apps/deskbar/ResourceSet.h b/src/apps/deskbar/ResourceSet.h
    index 5975304..7012c1d 100644
    a b Except as contained in this notice, the name of Be Incorporated shall not be  
    2626used in advertising or otherwise to promote the sale, use or other dealings in
    2727this Software without prior written authorization from Be Incorporated.
    2828
    29 Tracker(TM), Be(R), BeOS(R), and BeIA(TM) are trademarks or registered trademarks
    30 of Be Incorporated in the United States and other countries. Other brand product
    31 names are registered trademarks or trademarks of their respective holders.
     29Tracker(TM), Be(R), BeOS(R), and BeIA(TM) are trademarks or registered
     30trademarks of Be Incorporated in the United States and other countries. Other
     31brand product names are registered trademarks or trademarks of their respective
     32holders.
    3233All rights reserved.
    3334*/
    3435#ifndef _T_RESOURCE_SET_H
    namespace TResourcePrivate {  
    4849    class TypeList;
    4950}
    5051
    51 using namespace TResourcePrivate;
     52    using namespace TResourcePrivate;
    5253
    5354const uint32 B_STRING_BLOCK_TYPE = 'SBLK';
    5455
    public:  
    5758    TStringBlock(BDataIO* data);
    5859    TStringBlock(const void* block, size_t size);
    5960    virtual ~TStringBlock();
    60    
     61
    6162    const char* String(size_t index) const;
    6263
    6364private:
    6465    size_t PreIndex(char* strings, ssize_t len);
    65     void MakeIndex(const char* strings, ssize_t len,
    66         size_t indexLen, size_t* outIndex);
    67    
     66    void MakeIndex(const char* strings, ssize_t len, size_t indexLen,
     67        size_t* outIndex);
     68
    6869    size_t fNumEntries;
    6970    size_t* fIndex;
    7071    char* fStrings;
    public:  
    8081    status_t AddDirectory(const char* fullPath);
    8182    status_t AddEnvDirectory(const char* envPath,
    8283        const char* defaultValue = NULL);
    83    
    84     const void* FindResource(type_code type, int32 id,
    85         size_t* outSize);
    86     const void* FindResource(type_code type, const char* name,
    87         size_t* outSize);
    88    
     84
     85    const void* FindResource(type_code type, int32 id, size_t* outSize);
     86    const void* FindResource(type_code type, const char* name, size_t* outSize);
     87
    8988    const BBitmap* FindBitmap(type_code type, int32 id);
    9089    const BBitmap* FindBitmap(type_code type, const char* name);
    91    
     90
    9291    const TStringBlock* FindStringBlock(type_code type, int32 id);
    9392    const TStringBlock* FindStringBlock(type_code type, const char* name);
    94    
     93
    9594    const char* FindString(type_code type, int32 id, uint32 index);
    9695    const char* FindString(type_code type, const char* name, uint32 index);
    97    
     96
    9897private:
    9998    status_t ExpandString(BString* out, const char* in);
    10099    TypeList* FindTypeList(type_code type);
    101    
     100
    102101    TypeItem* FindItemID(type_code type, int32 id);
    103102    TypeItem* FindItemName(type_code type, const char* name);
    104    
     103
    105104    TypeItem* LoadResource(type_code type, int32 id, const char* name,
    106105        TypeList** inoutList = NULL);
    107    
     106
    108107    BBitmap* ReturnBitmapItem(type_code type, TypeItem* from);
    109108    TStringBlock* ReturnStringBlockItem(TypeItem* from);
    110    
     109
    111110    BLocker fLock;              // access control.
    112111    BList fResources;           // containing BResources objects.
    113112    BList fDirectories;         // containing BPath objects.
  • src/apps/deskbar/ShowHideMenuItem.cpp

    diff --git a/src/apps/deskbar/ShowHideMenuItem.cpp b/src/apps/deskbar/ShowHideMenuItem.cpp
    index a614fc8..b793426 100644
    a b Except as contained in this notice, the name of Be Incorporated shall not be  
    2626used in advertising or otherwise to promote the sale, use or other dealings in
    2727this Software without prior written authorization from Be Incorporated.
    2828
    29 Tracker(TM), Be(R), BeOS(R), and BeIA(TM) are trademarks or registered trademarks
    30 of Be Incorporated in the United States and other countries. Other brand product
    31 names are registered trademarks or trademarks of their respective holders.
     29Tracker(TM), Be(R), BeOS(R), and BeIA(TM) are trademarks or registered
     30trademarks of Be Incorporated in the United States and other countries. Other
     31brand product names are registered trademarks or trademarks of their respective
     32holders.
    3233All rights reserved.
    3334*/
    3435
  • src/apps/deskbar/ShowHideMenuItem.h

    diff --git a/src/apps/deskbar/ShowHideMenuItem.h b/src/apps/deskbar/ShowHideMenuItem.h
    index cd52f09..159dde1 100644
    a b Except as contained in this notice, the name of Be Incorporated shall not be  
    2626used in advertising or otherwise to promote the sale, use or other dealings in
    2727this Software without prior written authorization from Be Incorporated.
    2828
    29 Tracker(TM), Be(R), BeOS(R), and BeIA(TM) are trademarks or registered trademarks
    30 of Be Incorporated in the United States and other countries. Other brand product
    31 names are registered trademarks or trademarks of their respective holders.
     29Tracker(TM), Be(R), BeOS(R), and BeIA(TM) are trademarks or registered
     30trademarks of Be Incorporated in the United States and other countries. Other
     31brand product names are registered trademarks or trademarks of their respective
     32holders.
    3233All rights reserved.
    3334*/
    3435
    All rights reserved.  
    4344
    4445class TShowHideMenuItem : public BMenuItem {
    4546public:
    46                         TShowHideMenuItem(const char* title, 
     47                        TShowHideMenuItem(const char* title,
    4748                                          const BList* teams,
    4849                                          uint32 action);
    4950
    50     static status_t     TeamShowHideCommon(int32 action, 
    51                             const BList* teamList, 
    52                             BRect zoomRect = BRect(0, 0, 0, 0), 
     51    static status_t     TeamShowHideCommon(int32 action,
     52                            const BList* teamList,
     53                            BRect zoomRect = BRect(0, 0, 0, 0),
    5354                            bool doZoom = false);
    5455protected:
    5556    virtual void        GetContentSize(float* width, float* height);
    5657    virtual void        DrawContent();
    5758    virtual status_t    Invoke(BMessage* message = NULL);
    5859
    59 private: 
     60private:
    6061    const BList*        fTeams;
    6162    uint32              fAction;
    6263    float               fTitleWidth;
  • src/apps/deskbar/StatusView.cpp

    diff --git a/src/apps/deskbar/StatusView.cpp b/src/apps/deskbar/StatusView.cpp
    index a504101..14627f2 100644
    a b Except as contained in this notice, the name of Be Incorporated shall not be  
    2626used in advertising or otherwise to promote the sale, use or other dealings in
    2727this Software without prior written authorization from Be Incorporated.
    2828
    29 Tracker(TM), Be(R), BeOS(R), and BeIA(TM) are trademarks or registered trademarks
    30 of Be Incorporated in the United States and other countries. Other brand product
    31 names are registered trademarks or trademarks of their respective holders.
     29Tracker(TM), Be(R), BeOS(R), and BeIA(TM) are trademarks or registered
     30trademarks of Be Incorporated in the United States and other countries. Other
     31brand product names are registered trademarks or trademarks of their respective
     32holders.
    3233All rights reserved.
    3334*/
    3435
    All rights reserved.  
    7475using std::max;
    7576
    7677#ifdef DB_ADDONS
    77 //  Add-on support
     78// Add-on support
    7879//
    79 //  Item - internal item list (node, eref, etc)
    80 //  Icon - physical replicant handed to the DeskbarClass class
    81 //  AddOn - attribute based add-on
     80// Item - internal item list (node, eref, etc)
     81// Icon - physical replicant handed to the DeskbarClass class
     82// AddOn - attribute based add-on
    8283
    8384const char* const kInstantiateItemCFunctionName = "instantiate_deskbar_item";
    8485const char* const kInstantiateEntryCFunctionName = "instantiate_deskbar_entry";
    8586const char* const kDeskbarSecurityCodeFile = "Deskbar_security_code";
    8687const char* const kDeskbarSecurityCodeAttr = "be:deskbar_security_code";
    8788const char* const kStatusPredicate = "be:deskbar_item_status";
    88 const char* const kEnabledPredicate = "be:deskbar_item_status=enabled";
    89 const char* const kDisabledPredicate = "be:deskbar_item_status=disabled";
     89const char* const kEnabledPredicate = "be:deskbar_item_status = enabled";
     90const char* const kDisabledPredicate = "be:deskbar_item_status = disabled";
    9091
    9192float sMinimumWindowWidth = kGutter + kMinimumTrayWidth + kDragRegionWidth;
    9293
    TReplicantTray::DealWithClock(bool showClock)  
    240241}
    241242
    242243
    243 /*!
    244     Width is set to a minimum of kMinimumReplicantCount by kMaxReplicantWidth
     244/*! Width is set to a minimum of kMinimumReplicantCount by kMaxReplicantWidth
    245245    if not in multirowmode and greater than kMinimumReplicantCount
    246246    the width should be calculated based on the actual
    247247    replicant widths
    TReplicantTray::GetPreferredSize(float* preferredWidth, float* preferredHeight)  
    255255        if (fShelf->CountReplicants() > 0)
    256256            height = fRightBottomReplicant.bottom;
    257257
    258         // the height will be uniform for the number of rows
    259         // necessary to show all the reps + any gutters
    260         // necessary for spacing
     258        // the height will be uniform for the number of rows necessary to show
     259        // all the reps + any gutters necessary for spacing
    261260        int32 rowCount = (int32)(height / kMaxReplicantHeight);
    262261        height = kGutter + (rowCount * kMaxReplicantHeight)
    263262            + ((rowCount - 1) * kIconGap) + kGutter;
    264263        height = max(kMinimumTrayHeight, height);
    265264        width = fMinimumTrayWidth;
    266265    } else {
    267         // if last replicant overruns clock then
    268         // resize to accomodate
     266        // if last replicant overruns clock then resize to accomodate
    269267        if (fShelf->CountReplicants() > 0) {
    270268            if (fBarView->ShowingClock()
    271269                && fRightBottomReplicant.right + 6 >= fClock->Frame().left) {
    TReplicantTray::GetPreferredSize(float* preferredWidth, float* preferredHeight)  
    274272            } else
    275273                width = fRightBottomReplicant.right + 3;
    276274        }
     275
    277276        // this view has a fixed minimum width
    278277        width = max(fMinimumTrayWidth, width);
    279278    }
    280279
    281280    *preferredWidth = width;
    282     // add 2 for the border
     281    // add 1 for the border
    283282    *preferredHeight = height + 1;
    284283}
    285284
    TReplicantTray::ShowReplicantMenu(BPoint point)  
    350349    BPopUpMenu* menu = new BPopUpMenu("", false, false);
    351350    menu->SetFont(be_plain_font);
    352351
    353     // If the clock is visible, show the extended menu
    354     // otheriwse, show "Show Time".
     352    // If clock is visible show the extended menu, otherwise show "Show Time"
    355353
    356354    if (fBarView->ShowingClock())
    357355        fClock->ShowClockOptions(ConvertToScreen(point));
    TReplicantTray::MouseDown(BPoint where)  
    375373        DumpList(fItemList);
    376374#endif
    377375
    378     uint32  buttons;
     376    uint32 buttons;
    379377
    380378    Window()->CurrentMessage()->FindInt32("buttons", (int32*)&buttons);
    381379    if (buttons == B_SECONDARY_MOUSE_BUTTON) {
    TReplicantTray::InitAddOnSupport()  
    412410{
    413411    // list to maintain refs to each rep added/deleted
    414412    fItemList = new BList();
    415 
    416413    bool haveKey = false;
    417     BPath path;
     414    BPath path;
     415
    418416    if (find_directory(B_USER_SETTINGS_DIRECTORY, &path, true) == B_OK) {
    419417        path.Append(kDeskbarSecurityCodeFile);
    420418
    421         BFile file(path.Path(),B_READ_ONLY);
     419        BFile file(path.Path(), B_READ_ONLY);
    422420        if (file.InitCheck() == B_OK
    423             && file.Read(&fDeskbarSecurityCode, sizeof(fDeskbarSecurityCode))
     421            && file.Read(&fDeskbarSecurityCode, sizeof(fDeskbarSecurityCode))
    424422                == sizeof(fDeskbarSecurityCode))
    425423            haveKey = true;
    426424    }
    TReplicantTray::InitAddOnSupport()  
    443441        }
    444442    }
    445443
    446     // for each volume currently mounted
    447     //      index the volume with our indices
     444    // for each volume currently mounted index the volume with our indices
    448445    BVolumeRoster roster;
    449446    BVolume volume;
    450447    while (roster.GetNextVolume(&volume) == B_OK) {
    TReplicantTray::RunAddOnQuery(BVolume* volume, const char* predicate)  
    488485        || fs_stat_index(volume->Device(), kStatusPredicate, &info) != 0)
    489486        return;
    490487
    491     // run a new query on a specific volume
    492     // make it live
     488    // run a new query on a specific volume and make it live
    493489    BQuery query;
    494490    query.SetVolume(volume);
    495491    query.SetPredicate(predicate);
    TReplicantTray::NodeExists(node_ref& nodeRef)  
    557553}
    558554
    559555
    560 /*! This handles B_NODE_MONITOR & B_QUERY_UPDATE messages received
     556/*! This handles B_NODE_MONITOR & B_QUERY_UPDATE messages received
    561557    for the registered add-ons.
    562558*/
    563559void
    TReplicantTray::HandleEntryUpdate(BMessage* message)  
    697693}
    698694
    699695
    700 /*!
    701     The add-ons must support the exported C function API
     696/*! The add-ons must support the exported C function API
    702697    if they do, they will be loaded and added to deskbar
    703698    primary function is the Instantiate function
    704699*/
    TReplicantTray::MoveItem(entry_ref* ref, ino_t toDirectory)  
    883878    }
    884879}
    885880
    886 #endif  //  add-on support
     881#endif // add-on support
    887882
    888883//  external add-on API routines
    889884//  called using the new BDeskbar class
    TReplicantTray::IconCount() const  
    989984}
    990985
    991986
    992 /*! Message must contain an archivable view for later rehydration.
     987/*! Message must contain an archivable view for later rehydration.
    993988    This function takes over ownership of the provided message on success
    994989    only.
    995990    Returns the current replicant ID.
    TReplicantTray::AddIcon(BMessage* archive, int32* id, const entry_ref* addOn)  
    1004999
    10051000    entry_ref ref;
    10061001    if (addOn) {
    1007         // Use it if we got it
    10081002        ref = *addOn;
     1003            // Use it if we got it
    10091004    } else {
    10101005        const char* signature;
     1006
    10111007        status_t status = archive->FindString("add_on", &signature);
    10121008        if (status == B_OK) {
    10131009            BRoster roster;
    TReplicantTray::AddIcon(BMessage* archive, int32* id, const entry_ref* addOn)  
    10281024        return status;
    10291025
    10301026    BEntry entry(&ref, true);
    1031         // ToDo: this resolves an eventual link for the item
    1032         // being added - this is okay for now, but in multi-user
    1033         // environments, one might want to have links that
    1034         // carry the be:deskbar_item_status attribute
     1027        // TODO: this resolves an eventual link for the item being added - this
     1028        // is okay for now, but in multi-user environments, one might want to
     1029        // have links that carry the be:deskbar_item_status attribute
    10351030    status = entry.InitCheck();
    10361031    if (status != B_OK)
    10371032        return status;
    TReplicantTray::AddIcon(BMessage* archive, int32* id, const entry_ref* addOn)  
    10411036        archive->what = 0;
    10421037
    10431038    BRect originalBounds = archive->FindRect("_frame");
    1044         // this is a work-around for buggy replicants that change their
    1045         // size in AttachedToWindow() (such as "SVM")
     1039    // this is a work-around for buggy replicants that change their size in
     1040    // AttachedToWindow() (such as "SVM")
    10461041
    1047     // !! check for name collisions?
     1042    // TODO: check for name collisions?
    10481043    status = fShelf->AddReplicant(archive, BPoint(1, 1));
    10491044    if (status != B_OK)
    10501045        return status;
    TReplicantTray::AddIcon(BMessage* archive, int32* id, const entry_ref* addOn)  
    10701065    // add the item to the add-on list
    10711066
    10721067    AddItem(*id, nodeRef, entry, addOn != NULL);
    1073     return B_OK;
     1068    return B_OK;
    10741069}
    10751070
    10761071
    TReplicantTray::RealReplicantAdjustment(int32 startIndex)  
    11291124    float width, height;
    11301125    GetPreferredSize(&width, &height);
    11311126    if (oldWidth != width || oldHeight != height) {
    1132         // resize view to accomodate the replicants
    1133         // redraw as necessary
     1127        // resize view to accomodate the replicants, redraw as necessary
    11341128        AdjustPlacement();
    11351129    }
    11361130}
    TReplicantTray::ViewAt(int32* index, int32* id, int32 target, bool byIndex)  
    11541148            }
    11551149        }
    11561150    } else {
    1157         int32 count = fShelf->CountReplicants()-1;
     1151        int32 count = fShelf->CountReplicants() - 1;
    11581152        int32 localid;
    11591153        for (int32 repIndex = count ; repIndex >= 0 ; repIndex--) {
    11601154            fShelf->ReplicantAt(repIndex, &view, (uint32*)&localid);
    TReplicantTray::ViewAt(int32* index, int32* id, int32 target, bool byIndex)  
    11651159            }
    11661160        }
    11671161    }
    1168 
    11691162    return NULL;
    11701163}
    11711164
    TReplicantTray::ViewAt(int32* index, int32* id, const char* name)  
    11891182            return view;
    11901183        }
    11911184    }
    1192 
    11931185    return NULL;
    11941186}
    11951187
    TReplicantTray::SetMultiRow(bool state)  
    13531345//  #pragma mark -
    13541346
    13551347
    1356 /*! Draggable region that is asynchronous so that dragging does not block
     1348/*! Draggable region that is asynchronous so that dragging does not block
    13571349    other activities.
    13581350*/
    13591351TDragRegion::TDragRegion(TBarView* parent, BView* child)
    bool  
    15831575TDragRegion::SwitchModeForRect(BPoint mouse, BRect rect,
    15841576    bool newVertical, bool newLeft, bool newTop, int32 newState)
    15851577{
    1586     if (!rect.Contains(mouse))
     1578    if (!rect.Contains(mouse)) {
    15871579        // not our rect
    15881580        return false;
     1581    }
    15891582
    1590     if (newVertical == fBarView->Vertical()
    1591         && newLeft == fBarView->Left()
    1592         && newTop == fBarView->Top()
    1593         && newState == fBarView->State())
     1583    if (newVertical == fBarView->Vertical() && newLeft == fBarView->Left()
     1584        && newTop == fBarView->Top() && newState == fBarView->State()) {
    15941585        // already in the correct mode
    15951586        return true;
     1587    }
    15961588
    15971589    fBarView->ChangeState(newState, newVertical, newLeft, newTop);
    15981590    return true;
  • src/apps/deskbar/StatusView.h

    diff --git a/src/apps/deskbar/StatusView.h b/src/apps/deskbar/StatusView.h
    index aeef04b..31fb82f 100644
    a b Except as contained in this notice, the name of Be Incorporated shall not be  
    2626used in advertising or otherwise to promote the sale, use or other dealings in
    2727this Software without prior written authorization from Be Incorporated.
    2828
    29 Tracker(TM), Be(R), BeOS(R), and BeIA(TM) are trademarks or registered trademarks
    30 of Be Incorporated in the United States and other countries. Other brand product
    31 names are registered trademarks or trademarks of their respective holders.
     29Tracker(TM), Be(R), BeOS(R), and BeIA(TM) are trademarks or registered
     30trademarks of Be Incorporated in the United States and other countries. Other
     31brand product names are registered trademarks or trademarks of their respective
     32holders.
    3233All rights reserved.
    3334*/
    3435
    const int32 kIconGap = 2;  
    5152const int32 kGutter = 1;
    5253const int32 kDragRegionWidth = 6;
    5354
    54 //  1 pixel left gutter
    55 //  space for replicant tray (6 items)
    56 //  6 pixel drag region
    57 const float kMinimumTrayWidth = kIconGap
    58         + (kMinimumReplicantCount * kIconGap)
    59         + (kMinimumReplicantCount * kMaxReplicantWidth) + kGutter;
     55// 1 pixel left gutter
     56// space for replicant tray (6 items)
     57// 6 pixel drag region
     58const float kMinimumTrayWidth = kIconGap + (kMinimumReplicantCount * kIconGap)
     59    + (kMinimumReplicantCount * kMaxReplicantWidth) + kGutter;
    6060const float kMinimumTrayHeight = kGutter + kMaxReplicantHeight + kGutter;
    6161
    6262extern float sMinimumWindowWidth;
    public:  
    104104    void RemoveIcon(int32 target, bool byIndex = false);
    105105    void RemoveIcon(const char* name);
    106106
    107     BRect IconFrame(int32 target, bool byIndex=false);
     107    BRect IconFrame(int32 target, bool byIndex = false);
    108108    BRect IconFrame(const char* name);
    109109
    110110    bool AcceptAddon(BRect frame, BMessage* message);
  • src/apps/deskbar/StatusViewShelf.cpp

    diff --git a/src/apps/deskbar/StatusViewShelf.cpp b/src/apps/deskbar/StatusViewShelf.cpp
    index c879036..38cd445 100644
    a b Except as contained in this notice, the name of Be Incorporated shall not be  
    2626used in advertising or otherwise to promote the sale, use or other dealings in
    2727this Software without prior written authorization from Be Incorporated.
    2828
    29 Tracker(TM), Be(R), BeOS(R), and BeIA(TM) are trademarks or registered trademarks
    30 of Be Incorporated in the United States and other countries. Other brand product
    31 names are registered trademarks or trademarks of their respective holders.
     29Tracker(TM), Be(R), BeOS(R), and BeIA(TM) are trademarks or registered
     30trademarks of Be Incorporated in the United States and other countries. Other
     31brand product names are registered trademarks or trademarks of their respective
     32holders.
    3233All rights reserved.
    3334*/
    3435
    TReplicantShelf::MessageReceived(BMessage* message)  
    6869            // since we can't use ReplicantDeleted
    6970            // catch the message and find the id or name specifier
    7071            // then delete the rep vi the api,
    71             //
     72
    7273            // this will fix the problem of realigning the reps
    7374            // after a remove when done through scripting
    74             //
     75
    7576            // note: if specified by index its the index not the id!
    7677
    7778            while (message->FindMessage("specifiers", index++, &repspec)
    7879                == B_OK) {
    7980                const char* str;
     81
    8082                if (repspec.FindString("property", &str) == B_OK) {
    8183                    if (strcmp(str, "Replicant") == 0) {
    8284                        int32 index;
    TReplicantShelf::MessageReceived(BMessage* message)  
    103105}
    104106
    105107
    106 bool 
     108bool
    107109TReplicantShelf::CanAcceptReplicantView(BRect frame, BView* view,
    108110    BMessage* message) const
    109111{
  • src/apps/deskbar/StatusViewShelf.h

    diff --git a/src/apps/deskbar/StatusViewShelf.h b/src/apps/deskbar/StatusViewShelf.h
    index 4db46fb..181b4a8 100644
    a b Except as contained in this notice, the name of Be Incorporated shall not be  
    2626used in advertising or otherwise to promote the sale, use or other dealings in
    2727this Software without prior written authorization from Be Incorporated.
    2828
    29 Tracker(TM), Be(R), BeOS(R), and BeIA(TM) are trademarks or registered trademarks
    30 of Be Incorporated in the United States and other countries. Other brand product
    31 names are registered trademarks or trademarks of their respective holders.
     29Tracker(TM), Be(R), BeOS(R), and BeIA(TM) are trademarks or registered
     30trademarks of Be Incorporated in the United States and other countries. Other
     31brand product names are registered trademarks or trademarks of their respective
     32holders.
    3233All rights reserved.
    3334*/
    3435
    35 //  overrides BShelf; rejects draggers that won't fit into the shelf
    36 //  alligns received draggers into a grid
     36// overrides BShelf; rejects draggers that won't fit into the shelf
     37// alligns received draggers into a grid
    3738
    3839#ifndef __STATUS_VIEW_SHELF__
    3940#define __STATUS_VIEW_SHELF__
    class TReplicantShelf : public BShelf {  
    4546public:
    4647                        TReplicantShelf(TReplicantTray* view);
    4748                        ~TReplicantShelf();
    48                        
     49
    4950        void            MessageReceived(BMessage*);
    50        
     51
    5152protected:
    5253        bool            CanAcceptReplicantView(BRect, BView*, BMessage*) const;
    53         BPoint          AdjustReplicantBy(BRect, BMessage*) const;
     54        BPoint          AdjustReplicantBy(BRect, BMessage*) const;
    5455        void            ReplicantDeleted(int32, const BMessage*, const BView*);
    5556
    5657private:
  • src/apps/deskbar/Switcher.cpp

    diff --git a/src/apps/deskbar/Switcher.cpp b/src/apps/deskbar/Switcher.cpp
    index 86df52d..ed686a2 100644
    a b Except as contained in this notice, the name of Be Incorporated shall not be  
    2626used in advertising or otherwise to promote the sale, use or other dealings in
    2727this Software without prior written authorization from Be Incorporated.
    2828
    29 Tracker(TM), Be(R), BeOS(R), and BeIA(TM) are trademarks or registered trademarks
    30 of Be Incorporated in the United States and other countries. Other brand product
    31 names are registered trademarks or trademarks of their respective holders.
     29Tracker(TM), Be(R), BeOS(R), and BeIA(TM) are trademarks or registered
     30trademarks of Be Incorporated in the United States and other countries. Other
     31brand product names are registered trademarks or trademarks of their respective
     32holders.
    3233All rights reserved.
    3334*/
    3435
    public:  
    99100                                TSwitchManager* manager);
    100101    virtual                 ~TSwitcherWindow();
    101102
    102     virtual bool            QuitRequested();
    103     virtual void            MessageReceived(BMessage* message);
    104     virtual void            Show();
    105     virtual void            Hide();
    106     virtual void            WindowActivated(bool state);
     103    virtual bool            QuitRequested();
     104    virtual void            MessageReceived(BMessage* message);
     105    virtual void            Show();
     106    virtual void            Hide();
     107    virtual void            WindowActivated(bool state);
    107108
    108109            void            DoKey(uint32 key, uint32 modifiers);
    109110            TIconView*      IconView();
    public:  
    133134            void            UpdateGroup(int32 groupIndex, int32 windowIndex);
    134135
    135136    virtual void            AttachedToWindow();
    136     virtual void            Draw(BRect update);
    137     virtual void            Pulse();
    138     virtual void            GetPreferredSize(float* w, float* h);
     137    virtual void            Draw(BRect update);
     138    virtual void            Pulse();
     139    virtual void            GetPreferredSize(float* w, float* h);
    139140            void            ScrollTo(float x, float y)
    140                                 { ScrollTo(BPoint(x,y)); }
    141     virtual void            ScrollTo(BPoint where);
     141                            {
     142                                ScrollTo(BPoint(x, y));
     143                            }
     144    virtual void            ScrollTo(BPoint where);
    142145
    143146            void            ShowIndex(int32 windex);
    144147            BRect           FrameOf(int32 index) const;
    public:  
    161164            void            Hiding();
    162165
    163166    virtual void            KeyDown(const char* bytes, int32 numBytes);
    164     virtual void            Pulse();
    165     virtual void            MouseDown(BPoint point);
    166     virtual void            Draw(BRect updateRect);
     167    virtual void            Pulse();
     168    virtual void            MouseDown(BPoint point);
     169    virtual void            Draw(BRect updateRect);
    167170
    168171            void            ScrollTo(float x, float y)
    169                                 { ScrollTo(BPoint(x,y)); }
    170     virtual void    ScrollTo(BPoint where);
     172                            {
     173                                ScrollTo(BPoint(x, y));
     174                            }
     175    virtual void    ScrollTo(BPoint where);
    171176            void            Update(int32 previous, int32 current,
    172177                                int32 previousSlot, int32 currentSlot,
    173178                                bool forward);
    public:  
    199204
    200205    virtual void            Draw(BRect update);
    201206    virtual void            AllAttached();
    202     virtual void            DrawIconScrollers(bool force);
    203     virtual void            DrawWindowScrollers(bool force);
    204     virtual void            MouseDown(BPoint where);
     207    virtual void            DrawIconScrollers(bool force);
     208    virtual void            DrawWindowScrollers(bool force);
     209    virtual void            MouseDown(BPoint where);
    205210
    206211private:
    207212            TSwitchManager* fManager;
    LowBitIndex(uint32 value)  
    252257inline bool
    253258IsVisibleInCurrentWorkspace(const window_info* windowInfo)
    254259{
    255     /*
    256      The window list is always ordered from the top
    257      front visible window (the first on the list), going down through all
    258      the other visible windows, then all the hidden or non workspace
    259      visible window at the end.
    260 
    261      layer > 2 : normal visible window.
    262      layer == 2 : reserved for the desktop window (visible also).
    263      layer < 2 : hidden (0) and non workspace visible window (1)
    264     */
     260    // The window list is always ordered from the top front visible window
     261    // (the first on the list), going down through all the other visible
     262    // windows, then all hidden or non-workspace visible windows at the end.
     263    //     layer > 2  : normal visible window
     264    //     layer == 2 : reserved for the desktop window (visible also)
     265    //     layer < 2  : hidden (0) and non workspace visible window (1)
    265266    return windowInfo->layer > 2;
    266267}
    267268
    bool  
    280281IsWindowOK(const window_info* windowInfo)
    281282{
    282283    // is_mini (true means that the window is minimized).
    283     // if not, then
    284     // show_hide >= 1 means that the window is hidden.
    285     //
     284    // if not, then show_hide >= 1 means that the window is hidden.
    286285    // If the window is both minimized and hidden, then you get :
    287     //  TWindow->is_mini = false;
    288     //  TWindow->was_mini = true;
    289     //  TWindow->show_hide >= 1;
     286    //    TWindow->is_mini = false;
     287    //    TWindow->was_mini = true;
     288    //    TWindow->show_hide >= 1;
    290289
    291290    if (windowInfo->feel != _STD_W_TYPE_)
    292291        return false;
    SmartStrcmp(const char* s1, const char* s2)  
    332331            s2++;
    333332            continue;
    334333        }
    335         if (*s1 != *s2)
    336             return 1;       // they differ
     334        if (*s1 != *s2) {
     335            // they differ
     336            return 1;
     337        }
    337338        s1++;
    338339        s2++;
    339340    }
    340341
    341342    // if one of the strings ended before the other
    342     // ??? could process trailing spaces & underscores!
     343    // TODO: could process trailing spaces and underscores
    343344    if (*s1)
    344345        return 1;
    345346    if (*s2)
    TSwitchManager::TSwitchManager(BPoint point)  
    448449    TBarApp::Subscribe(BMessenger(this), &tmpList);
    449450
    450451    for (int32 i = 0; ; i++) {
    451         BarTeamInfo *barTeamInfo = (BarTeamInfo *)tmpList.ItemAt(i);
     452        BarTeamInfo* barTeamInfo = (BarTeamInfo*)tmpList.ItemAt(i);
    452453        if (!barTeamInfo)
    453454            break;
    454455
    TSwitchManager::MessageReceived(BMessage* message)  
    485486            int i = 0;
    486487            TTeamGroup* tinfo;
    487488            message->FindInt32("team", &teamID);
     489
    488490            while ((tinfo = (TTeamGroup*)fGroupList.ItemAt(i)) != NULL) {
    489491                if (tinfo->TeamList()->HasItem((void*)teamID)) {
    490492                    fGroupList.RemoveItem(i);
    TSwitchManager::MessageReceived(BMessage* message)  
    519521                delete teams;
    520522                break;
    521523            }
     524
    522525            delete smallIcon;
     526
    523527            if (message->FindString("sig", &signature) != B_OK) {
    524528                delete teams;
    525529                break;
    526530            }
     531
    527532            if (message->FindInt32("flags", (int32*)&flags) != B_OK) {
    528533                delete teams;
    529534                break;
    530535            }
     536
    531537            if (message->FindString("name", &name) != B_OK) {
    532538                delete teams;
    533539                break;
    TSwitchManager::MessageReceived(BMessage* message)  
    548554            const char* signature = message->FindString("sig");
    549555            team_id team = message->FindInt32("team");
    550556
    551             int32 numItems = fGroupList.CountItems();
    552             for (int32 i = 0; i < numItems; i++) {
     557            for (int32 i = 0; i < fGroupList.CountItems(); i++) {
    553558                TTeamGroup* tinfo = (TTeamGroup*)fGroupList.ItemAt(i);
    554559                if (strcasecmp(tinfo->Signature(), signature) == 0) {
    555560                    if (!(tinfo->TeamList()->HasItem((void*)team)))
    TSwitchManager::MessageReceived(BMessage* message)  
    564569        {
    565570            team_id team = message->FindInt32("team");
    566571
    567             int32 numItems = fGroupList.CountItems();
    568             for (int32 i = 0; i < numItems; i++) {
     572            for (int32 i = 0; i < fGroupList.CountItems(); i++) {
    569573                TTeamGroup* tinfo = (TTeamGroup*)fGroupList.ItemAt(i);
    570574                if (tinfo->TeamList()->HasItem((void*)team)) {
    571575                    tinfo->TeamList()->RemoveItem((void*)team);
    TSwitchManager::MessageReceived(BMessage* message)  
    586590            // starts differentiating initial key_downs from KeyDowns generated
    587591            // by auto-repeat. Until then the fSkipUntil stuff helps, but it
    588592            // isn't perfect.
    589 
    590593            if (time < fSkipUntil)
    591594                break;
    592595
    TSwitchManager::_SortApps()  
    622625    team_id* teams;
    623626    int32 count;
    624627    if (BPrivate::get_application_order(current_workspace(), &teams, &count)
    625             != B_OK)
     628        != B_OK)
    626629        return;
    627630
    628631    BList groups;
    TSwitchManager::MainEntry(BMessage* message)  
    658661{
    659662    bigtime_t now = system_time();
    660663    bigtime_t timeout = now + 180000;
    661         // The delay above was arrived at by trial and error and
    662         // has a good "feel"
     664        // The above delay has a good "feel" found by trial and error
    663665
    664666    app_info appInfo;
    665667    be_roster->GetActiveAppInfo(&appInfo);
    TSwitchManager::_FindNextValidApp(bool forward)  
    887889            if (fCurrentIndex < 0)
    888890                fCurrentIndex = max - 1;
    889891        }
     892
    890893        if (fCurrentIndex == startIndex) {
    891894            // we've gone completely through the list without finding
    892895            // a good app. Oh well.
    TSwitchManager::_FindNextValidApp(bool forward)  
    900903    return false;
    901904}
    902905
     906
    903907void
    904908TSwitchManager::SwitchToApp(int32 previousIndex, int32 newIndex, bool forward)
    905909{
    TSwitchManager::ActivateApp(bool forceShow, bool allowWorkspaceSwitch)  
    932936
    933937    int32 currentWorkspace = current_workspace();
    934938    TTeamGroup* teamGroup = (TTeamGroup*)fGroupList.ItemAt(fCurrentIndex);
     939
    935940    // Let's handle the easy case first: There's only 1 team in the group
    936941    if (teamGroup->TeamList()->CountItems() == 1) {
    937942        bool result;
    TSwitchManager::ActivateApp(bool forceShow, bool allowWorkspaceSwitch)  
    990995    if (tokens == NULL) {
    991996        ASSERT(windowInfo);
    992997        free(windowInfo);
    993         return true;    // weird error, so don't try to recover
     998        return true;
     999            // weird error, so don't try to recover
    9941000    }
    9951001
    9961002    BList windowsToActivate;
    TSwitchManager::QuitApp()  
    10421048
    10431049    TTeamGroup* teamGroup;
    10441050    int32 count = 0;
     1051
    10451052    for (int32 i = fCurrentIndex + 1; i < fGroupList.CountItems(); i++) {
    10461053        teamGroup = (TTeamGroup*)fGroupList.ItemAt(i);
    10471054
    TBox::MouseDown(BPoint where)  
    12961303    if (fLeftScroller) {
    12971304        BRect lhit(0, frame.top, frame.left, frame.bottom);
    12981305        if (lhit.Contains(where)) {
    1299             // Want to scroll by NUMSLOTS-1 slots
     1306            // Want to scroll by NUMSLOTS - 1 slots
    13001307            int32 previousIndex = fManager->CurrentIndex();
    13011308            int32 previousSlot = fManager->CurrentSlot();
    13021309            int32 newSlot = previousSlot - (kNumSlots - 1);
    TBox::MouseDown(BPoint where)  
    13111318    if (fRightScroller) {
    13121319        BRect rhit(frame.right, frame.top, bounds.right, frame.bottom);
    13131320        if (rhit.Contains(where)) {
    1314             // Want to scroll by NUMSLOTS-1 slots
     1321            // Want to scroll by NUMSLOTS - 1 slots
    13151322            int32 previousIndex = fManager->CurrentIndex();
    13161323            int32 previousSlot = fManager->CurrentSlot();
    1317             int32 newSlot = previousSlot + (kNumSlots-1);
     1324            int32 newSlot = previousSlot + (kNumSlots - 1);
    13181325            int32 newIndex = fIconView->IndexAt(newSlot);
    13191326
    13201327            if (newIndex < 0) {
    13211328                // don't have a page full to scroll
    13221329                int32 valid = fManager->CountVisibleGroups();
    1323                 newIndex = fIconView->IndexAt(valid-1);
     1330                newIndex = fIconView->IndexAt(valid - 1);
    13241331            }
    13251332            fManager->SwitchToApp(previousIndex, newIndex, true);
    13261333        }
    TBox::MouseDown(BPoint where)  
    13291336    frame = fWindow->WindowView()->Frame();
    13301337    if (fUpScroller) {
    13311338        BRect hit1(frame.left - 10, frame.top, frame.left,
    1332             (frame.top+frame.bottom)/2);
     1339            (frame.top + frame.bottom) / 2);
    13331340        BRect hit2(frame.right, frame.top, frame.right + 10,
    1334             (frame.top+frame.bottom)/2);
     1341            (frame.top + frame.bottom) / 2);
    13351342        if (hit1.Contains(where) || hit2.Contains(where)) {
    13361343            // Want to scroll up 1 window
    13371344            fManager->CycleWindow(false, false);
    TBox::MouseDown(BPoint where)  
    13391346    }
    13401347
    13411348    if (fDownScroller) {
    1342         BRect hit1(frame.left - 10, (frame.top+frame.bottom) / 2, frame.left,
    1343             frame.bottom);
    1344         BRect hit2(frame.right, (frame.top+frame.bottom) / 2, frame.right + 10,
    1345             frame.bottom);
     1349        BRect hit1(frame.left - 10, (frame.top + frame.bottom) / 2,
     1350            frame.left, frame.bottom);
     1351        BRect hit2(frame.right, (frame.top + frame.bottom) / 2,
     1352            frame.right + 10, frame.bottom);
    13461353        if (hit1.Contains(where) || hit2.Contains(where)) {
    13471354            // Want to scroll down 1 window
    13481355            fManager->CycleWindow(true, false);
    TBox::Draw(BRect update)  
    13741381
    13751382    // Fill the area with dark gray
    13761383    SetHighColor(darkGray);
    1377     box.InsetBy(1,1);
     1384    box.InsetBy(1, 1);
    13781385    FillRect(box);
    13791386
    1380     box.InsetBy(-1,-1);
     1387    box.InsetBy(-1, -1);
    13811388
    13821389    BeginLineArray(50);
    13831390
    13841391    // The main frame around the icon view
    1385     AddLine(box.LeftTop(), BPoint(center-kWedge, box.top), veryDarkGray);
    1386     AddLine(BPoint(center+kWedge, box.top), box.RightTop(), veryDarkGray);
     1392    AddLine(box.LeftTop(), BPoint(center - kWedge, box.top), veryDarkGray);
     1393    AddLine(BPoint(center + kWedge, box.top), box.RightTop(), veryDarkGray);
    13871394
    1388     AddLine(box.LeftBottom(), BPoint(center-kWedge, box.bottom), veryDarkGray);
    1389     AddLine(BPoint(center+kWedge, box.bottom), box.RightBottom(), veryDarkGray);
     1395    AddLine(box.LeftBottom(), BPoint(center - kWedge, box.bottom),
     1396        veryDarkGray);
     1397    AddLine(BPoint(center + kWedge, box.bottom), box.RightBottom(),
     1398        veryDarkGray);
    13901399    AddLine(box.LeftBottom() + BPoint(1, 1),
    1391         BPoint(center-kWedge, box.bottom + 1), white);
    1392     AddLine(BPoint(center+kWedge, box.bottom) + BPoint(0, 1),
     1400        BPoint(center - kWedge, box.bottom + 1), white);
     1401    AddLine(BPoint(center + kWedge, box.bottom) + BPoint(0, 1),
    13931402        box.RightBottom() + BPoint(1, 1), white);
    13941403
    13951404    AddLine(box.LeftTop(), box.LeftBottom(), veryDarkGray);
    13961405    AddLine(box.RightTop(), box.RightBottom(), veryDarkGray);
    1397     AddLine(box.RightTop() + BPoint(1, 1),
    1398         box.RightBottom() + BPoint(1, 1), white);
     1406    AddLine(box.RightTop() + BPoint(1, 1), box.RightBottom() + BPoint(1, 1),
     1407        white);
    13991408
    14001409    // downward pointing area at top of frame
    14011410    BPoint point(center - kWedge, box.top);
    14021411    AddLine(point, point + BPoint(kWedge, kWedge), veryDarkGray);
    1403     AddLine(point + BPoint(kWedge, kWedge),
    1404         BPoint(center+kWedge, point.y), veryDarkGray);
     1412    AddLine(point + BPoint(kWedge, kWedge), BPoint(center + kWedge, point.y),
     1413        veryDarkGray);
    14051414
    1406     AddLine(point + BPoint(1, 0),
    1407         point + BPoint(1, 0) + BPoint(kWedge - 1, kWedge - 1), white);
     1415    AddLine(point + BPoint(1, 0), point + BPoint(1, 0)
     1416        + BPoint(kWedge - 1, kWedge - 1), white);
    14081417
    14091418    AddLine(point + BPoint(2, -1) + BPoint(kWedge - 1, kWedge - 1),
    1410         BPoint(center+kWedge-1, point.y), darkGray);
     1419        BPoint(center + kWedge - 1, point.y), darkGray);
    14111420
    14121421    BPoint topPoint = point;
    14131422
    TBox::Draw(BRect update)  
    14161425    point.x = center - kWedge;
    14171426    AddLine(point, point + BPoint(kWedge, -kWedge), veryDarkGray);
    14181427    AddLine(point + BPoint(kWedge, -kWedge),
    1419         BPoint(center+kWedge, point.y), veryDarkGray);
     1428        BPoint(center + kWedge, point.y), veryDarkGray);
    14201429
    14211430    AddLine(point + BPoint(1, 0),
    14221431        point + BPoint(1, 0) + BPoint(kWedge - 1, -(kWedge - 1)), white);
    TBox::Draw(BRect update)  
    14361445
    14371446    // fill the upward pointing arrow area
    14381447    SetHighColor(standardGray);
    1439     FillTriangle(bottomPoint + BPoint(2,0),
     1448    FillTriangle(bottomPoint + BPoint(2, 0),
    14401449        bottomPoint + BPoint(2, 0) + BPoint(kWedge - 2, -(kWedge - 2)),
    14411450        BPoint(center + kWedge - 2, bottomPoint.y));
    14421451
    TBox::DrawIconScrollers(bool force)  
    14671476    }
    14681477
    14691478    int32 maxIndex = fManager->GroupList()->CountItems() - 1;
    1470             // last_frame is in fIconView coordinate space
     1479    // last_frame is in fIconView coordinate space
    14711480    BRect lastFrame = fIconView->FrameOf(maxIndex);
    14721481
    14731482    if (lastFrame.right > rect.right) {
    TIconView::CacheIcons(TTeamGroup* teamGroup)  
    18931902void
    18941903TIconView::AnimateIcon(BBitmap* startIcon, BBitmap* endIcon)
    18951904{
    1896     BRect centerRect(kCenterSlot*kSlotSize, 0,
     1905    BRect centerRect(kCenterSlot * kSlotSize, 0,
    18971906        (kCenterSlot + 1) * kSlotSize - 1, kSlotSize - 1);
    18981907    BRect startIconBounds = startIcon->Bounds();
    18991908    BRect bounds = Bounds();
    TIconView::AnimateIcon(BBitmap* startIcon, BBitmap* endIcon)  
    19171926    fOffBitmap->Lock();
    19181927
    19191928    for (int i = 0; i < 2; i++) {
    1920         startIconBounds.InsetBy(amount,amount);
     1929        startIconBounds.InsetBy(amount, amount);
    19211930        snooze(20000);
    19221931        fOffView->SetDrawingMode(B_OP_COPY);
    19231932        fOffView->FillRect(fOffView->Bounds());
    TIconView::AnimateIcon(BBitmap* startIcon, BBitmap* endIcon)  
    19271936        DrawBitmap(fOffBitmap, destRect);
    19281937    }
    19291938    for (int i = 0; i < 2; i++) {
    1930         startIconBounds.InsetBy(amount,amount);
     1939        startIconBounds.InsetBy(amount, amount);
    19311940        snooze(20000);
    19321941        fOffView->SetDrawingMode(B_OP_COPY);
    19331942        fOffView->FillRect(fOffView->Bounds());
    int32  
    20542063TIconView::SlotOf(int32 index) const
    20552064{
    20562065    BRect rect = FrameOf(index);
     2066
    20572067    return (int32)(rect.left / kSlotSize) - kCenterSlot;
    20582068}
    20592069
    TIconView::FrameOf(int32 index) const  
    20632073{
    20642074    BList* list = fManager->GroupList();
    20652075    int32 visible = kCenterSlot - 1;
    2066         // first few slots in view are empty
     2076    // first few slots in view are empty
    20672077
    20682078    TTeamGroup* teamGroup;
    20692079    for (int32 i = 0; i <= index; i++) {
    TIconView::DrawTeams(BRect update)  
    21072117
    21082118            SetDrawingMode(B_OP_COPY);
    21092119        }
    2110         rect.OffsetBy(kSlotSize,0);
     2120        rect.OffsetBy(kSlotSize, 0);
    21112121    }
    21122122}
    21132123
    TWindowView::ScrollTo(BPoint where)  
    22002210}
    22012211
    22022212
    2203 
    22042213BRect
    22052214TWindowView::FrameOf(int32 index) const
    22062215{
    TWindowView::Draw(BRect update)  
    22742283    int32 groupIndex = fManager->CurrentIndex();
    22752284    TTeamGroup* teamGroup
    22762285        = (TTeamGroup*)fManager->GroupList()->ItemAt(groupIndex);
     2286
    22772287    if (teamGroup == NULL)
    22782288        return;
    22792289
  • src/apps/deskbar/Switcher.h

    diff --git a/src/apps/deskbar/Switcher.h b/src/apps/deskbar/Switcher.h
    index 9f319ea..b727c99 100644
    a b Except as contained in this notice, the name of Be Incorporated shall not be  
    2626used in advertising or otherwise to promote the sale, use or other dealings in
    2727this Software without prior written authorization from Be Incorporated.
    2828
    29 Tracker(TM), Be(R), BeOS(R), and BeIA(TM) are trademarks or registered trademarks
    30 of Be Incorporated in the United States and other countries. Other brand product
    31 names are registered trademarks or trademarks of their respective holders.
     29Tracker(TM), Be(R), BeOS(R), and BeIA(TM) are trademarks or registered
     30trademarks of Be Incorporated in the United States and other countries. Other
     31brand product names are registered trademarks or trademarks of their respective
     32holders.
    3233All rights reserved.
    3334*/
    3435#ifndef SWITCHER_H
    public:  
    5354                            TSwitchManager(BPoint where);
    5455    virtual                 ~TSwitchManager();
    5556
    56     virtual void            MessageReceived(BMessage* message);
     57    virtual void            MessageReceived(BMessage* message);
    5758
    5859            void            Stop(bool doAction, uint32 modifiers);
    5960            void            Unblock();
    private:  
    8586                                bool allowWorkspaceSwitch);
    8687            void            ActivateWindow(int32 windowID = -1);
    8788            void            _SortApps();
    88            
     89
    8990            bool            _FindNextValidApp(bool forward);
    9091
    9192            TSwitcherWindow* fWindow;
  • src/apps/deskbar/TeamMenu.cpp

    diff --git a/src/apps/deskbar/TeamMenu.cpp b/src/apps/deskbar/TeamMenu.cpp
    index 7814b40..3053969 100644
    a b Except as contained in this notice, the name of Be Incorporated shall not be  
    2626used in advertising or otherwise to promote the sale, use or other dealings in
    2727this Software without prior written authorization from Be Incorporated.
    2828
    29 Tracker(TM), Be(R), BeOS(R), and BeIA(TM) are trademarks or registered trademarks
    30 of Be Incorporated in the United States and other countries. Other brand product
    31 names are registered trademarks or trademarks of their respective holders.
     29Tracker(TM), Be(R), BeOS(R), and BeIA(TM) are trademarks or registered
     30trademarks of Be Incorporated in the United States and other countries. Other
     31brand product names are registered trademarks or trademarks of their respective
     32holders.
    3233All rights reserved.
    3334*/
    3435
    TTeamMenu::AttachedToWindow()  
    121122    if (dragging && barview->LockLooper()) {
    122123        SetTrackingHook(barview->MenuTrackingHook,
    123124            barview->GetTrackingHookData());
    124         barview->DragStart();               
     125        barview->DragStart();
    125126        barview->UnlockLooper();
    126127    }
    127128
  • src/apps/deskbar/TeamMenu.h

    diff --git a/src/apps/deskbar/TeamMenu.h b/src/apps/deskbar/TeamMenu.h
    index b3b0487..a012a5e 100644
    a b Except as contained in this notice, the name of Be Incorporated shall not be  
    2626used in advertising or otherwise to promote the sale, use or other dealings in
    2727this Software without prior written authorization from Be Incorporated.
    2828
    29 Tracker(TM), Be(R), BeOS(R), and BeIA(TM) are trademarks or registered trademarks
    30 of Be Incorporated in the United States and other countries. Other brand product
    31 names are registered trademarks or trademarks of their respective holders.
     29Tracker(TM), Be(R), BeOS(R), and BeIA(TM) are trademarks or registered
     30trademarks of Be Incorporated in the United States and other countries. Other
     31brand product names are registered trademarks or trademarks of their respective
     32holders.
    3233All rights reserved.
    3334*/
    3435
    35 //  listing of running applications
    36 //  menu of BarMenuTitle
    37 //  in mini mode only
     36// listing of running applications
     37// menu of BarMenuTitle
     38// in mini mode only
    3839
    3940#ifndef TEAMMENU_H
    4041#define TEAMMENU_H
    All rights reserved.  
    4445#include "TeamMenuItem.h"
    4546
    4647class TTeamMenu : public BMenu {
    47     public:                 
     48    public:
    4849        TTeamMenu();
    4950
    5051        void    AttachedToWindow();
  • src/apps/deskbar/TeamMenuItem.cpp

    diff --git a/src/apps/deskbar/TeamMenuItem.cpp b/src/apps/deskbar/TeamMenuItem.cpp
    index cbd669f..5cdecdd 100644
    a b Except as contained in this notice, the name of Be Incorporated shall not be  
    2626used in advertising or otherwise to promote the sale, use or other dealings in
    2727this Software without prior written authorization from Be Incorporated.
    2828
    29 Tracker(TM), Be(R), BeOS(R), and BeIA(TM) are trademarks or registered trademarks
    30 of Be Incorporated in the United States and other countries. Other brand product
    31 names are registered trademarks or trademarks of their respective holders.
     29Tracker(TM), Be(R), BeOS(R), and BeIA(TM) are trademarks or registered
     30trademarks of Be Incorporated in the United States and other countries. Other
     31brand product names are registered trademarks or trademarks of their respective
     32holders.
    3233All rights reserved.
    3334*/
    3435
    TTeamMenuItem::TTeamMenuItem(BList* team, BBitmap* icon, char* name, char* sig,  
    7172}
    7273
    7374
    74 TTeamMenuItem::TTeamMenuItem(float width,float height,bool vertical)
     75TTeamMenuItem::TTeamMenuItem(float width, float height, bool vertical)
    7576    :   BMenuItem("", NULL)
    7677{
    77     InitData(NULL, NULL, strdup(""), strdup(""), width, height, false, vertical);
     78    InitData(NULL, NULL, strdup(""), strdup(""), width, height, false,
     79        vertical);
    7880}
    7981
    8082
    TTeamMenuItem::Invoke(BMessage* message)  
    136138        barview->DragStop();
    137139
    138140    // bring to front or minimize shortcuts
    139     uint32 mods = modifiers(); 
    140     if (mods & B_CONTROL_KEY)
     141    uint32 mods = modifiers();
     142    if (mods & B_CONTROL_KEY) {
    141143        TShowHideMenuItem::TeamShowHideCommon((mods & B_SHIFT_KEY)
    142144                ? B_MINIMIZE_WINDOW : B_BRING_TO_FRONT, Teams());
     145    }
    143146
    144147    return BMenuItem::Invoke(message);
    145148}
    TTeamMenuItem::GetContentSize(float* width, float* height)  
    213216        *width = kHPad + iconBounds.Width() + kLabelOffset + fLabelWidth + kHPad
    214217            + 20;
    215218
    216     if (fOverrideHeight != -1.0f) 
     219    if (fOverrideHeight != -1.0f)
    217220        *height = fOverrideHeight;
    218221    else {
    219222        *height = iconBounds.Height();
    TTeamMenuItem::Draw()  
    233236    BMenu* menu = Menu();
    234237    menu->PushState();
    235238    rgb_color menuColor = menu->LowColor();
    236 
    237239    TBarView* barview = (static_cast<TBarApp*>(be_app))->BarView();
     240
    238241    bool canHandle = !barview->Dragging()
    239242        || barview->AppCanHandleTypes(Signature());
    240243
    TTeamMenuItem::Draw()  
    314317
    315318        // these continue the dark grey border on the left or top edge
    316319        menu->SetHighColor(tint_color(menuColor, B_DARKEN_4_TINT));
    317         if (fVertical)
     320        if (fVertical) {
    318321            // dark line at top
    319322            menu->StrokeLine(frame.LeftTop(), frame.RightTop());
    320         else
     323        } else {
    321324            // dark line on the left
    322325            menu->StrokeLine(frame.LeftTop(), frame.LeftBottom());
    323     } else
     326        }
     327    } else
    324328        menu->SetLowColor(menuColor);
    325329
    326330    menu->MovePenTo(ContentLocation());
    TTeamMenuItem::DrawContent()  
    337341        if (fIcon->ColorSpace() == B_RGBA32) {
    338342            menu->SetDrawingMode(B_OP_ALPHA);
    339343            menu->SetBlendingMode(B_PIXEL_ALPHA, B_ALPHA_OVERLAY);
    340         } else {
     344        } else
    341345            menu->SetDrawingMode(B_OP_OVER);
    342         }
    343         BRect frame(Frame());
    344346
     347        BRect frame(Frame());
    345348        BRect iconBounds(fIcon->Bounds());
    346349        BRect dstRect(iconBounds);
    347350        float extra = fVertical ? 0.0f : 1.0f;
    348351        BPoint contLoc = ContentLocation();
     352
    349353        dstRect.OffsetTo(BPoint(contLoc.x + kHPad, contLoc.y +
    350354            ((frame.Height() - iconBounds.Height()) / 2) + extra));
    351355        menu->DrawBitmapAsync(fIcon, dstRect);
    TTeamMenuItem::DrawContent()  
    357361        menu->MovePenTo(drawLoc);
    358362    }
    359363
    360     //  set the pen to black so that either method will draw in the same color
    361     //  low color is set in inherited::DrawContent, override makes sure its
    362     //  what we want
     364    // set the pen to black so that either method will draw in the same color
     365    // low color is set in inherited::DrawContent, override makes sure its
     366    // what we want
    363367    if (fDrawLabel) {
    364368        menu->SetDrawingMode(B_OP_OVER);
    365369        menu->SetHighColor(0, 0, 0);
    366370
    367         //  override the drawing of the content when the item is disabled
    368         //  the wrong lowcolor is used when the item is disabled since the
    369         //  text color does not change
    370         DrawContentLabel(); 
     371        // override the drawing of the content when the item is disabled
     372        // the wrong lowcolor is used when the item is disabled since the
     373        // text color does not change
     374        DrawContentLabel();
    371375    }
    372376
    373377    // Draw the expandable icon.
    TTeamMenuItem::DrawContent()  
    387391        } else {
    388392            rgb_color outlineColor = {80, 80, 80, 255};
    389393            rgb_color middleColor = {200, 200, 200, 255};
    390    
     394
    391395            menu->SetDrawingMode(B_OP_OVER);
    392    
     396
    393397            if (!fExpanded) {
    394398                menu->BeginLineArray(6);
    395    
    396                 menu->AddLine(BPoint(rect.left + 3, rect.top + 1), 
     399
     400                menu->AddLine(BPoint(rect.left + 3, rect.top + 1),
    397401                    BPoint(rect.left + 3, rect.bottom - 1), outlineColor);
    398                 menu->AddLine(BPoint(rect.left + 3, rect.top + 1), 
     402                menu->AddLine(BPoint(rect.left + 3, rect.top + 1),
    399403                    BPoint(rect.left + 7, rect.top + 5), outlineColor);
    400                 menu->AddLine(BPoint(rect.left + 7, rect.top + 5), 
     404                menu->AddLine(BPoint(rect.left + 7, rect.top + 5),
    401405                    BPoint(rect.left + 3, rect.bottom - 1), outlineColor);
    402    
    403                 menu->AddLine(BPoint(rect.left + 4, rect.top + 3), 
     406
     407                menu->AddLine(BPoint(rect.left + 4, rect.top + 3),
    404408                    BPoint(rect.left + 4, rect.bottom - 3), middleColor);
    405                 menu->AddLine(BPoint(rect.left + 5, rect.top + 4), 
     409                menu->AddLine(BPoint(rect.left + 5, rect.top + 4),
    406410                    BPoint(rect.left + 5, rect.bottom - 4), middleColor);
    407                 menu->AddLine(BPoint(rect.left + 5, rect.top + 5), 
     411                menu->AddLine(BPoint(rect.left + 5, rect.top + 5),
    408412                    BPoint(rect.left + 6, rect.top + 5), middleColor);
    409413                menu->EndLineArray();
    410414            } else {
    411415                // expanded state
    412    
     416
    413417                menu->BeginLineArray(6);
    414                 menu->AddLine(BPoint(rect.left + 1, rect.top + 3), 
     418                menu->AddLine(BPoint(rect.left + 1, rect.top + 3),
    415419                    BPoint(rect.right - 3, rect.top + 3), outlineColor);
    416                 menu->AddLine(BPoint(rect.left + 1, rect.top + 3), 
     420                menu->AddLine(BPoint(rect.left + 1, rect.top + 3),
    417421                    BPoint(rect.left + 5, rect.top + 7), outlineColor);
    418                 menu->AddLine(BPoint(rect.left + 5, rect.top + 7), 
     422                menu->AddLine(BPoint(rect.left + 5, rect.top + 7),
    419423                    BPoint(rect.right - 3, rect.top + 3), outlineColor);
    420    
    421                 menu->AddLine(BPoint(rect.left + 3, rect.top + 4), 
     424
     425                menu->AddLine(BPoint(rect.left + 3, rect.top + 4),
    422426                    BPoint(rect.right - 5, rect.top + 4), middleColor);
    423                 menu->AddLine(BPoint(rect.left + 4, rect.top + 5), 
     427                menu->AddLine(BPoint(rect.left + 4, rect.top + 5),
    424428                    BPoint(rect.right - 6, rect.top + 5), middleColor);
    425                 menu->AddLine(BPoint(rect.left + 5, rect.top + 5), 
     429                menu->AddLine(BPoint(rect.left + 5, rect.top + 5),
    426430                    BPoint(rect.left + 5, rect.top + 6), middleColor);
    427431                menu->EndLineArray();
    428432            }
    TTeamMenuItem::DrawContentLabel()  
    437441    BMenu* menu = Menu();
    438442    menu->MovePenBy(0, fLabelAscent);
    439443
    440     float cachedWidth = menu->StringWidth(Label()); 
     444    float cachedWidth = menu->StringWidth(Label());
    441445    if (Submenu() && fVertical)
    442446        cachedWidth += 18;
    443447
    444448    const char* label = Label();
    445449    char* truncLabel = NULL;
    446450    float max = 0;
     451
    447452    if (static_cast<TBarApp*>(be_app)->Settings()->superExpando && fVertical)
    448453        max = menu->MaxContentWidth() - kSwitchWidth;
    449454    else
    450455        max = menu->MaxContentWidth();
    451456
    452457    if (max > 0) {
    453         BPoint penloc = menu->PenLocation();
     458        BPoint penloc = menu->PenLocation();
    454459        BRect frame = Frame();
    455460        float offset = penloc.x - frame.left;
    456         if (cachedWidth + offset > max) {
     461        if (cachedWidth + offset > max) {
    457462            truncLabel = (char*)malloc(strlen(label) + 4);
    458463            if (!truncLabel)
    459464                return;
    void  
    491496TTeamMenuItem::ToggleExpandState(bool resizeWindow)
    492497{
    493498    fExpanded = !fExpanded;
    494    
     499
    495500    if (fExpanded) {
    496501        // Populate Menu() with the stuff from SubMenu().
    497502        TWindowMenu* sub = (static_cast<TWindowMenu*>(Submenu()));
    TTeamMenuItem::ToggleExpandState(bool resizeWindow)  
    503508            if (locked)
    504509                sub->UnlockLooper();
    505510
    506             if (sub->CountItems() > 1){
     511            if (sub->CountItems() > 1) {
    507512                TExpandoMenuBar* parent = static_cast<TExpandoMenuBar*>(Menu());
    508513                int myindex = parent->IndexOf(this) + 1;
    509514
    TTeamMenuItem::ToggleExpandState(bool resizeWindow)  
    553558TWindowMenuItem*
    554559TTeamMenuItem::ExpandedWindowItem(int32 id)
    555560{
    556     if (!fExpanded) // Paranoia
     561    if (!fExpanded) {
     562        // Paranoia
    557563        return NULL;
     564    }
    558565
    559566    TExpandoMenuBar* parent = static_cast<TExpandoMenuBar*>(Menu());
    560567    int childIndex = parent->IndexOf(this) + 1;
  • src/apps/deskbar/TeamMenuItem.h

    diff --git a/src/apps/deskbar/TeamMenuItem.h b/src/apps/deskbar/TeamMenuItem.h
    index efcd7d0..9bfd28b 100644
    a b Except as contained in this notice, the name of Be Incorporated shall not be  
    2626used in advertising or otherwise to promote the sale, use or other dealings in
    2727this Software without prior written authorization from Be Incorporated.
    2828
    29 Tracker(TM), Be(R), BeOS(R), and BeIA(TM) are trademarks or registered trademarks
    30 of Be Incorporated in the United States and other countries. Other brand product
    31 names are registered trademarks or trademarks of their respective holders.
     29Tracker(TM), Be(R), BeOS(R), and BeIA(TM) are trademarks or registered
     30trademarks of Be Incorporated in the United States and other countries. Other
     31brand product names are registered trademarks or trademarks of their respective
     32holders.
    3233All rights reserved.
    3334*/
    3435#ifndef TEAMMENUITEM_H
    class TTeamMenuItem : public BMenuItem {  
    5354            float width = -1.0f, float height = -1.0f,
    5455            bool drawLabel = true, bool vertical = true);
    5556        TTeamMenuItem(float width = -1.0f, float height = -1.0f,
    56             bool vertical=true);
     57            bool vertical = true);
    5758        virtual ~TTeamMenuItem();
    5859
    5960        status_t Invoke(BMessage* msg = NULL);
    class TTeamMenuItem : public BMenuItem {  
    8283        friend class TExpandoMenuBar;
    8384        void InitData(BList* team, BBitmap* icon, char* name, char* sig,
    8485            float width = -1.0f, float height = -1.0f,
    85             bool drawLabel = true,bool vertical=true);
     86            bool drawLabel = true, bool vertical = true);
    8687
    8788        bool _IsSelected() const;
    8889
  • src/apps/deskbar/TimeView.cpp

    diff --git a/src/apps/deskbar/TimeView.cpp b/src/apps/deskbar/TimeView.cpp
    index 16c4982..1c141b4 100644
    a b Except as contained in this notice, the name of Be Incorporated shall not be  
    2626used in advertising or otherwise to promote the sale, use or other dealings in
    2727this Software without prior written authorization from Be Incorporated.
    2828
    29 Tracker(TM), Be(R), BeOS(R), and BeIA(TM) are trademarks or registered trademarks
    30 of Be Incorporated in the United States and other countries. Other brand product
    31 names are registered trademarks or trademarks of their respective holders.
     29Tracker(TM), Be(R), BeOS(R), and BeIA(TM) are trademarks or registered
     30trademarks of Be Incorporated in the United States and other countries. Other
     31brand product names are registered trademarks or trademarks of their respective
     32holders.
    3233All rights reserved.
    3334*/
    3435
    TTimeView::GetPreferredSize(float* width, float* height)  
    154155
    155156    GetCurrentTime();
    156157
    157     // TODO: SetOrientation never gets called, fix that
    158     // When in vertical mode, we want to limit the width so that it can't
    159     // overlap the bevels in the parent view.
     158    // TODO: SetOrientation never gets called, fix that when in vertical mode,
     159    // we want to limit the width so that it can't overlap the bevels in the
     160    // parent view.
    160161    *width = fOrientation ?
    161162        min_c(fMaxWidth - kHMargin, kHMargin + StringWidth(fTimeStr))
    162163        : kHMargin + StringWidth(fTimeStr);
    TTimeView::MessageReceived(BMessage* message)  
    217218
    218219        default:
    219220            BView::MessageReceived(message);
     221            break;
    220222    }
    221223}
    222224
    TTimeView::GetCurrentDate()  
    262264
    263265    fLocale.FormatDate(tmp, 64, fTime, B_FULL_DATE_FORMAT);
    264266
    265     //  remove leading 0 from date when month is less than 10 (MM/DD/YY)
    266     //  or remove leading 0 from date when day is less than 10 (DD/MM/YY)
     267    // remove leading 0 from date when month is less than 10 (MM/DD/YY)
     268    // or remove leading 0 from date when day is less than 10 (DD/MM/YY)
    267269    const char* str = tmp;
    268270    if (str[0] == '0')
    269271        str++;
    TTimeView::Pulse()  
    325327        // For dates, Update() could be called two times in a row,
    326328        // but that should only happen very rarely
    327329        if ((fLastTimeStr[1] != fTimeStr[1]
    328                 && (fLastTimeStr[1] == ':' || fTimeStr[1] == ':'))
     330            && (fLastTimeStr[1] == ':' || fTimeStr[1] == ':'))
    329331            || !fLastTimeStr[0])
    330332            Update();
    331333
    TTimeView::Update()  
    361363    GetCurrentTime();
    362364    GetCurrentDate();
    363365
    364 
    365366    SetToolTip(fDateStr);
    366367
    367368    ResizeToPreferred();
  • src/apps/deskbar/TimeView.h

    diff --git a/src/apps/deskbar/TimeView.h b/src/apps/deskbar/TimeView.h
    index 6034fb0..f71c052 100644
    a b Except as contained in this notice, the name of Be Incorporated shall not be  
    2626used in advertising or otherwise to promote the sale, use or other dealings in
    2727this Software without prior written authorization from Be Incorporated.
    2828
    29 Tracker(TM), Be(R), BeOS(R), and BeIA(TM) are trademarks or registered trademarks
    30 of Be Incorporated in the United States and other countries. Other brand product
    31 names are registered trademarks or trademarks of their respective holders.
     29Tracker(TM), Be(R), BeOS(R), and BeIA(TM) are trademarks or registered
     30trademarks of Be Incorporated in the United States and other countries. Other
     31brand product names are registered trademarks or trademarks of their respective
     32holders.
    3233All rights reserved.
    3334*/
    3435#ifndef TIME_VIEW_H
    class TTimeView : public BView {  
    7374        void        MouseDown(BPoint where);
    7475        void        Pulse();
    7576
    76         bool        ShowingSeconds()    { return fShowSeconds; }
     77        bool        ShowingSeconds() { return fShowSeconds; }
    7778        void        ShowSeconds(bool);
    7879        void        ShowCalendar(BPoint where);
    7980
    class TTimeView : public BView {  
    110111
    111112        float       fMaxWidth;
    112113        float       fHeight;
    113         bool        fOrientation;       // vertical = true
     114        bool        fOrientation; // vertical = true
    114115        BPoint      fTimeLocation;
    115116        BPoint      fDateLocation;
    116117
  • src/apps/deskbar/WindowMenu.cpp

    diff --git a/src/apps/deskbar/WindowMenu.cpp b/src/apps/deskbar/WindowMenu.cpp
    index 895b890..59e31fc 100644
    a b Except as contained in this notice, the name of Be Incorporated shall not be  
    2626used in advertising or otherwise to promote the sale, use or other dealings in
    2727this Software without prior written authorization from Be Incorporated.
    2828
    29 Tracker(TM), Be(R), BeOS(R), and BeIA(TM) are trademarks or registered trademarks
    30 of Be Incorporated in the United States and other countries. Other brand product
    31 names are registered trademarks or trademarks of their respective holders.
     29Tracker(TM), Be(R), BeOS(R), and BeIA(TM) are trademarks or registered
     30trademarks of Be Incorporated in the United States and other countries. Other
     31brand product names are registered trademarks or trademarks of their respective
     32holders.
    3233All rights reserved.
    3334*/
    3435
    void  
    8889TWindowMenu::AttachedToWindow()
    8990{
    9091    SetFont(be_plain_font);
    91 
    9292    RemoveItems(0, CountItems(), true);
    93 
    9493    int32 miniCount = 0;
    9594
    9695    bool dragging = false;
    9796    TBarView* barview =(static_cast<TBarApp*>(be_app))->BarView();
    9897    if (barview && barview->LockLooper()) {
    99         //  'dragging' mode set in BarView::CacheDragData
    100         //      invoke in MouseEnter in ExpandoMenuBar
     98        // 'dragging' mode set in BarView::CacheDragData
     99        // invoke in MouseEnter in ExpandoMenuBar
    101100        dragging = barview->Dragging();
    102101        if (dragging) {
    103102            // We don't want to show the menu when dragging, but it's not
    TWindowMenu::AttachedToWindow()  
    105104            // Don't call BMenu::Hide(), it causes the menu to pop up every now
    106105            // and then.
    107106            Window()->Hide();
    108             //  if in expando (horizontal or vertical)
     107            // if in expando (horizontal or vertical)
    109108            if (barview->Expando()) {
    110109                SetTrackingHook(barview->MenuTrackingHook,
    111110                    barview->GetTrackingHookData());
    TWindowMenu::AttachedToWindow()  
    177176
    178177    int32 itemCount = CountItems() + parentMenuItems;
    179178    if (itemCount < 1) {
    180         TWindowMenuItem* noWindowsItem =
    181             new TWindowMenuItem(B_TRANSLATE("No windows"), -1, false, false);
     179        TWindowMenuItem* noWindowsItem
     180            = new TWindowMenuItem(B_TRANSLATE("No windows"), -1, false, false);
    182181
    183182        noWindowsItem->SetEnabled(false);
    184183
    TWindowMenu::AttachedToWindow()  
    186185
    187186        // if an application has no windows, this feature makes it easy to quit
    188187        // it. (but we only add this option if the application is not Tracker.)
    189         if (fApplicationSignature.ICompare(kTrackerSignature) != 0) {
     188        if (fApplicationSignature.ICompare(kTrackerSignature) != 0) {
    190189            AddSeparatorItem();
    191190            AddItem(new TShowHideMenuItem(B_TRANSLATE("Quit application"),
    192191                fTeam, B_QUIT_REQUESTED));
    193         }
     192        }
    194193    } else {
    195         //  if we are in drag mode, then don't add the window controls
    196         //  to the menu
     194        // if we are in drag mode, then don't add the window controls
     195        // to the menu
    197196        if (!dragging) {
    198             TShowHideMenuItem* hide =
    199                 new TShowHideMenuItem(B_TRANSLATE("Hide all"), fTeam,
     197            TShowHideMenuItem* hide
     198                = new TShowHideMenuItem(B_TRANSLATE("Hide all"), fTeam,
    200199                    B_MINIMIZE_WINDOW);
    201             TShowHideMenuItem* show =
    202                 new TShowHideMenuItem(B_TRANSLATE("Show all"), fTeam,
     200            TShowHideMenuItem* show
     201                = new TShowHideMenuItem(B_TRANSLATE("Show all"), fTeam,
    203202                    B_BRING_TO_FRONT);
    204             TShowHideMenuItem* close =
    205                 new TShowHideMenuItem(B_TRANSLATE("Close all"), fTeam,
     203            TShowHideMenuItem* close
     204                = new TShowHideMenuItem(B_TRANSLATE("Close all"), fTeam,
    206205                    B_QUIT_REQUESTED);
    207206
    208207            if (miniCount == itemCount)
    TWindowMenu::AttachedToWindow()  
    212211
    213212            if (!parentMenuItems)
    214213                AddSeparatorItem();
     214
    215215            AddItem(hide);
    216216            AddItem(show);
    217217            AddItem(close);
    TWindowMenu::AttachedToWindow()  
    225225void
    226226TWindowMenu::DetachedFromWindow()
    227227{
    228     // in expando mode the teammenu will not call DragStop,
    229     // thus, it needs to be called from here
     228    // in expando mode the teammenu will not call DragStop, thus, it needs to
     229    // be called from here
    230230    TBarView* barview = (dynamic_cast<TBarApp*>(be_app))->BarView();
    231231    if (barview && barview->Expando() && barview->Dragging()
    232232        && barview->LockLooper()) {
    233         // We changed the show level in AttachedToWindow().  Undo it.
     233        // We changed the show level in AttachedToWindow(). Undo it.
    234234        Window()->Show();
    235235        barview->DragStop();
    236236        barview->UnlockLooper();
  • src/apps/deskbar/WindowMenu.h

    diff --git a/src/apps/deskbar/WindowMenu.h b/src/apps/deskbar/WindowMenu.h
    index 108f688..4204c07 100644
    a b Except as contained in this notice, the name of Be Incorporated shall not be  
    2626used in advertising or otherwise to promote the sale, use or other dealings in
    2727this Software without prior written authorization from Be Incorporated.
    2828
    29 Tracker(TM), Be(R), BeOS(R), and BeIA(TM) are trademarks or registered trademarks
    30 of Be Incorporated in the United States and other countries. Other brand product
    31 names are registered trademarks or trademarks of their respective holders.
     29Tracker(TM), Be(R), BeOS(R), and BeIA(TM) are trademarks or registered
     30trademarks of Be Incorporated in the United States and other countries. Other
     31brand product names are registered trademarks or trademarks of their respective
     32holders.
    3233All rights reserved.
    3334*/
    3435
    35 //  list of windows for a specific application
    36 //  always submenu for a TeamMenuItem
    37 //  all DB positions
     36// list of windows for a specific application
     37// always submenu for a TeamMenuItem
     38// all DB positions
    3839
    3940#ifndef WINDOWMENU_H
    4041#define WINDOWMENU_H
  • src/apps/deskbar/WindowMenuItem.cpp

    diff --git a/src/apps/deskbar/WindowMenuItem.cpp b/src/apps/deskbar/WindowMenuItem.cpp
    index ddf94f4..3e23585 100644
    a b Except as contained in this notice, the name of Be Incorporated shall not be  
    2626used in advertising or otherwise to promote the sale, use or other dealings in
    2727this Software without prior written authorization from Be Incorporated.
    2828
    29 Tracker(TM), Be(R), BeOS(R), and BeIA(TM) are trademarks or registered trademarks
    30 of Be Incorporated in the United States and other countries. Other brand product
    31 names are registered trademarks or trademarks of their respective holders.
     29Tracker(TM), Be(R), BeOS(R), and BeIA(TM) are trademarks or registered
     30trademarks of Be Incorporated in the United States and other countries. Other
     31brand product names are registered trademarks or trademarks of their respective
     32holders.
    3233All rights reserved.
    3334*/
    3435
    All rights reserved.  
    4849#include "WindowMenu.h"
    4950
    5051
    51 const float kHPad = 10.0f;
    52 const float kVPad = 2.0f;
    53 const float kLabelOffset = 8.0f;
    54 const BRect kIconRect(1.0f, 1.0f, 13.0f, 14.0f);
     52const float kHPad = 10.0f;
     53const float kVPad = 2.0f;
     54const float kLabelOffset = 8.0f;
     55const BRect kIconRect(1.0f, 1.0f, 13.0f, 14.0f);
    5556
    5657
    5758TWindowMenuItem::TWindowMenuItem(const char* title, int32 id, bool mini,
    void  
    7576TWindowMenuItem::Initialize(const char* title)
    7677{
    7778    if (fMini) {
    78         fBitmap = fCurrentWorkSpace
     79        fBitmap = fCurrentWorkSpace
    7980            ? AppResSet()->FindBitmap(B_MESSAGE_TYPE, R_WindowHiddenIcon)
    8081            : AppResSet()->FindBitmap(B_MESSAGE_TYPE, R_WindowHiddenSwitchIcon);
    8182    } else {
    82         fBitmap = fCurrentWorkSpace
     83        fBitmap = fCurrentWorkSpace
    8384            ? AppResSet()->FindBitmap(B_MESSAGE_TYPE, R_WindowShownIcon)
    8485            : AppResSet()->FindBitmap(B_MESSAGE_TYPE, R_WindowShownSwitchIcon);
    8586    }
    TWindowMenuItem::Draw()  
    204205
    205206    menu->PushState();
    206207
    207     //  if not selected or being tracked on, fill with gray
     208    // if not selected or being tracked on, fill with gray
    208209    TBarView* barview = (static_cast<TBarApp*>(be_app))->BarView();
    209210    if ((!IsSelected() && !menu->IsRedrawAfterSticky())
    210211        || barview->Dragging() || !IsEnabled()) {
    TWindowMenuItem::DrawContent()  
    241242
    242243    BRect frame(Frame());
    243244    BPoint contLoc = ContentLocation() + BPoint(kHPad, kVPad);
    244 //  if (fExpanded)
    245 //      contLoc.x += kHPad;
     245    //if (fExpanded)
     246    //  contLoc.x += kHPad;
    246247
    247248    if (fID >= 0) {
    248249        menu->SetDrawingMode(B_OP_OVER);
  • src/apps/deskbar/WindowMenuItem.h

    diff --git a/src/apps/deskbar/WindowMenuItem.h b/src/apps/deskbar/WindowMenuItem.h
    index bfe14da..d777b73 100644
    a b Except as contained in this notice, the name of Be Incorporated shall not be  
    2626used in advertising or otherwise to promote the sale, use or other dealings in
    2727this Software without prior written authorization from Be Incorporated.
    2828
    29 Tracker(TM), Be(R), BeOS(R), and BeIA(TM) are trademarks or registered trademarks
    30 of Be Incorporated in the United States and other countries. Other brand product
    31 names are registered trademarks or trademarks of their respective holders.
     29Tracker(TM), Be(R), BeOS(R), and BeIA(TM) are trademarks or registered
     30trademarks of Be Incorporated in the United States and other countries. Other
     31brand product names are registered trademarks or trademarks of their respective
     32holders.
    3233All rights reserved.
    3334*/
    3435#ifndef WINDOWMENUITEM_H
    public:  
    6970
    7071protected:
    7172            void                Initialize(const char* title);
    72     virtual void                GetContentSize(float* width, float* height);
     73    virtual void                GetContentSize(float* width, float* height);
    7374    virtual void                DrawContent();
    7475    virtual status_t            Invoke(BMessage* message = NULL);
    7576    virtual void                Draw();
    private:  
    9192
    9293
    9394#endif  /* WINDOWMENUITEM_H */
     95