2015-09-18 03:06:38 +00:00
|
|
|
// Copyright (c) 2015 GitHub, Inc.
|
|
|
|
// Use of this source code is governed by the MIT license that can be
|
|
|
|
// found in the LICENSE file.
|
|
|
|
|
|
|
|
#ifndef ATOM_COMMON_NATIVE_MATE_CONVERTERS_BLINK_CONVERTER_H_
|
|
|
|
#define ATOM_COMMON_NATIVE_MATE_CONVERTERS_BLINK_CONVERTER_H_
|
|
|
|
|
|
|
|
#include "native_mate/converter.h"
|
2016-05-12 20:48:01 +00:00
|
|
|
#include "third_party/WebKit/public/web/WebCache.h"
|
2016-05-03 00:02:33 +00:00
|
|
|
#include "third_party/WebKit/public/web/WebContextMenuData.h"
|
2015-09-18 03:06:38 +00:00
|
|
|
|
|
|
|
namespace blink {
|
2015-09-18 05:33:06 +00:00
|
|
|
class WebInputEvent;
|
|
|
|
class WebMouseEvent;
|
|
|
|
class WebMouseWheelEvent;
|
|
|
|
class WebKeyboardEvent;
|
2015-09-18 03:06:38 +00:00
|
|
|
struct WebDeviceEmulationParams;
|
2015-12-17 23:10:42 +00:00
|
|
|
struct WebFindOptions;
|
2015-09-18 03:06:38 +00:00
|
|
|
struct WebFloatPoint;
|
|
|
|
struct WebPoint;
|
|
|
|
struct WebSize;
|
2015-12-21 12:54:55 +00:00
|
|
|
} // namespace blink
|
2015-09-18 03:06:38 +00:00
|
|
|
|
2015-09-18 05:33:06 +00:00
|
|
|
namespace content {
|
|
|
|
struct NativeWebKeyboardEvent;
|
|
|
|
}
|
|
|
|
|
2015-09-18 03:06:38 +00:00
|
|
|
namespace mate {
|
|
|
|
|
2015-09-18 06:09:31 +00:00
|
|
|
int GetWebInputEventType(v8::Isolate* isolate, v8::Local<v8::Value> val);
|
|
|
|
|
2015-09-18 05:33:06 +00:00
|
|
|
template<>
|
|
|
|
struct Converter<blink::WebInputEvent> {
|
|
|
|
static bool FromV8(v8::Isolate* isolate, v8::Local<v8::Value> val,
|
|
|
|
blink::WebInputEvent* out);
|
|
|
|
};
|
|
|
|
|
|
|
|
template<>
|
|
|
|
struct Converter<blink::WebKeyboardEvent> {
|
|
|
|
static bool FromV8(v8::Isolate* isolate, v8::Local<v8::Value> val,
|
|
|
|
blink::WebKeyboardEvent* out);
|
|
|
|
};
|
|
|
|
|
|
|
|
template<>
|
|
|
|
struct Converter<content::NativeWebKeyboardEvent> {
|
|
|
|
static bool FromV8(v8::Isolate* isolate, v8::Local<v8::Value> val,
|
|
|
|
content::NativeWebKeyboardEvent* out);
|
|
|
|
};
|
|
|
|
|
|
|
|
template<>
|
|
|
|
struct Converter<blink::WebMouseEvent> {
|
|
|
|
static bool FromV8(v8::Isolate* isolate, v8::Local<v8::Value> val,
|
|
|
|
blink::WebMouseEvent* out);
|
|
|
|
};
|
|
|
|
|
|
|
|
template<>
|
|
|
|
struct Converter<blink::WebMouseWheelEvent> {
|
|
|
|
static bool FromV8(v8::Isolate* isolate, v8::Local<v8::Value> val,
|
|
|
|
blink::WebMouseWheelEvent* out);
|
|
|
|
};
|
|
|
|
|
2015-09-18 03:06:38 +00:00
|
|
|
template<>
|
|
|
|
struct Converter<blink::WebFloatPoint> {
|
|
|
|
static bool FromV8(v8::Isolate* isolate, v8::Local<v8::Value> val,
|
|
|
|
blink::WebFloatPoint* out);
|
|
|
|
};
|
|
|
|
|
|
|
|
template<>
|
|
|
|
struct Converter<blink::WebPoint> {
|
|
|
|
static bool FromV8(v8::Isolate* isolate, v8::Local<v8::Value> val,
|
|
|
|
blink::WebPoint* out);
|
|
|
|
};
|
|
|
|
|
|
|
|
template<>
|
|
|
|
struct Converter<blink::WebSize> {
|
|
|
|
static bool FromV8(v8::Isolate* isolate, v8::Local<v8::Value> val,
|
|
|
|
blink::WebSize* out);
|
|
|
|
};
|
|
|
|
|
|
|
|
template<>
|
|
|
|
struct Converter<blink::WebDeviceEmulationParams> {
|
|
|
|
static bool FromV8(v8::Isolate* isolate, v8::Local<v8::Value> val,
|
|
|
|
blink::WebDeviceEmulationParams* out);
|
|
|
|
};
|
|
|
|
|
2015-12-17 17:27:56 +00:00
|
|
|
template<>
|
|
|
|
struct Converter<blink::WebFindOptions> {
|
|
|
|
static bool FromV8(v8::Isolate* isolate, v8::Local<v8::Value> val,
|
|
|
|
blink::WebFindOptions* out);
|
|
|
|
};
|
|
|
|
|
2016-05-03 00:02:33 +00:00
|
|
|
template<>
|
|
|
|
struct Converter<blink::WebContextMenuData::MediaType> {
|
|
|
|
static v8::Local<v8::Value> ToV8(v8::Isolate* isolate,
|
|
|
|
const blink::WebContextMenuData::MediaType& in);
|
|
|
|
};
|
|
|
|
|
|
|
|
template<>
|
|
|
|
struct Converter<blink::WebContextMenuData::InputFieldType> {
|
|
|
|
static v8::Local<v8::Value> ToV8(v8::Isolate* isolate,
|
|
|
|
const blink::WebContextMenuData::InputFieldType& in);
|
|
|
|
};
|
|
|
|
|
|
|
|
v8::Local<v8::Value> EditFlagsToV8(v8::Isolate* isolate, int editFlags);
|
|
|
|
|
|
|
|
v8::Local<v8::Value> MediaFlagsToV8(v8::Isolate* isolate, int mediaFlags);
|
|
|
|
|
2016-05-12 20:48:01 +00:00
|
|
|
template<>
|
|
|
|
struct Converter<blink::WebCache::ResourceTypeStat> {
|
|
|
|
static v8::Local<v8::Value> ToV8(v8::Isolate* isolate,
|
|
|
|
const blink::WebCache::ResourceTypeStat& stat);
|
|
|
|
};
|
|
|
|
|
|
|
|
template<>
|
|
|
|
struct Converter<blink::WebCache::ResourceTypeStats> {
|
|
|
|
static v8::Local<v8::Value> ToV8(v8::Isolate* isolate,
|
|
|
|
const blink::WebCache::ResourceTypeStats& stats);
|
|
|
|
};
|
|
|
|
|
2015-09-18 03:06:38 +00:00
|
|
|
} // namespace mate
|
|
|
|
|
|
|
|
#endif // ATOM_COMMON_NATIVE_MATE_CONVERTERS_BLINK_CONVERTER_H_
|