summaryrefslogtreecommitdiffstats
path: root/ppapi/generators
diff options
context:
space:
mode:
authornoelallen@google.com <noelallen@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-08-17 20:45:57 +0000
committernoelallen@google.com <noelallen@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-08-17 20:45:57 +0000
commit49aa13876dd02aeea1b22443a127796c9a3bfebd (patch)
tree9a5a1ecc878359f21e5fe97a9bdc6ac94fdfae3c /ppapi/generators
parent51e2f797693a966fca67779eb67475184be2c24d (diff)
downloadchromium_src-49aa13876dd02aeea1b22443a127796c9a3bfebd.zip
chromium_src-49aa13876dd02aeea1b22443a127796c9a3bfebd.tar.gz
chromium_src-49aa13876dd02aeea1b22443a127796c9a3bfebd.tar.bz2
Update placement of interface 'Define'
A minor change to the way we output the headers. This change moves the defines which are used to name the interfaces and thier versions to the top of the header, moving out of the @file block. This prevents them from being 'spewed' in the documentation. BUG= none TEST= none Review URL: http://codereview.chromium.org/7669001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@97201 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ppapi/generators')
-rw-r--r--ppapi/generators/idl_c_header.py8
-rw-r--r--ppapi/generators/idl_c_proto.py33
2 files changed, 25 insertions, 16 deletions
diff --git a/ppapi/generators/idl_c_header.py b/ppapi/generators/idl_c_header.py
index d95a7c2..72fbf2a 100644
--- a/ppapi/generators/idl_c_header.py
+++ b/ppapi/generators/idl_c_header.py
@@ -86,8 +86,14 @@ def GenerateHeader(filenode, pref, inline=True):
if include == cur_include: continue
out.Write('#include "%s"\n' % include)
+ # Generate all interface defines
+ release = 'M14'
+ out.Write('\n')
+ for node in filenode.GetListOf('Interface'):
+ out.Write( cgen.InterfaceDefs(node) )
+
# Generate the @file comment
- out.Write('\n%s\n' % cgen.Comment(fileinfo, prefix='*\n @file'))
+ out.Write('%s\n' % cgen.Comment(fileinfo, prefix='*\n @file'))
# Generate definitions.
last_group = None
diff --git a/ppapi/generators/idl_c_proto.py b/ppapi/generators/idl_c_proto.py
index f92bf14..7147bbb 100644
--- a/ppapi/generators/idl_c_proto.py
+++ b/ppapi/generators/idl_c_proto.py
@@ -383,24 +383,27 @@ class CGen(object):
self.LogExit('Exit DefineMember')
return out
+ def InterfaceDefs(self, node):
+ out = ''
+ release = 'M14'
+ name = node.GetName()
+ macro = node.GetProperty('macro')
+ if not macro:
+ macro = self.GetMacro(node)
+ label = node.GetLabel()
+ if label:
+ for vers in label.versions:
+ strver = str(vers).replace('.', '_')
+ out += self.GetDefine('%s_%s' % (macro, strver),
+ '"%s;%s"' % (name, vers))
+ if label.GetRelease(vers) == release:
+ out += self.GetDefine(macro, '%s_%s' % (macro, strver))
+ out += '\n'
+ return out
+
# Define a Struct.
def DefineStruct(self, node, prefix='', comment=False):
out = ''
- if node.IsA('Interface'):
- release = 'M14'
- name = node.GetName()
- macro = node.GetProperty('macro')
- if not macro:
- macro = self.GetMacro(node)
- label = node.GetLabel()
- if label:
- for vers in label.versions:
- strver = str(vers).replace('.', '_')
- out += self.GetDefine('%s_%s' % (macro, strver),
- '"%s;%s"' % (name, vers))
- if label.GetRelease(vers) == release:
- out += self.GetDefine(macro, '%s_%s' % (macro, strver))
- out += '\n'
self.LogEnter('DefineStruct %s' % node)
if node.GetProperty('union'):