Back to index

lightning-sunbird  0.9+nobinonly
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | Protected Types | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Static Protected Attributes | Private Types | Private Member Functions | Static Private Member Functions | Private Attributes | Static Private Attributes | Friends
nsWindow Class Reference

Native BeOS window wrapper. More...

#include <nsWindow.h>

Inheritance diagram for nsWindow:
Inheritance graph
[legend]
Collaboration diagram for nsWindow:
Collaboration graph
[legend]

List of all members.

Public Types

enum  PluginType { PluginType_NONE = 0, PluginType_XEMBED, PluginType_NONXEMBED }
enum  {
  CREATE = 0x0101, CREATE_NATIVE, DESTROY, SET_FOCUS,
  GOT_FOCUS, KILL_FOCUS, ONMOUSE, ONDROP,
  ONWHEEL, ONPAINT, ONRESIZE, CLOSEWINDOW,
  ONKEY, BTNCLICK, ONACTIVATE, ONMOVE,
  ONWORKSPACE
}

Public Member Functions

 nsWindow ()
virtual ~nsWindow ()
 NS_IMETHOD_ (nsrefcnt) AddRef(void)
 NS_IMETHOD_ (nsrefcnt) Release(void)
NS_IMETHOD Create (nsIWidget *aParent, const nsRect &aRect, EVENT_CALLBACK aHandleEventFunction, nsIDeviceContext *aContext, nsIAppShell *aAppShell=nsnull, nsIToolkit *aToolkit=nsnull, nsWidgetInitData *aInitData=nsnull)
 Create and initialize a widget.
NS_IMETHOD Create (nsNativeWidget aParent, const nsRect &aRect, EVENT_CALLBACK aHandleEventFunction, nsIDeviceContext *aContext, nsIAppShell *aAppShell=nsnull, nsIToolkit *aToolkit=nsnull, nsWidgetInitData *aInitData=nsnull)
 Create and initialize a widget with a native window parent.
NS_IMETHOD PreCreateWidget (nsWidgetInitData *aWidgetInitData)
virtual nsresult StandardWindowCreate (nsIWidget *aParent, const nsRect &aRect, EVENT_CALLBACK aHandleEventFunction, nsIDeviceContext *aContext, nsIAppShell *aAppShell, nsIToolkit *aToolkit, nsWidgetInitData *aInitData, nsNativeWidget aNativeParent=nsnull)
NS_IMETHOD Destroy ()
 Close and destroy the internal native window.
virtual nsIWidgetGetParent (void)
 Return the parent Widget of this Widget or nsnull if this is a top level window.
NS_IMETHOD Show (PRBool bState)
 Show or hide this widget.
NS_IMETHOD CaptureMouse (PRBool aCapture)
 Enables/Disables system mouse capture.
NS_IMETHOD CaptureRollupEvents (nsIRollupListener *aListener, PRBool aDoCapture, PRBool aConsumeRollupEvent)
 Enables/Disables system capture of any and all events that would cause a dropdown to be rolled up, This method ignores the aConsumeRollupEvent parameter when aDoCapture is FALSE.
NS_IMETHOD IsVisible (PRBool &aState)
 Returns whether the window is visible.
NS_IMETHOD ConstrainPosition (PRBool aAllowSlop, PRInt32 *aX, PRInt32 *aY)
 Perform platform-dependent sanity check on a potential window position.
NS_IMETHOD Move (PRInt32 aX, PRInt32 aY)
 Move this widget.
NS_IMETHOD Resize (PRInt32 aWidth, PRInt32 aHeight, PRBool aRepaint)
 Resize this widget.
NS_IMETHOD Resize (PRInt32 aX, PRInt32 aY, PRInt32 aWidth, PRInt32 aHeight, PRBool aRepaint)
 Move or resize this widget.
NS_IMETHOD SetModal (PRBool aModal)
 Make the window modal.
NS_IMETHOD Enable (PRBool aState)
 Enable or disable this Widget.
NS_IMETHOD IsEnabled (PRBool *aState)
 Ask whether the widget is enabled.
NS_IMETHOD SetFocus (PRBool aRaise)
 Give focus to this widget.
NS_IMETHOD GetScreenBounds (nsRect &aRect)
 If the implementation of nsWindow uses a local coordinate system within the window, this method must be overridden.
NS_IMETHOD SetBackgroundColor (const nscolor &aColor)
 Set the background color for this widget.
virtual nsIFontMetricsGetFont (void)
 Get the font for this widget.
NS_IMETHOD SetFont (const nsFont &aFont)
 Set the font for this widget.
NS_IMETHOD SetCursor (nsCursor aCursor)
 Set the cursor for this widget.
NS_IMETHOD Invalidate (PRBool aIsSynchronous)
 Invalidate the widget and repaint it.
NS_IMETHOD Invalidate (const nsRect &aRect, PRBool aIsSynchronous)
 Invalidate a specified rect for a widget and repaints it.
NS_IMETHOD InvalidateRegion (const nsIRegion *aRegion, PRBool aIsSynchronous)
 Invalidate a specified region for a widget and repaints it.
NS_IMETHOD Update ()
 Force a synchronous repaint of the window if there are dirty rects.
virtual voidGetNativeData (PRUint32 aDataType)
NS_IMETHOD SetColorMap (nsColorMap *aColorMap)
 Set the color map for this widget.
NS_IMETHOD Scroll (PRInt32 aDx, PRInt32 aDy, nsRect *aClipRect)
 XXX (This is obsolete and will be removed soon, Use ScrollWidgets instead) Scroll this widget.
NS_IMETHOD SetTitle (const nsAString &aTitle)
 Set the widget's title.
NS_IMETHOD SetMenuBar (nsIMenuBar *aMenuBar)
 Set the widget's MenuBar.
NS_IMETHOD ShowMenuBar (PRBool aShow)
 Set the widget's MenuBar's visibility.
NS_IMETHOD WidgetToScreen (const nsRect &aOldRect, nsRect &aNewRect)
 Convert from this widget coordinates to screen coordinates.
NS_IMETHOD ScreenToWidget (const nsRect &aOldRect, nsRect &aNewRect)
 Convert from screen coordinates to this widget's coordinates.
NS_IMETHOD BeginResizingChildren (void)
 When adjustments are to made to a whole set of child widgets, call this before resizing/positioning the child windows to minimize repaints.
NS_IMETHOD EndResizingChildren (void)
 Call this when finished adjusting child windows.
NS_IMETHOD GetPreferredSize (PRInt32 &aWidth, PRInt32 &aHeight)
 Returns the preferred width and height for the widget.
NS_IMETHOD SetPreferredSize (PRInt32 aWidth, PRInt32 aHeight)
 Set the preferred width and height for the widget.
NS_IMETHOD DispatchEvent (nsGUIEvent *event, nsEventStatus &aStatus)
 Dispatches an event to the widget.
virtual void ConvertToDeviceCoordinates (nscoord &aX, nscoord &aY)
virtual bool CallMethod (MethodInfo *info)
virtual PRBool DispatchMouseEvent (PRUint32 aEventType, nsPoint aPoint, PRUint32 clicks, PRUint32 mod)
void InitEvent (nsGUIEvent &event, nsPoint *aPoint=nsnull)
nsToolkitGetToolkit ()
 Return the widget's toolkit.
 nsWindow ()
virtual ~nsWindow ()
NS_DECL_ISUPPORTS_INHERITED
NS_IMETHOD 
WidgetToScreen (const nsRect &aOldRect, nsRect &aNewRect)
 Convert from this widget coordinates to screen coordinates.
NS_IMETHOD PreCreateWidget (nsWidgetInitData *aWidgetInitData)
virtual voidGetNativeData (PRUint32 aDataType)
NS_IMETHOD Scroll (PRInt32 aDx, PRInt32 aDy, nsRect *aClipRect)
 XXX (This is obsolete and will be removed soon, Use ScrollWidgets instead) Scroll this widget.
NS_IMETHOD ScrollWidgets (PRInt32 aDx, PRInt32 aDy)
 Scroll the contents of the widget.
NS_IMETHOD ScrollRect (nsRect &aSrcRect, PRInt32 aDx, PRInt32 aDy)
 Scroll an area of this widget.
NS_IMETHOD SetTitle (const nsAString &aTitle)
 Set the widget's title.
NS_IMETHOD Show (PRBool aShow)
 Show or hide this widget.
NS_IMETHOD CaptureMouse (PRBool aCapture)
 Enables/Disables system mouse capture.
NS_IMETHOD ConstrainPosition (PRBool aAllowSlop, PRInt32 *aX, PRInt32 *aY)
 Perform platform-dependent sanity check on a potential window position.
NS_IMETHOD Move (PRInt32 aX, PRInt32 aY)
 Move this widget.
NS_IMETHOD Resize (PRInt32 aWidth, PRInt32 aHeight, PRBool aRepaint)
 Resize this widget.
NS_IMETHOD Resize (PRInt32 aX, PRInt32 aY, PRInt32 aWidth, PRInt32 aHeight, PRBool aRepaint)
 Move or resize this widget.
NS_IMETHOD BeginResizingChildren (void)
 When adjustments are to made to a whole set of child widgets, call this before resizing/positioning the child windows to minimize repaints.
NS_IMETHOD EndResizingChildren (void)
 Call this when finished adjusting child windows.
NS_IMETHOD GetScreenBounds (nsRect &aRect)
 If the implementation of nsWindow uses a local coordinate system within the window, this method must be overridden.
NS_IMETHOD CaptureRollupEvents (nsIRollupListener *aListener, PRBool aDoCapture, PRBool aConsumeRollupEvent)
 Enables/Disables system capture of any and all events that would cause a dropdown to be rolled up, This method ignores the aConsumeRollupEvent parameter when aDoCapture is FALSE.
NS_IMETHOD Validate ()
 Validate the widget.
NS_IMETHOD Invalidate (PRBool aIsSynchronous)
 Invalidate the widget and repaint it.
NS_IMETHOD Invalidate (const nsRect &aRect, PRBool aIsSynchronous)
 Invalidate a specified rect for a widget and repaints it.
NS_IMETHOD InvalidateRegion (const nsIRegion *aRegion, PRBool aIsSynchronous)
 Invalidate a specified region for a widget and repaints it.
NS_IMETHOD SetBackgroundColor (const nscolor &aColor)
 Set the background color for this widget.
NS_IMETHOD SetCursor (nsCursor aCursor)
 Set the cursor for this widget.
NS_IMETHOD Enable (PRBool aState)
 Enable or disable this Widget.
NS_IMETHOD IsEnabled (PRBool *aState)
 Ask whether the widget is enabled.
NS_IMETHOD SetFocus (PRBool aRaise)
 Give focus to this widget.
NS_IMETHOD GetAttention (PRInt32 aCycleCount)
 Bring this window to the user's attention.
NS_IMETHOD Destroy ()
 Close and destroy the internal native window.
NS_IMETHOD SetParent (nsIWidget *aNewParent)
 Reparent a widget.
void ResizeTransparencyBitmap (PRInt32 aNewWidth, PRInt32 aNewHeight)
void ApplyTransparencyBitmap ()
NS_IMETHOD SetIcon (const nsAString &aIcon)
 Set the widget's icon.
GdkCursor * GtkCreateCursor (nsCursor aCursorType)
virtual void LoseFocus (void)
NS_IMETHOD ResetInputState ()
void QueueDraw ()
void UnqueueDraw ()
void DoPaint (nsIRegion *aClipRegion)
virtual GtkWindow * GetTopLevelWindow (void)
NS_IMETHOD Update (void)
 Force a synchronous repaint of the window if there are dirty rects.
virtual void OnMotionNotifySignal (GdkEventMotion *aGdkMotionEvent)
virtual void OnEnterNotifySignal (GdkEventCrossing *aGdkCrossingEvent)
virtual void OnLeaveNotifySignal (GdkEventCrossing *aGdkCrossingEvent)
virtual void OnButtonPressSignal (GdkEventButton *aGdkButtonEvent)
virtual void OnButtonReleaseSignal (GdkEventButton *aGdkButtonEvent)
virtual void OnFocusInSignal (GdkEventFocus *aGdkFocusEvent)
virtual void OnFocusOutSignal (GdkEventFocus *aGdkFocusEvent)
virtual void InstallFocusInSignal (GtkWidget *aWidget)
virtual void InstallFocusOutSignal (GtkWidget *aWidget)
void HandleGDKEvent (GdkEvent *event)
gint ConvertBorderStyles (nsBorderStyle bs)
void InvalidateWindowPos (void)
void HandleXlibConfigureNotifyEvent (XEvent *event)
virtual GtkWidget * GetOwningWidget ()
nsWindowGetOwningWindow ()
nsWindowType GetOwningWindowType ()
virtual GdkWindow * GetRenderWindow (GtkObject *aGtkWidget)
virtual void DestroyNative (void)
PRBool GrabInProgress (void)
GdkWindow * GetGdkGrabWindow (void)
virtual GdkWindow * GetLayeringWindow ()
virtual void DispatchSetFocusEvent (void)
virtual void DispatchLostFocusEvent (void)
virtual void DispatchActivateEvent (void)
virtual void DispatchDeactivateEvent (void)
void HandleMozAreaFocusIn (void)
void HandleMozAreaFocusOut (void)
virtual void IMECommitEvent (GdkEventKey *aEvent)
 nsWindow ()
virtual ~nsWindow ()
NS_DECL_ISUPPORTS_INHERITED
NS_IMETHOD 
Create (nsIWidget *aParent, const nsRect &aRect, EVENT_CALLBACK aHandleEventFunction, nsIDeviceContext *aContext, nsIAppShell *aAppShell, nsIToolkit *aToolkit, nsWidgetInitData *aInitData)
 Create and initialize a widget.
NS_IMETHOD Create (nsNativeWidget aParent, const nsRect &aRect, EVENT_CALLBACK aHandleEventFunction, nsIDeviceContext *aContext, nsIAppShell *aAppShell, nsIToolkit *aToolkit, nsWidgetInitData *aInitData)
 Create and initialize a widget with a native window parent.
NS_IMETHOD Destroy (void)
 Close and destroy the internal native window.
NS_IMETHOD SetParent (nsIWidget *aNewParent)
 Reparent a widget.
NS_IMETHOD SetModal (PRBool aModal)
 Make the window modal.
NS_IMETHOD IsVisible (PRBool &aState)
 Returns whether the window is visible.
NS_IMETHOD ConstrainPosition (PRBool aAllowSlop, PRInt32 *aX, PRInt32 *aY)
 Perform platform-dependent sanity check on a potential window position.
NS_IMETHOD Move (PRInt32 aX, PRInt32 aY)
 Move this widget.
NS_IMETHOD PlaceBehind (nsTopLevelWidgetZPlacement aPlacement, nsIWidget *aWidget, PRBool aActivate)
 Position this widget just behind the given widget.
NS_IMETHOD SetZIndex (PRInt32 aZIndex)
 Sets the widget's z-index.
NS_IMETHOD SetSizeMode (PRInt32 aMode)
 Minimize, maximize or normalize the window size.
NS_IMETHOD Enable (PRBool aState)
 Enable or disable this Widget.
NS_IMETHOD SetFocus (PRBool aRaise=PR_FALSE)
 Give focus to this widget.
NS_IMETHOD GetScreenBounds (nsRect &aRect)
 If the implementation of nsWindow uses a local coordinate system within the window, this method must be overridden.
NS_IMETHOD SetForegroundColor (const nscolor &aColor)
 Set the foreground color for this widget.
NS_IMETHOD SetBackgroundColor (const nscolor &aColor)
 Set the background color for this widget.
virtual nsIFontMetricsGetFont (void)
 Get the font for this widget.
NS_IMETHOD SetFont (const nsFont &aFont)
 Set the font for this widget.
NS_IMETHOD SetCursor (nsCursor aCursor)
 Set the cursor for this widget.
NS_IMETHOD SetCursor (imgIContainer *aCursor, PRUint32 aHotspotX, PRUint32 aHotspotY)
 Sets an image as the cursor for this widget.
NS_IMETHOD Validate ()
 Validate the widget.
NS_IMETHOD Invalidate (PRBool aIsSynchronous)
 Invalidate the widget and repaint it.
NS_IMETHOD Invalidate (const nsRect &aRect, PRBool aIsSynchronous)
 Invalidate a specified rect for a widget and repaints it.
NS_IMETHOD InvalidateRegion (const nsIRegion *aRegion, PRBool aIsSynchronous)
 Invalidate a specified region for a widget and repaints it.
NS_IMETHOD Update ()
 Force a synchronous repaint of the window if there are dirty rects.
NS_IMETHOD SetColorMap (nsColorMap *aColorMap)
 Set the color map for this widget.
NS_IMETHOD Scroll (PRInt32 aDx, PRInt32 aDy, nsRect *aClipRect)
 XXX (This is obsolete and will be removed soon, Use ScrollWidgets instead) Scroll this widget.
NS_IMETHOD ScrollWidgets (PRInt32 aDx, PRInt32 aDy)
 Scroll the contents of the widget.
NS_IMETHOD ScrollRect (nsRect &aSrcRect, PRInt32 aDx, PRInt32 aDy)
 Scroll an area of this widget.
virtual voidGetNativeData (PRUint32 aDataType)
NS_IMETHOD SetBorderStyle (nsBorderStyle aBorderStyle)
 Set border style Must be called before Create.
NS_IMETHOD SetTitle (const nsAString &aTitle)
 Set the widget's title.
NS_IMETHOD SetIcon (const nsAString &aIconSpec)
 Set the widget's icon.
NS_IMETHOD SetMenuBar (nsIMenuBar *aMenuBar)
 Set the widget's MenuBar.
NS_IMETHOD ShowMenuBar (PRBool aShow)
 Set the widget's MenuBar's visibility.
NS_IMETHOD WidgetToScreen (const nsRect &aOldRect, nsRect &aNewRect)
 Convert from this widget coordinates to screen coordinates.
NS_IMETHOD ScreenToWidget (const nsRect &aOldRect, nsRect &aNewRect)
 Convert from screen coordinates to this widget's coordinates.
NS_IMETHOD BeginResizingChildren (void)
 When adjustments are to made to a whole set of child widgets, call this before resizing/positioning the child windows to minimize repaints.
NS_IMETHOD EndResizingChildren (void)
 Call this when finished adjusting child windows.
NS_IMETHOD EnableDragDrop (PRBool aEnable)
 Enables the dropping of files to a widget (XXX this is temporary)
virtual void ConvertToDeviceCoordinates (nscoord &aX, nscoord &aY)
NS_IMETHOD PreCreateWidget (nsWidgetInitData *aWidgetInitData)
NS_IMETHOD CaptureMouse (PRBool aCapture)
 Enables/Disables system mouse capture.
NS_IMETHOD CaptureRollupEvents (nsIRollupListener *aListener, PRBool aDoCapture, PRBool aConsumeRollupEvent)
 Enables/Disables system capture of any and all events that would cause a dropdown to be rolled up, This method ignores the aConsumeRollupEvent parameter when aDoCapture is FALSE.
NS_IMETHOD GetAttention (PRInt32 aCycleCount)
 Bring this window to the user's attention.
NS_IMETHOD MakeFullScreen (PRBool aFullScreen)
 Put the toplevel window into or out of fullscreen mode.
NS_IMETHOD HideWindowChrome (PRBool aShouldHide)
 Hide window chrome (borders, buttons) for this widget.
void LoseFocus ()
gint ConvertBorderStyles (nsBorderStyle aStyle)
gboolean OnExposeEvent (GtkWidget *aWidget, GdkEventExpose *aEvent)
gboolean OnConfigureEvent (GtkWidget *aWidget, GdkEventConfigure *aEvent)
void OnSizeAllocate (GtkWidget *aWidget, GtkAllocation *aAllocation)
void OnDeleteEvent (GtkWidget *aWidget, GdkEventAny *aEvent)
void OnEnterNotifyEvent (GtkWidget *aWidget, GdkEventCrossing *aEvent)
void OnLeaveNotifyEvent (GtkWidget *aWidget, GdkEventCrossing *aEvent)
void OnMotionNotifyEvent (GtkWidget *aWidget, GdkEventMotion *aEvent)
void OnButtonPressEvent (GtkWidget *aWidget, GdkEventButton *aEvent)
void OnButtonReleaseEvent (GtkWidget *aWidget, GdkEventButton *aEvent)
void OnContainerFocusInEvent (GtkWidget *aWidget, GdkEventFocus *aEvent)
void OnContainerFocusOutEvent (GtkWidget *aWidget, GdkEventFocus *aEvent)
gboolean OnKeyPressEvent (GtkWidget *aWidget, GdkEventKey *aEvent)
gboolean OnKeyReleaseEvent (GtkWidget *aWidget, GdkEventKey *aEvent)
void OnScrollEvent (GtkWidget *aWidget, GdkEventScroll *aEvent)
void OnVisibilityNotifyEvent (GtkWidget *aWidget, GdkEventVisibility *aEvent)
void OnWindowStateEvent (GtkWidget *aWidget, GdkEventWindowState *aEvent)
gboolean OnDragMotionEvent (GtkWidget *aWidget, GdkDragContext *aDragContext, gint aX, gint aY, guint aTime, void *aData)
void OnDragLeaveEvent (GtkWidget *aWidget, GdkDragContext *aDragContext, guint aTime, gpointer aData)
gboolean OnDragDropEvent (GtkWidget *aWidget, GdkDragContext *aDragContext, gint aX, gint aY, guint aTime, gpointer *aData)
void OnDragDataReceivedEvent (GtkWidget *aWidget, GdkDragContext *aDragContext, gint aX, gint aY, GtkSelectionData *aSelectionData, guint aInfo, guint aTime, gpointer aData)
void OnDragLeave (void)
void OnDragEnter (nscoord aX, nscoord aY)
nsresult NativeCreate (nsIWidget *aParent, nsNativeWidget aNativeParent, const nsRect &aRect, EVENT_CALLBACK aHandleEventFunction, nsIDeviceContext *aContext, nsIAppShell *aAppShell, nsIToolkit *aToolkit, nsWidgetInitData *aInitData)
void NativeResize (PRInt32 aWidth, PRInt32 aHeight, PRBool aRepaint)
void NativeResize (PRInt32 aX, PRInt32 aY, PRInt32 aWidth, PRInt32 aHeight, PRBool aRepaint)
void NativeShow (PRBool aAction)
void EnsureGrabs (void)
void GrabPointer (void)
void GrabKeyboard (void)
void ReleaseGrabs (void)
void SetPluginType (PluginType aPluginType)
void SetNonXEmbedPluginFocus (void)
void LoseNonXEmbedPluginFocus (void)
void ThemeChanged (void)
void ResizeTransparencyBitmap (PRInt32 aNewWidth, PRInt32 aNewHeight)
void ApplyTransparencyBitmap ()
 nsWindow ()
