[vala-extra-vapis: 1/4] add shapelib.vapi
- From: Guillaume Poirier-Morency <poirigui src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vala-extra-vapis: 1/4] add shapelib.vapi
- Date: Sun, 11 Jun 2017 19:09:21 +0000 (UTC)
commit 19de29df891d504b45396c0353faa01f410aa06b
Author: Andreas Strasser <andreas-strasser mail de>
Date: Thu Jun 1 20:21:56 2017 +0200
add shapelib.vapi
shapelib.vapi | 241 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 241 insertions(+), 0 deletions(-)
---
diff --git a/shapelib.vapi b/shapelib.vapi
new file mode 100644
index 0000000..910539c
--- /dev/null
+++ b/shapelib.vapi
@@ -0,0 +1,241 @@
+/* This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+*/
+
+[CCode (cprefix = "", lower_case_cprefix = "", cheader_filename = "shapefil.h")]
+namespace ShapeFil {
+ [CCode (cprefix = "", has_type_id = "0")]
+ public enum DBFFieldType {
+ FTString,
+ FTInteger,
+ FTDouble,
+ FTLogical,
+ FTInvalid
+ }
+
+ [Compact]
+ [CCode (cname = "DBFInfo", free_function = "", cprefix = "DBF")]
+ public class DBFHandle {
+ [CCode (cname = "DBFOpen")]
+ public DBFHandle (string pszDBFFile, string pszAccess);
+ [CCode (cname = "DBFCreate")]
+ public DBFHandle.create (string pszDBFFile);
+ [CCode (cname = "DBFGetRecordCount")]
+ public int get_record_count ();
+ [CCode (cname = "DBFGetFieldCount")]
+ public int get_field_count ();
+ [CCode (cname = "DBFGetFieldIndex")]
+ public int get_field_index (string pszFieldName);
+ [CCode (cname = "DBFAddField")]
+ public int add_field (string pszFieldName, ShapeFil.DBFFieldType eType, int nWidth, int
nDecimals);
+ [CCode (cname = "DBFAddNativeFieldType")]
+ public int add_native_field_type (string pszFieldName, string chType, int nWidth, int
nDecimals);
+ [CCode (cname = "DBFCloneEmpty")]
+ public unowned ShapeFil.DBFHandle clone_empty (string pszFilename);
+ [CCode (cname = "DBFClose")]
+ public void close ();
+ [CCode (cname = "DBFGetFieldInfo")]
+ public ShapeFil.DBFFieldType get_field_info (int iField, string pszFieldName, int pnWidth,
int pnDecimals);
+ [CCode (cname = "DBFGetNativeFieldType")]
+ public unowned string get_native_field_type (int iField);
+ [CCode (cname = "DBFIsAttributeNULL")]
+ public int is_attribute_null (int iShape, int iField);
+ [CCode (cname = "DBFIsRecordDeleted")]
+ public int is_record_deleted (int iShape);
+ [CCode (cname = "DBFMarkRecordDeleted")]
+ public int mark_record_deleted (int iShape, int bIsDeleted);
+ [CCode (cname = "DBFReadDoubleAttribute")]
+ public double read_double_attribute (int iShape, int iField);
+ [CCode (cname = "DBFReadIntegerAttribute")]
+ public int read_integer_attribute (int iShape, int iField);
+ [CCode (cname = "DBFReadLogicalAttribute")]
+ public unowned string read_logical_attribute (int iShape, int iField);
+ [CCode (cname = "DBFReadStringAttribute")]
+ public unowned string read_string_attribute (int iShape, int iField);
+ [CCode (cname = "DBFReadTuple")]
+ public unowned string read_tuple (int hEntity);
+ [CCode (cname = "DBFUpdateHeader")]
+ public void update_header ();
+ [CCode (cname = "DBFWriteAttributeDirectly")]
+ public int write_attribute_directly (int hEntity, int iField, void* pValue);
+ [CCode (cname = "DBFWriteDoubleAttribute")]
+ public int write_double_attribute (int iShape, int iField, double dFieldValue);
+ [CCode (cname = "DBFWriteIntegerAttribute")]
+ public int write_integer_attribute (int iShape, int iField, int nFieldValue);
+ [CCode (cname = "DBFWriteLogicalAttribute")]
+ public int write_logical_attribute (int iShape, int iField, string lFieldValue);
+ [CCode (cname = "DBFWriteNULLAttribute")]
+ public int write_null_attribute (int iShape, int iField);
+ [CCode (cname = "DBFWriteStringAttribute")]
+ public int write_string_attribute (int iShape, int iField, string pszFieldValue);
+ [CCode (cname = "DBFWriteTuple")]
+ public int write_tuple (int hEntity, void* pRawTuple);
+ }
+
+ [Compact]
+ public class DBFInfo {
+ public unowned 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 unowned string pachFieldType;
+ public unowned string pszHeader;
+ public int nCurrentRecord;
+ public int bCurrentRecordModified;
+ public unowned string pszCurrentRecord;
+ public int bNoHeader;
+ public int bUpdated;
+ }
+
+ [Compact]
+ [CCode (cname = "SHPHandle", free_function = "", cprefix = "SHP")]
+ public class SHPHandle {
+ [CCode (cname = "SHPOpen")]
+ public SHPHandle (string pszShapeFile, string pszAccess);
+ [CCode (cname = "SHPCreate")]
+ public SHPHandle.create (string pszShapeFile, int nShapeType);
+ [CCode (cname = "SHPClose")]
+ public void close ();
+ [CCode (cname = "SHPCreateTree")]
+ public unowned ShapeFil.SHPTree create_tree (int nDimension, int nMaxDepth, double
padfBoundsMin, double padfBoundsMax);
+ [CCode (cname = "SHPGetInfo")]
+ public void get_info (int pnEntities, int pnShapeType, double padfMinBound, double
padfMaxBound);
+ [CCode (cname = "SHPReadObject")]
+ public unowned ShapeFil.SHPObject read_object (int iShape);
+ [CCode (cname = "SHPRewindObject")]
+ public int rewind_object (ShapeFil.SHPObject psObject);
+ [CCode (cname = "SHPWriteHeader")]
+ public void write_header (ShapeFil.SHPHandle hSHP);
+ [CCode (cname = "SHPWriteObject")]
+ public int write_object (ShapeFil.SHPHandle hSHP, int iShape, ShapeFil.SHPObject psObject);
+ }
+
+ [Compact]
+ public class SHPInfo {
+ public unowned GLib.FileStream fpSHP;
+ public unowned GLib.FileStream fpSHX;
+ public int nShapeType;
+ public int nFileSize;
+ public int nRecords;
+ public int nMaxRecords;
+ public int panRecOffset;
+ public int panRecSize;
+ [CCode (array_length = false)]
+ [NoArrayLength]
+ public unowned double[] adBoundsMin;
+ [CCode (array_length = false)]
+ [NoArrayLength]
+ public unowned double[] adBoundsMax;
+ public int bUpdated;
+ public uint pabyRec;
+ public int nBufSize;
+ }
+
+ [Compact]
+ [CCode (cname = "SHPObject", cprefix = "SHP")]
+ public class SHPObject {
+ [CCode (cname = "SHPCreateObject")]
+ public SHPObject (int nSHPType, int nShapeId, int nParts, int panPartStart, int panPartType, int
nVertices, double padfX, double padfY, double padfZ, double padfM);
+ [CCode (cname = "SHPCreateSimpleObject")]
+ public SHPObject.Simple (int nSHPType, int nVertices, double padfX, double padfY, double padfZ);
+ 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;
+ public void ComputeExtents ();
+ public void DestroyObject ();
+ }
+
+ [Compact]
+ [CCode (cname = "SHPTree", cprefix = "SHP")]
+ public class SHPTree {
+ [CCode (cname = "SHPReadTree")]
+ public SHPTree (string pszFilename);
+ public unowned ShapeFil.SHPHandle hSHP;
+ public int nMaxDepth;
+ public int nDimension;
+ public int nTotalCount;
+ public unowned ShapeFil.SHPTreeNode psRoot;
+ [CCode (cname = "SHPTreeAddObject")]
+ public int add_object (ShapeFil.SHPObject psObject);
+ [CCode (cname = "SHPTreeAddShapeId")]
+ public int add_shape_id (ShapeFil.SHPObject psObject);
+ [CCode (cname = "SHPTreeFindLikelyShapes")]
+ public int find_likely_shapes (double padfBoundsMin, double padfBoundsMax, int p4);
+ [CCode (cname = "SHPTreeRemoveShapeId")]
+ public int remove_shape_id (int nShapeId);
+ [CCode (cname = "SHPTreeTrimExtraNodes")]
+ public void trim_extra_nodes ();
+ [CCode (cname = "SHPWriteTree")]
+ public int write (string pszFilename);
+ [CCode (cname = "SHPDestroyTree")]
+ public void destroy ();
+ }
+ [Compact]
+ public class SHPTreeNode {
+ [CCode (array_length = false)]
+ public unowned double[] adfBoundsMin;
+ [CCode (array_length = false)]
+ public unowned double[] adfBoundsMax;
+ public int nShapeCount;
+ public int panShapeIds;
+ public unowned ShapeFil.SHPObject papsShapeObj;
+ public int nSubNodes;
+ public void* apsSubNode;
+ }
+
+ public const int MAX_SUBNODE;
+ public const int SHPP_FIRSTRING;
+ public const int SHPP_INNERRING;
+ public const int SHPP_OUTERRING;
+ public const int SHPP_RING;
+ public const int SHPP_TRIFAN;
+ public const int SHPP_TRISTRIP;
+ public const int SHPT_ARC;
+ public const int SHPT_ARCM;
+ public const int SHPT_ARCZ;
+ public const int SHPT_MULTIPATCH;
+ public const int SHPT_MULTIPOINT;
+ public const int SHPT_MULTIPOINTM;
+ public const int SHPT_MULTIPOINTZ;
+ public const int SHPT_NULL;
+ public const int SHPT_POINT;
+ public const int SHPT_POINTM;
+ public const int SHPT_POINTZ;
+ public const int SHPT_POLYGON;
+ public const int SHPT_POLYGONM;
+ public const int SHPT_POLYGONZ;
+ public const int XBASE_FLDHDR_SZ;
+ [CCode (cname = "SHPCheckBoundsOverlap")]
+ public static int check_bounds_overlap (double p1, double p2, double p3, double p4, int p5);
+ [CCode (cname = "SHPSearchDiskTree")]
+ public static int search_disk_tree (GLib.FileStream fp, double padfBoundsMin, double padfBoundsMax,
int pnShapeCount);
+ [CCode (cname = "SHPTypeName")]
+ public static unowned string type_name (int nSHPType);
+}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]