QWorkArea.[Ch]: Wheel one-liner mouse fix

QWorkArea.h: Added comments
Reverted to Q_WS_X11 and Q_WS_MACX instead of Q_OS_*


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@13371 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Abdelrazak Younes 2006-03-14 14:50:00 +00:00
parent b751c74fe1
commit 6d21659ce0
5 changed files with 50 additions and 27 deletions

View File

@ -1,8 +1,23 @@
2006-03-01 Jürgen Spitzmüller <j.spitzmueller@gmx.de>
2006-03-14 Abdelrazak Younes <younes.a@free.fr>
* QWorkArea.[Ch]: Wheel one-liner mouse fix
* QWorkArea.C: Reverted to Q_WS_X11 and Q_WS_MACX instead of Q_OS_*
* QWorkArea.h: Added comments
2006-03-12 Lars Gullik Bjønnes <larsbj@lyx.org>
* ui/pch.h: new file
2006-03-11 Abdelrazak Younes <younes.a@free.fr>
* Various Compilation fixes for MacOSX. There is still a problem
with Dialog.C:275 which does not recognize
2006-03-10 Jürgen Spitzmüller <j.spitzmueller@gmx.de>
* QLMenubar.h: compile fix for gcc-4.1.
2006-03-01 Abdelrazak Younes <younes.a@free.fr>
2006-03-10 Abdelrazak Younes <younes.a@free.fr>
* QWorkArea.[Ch] cleanup:
- Added private members workWidth_ and workHeight_ in order to
@ -14,10 +29,6 @@
separate place at the end of QWorkArea.C.
- initial support for Wheel mouse (still does not work).
2006-03-12 Lars Gullik Bjønnes <larsbj@lyx.org>
* ui/pch.h: new file
2006-03-10 Georg Baum <Georg.Baum@post.rwth-aachen.de>
* QWorkArea.C (getClipboard): convert MAC to UNIX line endings on OSX

View File

@ -149,7 +149,7 @@ MenuBackend const & QLMenubar::backend()
*/
QMenuBar * QLMenubar::menuBar() const
{
#ifdef Q_OS_MACX
#ifdef Q_WS_MACX
return mac_menubar_.get();
#else
return owner_->menuBar();
@ -158,7 +158,7 @@ QMenuBar * QLMenubar::menuBar() const
void QLMenubar::macxMenuBarInit()
{
#ifdef Q_OS_MACX
#ifdef Q_WS_MACX
mac_menubar_.reset(new QMenuBar);
// this is the name of the menu that contains our special entries

View File

@ -28,7 +28,7 @@
#include "debug.h"
#ifdef Q_OS_MACX
#ifdef Q_WS_MACX
#include "kbmap.h"
#include "QLyXKeySym.h"
extern boost::scoped_ptr<kb_keymap> toplevel_keymap;
@ -147,7 +147,7 @@ string const QLPopupMenu::getLabel(MenuItem const & mi)
/// \todo Mac specific binding handling.
void QLPopupMenu::addBinding(string & label, MenuItem const & mi)
{
#ifndef Q_OS_MACX
#ifndef Q_WS_MACX
string const binding(mi.binding());
if (!binding.empty()) {
@ -177,7 +177,7 @@ void QLPopupMenu::addBinding(string & label, MenuItem const & mi)
/// \todo Fix Mac specific menu hack
void QLPopupMenu::specialMacXmenuHack()
{
#ifdef Q_OS_MACX
#ifdef Q_WS_MACX
/* The qt/mac menu code has a very silly hack that
moves some menu entries that it recognizes by name
(e.g. "Preferences...") to the "LyX" menu. This

View File

@ -43,7 +43,7 @@
#include <X11/Xlib.h>
#endif
#ifdef Q_OS_MACX
#ifdef Q_WS_MACX
#include <Carbon/Carbon.h>
#include <support/lstrings.h>
using lyx::support::subst;
@ -185,7 +185,7 @@ QWorkArea::QWorkArea(LyXView &, int w, int h)
setInputMethodEnabled(true);
#endif
#ifdef Q_OS_X11
#ifdef Q_WS_X11
// doubleClickInterval() is 400 ms on X11 witch is just too long.
// On Windows and Mac OS X, the operating system's value is used.
// On Microsoft Windows, calling this function sets the double
@ -193,7 +193,7 @@ QWorkArea::QWorkArea(LyXView &, int w, int h)
QApplication::setDoubleClickInterval(300);
#endif
#ifdef Q_OS_MACX
#ifdef Q_WS_MACX
wa_ptr = this;
#endif
}
@ -249,7 +249,7 @@ string const QWorkArea::getClipboard() const
lyxerr[Debug::ACTION] << "getClipboard: " << (const char*) str << endl;
if (str.isNull())
return string();
#ifdef Q_OS_MACX
#ifdef Q_WS_MACX
// The MAC clipboard uses \r for lineendings, and we use \n
return subst(fromqstr(str), '\r', '\n');
#else
@ -260,7 +260,7 @@ string const QWorkArea::getClipboard() const
void QWorkArea::putClipboard(string const & str) const
{
#ifdef Q_OS_MACX
#ifdef Q_WS_MACX
// The MAC clipboard uses \r for lineendings, and we use \n
QApplication::clipboard()->setText(toqstr(subst(str, '\n', '\r')),
QClipboard::Selection);
@ -390,6 +390,7 @@ void QWorkArea::mouseMoveEvent(QMouseEvent * e)
void QWorkArea::wheelEvent(QWheelEvent * e)
{
verticalScrollBar()->setValue(verticalScrollBar()->value() - e->delta());
adjustViewWithScrollBar();
}
void QWorkArea::generateSyntheticMouseEvent()
@ -573,7 +574,7 @@ bool lyxX11EventFilter(XEvent * xev)
////////////////////////////////////////////////////////////////////////
// Mac OSX specific stuff goes here...
#ifdef Q_OS_MACX
#ifdef Q_WS_MACX
namespace{
OSErr checkAppleEventForMissingParams(const AppleEvent& theAppleEvent)
{
@ -637,4 +638,4 @@ pascal OSErr handleOpenDocuments(const AppleEvent* inEvent,
AEDisposeDesc(&documentList);
return err;
}
#endif // Q_OS_MACX
#endif // Q_WS_MACX

View File

@ -168,35 +168,46 @@ protected:
#endif
public slots:
void keyeventTimeout();
void adjustViewWithScrollBar(int action);
/// Timeout event Slot for keyboard bufferring.
/// \todo This is not used currently in the code, remove?
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);
private:
///
/// Buffer view width.
int workWidth_;
///
/// Buffer view height.
int workHeight_;
/// our painter
/// Our painter.
QLPainter painter_;
/// The slot connected to SyntheticMouseEvent::timeout.
void generateSyntheticMouseEvent();
///
SyntheticMouseEvent synthetic_mouse_event_;
/// the double buffered pixmap
boost::scoped_ptr<QPixmap> pixmap_;
/// \todo remove
QTimer step_timer_;
/// \todo remove
std::queue<boost::shared_ptr<QKeyEvent> > keyeventQueue_;
double_click dc_event_;
bool scrolled_with_mouse_;
bool scrolled_with_keyboard_;
};
#endif // QWORKAREA_H