| Index: grit/format/rc_header.py
|
| diff --git a/grit/format/rc_header.py b/grit/format/rc_header.py
|
| index 543897b6847b23983bb805191c9b17ee0119125a..83bedb771596a0d67b171f00d0091fefefa0c8a9 100644
|
| --- a/grit/format/rc_header.py
|
| +++ b/grit/format/rc_header.py
|
| @@ -18,27 +18,24 @@ from grit.extern import FP
|
| class TopLevel(interface.ItemFormatter):
|
| '''Writes the necessary preamble for a resource.h file.'''
|
|
|
| - def Format(self, item, lang='', begin_item=True, output_dir='.'):
|
| - if not begin_item:
|
| - return ''
|
| - else:
|
| - header_string = '''// Copyright (c) Google Inc. %d
|
| + def Format(self, item, lang='', output_dir='.'):
|
| + header_string = '''// Copyright (c) Google Inc. %d
|
| // All rights reserved.
|
| // This file is automatically generated by GRIT. Do not edit.
|
|
|
| #pragma once
|
| ''' % (util.GetCurrentYear())
|
| - # Check for emit nodes under the rc_header. If any emit node
|
| - # is present, we assume it means the GRD file wants to override
|
| - # the default header, with no includes.
|
| - for output_node in item.GetOutputFiles():
|
| - if output_node.GetType() == 'rc_header':
|
| - for child in output_node.children:
|
| - if child.name == 'emit':
|
| - if child.attrs['emit_type'] == 'prepend':
|
| - return header_string
|
| - # else print out the default header with include
|
| - return header_string + '''
|
| + # Check for emit nodes under the rc_header. If any emit node
|
| + # is present, we assume it means the GRD file wants to override
|
| + # the default header, with no includes.
|
| + for output_node in item.GetOutputFiles():
|
| + if output_node.GetType() == 'rc_header':
|
| + for child in output_node.children:
|
| + if child.name == 'emit':
|
| + if child.attrs['emit_type'] == 'prepend':
|
| + return header_string
|
| + # else print out the default header with include
|
| + return header_string + '''
|
| #include <atlres.h>
|
|
|
| '''
|
| @@ -47,11 +44,8 @@ class TopLevel(interface.ItemFormatter):
|
| class EmitAppender(interface.ItemFormatter):
|
| '''Adds the content of the <emit> nodes to the RC header file.'''
|
|
|
| - def Format(self, item, lang='', begin_item=True, output_dir='.'):
|
| - if not begin_item:
|
| - return ''
|
| - else:
|
| - return '%s\n' % (item.GetCdata())
|
| + def Format(self, item, lang='', output_dir='.'):
|
| + return '%s\n' % (item.GetCdata())
|
|
|
| class Item(interface.ItemFormatter):
|
| '''Writes the #define line(s) for a single item in a resource.h file. If
|
| @@ -78,10 +72,7 @@ class Item(interface.ItemFormatter):
|
| print ('WARNING: Numeric resource IDs should be greater than 100 to avoid\n'
|
| 'conflicts with system-defined resource IDs.')
|
|
|
| - def Format(self, item, lang='', begin_item=True, output_dir='.'):
|
| - if not begin_item:
|
| - return ''
|
| -
|
| + def Format(self, item, lang='', output_dir='.'):
|
| # Resources that use the RES protocol don't need
|
| # any numerical ids generated, so we skip them altogether.
|
| # This is accomplished by setting the flag 'generateid' to false
|
|
|