Changeset 2558 for branches/blt4/gui


Ignore:
Timestamp:
Sep 21, 2011, 9:37:11 PM (13 years ago)
Author:
gah
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/blt4/gui/src/RpCanvPlacard.c

    r2227 r2558  
    211211
    212212/*
     213 * The record below describes a canvas widget.  It is made available
     214 * to the item procedures so they can access certain shared fields such
     215 * as the overall displacement and scale factor for the canvas.
     216 */
     217
     218typedef struct TkCanvas {
     219    Tk_Window tkwin;            /* Window that embodies the canvas.  NULL
     220                                 * means that the window has been destroyed
     221                                 * but the data structures haven't yet been
     222                                 * cleaned up.*/
     223    Display *display;           /* Display containing widget;  needed, among
     224                                 * other things, to release resources after
     225                                 * tkwin has already gone away. */
     226    Tcl_Interp *interp;         /* Interpreter associated with canvas. */
     227    Tcl_Command widgetCmd;      /* Token for canvas's widget command. */
     228    Tk_Item *firstItemPtr;      /* First in list of all items in canvas,
     229                                 * or NULL if canvas empty. */
     230    Tk_Item *lastItemPtr;       /* Last in list of all items in canvas,
     231                                 * or NULL if canvas empty. */
     232
     233    /*
     234     * Information used when displaying widget:
     235     */
     236
     237    int borderWidth;            /* Width of 3-D border around window. */
     238    Tk_3DBorder bgBorder;       /* Used for canvas background. */
     239    int relief;                 /* Indicates whether window as a whole is
     240                                 * raised, sunken, or flat. */
     241    int highlightWidth;         /* Width in pixels of highlight to draw
     242                                 * around widget when it has the focus.
     243                                 * <= 0 means don't draw a highlight. */
     244    XColor *highlightBgColorPtr;
     245                                /* Color for drawing traversal highlight
     246                                 * area when highlight is off. */
     247    XColor *highlightColorPtr;  /* Color for drawing traversal highlight. */
     248    int inset;                  /* Total width of all borders, including
     249                                 * traversal highlight and 3-D border.
     250                                 * Indicates how much interior stuff must
     251                                 * be offset from outside edges to leave
     252                                 * room for borders. */
     253    GC pixmapGC;                /* Used to copy bits from a pixmap to the
     254                                 * screen and also to clear the pixmap. */
     255    int width, height;          /* Dimensions to request for canvas window,
     256                                 * specified in pixels. */
     257    int redrawX1, redrawY1;     /* Upper left corner of area to redraw,
     258                                 * in pixel coordinates.  Border pixels
     259                                 * are included.  Only valid if
     260                                 * REDRAW_PENDING flag is set. */
     261    int redrawX2, redrawY2;     /* Lower right corner of area to redraw,
     262                                 * in integer canvas coordinates.  Border
     263                                 * pixels will *not* be redrawn. */
     264    int confine;                /* Non-zero means constrain view to keep
     265                                 * as much of canvas visible as possible. */
     266
     267    /*
     268     * Information used to manage the selection and insertion cursor:
     269     */
     270
     271    Tk_CanvasTextInfo textInfo; /* Contains lots of fields;  see tk.h for
     272                                 * details.  This structure is shared with
     273                                 * the code that implements individual items. */
     274    int insertOnTime;           /* Number of milliseconds cursor should spend
     275                                 * in "on" state for each blink. */
     276    int insertOffTime;          /* Number of milliseconds cursor should spend
     277                                 * in "off" state for each blink. */
     278    Tcl_TimerToken insertBlinkHandler;
     279                                /* Timer handler used to blink cursor on and
     280                                 * off. */
     281
     282    /*
     283     * Transformation applied to canvas as a whole:  to compute screen
     284     * coordinates (X,Y) from canvas coordinates (x,y), do the following:
     285     *
     286     * X = x - xOrigin;
     287     * Y = y - yOrigin;
     288     */
     289
     290    int xOrigin, yOrigin;       /* Canvas coordinates corresponding to
     291                                 * upper-left corner of window, given in
     292                                 * canvas pixel units. */
     293    int drawableXOrigin, drawableYOrigin;
     294                                /* During redisplay, these fields give the
     295                                 * canvas coordinates corresponding to
     296                                 * the upper-left corner of the drawable
     297                                 * where items are actually being drawn
     298                                 * (typically a pixmap smaller than the
     299                                 * whole window). */
     300
     301    /*
     302     * Information used for event bindings associated with items.
     303     */
     304
     305    Tk_BindingTable bindingTable;
     306                                /* Table of all bindings currently defined
     307                                 * for this canvas.  NULL means that no
     308                                 * bindings exist, so the table hasn't been
     309                                 * created.  Each "object" used for this
     310                                 * table is either a Tk_Uid for a tag or
     311                                 * the address of an item named by id. */
     312    Tk_Item *currentItemPtr;    /* The item currently containing the mouse
     313                                 * pointer, or NULL if none. */
     314    Tk_Item *newCurrentPtr;     /* The item that is about to become the
     315                                 * current one, or NULL.  This field is
     316                                 * used to detect deletions  of the new
     317                                 * current item pointer that occur during
     318                                 * Leave processing of the previous current
     319                                 * item.  */
     320    double closeEnough;         /* The mouse is assumed to be inside an
     321                                 * item if it is this close to it. */
     322    XEvent pickEvent;           /* The event upon which the current choice
     323                                 * of currentItem is based.  Must be saved
     324                                 * so that if the currentItem is deleted,
     325                                 * can pick another. */
     326    int state;                  /* Last known modifier state.  Used to
     327                                 * defer picking a new current object
     328                                 * while buttons are down. */
     329
     330    /*
     331     * Information used for managing scrollbars:
     332     */
     333
     334    char *xScrollCmd;           /* Command prefix for communicating with
     335                                 * horizontal scrollbar.  NULL means no
     336                                 * horizontal scrollbar.  Malloc'ed*/
     337    char *yScrollCmd;           /* Command prefix for communicating with
     338                                 * vertical scrollbar.  NULL means no
     339                                 * vertical scrollbar.  Malloc'ed*/
     340    int scrollX1, scrollY1, scrollX2, scrollY2;
     341                                /* These four coordinates define the region
     342                                 * that is the 100% area for scrolling (i.e.
     343                                 * these numbers determine the size and
     344                                 * location of the sliders on scrollbars).
     345                                 * Units are pixels in canvas coords. */
     346    char *regionString;         /* The option string from which scrollX1
     347                                 * etc. are derived.  Malloc'ed. */
     348    int xScrollIncrement;       /* If >0, defines a grid for horizontal
     349                                 * scrolling.  This is the size of the "unit",
     350                                 * and the left edge of the screen will always
     351                                 * lie on an even unit boundary. */
     352    int yScrollIncrement;       /* If >0, defines a grid for horizontal
     353                                 * scrolling.  This is the size of the "unit",
     354                                 * and the left edge of the screen will always
     355                                 * lie on an even unit boundary. */
     356
     357    /*
     358     * Information used for scanning:
     359     */
     360
     361    int scanX;                  /* X-position at which scan started (e.g.
     362                                 * button was pressed here). */
     363    int scanXOrigin;            /* Value of xOrigin field when scan started. */
     364    int scanY;                  /* Y-position at which scan started (e.g.
     365                                 * button was pressed here). */
     366    int scanYOrigin;            /* Value of yOrigin field when scan started. */
     367
     368    /*
     369     * Information used to speed up searches by remembering the last item
     370     * created or found with an item id search.
     371     */
     372
     373    Tk_Item *hotPtr;            /* Pointer to "hot" item (one that's been
     374                                 * recently used.  NULL means there's no
     375                                 * hot item. */
     376    Tk_Item *hotPrevPtr;        /* Pointer to predecessor to hotPtr (NULL
     377                                 * means item is first in list).  This is
     378                                 * only a hint and may not really be hotPtr's
     379                                 * predecessor. */
     380
     381    /*
     382     * Miscellaneous information:
     383     */
     384
     385    Tk_Cursor cursor;           /* Current cursor for window, or None. */
     386    char *takeFocus;            /* Value of -takefocus option;  not used in
     387                                 * the C code, but used by keyboard traversal
     388                                 * scripts.  Malloc'ed, but may be NULL. */
     389    double pixelsPerMM;         /* Scale factor between MM and pixels;
     390                                 * used when converting coordinates. */
     391    int flags;                  /* Various flags;  see below for
     392                                 * definitions. */
     393    int nextId;                 /* Number to use as id for next item
     394                                 * created in widget. */
     395    Tk_PostscriptInfo psInfo;
     396                                /* Pointer to information used for generating
     397                                 * Postscript for the canvas.  NULL means
     398                                 * no Postscript is currently being
     399                                 * generated. */
     400    Tcl_HashTable idTable;      /* Table of integer indices. */
     401    /*
     402     * Additional information, added by the 'dash'-patch
     403     */
     404    VOID *reserved1;
     405    Tk_State canvas_state;      /* state of canvas */
     406    VOID *reserved2;
     407    VOID *reserved3;
     408    Tk_TSOffset tsoffset;
     409#ifndef USE_OLD_TAG_SEARCH
     410    void *bindTagExprs; /* linked list of tag expressions used in bindings */
     411#endif
     412} TkCanvas;
     413
     414
     415/*
    213416 * ------------------------------------------------------------------------
    214417 *  RpCanvPlacard_Init --
     
    10831286{
    10841287    PlacardItem *plPtr = (PlacardItem *) itemPtr;
    1085 #ifdef notdef
    10861288    Tk_Window canvasWin = Tk_CanvasTkwin(canvas);
    1087 #endif
     1289
    10881290    int x, y;
    10891291    double xpos;
     
    11201322        Tcl_AppendResult(interp, buffer, " translate\n", (char *) NULL);
    11211323      }
    1122 #ifdef notdef
     1324
    11231325      Tk_PostscriptImage(plPtr->imageLeft, interp, canvasWin,
    11241326                         ((TkCanvas*)canvas)->psInfo, 0, 0,
    11251327                         plPtr->imageLeftW, plPtr->imageLeftH, prepass);
    1126 #endif
     1328
    11271329      if ( !prepass ) {
    11281330        /*
Note: See TracChangeset for help on using the changeset viewer.