virtual ~nsWindow ()
NS_DECL_ISUPPORTS_INHERITED
NS_IMETHOD 
Create (nsIWidget *aParent, const nsRect &aRect, EVENT_CALLBACK aHandleEventFunction, nsIDeviceContext *aContext, nsIAppShell *aAppShell=nsnull, nsIToolkit *aToolkit=nsnull, nsWidgetInitData *aInitData=nsnull)
 Create and initialize a widget.
NS_IMETHOD Create (nsNativeWidget aNativeParent, const nsRect &aRect, EVENT_CALLBACK aHandleEventFunction, nsIDeviceContext *aContext, nsIAppShell *aAppShell=nsnull, nsIToolkit *aToolkit=nsnull, nsWidgetInitData *aInitData=nsnull)
 Create and initialize a widget with a native window parent.
virtual nsresult StandardCreate (nsIWidget *aParent, const nsRect &aRect, EVENT_CALLBACK aHandleEventFunction, nsIDeviceContext *aContext, nsIAppShell *aAppShell, nsIToolkit *aToolkit, nsWidgetInitData *aInitData, nsNativeWidget aNativeParent=nsnull)
NS_IMETHOD Destroy ()
 Close and destroy the internal native window.
virtual nsIWidgetGetParent (void)
 Return the parent Widget of this Widget or nsnull if this is a top level window.
NS_IMETHOD Show (PRBool aState)
 Show or hide this widget.
NS_IMETHOD IsVisible (PRBool &aState)
 Returns whether the window is visible.
NS_IMETHOD ModalEventFilter (PRBool aRealEvent, void *aEvent, PRBool *aForWindow)
 Determine whether a given event should be processed assuming we are the currently active modal window.
NS_IMETHOD ConstrainPosition (PRBool aAllowSlop, PRInt32 *aX, PRInt32 *aY)
 Perform platform-dependent sanity check on a potential window position.
NS_IMETHOD Move (PRInt32 aX, PRInt32 aY)
 Move this widget.
NS_IMETHOD Resize (PRInt32 aWidth, PRInt32 aHeight, PRBool aRepaint)
 Resize this widget.
NS_IMETHOD Resize (PRInt32 aX, PRInt32 aY, PRInt32 aWidth, PRInt32 aHeight, PRBool aRepaint)
 Move or resize this widget.
NS_IMETHOD Enable (PRBool aState)
 Enable or disable this Widget.
NS_IMETHOD IsEnabled (PRBool *aState)
 Ask whether the widget is enabled.
NS_IMETHOD SetFocus (PRBool aRaise)
 Give focus to this widget.
NS_IMETHOD SetBounds (const nsRect &aRect)
NS_IMETHOD GetBounds (nsRect &aRect)
 If the implementation of nsWindow supports borders this method MUST be overridden.
virtual nsIFontMetricsGetFont (void)
 Get the font for this widget.
NS_IMETHOD SetFont (const nsFont &aFont)
 Set the font for this widget.
NS_IMETHOD Validate ()
 Validate the widget.
NS_IMETHOD Invalidate (PRBool aIsSynchronous)
 Invalidate the widget and repaint it.
NS_IMETHOD Invalidate (const nsRect &aRect, PRBool aIsSynchronous)
 Invalidate a specified rect for a widget and repaints it.
NS_IMETHOD InvalidateRegion (const nsIRegion *aRegion, PRBool aIsSynchronous)
 Invalidate a specified region for a widget and repaints it.
virtual voidGetNativeData (PRUint32 aDataType)
NS_IMETHOD SetColorMap (nsColorMap *aColorMap)
 Set the color map for this widget.
NS_IMETHOD Scroll (PRInt32 aDx, PRInt32 aDy, nsRect *aClipRect)
 XXX (This is obsolete and will be removed soon, Use ScrollWidgets instead) Scroll this widget.
NS_IMETHOD WidgetToScreen (const nsRect &aOldRect, nsRect &aNewRect)
 Convert from this widget coordinates to screen coordinates.
NS_IMETHOD ScreenToWidget (const nsRect &aOldRect, nsRect &aNewRect)
 Convert from screen coordinates to this widget's coordinates.
NS_IMETHOD BeginResizingChildren (void)
 When adjustments are to made to a whole set of child widgets, call this before resizing/positioning the child windows to minimize repaints.
NS_IMETHOD EndResizingChildren (void)
 Call this when finished adjusting child windows.
NS_IMETHOD DispatchEvent (nsGUIEvent *event, nsEventStatus &aStatus)
 Dispatches an event to the widget.
virtual PRBool DispatchMouseEvent (nsMouseEvent &aEvent)
virtual void StartDraw (nsIRenderingContext *aRenderingContext=nsnull)
virtual void EndDraw ()
PRBool IsDrawing () const
NS_IMETHOD Update ()
 Force a synchronous repaint of the window if there are dirty rects.
virtual void UpdateWidget (nsRect &aRect, nsIRenderingContext *aContext)
virtual void ConvertToDeviceCoordinates (nscoord &aX, nscoord &aY)
void LocalToWindowCoordinate (nsPoint &aPoint)
void LocalToWindowCoordinate (nscoord &aX, nscoord &aY)
void LocalToWindowCoordinate (nsRect &aRect)
NS_IMETHOD SetMenuBar (nsIMenuBar *aMenuBar)
 Set the widget's MenuBar.
NS_IMETHOD ShowMenuBar (PRBool aShow)
 Set the widget's MenuBar's visibility.
virtual nsIMenuBarGetMenuBar ()
NS_IMETHOD GetPreferredSize (PRInt32 &aWidth, PRInt32 &aHeight)
 Returns the preferred width and height for the widget.
NS_IMETHOD SetPreferredSize (PRInt32 aWidth, PRInt32 aHeight)
 Set the preferred width and height for the widget.
NS_IMETHOD SetCursor (nsCursor aCursor)
 Set the cursor for this widget.
NS_IMETHOD CaptureRollupEvents (nsIRollupListener *aListener, PRBool aDoCapture, PRBool aConsumeRollupEvent)
 Enables/Disables system capture of any and all events that would cause a dropdown to be rolled up, This method ignores the aConsumeRollupEvent parameter when aDoCapture is FALSE.
NS_IMETHOD SetTitle (const nsAString &title)
 Set the widget's title.
NS_IMETHOD GetAttention (PRInt32 aCycleCount)
 Bring this window to the user's attention.
PRBool RgnIntersects (RgnHandle aTheRegion, RgnHandle aIntersectRgn)
virtual void CalcWindowRegions ()
virtual PRBool PointInWidget (Point aThePoint)
virtual nsWindowFindWidgetHit (Point aThePoint)
virtual PRBool DispatchWindowEvent (nsGUIEvent &event)
virtual PRBool DispatchWindowEvent (nsGUIEvent &event, nsEventStatus &aStatus)
virtual nsresult HandleUpdateEvent (RgnHandle regionToValidate)
virtual void AcceptFocusOnClick (PRBool aBool)
PRBool AcceptFocusOnClick ()
void Flash (nsPaintEvent &aEvent)
PRBool IsTopLevelWidgetWindow () const
NS_IMETHOD GetPluginClipRect (nsRect &outClipRect, nsPoint &outOrigin, PRBool &outWidgetVisible)
NS_IMETHOD StartDrawPlugin (void)
NS_IMETHOD EndDrawPlugin (void)
NS_IMETHOD ResetInputState ()
NS_IMETHOD SetIMEOpenState (PRBool aState)
NS_IMETHOD GetIMEOpenState (PRBool *aState)
NS_IMETHOD CancelIMEComposition ()
 nsWindow ()
virtual ~nsWindow ()
NS_IMETHOD Create (nsIWidget *aParent, const nsRect &aRect, EVENT_CALLBACK aHandleEventFunction, nsIDeviceContext *aContext, nsIAppShell *aAppShell=nsnull, nsIToolkit *aToolkit=nsnull, nsWidgetInitData *aInitData=nsnull)
 Create and initialize a widget.
NS_IMETHOD Create (nsNativeWidget aParent, const nsRect &aRect, EVENT_CALLBACK aHandleEventFunction, nsIDeviceContext *aContext, nsIAppShell *aAppShell=nsnull, nsIToolkit *aToolkit=nsnull, nsWidgetInitData *aInitData=nsnull)
 Create and initialize a widget with a native window parent.
NS_IMETHOD Destroy ()
 Close and destroy the internal native window.
virtual nsIWidgetGetParent ()
 Return the parent Widget of this Widget or nsnull if this is a top level window.
NS_IMETHOD SetSizeMode (PRInt32 aMode)
 Minimize, maximize or normalize the window size.
NS_IMETHOD Show (PRBool bState)
 Show or hide this widget.
NS_IMETHOD ConstrainPosition (PRBool aAllowSlop, PRInt32 *aX, PRInt32 *aY)
 Perform platform-dependent sanity check on a potential window position.
NS_IMETHOD Move (PRInt32 aX, PRInt32 aY)
 Move this widget.
NS_IMETHOD Resize (PRInt32 aWidth, PRInt32 aHeight, PRBool aRepaint)
 Resize this widget.
NS_IMETHOD Resize (PRInt32 aX, PRInt32 aY, PRInt32 aWidth, PRInt32 aHeight, PRBool aRepaint)
 Move or resize this widget.
NS_IMETHOD GetClientBounds (nsRect &aRect)
 If the implementation of nsWindow supports borders this method MUST be overridden.
NS_IMETHOD Enable (PRBool aState)
 Enable or disable this Widget.
NS_IMETHOD IsEnabled (PRBool *aState)
 Ask whether the widget is enabled.
NS_IMETHOD SetFocus (PRBool aRaise)
 Give focus to this widget.
NS_IMETHOD GetBounds (nsRect &aRect)
 If the implementation of nsWindow supports borders this method MUST be overridden.
NS_IMETHOD IsVisible (PRBool &aState)
 Returns whether the window is visible.
PRBool IsShown ()
NS_IMETHOD PlaceBehind (nsTopLevelWidgetZPlacement aPlacement, nsIWidget *aWidget, PRBool aActivate)
 Position this widget just behind the given widget.
NS_IMETHOD CaptureMouse (PRBool aCapture)
 Enables/Disables system mouse capture.
NS_IMETHOD ModalEventFilter (PRBool aRealEvent, void *aEvent, PRBool *aForWindow)
 Determine whether a given event should be processed assuming we are the currently active modal window.
NS_IMETHOD GetPreferredSize (PRInt32 &aWidth, PRInt32 &aHeight)
 Returns the preferred width and height for the widget.
NS_IMETHOD SetPreferredSize (PRInt32 aWidth, PRInt32 aHeight)
 Set the preferred width and height for the widget.
NS_IMETHOD BeginResizingChildren ()
 When adjustments are to made to a whole set of child widgets, call this before resizing/positioning the child windows to minimize repaints.
NS_IMETHOD EndResizingChildren ()
 Call this when finished adjusting child windows.
NS_IMETHOD WidgetToScreen (const nsRect &aOldRect, nsRect &aNewRect)
 Convert from this widget coordinates to screen coordinates.
NS_IMETHOD ScreenToWidget (const nsRect &aOldRect, nsRect &aNewRect)
 Convert from screen coordinates to this widget's coordinates.
NS_IMETHOD DispatchEvent (struct nsGUIEvent *event, nsEventStatus &aStatus)
 Dispatches an event to the widget.
NS_IMETHOD CaptureRollupEvents (nsIRollupListener *aListener, PRBool aDoCapture, PRBool aConsumeRollupEvent)
 Enables/Disables system capture of any and all events that would cause a dropdown to be rolled up, This method ignores the aConsumeRollupEvent parameter when aDoCapture is FALSE.
NS_IMETHOD GetLastInputEventTime (PRUint32 &aTime)
 Get the last user input event time in milliseconds.
virtual nsIFontMetricsGetFont ()
 Get the font for this widget.
NS_IMETHOD SetFont (const nsFont &aFont)
 Set the font for this widget.
NS_IMETHOD SetColorMap (nsColorMap *aColorMap)
 Set the color map for this widget.
NS_IMETHOD SetCursor (nsCursor aCursor)
 Set the cursor for this widget.
NS_IMETHOD SetCursor (imgIContainer *aCursor, PRUint32 aHotspotX, PRUint32 aHotspotY)
 Sets an image as the cursor for this widget.
NS_IMETHOD HideWindowChrome (PRBool aShouldHide)
 Hide window chrome (borders, buttons) for this widget.
NS_IMETHOD SetTitle (const nsAString &aTitle)
 Set the widget's title.
NS_IMETHOD SetIcon (const nsAString &aIconSpec)
 Set the widget's icon.
NS_IMETHOD SetMenuBar (nsIMenuBar *aMenuBar)
 Set the widget's MenuBar.
NS_IMETHOD ShowMenuBar (PRBool aShow)
 Set the widget's MenuBar's visibility.
NS_IMETHOD Invalidate (PRBool aIsSynchronous)
 Invalidate the widget and repaint it.
NS_IMETHOD Invalidate (const nsRect &aRect, PRBool aIsSynchronous)
 Invalidate a specified rect for a widget and repaints it.
NS_IMETHOD InvalidateRegion (const nsIRegion *aRegion, PRBool aIsSynchronous)
 Invalidate a specified region for a widget and repaints it.
NS_IMETHOD Update ()
 Force a synchronous repaint of the window if there are dirty rects.
NS_IMETHOD Scroll (PRInt32 aDx, PRInt32 aDy, nsRect *aClipRect)
 XXX (This is obsolete and will be removed soon, Use ScrollWidgets instead) Scroll this widget.
NS_IMETHOD ScrollWidgets (PRInt32 aDx, PRInt32 aDy)
 Scroll the contents of the widget.
NS_IMETHOD ScrollRect (nsRect &aRect, PRInt32 aDx, PRInt32 aDy)
 Scroll an area of this widget.
virtual voidGetNativeData (PRUint32 aDataType)
virtual void FreeNativeData (void *aDatum, PRUint32 aDataType)
virtual HWND GetMainWindow () const
virtual BOOL CallMethod (MethodInfo *info)
ULONG GetNextID ()
void NS2PM_PARENT (POINTL &ptl)
void NS2PM (POINTL &ptl)
void NS2PM (RECTL &rcl)
 nsWindow ()
virtual ~nsWindow ()
NS_IMETHOD WidgetToScreen (const nsRect &aOldRect, nsRect &aNewRect)
 Convert from this widget coordinates to screen coordinates.
NS_IMETHOD PreCreateWidget (nsWidgetInitData *aWidgetInitData)
virtual voidGetNativeData (PRUint32 aDataType)
NS_IMETHOD Scroll (PRInt32 aDx, PRInt32 aDy, nsRect *aClipRect)
 XXX (This is obsolete and will be removed soon, Use ScrollWidgets instead) Scroll this widget.
NS_IMETHOD ScrollWidgets (PRInt32 aDx, PRInt32 aDy)
 Scroll the contents of the widget.
NS_IMETHOD ScrollRect (nsRect &aSrcRect, PRInt32 aDx, PRInt32 aDy)
 Scroll an area of this widget.
NS_IMETHOD SetTitle (const nsAString &aTitle)
 Set the widget's title.
NS_IMETHOD Move (PRInt32 aX, PRInt32 aY)
 Move this widget.
NS_IMETHOD Resize (PRInt32 aWidth, PRInt32 aHeight, PRBool aRepaint)
 Resize this widget.
NS_IMETHOD Resize (PRInt32 aX, PRInt32 aY, PRInt32 aWidth, PRInt32 aHeight, PRBool aRepaint)
 Move or resize this widget.
NS_IMETHOD CaptureRollupEvents (nsIRollupListener *aListener, PRBool aDoCapture, PRBool aConsumeRollupEvent)
 Enables/Disables system capture of any and all events that would cause a dropdown to be rolled up, This method ignores the aConsumeRollupEvent parameter when aDoCapture is FALSE.
NS_IMETHOD SetFocus (PRBool aRaise)
 Give focus to this widget.
NS_IMETHOD GetAttention (PRInt32 aCycleCount)
 Bring this window to the user's attention.
virtual PRBool IsChild () const
PRBool OnKey (nsKeyEvent &aEvent)
NS_IMETHOD GetClientBounds (nsRect &aRect)
 If the implementation of nsWindow supports borders this method MUST be overridden.
NS_IMETHOD SetModal (PRBool aModal)
 Make the window modal.
NS_IMETHOD MakeFullScreen (PRBool aFullScreen)
 Put the toplevel window into or out of fullscreen mode.
nsIRegionGetRegion ()
 nsWindow ()
virtual ~nsWindow ()
NS_DECL_ISUPPORTS_INHERITED
NS_IMETHOD 
PreCreateWidget (nsWidgetInitData *aWidgetInitData)
 nsWindow ()
virtual ~nsWindow ()
 NS_IMETHOD_ (nsrefcnt) AddRef(void)
 NS_IMETHOD_ (nsrefcnt) Release(void)
NS_IMETHOD QueryInterface (REFNSIID aIID, void **aInstancePtr)
NS_IMETHOD Create (nsIWidget *aParent, const nsRect &aRect, EVENT_CALLBACK aHandleEventFunction, nsIDeviceContext *aContext, nsIAppShell *aAppShell=nsnull, nsIToolkit *aToolkit=nsnull, nsWidgetInitData *aInitData=nsnull)
 Create and initialize a widget.
NS_IMETHOD Create (nsNativeWidget aParent, const nsRect &aRect, EVENT_CALLBACK aHandleEventFunction, nsIDeviceContext *aContext, nsIAppShell *aAppShell=nsnull, nsIToolkit *aToolkit=nsnull, nsWidgetInitData *aInitData=nsnull)
 Create and initialize a widget with a native window parent.
virtual nsresult StandardWindowCreate (nsIWidget *aParent, const nsRect &aRect, EVENT_CALLBACK aHandleEventFunction, nsIDeviceContext *aContext, nsIAppShell *aAppShell, nsIToolkit *aToolkit, nsWidgetInitData *aInitData, nsNativeWidget aNativeParent=nsnull)
NS_IMETHOD Destroy ()
 Close and destroy the internal native window.
NS_IMETHOD SetParent (nsIWidget *aNewParent)
 Reparent a widget.
virtual nsIWidgetGetParent (void)
 Return the parent Widget of this Widget or nsnull if this is a top level window.
NS_IMETHOD Show (PRBool bState)
 Show or hide this widget.
NS_IMETHOD IsVisible (PRBool &aState)
 Returns whether the window is visible.
NS_IMETHOD PlaceBehind (nsTopLevelWidgetZPlacement aPlacement, nsIWidget *aWidget, PRBool aActivate)
 Position this widget just behind the given widget.
NS_IMETHOD SetSizeMode (PRInt32 aMode)
 Minimize, maximize or normalize the window size.
NS_IMETHOD ModalEventFilter (PRBool aRealEvent, void *aEvent, PRBool *aForWindow)
 Determine whether a given event should be processed assuming we are the currently active modal window.
NS_IMETHOD CaptureMouse (PRBool aCapture)
 Enables/Disables system mouse capture.
NS_IMETHOD ConstrainPosition (PRBool aAllowSlop, PRInt32 *aX, PRInt32 *aY)
 Perform platform-dependent sanity check on a potential window position.
NS_IMETHOD Move (PRInt32 aX, PRInt32 aY)
 Move this widget.
NS_IMETHOD Resize (PRInt32 aWidth, PRInt32 aHeight, PRBool aRepaint)
 Resize this widget.
NS_IMETHOD Resize (PRInt32 aX, PRInt32 aY, PRInt32 aWidth, PRInt32 aHeight, PRBool aRepaint)
 Move or resize this widget.
NS_IMETHOD Enable (PRBool aState)
 Enable or disable this Widget.
NS_IMETHOD IsEnabled (PRBool *aState)
 Ask whether the widget is enabled.
NS_IMETHOD SetFocus (PRBool aRaise)
 Give focus to this widget.
NS_IMETHOD GetBounds (nsRect &aRect)
 If the implementation of nsWindow supports borders this method MUST be overridden.
NS_IMETHOD GetClientBounds (nsRect &aRect)
 If the implementation of nsWindow supports borders this method MUST be overridden.
