Example #1
0
/**
 * @return A list of all keys connected to this entity.
 */
RS_StringList RS_Entity::getAllKeys() {
    RS_StringList keys;
    RS_DictIterator<RS_String> it(varList);
    for( ; it.current(); ++it )
        keys.append(it.currentKey());

    return keys;
}
/**
 * Tries to complete the given command (e.g. when tab is pressed).
 */
RS_StringList RS_Commands::complete(const RS_String& cmd) {
	RS_DictIterator<RS2::ActionType> it(mainCommands);
	RS_StringList ret;
    for (; it.current(); ++it) {
        //cout << it.currentKey() << ": " << it.current()->text() << endl;
		if (it.currentKey().startsWith(cmd)) {
			ret << it.currentKey();
		}
	}
	ret.sort();

	return ret;
}
Example #3
0
/**
 * Initializes the font list by creating empty RS_Font 
 * objects, one for each font that could be found.
 */
void RS_FontList::init() {
    RS_DEBUG->print("RS_FontList::initFonts");

    RS_StringList list = RS_SYSTEM->getFontList();
    RS_Dict<char> added; //used to remeber added fonts (avoid duplication)
    RS_Font* font;

    for ( RS_StringList::Iterator it = list.begin();
            it != list.end(); ++it ) {
        RS_DEBUG->print("font: %s:", (*it).latin1());

        RS_FileInfo fi(*it);
        if (!added[fi.baseName()]) {
            font = new RS_Font(fi.baseName());
            fonts.append(font);
            added.insert(fi.baseName(), (char*)1);
        }

        RS_DEBUG->print("base: %s", fi.baseName().latin1());
    }
}
Example #4
0
/**
 * Initializes the script list by creating RS_Script 
 * objects, one for each script that could be found.
 */
void RS_ScriptList::init() {

    RS_DEBUG->print("RS_ScriptList::initScripts");

    scripts.clear();
    RS_StringList list = RS_SYSTEM->getScriptList();
    RS_Script* script;

    for ( RS_StringList::Iterator it = list.begin();
            it != list.end(); ++it ) {
        RS_DEBUG->print("script: %s:", (*it).latin1());

        RS_FileInfo fi(*it);
        script = new RS_Script(fi.baseName(), fi.absFilePath());
        scripts.append(script);

        RS_DEBUG->print("base: %s", fi.baseName().latin1());
        RS_DEBUG->print("path: %s", fi.absFilePath().latin1());
    }

    //RS_Script* f = new RS_Script("normal");
    //scripts.append(f);
}