Authored by Hal Mueller

more Doxygen tags and comments

@@ -31,7 +31,7 @@ @@ -31,7 +31,7 @@
31 31
32 @class RMTileCache; 32 @class RMTileCache;
33 33
34 -// Simple wrapper around a tilesource which checks the image cache first. 34 +/// Simple wrapper around a tilesource which checks the image cache first.
35 @interface RMCachedTileSource : NSObject<RMTileSource> 35 @interface RMCachedTileSource : NSObject<RMTileSource>
36 { 36 {
37 id <RMTileSource> tileSource; 37 id <RMTileSource> tileSource;
@@ -161,6 +161,7 @@ @@ -161,6 +161,7 @@
161 return image; 161 return image;
162 } 162 }
163 163
  164 +/// FIXME: shouldn't reinitialize database in a low-memory warning
164 -(void)didReceiveMemoryWarning 165 -(void)didReceiveMemoryWarning
165 { 166 {
166 LogMethod(); 167 LogMethod();
@@ -28,6 +28,7 @@ @@ -28,6 +28,7 @@
28 #import <Foundation/Foundation.h> 28 #import <Foundation/Foundation.h>
29 #import "RMTileImage.h" 29 #import "RMTileImage.h"
30 30
  31 +/// a tile image loaded from a local file
31 @interface RMFileTileImage : RMTileImage { 32 @interface RMFileTileImage : RMTileImage {
32 33
33 } 34 }
@@ -69,6 +69,7 @@ enum { @@ -69,6 +69,7 @@ enum {
69 @end 69 @end
70 70
71 71
  72 +/// The cartographic and data components of a map. There is exactly one RMMapContents instance for each RMMapView instance.
72 @interface RMMapContents : NSObject 73 @interface RMMapContents : NSObject
73 { 74 {
74 // TODO: Also support NSView. 75 // TODO: Also support NSView.
@@ -107,6 +108,13 @@ enum { @@ -107,6 +108,13 @@ enum {
107 @property (readwrite) RMXYRect XYBounds; 108 @property (readwrite) RMXYRect XYBounds;
108 @property (readonly) RMTileRect tileBounds; 109 @property (readonly) RMTileRect tileBounds;
109 @property (readonly) CGRect screenBounds; 110 @property (readonly) CGRect screenBounds;
  111 +/*! \brief "scale" as of version 0.4/0.5 actually doesn't mean cartographic scale; it means meters per pixel.
  112 +
  113 + "Scale" is how many meters in 1 pixel. Larger scale means bigger things are smaller on the screen.
  114 + "Scale" of 1 means 1 pixel == 1 meter.
  115 + "Scale" of 10 means 1 pixel == 10 meters.
  116 + \deprecated will be renamed appropriately and a new -scale method introduced, using cartographic scale (e.g. 1:24000).
  117 + */
110 @property (readwrite) float scale; 118 @property (readwrite) float scale;
111 @property (readwrite) float zoom; 119 @property (readwrite) float zoom;
112 120
@@ -89,7 +89,8 @@ svn checkout http://route-me.googlecode.com/svn/trunk/ route-me-read-only @@ -89,7 +89,8 @@ svn checkout http://route-me.googlecode.com/svn/trunk/ route-me-read-only
89 #import "RMMapViewDelegate.h" 89 #import "RMMapViewDelegate.h"
90 #import "RMMapContents.h" 90 #import "RMMapContents.h"
91 91
92 -/*! \struct RMGestureDetails 92 +/*!
  93 + \struct RMGestureDetails
93 iPhone-specific mapview stuff. Handles event handling, whatnot. 94 iPhone-specific mapview stuff. Handles event handling, whatnot.
94 */ 95 */
95 typedef struct { 96 typedef struct {
@@ -103,7 +104,7 @@ typedef struct { @@ -103,7 +104,7 @@ typedef struct {
103 /*! 104 /*!
104 \brief Wrapper around RMMapContents for the iPhone. 105 \brief Wrapper around RMMapContents for the iPhone.
105 It implements event handling; but that's about it. All the interesting map 106 It implements event handling; but that's about it. All the interesting map
106 - logic is done by RMMapContents. 107 + logic is done by RMMapContents. There is exactly one RMMapView instance for each RMMapContents instance.
107 */ 108 */
108 @interface RMMapView : UIView <RMMapContentsFacade, RMMapContentsAnimationCallback> 109 @interface RMMapView : UIView <RMMapContentsFacade, RMMapContentsAnimationCallback>
109 { 110 {
@@ -30,6 +30,7 @@ @@ -30,6 +30,7 @@
30 @class RMMapView; 30 @class RMMapView;
31 @class RMMarker; 31 @class RMMarker;
32 32
  33 +/// Use this for notifications of map panning, zooming, and taps on the RMMapView.
33 @protocol RMMapViewDelegate 34 @protocol RMMapViewDelegate
34 35
35 @optional 36 @optional
@@ -48,7 +49,7 @@ @@ -48,7 +49,7 @@
48 - (BOOL) mapView:(RMMapView *)map shouldDragMarker:(RMMarker *)marker withEvent:(UIEvent *)event; 49 - (BOOL) mapView:(RMMapView *)map shouldDragMarker:(RMMarker *)marker withEvent:(UIEvent *)event;
49 - (void) mapView:(RMMapView *)map didDragMarker:(RMMarker *)marker withEvent:(UIEvent *)event; 50 - (void) mapView:(RMMapView *)map didDragMarker:(RMMarker *)marker withEvent:(UIEvent *)event;
50 51
51 -// The following call is depreciated, please use didDragMarker instead. This call will no longer exist after the .5 Milestone 52 +/// \brief \deprecated This call is deprecated, please use didDragMarker instead. This call will no longer exist after the .5 Milestone
52 - (void) dragMarkerPosition: (RMMarker*) marker onMap: (RMMapView*)map position:(CGPoint)position; 53 - (void) dragMarkerPosition: (RMMarker*) marker onMap: (RMMapView*)map position:(CGPoint)position;
53 54
54 55
@@ -36,5 +36,7 @@ @@ -36,5 +36,7 @@
36 } 36 }
37 37
38 -(id)initWithCapacity: (NSUInteger) _capacity; 38 -(id)initWithCapacity: (NSUInteger) _capacity;
  39 +/// Remove the least-recently used image from cache, if cache is at or over capacity. Removes only 1 image.
  40 +-(void)makeSpaceInCache;
39 41
40 @end 42 @end
@@ -88,6 +88,7 @@ @@ -88,6 +88,7 @@
88 return image; 88 return image;
89 } 89 }
90 90
  91 +/// Remove the least-recently used image from cache, if cache is at or over capacity. Removes only 1 image.
91 -(void)makeSpaceInCache 92 -(void)makeSpaceInCache
92 { 93 {
93 while ([cache count] >= capacity) 94 while ([cache count] >= capacity)
@@ -33,18 +33,26 @@ @@ -33,18 +33,26 @@
33 #include <stdint.h> 33 #include <stdint.h>
34 34
35 /*! \struct RMTile 35 /*! \struct RMTile
36 - Uniquely specifies coordinates and zoom level for a particular tile in some tile source. 36 + \brief Uniquely specifies coordinates and zoom level for a particular tile in some tile source.
  37 +
  38 + This is a 3-field number. If you want the image associated with an RMTile, you're looking for RMTileImage
37 */ 39 */
38 typedef struct{ 40 typedef struct{
39 uint32_t x, y; 41 uint32_t x, y;
40 short zoom; 42 short zoom;
41 } RMTile; 43 } RMTile;
42 44
  45 +/*! \struct RMTilePoint
  46 + \brief Don't know what this is for.
  47 + */
43 typedef struct{ 48 typedef struct{
44 RMTile tile; 49 RMTile tile;
45 CGPoint offset; 50 CGPoint offset;
46 } RMTilePoint; 51 } RMTilePoint;
47 52
  53 +/*! \struct RMTileRect
  54 + \brief Don't know what this is for.
  55 + */
48 typedef struct{ 56 typedef struct{
49 RMTilePoint origin; 57 RMTilePoint origin;
50 CGSize size; 58 CGSize size;
@@ -55,19 +63,19 @@ char RMTilesEqual(RMTile one, RMTile two); @@ -55,19 +63,19 @@ char RMTilesEqual(RMTile one, RMTile two);
55 char RMTileIsDummy(RMTile tile); 63 char RMTileIsDummy(RMTile tile);
56 RMTile RMTileDummy(); 64 RMTile RMTileDummy();
57 65
58 -// Return a hash of the tile 66 +/// Return a hash of the tile
59 uint64_t RMTileHash(RMTile tile); 67 uint64_t RMTileHash(RMTile tile);
60 68
61 -// Returns a unique key of the tile 69 +/// Returns a unique key of the tile for use in the SQLite cache
62 uint64_t RMTileKey(RMTile tile); 70 uint64_t RMTileKey(RMTile tile);
63 71
64 -// Round the rectangle to whole numbers of tiles 72 +/// Round the rectangle to whole numbers of tiles
65 RMTileRect RMTileRectRound(RMTileRect rect); 73 RMTileRect RMTileRectRound(RMTileRect rect);
66 /* 74 /*
67 -// Calculate and return the intersection of two rectangles 75 +/// Calculate and return the intersection of two rectangles
68 TileRect TileRectIntersection(TileRect one, TileRect two); 76 TileRect TileRectIntersection(TileRect one, TileRect two);
69 77
70 -// Calculate and return the union of two rectangles 78 +/// Calculate and return the union of two rectangles
71 TileRect TileRectUnion(TileRect one, TileRect two); 79 TileRect TileRectUnion(TileRect one, TileRect two);
72 */ 80 */
73 #endif 81 #endif
@@ -62,6 +62,11 @@ typedef enum { @@ -62,6 +62,11 @@ typedef enum {
62 +(NSNumber*) tileHash: (RMTile)tile; 62 +(NSNumber*) tileHash: (RMTile)tile;
63 63
64 /// Add tile to cache 64 /// Add tile to cache
  65 +/*!
  66 + \bug Calls -makeSpaceInCache for every tile/image addition. -makeSpaceInCache does a linear scan of its contents at each call.
  67 +
  68 + \bug Since RMTileImage has an RMTile ivar, this API should be simplified to just -addImage:.
  69 + */
65 -(void)addTile: (RMTile)tile WithImage: (RMTileImage*)image; 70 -(void)addTile: (RMTile)tile WithImage: (RMTileImage*)image;
66 71
67 /// Add another cache to the chain 72 /// Add another cache to the chain
@@ -29,6 +29,7 @@ @@ -29,6 +29,7 @@
29 29
30 @class FMDatabase; 30 @class FMDatabase;
31 31
  32 +/// the interface between RMDatabaseCache and FMDB
32 @interface RMTileCacheDAO : NSObject { 33 @interface RMTileCacheDAO : NSObject {
33 FMDatabase* db; 34 FMDatabase* db;
34 } 35 }
@@ -53,11 +53,14 @@ extern NSString * const RMMapImageLoadingCancelledNotification; @@ -53,11 +53,14 @@ extern NSString * const RMMapImageLoadingCancelledNotification;
53 RMTile tile; 53 RMTile tile;
54 CGRect screenLocation; 54 CGRect screenLocation;
55 55
  56 + /// \deprecated appears to be cruft
56 int loadingPriorityCount; 57 int loadingPriorityCount;
57 58
58 - // Used by cache 59 + /// Used by cache
59 NSDate *lastUsedTime; 60 NSDate *lastUsedTime;
60 61
  62 + /// \bug placing the "layer" on the RMTileImage implicitly assumes that a particular RMTileImage will be used in only
  63 + /// one UIView. Might see some interesting crashes if you have two RMMapViews using the same tile source.
61 // Only used when appropriate 64 // Only used when appropriate
62 CALayer *layer; 65 CALayer *layer;
63 } 66 }
@@ -29,10 +29,13 @@ @@ -29,10 +29,13 @@
29 #import "RMTile.h" 29 #import "RMTile.h"
30 30
31 @class RMTileImage; 31 @class RMTileImage;
  32 +/// Has only class methods defined, to return generic "error image", "not-yet-loaded image", and proxy images.
  33 +/// \bug This functionality belongs on the tile source, and should not be freestanding.
32 @interface RMTileProxy : NSObject { 34 @interface RMTileProxy : NSObject {
33 35
34 } 36 }
35 37
  38 +/// \deprecated hardcoded to return nil
36 +(RMTileImage*) bestProxyFor: (RMTile) t; 39 +(RMTileImage*) bestProxyFor: (RMTile) t;
37 +(RMTileImage*) errorTile; 40 +(RMTileImage*) errorTile;
38 +(RMTileImage*) loadingTile; 41 +(RMTileImage*) loadingTile;
@@ -31,8 +31,7 @@ @@ -31,8 +31,7 @@
31 31
32 @protocol RMTileSource; 32 @protocol RMTileSource;
33 33
34 -////////////////////////////// NOT COMPLETE. DO NOT USE  
35 - 34 +/// ////////////////////////// NOT COMPLETE. DO NOT USE
36 @interface RMTiledLayerController : NSObject 35 @interface RMTiledLayerController : NSObject
37 { 36 {
38 CATiledLayer *layer; 37 CATiledLayer *layer;
@@ -28,6 +28,7 @@ @@ -28,6 +28,7 @@
28 #import <Foundation/Foundation.h> 28 #import <Foundation/Foundation.h>
29 #import "RMTileImage.h" 29 #import "RMTileImage.h"
30 30
  31 +/// a tile image loaded from a URL
31 @interface RMWebTileImage : RMTileImage { 32 @interface RMWebTileImage : RMTileImage {
32 /// Before image is completely loaded a proxy image can be used. 33 /// Before image is completely loaded a proxy image can be used.
33 /// This will typically be a boilerplate image or a zoomed in or zoomed out version of another image. 34 /// This will typically be a boilerplate image or a zoomed in or zoomed out version of another image.