2008-04-19 15:37:51 +00:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
|
|
|
/* vim:expandtab:shiftwidth=4:tabstop=4:
|
|
|
|
*/
|
|
|
|
/* ***** BEGIN LICENSE BLOCK *****
|
2008-04-19 15:31:50 +00:00
|
|
|
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
|
|
|
*
|
|
|
|
* The contents of this file are subject to the Mozilla Public License Version
|
|
|
|
* 1.1 (the "License"); you may not use this file except in compliance with
|
|
|
|
* the License. You may obtain a copy of the License at
|
|
|
|
* http://www.mozilla.org/MPL/
|
|
|
|
*
|
|
|
|
* Software distributed under the License is distributed on an "AS IS" basis,
|
|
|
|
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
|
|
|
* for the specific language governing rights and limitations under the
|
|
|
|
* License.
|
|
|
|
*
|
|
|
|
* The Original Code is mozilla.org code.
|
|
|
|
*
|
2008-04-19 15:37:51 +00:00
|
|
|
* The Initial Developer of the Original Code is Christopher Blizzard
|
|
|
|
* <blizzard@mozilla.org>. Portions created by the Initial Developer
|
|
|
|
* are Copyright (C) 2001 the Initial Developer. All Rights Reserved.
|
2008-04-19 15:31:50 +00:00
|
|
|
*
|
|
|
|
* Contributor(s):
|
2008-04-19 15:37:51 +00:00
|
|
|
* Masayuki Nakano <masayuki@d-toybox.com>
|
2008-04-22 11:21:18 +00:00
|
|
|
* Vladimir Vukicevic <vladimir@pobox.com>
|
2008-04-19 15:31:50 +00:00
|
|
|
*
|
|
|
|
* Alternatively, the contents of this file may be used under the terms of
|
|
|
|
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
|
|
|
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
|
|
|
* in which case the provisions of the GPL or the LGPL are applicable instead
|
|
|
|
* of those above. If you wish to allow use of your version of this file only
|
|
|
|
* under the terms of either the GPL or the LGPL, and not to allow others to
|
|
|
|
* use your version of this file under the terms of the MPL, indicate your
|
|
|
|
* decision by deleting the provisions above and replace them with the notice
|
|
|
|
* and other provisions required by the GPL or the LGPL. If you do not delete
|
|
|
|
* the provisions above, a recipient may use your version of this file under
|
|
|
|
* the terms of any one of the MPL, the GPL or the LGPL.
|
|
|
|
*
|
|
|
|
* ***** END LICENSE BLOCK ***** */
|
2008-04-19 15:37:51 +00:00
|
|
|
|
|
|
|
#ifndef __nsWindow_h__
|
|
|
|
#define __nsWindow_h__
|
|
|
|
|
2010-03-04 21:51:42 +00:00
|
|
|
#include <QKeyEvent>
|
|
|
|
#include <qgraphicswidget.h>
|
|
|
|
|
2008-04-19 15:37:51 +00:00
|
|
|
#include "nsAutoPtr.h"
|
2008-04-19 15:31:50 +00:00
|
|
|
|
2008-04-22 11:21:17 +00:00
|
|
|
#include "nsBaseWidget.h"
|
|
|
|
#include "nsGUIEvent.h"
|
2008-04-19 15:37:51 +00:00
|
|
|
|
2008-04-19 15:31:50 +00:00
|
|
|
#include "nsWeakReference.h"
|
|
|
|
|
2008-04-19 15:37:51 +00:00
|
|
|
#include "nsWidgetAtoms.h"
|
|
|
|
|
2008-04-22 11:21:17 +00:00
|
|
|
#ifdef MOZ_LOGGING
|
|
|
|
|
|
|
|
// make sure that logging is enabled before including prlog.h
|
|
|
|
#define FORCE_PR_LOG
|
|
|
|
|
|
|
|
#include "prlog.h"
|
2009-01-22 04:15:34 +00:00
|
|
|
#include "nsTArray.h"
|
2008-04-22 11:21:17 +00:00
|
|
|
|
|
|
|
extern PRLogModuleInfo *gWidgetLog;
|
|
|
|
extern PRLogModuleInfo *gWidgetFocusLog;
|
|
|
|
extern PRLogModuleInfo *gWidgetIMLog;
|
|
|
|
extern PRLogModuleInfo *gWidgetDrawLog;
|
|
|
|
|
|
|
|
#define LOG(args) PR_LOG(gWidgetLog, 4, args)
|
|
|
|
#define LOGFOCUS(args) PR_LOG(gWidgetFocusLog, 4, args)
|
|
|
|
#define LOGIM(args) PR_LOG(gWidgetIMLog, 4, args)
|
|
|
|
#define LOGDRAW(args) PR_LOG(gWidgetDrawLog, 4, args)
|
|
|
|
|
|
|
|
#else
|
|
|
|
|
|
|
|
#ifdef DEBUG_WIDGETS
|
|
|
|
|
|
|
|
#define PR_LOG2(_args) \
|
|
|
|
PR_BEGIN_MACRO \
|
|
|
|
qDebug _args; \
|
|
|
|
PR_END_MACRO
|
|
|
|
|
|
|
|
#define LOG(args) PR_LOG2(args)
|
|
|
|
#define LOGFOCUS(args) PR_LOG2(args)
|
|
|
|
#define LOGIM(args) PR_LOG2(args)
|
|
|
|
#define LOGDRAW(args) PR_LOG2(args)
|
|
|
|
|
|
|
|
#else
|
|
|
|
|
|
|
|
#define LOG(args)
|
|
|
|
#define LOGFOCUS(args)
|
|
|
|
#define LOGIM(args)
|
|
|
|
#define LOGDRAW(args)
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif /* MOZ_LOGGING */
|
|
|
|
|
2008-04-19 15:37:55 +00:00
|
|
|
class QEvent;
|
2010-06-24 10:07:57 +00:00
|
|
|
class QGraphicsView;
|
2008-04-19 15:37:55 +00:00
|
|
|
|
2008-04-20 08:16:40 +00:00
|
|
|
class MozQWidget;
|
|
|
|
|
2010-04-16 17:37:16 +00:00
|
|
|
class nsIdleService;
|
|
|
|
|
2008-04-22 11:21:17 +00:00
|
|
|
class nsWindow : public nsBaseWidget,
|
|
|
|
public nsSupportsWeakReference
|
2008-04-19 15:31:50 +00:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
nsWindow();
|
|
|
|
virtual ~nsWindow();
|
|
|
|
|
2010-02-16 18:14:20 +00:00
|
|
|
nsEventStatus DoPaint( QPainter* aPainter, const QStyleOptionGraphicsItem * aOption );
|
|
|
|
|
2008-04-19 15:37:51 +00:00
|
|
|
static void ReleaseGlobals();
|
2008-04-19 15:31:50 +00:00
|
|
|
|
|
|
|
NS_DECL_ISUPPORTS_INHERITED
|
|
|
|
|
2008-04-22 11:21:17 +00:00
|
|
|
//
|
2008-04-19 15:37:51 +00:00
|
|
|
// nsIWidget
|
2008-04-22 11:21:17 +00:00
|
|
|
//
|
|
|
|
|
2009-08-05 02:39:05 +00:00
|
|
|
NS_IMETHOD ConfigureChildren(const nsTArray<nsIWidget::Configuration>&);
|
|
|
|
|
2008-04-19 15:37:51 +00:00
|
|
|
NS_IMETHOD Create(nsIWidget *aParent,
|
2009-09-24 06:18:10 +00:00
|
|
|
nsNativeWidget aNativeParent,
|
|
|
|
const nsIntRect &aRect,
|
2008-04-19 15:37:51 +00:00
|
|
|
EVENT_CALLBACK aHandleEventFunction,
|
|
|
|
nsIDeviceContext *aContext,
|
|
|
|
nsIAppShell *aAppShell,
|
|
|
|
nsIToolkit *aToolkit,
|
|
|
|
nsWidgetInitData *aInitData);
|
|
|
|
NS_IMETHOD Destroy(void);
|
|
|
|
NS_IMETHOD SetParent(nsIWidget* aNewParent);
|
2008-04-22 11:21:17 +00:00
|
|
|
virtual nsIWidget *GetParent(void);
|
|
|
|
NS_IMETHOD Show(PRBool aState);
|
2008-04-19 15:37:51 +00:00
|
|
|
NS_IMETHOD SetModal(PRBool aModal);
|
|
|
|
NS_IMETHOD IsVisible(PRBool & aState);
|
|
|
|
NS_IMETHOD ConstrainPosition(PRBool aAllowSlop,
|
|
|
|
PRInt32 *aX,
|
|
|
|
PRInt32 *aY);
|
|
|
|
NS_IMETHOD Move(PRInt32 aX,
|
|
|
|
PRInt32 aY);
|
2008-04-22 11:21:17 +00:00
|
|
|
NS_IMETHOD Resize(PRInt32 aWidth,
|
|
|
|
PRInt32 aHeight,
|
|
|
|
PRBool aRepaint);
|
|
|
|
NS_IMETHOD Resize(PRInt32 aX,
|
|
|
|
PRInt32 aY,
|
|
|
|
PRInt32 aWidth,
|
|
|
|
PRInt32 aHeight,
|
|
|
|
PRBool aRepaint);
|
2008-04-19 15:37:51 +00:00
|
|
|
NS_IMETHOD PlaceBehind(nsTopLevelWidgetZPlacement aPlacement,
|
|
|
|
nsIWidget *aWidget,
|
|
|
|
PRBool aActivate);
|
|
|
|
NS_IMETHOD SetSizeMode(PRInt32 aMode);
|
|
|
|
NS_IMETHOD Enable(PRBool aState);
|
|
|
|
NS_IMETHOD SetFocus(PRBool aRaise = PR_FALSE);
|
2009-02-11 13:51:06 +00:00
|
|
|
NS_IMETHOD GetScreenBounds(nsIntRect &aRect);
|
2008-04-19 15:37:51 +00:00
|
|
|
NS_IMETHOD SetForegroundColor(const nscolor &aColor);
|
|
|
|
NS_IMETHOD SetBackgroundColor(const nscolor &aColor);
|
|
|
|
NS_IMETHOD SetCursor(nsCursor aCursor);
|
|
|
|
NS_IMETHOD SetCursor(imgIContainer* aCursor,
|
|
|
|
PRUint32 aHotspotX, PRUint32 aHotspotY);
|
2008-04-22 11:21:17 +00:00
|
|
|
NS_IMETHOD SetHasTransparentBackground(PRBool aTransparent);
|
|
|
|
NS_IMETHOD GetHasTransparentBackground(PRBool& aTransparent);
|
|
|
|
NS_IMETHOD HideWindowChrome(PRBool aShouldHide);
|
|
|
|
NS_IMETHOD MakeFullScreen(PRBool aFullScreen);
|
2009-02-11 13:51:06 +00:00
|
|
|
NS_IMETHOD Invalidate(const nsIntRect &aRect,
|
2008-04-19 15:37:51 +00:00
|
|
|
PRBool aIsSynchronous);
|
|
|
|
NS_IMETHOD Update();
|
2008-04-22 11:21:17 +00:00
|
|
|
|
2008-04-19 15:37:51 +00:00
|
|
|
virtual void* GetNativeData(PRUint32 aDataType);
|
|
|
|
NS_IMETHOD SetTitle(const nsAString& aTitle);
|
|
|
|
NS_IMETHOD SetIcon(const nsAString& aIconSpec);
|
2009-02-19 00:11:49 +00:00
|
|
|
virtual nsIntPoint WidgetToScreenOffset();
|
2008-04-22 11:21:17 +00:00
|
|
|
NS_IMETHOD DispatchEvent(nsGUIEvent *aEvent, nsEventStatus &aStatus);
|
|
|
|
|
2008-04-19 15:37:51 +00:00
|
|
|
NS_IMETHOD EnableDragDrop(PRBool aEnable);
|
|
|
|
NS_IMETHOD CaptureMouse(PRBool aCapture);
|
|
|
|
NS_IMETHOD CaptureRollupEvents(nsIRollupListener *aListener,
|
2009-12-22 23:49:33 +00:00
|
|
|
nsIMenuRollup *aMenuRollup,
|
2008-04-19 15:37:51 +00:00
|
|
|
PRBool aDoCapture,
|
|
|
|
PRBool aConsumeRollupEvent);
|
2008-04-22 11:21:17 +00:00
|
|
|
|
|
|
|
NS_IMETHOD SetWindowClass(const nsAString& xulWinType);
|
|
|
|
|
2008-04-19 15:37:51 +00:00
|
|
|
NS_IMETHOD GetAttention(PRInt32 aCycleCount);
|
2008-04-22 11:21:17 +00:00
|
|
|
NS_IMETHOD BeginResizeDrag (nsGUIEvent* aEvent, PRInt32 aHorizontal, PRInt32 aVertical);
|
2008-04-19 15:31:50 +00:00
|
|
|
|
2010-03-12 22:07:32 +00:00
|
|
|
NS_IMETHODIMP SetIMEEnabled(PRUint32 aState);
|
|
|
|
NS_IMETHODIMP GetIMEEnabled(PRUint32* aState);
|
2010-06-24 10:07:57 +00:00
|
|
|
NS_IMETHOD SetAcceleratedRendering(PRBool aEnabled);
|
2010-03-12 22:07:32 +00:00
|
|
|
|
2008-04-22 11:21:17 +00:00
|
|
|
//
|
2008-04-19 15:37:51 +00:00
|
|
|
// utility methods
|
2008-04-22 11:21:17 +00:00
|
|
|
//
|
2009-03-27 11:35:27 +00:00
|
|
|
void QWidgetDestroyed();
|
|
|
|
|
2008-04-22 11:21:17 +00:00
|
|
|
/***** from CommonWidget *****/
|
|
|
|
|
|
|
|
// event handling code
|
|
|
|
|
|
|
|
void DispatchActivateEvent(void);
|
|
|
|
void DispatchDeactivateEvent(void);
|
2010-07-29 01:05:56 +00:00
|
|
|
void DispatchActivateEventOnTopLevelWindow(void);
|
|
|
|
void DispatchDeactivateEventOnTopLevelWindow(void);
|
2009-02-11 13:51:06 +00:00
|
|
|
void DispatchResizeEvent(nsIntRect &aRect, nsEventStatus &aStatus);
|
2008-04-22 11:21:17 +00:00
|
|
|
|
|
|
|
nsEventStatus DispatchEvent(nsGUIEvent *aEvent) {
|
|
|
|
nsEventStatus status;
|
|
|
|
DispatchEvent(aEvent, status);
|
|
|
|
return status;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Some of the nsIWidget methods
|
|
|
|
NS_IMETHOD IsEnabled (PRBool *aState);
|
|
|
|
|
|
|
|
// called when we are destroyed
|
|
|
|
void OnDestroy(void);
|
|
|
|
|
|
|
|
// called to check and see if a widget's dimensions are sane
|
|
|
|
PRBool AreBoundsSane(void);
|
|
|
|
|
2008-04-19 15:31:50 +00:00
|
|
|
protected:
|
2008-04-22 11:21:17 +00:00
|
|
|
nsCOMPtr<nsIWidget> mParent;
|
|
|
|
// Is this a toplevel window?
|
|
|
|
PRPackedBool mIsTopLevel;
|
|
|
|
// Has this widget been destroyed yet?
|
|
|
|
PRPackedBool mIsDestroyed;
|
|
|
|
|
|
|
|
// This flag tracks if we're hidden or shown.
|
|
|
|
PRPackedBool mIsShown;
|
|
|
|
// is this widget enabled?
|
|
|
|
PRBool mEnabled;
|
|
|
|
// Has anyone set an x/y location for this widget yet? Toplevels
|
|
|
|
// shouldn't be automatically set to 0,0 for first show.
|
|
|
|
PRBool mPlaced;
|
|
|
|
|
2010-02-04 14:43:52 +00:00
|
|
|
// Remember the last sizemode so that we can restore it when
|
|
|
|
// leaving fullscreen
|
|
|
|
nsSizeMode mLastSizeMode;
|
|
|
|
|
2008-04-19 15:37:51 +00:00
|
|
|
/**
|
|
|
|
* Event handlers (proxied from the actual qwidget).
|
|
|
|
* They follow normal Qt widget semantics.
|
|
|
|
*/
|
2009-07-15 12:20:21 +00:00
|
|
|
void Initialize(MozQWidget *widget);
|
2008-04-19 15:37:51 +00:00
|
|
|
friend class nsQtEventDispatcher;
|
|
|
|
friend class InterceptContainer;
|
|
|
|
friend class MozQWidget;
|
|
|
|
|
2010-02-16 18:14:20 +00:00
|
|
|
virtual nsEventStatus OnMoveEvent(QGraphicsSceneHoverEvent *);
|
|
|
|
virtual nsEventStatus OnResizeEvent(QGraphicsSceneResizeEvent *);
|
2008-04-22 11:21:18 +00:00
|
|
|
virtual nsEventStatus OnCloseEvent(QCloseEvent *);
|
2010-02-16 18:14:20 +00:00
|
|
|
virtual nsEventStatus OnEnterNotifyEvent(QGraphicsSceneHoverEvent *);
|
|
|
|
virtual nsEventStatus OnLeaveNotifyEvent(QGraphicsSceneHoverEvent *);
|
|
|
|
virtual nsEventStatus OnMotionNotifyEvent(QGraphicsSceneMouseEvent *);
|
|
|
|
virtual nsEventStatus OnButtonPressEvent(QGraphicsSceneMouseEvent *);
|
|
|
|
virtual nsEventStatus OnButtonReleaseEvent(QGraphicsSceneMouseEvent *);
|
2010-04-21 22:54:25 +00:00
|
|
|
virtual nsEventStatus OnMouseDoubleClickEvent(QGraphicsSceneMouseEvent *);
|
2010-02-16 18:14:20 +00:00
|
|
|
virtual nsEventStatus OnFocusInEvent(QEvent *);
|
|
|
|
virtual nsEventStatus OnFocusOutEvent(QEvent *);
|
2008-04-20 08:16:40 +00:00
|
|
|
virtual nsEventStatus OnKeyPressEvent(QKeyEvent *);
|
|
|
|
virtual nsEventStatus OnKeyReleaseEvent(QKeyEvent *);
|
2010-02-16 18:14:20 +00:00
|
|
|
virtual nsEventStatus OnScrollEvent(QGraphicsSceneWheelEvent *);
|
2008-04-20 08:16:40 +00:00
|
|
|
|
2010-02-16 18:14:20 +00:00
|
|
|
virtual nsEventStatus contextMenuEvent(QGraphicsSceneContextMenuEvent *);
|
2008-04-20 08:16:40 +00:00
|
|
|
virtual nsEventStatus imStartEvent(QEvent *);
|
|
|
|
virtual nsEventStatus imComposeEvent(QEvent *);
|
|
|
|
virtual nsEventStatus imEndEvent(QEvent *);
|
2010-02-16 18:14:20 +00:00
|
|
|
virtual nsEventStatus OnDragEnter (QGraphicsSceneDragDropEvent *);
|
|
|
|
virtual nsEventStatus OnDragMotionEvent(QGraphicsSceneDragDropEvent *);
|
|
|
|
virtual nsEventStatus OnDragLeaveEvent(QGraphicsSceneDragDropEvent *);
|
|
|
|
virtual nsEventStatus OnDragDropEvent (QGraphicsSceneDragDropEvent *);
|
2008-04-20 08:16:40 +00:00
|
|
|
virtual nsEventStatus showEvent(QShowEvent *);
|
|
|
|
virtual nsEventStatus hideEvent(QHideEvent *);
|
|
|
|
|
2010-03-12 22:11:42 +00:00
|
|
|
//Gestures are only supported in qt > 4.6
|
|
|
|
#if (QT_VERSION >= QT_VERSION_CHECK(4, 6, 0))
|
|
|
|
virtual nsEventStatus OnTouchEvent(QTouchEvent *event, PRBool &handled);
|
|
|
|
virtual nsEventStatus OnGestureEvent(QGestureEvent *event, PRBool &handled);
|
|
|
|
double DistanceBetweenPoints(const QPointF &aFirstPoint, const QPointF &aSecondPoint);
|
|
|
|
#endif
|
|
|
|
|
2008-04-19 15:37:51 +00:00
|
|
|
void NativeResize(PRInt32 aWidth,
|
|
|
|
PRInt32 aHeight,
|
|
|
|
PRBool aRepaint);
|
|
|
|
|
|
|
|
void NativeResize(PRInt32 aX,
|
|
|
|
PRInt32 aY,
|
|
|
|
PRInt32 aWidth,
|
|
|
|
PRInt32 aHeight,
|
|
|
|
PRBool aRepaint);
|
|
|
|
|
|
|
|
void NativeShow (PRBool aAction);
|
|
|
|
|
|
|
|
enum PluginType {
|
|
|
|
PluginType_NONE = 0, /* do not have any plugin */
|
|
|
|
PluginType_XEMBED, /* the plugin support xembed */
|
|
|
|
PluginType_NONXEMBED /* the plugin does not support xembed */
|
|
|
|
};
|
|
|
|
|
|
|
|
void SetPluginType(PluginType aPluginType);
|
|
|
|
|
|
|
|
void ThemeChanged(void);
|
|
|
|
|
2010-06-24 10:07:57 +00:00
|
|
|
virtual LayerManager* GetLayerManager();
|
2010-02-16 18:14:20 +00:00
|
|
|
gfxASurface* GetThebesSurface();
|
2008-04-19 15:37:51 +00:00
|
|
|
|
|
|
|
private:
|
2010-02-16 18:14:20 +00:00
|
|
|
void* SetupPluginPort(void);
|
2009-01-22 04:15:34 +00:00
|
|
|
nsresult SetWindowIconList(const nsTArray<nsCString> &aIconList);
|
2008-04-19 15:37:51 +00:00
|
|
|
void SetDefaultIcon(void);
|
2010-02-16 18:14:20 +00:00
|
|
|
void InitButtonEvent(nsMouseEvent &event, QGraphicsSceneMouseEvent *aEvent, int aClickCount = 1);
|
2008-04-19 15:37:51 +00:00
|
|
|
PRBool DispatchCommandEvent(nsIAtom* aCommand);
|
2010-02-16 18:14:20 +00:00
|
|
|
MozQWidget* createQWidget(MozQWidget *parent, nsWidgetInitData *aInitData);
|
|
|
|
|
|
|
|
QWidget* GetViewWidget();
|
2010-06-24 10:07:57 +00:00
|
|
|
PRBool IsAcceleratedQView(QGraphicsView* aView);
|
2008-04-19 15:37:51 +00:00
|
|
|
|
2010-02-16 18:14:20 +00:00
|
|
|
MozQWidget* mWidget;
|
2008-04-19 15:37:51 +00:00
|
|
|
|
2010-02-16 18:14:20 +00:00
|
|
|
PRUint32 mIsVisible : 1,
|
|
|
|
mActivatePending : 1;
|
|
|
|
PRInt32 mSizeState;
|
|
|
|
PluginType mPluginType;
|
2008-04-19 15:37:51 +00:00
|
|
|
|
2008-04-19 15:31:50 +00:00
|
|
|
nsRefPtr<gfxASurface> mThebesSurface;
|
2010-04-16 17:37:16 +00:00
|
|
|
nsCOMPtr<nsIdleService> mIdleService;
|
2008-04-19 15:37:51 +00:00
|
|
|
|
|
|
|
PRBool mIsTransparent;
|
|
|
|
|
|
|
|
// all of our DND stuff
|
|
|
|
// this is the last window that had a drag event happen on it.
|
|
|
|
void InitDragEvent (nsMouseEvent &aEvent);
|
|
|
|
|
|
|
|
// this is everything we need to be able to fire motion events
|
|
|
|
// repeatedly
|
|
|
|
PRUint32 mKeyDownFlags[8];
|
|
|
|
|
|
|
|
/* Helper methods for DOM Key Down event suppression. */
|
|
|
|
PRUint32* GetFlagWord32(PRUint32 aKeyCode, PRUint32* aMask) {
|
|
|
|
/* Mozilla DOM Virtual Key Code is from 0 to 224. */
|
|
|
|
NS_ASSERTION((aKeyCode <= 0xFF), "Invalid DOM Key Code");
|
|
|
|
aKeyCode &= 0xFF;
|
|
|
|
|
|
|
|
/* 32 = 2^5 = 0x20 */
|
|
|
|
*aMask = PRUint32(1) << (aKeyCode & 0x1F);
|
|
|
|
return &mKeyDownFlags[(aKeyCode >> 5)];
|
|
|
|
}
|
|
|
|
|
|
|
|
PRBool IsKeyDown(PRUint32 aKeyCode) {
|
|
|
|
PRUint32 mask;
|
|
|
|
PRUint32* flag = GetFlagWord32(aKeyCode, &mask);
|
|
|
|
return ((*flag) & mask) != 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
void SetKeyDownFlag(PRUint32 aKeyCode) {
|
|
|
|
PRUint32 mask;
|
|
|
|
PRUint32* flag = GetFlagWord32(aKeyCode, &mask);
|
|
|
|
*flag |= mask;
|
|
|
|
}
|
|
|
|
|
|
|
|
void ClearKeyDownFlag(PRUint32 aKeyCode) {
|
|
|
|
PRUint32 mask;
|
|
|
|
PRUint32* flag = GetFlagWord32(aKeyCode, &mask);
|
|
|
|
*flag &= ~mask;
|
|
|
|
}
|
|
|
|
PRInt32 mQCursor;
|
|
|
|
|
2010-04-16 17:37:16 +00:00
|
|
|
// Call this function when the users activity is the direct cause of an
|
|
|
|
// event (like a keypress or mouse click).
|
|
|
|
void UserActivity();
|
|
|
|
|
2010-02-25 20:45:37 +00:00
|
|
|
// Remember dirty area caused by ::Scroll
|
|
|
|
QRegion mDirtyScrollArea;
|
2010-03-12 22:11:42 +00:00
|
|
|
|
|
|
|
#if (QT_VERSION >= QT_VERSION_CHECK(4, 6, 0))
|
|
|
|
double mTouchPointDistance;
|
|
|
|
double mLastPinchDistance;
|
|
|
|
PRBool mMouseEventsDisabled;
|
2010-03-26 00:33:31 +00:00
|
|
|
#endif
|
2010-03-22 02:55:36 +00:00
|
|
|
|
|
|
|
PRPackedBool mNeedsResize;
|
|
|
|
PRPackedBool mNeedsMove;
|
|
|
|
PRPackedBool mListenForResizes;
|
|
|
|
PRPackedBool mNeedsShow;
|
2008-04-19 15:31:50 +00:00
|
|
|
};
|
|
|
|
|
2008-04-19 15:37:51 +00:00
|
|
|
class nsChildWindow : public nsWindow
|
2008-04-19 15:31:50 +00:00
|
|
|
{
|
|
|
|
public:
|
2008-04-19 15:37:51 +00:00
|
|
|
nsChildWindow();
|
|
|
|
~nsChildWindow();
|
2008-04-19 15:31:50 +00:00
|
|
|
|
2010-02-16 18:14:20 +00:00
|
|
|
PRInt32 mChildID;
|
2008-04-19 15:31:50 +00:00
|
|
|
};
|
|
|
|
|
2008-04-19 15:37:51 +00:00
|
|
|
class nsPopupWindow : public nsWindow
|
2008-04-19 15:31:50 +00:00
|
|
|
{
|
|
|
|
public:
|
2010-02-16 18:14:20 +00:00
|
|
|
nsPopupWindow ();
|
|
|
|
~nsPopupWindow ();
|
2008-04-19 15:31:50 +00:00
|
|
|
|
2010-02-16 18:14:20 +00:00
|
|
|
PRInt32 mChildID;
|
2008-04-19 15:31:50 +00:00
|
|
|
};
|
2008-04-19 15:37:51 +00:00
|
|
|
#endif /* __nsWindow_h__ */
|
2008-04-19 15:31:50 +00:00
|
|
|
|