Ejemplo n.º 1
0
KRpmPlugin::KRpmPlugin(QObject *parent,
                       const QStringList &args)
    
    : KFilePlugin(parent, args)
{
    KFileMimeTypeInfo* info = addMimeTypeInfo( "application/x-rpm" );
    KFileMimeTypeInfo::GroupInfo* group = 0L;
    group = addGroupInfo(info, "General", i18n("General"));
    KFileMimeTypeInfo::ItemInfo* item;

    item = addItemInfo(group, "Name", i18n("Name"), QVariant::String);
    item = addItemInfo(group, "Version", i18n("Version"), QVariant::String);
    item = addItemInfo(group, "Release", i18n("Release"), QVariant::Int);
    item = addItemInfo(group, "Summary", i18n("Summary"), QVariant::String);
    setAttributes ( item, KFileMimeTypeInfo::Description );
    item = addItemInfo(group, "Group", i18n("Group"), QVariant::String);
    item = addItemInfo(group, "Size", i18n("Size"), QVariant::Int);
    setUnit ( item, KFileMimeTypeInfo::Bytes );
    item = addItemInfo(group, "Vendor", i18n("Vendor"), QVariant::String );
    item = addItemInfo(group, "Packager", i18n("Packager"), QVariant::String );
    item = addItemInfo(group, "Archive Offset", i18n("Archive Offset"), QVariant::Int);
    item = addItemInfo(group, "Comment", i18n("Comment"), QVariant::String);
    setAttributes( item, KFileMimeTypeInfo::MultiLine );

    group = addGroupInfo(info, "All tags", i18n("All tags"));
    addVariableInfo(group, QVariant::String, 0);
}
Ejemplo n.º 2
0
SkeletalCreature::SkeletalCreature(unsigned char _family) : Agent(_family, 0, 0, 0) {
	facialexpression = 0;
	pregnancy = 0;
	eyesclosed = false;

	// TODO: set zorder randomly :) should be somewhere between 1000-2700, at a /guess/
	zorder = 1500;

	ticks = 0;
	gaitgene = 0;
	
	calculated = false;

	if (engine.version == 1) {
		setAttributes(64 + 4 + 2); // mouseable, activateable, groundbound(?!)
	} else if (engine.version == 2) {
		setAttributes(128 + 64 + 4 + 2); // mouseable, activateable, suffersphysics, sufferscollisions
		// default values from original engine
		size.setInt(224);
		rest.setInt(70);
		accg.setInt(15);
		aero.setInt(10);
	}

	for (unsigned int i = 0; i < 6; i++) appearancegenes[i] = 0;

	skeleton = new SkeletonPart(this);
}
Ejemplo n.º 3
0
void KOfficePlugin::makeMimeTypeInfo(const QString& mimeType)
{
    KFileMimeTypeInfo* info = addMimeTypeInfo( mimeType );

    userdefined = addGroupInfo(info, UserDefined, i18n("User Defined"));
    addVariableInfo(userdefined, QVariant::String,
		    KFileMimeTypeInfo::Addable   |
		    KFileMimeTypeInfo::Removable |
		    KFileMimeTypeInfo::Modifiable);

    KFileMimeTypeInfo::GroupInfo* group = 0L;
    group = addGroupInfo(info, DocumentInfo, i18n("Document Information"));
    KFileMimeTypeInfo::ItemInfo* item;
    int i = 0;
    for (i = 0; Information[i]; i+=2){
      item = addItemInfo(group, Information[i], i18n(Information[i+1]),
		      QVariant::String);
      setAttributes(item, KFileMimeTypeInfo::Modifiable);
      switch (i){
	      case 0:
		setHint(item, KFileMimeTypeInfo::Name);
		break;
	      case 1:
		setHint(item, KFileMimeTypeInfo::Author);
		break;
	      case 2:
		setHint(item, KFileMimeTypeInfo::Description);
	      default:;
     }
    }

    item = addItemInfo(group, metakeyword, i18n("Keywords"),
		       QVariant::String);
    setHint(item, KFileMimeTypeInfo::Description);
    setAttributes(item, KFileMimeTypeInfo::Modifiable);

    group = addGroupInfo(info, DocAdvanced, i18n("Document Advanced"));
    for (i = 0; Advanced[i]; i+=2){
      // I should add the isDate property instead of testing the index, but it works well, who cares ? :-)
    QVariant::Type typ = QVariant::String;
    if (i > 1 && i < 8)
	    typ = QVariant::DateTime;
    if (i == 14)
	    typ = QVariant::String;
      item = addItemInfo(group, Advanced[i], i18n(Advanced[i+1]), typ);
      setHint(item, KFileMimeTypeInfo::Description);
    }

    group = addGroupInfo(info, DocStatistics, i18n("Document Statistics"));
    for (i = 0; Statistics[i]; i+=2){
      item = addItemInfo(group, Statistics[i], i18n(Statistics[i+1]),
		         QVariant::Int);
      setHint(item, KFileMimeTypeInfo::Length);
    }
}
Ejemplo n.º 4
0
void MidiControllableParameter::setPreferred(bool on)
{
    if (on)
    {
        setAttributes(attributes() | MidiControllableParameter::Preferred);
    }
    else
    {
        setAttributes(attributes() & ~MidiControllableParameter::Attributes(MidiControllableParameter::Preferred));
    }
}
Ejemplo n.º 5
0
void LoadDefaultsDecoder::setAttributes(Root &obj, //Root &obj_inst, 
                                        const Element& melem, 
                                        std::set<std::string> used_attributes)
{
    MapType::const_iterator I;
    for (I = melem.asMap().begin(); I != melem.asMap().end(); I++) {
        std::set<std::string>::const_iterator attr_found = 
                               used_attributes.find(I->first);
        if (attr_found == used_attributes.end()) {
            //cout<<"    -->"<<I->first<<endl;
            obj->setAttr(I->first, I->second);
            //obj_inst->setAttr(I->first, I->second);
        }
        used_attributes.insert(I->first);
    }
    I = melem.asMap().find(Atlas::Objects::PARENTS_ATTR);
    if (I != melem.asMap().end()) {
        for (ListType::const_iterator J = I->second.asList().begin();
             J != I->second.asList().end(); J++) {
            //cout<<"  >"<<J->asString()<<endl;
            const Element & parent_melem = getMessageElement(J->asString());
            setAttributes(obj, /*obj_inst,*/ parent_melem, used_attributes);
        }
    }
}
Ejemplo n.º 6
0
void Kit::ingestCsvInput(std::vector<std::vector<std::string>> csvFieldList)
{
	std::vector<std::string> csvField;
	std::string firstField;
	std::string quantity;
	std::string partNumber;
	std::string description;
	int line;

	for (int i = 0; i < csvFieldList.size(); i++)
	{

		line = i;
		csvField = csvFieldList[i];

		if (line == 0)
		{
			firstField = csvField[0];
			setKitName(firstField);
		}

		//checks if field is size 3 and if not header
		if (csvField.size() >= 3 && csvField[0] != "Qty")
		{
			quantity = csvField[0];
			partNumber = csvField[1];
			description = csvField[2];
			setQuantity(quantity);
			setPartNumber(partNumber);
			setDescription(description);
			setAttributes(getQuantity(), getDescription());
			addParts();
		}
	}
}//end ingestCsvInput()
Ejemplo n.º 7
0
bool PP_Revision::_handleNestedRevAttr()
{
	const gchar * pNestedRev = NULL;
	getAttribute("revision", pNestedRev);
	
	if(pNestedRev)
	{
		PP_RevisionAttr NestedAttr(pNestedRev);

		// now remove "revision"
		setAttribute("revision", NULL);
		prune();

		// overlay the attrs and props from the revision attribute
		for(UT_uint32 i = 0; i < NestedAttr.getRevisionsCount(); ++i)
		{
			const PP_Revision * pRev = NestedAttr.getNthRevision(i);
			UT_return_val_if_fail( pRev, false );
					
			// ignore inserts and deletes
			if(pRev->getType() == PP_REVISION_ADDITION || pRev->getType() == PP_REVISION_DELETION)
				continue;

			setProperties(pRev->getProperties());
			setAttributes(pRev->getAttributes());
		}

		prune();
	}

	return true;
}
Ejemplo n.º 8
0
OSItem::OSItem(const OSItemId& itemId, OSItemType osItemType, QWidget * parent)
               : QWidget(parent),
               m_itemId(itemId),
               m_selectionWidget(nullptr),
               m_borderWidget(nullptr),
               m_removeButton(nullptr),
               m_textLbl(nullptr),
               m_imageLeftLbl(nullptr),
               m_imageRightLbl(nullptr),
               m_mouseDown(false),
               m_selected(false),
               m_draggable(true),
               m_inspectable(false),
               m_acceptsDrops(false),
               m_size(QSize()),
               m_osItemType(osItemType),
               m_borderColor(QColor(Qt::black)),
               m_useLargeIcon(false)
{
  this->setObjectName("OSItem");

  createLayout();

  setAttributes(osItemType);
}
Ejemplo n.º 9
0
PassRefPtr<HTMLElement> HTMLConstructionSite::createHTMLElement(AtomicHTMLToken* token)
{
    Document& document = ownerDocumentForCurrentNode();
    RefPtr<HTMLElement> element = HTMLElementFactory::createHTMLElement(token->name(), document, true);
    setAttributes(element.get(), token);
    return element.release();
}
Ejemplo n.º 10
0
PassRefPtr<Element> HTMLConstructionSite::createElement(AtomicHTMLToken* token, const AtomicString& namespaceURI)
{
    QualifiedName tagName(token->name());
    RefPtr<Element> element = ownerDocumentForCurrentNode().createElement(tagName, true);
    setAttributes(element.get(), token);
    return element.release();
}
Ejemplo n.º 11
0
void HTMLConstructionSite::insertScriptElement(AtomicHTMLToken* token)
{
    RefPtr<HTMLScriptElement> element = HTMLScriptElement::create(ownerDocumentForCurrentNode());
    setAttributes(element.get(), token);
    attachLater(currentNode(), element);
    m_openElements.push(element.release());
}
Ejemplo n.º 12
0
void NTNDArrayRecord::update()
{
    lock();
    try
    {
        beginGroupPut();
        PVUByteArray::svector bytes;
        imageGen->fillSharedVector(bytes,angle);
        setValue(freeze(bytes));
        if (firstTime)
        {
            int dims[] = { imageGen->getWidth(), imageGen->getHeight() };
            setDimension(dims, 2);
            setAttributes();
            setSizes(static_cast<int64_t>(imageGen->getSize()));
            firstTime = false;
        }
        setDataTimeStamp();
        setUniqueId(count++);
        process();
        endGroupPut();
    }
    catch(...)
    {
        unlock();
        throw;
    }
    angle += 1;
    unlock();
}
Ejemplo n.º 13
0
bool CNSprite::initWithDictionary(CCDictionary * pDict)
{
	if (!init())
	{
		CNLog("error");
		return false;
	}
	if (!pDict)
	{
		CNLog("invalid parameter: pDict");
		return false;
	}
	
	CCString * pFilename = (CCString *)pDict->objectForKey("File");
	if (pFilename)
	{
		replaceImageWithFile(pFilename->getCString());
	}
	
	CCString * pOpacity = (CCString *)pDict->objectForKey("Opacity");
	if (pOpacity)
	{
		setOpacity(pOpacity->intValue());
	}
	
	return setAttributes(pDict);
}
Ejemplo n.º 14
0
int HDMIDisplay::configure() {
    if(!openFrameBuffer()) {
        ALOGE("%s: Failed to open FB: %d", __FUNCTION__, mFbNum);
        return -1;
    }
    readCEUnderscanInfo();
    readResolution();
    // TODO: Move this to activate
    /* Used for changing the resolution
     * getUserMode will get the preferred
     * mode set thru adb shell */
    mCurrentMode = getUserMode();
    if (mCurrentMode == -1) {
        //Get the best mode and set
        mCurrentMode = getBestMode();
    }
    setAttributes();
    // set system property
    property_set("hw.hdmiON", "1");

    // Read the system property to determine if downscale feature is enabled.
    char value[PROPERTY_VALUE_MAX];
    mMDPDownscaleEnabled = false;
    if(property_get("sys.hwc.mdp_downscale_enabled", value, "false")
            && !strcmp(value, "true")) {
        mMDPDownscaleEnabled = true;
    }
    return 0;
}
Ejemplo n.º 15
0
KRgbPlugin::KRgbPlugin(QObject *parent, const QStringList &args) :
	KFilePlugin(parent, args)
{
	KFileMimeTypeInfo* info = addMimeTypeInfo("image/x-rgb");

	KFileMimeTypeInfo::GroupInfo* group = 0;
	KFileMimeTypeInfo::ItemInfo* item;


	group = addGroupInfo(info, "Comment", i18n("Comment"));

	item = addItemInfo(group, "ImageName", i18n("Name"), QVariant::String);
	setAttributes(item, KFileMimeTypeInfo::Modifiable);
	setHint(item, KFileMimeTypeInfo::Description);


	group = addGroupInfo(info, "Technical", i18n("Technical Details"));

	item = addItemInfo(group, "Dimensions", i18n("Dimensions"), QVariant::Size);
	setHint(item, KFileMimeTypeInfo::Size);
	setUnit(item, KFileMimeTypeInfo::Pixels);

	item = addItemInfo(group, "BitDepth", i18n("Bit Depth"), QVariant::Int);
	setUnit(item, KFileMimeTypeInfo::BitsPerPixel);

	item = addItemInfo(group, "ColorMode", i18n("Color Mode"), QVariant::String);
	item = addItemInfo(group, "Compression", i18n("Compression"), QVariant::String);
	item = addItemInfo(group, "SharedRows",
			i18nc("percentage of avoided vertical redundancy (the higher the better)",
			"Shared Rows"), QVariant::String);

}
Ejemplo n.º 16
0
bool TMedia::parse(QDomElement element)
{
    root_element   = element;
    setAttributes();     // special for every media type
    setBaseParameters(); // in this class
    loaded       = false;
    return true;
}
Ejemplo n.º 17
0
void ObjectDepsRefsWidget::setAttributes(ModelWidget *model_wgt, BaseObject *object, BaseObject *parent_obj)
{
  if(!model_wgt)
    throw Exception(ERR_OPR_NOT_ALOC_OBJECT ,__PRETTY_FUNCTION__,__FILE__,__LINE__);

  this->model_wgt=model_wgt;
  setAttributes(model_wgt->getDatabaseModel(), object, parent_obj);
}
Ejemplo n.º 18
0
DynamicObjectData::DynamicObjectData(const char* pname,
                                     ObjectData* r /* = NULL */) :
  root(r ? r : this) {
  if (pname) {
    CountableHelper h(root);
    parent = create_object(pname, Array(), false, root);
    setAttributes(parent.get());
  }
}
Ejemplo n.º 19
0
Kit::Kit()
{
	setKitName("");
	setPartNumber("");
	setQuantity("");
	setDescription("");
	setAttributes("", "");

}//end Kit()
Ejemplo n.º 20
0
	Node& Node::operator = ( const Node& other )
	{
		setName( other.name );
		setAttributes( other.attributes );
		setChildren( other.children );
		flag = other.flag;
		text = other.text;
		
		return ( * this );
	}
