+2002-07-20 John Levon <moz@compsoc.man.ac.uk>
+
+ * QLImage.C: various fixes
+
+ * QWorkArea.C: set focus proxy
+
+ * qscreen.C: don't show cursor when in command buffer
+
+ * Makefile.am:
+ * moc/Makefile.am:
+ * QMiniBuffer.h:
+ * QMiniBuffer.C:
+ * QCommandBuffer.h:
+ * QCommandBuffer.C:
+ * QCommandEdit.h:
+ * QCommandEdit.C:
+ * QtView.h:
+ * QtView.C: Rudimentary command buffer
+
2002-07-19 John Levon <moz@compsoc.man.ac.uk>
* QWorkArea.C: remove unnecessary include
Timeout_pimpl.h \
Toolbar_pimpl.C \
Toolbar_pimpl.h \
+ QCommandBuffer.C \
+ QCommandBuffer.h \
+ QCommandEdit.C \
+ QCommandEdit.h \
QContentPane.C \
QContentPane.h \
QLImage.C \
QLPainter.h \
QLyXKeySym.C \
QLyXKeySym.h \
- QMiniBuffer.C \
- QMiniBuffer.h \
Qt2Base.C \
Qt2Base.h \
Qt2BC.C \
QLImage::QLImage(QLImage const & other)
- : Image(other), pixmap_(other.pixmap_)
+ : Image(other), pixmap_(other.pixmap_), xformed_pixmap_(other.xformed_pixmap_)
{
}
unsigned int QLImage::getWidth() const
{
- return pixmap_.width();
+ return xformed_pixmap_.width();
}
unsigned int QLImage::getHeight() const
{
- return pixmap_.height();
+ return xformed_pixmap_.height();
}
finishedLoading(false);
return;
}
+ lyxerr[Debug::GRAPHICS] << "just Loaded." << endl;
+ xformed_pixmap_ = pixmap_;
+ lyxerr[Debug::GRAPHICS] << "pixmap isNull " << pixmap_.isNull()
+ << " xformed_pixmap_ isNull " << xformed_pixmap_.isNull() << endl;
finishedLoading(true);
}
bool QLImage::setPixmap(Params const & params)
{
+ lyxerr[Debug::GRAPHICS] << "pixmap isNull " << pixmap_.isNull()
+ << " xformed_pixmap_ isNull " << xformed_pixmap_.isNull() << endl;
if (pixmap_.isNull() || params.display == NoDisplay)
return false;
+ lyxerr[Debug::GRAPHICS] << "setPixmap()" << endl;
+
// FIXME
#if 0
int color_key;
}
#endif
- xformed_pixmap_ = pixmap_;
return true;
}
void QLImage::clip(Params const & params)
{
- if (pixmap_.isNull())
+ lyxerr << "clip isNull " << pixmap_.isNull() << ", " <<xformed_pixmap_.isNull() << endl;
+ if (xformed_pixmap_.isNull())
return;
if (params.bb.empty())
void QLImage::rotate(Params const & params)
{
+ lyxerr << "rotate isNull " << pixmap_.isNull() << ", " <<xformed_pixmap_.isNull() << endl;
if (xformed_pixmap_.isNull())
return;
// The angle passed to flimage_rotate is the angle in one-tenth of a
// degree units.
+ lyxerr[Debug::GRAPHICS] << "rotating image by " << params.angle << " degrees" << endl;
+
QWMatrix m;
- m.rotate(params.angle / 10.0);
- xformed_pixmap_.xForm(m);
+ m.rotate(params.angle);
+ xformed_pixmap_ = xformed_pixmap_.xForm(m);
}
void QLImage::scale(Params const & params)
{
+ lyxerr << "scale isNull " << pixmap_.isNull() << ", " <<xformed_pixmap_.isNull() << endl;
if (xformed_pixmap_.isNull())
return;
if (width == getWidth() && height == getHeight())
return;
- xformed_pixmap_.resize(width, height);
+ lyxerr[Debug::GRAPHICS] << "resizing image to " << width << "(" <<
+ (double(width)/getWidth()) << ")," << height << "(" <<
+ (double(height)/getHeight()) << ")" << endl;
+ QWMatrix m;
+ m.scale(double(width) / getWidth(), double(height) / getHeight());
+ xformed_pixmap_ = xformed_pixmap_.xForm(m);
}
} // namespace grfx
+++ /dev/null
-// -*- C++ -*-
-/**
- * \file QMiniBuffer.C
- * Copyright 1995-2002 the LyX Team
- * Read the file COPYING
- *
- * \author Lars
- * \author Asger and Juergen
- * \author John Levon <moz@compsoc.man.ac.uk>
- */
-
-#include <config.h>
-
-#ifdef __GNUG__
-#pragma implementation
-#endif
-
-#include "QMiniBuffer.h"
-
-QMiniBuffer::QMiniBuffer(LyXView * o)
- : MiniBuffer(o)
-{
-}
-
-
-QMiniBuffer::~QMiniBuffer()
-{
-}
-
-
-bool QMiniBuffer::isEditingMode() const
-{
- return false;
-}
-
-
-void QMiniBuffer::editingMode()
-{
-}
-
-
-
-void QMiniBuffer::messageMode()
-{
-}
-
-
-void QMiniBuffer::set_input(string const &)
-{
-}
+++ /dev/null
-// -*- C++ -*-
-/**
- * \file QMiniBuffer.h
- * Copyright 1995-2002 the LyX Team
- * Read the file COPYING
- *
- * \author Lars
- * \author Asger and Juergen
- * \author John Levon <moz@compsoc.man.ac.uk>
- */
-
-#ifndef QMINIBUFFER_H
-#define QMINIBUFFER_H
-
-#include "LString.h"
-
-#include "frontends/MiniBuffer.h"
-
-#ifdef __GNUG__
-#pragma interface
-#endif
-
-/// FIXME: place holder only
-class QMiniBuffer : public MiniBuffer {
-public:
- ///
- QMiniBuffer(LyXView *);
-
- /// destructor
- virtual ~QMiniBuffer();
-
-protected:
- /// Are we in editing mode?
- virtual bool isEditingMode() const;
- /// enter editing mode
- virtual void editingMode();
- /// enter message display mode
- virtual void messageMode();
-
- /// set the minibuffer content in editing mode
- virtual void set_input(string const &);
-
-};
-
-#endif // QMINIBUFFER_H
(static_cast<QMainWindow*>(qApp->mainWidget()))->setCentralWidget(this);
+ setFocusProxy(content_);
+
content_->show();
content_->setBackgroundColor(lcolor.getX11Name(LColor::background).c_str());
#include "lyx_cb.h"
#include "support/filetools.h"
#include "MenuBackend.h"
-#include "QMiniBuffer.h"
#include "ToolbarDefaults.h"
#include "lyxfunc.h"
#include "bufferview_funcs.h"
#include "frontends/Dialogs.h"
#include "frontends/Timeout.h"
+#include <boost/bind.hpp>
+
#include "QtView.h"
#include "qfont_loader.h"
+#include "QCommandBuffer.h"
#include <qapplication.h>
#include <qpixmap.h>
#include <qmenubar.h>
#include <qstatusbar.h>
-#include <boost/bind.hpp>
-
using std::endl;
// FIXME: this has to go away
statusBar()->setSizeGripEnabled(false);
- minibuffer_.reset(new QMiniBuffer(this));
-
bufferview_.reset(new BufferView(this, 0, 0, width, height));
::current_view = bufferview_.get();
view_state_changed.connect(boost::bind(&QtView::update_view_state, this));
+ connect(&idle_timer_, SIGNAL(timeout()), this, SLOT(update_view_state_qt()));
+
+ idle_timer_.start(3000);
+
+ focus_command_buffer.connect(boost::bind(&QtView::focus_command_widget, this));
+
+ commandbuffer_ = new QCommandBuffer(this, *controlcommand_);
+
+ addToolBar(commandbuffer_, Bottom, true);
// FIXME: move
// FIXME autosave_timeout_->timeout.connect(SigC::slot(this, &QtView::autoSave));
}
+void QtView::message(string const & str)
+{
+ statusBar()->message(str.c_str());
+}
+
+
+void QtView::focus_command_widget()
+{
+ commandbuffer_->focus_command();
+}
+
+
+void QtView::update_view_state_qt()
+{
+ message(currentState(view()));
+}
+
+
void QtView::update_view_state()
{
- statusBar()->message(currentState(view()).c_str());
+ message(currentState(view()));
}
#include "frontends/LyXView.h"
#include <qmainwindow.h>
+#include <qtimer.h>
+
+class QCommandBuffer;
/**
* QtView - Qt implementation of LyXView
/// end modal operation
virtual void allowInput() const;
+ /// display a status message
+ virtual void message(string const & str);
+
public slots:
/// menu item has been selected
void activated(int id);
+ /// idle timeout
+ void update_view_state_qt();
+
protected:
/// make sure we quit cleanly
virtual void closeEvent(QCloseEvent * e);
private:
+ /// focus the command buffer widget
+ void focus_command_widget();
+
/// update status bar
void update_view_state();
setCaption(t.c_str());
setIconText(it.c_str());
}
+
+ /// idle timer
+ QTimer idle_timer_;
+
+ /// command buffer
+ QCommandBuffer * commandbuffer_;
};
#endif // QTVIEW_H
- loop round searching not working perhaps ??
+QCommandBuffer
+
+ - finish off, use listview etc.
+
QContentPane
- triple click
QGraphics
- - UI cleanups. Maybe not vital
+ - UI cleanups and fixes
QInclude
QLImage
- get jpeg etc. to work
- - get rotation etc. to work
- get mono/color to work
- get bgcolor and clipping to work
- isOK() - meaningful or not ?
- getISOEncoded - get this to work (*)
-QMiniBuffer
-
- - implement as a QStatusBar and a separate QToolbar containing a QComboBox (*)
- - make the necessary GUII API changes for this to work (*)
-
QPreferences
- implement me (*)
lengthcombo_moc.C \
qttableview_moc.C \
Toolbar_pimpl_moc.C \
+ QCommandBuffer_moc.C \
+ QCommandEdit_moc.C \
QContentPane_moc.C \
Qt2Base_moc.C \
QtView_moc.C \
#include "insets/insettext.h"
#include "debug.h"
+#include <qapplication.h>
+
using std::endl;
using std::max;
using std::min;
void QScreen::showManualCursor(LyXText const * text, int x, int y,
int asc, int desc, Cursor_Shape shape)
{
+ if (!qApp->focusWidget())
+ return;
+
+ string const focusname(qApp->focusWidget()->name());
+
+ // Probably a hack
+ if (focusname != "content_pane")
+ return;
+
int const y1 = max(y - text->first_y - asc, 0);
int const y_tmp = min(y - text->first_y + desc, owner_.height());