src/hg/hgTracks/imageV2.h 1.11
1.11 2009/12/05 01:29:01 larrym
CONTEXT_MENU stuff; mostly turned off, except map area id's are live
Index: src/hg/hgTracks/imageV2.h
===================================================================
RCS file: /projects/compbio/cvsroot/kent/src/hg/hgTracks/imageV2.h,v
retrieving revision 1.10
retrieving revision 1.11
diff -b -B -U 4 -r1.10 -r1.11
--- src/hg/hgTracks/imageV2.h 13 Nov 2009 00:17:59 -0000 1.10
+++ src/hg/hgTracks/imageV2.h 5 Dec 2009 01:29:01 -0000 1.11
@@ -5,8 +5,9 @@
// and/or UNCOMMENT IMAGEv2_DRAG_SCROLL and IMAGEv2_DRAG_SCROLL_SZ to allow dragScroll
// NOTE: dragScroll not working in SZ=1 (1x) yet, because haven't done ajax fetch when dragged beyond image dimansions.
// Still, set IMAGEv2_DRAG_SCROLL_SZ > 1 (3=3x) to get limited dragScroll functionality
#define IMAGEv2_UI
+//#define CONTEXT_MENU
//#define IMAGEv2_DRAG_REORDER
//#define IMAGEv2_DRAG_SCROLL
//#define IMAGEv2_DRAG_SCROLL_SZ 3
@@ -78,8 +79,9 @@
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)
};
struct mapSet // IMAGEv2: full map for image OR partial map for slice
{
char *name; // to point an image to a map in HTML
@@ -93,15 +95,15 @@
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);
+struct mapItem *mapSetItemUpdate(struct mapSet *map,struct mapItem *item,char *link,char *title,int topLeftX,int topLeftY,int bottomRightX,int bottomRightY, char *id);
/* Update an already existing mapItem */
-struct mapItem *mapSetItemAdd(struct mapSet *map,char *link,char *title,int topLeftX,int topLeftY,int bottomRightX,int bottomRightY);
+struct mapItem *mapSetItemAdd(struct mapSet *map,char *link,char *title,int topLeftX,int topLeftY,int bottomRightX,int bottomRightY, char *id);
/* 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);
+struct mapItem *mapSetItemUpdateOrAdd(struct mapSet *map,char *link,char *title,int topLeftX,int topLeftY,int bottomRightX,int bottomRightY, char *id);
/* Update or add a single mapItem */
-struct mapItem *mapSetItemFindOrAdd(struct mapSet *map,char *link,char *title,int topLeftX,int topLeftY,int bottomRightX,int bottomRightY);
+struct mapItem *mapSetItemFindOrAdd(struct mapSet *map,char *link,char *title,int topLeftX,int topLeftY,int bottomRightX,int bottomRightY, char *id);
/* 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);
@@ -217,9 +219,9 @@
struct imgSlice *imgTrackSliceUpdateOrAdd(struct imgTrack *imgTrack,enum sliceType type, struct image *img,char *title,int width,int height,int offsetX,int offsetY);
/* Updates the slice or adds it */
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);
+int imgTrackAddMapItem(struct imgTrack *imgTrack,char *link,char *title,int topLeftX,int topLeftY,int bottomRightX,int bottomRightY, char *id);
/* 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! */
@@ -298,9 +300,9 @@
#define imgBoxTrackFindOrAdd(a,b,c,d,e,f) NULL
#define imgBoxTrackUpdateOrAdd(a,b,c,d,e,f) (f?NULL:NULL)
#define imgTrackSliceUpdateOrAdd(a,b,c,d,e,f,g,h) NULL
#define sliceMapFindOrStart(a,b,c) NULL
-#define imgTrackAddMapItem(a,b,c,d,e,f,g)
+#define imgTrackAddMapItem(a,b,c,d,e,f,g,h)
#define imageBoxDraw(a)
#define imgBoxFree(a)
#define IMG_ANYORDER 0
#define IMG_FIXEDPOS 0