Developer

API Reference

IDecorator_IntersectOpaque()

Brew Release
Brew MP 1.0.2
See Also
Description
This function retrieves the intersection of a given rectangle with the largest opaque region of a given decorator. To illustrate, consider the diagram below:
   
   +--------------------+
   |                    |
   |       source     -----------+ result of IDecorator_IntersectOpaque()
   |     rectangle   |  |
   |                 V  |
   |            +---------------------------------------+
   |            |/ / / /|                               |
   |            | / / / |      target decorator         |
   |            |/ / / /|                               |
   +------------|-------                                |
                |                                       |
                +---------------------------------------+


The function determines where the extent of the target decorator and the source rectangle overlap -- subtracting out, however, areas that lack opacity. So, for example, if the decorator itself was transparent (i.e. it has no children or the background of the child widget has been set to be transparent), the rectangle that enclosed those transparent areas would not included in the result.
If the rectangle's intersect, IDecorator_IntersectOpaque() will return TRUE, otherwise the function returns FALSE and the resultant rectangle is empty.
Parameters
  • p
    []:
    [in] Pointer to the IDecorator object to be used as a target for intersection.
  • rd
    []:
    [out] Pointer to an AEERect, into which the function will return the intersection of the decorator's largest opaque rectangle and the rectangle passed to the function in 'prcIn'.
  • ri
    []:
    [in] Pointer to the AEERect that is to be intersected with the decorator's largest opaque rectangle. This rectangle should be expressed in the target widget's coordinate system, with 0,0 being the top-left corner of the widget.
Interface
Prototype
   boolean IDecorator_IntersectOpaque(IDecorator *p, AEERect *rd, const AEERect *ri);
   
Return
   TRUE   -  If 'ri' intersects with the decorator's largest opaque rectangle.
   FALSE  -  If 'ri' does not intersect with the decorator largest opaque rectangle.

The intersection of 'ri' and the decorator's largest opaque rectangle will be returned in 'rd', or returns the empty rectangle (0, 0, 0, 0) if the decorator is not wrapped around a widget (making the decorator, essentially, transparent).
Side Effect
None
Comment
By definition, the rectangle returned in 'rd' can be no larger than the rectangle passed to the function in 'ri'.
The largest opaque rectangle for an object is defined to be the largest rectangle required to capture all opaque points and regions within an object. So, for example, an object that looks something like this:
      +-------------------------------------------------------+
      |                                                       |
      |                                                       |
      |      #######                                          |
      |      #######                                          |
      |      #######                                          |
      |                              ##                       |
      |                              ##                       |
      |                  #######                              |
      |                   #######                             |
      |                    #######                            |  # indicates opaque
      |                     #######                           |    regions within the
      |                      #######                          |    object.  All other
      |            ##                                         |    area is transparent
      |           ####                                        |
      |          ######                                       |
      |         ########                                      |
      |        ##########                                     |
      |       ############                                    |
      |                                             ##        |
      |                                            ####       |
      |                                             ##        |
      |                                                       |
      |                                                       |
      +-------------------------------------------------------+

When expressed as its "largest opaque rectangle", the following rectangle would result (and subsequently compared to the source rectangle passed into the function to determine the intersecting rectangle):
      +-------------------------------------------------------+
      |                                                       |
      |                                                       |
      |      ##########################################       |
      |      ##########################################       |
      |      ##########################################       |
      |      ##########################################       |
      |      ##########################################       |
      |      ##########################################       |
      |      ##########################################       |
      |      ##########################################       |  # indicates area
      |      ##########################################       |    enclosed by the
      |      ##########################################       |    largest opaque
      |      ##########################################       |    rectangle
      |      ##########################################       |
      |      ##########################################       |
      |      ##########################################       |
      |      ##########################################       |
      |      ##########################################       |
      |      ##########################################       |
      |      ##########################################       |
      |      ##########################################       |
      |                                                       |
      |                                                       |
      +-------------------------------------------------------+
  • Follow