]> git.lyx.org Git - features.git/commitdiff
xforms ? what xforms ?
authorJohn Levon <levon@movementarian.org>
Sun, 14 Jul 2002 01:44:15 +0000 (01:44 +0000)
committerJohn Levon <levon@movementarian.org>
Sun, 14 Jul 2002 01:44:15 +0000 (01:44 +0000)
ps WOO-HOO !!! Rock ON !

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@4632 a592a061-630c-0410-9148-cb99ea01b6c8

17 files changed:
ChangeLog
configure.in
src/ChangeLog
src/frontends/ChangeLog
src/frontends/lyx_gui.h
src/frontends/qt2/Alert_pimpl.C
src/frontends/qt2/ChangeLog
src/frontends/qt2/Makefile.am
src/frontends/qt2/TODO
src/frontends/qt2/Toolbar_pimpl.C
src/frontends/qt2/lyx_gui.C
src/frontends/qt2/xforms/Makefile.am [deleted file]
src/frontends/xforms/ChangeLog
src/frontends/xforms/lyx_gui.C
src/lyxfunc.C
src/lyxserver.C
src/lyxserver.h

index 5812c34f7474baa2ef370ff8acebd7c2474caab3..7200db78436b939cad3280aa6b30c8ba350f6406 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2002-07-14  John Levon  <moz@compsoc.man.ac.uk>
+
+       * configure.in: remove xforms from qt
 2002-07-04  Kayvan A. Sylvan  <kayvan@sylvan.com>
 
        * configure.in (LYX_USE_FRONTEND): The order of libraries is
index 43864ca504e4c7f6f1aa2c2508be8e2da5c936a1..8252089805d9c8768c802d66e57dd7f37371662d 100644 (file)
@@ -197,10 +197,10 @@ case "$lyx_use_frontend" in
   qt2)
     QT2_DO_IT_ALL
     FRONTEND="qt2"
-    FRONTEND_GUILIB="qt2/*.lo qt2/ui/*.lo qt2/moc/*.lo qt2/ui/moc/*.lo qt2/xforms/*.lo"
+    FRONTEND_GUILIB="qt2/*.lo qt2/ui/*.lo qt2/moc/*.lo qt2/ui/moc/*.lo"
     FRONTEND_LDFLAGS="\$(QT2_LDFLAGS)"
-    FRONTEND_INCLUDES="-I\${srcdir}/qt2 -I\${top_srcdir}/src/frontends/xforms \$(QT2_INCLUDES)"
-    FRONTEND_LIBS="@XPM_LIB@ @XFORMS_LIB@ \$(QT2_LIBS)";;
+    FRONTEND_INCLUDES="-I\${srcdir}/qt2 \$(QT2_INCLUDES)"
+    FRONTEND_LIBS="\$(QT2_LIBS)";;
   *)
     LYX_ERROR(Unknown frontend $lyx_use_frontend);;
 esac
index baab579b368267103d963c2d57228dcec3229d70..6fd3e928d9bdd6a08c5015b358b740dc9aeea109 100644 (file)
@@ -1,3 +1,10 @@
+2002-07-14  John Levon  <moz@compsoc.man.ac.uk>
+
+       * lyxfunc.C: remove dead code
+
+       * lyxserver.h:
+       * lyxserver.C: use lyx_guii::set_read_callback
 2002-07-13  Dekel Tsur  <dekelts@tau.ac.il>
 
        * lyxfunc.C (dispatch): Correct cursor behaviour when exiting
index b132925deb2754e0cd374fb66234e5718ce3877f..5a7fc2b5264a2fb5a823dc5a3510377bdd9683d7 100644 (file)
@@ -1,3 +1,7 @@
+2002-07-14  John Levon  <moz@compsoc.man.ac.uk>
+
+       * lyx_gui.h: add set_read_callback()
 2002-07-12  John Levon  <moz@compsoc.man.ac.uk>
 
        * lyx_gui.h: remove init_graphics()
