Fixed cursor handling
This commit is contained in:
@@ -182,6 +182,65 @@ bool MozQWidget::event(QEvent *e)
|
|||||||
return !ignore;
|
return !ignore;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool
|
||||||
|
MozQWidget::SetCursor(nsCursor aCursor)
|
||||||
|
{
|
||||||
|
Qt::CursorShape cursor = Qt::ArrowCursor;
|
||||||
|
switch(aCursor) {
|
||||||
|
case eCursor_standard:
|
||||||
|
cursor = Qt::ArrowCursor;
|
||||||
|
break;
|
||||||
|
case eCursor_wait:
|
||||||
|
cursor = Qt::WaitCursor;
|
||||||
|
break;
|
||||||
|
case eCursor_select:
|
||||||
|
cursor = Qt::IBeamCursor;
|
||||||
|
break;
|
||||||
|
case eCursor_hyperlink:
|
||||||
|
cursor = Qt::PointingHandCursor;
|
||||||
|
break;
|
||||||
|
case eCursor_ew_resize:
|
||||||
|
cursor = Qt::SplitHCursor;
|
||||||
|
break;
|
||||||
|
case eCursor_ns_resize:
|
||||||
|
cursor = Qt::SplitVCursor;
|
||||||
|
break;
|
||||||
|
case eCursor_nw_resize:
|
||||||
|
case eCursor_se_resize:
|
||||||
|
cursor = Qt::SizeBDiagCursor;
|
||||||
|
break;
|
||||||
|
case eCursor_ne_resize:
|
||||||
|
case eCursor_sw_resize:
|
||||||
|
cursor = Qt::SizeFDiagCursor;
|
||||||
|
break;
|
||||||
|
case eCursor_crosshair:
|
||||||
|
case eCursor_move:
|
||||||
|
cursor = Qt::SizeAllCursor;
|
||||||
|
break;
|
||||||
|
case eCursor_help:
|
||||||
|
cursor = Qt::WhatsThisCursor;
|
||||||
|
break;
|
||||||
|
case eCursor_copy:
|
||||||
|
case eCursor_alias:
|
||||||
|
break;
|
||||||
|
case eCursor_context_menu:
|
||||||
|
case eCursor_cell:
|
||||||
|
case eCursor_grab:
|
||||||
|
case eCursor_grabbing:
|
||||||
|
case eCursor_spinning:
|
||||||
|
case eCursor_zoom_in:
|
||||||
|
case eCursor_zoom_out:
|
||||||
|
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
// FIXME after reimplementation of whole nsWindow SetCursor cause lot of errors
|
||||||
|
setCursor(cursor);
|
||||||
|
|
||||||
|
return NS_OK;
|
||||||
|
}
|
||||||
|
|
||||||
void MozQWidget::setModal(bool modal)
|
void MozQWidget::setModal(bool modal)
|
||||||
{
|
{
|
||||||
if (modal)
|
if (modal)
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
#define MOZQWIDGET_H
|
#define MOZQWIDGET_H
|
||||||
|
|
||||||
#include <qwidget.h>
|
#include <qwidget.h>
|
||||||
|
#include "nsIWidget.h"
|
||||||
|
|
||||||
class QEvent;
|
class QEvent;
|
||||||
class nsWindow;
|
class nsWindow;
|
||||||
@@ -17,6 +18,7 @@ public:
|
|||||||
* Mozilla helper.
|
* Mozilla helper.
|
||||||
*/
|
*/
|
||||||
void setModal(bool);
|
void setModal(bool);
|
||||||
|
bool SetCursor(nsCursor aCursor);
|
||||||
void dropReciever() { mReceiver = 0x0; };
|
void dropReciever() { mReceiver = 0x0; };
|
||||||
nsWindow* getReciever() { return mReceiver; };
|
nsWindow* getReciever() { return mReceiver; };
|
||||||
|
|
||||||
|
|||||||
@@ -40,6 +40,7 @@
|
|||||||
|
|
||||||
#include "prlink.h"
|
#include "prlink.h"
|
||||||
|
|
||||||
|
#include <qevent.h> //XXX switch for forward-decl
|
||||||
#include <QtGui>
|
#include <QtGui>
|
||||||
#include <qcursor.h>
|
#include <qcursor.h>
|
||||||
|
|
||||||
@@ -96,6 +97,17 @@
|
|||||||
#include "glitz-glx.h"
|
#include "glitz-glx.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include <qapplication.h>
|
||||||
|
#include <qdesktopwidget.h>
|
||||||
|
#include <qwidget.h>
|
||||||
|
#include "qx11info_x11.h"
|
||||||
|
#include <qcursor.h>
|
||||||
|
#include <qobject.h>
|
||||||
|
#include <execinfo.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
#include <execinfo.h>
|
||||||
|
|
||||||
#include "mozqwidget.h"
|
#include "mozqwidget.h"
|
||||||
|
|
||||||
/* For PrepareNativeWidget */
|
/* For PrepareNativeWidget */
|
||||||
@@ -567,63 +579,11 @@ NS_IMETHODIMP
|
|||||||
nsWindow::SetCursor(nsCursor aCursor)
|
nsWindow::SetCursor(nsCursor aCursor)
|
||||||
{
|
{
|
||||||
mCursor = aCursor;
|
mCursor = aCursor;
|
||||||
switch(mCursor) {
|
MozQWidget *mozWidget = static_cast<MozQWidget*>(mDrawingarea);
|
||||||
case eCursor_standard:
|
mozWidget->SetCursor(mCursor);
|
||||||
mQCursor = Qt::ArrowCursor;
|
|
||||||
break;
|
|
||||||
case eCursor_wait:
|
|
||||||
mQCursor = Qt::WaitCursor;
|
|
||||||
break;
|
|
||||||
case eCursor_select:
|
|
||||||
mQCursor = Qt::IBeamCursor;
|
|
||||||
break;
|
|
||||||
case eCursor_hyperlink:
|
|
||||||
mQCursor = Qt::PointingHandCursor;
|
|
||||||
break;
|
|
||||||
case eCursor_ew_resize:
|
|
||||||
mQCursor = Qt::SplitHCursor;
|
|
||||||
break;
|
|
||||||
case eCursor_ns_resize:
|
|
||||||
mQCursor = Qt::SplitVCursor;
|
|
||||||
break;
|
|
||||||
case eCursor_nw_resize:
|
|
||||||
case eCursor_se_resize:
|
|
||||||
mQCursor = Qt::SizeBDiagCursor;
|
|
||||||
break;
|
|
||||||
case eCursor_ne_resize:
|
|
||||||
case eCursor_sw_resize:
|
|
||||||
mQCursor = Qt::SizeFDiagCursor;
|
|
||||||
break;
|
|
||||||
case eCursor_crosshair:
|
|
||||||
case eCursor_move:
|
|
||||||
mQCursor = Qt::SizeAllCursor;
|
|
||||||
break;
|
|
||||||
case eCursor_help:
|
|
||||||
mQCursor = Qt::WhatsThisCursor;
|
|
||||||
break;
|
|
||||||
case eCursor_copy:
|
|
||||||
case eCursor_alias:
|
|
||||||
break;
|
|
||||||
case eCursor_context_menu:
|
|
||||||
case eCursor_cell:
|
|
||||||
case eCursor_grab:
|
|
||||||
case eCursor_grabbing:
|
|
||||||
case eCursor_spinning:
|
|
||||||
case eCursor_zoom_in:
|
|
||||||
case eCursor_zoom_out:
|
|
||||||
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
return NS_OK;
|
|
||||||
// FIXME after reimplementation of whole nsWindow SetCursor cause lot of errors
|
|
||||||
if (mDrawingarea)
|
|
||||||
mDrawingarea->setCursor(mQCursor);
|
|
||||||
|
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static
|
static
|
||||||
PRUint8* Data32BitTo1Bit(PRUint8* aImageData,
|
PRUint8* Data32BitTo1Bit(PRUint8* aImageData,
|
||||||
PRUint32 aImageBytesPerRow,
|
PRUint32 aImageBytesPerRow,
|
||||||
|
|||||||
@@ -50,10 +50,13 @@
|
|||||||
#include "nsITimer.h"
|
#include "nsITimer.h"
|
||||||
#include "nsWidgetAtoms.h"
|
#include "nsWidgetAtoms.h"
|
||||||
|
|
||||||
|
|
||||||
#ifdef Q_WS_X11
|
#ifdef Q_WS_X11
|
||||||
#include <QX11Info>
|
#include <QX11Info>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
class QEvent;
|
||||||
|
|
||||||
class nsWindow : public nsCommonWidget, public nsSupportsWeakReference
|
class nsWindow : public nsCommonWidget, public nsSupportsWeakReference
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|||||||
Reference in New Issue
Block a user