On Thu, May 20, 2010 at 5:14 PM, Joshua Judson Rosen <[email protected]> wrote: > John Stowers <[email protected]> writes: >> >> > > Yes, a patch for this would be great. It would also be worthwhile to >> > > rename the functions to osm_gps_map_poi_{add,remove} to match the work >> > > going on in the tracks-rework / gtk-3.0 branch. >> > >> > Please no, keep it generic! I think the _image interface is more >> > then enough (once it uses opaque pointers) to handle POIs and >> > anything else that might be rendered this way. So don't make it >> > POI specific please! >> >> Good point. I had overlooked this. The image/poi stuff should be the >> same API (excepting for the opaque pointer change) > > Indeed--not just the interface, but the implementation would also be > identical. Ideally, I'd suggest just adding the extra argument to > osm_gps_map_image_remove(), and changing the osm_gps_image_add() so > that it returns its image_t pointer as the opaque identifier > (cf. attached patch). > > The only reasons that I suggested a new function with "poi" > in the name were that I wasn't sure you were ready to break > backward-compatibility, and I couldn't think of a better term for > a `specific instance of an image associated with a distinct point' > (or `specific image-bearing point in which client code is interested') > than "POI" :)
Looking over the patch, I wonder if this implementation is flexible enough, while not making the API too confusing, for the behavior you are trying to enable (removing either a single poi/image, or a whole group of pois/images). The limitation appears to be the assumption that the same pixbuf be used as a handle for a group of pois/images. Is this something that is useful/true in practice or will the app still need to keep around the pointer to each added poi/image anyway (in which case we might as well keep the implementation simple, and thus remove() only accepts the opaque pointer) What do you think? John > > -- > "Don't be afraid to ask (λf.((λx.xx) (λr.f(rr))))." > > _______________________________________________ > This message is sent to you from [email protected] mailing list. > Visit http://lists.osgeo.org/mailman/listinfo/foss-gps to manage your > subscription > For more information, check http://wiki.osgeo.org/wiki/FOSS-GPS > > _______________________________________________ This message is sent to you from [email protected] mailing list. Visit http://lists.osgeo.org/mailman/listinfo/foss-gps to manage your subscription For more information, check http://wiki.osgeo.org/wiki/FOSS-GPS
