2014-10-31 18:17:05 +00:00
|
|
|
// Copyright (c) 2014 GitHub, Inc.
|
2014-10-24 04:48:52 +00:00
|
|
|
// Use of this source code is governed by the MIT license that can be
|
|
|
|
// found in the LICENSE file.
|
|
|
|
|
2014-10-24 06:37:14 +00:00
|
|
|
#ifndef ATOM_COMMON_NATIVE_MATE_CONVERTERS_GFX_CONVERTER_H_
|
|
|
|
#define ATOM_COMMON_NATIVE_MATE_CONVERTERS_GFX_CONVERTER_H_
|
|
|
|
|
2015-01-14 22:38:51 +00:00
|
|
|
#include "native_mate/converter.h"
|
|
|
|
|
2016-07-04 06:08:55 +00:00
|
|
|
namespace display {
|
|
|
|
class Display;
|
|
|
|
}
|
|
|
|
|
2015-01-14 22:38:51 +00:00
|
|
|
namespace gfx {
|
|
|
|
class Point;
|
|
|
|
class Size;
|
|
|
|
class Rect;
|
2018-04-18 01:44:10 +00:00
|
|
|
} // namespace gfx
|
2014-10-24 04:48:52 +00:00
|
|
|
|
|
|
|
namespace mate {
|
|
|
|
|
2018-04-18 01:44:10 +00:00
|
|
|
template <>
|
2014-10-24 04:48:52 +00:00
|
|
|
struct Converter<gfx::Point> {
|
2018-04-18 01:44:10 +00:00
|
|
|
static v8::Local<v8::Value> ToV8(v8::Isolate* isolate, const gfx::Point& val);
|
2015-01-14 22:38:51 +00:00
|
|
|
static bool FromV8(v8::Isolate* isolate,
|
2015-05-22 11:11:22 +00:00
|
|
|
v8::Local<v8::Value> val,
|
2015-01-14 22:38:51 +00:00
|
|
|
gfx::Point* out);
|
2014-10-24 04:48:52 +00:00
|
|
|
};
|
|
|
|
|
2018-04-18 01:44:10 +00:00
|
|
|
template <>
|
2014-10-24 04:48:52 +00:00
|
|
|
struct Converter<gfx::Size> {
|
2018-04-18 01:44:10 +00:00
|
|
|
static v8::Local<v8::Value> ToV8(v8::Isolate* isolate, const gfx::Size& val);
|
2015-01-14 22:38:51 +00:00
|
|
|
static bool FromV8(v8::Isolate* isolate,
|
2015-05-22 11:11:22 +00:00
|
|
|
v8::Local<v8::Value> val,
|
2015-01-14 22:38:51 +00:00
|
|
|
gfx::Size* out);
|
2014-10-24 04:48:52 +00:00
|
|
|
};
|
|
|
|
|
2018-04-18 01:44:10 +00:00
|
|
|
template <>
|
2014-10-24 04:48:52 +00:00
|
|
|
struct Converter<gfx::Rect> {
|
2018-04-18 01:44:10 +00:00
|
|
|
static v8::Local<v8::Value> ToV8(v8::Isolate* isolate, const gfx::Rect& val);
|
2015-01-14 22:38:51 +00:00
|
|
|
static bool FromV8(v8::Isolate* isolate,
|
2015-05-22 11:11:22 +00:00
|
|
|
v8::Local<v8::Value> val,
|
2015-01-14 22:38:51 +00:00
|
|
|
gfx::Rect* out);
|
2014-10-24 04:48:52 +00:00
|
|
|
};
|
|
|
|
|
2018-04-18 01:44:10 +00:00
|
|
|
template <>
|
2016-07-04 06:08:55 +00:00
|
|
|
struct Converter<display::Display> {
|
2015-05-22 11:11:22 +00:00
|
|
|
static v8::Local<v8::Value> ToV8(v8::Isolate* isolate,
|
2018-04-18 01:44:10 +00:00
|
|
|
const display::Display& val);
|
2015-01-14 22:38:51 +00:00
|
|
|
static bool FromV8(v8::Isolate* isolate,
|
2015-05-22 11:11:22 +00:00
|
|
|
v8::Local<v8::Value> val,
|
2016-07-04 06:08:55 +00:00
|
|
|
display::Display* out);
|
2014-10-24 04:48:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace mate
|
2014-10-24 06:37:14 +00:00
|
|
|
|
|
|
|
#endif // ATOM_COMMON_NATIVE_MATE_CONVERTERS_GFX_CONVERTER_H_
|