Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(81)

Side by Side Diff: mojo/public/bindings/pylib/generate/mojom.py

Issue 177183002: Mojo: Include "path/to/foo.mojom.h" (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: remove unnecessary abspath Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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;
OLDNEW
« no previous file with comments | « mojo/public/bindings/mojom_bindings_generator.py ('k') | mojo/public/bindings/pylib/generate/mojom_generator.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698