]> Pileus Git - grits/blobdiff - src/gis-viewer.h
Move OpenGL code from GisOpenGL to objects
[grits] / src / gis-viewer.h
index b85120b3d978b62a8a9fc90f2481c786d5780d14..a4da4fc6a591fa2172699a23626e0724ccef9324 100644 (file)
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
+/**
+ * Hack alert: gis-opengl.h needs to be included before gis-viewer
+ *   - GisViewer depends on GisObject for add/remove functions
+ *   - GisObject depends on GisOpenGL for load/unload functions
+ *   - GisOpenGL depends on GisViewer for inheritance
+ *
+ * The problem here is that GisOpenGL needs the GisViewer definition
+ * but GisViewer only needs the typedefs (through GisObject),
+ * so GisViewer needs to be included after the GisOpenGL typedefs but
+ * before the GisOpenGL definition. This is handled internally by
+ * gis-opengl.h
+ *
+ * This should probably be fixed, but making a GisGLObject interface
+ * seems like too much work. Merging GisViewer and GisOpenGL would also work,
+ * but I like the separate that that's provided by having two.
+ */
+#include "gis-opengl.h"
+
 #ifndef __GIS_VIEWER_H__
 #define __GIS_VIEWER_H__
 
@@ -81,7 +99,6 @@ typedef gdouble (*GisHeightFunc)(gdouble lat, gdouble lon, gpointer user_data);
 #include "gis-plugin.h"
 #include "gis-prefs.h"
 #include "objects/gis-object.h"
-#include "objects/gis-tile.h"
 
 struct _GisViewer {
        GtkDrawingArea parent_instance;
@@ -89,7 +106,7 @@ struct _GisViewer {
        /* instance members */
        GisPlugins *plugins;
        GisPrefs   *prefs;
-       gchar      *time;
+       time_t      time;
        gdouble     location[3];
        gdouble     rotation[3];
        gboolean    offline;
@@ -111,7 +128,7 @@ struct _GisViewerClass {
                                  gdouble *px, gdouble *py, gdouble *pz);
 
        void (*clear_height_func)(GisViewer *viewer);
-       void (*set_height_func)  (GisViewer *viewer, GisTile *tile,
+       void (*set_height_func)  (GisViewer *viewer, GisBounds *bounds,
                                  GisHeightFunc height_func, gpointer user_data,
                                  gboolean update);
 
@@ -125,8 +142,8 @@ GType gis_viewer_get_type(void);
 /* Methods */
 void gis_viewer_setup(GisViewer *viewer, GisPlugins *plugins, GisPrefs *prefs);
 
-void gis_viewer_set_time(GisViewer *viewer, const gchar *time);
-gchar *gis_viewer_get_time(GisViewer *viewer);
+void gis_viewer_set_time(GisViewer *viewer, time_t time);
+time_t gis_viewer_get_time(GisViewer *viewer);
 
 void gis_viewer_set_location(GisViewer *viewer, gdouble  lat, gdouble  lon, gdouble  elev);
 void gis_viewer_get_location(GisViewer *viewer, gdouble *lat, gdouble *lon, gdouble *elev);
@@ -151,7 +168,7 @@ void gis_viewer_project(GisViewer *viewer,
                gdouble *px, gdouble *py, gdouble *pz);
 
 void gis_viewer_clear_height_func(GisViewer *viewer);
-void gis_viewer_set_height_func(GisViewer *viewer, GisTile *tile,
+void gis_viewer_set_height_func(GisViewer *viewer, GisBounds *bounds,
                GisHeightFunc height_func, gpointer user_data,
                gboolean update);