NS_IMETHOD GetScreenBounds (nsRect &aRect)
 If the implementation of nsWindow uses a local coordinate system within the window, this method must be overridden.
NS_IMETHOD SetBackgroundColor (const nscolor &aColor)
 Set the background color for this widget.
virtual nsIFontMetricsGetFont (void)
 Get the font for this widget.
NS_IMETHOD SetFont (const nsFont &aFont)
 Set the font for this widget.
NS_IMETHOD SetCursor (nsCursor aCursor)
 Set the cursor for this widget.
NS_IMETHOD SetCursor (imgIContainer *aCursor, PRUint32 aHotspotX, PRUint32 aHotspotY)
 Sets an image as the cursor for this widget.
NS_IMETHOD HideWindowChrome (PRBool aShouldHide)
 Hide window chrome (borders, buttons) for this widget.
NS_IMETHOD Validate ()
 Validate the widget.
NS_IMETHOD Invalidate (PRBool aIsSynchronous)
 Invalidate the widget and repaint it.
NS_IMETHOD Invalidate (const nsRect &aRect, PRBool aIsSynchronous)
 Invalidate a specified rect for a widget and repaints it.
NS_IMETHOD InvalidateRegion (const nsIRegion *aRegion, PRBool aIsSynchronous)
 Invalidate a specified region for a widget and repaints it.
NS_IMETHOD Update ()
 Force a synchronous repaint of the window if there are dirty rects.
virtual voidGetNativeData (PRUint32 aDataType)
virtual void FreeNativeData (void *data, PRUint32 aDataType)
NS_IMETHOD SetColorMap (nsColorMap *aColorMap)
 Set the color map for this widget.
NS_IMETHOD Scroll (PRInt32 aDx, PRInt32 aDy, nsRect *aClipRect)
 XXX (This is obsolete and will be removed soon, Use ScrollWidgets instead) Scroll this widget.
NS_IMETHOD ScrollWidgets (PRInt32 aDx, PRInt32 aDy)
 Scroll the contents of the widget.
NS_IMETHOD ScrollRect (nsRect &aRect, PRInt32 aDx, PRInt32 aDy)
 Scroll an area of this widget.
NS_IMETHOD SetTitle (const nsAString &aTitle)
 Set the widget's title.
NS_IMETHOD SetIcon (const nsAString &aIconSpec)
 Set the widget's icon.
NS_IMETHOD SetMenuBar (nsIMenuBar *aMenuBar)
 Set the widget's MenuBar.
NS_IMETHOD ShowMenuBar (PRBool aShow)
 Set the widget's MenuBar's visibility.
NS_IMETHOD WidgetToScreen (const nsRect &aOldRect, nsRect &aNewRect)
 Convert from this widget coordinates to screen coordinates.
NS_IMETHOD ScreenToWidget (const nsRect &aOldRect, nsRect &aNewRect)
 Convert from screen coordinates to this widget's coordinates.
NS_IMETHOD BeginResizingChildren (void)
 When adjustments are to made to a whole set of child widgets, call this before resizing/positioning the child windows to minimize repaints.
NS_IMETHOD EndResizingChildren (void)
 Call this when finished adjusting child windows.
NS_IMETHOD GetPreferredSize (PRInt32 &aWidth, PRInt32 &aHeight)
 Returns the preferred width and height for the widget.
NS_IMETHOD SetPreferredSize (PRInt32 aWidth, PRInt32 aHeight)
 Set the preferred width and height for the widget.
NS_IMETHOD DispatchEvent (nsGUIEvent *event, nsEventStatus &aStatus)
 Dispatches an event to the widget.
NS_IMETHOD EnableDragDrop (PRBool aEnable)
 Enables the dropping of files to a widget (XXX this is temporary)
virtual void SetUpForPaint (HDC aHDC)
virtual void ConvertToDeviceCoordinates (nscoord &aX, nscoord &aY)
NS_IMETHOD CaptureRollupEvents (nsIRollupListener *aListener, PRBool aDoCapture, PRBool aConsumeRollupEvent)
 Enables/Disables system capture of any and all events that would cause a dropdown to be rolled up, This method ignores the aConsumeRollupEvent parameter when aDoCapture is FALSE.
NS_IMETHOD GetAttention (PRInt32 aCycleCount)
 Bring this window to the user's attention.
NS_IMETHOD GetLastInputEventTime (PRUint32 &aTime)
 Get the last user input event time in milliseconds.
nsWindowGetTopLevelWindow ()
NS_IMETHOD ResetInputState ()
NS_IMETHOD SetIMEOpenState (PRBool aState)
NS_IMETHOD GetIMEOpenState (PRBool *aState)
NS_IMETHOD CancelIMEComposition ()
PRBool IMEMouseHandling (PRUint32 aEventType, PRInt32 aAction, LPARAM lParam)
PRBool IMECompositionHitTest (PRUint32 aEventType, POINT *ptPos)
PRBool HandleMouseActionOfIME (PRInt32 aAction, POINT *ptPos)
void GetCompositionWindowPos (HIMC hIMC, PRUint32 aEventType, COMPOSITIONFORM *cpForm)
virtual BOOL CallMethod (MethodInfo *info)
HWND GetWindowHandle ()
WNDPROC GetPrevWindowProc ()
virtual PRBool DispatchMouseEvent (PRUint32 aEventType, WPARAM wParam=NULL, nsPoint *aPoint=nsnull)
virtual PRBool AutoErase ()
nsPointGetLastPoint ()
PRInt32 GetNewCmdMenuId ()
void InitEvent (nsGUIEvent &event, nsPoint *aPoint=nsnull)
void SuppressBlurEvents (PRBool aSuppress)
PRBool BlurEventsSuppressed ()
 nsWindow ()
 ~nsWindow ()
NS_IMETHOD CaptureRollupEvents (nsIRollupListener *aListener, PRBool aDoCapture, PRBool aConsumeRollupEvent)
 Enables/Disables system capture of any and all events that would cause a dropdown to be rolled up, This method ignores the aConsumeRollupEvent parameter when aDoCapture is FALSE.
NS_IMETHOD Invalidate (PRBool aIsSynchronous)
 Invalidate the widget and repaint it.
NS_IMETHOD Invalidate (const nsRect &aRect, PRBool aIsSynchronous)
 Invalidate a specified rect for a widget and repaints it.
NS_IMETHOD InvalidateRegion (const nsIRegion *aRegion, PRBool aIsSynchronous)
 Invalidate a specified region for a widget and repaints it.
NS_IMETHOD Update ()
 Force a synchronous repaint of the window if there are dirty rects.
NS_IMETHOD Scroll (PRInt32 aDx, PRInt32 aDy, nsRect *aClipRect)
 XXX (This is obsolete and will be removed soon, Use ScrollWidgets instead) Scroll this widget.
NS_IMETHOD ScrollWidgets (PRInt32 aDx, PRInt32 aDy)
 Scroll the contents of the widget.
NS_IMETHOD ScrollRect (nsRect &aSrcRect, PRInt32 aDx, PRInt32 aDy)
 Scroll an area of this widget.
NS_IMETHOD SetTitle (const nsAString &aTitle)
 Set the widget's title.
NS_IMETHOD Show (PRBool aShow)
 Show or hide this widget.
NS_IMETHOD Resize (PRInt32 aWidth, PRInt32 aHeight, PRBool aRepaint)
 Resize this widget.
NS_IMETHOD Resize (PRInt32 aX, PRInt32 aY, PRInt32 aWidth, PRInt32 aHeight, PRBool aRepaint)
 Move or resize this widget.
NS_IMETHOD SetFocus (PRBool aRaise)
 Give focus to this widget.
virtual PRBool OnExpose (nsPaintEvent &event)
NS_IMETHOD GetAttention (PRInt32 aCycleCount)
 Bring this window to the user's attention.
PRBool OnResize (nsSizeEvent *event)
PRBool OnResize (nsSizeEvent event)
virtual PRBool OnResize (nsSizeEvent &event)
NS_IMETHOD GetWindowClass (char *aClass)
 Gets the window class implemented in gtk.
NS_IMETHOD SetWindowClass (char *aClass)
 Sets the window class implemented in gtk.
void InitEvent (nsGUIEvent &event, PRUint32 aEventType, nsPoint *aPoint=nsnull)
PRBool DispatchFocus (nsGUIEvent &aEvent)
PRBool OnText (nsTextEvent &aEvent)
PRBool OnComposition (nsCompositionEvent &aEvent)
PRBool OnInput (nsInputEvent &aEvent)
void ResetZOrder ()
virtual PRBool DispatchKeyEvent (nsKeyEvent &aKeyEvent)
virtual nsresult StandardWidgetCreate (nsIWidget *aParent, const nsRect &aRect, EVENT_CALLBACK aHandleEventFunction, nsIDeviceContext *aContext, nsIAppShell *aAppShell, nsIToolkit *aToolkit, nsWidgetInitData *aInitData, nsNativeWidget aNativeParent=nsnull)
NS_IMETHOD SetName (const char *aName)
void LockCursor (PRBool aLock)
NS_IMETHOD SetTooltips (PRUint32 aNumberOfTips, nsRect *aTooltipAreas[])
NS_IMETHOD RemoveTooltips ()
NS_IMETHOD UpdateTooltips (nsRect *aNewTips[])
NS_IMETHOD GetRequestedBounds (nsRect &aRect)
virtual PRBool OnDeleteWindow (void)
virtual PRBool DispatchDestroyEvent (void)
void SetVisibility (int aState)
void SetIonic (PRBool isIonic)
Cursor XlibCreateCursor (nsCursor aCursorType)
voidCheckParent (long ThisWindow)
PRBool IsMouseInWindow (Window window, PRInt32 inMouseX, PRInt32 inMouseY)
PRBool HandlePopup (PRInt32 inMouseX, PRInt32 inMouseY)
void WidgetShow (nsWidget *aWidget)
NS_IMETHOD GetClientData (void *&aClientData)
 Accessor functions to get and set the client data associated with the widget.
NS_IMETHOD SetClientData (void *aClientData)
virtual void AddChild (nsIWidget *aChild)
 Internal methods.
virtual void RemoveChild (nsIWidget *aChild)
NS_IMETHOD GetZIndex (PRInt32 *aZIndex)
 Gets the widget's z-index.
NS_IMETHOD GetSizeMode (PRInt32 *aMode)
 Return size mode (minimized, maximized, normalized).
virtual nscolor GetForegroundColor (void)
 Get the foreground color for this widget.
virtual nscolor GetBackgroundColor (void)
 Get the background color for this widget.
virtual nsCursor GetCursor ()
 Get the cursor for this widget.
NS_IMETHOD GetWindowType (nsWindowType &aWindowType)
 Get the window type of this widget.
NS_IMETHOD SetWindowType (nsWindowType aWindowType)
NS_IMETHOD SetWindowTranslucency (PRBool aTranslucent)
 Set the translucency of the top-level window containing this widget.
NS_IMETHOD GetWindowTranslucency (PRBool &aTranslucent)
 Get the translucency of the top-level window that contains this widget.
NS_IMETHOD UpdateTranslucentWindowAlpha (const nsRect &aRect, PRUint8 *aAlphas)
 Update the alpha channel for some pixels of the top-level window that contains this widget.
nsresult MakeFullScreenInternal (PRBool aFullScreen)
virtual nsIRenderingContextGetRenderingContext ()
virtual nsIDeviceContextGetDeviceContext ()
virtual nsIAppShellGetAppShell ()
NS_IMETHOD AddMouseListener (nsIMouseListener *aListener)
 Processes a mouse pressed event.
NS_IMETHOD AddEventListener (nsIEventListener *aListener)
 Processes a mouse pressed event.
NS_IMETHOD AddMenuListener (nsIMenuListener *aListener)
 Add a menu listener This interface should only be called by the menu services manager This will AddRef() the menu listener This will Release() a previously set menu listener.
NS_IMETHOD GetBoundsAppUnits (nsRect &aRect, float aAppUnits)
 If the implementation of nsWindow supports borders this method MUST be overridden.
NS_IMETHOD GetBorderSize (PRInt32 &aWidth, PRInt32 &aHeight)
 Calculates the border width and height.
NS_IMETHOD Paint (nsIRenderingContext &aRenderingContext, const nsRect &aDirtyRect)
 Paints default border (XXX - this should be done by CSS)
nsIWidgetGetFirstChild () const
 Return the first child of this widget.
nsIWidgetGetLastChild () const
 Return the last child of this widget.
nsIWidgetGetNextSibling () const
 Return the next sibling of this widget.
void SetNextSibling (nsIWidget *aSibling)
 Set the next sibling of this widget.
nsIWidgetGetPrevSibling () const
 Return the previous sibling of this widget.
void SetPrevSibling (nsIWidget *aSibling)
 Set the previous sibling of this widget.
NS_IMETHOD GetClientData (void *&aClientData)
 Accessor functions to get and set the client data associated with the widget.
NS_IMETHOD SetClientData (void *aClientData)
NS_IMETHOD GetZIndex (PRInt32 *aZIndex)
 Gets the widget's z-index.
NS_IMETHOD GetSizeMode (PRInt32 *aMode)
 Return size mode (minimized, maximized, normalized).
NS_IMETHOD GetWindowType (nsWindowType &aWindowType)
 Get the window type of this widget.
NS_IMETHOD SetWindowType (nsWindowType aWindowType)
NS_IMETHOD SetWindowTranslucency (PRBool aTranslucent)
 Set the translucency of the top-level window containing this widget.
NS_IMETHOD GetWindowTranslucency (PRBool &aTranslucent)
 Get the translucency of the top-level window that contains this widget.
NS_IMETHOD UpdateTranslucentWindowAlpha (const nsRect &aRect, PRUint8 *aAlphas)
 Update the alpha channel for some pixels of the top-level window that contains this widget.
nsresult MakeFullScreenInternal (PRBool aFullScreen)
NS_IMETHOD AddMouseListener (nsIMouseListener *aListener)
 Processes a mouse pressed event.
NS_IMETHOD AddEventListener (nsIEventListener *aListener)
 Processes a mouse pressed event.
NS_IMETHOD AddMenuListener (nsIMenuListener *aListener)
 Add a menu listener This interface should only be called by the menu services manager This will AddRef() the menu listener This will Release() a previously set menu listener.
NS_IMETHOD GetBoundsAppUnits (nsRect &aRect, float aAppUnits)
 If the implementation of nsWindow supports borders this method MUST be overridden.
NS_IMETHOD GetBorderSize (PRInt32 &aWidth, PRInt32 &aHeight)
 Calculates the border width and height.
NS_IMETHOD Paint (nsIRenderingContext &aRenderingContext, const nsRect &aDirtyRect)
 Paints default border (XXX - this should be done by CSS)
nsIWidgetGetFirstChild () const
 Return the first child of this widget.
nsIWidgetGetLastChild () const
 Return the last child of this widget.
nsIWidgetGetNextSibling () const
 Return the next sibling of this widget.
void SetNextSibling (nsIWidget *aSibling)
 Set the next sibling of this widget.
nsIWidgetGetPrevSibling () const
 Return the previous sibling of this widget.
void SetPrevSibling (nsIWidget *aSibling)
 Set the previous sibling of this widget.
void CommonCreate (nsIWidget *aParent, PRBool aListenForResizes)
void InitButtonEvent (nsMouseEvent &aEvent, GdkEventButton *aGdkEvent)
void InitMouseScrollEvent (nsMouseScrollEvent &aEvent, GdkEventScroll *aGdkEvent)
void InitKeyEvent (nsKeyEvent &aEvent, GdkEventKey *aGdkEvent)
void DispatchGotFocusEvent (void)
void DispatchResizeEvent (nsRect &aRect, nsEventStatus &aStatus)
PRBool AreBoundsSane (void)
NS_IMETHOD Invalidate (const nsRect &, int)
nsCursor GetCursor ()
 Get the cursor for this widget.
NS_IMETHOD GetClientData (void *&aClientData)
 Accessor functions to get and set the client data associated with the widget.
NS_IMETHOD SetClientData (void *aClientData)
NS_IMETHOD GetZIndex (PRInt32 *aZIndex)
 Gets the widget's z-index.
NS_IMETHOD GetSizeMode (PRInt32 *aMode)
 Return size mode (minimized, maximized, normalized).
NS_IMETHOD GetWindowType (nsWindowType &aWindowType)
 Get the window type of this widget.
NS_IMETHOD SetWindowType (nsWindowType aWindowType)
NS_IMETHOD SetWindowTranslucency (PRBool aTranslucent)
 Set the translucency of the top-level window containing this widget.
NS_IMETHOD GetWindowTranslucency (PRBool &aTranslucent)
 Get the translucency of the top-level window that contains this widget.
NS_IMETHOD UpdateTranslucentWindowAlpha (const nsRect &aRect, PRUint8 *aAlphas)
 Update the alpha channel for some pixels of the top-level window that contains this widget.
nsresult MakeFullScreenInternal (PRBool aFullScreen)
NS_IMETHOD AddMouseListener (nsIMouseListener *aListener)
 Processes a mouse pressed event.
NS_IMETHOD AddEventListener (nsIEventListener *aListener)
 Processes a mouse pressed event.
NS_IMETHOD AddMenuListener (nsIMenuListener *aListener)
 Add a menu listener This interface should only be called by the menu services manager This will AddRef() the menu listener This will Release() a previously set menu listener.
NS_IMETHOD GetBoundsAppUnits (nsRect &aRect, float aAppUnits)
 If the implementation of nsWindow supports borders this method MUST be overridden.
NS_IMETHOD GetBorderSize (PRInt32 &aWidth, PRInt32 &aHeight)
 Calculates the border width and height.
NS_IMETHOD Paint (nsIRenderingContext &aRenderingContext, const nsRect &aDirtyRect)
 Paints default border (XXX - this should be done by CSS)
nsIWidgetGetFirstChild () const
 Return the first child of this widget.
nsIWidgetGetLastChild () const
 Return the last child of this widget.
nsIWidgetGetNextSibling () const
 Return the next sibling of this widget.
void SetNextSibling (nsIWidget *aSibling)
 Set the next sibling of this widget.
nsIWidgetGetPrevSibling () const
 Return the previous sibling of this widget.
void SetPrevSibling (nsIWidget *aSibling)
 Set the previous sibling of this widget.
PRBool AddDeleteObserver (nsDeleteObserver *aDeleteObserver)
PRBool RemoveDeleteObserver (nsDeleteObserver *aDeleteObserver)

Static Public Member Functions

