OLD | NEW |
1 #!/usr/bin/python2.4 | 1 #!/usr/bin/python2.4 |
2 # Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. |
3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
5 | 5 |
6 '''The 'grit resize' tool. | 6 '''The 'grit resize' tool. |
7 ''' | 7 ''' |
8 | 8 |
9 import getopt | 9 import getopt |
10 import os | 10 import os |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 # once and change it, then after you close it you won't be able to reopen it. | 68 # once and change it, then after you close it you won't be able to reopen it. |
69 RC_TEMPLATE = '''\ | 69 RC_TEMPLATE = '''\ |
70 // Copyright (c) Google Inc. 2005 | 70 // Copyright (c) Google Inc. 2005 |
71 // All rights reserved. | 71 // All rights reserved. |
72 // This file is automatically generated by GRIT and intended for editing | 72 // This file is automatically generated by GRIT and intended for editing |
73 // the layout of the dialogs contained in it. Do not edit anything but the | 73 // the layout of the dialogs contained in it. Do not edit anything but the |
74 // dialogs. Any changes made to translateable portions of the dialogs will | 74 // dialogs. Any changes made to translateable portions of the dialogs will |
75 // be ignored by GRIT. | 75 // be ignored by GRIT. |
76 | 76 |
77 #include "resource.h" | 77 #include "resource.h" |
78 #include <winres.h> | |
79 #include <winresrc.h> | 78 #include <winresrc.h> |
| 79 #ifdef IDC_STATIC |
| 80 #undef IDC_STATIC |
| 81 #endif |
| 82 #define IDC_STATIC (-1) |
80 | 83 |
81 LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL | 84 LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL |
82 | 85 |
83 #pragma code_page([[CODEPAGE_NUM]]) | 86 #pragma code_page([[CODEPAGE_NUM]]) |
84 | 87 |
85 [[INCLUDES]] | 88 [[INCLUDES]] |
86 | 89 |
87 [[DIALOGS]] | 90 [[DIALOGS]] |
88 ''' | 91 ''' |
89 | 92 |
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
291 header_defines.append(formatter.Format(node, self.lang)) | 294 header_defines.append(formatter.Format(node, self.lang)) |
292 header_text = HEADER_TEMPLATE.replace('[[DEFINES]]', ''.join(header_defines)
) | 295 header_text = HEADER_TEMPLATE.replace('[[DEFINES]]', ''.join(header_defines)
) |
293 fname = os.path.join(dir_path, 'resource.h') | 296 fname = os.path.join(dir_path, 'resource.h') |
294 self.WriteFile(fname, header_text) | 297 self.WriteFile(fname, header_text) |
295 print "Wrote %s" % fname | 298 print "Wrote %s" % fname |
296 | 299 |
297 def WriteFile(self, filename, contents, encoding='cp1252'): | 300 def WriteFile(self, filename, contents, encoding='cp1252'): |
298 f = util.WrapOutputStream(file(filename, 'wb'), encoding) | 301 f = util.WrapOutputStream(file(filename, 'wb'), encoding) |
299 f.write(contents) | 302 f.write(contents) |
300 f.close() | 303 f.close() |
OLD | NEW |