gfx_converter.h 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. // Copyright (c) 2014 GitHub, Inc.
  2. // Use of this source code is governed by the MIT license that can be
  3. // found in the LICENSE file.
  4. #ifndef ATOM_COMMON_NATIVE_MATE_CONVERTERS_GFX_CONVERTER_H_
  5. #define ATOM_COMMON_NATIVE_MATE_CONVERTERS_GFX_CONVERTER_H_
  6. #include "native_mate/converter.h"
  7. namespace display {
  8. class Display;
  9. }
  10. namespace gfx {
  11. class Point;
  12. class Size;
  13. class Rect;
  14. } // namespace gfx
  15. namespace mate {
  16. template <>
  17. struct Converter<gfx::Point> {
  18. static v8::Local<v8::Value> ToV8(v8::Isolate* isolate, const gfx::Point& val);
  19. static bool FromV8(v8::Isolate* isolate,
  20. v8::Local<v8::Value> val,
  21. gfx::Point* out);
  22. };
  23. template <>
  24. struct Converter<gfx::Size> {
  25. static v8::Local<v8::Value> ToV8(v8::Isolate* isolate, const gfx::Size& val);
  26. static bool FromV8(v8::Isolate* isolate,
  27. v8::Local<v8::Value> val,
  28. gfx::Size* out);
  29. };
  30. template <>
  31. struct Converter<gfx::Rect> {
  32. static v8::Local<v8::Value> ToV8(v8::Isolate* isolate, const gfx::Rect& val);
  33. static bool FromV8(v8::Isolate* isolate,
  34. v8::Local<v8::Value> val,
  35. gfx::Rect* out);
  36. };
  37. template <>
  38. struct Converter<display::Display> {
  39. static v8::Local<v8::Value> ToV8(v8::Isolate* isolate,
  40. const display::Display& val);
  41. static bool FromV8(v8::Isolate* isolate,
  42. v8::Local<v8::Value> val,
  43. display::Display* out);
  44. };
  45. } // namespace mate
  46. #endif // ATOM_COMMON_NATIVE_MATE_CONVERTERS_GFX_CONVERTER_H_