Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(118)

Side by Side Diff: ppapi/c/private/ppb_pdf.h

Issue 1953053002: Add private PPAPI interfaces for PDFium accessibility. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address feedback and run git cl format Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « pdf/pdfium/pdfium_page.cc ('k') | ppapi/c/private/ppp_pdf.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef PPAPI_C_PRIVATE_PPB_PDF_H_ 5 #ifndef PPAPI_C_PRIVATE_PPB_PDF_H_
6 #define PPAPI_C_PRIVATE_PPB_PDF_H_ 6 #define PPAPI_C_PRIVATE_PPB_PDF_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include "ppapi/c/pp_bool.h" 10 #include "ppapi/c/pp_bool.h"
11 #include "ppapi/c/pp_instance.h" 11 #include "ppapi/c/pp_instance.h"
12 #include "ppapi/c/pp_point.h"
13 #include "ppapi/c/pp_rect.h"
12 #include "ppapi/c/pp_resource.h" 14 #include "ppapi/c/pp_resource.h"
13 #include "ppapi/c/pp_var.h" 15 #include "ppapi/c/pp_var.h"
14 #include "ppapi/c/private/pp_private_font_charset.h" 16 #include "ppapi/c/private/pp_private_font_charset.h"
15 17
16 #define PPB_PDF_INTERFACE "PPB_PDF;1" 18 #define PPB_PDF_INTERFACE "PPB_PDF;1"
17 19
18 typedef enum { 20 typedef enum {
19 PP_PDFFEATURE_HIDPI = 0, 21 PP_PDFFEATURE_HIDPI = 0,
20 PP_PDFFEATURE_PRINTING = 1 22 PP_PDFFEATURE_PRINTING = 1
21 } PP_PDFFeature; 23 } PP_PDFFeature;
22 24
23 struct PP_PrivateFontFileDescription { 25 struct PP_PrivateFontFileDescription {
24 const char* face; 26 const char* face;
25 uint32_t weight; 27 uint32_t weight;
26 bool italic; 28 bool italic;
27 }; 29 };
28 30
29 struct PP_PrivateFindResult { 31 struct PP_PrivateFindResult {
30 int start_index; 32 int start_index;
31 int length; 33 int length;
32 }; 34 };
33 35
36 struct PP_PrivateAccessibilityViewportInfo {
37 double zoom;
38 struct PP_Point scroll;
39 struct PP_Point offset;
40 };
41
42 struct PP_PrivateAccessibilityDocInfo {
43 uint32_t page_count;
44 PP_Bool text_accessible;
45 PP_Bool text_copyable;
46 };
47
48 typedef enum {
49 PP_PRIVATEDIRECTION_NONE = 0,
50 PP_PRIVATEDIRECTION_LTR = 1,
51 PP_PRIVATEDIRECTION_RTL = 2,
52 PP_PRIVATEDIRECTION_TTB = 3,
53 PP_PRIVATEDIRECTION_BTT = 4,
54 PP_PRIVATEDIRECTION_LAST = PP_PRIVATEDIRECTION_BTT
55 } PP_PrivateDirection;
56
57 struct PP_PrivateAccessibilityPageInfo {
58 uint32_t page_index;
59 struct PP_Rect bounds;
60 uint32_t text_run_count;
61 uint32_t char_count;
62 };
63
64 struct PP_PrivateAccessibilityTextRunInfo {
65 uint32_t len;
66 double font_size;
67 struct PP_FloatRect bounds;
68 PP_PrivateDirection direction;
69 };
70
71 struct PP_PrivateAccessibilityCharInfo {
72 uint32_t unicode_character;
73 double char_width;
74 };
75
34 struct PPB_PDF { 76 struct PPB_PDF {
35 // Returns a resource identifying a font file corresponding to the given font 77 // Returns a resource identifying a font file corresponding to the given font
36 // request after applying the browser-specific fallback. 78 // request after applying the browser-specific fallback.
37 // 79 //
38 // Currently Linux-only. 80 // Currently Linux-only.
39 PP_Resource (*GetFontFileWithFallback)( 81 PP_Resource (*GetFontFileWithFallback)(
40 PP_Instance instance, 82 PP_Instance instance,
41 const struct PP_BrowserFont_Trusted_Description* description, 83 const struct PP_BrowserFont_Trusted_Description* description,
42 PP_PrivateFontCharset charset); 84 PP_PrivateFontCharset charset);
43 85
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 // Sets the link currently under the cursor. 130 // Sets the link currently under the cursor.
89 void (*SetLinkUnderCursor)(PP_Instance instance, const char* url); 131 void (*SetLinkUnderCursor)(PP_Instance instance, const char* url);
90 132
91 // Gets pointers to both the mmap'd V8 snapshot files and their sizes. 133 // Gets pointers to both the mmap'd V8 snapshot files and their sizes.
92 // This is needed when loading V8's initial snapshot from external files. 134 // This is needed when loading V8's initial snapshot from external files.
93 void (*GetV8ExternalSnapshotData)(PP_Instance instance, 135 void (*GetV8ExternalSnapshotData)(PP_Instance instance,
94 const char** natives_data_out, 136 const char** natives_data_out,
95 int* natives_size_out, 137 int* natives_size_out,
96 const char** snapshot_data_out, 138 const char** snapshot_data_out,
97 int* snapshot_size_out); 139 int* snapshot_size_out);
140
141 // Sends information about the viewport to the renderer for accessibility
142 // support.
143 void (*SetAccessibilityViewportInfo)(
144 PP_Instance instance,
145 struct PP_PrivateAccessibilityViewportInfo* viewport_info);
146
147 // Sends information about the PDF document to the renderer for accessibility
148 // support.
149 void (*SetAccessibilityDocInfo)(
150 PP_Instance instance,
151 struct PP_PrivateAccessibilityDocInfo* doc_info);
152
153 // Sends information about one page in a PDF document to the renderer for
154 // accessibility support.
155 void (*SetAccessibilityPageInfo)(
156 PP_Instance instance,
157 struct PP_PrivateAccessibilityPageInfo* page_info,
158 struct PP_PrivateAccessibilityTextRunInfo text_runs[],
159 struct PP_PrivateAccessibilityCharInfo chars[]);
98 }; 160 };
99 161
100 #endif // PPAPI_C_PRIVATE_PPB_PDF_H_ 162 #endif // PPAPI_C_PRIVATE_PPB_PDF_H_
OLDNEW
« no previous file with comments | « pdf/pdfium/pdfium_page.cc ('k') | ppapi/c/private/ppp_pdf.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698