mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-03 18:31:55 -04:00
interrogate changes to support freetype
This commit is contained in:
parent
57943ffd25
commit
68aa6f0e52
@ -662,19 +662,13 @@ push_string(const string &input, bool lock_position) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
// Function: CPPPreprocessor::parse_expr
|
// Function: CPPPreprocessor::expand_manifests
|
||||||
// Access: Protected
|
// Access: Protected
|
||||||
// Description: Given a string, expand all manifests within the
|
// Description: Given a string, expand all manifests within the
|
||||||
// string and evaluate it as an expression. Returns
|
// string and return the new string.
|
||||||
// NULL if the string is not a valid expression.
|
|
||||||
//
|
|
||||||
// This is an internal support function for
|
|
||||||
// CPPPreprocessor; however, there is a public variant
|
|
||||||
// of this function defined for CPPParser.
|
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
CPPExpression *CPPPreprocessor::
|
string CPPPreprocessor::
|
||||||
parse_expr(const string &input_expr, CPPScope *current_scope,
|
expand_manifests(const string &input_expr) {
|
||||||
CPPScope *global_scope) {
|
|
||||||
// Get a copy of the expression string we can modify.
|
// Get a copy of the expression string we can modify.
|
||||||
string expr = input_expr;
|
string expr = input_expr;
|
||||||
|
|
||||||
@ -721,6 +715,25 @@ parse_expr(const string &input_expr, CPPScope *current_scope,
|
|||||||
// that expands to another manifest.
|
// that expands to another manifest.
|
||||||
} while (manifest_found);
|
} while (manifest_found);
|
||||||
|
|
||||||
|
return expr;
|
||||||
|
}
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////
|
||||||
|
// Function: CPPPreprocessor::parse_expr
|
||||||
|
// Access: Protected
|
||||||
|
// Description: Given a string, expand all manifests within the
|
||||||
|
// string and evaluate it as an expression. Returns
|
||||||
|
// NULL if the string is not a valid expression.
|
||||||
|
//
|
||||||
|
// This is an internal support function for
|
||||||
|
// CPPPreprocessor; however, there is a public variant
|
||||||
|
// of this function defined for CPPParser.
|
||||||
|
////////////////////////////////////////////////////////////////////
|
||||||
|
CPPExpression *CPPPreprocessor::
|
||||||
|
parse_expr(const string &input_expr, CPPScope *current_scope,
|
||||||
|
CPPScope *global_scope) {
|
||||||
|
string expr = expand_manifests(input_expr);
|
||||||
|
|
||||||
CPPExpressionParser ep(current_scope, global_scope);
|
CPPExpressionParser ep(current_scope, global_scope);
|
||||||
ep._verbose = 0;
|
ep._verbose = 0;
|
||||||
if (ep.parse_expr(expr, *this)) {
|
if (ep.parse_expr(expr, *this)) {
|
||||||
@ -1314,9 +1327,21 @@ handle_include_directive(const string &args, int first_line,
|
|||||||
Filename filename_as_referenced;
|
Filename filename_as_referenced;
|
||||||
bool angle_quotes = false;
|
bool angle_quotes = false;
|
||||||
|
|
||||||
if (!args.empty()) {
|
string expr = args;
|
||||||
if (args[0] == '"' && args[args.size() - 1] == '"') {
|
|
||||||
filename = args.substr(1, args.size() - 2);
|
// The filename to include might actually be hidden within a
|
||||||
|
// manifest definition. Wow. FreeType depends on this.
|
||||||
|
|
||||||
|
// Just to play things safe, since our manifest-expansion logic
|
||||||
|
// might not filter out quotes and angle brackets properly, we'll
|
||||||
|
// only expand manifests if we don't begin with a quote or bracket.
|
||||||
|
if (!expr.empty() && (expr[0] != '"' && expr[0] != '<')) {
|
||||||
|
expr = expand_manifests(expr);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!expr.empty()) {
|
||||||
|
if (expr[0] == '"' && expr[expr.size() - 1] == '"') {
|
||||||
|
filename = expr.substr(1, expr.size() - 2);
|
||||||
okflag = true;
|
okflag = true;
|
||||||
|
|
||||||
if (_files.size() == 1) {
|
if (_files.size() == 1) {
|
||||||
@ -1325,8 +1350,8 @@ handle_include_directive(const string &args, int first_line,
|
|||||||
// included files.
|
// included files.
|
||||||
_quote_includes.insert(filename);
|
_quote_includes.insert(filename);
|
||||||
}
|
}
|
||||||
} else if (args[0] == '<' && args[args.size() - 1] == '>') {
|
} else if (expr[0] == '<' && expr[expr.size() - 1] == '>') {
|
||||||
filename = args.substr(1, args.size() - 2);
|
filename = expr.substr(1, expr.size() - 2);
|
||||||
angle_quotes = true;
|
angle_quotes = true;
|
||||||
okflag = true;
|
okflag = true;
|
||||||
|
|
||||||
|
@ -107,6 +107,7 @@ protected:
|
|||||||
bool push_file(const CPPFile &file);
|
bool push_file(const CPPFile &file);
|
||||||
bool push_string(const string &input, bool lock_position);
|
bool push_string(const string &input, bool lock_position);
|
||||||
|
|
||||||
|
string expand_manifests(const string &input_expr);
|
||||||
CPPExpression *parse_expr(const string &expr, CPPScope *current_scope,
|
CPPExpression *parse_expr(const string &expr, CPPScope *current_scope,
|
||||||
CPPScope *global_scope);
|
CPPScope *global_scope);
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
#define INSTALL_PARSER_INC \
|
#define INSTALL_PARSER_INC \
|
||||||
algorithm deque iostream list map memory \
|
algorithm deque ft2build.h iostream list map memory \
|
||||||
pair queue set stack stdcompare.h stdtypedefs.h \
|
pair queue set stack stdcompare.h stdtypedefs.h \
|
||||||
string vector windows.h zlib.h md5.h files.h hex.h \
|
string vector windows.h zlib.h md5.h files.h hex.h \
|
||||||
nurbs.hh
|
nurbs.hh
|
||||||
|
35
dtool/src/parser-inc/ft2build.h
Normal file
35
dtool/src/parser-inc/ft2build.h
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
// Filename: ft2build.h
|
||||||
|
// Created by: drose (08Feb02)
|
||||||
|
//
|
||||||
|
////////////////////////////////////////////////////////////////////
|
||||||
|
//
|
||||||
|
// PANDA 3D SOFTWARE
|
||||||
|
// Copyright (c) 2001, Disney Enterprises, Inc. All rights reserved
|
||||||
|
//
|
||||||
|
// All use of this software is subject to the terms of the Panda 3d
|
||||||
|
// Software license. You should have received a copy of this license
|
||||||
|
// along with this source code; you will also find a current copy of
|
||||||
|
// the license at http://www.panda3d.org/license.txt .
|
||||||
|
//
|
||||||
|
// To contact the maintainers of this program write to
|
||||||
|
// panda3d@yahoogroups.com .
|
||||||
|
//
|
||||||
|
////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
// This file, and all the other files in this directory, aren't
|
||||||
|
// intended to be compiled--they're just parsed by CPPParser (and
|
||||||
|
// interrogate) in lieu of the actual system headers, to generate the
|
||||||
|
// interrogate database.
|
||||||
|
|
||||||
|
#ifndef FT2BUILD_H
|
||||||
|
#define FT2BUILD_H
|
||||||
|
|
||||||
|
// This definition is intentionally recursive. Why complicate things
|
||||||
|
// with multiple files?
|
||||||
|
#define FT_FREETYPE_H <ft2build.h>
|
||||||
|
|
||||||
|
class FT_Face;
|
||||||
|
class FT_Library;
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
Loading…
x
Reference in New Issue
Block a user