VectorAttributes.code 1.51 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
Target: xml2python
Code: PyVectorAttributes_getattr
Prefix:
Postfix:
    // Try and handle legacy fields in VectorAttributes
    if(strcmp(name, "highQuality") == 0)
    {
        VectorAttributesObject *vectorObj = (VectorAttributesObject *)self;
        bool highQuality = vectorObj->data->GetGeometryQuality() == VectorAttributes::High;
        return PyInt_FromLong(highQuality?1L:0L);
    }

Code: PyVectorAttributes_setattr
Prefix:
Postfix:
   // Try and handle legacy fields in VectorAttributes
    if(obj == NULL)
    {
        VectorAttributesObject *VectorObj = (VectorAttributesObject *)self;
        if(strcmp(name, "highQuality") == 0)
        {
            int ival;
            if(!PyArg_ParseTuple(tuple, "i", &ival))
            {
                Py_DECREF(tuple);
                return -1;
            }
            if(ival == 0)
                VectorObj->data->SetGeometryQuality(VectorAttributes::Fast);
            else
                VectorObj->data->SetGeometryQuality(VectorAttributes::High);
    
            Py_INCREF(Py_None);
            obj = Py_None;
        }
    }

Target: xml2atts
hrchilds's avatar
hrchilds committed
39 40 41 42 43 44 45 46
Function: ChangesRequireRecalculation
Declaration: bool ChangesRequireRecalculation(const VectorAttributes &obj);
Definition:
bool
VectorAttributes::ChangesRequireRecalculation(const VectorAttributes &obj)
{
    return ((useStride != obj.useStride) ||
            (stride != obj.stride) ||
hrchilds's avatar
hrchilds committed
47
            (glyphLocation != obj.glyphLocation) ||
48 49
            (nVectors != obj.nVectors) ||
            (origOnly != obj.origOnly));
hrchilds's avatar
hrchilds committed
50
}
hrchilds's avatar
hrchilds committed
51