2019-10-18 00:31:29 +00:00
|
|
|
// Copyright (c) 2019 GitHub, Inc.
|
|
|
|
// Use of this source code is governed by the MIT license that can be
|
|
|
|
// found in the LICENSE file.
|
|
|
|
|
2021-11-22 07:34:31 +00:00
|
|
|
#ifndef ELECTRON_SHELL_COMMON_GIN_CONVERTERS_GFX_CONVERTER_H_
|
|
|
|
#define ELECTRON_SHELL_COMMON_GIN_CONVERTERS_GFX_CONVERTER_H_
|
2019-10-18 00:31:29 +00:00
|
|
|
|
|
|
|
#include "gin/converter.h"
|
|
|
|
|
|
|
|
namespace display {
|
|
|
|
class Display;
|
|
|
|
}
|
|
|
|
|
|
|
|
namespace gfx {
|
|
|
|
class Point;
|
|
|
|
class PointF;
|
|
|
|
class Size;
|
|
|
|
class Rect;
|
2021-06-02 02:37:10 +00:00
|
|
|
enum class ResizeEdge;
|
2019-10-18 00:31:29 +00:00
|
|
|
} // namespace gfx
|
|
|
|
|
|
|
|
namespace gin {
|
|
|
|
|
|
|
|
template <>
|
|
|
|
struct Converter<gfx::Point> {
|
|
|
|
static v8::Local<v8::Value> ToV8(v8::Isolate* isolate, const gfx::Point& val);
|
|
|
|
static bool FromV8(v8::Isolate* isolate,
|
|
|
|
v8::Local<v8::Value> val,
|
|
|
|
gfx::Point* out);
|
|
|
|
};
|
|
|
|
|
|
|
|
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);
|
|
|
|
};
|
|
|
|
|
|
|
|
template <>
|
|
|
|
struct Converter<gfx::Size> {
|
|
|
|
static v8::Local<v8::Value> ToV8(v8::Isolate* isolate, const gfx::Size& val);
|
|
|
|
static bool FromV8(v8::Isolate* isolate,
|
|
|
|
v8::Local<v8::Value> val,
|
|
|
|
gfx::Size* out);
|
|
|
|
};
|
|
|
|
|
|
|
|
template <>
|
|
|
|
struct Converter<gfx::Rect> {
|
|
|
|
static v8::Local<v8::Value> ToV8(v8::Isolate* isolate, const gfx::Rect& val);
|
|
|
|
static bool FromV8(v8::Isolate* isolate,
|
|
|
|
v8::Local<v8::Value> val,
|
|
|
|
gfx::Rect* out);
|
|
|
|
};
|
|
|
|
|
|
|
|
template <>
|
|
|
|
struct Converter<display::Display> {
|
|
|
|
static v8::Local<v8::Value> ToV8(v8::Isolate* isolate,
|
|
|
|
const display::Display& val);
|
|
|
|
static bool FromV8(v8::Isolate* isolate,
|
|
|
|
v8::Local<v8::Value> val,
|
|
|
|
display::Display* out);
|
|
|
|
};
|
|
|
|
|
2021-06-02 02:37:10 +00:00
|
|
|
template <>
|
|
|
|
struct Converter<gfx::ResizeEdge> {
|
|
|
|
static v8::Local<v8::Value> ToV8(v8::Isolate* isolate,
|
|
|
|
const gfx::ResizeEdge& val);
|
|
|
|
};
|
|
|
|
|
2019-10-18 00:31:29 +00:00
|
|
|
} // namespace gin
|
|
|
|
|
2021-11-22 07:34:31 +00:00
|
|
|
#endif // ELECTRON_SHELL_COMMON_GIN_CONVERTERS_GFX_CONVERTER_H_
|