Blender V2.61 - r43446

GHOST_Buttons.cpp

Go to the documentation of this file.
00001 /*
00002  * ***** BEGIN GPL LICENSE BLOCK *****
00003  *
00004  * This program is free software; you can redistribute it and/or
00005  * modify it under the terms of the GNU General Public License
00006  * as published by the Free Software Foundation; either version 2
00007  * of the License, or (at your option) any later version.
00008  *
00009  * This program is distributed in the hope that it will be useful,
00010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012  * GNU General Public License for more details.
00013  *
00014  * You should have received a copy of the GNU General Public License
00015  * along with this program; if not, write to the Free Software Foundation,
00016  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
00017  *
00018  * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
00019  * All rights reserved.
00020  *
00021  * The Original Code is: all of this file.
00022  *
00023  * Contributor(s): none yet.
00024  *
00025  * ***** END GPL LICENSE BLOCK *****
00026  */
00027 
00033 #include "GHOST_Buttons.h"
00034 
00035 
00036 
00037 GHOST_Buttons::GHOST_Buttons()
00038 {
00039     clear();
00040 }
00041 
00042 
00043 bool GHOST_Buttons::get(GHOST_TButtonMask mask) const
00044 {
00045     switch (mask) {
00046     case GHOST_kButtonMaskLeft:
00047         return m_ButtonLeft;
00048     case GHOST_kButtonMaskMiddle:
00049         return m_ButtonMiddle;
00050     case GHOST_kButtonMaskRight:
00051         return m_ButtonRight;
00052     default:
00053         return false;
00054     }
00055 }
00056 
00057 void GHOST_Buttons::set(GHOST_TButtonMask mask, bool down)
00058 {
00059     switch (mask) {
00060     case GHOST_kButtonMaskLeft:
00061         m_ButtonLeft = down; break;
00062     case GHOST_kButtonMaskMiddle:
00063         m_ButtonMiddle = down; break;
00064     case GHOST_kButtonMaskRight:
00065         m_ButtonRight = down; break;
00066     default:
00067         break;
00068     }
00069 }
00070 
00071 void GHOST_Buttons::clear()
00072 {
00073     m_ButtonLeft = false;
00074     m_ButtonMiddle = false;
00075     m_ButtonRight = false;
00076 }
00077 
00078 GHOST_Buttons::~GHOST_Buttons() {}