1 /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
3 * ***** BEGIN LICENSE BLOCK *****
4 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
6 * The contents of this file are subject to the Mozilla Public License Version
7 * 1.1 (the "License"); you may not use this file except in compliance with
8 * the License. You may obtain a copy of the License at
9 * http://www.mozilla.org/MPL/
11 * Software distributed under the License is distributed on an "AS IS" basis,
12 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
13 * for the specific language governing rights and limitations under the
16 * The Original Code is Mozilla Communicator.
18 * The Initial Developer of the Original Code is
19 * Netscape Communications Corp.
20 * Portions created by the Initial Developer are Copyright (C) 1999
21 * the Initial Developer. All Rights Reserved.
26 * Alternatively, the contents of this file may be used under the terms of
27 * either of the GNU General Public License Version 2 or later (the "GPL"),
28 * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
29 * in which case the provisions of the GPL or the LGPL are applicable instead
30 * of those above. If you wish to allow use of your version of this file only
31 * under the terms of either the GPL or the LGPL, and not to allow others to
32 * use your version of this file under the terms of the MPL, indicate your
33 * decision by deleting the provisions above and replace them with the notice
34 * and other provisions required by the GPL or the LGPL. If you do not delete
35 * the provisions above, a recipient may use your version of this file under
36 * the terms of any one of the MPL, the GPL or the LGPL.
38 * ***** END LICENSE BLOCK ***** */
40 #include
"nsISupports.idl"
46 [ptr] native nsIRegion
(nsIRegion
);
49 [scriptable
, uuid(82d8f400
-5bde
-11d3
-b033
-b27a62766bbc
)]
50 interface nsIScriptableRegion
: nsISupports
55 * copy operator equivalent that takes another region
57 * @param region to copy
62 void setToRegion
( in nsIScriptableRegion aRegion
);
65 * copy operator equivalent that takes a rect
67 * @param aX xoffset of rect to set region to
68 * @param aY yoffset of rect to set region to
69 * @param aWidth width of rect to set region to
70 * @param aHeight height of rect to set region to
75 void setToRect
( in long aX
, in long aY
, in long aWidth
, in long aHeight
);
78 * destructively intersect another region with this one
80 * @param region to intersect
85 void intersectRegion
( in nsIScriptableRegion aRegion
) ;
88 * destructively intersect a rect with this region
90 * @param aX xoffset of rect to intersect with region
91 * @param aY yoffset of rect to intersect with region
92 * @param aWidth width of rect to intersect with region
93 * @param aHeight height of rect to intersect with region
98 void intersectRect
( in long aX
, in long aY
, in long aWidth
, in long aHeight
) ;
101 * destructively union another region with this one
103 * @param region to union
108 void unionRegion
( in nsIScriptableRegion aRegion
) ;
111 * destructively union a rect with this region
113 * @param aX xoffset of rect to union with region
114 * @param aY yoffset of rect to union with region
115 * @param aWidth width of rect to union with region
116 * @param aHeight height of rect to union with region
121 void unionRect
( in long aX
, in long aY
, in long aWidth
, in long aHeight
) ;
124 * destructively subtract another region with this one
126 * @param region to subtract
131 void subtractRegion
( in nsIScriptableRegion aRegion
) ;
134 * destructively subtract a rect from this region
136 * @param aX xoffset of rect to subtract with region
137 * @param aY yoffset of rect to subtract with region
138 * @param aWidth width of rect to subtract with region
139 * @param aHeight height of rect to subtract with region
144 void subtractRect
( in long aX
, in long aY
, in long aWidth
, in long aHeight
) ;
147 * is this region empty? i.e. does it contain any pixels
150 * @return returns whether the region is empty
154 boolean isEmpty
( ) ;
157 * == operator equivalent i.e. do the regions contain exactly
160 * @param region to compare
161 * @return whether the regions are identical
165 boolean isEqualRegion
( in nsIScriptableRegion aRegion
) ;
168 * returns the bounding box of the region i.e. the smallest
169 * rectangle that completely contains the region.
171 * @param aX out parameter for xoffset of bounding rect for region
172 * @param aY out parameter for yoffset of bounding rect for region
173 * @param aWidth out parameter for width of bounding rect for region
174 * @param aHeight out parameter for height of bounding rect for region
178 void getBoundingBox
( out long aX
, out long aY
, out long aWidth
, out long aHeight
) ;
181 * offsets the region in x and y
183 * @param xoffset pixel offset in x
184 * @param yoffset pixel offset in y
188 void offset
( in long aXOffset
, in long aYOffset
) ;
191 * does the region intersect the rectangle?
193 * @param rect to check for containment
194 * @return true if the region intersects the rect
198 boolean containsRect
( in long aX
, in long aY
, in long aWidth
, in long aHeight
) ;
200 [noscript
] readonly attribute nsIRegion region
;