xforms ? what xforms ?

ps WOO-HOO !!! Rock ON !


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@4632 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
John Levon 2002-07-14 01:44:15 +00:00
parent 0c062bec1b
commit 9f2722a944
17 changed files with 78 additions and 114 deletions

View File

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

View 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

View 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

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

View 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

View File

@ -21,7 +21,6 @@
#include "Alert.h"
#include "Alert_pimpl.h"
#include "xforms_helpers.h"
using std::pair;
using std::make_pair;

View 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

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

View 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

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

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

View File

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

View 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

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

View 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 =========================================================== */

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

View 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