~cfuhrman/+junk/netbsd-othersrc-trunk

« back to all changes in this revision

Viewing changes to dist/cdk/include/label.h

  • Committer: garbled
  • Date: 2001-01-04 19:59:48 UTC
  • Revision ID: svn-v4:288d5a72-fed7-e111-8680-000c29dcf8fe:trunk:174
Initial import of CDK 4.9.9.  The work to port this was performed by
Charles Hannum, and that is the version being imported:
cdk-4.9.9-20000407-myc3

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#ifndef CDKLABEL_H
 
2
#define CDKLABEL_H      1
 
3
 
 
4
#include <cdk.h>
 
5
 
 
6
/*
 
7
 * Description of the widget:
 
8
 *
 
9
 */
 
10
 
 
11
/*
 
12
 * Copyright 1999, Mike Glover
 
13
 * All rights reserved.
 
14
 *
 
15
 * Redistribution and use in source and binary forms, with or without
 
16
 * modification, are permitted provided that the following conditions
 
17
 * are met:
 
18
 * 1. Redistributions of source code must retain the above copyright
 
19
 *    notice, this list of conditions and the following disclaimer.
 
20
 * 2. Redistributions in binary form must reproduce the above copyright
 
21
 *    notice, this list of conditions and the following disclaimer in the
 
22
 *    documentation and/or other materials provided with the distribution.
 
23
 * 3. All advertising materials mentioning features or use of this software
 
24
 *    must display the following acknowledgment:
 
25
 *      This product includes software developed by Mike Glover
 
26
 *      and contributors.
 
27
 * 4. Neither the name of Mike Glover, nor the names of contributors
 
28
 *    may be used to endorse or promote products derived from this software
 
29
 *    without specific prior written permission.
 
30
 *
 
31
 * THIS SOFTWARE IS PROVIDED BY MIKE GLOVER AND CONTRIBUTORS ``AS IS'' AND
 
32
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 
33
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 
34
 * ARE DISCLAIMED.  IN NO EVENT SHALL MIKE GLOVER OR CONTRIBUTORS BE LIABLE
 
35
 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 
36
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
 
37
 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 
38
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
 
39
 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
 
40
 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 
41
 * SUCH DAMAGE.
 
42
 */
 
43
 
 
44
/*
 
45
 * Declare any definitions you need to make.
 
46
 */
 
47
#define MAX_LABEL_ROWS  300
 
48
 
 
49
/*
 
50
 * Declare the CDK label structure.
 
51
 */
 
52
struct SLabel {
 
53
   CDKOBJS      obj;
 
54
   WINDOW       *parent;
 
55
   WINDOW       *win;
 
56
   WINDOW       *infoWin;
 
57
   chtype       *info[MAX_LABEL_ROWS];
 
58
   int          infoLen[MAX_LABEL_ROWS];
 
59
   int          infoPos[MAX_LABEL_ROWS];
 
60
   int          boxWidth;
 
61
   int          boxHeight;
 
62
   int          xpos;
 
63
   int          ypos;
 
64
   int          rows;
 
65
   chtype       ULChar;
 
66
   chtype       URChar;
 
67
   chtype       LLChar;
 
68
   chtype       LRChar;
 
69
   chtype       VChar;
 
70
   chtype       HChar;
 
71
   chtype       BoxAttrib;
 
72
   boolean      shadow;
 
73
};
 
74
typedef struct SLabel CDKLABEL;
 
75
 
 
76
/*
 
77
 * This creates a new CDK label widget.
 
78
 */
 
79
CDKLABEL *newCDKLabel (
 
80
                CDKSCREEN *     /* screen */,
 
81
                int             /* xPos */,
 
82
                int             /* yPos */,
 
83
                char **         /* mesg */,
 
84
                int             /* rows */,
 
85
                boolean         /* Box */,
 
86
                boolean         /* shadow */);
 
