electron/shell/common/native_mate_converters/gfx_converter.h

68 lines
1.9 KiB
C
Raw Normal View History

// 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.
2019-06-19 20:56:58 +00:00
#ifndef SHELL_COMMON_NATIVE_MATE_CONVERTERS_GFX_CONVERTER_H_
#define SHELL_COMMON_NATIVE_MATE_CONVERTERS_GFX_CONVERTER_H_
#include "native_mate/converter.h"
#include "ui/gfx/geometry/point_f.h"
2016-07-04 06:08:55 +00:00
namespace display {
class Display;
}
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);
static bool FromV8(v8::Isolate* isolate,
2015-05-22 11:11:22 +00:00
v8::Local<v8::Value> val,
gfx::Point* out);
2014-10-24 04:48:52 +00:00
};
template <>
struct Converter<gfx::PointF> {
static v8::Local<v8::Value> ToV8(v8::Isolate* isolate,
const gfx::PointF& val);
static bool FromV8(v8::Isolate* isolate,
v8::Local<v8::Value> val,
gfx::PointF* out);
};
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);
static bool FromV8(v8::Isolate* isolate,
2015-05-22 11:11:22 +00:00
v8::Local<v8::Value> val,
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);
static bool FromV8(v8::Isolate* isolate,
2015-05-22 11:11:22 +00:00
v8::Local<v8::Value> val,
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);
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
2019-06-19 20:56:58 +00:00
#endif // SHELL_COMMON_NATIVE_MATE_CONVERTERS_GFX_CONVERTER_H_