Exemplo n.º 1
0
/*
 * Find attribute
 *
 * Arguments: self - The NetscapeSPKI object
 *            name - The attribute name
 * Returns:   A Python object for the attribute, or NULL if something went
 *            wrong
 */
static PyObject *
crypto_NetscapeSPKI_getattr( crypto_NetscapeSPKIObj * self, char *name )
{
    return Py_FindMethod( crypto_NetscapeSPKI_methods, ( PyObject * ) self,
                          name );
}
Exemplo n.º 2
0
static PyObject * iXformProperty_getAttr(PyObject * self, char * attrName)
{
   //ALEMBIC_TRY_STATEMENT  //--- does not access any Alembic objects
   return Py_FindMethod(iXformProperty_methods, self, attrName);
   //ALEMBIC_PYOBJECT_CATCH_STATEMENT
}
Exemplo n.º 3
0
/*
 * Find attribute
 *
 * Arguments: self - The PKey object
 *            name - The attribute name
 * Returns:   A Python object for the attribute, or NULL if something went
 *            wrong
 */
static PyObject *
crypto_PKey_getattr( crypto_PKeyObj * self, char *name )
{
    return Py_FindMethod( crypto_PKey_methods, ( PyObject * ) self, name );
}
Exemplo n.º 4
0
static PyObject * ErisView_getattr(PyErisView * self, char * name)
{
    return Py_FindMethod(ErisView_methods, (PyObject *)self, name);
}
Exemplo n.º 5
0
static PyObject *
oss_mixer_getattr(oss_mixer_t *self, char *name)
{
    return Py_FindMethod(oss_mixer_methods, (PyObject *)self, name);
}
Exemplo n.º 6
0
static PyObject *
fh_getattr(fhobject *fhp, char *name)
{
    return Py_FindMethod(fh_methods, (PyObject *)fhp, name);
}
Exemplo n.º 7
0
static PyObject *getAttr (_ScanDevice * self, char *name)
{
    return Py_FindMethod (ScanDevice_methods, (PyObject *) self, name);
}
Exemplo n.º 8
0
static PyObject* wpRegion_getAttr( wpRegion* self, char* name )
{
	/*
		\rproperty region.parent This property represents the parent region of this region. If there is no parent region this
		property contains None, otherwise another region object for the parent region.
	*/
	if ( !strcmp( name, "parent" ) )
	{
		// Check if valid region
		cTerritory* pRegion = dynamic_cast<cTerritory*>( self->pRegion->parent() );
		return PyGetRegionObject( pRegion );
	}
	/*
		\rproperty region.children This property contains a tuple of region objects for the subregions within this region.
	*/
	else if ( !strcmp( name, "children" ) )
	{
		QList<cBaseRegion*> children = self->pRegion->children();
		PyObject* tuple = PyTuple_New( children.size() );
		for ( int i = 0; i < children.size(); ++i )
		{
			cTerritory* pRegion = dynamic_cast<cTerritory*>( children[i] );
			PyTuple_SetItem( tuple, i, PyGetRegionObject( pRegion ) );
		}
		return tuple;
	}
	/*
		\rproperty region.rectangles This property is a tuple of tuples containing x1, y1, x2 and y2 for the rectangles that define
		the area of this region.
	*/
	else if ( !strcmp( name, "rectangles" ) )
	{
		QList<cBaseRegion::rect_st> rectangles = self->pRegion->rectangles();
		PyObject* tuple = PyTuple_New( rectangles.size() );
		for ( int i = 0; i < rectangles.size(); ++i )
		{
			PyObject* subtuple = PyTuple_New( 4 );
			PyTuple_SetItem( subtuple, 0, PyInt_FromLong( rectangles[i].x1 ) );
			PyTuple_SetItem( subtuple, 1, PyInt_FromLong( rectangles[i].y1 ) );
			PyTuple_SetItem( subtuple, 2, PyInt_FromLong( rectangles[i].x2 ) );
			PyTuple_SetItem( subtuple, 3, PyInt_FromLong( rectangles[i].y2 ) );

			PyTuple_SetItem( tuple, i, subtuple );
		}
		return tuple;
	}
	/*
		\rproperty region.name The name of this region.
	*/
	else if ( !strcmp( name, "name" ) )
		return QString2Python( self->pRegion->name() );
	/*
		\rproperty region.resores The Definition of Ores of this Region.
	*/
	else if ( !strcmp( name, "resores" ) )
		return QString2Python( self->pRegion->resores() );
	/*
		\rproperty region.firstcoin The Definition of the First Coin for this Region (From New Monetary).
	*/
	else if ( !strcmp( name, "firstcoin" ) )
		return QString2Python( self->pRegion->firstcoin() );
	/*
		\rproperty region.secondcoin The Definition of the Second Coin for this Region (From New Monetary).
	*/
	else if ( !strcmp( name, "secondcoin" ) )
		return QString2Python( self->pRegion->secondcoin() );
	/*
		\rproperty region.thirdcoin The Definition of the Third Coin for this Region (From New Monetary).
	*/
	else if ( !strcmp( name, "thirdcoin" ) )
		return QString2Python( self->pRegion->thirdcoin() );
	/*
		\rproperty region.midilist A list of midi sounds to be played for this region.
	*/
	else if ( !strcmp( name, "midilist" ) )
		return QString2Python( self->pRegion->midilist() );
	/*
		\rproperty region.guardowner The name of the guardowner for this region.
	*/
	else if ( !strcmp( name, "guardowner" ) )
		return QString2Python( self->pRegion->guardOwner() );
	/*
		\rproperty region.fixedlight The Fixed LightLevel for this Region (Will return -1 to no fixed light level)
	*/
	else if ( !strcmp( name, "fixedlight" ) )
		return PyInt_FromLong( self->pRegion->fixedlight() );
	/*
		\rproperty region.lightmodifier The Modifier for LightLevel in this Region
	*/
	else if ( !strcmp( name, "lightmodifier" ) )
		return PyInt_FromLong( self->pRegion->lightmodifier() );

	// Flags
	/*
		\rproperty region.guarded This boolean flag indicates whether the region is guarded or not.
	*/
	else if ( !strcmp( name, "guarded" ) )
		return PyInt_FromLong( self->pRegion->isGuarded() ? 1 : 0 );
	/*
		\rproperty region.nomark This boolean flag indicates whether runes aren't markable in this region or not.
	*/
	else if ( !strcmp( name, "nomark" ) )
		return PyInt_FromLong( self->pRegion->isNoMark() ? 1 : 0 );
	/*
		\rproperty region.nogate This boolean flag indicates whether gates in or out of this region are allowed.
	*/
	else if ( !strcmp( name, "nogate" ) )
		return PyInt_FromLong( self->pRegion->isNoGate() ? 1 : 0 );
	/*
		\rproperty region.norecallout This boolean flag indicates whether recalling out of this region is allowed.
	*/
	else if ( !strcmp( name, "norecallout" ) )
		return PyInt_FromLong( self->pRegion->isNoRecallOut() ? 1 : 0 );
	/*
		\rproperty region.norecallin This boolean flag indicates whether recalling into this region is allowed.
	*/
	else if ( !strcmp( name, "norecallin" ) )
		return PyInt_FromLong( self->pRegion->isNoRecallIn() ? 1 : 0 );
	/*
		\rproperty region.noagressivemagic This boolean flag indicates whether agressive magic is forbidden in this region or not.
	*/
	else if ( !strcmp( name, "noagressivemagic" ) )
		return PyInt_FromLong( self->pRegion->isNoAgressiveMagic() ? 1 : 0 );
	/*
		\rproperty region.antimagic This boolean flag indicates whether magic is forbidden in this region or not.
	*/
	else if ( !strcmp( name, "antimagic" ) )
		return PyInt_FromLong( self->pRegion->isAntiMagic() ? 1 : 0 );
	/*
		\rproperty region.cave This boolean flag indicates that this region is underground.
	*/
	else if ( !strcmp( name, "cave" ) )
		return PyInt_FromLong( self->pRegion->isCave() ? 1 : 0 );
	/*
		\rproperty region.nodecay This boolean flag indicates that items do not decay in this region.
	*/
	else if ( !strcmp( name, "nodecay" ) )
		return PyInt_FromLong( self->pRegion->isNoDecay() ? 1 : 0 );
	/*
		\rproperty region.nomusic This boolean flag indicates that no music should be played in this region.
	*/
	else if ( !strcmp( name, "nomusic" ) )
		return PyInt_FromLong( self->pRegion->isNoMusic() ? 1 : 0 );
	/*
		\rproperty region.noguardmessage This boolean flag indicates that no guard message should show when entering this region..
	*/
	else if ( !strcmp( name, "noguardmessage" ) )
		return PyInt_FromLong( self->pRegion->isNoGuardMessage() ? 1 : 0 );
	/*
		\rproperty region.noentermessage This boolean flag indicates that no entrance message should show when entering this region.
	*/
	else if ( !strcmp( name, "noentermessage" ) )
		return PyInt_FromLong( self->pRegion->isNoEnterMessage() ? 1 : 0 );
	/*
		\rproperty region.instalogout This boolean flag indicates if Region is a InstaLogout Region or not.
	*/
	else if ( !strcmp( name, "instalogout" ) )
		return PyInt_FromLong( self->pRegion->isInstaLogout() ? 1 : 0 );
	/*
		\rproperty region.noteleport This boolean flag indicates that no Teleport Magic is allowed in this place.
	*/
	else if ( !strcmp( name, "noteleport" ) )
		return PyInt_FromLong( self->pRegion->isNoTeleport() ? 1 : 0 );
	/*
		\rproperty region.safe This boolean flag indicates the Region is a Safe Region (no one can be harmed here).
	*/
	else if ( !strcmp( name, "safe" ) )
		return PyInt_FromLong( self->pRegion->isSafe() ? 1 : 0 );
	/*
		\rproperty region.nocriminalcombat This boolean flag indicates that attacks here against innocent targets, cant make attacker criminal.
	*/
	else if ( !strcmp( name, "nocriminalcombat" ) )
		return PyInt_FromLong( self->pRegion->isNoCriminalCombat() ? 1 : 0 );
	/*
		\rproperty region.nokillcount This boolean flag indicates that Kills are not counted on this area.
	*/
	else if ( !strcmp( name, "nokillcount" ) )
		return PyInt_FromLong( self->pRegion->isNoKillCount() ? 1 : 0 );
	/*
		\rproperty region.israining This boolean flag indicates that this Region is Raining or not.
	*/
	else if ( !strcmp( name, "israining" ) )
		return PyInt_FromLong( self->pRegion->isRaining() ? 1 : 0);
	/*
		\rproperty region.issnowing This boolean flag indicates that this Region is Raining or not.
	*/
	else if ( !strcmp( name, "issnowing" ) )
		return PyInt_FromLong( self->pRegion->isSnowing() ? 1 : 0);
	/*
		\rproperty region.rainchance The Rain Chance for that Region
	*/
	else if ( !strcmp( name, "rainchance" ) )
		return PyInt_FromLong( self->pRegion->rainChance() );
	/*
		\rproperty region.snowchance The Snow Chance for that Region
	*/
	else if ( !strcmp( name, "snowchance" ) )
		return PyInt_FromLong( self->pRegion->snowChance() );
	/*
		\rproperty region.weatherday The day for Next Weather Change
	*/
	else if ( !strcmp( name, "weatherday" ) )
		return PyInt_FromLong( self->pRegion->weatherday() );
	/*
		\rproperty region.weatherhour The hour for Next Weather Change
	*/
	else if ( !strcmp( name, "weatherhour" ) )
		return PyInt_FromLong( self->pRegion->weatherhour() );
	/*
		\rproperty region.rainduration The Default duration for Rain in this Region
	*/
	else if ( !strcmp( name, "rainduration" ) )
		return PyInt_FromLong( self->pRegion->rainduration() );
	/*
		\rproperty region.snowduration The Default duration for Snow in this Region
	*/
	else if ( !strcmp( name, "snowduration" ) )
		return PyInt_FromLong( self->pRegion->snowduration() );
	/*
		\rproperty region.dryduration The Default duration for Dry in this Region
	*/
	else if ( !strcmp( name, "dryduration" ) )
		return PyInt_FromLong( self->pRegion->dryduration() );
	/*
		\rproperty region.rainrangeduration The Default range for Rain duration in this Region
	*/
	else if ( !strcmp( name, "rainrangeduration" ) )
		return PyInt_FromLong( self->pRegion->rainrangeduration() );
	/*
		\rproperty region.snowrangeduration The Default range for Snow duration in this Region
	*/
	else if ( !strcmp( name, "snowrangeduration" ) )
		return PyInt_FromLong( self->pRegion->snowrangeduration() );
	/*
		\rproperty region.dryrangeduration The Default range for Dry duration in this Region
	*/
	else if ( !strcmp( name, "dryrangeduration" ) )
		return PyInt_FromLong( self->pRegion->dryrangeduration() );
	/*
		\rproperty region.maxintensity The Max Value for Weather Intensity in this Region
	*/
	else if ( !strcmp( name, "maxintensity" ) )
		return PyInt_FromLong( self->pRegion->maxintensity() );
	/*
		\rproperty region.minintensity The Min Value for Weather Intensity in this Region
	*/
	else if ( !strcmp( name, "minintensity" ) )
		return PyInt_FromLong( self->pRegion->minintensity() );
	/*
		\rproperty region.intensity The Actual Value for Weather Intensity in this Region
	*/
	else if ( !strcmp( name, "intensity" ) )
		return PyInt_FromLong( self->pRegion->intensity() );
	/*
		\rproperty region.extraflags The Extra Flags for this Region
	*/
	else if ( !strcmp( name, "extraflags" ) )
		return PyInt_FromLong( self->pRegion->extraflags() );

	return Py_FindMethod( wpRegionMethods, ( PyObject * ) self, name );
}
Exemplo n.º 9
0
static PyObject *
navigation_getattr_py(PyObject *self, char *name)
{
	return Py_FindMethod(navigation_methods, self, name);
}
Exemplo n.º 10
0
/*
 * GetAttr
 */
