[Vala] Post vapi
- From: Tonatiuh Morales <tnt_zoe hotmail com>
- To: <vala-list gnome org>, Clément DAVID <c david86 gmail com>
- Subject: [Vala] Post vapi
- Date: Fri, 10 Oct 2008 17:32:25 +0000
Hi
This is a shapefil.vapi
/* shapefil.vapi generated by vapigen, do not modify. */
[CCode (cprefix = "ShapeFil", lower_case_cprefix = "shape_fil_")]
namespace ShapeFil {
[CCode (cprefix = "", has_type_id = "0", cheader_filename = "shapefil.h")]
public enum DBFFieldType {
FTString,
FTInteger,
FTDouble,
FTLogical,
FTInvalid
}
[Compact]
[CCode (cheader_filename = "shapefil.h")]
public class DBFHandle {
}
[Compact]
[CCode (cheader_filename = "shapefil.h")]
public class DBFInfo {
public weak GLib.FileStream fp;
public int nRecords;
public int nRecordLength;
public int nHeaderLength;
public int nFields;
public int panFieldOffset;
public int panFieldSize;
public int panFieldDecimals;
public weak string pachFieldType;
public weak string pszHeader;
public int nCurrentRecord;
public int bCurrentRecordModified;
public weak string pszCurrentRecord;
public int bNoHeader;
public int bUpdated;
}
[Compact]
[CCode (cheader_filename = "shapefil.h")]
public class SHPHandle {
}
[Compact]
[CCode (cheader_filename = "shapefil.h")]
public class SHPInfo {
public weak GLib.FileStream fpSHP;
public weak GLib.FileStream fpSHX;
public int nShapeType;
public int nFileSize;
public int nRecords;
public int nMaxRecords;
public int panRecOffset;
public int panRecSize;
[NoArrayLength]
public weak double[] adBoundsMin;
[NoArrayLength]
public weak double[] adBoundsMax;
public int bUpdated;
public uint pabyRec;
public int nBufSize;
}
[Compact]
[CCode (cheader_filename = "shapefil.h")]
public class SHPObject {
public int nSHPType;
public int nShapeId;
public int nParts;
public int panPartStart;
public int panPartType;
public int nVertices;
public double padfX;
public double padfY;
public double padfZ;
public double padfM;
public double dfXMin;
public double dfYMin;
public double dfZMin;
public double dfMMin;
public double dfXMax;
public double dfYMax;
public double dfZMax;
public double dfMMax;
public int bMeasureIsUsed;
}
[Compact]
[CCode (cheader_filename = "shapefil.h")]
public class SHPTree {
public weak ShapeFil.SHPHandle hSHP;
public int nMaxDepth;
public int nDimension;
public int nTotalCount;
public weak ShapeFil.SHPTreeNode psRoot;
}
[Compact]
[CCode (cheader_filename = "shapefil.h")]
public class SHPTreeNode {
[NoArrayLength]
public weak double[] adfBoundsMin;
[NoArrayLength]
public weak double[] adfBoundsMax;
public int nShapeCount;
public int panShapeIds;
public weak ShapeFil.SHPObject papsShapeObj;
public int nSubNodes;
public void* apsSubNode;
}
[CCode (cheader_filename = "shapefil.h")]
public const int MAX_SUBNODE;
[CCode (cheader_filename = "shapefil.h")]
public const int SHPP_FIRSTRING;
[CCode (cheader_filename = "shapefil.h")]
public const int SHPP_INNERRING;
[CCode (cheader_filename = "shapefil.h")]
public const int SHPP_OUTERRING;
[CCode (cheader_filename = "shapefil.h")]
public const int SHPP_RING;
[CCode (cheader_filename = "shapefil.h")]
public const int SHPP_TRIFAN;
[CCode (cheader_filename = "shapefil.h")]
public const int SHPP_TRISTRIP;
[CCode (cheader_filename = "shapefil.h")]
public const int SHPT_ARC;
[CCode (cheader_filename = "shapefil.h")]
public const int SHPT_ARCM;
[CCode (cheader_filename = "shapefil.h")]
public const int SHPT_ARCZ;
[CCode (cheader_filename = "shapefil.h")]
public const int SHPT_MULTIPATCH;
[CCode (cheader_filename = "shapefil.h")]
public const int SHPT_MULTIPOINT;
[CCode (cheader_filename = "shapefil.h")]
public const int SHPT_MULTIPOINTM;
[CCode (cheader_filename = "shapefil.h")]
public const int SHPT_MULTIPOINTZ;
[CCode (cheader_filename = "shapefil.h")]
public const int SHPT_NULL;
[CCode (cheader_filename = "shapefil.h")]
public const int SHPT_POINT;
[CCode (cheader_filename = "shapefil.h")]
public const int SHPT_POINTM;
[CCode (cheader_filename = "shapefil.h")]
public const int SHPT_POINTZ;
[CCode (cheader_filename = "shapefil.h")]
public const int SHPT_POLYGON;
[CCode (cheader_filename = "shapefil.h")]
public const int SHPT_POLYGONM;
[CCode (cheader_filename = "shapefil.h")]
public const int SHPT_POLYGONZ;
[CCode (cheader_filename = "shapefil.h")]
public const int XBASE_FLDHDR_SZ;
[CCode (cname = "DBFAddField", cheader_filename = "shapefil.h")]
public static int DBFAddField (ShapeFil.DBFHandle hDBF, string pszFieldName, ShapeFil.DBFFieldType
eType, int nWidth, int nDecimals);
[CCode (cname = "DBFAddNativeFieldType", cheader_filename = "shapefil.h")]
public static int DBFAddNativeFieldType (ShapeFil.DBFHandle hDBF, string pszFieldName, string chType,
int nWidth, int nDecimals);
[CCode (cname = "DBFCloneEmpty", cheader_filename = "shapefil.h")]
public static weak ShapeFil.DBFHandle DBFCloneEmpty (ShapeFil.DBFHandle psDBF, string pszFilename);
[CCode (cname = "DBFClose", cheader_filename = "shapefil.h")]
public static void DBFClose (ShapeFil.DBFHandle hDBF);
[CCode (cname = "DBFCreate", cheader_filename = "shapefil.h")]
public static weak ShapeFil.DBFHandle DBFCreate (string pszDBFFile);
[CCode (cname = "DBFGetFieldCount", cheader_filename = "shapefil.h")]
public static int DBFGetFieldCount (ShapeFil.DBFHandle psDBF);
[CCode (cname = "DBFGetFieldIndex", cheader_filename = "shapefil.h")]
public static int DBFGetFieldIndex (ShapeFil.DBFHandle psDBF, string pszFieldName);
[CCode (cname = "DBFGetFieldInfo", cheader_filename = "shapefil.h")]
public static ShapeFil.DBFFieldType DBFGetFieldInfo (ShapeFil.DBFHandle psDBF, int iField, string
pszFieldName, int pnWidth, int pnDecimals);
[CCode (cname = "DBFGetNativeFieldType", cheader_filename = "shapefil.h")]
public static weak string DBFGetNativeFieldType (ShapeFil.DBFHandle hDBF, int iField);
[CCode (cname = "DBFGetRecordCount", cheader_filename = "shapefil.h")]
public static int DBFGetRecordCount (ShapeFil.DBFHandle psDBF);
[CCode (cname = "DBFIsAttributeNULL", cheader_filename = "shapefil.h")]
public static int DBFIsAttributeNULL (ShapeFil.DBFHandle hDBF, int iShape, int iField);
[CCode (cname = "DBFIsRecordDeleted", cheader_filename = "shapefil.h")]
public static int DBFIsRecordDeleted (ShapeFil.DBFHandle psDBF, int iShape);
[CCode (cname = "DBFMarkRecordDeleted", cheader_filename = "shapefil.h")]
public static int DBFMarkRecordDeleted (ShapeFil.DBFHandle psDBF, int iShape, int bIsDeleted);
[CCode (cname = "DBFOpen", cheader_filename = "shapefil.h")]
public static weak ShapeFil.DBFHandle DBFOpen (string pszDBFFile, string pszAccess);
[CCode (cname = "DBFReadDoubleAttribute", cheader_filename = "shapefil.h")]
public static double DBFReadDoubleAttribute (ShapeFil.DBFHandle hDBF, int iShape, int iField);
[CCode (cname = "DBFReadIntegerAttribute", cheader_filename = "shapefil.h")]
public static int DBFReadIntegerAttribute (ShapeFil.DBFHandle hDBF, int iShape, int iField);
[CCode (cname = "DBFReadLogicalAttribute", cheader_filename = "shapefil.h")]
public static weak string DBFReadLogicalAttribute (ShapeFil.DBFHandle hDBF, int iShape, int iField);
[CCode (cname = "DBFReadStringAttribute", cheader_filename = "shapefil.h")]
public static weak string DBFReadStringAttribute (ShapeFil.DBFHandle hDBF, int iShape, int iField);
[CCode (cname = "DBFReadTuple", cheader_filename = "shapefil.h")]
public static weak string DBFReadTuple (ShapeFil.DBFHandle psDBF, int hEntity);
[CCode (cname = "DBFUpdateHeader", cheader_filename = "shapefil.h")]
public static void DBFUpdateHeader (ShapeFil.DBFHandle hDBF);
[CCode (cname = "DBFWriteAttributeDirectly", cheader_filename = "shapefil.h")]
public static int DBFWriteAttributeDirectly (ShapeFil.DBFHandle psDBF, int hEntity, int iField, void*
pValue);
[CCode (cname = "DBFWriteDoubleAttribute", cheader_filename = "shapefil.h")]
public static int DBFWriteDoubleAttribute (ShapeFil.DBFHandle hDBF, int iShape, int iField, double
dFieldValue);
[CCode (cname = "DBFWriteIntegerAttribute", cheader_filename = "shapefil.h")]
public static int DBFWriteIntegerAttribute (ShapeFil.DBFHandle hDBF, int iShape, int iField, int
nFieldValue);
[CCode (cname = "DBFWriteLogicalAttribute", cheader_filename = "shapefil.h")]
public static int DBFWriteLogicalAttribute (ShapeFil.DBFHandle hDBF, int iShape, int iField, string
lFieldValue);
[CCode (cname = "DBFWriteNULLAttribute", cheader_filename = "shapefil.h")]
public static int DBFWriteNULLAttribute (ShapeFil.DBFHandle hDBF, int iShape, int iField);
[CCode (cname = "DBFWriteStringAttribute", cheader_filename = "shapefil.h")]
public static int DBFWriteStringAttribute (ShapeFil.DBFHandle hDBF, int iShape, int iField, string
pszFieldValue);
[CCode (cname = "DBFWriteTuple", cheader_filename = "shapefil.h")]
public static int DBFWriteTuple (ShapeFil.DBFHandle psDBF, int hEntity, void* pRawTuple);
[CCode (cname = "SHPCheckBoundsOverlap", cheader_filename = "shapefil.h")]
public static int SHPCheckBoundsOverlap (double p1, double p2, double p3, double p4, int p5);
[CCode (cname = "SHPClose", cheader_filename = "shapefil.h")]
public static void SHPClose (ShapeFil.SHPHandle hSHP);
[CCode (cname = "SHPComputeExtents", cheader_filename = "shapefil.h")]
public static void SHPComputeExtents (ShapeFil.SHPObject psObject);
[CCode (cname = "SHPCreate", cheader_filename = "shapefil.h")]
public static weak ShapeFil.SHPHandle SHPCreate (string pszShapeFile, int nShapeType);
[CCode (cname = "SHPCreateObject", cheader_filename = "shapefil.h")]
public static weak ShapeFil.SHPObject SHPCreateObject (int nSHPType, int nShapeId, int nParts, int
panPartStart, int panPartType, int nVertices, double padfX, double padfY, double padfZ, double padfM);
[CCode (cname = "SHPCreateSimpleObject", cheader_filename = "shapefil.h")]
public static weak ShapeFil.SHPObject SHPCreateSimpleObject (int nSHPType, int nVertices, double
padfX, double padfY, double padfZ);
[CCode (cname = "SHPCreateTree", cheader_filename = "shapefil.h")]
public static weak ShapeFil.SHPTree SHPCreateTree (ShapeFil.SHPHandle hSHP, int nDimension, int
nMaxDepth, double padfBoundsMin, double padfBoundsMax);
[CCode (cname = "SHPDestroyObject", cheader_filename = "shapefil.h")]
public static void SHPDestroyObject (ShapeFil.SHPObject psObject);
[CCode (cname = "SHPDestroyTree", cheader_filename = "shapefil.h")]
public static void SHPDestroyTree (ShapeFil.SHPTree hTree);
[CCode (cname = "SHPGetInfo", cheader_filename = "shapefil.h")]
public static void SHPGetInfo (ShapeFil.SHPHandle hSHP, int pnEntities, int pnShapeType, double
padfMinBound, double padfMaxBound);
[CCode (cname = "SHPOpen", cheader_filename = "shapefil.h")]
public static weak ShapeFil.SHPHandle SHPOpen (string pszShapeFile, string pszAccess);
[CCode (cname = "SHPPartTypeName", cheader_filename = "shapefil.h")]
public static weak string SHPPartTypeName (int nPartType);
[CCode (cname = "SHPReadObject", cheader_filename = "shapefil.h")]
public static weak ShapeFil.SHPObject SHPReadObject (ShapeFil.SHPHandle hSHP, int iShape);
[CCode (cname = "SHPReadTree", cheader_filename = "shapefil.h")]
public static weak ShapeFil.SHPTree SHPReadTree (string pszFilename);
[CCode (cname = "SHPRewindObject", cheader_filename = "shapefil.h")]
public static int SHPRewindObject (ShapeFil.SHPHandle hSHP, ShapeFil.SHPObject psObject);
[CCode (cname = "SHPSearchDiskTree", cheader_filename = "shapefil.h")]
public static int SHPSearchDiskTree (GLib.FileStream fp, double padfBoundsMin, double padfBoundsMax,
int pnShapeCount);
[CCode (cname = "SHPTreeAddObject", cheader_filename = "shapefil.h")]
public static int SHPTreeAddObject (ShapeFil.SHPTree hTree, ShapeFil.SHPObject psObject);
[CCode (cname = "SHPTreeAddShapeId", cheader_filename = "shapefil.h")]
public static int SHPTreeAddShapeId (ShapeFil.SHPTree hTree, ShapeFil.SHPObject psObject);
[CCode (cname = "SHPTreeFindLikelyShapes", cheader_filename = "shapefil.h")]
public static int SHPTreeFindLikelyShapes (ShapeFil.SHPTree hTree, double padfBoundsMin, double
padfBoundsMax, int p4);
[CCode (cname = "SHPTreeRemoveShapeId", cheader_filename = "shapefil.h")]
public static int SHPTreeRemoveShapeId (ShapeFil.SHPTree hTree, int nShapeId);
[CCode (cname = "SHPTreeTrimExtraNodes", cheader_filename = "shapefil.h")]
public static void SHPTreeTrimExtraNodes (ShapeFil.SHPTree hTree);
[CCode (cname = "SHPTypeName", cheader_filename = "shapefil.h")]
public static weak string SHPTypeName (int nSHPType);
[CCode (cname = "SHPWriteHeader", cheader_filename = "shapefil.h")]
public static void SHPWriteHeader (ShapeFil.SHPHandle hSHP);
[CCode (cname = "SHPWriteObject", cheader_filename = "shapefil.h")]
public static int SHPWriteObject (ShapeFil.SHPHandle hSHP, int iShape, ShapeFil.SHPObject psObject);
[CCode (cname = "SHPWriteTree", cheader_filename = "shapefil.h")]
public static int SHPWriteTree (ShapeFil.SHPTree hTree, string pszFilename);
________________________________
Date: Fri, 10 Oct 2008 19:22:19 +0200
From: c david86 gmail com
To: tnt_zoe hotmail com
Subject: Re: [Vala] (no subject)
CC: vala-list gnome org
Hi,
I don't think that the ShapeLib use GObject convention so you cannot automagically generate a vapi file
from it. But you can hand-write a vapi which act as an auto transform layer from Vala to C the functions
call.
Can you post the generated vapi file here ?
2008/10/10 Tonatiuh Morales
Hi!!!
I have one problem!!
I do vapi for ShapeLib (read/write files dbf) i follow the tutorial for generat vapi and i don't have any
problem...
But i try do this:
using GLib;
using ShapeFil;
public class Main : Object {
public static void main (string[] args) {
weak DBFHandle handle = DBFOpen ("entidad.dbf","rb");
int campos = DBFGetFieldCount (handle);
int rows = DBFGetRecordCount (handle);
stdout.printf ("campos %d \n",campos);
stdout.printf ("rows %d \n",rows);
}
}
valac -C --pkg=ShapeFil Main.vala
valac generated this in method void main_main (char ** args, int args_length)
void main_main (char** args, int args_length1) {
ShapeFilDBFHandle* handle;
gint campos;
gint rows;
handle = DBFOpen ("entidad.dbf", "rb");
campos = DBFGetFieldCount (handle);
rows = DBFGetRecordCount (handle);
fprintf (stdout, "campos %d \n", campos);
fprintf (stdout, "rows %d \n", rows);
}
No exist ShapeFilDBFHandle, because is only DBFHandle
I have Fedora Core 9 , Vala 0.3.5 thank you !!!!! for you help =)
_________________________________________________________________
P.D. Checa las nuevas fotos de mi Space
http://home.services.spaces.live.com/
_______________________________________________
Vala-list mailing list
Vala-list gnome org
http://mail.gnome.org/mailman/listinfo/vala-list
_________________________________________________________________
Live Search premia tus búsquedas, llévate hasta ¡Un Auto!
http://www.ganabuscando.com/Default.aspx
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]