OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [tags/] [start/] [insight/] [tk/] [generic/] [tkScrollbar.h] - Diff between revs 579 and 1765

Go to most recent revision | Only display areas with differences | Details | Blame | View Log

Rev 579 Rev 1765
/*
/*
 * tkScrollbar.h --
 * tkScrollbar.h --
 *
 *
 *      Declarations of types and functions used to implement
 *      Declarations of types and functions used to implement
 *      the scrollbar widget.
 *      the scrollbar widget.
 *
 *
 * Copyright (c) 1996 by Sun Microsystems, Inc.
 * Copyright (c) 1996 by Sun Microsystems, Inc.
 *
 *
 * See the file "license.terms" for information on usage and redistribution
 * See the file "license.terms" for information on usage and redistribution
 * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
 * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
 *
 *
 * RCS: @(#) $Id: tkScrollbar.h,v 1.1.1.1 2002-01-16 10:25:52 markom Exp $
 * RCS: @(#) $Id: tkScrollbar.h,v 1.1.1.1 2002-01-16 10:25:52 markom Exp $
 */
 */
 
 
#ifndef _TKSCROLLBAR
#ifndef _TKSCROLLBAR
#define _TKSCROLLBAR
#define _TKSCROLLBAR
 
 
#ifndef _TKINT
#ifndef _TKINT
#include "tkInt.h"
#include "tkInt.h"
#endif
#endif
 
 
#ifdef BUILD_tk
#ifdef BUILD_tk
# undef TCL_STORAGE_CLASS
# undef TCL_STORAGE_CLASS
# define TCL_STORAGE_CLASS DLLEXPORT
# define TCL_STORAGE_CLASS DLLEXPORT
#endif
#endif
 
 
/*
/*
 * A data structure of the following type is kept for each scrollbar
 * A data structure of the following type is kept for each scrollbar
 * widget.
 * widget.
 */
 */
 
 
