Joao latest bits

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@8044 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Alfredo Braunstein 2003-11-05 10:49:07 +00:00
parent 9698caf8a3
commit 3f61b02f0c
6 changed files with 43 additions and 15 deletions

View 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

View 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>

View 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 \

View 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

View 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 set_datasocket_callback(LyXDataSocket * p)
{
socket_callbacks[p->fd()] = new socket_callback(p);
}
void set_serversocket_callback(LyXServerSocket * p)
{
socket_callbacks[p->fd()] = new socket_callback(p);
}
void remove_datasocket_callback(LyXDataSocket * /* 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_datasocket_callback(LyXDataSocket * p)
{
remove_socket_callback(p->fd());
}
void set_serversocket_callback(LyXServerSocket * /* p */)
{}
void remove_serversocket_callback(LyXServerSocket * /* p */)
{}
void remove_serversocket_callback(LyXServerSocket * p)
{
remove_socket_callback(p->fd());
}
string const roman_font_name()
{

View 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;