• Main Page
  • Classes
  • Files
  • File List

IPrimaryScreen.cpp

00001 /*
00002  * synergy -- mouse and keyboard sharing utility
00003  * Copyright (C) 2012 Bolton Software Ltd.
00004  * Copyright (C) 2004 Chris Schoeneman
00005  * 
00006  * This package is free software; you can redistribute it and/or
00007  * modify it under the terms of the GNU General Public License
00008  * found in the file COPYING that should have accompanied this file.
00009  * 
00010  * This package is distributed in the hope that it will be useful,
00011  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013  * GNU General Public License for more details.
00014  *
00015  * You should have received a copy of the GNU General Public License
00016  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
00017  */
00018 
00019 #include "IPrimaryScreen.h"
00020 #include "CEventQueue.h"
00021 #include <cstdlib>
00022 
00023 //
00024 // IPrimaryScreen
00025 //
00026 
00027 CEvent::Type        IPrimaryScreen::s_buttonDownEvent      = CEvent::kUnknown;
00028 CEvent::Type        IPrimaryScreen::s_buttonUpEvent        = CEvent::kUnknown;
00029 CEvent::Type        IPrimaryScreen::s_motionPrimaryEvent   = CEvent::kUnknown;
00030 CEvent::Type        IPrimaryScreen::s_motionSecondaryEvent = CEvent::kUnknown;
00031 CEvent::Type        IPrimaryScreen::s_wheelEvent           = CEvent::kUnknown;
00032 CEvent::Type        IPrimaryScreen::s_ssActivatedEvent     = CEvent::kUnknown;
00033 CEvent::Type        IPrimaryScreen::s_ssDeactivatedEvent   = CEvent::kUnknown;
00034 CEvent::Type        IPrimaryScreen::s_hotKeyDownEvent      = CEvent::kUnknown;
00035 CEvent::Type        IPrimaryScreen::s_hotKeyUpEvent        = CEvent::kUnknown;
00036 CEvent::Type        IPrimaryScreen::s_fakeInputBegin       = CEvent::kUnknown;
00037 CEvent::Type        IPrimaryScreen::s_fakeInputEnd         = CEvent::kUnknown;
00038 CEvent::Type        IPrimaryScreen::s_gameButtonsEvent     = CEvent::kUnknown;
00039 CEvent::Type        IPrimaryScreen::s_gameSticksEvent      = CEvent::kUnknown;
00040 CEvent::Type        IPrimaryScreen::s_gameTriggersEvent    = CEvent::kUnknown;
00041 CEvent::Type        IPrimaryScreen::s_gameTimingReqEvent   = CEvent::kUnknown;
00042 
00043 CEvent::Type
00044 IPrimaryScreen::getButtonDownEvent()
00045 {
00046     return EVENTQUEUE->registerTypeOnce(s_buttonDownEvent,
00047                             "IPrimaryScreen::buttonDown");
00048 }
00049 
00050 CEvent::Type
00051 IPrimaryScreen::getButtonUpEvent()
00052 {
00053     return EVENTQUEUE->registerTypeOnce(s_buttonUpEvent,
00054                             "IPrimaryScreen::buttonUp");
00055 }
00056 
00057 CEvent::Type
00058 IPrimaryScreen::getMotionOnPrimaryEvent()
00059 {
00060     return EVENTQUEUE->registerTypeOnce(s_motionPrimaryEvent,
00061                             "IPrimaryScreen::motionPrimary");
00062 }
00063 
00064 CEvent::Type
00065 IPrimaryScreen::getMotionOnSecondaryEvent()
00066 {
00067     return EVENTQUEUE->registerTypeOnce(s_motionSecondaryEvent,
00068                             "IPrimaryScreen::motionSecondary");
00069 }
00070 
00071 CEvent::Type
00072 IPrimaryScreen::getWheelEvent()
00073 {
00074     return EVENTQUEUE->registerTypeOnce(s_wheelEvent,
00075                             "IPrimaryScreen::wheel");
00076 }
00077 
00078 CEvent::Type
00079 IPrimaryScreen::getScreensaverActivatedEvent()
00080 {
00081     return EVENTQUEUE->registerTypeOnce(s_ssActivatedEvent,
00082                             "IPrimaryScreen::screensaverActivated");
00083 }
00084 
00085 CEvent::Type
00086 IPrimaryScreen::getScreensaverDeactivatedEvent()
00087 {
00088     return EVENTQUEUE->registerTypeOnce(s_ssDeactivatedEvent,
00089                             "IPrimaryScreen::screensaverDeactivated");
00090 }
00091 
00092 CEvent::Type
00093 IPrimaryScreen::getHotKeyDownEvent()
00094 {
00095     return EVENTQUEUE->registerTypeOnce(s_hotKeyDownEvent,
00096                             "IPrimaryScreen::hotKeyDown");
00097 }
00098 
00099 CEvent::Type
00100 IPrimaryScreen::getHotKeyUpEvent()
00101 {
00102     return EVENTQUEUE->registerTypeOnce(s_hotKeyUpEvent,
00103                             "IPrimaryScreen::hotKeyUp");
00104 }
00105 
00106 CEvent::Type
00107 IPrimaryScreen::getFakeInputBeginEvent()
00108 {
00109     return EVENTQUEUE->registerTypeOnce(s_fakeInputBegin,
00110                             "IPrimaryScreen::fakeInputBegin");
00111 }
00112 
00113 CEvent::Type
00114 IPrimaryScreen::getFakeInputEndEvent()
00115 {
00116     return EVENTQUEUE->registerTypeOnce(s_fakeInputEnd,
00117                             "IPrimaryScreen::fakeInputEnd");
00118 }
00119 
00120 CEvent::Type
00121 IPrimaryScreen::getGameDeviceButtonsEvent()
00122 {
00123     return EVENTQUEUE->registerTypeOnce(s_gameButtonsEvent,
00124                             "IPrimaryScreen::getGameDeviceButtonsEvent");
00125 }
00126 
00127 CEvent::Type
00128 IPrimaryScreen::getGameDeviceSticksEvent()
00129 {
00130     return EVENTQUEUE->registerTypeOnce(s_gameSticksEvent,
00131                             "IPrimaryScreen::getGameDeviceSticksEvent");
00132 }
00133 
00134 CEvent::Type
00135 IPrimaryScreen::getGameDeviceTriggersEvent()
00136 {
00137     return EVENTQUEUE->registerTypeOnce(s_gameTriggersEvent,
00138                             "IPrimaryScreen::getGameDeviceTriggersEvent");
00139 }
00140 
00141 CEvent::Type
00142 IPrimaryScreen::getGameDeviceTimingReqEvent()
00143 {
00144     return EVENTQUEUE->registerTypeOnce(s_gameTimingReqEvent,
00145         "IPrimaryScreen::getGameDeviceTimingReqEvent");
00146 }
00147 
00148 //
00149 // IPrimaryScreen::CButtonInfo
00150 //
00151 
00152 IPrimaryScreen::CButtonInfo*
00153 IPrimaryScreen::CButtonInfo::alloc(ButtonID id, KeyModifierMask mask)
00154 {
00155     CButtonInfo* info = (CButtonInfo*)malloc(sizeof(CButtonInfo));
00156     info->m_button = id;
00157     info->m_mask   = mask;
00158     return info;
00159 }
00160 
00161 IPrimaryScreen::CButtonInfo*
00162 IPrimaryScreen::CButtonInfo::alloc(const CButtonInfo& x)
00163 {
00164     CButtonInfo* info = (CButtonInfo*)malloc(sizeof(CButtonInfo));
00165     info->m_button = x.m_button;
00166     info->m_mask   = x.m_mask;
00167     return info;
00168 }
00169 
00170 bool
00171 IPrimaryScreen::CButtonInfo::equal(const CButtonInfo* a, const CButtonInfo* b)
00172 {
00173     return (a->m_button == b->m_button && a->m_mask == b->m_mask);
00174 }
00175 
00176 
00177 //
00178 // IPrimaryScreen::CMotionInfo
00179 //
00180 
00181 IPrimaryScreen::CMotionInfo*
00182 IPrimaryScreen::CMotionInfo::alloc(SInt32 x, SInt32 y)
00183 {
00184     CMotionInfo* info = (CMotionInfo*)malloc(sizeof(CMotionInfo));
00185     info->m_x = x;
00186     info->m_y = y;
00187     return info;
00188 }
00189 
00190 
00191 //
00192 // IPrimaryScreen::CWheelInfo
00193 //
00194 
00195 IPrimaryScreen::CWheelInfo*
00196 IPrimaryScreen::CWheelInfo::alloc(SInt32 xDelta, SInt32 yDelta)
00197 {
00198     CWheelInfo* info = (CWheelInfo*)malloc(sizeof(CWheelInfo));
00199     info->m_xDelta = xDelta;
00200     info->m_yDelta = yDelta;
00201     return info;
00202 }
00203 
00204 
00205 //
00206 // IPrimaryScreen::CHotKeyInfo
00207 //
00208 
00209 IPrimaryScreen::CHotKeyInfo*
00210 IPrimaryScreen::CHotKeyInfo::alloc(UInt32 id)
00211 {
00212     CHotKeyInfo* info = (CHotKeyInfo*)malloc(sizeof(CHotKeyInfo));
00213     info->m_id = id;
00214     return info;
00215 }

Generated on Mon May 20 2013 00:00:06 for Synergy by  doxygen 1.7.1