typedef struct TkScrollbar {
typedef struct TkScrollbar {
    Tk_Window tkwin;            /* Window that embodies the scrollbar.  NULL
    Tk_Window tkwin;            /* Window that embodies the scrollbar.  NULL
                                 * means that the window has been destroyed
                                 * means that the window has been destroyed
                                 * but the data structures haven't yet been
                                 * but the data structures haven't yet been
                                 * cleaned up.*/
                                 * cleaned up.*/
    Display *display;           /* Display containing widget.  Used, among
    Display *display;           /* Display containing widget.  Used, among
                                 * other things, so that resources can be
                                 * other things, so that resources can be
                                 * freed even after tkwin has gone away. */
                                 * freed even after tkwin has gone away. */
    Tcl_Interp *interp;         /* Interpreter associated with scrollbar. */
    Tcl_Interp *interp;         /* Interpreter associated with scrollbar. */
    Tcl_Command widgetCmd;      /* Token for scrollbar's widget command. */
    Tcl_Command widgetCmd;      /* Token for scrollbar's widget command. */
    Tk_Uid orientUid;           /* Orientation for window ("vertical" or
    Tk_Uid orientUid;           /* Orientation for window ("vertical" or
                                 * "horizontal"). */
                                 * "horizontal"). */
    int vertical;               /* Non-zero means vertical orientation
    int vertical;               /* Non-zero means vertical orientation
                                 * requested, zero means horizontal. */
                                 * requested, zero means horizontal. */
    int width;                  /* Desired narrow dimension of scrollbar,
    int width;                  /* Desired narrow dimension of scrollbar,
                                 * in pixels. */
                                 * in pixels. */
    char *command;              /* Command prefix to use when invoking
    char *command;              /* Command prefix to use when invoking
                                 * scrolling commands.  NULL means don't
                                 * scrolling commands.  NULL means don't
                                 * invoke commands.  Malloc'ed. */
                                 * invoke commands.  Malloc'ed. */
    int commandSize;            /* Number of non-NULL bytes in command. */
    int commandSize;            /* Number of non-NULL bytes in command. */
    int repeatDelay;            /* How long to wait before auto-repeating
    int repeatDelay;            /* How long to wait before auto-repeating
                                 * on scrolling actions (in ms). */
                                 * on scrolling actions (in ms). */
    int repeatInterval;         /* Interval between autorepeats (in ms). */
    int repeatInterval;         /* Interval between autorepeats (in ms). */
    int jump;                   /* Value of -jump option. */
    int jump;                   /* Value of -jump option. */
 
 
    /*
    /*
     * Information used when displaying widget:
     * Information used when displaying widget:
     */
     */
 
 
    int borderWidth;            /* Width of 3-D borders. */
    int borderWidth;            /* Width of 3-D borders. */
    Tk_3DBorder bgBorder;       /* Used for drawing background (all flat
    Tk_3DBorder bgBorder;       /* Used for drawing background (all flat
                                 * surfaces except for trough). */
                                 * surfaces except for trough). */
    Tk_3DBorder activeBorder;   /* For drawing backgrounds when active (i.e.
    Tk_3DBorder activeBorder;   /* For drawing backgrounds when active (i.e.
                                 * when mouse is positioned over element). */
                                 * when mouse is positioned over element). */
    XColor *troughColorPtr;     /* Color for drawing trough. */
    XColor *troughColorPtr;     /* Color for drawing trough. */
    int relief;                 /* Indicates whether window as a whole is
    int relief;                 /* Indicates whether window as a whole is
                                 * raised, sunken, or flat. */
                                 * raised, sunken, or flat. */
    int highlightWidth;         /* Width in pixels of highlight to draw
    int highlightWidth;         /* Width in pixels of highlight to draw
                                 * around widget when it has the focus.
                                 * around widget when it has the focus.
                                 * <= 0 means don't draw a highlight. */
                                 * <= 0 means don't draw a highlight. */
    XColor *highlightBgColorPtr;
    XColor *highlightBgColorPtr;
                                /* Color for drawing traversal highlight
                                /* Color for drawing traversal highlight
                                 * area when highlight is off. */
                                 * area when highlight is off. */
    XColor *highlightColorPtr;  /* Color for drawing traversal highlight. */
    XColor *highlightColorPtr;  /* Color for drawing traversal highlight. */
    int inset;                  /* Total width of all borders, including
    int inset;                  /* Total width of all borders, including
                                 * traversal highlight and 3-D border.
                                 * traversal highlight and 3-D border.
                                 * Indicates how much interior stuff must
                                 * Indicates how much interior stuff must
                                 * be offset from outside edges to leave
                                 * be offset from outside edges to leave
                                 * room for borders. */
                                 * room for borders. */
    int elementBorderWidth;     /* Width of border to draw around elements
    int elementBorderWidth;     /* Width of border to draw around elements
                                 * inside scrollbar (arrows and slider).
                                 * inside scrollbar (arrows and slider).
                                 * -1 means use borderWidth. */
                                 * -1 means use borderWidth. */
    int arrowLength;            /* Length of arrows along long dimension of
    int arrowLength;            /* Length of arrows along long dimension of
                                 * scrollbar, including space for a small gap
                                 * scrollbar, including space for a small gap
                                 * between the arrow and the slider.
                                 * between the arrow and the slider.
                                 * Recomputed on window size changes. */
                                 * Recomputed on window size changes. */
    int sliderFirst;            /* Pixel coordinate of top or left edge
    int sliderFirst;            /* Pixel coordinate of top or left edge
                                 * of slider area, including border. */
                                 * of slider area, including border. */
    int sliderLast;             /* Coordinate of pixel just after bottom
    int sliderLast;             /* Coordinate of pixel just after bottom
                                 * or right edge of slider area, including
                                 * or right edge of slider area, including
                                 * border. */
                                 * border. */
    int activeField;            /* Names field to be displayed in active
    int activeField;            /* Names field to be displayed in active
                                 * colors, such as TOP_ARROW, or 0 for
                                 * colors, such as TOP_ARROW, or 0 for
                                 * no field. */
                                 * no field. */
    int activeRelief;           /* Value of -activeRelief option: relief
    int activeRelief;           /* Value of -activeRelief option: relief
                                 * to use for active element. */
                                 * to use for active element. */
 
 
    /*
    /*
     * Information describing the application related to the scrollbar.
     * Information describing the application related to the scrollbar.
     * This information is provided by the application by invoking the
     * This information is provided by the application by invoking the
     * "set" widget command.  This information can now be provided in
     * "set" widget command.  This information can now be provided in
     * two ways:  the "old" form (totalUnits, windowUnits, firstUnit,
     * two ways:  the "old" form (totalUnits, windowUnits, firstUnit,
     * and lastUnit), or the "new" form (firstFraction and lastFraction).
     * and lastUnit), or the "new" form (firstFraction and lastFraction).
     * FirstFraction and lastFraction will always be valid, but
     * FirstFraction and lastFraction will always be valid, but
     * the old-style information is only valid if the NEW_STYLE_COMMANDS
     * the old-style information is only valid if the NEW_STYLE_COMMANDS
     * flag is 0.
     * flag is 0.
     */
     */
 
 
    int totalUnits;             /* Total dimension of application, in
    int totalUnits;             /* Total dimension of application, in
                                 * units.  Valid only if the NEW_STYLE_COMMANDS
                                 * units.  Valid only if the NEW_STYLE_COMMANDS
                                 * flag isn't set. */
                                 * flag isn't set. */
    int windowUnits;            /* Maximum number of units that can be
    int windowUnits;            /* Maximum number of units that can be
                                 * displayed in the window at once.  Valid
                                 * displayed in the window at once.  Valid
                                 * only if the NEW_STYLE_COMMANDS flag isn't
                                 * only if the NEW_STYLE_COMMANDS flag isn't
                                 * set. */
                                 * set. */
    int firstUnit;              /* Number of last unit visible in
    int firstUnit;              /* Number of last unit visible in
                                 * application's window.  Valid only if the
                                 * application's window.  Valid only if the
                                 * NEW_STYLE_COMMANDS flag isn't set. */
                                 * NEW_STYLE_COMMANDS flag isn't set. */
    int lastUnit;               /* Index of last unit visible in window.
    int lastUnit;               /* Index of last unit visible in window.
                                 * Valid only if the NEW_STYLE_COMMANDS
                                 * Valid only if the NEW_STYLE_COMMANDS
                                 * flag isn't set. */
                                 * flag isn't set. */
    double firstFraction;       /* Position of first visible thing in window,
    double firstFraction;       /* Position of first visible thing in window,
                                 * specified as a fraction between 0 and
                                 * specified as a fraction between 0 and
                                 * 1.0. */
                                 * 1.0. */
    double lastFraction;        /* Position of last visible thing in window,
    double lastFraction;        /* Position of last visible thing in window,
                                 * specified as a fraction between 0 and
                                 * specified as a fraction between 0 and
                                 * 1.0. */
                                 * 1.0. */
 
 
    /*
    /*
     * Miscellaneous information:
     * Miscellaneous information:
     */
     */
 
 
    Tk_Cursor cursor;           /* Current cursor for window, or None. */
    Tk_Cursor cursor;           /* Current cursor for window, or None. */
    char *takeFocus;            /* Value of -takefocus option;  not used in
    char *takeFocus;            /* Value of -takefocus option;  not used in
                                 * the C code, but used by keyboard traversal
                                 * the C code, but used by keyboard traversal
                                 * scripts.  Malloc'ed, but may be NULL. */
                                 * scripts.  Malloc'ed, but may be NULL. */
    int flags;                  /* Various flags;  see below for
    int flags;                  /* Various flags;  see below for
                                 * definitions. */
                                 * definitions. */
} TkScrollbar;
} TkScrollbar;
 
 
/*
/*
 * Legal values for "activeField" field of Scrollbar structures.  These
 * Legal values for "activeField" field of Scrollbar structures.  These
 * are also the return values from the ScrollbarPosition procedure.
 * are also the return values from the ScrollbarPosition procedure.
 */
 */
 
 
