1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/widget/nsWidgetInitData.h Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,133 @@ 1.4 +/* -*- Mode: C++; tab-width: 40; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public 1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.8 + 1.9 +#ifndef nsWidgetInitData_h__ 1.10 +#define nsWidgetInitData_h__ 1.11 + 1.12 +/** 1.13 + * Window types 1.14 + * 1.15 + * Don't alter previously encoded enum values - 3rd party apps may look at 1.16 + * these. 1.17 + */ 1.18 +enum nsWindowType { 1.19 + eWindowType_toplevel, // default top level window 1.20 + eWindowType_dialog, // top level window but usually handled differently 1.21 + // by the OS 1.22 + eWindowType_popup, // used for combo boxes, etc 1.23 + eWindowType_child, // child windows (contained inside a window on the 1.24 + // desktop (has no border)) 1.25 + eWindowType_invisible, // windows that are invisible or offscreen 1.26 + eWindowType_plugin, // plugin window 1.27 + eWindowType_sheet // MacOSX sheet (special dialog class) 1.28 +}; 1.29 + 1.30 +/** 1.31 + * Popup types 1.32 + * 1.33 + * For eWindowType_popup 1.34 + */ 1.35 +enum nsPopupType { 1.36 + ePopupTypePanel, 1.37 + ePopupTypeMenu, 1.38 + ePopupTypeTooltip, 1.39 + ePopupTypeAny = 0xF000 // used only to pass to 1.40 + // nsXULPopupManager::GetTopPopup 1.41 +}; 1.42 + 1.43 +/** 1.44 + * Popup levels specify the window ordering behaviour. 1.45 + */ 1.46 +enum nsPopupLevel { 1.47 + // the popup appears just above its parent and maintains its position 1.48 + // relative to the parent 1.49 + ePopupLevelParent, 1.50 + // the popup is a floating popup used for tool palettes. A parent window 1.51 + // must be specified, but a platform implementation need not use this. 1.52 + // On Windows, floating is generally equivalent to parent. On Mac, floating 1.53 + // puts the popup at toplevel, but it will hide when the application is deactivated 1.54 + ePopupLevelFloating, 1.55 + // the popup appears on top of other windows, including those of other applications 1.56 + ePopupLevelTop 1.57 +}; 1.58 + 1.59 +/** 1.60 + * Border styles 1.61 + */ 1.62 +enum nsBorderStyle { 1.63 + eBorderStyle_none = 0, // no border, titlebar, etc.. opposite of 1.64 + // all 1.65 + eBorderStyle_all = 1 << 0, // all window decorations 1.66 + eBorderStyle_border = 1 << 1, // enables the border on the window. these 1.67 + // are only for decoration and are not 1.68 + // resize handles 1.69 + eBorderStyle_resizeh = 1 << 2, // enables the resize handles for the 1.70 + // window. if this is set, border is 1.71 + // implied to also be set 1.72 + eBorderStyle_title = 1 << 3, // enables the titlebar for the window 1.73 + eBorderStyle_menu = 1 << 4, // enables the window menu button on the 1.74 + // title bar. this being on should force 1.75 + // the title bar to display 1.76 + eBorderStyle_minimize = 1 << 5, // enables the minimize button so the user 1.77 + // can minimize the window. turned off for 1.78 + // tranient windows since they can not be 1.79 + // minimized separate from their parent 1.80 + eBorderStyle_maximize = 1 << 6, // enables the maxmize button so the user 1.81 + // can maximize the window 1.82 + eBorderStyle_close = 1 << 7, // show the close button 1.83 + eBorderStyle_default = -1 // whatever the OS wants... i.e. don't do 1.84 + // anything 1.85 +}; 1.86 + 1.87 +/** 1.88 + * Basic struct for widget initialization data. 1.89 + * @see Create member function of nsIWidget 1.90 + */ 1.91 + 1.92 +struct nsWidgetInitData { 1.93 + nsWidgetInitData() : 1.94 + mWindowType(eWindowType_child), 1.95 + mBorderStyle(eBorderStyle_default), 1.96 + mPopupHint(ePopupTypePanel), 1.97 + mPopupLevel(ePopupLevelTop), 1.98 + clipChildren(false), 1.99 + clipSiblings(false), 1.100 + mDropShadow(false), 1.101 + mListenForResizes(false), 1.102 + mUnicode(true), 1.103 + mRTL(false), 1.104 + mNoAutoHide(false), 1.105 + mIsDragPopup(false), 1.106 + mIsAnimationSuppressed(false), 1.107 + mSupportTranslucency(false), 1.108 + mMouseTransparent(false), 1.109 + mRequireOffMainThreadCompositing(false) 1.110 + { 1.111 + } 1.112 + 1.113 + nsWindowType mWindowType; 1.114 + nsBorderStyle mBorderStyle; 1.115 + nsPopupType mPopupHint; 1.116 + nsPopupLevel mPopupLevel; 1.117 + // when painting exclude area occupied by child windows and sibling windows 1.118 + bool clipChildren, clipSiblings, mDropShadow; 1.119 + bool mListenForResizes; 1.120 + bool mUnicode; 1.121 + bool mRTL; 1.122 + bool mNoAutoHide; // true for noautohide panels 1.123 + bool mIsDragPopup; // true for drag feedback panels 1.124 + // true if window creation animation is suppressed, e.g. for session restore 1.125 + bool mIsAnimationSuppressed; 1.126 + // true if the window should support an alpha channel, if available. 1.127 + bool mSupportTranslucency; 1.128 + // true if the window should be transparent to mouse events. Currently this is 1.129 + // only valid for eWindowType_popup widgets 1.130 + bool mMouseTransparent; 1.131 + // Windows with out-of-process tabs always require OMTC. This flag designates 1.132 + // such windows. 1.133 + bool mRequireOffMainThreadCompositing; 1.134 +}; 1.135 + 1.136 +#endif // nsWidgetInitData_h__