+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
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
+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
+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()
class Dialogs;
class LyXFont;
+class LyXComm;
/// GUI interaction
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
#include "Alert.h"
#include "Alert_pimpl.h"
-#include "xforms_helpers.h"
using std::pair;
using std::make_pair;
+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
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 \
- remove getPixmap()
-LyXServer
-
- - remove xforms dependency
-
lyx_gui (qt)
- move out lyxserver
- do dpi
+ - implement set_read_callback
Menubar_pimpl
#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"
{
return fontloader.available(font);
}
+
+
+void lyx_gui::set_read_callback(int fd, LyXComm * comm)
+{
+ // FIXME
+}
+++ /dev/null
-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
+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
{
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);
+}
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 =========================================================== */
#include "lyxfunc.h"
#include "support/lstrings.h"
#include "support/lyxlib.h"
+#include "frontends/lyx_gui.h"
#ifdef __EMX__
#include <cstdlib>
#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;
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;
}
// 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
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');
<< ", 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())
{
break; // reset connection
}
}
- c->closeConnection();
- c->openConnection();
+ closeConnection();
+ openConnection();
errno= 0;
}
#endif
#include "LString.h"
+
+#include <boost/signals/trackable.hpp>
+
class LyXFunc;
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
/// 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