#define OUTSIDE         0
#define OUTSIDE         0
#define TOP_ARROW       1
#define TOP_ARROW       1
#define TOP_GAP         2
#define TOP_GAP         2
#define SLIDER          3
#define SLIDER          3
#define BOTTOM_GAP      4
#define BOTTOM_GAP      4
#define BOTTOM_ARROW    5
#define BOTTOM_ARROW    5
 
 
/*
/*
 * Flag bits for scrollbars:
 * Flag bits for scrollbars:
 *
 *
 * REDRAW_PENDING:              Non-zero means a DoWhenIdle handler
 * REDRAW_PENDING:              Non-zero means a DoWhenIdle handler
 *                              has already been queued to redraw
 *                              has already been queued to redraw
 *                              this window.
 *                              this window.
 * NEW_STYLE_COMMANDS:          Non-zero means the new style of commands
 * NEW_STYLE_COMMANDS:          Non-zero means the new style of commands
 *                              should be used to communicate with the
 *                              should be used to communicate with the
 *                              widget:  ".t yview scroll 2 lines", instead
 *                              widget:  ".t yview scroll 2 lines", instead
 *                              of ".t yview 40", for example.
 *                              of ".t yview 40", for example.
 * GOT_FOCUS:                   Non-zero means this window has the input
 * GOT_FOCUS:                   Non-zero means this window has the input
 *                              focus.
 *                              focus.
 */
 */
 
 
