2007-11-25 19:46:22 +00:00
|
|
|
// -*- C++ -*-
|
|
|
|
/**
|
|
|
|
* \file SignalSlot.cpp
|
|
|
|
* This file is part of LyX, the document processor.
|
|
|
|
* Licence details can be found in the file COPYING.
|
|
|
|
*
|
2008-11-14 15:58:50 +00:00
|
|
|
* \author André Pönitz
|
2007-11-25 19:46:22 +00:00
|
|
|
*
|
|
|
|
* Full author contact details are available in file CREDITS.
|
|
|
|
*/
|
|
|
|
|
2007-11-27 19:54:01 +00:00
|
|
|
#include <config.h>
|
2007-11-26 19:56:25 +00:00
|
|
|
|
2007-11-29 07:04:28 +00:00
|
|
|
#include "support/SignalSlot.h"
|
|
|
|
#include "support/SignalSlotPrivate.h"
|
2007-11-25 19:46:22 +00:00
|
|
|
|
|
|
|
namespace lyx {
|
|
|
|
|
|
|
|
/////////////////////////////////////////////////////////////////////
|
|
|
|
//
|
|
|
|
// Signal
|
|
|
|
//
|
|
|
|
/////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
Signal::Signal()
|
|
|
|
: impl(new SignalImpl)
|
|
|
|
{}
|
|
|
|
|
|
|
|
|
|
|
|
Signal::~Signal()
|
|
|
|
{
|
|
|
|
delete impl;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void Signal::fire()
|
|
|
|
{
|
|
|
|
impl->fire();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/////////////////////////////////////////////////////////////////////
|
|
|
|
//
|
|
|
|
// Slot
|
|
|
|
//
|
|
|
|
/////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
void SlotImpl::called()
|
|
|
|
{
|
|
|
|
owner_.called();
|
|
|
|
}
|
|
|
|
|
|
|
|
Slot::Slot()
|
|
|
|
: impl(new SlotImpl(*this))
|
|
|
|
{}
|
|
|
|
|
|
|
|
Slot::~Slot()
|
|
|
|
{
|
|
|
|
delete impl;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/////////////////////////////////////////////////////////////////////
|
|
|
|
//
|
|
|
|
// Connect
|
|
|
|
//
|
|
|
|
/////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
void connect(Signal & sig, Slot & slot)
|
|
|
|
{
|
|
|
|
QObject::connect(sig.impl, SIGNAL(fire()), slot.impl, SLOT(called()));
|
|
|
|
}
|
|
|
|
|
|
|
|
} // namespace lyx
|