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

Unified Diff: ppapi/generators/idl_c_header.py

Issue 7753042: Update generator for Chrome generation as the default case (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ppapi/generators/generator.py ('k') | ppapi/generators/idl_generator.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/generators/idl_c_header.py
===================================================================
--- ppapi/generators/idl_c_header.py (revision 98485)
+++ ppapi/generators/idl_c_header.py (working copy)
@@ -114,7 +114,18 @@
out = '#define %s \\\n %s' % (name, value)
return '%s\n' % out
+ def GetVersionString(self, node):
+ # If an interface name is specified, use that
+ iname = node.GetProperty('iname')
+ if iname: return iname
+ # Otherwise, the interface name is the object's name
+ # With '_Dev' replaced by '(Dev)' if it's a Dev interface.
+ name = node.GetName()
+ if len(name) > 4 and name[-4:] == '_Dev':
+ name = '%s(Dev)' % name[:-4]
+ return name
+
def GetOutFile(self, filenode, options):
savename = GetOutFileName(filenode, GetOption('dstroot'))
return IDLOutFile(savename)
@@ -163,7 +174,7 @@
out.Write('\n')
for node in filenode.GetListOf('Interface'):
idefs = ''
- name = node.GetName()
+ name = self.GetVersionString(node)
macro = node.GetProperty('macro')
if not macro:
macro = self.GetMacro(node)
« no previous file with comments | « ppapi/generators/generator.py ('k') | ppapi/generators/idl_generator.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698