xref: /aosp_15_r20/external/skia/include/core/SkAnnotation.h (revision c8dee2aa9b3f27cf6c858bd81872bdeb2c07ed17)
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 "include/core/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  *  The URL is expected to be escaped and be valid 7-bit ASCII.
23  *
24  *  If the backend of this canvas does not support annotations, this call is
25  *  safely ignored.
26  *
27  *  The caller is responsible for managing its ownership of the SkData.
28  */
29 SK_API void SkAnnotateRectWithURL(SkCanvas*, const SkRect&, SkData*);
30 
31 /**
32  *  Annotate the canvas by associating a name with the specified point.
33  *
34  *  If the backend of this canvas does not support annotations, this call is
35  *  safely ignored.
36  *
37  *  The caller is responsible for managing its ownership of the SkData.
38  */
39 SK_API void SkAnnotateNamedDestination(SkCanvas*, const SkPoint&, SkData*);
40 
41 /**
42  *  Annotate the canvas by making the specified rectangle link to a named
43  *  destination.
44  *
45  *  If the backend of this canvas does not support annotations, this call is
46  *  safely ignored.
47  *
48  *  The caller is responsible for managing its ownership of the SkData.
49  */
50 SK_API void SkAnnotateLinkToDestination(SkCanvas*, const SkRect&, SkData*);
51 
52 #endif
53