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

Subversion Repositories or1k

[/] [or1k/] [tags/] [start/] [insight/] [tix/] [generic/] [tixTList.h] - Blame information for rev 1765

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 578 markom
/*
2
 * tixTList.h --
3
 *
4
 *      This header file defines the data structures used by the tixTList
5
 *      widget.
6
 *
7
 * Copyright (c) 1996, Expert Interface Technologies
8
 *
9
 * See the file "license.terms" for information on usage and redistribution
10
 * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
11
 *
12
 */
13
 
14
#ifndef _TIX_TLIST_H_
15
#define _TIX_TLIST_H_
16
 
17
#define TIX_X 0
18
#define TIX_Y 1
19
 
20
typedef struct ListEntry {
21
    struct ListEntry * next;
22
    Tix_DItem * iPtr;
23
    Tk_Uid state;
24
    int size[2];
25
    unsigned int selected : 1;
26
} ListEntry;
27
 
28
typedef struct ListRow {
29
    ListEntry * chPtr;
30
    int size[2];
31
    int numEnt;
32
} ListRow;
33
 
34
/*
35
 * A data structure of the following type is kept for each
36
 * widget managed by this file:
37
 */
38
typedef struct ListStruct {
39
    Tix_DispData dispData;
40
 
41
    Tcl_Command widgetCmd;      /* Token for button's widget command. */
42
 
43
    /*
44
     * Information used when displaying widget:
45
     */
46
    int width, height;          /* For app programmer to request size */
47
 
48
    /*
49
     * Information used when displaying widget:
50
     */
51
 
52
    /* Border and general drawing */
53
    int borderWidth;            /* Width of 3-D borders. */
54
    int selBorderWidth;         /* Width of 3-D borders for selected items */
55
    int relief;                 /* Indicates whether window as a whole is
56
                                 * raised, sunken, or flat. */
57
    Tk_3DBorder border;         /* Used for drawing the 3d border. */
58
    Tk_3DBorder selectBorder;   /* Used for selected background. */
59
    XColor *normalFg;           /* Normal foreground for text. */
60
    XColor *normalBg;           /* Normal background for  text. */
61
    XColor *selectFg;           /* Color for drawing selected text. */
62
 
63
       /* GC and stuff */
64
    GC backgroundGC;            /* GC for drawing background. */
65
    GC selectGC;                /* GC for drawing selected background. */
66
    GC anchorGC;                /* GC for drawing dotted anchor highlight. */
67
    TixFont font;               /* Default font used by the DItems. */
68
 
69
    /* Text drawing */
70
    Cursor cursor;              /* Current cursor for window, or None. */
71
 
72
    /* For highlights */
73
    int highlightWidth;         /* Width in pixels of highlight to draw
74
                                 * around widget when it has the focus.
75
                                 * <= 0 means don't draw a highlight. */
76
    XColor *highlightColorPtr;  /* Color for drawing traversal highlight. */
77
    GC highlightGC;             /* For drawing traversal highlight. */
78
 
79
    /* default pad and gap values */
80
    int padX, padY;
81
 
82
    Tk_Uid selectMode;          /* Selection style: single, browse, multiple,
83
                                 * or extended.  This value isn't used in C
84
                                 * code, but the Tcl bindings use it. */
85
    Tk_Uid state;               /* State can only be normal or disabled. */
86
    Tix_LinkList entList;
87
 
88
    int numRowAllocd;
89
    int numRow;
90
    ListRow * rows;
91
 
92
    ListEntry * seeElemPtr;     /* The current item to "see" */
93
    ListEntry * anchor;         /* The current anchor item */
94
    ListEntry * active;         /* The current active item */
95
    ListEntry * dropSite;       /* The current drop site */
96
    ListEntry * dragSite;       /* The current drop site */
97
 
98
    /*
99
     * Commands
100
     */
101
    char *command;              /* The command when user double-clicks */
102
    char *browseCmd;            /* The command to call when the selection
103
                                 * changes. */
104
    char *sizeCmd;              /* The command to call when the size of
105
                                 * the listbox changes. E.g., when the user
106
                                 * add/deletes elements. Useful for
107
                                 * auto-scrollbar geometry managers */
108
 
109
    /* These options control how the items are arranged on the list */
110
    Tk_Uid orientUid;           /* Can be "vertical" or "horizontal" */
111
    int packMode[2];            /* is row and column packed */
112
    int numMajor[2];            /* num of rows and columns */
113
    int itemSize[2];            /* horizontal and vertical size of items, -1
114
                                 * means natural size */
115
 
116
    /* Info for laying out */
117
    int maxSize[2];             /* max size of all elements in X and Y, (they
118
                                 * do not need to be the same element, may be
119
                                 * invalid according to mode */
120
    char *takeFocus;            /* Value of -takefocus option;  not used in
121
                                 * the C code, but used by keyboard traversal
122
                                 * scripts.  Malloc'ed, but may be NULL. */
123
 
124
    int serial;                 /* this number is incremented before each time
125
                                 * the widget is redisplayed */
126
 
127
    Tix_DItemInfo * diTypePtr;  /* Default item type */
128
    Tix_IntScrollInfo scrollInfo[2];
129
    unsigned int redrawing : 1;
130
    unsigned int resizing  : 1;
131
    unsigned int hasFocus  : 1;
132
    unsigned int isVertical : 1;
133
} TixTListWidget;
134
 
135
typedef TixTListWidget   WidgetRecord;
136
typedef TixTListWidget * WidgetPtr;
137
 
138
#endif /* _TIX_TLIST_H_ */

powered by: WebSVN 2.1.0

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