当前位置: 首页>>代码示例>>C++>>正文


C++ ObjectEntry类代码示例

本文整理汇总了C++中ObjectEntry的典型用法代码示例。如果您正苦于以下问题:C++ ObjectEntry类的具体用法?C++ ObjectEntry怎么用?C++ ObjectEntry使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了ObjectEntry类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: saveConfigFile

void PolycodeIDEApp::saveConfigFile() {
	Config *config = CoreServices::getInstance()->getConfig();
	Object configFile;
	configFile.root.name = "config";
	configFile.root.addChild("open_projects");
	configFile.root.addChild("syntax_theme", globalSyntaxTheme->name);
	for(int i=0; i < projectManager->getProjectCount(); i++) {
		PolycodeProject *project = projectManager->getProjectByIndex(i);		
		ObjectEntry *projectEntry = configFile.root["open_projects"]->addChild("project");
		projectEntry->addChild("name", project->getProjectName());
		projectEntry->addChild("path", project->getProjectFile());
	}

	configFile.root.addChild("settings");
	ObjectEntry *textEditorEntry = configFile.root["settings"]->addChild("text_editor");
	textEditorEntry->addChild("use_external", config->getStringValue("Polycode", "useExternalTextEditor"));
	textEditorEntry->addChild("command", config->getStringValue("Polycode", "externalTextEditorCommand"));

#if defined(__APPLE__) && defined(__MACH__)
	core->createFolder(core->getUserHomeDirectory()+"/Library/Application Support/Polycode");
	configFile.saveToXML(core->getUserHomeDirectory()+"/Library/Application Support/Polycode/config.xml");	
#else
	core->createFolder(core->getUserHomeDirectory()+"/.polycode");
	configFile.saveToXML(core->getUserHomeDirectory()+"/.polycode/config.xml");	

#endif
}
开发者ID:maybeshewill,项目名称:Polycode,代码行数:27,代码来源:PolycodeIDEApp.cpp

示例2: parseOpenNodesIntoEntry

void parseOpenNodesIntoEntry(ObjectEntry *entry, UITree *node, bool addNewNode) {

    bool hasOpenNodes = false;
    for(int i=0; i < node->getNumTreeChildren(); i++) {
        UITree *child = node->getTreeChild(i);
        if(!child->isCollapsed()) {
            hasOpenNodes = true;
        }
    }

    if(!hasOpenNodes) {
        return;
    }

    ObjectEntry *childNodes = entry;
    if(addNewNode) {
        childNodes = entry->addChild("child_nodes");
    }

    for(int i=0; i < node->getNumTreeChildren(); i++) {
        UITree *child = node->getTreeChild(i);
        if(!child->isCollapsed()) {
            ObjectEntry *newEntry = childNodes->addChild("open_node");
            newEntry->addChild("name", child->getLabelText());
            parseOpenNodesIntoEntry(newEntry, child, true);
        }
    }
}
开发者ID:carlosmarti,项目名称:Polycode,代码行数:28,代码来源:PolycodeProjectBrowser.cpp

示例3: ObjectEntry

ObjectEntry *PolycodeTextEditor::getEditorConfig() {
	ObjectEntry *configEntry = new ObjectEntry();
		
	configEntry->addChild("scroll_offset", textInput->getScrollContainer()->getVScrollBar()->getScrollValue());
			
	return configEntry;
}
开发者ID:carlosmarti,项目名称:Polycode,代码行数:7,代码来源:PolycodeTextEditor.cpp

示例4: SetOrRemoveObject