Ejemplo n.º 21
0
bool PackageUtils::preCreatePackage()
{
    bool result = setAttributes() && prepareWidget() && writeDesktopFile() && writeInstallationScripts() && writeRemovalScripts();

#if defined(Q_OS_MAEMO6)
    result = result && writeBackupConfigFile() && writeBackupRestoreScripts() && writeSecsessionFile();
#endif

    return result;
}
Ejemplo n.º 22
0
void
AttributesEditor::noBoxEdited()
{
  _boxEdited = NO_ID;
  setAttributes(new AbstractBox);
  _boxStartValue->clear();
  _boxLengthValue->clear();
  _boxName->clear();
  _colorButtonPixmap->fill(Qt::gray);
}
Ejemplo n.º 23
0
		void Control::refresh() {
			updated = false;

			HWND handle = getHandle();
			if (handle == nullptr) {
				handle = createHandle();
				setHandle(handle);
			}

			setAttributes(handle);
		}
Ejemplo n.º 24
0
void HairObject::setAttributes(HairObject *_oldObject){
    if (_oldObject == NULL){
        setAttributes();
    } else {
        setAttributes(
                    _oldObject->m_color,
                    _oldObject->m_numGroupHairs,
                    _oldObject->m_hairGroupSpread,
                    _oldObject->m_hairRadius,
                    _oldObject->m_noiseAmplitude,
                    _oldObject->m_noiseFrequency,
                    _oldObject->m_numSplineVertices,
                    _oldObject->m_shadowIntensity,
                    _oldObject->m_diffuseIntensity,
                    _oldObject->m_specularIntensity,
                    _oldObject->m_transparency,
                    _oldObject->m_useHairColorVariation,
                    _oldObject->m_hairColorVariation);
    }
}
Ejemplo n.º 25
0
// ----------------------------------
XML::Node::Node(const char *fmt,...)
{
	va_list ap;
  	va_start(ap, fmt);

	char tmp[8192];
	vsprintf(tmp,fmt,ap);
	setAttributes(tmp);

   	va_end(ap);	
	init();
}
Ejemplo n.º 26
0
	void Mesh::setVertices(vector<Vertex> vertices, vector<int> indices)
	{
		this->vertices.clear();
		this->indices.clear();

		this->vertices = vertices;
		this->indices = indices;

		setAttributes();

		uploaded = false;
	}