#define REDRAW_PENDING          1
#define REDRAW_PENDING          1
#define NEW_STYLE_COMMANDS      2
#define NEW_STYLE_COMMANDS      2
#define GOT_FOCUS               4
#define GOT_FOCUS               4
 
 
/*
/*
 * Declaration of scrollbar class procedures structure.
 * Declaration of scrollbar class procedures structure.
 */
 */
 
 
extern TkClassProcs tkpScrollbarProcs;
extern TkClassProcs tkpScrollbarProcs;
 
 
/*
/*
 * Declaration of scrollbar configuration options.
 * Declaration of scrollbar configuration options.
 */
 */
 
 
extern Tk_ConfigSpec tkpScrollbarConfigSpecs[];
extern Tk_ConfigSpec tkpScrollbarConfigSpecs[];
 
 
/*
/*
 * Declaration of procedures used in the implementation of the scrollbar
 * Declaration of procedures used in the implementation of the scrollbar
 * widget.
 * widget.
 */
 */
 
 
EXTERN void             TkScrollbarEventProc _ANSI_ARGS_((
EXTERN void             TkScrollbarEventProc _ANSI_ARGS_((
                            ClientData clientData, XEvent *eventPtr));
                            ClientData clientData, XEvent *eventPtr));
EXTERN void             TkScrollbarEventuallyRedraw _ANSI_ARGS_((
EXTERN void             TkScrollbarEventuallyRedraw _ANSI_ARGS_((
                            TkScrollbar *scrollPtr));
                            TkScrollbar *scrollPtr));
EXTERN void             TkpComputeScrollbarGeometry _ANSI_ARGS_((
EXTERN void             TkpComputeScrollbarGeometry _ANSI_ARGS_((
                            TkScrollbar *scrollPtr));
                            TkScrollbar *scrollPtr));
EXTERN TkScrollbar *    TkpCreateScrollbar _ANSI_ARGS_((Tk_Window tkwin));
EXTERN TkScrollbar *    TkpCreateScrollbar _ANSI_ARGS_((Tk_Window tkwin));
EXTERN void             TkpDestroyScrollbar _ANSI_ARGS_((
EXTERN void             TkpDestroyScrollbar _ANSI_ARGS_((
                            TkScrollbar *scrollPtr));
                            TkScrollbar *scrollPtr));
EXTERN void             TkpDisplayScrollbar _ANSI_ARGS_((
EXTERN void             TkpDisplayScrollbar _ANSI_ARGS_((
                            ClientData clientData));
                            ClientData clientData));
EXTERN void             TkpConfigureScrollbar _ANSI_ARGS_((
EXTERN void             TkpConfigureScrollbar _ANSI_ARGS_((
                            TkScrollbar *scrollPtr));
                            TkScrollbar *scrollPtr));
EXTERN int              TkpScrollbarPosition _ANSI_ARGS_((
EXTERN int              TkpScrollbarPosition _ANSI_ARGS_((
                            TkScrollbar *scrollPtr, int x, int y));
                            TkScrollbar *scrollPtr, int x, int y));
 
 
# undef TCL_STORAGE_CLASS
# undef TCL_STORAGE_CLASS
# define TCL_STORAGE_CLASS DLLIMPORT
# define TCL_STORAGE_CLASS DLLIMPORT
 
 
#endif /* _TKSCROLLBAR */
#endif /* _TKSCROLLBAR */
 
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.