Ticket #7052: Deskbar_BarView_cpp_style_fix.diff

File Deskbar_BarView_cpp_style_fix.diff, 7.5 KB (added by jscipione, 13 years ago)
  • 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