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> 2002-07-04 Kayvan A. Sylvan <kayvan@sylvan.com>
* configure.in (LYX_USE_FRONTEND): The order of libraries is * configure.in (LYX_USE_FRONTEND): The order of libraries is

View File

@ -197,10 +197,10 @@ case "$lyx_use_frontend" in
qt2) qt2)
QT2_DO_IT_ALL QT2_DO_IT_ALL
FRONTEND="qt2" 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_LDFLAGS="\$(QT2_LDFLAGS)"
FRONTEND_INCLUDES="-I\${srcdir}/qt2 -I\${top_srcdir}/src/frontends/xforms \$(QT2_INCLUDES)" FRONTEND_INCLUDES="-I\${srcdir}/qt2 \$(QT2_INCLUDES)"
FRONTEND_LIBS="@XPM_LIB@ @XFORMS_LIB@ \$(QT2_LIBS)";; FRONTEND_LIBS="\$(QT2_LIBS)";;
*) *)
LYX_ERROR(Unknown frontend $lyx_use_frontend);; LYX_ERROR(Unknown frontend $lyx_use_frontend);;
esac 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> 2002-07-13 Dekel Tsur <dekelts@tau.ac.il>
* lyxfunc.C (dispatch): Correct cursor behaviour when exiting * 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> 2002-07-12 John Levon <moz@compsoc.man.ac.uk>
* lyx_gui.h: remove init_graphics() * lyx_gui.h: remove init_graphics()

View File

