chromium/mojo/public/interfaces/bindings/tests/test_native_types.mojom

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

module mojo.test;

import "mojo/public/interfaces/bindings/tests/rect.mojom";

// Used to verify that structs can be declared with no body in mojom.

[Native]
struct PickledStruct;

[Native]
enum PickledEnum;

struct PickleContainer {
  PickledStruct f_struct;
  PickledEnum f_enum;
};

interface PicklePasser {
  PassPickledStruct(PickledStruct pickle) => (PickledStruct passed);
  PassPickledEnum(PickledEnum pickle) => (PickledEnum passed);
  PassPickleContainer(PickleContainer container) => (PickleContainer passed);
  PassPickles(array<PickledStruct> pickles) => (array<PickledStruct> passed);
  PassPickleArrays(array<array<PickledStruct>> pickle_arrays)
      => (array<array<PickledStruct>> passed);
};

// Used to verify support for native serialization of mojom-defined structs
// using StrucTraits with different variants of the Rect type from rect.mojom.

interface RectService {
  AddRect(TypemappedRect r);
  GetLargestRect() => (TypemappedRect largest);
  PassSharedRect(SharedTypemappedRect r) => (SharedTypemappedRect passed);
};

[Native]
struct TestNativeStructMojom;

[Native]
struct TestNativeStructWithAttachmentsMojom;

interface NativeTypeTester {
  PassNativeStruct(TestNativeStructMojom s) => (TestNativeStructMojom passed);
  PassNativeStructWithAttachments(TestNativeStructWithAttachmentsMojom s)
      => (TestNativeStructWithAttachmentsMojom s);
};