Backed out 3 changesets (bug 1854025) for causing build bustages.
[gecko.git] / widget / InitData.h
blob0249ea47e5cfd7729f31beb0c752722564923b21
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 Sheet, // MacOSX sheet (special dialog class)
21 Popup, // used for combo boxes, etc
22 Child, // child windows (contained inside a window on the
23 // desktop (has no border))
24 Invisible, // windows that are invisible or offscreen
27 // Popup types for WindowType::Popup
28 enum class PopupType : uint8_t {
29 Panel,
30 Menu,
31 Tooltip,
32 Any, // used only to pass to nsXULPopupManager::GetTopPopup
35 // Popup levels specify the window ordering behaviour.
36 enum class PopupLevel : uint8_t {
37 // The popup appears just above its parent and maintains its position
38 // relative to the parent.
39 Parent,
40 // The popup is a floating popup used for tool palettes. A parent window must
41 // be specified, but a platform implementation need not use this. On Windows,
42 // floating is generally equivalent to parent. On Mac, floating puts the
43 // popup at toplevel, but it will hide when the application is deactivated.
44 Floating,
45 // The popup appears on top of other windows, including those of other
46 // applications.
47 Top,
50 // Border styles
51 enum class BorderStyle : int16_t {
52 None = 0, // no border, titlebar, etc.. opposite of all
53 All = 1 << 0, // all window decorations
54 Border = 1 << 1, // enables the border on the window. these
55 // are only for decoration and are not
56 // resize handles
57 ResizeH = 1 << 2, // enables the resize handles for the
58 // window. if this is set, border is
59 // implied to also be set
60 Title = 1 << 3, // enables the titlebar for the window
61 Menu = 1 << 4, // enables the window menu button on the
62 // title bar. this being on should force
63 // the title bar to display
64 Minimize = 1 << 5, // enables the minimize button so the user
65 // can minimize the window. turned off for
66 // tranient windows since they can not be
67 // minimized separate from their parent
68 Maximize = 1 << 6, // enables the maxmize button so the user
69 // can maximize the window
70 Close = 1 << 7, // show the close button
71 Default = -1 // whatever the OS wants... i.e. don't do anything
74 MOZ_MAKE_ENUM_CLASS_BITWISE_OPERATORS(BorderStyle)
76 enum class TransparencyMode : uint8_t {
77 Opaque = 0, // Fully opaque
78 Transparent, // Parts of the window may be transparent
79 // If you add to the end here, you must update the serialization code in
80 // WidgetMessageUtils.h
83 // Basic struct for widget initialization data.
84 // @see Create member function of nsIWidget
85 struct InitData {
86 WindowType mWindowType = WindowType::Child;
87 BorderStyle mBorderStyle = BorderStyle::Default;
88 PopupType mPopupHint = PopupType::Panel;
89 PopupLevel mPopupLevel = PopupLevel::Top;
90 TransparencyMode mTransparencyMode = TransparencyMode::Opaque;
91 // when painting exclude area occupied by child windows and sibling windows
92 bool mClipChildren = false;
93 bool mClipSiblings = false;
94 bool mForMenupopupFrame = false;
95 bool mRTL = false;
96 bool mNoAutoHide = false; // true for noautohide panels
97 bool mIsDragPopup = false; // true for drag feedback panels
98 // true if window creation animation is suppressed, e.g. for session restore
99 bool mIsAnimationSuppressed = false;
100 // true if the window should support an alpha channel, if available.
101 bool mHasRemoteContent = false;
102 bool mAlwaysOnTop = false;
103 // Is PictureInPicture window
104 bool mPIPWindow = false;
105 // True if the window is user-resizable.
106 bool mResizable = false;
107 bool mIsPrivate = false;
110 } // namespace mozilla::widget
112 #endif // mozilla_widget_InitData