int VirtualDisplay::configure() {
    if(!openFrameBuffer())
        return -1;

    if(ioctl(mFd, FBIOGET_VSCREENINFO, &mVInfo) < 0) {
        ALOGD("%s: FBIOGET_VSCREENINFO failed with %s", __FUNCTION__,
                strerror(errno));
        return -1;
    }
    setAttributes();
    return 0;
}
    void GeneticGeneration::dump(TiXmlElement *generationElement,bool includeGenes)
    {
        setAttributes(generationElement);

        for (int a=0;a<(int)individuals.size();a++)
        {
            TiXmlElement *individualElement = new TiXmlElement("Individual");

            individuals[a]->dump(individualElement,includeGenes);

            generationElement->LinkEndChild(individualElement);
        }
    }
Ejemplo n.º 29
0
void CPUSideTriangleMesh::generatePhongNormals()
{
    assert( haveFaceNormals() && haveSmoothingGroups() && "Mesh should have smoothing groups - use generateSmoothingGroups");

    // vertex normals
    math::vector_of_vector3f normals(attributeArrays[0].count);
    // vertex normals indices
    std::vector<unsigned> indices(indicesArrays[0].indices.get(), indicesArrays[0].indices.get() + indicesArrays[0].count);
    // vertex smoothing groups
    std::vector<int> vertexSMGroup(attributeArrays[0].count, -1);

    // average normals against faces sharing same smoothing group
    for (size_t iFace = 0; iFace < faceNormals.size(); ++iFace)
    {
        for (size_t iVertInd = iFace * 3; iVertInd < iFace * 3 + 3; ++iVertInd)
        {
            unsigned iVert = indices[iVertInd];
            if (vertexSMGroup[iVert] == -1) 
            {
                vertexSMGroup[iVert] = get_first_nonzero_bit(smoothingGroups[iFace]);
                normals[iVert] = faceNormals[iFace];
            }
            else if ( (smoothingGroups[iFace] != 0) && (smoothingGroups[iFace] & (1 << (vertexSMGroup[iVert] - 1))) ) {
                normals[iVert] += faceNormals[iFace];
            }
            else 
            {
                indices[iVertInd] = normals.size();
                normals.push_back(faceNormals[iFace]);
                vertexSMGroup.push_back( get_first_nonzero_bit(smoothingGroups[iFace]) );
            }
        }
    }

    // normalize all
    for (size_t i = 0; i<normals.size(); ++i) {
        normals[i] = math::normalize(normals[i]);
    }

    // find attribute slot for normals
    int normalAttrIndex = getAttributeIndex("normal");
    if (normalAttrIndex == -1) {
        normalAttrIndex = getFreeAttributeIndex();
    }
    assert(normalAttrIndex != -1 && "No free slot for normals");

    // setup normals
    setAttributes("normal", normalAttrIndex, 3, normals.size(), sgl::FLOAT, &normals[0]);
    setIndices(normalAttrIndex, indices.size(), &indices[0]);
}
Ejemplo n.º 30
0
void ScaleEngine::clone(const ScaleEngine *engine)
{
    d_type = engine->type();
	d_break_left = engine->axisBreakLeft();
	d_break_right = engine->axisBreakRight();
    d_break_pos = engine->breakPosition();
	d_step_before = engine->stepBeforeBreak();
	d_step_after = engine->stepAfterBreak();
	d_minor_ticks_before = engine->minTicksBeforeBreak();
	d_minor_ticks_after = engine->minTicksAfterBreak();
    d_log10_scale_after = engine->log10ScaleAfterBreak();
    d_break_width = engine->breakWidth();
	d_break_decoration = engine->hasBreakDecoration();
	setAttributes(engine->attributes());
    setMargins(engine->loMargin(), engine->hiMargin());
}