chromium/components/remote_cocoa/common/BUILD.gn

# Copyright 2018 The Chromium Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

import("//mojo/public/tools/bindings/mojom.gni")

mojom("mojo") {
  assert(is_mac)

  sources = [
    "alert.mojom",
    "application.mojom",
    "font.mojom",
    "menu.mojom",
    "native_widget_ns_window.mojom",
    "native_widget_ns_window_host.mojom",
    "select_file_dialog.mojom",
    "text_input_host.mojom",
  ]

  public_deps = [
    "//components/system_media_controls:mojo",
    "//mojo/public/mojom/base",
    "//services/network/public/mojom",
    "//ui/base/accelerators/mojom",
    "//ui/base/cursor/mojom",
    "//ui/base/ime/mojom",
    "//ui/base/mojom",
    "//ui/base/mojom:ui_base_types",
    "//ui/display/mojom",
    "//ui/events/mojom",
    "//ui/gfx/geometry/mojom",
    "//ui/gfx/image/mojom",
    "//ui/gfx/mojom",
    "//ui/gfx/range/mojom",
  ]

  cpp_typemaps = [
    {
      types = [
        {
          mojom = "remote_cocoa.mojom.SystemFont"
          cpp = "gfx::PlatformFontMac::SystemFontType"
        },
        {
          mojom = "remote_cocoa.mojom.FontWeight"
          cpp = "gfx::Font::Weight"
        },
        {
          mojom = "remote_cocoa.mojom.Font"
          cpp = "gfx::Font"
        },
      ]
      traits_headers = [
        "font_mojom_traits.h",
        "//ui/gfx/font.h",
        "//ui/gfx/platform_font_mac.h",
      ]
      traits_sources = [ "font_mojom_traits.cc" ]
      traits_public_deps = [
        "//ui/base/ime",
        "//ui/gfx",
      ]
    },
  ]
}

source_set("unit_tests") {
  testonly = true
  sources = [ "font_mojom_traits_unittests.cc" ]
  deps = [
    ":mojo",
    "//mojo/public/cpp/test_support:test_utils",
    "//testing/gtest",
  ]
}