OLD | NEW |
1 # Copyright 2013 The Chromium Authors. All rights reserved. | 1 # Copyright 2013 The Chromium Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 # mojom's classes provide an interface to mojo modules. Modules are collections | 5 # mojom's classes provide an interface to mojo modules. Modules are collections |
6 # of interfaces and structs to be used by mojo ipc clients and servers. | 6 # of interfaces and structs to be used by mojo ipc clients and servers. |
7 # | 7 # |
8 # A simple interface would be created this way: | 8 # A simple interface would be created this way: |
9 # module = mojom.Module('Foo') | 9 # module = mojom.Module('Foo') |
10 # interface = module.AddInterface('Bar') | 10 # interface = module.AddInterface('Bar') |
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
159 | 159 |
160 class Enum(object): | 160 class Enum(object): |
161 def __init__(self, name = None): | 161 def __init__(self, name = None): |
162 self.name = name | 162 self.name = name |
163 self.fields = [] | 163 self.fields = [] |
164 | 164 |
165 | 165 |
166 class Module(object): | 166 class Module(object): |
167 def __init__(self, name = None, namespace = None): | 167 def __init__(self, name = None, namespace = None): |
168 self.name = name | 168 self.name = name |
| 169 self.path = name |
169 self.namespace = namespace | 170 self.namespace = namespace |
170 self.structs = [] | 171 self.structs = [] |
171 self.interfaces = [] | 172 self.interfaces = [] |
172 | 173 |
173 def AddInterface(self, name): | 174 def AddInterface(self, name): |
174 interface = Interface(name); | 175 interface = Interface(name); |
175 self.interfaces.append(interface) | 176 self.interfaces.append(interface) |
176 return interface; | 177 return interface; |
177 | 178 |
178 def AddStruct(self, name): | 179 def AddStruct(self, name): |
179 struct = Struct(name) | 180 struct = Struct(name) |
180 self.structs.append(struct) | 181 self.structs.append(struct) |
181 return struct; | 182 return struct; |
OLD | NEW |