Cross Reference: Xaw3_1TextP.h
xref
: /
solaris-x11-s11
/
open-src
/
lib
/
libXScrnSaver
Home
History
Annotate
Line#
Navigate
Download
Search
only in
./
749
N/A
/*
749
N/A
* $XConsortium:
TextP.h
,v 1.42 89/11/21 15:48:03 swick Exp $
749
N/A
*/
749
N/A
749
N/A
749
N/A
/***********************************************************
749
N/A
Copyright 1987, 1988 by Digital Equipment Corporation, Maynard, Massachusetts,
749
N/A
and the Massachusetts Institute of Technology, Cambridge, Massachusetts.
749
N/A
749
N/A
All Rights Reserved
749
N/A
749
N/A
Permission to use, copy, modify, and distribute this software and its
749
N/A
documentation for any purpose and without fee is hereby granted,
749
N/A
provided that the above copyright notice appear in all copies and that
749
N/A
both that copyright notice and this permission notice appear in
749
N/A
supporting documentation, and that the names of Digital or MIT not be
749
N/A
used in advertising or publicity pertaining to distribution of the
749
N/A
software without specific, written prior permission.
749
N/A
749
N/A
DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
749
N/A
ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
749
N/A
DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
749
N/A
ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
749
N/A
WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
749
N/A
ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
749
N/A
SOFTWARE.
749
N/A
749
N/A
******************************************************************/
749
N/A
749
N/A
#
ifndef
_XawTextP_h
749
N/A
#
define
_XawTextP_h
749
N/A
749
N/A
#
include
<./
Xaw3_1Text
.h>
749
N/A
#
include
<./
Xaw3_1SimpleP
.h>
749
N/A
749
N/A
/****************************************************************
749
N/A
*
749
N/A
* Text widget private
749
N/A
*
749
N/A
****************************************************************/
749
N/A
#
define
MAXCUT
30000
/* Maximum number of characters that can be cut. */
749
N/A
749
N/A
#
define
abs
(x) (((x) < 0) ? (-(x)) : (x))
749
N/A
749
N/A
#
define
GETLASTPOS
XawTextSourceScan
(
ctx
->
text
.
source
, 0, \
749
N/A
XawstAll
,
XawsdRight
,
1
,
TRUE
)
749
N/A
749
N/A
#
define
zeroPosition
((
XawTextPosition
) 0)
749
N/A
749
N/A
extern
XtActionsRec
textActionsTable
[];
749
N/A
extern
Cardinal
textActionsTableCount
;
749
N/A
749
N/A
#
define
LF
0x0a
749
N/A
#
define
CR
0x0d
749
N/A
#
define
TAB
0x09
749
N/A
#
define
BS
0x08
749
N/A
#
define
SP
0x20
749
N/A
#
define
DEL
0x7f
749
N/A
#
define
BSLASH
'\\'
749
N/A
749
N/A
/* constants that subclasses may want to know */
749
N/A
#
define
DEFAULT_TEXT_HEIGHT
((
Dimension
)~0)
749
N/A
749
N/A
/* displayable text management data structures */
749
N/A
749
N/A
typedef
struct
{
749
N/A
XawTextPosition
position
;
749
N/A
Position
y;
749
N/A
Dimension
textWidth
;
749
N/A
}
XawTextLineTableEntry
, *
XawTextLineTableEntryPtr
;
749
N/A
749
N/A
typedef
struct
{
749
N/A
XawTextPosition
left
,
right
;
749
N/A
XawTextSelectType
type
;
749
N/A
Atom
*
selections
;
749
N/A
int
atom_count
;
749
N/A
int
array_size
;
749
N/A
}
XawTextSelection
;
749
N/A
749
N/A
/* Line Tables are n+1 long - last position displayed is in last lt entry */
749
N/A
typedef
struct
{
749
N/A
XawTextPosition
top
;
/* Top of the displayed text. */
749
N/A
int
lines
;
/* How many lines in this table. */
749
N/A
XawTextLineTableEntry
*
info
;
/* A dynamic array, one entry per line */
749
N/A
}
XawTextLineTable
, *
XawTextLineTablePtr
;
749
N/A
749
N/A
749
N/A
typedef
struct
_XawTextMargin
{
749
N/A
Position
left
,
right
,
top
,
bottom
;
749
N/A
}
XawTextMargin
;
749
N/A
749
N/A
#
define
VMargins
(
ctx
) ( (
ctx
)->
text
.
margin
.
top
+ (
ctx
)->
text
.
margin
.
bottom
)
749
N/A
#
define
HMargins
(
ctx
) ( (
ctx
)->
text
.
margin
.
left
+ (
ctx
)->
text
.
margin
.
right
)
749
N/A
749
N/A
#
define
IsPositionVisible
(
ctx
,
pos
) \
749
N/A
(
pos
>=
ctx
->
text
.
lt
.
info
[0].
position
&& \
749
N/A
pos
<
ctx
->
text
.
lt
.
info
[
ctx
->
text
.
lt
.
lines
].
position
)
749
N/A
749
N/A
/*
749
N/A
* Search & Replace data structure.
749
N/A
*/
749
N/A
749
N/A
struct
SearchAndReplace
{
749
N/A
Boolean
selection_changed
;
/* flag so that the selection cannot be
749
N/A
changed out from underneath query-replace.*/
749
N/A
Widget
search_popup
;
/* The poppup widget that allows searches.*/
749
N/A
Widget
label1
;
/* The label widgets for the search window. */
749
N/A
Widget
label2
;
749
N/A
Widget
left_toggle
;
/* The left search toggle radioGroup. */
749
N/A
Widget
right_toggle
;
/* The right search toggle radioGroup. */
749
N/A
Widget
rep_label
;
/* The Replace label string. */
749
N/A
Widget
rep_text
;
/* The Replace text field. */
749
N/A
Widget
search_text
;
/* The Search text field. */
749
N/A
Widget
rep_one
;
/* The Replace one button. */
749
N/A
Widget
rep_all
;
/* The Replace all button. */
749
N/A
};
749
N/A
749
N/A
/* Private Text Definitions */
749
N/A
749
N/A
typedef
int
(*
ActionProc
)();
749
N/A
749
N/A
/* New fields for the Text widget class record */
749
N/A
749
N/A
typedef
struct
{
int
empty
;}
TextClassPart
;
749
N/A
749
N/A
/* Full class record declaration */
749
N/A
typedef
struct
_TextClassRec
{
749
N/A
CoreClassPart
core_class
;
749
N/A
SimpleClassPart
simple_class
;
749
N/A
TextClassPart
text_class
;
749
N/A
}
TextClassRec
;
749
N/A
749
N/A
extern
TextClassRec
textClassRec
;
749
N/A
749
N/A
/* New fields for the Text widget record */
749
N/A
typedef
struct
_TextPart
{
749
N/A
/* resources */
749
N/A
749
N/A
Widget
source
,
sink
;
749
N/A
XawTextPosition
insertPos
;
749
N/A
XawTextSelection
s;
749
N/A
XawTextSelectType
*
sarray
;
/* Array to cycle for selections. */
749
N/A
int
options
;
/* wordbreak, scroll, etc. */
749
N/A
int
dialog_horiz_offset
;
/* position for popup dialog */
749
N/A
int
dialog_vert_offset
;
/* position for popup dialog */
749
N/A
Boolean
display_caret
;
/* insertion pt visible iff T */
749
N/A
Boolean
auto_fill
;
/* Auto fill mode? */
749
N/A
XawTextScrollMode
scroll_vert
,
scroll_horiz
;
/*what type of scrollbars.*/
749
N/A
XawTextWrapMode
wrap
;
/* The type of wrapping. */
749
N/A
XawTextResizeMode
resize
;
/* what to resize */
749
N/A
XawTextMargin
r_margin
;
/* The real margins. */
749
N/A
749
N/A
/* private state */
749
N/A
749
N/A
XawTextMargin
margin
;
/* The current margins. */
749
N/A
XawTextLineTable
lt
;
749
N/A
XawTextScanDirection
extendDir
;
749
N/A
XawTextSelection
origSel
;
/* the selection being modified */
749
N/A
Time
lasttime
;
/* timestamp of last processed action */
749
N/A
Time
time
;
/* time of last key or button action */
749
N/A
Position
ev_x
,
ev_y
;
/* x, y coords for key or button action */
749
N/A
Widget
vbar
,
hbar
;
/* The scroll bars (none = NULL). */
749
N/A
struct
SearchAndReplace
*
search
;
/* Search and replace structure. */
749
N/A
Widget
file_insert
;
/* The file insert popup widget. */
749
N/A
XawTextPosition
*
updateFrom
;
/* Array of start positions for update. */
749
N/A
XawTextPosition
*
updateTo
;
/* Array of end positions for update. */
749
N/A
int
numranges
;
/* How many update ranges there are. */
749
N/A
int
maxranges
;
/* How many ranges we have space for */
749
N/A
XawTextPosition
lastPos
;
/* Last position of source. */
749
N/A
GC
gc
;
749
N/A
Boolean
showposition
;
/* True if we need to show the position. */
749
N/A
Boolean
hasfocus
;
/* TRUE if we currently have input focus.*/
749
N/A
Boolean
update_disabled
;
/* TRUE if display updating turned off */
749
N/A
Boolean
single_char
;
/* Single character replaced. */
749
N/A
XawTextPosition
old_insert
;
/* Last insertPos for batched updates */
749
N/A
short
mult
;
/* Multiplier. */
749
N/A
749
N/A
/* private state, shared
w
/
Source
and Sink */
749
N/A
Boolean
redisplay_needed
;
/* in SetValues */
749
N/A
749
N/A
}
TextPart
;
749
N/A
749
N/A
/*************************************************************
749
N/A
*
749
N/A
* Resource types private to Text widget.
749
N/A
*
749
N/A
*************************************************************/
749
N/A
749
N/A
#
define
XtRScrollMode
"ScrollMode"
749
N/A
#
define
XtRWrapMode
"WrapMode"
749
N/A
#
define
XtRResizeMode
"ResizeMode"
749
N/A
749
N/A
/****************************************************************
749
N/A
*
749
N/A
* Full instance record declaration
749
N/A
*
749
N/A
****************************************************************/
749
N/A
749
N/A
typedef
struct
_TextRec
{
749
N/A
CorePart
core
;
749
N/A
SimplePart
simple
;
749
N/A
TextPart
text
;
749
N/A
}
TextRec
;
749
N/A
749
N/A
#
ifdef
XAW_BC
749
N/A
/*************************************************************
749
N/A
* For Compatibility only. */
749
N/A
749
N/A
#
define
XtTextLineTable
XawTextLineTable
749
N/A
#
define
XtTextLineTablePtr
XawTextLineTablePtr
749
N/A
#
define
XtTextLineTableEntry
XawTextLineTableEntry
749
N/A
#
define
XtTextLineTableEntryPtr
XawTextLineTableEntryPtr
749
N/A
749
N/A
/*************************************************************/
749
N/A
#
endif
/* XAW_BC */
749
N/A
749
N/A
#
endif
/* _XawTextP_h */