]> git.lyx.org Git - features.git/commitdiff
make lyxserver work
authorJohn Levon <levon@movementarian.org>
Sun, 14 Jul 2002 02:04:19 +0000 (02:04 +0000)
committerJohn Levon <levon@movementarian.org>
Sun, 14 Jul 2002 02:04:19 +0000 (02:04 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@4633 a592a061-630c-0410-9148-cb99ea01b6c8

src/frontends/qt2/ChangeLog
src/frontends/qt2/Makefile.am
src/frontends/qt2/TODO
src/frontends/qt2/io_callback.h [new file with mode: 0644]
src/frontends/qt2/lyx_gui.C
src/frontends/qt2/moc/Makefile.am

index fe22899292a4a34e8a70ac2b5c16a6df0d507460..7df69e2473e8a78b7a0462ebbfd230c68a081379 100644 (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()
index 724446240f725e310edce1375701dda855382bb6..cf9ad768f56ba8d2fe488006dc9ca1a32b9da94b 100644 (file)
@@ -52,6 +52,7 @@ libqt2_la_SOURCES = \
        emptytable.C \
        emptytable.h \
        guiapi.C \
+       io_callback.h \
        lengthcombo.C \
        lengthcombo.h \
        lyx_gui.C \
index 2a392ea9b10ce16d4fefde2fb87b6af6d668d38b..c47ae8bae4cf31416fe2ea0f1db7e4f9a49d891f 100644 (file)
@@ -16,7 +16,6 @@ lyx_gui (qt)
 
        - move out lyxserver
        - do dpi
-       - implement set_read_callback
  
 Menubar_pimpl
 
diff --git a/src/frontends/qt2/io_callback.h b/src/frontends/qt2/io_callback.h
new file mode 100644 (file)
index 0000000..097af0c
--- /dev/null
@@ -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 
index 385eff39bad59b94bec2b73d9475ac3fb95d4611..9a0eec71f295a9db57437e71f8334d2c5d9da30b 100644 (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);
 }
index 4e06ce76897b913950e9e0dd112a13fd0a73fb9b..954c6eafa8aab265abf3f06f93f14d556e1ad9e1 100644 (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 $@ $<