Changeset 561 for trunk/src/opengl/util/generator.cpp
- Timestamp:
- Feb 11, 2010, 11:19:06 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
-
Property svn:mergeinfo
set to (toggle deleted branches)
/branches/vendor/nokia/qt/4.6.1 merged eligible /branches/vendor/nokia/qt/current merged eligible /branches/vendor/trolltech/qt/current 3-149
-
Property svn:mergeinfo
set to (toggle deleted branches)
-
trunk/src/opengl/util/generator.cpp
r2 r561 2 2 ** 3 3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). 4 ** Contact: Qt Software Information (qt-info@nokia.com) 4 ** All rights reserved. 5 ** Contact: Nokia Corporation (qt-info@nokia.com) 5 6 ** 6 7 ** This file is part of the QtOpenGL module of the Qt Toolkit. … … 21 22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 22 23 ** 23 ** In addition, as a special exception, Nokia gives you certain 24 ** additional rights. These rights are described in the Nokia Qt LGPL 25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this 26 ** package. 24 ** In addition, as a special exception, Nokia gives you certain additional 25 ** rights. These rights are described in the Nokia Qt LGPL Exception 26 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 27 27 ** 28 28 ** GNU General Public License Usage … … 34 34 ** met: http://www.gnu.org/copyleft/gpl.html. 35 35 ** 36 ** If you are unsure which license is appropriate for your use, please37 ** contact the sales department at qt-sales@nokia.com.36 ** If you have questions regarding the use of this file, please contact 37 ** Nokia at qt-info@nokia.com. 38 38 ** $QT_END_LICENSE$ 39 39 ** … … 49 49 50 50 #include <QtDebug> 51 #include <cstdlib> 51 52 52 53 QT_BEGIN_NAMESPACE 53 54 54 55 QT_USE_NAMESPACE 56 57 #define TAB " " 55 58 56 59 typedef QPair<QString, QString> QStringPair; … … 117 120 118 121 if (lineStream.atEnd()) { 119 qDebug() << "Error in file" << confFile << "(" << enumerator << ")";122 qDebug() << "Error in file" << confFile << '(' << enumerator << ')'; 120 123 exit(0); 121 124 } … … 243 246 } 244 247 248 void writeVariablesEnum(QTextStream &out, const char *name, const QSet<QString> &s) 249 { 250 out << "enum " << name << " {"; 251 QSet<QString>::const_iterator it = s.begin(); 252 if (it != s.end()) { 253 out << "\n" TAB "VAR_" << it->toUpper(); 254 for (++it; it != s.end(); ++it) 255 out << ",\n" TAB "VAR_" << it->toUpper(); 256 } 257 out << "\n};\n\n"; 258 } 259 260 void writeTypesEnum(QTextStream &out, const char *name, const QList<QStringPair> &s) 261 { 262 out << "enum " << name << " {"; 263 QList<QStringPair>::const_iterator it = s.begin(); 264 if (it != s.end()) { 265 out << "\n" TAB << it->first; 266 for (++it; it != s.end(); ++it) 267 out << ",\n" TAB << it->first; 268 } 269 out << "\n};\n\n"; 270 } 271 245 272 void writeIncludeFile(const QSet<QString> &variables, 246 273 const QList<QStringPair> &brushes, … … 257 284 QTextStream out(&includeFile); 258 285 259 QLatin1String tab(" "); 260 261 out << "#ifndef FRAGMENTPROGRAMS_H\n" 262 << "#define FRAGMENTPROGRAMS_H\n\n"; 263 264 out << "enum FragmentVariable {\n"; 265 foreach (QString str, variables) 266 out << tab << "VAR_" << str.toUpper() << ",\n"; 267 out << "};\n\n"; 268 269 out << "enum FragmentBrushType {\n"; 270 foreach (QStringPair brush, brushes) 271 out << tab << brush.first << ",\n"; 272 out << "};\n\n"; 273 274 out << "enum FragmentCompositionModeType {\n"; 275 foreach (QStringPair mode, compositionModes) 276 out << tab << mode.first << ",\n"; 277 out << "};\n\n"; 278 279 out << "enum FragmentMaskType {\n"; 280 foreach (QStringPair mask, masks) 281 out << tab << mask.first << ",\n"; 282 out << "};\n\n"; 286 QLatin1String tab(TAB); 287 288 out << "/****************************************************************************\n" 289 "**\n" 290 "** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).\n" 291 "** All rights reserved.\n" 292 "** Contact: Nokia Corporation (qt-info@nokia.com)\n" 293 "**\n" 294 "** This file is part of the QtOpenGL module of the Qt Toolkit.\n" 295 "**\n" 296 "** $QT_BEGIN_LICENSE:LGPL$\n" 297 "** Commercial Usage\n" 298 "** Licensees holding valid Qt Commercial licenses may use this file in\n" 299 "** accordance with the Qt Commercial License Agreement provided with the\n" 300 "** Software or, alternatively, in accordance with the terms contained in\n" 301 "** a written agreement between you and Nokia.\n" 302 "**\n" 303 "** GNU Lesser General Public License Usage\n" 304 "** Alternatively, this file may be used under the terms of the GNU Lesser\n" 305 "** General Public License version 2.1 as published by the Free Software\n" 306 "** Foundation and appearing in the file LICENSE.LGPL included in the\n" 307 "** packaging of this file. Please review the following information to\n" 308 "** ensure the GNU Lesser General Public License version 2.1 requirements\n" 309 "** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n" 310 "**\n" 311 "** In addition, as a special exception, Nokia gives you certain additional\n" 312 "** rights. These rights are described in the Nokia Qt LGPL Exception\n" 313 "** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n" 314 "**\n" 315 "** GNU General Public License Usage\n" 316 "** Alternatively, this file may be used under the terms of the GNU\n" 317 "** General Public License version 3.0 as published by the Free Software\n" 318 "** Foundation and appearing in the file LICENSE.GPL included in the\n" 319 "** packaging of this file. Please review the following information to\n" 320 "** ensure the GNU General Public License version 3.0 requirements will be\n" 321 "** met: http://www.gnu.org/copyleft/gpl.html.\n" 322 "**\n" 323 "** If you have questions regarding the use of this file, please contact\n" 324 "** Nokia at qt-info@nokia.com.\n" 325 "** $QT_END_LICENSE$\n" 326 "**\n" 327 "****************************************************************************/\n" 328 "\n" 329 "#ifndef FRAGMENTPROGRAMS_P_H\n" 330 "#define FRAGMENTPROGRAMS_P_H\n" 331 "\n" 332 "//\n" 333 "// W A R N I N G\n" 334 "// -------------\n" 335 "//\n" 336 "// This file is not part of the Qt API. It exists purely as an\n" 337 "// implementation detail. This header file may change from version to\n" 338 "// version without notice, or even be removed.\n" 339 "//\n" 340 "// We mean it.\n" 341 "//\n" 342 "\n"; 343 344 writeVariablesEnum(out, "FragmentVariable", variables); 345 writeTypesEnum(out, "FragmentBrushType", brushes); 346 writeTypesEnum(out, "FragmentCompositionModeType", compositionModes); 347 writeTypesEnum(out, "FragmentMaskType", masks); 283 348 284 349 out << "static const unsigned int num_fragment_variables = " << variables.size() << ";\n\n";
Note:
See TracChangeset
for help on using the changeset viewer.