/[dtapublic]/projs/ets/trunk/src/c_tk_base_7_5_w_mods/tkscrollbar.h
ViewVC logotype

Diff of /projs/ets/trunk/src/c_tk_base_7_5_w_mods/tkscrollbar.h

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   * tkScrollbar.h --   * tkScrollbar.h --
5   *   *
6   *      Declarations of types and functions used to implement   *      Declarations of types and functions used to implement
7   *      the scrollbar widget.   *      the scrollbar widget.
8   *   *
9   * Copyright (c) 1996 by Sun Microsystems, Inc.   * Copyright (c) 1996 by 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: tkscrollbar.h,v 1.1.1.1 2001/06/13 05:07:54 dtashley Exp $   * RCS: @(#) $Id: tkscrollbar.h,v 1.1.1.1 2001/06/13 05:07:54 dtashley Exp $
15   */   */
16    
17  #ifndef _TKSCROLLBAR  #ifndef _TKSCROLLBAR
18  #define _TKSCROLLBAR  #define _TKSCROLLBAR
19    
20  #ifndef _TKINT  #ifndef _TKINT
21  #include "tkInt.h"  #include "tkInt.h"
22  #endif  #endif
23    
24  #ifdef BUILD_tk  #ifdef BUILD_tk
25  # undef TCL_STORAGE_CLASS  # undef TCL_STORAGE_CLASS
26  # define TCL_STORAGE_CLASS DLLEXPORT  # define TCL_STORAGE_CLASS DLLEXPORT
27  #endif  #endif
28    
29  /*  /*
30   * A data structure of the following type is kept for each scrollbar   * A data structure of the following type is kept for each scrollbar
31   * widget.   * widget.
32   */   */
33    
34  typedef struct TkScrollbar {  typedef struct TkScrollbar {
35      Tk_Window tkwin;            /* Window that embodies the scrollbar.  NULL      Tk_Window tkwin;            /* Window that embodies the scrollbar.  NULL
36                                   * means that the window has been destroyed                                   * means that the window has been destroyed
37                                   * but the data structures haven't yet been                                   * but the data structures haven't yet been
38                                   * cleaned up.*/                                   * cleaned up.*/
39      Display *display;           /* Display containing widget.  Used, among      Display *display;           /* Display containing widget.  Used, among
40                                   * other things, so that resources can be                                   * other things, so that resources can be
41                                   * freed even after tkwin has gone away. */                                   * freed even after tkwin has gone away. */
42      Tcl_Interp *interp;         /* Interpreter associated with scrollbar. */      Tcl_Interp *interp;         /* Interpreter associated with scrollbar. */
43      Tcl_Command widgetCmd;      /* Token for scrollbar's widget command. */      Tcl_Command widgetCmd;      /* Token for scrollbar's widget command. */
44      int vertical;               /* Non-zero means vertical orientation      int vertical;               /* Non-zero means vertical orientation
45                                   * requested, zero means horizontal. */                                   * requested, zero means horizontal. */
46      int width;                  /* Desired narrow dimension of scrollbar,      int width;                  /* Desired narrow dimension of scrollbar,
47                                   * in pixels. */                                   * in pixels. */
48      char *command;              /* Command prefix to use when invoking      char *command;              /* Command prefix to use when invoking
49                                   * scrolling commands.  NULL means don't                                   * scrolling commands.  NULL means don't
50                                   * invoke commands.  Malloc'ed. */                                   * invoke commands.  Malloc'ed. */
51      int commandSize;            /* Number of non-NULL bytes in command. */      int commandSize;            /* Number of non-NULL bytes in command. */
52      int repeatDelay;            /* How long to wait before auto-repeating      int repeatDelay;            /* How long to wait before auto-repeating
53                                   * on scrolling actions (in ms). */                                   * on scrolling actions (in ms). */
54      int repeatInterval;         /* Interval between autorepeats (in ms). */      int repeatInterval;         /* Interval between autorepeats (in ms). */
55      int jump;                   /* Value of -jump option. */      int jump;                   /* Value of -jump option. */
56    
57      /*      /*
58       * Information used when displaying widget:       * Information used when displaying widget:
59       */       */
60    
61      int borderWidth;            /* Width of 3-D borders. */      int borderWidth;            /* Width of 3-D borders. */
62      Tk_3DBorder bgBorder;       /* Used for drawing background (all flat      Tk_3DBorder bgBorder;       /* Used for drawing background (all flat
63                                   * surfaces except for trough). */                                   * surfaces except for trough). */
64      Tk_3DBorder activeBorder;   /* For drawing backgrounds when active (i.e.      Tk_3DBorder activeBorder;   /* For drawing backgrounds when active (i.e.
65                                   * when mouse is positioned over element). */                                   * when mouse is positioned over element). */
66      XColor *troughColorPtr;     /* Color for drawing trough. */      XColor *troughColorPtr;     /* Color for drawing trough. */
67      int relief;                 /* Indicates whether window as a whole is      int relief;                 /* Indicates whether window as a whole is
68                                   * raised, sunken, or flat. */                                   * raised, sunken, or flat. */
69      int highlightWidth;         /* Width in pixels of highlight to draw      int highlightWidth;         /* Width in pixels of highlight to draw
70                                   * around widget when it has the focus.                                   * around widget when it has the focus.
71                                   * <= 0 means don't draw a highlight. */                                   * <= 0 means don't draw a highlight. */
72      XColor *highlightBgColorPtr;      XColor *highlightBgColorPtr;
73                                  /* Color for drawing traversal highlight                                  /* Color for drawing traversal highlight
74                                   * area when highlight is off. */                                   * area when highlight is off. */
75      XColor *highlightColorPtr;  /* Color for drawing traversal highlight. */      XColor *highlightColorPtr;  /* Color for drawing traversal highlight. */
76      int inset;                  /* Total width of all borders, including      int inset;                  /* Total width of all borders, including
77                                   * traversal highlight and 3-D border.                                   * traversal highlight and 3-D border.
78                                   * Indicates how much interior stuff must                                   * Indicates how much interior stuff must
79                                   * be offset from outside edges to leave                                   * be offset from outside edges to leave
80                                   * room for borders. */                                   * room for borders. */
81      int elementBorderWidth;     /* Width of border to draw around elements      int elementBorderWidth;     /* Width of border to draw around elements
82                                   * inside scrollbar (arrows and slider).                                   * inside scrollbar (arrows and slider).
83                                   * -1 means use borderWidth. */                                   * -1 means use borderWidth. */
84      int arrowLength;            /* Length of arrows along long dimension of      int arrowLength;            /* Length of arrows along long dimension of
85                                   * scrollbar, including space for a small gap                                   * scrollbar, including space for a small gap
86                                   * between the arrow and the slider.                                   * between the arrow and the slider.
87                                   * Recomputed on window size changes. */                                   * Recomputed on window size changes. */
88      int sliderFirst;            /* Pixel coordinate of top or left edge      int sliderFirst;            /* Pixel coordinate of top or left edge
89                                   * of slider area, including border. */                                   * of slider area, including border. */
90      int sliderLast;             /* Coordinate of pixel just after bottom      int sliderLast;             /* Coordinate of pixel just after bottom
91                                   * or right edge of slider area, including                                   * or right edge of slider area, including
92                                   * border. */                                   * border. */
93      int activeField;            /* Names field to be displayed in active      int activeField;            /* Names field to be displayed in active
94                                   * colors, such as TOP_ARROW, or 0 for                                   * colors, such as TOP_ARROW, or 0 for
95                                   * no field. */                                   * no field. */
96      int activeRelief;           /* Value of -activeRelief option: relief      int activeRelief;           /* Value of -activeRelief option: relief
97                                   * to use for active element. */                                   * to use for active element. */
98    
99      /*      /*
100       * Information describing the application related to the scrollbar.       * Information describing the application related to the scrollbar.
101       * This information is provided by the application by invoking the       * This information is provided by the application by invoking the
102       * "set" widget command.  This information can now be provided in       * "set" widget command.  This information can now be provided in
103       * two ways:  the "old" form (totalUnits, windowUnits, firstUnit,       * two ways:  the "old" form (totalUnits, windowUnits, firstUnit,
104       * and lastUnit), or the "new" form (firstFraction and lastFraction).       * and lastUnit), or the "new" form (firstFraction and lastFraction).
105       * FirstFraction and lastFraction will always be valid, but       * FirstFraction and lastFraction will always be valid, but
106       * the old-style information is only valid if the NEW_STYLE_COMMANDS       * the old-style information is only valid if the NEW_STYLE_COMMANDS
107       * flag is 0.       * flag is 0.
108       */       */
109    
110      int totalUnits;             /* Total dimension of application, in      int totalUnits;             /* Total dimension of application, in
111                                   * units.  Valid only if the NEW_STYLE_COMMANDS                                   * units.  Valid only if the NEW_STYLE_COMMANDS
112                                   * flag isn't set. */                                   * flag isn't set. */
113      int windowUnits;            /* Maximum number of units that can be      int windowUnits;            /* Maximum number of units that can be
114                                   * displayed in the window at once.  Valid                                   * displayed in the window at once.  Valid
115                                   * only if the NEW_STYLE_COMMANDS flag isn't                                   * only if the NEW_STYLE_COMMANDS flag isn't
116                                   * set. */                                   * set. */
117      int firstUnit;              /* Number of last unit visible in      int firstUnit;              /* Number of last unit visible in
118                                   * application's window.  Valid only if the                                   * application's window.  Valid only if the
119                                   * NEW_STYLE_COMMANDS flag isn't set. */                                   * NEW_STYLE_COMMANDS flag isn't set. */
120      int lastUnit;               /* Index of last unit visible in window.      int lastUnit;               /* Index of last unit visible in window.
121                                   * Valid only if the NEW_STYLE_COMMANDS                                   * Valid only if the NEW_STYLE_COMMANDS
122                                   * flag isn't set. */                                   * flag isn't set. */
123      double firstFraction;       /* Position of first visible thing in window,      double firstFraction;       /* Position of first visible thing in window,
124                                   * specified as a fraction between 0 and                                   * specified as a fraction between 0 and
125                                   * 1.0. */                                   * 1.0. */
126      double lastFraction;        /* Position of last visible thing in window,      double lastFraction;        /* Position of last visible thing in window,
127                                   * specified as a fraction between 0 and                                   * specified as a fraction between 0 and
128                                   * 1.0. */                                   * 1.0. */
129    
130      /*      /*
131       * Miscellaneous information:       * Miscellaneous information:
132       */       */
133    
134      Tk_Cursor cursor;           /* Current cursor for window, or None. */      Tk_Cursor cursor;           /* Current cursor for window, or None. */
135      char *takeFocus;            /* Value of -takefocus option;  not used in      char *takeFocus;            /* Value of -takefocus option;  not used in
136                                   * the C code, but used by keyboard traversal                                   * the C code, but used by keyboard traversal
137                                   * scripts.  Malloc'ed, but may be NULL. */                                   * scripts.  Malloc'ed, but may be NULL. */
138      int flags;                  /* Various flags;  see below for      int flags;                  /* Various flags;  see below for
139                                   * definitions. */                                   * definitions. */
140  } TkScrollbar;  } TkScrollbar;
141    
142  /*  /*
143   * Legal values for "activeField" field of Scrollbar structures.  These   * Legal values for "activeField" field of Scrollbar structures.  These
144   * are also the return values from the ScrollbarPosition procedure.   * are also the return values from the ScrollbarPosition procedure.
145   */   */
146    
147  #define OUTSIDE         0  #define OUTSIDE         0
148  #define TOP_ARROW       1  #define TOP_ARROW       1
149  #define TOP_GAP         2  #define TOP_GAP         2
150  #define SLIDER          3  #define SLIDER          3
151  #define BOTTOM_GAP      4  #define BOTTOM_GAP      4
152  #define BOTTOM_ARROW    5  #define BOTTOM_ARROW    5
153    
154  /*  /*
155   * Flag bits for scrollbars:   * Flag bits for scrollbars:
156   *   *
157   * REDRAW_PENDING:              Non-zero means a DoWhenIdle handler   * REDRAW_PENDING:              Non-zero means a DoWhenIdle handler
158   *                              has already been queued to redraw   *                              has already been queued to redraw
159   *                              this window.   *                              this window.
160   * NEW_STYLE_COMMANDS:          Non-zero means the new style of commands   * NEW_STYLE_COMMANDS:          Non-zero means the new style of commands
161   *                              should be used to communicate with the   *                              should be used to communicate with the
162   *                              widget:  ".t yview scroll 2 lines", instead   *                              widget:  ".t yview scroll 2 lines", instead
163   *                              of ".t yview 40", for example.   *                              of ".t yview 40", for example.
164   * GOT_FOCUS:                   Non-zero means this window has the input   * GOT_FOCUS:                   Non-zero means this window has the input
165   *                              focus.   *                              focus.
166   */   */
167    
168  #define REDRAW_PENDING          1  #define REDRAW_PENDING          1
169  #define NEW_STYLE_COMMANDS      2  #define NEW_STYLE_COMMANDS      2
170  #define GOT_FOCUS               4  #define GOT_FOCUS               4
171    
172  /*  /*
173   * Declaration of scrollbar class procedures structure.   * Declaration of scrollbar class procedures structure.
174   */   */
175    
176  extern TkClassProcs tkpScrollbarProcs;  extern TkClassProcs tkpScrollbarProcs;
177    
178  /*  /*
179   * Declaration of scrollbar configuration options.   * Declaration of scrollbar configuration options.
180   */   */
181    
182  extern Tk_ConfigSpec tkpScrollbarConfigSpecs[];  extern Tk_ConfigSpec tkpScrollbarConfigSpecs[];
183    
184  /*  /*
185   * Declaration of procedures used in the implementation of the scrollbar   * Declaration of procedures used in the implementation of the scrollbar
186   * widget.   * widget.
187   */   */
188    
189  extern void             TkScrollbarEventProc _ANSI_ARGS_((  extern void             TkScrollbarEventProc _ANSI_ARGS_((
190                              ClientData clientData, XEvent *eventPtr));                              ClientData clientData, XEvent *eventPtr));
191  extern void             TkScrollbarEventuallyRedraw _ANSI_ARGS_((  extern void             TkScrollbarEventuallyRedraw _ANSI_ARGS_((
192                              TkScrollbar *scrollPtr));                              TkScrollbar *scrollPtr));
193  extern void             TkpComputeScrollbarGeometry _ANSI_ARGS_((  extern void             TkpComputeScrollbarGeometry _ANSI_ARGS_((
194                              TkScrollbar *scrollPtr));                              TkScrollbar *scrollPtr));
195  extern TkScrollbar *    TkpCreateScrollbar _ANSI_ARGS_((Tk_Window tkwin));  extern TkScrollbar *    TkpCreateScrollbar _ANSI_ARGS_((Tk_Window tkwin));
196  extern void             TkpDestroyScrollbar _ANSI_ARGS_((  extern void             TkpDestroyScrollbar _ANSI_ARGS_((
197                              TkScrollbar *scrollPtr));                              TkScrollbar *scrollPtr));
198  extern void             TkpDisplayScrollbar _ANSI_ARGS_((  extern void             TkpDisplayScrollbar _ANSI_ARGS_((
199                              ClientData clientData));                              ClientData clientData));
200  extern void             TkpConfigureScrollbar _ANSI_ARGS_((  extern void             TkpConfigureScrollbar _ANSI_ARGS_((
201                              TkScrollbar *scrollPtr));                              TkScrollbar *scrollPtr));
202  extern int              TkpScrollbarPosition _ANSI_ARGS_((  extern int              TkpScrollbarPosition _ANSI_ARGS_((
203                              TkScrollbar *scrollPtr, int x, int y));                              TkScrollbar *scrollPtr, int x, int y));
204    
205  # undef TCL_STORAGE_CLASS  # undef TCL_STORAGE_CLASS
206  # define TCL_STORAGE_CLASS DLLIMPORT  # define TCL_STORAGE_CLASS DLLIMPORT
207    
208  #endif /* _TKSCROLLBAR */  #endif /* _TKSCROLLBAR */
209    
210  /* End of tkscrollbar.h */  /* End of tkscrollbar.h */

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

dashley@gmail.com
ViewVC Help
Powered by ViewVC 1.1.25