87
 
 
88
/*
 
89
 * This was added to make the builder simpler. All this will
 
90
 * do is call drawCDKLabel.
 
91
 */
 
92
void activateCDKLabel (
 
93
                CDKLABEL *      /* label */,
 
94
                chtype *        /* actions */);
 
95
 
 
96
/*
 
97
 * This sets multiple attributes of the widget.
 
98
 */
 
99
void setCDKLabel (
 
100
                CDKLABEL *      /* label */,
 
101
                char **         /* message */,
 
102
                int             /* lines */,
 
103
                boolean         /* Box */);
 
104
 
 
105
/*
 
106
 * This sets the contents of the label.
 
107
 */
 
108
void setCDKLabelMessage (
 
109
                CDKLABEL *      /* label */,
 
110
                char **         /* mesg */,
 
111
                int             /* lines */);
 
112
chtype **getCDKLabelMessage (
 
113
                CDKLABEL *      /* label */,
 
114
                int *           /* size */);
 
115
 
 
116
/*
 
117
 * This sets the box attribute of the widget.
 
118
 */
 
119
void setCDKLabelBox (
 
120
                CDKLABEL *      /* label */,
 
121
                boolean         /* Box */);
 
122
boolean getCDKLabelBox (
 
123
                CDKLABEL *      /* label */);
 
124
 
 
125
/*
 
126
 * This draws the label.
 
127
 */
 
128
#define drawCDKLabel(obj,Box) drawCDKObject(obj,Box)
 
129
 
 
130
/*
 
131
 * These functions set the drawing characters of the widget.
 
132
 */
 
133
void setCDKLabelULChar (
 
134
                CDKLABEL *      /* label */,
 
135
                chtype          /* character */);
 
136
 
 
137
void setCDKLabelURChar (
 
138
                CDKLABEL *      /* label */,
 
139
                chtype          /* character */);
 
140
 
 
141
void setCDKLabelLLChar (
 
142
                CDKLABEL *      /* label */,
 
143
                chtype          /* character */);
 
144
 
 
145
void setCDKLabelLRChar (
 
146
                CDKLABEL *      /* label */,
 
147
                chtype          /* character */);
 
148
 
 
149
void setCDKLabelVerticalChar (
 
150
                CDKLABEL *      /* label */,
 
151
                chtype          /* character */);
 
152
 
 
153
void setCDKLabelHorizontalChar (
 
154
                CDKLABEL *      /* label */,
 
155
                chtype          /* character */);
 
156
 
 
157
void setCDKLabelBoxAttribute (
 
158
                CDKLABEL *      /* label */,
 
159
                chtype          /* character */);
 
160
 
 
161
/*
 
162
 * This sets the background color of the widget.
 
163
 */
 
164
void setCDKLabelBackgroundColor (
 
165
                CDKLABEL *      /* label */,
 
166
                char *          /* color */);
 
167
 
 
168
/*
 
169
 * This erases the label.
 
170
 */
 
171
#define eraseCDKLabel(obj) eraseCDKObject(obj)
 
172
 
 
173
/*
 
174
 * This destroys the label and the memory used by it.
 
175
 */
 
176
void destroyCDKLabel (
 
177
                CDKLABEL *      /* label */);
 
178
 
 
179
/*
 
180
 * This draws the label then waits for the user to press
 
181
 * the key defined by the 'key' parameter.
 
182
 */
 
183
char waitCDKLabel (
 
184
                CDKLABEL *      /* label */,
 
185
                char            /* key */);
 
186
 
 
187
/*
 
188
 * This moves the label.
 
189
 */
 
190
#define moveCDKLabel(obj,xpos,ypos,relative,refresh) moveCDKObject(obj,xpos,ypos,relative,refresh)
 
191
 
 
192
/*
 
193
 * This allows the user to interactively position the label.
 
194
 */
 
195
#define positionCDKLabel(widget) positionCDKObject(ObjOf(widget),widget->win)
 
196
 
 
197
#endif /* CDKLABEL_H */