From: Kaj-Michael Lang Date: Tue, 29 Apr 2008 13:14:45 +0000 (+0300) Subject: More code X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1a882fea9ac182f65e230bd113bb4c8f21d23464;p=mapper More code --- diff --git a/src/gtkmap.c b/src/gtkmap.c index b12f55f..03025dd 100644 --- a/src/gtkmap.c +++ b/src/gtkmap.c @@ -17,16 +17,58 @@ * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ +#ifdef WITH_GL +#include +#include +#endif + #include #include +#include "image-cache.h" #include "gtkmap.h" +#define MAP_THUMB_MARGIN_X (100) +#define MAP_THUMB_MARGIN_Y (75) + +/* Initial size */ +#define BUF_WIDTH_TILES (4) +#define BUF_HEIGHT_TILES (3) +#define BUF_WIDTH_PIXELS (1024) +#define BUF_HEIGHT_PIXELS (768) + +#define MAP_CACHE_DEFAULT (64) +/* Tile cache, this might need some adjustment */ + G_DEFINE_TYPE(GtkMap, gtk_map, GTK_TYPE_WIDGET); typedef struct _GtkMapPriv GtkMapPriv; - -struct _GtkMapPriv -{ +struct _GtkMapPriv { +gint mark_x1; +gint mark_x2; +gint mark_y1; +gint mark_y2; +gint mark_minx; +gint mark_miny; +gint mark_width; +gint mark_height; + +guint buf_width_tiles; +guint buf_height_tiles; +guint buf_width_pixels; +guint buf_height_pixels; + +GTimer *timer; + +GtkMapCenterMode center_mode; + +GdkPixmap *buffer; +ImageCache *icache; + +#ifdef WITH_GL +GdkGLConfig* gl_config; +#endif +gboolean gl; + PangoContext *context; PangoLayout *layout; PangoFontDescription *fontdesc; @@ -91,7 +133,7 @@ widget_class->expose_event = gtk_map_expose; widget_class->realize = gtk_map_realize; widget_class->size_allocate = gtk_map_size_allocate; -g_type_class_add_private (object_class, sizeof (GtkMapPriv)); +g_type_class_add_private (object_class, sizeof(GtkMapPriv)); } static void