c32d6e08d19a0b8ad7ece12aab39d0ba0be7a9e1 chmalee Mon Dec 1 16:26:27 2025 -0800 hgTracks tooltips use the data-tooltip attribute on the area element if present, falling back to the title attribute. Makes title attributes for (hopefully all) tracks with special tooltips put the tooltip string into the data-tooltip attribute instead of the title attribute, refs #35756 diff --git src/hg/hgTracks/imageV2.h src/hg/hgTracks/imageV2.h index 292fe4bda7f..6a0649e9dda 100644 --- src/hg/hgTracks/imageV2.h +++ src/hg/hgTracks/imageV2.h @@ -112,71 +112,73 @@ // image contains all information about an image file and associated map box ///////////////////////// /////////////////////// Maps struct mapItem // IMAGEv2: single map item in an image map. { struct mapItem *next; // slList char *linkVar; // the get variables associated with the map link char *title; // item title int topLeftX; // in pixels relative to image int topLeftY; // in pixels relative to image int bottomRightX; // in pixels relative to image int bottomRightY; // in pixels relative to image char *id; // id; used by js right-click code to figure out what to do with // a map item (usually mapName) + char *tooltip; // the tooltip (if any) to show for this area, fallback to title + // if not present }; struct mapSet // IMAGEv2: full map for image OR partial map for slice { char *name; // to point an image to a map in HTML struct image *parentImg; // points to the image this map belongs to char *linkRoot; // the common or static portion of the link for the entire image struct mapItem *items; // list of items }; // To create map items which have mouse-over titles but no link, fill link with: #define TITLE_BUT_NO_LINK "noLink" struct mapSet *mapSetStart(char *name,struct image *img,char *linkRoot); // Starts a map (aka mapSet) which is the seet of links and image locations used in HTML. // Complete a map by adding items with mapItemAdd() struct mapSet *mapSetUpdate(struct mapSet *map,char *name,struct image *img,char *linkRoot); // Updates an existing map (aka mapSet) struct mapItem *mapSetItemFind(struct mapSet *map,int topLeftX,int topLeftY, int bottomRightX,int bottomRightY); // Find a single mapItem based upon coordinates (within a pixel) struct mapItem *mapSetItemUpdate(struct mapSet *map,struct mapItem *item,char *link,char *title, int topLeftX,int topLeftY,int bottomRightX,int bottomRightY, - char *id); + char *id, char *tooltip); // Update an already existing mapItem struct mapItem *mapSetItemAdd(struct mapSet *map,char *link,char *title,int topLeftX,int topLeftY, - int bottomRightX,int bottomRightY, char *id); + int bottomRightX,int bottomRightY, char *id, char *tooltip); // Add a single mapItem to a growing mapSet struct mapItem *mapSetItemUpdateOrAdd(struct mapSet *map,char *link,char *title, int topLeftX,int topLeftY,int bottomRightX,int bottomRightY, - char *id); + char *id, char *tooltip); // Update or add a single mapItem struct mapItem *mapSetItemFindOrAdd(struct mapSet *map,char *link,char *title, int topLeftX,int topLeftY,int bottomRightX,int bottomRightY, - char *id); + char *id, char *tooltip); // Finds or adds the map item void mapItemFree(struct mapItem **pItem); // frees all memory assocated with a single mapItem boolean mapItemConsistentWithImage(struct mapItem *item,struct image *img,boolean verbose); // Test whether a map item is consistent with the image it is supposed to be for boolean mapSetIsComplete(struct mapSet *map,boolean verbose); // Tests the completeness and consistency of this map (mapSet) void mapSetFree(struct mapSet **pMap); // frees all memory (including items) assocated with a single mapSet @@ -355,31 +357,31 @@ int offsetX,int offsetY); // Updates the slice or adds it int imgTrackCoordinates(struct imgTrack *imgTrack, int *leftX,int *topY,int *rightX,int *bottomY); // Fills in topLeft x,y and bottomRight x,y coordinates, returning topY. #define imgTrackTopY(imgTrack) imgTrackCoordinates(imgTrack,NULL,NULL,NULL,NULL) // Returns the Y coordinate of the top of the track. int imgTrackBottomY(struct imgTrack *imgTrack); // Returns the Y coordinate of the bottom of the track. struct mapSet *imgTrackGetMapByType(struct imgTrack *imgTrack,enum sliceType type); // Gets the map assocated with a specific slice belonging to the imgTrack int imgTrackAddMapItem(struct imgTrack *imgTrack,char *link,char *title,int topLeftX,int topLeftY, - int bottomRightX,int bottomRightY, char *id); + int bottomRightX,int bottomRightY, char *id, char *tooltip); // Will add a map item it an imgTrack's appropriate slice's map // Since a map item may span slices, the imgTrack is in the best position to determine where // to put the map item. // Returns count of map items added, which could be 0, 1 or more than one if item spans slices // NOTE: Precedence is given to first map item when adding items with same coordinates! boolean imgTrackIsComplete(struct imgTrack *imgTrack,boolean verbose); // Tests the completeness and consistency of this imgTrack (including slices) void imgTrackFree(struct imgTrack **pImgTrack); // frees all memory assocated with an imgTrack (including slices) /////////////////////// Image Box struct imgBox // IMAGEv2: imageBox conatins all the definitions to draw an image in hgTracks