// restore selected branch
if (bname == sel_branch)
branchesLV->setSelected(newItem, true);
- }\r
+ }
emit changed();
}
if (selItem != 0)
sel_branch = selItem->text(0);
if (!sel_branch.isEmpty()) {
- QColor initial("lightskyblue");\r
+ QColor initial("lightskyblue");
string current_branch = fromqstr(sel_branch);
Branch * branch =
branchlist_.find(current_branch);
void update(BufferParams const & params);
void apply(BufferParams & params) const;
-\r
-signals:\r
- void changed();\r
+
+signals:
+ void changed();
protected:
void toggleBranch(Q3ListViewItem * selItem);
branchesModule = new QBranches;
- connect(branchesModule, SIGNAL(changed()), this, SLOT(change_adaptor()));\r
+ connect(branchesModule, SIGNAL(changed()), this, SLOT(change_adaptor()));
preambleModule = new UiWidget<Ui::PreambleUi>;
#include "MenuBackend.h"
-#include "debug.h"\r
+#include "debug.h"
#include <QMenuBar>
#include <QCursor>
QPainter qp(qwa_->paintDevice());
qp.drawPixmap(x, y, pixmap);
}
-\r
-void QLPainter::drawImage(int x, int y, QImage const & image)\r
-{\r
- QPainter qp(qwa_->paintDevice());\r
- qp.drawImage(x, y, image);\r
-}\r
+
+void QLPainter::drawImage(int x, int y, QImage const & image)
+{
+ QPainter qp(qwa_->paintDevice());
+ qp.drawImage(x, y, image);
+}
class QPaintDevice;
class QPainter;
class QString;
-class QPixmap;\r
-class QImage;\r
+class QPixmap;
+class QImage;
class QWorkArea;
/**
~QLPainter();
- /// begin painting\r
- /**\r
- Not used in the the Qt4 frontend.\r
+ /// begin painting
+ /**
+ Not used in the the Qt4 frontend.
*/
virtual void start() {}
/// end painting
- /**\r
- Not used in the the Qt4 frontend.\r
- */\r
+ /**
+ Not used in the the Qt4 frontend.
+ */
virtual void end() {}
/// return the width of the work area in pixels
/// draw a pixmap from the image cache
virtual void drawPixmap(int x, int y, QPixmap const & pixmap);
- /// draw a pixmap from the image cache\r
- virtual void drawImage(int x, int y, QImage const & image);\r
-\r
+ /// draw a pixmap from the image cache
+ virtual void drawImage(int x, int y, QImage const & image);
+
private:
/// draw small caps text
void smallCapsText(int x, int y,
lyxerr[Debug::GUI] << "\tTriggered menu: " << name_ << endl;
clear();
-\r
+
if (name_.empty())
return;
/// Top Level Menu
Menu topLevelMenu_;
-\r
- /// Mac specific menu hack\r
- /// \todo Fix it\r
- void specialMacXmenuHack();\r
+
+ /// Mac specific menu hack
+ /// \todo Fix it
+ void specialMacXmenuHack();
};
} // namespace frontend
verticalScrollBar()->setPageStep(viewport()->height());
screen_device_ = QPixmap(viewport()->width(), viewport()->height());
- paint_device_ = QImage(viewport()->width(), viewport()->height(), QImage::Format_RGB32);\r
+ paint_device_ = QImage(viewport()->width(), viewport()->height(), QImage::Format_RGB32);
this->workAreaResize();
-\r
+
/*
lyxerr[Debug::GUI] << BOOST_CURRENT_FUNCTION
<< "\n QWidget width\t" << this->QWidget::width()
<< "\n viewport height\t" << viewport()->height()
<< "\n QResizeEvent rect left\t" << rect().left()
<< "\n QResizeEvent rect right\t" << rect().right()
- << endl;\r
+ << endl;
*/
}
-void QWorkArea::update(int x, int y, int w, int h)\r
-{\r
- //screen_device_.fromImage(paint_device_);\r
- QPainter q(&screen_device_);\r
- q.drawImage(x, y, paint_device_.copy(x, y, w, h));\r
- \r
- viewport()->update(x, y, w, h);\r
-}\r
-\r
+void QWorkArea::update(int x, int y, int w, int h)
+{
+ //screen_device_.fromImage(paint_device_);
+ QPainter q(&screen_device_);
+ q.drawImage(x, y, paint_device_.copy(x, y, w, h));
+
+ viewport()->update(x, y, w, h);
+}
+
void QWorkArea::paintEvent(QPaintEvent * e)
-{\r
+{
/*
lyxerr[Debug::GUI] << BOOST_CURRENT_FUNCTION
<< "\n QWidget width\t" << this->width()
<< "\n QPaintEvent y\t" << e->rect().y()
<< "\n QPaintEvent w\t" << e->rect().width()
<< "\n QPaintEvent h\t" << e->rect().height()
- << endl;\r
+ << endl;
*/
QPainter q(viewport());
q.drawPixmap(e->rect(), screen_device_, e->rect());
}
-\r
-QPixmap QWorkArea::copyScreen(int x, int y, int w, int h) const\r
-{\r
- return screen_device_.copy(x, y, w, h);\r
-}\r
-\r
-void QWorkArea::drawScreen(int x, int y, QPixmap pixmap)\r
-{\r
- QPainter q(&screen_device_);\r
- q.drawPixmap(x, y, pixmap);\r
- viewport()->update(x, y, pixmap.width(), pixmap.height());\r
-}\r
+
+QPixmap QWorkArea::copyScreen(int x, int y, int w, int h) const
+{
+ return screen_device_.copy(x, y, w, h);
+}
+
+void QWorkArea::drawScreen(int x, int y, QPixmap pixmap)
+{
+ QPainter q(&screen_device_);
+ q.drawPixmap(x, y, pixmap);
+ viewport()->update(x, y, pixmap.width(), pixmap.height());
+}
///////////////////////////////////////////////////////////////
#include "QLPainter.h"
#include "LyXView.h"
-#include "funcrequest.h"\r
-#include "frontends/Timeout.h"\r
-\r
+#include "funcrequest.h"
+#include "frontends/Timeout.h"
+
#include <QAbstractScrollArea>
#include <QMouseEvent>
#include <QWheelEvent>
#include <QKeyEvent>
#include <QPaintEvent>
#include <QTimer>
-#include <QImage>\r
-#include <QPixmap>\r
+#include <QImage>
+#include <QPixmap>
#include <queue>
/// return the backing pixmap
QPaintDevice * paintDevice() { return &paint_device_; }
-\r
+
/// update the passed area.
- void update(int x, int y, int w, int h);\r
+ void update(int x, int y, int w, int h);
- /// return a screen copy of the defined area.\r
+ /// return a screen copy of the defined area.
QPixmap copyScreen(int x, int y, int w, int h) const;
- /// Draw a pixmap onto the backing pixmap.\r
- /**\r
- QPixmap is implicitely shared so no need to pass by reference.\r
- */\r
- void drawScreen(int x, int y, QPixmap pixmap);\r
-\r
+ /// Draw a pixmap onto the backing pixmap.
+ /**
+ QPixmap is implicitely shared so no need to pass by reference.
+ */
+ void drawScreen(int x, int y, QPixmap pixmap);
+
protected:
/// repaint part of the widget
#endif
public slots:
-\r
- /// Timeout event Slot for keyboard bufferring.\r
+
+ /// Timeout event Slot for keyboard bufferring.
/// \todo This is not used currently in the code, remove?
- void keyeventTimeout();\r
-\r
- /// Adjust the LyX buffer view with the position of the scrollbar.\r
- /**\r
- * The action argument is not used in the the code, it is there\r
- * only for the connection to the vertical srollbar signal which \r
- * emits an 'int' action.\r
+ void keyeventTimeout();
+
+ /// Adjust the LyX buffer view with the position of the scrollbar.
+ /**
+ * The action argument is not used in the the code, it is there
+ * only for the connection to the vertical srollbar signal which
+ * emits an 'int' action.
*/
void adjustViewWithScrollBar(int action = 0);
/// Buffer view width.
int workWidth_;
-\r
- /// Buffer view height.\r
+
+ /// Buffer view height.
int workHeight_;
/// Our painter.
/// The slot connected to SyntheticMouseEvent::timeout.
void generateSyntheticMouseEvent();
- ///\r
+ ///
SyntheticMouseEvent synthetic_mouse_event_;
/// Our client side painting device.
QImage paint_device_;
- /// Our server side painting device.\r
- QPixmap screen_device_;\r
-\r
- /// \todo remove\r
+ /// Our server side painting device.
+ QPixmap screen_device_;
+
+ /// \todo remove
QTimer step_timer_;
-\r
- /// \todo remove\r
+
+ /// \todo remove
std::queue<boost::shared_ptr<QKeyEvent> > keyeventQueue_;
double_click dc_event_;
#include "LColor.h"
-LColorCache lcolorcache;\r
-\r
-const QColor grey40(0x66, 0x66, 0x66);\r
-const QColor grey60(0x99, 0x99, 0x99);\r
-const QColor grey80(0xcc, 0xcc, 0xcc);\r
-const QColor grey90(0xe5, 0xe5, 0xe5);\r
+LColorCache lcolorcache;
+
+const QColor grey40(0x66, 0x66, 0x66);
+const QColor grey60(0x99, 0x99, 0x99);
+const QColor grey80(0xcc, 0xcc, 0xcc);
+const QColor grey90(0xe5, 0xe5, 0xe5);
LColorCache::LColorCache()
list_->setColumnCount(1);
list_->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding));
- stack_->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding));\r
+ stack_->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding));
list_->setSortingEnabled(false);
// list_->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
//it->second->addChild(item);
}
- panel_map_[n] = item;\r
-\r
+ panel_map_[n] = item;
+
list_->setFixedWidth(list_->sizeHint().width());
/*
item->setFlags(false);
* Full author contact details are available in file CREDITS.
*/
-#include <config.h>\r
+#include <config.h>
-#include "QWorkArea.h"\r
-#include "qscreen.h"\r
-\r
-#include <QColor>\r
-#include <QPainter>\r
+#include "QWorkArea.h"
+#include "qscreen.h"
+
+#include <QColor>
+#include <QPainter>
#include <QApplication>
-#include "debug.h"\r
-#include "lcolorcache.h"\r
-\r
+#include "debug.h"
+#include "lcolorcache.h"
+
namespace {
void QScreen::expose(int x, int y, int w, int h)
{
- lyxerr[Debug::GUI] << "expose " << w << 'x' << h\r
+ lyxerr[Debug::GUI] << "expose " << w << 'x' << h
<< '+' << x << '+' << y << std::endl;
owner_.update(x, y, w, h);
// 1 the rectangle of the original screen.
// 2 the vertical line of the cursor.
// 3 the horizontal line of the L-shaped cursor (if necessary).
-\r
+
QColor const & required_color = lcolorcache.get(LColor::cursor);
bool const cursor_color_changed = required_color != cursor_color_;
if (cursor_color_changed)
- cursor_color_ = required_color;\r
-\r
- vcursor_ = QPixmap(cursor_w_, cursor_h_);\r
- vcursor_ .fill(cursor_color_);\r
+ cursor_color_ = required_color;
+
+ vcursor_ = QPixmap(cursor_w_, cursor_h_);
+ vcursor_ .fill(cursor_color_);
switch (shape) {
case BAR_SHAPE:
if (cursor_w_ != hcursor_.width() ||
cursor_color_changed) {
if (cursor_w_ != hcursor_.width())
- hcursor_ = QPixmap(cursor_w_, 1);\r
- hcursor_.fill(cursor_color_);\r
+ hcursor_ = QPixmap(cursor_w_, 1);
+ hcursor_.fill(cursor_color_);
}
break;
}
- // Save the old area (no cursor).\r
- nocursor_ = owner_.copyScreen(cursor_x_, cursor_y_, cursor_w_, cursor_h_);\r
+ // Save the old area (no cursor).
+ nocursor_ = owner_.copyScreen(cursor_x_, cursor_y_, cursor_w_, cursor_h_);
// Draw the new (vertical) cursor using the cached store.
owner_.drawScreen(cursor_x_, cursor_y_, vcursor_);
* This file is part of LyX, the document processor.
* Licence details can be found in the file COPYING.
*
- * \author John Levon\r
+ * \author John Levon
*
* Full author contact details are available in file CREDITS.
*/
#ifndef QSCREEN_H
#define QSCREEN_H
-\r
-#include "screen.h"\r
-#include <QPixmap>\r
-\r
-class QColor;\r
+#include "screen.h"
+
+#include <QPixmap>
+
+class QColor;
class QWorkArea;
class WorkArea;