make lyxserver work

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@4633 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
John Levon 2002-07-14 02:04:19 +00:00
parent 9f2722a944
commit 6a18ddc586
6 changed files with 49 additions and 3 deletions

View File

@ -1,3 +1,8 @@
2002-07-14 John Levon <moz@compsoc.man.ac.uk>
* io_callback.h:
* lyx_gui.C: make set_read_callback() work
2002-07-14 John Levon <moz@compsoc.man.ac.uk>
* lyx_gui.C: add set_read_callback()

View File

@ -52,6 +52,7 @@ libqt2_la_SOURCES = \
emptytable.C \
emptytable.h \
guiapi.C \
io_callback.h \
lengthcombo.C \
lengthcombo.h \
lyx_gui.C \

View File

@ -16,7 +16,6 @@ lyx_gui (qt)
- move out lyxserver
- do dpi
- implement set_read_callback
Menubar_pimpl

View File

@ -0,0 +1,38 @@
/**
* \file io_callback.h
* Copyright 2002 the LyX Team
* Read the file COPYING
*
* \author unknown
* \author John Levon <moz@compsoc.man.ac.uk>
*/
#ifndef IO_CALLBACK_H
#define IO_CALLBACK_H
#include <config.h>
#include "lyxserver.h"
#include <qsocketnotifier.h>
class io_callback : public QObject {
Q_OBJECT
public:
io_callback(int fd, LyXComm * comm)
: comm_(comm) {
QSocketNotifier * sn = new QSocketNotifier(fd,
QSocketNotifier::Read, this);
connect(sn, SIGNAL(activated(int)), this, SLOT(data_received()));
}
public slots:
void data_received() {
comm_->read_ready();
}
private:
LyXComm * comm_;
};
#endif // IO_CALLBACK_H

View File

@ -38,6 +38,7 @@
#include "QtView.h"
#include "QLImage.h"
#include "qfont_loader.h"
#include "io_callback.h"
#include <qapplication.h>
@ -146,5 +147,6 @@ bool lyx_gui::font_available(LyXFont const & font)
void lyx_gui::set_read_callback(int fd, LyXComm * comm)
{
// FIXME
// FIXME: "leak"
new io_callback(fd, comm);
}

View File

@ -25,9 +25,10 @@ nodist_libqt2moc_la_SOURCES = \
QContentPane_moc.C \
Qt2Base_moc.C \
QtView_moc.C \
io_callback_moc.C \
$(MOCDIALOGS)
libqt2moc.la: $(libqt2moc_la_OBJECTS) $(libqt2moc_la_DEPENDENCIES)
%_moc.C: ../%.h
$(MOC) -o $@ $<