LCOV - code coverage report
Current view: top level - widget - nsWidgetInitData.h (source / functions) Hit Total Coverage
Test: output.info Lines: 3 3 100.0 %
Date: 2017-07-14 16:53:18 Functions: 1 1 100.0 %
Legend: Lines: hit not hit

          Line data    Source code
       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_plugin_ipc_chrome,  // chrome side native widget for plugins (e10s)
      25             :   eWindowType_plugin_ipc_content, // content side puppet widget for plugins (e10s)
      26             :   eWindowType_sheet,              // MacOSX sheet (special dialog class)
      27             : };
      28             : 
      29             : /**
      30             :  * Popup types
      31             :  *
      32             :  * For eWindowType_popup
      33             :  */
      34             : enum nsPopupType {
      35             :   ePopupTypePanel,
      36             :   ePopupTypeMenu,
      37             :   ePopupTypeTooltip,
      38             :   ePopupTypeAny      = 0xF000 // used only to pass to
      39             :                               // nsXULPopupManager::GetTopPopup
      40             : };
      41             : 
      42             : /**
      43             :  * Popup levels specify the window ordering behaviour.
      44             :  */
      45             : enum nsPopupLevel {
      46             :   // the popup appears just above its parent and maintains its position
      47             :   // relative to the parent
      48             :   ePopupLevelParent,
      49             :   // the popup is a floating popup used for tool palettes. A parent window
      50             :   // must be specified, but a platform implementation need not use this.
      51             :   // On Windows, floating is generally equivalent to parent. On Mac, floating
      52             :   // puts the popup at toplevel, but it will hide when the application is deactivated
      53             :   ePopupLevelFloating,
      54             :   // the popup appears on top of other windows, including those of other applications
      55             :   ePopupLevelTop
      56             : };
      57             : 
      58             : /**
      59             :  * Border styles
      60             :  */
      61             : enum nsBorderStyle {
      62             :   eBorderStyle_none     = 0,      // no border, titlebar, etc.. opposite of
      63             :                                   // all
      64             :   eBorderStyle_all      = 1 << 0, // all window decorations
      65             :   eBorderStyle_border   = 1 << 1, // enables the border on the window. these
      66             :                                   // are only for decoration and are not
      67             :                                   // resize handles
      68             :   eBorderStyle_resizeh  = 1 << 2, // enables the resize handles for the
      69             :                                   // window. if this is set, border is
      70             :                                   // implied to also be set
      71             :   eBorderStyle_title    = 1 << 3, // enables the titlebar for the window
      72             :   eBorderStyle_menu     = 1 << 4, // enables the window menu button on the
      73             :                                   // title bar. this being on should force
      74             :                                   // the title bar to display
      75             :   eBorderStyle_minimize = 1 << 5, // enables the minimize button so the user
      76             :                                   // can minimize the window. turned off for
      77             :                                   // tranient windows since they can not be
      78             :                                   // minimized separate from their parent
      79             :   eBorderStyle_maximize = 1 << 6, // enables the maxmize button so the user
      80             :                                   // can maximize the window
      81             :   eBorderStyle_close    = 1 << 7, // show the close button
      82             :   eBorderStyle_default  = -1      // whatever the OS wants... i.e. don't do
      83             :                                   // anything
      84             : };
      85             : 
      86             : /**
      87             :  * Basic struct for widget initialization data.
      88             :  * @see Create member function of nsIWidget
      89             :  */
      90             : 
      91             : struct nsWidgetInitData {
      92           8 :   nsWidgetInitData() :
      93             :       mWindowType(eWindowType_child),
      94             :       mBorderStyle(eBorderStyle_default),
      95             :       mPopupHint(ePopupTypePanel),
      96             :       mPopupLevel(ePopupLevelTop),
      97             :       mScreenId(0),
      98             :       clipChildren(false),
      99             :       clipSiblings(false),
     100             :       mDropShadow(false),
     101             :       mListenForResizes(false),
     102             :       mUnicode(true),
     103             :       mRTL(false),
     104             :       mNoAutoHide(false),
     105             :       mIsDragPopup(false),
     106             :       mIsAnimationSuppressed(false),
     107             :       mSupportTranslucency(false),
     108             :       mMouseTransparent(false),
     109           8 :       mHasRemoteContent(false)
     110             :   {
     111           8 :   }
     112             : 
     113             :   nsWindowType  mWindowType;
     114             :   nsBorderStyle mBorderStyle;
     115             :   nsPopupType   mPopupHint;
     116             :   nsPopupLevel  mPopupLevel;
     117             :   // B2G multi-screen support. Screen ID is for differentiating screens of
     118             :   // windows, and due to the hardware limitation, it is platform-specific for
     119             :   // now, which align with the value of display type defined in HWC.
     120             :   uint32_t      mScreenId;
     121             :   // when painting exclude area occupied by child windows and sibling windows
     122             :   bool          clipChildren, clipSiblings, mDropShadow;
     123             :   bool          mListenForResizes;
     124             :   bool          mUnicode;
     125             :   bool          mRTL;
     126             :   bool          mNoAutoHide; // true for noautohide panels
     127             :   bool          mIsDragPopup;  // true for drag feedback panels
     128             :   // true if window creation animation is suppressed, e.g. for session restore
     129             :   bool          mIsAnimationSuppressed;
     130             :   // true if the window should support an alpha channel, if available.
     131             :   bool          mSupportTranslucency;
     132             :   // true if the window should be transparent to mouse events. Currently this is
     133             :   // only valid for eWindowType_popup widgets
     134             :   bool          mMouseTransparent;
     135             :   bool          mHasRemoteContent;
     136             : };
     137             : 
     138             : #endif // nsWidgetInitData_h__

Generated by: LCOV version 1.13