OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_PROXY_SERIALIZED_STRUCTS_H_ | 5 #ifndef PPAPI_PROXY_SERIALIZED_STRUCTS_H_ |
6 #define PPAPI_PROXY_SERIALIZED_STRUCTS_H_ | 6 #define PPAPI_PROXY_SERIALIZED_STRUCTS_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "base/logging.h" | 11 #include "base/logging.h" |
12 #include "base/memory/shared_memory.h" | 12 #include "base/memory/shared_memory.h" |
13 #include "build/build_config.h" | 13 #include "build/build_config.h" |
14 #include "ppapi/c/dev/ppb_truetype_font_dev.h" | 14 #include "ppapi/c/dev/ppb_truetype_font_dev.h" |
15 #include "ppapi/c/pp_bool.h" | 15 #include "ppapi/c/pp_bool.h" |
16 #include "ppapi/c/pp_instance.h" | 16 #include "ppapi/c/pp_instance.h" |
17 #include "ppapi/c/pp_point.h" | 17 #include "ppapi/c/pp_point.h" |
18 #include "ppapi/c/pp_rect.h" | 18 #include "ppapi/c/pp_rect.h" |
19 #include "ppapi/c/ppb_network_list.h" | 19 #include "ppapi/c/ppb_network_list.h" |
20 #include "ppapi/c/private/ppb_net_address_private.h" | 20 #include "ppapi/c/private/ppb_net_address_private.h" |
21 #include "ppapi/proxy/ppapi_proxy_export.h" | 21 #include "ppapi/proxy/ppapi_proxy_export.h" |
22 #include "ppapi/shared_impl/host_resource.h" | 22 #include "ppapi/shared_impl/host_resource.h" |
23 | 23 |
24 struct PP_FontDescription_Dev; | |
25 struct PP_BrowserFont_Trusted_Description; | 24 struct PP_BrowserFont_Trusted_Description; |
26 | 25 |
27 namespace ppapi { | 26 namespace ppapi { |
28 namespace proxy { | 27 namespace proxy { |
29 | 28 |
30 // PP_FontDescription_Dev/PP_BrowserFontDescription (same definition, different | 29 // PP_BrowserFontDescription has to be redefined with a string in place of the |
31 // names) has to be redefined with a string in place of the PP_Var used for the | 30 // PP_Var used for the face name. |
32 // face name. | |
33 struct PPAPI_PROXY_EXPORT SerializedFontDescription { | 31 struct PPAPI_PROXY_EXPORT SerializedFontDescription { |
34 SerializedFontDescription(); | 32 SerializedFontDescription(); |
35 ~SerializedFontDescription(); | 33 ~SerializedFontDescription(); |
36 | 34 |
37 // Converts a PP_FontDescription_Dev to a SerializedFontDescription. | |
38 // | |
39 // The reference of |face| owned by the PP_FontDescription_Dev will be | |
40 // unchanged and the caller is responsible for freeing it. | |
41 void SetFromPPFontDescription(const PP_FontDescription_Dev& desc); | |
42 void SetFromPPBrowserFontDescription( | 35 void SetFromPPBrowserFontDescription( |
43 const PP_BrowserFont_Trusted_Description& desc); | 36 const PP_BrowserFont_Trusted_Description& desc); |
44 | 37 |
45 // Converts to a PP_FontDescription_Dev. The face name will have one ref | |
46 // assigned to it. The caller is responsible for freeing it. | |
47 void SetToPPFontDescription(PP_FontDescription_Dev* desc) const; | |
48 void SetToPPBrowserFontDescription( | 38 void SetToPPBrowserFontDescription( |
49 PP_BrowserFont_Trusted_Description* desc) const; | 39 PP_BrowserFont_Trusted_Description* desc) const; |
50 | 40 |
51 std::string face; | 41 std::string face; |
52 int32_t family; | 42 int32_t family; |
53 uint32_t size; | 43 uint32_t size; |
54 int32_t weight; | 44 int32_t weight; |
55 PP_Bool italic; | 45 PP_Bool italic; |
56 PP_Bool small_caps; | 46 PP_Bool small_caps; |
57 int32_t letter_spacing; | 47 int32_t letter_spacing; |
(...skipping 16 matching lines...) Expand all Loading... |
74 struct PPAPI_PROXY_EXPORT SerializedTrueTypeFontDesc { | 64 struct PPAPI_PROXY_EXPORT SerializedTrueTypeFontDesc { |
75 SerializedTrueTypeFontDesc(); | 65 SerializedTrueTypeFontDesc(); |
76 ~SerializedTrueTypeFontDesc(); | 66 ~SerializedTrueTypeFontDesc(); |
77 | 67 |
78 // Sets this to correspond to the contents of a PP_TrueTypeFontDesc_Dev. | 68 // Sets this to correspond to the contents of a PP_TrueTypeFontDesc_Dev. |
79 // | 69 // |
80 // The reference count of the desc.family PP_Var will be unchanged and the | 70 // The reference count of the desc.family PP_Var will be unchanged and the |
81 // caller is responsible for releasing it. | 71 // caller is responsible for releasing it. |
82 void SetFromPPTrueTypeFontDesc(const PP_TrueTypeFontDesc_Dev& desc); | 72 void SetFromPPTrueTypeFontDesc(const PP_TrueTypeFontDesc_Dev& desc); |
83 | 73 |
84 // Converts this to a PP_FontDescription_Dev. | 74 // Converts this to a PP_TrueTypeFontDesc_Dev. |
85 // | 75 // |
86 // The desc.family PP_Var will have one reference assigned to it. The caller | 76 // The desc.family PP_Var will have one reference assigned to it. The caller |
87 // is responsible for releasing it. | 77 // is responsible for releasing it. |
88 void CopyToPPTrueTypeFontDesc(PP_TrueTypeFontDesc_Dev* desc) const; | 78 void CopyToPPTrueTypeFontDesc(PP_TrueTypeFontDesc_Dev* desc) const; |
89 | 79 |
90 std::string family; | 80 std::string family; |
91 PP_TrueTypeFontFamily_Dev generic_family; | 81 PP_TrueTypeFontFamily_Dev generic_family; |
92 PP_TrueTypeFontStyle_Dev style; | 82 PP_TrueTypeFontStyle_Dev style; |
93 PP_TrueTypeFontWeight_Dev weight; | 83 PP_TrueTypeFontWeight_Dev weight; |
94 PP_TrueTypeFontWidth_Dev width; | 84 PP_TrueTypeFontWidth_Dev width; |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
135 #if defined(OS_WIN) | 125 #if defined(OS_WIN) |
136 typedef HANDLE ImageHandle; | 126 typedef HANDLE ImageHandle; |
137 #else | 127 #else |
138 typedef base::SharedMemoryHandle ImageHandle; | 128 typedef base::SharedMemoryHandle ImageHandle; |
139 #endif | 129 #endif |
140 | 130 |
141 } // namespace proxy | 131 } // namespace proxy |
142 } // namespace ppapi | 132 } // namespace ppapi |
143 | 133 |
144 #endif // PPAPI_PROXY_SERIALIZED_STRUCTS_H_ | 134 #endif // PPAPI_PROXY_SERIALIZED_STRUCTS_H_ |
OLD | NEW |