static nsresult
SetOrRemoveObject(PLDHashTable& table, nsIContent* aKey, nsISupports* aValue)
{
  if (aValue) {
    // lazily create the table, but only when adding elements
    if (!table.ops &&
        !PL_DHashTableInit(&table, &ObjectTableOps, nullptr,
                           sizeof(ObjectEntry), 16)) {
      table.ops = nullptr;
      return NS_ERROR_OUT_OF_MEMORY;
    }
    aKey->SetFlags(NODE_MAY_BE_IN_BINDING_MNGR);
    return AddObjectEntry(table, aKey, aValue);
  }

  // no value, so remove the key from the table
  if (table.ops) {
    ObjectEntry* entry =
      static_cast<ObjectEntry*>
        (PL_DHashTableOperate(&table, aKey, PL_DHASH_LOOKUP));
    if (entry && PL_DHASH_ENTRY_IS_BUSY(entry)) {
      // Keep key and value alive while removing the entry.
      nsCOMPtr<nsISupports> key = entry->GetKey();
      nsCOMPtr<nsISupports> value = entry->GetValue();
      RemoveObjectEntry(table, aKey);
    }
  }
  return NS_OK;
}
开发者ID:drexler,项目名称:releases-mozilla-aurora,代码行数:29,代码来源:nsBindingManager.cpp

示例5: ObjectEntry

ObjectEntry *PolycodeProjectBrowser::getBrowserConfig() {
    ObjectEntry *configEntry = new ObjectEntry();
    configEntry->name = "project_browser";

    configEntry->addChild("width", getWidth());
    ObjectEntry *openNodes = configEntry->addChild("open_nodes");
    parseOpenNodesIntoEntry(openNodes, treeContainer->getRootNode(), false);

    return configEntry;
}
开发者ID:carlosmarti,项目名称:Polycode,代码行数:10,代码来源:PolycodeProjectBrowser.cpp

示例6: StoreObjEntry

void ObjectEntryList :: StoreObjEntry (BinArray *array, BinSArrayObjEntry *obj_entry )
{
  ObjectEntry         *objentry = (ObjectEntry *)obj_entry;
  EB_Number            entnr;
  if ( objentry )
  {
    entnr = objentry->get_object_id();
    instance_pool->StoreInstance(entnr,(EBI *)objentry,objentry->get_ext_inst(),objentry->get_cluster_number().get_ebsnum());
    BinArray::StoreObjEntry(array,obj_entry);
  }

}
开发者ID:BackupTheBerlios,项目名称:openaqua-svn,代码行数:12,代码来源:ObjectEntryList.cpp

示例7: saveConfigFile

void PolycodeIDEApp::saveConfigFile() {
	Object configFile;
	configFile.root.name = "config";
	configFile.root.addChild("open_projects");
	for(int i=0; i < projectManager->getProjectCount(); i++) {
		PolycodeProject *project = projectManager->getProjectByIndex(i);		
		ObjectEntry *projectEntry = configFile.root["open_projects"]->addChild("project");
		projectEntry->addChild("name", project->getProjectName());
		projectEntry->addChild("path", project->getProjectFile());
	}
	core->createFolder("/Users/ivansafrin/Library/Application Support/Polycode");
	configFile.saveToXML("/Users/ivansafrin/Library/Application Support/Polycode/config.xml");		
}
开发者ID:RobLach,项目名称:Polycode,代码行数:13,代码来源:PolycodeIDEApp.cpp

示例8: LookupObject

// helper routine for looking up an existing entry. Note that the
// return result is NOT addreffed
static nsISupports*
LookupObject(PLDHashTable& table, nsIContent* aKey)
{
  if (aKey && aKey->HasFlag(NODE_MAY_BE_IN_BINDING_MNGR)) {
    ObjectEntry *entry =
      static_cast<ObjectEntry*>
                 (PL_DHashTableOperate(&table, aKey, PL_DHASH_LOOKUP));

    if (PL_DHASH_ENTRY_IS_BUSY(entry))
      return entry->GetValue();
  }

  return nullptr;
}
开发者ID:drexler,项目名称:releases-mozilla-aurora,代码行数:16,代码来源:nsBindingManager.cpp

示例9: saveConfigFile

