Show
Ignore:
Timestamp:
03/21/12 18:36:20 (3 years ago)
Author:
robert
Message:

Ran script to remove trailing spaces and tabs

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • OpenSceneGraph/trunk/src/osgGA/EventQueue.cpp

    r12938 r13041  
    1 /* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield  
     1/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield 
    22 * 
    3  * This library is open source and may be redistributed and/or modified under   
    4  * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or  
     3 * This library is open source and may be redistributed and/or modified under 
     4 * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or 
    55 * (at your option) any later version.  The full license is in LICENSE file 
    66 * included with this distribution, and on the openscenegraph.org website. 
    7  *  
     7 * 
    88 * This library is distributed in the hope that it will be useful, 
    99 * but WITHOUT ANY WARRANTY; without even the implied warranty of 
    10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the  
     10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
    1111 * OpenSceneGraph Public License for more details. 
    1212*/ 
     
    2525    _accumulateEventState = new GUIEventAdapter(); 
    2626    _accumulateEventState->setMouseYOrientation(mouseYOrientation); 
    27      
     27 
    2828    _firstTouchEmulatesMouse = true; 
    2929} 
     
    8282 
    8383        if (ritr==_eventQueue.rend()) return false; 
    84          
     84 
    8585        for(Events::iterator itr = _eventQueue.begin(); 
    8686            itr != ritr.base(); 
     
    151151    event->setPenPressure(pressure); 
    152152    event->setTime(time); 
    153      
     153 
    154154    addEvent(event); 
    155155} 
     
    163163    event->setPenRotation(rotation); 
    164164    event->setTime(time); 
    165      
     165 
    166166    addEvent(event); 
    167167} 
     
    173173    event->setTabletPointerType(pt); 
    174174    event->setTime(time); 
    175      
     175 
    176176    addEvent(event); 
    177177} 
     
    183183    event->setScrollingMotion(sm); 
    184184    event->setTime(time); 
    185      
     185 
    186186    addEvent(event); 
    187187} 
     
    193193    event->setScrollingMotionDelta(x,y); 
    194194    event->setTime(time); 
    195      
     195 
    196196    addEvent(event); 
    197197} 
     
    213213    event->setEventType(event->getButtonMask() ? GUIEventAdapter::DRAG : GUIEventAdapter::MOVE); 
    214214    event->setTime(time); 
    215      
     215 
    216216    addEvent(event); 
    217217} 
     
    224224    switch(button) 
    225225    { 
    226         case(1):  
     226        case(1): 
    227227            _accumulateEventState->setButtonMask(GUIEventAdapter::LEFT_MOUSE_BUTTON | _accumulateEventState->getButtonMask()); 
    228228            break; 
    229         case(2):  
     229        case(2): 
    230230            _accumulateEventState->setButtonMask(GUIEventAdapter::MIDDLE_MOUSE_BUTTON | _accumulateEventState->getButtonMask()); 
    231231            break; 
    232         case(3):  
     232        case(3): 
    233233            _accumulateEventState->setButtonMask(GUIEventAdapter::RIGHT_MOUSE_BUTTON | _accumulateEventState->getButtonMask()); 
    234234            break; 
     
    241241    switch(button) 
    242242    { 
    243         case(1):  
     243        case(1): 
    244244            event->setButton(GUIEventAdapter::LEFT_MOUSE_BUTTON); 
    245245            break; 
    246         case(2):  
     246        case(2): 
    247247            event->setButton(GUIEventAdapter::MIDDLE_MOUSE_BUTTON); 
    248248            break; 
    249         case(3):  
     249        case(3): 
    250250            event->setButton(GUIEventAdapter::RIGHT_MOUSE_BUTTON); 
    251251            break; 
    252252    } 
    253      
     253 
    254254    addEvent(event); 
    255255} 
     
    262262    switch(button) 
    263263    { 
    264         case(1):  
     264        case(1): 
    265265            _accumulateEventState->setButtonMask(GUIEventAdapter::LEFT_MOUSE_BUTTON | _accumulateEventState->getButtonMask()); 
    266266            break; 
    267         case(2):  
     267        case(2): 
    268268            _accumulateEventState->setButtonMask(GUIEventAdapter::MIDDLE_MOUSE_BUTTON | _accumulateEventState->getButtonMask()); 
    269269            break; 
    270         case(3):  
     270        case(3): 
    271271            _accumulateEventState->setButtonMask(GUIEventAdapter::RIGHT_MOUSE_BUTTON | _accumulateEventState->getButtonMask()); 
    272272            break; 
     
    279279    switch(button) 
    280280    { 
    281         case(1):  
     281        case(1): 
    282282            event->setButton(GUIEventAdapter::LEFT_MOUSE_BUTTON); 
    283283            break; 
    284         case(2):  
     284        case(2): 
    285285            event->setButton(GUIEventAdapter::MIDDLE_MOUSE_BUTTON); 
    286286            break; 
    287         case(3):  
     287        case(3): 
    288288            event->setButton(GUIEventAdapter::RIGHT_MOUSE_BUTTON); 
    289289            break; 
    290290    } 
    291      
     291 
    292292    addEvent(event); 
    293293} 
     
    300300    switch(button) 
    301301    { 
    302         case(1):  
     302        case(1): 
    303303            _accumulateEventState->setButtonMask(~GUIEventAdapter::LEFT_MOUSE_BUTTON & _accumulateEventState->getButtonMask()); 
    304304            break; 
    305         case(2):  
     305        case(2): 
    306306            _accumulateEventState->setButtonMask(~GUIEventAdapter::MIDDLE_MOUSE_BUTTON & _accumulateEventState->getButtonMask()); 
    307307            break; 
    308         case(3):  
     308        case(3): 
    309309            _accumulateEventState->setButtonMask(~GUIEventAdapter::RIGHT_MOUSE_BUTTON & _accumulateEventState->getButtonMask()); 
    310310            break; 
     
    317317    switch(button) 
    318318    { 
    319         case(1):  
     319        case(1): 
    320320            event->setButton(GUIEventAdapter::LEFT_MOUSE_BUTTON); 
    321321            break; 
    322         case(2):  
     322        case(2): 
    323323            event->setButton(GUIEventAdapter::MIDDLE_MOUSE_BUTTON); 
    324324            break; 
    325         case(3):  
     325        case(3): 
    326326            event->setButton(GUIEventAdapter::RIGHT_MOUSE_BUTTON); 
    327327            break; 
    328328    } 
    329      
     329 
    330330    addEvent(event); 
    331331} 
     
    349349        case(GUIEventAdapter::KEY_Caps_Lock): 
    350350        { 
    351             if ((_accumulateEventState->getModKeyMask() & GUIEventAdapter::MODKEY_CAPS_LOCK)!=0)  
     351            if ((_accumulateEventState->getModKeyMask() & GUIEventAdapter::MODKEY_CAPS_LOCK)!=0) 
    352352                _accumulateEventState->setModKeyMask(~GUIEventAdapter::MODKEY_CAPS_LOCK & _accumulateEventState->getModKeyMask()); 
    353             else  
    354                 _accumulateEventState->setModKeyMask(GUIEventAdapter::MODKEY_CAPS_LOCK | _accumulateEventState->getModKeyMask());  
     353            else 
     354                _accumulateEventState->setModKeyMask(GUIEventAdapter::MODKEY_CAPS_LOCK | _accumulateEventState->getModKeyMask()); 
    355355            break; 
    356356        } 
     
    364364        } 
    365365        default: break; 
    366     }         
     366    } 
    367367 
    368368    GUIEventAdapter* event = new GUIEventAdapter(*_accumulateEventState); 
     
    371371    event->setUnmodifiedKey(unmodifiedKey); 
    372372    event->setTime(time); 
    373      
     373 
    374374    addEvent(event); 
    375375} 
     
    392392        case(GUIEventAdapter::KEY_Hyper_R):      _accumulateEventState->setModKeyMask(~GUIEventAdapter::MODKEY_RIGHT_HYPER & _accumulateEventState->getModKeyMask()); break; 
    393393        default: break; 
    394     }         
     394    } 
    395395 
    396396    GUIEventAdapter* event = new GUIEventAdapter(*_accumulateEventState); 
     
    399399    event->setUnmodifiedKey(unmodifiedKey); 
    400400    event->setTime(time); 
    401      
     401 
    402402    addEvent(event); 
    403403} 
     
    406406GUIEventAdapter*  EventQueue::touchBegan(unsigned int id, GUIEventAdapter::TouchPhase phase, float x, float y, double time) 
    407407{ 
    408     if(_firstTouchEmulatesMouse)  
     408    if(_firstTouchEmulatesMouse) 
    409409    { 
    410410        // emulate left mouse button press 
    411          
     411 
    412412        _accumulateEventState->setButtonMask((1) | _accumulateEventState->getButtonMask()); 
    413413        _accumulateEventState->setX(x); 
    414414        _accumulateEventState->setY(y); 
    415415    } 
    416      
     416 
    417417    GUIEventAdapter* event = new GUIEventAdapter(*_accumulateEventState); 
    418418    event->setEventType(GUIEventAdapter::PUSH); 
    419419    event->setTime(time); 
    420420    event->addTouchPoint(id, phase, x, y, 0); 
    421    
    422     addEvent(event); 
    423      
     421 
     422    addEvent(event); 
     423 
    424424    return event; 
    425425} 
    426          
    427          
     426 
     427 
    428428GUIEventAdapter*  EventQueue::touchMoved(unsigned int id, GUIEventAdapter::TouchPhase phase, float x, float y, double time) 
    429429{ 
     
    433433        _accumulateEventState->setY(y); 
    434434    } 
    435      
     435 
    436436    GUIEventAdapter* event = new GUIEventAdapter(*_accumulateEventState); 
    437437    event->setEventType(GUIEventAdapter::DRAG); 
     
    439439    event->addTouchPoint(id, phase, x, y, 0); 
    440440    addEvent(event); 
    441      
     441 
    442442    return event; 
    443443} 
     
    445445GUIEventAdapter*  EventQueue::touchEnded(unsigned int id, GUIEventAdapter::TouchPhase phase, float x, float y, unsigned int tap_count, double time) 
    446446{ 
    447     if (_firstTouchEmulatesMouse)  
     447    if (_firstTouchEmulatesMouse) 
    448448    { 
    449449        _accumulateEventState->setButtonMask(~(1) & _accumulateEventState->getButtonMask()); 
     
    451451        _accumulateEventState->setY(y); 
    452452    } 
    453      
     453 
    454454    GUIEventAdapter* event = new GUIEventAdapter(*_accumulateEventState); 
    455455    event->setEventType(GUIEventAdapter::RELEASE); 
     
    457457    event->addTouchPoint(id, phase, x, y, tap_count); 
    458458    addEvent(event); 
    459      
     459 
    460460    return event; 
    461461} 
    462          
     462 
    463463 
    464464void EventQueue::closeWindow(double time) 
     
    467467    event->setEventType(GUIEventAdapter::CLOSE_WINDOW); 
    468468    event->setTime(time); 
    469    
     469 
    470470    addEvent(event); 
    471471} 
     
    476476    event->setEventType(GUIEventAdapter::QUIT_APPLICATION); 
    477477    event->setTime(time); 
    478    
     478 
    479479    addEvent(event); 
    480480} 
     
    486486    event->setEventType(GUIEventAdapter::FRAME); 
    487487    event->setTime(time); 
    488      
     488 
    489489    addEvent(event); 
    490490} 
     
    492492GUIEventAdapter* EventQueue::createEvent() 
    493493{ 
    494     if (_accumulateEventState.valid()) return new GUIEventAdapter(*_accumulateEventState.get());  
    495     else return new GUIEventAdapter();     
     494    if (_accumulateEventState.valid()) return new GUIEventAdapter(*_accumulateEventState.get()); 
     495    else return new GUIEventAdapter(); 
    496496} 
    497497 
     
    502502    event->setUserData(userEventData); 
    503503    event->setTime(time); 
    504      
    505     addEvent(event); 
    506 } 
    507  
    508  
     504 
     505    addEvent(event); 
     506} 
     507 
     508