1 /* -*- Mode: C++; tab-width: 40; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 #ifndef nsWidgetInitData_h__
7 #define nsWidgetInitData_h__
12 * Don't alter previously encoded enum values - 3rd party apps may look at
16 eWindowType_toplevel
, // default top level window
17 eWindowType_dialog
, // top level window but usually handled differently
19 eWindowType_popup
, // used for combo boxes, etc
20 eWindowType_child
, // child windows (contained inside a window on the
21 // desktop (has no border))
22 eWindowType_invisible
, // windows that are invisible or offscreen
23 eWindowType_plugin
, // plugin window
24 eWindowType_sheet
// MacOSX sheet (special dialog class)
30 * For eWindowType_popup
36 ePopupTypeAny
= 0xF000 // used only to pass to
37 // nsXULPopupManager::GetTopPopup
41 * Popup levels specify the window ordering behaviour.
44 // the popup appears just above its parent and maintains its position
45 // relative to the parent
47 // the popup is a floating popup used for tool palettes. A parent window
48 // must be specified, but a platform implementation need not use this.
49 // On Windows, floating is generally equivalent to parent. On Mac, floating
50 // puts the popup at toplevel, but it will hide when the application is deactivated
52 // the popup appears on top of other windows, including those of other applications
60 eBorderStyle_none
= 0, // no border, titlebar, etc.. opposite of
62 eBorderStyle_all
= 1 << 0, // all window decorations
63 eBorderStyle_border
= 1 << 1, // enables the border on the window. these
64 // are only for decoration and are not
66 eBorderStyle_resizeh
= 1 << 2, // enables the resize handles for the
67 // window. if this is set, border is
68 // implied to also be set
69 eBorderStyle_title
= 1 << 3, // enables the titlebar for the window
70 eBorderStyle_menu
= 1 << 4, // enables the window menu button on the
71 // title bar. this being on should force
72 // the title bar to display
73 eBorderStyle_minimize
= 1 << 5, // enables the minimize button so the user
74 // can minimize the window. turned off for
75 // tranient windows since they can not be
76 // minimized separate from their parent
77 eBorderStyle_maximize
= 1 << 6, // enables the maxmize button so the user
78 // can maximize the window
79 eBorderStyle_close
= 1 << 7, // show the close button
80 eBorderStyle_default
= -1 // whatever the OS wants... i.e. don't do
85 * Basic struct for widget initialization data.
86 * @see Create member function of nsIWidget
89 struct nsWidgetInitData
{
91 mWindowType(eWindowType_child
),
92 mBorderStyle(eBorderStyle_default
),
93 mPopupHint(ePopupTypePanel
),
94 mPopupLevel(ePopupLevelTop
),
98 mListenForResizes(false),
103 mIsAnimationSuppressed(false),
104 mSupportTranslucency(false)
108 nsWindowType mWindowType
;
109 nsBorderStyle mBorderStyle
;
110 nsPopupType mPopupHint
;
111 nsPopupLevel mPopupLevel
;
112 // when painting exclude area occupied by child windows and sibling windows
113 bool clipChildren
, clipSiblings
, mDropShadow
;
114 bool mListenForResizes
;
117 bool mNoAutoHide
; // true for noautohide panels
118 bool mIsDragPopup
; // true for drag feedback panels
119 // true if window creation animation is suppressed, e.g. for session restore
120 bool mIsAnimationSuppressed
;
121 // true if the window should support an alpha channel, if available.
122 bool mSupportTranslucency
;
125 #endif // nsWidgetInitData_h__