2009-08-26 Chris Toshok <toshok@ximian.com>
[moon.git] / src / tilesource.cpp
bloba2a6d239aed9e7dc57c6cb1abb4bf6a78dc12143
1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
2 /*
3 * tilesource.cpp
5 * Contact:
6 * Moonlight List (moonlight-list@lists.ximian.com)
8 * Copyright 2007-2008 Novell, Inc. (http://www.novell.com)
10 * See the LICENSE file included with the distribution for details.
14 #include "tilesource.h"
17 MultiScaleTileSource::MultiScaleTileSource ()
19 SetObjectType (Type::MULTISCALETILESOURCE);
20 imageWidth = -1;
21 get_tile_func = NULL;
22 invalidate_cb = NULL;
25 double
26 MultiScaleTileSource::GetImageWidth ()
28 return imageWidth;
31 void
32 MultiScaleTileSource::SetImageWidth (double width)
34 imageWidth = width;
37 double
38 MultiScaleTileSource::GetImageHeight ()
40 return imageHeight;
43 void
44 MultiScaleTileSource::SetImageHeight (double height)
46 imageHeight = height;
49 int
50 MultiScaleTileSource::GetTileWidth ()
52 return tileWidth;
55 void
56 MultiScaleTileSource::SetTileWidth (int width)
58 tileWidth = width;
61 int
62 MultiScaleTileSource::GetTileHeight ()
64 return tileHeight;
67 void
68 MultiScaleTileSource::SetTileHeight (int height)
70 tileHeight = height;
73 int
74 MultiScaleTileSource::GetTileOverlap ()
76 return tileOverlap;
79 void
80 MultiScaleTileSource::SetTileOverlap (int overlap)
82 tileOverlap = overlap;
85 void
86 MultiScaleTileSource::set_image_uri_func (get_image_uri_func func)
88 if (!get_tile_func)
89 get_tile_func = func;
90 else
91 g_warning ("get_tile_func already set\n");
94 void
95 MultiScaleTileSource::InvalidateTileLayer (int level, int tilePositionX, int tilePositionY, int tileLayer)
97 if (invalidate_cb)
98 invalidate_cb (level, tilePositionX, tilePositionY, tileLayer, invalidate_data);
101 void
102 MultiScaleTileSource::set_invalidate_tile_layer_func (invalidate_tile_layer_func func, void *user_data)
104 invalidate_cb = func;
105 invalidate_data = user_data;