Bug 1769547 - Do not MOZ_CRASH() on missing process r=nika
[gecko.git] / widget / nsWidgetInitData.h
blob6d2280c0f45ae1db5f52d3158ca168015bb2158c
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__
9 /**
10 * Window types
12 * Don't alter previously encoded enum values - 3rd party apps may look at
13 * these.
15 enum nsWindowType {
16 eWindowType_toplevel, // default top level window
17 eWindowType_dialog, // top level window but usually handled differently
18 // by the OS
19 eWindowType_sheet, // MacOSX sheet (special dialog class)
20 eWindowType_popup, // used for combo boxes, etc
21 eWindowType_child, // child windows (contained inside a window on the
22 // desktop (has no border))
23 eWindowType_invisible, // windows that are invisible or offscreen
26 /**
27 * Popup types
29 * For eWindowType_popup
31 enum nsPopupType {
32 ePopupTypePanel,
33 ePopupTypeMenu,
34 ePopupTypeTooltip,
35 ePopupTypeAny = 0xF000 // used only to pass to
36 // nsXULPopupManager::GetTopPopup
39 /**
40 * Popup levels specify the window ordering behaviour.
42 enum nsPopupLevel {
43 // the popup appears just above its parent and maintains its position
44 // relative to the parent
45 ePopupLevelParent,
46 // the popup is a floating popup used for tool palettes. A parent window
47 // must be specified, but a platform implementation need not use this.
48 // On Windows, floating is generally equivalent to parent. On Mac, floating
49 // puts the popup at toplevel, but it will hide when the application is
50 // deactivated
51 ePopupLevelFloating,
52 // the popup appears on top of other windows, including those of other
53 // applications
54 ePopupLevelTop
57 /**
58 * Border styles
60 enum nsBorderStyle {
61 eBorderStyle_none = 0, // no border, titlebar, etc.. opposite of
62 // all
63 eBorderStyle_all = 1 << 0, // all window decorations
64 eBorderStyle_border = 1 << 1, // enables the border on the window. these
65 // are only for decoration and are not
66 // resize handles
67 eBorderStyle_resizeh = 1 << 2, // enables the resize handles for the
68 // window. if this is set, border is
69 // implied to also be set
70 eBorderStyle_title = 1 << 3, // enables the titlebar for the window
71 eBorderStyle_menu = 1 << 4, // enables the window menu button on the
72 // title bar. this being on should force
73 // the title bar to display
74 eBorderStyle_minimize = 1 << 5, // enables the minimize button so the user
75 // can minimize the window. turned off for
76 // tranient windows since they can not be
77 // minimized separate from their parent
78 eBorderStyle_maximize = 1 << 6, // enables the maxmize button so the user
79 // can maximize the window
80 eBorderStyle_close = 1 << 7, // show the close button
81 eBorderStyle_default = -1 // whatever the OS wants... i.e. don't do
82 // anything
85 /**
86 * Basic struct for widget initialization data.
87 * @see Create member function of nsIWidget
90 struct nsWidgetInitData {
91 nsWidgetInitData()
92 : mWindowType(eWindowType_child),
93 mBorderStyle(eBorderStyle_default),
94 mPopupHint(ePopupTypePanel),
95 mPopupLevel(ePopupLevelTop),
96 mScreenId(0),
97 clipChildren(false),
98 clipSiblings(false),
99 mDropShadow(false),
100 mRTL(false),
101 mNoAutoHide(false),
102 mIsDragPopup(false),
103 mIsAnimationSuppressed(false),
104 mSupportTranslucency(false),
105 mMouseTransparent(false),
106 mHasRemoteContent(false),
107 mAlwaysOnTop(false),
108 mPIPWindow(false),
109 mFissionWindow(false),
110 mResizable(false),
111 mIsPrivate(false) {}
113 nsWindowType mWindowType;
114 nsBorderStyle mBorderStyle;
115 nsPopupType mPopupHint;
116 nsPopupLevel mPopupLevel;
117 // B2G multi-screen support. Screen ID is for differentiating screens of
118 // windows, and due to the hardware limitation, it is platform-specific for
119 // now, which align with the value of display type defined in HWC.
120 uint32_t mScreenId;
121 // when painting exclude area occupied by child windows and sibling windows
122 bool clipChildren, clipSiblings, mDropShadow;
123 bool mRTL;
124 bool mNoAutoHide; // true for noautohide panels
125 bool mIsDragPopup; // true for drag feedback panels
126 // true if window creation animation is suppressed, e.g. for session restore
127 bool mIsAnimationSuppressed;
128 // true if the window should support an alpha channel, if available.
129 bool mSupportTranslucency;
130 // true if the window should be transparent to mouse events. Currently this is
131 // only valid for eWindowType_popup widgets
132 bool mMouseTransparent;
133 bool mHasRemoteContent;
134 bool mAlwaysOnTop;
135 // Is PictureInPicture window
136 bool mPIPWindow;
137 // True if fission is enabled for this window
138 bool mFissionWindow;
139 // True if the window is user-resizable.
140 bool mResizable;
141 bool mIsPrivate;
144 #endif // nsWidgetInitData_h__