]> git.lyx.org Git - lyx.git/commitdiff
Joao latest bits
authorAlfredo Braunstein <abraunst@lyx.org>
Wed, 5 Nov 2003 10:49:07 +0000 (10:49 +0000)
committerAlfredo Braunstein <abraunst@lyx.org>
Wed, 5 Nov 2003 10:49:07 +0000 (10:49 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@8044 a592a061-630c-0410-9148-cb99ea01b6c8

src/ChangeLog
src/frontends/qt2/ChangeLog
src/frontends/qt2/Makefile.am
src/frontends/qt2/Makefile.dialogs
src/frontends/qt2/lyx_gui.C
src/lyxsocket.C

index a80ea7357dff831f73a57e0f7e92ee33a2898b06..9b375987ae1dc22380912b797417bb696604e99d 100644 (file)
@@ -1,3 +1,7 @@
+2003-11-05  João Luis M. Assirati  <assirati@fma.if.usp.br>
+
+       * lyxsocket.C: export variables XEDITOR and LYXSOCKET
+
 2003-11-05  Alfredo Braunstein  <abraunst@libero.it>
 
        * lyxfunc.C (dispatch): make LFUN_GOTO_PARAGRAPH work with deep
index 71d7853c7bda4d6d8488fb2f84d53ad970796eae..55affae91ec9fac62e05a097bcc7512dd43a12bb 100644 (file)
@@ -1,8 +1,9 @@
 2003-11-05  João Luis M. Assirati  <assirati@fma.if.usp.br>
 
-       * socket_callback.[Ch] ({set,remove}_{server,data}socket_callback()): 
+       * lyx_gui.C: {set,remove}_{server,data}socket_callback(): replace
+       dummy functions with working ones
+       * socket_callback.[Ch] (): 
        new files with a class to connect sockets.
-
        * Makefile.am: add the above
 
 2003-11-04  Alfredo Braunstein  <abraunst@libero.it>
index f765ab638fc66975de7adbb7057f5b570d35d068..09c8d11eabe49611884799d0d9d06de0bf3d5887 100644 (file)
@@ -72,7 +72,6 @@ libqt2_la_SOURCES = \
        lyx_gui.C \
        lcolorcache.h lcolorcache.C \
        panelstack.h panelstack.C \
-       socket_callback.C socket_callback.h \
        qcoloritem.h qcoloritem.C \
        qfontexample.h qfontexample.C \
        qfont_loader.h qfont_loader.C \
index 59961374ddda5ccf63593607f471686dcf831251..f50b486b712f60262c72346345f76872d3f53c5d 100644 (file)
@@ -125,4 +125,5 @@ MOCFILES = \
        QURLDialog.C QURLDialog.h \
        QVCLogDialog.C QVCLogDialog.h \
        QWrapDialog.C QWrapDialog.h \
-       QLToolbar.C QLToolbar.h
+       QLToolbar.C QLToolbar.h \
+       socket_callback.C socket_callback.h
index 5c7132f533ee5798455831bc8144d3d792213b3f..d93936aea69f998d764746bd665d3944f145cc33 100644 (file)
@@ -40,6 +40,7 @@
 #include "QLImage.h"
 #include "qfont_loader.h"
 #include "io_callback.h"
+#include "socket_callback.h"
 #include "lcolorcache.h"
 
 #include <qapplication.h>
@@ -70,6 +71,7 @@ float getDPI()
 }
 
 map<int, io_callback *> io_callbacks;
+map<int, socket_callback *> socket_callbacks;
 
 } // namespace anon
 
@@ -177,6 +179,7 @@ void sync_events()
 
 void exit()
 {
+       delete lyxsocket;
        delete lyxserver;
        lyxserver = 0;
 
@@ -248,21 +251,34 @@ void remove_read_callback(int fd)
 }
 
 
-void set_datasocket_callback(LyXDataSocket * /* p */)
-{}
-
-
-void remove_datasocket_callback(LyXDataSocket * /* p */)
-{}
-
+void set_datasocket_callback(LyXDataSocket * p)
+{
+       socket_callbacks[p->fd()] = new socket_callback(p);
+}
 
-void set_serversocket_callback(LyXServerSocket * /* p */)
-{}
+void set_serversocket_callback(LyXServerSocket * p)
+{
+       socket_callbacks[p->fd()] = new socket_callback(p);
+}
 
+void remove_socket_callback(int fd)
+{
+       map<int, socket_callback *>::iterator it = socket_callbacks.find(fd);
+       if (it != socket_callbacks.end()) {
+               delete it->second;
+               socket_callbacks.erase(it);
+       }
+}
 
-void remove_serversocket_callback(LyXServerSocket * /* p */)
-{}
+void remove_datasocket_callback(LyXDataSocket * p)
+{
+       remove_socket_callback(p->fd());
+}
 
+void remove_serversocket_callback(LyXServerSocket * p)
+{
+       remove_socket_callback(p->fd());
+}
 
 string const roman_font_name()
 {
index e3a84683e5723cfc02942708e1bd94cbd024b181..3095d2bb31a8e8bfc2004ba1083aa08dd1079fa7 100644 (file)
@@ -45,6 +45,13 @@ LyXServerSocket::LyXServerSocket(LyXFunc * f, string const & addr)
                lyxerr << "lyx: Disabling LyX socket." << endl;
                return;
        }
+
+       // These env vars are used by DVI inverse search
+       // Needed by xdvi
+       lyx::support::putenv("XEDITOR", "lyxclient -g %f %l");
+       // Needed by lyxclient
+       lyx::support::putenv("LYXSOCKET", address_);
+
        lyx_gui::set_serversocket_callback(this);
        lyxerr[Debug::LYXSERVER] << "lyx: New server socket "
                                 << fd_ << ' ' << address_ << endl;