Home | History | Annotate | Download | only in core
      1 /*
      2  * Copyright 2012 Google Inc.
      3  *
      4  * Use of this source code is governed by a BSD-style license that can be
      5  * found in the LICENSE file.
      6  */
      7 
      8 #ifndef SkAnnotation_DEFINED
      9 #define SkAnnotation_DEFINED
     10 
     11 #include "SkTypes.h"
     12 
     13 class SkData;
     14 struct SkPoint;
     15 struct SkRect;
     16 class SkCanvas;
     17 
     18 /**
     19  *  Annotate the canvas by associating the specified URL with the
     20  *  specified rectangle (in local coordinates, just like drawRect).
     21  *
     22  *  If the backend of this canvas does not support annotations, this call is
     23  *  safely ignored.
     24  *
     25  *  The caller is responsible for managing its ownership of the SkData.
     26  */
     27 SK_API void SkAnnotateRectWithURL(SkCanvas*, const SkRect&, SkData*);
     28 
     29 /**
     30  *  Annotate the canvas by associating a name with the specified point.
     31  *
     32  *  If the backend of this canvas does not support annotations, this call is
     33  *  safely ignored.
     34  *
     35  *  The caller is responsible for managing its ownership of the SkData.
     36  */
     37 SK_API void SkAnnotateNamedDestination(SkCanvas*, const SkPoint&, SkData*);
     38 
     39 /**
     40  *  Annotate the canvas by making the specified rectangle link to a named
     41  *  destination.
     42  *
     43  *  If the backend of this canvas does not support annotations, this call is
     44  *  safely ignored.
     45  *
     46  *  The caller is responsible for managing its ownership of the SkData.
     47  */
     48 SK_API void SkAnnotateLinkToDestination(SkCanvas*, const SkRect&, SkData*);
     49 
     50 #endif
     51