barrier/lib/base/IEventQueue.cpp

44 lines
1009 B
C++
Raw Normal View History

2002-08-02 23:57:46 +04:00
/*
* synergy -- mouse and keyboard sharing utility
* Copyright (C) 2004 Chris Schoeneman
2002-08-02 23:57:46 +04: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.
*/
#include "IEventQueue.h"
2001-10-06 18:13:28 +04:00
//
// IEventQueue
2001-10-06 18:13:28 +04:00
//
static int g_systemTarget = 0;
IEventQueue* IEventQueue::s_instance = NULL;
void*
IEventQueue::getSystemTarget()
2001-10-06 18:13:28 +04:00
{
// any unique arbitrary pointer will do
return &g_systemTarget;
2001-10-06 18:13:28 +04:00
}
IEventQueue*
IEventQueue::getInstance()
2001-10-06 18:13:28 +04:00
{
assert(s_instance != NULL);
return s_instance;
2001-10-06 18:13:28 +04:00
}
void
IEventQueue::setInstance(IEventQueue* instance)
2001-10-06 18:13:28 +04:00
{
assert(s_instance == NULL || instance == NULL);
s_instance = instance;
2001-10-06 18:13:28 +04:00
}