gfx/src/nsIScriptableRegion.idl

Tue, 06 Jan 2015 21:39:09 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Tue, 06 Jan 2015 21:39:09 +0100
branch
TOR_BUG_9701
changeset 8
97036ab72558
permissions
-rw-r--r--

Conditionally force memory storage according to privacy.thirdparty.isolate;
This solves Tor bug #9701, complying with disk avoidance documented in
https://www.torproject.org/projects/torbrowser/design/#disk-avoidance.

     1 /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
     2  *
     3  * This Source Code Form is subject to the terms of the Mozilla Public
     4  * License, v. 2.0. If a copy of the MPL was not distributed with this
     5  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     7 #include "nsISupports.idl"
     9 %{C++
    10 class nsIntRegion;
    11 %}
    13 native nsIntRegion(nsIntRegion);
    16 [scriptable, uuid(a5f44cc7-2820-489b-b817-ae8a08506ff6)]
    17 interface nsIScriptableRegion : nsISupports
    18 {
    19   void init ( ) ;
    21   /**
    22   * copy operator equivalent that takes another region
    23   *
    24   * @param      region to copy
    25   * @return     void
    26   *
    27   **/
    29   void setToRegion ( in nsIScriptableRegion aRegion );
    31   /**
    32   * copy operator equivalent that takes a rect
    33   *
    34   * @param      aX xoffset of rect to set region to
    35   * @param      aY yoffset of rect to set region to
    36   * @param      aWidth width of rect to set region to
    37   * @param      aHeight height of rect to set region to
    38   * @return     void
    39   *
    40   **/
    42   void setToRect ( in long aX, in long aY, in long aWidth, in long aHeight );
    44   /**
    45   * destructively intersect another region with this one
    46   *
    47   * @param      region to intersect
    48   * @return     void
    49   *
    50   **/
    52   void intersectRegion ( in nsIScriptableRegion aRegion ) ;
    54   /**
    55   * destructively intersect a rect with this region
    56   *
    57   * @param      aX xoffset of rect to intersect with region
    58   * @param      aY yoffset of rect to intersect with region
    59   * @param      aWidth width of rect to intersect with region
    60   * @param      aHeight height of rect to intersect with region
    61   * @return     void
    62   *
    63   **/
    65   void intersectRect ( in long aX, in long aY, in long aWidth, in long aHeight ) ;
    67   /**
    68   * destructively union another region with this one
    69   *
    70   * @param      region to union
    71   * @return     void
    72   *
    73   **/
    75   void unionRegion ( in nsIScriptableRegion aRegion ) ;
    77   /**
    78   * destructively union a rect with this region
    79   *
    80   * @param      aX xoffset of rect to union with region
    81   * @param      aY yoffset of rect to union with region
    82   * @param      aWidth width of rect to union with region
    83   * @param      aHeight height of rect to union with region
    84   * @return     void
    85   *
    86   **/
    88   void unionRect ( in long aX, in long aY, in long aWidth, in long aHeight ) ;
    90   /**
    91   * destructively subtract another region with this one
    92   *
    93   * @param      region to subtract
    94   * @return     void
    95   *
    96   **/
    98   void subtractRegion ( in nsIScriptableRegion aRegion ) ;
   100   /**
   101   * destructively subtract a rect from this region
   102   *
   103   * @param      aX xoffset of rect to subtract with region
   104   * @param      aY yoffset of rect to subtract with region
   105   * @param      aWidth width of rect to subtract with region
   106   * @param      aHeight height of rect to subtract with region
   107   * @return     void
   108   *
   109   **/
   111   void subtractRect ( in long aX, in long aY, in long aWidth, in long aHeight ) ;
   113   /**
   114   * is this region empty? i.e. does it contain any pixels
   115   *
   116   * @param      none
   117   * @return     returns whether the region is empty
   118   *
   119   **/
   121   boolean isEmpty ( ) ;
   123   /**
   124   * == operator equivalent i.e. do the regions contain exactly
   125   * the same pixels
   126   *
   127   * @param      region to compare
   128   * @return     whether the regions are identical
   129   *
   130   **/
   132   boolean isEqualRegion ( in nsIScriptableRegion aRegion ) ;
   134   /**
   135   * returns the bounding box of the region i.e. the smallest
   136   * rectangle that completely contains the region.        
   137   *
   138   * @param      aX out parameter for xoffset of bounding rect for region
   139   * @param      aY out parameter for yoffset of bounding rect for region
   140   * @param      aWidth out parameter for width of bounding rect for region
   141   * @param      aHeight out parameter for height of bounding rect for region
   142   * @return     void
   143   *
   144   **/
   145   void getBoundingBox ( out long aX, out long aY, out long aWidth, out long aHeight ) ;
   147   /**
   148   * offsets the region in x and y
   149   *
   150   * @param  xoffset  pixel offset in x
   151   * @param  yoffset  pixel offset in y
   152   * @return          void
   153   *
   154   **/
   155   void offset ( in long aXOffset, in long aYOffset ) ;
   157   /**
   158    * @return null if there are no rects,
   159    * @return flat array of rects,ie [x1,y1,width1,height1,x2...].
   160    * The result will contain bogus data if values don't fit in 31 bit
   161    **/
   162   [implicit_jscontext] jsval getRects();
   164   /**
   165   * does the region intersect the rectangle?
   166   *
   167   * @param      rect to check for containment
   168   * @return     true if the region intersects the rect
   169   *
   170   **/
   172   boolean containsRect ( in long aX, in long aY, in long aWidth, in long aHeight ) ;
   174   [noscript] readonly attribute nsIntRegion region;
   176 };

mercurial