X-Git-Url: http://pileus.org/git/?a=blobdiff_plain;f=src%2Fobjects%2Fgrits-tile.h;h=b13e1c346c62b9b0b86af471bbcc1c52b2e52a0e;hb=8594927c0cd07daea95e8b99dc36ffef4f12da8a;hp=91f5ac69d91a35beaf89d5cbc9e55ea5cab00581;hpb=d8948985b467a5cfd0447ae413ed1c5d01afb024;p=grits
diff --git a/src/objects/grits-tile.h b/src/objects/grits-tile.h
index 91f5ac6..b13e1c3 100644
--- a/src/objects/grits-tile.h
+++ b/src/objects/grits-tile.h
@@ -15,121 +15,125 @@
* along with this program. If not, see .
*/
-#ifndef __GIS_TILE_H__
-#define __GIS_TILE_H__
+#ifndef __GRITS_TILE_H__
+#define __GRITS_TILE_H__
#include
#include
#include "grits-object.h"
-#define GIS_TYPE_TILE (gis_tile_get_type())
-#define GIS_TILE(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), GIS_TYPE_TILE, GisTile))
-#define GIS_IS_TILE(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), GIS_TYPE_TILE))
-#define GIS_TILE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GIS_TYPE_TILE, GisTileClass))
-#define GIS_IS_TILE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GIS_TYPE_TILE))
-#define GIS_TILE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GIS_TYPE_TILE, GisTileClass))
+#define GRITS_TYPE_TILE (grits_tile_get_type())
+#define GRITS_TILE(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), GRITS_TYPE_TILE, GritsTile))
+#define GRITS_IS_TILE(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), GRITS_TYPE_TILE))
+#define GRITS_TILE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GRITS_TYPE_TILE, GritsTileClass))
+#define GRITS_IS_TILE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GRITS_TYPE_TILE))
+#define GRITS_TILE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GRITS_TYPE_TILE, GritsTileClass))
-typedef struct _GisTile GisTile;
-typedef struct _GisTileClass GisTileClass;
+typedef struct _GritsTile GritsTile;
+typedef struct _GritsTileClass GritsTileClass;
-struct _GisTile {
- GisObject parent_instance;
+struct _GritsTile {
+ GritsObject parent_instance;
/* Pointer to the tile data */
gpointer data;
+ gboolean load;
/* Drawing order */
gint zindex;
/* North,South,East,West limits */
- GisBounds edge;
+ GritsBounds edge;
/* Texture mapping coordinates */
- GisBounds coords;
+ GritsBounds coords;
/* Pointers to parent/child nodes */
- GisTile *parent;
- GisTile *children[2][2];
+ GritsTile *parent;
+ GritsTile *children[2][2];
/* Last access time (for garbage collection) */
time_t atime;
+
+ /* Projection used by tile data */
+ GritsProj proj;
};
-struct _GisTileClass {
- GisObjectClass parent_class;
+struct _GritsTileClass {
+ GritsObjectClass parent_class;
};
/**
- * GisTileLoadFunc:
+ * GritsTileLoadFunc:
* @tile: the tile to load
* @user_data: data paseed to the function
*
- * Used to load the image data associated with a tile. For GisOpenGL, this
+ * Used to load the image data associated with a tile. For GritsOpenGL, this
* function should store the OpenGL texture number in the tiles data field.
*/
-typedef void (*GisTileLoadFunc)(GisTile *tile, gpointer user_data);
+typedef void (*GritsTileLoadFunc)(GritsTile *tile, gpointer user_data);
/**
- * GisTileFreeFunc:
+ * GritsTileFreeFunc:
* @tile: the tile to free
* @user_data: data paseed to the function
*
* Used to free the image data associated with a tile
*/
-typedef void (*GisTileFreeFunc)(GisTile *tile, gpointer user_data);
+typedef void (*GritsTileFreeFunc)(GritsTile *tile, gpointer user_data);
/* Forech functions */
/**
- * gis_tile_foreach:
- * @parent: the #GisTile to iterate over
- * @child: a pointer to a #GisTile to store the current subtile
+ * grits_tile_foreach:
+ * @parent: the #GritsTile to iterate over
+ * @child: a pointer to a #GritsTile to store the current subtile
*
* Iterate over each imediate subtile of @parent.
*/
-#define gis_tile_foreach(parent, child) \
+#define grits_tile_foreach(parent, child) \
for (int _x = 0; _x < G_N_ELEMENTS(parent->children); _x++) \
for (int _y = 0; child = parent->children[_x][_y], \
_y < G_N_ELEMENTS(parent->children[_x]); _y++)
/**
- * gis_tile_foreach_index:
- * @parent: the #GisTile to iterate over
+ * grits_tile_foreach_index:
+ * @parent: the #GritsTile to iterate over
* @x: integer to store the x index of the current subtile
* @y: integer to store the y index of the current subtile
*
* Iterate over each imediate subtile of @parent.
*/
-#define gis_tile_foreach_index(parent, x, y) \
+#define grits_tile_foreach_index(parent, x, y) \
for (x = 0; x < G_N_ELEMENTS(parent->children); x++) \
for (y = 0; y < G_N_ELEMENTS(parent->children[x]); y++)
/* Path to string table, keep in sync with tile->children */
-extern gchar *gis_tile_path_table[2][2];
+extern gchar *grits_tile_path_table[2][2];
-GType gis_tile_get_type(void);
+GType grits_tile_get_type(void);
/* Allocate a new Tile */
-GisTile *gis_tile_new(GisTile *parent,
+GritsTile *grits_tile_new(GritsTile *parent,
gdouble n, gdouble s, gdouble e, gdouble w);
/* Return a string representation of the tile's path */
-gchar *gis_tile_get_path(GisTile *child);
+gchar *grits_tile_get_path(GritsTile *child);
/* Update a root tile */
/* Based on eye distance */
-void gis_tile_update(GisTile *root, GisPoint *eye,
+void grits_tile_update(GritsTile *root, GritsPoint *eye,
gdouble res, gint width, gint height,
- GisTileLoadFunc load_func, gpointer user_data);
+ GritsTileLoadFunc load_func, gpointer user_data);
/* Find the leaf tile containing lat-lon */
-GisTile *gis_tile_find(GisTile *root, gdouble lat, gdouble lon);
+GritsTile *grits_tile_find(GritsTile *root, gdouble lat, gdouble lon);
/* Delete nodes that haven't been accessed since atime */
-GisTile *gis_tile_gc(GisTile *root, time_t atime,
- GisTileFreeFunc free_func, gpointer user_data);
+GritsTile *grits_tile_gc(GritsTile *root, time_t atime,
+ GritsTileFreeFunc free_func, gpointer user_data);
/* Free a tile and all it's children */
-void gis_tile_free(GisTile *root,
- GisTileFreeFunc free_func, gpointer user_data);
+void grits_tile_free(GritsTile *root,
+ GritsTileFreeFunc free_func, gpointer user_data);
#endif