2004-07-22 13:44:40 +00:00
|
|
|
|
// -*- C++ -*-
|
|
|
|
|
/**
|
|
|
|
|
* \file io_callback.h
|
|
|
|
|
* This file is part of LyX, the document processor.
|
|
|
|
|
* Licence details can be found in the file COPYING.
|
|
|
|
|
*
|
|
|
|
|
* \author John Levon
|
|
|
|
|
* \author Jo<EFBFBD>o Luis M. Assirati
|
|
|
|
|
*
|
|
|
|
|
* Full author contact details are available in file CREDITS.
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#ifndef IO_CALLBACK_H
|
|
|
|
|
#define IO_CALLBACK_H
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#include <gtkmm.h>
|
|
|
|
|
|
|
|
|
|
#include <boost/function.hpp>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* io_callback - a simple wrapper for asynchronous socket notification
|
|
|
|
|
*
|
|
|
|
|
* This is used by the lyxsocket to notice the socket is ready to be
|
|
|
|
|
* connected/read.
|
|
|
|
|
*
|
|
|
|
|
*/
|
2004-09-26 16:48:30 +00:00
|
|
|
|
class io_callback : public sigc::trackable {
|
2004-07-22 13:44:40 +00:00
|
|
|
|
public:
|
|
|
|
|
/// connect a connection notification from the LyXServerSocket
|
|
|
|
|
io_callback(int fd, boost::function<void()> func);
|
|
|
|
|
private:
|
2004-10-05 10:11:42 +00:00
|
|
|
|
bool data_received(Glib::IOCondition);
|
2004-07-22 13:44:40 +00:00
|
|
|
|
/// our notifier
|
2004-09-26 16:48:30 +00:00
|
|
|
|
sigc::connection conn_;
|
2004-07-22 13:44:40 +00:00
|
|
|
|
/// The callback function
|
|
|
|
|
boost::function<void()> func_;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
#endif // IO_CALLBACK_H
|