electron/shell/common/gin_converters/gfx_converter.h
Cheng Zhao 19223952a8
chore: remove native_mate (Part 8) (#20598)
* refactor: convert methods of AutoUpdater to gin

* refactor: converter in map_converter.h is no more needed

* refactor: use gin in crash_reporter

* refactor: remove native_mate_converters/map_converter.h

* refactor: implement gfx_converter with gin

* refactor: convert methods of NativeImage to gin

* refactor: add gin_helper::Arguments

* fix: use gin_helper::Arguments to parse multi-type parameters
2019-10-18 09:31:29 +09:00

67 lines
1.8 KiB
C++

// Copyright (c) 2019 GitHub, Inc.
// Use of this source code is governed by the MIT license that can be
// found in the LICENSE file.
#ifndef SHELL_COMMON_GIN_CONVERTERS_GFX_CONVERTER_H_
#define SHELL_COMMON_GIN_CONVERTERS_GFX_CONVERTER_H_
#include "gin/converter.h"
namespace display {
class Display;
}
namespace gfx {
class Point;
class PointF;
class Size;
class Rect;
} // 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);
};
} // namespace gin
#endif // SHELL_COMMON_GIN_CONVERTERS_GFX_CONVERTER_H_