void PolycodeIDEApp::saveConfigFile() {
	Config *config = CoreServices::getInstance()->getConfig();
	Object configFile;
	configFile.root.name = "config";
	configFile.root.addChild("open_projects");
	configFile.root.addChild("syntax_theme", globalSyntaxTheme->name);
	configFile.root.addChild("ui_theme", config->getStringValue("Polycode", "uiTheme"));
	configFile.root.addChild("texture_filtering_mode", config->getStringValue("Polycode", "textureFilteringMode"));
	
	configFile.root.addChild("app_width", String::IntToString(core->getXRes()));
	configFile.root.addChild("app_height", String::IntToString(core->getYRes()));
	
	ObjectEntry *consoleEntry = configFile.root.addChild("console");
	consoleEntry->addChild("size", frame->getConsoleSize());
	consoleEntry->addChild("showing", frame->isShowingConsole());
	
	for(int i=0; i < projectManager->getProjectCount(); i++) {
		PolycodeProject *project = projectManager->getProjectByIndex(i);		
		ObjectEntry *projectEntry = configFile.root["open_projects"]->addChild("project");

		projectEntry->addChild("is_active", (project == projectManager->getActiveProject()));
		
		projectEntry->addChild("name", project->getProjectName());
		projectEntry->addChild("path", project->getProjectFile());
		
		ObjectEntry *projectFrameConfig = frame->getFrameConfigForProject(project);
		if(projectFrameConfig) {
			projectEntry->addChild(projectFrameConfig);
		}
	}

	configFile.root.addChild("settings");
	ObjectEntry *textEditorEntry = configFile.root["settings"]->addChild("text_editor");
	textEditorEntry->addChild("use_external", config->getStringValue("Polycode", "useExternalTextEditor"));
	textEditorEntry->addChild("command", config->getStringValue("Polycode", "externalTextEditorCommand"));

#if defined(__APPLE__) && defined(__MACH__)
	core->createFolder(core->getUserHomeDirectory()+"/Library/Application Support/Polycode");
	configFile.saveToXML(core->getUserHomeDirectory()+"/Library/Application Support/Polycode/config.xml");	
#else
	core->createFolder(core->getUserHomeDirectory()+"/.polycode");
	configFile.saveToXML(core->getUserHomeDirectory()+"/.polycode/config.xml");	

#endif
}
开发者ID:Mr-Nil,项目名称:Polycode,代码行数:45,代码来源:PolycodeIDEApp.cpp

示例10: saveConfigFile

void PolycodeIDEApp::saveConfigFile() {
	Object configFile;
	configFile.root.name = "config";
	configFile.root.addChild("open_projects");
	configFile.root.addChild("syntax_theme", globalSyntaxTheme->name);
	for(int i=0; i < projectManager->getProjectCount(); i++) {
		PolycodeProject *project = projectManager->getProjectByIndex(i);		
		ObjectEntry *projectEntry = configFile.root["open_projects"]->addChild("project");
		projectEntry->addChild("name", project->getProjectName());
		projectEntry->addChild("path", project->getProjectFile());
	}

#if defined(__APPLE__) && defined(__MACH__)
	core->createFolder(core->getUserHomeDirectory()+"/Library/Application Support/Polycode");
	configFile.saveToXML(core->getUserHomeDirectory()+"/Library/Application Support/Polycode/config.xml");	
#else
	core->createFolder(core->getUserHomeDirectory()+"/.polycode");
	configFile.saveToXML(core->getUserHomeDirectory()+"/.polycode/config.xml");	

#endif
}
开发者ID:bigjko,项目名称:Polycode,代码行数:21,代码来源:PolycodeIDEApp.cpp

示例11: saveFile

void PolycodeSpriteEditor::saveFile() {
	Object saveObject;
	
	saveObject.root.name = "sprite";
	
	ObjectEntry *image = saveObject.root.addChild("image");
	image->addChild("frameWidth", widthProp->get());
	image->addChild("frameHeight", heightProp->get());
	image->addChild("fileName", previewSprite->getTexture()->getResourcePath());
	
	ObjectEntry *animations = saveObject.root.addChild("animations");
			
	for(int i=0; i < animationEntries.size(); i++) {
		ObjectEntry *animation = animations->addChild("animation");
		animation->addChild("name", animationEntries[i]->nameInput->getText());
		animation->addChild("frames", animationEntries[i]->framesInput->getText());
		animation->addChild("speed", atof(animationEntries[i]->speedInput->getText().c_str()));	
	}			
			
	saveObject.saveToXML(filePath);
}
开发者ID:AmeliaMesdag,项目名称:Polycode,代码行数:21,代码来源:PolycodeSpriteEditor.cpp

