7d6743d521ae0f87134820a6ef0943c915649e1e galt Sat Dec 6 09:35:15 2014 -0800 changing references to gif to png; fix documentation referring to slices to mention the newly-separated button slice diff --git src/hg/hgTracks/imageV2.c src/hg/hgTracks/imageV2.c index ebb0271..72d2790 100644 --- src/hg/hgTracks/imageV2.c +++ src/hg/hgTracks/imageV2.c @@ -549,38 +549,38 @@ struct mapItem *item = NULL; while ((item = slPopHead(&(map->items))) != NULL ) mapItemFree(&item); freeMem(map->name); // Don't free parentImg, as it should be freed independently freeMem(map->linkRoot); freeMem(map); *pMap = NULL; } } /////////////////////// Images -struct image *imgCreate(char *gif,char *title,int width,int height) +struct image *imgCreate(char *png,char *title,int width,int height) // Creates a single image container. // A map map be added with imgMapStart(),mapSetItemAdd() { struct image *img; AllocVar(img); -if (gif != NULL) - img->file = cloneString(gif); +if (png != NULL) + img->file = cloneString(png); if (title != NULL) img->title = cloneString(title); img->height = height; img->width = width; img->map = NULL; return img; } struct mapSet *imgMapStart(struct image *img,char *name,char *linkRoot) // Starts a map associated with an image // Map items can then be added to the returned pointer with mapSetItemAdd() { if (img->map != NULL) { warn("imgAddMap() but map already exists. Being replaced."); @@ -889,31 +889,31 @@ freeMem(slice); *pSlice = NULL; } } /////////////////////// imgTracks struct imgTrack *imgTrackStart(struct trackDb *tdb,char *name,char *db, char *chrom,int chromStart,int chromEnd,boolean plusStrand, boolean hasCenterLabel,enum trackVisibility vis,int order) // Starts an image track which will contain all image slices needed to render one track // Must completed by adding slices with imgTrackAddSlice() { -struct imgTrack *imgTrack; // gifTn.forHtml, pixWidth, mapName +struct imgTrack *imgTrack; // pngTn.forHtml, pixWidth, mapName AllocVar(imgTrack); imgTrack->centerLabelSeen = clAlways; return imgTrackUpdate(imgTrack,tdb,name,db,chrom,chromStart,chromEnd,plusStrand, hasCenterLabel,vis,order); } struct imgTrack *imgTrackUpdate(struct imgTrack *imgTrack,struct trackDb *tdb,char *name, char *db,char *chrom,int chromStart,int chromEnd,boolean plusStrand, boolean hasCenterLabel,enum trackVisibility vis,int order) // Updates an already existing image track { if (tdb != NULL && tdb != imgTrack->tdb) imgTrack->tdb = tdb; if (name != NULL && differentStringNullOk(imgTrack->name,name)) { @@ -1282,31 +1282,31 @@ freeMem(imgTrack->name); freeMem(imgTrack); *pImgTrack = NULL; } } /////////////////////// Image Box struct imgBox *imgBoxStart(char *db,char *chrom,int chromStart,int chromEnd,boolean plusStrand, int sideLabelWidth,int width) // Starts an imgBox which should contain all info needed to draw the hgTracks image with // multiple tracks. The image box must be completed using imgBoxImageAdd() and imgBoxTrackAdd() { -struct imgBox * imgBox; // gifTn.forHtml, pixWidth, mapName +struct imgBox * imgBox; // pngTn.forHtml, pixWidth, mapName AllocVar(imgBox); if (db != NULL) imgBox->db = cloneString(db); // NOTE: Is allocated if (chrom != NULL) imgBox->chrom = cloneString(chrom); // NOTE: Is allocated imgBox->chromStart = chromStart; imgBox->chromEnd = chromEnd; imgBox->plusStrand = plusStrand; imgBox->showSideLabel = (sideLabelWidth != 0); imgBox->sideLabelWidth = sideLabelWidth; imgBox->images = NULL; imgBox->bgImg = NULL; imgBox->width = width; imgBox->showPortal = FALSE; //int oneThird = (chromEnd - chromStart)/3; // TODO: Currently defaulting to 1/3 of image width @@ -1426,56 +1426,56 @@ } else { if ( portalStart ) *portalStart = imgBox->chromStart; if ( portalEnd ) *portalEnd = imgBox->chromEnd; if ( portalWidth ) *portalWidth = imgBox->width; } if ( basesPerPixel ) *basesPerPixel = imgBox->basesPerPixel; return imgBox->showPortal; } -struct image *imgBoxImageAdd(struct imgBox *imgBox,char *gif,char *title, +struct image *imgBoxImageAdd(struct imgBox *imgBox,char *png,char *title, int width,int height,boolean backGround) // Adds an image to an imgBox. The image may be extended with imgMapStart(),mapSetItemAdd() { -struct image *img = imgCreate(gif,title,width,height); +struct image *img = imgCreate(png,title,width,height); if (backGround) { if (imgBox->bgImg != NULL) { warn("imgBoxImageAdd() for background but already exists. Being replaced."); imgFree(&(imgBox->bgImg)); } imgBox->bgImg = img; return imgBox->bgImg; } slAddHead(&(imgBox->images),img); return imgBox->images; } -struct image *imgBoxImageFind(struct imgBox *imgBox,char *gif) +struct image *imgBoxImageFind(struct imgBox *imgBox,char *png) // Finds a specific image already added to this imgBox { struct image *img = NULL; for (img = imgBox->images; img != NULL; img = img->next ) { - if (sameOk(img->file,gif)) + if (sameOk(img->file,png)) return img; } return NULL; } // TODO: Will we need this? //boolean imgBoxImageRemove(struct imgBox *imgBox,struct image *img) //{ //return slRemoveEl(&(imgBox->images),img); //} struct imgTrack *imgBoxTrackAdd(struct imgBox *imgBox,struct trackDb *tdb,char *name, enum trackVisibility vis,boolean hasCenterLabel,int order) // Adds an imgTrack to an imgBox. The imgTrack needs to be extended with imgTrackAddSlice() {