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__
10 #include "mozilla/TypedEnumBits.h"
11 #include "X11UndefineNone.h"
13 namespace mozilla::widget
{
16 enum class WindowType
: uint8_t {
17 TopLevel
, // default top level window
18 Dialog
, // top level window but usually handled differently
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 {
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.
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.
45 // The popup appears on top of other windows, including those of other
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
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 BorderlessGlass
, // Transparent parts of the window has windows 7
80 // glass effect, without a border around opaque
82 // If you add to the end here, you must update the serialization code in
83 // WidgetMessageUtils.h
86 // Basic struct for widget initialization data.
87 // @see Create member function of nsIWidget
89 WindowType mWindowType
= WindowType::Child
;
90 BorderStyle mBorderStyle
= BorderStyle::Default
;
91 PopupType mPopupHint
= PopupType::Panel
;
92 PopupLevel mPopupLevel
= PopupLevel::Top
;
93 TransparencyMode mTransparencyMode
= TransparencyMode::Opaque
;
94 // when painting exclude area occupied by child windows and sibling windows
95 bool mClipChildren
= false;
96 bool mClipSiblings
= false;
97 bool mForMenupopupFrame
= false;
99 bool mNoAutoHide
= false; // true for noautohide panels
100 bool mIsDragPopup
= false; // true for drag feedback panels
101 // true if window creation animation is suppressed, e.g. for session restore
102 bool mIsAnimationSuppressed
= false;
103 // true if the window should support an alpha channel, if available.
104 bool mHasRemoteContent
= false;
105 bool mAlwaysOnTop
= false;
106 // Is PictureInPicture window
107 bool mPIPWindow
= false;
108 // True if the window is user-resizable.
109 bool mResizable
= false;
110 bool mIsPrivate
= false;
113 } // namespace mozilla::widget
115 #endif // mozilla_widget_InitData