示例12: AddObjectEntry

// helper routine for adding a new entry
static nsresult
AddObjectEntry(PLDHashTable& table, nsISupports* aKey, nsISupports* aValue)
{
  NS_ASSERTION(aKey, "key must be non-null");
  if (!aKey) return NS_ERROR_INVALID_ARG;
  
  ObjectEntry *entry =
    static_cast<ObjectEntry*>
               (PL_DHashTableOperate(&table, aKey, PL_DHASH_ADD));

  if (!entry)
    return NS_ERROR_OUT_OF_MEMORY;

  // only add the key if the entry is new
  if (!entry->GetKey())
    entry->SetKey(aKey);

  // now attach the new entry - note that entry->mValue could possibly
  // have a value already, this will release that.
  entry->SetValue(aValue);
  
  return NS_OK;
}
开发者ID:drexler,项目名称:releases-mozilla-aurora,代码行数:24,代码来源:nsBindingManager.cpp

示例13: exportToFile

int exportToFile(String prefix, bool swapZY, bool addSubmeshes, bool listOnly, bool exportEntity) {

    Object sceneObject;
    sceneObject.root.name = "entity";
    ObjectEntry *parentEntry = sceneObject.root.addChild("root");
    
    parentEntry->addChild("id", "");
    parentEntry->addChild("tags", "");
    parentEntry->addChild("type", "Entity");
    parentEntry->addChild("cR", "1");
    parentEntry->addChild("cG", "1");
    parentEntry->addChild("cB", "1");
    parentEntry->addChild("cA", "1");
    parentEntry->addChild("blendMode", "0");
    parentEntry->addChild("sX", 1.0);
    parentEntry->addChild("sY", 1.0);
    parentEntry->addChild("sZ", 1.0);
    
    parentEntry->addChild("rX", 0.0);
    parentEntry->addChild("rY", 0.0);
    parentEntry->addChild("rZ", 0.0);
    parentEntry->addChild("rW", 1.0);
    
    parentEntry->addChild("pX", 0.0);
    parentEntry->addChild("pY", 0.0);
    parentEntry->addChild("pZ", 0.0);
    
    parentEntry->addChild("bbX", 0.0);
    parentEntry->addChild("bbY", 0.0);
    parentEntry->addChild("bbZ", 0.0);
    
    ObjectEntry *children = parentEntry->addChild("children");

		
	Polycode::Mesh *mesh = new Polycode::Mesh(Mesh::TRI_MESH);
    mesh->indexedMesh = true;
	addToMesh(prefix, mesh, scene, scene->mRootNode, swapZY, addSubmeshes, listOnly, children);
    
	
	if(addSubmeshes) {
		String fileNameMesh;
		if(prefix != "") {
			fileNameMesh = prefix+".mesh";			
		} else {
			fileNameMesh = "out.mesh";
		}		

		if(listOnly) {
			printf("%s\n", fileNameMesh.c_str());
		} else {
			OSFILE *outFile = OSBasics::open(fileNameMesh.c_str(), "wb");	
			mesh->saveToFile(outFile, writeNormals, writeTangents, writeColors, writeBoneWeights, writeUVs, writeSecondaryUVs);
			OSBasics::close(outFile);
		}
	}
		
	if(hasWeights) {		
		if(listOnly) {
			printf("%s.skeleton\n", prefix.c_str());
		} else {
			printf("Mesh has weights, exporting skeleton...\n");
		}	
		
		String fileNameSkel;
        if(prefix != "") {
            fileNameSkel = prefix+".skeleton";
        } else {
            fileNameSkel = "out.skeleton";
        }
		ISkeleton *skeleton = new ISkeleton();
	
		for (int n = 0; n < scene->mRootNode->mNumChildren; ++n) {
			if(scene->mRootNode->mChildren[n]->mNumChildren > 0) {
				addToISkeleton(skeleton, NULL, scene, scene->mRootNode->mChildren[n]);
			}
		}

		if(scene->HasAnimations()) {
			printf("Importing animations...\n");
			for(int i=0; i < scene->mNumAnimations;i++) {
				aiAnimation *a = scene->mAnimations[i];
				
				if(listOnly) {
					printf("%s%s.anim\n", prefix.c_str(), a->mName.data);
				} else {
					printf("Importing '%s' (%d tracks)\n", a->mName.data, a->mNumChannels);					
				}	
				
			
				IAnimation *anim = new IAnimation();
				anim->tps = a->mTicksPerSecond;
				anim->name = a->mName.data;
				anim->numTracks = a->mNumChannels;
				anim->length = a->mDuration/a->mTicksPerSecond;
	
				for(int c=0; c < a->mNumChannels; c++) {
					aiNodeAnim *nodeAnim = a->mChannels[c];

					ITrack *track = new ITrack();
					track->nodeAnim = nodeAnim;
//.........这里部分代码省略.........
开发者ID:Gwill,项目名称:Polycode,代码行数:101,代码来源:polyimport.cpp

示例14: main


//.........这里部分代码省略.........
		return 1;		
	}

	if(configFile.root["defaultHeight"]) {
		printf("Height: %d\n", configFile.root["defaultHeight"]->intVal);
		defaultHeight = configFile.root["defaultHeight"]->intVal;
	} else {
		printf("Required parameter: \"defaultHeight\" is missing from config file!\n");
		return 1;		
	}

	// start optional params

	if(configFile.root["frameRate"]) {
		printf("Frame rate: %d\n", configFile.root["frameRate"]->intVal);
		frameRate = configFile.root["frameRate"]->intVal;
	}

	if(configFile.root["antiAliasingLevel"]) {
		printf("Anti-aliasing level: %d\n", configFile.root["antiAliasingLevel"]->intVal);
		antiAliasingLevel = configFile.root["antiAliasingLevel"]->intVal;
	}

	if(configFile.root["fullScreen"]) {
		fullScreen = configFile.root["fullScreen"]->boolVal;
		if(fullScreen) {
			printf("Full-screen: true\n");
		} else {
			printf("Full-screen: false\n");
		}
	}

	if(configFile.root["backgroundColor"]) {
		ObjectEntry *color = configFile.root["backgroundColor"];
		if((*color)["red"] && (*color)["green"] && (*color)["blue"]) {
			backgroundColorR = (*color)["red"]->NumberVal;
			backgroundColorG = (*color)["green"]->NumberVal;
			backgroundColorB = (*color)["blue"]->NumberVal;
			printf("Background color: %f %f %f\n", backgroundColorR, backgroundColorG, backgroundColorB);

		} else {
			printf("backgroundColor node specified, but missing all three color attributes (red,green,blue). Ignoring.\n");
		}
	}

	zipFile z = zipOpen(getArg("--out").c_str(), 0);
	

	Object runInfo;
	runInfo.root.name = "PolycodeApp";
	runInfo.root.addChild("entryPoint", entryPoint);
	runInfo.root.addChild("defaultHeight", defaultHeight);
	runInfo.root.addChild("defaultWidth", defaultWidth);
	runInfo.root.addChild("frameRate", frameRate);
	runInfo.root.addChild("antiAliasingLevel", antiAliasingLevel);
	runInfo.root.addChild("fullScreen", fullScreen);
	
	ObjectEntry *color = runInfo.root.addChild("backgroundColor");
	color->addChild("red", backgroundColorR);
	color->addChild("green", backgroundColorG);
	color->addChild("blue", backgroundColorB);

	addFileToZip(z, entryPoint, entryPoint, false);

	if(configFile.root["modules"]) {
#ifdef _WINDOWS
开发者ID:RobLach,项目名称:Polycode,代码行数:67,代码来源:polybuild.cpp

示例15: saveFile

bool PolycodeProject::saveFile() {


    configFile.root["frameRate"]->intVal = data.frameRate;
    configFile.root["defaultWidth"]->intVal = data.defaultWidth;
    configFile.root["defaultHeight"]->intVal = data.defaultHeight;
    configFile.root["entryPoint"]->stringVal = data.entryPoint;
    configFile.root["entryPoint"]->type = ObjectEntry::STRING_ENTRY;

    configFile.root["textureFiltering"]->type = ObjectEntry::STRING_ENTRY;
    configFile.root["textureFiltering"]->stringVal = data.filteringMode;

    ObjectEntry *color = configFile.root["backgroundColor"];

    (*color)["red"]->NumberVal = data.backgroundColorR;
    (*color)["red"]->type = ObjectEntry::FLOAT_ENTRY;

    (*color)["green"]->NumberVal = data.backgroundColorG;
    (*color)["green"]->type = ObjectEntry::FLOAT_ENTRY;

    (*color)["blue"]->NumberVal = data.backgroundColorB;
    (*color)["blue"]->type = ObjectEntry::FLOAT_ENTRY;

    if(configFile.root["modules"]) {
        configFile.root["modules"]->Clear();
    }

    /*
    for(int j=0; j < data.modules.size(); j++) {
    	if(!configFile.root["modules"]) {
    		configFile.root.addChild("modules");
    	}
    	configFile.root["modules"]->type = ObjectEntry::ARRAY_ENTRY;
    	configFile.root["modules"]->addChild("module", data.modules[j]);

    	CoreServices::getInstance()->getResourceManager()->addArchive("Standalone/Modules/"+data.modules[j]+"/API");

    }
    */

    if(configFile.root["fonts"]) {
        configFile.root["fonts"]->Clear();
    }

    for(int j=0; j < data.fonts.size(); j++) {
        if(!configFile.root["fonts"]) {
            configFile.root.addChild("fonts");
        }
        configFile.root["fonts"]->type = ObjectEntry::ARRAY_ENTRY;

        ObjectEntry *objectEntry = configFile.root["fonts"]->addChild("font");
        objectEntry->addChild("name", data.fonts[j].fontName);
        objectEntry->addChild("path", data.fonts[j].fontPath);

    }

    if(configFile.root["packedItems"]) {
        configFile.root["packedItems"]->Clear();
    }

    vector<OSFileEntry> files = OSBasics::parseFolder(projectFolder, false);

    for(int i=0; i < files.size(); i++) {
        OSFileEntry entry = files[i];

        if(!configFile.root["packedItems"]) {
            configFile.root.addChild("packedItems");
        }

        if(entry.type == OSFileEntry::TYPE_FOLDER) {
            ObjectEntry *objectEntry = configFile.root["packedItems"]->addChild("item");
            objectEntry->addChild("type", "folder");
            objectEntry->addChild("path", entry.name);
        } else {
            if(entry.fullPath != projectFile) {
                ObjectEntry *objectEntry = configFile.root["packedItems"]->addChild("item");
                objectEntry->addChild("type", "file");
                objectEntry->addChild("path", entry.name);
            }
        }
    }


    unsigned int afMap[6] = {0,1,2,4,8,16};
    unsigned int aaMap[4] = {0,2,4,6};

    configFile.root["antiAliasingLevel"]->intVal = data.aaLevel;
    configFile.root["anisotropyLevel"]->intVal = data.anisotropy;
    configFile.root["vSync"]->boolVal = data.vSync;

    configFile.saveToXML(projectFile);

    return true;
}
开发者ID:CIB,项目名称:Polycode,代码行数:94,代码来源:PolycodeProject.cpp


注:本文中的ObjectEntry类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。