~sbeattie/ubuntu/lucid/vnc4/lp556147

« back to all changes in this revision

Viewing changes to unix/xc/lib/Xaw/TextSrcP.h

  • Committer: Bazaar Package Importer
  • Author(s): Ola Lundqvist
  • Date: 2006-05-15 20:35:17 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20060515203517-l4lre1ku942mn26k
Tags: 4.1.1+X4.3.0-10
* Correction of critical security issue. Thanks to Martin Kogler
  <e9925248@student.tuwien.ac.at> that informed me about the issue,
  and provided the patch.
  This flaw was originally found by Steve Wiseman of intelliadmin.com.
* Applied patch from Javier Kohen <jkohen@users.sourceforge.net> that
  inform the user that only 8 first characters of the password will
  actually be used when typing more than 8 characters, closes:
  #355619.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
* $Xorg: TextSrcP.h,v 1.4 2001/02/09 02:03:47 xorgcvs Exp $
 
3
*/
 
4
 
 
5
 
 
6
/***********************************************************
 
7
 
 
8
Copyright 1987, 1988, 1994, 1998  The Open Group
 
9
 
 
10
Permission to use, copy, modify, distribute, and sell this software and its
 
11
documentation for any purpose is hereby granted without fee, provided that
 
12
the above copyright notice appear in all copies and that both that
 
13
copyright notice and this permission notice appear in supporting
 
14
documentation.
 
15
 
 
16
The above copyright notice and this permission notice shall be included in
 
17
all copies or substantial portions of the Software.
 
18
 
 
19
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 
20
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 
21
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
 
22
OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
 
23
AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
 
24
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 
25
 
 
26
Except as contained in this notice, the name of The Open Group shall not be
 
27
used in advertising or otherwise to promote the sale, use or other dealings
 
28
in this Software without prior written authorization from The Open Group.
 
29
 
 
30
 
 
31
Copyright 1987, 1988 by Digital Equipment Corporation, Maynard, Massachusetts.
 
32
 
 
33
                        All Rights Reserved
 
34
 
 
35
Permission to use, copy, modify, and distribute this software and its 
 
36
documentation for any purpose and without fee is hereby granted, 
 
37
provided that the above copyright notice appear in all copies and that
 
38
both that copyright notice and this permission notice appear in 
 
39
supporting documentation, and that the name of Digital not be
 
40
used in advertising or publicity pertaining to distribution of the
 
41
software without specific, written prior permission.  
 
42
 
 
43
DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
 
44
ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
 
45
DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
 
46
ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
 
47
WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
 
48
ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
 
49
SOFTWARE.
 
50
 
 
51
******************************************************************/
 
52
/* $XFree86: xc/lib/Xaw/TextSrcP.h,v 1.15 2001/12/19 21:37:31 dawes Exp $ */
 
53
 
 
54
#ifndef _XawTextSrcP_h
 
55
#define _XawTextSrcP_h
 
56
 
 
57
/*
 
58
 * TextSrc Object Private Data
 
59
 */
 
60
#include <X11/Xfuncproto.h>
 
61
 
 
62
#include <X11/Xaw/TextSrc.h>
 
63
#include <X11/Xaw/TextP.h>      /* This source works with the Text widget */
 
64
 
 
65
_XFUNCPROTOBEGIN
 
66
 
 
67
#ifndef OLDXAW
 
68
struct _XawTextAnchor {
 
69
    XawTextPosition position;
 
70
    XawTextEntity *entities, *cache;
 
71
};
 
72
 
 
73
#define XAW_TENTF_HIDE          0x0001
 
74
#define XAW_TENTF_READ          0x0002
 
75
#define XAW_TENTF_REPLACE       0x0004
 
76
struct _XawTextEntity {
 
77
    short type;
 
78
    short flags;
 
79
    XawTextEntity *next;
 
80
    XtPointer data;
 
81
    XawTextPosition offset;     /* from the anchor */
 
82
    Cardinal length;
 
83
    XrmQuark property;
 
84
};
 
85
#endif
 
86
 
 
87
#if 0   /* no longer used */
 
88
/* New fields for the TextSrc object class */
 
89
typedef struct {
 
90
  XtPointer             next_extension;
 
91
  XrmQuark              record_type;
 
92
  long                  version;
 
93
  Cardinal              record_size;
 
94
  int                   (*Input)();
 
95
} TextSrcExtRec, *TextSrcExt;
 
96
#endif
 
97
 
 
98
typedef XawTextPosition (*_XawSrcReadProc)
 
99
     (Widget, XawTextPosition, XawTextBlock*, int);
 
100
 
 
101
typedef int (*_XawSrcReplaceProc)
 
102
     (Widget, XawTextPosition, XawTextPosition, XawTextBlock*);
 
103
 
 
104
typedef XawTextPosition (*_XawSrcScanProc)
 
105
     (Widget, XawTextPosition, XawTextScanType, XawTextScanDirection,
 
106
      int, Bool);
 
107
 
 
108
typedef XawTextPosition (*_XawSrcSearchProc)
 
109
     (Widget, XawTextPosition, XawTextScanDirection, XawTextBlock*);
 
110
 
 
111
typedef void (*_XawSrcSetSelectionProc)
 
112
     (Widget, XawTextPosition, XawTextPosition, Atom);
 
113
 
 
114
typedef Boolean (*_XawSrcConvertSelectionProc)
 
115
     (Widget, Atom*, Atom*, Atom*, XtPointer*, unsigned long*, int*);
 
