blob: 39dcda99309048b0eabcebcc91de54517b5ada34 [file] [log] [blame]
[email protected]256513872012-01-05 15:41:521/* Copyright (c) 2012 The Chromium Authors. All rights reserved.
[email protected]6ea69542010-12-20 18:15:592 * Use of this source code is governed by a BSD-style license that can be
3 * found in the LICENSE file.
4 */
[email protected]9b37f4802011-07-19 00:09:285
[email protected]256513872012-01-05 15:41:526/* From pp_point.idl modified Wed Oct 5 14:06:02 2011. */
[email protected]9b37f4802011-07-19 00:09:287
[email protected]1758e882010-11-01 16:16:508#ifndef PPAPI_C_PP_POINT_H_
9#define PPAPI_C_PP_POINT_H_
10
[email protected]9b37f4802011-07-19 00:09:2811#include "ppapi/c/pp_macros.h"
12#include "ppapi/c/pp_stdint.h"
13
[email protected]1758e882010-11-01 16:16:5014/**
15 * @file
[email protected]590872fa2011-02-03 22:47:0916 * This file defines the API to create a 2 dimensional point.
17 * 0,0 is the upper-left starting coordinate.
[email protected]1758e882010-11-01 16:16:5018 */
19
[email protected]1758e882010-11-01 16:16:5020
[email protected]040d5e82011-01-28 15:38:3821/**
[email protected]040d5e82011-01-28 15:38:3822 * @addtogroup Structs
23 * @{
24 */
[email protected]590872fa2011-02-03 22:47:0925/**
[email protected]493d14212011-07-07 15:38:4826 * The PP_Point structure defines the integer x and y coordinates of a point.
[email protected]590872fa2011-02-03 22:47:0927 */
[email protected]1758e882010-11-01 16:16:5028struct PP_Point {
[email protected]590872fa2011-02-03 22:47:0929 /**
30 * This value represents the horizontal coordinate of a point, starting with 0
31 * as the left-most coordinate.
32 */
[email protected]1758e882010-11-01 16:16:5033 int32_t x;
[email protected]590872fa2011-02-03 22:47:0934 /**
35 * This value represents the vertical coordinate of a point, starting with 0
36 * as the top-most coordinate.
37 */
[email protected]1758e882010-11-01 16:16:5038 int32_t y;
39};
[email protected]1ad2a1db2010-12-13 20:04:3140PP_COMPILE_ASSERT_STRUCT_SIZE_IN_BYTES(PP_Point, 8);
[email protected]493d14212011-07-07 15:38:4841
42/**
43 * The PP_FloatPoint structure defines the floating-point x and y coordinates
44 * of a point.
45 */
46struct PP_FloatPoint {
47 float x;
48 float y;
49};
50PP_COMPILE_ASSERT_STRUCT_SIZE_IN_BYTES(PP_FloatPoint, 8);
[email protected]040d5e82011-01-28 15:38:3851/**
52 * @}
53 */
[email protected]1758e882010-11-01 16:16:5054
[email protected]040d5e82011-01-28 15:38:3855/**
56 * @addtogroup Functions
57 * @{
58 */
[email protected]590872fa2011-02-03 22:47:0959
60/**
[email protected]c5495952011-06-30 22:57:1761 * PP_MakePoint() creates a <code>PP_Point</code> given the x and y coordinates
62 * as int32_t values.
[email protected]b6cf7682011-08-12 15:59:4963 *
[email protected]590872fa2011-02-03 22:47:0964 * @param[in] x An int32_t value representing a horizontal coordinate of a
65 * point, starting with 0 as the left-most coordinate.
66 * @param[in] y An int32_t value representing a vertical coordinate of a point,
67 * starting with 0 as the top-most coordinate.
[email protected]b6cf7682011-08-12 15:59:4968 *
[email protected]c5495952011-06-30 22:57:1769 * @return A <code>PP_Point</code> structure.
[email protected]590872fa2011-02-03 22:47:0970 */
[email protected]6f2e3912010-11-05 14:45:4471PP_INLINE struct PP_Point PP_MakePoint(int32_t x, int32_t y) {
[email protected]1758e882010-11-01 16:16:5072 struct PP_Point ret;
73 ret.x = x;
74 ret.y = y;
75 return ret;
76}
[email protected]493d14212011-07-07 15:38:4877
78PP_INLINE struct PP_FloatPoint PP_MakeFloatPoint(float x, float y) {
79 struct PP_FloatPoint ret;
80 ret.x = x;
81 ret.y = y;
82 return ret;
83}
[email protected]1758e882010-11-01 16:16:5084/**
85 * @}
[email protected]1758e882010-11-01 16:16:5086 */
87
[email protected]6ea69542010-12-20 18:15:5988#endif /* PPAPI_C_PP_POINT_H_ */
89