FileDocCategorySizeDatePackage
BluecurveEngineParser.javaAPI DocJava SE 5 API3488Fri Aug 26 14:54:44 BST 2005com.sun.java.swing.plaf.gtk

BluecurveEngineParser

public class BluecurveEngineParser extends GTKEngineParser
A parser for the "bluecurve" engine sections in GTK rc theme files.
author
Shannon Hickey
version
1.5 12/19/03

Fields Summary
private static final int
SYM_CONTRAST
private static final int
SYM_WIDE
private static final int
SYM_TRUE
private static final int
SYM_FALSE
private static final int[]
symbolVals
private static final String[]
symbolNames
private GTKScanner
scanner
private GTKParser
parser
private BluecurveEngineInfo
engineInfo
Constructors Summary
Methods Summary
intparse(GTKScanner scanner, GTKParser parser, GTKParser.EngineInfo[] retVal)


        this.scanner = scanner;
        this.parser = parser;

        if (retVal[0] == null) {
            engineInfo = new BluecurveEngineInfo();
        } else {
            engineInfo = (BluecurveEngineInfo)retVal[0];
        }

        int oldScope = scanner.setScope(uniqueScopeID);
        registerSymbolsIfNecessary();

        // At this time we don't know how bluecurve allows
        // itself to be customized, so we'll just skip over
        // the block.
        int token;
        int curlys = 1;

        while (curlys > 0) {
            token = scanner.getToken();
            switch(token) {
                case GTKScanner.TOKEN_EOF:
                case GTKScanner.TOKEN_ERROR:
                    return GTKScanner.TOKEN_RIGHT_CURLY;
                case GTKScanner.TOKEN_LEFT_CURLY:
                    curlys++;
                    break;
                case GTKScanner.TOKEN_RIGHT_CURLY:
                    curlys--;
                    break;
                default:
                    // ignore
            }
        }

        retVal[0] = engineInfo;

        scanner.setScope(oldScope);
        return GTKScanner.TOKEN_NONE;
    
private voidregisterSymbolsIfNecessary()

        if (scanner.containsSymbol(symbolNames[0])) {
            return;
        }

        for (int i = 0; i < symbolNames.length; i++) {
            scanner.addSymbol(symbolNames[i], symbolVals[i]);
        }