summaryrefslogtreecommitdiffstats
path: root/webkit/plugins/ppapi/event_conversion.h
blob: 71beee6c8fad9a893d8f3962559fe4db31afb5e3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
// Copyright (c) 2010 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.

#ifndef WEBKIT_PLUGINS_PPAPI_EVENT_CONVERSION_H_
#define WEBKIT_PLUGINS_PPAPI_EVENT_CONVERSION_H_

#include <vector>

struct PP_InputEvent;

namespace WebKit {
class WebInputEvent;
}

namespace webkit {
namespace ppapi {

// Converts the given WebKit event to one or possibly multiple PP_InputEvents.
// The generated events will be filled into the given vector. On failure, no
// events will ge generated and the vector will be empty.
void CreatePPEvent(const WebKit::WebInputEvent& event,
                   std::vector<PP_InputEvent>* pp_events);

// Creates a WebInputEvent from the given PP_InputEvent.  If it fails, returns
// NULL.  The caller owns the created object on success.
WebKit::WebInputEvent* CreateWebInputEvent(const PP_InputEvent& event);

}  // namespace ppapi
}  // namespace webkit

#endif  // WEBKIT_PLUGINS_PPAPI_EVENT_CONVERSION_H_