wsignal.h

Go to the documentation of this file.
00001 /*
00002   libwt - Vassilis Virvilis Toolkit - a widget library
00003   Copyright (C) 2006 Vassilis Virvilis <vasvir2@fastmail.fm>
00004  
00005   This library is free software; you can redistribute it and/or
00006   modify it under the terms of the GNU Lesser General Public
00007   License as published by the Free Software Foundation; either
00008   version 2.1 of the License, or (at your option) any later version.
00009   
00010   This library is distributed in the hope that it will be useful,
00011   but WITHOUT ANY WARRANTY; without even the implied warranty of
00012   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013   Lesser General Public License for more details.
00014   
00015   You should have received a copy of the GNU Lesser General Public
00016   License along with this library; if not, write to the
00017   Free Software Foundation, Inc., 59 Temple Place - Suite 330,
00018   Boston, MA  02111-1307, SA.
00019 */
00020 
00021 #ifndef WT_WSIGNAL_H
00022 #define WT_WSIGNAL_H
00023 
00024 #include <sigc++/signal.h>
00025 #include <sigc++/hide.h>
00026 #include <sigc++/object_slot.h>
00027 
00028 namespace Wt {
00029 
00030 template<typename R, typename ARG1>
00031 class Signal01 : public sigc::signal1<R, ARG1> {
00032 public:
00033     void connect(const sigc::slot0<R>& slot) {
00034         sigc::signal1<R, ARG1>::connect(sigc::hide(slot));
00035     }
00036     void connect(const sigc::slot1<R, ARG1>& slot) {
00037         sigc::signal1<R, ARG1>::connect(slot);
00038     }
00039 };
00040 
00041 template<typename R, typename ARG1, typename ARG2>
00042 class Signal012 : public sigc::signal2<R, ARG1, ARG2> {
00043 public:
00044     void connect(const sigc::slot0<R>& slot) {
00045         sigc::signal2<R, ARG1, ARG2>::connect(sigc::hide(sigc::hide(slot)));
00046     }
00047     void connect(const sigc::slot1<R, ARG1>& slot) {
00048         sigc::signal2<R, ARG1, ARG2>::connect(sigc::hide(slot));
00049     }
00050     void connect(const sigc::slot2<R, ARG1, ARG2>& slot) {
00051         sigc::signal2<R, ARG1, ARG2>::connect(slot);
00052     }
00053 };
00054 
00055 template<typename R, typename ARG1, typename ARG2, typename M>
00056 class Signal012M : public sigc::signal2<R, ARG1, ARG2, M> {
00057 public:
00058     void connect(const sigc::slot0<R>& slot) {
00059         sigc::signal2<R, ARG1, ARG2, M>::connect(sigc::hide(sigc::hide(slot)));
00060     }
00061     void connect(const sigc::slot1<R, ARG1>& slot) {
00062         sigc::signal2<R, ARG1, ARG2, M>::connect(sigc::hide(slot));
00063     }
00064     void connect(const sigc::slot2<R, ARG1, ARG2>& slot) {
00065         sigc::signal2<R, ARG1, ARG2, M>::connect(slot);
00066     }
00067 };
00068 
00069 }
00070 
00071 #endif // WT_WSIGNAL_H

Generated Fri Jul 28 19:23:01 2006.
Copyright © 1998-2003 by the respective authors.

This document is licensed under the terms of the GNU Free Documentation License and may be freely distributed under the conditions given by this license.