3 * Copyright 2002 the LyX Team
4 * Read the file COPYING
7 * \author John Levon <moz@compsoc.man.ac.uk>
15 #include "lyxserver.h"
18 #include <qsocketnotifier.h>
20 #include <boost/scoped_ptr.hpp>
23 * io_callback - a simple wrapper for asynchronous pipe notification
25 * This is used by the lyxserver to notice the pipe is ready to be
28 * FIXME: this code apparently will not work on Windows.
30 class io_callback : public QObject {
33 /// connect a read ready notification for fd to the LyXComm
34 io_callback(int fd, LyXComm * comm)
36 sn_.reset(new QSocketNotifier(fd, QSocketNotifier::Read, this));
37 connect(sn_.get(), SIGNAL(activated(int)), this, SLOT(data_received()));
41 void data_received() {
47 boost::scoped_ptr<QSocketNotifier> sn_;
52 #endif // IO_CALLBACK_H