index d4f0c03e4528401ab5aabd97fefaad910bc3b490..bcc68c7f94d1a8cb2242e9aa464f6c7ca8c6a4f9 100644 (file)
@@ -16,6 +16,7 @@
 
 class Dialogs;
 class LyXFont;
+class LyXComm;
 
 /// GUI interaction
 namespace lyx_gui {
@@ -54,6 +55,11 @@ namespace lyx_gui {
         * is the given font available ?
         */
        bool font_available(LyXFont const & font);
+
+       /**
+        * add a callback for I/O read notification
+        */
+       void set_read_callback(int fd, LyXComm * comm);
 }
 
 #endif // LYX_GUI_H
index 5939e3ddd78454b8ff75ec0e5f9ce431c6bad2f4..1926136bf4d0e6ecd20e3a65bcd73e6b98f52e5d 100644 (file)
@@ -21,7 +21,6 @@
 
 #include "Alert.h"
 #include "Alert_pimpl.h"
-#include "xforms_helpers.h"
 
 using std::pair;
 using std::make_pair;
index a70019723e9daa2012adce76bc7bd81062dd9709..fe22899292a4a34e8a70ac2b5c16a6df0d507460 100644 (file)
@@ -1,3 +1,10 @@
+2002-07-14  John Levon  <moz@compsoc.man.ac.uk>
+
+       * lyx_gui.C: add set_read_callback()
+       * Makefile.am: 
+       * xforms/*: remove
 2002-07-13  John Levon  <moz@compsoc.man.ac.uk>
 
        * QtView.C: add a status bar
index d3099353d09a335693d454412d3a635fbc7be40a..724446240f725e310edce1375701dda855382bb6 100644 (file)
@@ -1,6 +1,6 @@
 include $(top_srcdir)/config/common.am
 
-SUBDIRS = xforms ui moc
+SUBDIRS = ui moc
 
 EXTRA_DIST = Makefile.dialogs QDocument.C QDocument.h \
        QDocumentDialog.C QDocumentDialog.h QParagraph.h QParagraph.C \
index 90b18a071cf17708cfc0d1e5b9221276c33bf245..2a392ea9b10ce16d4fefde2fb87b6af6d668d38b 100644 (file)
@@ -12,14 +12,11 @@ GraphicsImage
 
        - remove getPixmap() 
  
-LyXServer
-
-       - remove xforms dependency
 lyx_gui (qt)
 
        - move out lyxserver
        - do dpi
+       - implement set_read_callback
  
 Menubar_pimpl
 
index fdc7858f7d78cd7250a2352c398ef982d0a42aed..bab349e99d016e2732276250b19b81c1a4ba72ab 100644 (file)
@@ -20,9 +20,7 @@
 #include "buffer.h"
 #include "lyxtextclasslist.h"
 #include "LyXAction.h"
-#include "MathsSymbols.h" 
 #include "gettext.h"
-#include "Tooltips.h"
 
 #include "support/LAssert.h"
 #include "support/filetools.h"
index 9ca60f1c7ee555632aebcd976fd8ebb40cbaa1a5..385eff39bad59b94bec2b73d9475ac3fb95d4611 100644 (file)
@@ -142,3 +142,9 @@ bool lyx_gui::font_available(LyXFont const & font)
 {
        return fontloader.available(font);
 }
+
+
+void lyx_gui::set_read_callback(int fd, LyXComm * comm)
+{
+       // FIXME 
+}
diff --git a/src/frontends/qt2/xforms/Makefile.am b/src/frontends/qt2/xforms/Makefile.am
deleted file mode 100644 (file)
index 4acca16..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-include $(top_srcdir)/config/common.am
-
-noinst_LTLIBRARIES = libqt2xforms.la
-
-INCLUDES = -I$(top_srcdir)/src/ -I$(top_srcdir)/src/frontends/ \
-       $(SIGC_CFLAGS) -I$(top_srcdir)/images \
-       $(FRONTEND_INCLUDES) $(BOOST_INCLUDES) \
-       -I$(top_srcdir)/src/frontends/controllers
-
-nodist_libqt2xforms_la_SOURCES = \
-       Color.h \
-       Color.C \
-       DropDown.h \
-       DropDown.C \
-       Tooltips.h \
-       Tooltips.C \
-       xforms_helpers.h \
-       xforms_helpers.C
-
-libqt2xforms.la: link_files $(libqt2xforms_la_OBJECTS)
-
-link_files:
-       for i in $(nodist_libqt2xforms_la_SOURCES); do \
-               ln -sf "$(top_srcdir)/src/frontends/xforms/$$i" . ; \
-       done
index 84c084ccbb53547d671e16e90d498622db6da26e..940e8d285600204909ea2332bcd7c3bccdfeec8e 100644 (file)
@@ -1,3 +1,7 @@
+2002-07-14  John Levon  <moz@compsoc.man.ac.uk>
+
+       * lyx_gui.C: add set_read_callback()
 2002-07-12  John Levon  <moz@compsoc.man.ac.uk>
 
        * lyx_gui.C: move init_graphics() into setup
index 67c55eede8d6fec5571650438a77afecd48a7f1d..215f55cd40ef59daa9dd4627d38c6b08cac27b42 100644 (file)
@@ -352,3 +352,16 @@ bool lyx_gui::font_available(LyXFont const & font)
 {
        return fontloader.available(font);
 }
+
+namespace {
+       void C_read_callback(int, void * data)
+       {
+               LyXComm * comm = static_cast<LyXComm *>(data); 
+               comm->read_ready();
+       }
+}
+
+void lyx_gui::set_read_callback(int fd, LyXComm * comm)
+{
+       fl_add_io_callback(fd, FL_READ, C_read_callback, comm);
+}
index e1d32d92f5e780753b27b09bd894c9f7ddff877f..19bfb7dba377d1d9682eceea5895ec61e1497999 100644 (file)
@@ -122,39 +122,6 @@ extern tex_accent_struct get_accent(kb_action action);
 extern void ShowLatexLog();
 
 
-#if 0
-
-///
-class MiniBufferController : public SigC::Object {
-public:
-       ///
-       MiniBufferController() {
-               minibuffer
-                       .cmdReady
-                       .connect(slot(this,
-                                     &MiniBufferController::receiveCommand));
-               minibuffer
-                       .argReady
-                       .connect(slot(this,
-                                     &MiniBufferController::receiveArg));
-       }
-       ///
-       void receiveCmd(string const & cmd) {}
-       ///
-       void receiveArg(string const & arg) {}
-
-
-private:
-};
-
-namespace {
-
-MiniBufferController mb_ctrl;
-
-}
-#endif
-
-
 /* === globals =========================================================== */
 
 
index 11f3d47aea8df785f1e216be66aa56d4a121d48f..4a7fadbaa2703c8733ece370c787ba2207e44df7 100644 (file)
@@ -53,6 +53,7 @@
 #include "lyxfunc.h"
 #include "support/lstrings.h"
 #include "support/lyxlib.h"
+#include "frontends/lyx_gui.h"
 
 #ifdef __EMX__
 #include <cstdlib>
@@ -75,23 +76,6 @@ int mkfifo(char const * __path, mode_t __mode) {
 #endif
 
 
-/* === variables ========================================================= */
-
-extern "C" {
-
-       // C wrapper
-       static
-       void C_LyXComm_callback(int fd, void *v)
-       {
-               LyXComm::callback(fd, v);
-       }
-
-}
-
-
-// LyXComm class
-
-// Open pipes
 void LyXComm::openConnection()
 {
        lyxerr[Debug::LYXSERVER] << "LyXComm: Opening connection" << endl;
@@ -215,8 +199,9 @@ int LyXComm::startPipe(string const & filename, bool write)
                return -1;
        }
 
-       if (!write)
-               fl_add_io_callback(fd, FL_READ, C_LyXComm_callback, this);
+       if (!write) {
+               lyx_gui::set_read_callback(fd, this);
+       }
 
        return fd;
 }
@@ -267,15 +252,13 @@ void LyXComm::emergencyCleanup()
 
 
 // Receives messages and sends then to client
-void LyXComm::callback(int fd, void *v)
+void LyXComm::read_ready()
 {
-       LyXComm * c = static_cast<LyXComm*>(v);
-
        if (lyxerr.debugging(Debug::LYXSERVER)) {
-               lyxerr << "LyXComm: Receiving from fd " << fd << endl;
+               lyxerr << "LyXComm: Receiving from fd " << infd << endl;
        }
 
-       const int CMDBUFLEN = 100;
+       int const CMDBUFLEN = 100;
        char charbuf[CMDBUFLEN];
        string cmd;
 // nb! make lsbuf a class-member for multiple sessions
@@ -284,17 +267,12 @@ void LyXComm::callback(int fd, void *v)
        errno = 0;
        int status;
        // the single = is intended here.
-       while ((status = read(fd, charbuf, CMDBUFLEN-1)))
-       {// break and return in loop
-               if (status > 0) // got something
-               {
+       while ((status = read(infd, charbuf, CMDBUFLEN-1))) {
+               if (status > 0) {
                        charbuf[status]= '\0'; // turn it into a c string
                        lsbuf += strip(charbuf, '\r');
                        // commit any commands read
-                       while (lsbuf.find('\n') != string::npos) // while still
-                                                       // commands
-                                                       // left
-                       {
+                       while (lsbuf.find('\n') != string::npos) {
                                // split() grabs the entire string if
                                // the delim /wasn't/ found. ?:-P
                                lsbuf= split(lsbuf, cmd,'\n');
@@ -303,19 +281,15 @@ void LyXComm::callback(int fd, void *v)
                                        << ", lsbuf:" << lsbuf
                                        << ", cmd:" << cmd << endl;
                                if (!cmd.empty())
-                                       c->clientcb(c->client, cmd);
+                                       clientcb(client, cmd);
                                        //\n or not \n?
                        }
                }
-               if (errno == EAGAIN)
-               {  // EAGAIN is not really an error , it means we're
-                  // only reading too fast for the writing process on
-                  // the other end of the pipe.
+               if (errno == EAGAIN) {
                        errno = 0;
-                       return; // up to libforms select-loop (*crunch*)
+                       return;
                }
-               if (errno != 0)
-               {
+               if (errno != 0) {
                        lyxerr << "LyXComm: " << strerror(errno) << endl;
                        if (!lsbuf.empty())
                        {
@@ -326,8 +300,8 @@ void LyXComm::callback(int fd, void *v)
                        break; // reset connection
                }
        }
-       c->closeConnection();
-       c->openConnection();
+       closeConnection();
+       openConnection();
        errno= 0;
 }
 
index 6b69392fe6890018f3e3dd8b99f76fac6a8bd25b..f6d38868db55c5a67440bf7d2e095a8e4088f277 100644 (file)
@@ -17,6 +17,9 @@
 #endif
 
 #include "LString.h"
+
+#include <boost/signals/trackable.hpp>
 class LyXFunc;
 class LyXServer;
 
@@ -29,7 +32,7 @@ class LyXServer;
  This class encapsulates all the dirty communication and thus provides
  a clean string interface.
  */
-class LyXComm {
+class LyXComm : public boost::signals::trackable {
 public:
        /** When we receive a message, we send it to a client.
          This is one of the small things that would have been a lot
@@ -55,8 +58,8 @@ public:
        /// Send message
        void send(string const &);
 
-       /// We receive messages via XForms through this callback
-       static void callback(int fd, void *v);
+       /// asynch ready-to-be-read notification
+       void read_ready();
 
 private:
        /// the filename of the in pipe