static void ReleaseGlobals ()
static gboolean UpdateIdle (gpointer data)
static PRBool DragInProgress (void)
static nsWindowGetGrabWindow (void)
static PRBool IconEntryMatches (PLDHashTable *aTable, const PLDHashEntryHdr *aHdr, const void *aKey)
static void ClearIconEntry (PLDHashTable *aTable, PLDHashEntryHdr *aHdr)
static void ReleaseGlobals ()
static PRBool ConvertStatus (nsEventStatus aStatus)
static void SetCursorResource (short aCursorResourceNum)
static void nsRectToMacRect (const nsRect &aRect, Rect &aMacRect)
static void ReleaseGlobals ()
static void RawDrawFunc (PtWidget_t *pWidget, PhTile_t *damage)
static void GlobalMsgWindowProc (HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
static HWND GetTopLevelHWND (HWND aWnd, PRBool aStopOnFirstTopLevel=PR_FALSE)
static
NS_DECL_ISUPPORTS_INHERITED
void 
UpdateIdle (void *data)
static void SetLastEventTime (guint32 aTime)
static void GetLastEventTime (guint32 *aTime)
static void DropMotionTarget (void)
static void DragStarted (void)
static void SetInstance (PtWidget_t *pWidget, nsWidget *inst)
static nsWidgetGetInstance (PtWidget_t *pWidget)
static nsWidgetGetWidgetForWindow (Window aWindow)
static Window GetFocusWindow (void)

Public Attributes

PRBool mBlockMozAreaFocusIn
Window mOldFocusWindow
PRBool mIsToplevel

Static Public Attributes

static guint32 mLastButtonPressTime = 0
static guint32 mLastButtonReleaseTime = 0
static nsWidgetsFocusWindow = 0
static nsWidgetsButtonMotionTarget = NULL
static gint sButtonMotionRootX = -1
static gint sButtonMotionRootY = -1
static gint sButtonMotionWidgetX = -1
static gint sButtonMotionWidgetY = -1
static Atom WMDeleteWindow = 0
static Atom WMTakeFocus = 0
static Atom WMSaveYourself = 0
static PRBool WMProtocolsInitialized = PR_FALSE

Protected Types

enum  {
  CREATE = 0x0101, DESTROY, SET_FOCUS, UPDATE_WINDOW,
  SET_TITLE, GET_TITLE
}
enum  {
  CREATE = 0x0101, CREATE_NATIVE, DESTROY, SET_FOCUS,
  SET_CURSOR, CREATE_HACK
}
enum  {
  CREATE = 0x0101, CREATE_NATIVE, DESTROY, SET_FOCUS,
  SET_CURSOR, CREATE_HACK
}
enum  {
  CREATE = 0x0101, CREATE_NATIVE, DESTROY, SET_FOCUS,
  SET_CURSOR, CREATE_HACK
}
enum  {
  CREATE = 0x0101, CREATE_NATIVE, DESTROY, SET_FOCUS,
  SET_CURSOR, CREATE_HACK
}

Protected Member Functions

void OnDestroy ()
void OnWheel (PRInt32 aDirection, uint32 aButtons, BPoint aPoint, nscoord aDelta)
PRBool OnMove (PRInt32 aX, PRInt32 aY)
nsresult OnPaint (BRegion *breg)
PRBool OnResize (nsRect &aWindowRect)
PRBool OnKeyDown (PRUint32 aEventType, const char *bytes, int32 numBytes, PRUint32 mod, PRUint32 bekeycode, int32 rawcode)
PRBool OnKeyUp (PRUint32 aEventType, const char *bytes, int32 numBytes, PRUint32 mod, PRUint32 bekeycode, int32 rawcode)
PRBool DispatchKeyEvent (PRUint32 aEventType, PRUint32 aCharCode, PRUint32 aKeyCode, PRUint32 aFlags=0)
PRBool DispatchFocus (PRUint32 aEventType)
PRBool DispatchStandardEvent (PRUint32 aMsg)
PRBool DispatchWindowEvent (nsGUIEvent *event)
void HideKids (PRBool state)
virtual void ResetInternalVisibility ()
virtual void SetInternalVisibility (PRBool aVisible)
virtual void OnRealize (GtkWidget *aWidget)
virtual void OnDestroySignal (GtkWidget *aGtkWidget)
virtual void InitCallbacks (char *aName=nsnull)
NS_IMETHOD CreateNative (GtkObject *parentWidget)
PRBool GetWindowPos (nscoord &x, nscoord &y)
virtual void ThemeChanged ()
void InitDragEvent (nsMouseEvent &aEvent)
void UpdateDragStatus (nsMouseEvent &aEvent, GdkDragContext *aDragContext, nsIDragService *aDragService)
gint OnDragMotionSignal (GtkWidget *aWidget, GdkDragContext *aDragContext, gint aX, gint aY, guint aTime, void *aData)
void OnDragLeaveSignal (GtkWidget *aWidget, GdkDragContext *aDragContext, guint aTime, gpointer aData)
gint OnDragDropSignal (GtkWidget *aWidget, GdkDragContext *aDragContext, gint aX, gint aY, guint aTime, void *aData)
void OnDragDataReceived (GtkWidget *aWidget, GdkDragContext *aDragContext, gint aX, gint aY, GtkSelectionData *aSelectionData, guint aInfo, guint32 aTime, gpointer aData)
void OnDragLeave (void)
void OnDragEnter (nscoord aX, nscoord aY)
void ResetDragMotionTimer (GtkWidget *aWidget, GdkDragContext *aDragContext, gint aX, gint aY, guint aTime)
void FireDragMotionTimer (void)
void FireDragLeaveTimer (void)
void IMEComposeStart (guint aTime)
void IMEComposeText (GdkEventKey *, const PRUnichar *aText, const PRInt32 aLen, const char *aFeedback)
void IMEComposeEnd (guint aTime)
PRBool ReportDestroyEvent ()
PRBool ReportMoveEvent ()
PRBool ReportSizeEvent ()
void CalcOffset (PRInt32 &aX, PRInt32 &aY)
PRBool ContainerHierarchyIsVisible ()
virtual PRBool OnPaint (nsPaintEvent &aEvent)
void ScrollBits (Rect &foo, PRInt32 inLeftDelta, PRInt32 inTopDelta)
void CombineRects (TRectArray &inRectArray)
void SortRectsLeftToRight (TRectArray &inRectArray)
virtual PCSZ WindowClass ()
virtual ULONG WindowStyle ()
virtual void PostCreateWidget ()
virtual PRInt32 GetClientHeight ()
virtual ULONG GetSWPFlags (ULONG flags)
virtual void SetupForPrint (HWND)
virtual nsresult GetWindowText (nsString &str, PRUint32 *rc)
virtual void AddToStyle (ULONG style)
virtual void RemoveFromStyle (ULONG style)
virtual BOOL SetWindowPos (HWND hwndInsertBehind, long x, long y, long cx, long cy, unsigned long flags)
virtual PRBool ProcessMessage (ULONG m, MPARAM p1, MPARAM p2, MRESULT &r)
virtual PRBool OnPaint ()
virtual void OnDestroy ()
virtual PRBool OnReposition (PSWP pNewSwp)
virtual PRBool OnResize (PRInt32 aX, PRInt32 aY)
virtual PRBool OnMove (PRInt32 aX, PRInt32 aY)
virtual PRBool OnKey (MPARAM mp1, MPARAM mp2)
virtual PRBool OnRealizePalette ()
virtual PRBool DispatchFocus (PRUint32 aEventType, PRBool isMozWindowTakingFocus)
virtual PRBool OnScroll (ULONG msgid, MPARAM mp1, MPARAM mp2)
virtual PRBool OnVScroll (MPARAM mp1, MPARAM mp2)
virtual PRBool OnHScroll (MPARAM mp1, MPARAM mp2)
virtual PRBool OnControl (MPARAM mp1, MPARAM mp2)
virtual PRBool OnPresParamChanged (MPARAM mp1, MPARAM mp2)
virtual PRBool OnDragDropMsg (ULONG msg, MPARAM mp1, MPARAM mp2, MRESULT &mr)
HWND GetParentHWND () const
HWND GetHWND () const
PFNWP GetPrevWP () const
void DoCreate (HWND hwndP, nsWindow *wndP, const nsRect &rect, EVENT_CALLBACK aHandleEventFunction, nsIDeviceContext *aContext, nsIAppShell *aAppShell, nsIToolkit *aToolkit, nsWidgetInitData *aInitData)
virtual void RealDoCreate (HWND hwndP, nsWindow *aParent, const nsRect &aRect, EVENT_CALLBACK aHandleEventFunction, nsIDeviceContext *aContext, nsIAppShell *aAppShell, nsWidgetInitData *aInitData, HWND hwndOwner=0)
virtual ULONG GetFCFlags ()
virtual void SubclassWindow (BOOL bState)
PRBool ConvertStatus (nsEventStatus aStatus)
void InitEvent (nsGUIEvent &event, nsPoint *pt=0)
virtual PRBool DispatchWindowEvent (nsGUIEvent *event)
virtual PRBool DispatchWindowEvent (nsGUIEvent *event, nsEventStatus &aStatus)
PRBool DispatchStandardEvent (PRUint32 aMsg)
PRBool DispatchAppCommandEvent (PRUint32 aEventCommand)
PRBool DispatchDragDropEvent (PRUint32 aMsg)
virtual PRBool DispatchMouseEvent (PRUint32 aEventType, MPARAM mp1, MPARAM mp2)
virtual PRBool DispatchResizeEvent (PRInt32 aClientX, PRInt32 aClientY)
void GetNonClientBounds (nsRect &aRect)
void DeferPosition (HWND, HWND, long, long, long, long, ULONG)
void ConstrainZLevel (HWND *aAfter)
PRBool CheckDragStatus (PRUint32 aAction, HPS *oHps)
PRBool ReleaseIfDragHPS (HPS aHps)
HBITMAP DataToBitmap (PRUint8 *aImageData, PRUint32 aWidth, PRUint32 aHeight, PRUint32 aDepth)
HBITMAP CreateTransparencyMask (PRInt32 format, PRUint8 *aImageData, PRUint32 aWidth, PRUint32 aHeight)
BOOL NotifyForeignChildWindows (HWND aWnd)
QWidget * createQWidget (QWidget *parent, nsWidgetInitData *aInitData)
nsWindowGetParent (PRBool aStopOnFirstTopLevel)
void DispatchPendingEvents ()
virtual PRBool ProcessMessage (UINT msg, WPARAM wParam, LPARAM lParam, LRESULT *aRetValue)
virtual PRBool DispatchWindowEvent (nsGUIEvent *event)
virtual PRBool DispatchWindowEvent (nsGUIEvent *event, nsEventStatus &aStatus)
virtual PRInt32 GetHeight (PRInt32 aProposedHeight)
virtual LPCWSTR WindowClassW ()
virtual LPCWSTR WindowPopupClassW ()
virtual LPCTSTR WindowClass ()
virtual LPCTSTR WindowPopupClass ()
virtual DWORD WindowStyle ()
virtual DWORD WindowExStyle ()
virtual void SubclassWindow (BOOL bState)
virtual void OnDestroy ()
virtual PRBool OnMove (PRInt32 aX, PRInt32 aY)
virtual PRBool OnPaint (HDC aDC=nsnull)
virtual PRBool OnResize (nsRect &aWindowRect)
BOOL OnChar (UINT charCode, LPARAM keyData, PRUint32 aFlags=0)
BOOL OnKeyDown (UINT aVirtualKeyCode, UINT aScanCode, LPARAM aKeyCode)
BOOL OnKeyUp (UINT aVirtualKeyCode, UINT aScanCode, LPARAM aKeyCode)
UINT MapFromNativeToDOM (UINT aNativeKeyCode)
BOOL OnInputLangChange (HKL aHKL, LRESULT *oResult)
BOOL OnIMEChar (BYTE aByte1, BYTE aByte2, LPARAM aKeyState)
BOOL OnIMEComposition (LPARAM aGCS)
BOOL OnIMECompositionFull ()
BOOL OnIMEEndComposition ()
BOOL OnIMENotify (WPARAM aIMN, LPARAM aData, LRESULT *oResult)
BOOL OnIMERequest (WPARAM aIMR, LPARAM aData, LRESULT *oResult, PRBool aUseUnicode)
BOOL OnIMESelect (BOOL aSelected, WORD aLangID)
BOOL OnIMESetContext (BOOL aActive, LPARAM &aISC)
BOOL OnIMEStartComposition ()
BOOL OnIMEReconvert (LPARAM aData, LRESULT *oResult, PRBool aUseUnicode)
BOOL OnIMEQueryCharPosition (LPARAM aData, LRESULT *oResult, PRBool aUseUnicode)
void GetCompositionString (HIMC aHIMC, DWORD aIndex, nsString *aStrUnicode, nsCString *aStrAnsi)
void ResolveIMECaretPos (nsWindow *aClient, nsRect &aEventResult, nsRect &aResult)
virtual PRBool DispatchKeyEvent (PRUint32 aEventType, WORD aCharCode, UINT aVirtualCharCode, LPARAM aKeyCode, PRUint32 aFlags=0)
virtual PRBool DispatchFocus (PRUint32 aEventType, PRBool isMozWindowTakingFocus)
virtual PRBool OnScroll (UINT scrollCode, int cPos)
virtual HBRUSH OnControlColor ()
PRBool DispatchStandardEvent (PRUint32 aMsg)
PRBool DispatchAppCommandEvent (PRUint32 aEventCommand)
void RelayMouseEvent (UINT aMsg, WPARAM wParam, LPARAM lParam)
void GetNonClientBounds (nsRect &aRect)
void HandleTextEvent (HIMC hIMEContext, PRBool aCheckAttr=PR_TRUE)
BOOL HandleStartComposition (HIMC hIMEContext)
void HandleEndComposition (void)
void GetTextRangeList (PRUint32 *textRangeListLengthResult, nsTextRangeArray *textRangeListResult)
void ConstrainZLevel (HWND *aAfter)
PRBool CanTakeFocus ()
virtual long GetEventMask ()
void NativeGrab (PRBool aGrab)
void DoPaint (PRInt32 aX, PRInt32 aY, PRInt32 aWidth, PRInt32 aHeight, nsIRegion *aClipRegion)
void QueueDraw ()
void UnqueueDraw ()
virtual void CreateNative (Window aParent, nsRect aRect)
nsresult CreateWidget (nsIWidget *aParent, const nsRect &aRect, EVENT_CALLBACK aHandleEventFunction, nsIDeviceContext *aContext, nsIAppShell *aAppShell, nsIToolkit *aToolkit, nsWidgetInitData *aInitData, nsNativeWidget aNativeParent=nsnull)
nsresult CreateWidget (nsIWidget *aParent, const nsRect &aRect, EVENT_CALLBACK aHandleEventFunction, nsIDeviceContext *aContext, nsIAppShell *aAppShell, nsIToolkit *aToolkit, nsWidgetInitData *aInitData, nsNativeWidget aNativeParent=nsnull)
virtual void SetFontNative (GdkFont *aFont)
virtual void SetBackgroundColorNative (GdkColor *aColorNor, GdkColor *aColorBri, GdkColor *aColorDark)
void InstallEnterNotifySignal (GtkWidget *aWidget)
void InstallLeaveNotifySignal (GtkWidget *aWidget)
void InstallButtonPressSignal (GtkWidget *aWidget)
void InstallButtonReleaseSignal (GtkWidget *aWidget)
void InstallRealizeSignal (GtkWidget *aWidget)
void AddToEventMask (GtkWidget *aWidget, gint aEventMask)
void InstallSignal (GtkWidget *aWidget, gchar *aSignalName, GtkSignalFunc aSignalFunction)
void InitMouseEvent (GdkEventButton *aGdkButtonEvent, nsMouseEvent &anEvent)
void InitMouseEvent (PhPointerEvent_t *aPhButtonEvent, nsWidget *aWidget, nsMouseEvent &anEvent, PRUint32 aEventType)
PRBool HandleEvent (PtWidget_t *, PtCallbackInfo_t *aCbInfo)
PRBool DispatchKeyEvent (PhKeyEvent_t *aPhKeyEvent, int force)
void ScreenToWidgetPos (PhPoint_t &pt)
void InitKeyEvent (PhKeyEvent_t *aPhKeyEvent, nsKeyEvent &anEvent)
void InitKeyPressEvent (PhKeyEvent_t *aPhKeyEvent, nsKeyEvent &anEvent)
PRUint32 nsConvertKey (PhKeyEvent_t *aPhKeyEvent)
virtual void CreateNativeWindow (Window aParent, nsRect aRect, XSetWindowAttributes aAttr, unsigned long aMask)
void Map (void)
void Unmap (void)
void SetUpWMHints (void)
void WidgetPut (nsWidget *aWidget)
void WidgetMove (nsWidget *aWidget)
void WidgetMoveResize (nsWidget *aWidget)
void WidgetResize (nsWidget *aWidget)
PRBool WidgetVisible (nsRect &aBounds)
virtual void ResolveIconName (const nsAString &aIconName, const nsAString &aIconSuffix, nsILocalFile **aResult)
 Resolve the given icon name into a local file object.
virtual void DrawScaledRect (nsIRenderingContext &aRenderingContext, const nsRect &aRect, float aScale, float aAppUnits)
 Calculates the border width and height.
virtual void DrawScaledLine (nsIRenderingContext &aRenderingContext, nscoord aSX, nscoord aSY, nscoord aEX, nscoord aEY, float aScale, float aAppUnits, PRBool aIsHorz)
 Calculates the border width and height.
virtual void BaseCreate (nsIWidget *aParent, const nsRect &aRect, EVENT_CALLBACK aHandleEventFunction, nsIDeviceContext *aContext, nsIAppShell *aAppShell, nsIToolkit *aToolkit, nsWidgetInitData *aInitData)
void CommonCreate (nsIWidget *aParent, PRBool aListenForResizes)
void InitKeyEvent (nsKeyEvent *nsEvent, QKeyEvent *qEvent)
void DispatchGotFocusEvent (void)
PRBool AreBoundsSane () const
virtual bool mousePressEvent (QMouseEvent *)
virtual bool mouseReleaseEvent (QMouseEvent *)
virtual bool mouseDoubleClickEvent (QMouseEvent *)
virtual bool mouseMoveEvent (QMouseEvent *)
virtual bool wheelEvent (QWheelEvent *)
virtual bool keyPressEvent (QKeyEvent *)
virtual bool keyReleaseEvent (QKeyEvent *)
virtual bool focusInEvent (QFocusEvent *)
virtual bool focusOutEvent (QFocusEvent *)
virtual bool enterEvent (QEvent *)
virtual bool leaveEvent (QEvent *)
virtual bool paintEvent (QPaintEvent *)
virtual bool moveEvent (QMoveEvent *)
virtual bool resizeEvent (QResizeEvent *)
virtual bool closeEvent (QCloseEvent *)
virtual bool contextMenuEvent (QContextMenuEvent *)
virtual bool imStartEvent (QIMEvent *)
virtual bool imComposeEvent (QIMEvent *)
virtual bool imEndEvent (QIMEvent *)
virtual bool dragEnterEvent (QDragEnterEvent *)
virtual bool dragMoveEvent (QDragMoveEvent *)
virtual bool dragLeaveEvent (QDragLeaveEvent *)
virtual bool dropEvent (QDropEvent *)
virtual bool showEvent (QShowEvent *)
virtual bool hideEvent (QHideEvent *)
bool ignoreEvent (nsEventStatus aStatus) const
void Initialize (QWidget *widget)
 Has to be called in subclasses after they created the actual QWidget if they overwrite the Create calls from the nsCommonWidget class.
void InitMouseEvent (nsMouseEvent *nsEvent, QMouseEvent *qEvent, int aClickCount)
void InitMouseWheelEvent (nsMouseScrollEvent *aEvent, QWheelEvent *qEvent)

Static Protected Member Functions

static PRBool EventIsInsideWindow (nsWindow *aWindow, nsPoint pos)
static PRBool DealWithPopups (uint32 methodID, nsPoint pos)
static PRBool ConvertStatus (nsEventStatus aStatus)
static Window GetInnerMostWindow (Window aOriginWindow, Window aWindow, nscoord x, nscoord y, nscoord *retx, nscoord *rety, int depth)
static nsWindowGetnsWindowFromXWindow (Window aWindow)
static gint ClientEventSignal (GtkWidget *widget, GdkEventClient *event, void *data)
static gint DragMotionSignal (GtkWidget *aWidget, GdkDragContext *aDragContext, gint aX, gint aY, guint aTime, void *aData)
static void DragLeaveSignal (GtkWidget *aWidget, GdkDragContext *aDragContext, guint aTime, gpointer aData)
static gint DragDropSignal (GtkWidget *aWidget, GdkDragContext *aDragContext, gint aX, gint aY, guint aTime, void *aData)
static void DragDataReceived (GtkWidget *aWidget, GdkDragContext *aDragContext, gint aX, gint aY, GtkSelectionData *aSelectionData, guint aInfo, guint32 aTime, gpointer aData)
static guint DragMotionTimerCallback (gpointer aClosure)
static void DragLeaveTimerCallback (nsITimer *aTimer, void *aClosure)
static OSStatus AddRectToArrayProc (UInt16 message, RgnHandle rgn, const Rect *rect, void *refCon)
static void PaintUpdateRect (Rect *r, void *data)
static BOOL DealWithPopups (ULONG inMsg, MRESULT *outResult)
static PRBool EventIsInsideWindow (nsWindow *aWindow)
static nsWindowGetNSWindowPtr (HWND aWnd)
static BOOL SetNSWindowPtr (HWND aWnd, nsWindow *ptr)
static LRESULT CALLBACK MozSpecialMsgFilter (int code, WPARAM wParam, LPARAM lParam)
static LRESULT CALLBACK MozSpecialWndProc (int code, WPARAM wParam, LPARAM lParam)
static LRESULT CALLBACK MozSpecialMouseProc (int code, WPARAM wParam, LPARAM lParam)
static VOID CALLBACK HookTimerForPopups (HWND hwnd, UINT uMsg, UINT idEvent, DWORD dwTime)
static void ScheduleHookTimer (HWND aWnd, UINT aMsgId)
static void RegisterSpecialDropdownHooks ()
static void UnregisterSpecialDropdownHooks ()
static void PostSleepWakeNotification (const char *aNotification)
static BOOL DealWithPopups (HWND inWnd, UINT inMsg, WPARAM inWParam, LPARAM inLParam, LRESULT *outResult)
static PRBool EventIsInsideWindow (UINT Msg, nsWindow *aWindow)
static nsWindowGetNSWindowPtr (HWND aWnd)
static BOOL SetNSWindowPtr (HWND aWnd, nsWindow *ptr)
static LRESULT CALLBACK WindowProc (HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
static LRESULT CALLBACK DefaultWindowProc (HWND hWns, UINT msg, WPARAM wParam, LPARAM lParam)
static PRBool ConvertStatus (nsEventStatus aStatus)
static PRUint8Data8BitTo1Bit (PRUint8 *aAlphaData, PRUint32 aAlphaBytesPerRow, PRUint32 aWidth, PRUint32 aHeight)
 Create a 1 bit mask out of a 8 bit alpha layer.
static PRUint8DataToAData (PRUint8 *aImageData, PRUint32 aImageBytesPerRow, PRUint8 *aAlphaData, PRUint32 aAlphaBytesPerRow, PRUint32 aWidth, PRUint32 aHeight)
 Combine the given image data with a separate alpha channel to image data with the alpha channel interleaved with the image data (BGRA).
static HBITMAP DataToBitmap (PRUint8 *aImageData, PRUint32 aWidth, PRUint32 aHeight, PRUint32 aDepth)
 Convert the given image data to a HBITMAP.
static HBITMAP CreateOpaqueAlphaChannel (PRUint32 aWidth, PRUint32 aHeight)
 Create a bitmap representing an opaque alpha channel (filled with 0xff).
static BOOL CALLBACK BroadcastMsgToChildren (HWND aWnd, LPARAM aMsg)
static BOOL CALLBACK BroadcastMsg (HWND aTopWindow, LPARAM aMsg)
static BOOL CALLBACK DispatchStarvedPaints (HWND aTopWindow, LPARAM aMsg)
static gint DestroySignal (GtkWidget *aGtkWidget, nsWidget *aWidget)
static gint EnterNotifySignal (GtkWidget *aWidget, GdkEventCrossing *aGdkCrossingEvent, gpointer aData)
static gint LeaveNotifySignal (GtkWidget *aWidget, GdkEventCrossing *aGdkCrossingEvent, gpointer aData)
static gint ButtonPressSignal (GtkWidget *aWidget, GdkEventButton *aGdkButtonEvent, gpointer aData)
static gint ButtonReleaseSignal (GtkWidget *aWidget, GdkEventButton *aGdkButtonEvent, gpointer aData)
static gint RealizeSignal (GtkWidget *aWidget, gpointer aData)
static gint FocusInSignal (GtkWidget *aWidget, GdkEventFocus *aGdkFocusEvent, gpointer aData)
static gint FocusOutSignal (GtkWidget *aWidget, GdkEventFocus *aGdkFocusEvent, gpointer aData)
static int RawEventHandler (PtWidget_t *widget, void *data, PtCallbackInfo_t *cbinfo)
static int GotFocusCallback (PtWidget_t *widget, void *data, PtCallbackInfo_t *cbinfo)
static int LostFocusCallback (PtWidget_t *widget, void *data, PtCallbackInfo_t *cbinfo)
static int DestroyedCallback (PtWidget_t *widget, void *data, PtCallbackInfo_t *cbinfo)
static void DestroyNativeChildren (Display *aDisplay, Window aWindow)
static void AddWindowCallback (Window aWindow, nsWidget *aWidget)
static void DeleteWindowCallback (Window aWindow)

Protected Attributes

nsCOMPtr< nsIWidgetmParent
nsWindowmWindowParent
nsCOMPtr< nsIRegionmUpdateArea
nsIFontMetricsmFontMetrics
nsViewBeOSmView
PRInt32 mPreferredWidth
PRInt32 mPreferredHeight
window_feel mBWindowFeel
PRPackedBool mIsTopWidgetWindow
PRPackedBool mIsMetaDown
PRPackedBool mIsVisible
PRPackedBool mEnabled
PRPackedBool mIsScrolling
PRPackedBool mListenForResizes
PRBool mIsTooSmall
GtkWidget * mShell
GdkSuperWin * mSuperWin
GtkWidget * mMozArea
GtkWidget * mMozAreaClosestParent
nscoord mCachedX
nscoord mCachedY
GtkWidget * mDragMotionWidget
GdkDragContext * mDragMotionContext
gint mDragMotionX
gint mDragMotionY
guint mDragMotionTime
guint mDragMotionTimerID
nsCOMPtr< nsITimermDragLeaveTimer
nsIWidgetmParent
PRPackedBool mResizingChildren
PRPackedBool mSaveVisible
PRPackedBool mVisible
nsIMenuBarmMenuBar
RgnHandle mWindowRegion
RgnHandle mVisRegion
WindowPtr mWindowPtr
PRPackedBool mDestructorCalled
PRPackedBool mAcceptFocusOnClick
PRPackedBool mDrawing
PRPackedBool mInUpdate
PRPackedBool mTempRenderingContextMadeHere
nsIRenderingContextmTempRenderingContext
nsPluginPort * mPluginPort
HWND mWnd
HWND mFrameWnd
PFNWP mPrevWndProc
nsWindowmParent
ULONG mNextID
PSWP mSWPs
ULONG mlHave
ULONG mlUsed
HPOINTER mFrameIcon
VDKEY mDeadKey
BOOL mHaveDeadKey
QMSG mQmsg
PRBool mIsTopWidgetWindow
BOOL mIsScrollBar
BOOL mInSetFocus
BOOL mChromeHidden
nsContentType mContentType
HPS mDragHps
PRUint32 mDragStatus
HPOINTER mCssCursorHPtr
nsCOMPtr< imgIContainermCssCursorImg
BOOL mIsVisible
nsToolkitmOS2Toolkit
nsFontmFont
PRInt32 mWindowState
nsSize mLastSize
nsPoint mLastPoint
HWND mBorderlessParent
WNDPROC mPrevWndProc
HBRUSH mBrush
PRPackedBool mHas3DBorder
PRPackedBool mIsShiftDown
PRPackedBool mIsControlDown
PRPackedBool mIsAltDown
PRPackedBool mIsDestroying
PRPackedBool mOnDestroyCalled
PRPackedBool mIsInMouseCapture
PRPackedBool mIsInMouseWheelProcessing
PRPackedBool mUnicodeWidget
PRPackedBool mPainting
char mLeadByte
PRUint32 mBlurEventSuppressionLevel
PRInt32 mMenuCmdId
DWORD mOldStyle
DWORD mOldExStyle
HKL mLastKeyboardLayout
nsNativeDragTargetmNativeDragTarget
HDWP mDeferredPositioner
PRBool mIsUpdating
PRBool mBlockFocusEvents
GC mScrollGC
PRPackedBool mIsToplevel
PRBool mHasFocus
GtkWidget * mWidget
PtWidget_t * mWidget
GtkWidget * mMozBox
PRPackedBool mShown
PRBool mShown
PRPackedBool mInternalShown
PRBool mIsShown
int mVisibility
nsIWidgetmParentWidget
Window mParentWindow
XlibRgbHandle * mXlibRgbHandle
DisplaymDisplay
Screen * mScreen
Window mBaseWindow
Visual * mVisual
int mDepth
unsigned long mBackgroundPixel
PRUint32 mBorderRGB
unsigned long mBorderPixel
nsString mName
nsRect mRequestedSize
PRPackedBool mMapped
voidmClientData
EVENT_CALLBACK mEventCallback
nsIDeviceContextmContext
nsCOMPtr< nsIAppShellmAppShell
nsIToolkitmToolkit
nsIMouseListenermMouseListener
nsIEventListenermEventListener
nsIMenuListenermMenuListener
nscolor mBackground
nscolor mForeground
nsCursor mCursor
nsWindowType mWindowType
nsBorderStyle mBorderStyle
nsRect mBounds
nsRectmOriginalBounds
PRInt32 mZIndex
nsSizeMode mSizeMode
nsCOMPtr< nsIWidgetmFirstChild
nsIWidgetmLastChild
nsCOMPtr< nsIWidgetmNextSibling
nsIWidgetmPrevSibling
voidmClientData
EVENT_CALLBACK mEventCallback
nsIDeviceContextmContext
nsCOMPtr< nsIAppShellmAppShell
nsIToolkitmToolkit
nsIMouseListenermMouseListener
nsIEventListenermEventListener
nsIMenuListenermMenuListener
nscolor mBackground
nscolor mForeground
nsCursor mCursor
nsWindowType mWindowType
nsBorderStyle mBorderStyle
nsRect mBounds
nsRectmOriginalBounds
PRInt32 mZIndex
nsSizeMode mSizeMode
nsCOMPtr< nsIWidgetmFirstChild
nsIWidgetmLastChild
nsCOMPtr< nsIWidgetmNextSibling
nsIWidgetmPrevSibling
PRPackedBool mIsTopLevel
PRPackedBool mIsDestroyed
PRPackedBool mNeedsResize
PRPackedBool mNeedsMove
PRPackedBool mIsShown
PRPackedBool mNeedsShow
PRBool mCreated
PRBool mPlaced
QWidget * mWidget
voidmClientData
EVENT_CALLBACK mEventCallback
nsIDeviceContextmContext
nsCOMPtr< nsIAppShellmAppShell
nsIToolkitmToolkit
nsIMouseListenermMouseListener
nsIEventListenermEventListener
nsIMenuListenermMenuListener
nscolor mBackground
nscolor mForeground
nsCursor mCursor
nsWindowType mWindowType
nsBorderStyle mBorderStyle
nsRect mBounds
nsRectmOriginalBounds
PRInt32 mZIndex
nsSizeMode mSizeMode
nsCOMPtr< nsIWidgetmFirstChild
nsIWidgetmLastChild
nsCOMPtr< nsIWidgetmNextSibling
nsIWidgetmPrevSibling

Static Protected Attributes

static PRBool sIsGrabbing = PR_FALSE
static nsWindowsGrabWindow = NULL
static PRBool sIsDraggingOutOf = PR_FALSE
static GHashTable * mWindowLookupTable = NULL
static nsWindowmLastDragMotionWindow = NULL
static GdkCursor * gsGtkCursorCache [eCursorCount]
static PLDHashTablesIconCache
static nsWindowgCurrentWindow = nsnull
static BOOL sIsRegistered = FALSE
static PRUint32 sInstanceCount = 0
static PRBool sIMEIsComposing = PR_FALSE
static PRBool sIMEIsStatusChanged = PR_FALSE
static DWORD sIMEProperty = 0
static nsStringsIMECompUnicode = NULL
static PRUint8sIMEAttributeArray = NULL
static PRInt32 sIMEAttributeArrayLength = 0
static PRInt32 sIMEAttributeArraySize = 0
static PRUint32sIMECompClauseArray = NULL
static PRInt32 sIMECompClauseArrayLength = 0
static PRInt32 sIMECompClauseArraySize = 0
static long sIMECursorPosition = 0
static PRUnicharsIMEReconvertUnicode = NULL
static RECT * sIMECompCharPos = nsnull
static PRInt32 sIMECaretHeight = 0
static UINT gCurrentKeyboardCP = 0
static HKL gKeyboardLayout = 0
static PRBool gSwitchKeyboardLayout = PR_FALSE
static BOOL sIsPopupClassRegistered = FALSE
static UINT uMSH_MOUSEWHEEL = 0
static UINT uWM_MSIME_RECONVERT = 0
static UINT uWM_MSIME_MOUSE = 0
static UINT uWM_ATOK_RECONVERT = 0
static UINT uWM_HEAP_DUMP = 0
static HCURSOR gHCursor = NULL
static imgIContainergCursorImgContainer = nsnull
static guint32 sLastEventTime = 0
static nsWidgetsFocusWidget = 0
static nsILookAndFeelsLookAndFeel = nsnull
static nsClipboardsClipboard = nsnull
static PRUint32 sWidgetCount = 0
static Window mFocusWindow = 0
static nsHashtable * gsWindowList = nsnull
static Cursor gsXlibCursorCache [eCursorCount]
static PRBool gRollupConsumeRollupEvent = PR_FALSE

Private Types

typedef nsBaseWidget Inherited

Private Member Functions

nsresult SetMiniIcon (GdkPixmap *window_pixmap, GdkBitmap *window_mask)
nsresult SetIcon (GdkPixmap *window_pixmap, GdkBitmap *window_mask)
void NativeGrab (PRBool aGrab)
void DestroyNativeChildren (void)
void GetToplevelWidget (GtkWidget **aWidget)
void GetContainerWindow (nsWindow **aWindow)
void SetUrgencyHint (GtkWidget *top_window, PRBool state)
voidSetupPluginPort (void)
nsresult SetWindowIconList (const nsCStringArray &aIconList)
void SetDefaultIcon (void)
void InitDragEvent (nsMouseEvent &aEvent)
void UpdateDragStatus (nsMouseEvent &aEvent, GdkDragContext *aDragContext, nsIDragService *aDragService)
void ResetDragMotionTimer (GtkWidget *aWidget, GdkDragContext *aDragContext, gint aX, gint aY, guint aTime)
void FireDragMotionTimer (void)
void FireDragLeaveTimer (void)
virtual void DestroyNative (void)
void DestroyNativeChildren (void)
NS_IMETHOD CreateNative (PtWidget_t *parentWidget)
NS_IMETHOD ModalEventFilter (PRBool aRealEvent, void *aEvent, PRBool *aForWindow)
 Determine whether a given event should be processed assuming we are the currently active modal window.

Static Private Member Functions

static PRBool DragInProgress (void)
static guint DragMotionTimerCallback (gpointer aClosure)
static void DragLeaveTimerCallback (nsITimer *aTimer, void *aClosure)
static int MenuRegionCallback (PtWidget_t *widget, void *data, PtCallbackInfo_t *cbinfo)
static int ResizeHandler (PtWidget_t *widget, void *data, PtCallbackInfo_t *cbinfo)
static int EvInfo (PtWidget_t *widget, void *data, PtCallbackInfo_t *cbinfo)
static int WindowWMHandler (PtWidget_t *widget, void *data, PtCallbackInfo_t *cbinfo)
static int MenuRegionDestroyed (PtWidget_t *widget, void *data, PtCallbackInfo_t *cbinfo)

Private Attributes

PRUnicharmIMECompositionUniString
PRInt32 mIMECompositionUniStringSize
PRPackedBool mLastGrabFailed
PRPackedBool mIsUpdating
PRPackedBool mLeavePending
PRPackedBool mRestoreFocus
PRPackedBool mHasAnonymousChildren
 Whether this widget has child widgets that are not linked into its explicit nsIWidget child list.
PRPackedBool mIsTranslucent
gchar * mTransparencyBitmap
GtkWindow * mTransientParent
MozContainer * mContainer
MozDrawingarea * mDrawingarea
GtkWindowGroup * mWindowGroup
PRUint32 mContainerGotFocus: 1
PRUint32 mContainerLostFocus: 1
PRUint32 mContainerBlockFocus: 1
PRUint32 mInKeyRepeat: 1
PRUint32 mIsVisible: 1
PRUint32 mRetryPointerGrab: 1
PRUint32 mActivatePending: 1
PRUint32 mRetryKeyboardGrab: 1
PRInt32 mSizeState
PluginType mPluginType
PRBool mIsTranslucent
PtWidget_t * mClientWidget
PtWidget_t * mLastMenu

Static Private Attributes

static nsIRollupListenergRollupListener = nsnull
static nsIWidgetgRollupWidget = nsnull

Friends

MRESULT EXPENTRY fnwpNSWindow (HWND, ULONG, MPARAM, MPARAM)
MRESULT EXPENTRY fnwpFrame (HWND, ULONG, MPARAM, MPARAM)
class nsQtEventDispatcher
 Event handlers (proxied from the actual qwidget).
class InterceptContainer
class MozQWidget

Detailed Description

Native BeOS window wrapper.

Native WIN32 window wrapper.

Native Photon window wrapper.

Native GTK+ window wrapper.

Definition at line 79 of file nsWindow.h.


Member Typedef Documentation

typedef nsBaseWidget nsWindow::Inherited [private]

Reimplemented in nsMacWindow, nsNativeScrollbar, nsNativeScrollbar, nsMacControl, and nsChildWindow.

Definition at line 93 of file nsWindow.h.


Member Enumeration Documentation

anonymous enum [inherited]
Enumerator:
CREATE 
CREATE_NATIVE 
DESTROY 
SET_FOCUS 
GOT_FOCUS 
KILL_FOCUS 
ONMOUSE 
ONDROP 
ONWHEEL 
ONPAINT 
ONRESIZE 
CLOSEWINDOW 
ONKEY 
BTNCLICK 
ONACTIVATE 
ONMOVE 
ONWORKSPACE 

Definition at line 61 of file nsSwitchToUIThread.h.

anonymous enum [protected]
Enumerator:
CREATE 
DESTROY 
SET_FOCUS 
UPDATE_WINDOW 
SET_TITLE 
GET_TITLE 

Definition at line 344 of file nsWindow.h.

anonymous enum [protected]
Enumerator:
CREATE 
CREATE_NATIVE 
DESTROY 
SET_FOCUS 
SET_CURSOR 
CREATE_HACK 

Definition at line 632 of file nsWindow.h.

anonymous enum [protected, inherited]
Enumerator:
CREATE 
CREATE_NATIVE 
DESTROY 
SET_FOCUS 
SET_CURSOR 
CREATE_HACK 

Definition at line 186 of file nsBaseWidget.h.

anonymous enum [protected, inherited]
Enumerator:
CREATE 
CREATE_NATIVE 
DESTROY 
SET_FOCUS 
SET_CURSOR 
CREATE_HACK 

Definition at line 186 of file nsBaseWidget.h.

anonymous enum [protected, inherited]
Enumerator:
CREATE 
CREATE_NATIVE 
DESTROY 
SET_FOCUS 
SET_CURSOR 
CREATE_HACK 

Definition at line 186 of file nsBaseWidget.h.

Enumerator:
PluginType_NONE 
PluginType_XEMBED 
PluginType_NONXEMBED 

Definition at line 244 of file nsWindow.h.

                    {
        PluginType_NONE = 0,   /* do not have any plugin */
        PluginType_XEMBED,     /* the plugin support xembed */
        PluginType_NONXEMBED   /* the plugin does not support xembed */
    };

Constructor & Destructor Documentation

Definition at line 284 of file nsWindow.cpp.

                   : nsBaseWidget()
{
       rgb_color     back = ui_color(B_PANEL_BACKGROUND_COLOR);

       mView               = 0;
       mPreferredWidth     = 0;
       mPreferredHeight    = 0;
       mFontMetrics        = nsnull;
       mIsVisible          = PR_FALSE;
       mEnabled            = PR_TRUE;
       mIsScrolling        = PR_FALSE;
       mParent             = nsnull;
       mWindowParent       = nsnull;
       mUpdateArea = do_CreateInstance(kRegionCID);
       mForeground = NS_RGBA(0xFF,0xFF,0xFF,0xFF);
       mBackground = mForeground;
       mBWindowFeel        = B_NORMAL_WINDOW_FEEL;
       if (mUpdateArea)
       {
              mUpdateArea->Init();
              mUpdateArea->SetTo(0, 0, 0, 0);
       }
}

Here is the call graph for this function:

nsWindow::~nsWindow ( ) [virtual]

Definition at line 314 of file nsWindow.cpp.

{
       mIsDestroying = PR_TRUE;

       // If the widget was released without calling Destroy() then the native
       // window still exists, and we need to destroy it
       if (NULL != mView) 
       {
              Destroy();
       }
       NS_IF_RELEASE(mFontMetrics);
}

Here is the call graph for this function:

virtual nsWindow::~nsWindow ( ) [virtual]
virtual nsWindow::~nsWindow ( ) [virtual]
virtual nsWindow::~nsWindow ( ) [virtual]
virtual nsWindow::~nsWindow ( ) [virtual]
virtual nsWindow::~nsWindow ( ) [virtual]
virtual nsWindow::~nsWindow ( ) [virtual]
virtual nsWindow::~nsWindow ( ) [virtual]

Member Function Documentation

virtual void nsWindow::AcceptFocusOnClick ( PRBool  aBool) [inline, virtual]

Definition at line 206 of file nsWindow.h.

{ mAcceptFocusOnClick = aBool;};

Definition at line 207 of file nsWindow.h.

{ return mAcceptFocusOnClick;};

Here is the caller graph for this function:

void nsBaseWidget::AddChild ( nsIWidget aChild) [virtual, inherited]

Internal methods.

Implements nsIWidget.

Definition at line 284 of file nsBaseWidget.cpp.

{
  NS_PRECONDITION(!aChild->GetNextSibling() && !aChild->GetPrevSibling(),
                  "aChild not properly removed from its old child list");
  
  if (!mFirstChild) {
    mFirstChild = mLastChild = aChild;
  } else {
    // append to the list
    NS_ASSERTION(mLastChild, "Bogus state");
    NS_ASSERTION(!mLastChild->GetNextSibling(), "Bogus state");
    mLastChild->SetNextSibling(aChild);
    aChild->SetPrevSibling(mLastChild);
    mLastChild = aChild;
  }
}

Here is the call graph for this function:

Here is the caller graph for this function:

PRBool nsDeleteObserved::AddDeleteObserver ( nsDeleteObserver aDeleteObserver) [inherited]

Definition at line 76 of file nsDeleteObserver.cpp.

{
       if (! mDeleteObserverArray)
              mDeleteObserverArray = new nsVoidArray();

       if (mDeleteObserverArray)
              return mDeleteObserverArray->AppendElement(aDeleteObserver);
       return PR_FALSE;
}

Here is the call graph for this function:

Here is the caller graph for this function:

NS_METHOD nsBaseWidget::AddEventListener ( nsIEventListener aListener) [virtual, inherited]

Processes a mouse pressed event.

Implements nsIWidget.

Definition at line 718 of file nsBaseWidget.cpp.

{
  NS_PRECONDITION(mEventListener == nsnull, "Null mouse listener");
  NS_IF_RELEASE(mEventListener);
  NS_ADDREF(aListener);
  mEventListener = aListener;
  return NS_OK;
}

Here is the call graph for this function:

NS_METHOD nsBaseWidget::AddEventListener ( nsIEventListener aListener) [virtual, inherited]

Processes a mouse pressed event.

Implements nsIWidget.

Definition at line 718 of file nsBaseWidget.cpp.

{
  NS_PRECONDITION(mEventListener == nsnull, "Null mouse listener");
  NS_IF_RELEASE(mEventListener);
  NS_ADDREF(aListener);
  mEventListener = aListener;
  return NS_OK;
}

Here is the call graph for this function:

NS_METHOD nsBaseWidget::AddEventListener ( nsIEventListener aListener) [virtual, inherited]

Processes a mouse pressed event.

Implements nsIWidget.

Definition at line 718 of file nsBaseWidget.cpp.

{
  NS_PRECONDITION(mEventListener == nsnull, "Null mouse listener");
  NS_IF_RELEASE(mEventListener);
  NS_ADDREF(aListener);
  mEventListener = aListener;
  return NS_OK;
}

Here is the call graph for this function:

NS_METHOD nsBaseWidget::AddMenuListener ( nsIMenuListener aListener) [virtual, inherited]

Add a menu listener This interface should only be called by the menu services manager This will AddRef() the menu listener This will Release() a previously set menu listener.

Implements nsIWidget.

Definition at line 735 of file nsBaseWidget.cpp.

NS_METHOD nsBaseWidget::AddMenuListener ( nsIMenuListener aListener) [virtual, inherited]

Add a menu listener This interface should only be called by the menu services manager This will AddRef() the menu listener This will Release() a previously set menu listener.

Implements nsIWidget.

Definition at line 735 of file nsBaseWidget.cpp.

NS_METHOD nsBaseWidget::AddMenuListener ( nsIMenuListener aListener) [virtual, inherited]

Add a menu listener This interface should only be called by the menu services manager This will AddRef() the menu listener This will Release() a previously set menu listener.

Implements nsIWidget.

Definition at line 735 of file nsBaseWidget.cpp.

NS_METHOD nsBaseWidget::AddMouseListener ( nsIMouseListener aListener) [virtual, inherited]

Processes a mouse pressed event.

Implements nsIWidget.

Definition at line 705 of file nsBaseWidget.cpp.

{
  NS_PRECONDITION(mMouseListener == nsnull, "Null mouse listener");
  NS_IF_RELEASE(mMouseListener);
  NS_ADDREF(aListener);
  mMouseListener = aListener;
  return NS_OK;
}

Here is the call graph for this function:

NS_METHOD nsBaseWidget::AddMouseListener ( nsIMouseListener aListener) [virtual, inherited]

Processes a mouse pressed event.

Implements nsIWidget.

Definition at line 705 of file nsBaseWidget.cpp.

{
  NS_PRECONDITION(mMouseListener == nsnull, "Null mouse listener");
  NS_IF_RELEASE(mMouseListener);
  NS_ADDREF(aListener);
  mMouseListener = aListener;
  return NS_OK;
}

Here is the call graph for this function:

NS_METHOD nsBaseWidget::AddMouseListener ( nsIMouseListener aListener) [virtual, inherited]

Processes a mouse pressed event.

Implements nsIWidget.

Definition at line 705 of file nsBaseWidget.cpp.

{
  NS_PRECONDITION(mMouseListener == nsnull, "Null mouse listener");
  NS_IF_RELEASE(mMouseListener);
  NS_ADDREF(aListener);
  mMouseListener = aListener;
  return NS_OK;
}

Here is the call graph for this function:

OSStatus nsWindow::AddRectToArrayProc ( UInt16  message,
RgnHandle  rgn,
const Rect *  rect,
void refCon 
) [static, protected]

Definition at line 1308 of file nsWindow.cpp.

{
  if (message == kQDRegionToRectsMsgParse) {
    NS_ASSERTION(inArray, "You better pass an array!");
    TRectArray* rectArray = NS_REINTERPRET_CAST(TRectArray*, inArray);

    if (rectArray->mNumRects == rectArray->mCapacity) {
      // This should not happen - returning memFullErr below should have
      // prevented it.
      return memFullErr;
    }

    rectArray->mRectList[rectArray->mNumRects++] = *inDirtyRect;

    if (rectArray->mNumRects == rectArray->mCapacity) {
      // Signal that the array is full and QDRegionToRects should stop.
      // After returning memFullErr, this proc should not be called with
      // the same |message| again.
      return memFullErr;
    }
  }

  return noErr;
}
void nsWidget::AddToEventMask ( GtkWidget *  aWidget,
gint  aEventMask 
) [protected, inherited]

Definition at line 1642 of file nsWidget.cpp.

{
  NS_ASSERTION( nsnull != aWidget, "widget is null");
  NS_ASSERTION( 0 != aEventMask, "mask is 0");

  gtk_widget_add_events(aWidget,aEventMask);
}

Here is the caller graph for this function:

void nsWindow::AddToStyle ( ULONG  style) [protected, virtual]

Definition at line 3853 of file nsWindow.cpp.

{
   if( mWnd)
      WinSetWindowBits( mWnd, QWL_STYLE, style, style);
}
void nsWidget::AddWindowCallback ( Window  aWindow,
nsWidget aWidget 
) [static, protected, inherited]

Definition at line 842 of file nsWidget.cpp.

{
  // make sure that the list has been initialized
  if (gsWindowList == nsnull) {
    gsWindowList = new nsHashtable();
  }
  nsWindowKey window_key(aWindow);
  gsWindowList->Put(&window_key, aWidget);
}

Here is the caller graph for this function:

Definition at line 4204 of file nsWindow.cpp.

{}

Here is the caller graph for this function:

Definition at line 461 of file nsCommonWidget.cpp.

{
    if (mBounds.width > 0 && mBounds.height > 0)
        return PR_TRUE;

    return PR_FALSE;
}

Here is the caller graph for this function:

PRBool nsCommonWidget::AreBoundsSane ( ) const [protected, inherited]
PRBool nsWindow::AutoErase ( ) [virtual]

Reimplemented in nsTextHelper, nsTextHelper, and nsTextHelper.

Definition at line 6676 of file nsWindow.cpp.

{
  return PR_FALSE;
}

Here is the caller graph for this function:

void nsBaseWidget::BaseCreate ( nsIWidget aParent,
const nsRect aRect,
EVENT_CALLBACK  aHandleEventFunction,
nsIDeviceContext aContext,
nsIAppShell aAppShell,
nsIToolkit aToolkit,
nsWidgetInitData aInitData 
) [protected, virtual, inherited]

Definition at line 130 of file nsBaseWidget.cpp.

{
  if (nsnull == mToolkit) {
    if (nsnull != aToolkit) {
      mToolkit = (nsIToolkit*)aToolkit;
      NS_ADDREF(mToolkit);
    }
    else {
      if (nsnull != aParent) {
        mToolkit = (nsIToolkit*)(aParent->GetToolkit()); // the call AddRef's, we don't have to
      }
      // it's some top level window with no toolkit passed in.
      // Create a default toolkit with the current thread
#if !defined(USE_TLS_FOR_TOOLKIT)
      else {
        static NS_DEFINE_CID(kToolkitCID, NS_TOOLKIT_CID);
        
        nsresult res;
        res = CallCreateInstance(kToolkitCID, &mToolkit);
        NS_ASSERTION(NS_SUCCEEDED(res), "Can not create a toolkit in nsBaseWidget::Create");
        if (mToolkit)
          mToolkit->Init(PR_GetCurrentThread());
      }
#else /* USE_TLS_FOR_TOOLKIT */
      else {
        nsresult rv;

        rv = NS_GetCurrentToolkit(&mToolkit);
      }
#endif /* USE_TLS_FOR_TOOLKIT */
    }
    
  }
  
  mAppShell = aAppShell;    // addrefs
  
  // save the event callback function
  mEventCallback = aHandleEventFunction;
  
  // keep a reference to the device context
  if (aContext) {
    mContext = aContext;
    NS_ADDREF(mContext);
  }
  else {
    nsresult  res;
    
    static NS_DEFINE_CID(kDeviceContextCID, NS_DEVICE_CONTEXT_CID);
    
    res = CallCreateInstance(kDeviceContextCID, &mContext);

    if (NS_SUCCEEDED(res))
      mContext->Init(nsnull);
  }

  if (nsnull != aInitData) {
    PreCreateWidget(aInitData);
  }

  if (aParent) {
    aParent->AddChild(this);
  }
}

Here is the call graph for this function:

Here is the caller graph for this function:

When adjustments are to made to a whole set of child widgets, call this before resizing/positioning the child windows to minimize repaints.

Must be followed by EndResizingChildren() after child windows have been adjusted.

Reimplemented from nsWidget.

When adjustments are to made to a whole set of child widgets, call this before resizing/positioning the child windows to minimize repaints.

Must be followed by EndResizingChildren() after child windows have been adjusted.

Reimplemented from nsWidget.

When adjustments are to made to a whole set of child widgets, call this before resizing/positioning the child windows to minimize repaints.

Must be followed by EndResizingChildren() after child windows have been adjusted.

Reimplemented from nsWidget.

When adjustments are to made to a whole set of child widgets, call this before resizing/positioning the child windows to minimize repaints.

Must be followed by EndResizingChildren() after child windows have been adjusted.

Reimplemented from nsWidget.

When adjustments are to made to a whole set of child widgets, call this before resizing/positioning the child windows to minimize repaints.

Must be followed by EndResizingChildren() after child windows have been adjusted.

Reimplemented from nsWidget.

Definition at line 327 of file nsWindow.cpp.

{
       // HideKids(PR_TRUE) may be used here
       NS_NOTYETIMPLEMENTED("BeginResizingChildren not yet implemented"); // to be implemented
       return NS_OK;
}

When adjustments are to made to a whole set of child widgets, call this before resizing/positioning the child windows to minimize repaints.

Must be followed by EndResizingChildren() after child windows have been adjusted.

Reimplemented from nsWidget.

Definition at line 1279 of file nsWindow.cpp.

{
  // are they suppressed in this window?
  if (mBlurEventSuppressionLevel > 0)
    return PR_TRUE;

  // are they suppressed by any container widget?
  HWND parentWnd = ::GetParent(mWnd);
  if (parentWnd) {
    nsWindow *parent = GetNSWindowPtr(parentWnd);
    if (parent)
      return parent->BlurEventsSuppressed();
  }
  return PR_FALSE;
}

Here is the call graph for this function:

Here is the caller graph for this function:

BOOL CALLBACK nsWindow::BroadcastMsg ( HWND  aTopWindow,
LPARAM  aMsg 
) [static, protected]

Definition at line 921 of file nsWindow.cpp.

{
  // Iterate each of aTopWindows child windows sending the aMsg
  // to each of them.
  EnumChildWindows(aTopWindow, nsWindow::BroadcastMsgToChildren, aMsg);
  return TRUE;
}

Here is the call graph for this function:

Here is the caller graph for this function:

BOOL CALLBACK nsWindow::BroadcastMsgToChildren ( HWND  aWnd,
LPARAM  aMsg 
) [static, protected]

Definition at line 906 of file nsWindow.cpp.

{
  WNDPROC winProc = (WNDPROC)nsToolkit::mGetWindowLong(aWnd, GWL_WNDPROC);
  if (winProc == &nsWindow::WindowProc) {
    // it's one of our windows so go ahead and send a message to it
    nsToolkit::mCallWindowProc(winProc, aWnd, aMsg, 0, 0);
  }
  return TRUE;
}

Here is the call graph for this function:

Here is the caller graph for this function:

gint nsWidget::ButtonPressSignal ( GtkWidget *  aWidget,
GdkEventButton *  aGdkButtonEvent,
gpointer  aData 
) [static, protected, inherited]

Definition at line 2202 of file nsWidget.cpp.

{
  //  printf("nsWidget::ButtonPressSignal(%p)\n",aData);

  NS_ASSERTION( nsnull != aWidget, "widget is null");
  NS_ASSERTION( nsnull != aGdkButtonEvent, "event is null");

  nsWidget * widget = (nsWidget *) aData;

  NS_ASSERTION( nsnull != widget, "instance pointer is null");

  widget->OnButtonPressSignal(aGdkButtonEvent);

  return PR_TRUE;
}

Here is the call graph for this function:

Here is the caller graph for this function:

gint nsWidget::ButtonReleaseSignal ( GtkWidget *  aWidget,
GdkEventButton *  aGdkButtonEvent,
gpointer  aData 
) [static, protected, inherited]

Definition at line 2221 of file nsWidget.cpp.

{
  //  printf("nsWidget::ButtonReleaseSignal(%p)\n",aData);

  NS_ASSERTION( nsnull != aWidget, "widget is null");
  NS_ASSERTION( nsnull != aGdkButtonEvent, "event is null");

  nsWidget * widget = (nsWidget *) aData;

  NS_ASSERTION( nsnull != widget, "instance pointer is null");

  widget->OnButtonReleaseSignal(aGdkButtonEvent);

  return PR_TRUE;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void nsWindow::CalcOffset ( PRInt32 aX,
PRInt32 aY 
) [protected]

Definition at line 2009 of file nsWindow.cpp.

{
  aX = aY = 0;

  nsCOMPtr<nsIWidget> theParent = dont_AddRef(GetParent());
  while (theParent)
  {
    nsRect theRect;
    theParent->GetBounds(theRect);
    aX += theRect.x;
    aY += theRect.y;

    nsIWidget* grandparent = theParent->GetParent();
    theParent = dont_AddRef(grandparent);
  }
}

Here is the call graph for this function:

Reimplemented in nsChildWindow.

Definition at line 1907 of file nsWindow.cpp.

{
       //------
       // calculate the window region
       if (mWindowRegion == nsnull)
       {
              mWindowRegion = ::NewRgn();
              if (mWindowRegion == nsnull)
                     return;
       }
       ::SetRectRgn(mWindowRegion, 0, 0, mBounds.width, mBounds.height);

       // intersect with all the parents
       nsWindow* parent = (nsWindow*)mParent;
       nsPoint origin(-mBounds.x, -mBounds.y);

       // must stop enumerating when hitting a native window boundary
       if (!mIsTopWidgetWindow)
       {
              while (parent && (!parent->mIsTopWidgetWindow))
       {
    if (parent->mWindowRegion)
    {
      // Under 10.2, if we offset a region beyond the coordinate space,
      // OffsetRgn() will silently fail and restoring it will then cause the
      // widget to be out of place (visible as 'shearing' when scrolling).
      // To prevent that, we copy the original region and work on that. (bug 162885)
      StRegionFromPool shiftedParentWindowRgn;
      if ( !shiftedParentWindowRgn )
        return;
      ::CopyRgn(parent->mWindowRegion, shiftedParentWindowRgn); 
      ::OffsetRgn(shiftedParentWindowRgn, origin.x, origin.y);
      ::SectRgn(mWindowRegion, shiftedParentWindowRgn, mWindowRegion);
    }
              origin.x -= parent->mBounds.x;
              origin.y -= parent->mBounds.y;
              parent = (nsWindow*)parent->mParent;
              }
       }

       //------
       // calculate the visible region
       if (mVisRegion == nsnull)
       {
              mVisRegion = ::NewRgn();
              if (mVisRegion == nsnull)
                     return;
       }
       ::CopyRgn(mWindowRegion, mVisRegion);

       // clip the children out of the visRegion
       if (mFirstChild)
       {
              StRegionFromPool childRgn;
              if (childRgn != nsnull) {
                     nsIWidget* child = mFirstChild;
                     do
                     {
                            nsWindow* childWindow = NS_STATIC_CAST(nsWindow*, child);
                                   
                            PRBool visible;
                            childWindow->IsVisible(visible);
                            if (visible) {
                                   nsRect childRect;
                                   childWindow->GetBounds(childRect);

                                   Rect macRect;
                                   ::SetRect(&macRect, childRect.x, childRect.y, childRect.XMost(), childRect.YMost());
                                   ::RectRgn(childRgn, &macRect);
                                   ::DiffRgn(mVisRegion, childRgn, mVisRegion);
                            }
                            
                            child = child->GetNextSibling();
                     } while (child);
              }
       }
}

Here is the call graph for this function:

Here is the caller graph for this function:

BOOL nsWindow::CallMethod ( MethodInfo info) [virtual]

Implements nsSwitchToUIThread.

Definition at line 1853 of file nsWindow.cpp.

{
       bool bRet = TRUE;

       switch (info->methodId)
       {
       case nsSwitchToUIThread::CREATE:
              NS_ASSERTION(info->nArgs == 7, "Wrong number of arguments to CallMethod");
              Create((nsIWidget*)(info->args[0]),
                     (nsRect&)*(nsRect*)(info->args[1]),
                     (EVENT_CALLBACK)(info->args[2]),
                     (nsIDeviceContext*)(info->args[3]),
                     (nsIAppShell *)(info->args[4]),
                     (nsIToolkit*)(info->args[5]),
                     (nsWidgetInitData*)(info->args[6]));
              break;

       case nsSwitchToUIThread::CREATE_NATIVE:
              NS_ASSERTION(info->nArgs == 7, "Wrong number of arguments to CallMethod");
              Create((nsNativeWidget)(info->args[0]),
                     (nsRect&)*(nsRect*)(info->args[1]),
                     (EVENT_CALLBACK)(info->args[2]),
                     (nsIDeviceContext*)(info->args[3]),
                     (nsIAppShell *)(info->args[4]),
                     (nsIToolkit*)(info->args[5]),
                     (nsWidgetInitData*)(info->args[6]));
              break;

       case nsSwitchToUIThread::DESTROY:
              NS_ASSERTION(info->nArgs == 0, "Wrong number of arguments to CallMethod");
              Destroy();
              break;

       case nsSwitchToUIThread::CLOSEWINDOW :
              {
                     NS_ASSERTION(info->nArgs == 0, "Wrong number of arguments to CallMethod");
                     if (eWindowType_popup != mWindowType && eWindowType_child != mWindowType)
                            DealWithPopups(nsSwitchToUIThread::CLOSEWINDOW,nsPoint(0,0));
                            for (nsIWidget* kid = mFirstChild; kid; kid = kid->GetNextSibling()) 
                            {
                                   nsWindow *childWidget = NS_STATIC_CAST(nsWindow*, kid);
                                   BWindow* kidwindow = (BWindow *)kid->GetNativeData(NS_NATIVE_WINDOW);
                                   if (kidwindow)
                                   {
                                          // PostMessage() is unsafe, so using BMessenger
                                          BMessenger bm(kidwindow);
                                          bm.SendMessage(B_QUIT_REQUESTED);
                                   }
                            }
                     DispatchStandardEvent(NS_DESTROY);
              }
              break;

       case nsSwitchToUIThread::SET_FOCUS:
              NS_ASSERTION(info->nArgs == 1, "Wrong number of arguments to CallMethod");
              if (!mEnabled)
                     return false;
              SetFocus(((PRBool *)info->args)[0]);
              break;

#ifdef DEBUG_FOCUS
       case nsSwitchToUIThread::GOT_FOCUS:
              NS_ASSERTION(info->nArgs == 1, "Wrong number of arguments to CallMethod");
              if (!mEnabled)
                     return false;
              if ((uint32)info->args[0] != (uint32)mView)
                     printf("Wrong view to get focus\n");*/
              break;
#endif
       case nsSwitchToUIThread::KILL_FOCUS:
              NS_ASSERTION(info->nArgs == 1, "Wrong number of arguments to CallMethod");
              if ((uint32)info->args[0] == (uint32)mView)
                     DispatchFocus(NS_LOSTFOCUS);
#ifdef DEBUG_FOCUS
              else
                     printf("Wrong view to de-focus\n");
#endif
#if defined(BeIME)
              nsIMEBeOS::GetIME()->DispatchCancelIME();
              if (mView && mView->LockLooper())
              {
                     mView->SetFlags(mView->Flags() & ~B_NAVIGABLE);
                     mView->UnlockLooper();
              }
#endif
              break;

       case nsSwitchToUIThread::BTNCLICK :
              {
                     NS_ASSERTION(info->nArgs == 5, "Wrong number of arguments to CallMethod");
                     if (!mEnabled)
                            return false;
                     // close popup when clicked outside of the popup window
                     uint32 eventID = ((int32 *)info->args)[0];
                     PRBool rollup = PR_FALSE;

                     if ((eventID == NS_MOUSE_LEFT_BUTTON_DOWN ||
                             eventID == NS_MOUSE_RIGHT_BUTTON_DOWN ||
                             eventID == NS_MOUSE_MIDDLE_BUTTON_DOWN) &&
                             mView && mView->LockLooper())
                     {
                            BPoint p(((int32 *)info->args)[1], ((int32 *)info->args)[2]);
                            mView->ConvertToScreen(&p);
                            rollup = DealWithPopups(nsSwitchToUIThread::ONMOUSE, nsPoint(p.x, p.y));
                            mView->UnlockLooper();
                     }
                     // Drop click event - bug 314330
                     if (rollup)
                            return false;
                     DispatchMouseEvent(((int32 *)info->args)[0],
                                        nsPoint(((int32 *)info->args)[1], ((int32 *)info->args)[2]),
                                        ((int32 *)info->args)[3],
                                        ((int32 *)info->args)[4]);

                     if (((int32 *)info->args)[0] == NS_MOUSE_RIGHT_BUTTON_DOWN)
                     {
                            DispatchMouseEvent (NS_CONTEXTMENU,
                                                nsPoint(((int32 *)info->args)[1], ((int32 *)info->args)[2]),
                                                ((int32 *)info->args)[3],
                                                ((int32 *)info->args)[4]);
                     }
              }
              break;

       case nsSwitchToUIThread::ONWHEEL :
              {
                     NS_ASSERTION(info->nArgs == 1, "Wrong number of arguments to CallMethod");
                     // avoid mistargeting
                     if ((uint32)info->args[0] != (uint32)mView)
                            return false;
                     BPoint cursor(0,0);
                     uint32 buttons;
                     BPoint delta;
                     if (mView && mView->LockLooper())
                     {
                            mView->GetMouse(&cursor, &buttons, false);
                            delta = mView->GetWheel();
                            mView->UnlockLooper();
                     }
                     else
                            return false;
                     // BeOS TwoWheel input-filter is bit buggy atm, generating sometimes X-wheel with no reason,
                     // so we're setting priority for Y-wheel.
                     // Also hardcoding here _system_ scroll-step value to 3 lines.
                     if (nscoord(delta.y) != 0)
                     {
                            OnWheel(nsMouseScrollEvent::kIsVertical, buttons, cursor, nscoord(delta.y)*3);
                     }
                     else if(nscoord(delta.x) != 0)
                            OnWheel(nsMouseScrollEvent::kIsHorizontal, buttons, cursor, nscoord(delta.x)*3);
              }
              break;

       case nsSwitchToUIThread::ONKEY :
              NS_ASSERTION(info->nArgs == 6, "Wrong number of arguments to CallMethod");
              if (((int32 *)info->args)[0] == NS_KEY_DOWN)
              {
                     OnKeyDown(((int32 *)info->args)[0],
                               (const char *)(&((uint32 *)info->args)[1]), ((int32 *)info->args)[2],
                               ((uint32 *)info->args)[3], ((uint32 *)info->args)[4], ((int32 *)info->args)[5]);
              }
              else
              {
                     if (((int32 *)info->args)[0] == NS_KEY_UP)
                     {
                            OnKeyUp(((int32 *)info->args)[0],
                                    (const char *)(&((uint32 *)info->args)[1]), ((int32 *)info->args)[2],
                                    ((uint32 *)info->args)[3], ((uint32 *)info->args)[4], ((int32 *)info->args)[5]);
                     }
              }
              break;

       case nsSwitchToUIThread::ONPAINT :
              NS_ASSERTION(info->nArgs == 1, "Wrong number of arguments to CallMethod");
              {
                     if ((uint32)mView != ((uint32 *)info->args)[0])
                            return false;
                     BRegion reg;
                     reg.MakeEmpty();
                     if(mView && mView->LockLooper())
                     {
                            bool nonempty = mView->GetPaintRegion(&reg);
                            mView->UnlockLooper();
                            if (nonempty)
                                   OnPaint(&reg);
                     }
              }
              break;

       case nsSwitchToUIThread::ONRESIZE :
              {
                     NS_ASSERTION(info->nArgs == 0, "Wrong number of arguments to CallMethod");
                     if (eWindowType_popup != mWindowType && eWindowType_child != mWindowType)
                            DealWithPopups(nsSwitchToUIThread::ONRESIZE,nsPoint(0,0));
                     // This should be called only from BWindow::FrameResized()
                     if (!mIsTopWidgetWindow  || !mView  || !mView->Window())
                            return false;
                     
                     nsRect r(mBounds);
                     if (mView->LockLooper())
                     {
                            BRect br = mView->Frame();
                            r.x = nscoord(br.left);
                            r.y = nscoord(br.top);
                            r.width  = br.IntegerWidth() + 1;
                            r.height = br.IntegerHeight() + 1;
                            ((nsWindowBeOS *)mView->Window())->fJustGotBounds = true;
                            mView->UnlockLooper();
                     }

                     OnResize(r);
              }
              break;

       case nsSwitchToUIThread::ONMOUSE :
              {
              NS_ASSERTION(info->nArgs == 1, "Wrong number of arguments to CallMethod");
                     if (!mEnabled)
                            return false;
                     BPoint cursor(0,0);
                     uint32 buttons;
                     
                     if(mView && mView->LockLooper())
                     {
                            mView->GetMouse(&cursor, &buttons, true);
                            mView->UnlockLooper();
                     }

                     DispatchMouseEvent(((int32 *)info->args)[0],
                                        nsPoint(int32(cursor.x), int32(cursor.y)),
                                        0,
                                    modifiers());
              }
              break;

       case nsSwitchToUIThread::ONDROP :
              {
                     NS_ASSERTION(info->nArgs == 4, "Wrong number of arguments to CallMethod");

                     nsMouseEvent event(PR_TRUE, (int32)  info->args[0], this, nsMouseEvent::eReal);
                     nsPoint point(((int32 *)info->args)[1], ((int32 *)info->args)[2]);
                     InitEvent (event, &point);
                     uint32 mod = (uint32) info->args[3];
                     event.isShift   = mod & B_SHIFT_KEY;
                     event.isControl = mod & B_CONTROL_KEY;
                     event.isAlt     = mod & B_COMMAND_KEY;
                     event.isMeta     = mod & B_OPTION_KEY;

                     // Setting drag action, must be done before event dispatch
                     nsCOMPtr<nsIDragService> dragService = do_GetService(kCDragServiceCID);
                     if (dragService)
                     {
                            nsCOMPtr<nsIDragSession> dragSession;
                            dragService->GetCurrentSession(getter_AddRefs(dragSession));
                            if (dragSession)
                            {
                                   // Original action mask stored in dragsession.
                                   // For native events such mask must be set in nsDragServiceBeOS::UpdateDragMessageIfNeeded()
       
                                   PRUint32 action_mask = 0;
                                   dragSession->GetDragAction(&action_mask);
                                   PRUint32 action = nsIDragService::DRAGDROP_ACTION_MOVE;
                                   if (mod & B_OPTION_KEY)
                                   {
                                          if (mod & B_COMMAND_KEY)
                                                 action = nsIDragService::DRAGDROP_ACTION_LINK & action_mask;
                                          else
                                                 action = nsIDragService::DRAGDROP_ACTION_COPY & action_mask;
                                   }
                                   dragSession->SetDragAction(action);
                            }
                     }

                     DispatchWindowEvent(&event);
                     NS_RELEASE(event.widget);

                     if (dragService)
                            dragService->EndDragSession();

              }
              break;

       case nsSwitchToUIThread::ONACTIVATE:
              NS_ASSERTION(info->nArgs == 2, "Wrong number of arguments to CallMethod");
              if (!mEnabled || eWindowType_popup == mWindowType || 0 == mView->Window())
                     return false;
              if ((BWindow *)info->args[1] != mView->Window())
                     return false;
              if (mEventCallback || eWindowType_child == mWindowType )
              {
                     bool active = (bool)info->args[0];
                     if (!active) 
                     {
                            if (eWindowType_dialog == mWindowType || 
                                eWindowType_toplevel == mWindowType)
                                   DealWithPopups(nsSwitchToUIThread::ONACTIVATE,nsPoint(0,0));
                            //Testing if BWindow is really deactivated.
                            if (!mView->Window()->IsActive())
                            {
                                   // BeOS is poor in windows hierarchy and variations support. In lot of aspects.
                                   // Here is workaround for flacky Activate() handling for B_FLOATING windows.
                                   // We should force parent (de)activation to allow main window to regain control after closing floating dialog.
                                   if (mWindowParent &&  mView->Window()->IsFloating())
                                          mWindowParent->DispatchFocus(NS_ACTIVATE);

                                   DispatchFocus(NS_DEACTIVATE);
#if defined(BeIME)
                                   nsIMEBeOS::GetIME()->DispatchCancelIME();
#endif
                            }
                     } 
                     else 
                     {

                            if (mView->Window()->IsActive())
                            {
                                   // See comment above.
                                   if (mWindowParent &&  mView->Window()->IsFloating())
                                          mWindowParent->DispatchFocus(NS_DEACTIVATE);
                                   
                                   DispatchFocus(NS_ACTIVATE);
                                   if (mView && mView->Window())
                                          gLastActiveWindow = mView->Window();
                            }
                     }
              }
              break;

       case nsSwitchToUIThread::ONMOVE:
              {
                     NS_ASSERTION(info->nArgs == 0, "Wrong number of arguments to CallMethod");
                     nsRect r;
                     // We use this only for tracking whole window moves
                     GetScreenBounds(r);         
                     if (eWindowType_popup != mWindowType && eWindowType_child != mWindowType)
                            DealWithPopups(nsSwitchToUIThread::ONMOVE,nsPoint(0,0));
                     OnMove(r.x, r.y);
              }
              break;
              
       case nsSwitchToUIThread::ONWORKSPACE:
              {
                     NS_ASSERTION(info->nArgs == 2, "Wrong number of arguments to CallMethod");
                     if (eWindowType_popup != mWindowType && eWindowType_child != mWindowType)
                            DealWithPopups(nsSwitchToUIThread::ONWORKSPACE,nsPoint(0,0));
              }
              break;

#if defined(BeIME)
       case nsSwitchToUIThread::ONIME:
              //No assertion used, as number of arguments varies here
              if (mView && mView->LockLooper())
              {
                     mView->SetFlags(mView->Flags() | B_NAVIGABLE);
                     mView->UnlockLooper();
              }
              nsIMEBeOS::GetIME()->RunIME(info->args, this, mView);
              break;
#endif
              default:
                     bRet = FALSE;
                     break;
              
       }

       return bRet;
}

Here is the call graph for this function:

virtual BOOL nsWindow::CallMethod ( MethodInfo info) [virtual]

Implements nsSwitchToUIThread.

virtual BOOL nsWindow::CallMethod ( MethodInfo info) [virtual]

Implements nsSwitchToUIThread.

Implements nsIKBStateControl.

Definition at line 2400 of file nsWindow.cpp.

Implements nsIKBStateControl.

PRBool nsWindow::CanTakeFocus ( ) [protected]

Definition at line 1930 of file nsWindow.cpp.

{
#ifndef WINCE
  gWindowsVisible = PR_FALSE;
  EnumWindows(gEnumWindowsProc, 0);
  if (!gWindowsVisible) {
    return PR_TRUE;
  } else {
    HWND fgWnd = ::GetForegroundWindow();
    if (!fgWnd) {
      return PR_TRUE;
    }
    DWORD pid;
    GetWindowThreadProcessId(fgWnd, &pid);
    if (pid == _getpid()) {
      return PR_TRUE;
    }
  }
  return PR_FALSE;
#else
  return PR_TRUE;
#endif
}

Here is the call graph for this function:

NS_IMETHOD nsWindow::CaptureMouse ( PRBool  aCapture) [virtual]

Enables/Disables system mouse capture.

Parameters:
aCapturePR_TRUE enables mouse capture, PR_FALSE disables mouse capture

Reimplemented from nsWidget.

NS_METHOD nsWindow::CaptureMouse ( PRBool  aCapture) [virtual]

Enables/Disables system mouse capture.

Parameters:
aCapturePR_TRUE enables mouse capture, PR_FALSE disables mouse capture

Reimplemented from nsWidget.

Definition at line 897 of file nsWindow.cpp.

{
       if (mView && mView->LockLooper())
       {
              if (PR_TRUE == aCapture)
                     mView->SetEventMask(B_POINTER_EVENTS);
              else
                     mView->SetEventMask(0);
              mView->UnlockLooper();
       }
       return NS_OK;
}

Here is the caller graph for this function:

NS_IMETHOD nsWindow::CaptureMouse ( PRBool  aCapture) [virtual]

Enables/Disables system mouse capture.

Parameters:
aCapturePR_TRUE enables mouse capture, PR_FALSE disables mouse capture

Reimplemented from nsWidget.

NS_IMETHOD nsWindow::CaptureMouse ( PRBool  aCapture) [virtual]

Enables/Disables system mouse capture.

Parameters:
aCapturePR_TRUE enables mouse capture, PR_FALSE disables mouse capture

Reimplemented from nsWidget.

NS_IMETHOD nsWindow::CaptureMouse ( PRBool  aCapture) [virtual]

Enables/Disables system mouse capture.

Parameters:
aCapturePR_TRUE enables mouse capture, PR_FALSE disables mouse capture

Reimplemented from nsWidget.

NS_IMETHOD nsWindow::CaptureRollupEvents ( nsIRollupListener aListener,
PRBool  aDoCapture,
PRBool  aConsumeRollupEvent 
) [virtual]

Enables/Disables system capture of any and all events that would cause a dropdown to be rolled up, This method ignores the aConsumeRollupEvent parameter when aDoCapture is FALSE.

Parameters:
aDoCapturePR_TRUE enables capture, PR_FALSE disables capture
aConsumeRollupEventPR_TRUE consumes the rollup event, PR_FALSE dispatches rollup event

Reimplemented from nsWidget.

NS_IMETHOD nsWindow::CaptureRollupEvents ( nsIRollupListener aListener,
PRBool  aDoCapture,
PRBool  aConsumeRollupEvent 
) [virtual]

Enables/Disables system capture of any and all events that would cause a dropdown to be rolled up, This method ignores the aConsumeRollupEvent parameter when aDoCapture is FALSE.

Parameters:
aDoCapturePR_TRUE enables capture, PR_FALSE disables capture
aConsumeRollupEventPR_TRUE consumes the rollup event, PR_FALSE dispatches rollup event

Reimplemented from nsWidget.

NS_IMETHOD nsWindow::CaptureRollupEvents ( nsIRollupListener aListener,
PRBool  aDoCapture,
PRBool  aConsumeRollupEvent 
) [virtual]

Enables/Disables system capture of any and all events that would cause a dropdown to be rolled up, This method ignores the aConsumeRollupEvent parameter when aDoCapture is FALSE.

Parameters:
aDoCapturePR_TRUE enables capture, PR_FALSE disables capture
aConsumeRollupEventPR_TRUE consumes the rollup event, PR_FALSE dispatches rollup event

Reimplemented from nsWidget.

NS_IMETHODIMP nsWindow::CaptureRollupEvents ( nsIRollupListener aListener,
PRBool  aDoCapture,
PRBool  aConsumeRollupEvent 
) [virtual]

Enables/Disables system capture of any and all events that would cause a dropdown to be rolled up, This method ignores the aConsumeRollupEvent parameter when aDoCapture is FALSE.

Parameters:
aDoCapturePR_TRUE enables capture, PR_FALSE disables capture
aConsumeRollupEventPR_TRUE consumes the rollup event, PR_FALSE dispatches rollup event

Reimplemented from nsWidget.

Definition at line 912 of file nsWindow.cpp.

{
       if (!mEnabled)
              return NS_OK;
              
       if (aDoCapture) 
       {
              // we haven't bothered carrying a weak reference to gRollupWidget because
              // we believe lifespan is properly scoped. this next assertion helps 
              // assure that remains true.
              NS_ASSERTION(!gRollupWidget, "rollup widget reassigned before release");
              gRollupConsumeRollupEvent = aConsumeRollupEvent;
              NS_IF_RELEASE(gRollupListener);
              NS_IF_RELEASE(gRollupWidget);
              gRollupListener = aListener;
              NS_ADDREF(aListener);
              gRollupWidget = this;
              NS_ADDREF(this);
       } 
       else 
       {
              NS_IF_RELEASE(gRollupListener);
              NS_IF_RELEASE(gRollupWidget);
       }

       return NS_OK;
}

Here is the call graph for this function:

NS_IMETHOD nsWindow::CaptureRollupEvents ( nsIRollupListener aListener,
PRBool  aDoCapture,
PRBool  aConsumeRollupEvent 
) [virtual]

Enables/Disables system capture of any and all events that would cause a dropdown to be rolled up, This method ignores the aConsumeRollupEvent parameter when aDoCapture is FALSE.

Parameters:
aDoCapturePR_TRUE enables capture, PR_FALSE disables capture
aConsumeRollupEventPR_TRUE consumes the rollup event, PR_FALSE dispatches rollup event

Reimplemented from nsWidget.

NS_IMETHOD nsWindow::CaptureRollupEvents ( nsIRollupListener aListener,
PRBool  aDoCapture,
PRBool  aConsumeRollupEvent 
) [virtual]

Enables/Disables system capture of any and all events that would cause a dropdown to be rolled up, This method ignores the aConsumeRollupEvent parameter when aDoCapture is FALSE.

Parameters:
aDoCapturePR_TRUE enables capture, PR_FALSE disables capture
aConsumeRollupEventPR_TRUE consumes the rollup event, PR_FALSE dispatches rollup event

Reimplemented from nsWidget.

NS_IMETHOD nsWindow::CaptureRollupEvents ( nsIRollupListener aListener,
PRBool  aDoCapture,
PRBool  aConsumeRollupEvent 
) [virtual]

Enables/Disables system capture of any and all events that would cause a dropdown to be rolled up, This method ignores the aConsumeRollupEvent parameter when aDoCapture is FALSE.

Parameters:
aDoCapturePR_TRUE enables capture, PR_FALSE disables capture
aConsumeRollupEventPR_TRUE consumes the rollup event, PR_FALSE dispatches rollup event

Reimplemented from nsWidget.

NS_IMETHOD nsWindow::CaptureRollupEvents ( nsIRollupListener aListener,
PRBool  aDoCapture,
PRBool  aConsumeRollupEvent 
) [virtual]

Enables/Disables system capture of any and all events that would cause a dropdown to be rolled up, This method ignores the aConsumeRollupEvent parameter when aDoCapture is FALSE.

Parameters:
aDoCapturePR_TRUE enables capture, PR_FALSE disables capture
aConsumeRollupEventPR_TRUE consumes the rollup event, PR_FALSE dispatches rollup event

Reimplemented from nsWidget.

PRBool nsWindow::CheckDragStatus ( PRUint32  aAction,
HPS *  oHps 
) [protected]

Definition at line 3970 of file nsWindow.cpp.

{
  PRBool rtn    = PR_TRUE;
  PRBool getHps = PR_FALSE;

  switch (aAction) {

      // OnPaint() & Scroll..() - only Moz drags get a Drg hps
    case ACTION_PAINT:
    case ACTION_SCROLL:
      if (gDragStatus & DND_MozDrag)
        getHps = PR_TRUE;
      break;

      // GetNativeData() - Moz drags + native drags over this nsWindow
    case ACTION_DRAW:
      if ((gDragStatus & DND_MozDrag) ||
          (mDragStatus & DND_NativeDrag))
        getHps = PR_TRUE;
      break;

      // Show() - don't show popups during a native dragover
    case ACTION_SHOW:
      if ((gDragStatus & (DND_NativeDrag | DND_InDrop)) == DND_NativeDrag)
        rtn = PR_FALSE;
      break;

      // InitEvent() - use PtrPos while in drag, MsgPos otherwise
    case ACTION_PTRPOS:
      if (!gDragStatus)
        rtn = PR_FALSE;
      break;

    default:
      rtn = PR_FALSE;
  }

    // if the caller wants an HPS, and the current drag status
    // calls for one, *and* a drag hps hasn't already been requested
    // for this window, get the hps;  otherwise, return zero;
    // (if we provide a 2nd hps for a window, the cursor in text
    // fields won't be erased when it's moved to another position)
  if (oHps)
    if (getHps && !mDragHps) {
      mDragHps = DrgGetPS(mWnd);
      *oHps = mDragHps;
    }
    else
      *oHps = 0;

  return rtn;
}

Here is the caller graph for this function:

void * nsWidget::CheckParent ( long  ThisWindow) [inherited]

Definition at line 208 of file nsWidget.cpp.

{
  return (void*)-1;
}

Definition at line 4434 of file nsWindow.cpp.

{
  IconEntry* entry = NS_STATIC_CAST(IconEntry*, aHdr);
  if (entry->w_pixmap) {
    gdk_pixmap_unref(entry->w_pixmap);
    gdk_bitmap_unref(entry->w_mask);
  }
  if (entry->w_minipixmap) {
    gdk_pixmap_unref(entry->w_minipixmap);
    gdk_bitmap_unref(entry->w_minimask);
  }
  if (entry->string)
    free((void*) entry->string);
  PL_DHashClearEntryStub(aTable, aHdr);
}

Here is the call graph for this function:

gint nsWindow::ClientEventSignal ( GtkWidget *  widget,
GdkEventClient *  event,
void data 
) [static, protected]

Definition at line 3631 of file nsWindow.cpp.

{
  static GdkAtom atom_rcfiles = GDK_NONE;
  if (!atom_rcfiles)
    atom_rcfiles = gdk_atom_intern("_GTK_READ_RCFILES", FALSE);

  if (event->message_type == atom_rcfiles) {
    nsWidget* targetWindow = (nsWidget*) data;
    targetWindow->ThemeChanged();
  }

  return FALSE;
}

Here is the call graph for this function:

Here is the caller graph for this function:

bool nsCommonWidget::closeEvent ( QCloseEvent *  ) [protected, virtual, inherited]

Definition at line 1195 of file nsCommonWidget.cpp.

{
    nsGUIEvent event(PR_TRUE, NS_XUL_CLOSE, this);

    event.point.x = 0;
    event.point.y = 0;

    nsEventStatus status;
    DispatchEvent(&event, status);

    return ignoreEvent(status);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void nsWindow::CombineRects ( TRectArray inRectArray) [protected]

Definition at line 1515 of file nsWindow.cpp.

{
  const float kCombineThresholdRatio = 0.50;      // 50%
  
  // We assume the rects are sorted left to right below, so sort 'em.
  SortRectsLeftToRight ( rectArray );
  
  // Here's basically what we're doing:
  //
  // compute the area of X and X+1
  // compute area of the bounding rect (topLeft of X and bottomRight of X+1)
  // if ( ratio of combined areas to bounding box is > 50% )
  //   make bottomRight of X be bottomRight of X+1
  //   delete X+1 from array and don't advance X, 
  //    otherwise move along to X+1
  
  PRUint32 i = 0;
  while (i < rectArray.mNumRects - 1) {
    Rect* curr = &rectArray.mRectList[i];
    Rect* next = &rectArray.mRectList[i+1];
  
    // compute areas of current and next rects
    int currArea = (curr->right - curr->left) * (curr->bottom - curr->top);
    int nextArea = (next->right - next->left) * (next->bottom - next->top);

    // compute the bounding box and its area
    Rect boundingBox;
    ::UnionRect ( curr, next, &boundingBox );
    int boundingRectArea = (boundingBox.right - boundingBox.left) * 
                              (boundingBox.bottom - boundingBox.top);
    
    // determine if we should combine the rects, based on if the ratio of the
    // combined areas to the bounding rect's area is above some threshold.
    if ( (currArea + nextArea) / (float)boundingRectArea > kCombineThresholdRatio ) {
      // we're combining, so combine the rects, delete the next rect (i+1), remove it from
      // the array, and _don't_ advance to the next rect.
      
      // make the current rectangle the bounding box and shift everything from 
      // i+2 over.
      *curr = boundingBox;
      for (PRUint32 j = i + 1 ; j < rectArray.mNumRects - 1 ; ++j)
        rectArray.mRectList[j] = rectArray.mRectList[j+1];
      --rectArray.mNumRects;
      
    } // if we should combine
    else
      ++i;
  } // foreach rect
  
} // CombineRects

Here is the call graph for this function:

Here is the caller graph for this function:

void nsCommonWidget::CommonCreate ( nsIWidget aParent,
PRBool  aListenForResizes 
) [inherited]

Definition at line 73 of file nsCommonWidget.cpp.

{
    mParent = aParent;
    mListenForResizes = aListenForResizes;
    mCreated = PR_TRUE;
}

Here is the caller graph for this function:

void nsCommonWidget::CommonCreate ( nsIWidget aParent,
PRBool  aListenForResizes 
) [protected, inherited]
NS_IMETHOD nsWindow::ConstrainPosition ( PRBool  aAllowSlop,
PRInt32 aX,
PRInt32 aY 
) [virtual]

Perform platform-dependent sanity check on a potential window position.

This is guaranteed to work only for top-level windows.

Parameters:
aAllowSlop,:if true, allow the window to slop offscreen; the window should be partially visible. if false, force the entire window onscreen (or at least the upper-left corner, if it's too large).
aXin: an x position expressed in screen coordinates. out: the x position constrained to fit on the screen(s).
aYin: an y position expressed in screen coordinates. out: the y position constrained to fit on the screen(s).
Returns:
vapid success indication. but see also the parameters.

Reimplemented from nsWidget.

Reimplemented in nsMacWindow.

NS_IMETHOD nsWindow::ConstrainPosition ( PRBool  aAllowSlop,
PRInt32 aX,
PRInt32 aY 
) [virtual]

Perform platform-dependent sanity check on a potential window position.

This is guaranteed to work only for top-level windows.

Parameters:
aAllowSlop,:if true, allow the window to slop offscreen; the window should be partially visible. if false, force the entire window onscreen (or at least the upper-left corner, if it's too large).
aXin: an x position expressed in screen coordinates. out: the x position constrained to fit on the screen(s).
aYin: an y position expressed in screen coordinates. out: the y position constrained to fit on the screen(s).
Returns:
vapid success indication. but see also the parameters.

Reimplemented from nsWidget.

Reimplemented in nsMacWindow.

NS_IMETHOD nsWindow::ConstrainPosition ( PRBool  aAllowSlop,
PRInt32 aX,
PRInt32 aY 
) [virtual]

Perform platform-dependent sanity check on a potential window position.

This is guaranteed to work only for top-level windows.

Parameters:
aAllowSlop,:if true, allow the window to slop offscreen; the window should be partially visible. if false, force the entire window onscreen (or at least the upper-left corner, if it's too large).
aXin: an x position expressed in screen coordinates. out: the x position constrained to fit on the screen(s).
aYin: an y position expressed in screen coordinates. out: the y position constrained to fit on the screen(s).
Returns:
vapid success indication. but see also the parameters.

Reimplemented from nsWidget.

Reimplemented in nsMacWindow.

NS_METHOD nsWindow::ConstrainPosition ( PRBool  aAllowSlop,
PRInt32 aX,
PRInt32 aY 
) [virtual]

Perform platform-dependent sanity check on a potential window position.

This is guaranteed to work only for top-level windows.

Parameters:
aAllowSlop,:if true, allow the window to slop offscreen; the window should be partially visible. if false, force the entire window onscreen (or at least the upper-left corner, if it's too large).
aXin: an x position expressed in screen coordinates. out: the x position constrained to fit on the screen(s).
aYin: an y position expressed in screen coordinates. out: the y position constrained to fit on the screen(s).
Returns:
vapid success indication. but see also the parameters.

Reimplemented from nsWidget.

Reimplemented in nsMacWindow.

Definition at line 1042 of file nsWindow.cpp.

{
       if (mIsTopWidgetWindow && mView->Window()) 
       {
              BScreen screen;
              // If no valid screen, just return
              if (! screen.IsValid()) return NS_OK;
              
              BRect screen_rect = screen.Frame();
              BRect win_bounds = mView->Window()->Frame();

#ifdef DEBUG_CONSTRAIN_POSITION
              printf("ConstrainPosition: allowSlop=%s, x=%d, y=%d\n\tScreen :", (aAllowSlop?"T":"F"),*aX,*aY);
              screen_rect.PrintToStream();
              printf("\tWindow: ");
              win_bounds.PrintToStream();
#endif
              
              if (aAllowSlop) 
              {
                     if (*aX < kWindowPositionSlop - win_bounds.IntegerWidth() + kWindowBorderWidth)
                            *aX = kWindowPositionSlop - win_bounds.IntegerWidth() + kWindowBorderWidth;
                     else if (*aX > screen_rect.IntegerWidth() - kWindowPositionSlop - kWindowBorderWidth)
                            *aX = screen_rect.IntegerWidth() - kWindowPositionSlop - kWindowBorderWidth;
                            
                     if (*aY < kWindowPositionSlop - win_bounds.IntegerHeight() + kWindowTitleBarHeight)
                            *aY = kWindowPositionSlop - win_bounds.IntegerHeight() + kWindowTitleBarHeight;
                     else if (*aY > screen_rect.IntegerHeight() - kWindowPositionSlop - kWindowBorderWidth)
                            *aY = screen_rect.IntegerHeight() - kWindowPositionSlop - kWindowBorderWidth;
                            
              } 
              else 
              {
                     
                     if (*aX < kWindowBorderWidth)
                            *aX = kWindowBorderWidth;
                     else if (*aX > screen_rect.IntegerWidth() - win_bounds.IntegerWidth() - kWindowBorderWidth)
                            *aX = screen_rect.IntegerWidth() - win_bounds.IntegerWidth() - kWindowBorderWidth;
                            
                     if (*aY < kWindowTitleBarHeight)
                            *aY = kWindowTitleBarHeight;
                     else if (*aY > screen_rect.IntegerHeight() - win_bounds.IntegerHeight() - kWindowBorderWidth)
                            *aY = screen_rect.IntegerHeight() - win_bounds.IntegerHeight() - kWindowBorderWidth;
              }
       }
       return NS_OK;
}
NS_IMETHOD nsWindow::ConstrainPosition ( PRBool  aAllowSlop,
PRInt32 aX,
PRInt32 aY 
) [virtual]

Perform platform-dependent sanity check on a potential window position.

This is guaranteed to work only for top-level windows.

Parameters:
aAllowSlop,:if true, allow the window to slop offscreen; the window should be partially visible. if false, force the entire window onscreen (or at least the upper-left corner, if it's too large).
aXin: an x position expressed in screen coordinates. out: the x position constrained to fit on the screen(s).
aYin: an y position expressed in screen coordinates. out: the y position constrained to fit on the screen(s).
Returns:
vapid success indication. but see also the parameters.

Reimplemented from nsWidget.

Reimplemented in nsMacWindow.

NS_IMETHOD nsWindow::ConstrainPosition ( PRBool  aAllowSlop,
PRInt32 aX,
PRInt32 aY 
) [virtual]

Perform platform-dependent sanity check on a potential window position.

This is guaranteed to work only for top-level windows.

Parameters:
aAllowSlop,:if true, allow the window to slop offscreen; the window should be partially visible. if false, force the entire window onscreen (or at least the upper-left corner, if it's too large).
aXin: an x position expressed in screen coordinates. out: the x position constrained to fit on the screen(s).
aYin: an y position expressed in screen coordinates. out: the y position constrained to fit on the screen(s).
Returns:
vapid success indication. but see also the parameters.

Reimplemented from nsWidget.

Reimplemented in nsMacWindow.

void nsWindow::ConstrainZLevel ( HWND aAfter) [protected]

Definition at line 2639 of file nsWindow.cpp.

                                           {

  nsZLevelEvent  event(PR_TRUE, NS_SETZLEVEL, this);
  nsWindow      *aboveWindow = 0;

  InitEvent(event);

  if (*aAfter == HWND_BOTTOM)
    event.mPlacement = nsWindowZBottom;
  else if (*aAfter == HWND_TOP)
    event.mPlacement = nsWindowZTop;
  else {
    event.mPlacement = nsWindowZRelative;
    aboveWindow = GetNSWindowPtr(*aAfter);
  }
  event.mReqBelow = aboveWindow;
  event.mActualBelow = nsnull;

  event.mImmediate = PR_FALSE;
  event.mAdjusted = PR_FALSE;
  DispatchWindowEvent(&event);

  if (event.mAdjusted) {
    if (event.mPlacement == nsWindowZBottom)
      *aAfter = HWND_BOTTOM;
    else if (event.mPlacement == nsWindowZTop)
      *aAfter = HWND_TOP;
    else {
      *aAfter = (HWND)event.mActualBelow->GetNativeData(NS_NATIVE_WINDOW);
      /* If we have a client window, use the frame */
      if (WinQueryWindowUShort(*aAfter, QWS_ID) == FID_CLIENT) {
        *aAfter = WinQueryWindow(*aAfter, QW_PARENT);
      }
    }
  }
  NS_IF_RELEASE(event.mActualBelow);
  NS_RELEASE(event.widget);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void nsWindow::ConstrainZLevel ( HWND aAfter) [protected]

Definition at line 2028 of file nsWindow.cpp.

{
  nsCOMPtr<nsIWidget> theParent = dont_AddRef(GetParent());
  
  while (theParent)
  {
    PRBool  visible;
    theParent->IsVisible(visible);
    if (!visible)
      return PR_FALSE;
    
    nsIWidget* grandparent = theParent->GetParent();
    theParent = dont_AddRef(grandparent);
  }
  
  return PR_TRUE;
}

Here is the call graph for this function:

Here is the caller graph for this function:

bool nsCommonWidget::contextMenuEvent ( QContextMenuEvent *  ) [protected, virtual, inherited]

Definition at line 1209 of file nsCommonWidget.cpp.

{
    //qDebug("context menu");
    return false;
}

Here is the caller graph for this function:

Definition at line 1844 of file nsWindow.cpp.

{
  gint w = 0;

  if (bs == eBorderStyle_default)
    return -1;

  if (bs & eBorderStyle_all)
    w |= GDK_DECOR_ALL;
  if (bs & eBorderStyle_border)
    w |= GDK_DECOR_BORDER;
  if (bs & eBorderStyle_resizeh)
    w |= GDK_DECOR_RESIZEH;
  if (bs & eBorderStyle_title)
    w |= GDK_DECOR_TITLE;
  if (bs & eBorderStyle_menu)
    w |= GDK_DECOR_MENU;
  if (bs & eBorderStyle_minimize)
    w |= GDK_DECOR_MINIMIZE;
  if (bs & eBorderStyle_maximize)
    w |= GDK_DECOR_MAXIMIZE;
  if (bs & eBorderStyle_close) {
#ifdef DEBUG
    printf("we don't handle eBorderStyle_close yet... please fix me\n");
#endif /* DEBUG */
  }

  return w;
}

Here is the caller graph for this function:

static PRBool nsWindow::ConvertStatus ( nsEventStatus  aStatus) [static]

Reimplemented from nsWidget.

PRBool nsWindow::ConvertStatus ( nsEventStatus  aStatus) [static, protected]

Reimplemented from nsWidget.

Definition at line 382 of file nsWindow.cpp.

{
       switch(aStatus) 
       {
              case nsEventStatus_eIgnore:
                     return PR_FALSE;
              case nsEventStatus_eConsumeNoDefault:
                     return PR_TRUE;
              case nsEventStatus_eConsumeDoDefault:
                     return PR_FALSE;
              default:
                     NS_ASSERTION(0, "Illegal nsEventStatus enumeration value");
                     break;
       }
       return PR_FALSE;
}

Here is the caller graph for this function:

PRBool nsWindow::ConvertStatus ( nsEventStatus  aStatus) [protected]

Reimplemented from nsWidget.

static PRBool nsWindow::ConvertStatus ( nsEventStatus  aStatus) [static, protected]

Reimplemented from nsWidget.

virtual void nsWindow::ConvertToDeviceCoordinates ( nscoord aX,
nscoord aY 
) [virtual]

Reimplemented from nsWidget.

void nsWindow::ConvertToDeviceCoordinates ( nscoord aX,
nscoord aY 
) [inline, virtual]

Reimplemented from nsWidget.

Definition at line 174 of file nsWindow.h.

{}

Here is the caller graph for this function:

virtual void nsWindow::ConvertToDeviceCoordinates ( nscoord aX,
nscoord aY 
) [virtual]

Reimplemented from nsWidget.

virtual void nsWindow::ConvertToDeviceCoordinates ( nscoord aX,
nscoord aY 
) [inline, virtual]

Reimplemented from nsWidget.

Definition at line 376 of file nsWindow.h.

{}
NS_DECL_ISUPPORTS_INHERITED NS_IMETHOD nsWindow::Create ( nsIWidget aParent,
const nsRect aRect,
EVENT_CALLBACK  aHandleEventFunction,
nsIDeviceContext aContext,
nsIAppShell aAppShell,
nsIToolkit aToolkit,
nsWidgetInitData aInitData 
) [virtual]

Create and initialize a widget.

The widget represents a window that can be drawn into. It also is the base class for user-interface widgets such as buttons and text boxes.

All the arguments can be NULL in which case a top level window with size 0 is created. The event callback function has to be provided only if the caller wants to deal with the events this widget receives. The event callback is basically a preprocess hook called synchronously. The return value determines whether the event goes to the default window procedure or it is hidden to the os. The assumption is that if the event handler returns false the widget does not see the event. The widget should not automatically clear the window to the background color. The calling code must handle paint messages and clear the background itself.

aInitData cannot be eWindowType_popup here; popups cannot be hooked into the nsIWidget hierarchy.

Parameters:
parentor null if it's a top level window
aRectthe widget dimension
aHandleEventFunctionthe event handler callback function
aContext
aAppShellthe parent application shell. If nsnull, the parent window's application shell will be used.
aToolkit
aInitDatadata that is used for widget initialization

Reimplemented from nsWidget.

Reimplemented in nsMacControl.

NS_IMETHOD nsWindow::Create ( nsNativeWidget  aParent,
const nsRect aRect,
EVENT_CALLBACK  aHandleEventFunction,
nsIDeviceContext aContext,
nsIAppShell aAppShell,
nsIToolkit aToolkit,
nsWidgetInitData aInitData 
) [virtual]

Create and initialize a widget with a native window parent.

The widget represents a window that can be drawn into. It also is the base class for user-interface widgets such as buttons and text boxes.

All the arguments can be NULL in which case a top level window with size 0 is created. The event callback function has to be provided only if the caller wants to deal with the events this widget receives. The event callback is basically a preprocess hook called synchronously. The return value determines whether the event goes to the default window procedure or it is hidden to the os. The assumption is that if the event handler returns false the widget does not see the event.

Parameters:
aParentnative window.
aRectthe widget dimension
aHandleEventFunctionthe event handler callback function

Reimplemented from nsWidget.

Reimplemented in nsMacWindow.

NS_METHOD nsWindow::Create ( nsIWidget aParent,
const nsRect aRect,
EVENT_CALLBACK  aHandleEventFunction,
nsIDeviceContext aContext,
nsIAppShell aAppShell = nsnull,
nsIToolkit aToolkit = nsnull,
nsWidgetInitData aInitData = nsnull 
) [virtual]

Create and initialize a widget.

The widget represents a window that can be drawn into. It also is the base class for user-interface widgets such as buttons and text boxes.

All the arguments can be NULL in which case a top level window with size 0 is created. The event callback function has to be provided only if the caller wants to deal with the events this widget receives. The event callback is basically a preprocess hook called synchronously. The return value determines whether the event goes to the default window procedure or it is hidden to the os. The assumption is that if the event handler returns false the widget does not see the event. The widget should not automatically clear the window to the background color. The calling code must handle paint messages and clear the background itself.

aInitData cannot be eWindowType_popup here; popups cannot be hooked into the nsIWidget hierarchy.

Parameters:
parentor null if it's a top level window
aRectthe widget dimension
aHandleEventFunctionthe event handler callback function
aContext
aAppShellthe parent application shell. If nsnull, the parent window's application shell will be used.
aToolkit
aInitDatadata that is used for widget initialization

Reimplemented from nsWidget.

Reimplemented in nsMacControl.

Definition at line 690 of file nsWindow.cpp.

{
       return(StandardWindowCreate(aParent, aRect, aHandleEventFunction,
                                   aContext, aAppShell, aToolkit, aInitData,
                                   nsnull));
}

Here is the call graph for this function:

Here is the caller graph for this function:

NS_DECL_ISUPPORTS_INHERITED NS_IMETHOD nsWindow::Create ( nsIWidget aParent,
const nsRect aRect,
EVENT_CALLBACK  aHandleEventFunction,
nsIDeviceContext aContext,
nsIAppShell aAppShell = nsnull,
nsIToolkit aToolkit = nsnull,
nsWidgetInitData aInitData = nsnull 
) [virtual]

Create and initialize a widget.

The widget represents a window that can be drawn into. It also is the base class for user-interface widgets such as buttons and text boxes.

All the arguments can be NULL in which case a top level window with size 0 is created. The event callback function has to be provided only if the caller wants to deal with the events this widget receives. The event callback is basically a preprocess hook called synchronously. The return value determines whether the event goes to the default window procedure or it is hidden to the os. The assumption is that if the event handler returns false the widget does not see the event. The widget should not automatically clear the window to the background color. The calling code must handle paint messages and clear the background itself.

aInitData cannot be eWindowType_popup here; popups cannot be hooked into the nsIWidget hierarchy.

Parameters:
parentor null if it's a top level window
aRectthe widget dimension
aHandleEventFunctionthe event handler callback function
aContext
aAppShellthe parent application shell. If nsnull, the parent window's application shell will be used.
aToolkit
aInitDatadata that is used for widget initialization

Reimplemented from nsWidget.

Reimplemented in nsMacControl.

NS_METHOD nsWindow::Create ( nsNativeWidget  aParent,
const nsRect aRect,
EVENT_CALLBACK  aHandleEventFunction,
nsIDeviceContext aContext,
nsIAppShell aAppShell = nsnull,
nsIToolkit aToolkit = nsnull,
nsWidgetInitData aInitData = nsnull 
) [virtual]

Create and initialize a widget with a native window parent.

The widget represents a window that can be drawn into. It also is the base class for user-interface widgets such as buttons and text boxes.

All the arguments can be NULL in which case a top level window with size 0 is created. The event callback function has to be provided only if the caller wants to deal with the events this widget receives. The event callback is basically a preprocess hook called synchronously. The return value determines whether the event goes to the default window procedure or it is hidden to the os. The assumption is that if the event handler returns false the widget does not see the event.

Parameters:
aParentnative window.
aRectthe widget dimension
aHandleEventFunctionthe event handler callback function

Reimplemented from nsWidget.

Reimplemented in nsMacWindow.

Definition at line 710 of file nsWindow.cpp.

{
       return(StandardWindowCreate(nsnull, aRect, aHandleEventFunction,
                                   aContext, aAppShell, aToolkit, aInitData,
                                   aParent));
}

Here is the call graph for this function:

NS_IMETHOD nsWindow::Create ( nsNativeWidget  aParent,
const nsRect aRect,
EVENT_CALLBACK  aHandleEventFunction,
nsIDeviceContext aContext,
nsIAppShell aAppShell = nsnull,
nsIToolkit aToolkit = nsnull,
nsWidgetInitData aInitData = nsnull 
) [virtual]

Create and initialize a widget with a native window parent.

The widget represents a window that can be drawn into. It also is the base class for user-interface widgets such as buttons and text boxes.

All the arguments can be NULL in which case a top level window with size 0 is created. The event callback function has to be provided only if the caller wants to deal with the events this widget receives. The event callback is basically a preprocess hook called synchronously. The return value determines whether the event goes to the default window procedure or it is hidden to the os. The assumption is that if the event handler returns false the widget does not see the event.

Parameters:
aParentnative window.
aRectthe widget dimension
aHandleEventFunctionthe event handler callback function

Reimplemented from nsWidget.

Reimplemented in nsMacWindow.

NS_IMETHOD nsWindow::Create ( nsIWidget aParent,
const nsRect aRect,
EVENT_CALLBACK  aHandleEventFunction,
nsIDeviceContext aContext,
nsIAppShell aAppShell = nsnull,
nsIToolkit aToolkit = nsnull,
nsWidgetInitData aInitData = nsnull 
) [virtual]

Create and initialize a widget.

The widget represents a window that can be drawn into. It also is the base class for user-interface widgets such as buttons and text boxes.

All the arguments can be NULL in which case a top level window with size 0 is created. The event callback function has to be provided only if the caller wants to deal with the events this widget receives. The event callback is basically a preprocess hook called synchronously. The return value determines whether the event goes to the default window procedure or it is hidden to the os. The assumption is that if the event handler returns false the widget does not see the event. The widget should not automatically clear the window to the background color. The calling code must handle paint messages and clear the background itself.

aInitData cannot be eWindowType_popup here; popups cannot be hooked into the nsIWidget hierarchy.

Parameters:
parentor null if it's a top level window
aRectthe widget dimension
aHandleEventFunctionthe event handler callback function
aContext
aAppShellthe parent application shell. If nsnull, the parent window's application shell will be used.
aToolkit
aInitDatadata that is used for widget initialization

Reimplemented from nsWidget.

Reimplemented in nsMacControl.