Chromium Code Reviews| Index: ppapi/c/pp_input_event.h |
| =================================================================== |
| --- ppapi/c/pp_input_event.h (revision 72639) |
| +++ ppapi/c/pp_input_event.h (working copy) |
| @@ -8,9 +8,6 @@ |
| /** |
| * @file |
| * Defines the API ... |
| - * |
| - * @addtogroup PP |
| - * @{ |
| */ |
| #include "ppapi/c/pp_bool.h" |
| @@ -18,14 +15,29 @@ |
| #include "ppapi/c/pp_stdint.h" |
| #include "ppapi/c/pp_time.h" |
| +/** |
| + * |
| + * @addtogroup Enums |
| + * @{ |
| + */ |
| typedef enum { |
| PP_INPUTEVENT_MOUSEBUTTON_NONE = -1, |
| PP_INPUTEVENT_MOUSEBUTTON_LEFT = 0, |
| PP_INPUTEVENT_MOUSEBUTTON_MIDDLE = 1, |
| PP_INPUTEVENT_MOUSEBUTTON_RIGHT = 2 |
| } PP_InputEvent_MouseButton; |
| + |
| +/** |
| + * @} |
| + */ |
| + |
| PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_InputEvent_MouseButton, 4); |
|
dmichael(do not use this one)
2011/01/27 21:46:56
Again, please leave the assert immediately after t
|
| +/** |
| + * |
| + * @addtogroup Enums |
| + * @{ |
| + */ |
| typedef enum { |
| PP_INPUTEVENT_TYPE_UNDEFINED = -1, |
| PP_INPUTEVENT_TYPE_MOUSEDOWN = 0, // PP_InputEvent_Mouse |
| @@ -40,8 +52,17 @@ |
| PP_INPUTEVENT_TYPE_CHAR = 9, // PP_InputEvent_Character |
| PP_INPUTEVENT_TYPE_CONTEXTMENU = 10 // PP_InputEvent_Mouse |
| } PP_InputEvent_Type; |
| +/** |
| + * @} |
| + */ |
| + |
| PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_InputEvent_Type, 4); |
| +/** |
| + * |
| + * @addtogroup Enums |
| + * @{ |
| + */ |
| typedef enum { |
| PP_INPUTEVENT_MODIFIER_SHIFTKEY = 1 << 0, |
| PP_INPUTEVENT_MODIFIER_CONTROLKEY = 1 << 1, |
| @@ -55,9 +76,18 @@ |
| PP_INPUTEVENT_MODIFIER_CAPSLOCKKEY = 1 << 9, |
| PP_INPUTEVENT_MODIFIER_NUMLOCKKEY = 1 << 10 |
| } PP_InputEvent_Modifier; |
| +/** |
| + * @} |
| + */ |
| + |
| PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_InputEvent_Modifier, 4); |
| /** |
| + * @addtogroup Structs |
| + * @{ |
| + */ |
| + |
| +/** |
| * An event representing a key up or down event. |
| * |
| * Key up and down events correspond to physical keys on the keyboard. The |
| @@ -70,6 +100,7 @@ |
| * click elsewhere on the web page, the plugin focus will be lost and no more |
| * input events will be delivered. If you depend on getting key up events, you |
| * will also want to handle "lost focus" as the equivalent of "all keys up." |
| + * |
| */ |
| struct PP_InputEvent_Key { |
| /** A combination of the EVENT_MODIFIER flags. */ |
| @@ -82,9 +113,18 @@ |
| */ |
| uint32_t key_code; |
| }; |
| +/** |
| + * @} |
| + */ |
| + |
| PP_COMPILE_ASSERT_STRUCT_SIZE_IN_BYTES(PP_InputEvent_Key, 8); |
| /** |
| + * @addtogroup Structs |
| + * @{ |
| + */ |
| + |
| +/** |
| * An event representing a typed character. |
| * |
| * Normally, the program will receive a key down event, followed by a character |
| @@ -103,6 +143,7 @@ |
| * an 'R', the system might send unlaut down, umlaut up, 'R' key down, umlaut |
| * character ("whoops, I can't combine it with 'R', I better just send the raw |
| * unlaut so it isn't lost"), 'R' character event, 'R' key up. |
| + * |
| */ |
| struct PP_InputEvent_Character { |
| /** A combination of the EVENT_MODIFIER flags. */ |
| @@ -116,8 +157,17 @@ |
| */ |
| char text[5]; |
| }; |
| +/** |
| + * @} |
| + */ |
| + |
| PP_COMPILE_ASSERT_STRUCT_SIZE_IN_BYTES(PP_InputEvent_Character, 12); |
| +/** |
| + * @addtogroup Structs |
| + * @{ |
| + */ |
| + |
| /** Represents a mouse event for everything other than the mouse wheel. */ |
| struct PP_InputEvent_Mouse { |
| /** A combination of the EVENT_MODIFIER flags. */ |
| @@ -143,8 +193,16 @@ |
| /** TODO(brettw) figure out exactly what this means. */ |
| int32_t click_count; |
| }; |
| +/** |
| + * @} |
| + */ |
| + |
| PP_COMPILE_ASSERT_STRUCT_SIZE_IN_BYTES(PP_InputEvent_Mouse, 20); |
| +/** |
| + * @addtogroup Structs |
| + * @{ |
| + */ |
| struct PP_InputEvent_Wheel { |
| /** A combination of the EVENT_MODIFIER flags. */ |
| uint32_t modifier; |
| @@ -156,8 +214,17 @@ |
| PP_Bool scroll_by_page; |
| }; |
| +/** |
| + * @} |
| + */ |
| + |
| PP_COMPILE_ASSERT_STRUCT_SIZE_IN_BYTES(PP_InputEvent_Wheel, 24); |
| +/** |
| + * |
| + * @addtogroup Structs |
| + * @{ |
| + */ |
| struct PP_InputEvent { |
| /** Identifies the type of the event. */ |
| PP_InputEvent_Type type; |
| @@ -187,11 +254,10 @@ |
| char padding[64]; |
| } u; |
| }; |
| -PP_COMPILE_ASSERT_STRUCT_SIZE_IN_BYTES(PP_InputEvent, 80); |
| - |
| /** |
| * @} |
| - * End of addtogroup PP |
| */ |
| +PP_COMPILE_ASSERT_STRUCT_SIZE_IN_BYTES(PP_InputEvent, 80); |
| + |
| #endif /* PPAPI_C_PP_INPUT_EVENT_H_ */ |