static PyObject *
PyDiaError_GetAttr(PyDiaError *self, gchar *attr)
{
  return Py_FindMethod(PyDiaError_Methods, (PyObject *)self, attr);
}
Exemplo n.º 11
0
static PyObject *
lock_getattr(lockobject *self, char *name)
{
	return Py_FindMethod(lock_methods, (PyObject *)self, name);
}
Exemplo n.º 12
0
static PyObject*  
_outline_getattr(OutlineObject* self, char* name)
{
    return Py_FindMethod(_outline_methods, (PyObject*) self, name);
}
Exemplo n.º 13
0
PyObject *ekg_session_get_attr(ekg_sessionObj * self, char * attr)
{
	return Py_FindMethod(ekg_session_methods, (PyObject *) self, attr);
}
Exemplo n.º 14
0
static PyObject *
opencc_getattr(openccobject *dp, char *name)
{
    return Py_FindMethod(opencc_methods, (PyObject *)dp, name);
}
Exemplo n.º 15
0
static PyObject *wpDbResult_getAttr(wpDbResult *self, char *name) {
	return Py_FindMethod(wpDbResultMethods, (PyObject*)self, name);
}
Exemplo n.º 16
0
// python callbacks
static PyObject *
pyxa_instance_getattr(PyObject *self, char *attrname) {
    return Py_FindMethod(pyxa_instance_methods, self, attrname);
}
Exemplo n.º 17
0
static PyObject *py_samr_alias_hnd_getattr(PyObject *self, char *attrname)
{
	return Py_FindMethod(samr_alias_methods, self, attrname);
}
Exemplo n.º 18
0
PyObject *
PySurfaceAttributes_getattr(PyObject *self, char *name)
{
    if(strcmp(name, "legendFlag") == 0)
        return SurfaceAttributes_GetLegendFlag(self, NULL);
    if(strcmp(name, "lightingFlag") == 0)
        return SurfaceAttributes_GetLightingFlag(self, NULL);
    if(strcmp(name, "surfaceFlag") == 0)
        return SurfaceAttributes_GetSurfaceFlag(self, NULL);
    if(strcmp(name, "wireframeFlag") == 0)
        return SurfaceAttributes_GetWireframeFlag(self, NULL);
    if(strcmp(name, "limitsMode") == 0)
        return SurfaceAttributes_GetLimitsMode(self, NULL);
    if(strcmp(name, "OriginalData") == 0)
        return PyInt_FromLong(long(SurfaceAttributes::OriginalData));
    if(strcmp(name, "CurrentPlot") == 0)
        return PyInt_FromLong(long(SurfaceAttributes::CurrentPlot));

    if(strcmp(name, "minFlag") == 0)
        return SurfaceAttributes_GetMinFlag(self, NULL);
    if(strcmp(name, "maxFlag") == 0)
        return SurfaceAttributes_GetMaxFlag(self, NULL);
    if(strcmp(name, "colorByZFlag") == 0)
        return SurfaceAttributes_GetColorByZFlag(self, NULL);
    if(strcmp(name, "scaling") == 0)
        return SurfaceAttributes_GetScaling(self, NULL);
    if(strcmp(name, "Linear") == 0)
        return PyInt_FromLong(long(SurfaceAttributes::Linear));
    if(strcmp(name, "Log") == 0)
        return PyInt_FromLong(long(SurfaceAttributes::Log));
    if(strcmp(name, "Skew") == 0)
        return PyInt_FromLong(long(SurfaceAttributes::Skew));

    if(strcmp(name, "lineStyle") == 0)
        return SurfaceAttributes_GetLineStyle(self, NULL);
    if(strcmp(name, "SOLID") == 0)
        return PyInt_FromLong(long(0));
    else if(strcmp(name, "DASH") == 0)
        return PyInt_FromLong(long(1));
    else if(strcmp(name, "DOT") == 0)
        return PyInt_FromLong(long(2));
    else if(strcmp(name, "DOTDASH") == 0)
        return PyInt_FromLong(long(3));

    if(strcmp(name, "lineWidth") == 0)
        return SurfaceAttributes_GetLineWidth(self, NULL);
    if(strcmp(name, "surfaceColor") == 0)
        return SurfaceAttributes_GetSurfaceColor(self, NULL);
    if(strcmp(name, "wireframeColor") == 0)
        return SurfaceAttributes_GetWireframeColor(self, NULL);
    if(strcmp(name, "skewFactor") == 0)
        return SurfaceAttributes_GetSkewFactor(self, NULL);
    if(strcmp(name, "min") == 0)
        return SurfaceAttributes_GetMin(self, NULL);
    if(strcmp(name, "max") == 0)
        return SurfaceAttributes_GetMax(self, NULL);
    if(strcmp(name, "colorTableName") == 0)
        return SurfaceAttributes_GetColorTableName(self, NULL);
    if(strcmp(name, "invertColorTable") == 0)
        return SurfaceAttributes_GetInvertColorTable(self, NULL);

    return Py_FindMethod(PySurfaceAttributes_methods, self, name);
}
Exemplo n.º 19
0
static PyObject*  
_getattr(ImagingEncoderObject* self, char* name)
{
    return Py_FindMethod(methods, (PyObject*) self, name);
}
Exemplo n.º 20
0
PyObject *
PyMeshAttributes_getattr(PyObject *self, char *name)
{
    if(strcmp(name, "legendFlag") == 0)
        return MeshAttributes_GetLegendFlag(self, NULL);
    if(strcmp(name, "lineStyle") == 0)
        return MeshAttributes_GetLineStyle(self, NULL);
    if(strcmp(name, "SOLID") == 0)
        return PyInt_FromLong(long(0));
    else if(strcmp(name, "DASH") == 0)
        return PyInt_FromLong(long(1));
    else if(strcmp(name, "DOT") == 0)
        return PyInt_FromLong(long(2));
    else if(strcmp(name, "DOTDASH") == 0)
        return PyInt_FromLong(long(3));

    if(strcmp(name, "lineWidth") == 0)
        return MeshAttributes_GetLineWidth(self, NULL);
    if(strcmp(name, "meshColor") == 0)
        return MeshAttributes_GetMeshColor(self, NULL);
    if(strcmp(name, "meshColorSource") == 0)
        return MeshAttributes_GetMeshColorSource(self, NULL);
    if(strcmp(name, "Foreground") == 0)
        return PyInt_FromLong(long(MeshAttributes::Foreground));
    if(strcmp(name, "MeshCustom") == 0)
        return PyInt_FromLong(long(MeshAttributes::MeshCustom));

    if(strcmp(name, "opaqueColorSource") == 0)
        return MeshAttributes_GetOpaqueColorSource(self, NULL);
    if(strcmp(name, "Background") == 0)
        return PyInt_FromLong(long(MeshAttributes::Background));
    if(strcmp(name, "OpaqueCustom") == 0)
        return PyInt_FromLong(long(MeshAttributes::OpaqueCustom));

    if(strcmp(name, "opaqueMode") == 0)
        return MeshAttributes_GetOpaqueMode(self, NULL);
    if(strcmp(name, "Auto") == 0)
        return PyInt_FromLong(long(MeshAttributes::Auto));
    if(strcmp(name, "On") == 0)
        return PyInt_FromLong(long(MeshAttributes::On));
    if(strcmp(name, "Off") == 0)
        return PyInt_FromLong(long(MeshAttributes::Off));

    if(strcmp(name, "pointSize") == 0)
        return MeshAttributes_GetPointSize(self, NULL);
    if(strcmp(name, "opaqueColor") == 0)
        return MeshAttributes_GetOpaqueColor(self, NULL);
    if(strcmp(name, "smoothingLevel") == 0)
        return MeshAttributes_GetSmoothingLevel(self, NULL);
    if(strcmp(name, "None") == 0)
        return PyInt_FromLong(long(MeshAttributes::None));
    if(strcmp(name, "Fast") == 0)
        return PyInt_FromLong(long(MeshAttributes::Fast));
    if(strcmp(name, "High") == 0)
        return PyInt_FromLong(long(MeshAttributes::High));

    if(strcmp(name, "pointSizeVarEnabled") == 0)
        return MeshAttributes_GetPointSizeVarEnabled(self, NULL);
    if(strcmp(name, "pointSizeVar") == 0)
        return MeshAttributes_GetPointSizeVar(self, NULL);
    if(strcmp(name, "pointType") == 0)
        return MeshAttributes_GetPointType(self, NULL);
    if(strcmp(name, "Box") == 0)
        return PyInt_FromLong(long(MeshAttributes::Box));
    if(strcmp(name, "Axis") == 0)
        return PyInt_FromLong(long(MeshAttributes::Axis));
    if(strcmp(name, "Icosahedron") == 0)
        return PyInt_FromLong(long(MeshAttributes::Icosahedron));
    if(strcmp(name, "Octahedron") == 0)
        return PyInt_FromLong(long(MeshAttributes::Octahedron));
    if(strcmp(name, "Tetrahedron") == 0)
        return PyInt_FromLong(long(MeshAttributes::Tetrahedron));
    if(strcmp(name, "SphereGeometry") == 0)
        return PyInt_FromLong(long(MeshAttributes::SphereGeometry));
    if(strcmp(name, "Point") == 0)
        return PyInt_FromLong(long(MeshAttributes::Point));
    if(strcmp(name, "Sphere") == 0)
        return PyInt_FromLong(long(MeshAttributes::Sphere));

    if(strcmp(name, "showInternal") == 0)
        return MeshAttributes_GetShowInternal(self, NULL);
    if(strcmp(name, "pointSizePixels") == 0)
        return MeshAttributes_GetPointSizePixels(self, NULL);
    if(strcmp(name, "opacity") == 0)
        return MeshAttributes_GetOpacity(self, NULL);

    // Try and handle legacy fields in MeshAttributes
    if(strcmp(name, "backgroundFlag") == 0)
    {
        MeshAttributesObject *meshObj = (MeshAttributesObject *)self;
        bool backgroundFlag = meshObj->data->GetOpaqueColorSource() == MeshAttributes::Background;
        return PyInt_FromLong(backgroundFlag?1L:0L);
    }
    else if(strcmp(name, "foregroundFlag") == 0)
    {
        MeshAttributesObject *meshObj = (MeshAttributesObject *)self;
        bool foregroundFlag = meshObj->data->GetMeshColorSource() == MeshAttributes::Foreground;
        return PyInt_FromLong(foregroundFlag?1L:0L);
    }
    return Py_FindMethod(PyMeshAttributes_methods, self, name);
}