Bug 1887677: Correctly compute inClass predicate when validating unbound private...
[gecko.git] / widget / InitData.h
bloba0733620658e8395624bccc04d11a3ad7140a494
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 mozilla_widget_InitData_h__
7 #define mozilla_widget_InitData_h__
9 #include <cstdint>
10 #include "mozilla/TypedEnumBits.h"
11 #include "X11UndefineNone.h"
13 namespace mozilla::widget {
15 // Window types
16 enum class WindowType : uint8_t {
17 TopLevel, // default top level window
18 Dialog, // top level window but usually handled differently
19 // by the OS
20 Popup, // used for combo boxes, etc
21 Child, // child windows (contained inside a window on the
22 // desktop (has no border))
23 Invisible, // windows that are invisible or offscreen
26 // Popup types for WindowType::Popup
27 enum class PopupType : uint8_t {
28 Panel,
29 Menu,
30 Tooltip,
31 Any, // used only to pass to nsXULPopupManager::GetTopPopup
34 // Popup levels specify the window ordering behaviour.
35 enum class PopupLevel : uint8_t {
36 // The popup appears just above its parent and maintains its position
37 // relative to the parent.
38 Parent,
39 // The popup appears on top of other windows, including those of other
40 // applications.
41 Top,
44 // Border styles
45 enum class BorderStyle : int16_t {
46 None = 0, // no border, titlebar, etc.. opposite of all
47 All = 1 << 0, // all window decorations
48 Border = 1 << 1, // enables the border on the window. these
49 // are only for decoration and are not
50 // resize handles
51 ResizeH = 1 << 2, // enables the resize handles for the
52 // window. if this is set, border is
53 // implied to also be set
54 Title = 1 << 3, // enables the titlebar for the window
55 Menu = 1 << 4, // enables the window menu button on the
56 // title bar. this being on should force
57 // the title bar to display
58 Minimize = 1 << 5, // enables the minimize button so the user
59 // can minimize the window. turned off for
60 // tranient windows since they can not be
61 // minimized separate from their parent
62 Maximize = 1 << 6, // enables the maxmize button so the user
63 // can maximize the window
64 Close = 1 << 7, // show the close button
65 Default = -1 // whatever the OS wants... i.e. don't do anything
68 MOZ_MAKE_ENUM_CLASS_BITWISE_OPERATORS(BorderStyle)
70 enum class TransparencyMode : uint8_t {
71 Opaque = 0, // Fully opaque
72 Transparent, // Parts of the window may be transparent
73 // If you add to the end here, you must update the serialization code in
74 // WidgetMessageUtils.h
77 // Basic struct for widget initialization data.
78 // @see Create member function of nsIWidget
79 struct InitData {
80 WindowType mWindowType = WindowType::Child;
81 BorderStyle mBorderStyle = BorderStyle::Default;
82 PopupType mPopupHint = PopupType::Panel;
83 PopupLevel mPopupLevel = PopupLevel::Top;
84 TransparencyMode mTransparencyMode = TransparencyMode::Opaque;
85 // when painting exclude area occupied by child windows and sibling windows
86 bool mClipChildren = false;
87 bool mClipSiblings = false;
88 bool mRTL = false;
89 bool mNoAutoHide = false; // true for noautohide panels
90 bool mIsDragPopup = false; // true for drag feedback panels
91 // true if window creation animation is suppressed, e.g. for session restore
92 bool mIsAnimationSuppressed = false;
93 // true if the window should support an alpha channel, if available.
94 bool mHasRemoteContent = false;
95 bool mAlwaysOnTop = false;
96 // Whether we're a PictureInPicture window
97 bool mPIPWindow = false;
98 // True if the window is user-resizable.
99 bool mResizable = false;
100 bool mIsPrivate = false;
101 // True if the window is an alert / notification.
102 bool mIsAlert = false;
105 } // namespace mozilla::widget
107 #endif // mozilla_widget_InitData