@ -16,6 +16,7 @@
class Dialogs; class Dialogs;
class LyXFont; class LyXFont;
class LyXComm;
/// GUI interaction /// GUI interaction
namespace lyx_gui { namespace lyx_gui {
@ -54,6 +55,11 @@ namespace lyx_gui {
* is the given font available ? * is the given font available ?
*/ */
bool font_available(LyXFont const & font); 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 #endif // LYX_GUI_H

View File

@ -21,7 +21,6 @@
#include "Alert.h" #include "Alert.h"
#include "Alert_pimpl.h" #include "Alert_pimpl.h"
#include "xforms_helpers.h"
using std::pair; using std::pair;
using std::make_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> 2002-07-13 John Levon <moz@compsoc.man.ac.uk>
* QtView.C: add a status bar * QtView.C: add a status bar

View File

@ -1,6 +1,6 @@
include $(top_srcdir)/config/common.am include $(top_srcdir)/config/common.am
SUBDIRS = xforms ui moc SUBDIRS = ui moc
EXTRA_DIST = Makefile.dialogs QDocument.C QDocument.h \ EXTRA_DIST = Makefile.dialogs QDocument.C QDocument.h \
QDocumentDialog.C QDocumentDialog.h QParagraph.h QParagraph.C \ QDocumentDialog.C QDocumentDialog.h QParagraph.h QParagraph.C \

View File

@ -12,14 +12,11 @@ GraphicsImage
- remove getPixmap() - remove getPixmap()
LyXServer
- remove xforms dependency
lyx_gui (qt) lyx_gui (qt)
- move out lyxserver - move out lyxserver
- do dpi - do dpi
- implement set_read_callback
Menubar_pimpl Menubar_pimpl

View File

@ -20,9 +20,7 @@
#include "buffer.h" #include "buffer.h"
#include "lyxtextclasslist.h" #include "lyxtextclasslist.h"
#include "LyXAction.h" #include "LyXAction.h"
#include "MathsSymbols.h"
#include "gettext.h" #include "gettext.h"
#include "Tooltips.h"
#include "support/LAssert.h" #include "support/LAssert.h"
#include "support/filetools.h" #include "support/filetools.h"

View File

@ -142,3 +142,9 @@ bool lyx_gui::font_available(LyXFont const & font)
{ {
return fontloader.available(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> 2002-07-12 John Levon <moz@compsoc.man.ac.uk>
* lyx_gui.C: move init_graphics() into setup * 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); 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(); 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 =========================================================== */ /* === globals =========================================================== */

View File

@ -53,6 +53,7 @@
#include "lyxfunc.h" #include "lyxfunc.h"
#include "support/lstrings.h" #include "support/lstrings.h"
#include "support/lyxlib.h" #include "support/lyxlib.h"
#include "frontends/lyx_gui.h"
#ifdef __EMX__ #ifdef __EMX__
#include <cstdlib> #include <cstdlib>
@ -75,23 +76,6 @@ int mkfifo(char const * __path, mode_t __mode) {
#endif #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() void LyXComm::openConnection()
{ {
lyxerr[Debug::LYXSERVER] << "LyXComm: Opening connection" << endl; lyxerr[Debug::LYXSERVER] << "LyXComm: Opening connection" << endl;
@ -215,8 +199,9 @@ int LyXComm::startPipe(string const & filename, bool write)
return -1; return -1;
} }
if (!write) if (!write) {
fl_add_io_callback(fd, FL_READ, C_LyXComm_callback, this); lyx_gui::set_read_callback(fd, this);
}
return fd; return fd;
} }
@ -267,15 +252,13 @@ void LyXComm::emergencyCleanup()
// Receives messages and sends then to client // 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)) { 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]; char charbuf[CMDBUFLEN];
string cmd; string cmd;
// nb! make lsbuf a class-member for multiple sessions // nb! make lsbuf a class-member for multiple sessions
@ -284,17 +267,12 @@ void LyXComm::callback(int fd, void *v)
errno = 0; errno = 0;
int status; int status;
// the single = is intended here. // the single = is intended here.
while ((status = read(fd, charbuf, CMDBUFLEN-1))) while ((status = read(infd, charbuf, CMDBUFLEN-1))) {
{// break and return in loop if (status > 0) {
if (status > 0) // got something
{
charbuf[status]= '\0'; // turn it into a c string charbuf[status]= '\0'; // turn it into a c string
lsbuf += strip(charbuf, '\r'); lsbuf += strip(charbuf, '\r');
// commit any commands read // commit any commands read
while (lsbuf.find('\n') != string::npos) // while still while (lsbuf.find('\n') != string::npos) {
// commands
// left
{
// split() grabs the entire string if // split() grabs the entire string if
// the delim /wasn't/ found. ?:-P // the delim /wasn't/ found. ?:-P
lsbuf= split(lsbuf, cmd,'\n'); lsbuf= split(lsbuf, cmd,'\n');
@ -303,19 +281,15 @@ void LyXComm::callback(int fd, void *v)
<< ", lsbuf:" << lsbuf << ", lsbuf:" << lsbuf
<< ", cmd:" << cmd << endl; << ", cmd:" << cmd << endl;
if (!cmd.empty()) if (!cmd.empty())
c->clientcb(c->client, cmd); clientcb(client, cmd);
//\n or not \n? //\n or not \n?
} }
} }
if (errno == EAGAIN) 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.
errno = 0; errno = 0;
return; // up to libforms select-loop (*crunch*) return;
} }
if (errno != 0) if (errno != 0) {
{
lyxerr << "LyXComm: " << strerror(errno) << endl; lyxerr << "LyXComm: " << strerror(errno) << endl;
if (!lsbuf.empty()) if (!lsbuf.empty())
{ {
@ -326,8 +300,8 @@ void LyXComm::callback(int fd, void *v)
break; // reset connection break; // reset connection
} }
} }
c->closeConnection(); closeConnection();
c->openConnection(); openConnection();
errno= 0; errno= 0;
} }

View File

@ -17,6 +17,9 @@
#endif #endif
#include "LString.h" #include "LString.h"
#include <boost/signals/trackable.hpp>
class LyXFunc; class LyXFunc;
class LyXServer; class LyXServer;
@ -29,7 +32,7 @@ class LyXServer;
This class encapsulates all the dirty communication and thus provides This class encapsulates all the dirty communication and thus provides
a clean string interface. a clean string interface.
*/ */
class LyXComm { class LyXComm : public boost::signals::trackable {
public: public:
/** When we receive a message, we send it to a client. /** When we receive a message, we send it to a client.
This is one of the small things that would have been a lot This is one of the small things that would have been a lot
@ -55,8 +58,8 @@ public:
/// Send message /// Send message
void send(string const &); void send(string const &);
/// We receive messages via XForms through this callback /// asynch ready-to-be-read notification
static void callback(int fd, void *v); void read_ready();
private: private:
/// the filename of the in pipe /// the filename of the in pipe