/[dtapublic]/projs/dtats/trunk/shared_source/c_tk_base_7_5_w_mods/tkcanvbmap.c
ViewVC logotype

Diff of /projs/dtats/trunk/shared_source/c_tk_base_7_5_w_mods/tkcanvbmap.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 69 by dashley, Sat Nov 5 10:54:17 2016 UTC revision 71 by dashley, Sat Nov 5 11:07:06 2016 UTC
# Line 1  Line 1 
1  /* $Header$ */  /* $Header$ */
2    
3  /*  /*
4   * tkCanvBmap.c --   * tkCanvBmap.c --
5   *   *
6   *      This file implements bitmap items for canvas widgets.   *      This file implements bitmap items for canvas widgets.
7   *   *
8   * Copyright (c) 1992-1994 The Regents of the University of California.   * Copyright (c) 1992-1994 The Regents of the University of California.
9   * Copyright (c) 1994-1997 Sun Microsystems, Inc.   * Copyright (c) 1994-1997 Sun Microsystems, Inc.
10   *   *
11   * See the file "license.terms" for information on usage and redistribution   * See the file "license.terms" for information on usage and redistribution
12   * of this file, and for a DISCLAIMER OF ALL WARRANTIES.   * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
13   *   *
14   * RCS: @(#) $Id: tkcanvbmap.c,v 1.1.1.1 2001/06/13 04:56:16 dtashley Exp $   * RCS: @(#) $Id: tkcanvbmap.c,v 1.1.1.1 2001/06/13 04:56:16 dtashley Exp $
15   */   */
16    
17  #include <stdio.h>  #include <stdio.h>
18  #include "tkInt.h"  #include "tkInt.h"
19  #include "tkPort.h"  #include "tkPort.h"
20  #include "tkCanvas.h"  #include "tkCanvas.h"
21    
22  /*  /*
23   * The structure below defines the record for each bitmap item.   * The structure below defines the record for each bitmap item.
24   */   */
25    
26  typedef struct BitmapItem  {  typedef struct BitmapItem  {
27      Tk_Item header;             /* Generic stuff that's the same for all      Tk_Item header;             /* Generic stuff that's the same for all
28                                   * types.  MUST BE FIRST IN STRUCTURE. */                                   * types.  MUST BE FIRST IN STRUCTURE. */
29      double x, y;                /* Coordinates of positioning point for      double x, y;                /* Coordinates of positioning point for
30                                   * bitmap. */                                   * bitmap. */
31      Tk_Anchor anchor;           /* Where to anchor bitmap relative to      Tk_Anchor anchor;           /* Where to anchor bitmap relative to
32                                   * (x,y). */                                   * (x,y). */
33      Pixmap bitmap;              /* Bitmap to display in window. */      Pixmap bitmap;              /* Bitmap to display in window. */
34      Pixmap activeBitmap;        /* Bitmap to display in window. */      Pixmap activeBitmap;        /* Bitmap to display in window. */
35      Pixmap disabledBitmap;      /* Bitmap to display in window. */      Pixmap disabledBitmap;      /* Bitmap to display in window. */
36      XColor *fgColor;            /* Foreground color to use for bitmap. */      XColor *fgColor;            /* Foreground color to use for bitmap. */
37      XColor *activeFgColor;      /* Foreground color to use for bitmap. */      XColor *activeFgColor;      /* Foreground color to use for bitmap. */
38      XColor *disabledFgColor;    /* Foreground color to use for bitmap. */      XColor *disabledFgColor;    /* Foreground color to use for bitmap. */
39      XColor *bgColor;            /* Background color to use for bitmap. */      XColor *bgColor;            /* Background color to use for bitmap. */
40      XColor *activeBgColor;      /* Background color to use for bitmap. */      XColor *activeBgColor;      /* Background color to use for bitmap. */
41      XColor *disabledBgColor;    /* Background color to use for bitmap. */      XColor *disabledBgColor;    /* Background color to use for bitmap. */
42      GC gc;                      /* Graphics context to use for drawing      GC gc;                      /* Graphics context to use for drawing
43                                   * bitmap on screen. */                                   * bitmap on screen. */
44  } BitmapItem;  } BitmapItem;
45    
46  /*  /*
47   * Information used for parsing configuration specs:   * Information used for parsing configuration specs:
48   */   */
49    
50  static Tk_CustomOption stateOption = {  static Tk_CustomOption stateOption = {
51      (Tk_OptionParseProc *) TkStateParseProc,      (Tk_OptionParseProc *) TkStateParseProc,
52      TkStatePrintProc, (ClientData) 2      TkStatePrintProc, (ClientData) 2
53  };  };
54  static Tk_CustomOption tagsOption = {  static Tk_CustomOption tagsOption = {
55      (Tk_OptionParseProc *) Tk_CanvasTagsParseProc,      (Tk_OptionParseProc *) Tk_CanvasTagsParseProc,
56      Tk_CanvasTagsPrintProc, (ClientData) NULL      Tk_CanvasTagsPrintProc, (ClientData) NULL
57  };  };
58    
59  static Tk_ConfigSpec configSpecs[] = {  static Tk_ConfigSpec configSpecs[] = {
60      {TK_CONFIG_COLOR, "-activebackground", (char *) NULL, (char *) NULL,      {TK_CONFIG_COLOR, "-activebackground", (char *) NULL, (char *) NULL,
61          (char *) NULL, Tk_Offset(BitmapItem, activeBgColor), TK_CONFIG_NULL_OK},          (char *) NULL, Tk_Offset(BitmapItem, activeBgColor), TK_CONFIG_NULL_OK},
62      {TK_CONFIG_BITMAP, "-activebitmap", (char *) NULL, (char *) NULL,      {TK_CONFIG_BITMAP, "-activebitmap", (char *) NULL, (char *) NULL,
63          (char *) NULL, Tk_Offset(BitmapItem, activeBitmap), TK_CONFIG_NULL_OK},          (char *) NULL, Tk_Offset(BitmapItem, activeBitmap), TK_CONFIG_NULL_OK},
64      {TK_CONFIG_COLOR, "-activeforeground", (char *) NULL, (char *) NULL,      {TK_CONFIG_COLOR, "-activeforeground", (char *) NULL, (char *) NULL,
65          (char *) NULL, Tk_Offset(BitmapItem, activeFgColor), TK_CONFIG_NULL_OK},          (char *) NULL, Tk_Offset(BitmapItem, activeFgColor), TK_CONFIG_NULL_OK},
66      {TK_CONFIG_ANCHOR, "-anchor", (char *) NULL, (char *) NULL,      {TK_CONFIG_ANCHOR, "-anchor", (char *) NULL, (char *) NULL,
67          "center", Tk_Offset(BitmapItem, anchor), TK_CONFIG_DONT_SET_DEFAULT},          "center", Tk_Offset(BitmapItem, anchor), TK_CONFIG_DONT_SET_DEFAULT},
68      {TK_CONFIG_COLOR, "-background", (char *) NULL, (char *) NULL,      {TK_CONFIG_COLOR, "-background", (char *) NULL, (char *) NULL,
69          (char *) NULL, Tk_Offset(BitmapItem, bgColor), TK_CONFIG_NULL_OK},          (char *) NULL, Tk_Offset(BitmapItem, bgColor), TK_CONFIG_NULL_OK},
70      {TK_CONFIG_BITMAP, "-bitmap", (char *) NULL, (char *) NULL,      {TK_CONFIG_BITMAP, "-bitmap", (char *) NULL, (char *) NULL,
71          (char *) NULL, Tk_Offset(BitmapItem, bitmap), TK_CONFIG_NULL_OK},          (char *) NULL, Tk_Offset(BitmapItem, bitmap), TK_CONFIG_NULL_OK},
72      {TK_CONFIG_COLOR, "-disabledbackground", (char *) NULL, (char *) NULL,      {TK_CONFIG_COLOR, "-disabledbackground", (char *) NULL, (char *) NULL,
73          (char *) NULL, Tk_Offset(BitmapItem, disabledBgColor),          (char *) NULL, Tk_Offset(BitmapItem, disabledBgColor),
74          TK_CONFIG_NULL_OK},          TK_CONFIG_NULL_OK},
75      {TK_CONFIG_BITMAP, "-disabledbitmap", (char *) NULL, (char *) NULL,      {TK_CONFIG_BITMAP, "-disabledbitmap", (char *) NULL, (char *) NULL,
76          (char *) NULL, Tk_Offset(BitmapItem, disabledBitmap),          (char *) NULL, Tk_Offset(BitmapItem, disabledBitmap),
77          TK_CONFIG_NULL_OK},          TK_CONFIG_NULL_OK},
78      {TK_CONFIG_COLOR, "-disabledforeground", (char *) NULL, (char *) NULL,      {TK_CONFIG_COLOR, "-disabledforeground", (char *) NULL, (char *) NULL,
79          (char *) NULL, Tk_Offset(BitmapItem, disabledFgColor),          (char *) NULL, Tk_Offset(BitmapItem, disabledFgColor),
80          TK_CONFIG_NULL_OK},          TK_CONFIG_NULL_OK},
81      {TK_CONFIG_COLOR, "-foreground", (char *) NULL, (char *) NULL,      {TK_CONFIG_COLOR, "-foreground", (char *) NULL, (char *) NULL,
82          "black", Tk_Offset(BitmapItem, fgColor), 0},          "black", Tk_Offset(BitmapItem, fgColor), 0},
83      {TK_CONFIG_CUSTOM, "-state", (char *) NULL, (char *) NULL,      {TK_CONFIG_CUSTOM, "-state", (char *) NULL, (char *) NULL,
84          (char *) NULL, Tk_Offset(Tk_Item, state), TK_CONFIG_NULL_OK,          (char *) NULL, Tk_Offset(Tk_Item, state), TK_CONFIG_NULL_OK,
85          &stateOption},          &stateOption},
86      {TK_CONFIG_CUSTOM, "-tags", (char *) NULL, (char *) NULL,      {TK_CONFIG_CUSTOM, "-tags", (char *) NULL, (char *) NULL,
87          (char *) NULL, 0, TK_CONFIG_NULL_OK, &tagsOption},          (char *) NULL, 0, TK_CONFIG_NULL_OK, &tagsOption},
88      {TK_CONFIG_END, (char *) NULL, (char *) NULL, (char *) NULL,      {TK_CONFIG_END, (char *) NULL, (char *) NULL, (char *) NULL,
89          (char *) NULL, 0, 0}          (char *) NULL, 0, 0}
90  };  };
91    
92  /*  /*
93   * Prototypes for procedures defined in this file:   * Prototypes for procedures defined in this file:
94   */   */
95    
96  static int              BitmapCoords _ANSI_ARGS_((Tcl_Interp *interp,  static int              BitmapCoords _ANSI_ARGS_((Tcl_Interp *interp,
97                              Tk_Canvas canvas, Tk_Item *itemPtr, int argc,                              Tk_Canvas canvas, Tk_Item *itemPtr, int argc,
98                              Tcl_Obj *CONST argv[]));                              Tcl_Obj *CONST argv[]));
99  static int              BitmapToArea _ANSI_ARGS_((Tk_Canvas canvas,  static int              BitmapToArea _ANSI_ARGS_((Tk_Canvas canvas,
100                              Tk_Item *itemPtr, double *rectPtr));                              Tk_Item *itemPtr, double *rectPtr));
101  static double           BitmapToPoint _ANSI_ARGS_((Tk_Canvas canvas,  static double           BitmapToPoint _ANSI_ARGS_((Tk_Canvas canvas,
102                              Tk_Item *itemPtr, double *coordPtr));                              Tk_Item *itemPtr, double *coordPtr));
103  static int              BitmapToPostscript _ANSI_ARGS_((Tcl_Interp *interp,  static int              BitmapToPostscript _ANSI_ARGS_((Tcl_Interp *interp,
104                              Tk_Canvas canvas, Tk_Item *itemPtr, int prepass));                              Tk_Canvas canvas, Tk_Item *itemPtr, int prepass));
105  static void             ComputeBitmapBbox _ANSI_ARGS_((Tk_Canvas canvas,  static void             ComputeBitmapBbox _ANSI_ARGS_((Tk_Canvas canvas,
106                              BitmapItem *bmapPtr));                              BitmapItem *bmapPtr));
107  static int              ConfigureBitmap _ANSI_ARGS_((Tcl_Interp *interp,  static int              ConfigureBitmap _ANSI_ARGS_((Tcl_Interp *interp,
108                              Tk_Canvas canvas, Tk_Item *itemPtr, int argc,                              Tk_Canvas canvas, Tk_Item *itemPtr, int argc,
109                              Tcl_Obj *CONST argv[], int flags));                              Tcl_Obj *CONST argv[], int flags));
110  static int              CreateBitmap _ANSI_ARGS_((Tcl_Interp *interp,  static int              CreateBitmap _ANSI_ARGS_((Tcl_Interp *interp,
111                              Tk_Canvas canvas, struct Tk_Item *itemPtr,                              Tk_Canvas canvas, struct Tk_Item *itemPtr,
112                              int argc, Tcl_Obj *CONST argv[]));                              int argc, Tcl_Obj *CONST argv[]));
113  static void             DeleteBitmap _ANSI_ARGS_((Tk_Canvas canvas,  static void             DeleteBitmap _ANSI_ARGS_((Tk_Canvas canvas,
114                              Tk_Item *itemPtr, Display *display));                              Tk_Item *itemPtr, Display *display));
115  static void             DisplayBitmap _ANSI_ARGS_((Tk_Canvas canvas,  static void             DisplayBitmap _ANSI_ARGS_((Tk_Canvas canvas,
116                              Tk_Item *itemPtr, Display *display, Drawable dst,                              Tk_Item *itemPtr, Display *display, Drawable dst,
117                              int x, int y, int width, int height));                              int x, int y, int width, int height));
118  static void             ScaleBitmap _ANSI_ARGS_((Tk_Canvas canvas,  static void             ScaleBitmap _ANSI_ARGS_((Tk_Canvas canvas,
119                              Tk_Item *itemPtr, double originX, double originY,                              Tk_Item *itemPtr, double originX, double originY,
120                              double scaleX, double scaleY));                              double scaleX, double scaleY));
121  static void             TranslateBitmap _ANSI_ARGS_((Tk_Canvas canvas,  static void             TranslateBitmap _ANSI_ARGS_((Tk_Canvas canvas,
122                              Tk_Item *itemPtr, double deltaX, double deltaY));                              Tk_Item *itemPtr, double deltaX, double deltaY));
123    
124  /*  /*
125   * The structures below defines the bitmap item type in terms of   * The structures below defines the bitmap item type in terms of
126   * procedures that can be invoked by generic item code.   * procedures that can be invoked by generic item code.
127   */   */
128    
129  Tk_ItemType tkBitmapType = {  Tk_ItemType tkBitmapType = {
130      "bitmap",                           /* name */      "bitmap",                           /* name */
131      sizeof(BitmapItem),                 /* itemSize */      sizeof(BitmapItem),                 /* itemSize */
132      CreateBitmap,                       /* createProc */      CreateBitmap,                       /* createProc */
133      configSpecs,                        /* configSpecs */      configSpecs,                        /* configSpecs */
134      ConfigureBitmap,                    /* configureProc */      ConfigureBitmap,                    /* configureProc */
135      BitmapCoords,                       /* coordProc */      BitmapCoords,                       /* coordProc */
136      DeleteBitmap,                       /* deleteProc */      DeleteBitmap,                       /* deleteProc */
137      DisplayBitmap,                      /* displayProc */      DisplayBitmap,                      /* displayProc */
138      TK_CONFIG_OBJS,                     /* flags */      TK_CONFIG_OBJS,                     /* flags */
139      BitmapToPoint,                      /* pointProc */      BitmapToPoint,                      /* pointProc */
140      BitmapToArea,                       /* areaProc */      BitmapToArea,                       /* areaProc */
141      BitmapToPostscript,                 /* postscriptProc */      BitmapToPostscript,                 /* postscriptProc */
142      ScaleBitmap,                        /* scaleProc */      ScaleBitmap,                        /* scaleProc */
143      TranslateBitmap,                    /* translateProc */      TranslateBitmap,                    /* translateProc */
144      (Tk_ItemIndexProc *) NULL,          /* indexProc */      (Tk_ItemIndexProc *) NULL,          /* indexProc */
145      (Tk_ItemCursorProc *) NULL,         /* icursorProc */      (Tk_ItemCursorProc *) NULL,         /* icursorProc */
146      (Tk_ItemSelectionProc *) NULL,      /* selectionProc */      (Tk_ItemSelectionProc *) NULL,      /* selectionProc */
147      (Tk_ItemInsertProc *) NULL,         /* insertProc */      (Tk_ItemInsertProc *) NULL,         /* insertProc */
148      (Tk_ItemDCharsProc *) NULL,         /* dTextProc */      (Tk_ItemDCharsProc *) NULL,         /* dTextProc */
149      (Tk_ItemType *) NULL,               /* nextPtr */      (Tk_ItemType *) NULL,               /* nextPtr */
150  };  };
151    
152  /*  /*
153   *--------------------------------------------------------------   *--------------------------------------------------------------
154   *   *
155   * CreateBitmap --   * CreateBitmap --
156   *   *
157   *      This procedure is invoked to create a new bitmap   *      This procedure is invoked to create a new bitmap
158   *      item in a canvas.   *      item in a canvas.
159   *   *
160   * Results:   * Results:
161   *      A standard Tcl return value.  If an error occurred in   *      A standard Tcl return value.  If an error occurred in
162   *      creating the item, then an error message is left in   *      creating the item, then an error message is left in
163   *      the interp's result;  in this case itemPtr is left uninitialized,   *      the interp's result;  in this case itemPtr is left uninitialized,
164   *      so it can be safely freed by the caller.   *      so it can be safely freed by the caller.
165   *   *
166   * Side effects:   * Side effects:
167   *      A new bitmap item is created.   *      A new bitmap item is created.
168   *   *
169   *--------------------------------------------------------------   *--------------------------------------------------------------
170   */   */
171    
172  static int  static int
173  CreateBitmap(interp, canvas, itemPtr, argc, argv)  CreateBitmap(interp, canvas, itemPtr, argc, argv)
174      Tcl_Interp *interp;                 /* Interpreter for error reporting. */      Tcl_Interp *interp;                 /* Interpreter for error reporting. */
175      Tk_Canvas canvas;                   /* Canvas to hold new item. */      Tk_Canvas canvas;                   /* Canvas to hold new item. */
176      Tk_Item *itemPtr;                   /* Record to hold new item;  header      Tk_Item *itemPtr;                   /* Record to hold new item;  header
177                                           * has been initialized by caller. */                                           * has been initialized by caller. */
178      int argc;                           /* Number of arguments in argv. */      int argc;                           /* Number of arguments in argv. */
179      Tcl_Obj *CONST argv[];              /* Arguments describing rectangle. */      Tcl_Obj *CONST argv[];              /* Arguments describing rectangle. */
180  {  {
181      BitmapItem *bmapPtr = (BitmapItem *) itemPtr;      BitmapItem *bmapPtr = (BitmapItem *) itemPtr;
182      int i;      int i;
183    
184      if (argc==1) {      if (argc==1) {
185          i = 1;          i = 1;
186      } else {      } else {
187          char *arg = Tcl_GetStringFromObj(argv[1], NULL);          char *arg = Tcl_GetStringFromObj(argv[1], NULL);
188          if (((argc>1) && (arg[0] == '-')          if (((argc>1) && (arg[0] == '-')
189                  && (arg[1] >= 'a') && (arg[1] <= 'z'))) {                  && (arg[1] >= 'a') && (arg[1] <= 'z'))) {
190              i = 1;              i = 1;
191          } else {          } else {
192              i = 2;              i = 2;
193          }          }
194      }      }
195    
196      if (argc < i) {      if (argc < i) {
197          Tcl_AppendResult(interp, "wrong # args: should be \"",          Tcl_AppendResult(interp, "wrong # args: should be \"",
198                  Tk_PathName(Tk_CanvasTkwin(canvas)), " create ",                  Tk_PathName(Tk_CanvasTkwin(canvas)), " create ",
199                  itemPtr->typePtr->name, " x y ?options?\"",                  itemPtr->typePtr->name, " x y ?options?\"",
200                  (char *) NULL);                  (char *) NULL);
201          return TCL_ERROR;          return TCL_ERROR;
202      }      }
203    
204      /*      /*
205       * Initialize item's record.       * Initialize item's record.
206       */       */
207    
208      bmapPtr->anchor = TK_ANCHOR_CENTER;      bmapPtr->anchor = TK_ANCHOR_CENTER;
209      bmapPtr->bitmap = None;      bmapPtr->bitmap = None;
210      bmapPtr->activeBitmap = None;      bmapPtr->activeBitmap = None;
211      bmapPtr->disabledBitmap = None;      bmapPtr->disabledBitmap = None;
212      bmapPtr->fgColor = NULL;      bmapPtr->fgColor = NULL;
213      bmapPtr->activeFgColor = NULL;      bmapPtr->activeFgColor = NULL;
214      bmapPtr->disabledFgColor = NULL;      bmapPtr->disabledFgColor = NULL;
215      bmapPtr->bgColor = NULL;      bmapPtr->bgColor = NULL;
216      bmapPtr->activeBgColor = NULL;      bmapPtr->activeBgColor = NULL;
217      bmapPtr->disabledBgColor = NULL;      bmapPtr->disabledBgColor = NULL;
218      bmapPtr->gc = None;      bmapPtr->gc = None;
219    
220      /*      /*
221       * Process the arguments to fill in the item record.       * Process the arguments to fill in the item record.
222       */       */
223    
224      if ((BitmapCoords(interp, canvas, itemPtr, i, argv) != TCL_OK)) {      if ((BitmapCoords(interp, canvas, itemPtr, i, argv) != TCL_OK)) {
225          goto error;          goto error;
226      }      }
227      if (ConfigureBitmap(interp, canvas, itemPtr, argc-i, argv+i, 0) == TCL_OK) {      if (ConfigureBitmap(interp, canvas, itemPtr, argc-i, argv+i, 0) == TCL_OK) {
228          return TCL_OK;          return TCL_OK;
229      }      }
230    
231      error:      error:
232      DeleteBitmap(canvas, itemPtr, Tk_Display(Tk_CanvasTkwin(canvas)));      DeleteBitmap(canvas, itemPtr, Tk_Display(Tk_CanvasTkwin(canvas)));
233      return TCL_ERROR;      return TCL_ERROR;
234  }  }
235    
236  /*  /*
237   *--------------------------------------------------------------   *--------------------------------------------------------------
238   *   *
239   * BitmapCoords --   * BitmapCoords --
240   *   *
241   *      This procedure is invoked to process the "coords" widget   *      This procedure is invoked to process the "coords" widget
242   *      command on bitmap items.  See the user documentation for   *      command on bitmap items.  See the user documentation for
243   *      details on what it does.   *      details on what it does.
244   *   *
245   * Results:   * Results:
246   *      Returns TCL_OK or TCL_ERROR, and sets the interp's result.   *      Returns TCL_OK or TCL_ERROR, and sets the interp's result.
247   *   *
248   * Side effects:   * Side effects:
249   *      The coordinates for the given item may be changed.   *      The coordinates for the given item may be changed.
250   *   *
251   *--------------------------------------------------------------   *--------------------------------------------------------------
252   */   */
253    
254  static int  static int
255  BitmapCoords(interp, canvas, itemPtr, argc, argv)  BitmapCoords(interp, canvas, itemPtr, argc, argv)
256      Tcl_Interp *interp;                 /* Used for error reporting. */      Tcl_Interp *interp;                 /* Used for error reporting. */
257      Tk_Canvas canvas;                   /* Canvas containing item. */      Tk_Canvas canvas;                   /* Canvas containing item. */
258      Tk_Item *itemPtr;                   /* Item whose coordinates are to be      Tk_Item *itemPtr;                   /* Item whose coordinates are to be
259                                           * read or modified. */                                           * read or modified. */
260      int argc;                           /* Number of coordinates supplied in      int argc;                           /* Number of coordinates supplied in
261                                           * argv. */                                           * argv. */
262      Tcl_Obj *CONST argv[];              /* Array of coordinates: x1, y1,      Tcl_Obj *CONST argv[];              /* Array of coordinates: x1, y1,
263                                           * x2, y2, ... */                                           * x2, y2, ... */
264  {  {
265      BitmapItem *bmapPtr = (BitmapItem *) itemPtr;      BitmapItem *bmapPtr = (BitmapItem *) itemPtr;
266    
267      if (argc == 0) {      if (argc == 0) {
268          Tcl_Obj *obj = Tcl_NewObj();          Tcl_Obj *obj = Tcl_NewObj();
269          Tcl_Obj *subobj = Tcl_NewDoubleObj(bmapPtr->x);          Tcl_Obj *subobj = Tcl_NewDoubleObj(bmapPtr->x);
270          Tcl_ListObjAppendElement(interp, obj, subobj);          Tcl_ListObjAppendElement(interp, obj, subobj);
271          subobj = Tcl_NewDoubleObj(bmapPtr->y);          subobj = Tcl_NewDoubleObj(bmapPtr->y);
272          Tcl_ListObjAppendElement(interp, obj, subobj);          Tcl_ListObjAppendElement(interp, obj, subobj);
273          Tcl_SetObjResult(interp, obj);          Tcl_SetObjResult(interp, obj);
274      } else if (argc <3) {      } else if (argc <3) {
275          if (argc==1) {          if (argc==1) {
276              if (Tcl_ListObjGetElements(interp, argv[0], &argc,              if (Tcl_ListObjGetElements(interp, argv[0], &argc,
277                      (Tcl_Obj ***) &argv) != TCL_OK) {                      (Tcl_Obj ***) &argv) != TCL_OK) {
278                  return TCL_ERROR;                  return TCL_ERROR;
279              } else if (argc != 2) {              } else if (argc != 2) {
280                  char buf[64 + TCL_INTEGER_SPACE];                  char buf[64 + TCL_INTEGER_SPACE];
281    
282                  sprintf(buf, "wrong # coordinates: expected 2, got %d", argc);                  sprintf(buf, "wrong # coordinates: expected 2, got %d", argc);
283                  Tcl_SetResult(interp, buf, TCL_VOLATILE);                  Tcl_SetResult(interp, buf, TCL_VOLATILE);
284                  return TCL_ERROR;                  return TCL_ERROR;
285              }              }
286          }          }
287          if ((Tk_CanvasGetCoordFromObj(interp, canvas, argv[0], &bmapPtr->x) != TCL_OK)          if ((Tk_CanvasGetCoordFromObj(interp, canvas, argv[0], &bmapPtr->x) != TCL_OK)
288                  || (Tk_CanvasGetCoordFromObj(interp, canvas, argv[1], &bmapPtr->y)                  || (Tk_CanvasGetCoordFromObj(interp, canvas, argv[1], &bmapPtr->y)
289                      != TCL_OK)) {                      != TCL_OK)) {
290              return TCL_ERROR;              return TCL_ERROR;
291          }          }
292          ComputeBitmapBbox(canvas, bmapPtr);          ComputeBitmapBbox(canvas, bmapPtr);
293      } else {      } else {
294          char buf[64 + TCL_INTEGER_SPACE];          char buf[64 + TCL_INTEGER_SPACE];
295    
296          sprintf(buf, "wrong # coordinates: expected 0 or 2, got %d", argc);          sprintf(buf, "wrong # coordinates: expected 0 or 2, got %d", argc);
297          Tcl_SetResult(interp, buf, TCL_VOLATILE);          Tcl_SetResult(interp, buf, TCL_VOLATILE);
298          return TCL_ERROR;          return TCL_ERROR;
299      }      }
300      return TCL_OK;      return TCL_OK;
301  }  }
302    
303  /*  /*
304   *--------------------------------------------------------------   *--------------------------------------------------------------
305   *   *
306   * ConfigureBitmap --   * ConfigureBitmap --
307   *   *
308   *      This procedure is invoked to configure various aspects   *      This procedure is invoked to configure various aspects
309   *      of a bitmap item, such as its anchor position.   *      of a bitmap item, such as its anchor position.
310   *   *
311   * Results:   * Results:
312   *      A standard Tcl result code.  If an error occurs, then   *      A standard Tcl result code.  If an error occurs, then
313   *      an error message is left in the interp's result.   *      an error message is left in the interp's result.
314   *   *
315   * Side effects:   * Side effects:
316   *      Configuration information may be set for itemPtr.   *      Configuration information may be set for itemPtr.
317   *   *
318   *--------------------------------------------------------------   *--------------------------------------------------------------
319   */   */
320    
321  static int  static int
322  ConfigureBitmap(interp, canvas, itemPtr, argc, argv, flags)  ConfigureBitmap(interp, canvas, itemPtr, argc, argv, flags)
323      Tcl_Interp *interp;         /* Used for error reporting. */      Tcl_Interp *interp;         /* Used for error reporting. */
324      Tk_Canvas canvas;           /* Canvas containing itemPtr. */      Tk_Canvas canvas;           /* Canvas containing itemPtr. */
325      Tk_Item *itemPtr;           /* Bitmap item to reconfigure. */      Tk_Item *itemPtr;           /* Bitmap item to reconfigure. */
326      int argc;                   /* Number of elements in argv.  */      int argc;                   /* Number of elements in argv.  */
327      Tcl_Obj *CONST argv[];      /* Arguments describing things to configure. */      Tcl_Obj *CONST argv[];      /* Arguments describing things to configure. */
328      int flags;                  /* Flags to pass to Tk_ConfigureWidget. */      int flags;                  /* Flags to pass to Tk_ConfigureWidget. */
329  {  {
330      BitmapItem *bmapPtr = (BitmapItem *) itemPtr;      BitmapItem *bmapPtr = (BitmapItem *) itemPtr;
331      XGCValues gcValues;      XGCValues gcValues;
332      GC newGC;      GC newGC;
333      Tk_Window tkwin;      Tk_Window tkwin;
334      unsigned long mask;      unsigned long mask;
335      XColor *fgColor;      XColor *fgColor;
336      XColor *bgColor;      XColor *bgColor;
337      Pixmap bitmap;      Pixmap bitmap;
338      Tk_State state;      Tk_State state;
339    
340      tkwin = Tk_CanvasTkwin(canvas);      tkwin = Tk_CanvasTkwin(canvas);
341      if (Tk_ConfigureWidget(interp, tkwin, configSpecs, argc, (char **) argv,      if (Tk_ConfigureWidget(interp, tkwin, configSpecs, argc, (char **) argv,
342              (char *) bmapPtr, flags|TK_CONFIG_OBJS) != TCL_OK) {              (char *) bmapPtr, flags|TK_CONFIG_OBJS) != TCL_OK) {
343          return TCL_ERROR;          return TCL_ERROR;
344      }      }
345    
346      /*      /*
347       * A few of the options require additional processing, such as those       * A few of the options require additional processing, such as those
348       * that determine the graphics context.       * that determine the graphics context.
349       */       */
350    
351      state = itemPtr->state;      state = itemPtr->state;
352    
353      if (bmapPtr->activeFgColor!=NULL ||      if (bmapPtr->activeFgColor!=NULL ||
354              bmapPtr->activeBgColor!=NULL ||              bmapPtr->activeBgColor!=NULL ||
355              bmapPtr->activeBitmap!=None) {              bmapPtr->activeBitmap!=None) {
356          itemPtr->redraw_flags |= TK_ITEM_STATE_DEPENDANT;          itemPtr->redraw_flags |= TK_ITEM_STATE_DEPENDANT;
357      } else {      } else {
358          itemPtr->redraw_flags &= ~TK_ITEM_STATE_DEPENDANT;          itemPtr->redraw_flags &= ~TK_ITEM_STATE_DEPENDANT;
359      }      }
360    
361      if(state == TK_STATE_NULL) {      if(state == TK_STATE_NULL) {
362          state = ((TkCanvas *)canvas)->canvas_state;          state = ((TkCanvas *)canvas)->canvas_state;
363      }      }
364      if (state==TK_STATE_HIDDEN) {      if (state==TK_STATE_HIDDEN) {
365          ComputeBitmapBbox(canvas, bmapPtr);          ComputeBitmapBbox(canvas, bmapPtr);
366          return TCL_OK;            return TCL_OK;  
367      }      }
368      fgColor = bmapPtr->fgColor;      fgColor = bmapPtr->fgColor;
369      bgColor = bmapPtr->bgColor;      bgColor = bmapPtr->bgColor;
370      bitmap = bmapPtr->bitmap;      bitmap = bmapPtr->bitmap;
371      if (((TkCanvas *)canvas)->currentItemPtr == itemPtr) {      if (((TkCanvas *)canvas)->currentItemPtr == itemPtr) {
372          if (bmapPtr->activeFgColor!=NULL) {          if (bmapPtr->activeFgColor!=NULL) {
373              fgColor = bmapPtr->activeFgColor;              fgColor = bmapPtr->activeFgColor;
374          }          }
375          if (bmapPtr->activeBgColor!=NULL) {          if (bmapPtr->activeBgColor!=NULL) {
376              bgColor = bmapPtr->activeBgColor;              bgColor = bmapPtr->activeBgColor;
377          }          }
378          if (bmapPtr->activeBitmap!=None) {          if (bmapPtr->activeBitmap!=None) {
379              bitmap = bmapPtr->activeBitmap;              bitmap = bmapPtr->activeBitmap;
380          }          }
381      } else if (state==TK_STATE_DISABLED) {      } else if (state==TK_STATE_DISABLED) {
382          if (bmapPtr->disabledFgColor!=NULL) {          if (bmapPtr->disabledFgColor!=NULL) {
383              fgColor = bmapPtr->disabledFgColor;              fgColor = bmapPtr->disabledFgColor;
384          }          }
385          if (bmapPtr->disabledBgColor!=NULL) {          if (bmapPtr->disabledBgColor!=NULL) {
386              bgColor = bmapPtr->disabledBgColor;              bgColor = bmapPtr->disabledBgColor;
387          }          }
388          if (bmapPtr->disabledBitmap!=None) {          if (bmapPtr->disabledBitmap!=None) {
389              bitmap = bmapPtr->disabledBitmap;              bitmap = bmapPtr->disabledBitmap;
390          }          }
391      }      }
392    
393      if (state==TK_STATE_DISABLED || bitmap == None) {      if (state==TK_STATE_DISABLED || bitmap == None) {
394          ComputeBitmapBbox(canvas, bmapPtr);          ComputeBitmapBbox(canvas, bmapPtr);
395          return TCL_OK;          return TCL_OK;
396      }      }
397    
398      gcValues.foreground = fgColor->pixel;      gcValues.foreground = fgColor->pixel;
399      mask = GCForeground;      mask = GCForeground;
400      if (bgColor != NULL) {      if (bgColor != NULL) {
401          gcValues.background = bgColor->pixel;          gcValues.background = bgColor->pixel;
402          mask |= GCBackground;          mask |= GCBackground;
403      } else {      } else {
404          gcValues.clip_mask = bitmap;          gcValues.clip_mask = bitmap;
405          mask |= GCClipMask;          mask |= GCClipMask;
406      }      }
407      if (bitmap == None) {      if (bitmap == None) {
408          newGC = None;          newGC = None;
409      } else {      } else {
410          newGC = Tk_GetGC(tkwin, mask, &gcValues);          newGC = Tk_GetGC(tkwin, mask, &gcValues);
411      }      }
412      if (bmapPtr->gc != None) {      if (bmapPtr->gc != None) {
413          Tk_FreeGC(Tk_Display(tkwin), bmapPtr->gc);          Tk_FreeGC(Tk_Display(tkwin), bmapPtr->gc);
414      }      }
415      bmapPtr->gc = newGC;      bmapPtr->gc = newGC;
416    
417      ComputeBitmapBbox(canvas, bmapPtr);      ComputeBitmapBbox(canvas, bmapPtr);
418    
419      return TCL_OK;      return TCL_OK;
420  }  }
421    
422  /*  /*
423   *--------------------------------------------------------------   *--------------------------------------------------------------
424   *   *
425   * DeleteBitmap --   * DeleteBitmap --
426   *   *
427   *      This procedure is called to clean up the data structure   *      This procedure is called to clean up the data structure
428   *      associated with a bitmap item.   *      associated with a bitmap item.
429   *   *
430   * Results:   * Results:
431   *      None.   *      None.
432   *   *
433   * Side effects:   * Side effects:
434   *      Resources associated with itemPtr are released.   *      Resources associated with itemPtr are released.
435   *   *
436   *--------------------------------------------------------------   *--------------------------------------------------------------
437   */   */
438    
439  static void  static void
440  DeleteBitmap(canvas, itemPtr, display)  DeleteBitmap(canvas, itemPtr, display)
441      Tk_Canvas canvas;                   /* Info about overall canvas widget. */      Tk_Canvas canvas;                   /* Info about overall canvas widget. */
442      Tk_Item *itemPtr;                   /* Item that is being deleted. */      Tk_Item *itemPtr;                   /* Item that is being deleted. */
443      Display *display;                   /* Display containing window for      Display *display;                   /* Display containing window for
444                                           * canvas. */                                           * canvas. */
445  {  {
446      BitmapItem *bmapPtr = (BitmapItem *) itemPtr;      BitmapItem *bmapPtr = (BitmapItem *) itemPtr;
447    
448      if (bmapPtr->bitmap != None) {      if (bmapPtr->bitmap != None) {
449          Tk_FreeBitmap(display, bmapPtr->bitmap);          Tk_FreeBitmap(display, bmapPtr->bitmap);
450      }      }
451      if (bmapPtr->activeBitmap != None) {      if (bmapPtr->activeBitmap != None) {
452          Tk_FreeBitmap(display, bmapPtr->activeBitmap);          Tk_FreeBitmap(display, bmapPtr->activeBitmap);
453      }      }
454      if (bmapPtr->disabledBitmap != None) {      if (bmapPtr->disabledBitmap != None) {
455          Tk_FreeBitmap(display, bmapPtr->disabledBitmap);          Tk_FreeBitmap(display, bmapPtr->disabledBitmap);
456      }      }
457      if (bmapPtr->fgColor != NULL) {      if (bmapPtr->fgColor != NULL) {
458          Tk_FreeColor(bmapPtr->fgColor);          Tk_FreeColor(bmapPtr->fgColor);
459      }      }
460      if (bmapPtr->activeFgColor != NULL) {      if (bmapPtr->activeFgColor != NULL) {
461          Tk_FreeColor(bmapPtr->activeFgColor);          Tk_FreeColor(bmapPtr->activeFgColor);
462      }      }
463      if (bmapPtr->disabledFgColor != NULL) {      if (bmapPtr->disabledFgColor != NULL) {
464          Tk_FreeColor(bmapPtr->disabledFgColor);          Tk_FreeColor(bmapPtr->disabledFgColor);
465      }      }
466      if (bmapPtr->bgColor != NULL) {      if (bmapPtr->bgColor != NULL) {
467          Tk_FreeColor(bmapPtr->bgColor);          Tk_FreeColor(bmapPtr->bgColor);
468      }      }
469      if (bmapPtr->activeBgColor != NULL) {      if (bmapPtr->activeBgColor != NULL) {
470          Tk_FreeColor(bmapPtr->activeBgColor);          Tk_FreeColor(bmapPtr->activeBgColor);
471      }      }
472      if (bmapPtr->disabledBgColor != NULL) {      if (bmapPtr->disabledBgColor != NULL) {
473          Tk_FreeColor(bmapPtr->disabledBgColor);          Tk_FreeColor(bmapPtr->disabledBgColor);
474      }      }
475      if (bmapPtr->gc != NULL) {      if (bmapPtr->gc != NULL) {
476          Tk_FreeGC(display, bmapPtr->gc);          Tk_FreeGC(display, bmapPtr->gc);
477      }      }
478  }  }
479    
480  /*  /*
481   *--------------------------------------------------------------   *--------------------------------------------------------------
482   *   *
483   * ComputeBitmapBbox --   * ComputeBitmapBbox --
484   *   *
485   *      This procedure is invoked to compute the bounding box of   *      This procedure is invoked to compute the bounding box of
486   *      all the pixels that may be drawn as part of a bitmap item.   *      all the pixels that may be drawn as part of a bitmap item.
487   *      This procedure is where the child bitmap's placement is   *      This procedure is where the child bitmap's placement is
488   *      computed.   *      computed.
489   *   *
490   * Results:   * Results:
491   *      None.   *      None.
492   *   *
493   * Side effects:   * Side effects:
494   *      The fields x1, y1, x2, and y2 are updated in the header   *      The fields x1, y1, x2, and y2 are updated in the header
495   *      for itemPtr.   *      for itemPtr.
496   *   *
497   *--------------------------------------------------------------   *--------------------------------------------------------------
498   */   */
499    
500          /* ARGSUSED */          /* ARGSUSED */
501  static void  static void
502  ComputeBitmapBbox(canvas, bmapPtr)  ComputeBitmapBbox(canvas, bmapPtr)
503      Tk_Canvas canvas;                   /* Canvas that contains item. */      Tk_Canvas canvas;                   /* Canvas that contains item. */
504      BitmapItem *bmapPtr;                /* Item whose bbox is to be      BitmapItem *bmapPtr;                /* Item whose bbox is to be
505                                           * recomputed. */                                           * recomputed. */
506  {  {
507      int width, height;      int width, height;
508      int x, y;      int x, y;
509      Pixmap bitmap;      Pixmap bitmap;
510      Tk_State state = bmapPtr->header.state;      Tk_State state = bmapPtr->header.state;
511    
512      if(state == TK_STATE_NULL) {      if(state == TK_STATE_NULL) {
513          state = ((TkCanvas *)canvas)->canvas_state;          state = ((TkCanvas *)canvas)->canvas_state;
514      }      }
515      bitmap = bmapPtr->bitmap;      bitmap = bmapPtr->bitmap;
516      if (((TkCanvas *)canvas)->currentItemPtr == (Tk_Item *)bmapPtr) {      if (((TkCanvas *)canvas)->currentItemPtr == (Tk_Item *)bmapPtr) {
517          if (bmapPtr->activeBitmap!=None) {          if (bmapPtr->activeBitmap!=None) {
518              bitmap = bmapPtr->activeBitmap;              bitmap = bmapPtr->activeBitmap;
519          }          }
520      } else if (state==TK_STATE_DISABLED) {      } else if (state==TK_STATE_DISABLED) {
521          if (bmapPtr->disabledBitmap!=None) {          if (bmapPtr->disabledBitmap!=None) {
522              bitmap = bmapPtr->disabledBitmap;              bitmap = bmapPtr->disabledBitmap;
523          }          }
524      }      }
525    
526      x = (int) (bmapPtr->x + ((bmapPtr->x >= 0) ? 0.5 : - 0.5));      x = (int) (bmapPtr->x + ((bmapPtr->x >= 0) ? 0.5 : - 0.5));
527      y = (int) (bmapPtr->y + ((bmapPtr->y >= 0) ? 0.5 : - 0.5));      y = (int) (bmapPtr->y + ((bmapPtr->y >= 0) ? 0.5 : - 0.5));
528    
529      if (state==TK_STATE_HIDDEN || bitmap == None) {      if (state==TK_STATE_HIDDEN || bitmap == None) {
530          bmapPtr->header.x1 = bmapPtr->header.x2 = x;          bmapPtr->header.x1 = bmapPtr->header.x2 = x;
531          bmapPtr->header.y1 = bmapPtr->header.y2 = y;          bmapPtr->header.y1 = bmapPtr->header.y2 = y;
532          return;          return;
533      }      }
534    
535      /*      /*
536       * Compute location and size of bitmap, using anchor information.       * Compute location and size of bitmap, using anchor information.
537       */       */
538    
539      Tk_SizeOfBitmap(Tk_Display(Tk_CanvasTkwin(canvas)), bmapPtr->bitmap,      Tk_SizeOfBitmap(Tk_Display(Tk_CanvasTkwin(canvas)), bmapPtr->bitmap,
540              &width, &height);              &width, &height);
541      switch (bmapPtr->anchor) {      switch (bmapPtr->anchor) {
542          case TK_ANCHOR_N:          case TK_ANCHOR_N:
543              x -= width/2;              x -= width/2;
544              break;              break;
545          case TK_ANCHOR_NE:          case TK_ANCHOR_NE:
546              x -= width;              x -= width;
547              break;              break;
548          case TK_ANCHOR_E:          case TK_ANCHOR_E:
549              x -= width;              x -= width;
550              y -= height/2;              y -= height/2;
551              break;              break;
552          case TK_ANCHOR_SE:          case TK_ANCHOR_SE:
553              x -= width;              x -= width;
554              y -= height;              y -= height;
555              break;              break;
556          case TK_ANCHOR_S:          case TK_ANCHOR_S:
557              x -= width/2;              x -= width/2;
558              y -= height;              y -= height;
559              break;              break;
560          case TK_ANCHOR_SW:          case TK_ANCHOR_SW:
561              y -= height;              y -= height;
562              break;              break;
563          case TK_ANCHOR_W:          case TK_ANCHOR_W:
564              y -= height/2;              y -= height/2;
565              break;              break;
566          case TK_ANCHOR_NW:          case TK_ANCHOR_NW:
567              break;              break;
568          case TK_ANCHOR_CENTER:          case TK_ANCHOR_CENTER:
569              x -= width/2;              x -= width/2;
570              y -= height/2;              y -= height/2;
571              break;              break;
572      }      }
573    
574      /*      /*
575       * Store the information in the item header.       * Store the information in the item header.
576       */       */
577    
578      bmapPtr->header.x1 = x;      bmapPtr->header.x1 = x;
579      bmapPtr->header.y1 = y;      bmapPtr->header.y1 = y;
580      bmapPtr->header.x2 = x + width;      bmapPtr->header.x2 = x + width;
581      bmapPtr->header.y2 = y + height;      bmapPtr->header.y2 = y + height;
582  }  }
583    
584  /*  /*
585   *--------------------------------------------------------------   *--------------------------------------------------------------
586   *   *
587   * DisplayBitmap --   * DisplayBitmap --
588   *   *
589   *      This procedure is invoked to draw a bitmap item in a given   *      This procedure is invoked to draw a bitmap item in a given
590   *      drawable.   *      drawable.
591   *   *
592   * Results:   * Results:
593   *      None.   *      None.
594   *   *
595   * Side effects:   * Side effects:
596   *      ItemPtr is drawn in drawable using the transformation   *      ItemPtr is drawn in drawable using the transformation
597   *      information in canvas.   *      information in canvas.
598   *   *
599   *--------------------------------------------------------------   *--------------------------------------------------------------
600   */   */
601    
602  static void  static void
603  DisplayBitmap(canvas, itemPtr, display, drawable, x, y, width, height)  DisplayBitmap(canvas, itemPtr, display, drawable, x, y, width, height)
604      Tk_Canvas canvas;                   /* Canvas that contains item. */      Tk_Canvas canvas;                   /* Canvas that contains item. */
605      Tk_Item *itemPtr;                   /* Item to be displayed. */      Tk_Item *itemPtr;                   /* Item to be displayed. */
606      Display *display;                   /* Display on which to draw item. */      Display *display;                   /* Display on which to draw item. */
607      Drawable drawable;                  /* Pixmap or window in which to draw      Drawable drawable;                  /* Pixmap or window in which to draw
608                                           * item. */                                           * item. */
609      int x, y, width, height;            /* Describes region of canvas that      int x, y, width, height;            /* Describes region of canvas that
610                                           * must be redisplayed (not used). */                                           * must be redisplayed (not used). */
611  {  {
612      BitmapItem *bmapPtr = (BitmapItem *) itemPtr;      BitmapItem *bmapPtr = (BitmapItem *) itemPtr;
613      int bmapX, bmapY, bmapWidth, bmapHeight;      int bmapX, bmapY, bmapWidth, bmapHeight;
614      short drawableX, drawableY;      short drawableX, drawableY;
615      XColor *fgColor;      XColor *fgColor;
616      XColor *bgColor;      XColor *bgColor;
617      Pixmap bitmap;      Pixmap bitmap;
618      Tk_State state = itemPtr->state;      Tk_State state = itemPtr->state;
619    
620      /*      /*
621       * If the area being displayed doesn't cover the whole bitmap,       * If the area being displayed doesn't cover the whole bitmap,
622       * then only redisplay the part of the bitmap that needs       * then only redisplay the part of the bitmap that needs
623       * redisplay.       * redisplay.
624       */       */
625    
626      if(state == TK_STATE_NULL) {      if(state == TK_STATE_NULL) {
627          state = ((TkCanvas *)canvas)->canvas_state;          state = ((TkCanvas *)canvas)->canvas_state;
628      }      }
629      fgColor = bmapPtr->fgColor;      fgColor = bmapPtr->fgColor;
630      bgColor = bmapPtr->bgColor;      bgColor = bmapPtr->bgColor;
631      bitmap = bmapPtr->bitmap;      bitmap = bmapPtr->bitmap;
632      if (((TkCanvas *)canvas)->currentItemPtr == itemPtr) {      if (((TkCanvas *)canvas)->currentItemPtr == itemPtr) {
633          if (bmapPtr->activeFgColor!=NULL) {          if (bmapPtr->activeFgColor!=NULL) {
634              fgColor = bmapPtr->activeFgColor;              fgColor = bmapPtr->activeFgColor;
635          }          }
636          if (bmapPtr->activeBgColor!=NULL) {          if (bmapPtr->activeBgColor!=NULL) {
637              bgColor = bmapPtr->activeBgColor;              bgColor = bmapPtr->activeBgColor;
638          }          }
639          if (bmapPtr->activeBitmap!=None) {          if (bmapPtr->activeBitmap!=None) {
640              bitmap = bmapPtr->activeBitmap;              bitmap = bmapPtr->activeBitmap;
641          }          }
642      } else if (state==TK_STATE_DISABLED) {      } else if (state==TK_STATE_DISABLED) {
643          if (bmapPtr->disabledFgColor!=NULL) {          if (bmapPtr->disabledFgColor!=NULL) {
644              fgColor = bmapPtr->disabledFgColor;              fgColor = bmapPtr->disabledFgColor;
645          }          }
646          if (bmapPtr->disabledBgColor!=NULL) {          if (bmapPtr->disabledBgColor!=NULL) {
647              bgColor = bmapPtr->disabledBgColor;              bgColor = bmapPtr->disabledBgColor;
648          }          }
649          if (bmapPtr->disabledBitmap!=None) {          if (bmapPtr->disabledBitmap!=None) {
650              bitmap = bmapPtr->disabledBitmap;              bitmap = bmapPtr->disabledBitmap;
651          }          }
652      }      }
653    
654      if (bitmap != None) {      if (bitmap != None) {
655          if (x > bmapPtr->header.x1) {          if (x > bmapPtr->header.x1) {
656              bmapX = x - bmapPtr->header.x1;              bmapX = x - bmapPtr->header.x1;
657              bmapWidth = bmapPtr->header.x2 - x;              bmapWidth = bmapPtr->header.x2 - x;
658          } else {          } else {
659              bmapX = 0;              bmapX = 0;
660              if ((x+width) < bmapPtr->header.x2) {              if ((x+width) < bmapPtr->header.x2) {
661                  bmapWidth = x + width - bmapPtr->header.x1;                  bmapWidth = x + width - bmapPtr->header.x1;
662              } else {              } else {
663                  bmapWidth = bmapPtr->header.x2 - bmapPtr->header.x1;                  bmapWidth = bmapPtr->header.x2 - bmapPtr->header.x1;
664              }              }
665          }          }
666          if (y > bmapPtr->header.y1) {          if (y > bmapPtr->header.y1) {
667              bmapY = y - bmapPtr->header.y1;              bmapY = y - bmapPtr->header.y1;
668              bmapHeight = bmapPtr->header.y2 - y;              bmapHeight = bmapPtr->header.y2 - y;
669          } else {          } else {
670              bmapY = 0;              bmapY = 0;
671              if ((y+height) < bmapPtr->header.y2) {              if ((y+height) < bmapPtr->header.y2) {
672                  bmapHeight = y + height - bmapPtr->header.y1;                  bmapHeight = y + height - bmapPtr->header.y1;
673              } else {              } else {
674                  bmapHeight = bmapPtr->header.y2 - bmapPtr->header.y1;                  bmapHeight = bmapPtr->header.y2 - bmapPtr->header.y1;
675              }              }
676          }          }
677          Tk_CanvasDrawableCoords(canvas,          Tk_CanvasDrawableCoords(canvas,
678                  (double) (bmapPtr->header.x1 + bmapX),                  (double) (bmapPtr->header.x1 + bmapX),
679                  (double) (bmapPtr->header.y1 + bmapY),                  (double) (bmapPtr->header.y1 + bmapY),
680                  &drawableX, &drawableY);                  &drawableX, &drawableY);
681    
682          /*          /*
683           * Must modify the mask origin within the graphics context           * Must modify the mask origin within the graphics context
684           * to line up with the bitmap's origin (in order to make           * to line up with the bitmap's origin (in order to make
685           * bitmaps with "-background {}" work right).           * bitmaps with "-background {}" work right).
686           */           */
687    
688          XSetClipOrigin(display, bmapPtr->gc, drawableX - bmapX,          XSetClipOrigin(display, bmapPtr->gc, drawableX - bmapX,
689                  drawableY - bmapY);                  drawableY - bmapY);
690          XCopyPlane(display, bitmap, drawable,          XCopyPlane(display, bitmap, drawable,
691                  bmapPtr->gc, bmapX, bmapY, (unsigned int) bmapWidth,                  bmapPtr->gc, bmapX, bmapY, (unsigned int) bmapWidth,
692                  (unsigned int) bmapHeight, drawableX, drawableY, 1);                  (unsigned int) bmapHeight, drawableX, drawableY, 1);
693          XSetClipOrigin(display, bmapPtr->gc, 0, 0);          XSetClipOrigin(display, bmapPtr->gc, 0, 0);
694      }      }
695  }  }
696    
697  /*  /*
698   *--------------------------------------------------------------   *--------------------------------------------------------------
699   *   *
700   * BitmapToPoint --   * BitmapToPoint --
701   *   *
702   *      Computes the distance from a given point to a given   *      Computes the distance from a given point to a given
703   *      rectangle, in canvas units.   *      rectangle, in canvas units.
704   *   *
705   * Results:   * Results:
706   *      The return value is 0 if the point whose x and y coordinates   *      The return value is 0 if the point whose x and y coordinates
707   *      are coordPtr[0] and coordPtr[1] is inside the bitmap.  If the   *      are coordPtr[0] and coordPtr[1] is inside the bitmap.  If the
708   *      point isn't inside the bitmap then the return value is the   *      point isn't inside the bitmap then the return value is the
709   *      distance from the point to the bitmap.   *      distance from the point to the bitmap.
710   *   *
711   * Side effects:   * Side effects:
712   *      None.   *      None.
713   *   *
714   *--------------------------------------------------------------   *--------------------------------------------------------------
715   */   */
716    
717          /* ARGSUSED */          /* ARGSUSED */
718  static double  static double
719  BitmapToPoint(canvas, itemPtr, coordPtr)  BitmapToPoint(canvas, itemPtr, coordPtr)
720      Tk_Canvas canvas;           /* Canvas containing item. */      Tk_Canvas canvas;           /* Canvas containing item. */
721      Tk_Item *itemPtr;           /* Item to check against point. */      Tk_Item *itemPtr;           /* Item to check against point. */
722      double *coordPtr;           /* Pointer to x and y coordinates. */      double *coordPtr;           /* Pointer to x and y coordinates. */
723  {  {
724      BitmapItem *bmapPtr = (BitmapItem *) itemPtr;      BitmapItem *bmapPtr = (BitmapItem *) itemPtr;
725      double x1, x2, y1, y2, xDiff, yDiff;      double x1, x2, y1, y2, xDiff, yDiff;
726    
727      x1 = bmapPtr->header.x1;      x1 = bmapPtr->header.x1;
728      y1 = bmapPtr->header.y1;      y1 = bmapPtr->header.y1;
729      x2 = bmapPtr->header.x2;      x2 = bmapPtr->header.x2;
730      y2 = bmapPtr->header.y2;      y2 = bmapPtr->header.y2;
731    
732      /*      /*
733       * Point is outside rectangle.       * Point is outside rectangle.
734       */       */
735    
736      if (coordPtr[0] < x1) {      if (coordPtr[0] < x1) {
737          xDiff = x1 - coordPtr[0];          xDiff = x1 - coordPtr[0];
738      } else if (coordPtr[0] > x2)  {      } else if (coordPtr[0] > x2)  {
739          xDiff = coordPtr[0] - x2;          xDiff = coordPtr[0] - x2;
740      } else {      } else {
741          xDiff = 0;          xDiff = 0;
742      }      }
743    
744      if (coordPtr[1] < y1) {      if (coordPtr[1] < y1) {
745          yDiff = y1 - coordPtr[1];          yDiff = y1 - coordPtr[1];
746      } else if (coordPtr[1] > y2)  {      } else if (coordPtr[1] > y2)  {
747          yDiff = coordPtr[1] - y2;          yDiff = coordPtr[1] - y2;
748      } else {      } else {
749          yDiff = 0;          yDiff = 0;
750      }      }
751    
752      return hypot(xDiff, yDiff);      return hypot(xDiff, yDiff);
753  }  }
754    
755  /*  /*
756   *--------------------------------------------------------------   *--------------------------------------------------------------
757   *   *
758   * BitmapToArea --   * BitmapToArea --
759   *   *
760   *      This procedure is called to determine whether an item   *      This procedure is called to determine whether an item
761   *      lies entirely inside, entirely outside, or overlapping   *      lies entirely inside, entirely outside, or overlapping
762   *      a given rectangle.   *      a given rectangle.
763   *   *
764   * Results:   * Results:
765   *      -1 is returned if the item is entirely outside the area   *      -1 is returned if the item is entirely outside the area
766   *      given by rectPtr, 0 if it overlaps, and 1 if it is entirely   *      given by rectPtr, 0 if it overlaps, and 1 if it is entirely
767   *      inside the given area.   *      inside the given area.
768   *   *
769   * Side effects:   * Side effects:
770   *      None.   *      None.
771   *   *
772   *--------------------------------------------------------------   *--------------------------------------------------------------
773   */   */
774    
775          /* ARGSUSED */          /* ARGSUSED */
776  static int  static int
777  BitmapToArea(canvas, itemPtr, rectPtr)  BitmapToArea(canvas, itemPtr, rectPtr)
778      Tk_Canvas canvas;           /* Canvas containing item. */      Tk_Canvas canvas;           /* Canvas containing item. */
779      Tk_Item *itemPtr;           /* Item to check against rectangle. */      Tk_Item *itemPtr;           /* Item to check against rectangle. */
780      double *rectPtr;            /* Pointer to array of four coordinates      double *rectPtr;            /* Pointer to array of four coordinates
781                                   * (x1, y1, x2, y2) describing rectangular                                   * (x1, y1, x2, y2) describing rectangular
782                                   * area.  */                                   * area.  */
783  {  {
784      BitmapItem *bmapPtr = (BitmapItem *) itemPtr;      BitmapItem *bmapPtr = (BitmapItem *) itemPtr;
785    
786      if ((rectPtr[2] <= bmapPtr->header.x1)      if ((rectPtr[2] <= bmapPtr->header.x1)
787              || (rectPtr[0] >= bmapPtr->header.x2)              || (rectPtr[0] >= bmapPtr->header.x2)
788              || (rectPtr[3] <= bmapPtr->header.y1)              || (rectPtr[3] <= bmapPtr->header.y1)
789              || (rectPtr[1] >= bmapPtr->header.y2)) {              || (rectPtr[1] >= bmapPtr->header.y2)) {
790          return -1;          return -1;
791      }      }
792      if ((rectPtr[0] <= bmapPtr->header.x1)      if ((rectPtr[0] <= bmapPtr->header.x1)
793              && (rectPtr[1] <= bmapPtr->header.y1)              && (rectPtr[1] <= bmapPtr->header.y1)
794              && (rectPtr[2] >= bmapPtr->header.x2)              && (rectPtr[2] >= bmapPtr->header.x2)
795              && (rectPtr[3] >= bmapPtr->header.y2)) {              && (rectPtr[3] >= bmapPtr->header.y2)) {
796          return 1;          return 1;
797      }      }
798      return 0;      return 0;
799  }  }
800    
801  /*  /*
802   *--------------------------------------------------------------   *--------------------------------------------------------------
803   *   *
804   * ScaleBitmap --   * ScaleBitmap --
805   *   *
806   *      This procedure is invoked to rescale a bitmap item in a   *      This procedure is invoked to rescale a bitmap item in a
807   *      canvas.  It is one of the standard item procedures for   *      canvas.  It is one of the standard item procedures for
808   *      bitmap items, and is invoked by the generic canvas code.   *      bitmap items, and is invoked by the generic canvas code.
809   *   *
810   * Results:   * Results:
811   *      None.   *      None.
812   *   *
813   * Side effects:   * Side effects:
814   *      The item referred to by itemPtr is rescaled so that the   *      The item referred to by itemPtr is rescaled so that the
815   *      following transformation is applied to all point coordinates:   *      following transformation is applied to all point coordinates:
816   *              x' = originX + scaleX*(x-originX)   *              x' = originX + scaleX*(x-originX)
817   *              y' = originY + scaleY*(y-originY)   *              y' = originY + scaleY*(y-originY)
818   *   *
819   *--------------------------------------------------------------   *--------------------------------------------------------------
820   */   */
821    
822  static void  static void
823  ScaleBitmap(canvas, itemPtr, originX, originY, scaleX, scaleY)  ScaleBitmap(canvas, itemPtr, originX, originY, scaleX, scaleY)
824      Tk_Canvas canvas;                   /* Canvas containing rectangle. */      Tk_Canvas canvas;                   /* Canvas containing rectangle. */
825      Tk_Item *itemPtr;                   /* Rectangle to be scaled. */      Tk_Item *itemPtr;                   /* Rectangle to be scaled. */
826      double originX, originY;            /* Origin about which to scale item. */      double originX, originY;            /* Origin about which to scale item. */
827      double scaleX;                      /* Amount to scale in X direction. */      double scaleX;                      /* Amount to scale in X direction. */
828      double scaleY;                      /* Amount to scale in Y direction. */      double scaleY;                      /* Amount to scale in Y direction. */
829  {  {
830      BitmapItem *bmapPtr = (BitmapItem *) itemPtr;      BitmapItem *bmapPtr = (BitmapItem *) itemPtr;
831    
832      bmapPtr->x = originX + scaleX*(bmapPtr->x - originX);      bmapPtr->x = originX + scaleX*(bmapPtr->x - originX);
833      bmapPtr->y = originY + scaleY*(bmapPtr->y - originY);      bmapPtr->y = originY + scaleY*(bmapPtr->y - originY);
834      ComputeBitmapBbox(canvas, bmapPtr);      ComputeBitmapBbox(canvas, bmapPtr);
835  }  }
836    
837  /*  /*
838   *--------------------------------------------------------------   *--------------------------------------------------------------
839   *   *
840   * TranslateBitmap --   * TranslateBitmap --
841   *   *
842   *      This procedure is called to move an item by a given amount.   *      This procedure is called to move an item by a given amount.
843   *   *
844   * Results:   * Results:
845   *      None.   *      None.
846   *   *
847   * Side effects:   * Side effects:
848   *      The position of the item is offset by (xDelta, yDelta), and   *      The position of the item is offset by (xDelta, yDelta), and
849   *      the bounding box is updated in the generic part of the item   *      the bounding box is updated in the generic part of the item
850   *      structure.   *      structure.
851   *   *
852   *--------------------------------------------------------------   *--------------------------------------------------------------
853   */   */
854    
855  static void  static void
856  TranslateBitmap(canvas, itemPtr, deltaX, deltaY)  TranslateBitmap(canvas, itemPtr, deltaX, deltaY)
857      Tk_Canvas canvas;                   /* Canvas containing item. */      Tk_Canvas canvas;                   /* Canvas containing item. */
858      Tk_Item *itemPtr;                   /* Item that is being moved. */      Tk_Item *itemPtr;                   /* Item that is being moved. */
859      double deltaX, deltaY;              /* Amount by which item is to be      double deltaX, deltaY;              /* Amount by which item is to be
860                                           * moved. */                                           * moved. */
861  {  {
862      BitmapItem *bmapPtr = (BitmapItem *) itemPtr;      BitmapItem *bmapPtr = (BitmapItem *) itemPtr;
863    
864      bmapPtr->x += deltaX;      bmapPtr->x += deltaX;
865      bmapPtr->y += deltaY;      bmapPtr->y += deltaY;
866      ComputeBitmapBbox(canvas, bmapPtr);      ComputeBitmapBbox(canvas, bmapPtr);
867  }  }
868    
869  /*  /*
870   *--------------------------------------------------------------   *--------------------------------------------------------------
871   *   *
872   * BitmapToPostscript --   * BitmapToPostscript --
873   *   *
874   *      This procedure is called to generate Postscript for   *      This procedure is called to generate Postscript for
875   *      bitmap items.   *      bitmap items.
876   *   *
877   * Results:   * Results:
878   *      The return value is a standard Tcl result.  If an error   *      The return value is a standard Tcl result.  If an error
879   *      occurs in generating Postscript then an error message is   *      occurs in generating Postscript then an error message is
880   *      left in the interp's result, replacing whatever used to be there.   *      left in the interp's result, replacing whatever used to be there.
881   *      If no error occurs, then Postscript for the item is appended   *      If no error occurs, then Postscript for the item is appended
882   *      to the result.   *      to the result.
883   *   *
884   * Side effects:   * Side effects:
885   *      None.   *      None.
886   *   *
887   *--------------------------------------------------------------   *--------------------------------------------------------------
888   */   */
889    
890  static int  static int
891  BitmapToPostscript(interp, canvas, itemPtr, prepass)  BitmapToPostscript(interp, canvas, itemPtr, prepass)
892      Tcl_Interp *interp;                 /* Leave Postscript or error message      Tcl_Interp *interp;                 /* Leave Postscript or error message
893                                           * here. */                                           * here. */
894      Tk_Canvas canvas;                   /* Information about overall canvas. */      Tk_Canvas canvas;                   /* Information about overall canvas. */
895      Tk_Item *itemPtr;                   /* Item for which Postscript is      Tk_Item *itemPtr;                   /* Item for which Postscript is
896                                           * wanted. */                                           * wanted. */
897      int prepass;                        /* 1 means this is a prepass to      int prepass;                        /* 1 means this is a prepass to
898                                           * collect font information;  0 means                                           * collect font information;  0 means
899                                           * final Postscript is being created. */                                           * final Postscript is being created. */
900  {  {
901      BitmapItem *bmapPtr = (BitmapItem *) itemPtr;      BitmapItem *bmapPtr = (BitmapItem *) itemPtr;
902      double x, y;      double x, y;
903      int width, height, rowsAtOnce, rowsThisTime;      int width, height, rowsAtOnce, rowsThisTime;
904      int curRow;      int curRow;
905      char buffer[100 + TCL_DOUBLE_SPACE * 2 + TCL_INTEGER_SPACE * 4];      char buffer[100 + TCL_DOUBLE_SPACE * 2 + TCL_INTEGER_SPACE * 4];
906    
907      if (bmapPtr->bitmap == None) {      if (bmapPtr->bitmap == None) {
908          return TCL_OK;          return TCL_OK;
909      }      }
910    
911      /*      /*
912       * Compute the coordinates of the lower-left corner of the bitmap,       * Compute the coordinates of the lower-left corner of the bitmap,
913       * taking into account the anchor position for the bitmp.       * taking into account the anchor position for the bitmp.
914       */       */
915    
916      x = bmapPtr->x;      x = bmapPtr->x;
917      y = Tk_CanvasPsY(canvas, bmapPtr->y);      y = Tk_CanvasPsY(canvas, bmapPtr->y);
918      Tk_SizeOfBitmap(Tk_Display(Tk_CanvasTkwin(canvas)), bmapPtr->bitmap,      Tk_SizeOfBitmap(Tk_Display(Tk_CanvasTkwin(canvas)), bmapPtr->bitmap,
919              &width, &height);              &width, &height);
920      switch (bmapPtr->anchor) {      switch (bmapPtr->anchor) {
921          case TK_ANCHOR_NW:                      y -= height;            break;          case TK_ANCHOR_NW:                      y -= height;            break;
922          case TK_ANCHOR_N:       x -= width/2.0; y -= height;            break;          case TK_ANCHOR_N:       x -= width/2.0; y -= height;            break;
923          case TK_ANCHOR_NE:      x -= width;     y -= height;            break;          case TK_ANCHOR_NE:      x -= width;     y -= height;            break;
924          case TK_ANCHOR_E:       x -= width;     y -= height/2.0;        break;          case TK_ANCHOR_E:       x -= width;     y -= height/2.0;        break;
925          case TK_ANCHOR_SE:      x -= width;                             break;          case TK_ANCHOR_SE:      x -= width;                             break;
926          case TK_ANCHOR_S:       x -= width/2.0;                         break;          case TK_ANCHOR_S:       x -= width/2.0;                         break;
927          case TK_ANCHOR_SW:                                              break;          case TK_ANCHOR_SW:                                              break;
928          case TK_ANCHOR_W:                       y -= height/2.0;        break;          case TK_ANCHOR_W:                       y -= height/2.0;        break;
929          case TK_ANCHOR_CENTER:  x -= width/2.0; y -= height/2.0;        break;          case TK_ANCHOR_CENTER:  x -= width/2.0; y -= height/2.0;        break;
930      }      }
931    
932      /*      /*
933       * Color the background, if there is one.       * Color the background, if there is one.
934       */       */
935    
936      if (bmapPtr->bgColor != NULL) {      if (bmapPtr->bgColor != NULL) {
937          sprintf(buffer,          sprintf(buffer,
938                  "%.15g %.15g moveto %d 0 rlineto 0 %d rlineto %d %s\n",                  "%.15g %.15g moveto %d 0 rlineto 0 %d rlineto %d %s\n",
939                  x, y, width, height, -width, "0 rlineto closepath");                  x, y, width, height, -width, "0 rlineto closepath");
940          Tcl_AppendResult(interp, buffer, (char *) NULL);          Tcl_AppendResult(interp, buffer, (char *) NULL);
941          if (Tk_CanvasPsColor(interp, canvas, bmapPtr->bgColor) != TCL_OK) {          if (Tk_CanvasPsColor(interp, canvas, bmapPtr->bgColor) != TCL_OK) {
942              return TCL_ERROR;              return TCL_ERROR;
943          }          }
944          Tcl_AppendResult(interp, "fill\n", (char *) NULL);          Tcl_AppendResult(interp, "fill\n", (char *) NULL);
945      }      }
946    
947      /*      /*
948       * Draw the bitmap, if there is a foreground color.  If the bitmap       * Draw the bitmap, if there is a foreground color.  If the bitmap
949       * is very large, then chop it up into multiple bitmaps, each       * is very large, then chop it up into multiple bitmaps, each
950       * consisting of one or more rows.  This is needed because Postscript       * consisting of one or more rows.  This is needed because Postscript
951       * can't handle single strings longer than 64 KBytes long.       * can't handle single strings longer than 64 KBytes long.
952       */       */
953    
954      if (bmapPtr->fgColor != NULL) {      if (bmapPtr->fgColor != NULL) {
955          if (Tk_CanvasPsColor(interp, canvas, bmapPtr->fgColor) != TCL_OK) {          if (Tk_CanvasPsColor(interp, canvas, bmapPtr->fgColor) != TCL_OK) {
956              return TCL_ERROR;              return TCL_ERROR;
957          }          }
958          if (width > 60000) {          if (width > 60000) {
959              Tcl_ResetResult(interp);              Tcl_ResetResult(interp);
960              Tcl_AppendResult(interp, "can't generate Postscript",              Tcl_AppendResult(interp, "can't generate Postscript",
961                      " for bitmaps more than 60000 pixels wide",                      " for bitmaps more than 60000 pixels wide",
962                      (char *) NULL);                      (char *) NULL);
963              return TCL_ERROR;              return TCL_ERROR;
964          }          }
965          rowsAtOnce = 60000/width;          rowsAtOnce = 60000/width;
966          if (rowsAtOnce < 1) {          if (rowsAtOnce < 1) {
967              rowsAtOnce = 1;              rowsAtOnce = 1;
968          }          }
969          sprintf(buffer, "%.15g %.15g translate\n", x, y+height);          sprintf(buffer, "%.15g %.15g translate\n", x, y+height);
970          Tcl_AppendResult(interp, buffer, (char *) NULL);          Tcl_AppendResult(interp, buffer, (char *) NULL);
971          for (curRow = 0; curRow < height; curRow += rowsAtOnce) {          for (curRow = 0; curRow < height; curRow += rowsAtOnce) {
972              rowsThisTime = rowsAtOnce;              rowsThisTime = rowsAtOnce;
973              if (rowsThisTime > (height - curRow)) {              if (rowsThisTime > (height - curRow)) {
974                  rowsThisTime = height - curRow;                  rowsThisTime = height - curRow;
975              }              }
976              sprintf(buffer, "0 -%.15g translate\n%d %d true matrix {\n",              sprintf(buffer, "0 -%.15g translate\n%d %d true matrix {\n",
977                      (double) rowsThisTime, width, rowsThisTime);                      (double) rowsThisTime, width, rowsThisTime);
978              Tcl_AppendResult(interp, buffer, (char *) NULL);              Tcl_AppendResult(interp, buffer, (char *) NULL);
979              if (Tk_CanvasPsBitmap(interp, canvas, bmapPtr->bitmap,              if (Tk_CanvasPsBitmap(interp, canvas, bmapPtr->bitmap,
980                      0, curRow, width, rowsThisTime) != TCL_OK) {                      0, curRow, width, rowsThisTime) != TCL_OK) {
981                  return TCL_ERROR;                  return TCL_ERROR;
982              }              }
983              Tcl_AppendResult(interp, "\n} imagemask\n", (char *) NULL);              Tcl_AppendResult(interp, "\n} imagemask\n", (char *) NULL);
984          }          }
985      }      }
986      return TCL_OK;      return TCL_OK;
987  }  }
988    
989  /* End of tkcanvbmap.c */  /* End of tkcanvbmap.c */

Legend:
Removed from v.69  
changed lines
  Added in v.71

dashley@gmail.com
ViewVC Help
Powered by ViewVC 1.1.25