no bug - Bumping Firefox l10n changesets r=release a=l10n-bump DONTBUILD CLOSED TREE
[gecko.git] / widget / InitData.h
blobaed5e0a55135c832d29992caddc0f820c9c92dcf
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 appears on top of other windows, including those of other
41 // applications.
42 Top,
45 // Border styles
46 enum class BorderStyle : int16_t {
47 None = 0, // no border, titlebar, etc.. opposite of all
48 All = 1 << 0, // all window decorations
49 Border = 1 << 1, // enables the border on the window. these
50 // are only for decoration and are not
51 // resize handles
52 ResizeH = 1 << 2, // enables the resize handles for the
53 // window. if this is set, border is
54 // implied to also be set
55 Title = 1 << 3, // enables the titlebar for the window
56 Menu = 1 << 4, // enables the window menu button on the
57 // title bar. this being on should force
58 // the title bar to display
59 Minimize = 1 << 5, // enables the minimize button so the user
60 // can minimize the window. turned off for
61 // tranient windows since they can not be
62 // minimized separate from their parent
63 Maximize = 1 << 6, // enables the maxmize button so the user
64 // can maximize the window
65 Close = 1 << 7, // show the close button
66 Default = -1 // whatever the OS wants... i.e. don't do anything
69 MOZ_MAKE_ENUM_CLASS_BITWISE_OPERATORS(BorderStyle)
71 enum class TransparencyMode : uint8_t {
72 Opaque = 0, // Fully opaque
73 Transparent, // Parts of the window may be transparent
74 // If you add to the end here, you must update the serialization code in
75 // WidgetMessageUtils.h
78 // Basic struct for widget initialization data.
79 // @see Create member function of nsIWidget
80 struct InitData {
81 WindowType mWindowType = WindowType::Child;
82 BorderStyle mBorderStyle = BorderStyle::Default;
83 PopupType mPopupHint = PopupType::Panel;
84 PopupLevel mPopupLevel = PopupLevel::Top;
85 TransparencyMode mTransparencyMode = TransparencyMode::Opaque;
86 // when painting exclude area occupied by child windows and sibling windows
87 bool mClipChildren = false;
88 bool mClipSiblings = false;
89 bool mRTL = false;
90 bool mNoAutoHide = false; // true for noautohide panels
91 bool mIsDragPopup = false; // true for drag feedback panels
92 // true if window creation animation is suppressed, e.g. for session restore
93 bool mIsAnimationSuppressed = false;
94 // true if the window should support an alpha channel, if available.
95 bool mHasRemoteContent = false;
96 bool mAlwaysOnTop = false;
97 // Whether we're a PictureInPicture window
98 bool mPIPWindow = false;
99 // True if the window is user-resizable.
100 bool mResizable = false;
101 bool mIsPrivate = false;
102 // True if the window is an alert / notification.
103 bool mIsAlert = false;
106 } // namespace mozilla::widget
108 #endif // mozilla_widget_InitData