summaryrefslogtreecommitdiffstats
path: root/ppapi/c
diff options
context:
space:
mode:
authorbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-10-04 15:34:49 +0000
committerbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-10-04 15:34:49 +0000
commit3fc769ef74a35fcf38aa4d78b7747d18139a7645 (patch)
tree2aa9dc408fceb4d01b759980b78648ffad085b81 /ppapi/c
parent721768a21b6aaa5e04efd10f853467965312e6bb (diff)
downloadchromium_src-3fc769ef74a35fcf38aa4d78b7747d18139a7645.zip
chromium_src-3fc769ef74a35fcf38aa4d78b7747d18139a7645.tar.gz
chromium_src-3fc769ef74a35fcf38aa4d78b7747d18139a7645.tar.bz2
Convert font, console, buffer, and find to IDL.
TEST=none BUG=none Review URL: http://codereview.chromium.org/8124015 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@103905 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ppapi/c')
-rw-r--r--ppapi/c/dev/ppb_buffer_dev.h52
-rw-r--r--ppapi/c/dev/ppb_console_dev.h31
-rw-r--r--ppapi/c/dev/ppb_find_dev.h38
-rw-r--r--ppapi/c/dev/ppb_font_dev.h77
4 files changed, 139 insertions, 59 deletions
diff --git a/ppapi/c/dev/ppb_buffer_dev.h b/ppapi/c/dev/ppb_buffer_dev.h
index 5a65fbc..785fc3a 100644
--- a/ppapi/c/dev/ppb_buffer_dev.h
+++ b/ppapi/c/dev/ppb_buffer_dev.h
@@ -1,38 +1,62 @@
-/* Copyright (c) 2010 The Chromium Authors. All rights reserved.
+/* 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.
*/
+
+/* From dev/ppb_buffer_dev.idl modified Fri Aug 26 13:58:06 2011. */
+
#ifndef PPAPI_C_DEV_PPB_BUFFER_DEV_H_
#define PPAPI_C_DEV_PPB_BUFFER_DEV_H_
#include "ppapi/c/pp_bool.h"
#include "ppapi/c/pp_instance.h"
+#include "ppapi/c/pp_macros.h"
#include "ppapi/c/pp_resource.h"
#include "ppapi/c/pp_stdint.h"
#define PPB_BUFFER_DEV_INTERFACE_0_4 "PPB_Buffer(Dev);0.4"
#define PPB_BUFFER_DEV_INTERFACE PPB_BUFFER_DEV_INTERFACE_0_4
+/**
+ * @file
+ * This file defines the <code>PPB_Buffer_Dev</code> interface.
+ */
+
+
+/**
+ * @addtogroup Interfaces
+ * @{
+ */
struct 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.
+ /**
+ * 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)(PP_Instance instance, 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.
+ /**
+ * 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)(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.
+ /**
+ * 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)(PP_Resource resource, uint32_t* size_in_bytes);
-
- // Maps this buffer into the plugin address space and returns a pointer to the
- // beginning of the data.
+ /**
+ * Maps this buffer into the plugin address space and returns a pointer to
+ * the beginning of the data.
+ */
void* (*Map)(PP_Resource resource);
-
+ /**
+ * Unmaps this buffer.
+ */
void (*Unmap)(PP_Resource resource);
};
+/**
+ * @}
+ */
#endif /* PPAPI_C_DEV_PPB_BUFFER_DEV_H_ */
diff --git a/ppapi/c/dev/ppb_console_dev.h b/ppapi/c/dev/ppb_console_dev.h
index 2a57ede..ede1a3b5 100644
--- a/ppapi/c/dev/ppb_console_dev.h
+++ b/ppapi/c/dev/ppb_console_dev.h
@@ -2,22 +2,46 @@
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
+
+/* From dev/ppb_console_dev.idl modified Fri Aug 26 13:53:19 2011. */
+
#ifndef PPAPI_C_DEV_PPB_CONSOLE_DEV_H_
#define PPAPI_C_DEV_PPB_CONSOLE_DEV_H_
+#include "ppapi/c/pp_bool.h"
#include "ppapi/c/pp_instance.h"
+#include "ppapi/c/pp_macros.h"
+#include "ppapi/c/pp_stdint.h"
#include "ppapi/c/pp_var.h"
#define PPB_CONSOLE_DEV_INTERFACE_0_1 "PPB_Console(Dev);0.1"
#define PPB_CONSOLE_DEV_INTERFACE PPB_CONSOLE_DEV_INTERFACE_0_1
+/**
+ * @file
+ * This file defines the <code>PPB_Console_Dev</code> interface.
+ */
+
+
+/**
+ * @addtogroup Enums
+ * @{
+ */
typedef enum {
PP_LOGLEVEL_TIP = 0,
PP_LOGLEVEL_LOG,
PP_LOGLEVEL_WARNING,
PP_LOGLEVEL_ERROR
} PP_LogLevel_Dev;
+PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_LogLevel_Dev, 4);
+/**
+ * @}
+ */
+/**
+ * @addtogroup Interfaces
+ * @{
+ */
struct PPB_Console_Dev {
/**
* Logs the given message to the JavaScript console associated with the
@@ -26,7 +50,6 @@ struct PPB_Console_Dev {
* The value may be any type of Var.
*/
void (*Log)(PP_Instance instance, PP_LogLevel_Dev level, struct 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.
@@ -42,5 +65,9 @@ struct PPB_Console_Dev {
struct PP_Var source,
struct PP_Var value);
};
+/**
+ * @}
+ */
+
+#endif /* PPAPI_C_DEV_PPB_CONSOLE_DEV_H_ */
-#endif // PPAPI_C_DEV_PPB_CONSOLE_DEV_H_
diff --git a/ppapi/c/dev/ppb_find_dev.h b/ppapi/c/dev/ppb_find_dev.h
index bdaec7fa..4cefc9c 100644
--- a/ppapi/c/dev/ppb_find_dev.h
+++ b/ppapi/c/dev/ppb_find_dev.h
@@ -1,31 +1,49 @@
-/* Copyright (c) 2010 The Chromium Authors. All rights reserved.
+/* 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.
*/
+
+/* From dev/ppb_find_dev.idl modified Tue Oct 4 08:34:10 2011. */
+
#ifndef PPAPI_C_DEV_PPB_FIND_DEV_H_
#define PPAPI_C_DEV_PPB_FIND_DEV_H_
#include "ppapi/c/pp_bool.h"
#include "ppapi/c/pp_instance.h"
+#include "ppapi/c/pp_macros.h"
#include "ppapi/c/pp_stdint.h"
#define PPB_FIND_DEV_INTERFACE_0_3 "PPB_Find(Dev);0.3"
#define PPB_FIND_DEV_INTERFACE PPB_FIND_DEV_INTERFACE_0_3
+/**
+ * @file
+ * This file defines the <code>PPB_Find_Dev</code> interface.
+ */
+
+
+/**
+ * @addtogroup Interfaces
+ * @{
+ */
struct 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 finalResult set
- // to PP_TRUE.
+ /**
+ * 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)(PP_Instance instance,
int32_t total,
PP_Bool final_result);
-
- // Updates the index of the currently selected search item.
- void (*SelectedFindResultChanged)(PP_Instance instance,
- int32_t index);
-
+ /**
+ * Updates the index of the currently selected search item.
+ */
+ void (*SelectedFindResultChanged)(PP_Instance instance, int32_t index);
};
+/**
+ * @}
+ */
#endif /* PPAPI_C_DEV_PPB_FIND_DEV_H_ */
diff --git a/ppapi/c/dev/ppb_font_dev.h b/ppapi/c/dev/ppb_font_dev.h
index fd2652e..700692d 100644
--- a/ppapi/c/dev/ppb_font_dev.h
+++ b/ppapi/c/dev/ppb_font_dev.h
@@ -1,30 +1,42 @@
-/* Copyright (c) 2010 The Chromium Authors. All rights reserved.
+/* 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.
*/
+
+/* From dev/ppb_font_dev.idl modified Mon Oct 3 16:33:50 2011. */
+
#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"
#include "ppapi/c/pp_macros.h"
+#include "ppapi/c/pp_point.h"
+#include "ppapi/c/pp_rect.h"
#include "ppapi/c/pp_resource.h"
+#include "ppapi/c/pp_size.h"
#include "ppapi/c/pp_stdint.h"
#include "ppapi/c/pp_var.h"
#define PPB_FONT_DEV_INTERFACE_0_6 "PPB_Font(Dev);0.6"
#define PPB_FONT_DEV_INTERFACE PPB_FONT_DEV_INTERFACE_0_6
-struct PP_Point;
-struct PP_Rect;
+/**
+ * @file
+ * This file defines the <code>PPB_Font_Dev</code> interface.
+ */
+
+/**
+ * @addtogroup Enums
+ * @{
+ */
typedef enum {
/**
* 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.
@@ -40,19 +52,26 @@ PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_FontFamily_Dev, 4);
*/
typedef enum {
PP_FONTWEIGHT_100 = 0,
- PP_FONTWEIGHT_200,
- PP_FONTWEIGHT_300,
- PP_FONTWEIGHT_400,
- PP_FONTWEIGHT_500,
- PP_FONTWEIGHT_600,
- PP_FONTWEIGHT_700,
- PP_FONTWEIGHT_800,
- PP_FONTWEIGHT_900,
- PP_FONTWEIGHT_NORMAL = PP_FONTWEIGHT_400,
- PP_FONTWEIGHT_BOLD = PP_FONTWEIGHT_700
+ 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
} PP_FontWeight_Dev;
PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_FontWeight_Dev, 4);
+/**
+ * @}
+ */
+/**
+ * @addtogroup Structs
+ * @{
+ */
struct PP_FontDescription_Dev {
/**
* Font face name as a string. This can also be an undefined var, in which
@@ -61,7 +80,6 @@ struct PP_FontDescription_Dev {
* font.
*/
struct 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,
@@ -73,7 +91,6 @@ struct PP_FontDescription_Dev {
* is serif or sans serif.
*/
PP_FontFamily_Dev family;
-
/**
* Size in pixels.
*
@@ -83,15 +100,12 @@ struct PP_FontDescription_Dev {
* 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
@@ -99,7 +113,6 @@ struct PP_FontDescription_Dev {
*/
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
@@ -126,12 +139,10 @@ struct PP_TextRun_Dev {
* treated as a 0-length string).
*/
struct 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
@@ -139,7 +150,14 @@ struct PP_TextRun_Dev {
PP_Bool override_direction;
};
PP_COMPILE_ASSERT_STRUCT_SIZE_IN_BYTES(PP_TextRun_Dev, 24);
+/**
+ * @}
+ */
+/**
+ * @addtogroup Interfaces
+ * @{
+ */
struct PPB_Font_Dev {
/**
* Returns a list of all available font families on the system. You can use
@@ -152,20 +170,17 @@ struct PPB_Font_Dev {
* invalid instance).
*/
struct PP_Var (*GetFontFamilies)(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)(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.
*/
PP_Bool (*IsFont)(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
@@ -182,7 +197,6 @@ struct PPB_Font_Dev {
PP_Bool (*Describe)(PP_Resource font,
struct PP_FontDescription_Dev* description,
struct PP_FontMetrics_Dev* metrics);
-
/**
* Draws the text to the image buffer.
*
@@ -208,7 +222,6 @@ struct PPB_Font_Dev {
uint32_t color,
const struct PP_Rect* clip,
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.
@@ -219,9 +232,7 @@ struct PPB_Font_Dev {
*
* Returns -1 on failure.
*/
- int32_t (*MeasureText)(PP_Resource font,
- const struct PP_TextRun_Dev* 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
@@ -231,7 +242,6 @@ struct PPB_Font_Dev {
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,
@@ -241,9 +251,10 @@ struct PPB_Font_Dev {
int32_t (*PixelOffsetForCharacter)(PP_Resource font,
const struct PP_TextRun_Dev* text,
uint32_t char_offset);
-
-
};
+/**
+ * @}
+ */
#endif /* PPAPI_C_DEV_PPB_FONT_DEV_H_ */