/* Copyright 2004 Bastiaan Veelo This file is part of dcouple. Dcouple is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. You are free to negociate a different license with the copyright holder. Dcouple 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 dcouple; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ module dcouple.connect; private import dcouple.signal; private import dcouple.slot; /*! Provides a syntax for connecting signals to slots akin to the Qt syntax: \code connect(incomeButton.pressed, moneyInTheBank.up); \endcode Alternatively, you can do \code incomeButton.pressed.connect(moneyInTheBank.up); // or: moneyInTheBank.up.connect(incomeButton.pressed); \endcode */ void connect(GenericSignal signal, GenericSlot slot) { signal.genericConnect(slot); //slot.connect(signal); // superfluous } void connect(GenericSlot slot, GenericSignal signal) { signal.genericConnect(slot); //slot.connect(signal); // superfluous } /*! Provides a syntax for explicitly disconnecting signals from slots akin to the Qt syntax: \code disconnect(incomeButton.pressed, moneyInTheBank.up); \endcode Alternatively, you can do \code incomeButton.pressed.disconnect(moneyInTheBank.up); // or: moneyInTheBank.up.disconnect(incomeButton.pressed); \endcode Note that connections get implicitly disconnected when the sending and/or the receiving end is deleted, and connections may be broken by classes that manage the signals and slots they own. */ void disconnect(GenericSignal signal, GenericSlot slot) { signal.genericDisconnect(slot); //slot.disconnect(signal); // superfluous } void disconnect(GenericSlot slot, GenericSignal signal) { signal.genericDisconnect(slot); //slot.disconnect(signal); // superfluous }