|
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/. */ |
|
5 |
|
6 #ifndef nsWidgetInitData_h__ |
|
7 #define nsWidgetInitData_h__ |
|
8 |
|
9 /** |
|
10 * Window types |
|
11 * |
|
12 * Don't alter previously encoded enum values - 3rd party apps may look at |
|
13 * these. |
|
14 */ |
|
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_popup, // used for combo boxes, etc |
|
20 eWindowType_child, // child windows (contained inside a window on the |
|
21 // desktop (has no border)) |
|
22 eWindowType_invisible, // windows that are invisible or offscreen |
|
23 eWindowType_plugin, // plugin window |
|
24 eWindowType_sheet // MacOSX sheet (special dialog class) |
|
25 }; |
|
26 |
|
27 /** |
|
28 * Popup types |
|
29 * |
|
30 * For eWindowType_popup |
|
31 */ |
|
32 enum nsPopupType { |
|
33 ePopupTypePanel, |
|
34 ePopupTypeMenu, |
|
35 ePopupTypeTooltip, |
|
36 ePopupTypeAny = 0xF000 // used only to pass to |
|
37 // nsXULPopupManager::GetTopPopup |
|
38 }; |
|
39 |
|
40 /** |
|
41 * Popup levels specify the window ordering behaviour. |
|
42 */ |
|
43 enum nsPopupLevel { |
|
44 // the popup appears just above its parent and maintains its position |
|
45 // relative to the parent |
|
46 ePopupLevelParent, |
|
47 // the popup is a floating popup used for tool palettes. A parent window |
|
48 // must be specified, but a platform implementation need not use this. |
|
49 // On Windows, floating is generally equivalent to parent. On Mac, floating |
|
50 // puts the popup at toplevel, but it will hide when the application is deactivated |
|
51 ePopupLevelFloating, |
|
52 // the popup appears on top of other windows, including those of other applications |
|
53 ePopupLevelTop |
|
54 }; |
|
55 |
|
56 /** |
|
57 * Border styles |
|
58 */ |
|
59 enum nsBorderStyle { |
|
60 eBorderStyle_none = 0, // no border, titlebar, etc.. opposite of |
|
61 // all |
|
62 eBorderStyle_all = 1 << 0, // all window decorations |
|
63 eBorderStyle_border = 1 << 1, // enables the border on the window. these |
|
64 // are only for decoration and are not |
|
65 // resize handles |
|
66 eBorderStyle_resizeh = 1 << 2, // enables the resize handles for the |
|
67 // window. if this is set, border is |
|
68 // implied to also be set |
|
69 eBorderStyle_title = 1 << 3, // enables the titlebar for the window |
|
70 eBorderStyle_menu = 1 << 4, // enables the window menu button on the |
|
71 // title bar. this being on should force |
|
72 // the title bar to display |
|
73 eBorderStyle_minimize = 1 << 5, // enables the minimize button so the user |
|
74 // can minimize the window. turned off for |
|
75 // tranient windows since they can not be |
|
76 // minimized separate from their parent |
|
77 eBorderStyle_maximize = 1 << 6, // enables the maxmize button so the user |
|
78 // can maximize the window |
|
79 eBorderStyle_close = 1 << 7, // show the close button |
|
80 eBorderStyle_default = -1 // whatever the OS wants... i.e. don't do |
|
81 // anything |
|
82 }; |
|
83 |
|
84 /** |
|
85 * Basic struct for widget initialization data. |
|
86 * @see Create member function of nsIWidget |
|
87 */ |
|
88 |
|
89 struct nsWidgetInitData { |
|
90 nsWidgetInitData() : |
|
91 mWindowType(eWindowType_child), |
|
92 mBorderStyle(eBorderStyle_default), |
|
93 mPopupHint(ePopupTypePanel), |
|
94 mPopupLevel(ePopupLevelTop), |
|
95 clipChildren(false), |
|
96 clipSiblings(false), |
|
97 mDropShadow(false), |
|
98 mListenForResizes(false), |
|
99 mUnicode(true), |
|
100 mRTL(false), |
|
101 mNoAutoHide(false), |
|
102 mIsDragPopup(false), |
|
103 mIsAnimationSuppressed(false), |
|
104 mSupportTranslucency(false), |
|
105 mMouseTransparent(false), |
|
106 mRequireOffMainThreadCompositing(false) |
|
107 { |
|
108 } |
|
109 |
|
110 nsWindowType mWindowType; |
|
111 nsBorderStyle mBorderStyle; |
|
112 nsPopupType mPopupHint; |
|
113 nsPopupLevel mPopupLevel; |
|
114 // when painting exclude area occupied by child windows and sibling windows |
|
115 bool clipChildren, clipSiblings, mDropShadow; |
|
116 bool mListenForResizes; |
|
117 bool mUnicode; |
|
118 bool mRTL; |
|
119 bool mNoAutoHide; // true for noautohide panels |
|
120 bool mIsDragPopup; // true for drag feedback panels |
|
121 // true if window creation animation is suppressed, e.g. for session restore |
|
122 bool mIsAnimationSuppressed; |
|
123 // true if the window should support an alpha channel, if available. |
|
124 bool mSupportTranslucency; |
|
125 // true if the window should be transparent to mouse events. Currently this is |
|
126 // only valid for eWindowType_popup widgets |
|
127 bool mMouseTransparent; |
|
128 // Windows with out-of-process tabs always require OMTC. This flag designates |
|
129 // such windows. |
|
130 bool mRequireOffMainThreadCompositing; |
|
131 }; |
|
132 |
|
133 #endif // nsWidgetInitData_h__ |