diff options
Diffstat (limited to 'ppapi/api')
-rw-r--r-- | ppapi/api/dev/ppb_buffer_dev.idl | 51 | ||||
-rw-r--r-- | ppapi/api/dev/ppb_console_dev.idl | 49 | ||||
-rw-r--r-- | ppapi/api/dev/ppb_find_dev.idl | 33 | ||||
-rw-r--r-- | ppapi/api/dev/ppb_font_dev.idl | 245 |
4 files changed, 378 insertions, 0 deletions
diff --git a/ppapi/api/dev/ppb_buffer_dev.idl b/ppapi/api/dev/ppb_buffer_dev.idl new file mode 100644 index 0000000..9aa980e --- /dev/null +++ b/ppapi/api/dev/ppb_buffer_dev.idl @@ -0,0 +1,51 @@ +/* Copyright (c) 2011 The Chromium Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +/** + * This file defines the <code>PPB_Buffer_Dev</code> interface. + */ + +label Chrome { + M14 = 0.4 +}; + +interface PPB_Buffer_Dev { + /** + * Allocates a buffer of the given size in bytes. The return value will have + * a non-zero ID on success, or zero on failure. Failure means the module + * handle was invalid. The buffer will be initialized to contain zeroes. + */ + PP_Resource Create( + [in] PP_Instance instance, + [in] uint32_t size_in_bytes); + + /** + * Returns PP_TRUE if the given resource is a Buffer. Returns PP_FALSE if the + * resource is invalid or some type other than a Buffer. + */ + PP_Bool IsBuffer( + [in] PP_Resource resource); + + /** + * Gets the size of the buffer. Returns PP_TRUE on success, PP_FALSE + * if the resource is not a buffer. On failure, |*size_in_bytes| is not set. + */ + PP_Bool Describe( + [in] PP_Resource resource, + [out] uint32_t size_in_bytes); + + /** + * Maps this buffer into the plugin address space and returns a pointer to + * the beginning of the data. + */ + mem_t Map( + [in] PP_Resource resource); + + /** + * Unmaps this buffer. + */ + void Unmap( + [in] PP_Resource resource); +}; diff --git a/ppapi/api/dev/ppb_console_dev.idl b/ppapi/api/dev/ppb_console_dev.idl new file mode 100644 index 0000000..9848164 --- /dev/null +++ b/ppapi/api/dev/ppb_console_dev.idl @@ -0,0 +1,49 @@ +/* Copyright (c) 2011 The Chromium Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +/** + * This file defines the <code>PPB_Console_Dev</code> interface. + */ + +label Chrome { + M14 = 0.1 +}; + +[assert_size(4)] +enum PP_LogLevel_Dev { + PP_LOGLEVEL_TIP = 0, + PP_LOGLEVEL_LOG, + PP_LOGLEVEL_WARNING, + PP_LOGLEVEL_ERROR +}; + +interface PPB_Console_Dev { + /** + * Logs the given message to the JavaScript console associated with the + * given plugin instance with the given logging level. The name of the plugin + * issuing the log message will be automatically prepended to the message. + * The value may be any type of Var. + */ + void Log( + [in] PP_Instance instance, + [in] PP_LogLevel_Dev level, + [in] PP_Var value); + + /** + * Logs a message to the console with the given source information rather + * than using the internal PPAPI plugin name. The name must be a string var. + * + * The regular log function will automatically prepend the name of your + * plugin to the message as the "source" of the message. Some plugins may + * wish to override this. For example, if your plugin is a Python + * interpreter, you would want log messages to contain the source .py file + * doing the log statement rather than have "python" show up in the console. + */ + void LogWithSource( + [in] PP_Instance instance, + [in] PP_LogLevel_Dev level, + [in] PP_Var source, + [in] PP_Var value); +}; diff --git a/ppapi/api/dev/ppb_find_dev.idl b/ppapi/api/dev/ppb_find_dev.idl new file mode 100644 index 0000000..3e10c73 --- /dev/null +++ b/ppapi/api/dev/ppb_find_dev.idl @@ -0,0 +1,33 @@ +/* Copyright (c) 2011 The Chromium Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +/** + * This file defines the <code>PPB_Find_Dev</code> interface. + */ + +label Chrome { + M14 = 0.3 +}; + +interface PPB_Find_Dev { + /** + * Updates the number of find results for the current search term. If + * there are no matches 0 should be passed in. Only when the plugin has + * finished searching should it pass in the final count with final_result set + * to PP_TRUE. + */ + void NumberOfFindResultsChanged( + [in] PP_Instance instance, + [in] int32_t total, + [in] PP_Bool final_result); + + /** + * Updates the index of the currently selected search item. + */ + void SelectedFindResultChanged( + [in] PP_Instance instance, + [in] int32_t index); +}; + diff --git a/ppapi/api/dev/ppb_font_dev.idl b/ppapi/api/dev/ppb_font_dev.idl new file mode 100644 index 0000000..5fb0d1a2 --- /dev/null +++ b/ppapi/api/dev/ppb_font_dev.idl @@ -0,0 +1,245 @@ +/* Copyright (c) 2011 The Chromium Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +/** + * This file defines the <code>PPB_Font_Dev</code> interface. + */ +label Chrome { + M14 = 0.6 +}; + +[assert_size(4)] +enum PP_FontFamily_Dev { + /** + * Uses the user's default web page font (normally either the default serif + * or sans serif font). + */ + PP_FONTFAMILY_DEFAULT = 0, + + /** + * These families will use the default web page font corresponding to the + * given family. + */ + PP_FONTFAMILY_SERIF = 1, + PP_FONTFAMILY_SANSSERIF = 2, + PP_FONTFAMILY_MONOSPACE = 3 +}; + +/** + * Specifies the font weight. Normally users will only use NORMAL or BOLD. + */ +[assert_size(4)] +enum PP_FontWeight_Dev { + 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 = 3, + PP_FONTWEIGHT_BOLD = 6 +}; + +[assert_size(48)] +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 + * the system, the browser will attempt to do font fallback or pick a default + * font. + */ + PP_Var face; + + /** + * When Create()ing a font and the face is an undefined var, the family + * specifies the generic font family type to use. If the face is specified, + * this will be ignored. + * + * When Describe()ing a font, the family will be the value you passed in when + * the font was created. In other words, if you specify a face name, the + * family will not be updated to reflect whether the font name you requested + * is serif or sans serif. + */ + PP_FontFamily_Dev family; + + /** + * Size in pixels. + * + * You can specify 0 to get the default font size. The default font size + * may vary depending on the requested font. The typical example is that + * the user may have a different font size for the default monospace font to + * give it a similar optical size to the proportionally spaced fonts. + */ + uint32_t size; + + /** + * Normally you will use either PP_FONTWEIGHT_NORMAL or PP_FONTWEIGHT_BOLD. + */ + PP_FontWeight_Dev weight; + + PP_Bool italic; + PP_Bool small_caps; + + /** + * Adjustment to apply to letter and word spacing, respectively. Initialize + * to 0 to get normal spacing. Negative values bring letters/words closer + * together, positive values separate them. + */ + int32_t letter_spacing; + int32_t word_spacing; + + /** + * Ensure that this struct is 48-bytes wide by padding the end. In some + * compilers, PP_Var is 8-byte aligned, so those compilers align this struct + * on 8-byte boundaries as well and pad it to 16 bytes even without this + * padding attribute. This padding makes its size consistent across + * compilers. + */ + int32_t padding; +}; + +[assert_size(20)] +struct PP_FontMetrics_Dev { + int32_t height; + int32_t ascent; + int32_t descent; + int32_t line_spacing; + int32_t x_height; +}; + +[assert_size(24)] +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). + */ + PP_Var text; + + /** + * Set to PP_TRUE if the text is right-to-left. + */ + PP_Bool rtl; + + /** + * Set to PP_TRUE to force the directionality of the text regardless of + * content + */ + PP_Bool override_direction; +}; + +interface PPB_Font_Dev { + /** + * Returns a list of all available font families on the system. You can use + * this list to decide whether to Create() a font. + * + * The return value will be a single string with null characters delimiting + * the end of each font name. For example: "Arial\0Courier\0Times\0". + * + * Returns an undefined var on failure (this typically means you passed an + * invalid instance). + */ + PP_Var GetFontFamilies( + [in] PP_Instance instance); + + /** + * 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( + [in] PP_Instance instance, + [in] 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. + */ + PP_Bool IsFont( + [in] PP_Resource resource); + + /** + * Loads the description and metrics of the font into the given structures. + * The description will be different than the description the font was + * created with since it will be filled with the real values from the font + * that was actually selected. + * + * The PP_Var in the description should be of type Void on input. On output, + * this will contain the string and will have a reference count of 1. The + * plugin is responsible for calling Release on this var. + * + * Returns PP_TRUE on success, PP_FALSE if the font is invalid or if the Var + * in the description isn't Null (to prevent leaks). + */ + PP_Bool Describe( + [in] PP_Resource font, + [out] PP_FontDescription_Dev description, + [out] PP_FontMetrics_Dev metrics); + + /** + * Draws the text to the image buffer. + * + * The given point represents the baseline of the left edge of the font, + * regardless of whether it is left-to-right or right-to-left (in the case of + * RTL text, this will actually represent the logical end of the text). + * + * The clip is optional and may be NULL. In this case, the text will be + * clipped to the image. + * + * The image_data_is_opaque flag indicates whether subpixel antialiasing can + * be performend, if it is supported. When the image below the text is + * opaque, subpixel antialiasing is supported and you should set this to + * PP_TRUE to pick up the user's default preferences. If your plugin is + * partially transparent, then subpixel antialiasing is not possible and + * grayscale antialiasing will be used instead (assuming the user has + * antialiasing enabled at all). + */ + PP_Bool DrawTextAt( + [in] PP_Resource font, + [in] PP_Resource image_data, + [in] PP_TextRun_Dev text, + [in] PP_Point position, + [in] uint32_t color, + [in] PP_Rect clip, + [in] PP_Bool image_data_is_opaque); + + /** + * Returns the width of the given string. If the font is invalid or the var + * isn't a valid string, this will return -1. + * + * Note that this function handles complex scripts such as Arabic, combining + * accents, etc. so that adding the width of substrings won't necessarily + * produce the correct width of the entire string. + * + * Returns -1 on failure. + */ + int32_t MeasureText( + [in] PP_Resource font, + [in] 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. + */ + uint32_t CharacterOffsetForPixel( + [in] PP_Resource font, + [in] PP_TextRun_Dev text, + [in] 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( + [in] PP_Resource font, + [in] PP_TextRun_Dev text, + [in] uint32_t char_offset); +}; + |