| Index: ppapi/c/dev/ppb_font_dev.h
|
| diff --git a/ppapi/c/trusted/ppb_browser_font_trusted.h b/ppapi/c/dev/ppb_font_dev.h
|
| similarity index 66%
|
| copy from ppapi/c/trusted/ppb_browser_font_trusted.h
|
| copy to ppapi/c/dev/ppb_font_dev.h
|
| index bb626a784e5fdebe613a4e9d0a909db1afa2df32..4e7bea1cd851a22f18b6bb55bd1ad1d4d6c247a0 100644
|
| --- a/ppapi/c/trusted/ppb_browser_font_trusted.h
|
| +++ b/ppapi/c/dev/ppb_font_dev.h
|
| @@ -3,12 +3,10 @@
|
| * found in the LICENSE file.
|
| */
|
|
|
| -/* From trusted/ppb_browser_font_trusted.idl,
|
| - * modified Thu Mar 28 10:14:27 2013.
|
| - */
|
| +/* From dev/ppb_font_dev.idl modified Thu Mar 28 10:56:39 2013. */
|
|
|
| -#ifndef PPAPI_C_TRUSTED_PPB_BROWSER_FONT_TRUSTED_H_
|
| -#define PPAPI_C_TRUSTED_PPB_BROWSER_FONT_TRUSTED_H_
|
| +#ifndef PPAPI_C_DEV_PPB_FONT_DEV_H_
|
| +#define PPAPI_C_DEV_PPB_FONT_DEV_H_
|
|
|
| #include "ppapi/c/pp_bool.h"
|
| #include "ppapi/c/pp_instance.h"
|
| @@ -20,12 +18,12 @@
|
| #include "ppapi/c/pp_stdint.h"
|
| #include "ppapi/c/pp_var.h"
|
|
|
| -#define PPB_BROWSERFONT_TRUSTED_INTERFACE_1_0 "PPB_BrowserFont_Trusted;1.0"
|
| -#define PPB_BROWSERFONT_TRUSTED_INTERFACE PPB_BROWSERFONT_TRUSTED_INTERFACE_1_0
|
| +#define PPB_FONT_DEV_INTERFACE_0_6 "PPB_Font(Dev);0.6"
|
| +#define PPB_FONT_DEV_INTERFACE PPB_FONT_DEV_INTERFACE_0_6
|
|
|
| /**
|
| * @file
|
| - * This file defines the <code>PPB_BrowserFont_Trusted</code> interface.
|
| + * This file defines the <code>PPB_Font_Dev</code> interface.
|
| */
|
|
|
|
|
| @@ -38,34 +36,34 @@ typedef enum {
|
| * Uses the user's default web page font (normally either the default serif
|
| * or sans serif font).
|
| */
|
| - PP_BROWSERFONT_TRUSTED_FAMILY_DEFAULT = 0,
|
| + PP_FONTFAMILY_DEFAULT = 0,
|
| /**
|
| * These families will use the default web page font corresponding to the
|
| * given family.
|
| */
|
| - PP_BROWSERFONT_TRUSTED_FAMILY_SERIF = 1,
|
| - PP_BROWSERFONT_TRUSTED_FAMILY_SANSSERIF = 2,
|
| - PP_BROWSERFONT_TRUSTED_FAMILY_MONOSPACE = 3
|
| -} PP_BrowserFont_Trusted_Family;
|
| -PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_BrowserFont_Trusted_Family, 4);
|
| + PP_FONTFAMILY_SERIF = 1,
|
| + PP_FONTFAMILY_SANSSERIF = 2,
|
| + PP_FONTFAMILY_MONOSPACE = 3
|
| +} PP_FontFamily_Dev;
|
| +PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_FontFamily_Dev, 4);
|
|
|
| /**
|
| * Specifies the font weight. Normally users will only use NORMAL or BOLD.
|
| */
|
| typedef enum {
|
| - PP_BROWSERFONT_TRUSTED_WEIGHT_100 = 0,
|
| - PP_BROWSERFONT_TRUSTED_WEIGHT_200 = 1,
|
| - PP_BROWSERFONT_TRUSTED_WEIGHT_300 = 2,
|
| - PP_BROWSERFONT_TRUSTED_WEIGHT_400 = 3,
|
| - PP_BROWSERFONT_TRUSTED_WEIGHT_500 = 4,
|
| - PP_BROWSERFONT_TRUSTED_WEIGHT_600 = 5,
|
| - PP_BROWSERFONT_TRUSTED_WEIGHT_700 = 6,
|
| - PP_BROWSERFONT_TRUSTED_WEIGHT_800 = 7,
|
| - PP_BROWSERFONT_TRUSTED_WEIGHT_900 = 8,
|
| - PP_BROWSERFONT_TRUSTED_WEIGHT_NORMAL = PP_BROWSERFONT_TRUSTED_WEIGHT_400,
|
| - PP_BROWSERFONT_TRUSTED_WEIGHT_BOLD = PP_BROWSERFONT_TRUSTED_WEIGHT_700
|
| -} PP_BrowserFont_Trusted_Weight;
|
| -PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_BrowserFont_Trusted_Weight, 4);
|
| + PP_FONTWEIGHT_100 = 0,
|
| + PP_FONTWEIGHT_200 = 1,
|
| + PP_FONTWEIGHT_300 = 2,
|
| + PP_FONTWEIGHT_400 = 3,
|
| + PP_FONTWEIGHT_500 = 4,
|
| + PP_FONTWEIGHT_600 = 5,
|
| + PP_FONTWEIGHT_700 = 6,
|
| + PP_FONTWEIGHT_800 = 7,
|
| + PP_FONTWEIGHT_900 = 8,
|
| + PP_FONTWEIGHT_NORMAL = PP_FONTWEIGHT_400,
|
| + PP_FONTWEIGHT_BOLD = PP_FONTWEIGHT_700
|
| +} PP_FontWeight_Dev;
|
| +PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_FontWeight_Dev, 4);
|
| /**
|
| * @}
|
| */
|
| @@ -74,7 +72,7 @@ PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_BrowserFont_Trusted_Weight, 4);
|
| * @addtogroup Structs
|
| * @{
|
| */
|
| -struct PP_BrowserFont_Trusted_Description {
|
| +struct PP_FontDescription_Dev {
|
| /**
|
| * Font face name as a string. This can also be an undefined var, in which
|
| * case the generic family will be obeyed. If the face is not available on
|
| @@ -92,7 +90,7 @@ struct PP_BrowserFont_Trusted_Description {
|
| * family will not be updated to reflect whether the font name you requested
|
| * is serif or sans serif.
|
| */
|
| - PP_BrowserFont_Trusted_Family family;
|
| + PP_FontFamily_Dev family;
|
| /**
|
| * Size in pixels.
|
| *
|
| @@ -103,9 +101,9 @@ struct PP_BrowserFont_Trusted_Description {
|
| */
|
| uint32_t size;
|
| /**
|
| - * Normally you will use either normal or bold.
|
| + * Normally you will use either PP_FONTWEIGHT_NORMAL or PP_FONTWEIGHT_BOLD.
|
| */
|
| - PP_BrowserFont_Trusted_Weight weight;
|
| + PP_FontWeight_Dev weight;
|
| PP_Bool italic;
|
| PP_Bool small_caps;
|
| /**
|
| @@ -124,18 +122,18 @@ struct PP_BrowserFont_Trusted_Description {
|
| */
|
| int32_t padding;
|
| };
|
| -PP_COMPILE_ASSERT_STRUCT_SIZE_IN_BYTES(PP_BrowserFont_Trusted_Description, 48);
|
| +PP_COMPILE_ASSERT_STRUCT_SIZE_IN_BYTES(PP_FontDescription_Dev, 48);
|
|
|
| -struct PP_BrowserFont_Trusted_Metrics {
|
| +struct PP_FontMetrics_Dev {
|
| int32_t height;
|
| int32_t ascent;
|
| int32_t descent;
|
| int32_t line_spacing;
|
| int32_t x_height;
|
| };
|
| -PP_COMPILE_ASSERT_STRUCT_SIZE_IN_BYTES(PP_BrowserFont_Trusted_Metrics, 20);
|
| +PP_COMPILE_ASSERT_STRUCT_SIZE_IN_BYTES(PP_FontMetrics_Dev, 20);
|
|
|
| -struct PP_BrowserFont_Trusted_TextRun {
|
| +struct PP_TextRun_Dev {
|
| /**
|
| * This var must either be a string or a null/undefined var (which will be
|
| * treated as a 0-length string).
|
| @@ -143,15 +141,31 @@ struct PP_BrowserFont_Trusted_TextRun {
|
| struct PP_Var text;
|
| /**
|
| * Set to PP_TRUE if the text is right-to-left.
|
| + *
|
| + * When <code>override_direction</code> is false, the browser will perform
|
| + * the Unicode Bidirectional Algorithm (http://unicode.org/reports/tr9/) on
|
| + * the text. The value of the <code>rtl</code> flag specifies the
|
| + * directionality of the surrounding environment. This means that Hebrew
|
| + * word will always display right to left, even if <code>rtl</code> is false.
|
| + *
|
| + * When <code>override_direction</code> is true, no autodetection will be done
|
| + * and <code>rtl</code> specifies the direction of the text.
|
| + *
|
| + * TODO(brettw) note that autodetection with rtl = true is currently
|
| + * unimplemented.
|
| */
|
| PP_Bool rtl;
|
| /**
|
| * Set to PP_TRUE to force the directionality of the text regardless of
|
| - * content
|
| + * content.
|
| + *
|
| + * If this flag is set, the browser will skip autodetection of the content
|
| + * and will display all text in the direction specified by the
|
| + * <code>rtl</code> flag.
|
| */
|
| PP_Bool override_direction;
|
| };
|
| -PP_COMPILE_ASSERT_STRUCT_SIZE_IN_BYTES(PP_BrowserFont_Trusted_TextRun, 24);
|
| +PP_COMPILE_ASSERT_STRUCT_SIZE_IN_BYTES(PP_TextRun_Dev, 24);
|
| /**
|
| * @}
|
| */
|
| @@ -160,17 +174,7 @@ PP_COMPILE_ASSERT_STRUCT_SIZE_IN_BYTES(PP_BrowserFont_Trusted_TextRun, 24);
|
| * @addtogroup Interfaces
|
| * @{
|
| */
|
| -/**
|
| - * Provides an interface for native browser text rendering.
|
| - *
|
| - * This API is "trusted" not for security reasons, but because it can not be
|
| - * implemented efficiently when running out-of-process in Browser Client. In
|
| - * this case, WebKit is in another process and every text call would require a
|
| - * synchronous IPC to the renderer. It is, however, available to native
|
| - * (non-NaCl) out-of-process PPAPI plugins since WebKit is available in the
|
| - * plugin process.
|
| - */
|
| -struct PPB_BrowserFont_Trusted_1_0 {
|
| +struct PPB_Font_Dev_0_6 {
|
| /**
|
| * Returns a list of all available font families on the system. You can use
|
| * this list to decide whether to Create() a font.
|
| @@ -186,9 +190,8 @@ struct PPB_BrowserFont_Trusted_1_0 {
|
| * Returns a font which best matches the given description. The return value
|
| * will have a non-zero ID on success, or zero on failure.
|
| */
|
| - PP_Resource (*Create)(
|
| - PP_Instance instance,
|
| - const struct PP_BrowserFont_Trusted_Description* description);
|
| + PP_Resource (*Create)(PP_Instance instance,
|
| + const struct PP_FontDescription_Dev* description);
|
| /**
|
| * Returns PP_TRUE if the given resource is a Font. Returns PP_FALSE if the
|
| * resource is invalid or some type other than a Font.
|
| @@ -208,8 +211,8 @@ struct PPB_BrowserFont_Trusted_1_0 {
|
| * in the description isn't Null (to prevent leaks).
|
| */
|
| PP_Bool (*Describe)(PP_Resource font,
|
| - struct PP_BrowserFont_Trusted_Description* description,
|
| - struct PP_BrowserFont_Trusted_Metrics* metrics);
|
| + struct PP_FontDescription_Dev* description,
|
| + struct PP_FontMetrics_Dev* metrics);
|
| /**
|
| * Draws the text to the image buffer.
|
| *
|
| @@ -230,7 +233,7 @@ struct PPB_BrowserFont_Trusted_1_0 {
|
| */
|
| PP_Bool (*DrawTextAt)(PP_Resource font,
|
| PP_Resource image_data,
|
| - const struct PP_BrowserFont_Trusted_TextRun* text,
|
| + const struct PP_TextRun_Dev* text,
|
| const struct PP_Point* position,
|
| uint32_t color,
|
| const struct PP_Rect* clip,
|
| @@ -245,38 +248,31 @@ struct PPB_BrowserFont_Trusted_1_0 {
|
| *
|
| * Returns -1 on failure.
|
| */
|
| - int32_t (*MeasureText)(PP_Resource font,
|
| - const struct PP_BrowserFont_Trusted_TextRun* text);
|
| + int32_t (*MeasureText)(PP_Resource font, const struct PP_TextRun_Dev* text);
|
| /**
|
| * Returns the character at the given pixel X position from the beginning of
|
| * the string. This handles complex scripts such as Arabic, where characters
|
| * may be combined or replaced depending on the context. Returns (uint32)-1
|
| * on failure.
|
| - *
|
| - * TODO(brettw) this function may be broken. See the CharPosRTL test. It
|
| - * seems to tell you "insertion point" rather than painting position. This
|
| - * is useful but maybe not what we intended here.
|
| */
|
| - uint32_t (*CharacterOffsetForPixel)(
|
| - PP_Resource font,
|
| - const struct PP_BrowserFont_Trusted_TextRun* text,
|
| - int32_t pixel_position);
|
| + uint32_t (*CharacterOffsetForPixel)(PP_Resource font,
|
| + const struct PP_TextRun_Dev* text,
|
| + int32_t pixel_position);
|
| /**
|
| * Returns the horizontal advance to the given character if the string was
|
| * placed at the given position. This handles complex scripts such as Arabic,
|
| * where characters may be combined or replaced depending on context. Returns
|
| * -1 on error.
|
| */
|
| - int32_t (*PixelOffsetForCharacter)(
|
| - PP_Resource font,
|
| - const struct PP_BrowserFont_Trusted_TextRun* text,
|
| - uint32_t char_offset);
|
| + int32_t (*PixelOffsetForCharacter)(PP_Resource font,
|
| + const struct PP_TextRun_Dev* text,
|
| + uint32_t char_offset);
|
| };
|
|
|
| -typedef struct PPB_BrowserFont_Trusted_1_0 PPB_BrowserFont_Trusted;
|
| +typedef struct PPB_Font_Dev_0_6 PPB_Font_Dev;
|
| /**
|
| * @}
|
| */
|
|
|
| -#endif /* PPAPI_C_TRUSTED_PPB_BROWSER_FONT_TRUSTED_H_ */
|
| +#endif /* PPAPI_C_DEV_PPB_FONT_DEV_H_ */
|
|
|
|
|