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"
|
|
|
|
|
|
|
|
namespace gfx {
|
|
|
|
class Point;
|
|
|
|
class Size;
|
|
|
|
class Rect;
|
|
|
|
class Display;
|
|
|
|
}
|
2014-10-24 04:48:52 +00:00
|
|
|
|
|
|
|
namespace mate {
|
|
|
|
|
|
|
|
template<>
|
|
|
|
struct Converter<gfx::Point> {
|
2015-05-22 11:11:22 +00:00
|
|
|
static v8::Local<v8::Value> ToV8(v8::Isolate* isolate,
|
2015-01-14 22:38:51 +00:00
|
|
|
const gfx::Point& val);
|
|
|
|
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
|
|
|
};
|
|
|
|
|
|
|
|
template<>
|
|
|
|
struct Converter<gfx::Size> {
|
2015-05-22 11:11:22 +00:00
|
|
|
static v8::Local<v8::Value> ToV8(v8::Isolate* isolate,
|
2015-01-14 22:38:51 +00:00
|
|
|
const gfx::Size& val);
|
|
|
|
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
|
|
|
};
|
|
|
|
|
|
|
|
template<>
|
|
|
|
struct Converter<gfx::Rect> {
|
2015-05-22 11:11:22 +00:00
|
|
|
static v8::Local<v8::Value> ToV8(v8::Isolate* isolate,
|
2015-01-14 22:38:51 +00:00
|
|
|
const gfx::Rect& val);
|
|
|
|
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
|
|
|
};
|
|
|
|
|
|
|
|
template<>
|
|
|
|
struct Converter<gfx::Display> {
|
2015-05-22 11:11:22 +00:00
|
|
|
static v8::Local<v8::Value> ToV8(v8::Isolate* isolate,
|
2015-01-14 22:38:51 +00:00
|
|
|
const gfx::Display& val);
|
|
|
|
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::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_
|