IPrimaryScreen.cpp

00001 /*
00002  * synergy -- mouse and keyboard sharing utility
00003  * Copyright (C) 2004 Chris Schoeneman
00004  * 
00005  * This package is free software; you can redistribute it and/or
00006  * modify it under the terms of the GNU General Public License
00007  * found in the file COPYING that should have accompanied this file.
00008  * 
00009  * This package 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 
00015 #include "IPrimaryScreen.h"
00016 #include <cstdlib>
00017 
00018 //
00019 // IPrimaryScreen
00020 //
00021 
00022 CEvent::Type        IPrimaryScreen::s_buttonDownEvent      = CEvent::kUnknown;
00023 CEvent::Type        IPrimaryScreen::s_buttonUpEvent        = CEvent::kUnknown;
00024 CEvent::Type        IPrimaryScreen::s_motionPrimaryEvent   = CEvent::kUnknown;
00025 CEvent::Type        IPrimaryScreen::s_motionSecondaryEvent = CEvent::kUnknown;
00026 CEvent::Type        IPrimaryScreen::s_wheelEvent           = CEvent::kUnknown;
00027 CEvent::Type        IPrimaryScreen::s_ssActivatedEvent     = CEvent::kUnknown;
00028 CEvent::Type        IPrimaryScreen::s_ssDeactivatedEvent   = CEvent::kUnknown;
00029 CEvent::Type        IPrimaryScreen::s_hotKeyDownEvent      = CEvent::kUnknown;
00030 CEvent::Type        IPrimaryScreen::s_hotKeyUpEvent        = CEvent::kUnknown;
00031 CEvent::Type        IPrimaryScreen::s_fakeInputBegin       = CEvent::kUnknown;
00032 CEvent::Type        IPrimaryScreen::s_fakeInputEnd         = CEvent::kUnknown;
00033 
00034 CEvent::Type
00035 IPrimaryScreen::getButtonDownEvent()
00036 {
00037     return CEvent::registerTypeOnce(s_buttonDownEvent,
00038                             "IPrimaryScreen::buttonDown");
00039 }
00040 
00041 CEvent::Type
00042 IPrimaryScreen::getButtonUpEvent()
00043 {
00044     return CEvent::registerTypeOnce(s_buttonUpEvent,
00045                             "IPrimaryScreen::buttonUp");
00046 }
00047 
00048 CEvent::Type
00049 IPrimaryScreen::getMotionOnPrimaryEvent()
00050 {
00051     return CEvent::registerTypeOnce(s_motionPrimaryEvent,
00052                             "IPrimaryScreen::motionPrimary");
00053 }
00054 
00055 CEvent::Type
00056 IPrimaryScreen::getMotionOnSecondaryEvent()
00057 {
00058     return CEvent::registerTypeOnce(s_motionSecondaryEvent,
00059                             "IPrimaryScreen::motionSecondary");
00060 }
00061 
00062 CEvent::Type
00063 IPrimaryScreen::getWheelEvent()
00064 {
00065     return CEvent::registerTypeOnce(s_wheelEvent,
00066                             "IPrimaryScreen::wheel");
00067 }
00068 
00069 CEvent::Type
00070 IPrimaryScreen::getScreensaverActivatedEvent()
00071 {
00072     return CEvent::registerTypeOnce(s_ssActivatedEvent,
00073                             "IPrimaryScreen::screensaverActivated");
00074 }
00075 
00076 CEvent::Type
00077 IPrimaryScreen::getScreensaverDeactivatedEvent()
00078 {
00079     return CEvent::registerTypeOnce(s_ssDeactivatedEvent,
00080                             "IPrimaryScreen::screensaverDeactivated");
00081 }
00082 
00083 CEvent::Type
00084 IPrimaryScreen::getHotKeyDownEvent()
00085 {
00086     return CEvent::registerTypeOnce(s_hotKeyDownEvent,
00087                             "IPrimaryScreen::hotKeyDown");
00088 }
00089 
00090 CEvent::Type
00091 IPrimaryScreen::getHotKeyUpEvent()
00092 {
00093     return CEvent::registerTypeOnce(s_hotKeyUpEvent,
00094                             "IPrimaryScreen::hotKeyUp");
00095 }
00096 
00097 CEvent::Type
00098 IPrimaryScreen::getFakeInputBeginEvent()
00099 {
00100     return CEvent::registerTypeOnce(s_fakeInputBegin,
00101                             "IPrimaryScreen::fakeInputBegin");
00102 }
00103 
00104 CEvent::Type
00105 IPrimaryScreen::getFakeInputEndEvent()
00106 {
00107     return CEvent::registerTypeOnce(s_fakeInputEnd,
00108                             "IPrimaryScreen::fakeInputEnd");
00109 }
00110 
00111 
00112 //
00113 // IPrimaryScreen::CButtonInfo
00114 //
00115 
00116 IPrimaryScreen::CButtonInfo*
00117 IPrimaryScreen::CButtonInfo::alloc(ButtonID id, KeyModifierMask mask)
00118 {
00119     CButtonInfo* info = (CButtonInfo*)malloc(sizeof(CButtonInfo));
00120     info->m_button = id;
00121     info->m_mask   = mask;
00122     return info;
00123 }
00124 
00125 IPrimaryScreen::CButtonInfo*
00126 IPrimaryScreen::CButtonInfo::alloc(const CButtonInfo& x)
00127 {
00128     CButtonInfo* info = (CButtonInfo*)malloc(sizeof(CButtonInfo));
00129     info->m_button = x.m_button;
00130     info->m_mask   = x.m_mask;
00131     return info;
00132 }
00133 
00134 bool
00135 IPrimaryScreen::CButtonInfo::equal(const CButtonInfo* a, const CButtonInfo* b)
00136 {
00137     return (a->m_button == b->m_button && a->m_mask == b->m_mask);
00138 }
00139 
00140 
00141 //
00142 // IPrimaryScreen::CMotionInfo
00143 //
00144 
00145 IPrimaryScreen::CMotionInfo*
00146 IPrimaryScreen::CMotionInfo::alloc(SInt32 x, SInt32 y)
00147 {
00148     CMotionInfo* info = (CMotionInfo*)malloc(sizeof(CMotionInfo));
00149     info->m_x = x;
00150     info->m_y = y;
00151     return info;
00152 }
00153 
00154 
00155 //
00156 // IPrimaryScreen::CWheelInfo
00157 //
00158 
00159 IPrimaryScreen::CWheelInfo*
00160 IPrimaryScreen::CWheelInfo::alloc(SInt32 xDelta, SInt32 yDelta)
00161 {
00162     CWheelInfo* info = (CWheelInfo*)malloc(sizeof(CWheelInfo));
00163     info->m_xDelta = xDelta;
00164     info->m_yDelta = yDelta;
00165     return info;
00166 }
00167 
00168 
00169 //
00170 // IPrimaryScreen::CHotKeyInfo
00171 //
00172 
00173 IPrimaryScreen::CHotKeyInfo*
00174 IPrimaryScreen::CHotKeyInfo::alloc(UInt32 id)
00175 {
00176     CHotKeyInfo* info = (CHotKeyInfo*)malloc(sizeof(CHotKeyInfo));
00177     info->m_id = id;
00178     return info;
00179 }

Generated on Fri Nov 6 00:18:46 2009 for synergy-plus by  doxygen 1.4.7