deskflow/src/lib/synergy/IPrimaryScreen.cpp

92 lines
2.1 KiB
C++
Raw Normal View History

2012-06-10 16:50:54 +00:00
/*
* synergy -- mouse and keyboard sharing utility
* Copyright (C) 2012 Synergy Si Ltd.
* Copyright (C) 2004 Chris Schoeneman
2012-06-10 16:50:54 +00:00
*
* This package is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* found in the file COPYING that should have accompanied this file.
*
* This package is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "synergy/IPrimaryScreen.h"
#include "base/EventQueue.h"
2012-06-10 16:50:54 +00:00
#include <cstdlib>
//
2014-11-11 13:51:47 +00:00
// IPrimaryScreen::ButtonInfo
2012-06-10 16:50:54 +00:00
//
2014-11-11 13:51:47 +00:00
IPrimaryScreen::ButtonInfo*
IPrimaryScreen::ButtonInfo::alloc(ButtonID id, KeyModifierMask mask)
2012-06-10 16:50:54 +00:00
{
2014-11-11 13:51:47 +00:00
ButtonInfo* info = (ButtonInfo*)malloc(sizeof(ButtonInfo));
2012-06-10 16:50:54 +00:00
info->m_button = id;
info->m_mask = mask;
return info;
}
2014-11-11 13:51:47 +00:00
IPrimaryScreen::ButtonInfo*
IPrimaryScreen::ButtonInfo::alloc(const ButtonInfo& x)
2012-06-10 16:50:54 +00:00
{
2014-11-11 13:51:47 +00:00
ButtonInfo* info = (ButtonInfo*)malloc(sizeof(ButtonInfo));
2012-06-10 16:50:54 +00:00
info->m_button = x.m_button;
info->m_mask = x.m_mask;
return info;
}
bool
2014-11-11 13:51:47 +00:00
IPrimaryScreen::ButtonInfo::equal(const ButtonInfo* a, const ButtonInfo* b)
2012-06-10 16:50:54 +00:00
{
return (a->m_button == b->m_button && a->m_mask == b->m_mask);
}
//
2014-11-11 13:51:47 +00:00
// IPrimaryScreen::MotionInfo
2012-06-10 16:50:54 +00:00
//
2014-11-11 13:51:47 +00:00
IPrimaryScreen::MotionInfo*
IPrimaryScreen::MotionInfo::alloc(SInt32 x, SInt32 y)
2012-06-10 16:50:54 +00:00
{
2014-11-11 13:51:47 +00:00
MotionInfo* info = (MotionInfo*)malloc(sizeof(MotionInfo));
2012-06-10 16:50:54 +00:00
info->m_x = x;
info->m_y = y;
return info;
}
//
2014-11-11 13:51:47 +00:00
// IPrimaryScreen::WheelInfo
2012-06-10 16:50:54 +00:00
//
2014-11-11 13:51:47 +00:00
IPrimaryScreen::WheelInfo*
IPrimaryScreen::WheelInfo::alloc(SInt32 xDelta, SInt32 yDelta)
2012-06-10 16:50:54 +00:00
{
2014-11-11 13:51:47 +00:00
WheelInfo* info = (WheelInfo*)malloc(sizeof(WheelInfo));
2012-06-10 16:50:54 +00:00
info->m_xDelta = xDelta;
info->m_yDelta = yDelta;
return info;
}
//
2014-11-11 13:51:47 +00:00
// IPrimaryScreen::HotKeyInfo
2012-06-10 16:50:54 +00:00
//
2014-11-11 13:51:47 +00:00
IPrimaryScreen::HotKeyInfo*
IPrimaryScreen::HotKeyInfo::alloc(UInt32 id)
2012-06-10 16:50:54 +00:00
{
2014-11-11 13:51:47 +00:00
HotKeyInfo* info = (HotKeyInfo*)malloc(sizeof(HotKeyInfo));
2012-06-10 16:50:54 +00:00
info->m_id = id;
return info;
}