116
 
 
117
typedef struct _TextSrcClassPart {
 
118
    _XawSrcReadProc Read;
 
119
    _XawSrcReplaceProc Replace;
 
120
    _XawSrcScanProc Scan;
 
121
    _XawSrcSearchProc Search;
 
122
    _XawSrcSetSelectionProc SetSelection;
 
123
    _XawSrcConvertSelectionProc ConvertSelection;
 
124
#ifndef OLDXAW
 
125
    XtPointer extension;
 
126
#endif
 
127
} TextSrcClassPart;
 
128
 
 
129
/* Full class record */
 
130
typedef struct _TextSrcClassRec {
 
131
    ObjectClassPart     object_class;
 
132
    TextSrcClassPart    textSrc_class;
 
133
} TextSrcClassRec;
 
134
 
 
135
extern TextSrcClassRec textSrcClassRec;
 
136
 
 
137
#ifndef OLDXAW
 
138
typedef struct _XawTextUndo XawTextUndo;
 
139
#endif
 
140
 
 
141
/* New fields for the TextSrc object */
 
142
typedef struct {
 
143
    /* resources */
 
144
    XawTextEditType     edit_mode;
 
145
    XrmQuark text_format;               /* 2 formats: FMT8BIT for Ascii
 
146
                                           FMTWIDE for ISO 10646 */
 
147
#ifndef OLDXAW
 
148
    XtCallbackList callback;            /* A callback list to call when the
 
149
                                           source is changed */
 
150
    Boolean changed;
 
151
    Boolean enable_undo;
 
152
 
 
153
    /* private state */
 
154
    Boolean undo_state;                 /* to protect undo manipulation */
 
155
    XawTextUndo *undo;
 
156
    WidgetList text;                    /* TextWidget's using this source */
 
157
    Cardinal num_text;
 
158
    XtCallbackList property_callback;
 
159
    XawTextAnchor **anchors;
 
160
    int num_anchors;
 
161
    XtPointer pad[1];   /* for future use and keep binary compatability */
 
162
#endif
 
163
} TextSrcPart;
 
164
 
 
165
/* Full instance record */
 
166
typedef struct _TextSrcRec {
 
167
    ObjectPart  object;
 
168
    TextSrcPart textSrc;
 
169
} TextSrcRec;
 
170
 
 
171
/*
 
172
 * Semiprivate declarations of functions used in other modules
 
173
 */
 
174
char* _XawTextWCToMB
 
175
(
 
176
 Display        *display,
 
177
 wchar_t        *wstr,
 
178
 int            *len_in_out
 
179
 );
 
180
 
 
181
wchar_t* _XawTextMBToWC
 
182
(
 
183
 Display        *display,
 
184
 char           *str,
 
185
 int            *len_in_out
 
186
 );
 
187
 
 
188
#ifndef OLDXAW
 
189
XawTextAnchor *XawTextSourceAddAnchor
 
190
(
 
191
 Widget                 source,
 
192
 XawTextPosition        position
 
193
 );
 
194
 
 
195
XawTextAnchor *XawTextSourceFindAnchor
 
196
(
 
197
 Widget                 source,
 
198
 XawTextPosition        position
 
199
 );
 
200
 
 
201
XawTextAnchor *XawTextSourceNextAnchor
 
202
(
 
203
 Widget                  source,
 
204
 XawTextAnchor          *anchor
 
205
 );
 
206
 
 
207
XawTextAnchor *XawTextSourcePrevAnchor
 
208
(
 
209
 Widget                  source,
 
210
 XawTextAnchor          *anchor
 
211
 );
 
212
 
 
213
XawTextAnchor *XawTextSourceRemoveAnchor
 
214
(
 
215
 Widget                  source,
 
216
 XawTextAnchor          *anchor
 
217
 );
 
218
 
 
219
Bool XawTextSourceAnchorAndEntity
 
220
(
 
221
 Widget                   w,
 
222
 XawTextPosition          position,
 
223
 XawTextAnchor          **anchor_return,
 
224
 XawTextEntity          **entity_return
 
225
 );
 
226
 
 
227
XawTextEntity *XawTextSourceAddEntity
 
228
(
 
229
 Widget                 source,
 
230
 int                    type,
 
231
 int                    flags,
 
232
 XtPointer              data,
 
233
 XawTextPosition        position,
 
234
 Cardinal               length,
 
235
 XrmQuark               property
 
236
 );
 
237
 
 
238
void XawTextSourceClearEntities
 
239
(
 
240
 Widget                 w,
 
241
 XawTextPosition        left,
 
242
 XawTextPosition        right
 
243
 );
 
244
#endif
 
245
 
 
246
#if 0   /* no longer used */
 
247
typedef XawTextPosition (*_XawTextPositionFunc)();
 
248
#endif
 
249
 
 
250
#define XtInheritInput                  ((_XawTextPositionFunc)_XtInherit)
 
251
#define XtInheritRead                   ((_XawSrcReadProc)_XtInherit)
 
252
#define XtInheritReplace                ((_XawSrcReplaceProc)_XtInherit)
 
253
#define XtInheritScan                   ((_XawSrcScanProc)_XtInherit)
 
254
#define XtInheritSearch                 ((_XawSrcSearchProc)_XtInherit)
 
255
#define XtInheritSetSelection           ((_XawSrcSetSelectionProc)_XtInherit)
 
256
#define XtInheritConvertSelection     ((_XawSrcConvertSelectionProc)_XtInherit)
 
257
#if 0
 
258
#define XtTextSrcExtVersion           1
 
259
#define XtTextSrcExtTypeString        "XT_TEXTSRC_EXT"
 
260
#endif
 
261
 
 
262
_XFUNCPROTOEND
 
263
 
 
264
#endif /* _XawTextSrcP_h */