2
* Motif Tools Library, Version 3.1
5
* Written by David Flanagan.
6
* Copyright (c) 1992-2001 by David Flanagan.
7
* All Rights Reserved. See the file COPYRIGHT for details.
8
* This is open source software. See the file LICENSE for details.
9
* There is no warranty for this software. See NO_WARRANTY for details.
12
* Revision 1.1.1.1 2001/07/18 11:06:02 root
15
* Revision 1.2 2001/06/12 16:25:28 andre
16
* *** empty log message ***
26
#include <Xm/TextOutP.h>
34
typedef struct _XmtCliClassRec {
35
CoreClassPart core_class;
36
XmPrimitiveClassPart primitive_class;
37
XmTextClassPart text_class;
38
XmtCliClassPart cli_class;
41
externalref XmtCliClassRec xmtCliClassRec;
43
typedef struct _XmtCliPart {
45
Boolean save_history; /* whether to save input in command history */
46
char **history; /* the command history */
47
short history_num_items; /* how many filled slots in the history */
48
short history_max_items; /* how many entries in command history */
49
Boolean escape_newlines; /* whether \ at end of line escapes newline */
50
short save_lines; /* minimum # of lines to save */
51
Boolean display_stdout; /* grab and display output to stdout? */
52
Boolean display_stderr; /* grab and display output to stderr? */
53
int fildes; /* display anything read from this descriptor */
54
Boolean page_mode; /* simulate the more command for long output? */
55
String page_string; /* the string to display for pager */
56
XtCallbackList input_callback; /* called when Return is typed */
57
String prompt; /* string displayed after each input */
58
Widget page_widget; /* an XmLabel widget */
59
XtTranslations translations;
62
XmTextPosition inputpos; /* where editable user input text begins */
63
int total_lines; /* total lines currently in widget */
64
int last_read_line; /* last line displayed, when paging */
65
Boolean blocking; /* flag when blocked in XmtCliGets */
66
Boolean paging; /* flag when paging output */
67
int historypos; /* the current location in the history */
68
int pipes[2]; /* pipes for stdin and stdout */
69
XtInputId stdID; /* handle for stdin and stdout input proc */
70
XtInputId fildesID; /* handle for XmtNfildes input proc */
71
int save_stdout; /* a dup'ed copy of stdout */
72
int save_stderr; /* a dup'ed copy of stderr */
73
XmTextPosition saved_cursor_position; /* to restore cursor after drag */
74
Boolean permissive; /* disable motion & modify verify callbacks */
75
Widget blank_widget; /* to blank out the rest of the paging line */
76
String input_string; /* copy of the input string for modal input */
77
Boolean has_newlines; /* whether we need to remove \ \n sequences */
80
typedef struct _XmtCliRec {
82
XmPrimitivePart primitive;
88
* macros for getting at the internal state of the text widget.
89
* These work in both Motif 1.1 and Motif 1.2
91
#define XmtCliTotalLines(w) (((XmtCliWidget)(w))->text.total_lines)
92
#define XmtCliTopLine(w) (((XmtCliWidget)(w))->text.top_line)
93
#define XmtCliVBar(w) (((XmtCliWidget)(w))->text.output->data->vbar)
94
#define XmtCliNumRows(w)\
95
(((XmtCliWidget)(w))->text.output->data->number_lines)
96
#define XmtCliFontList(w)\
97
(((XmtCliWidget)(w))->text.output->data->fontlist)
98
#define XmtCliLineHeight(w)\
99
(((XmtCliWidget)(w))->text.output->data->lineheight)
100
#define XmtCliMarginHeight(w)\
101
(((XmtCliWidget)(w))->text.margin_height)
102
#define XmtCliMarginWidth(w)\
103
(((XmtCliWidget)(w))->text.margin_width)
106
* 1.1 to 1.2 portability stuff
108
#if XmVersion == 1001
109
#define XmGetFocusWidget(w) _XmGetActiveItem(w)
110
#define XmTextDisableRedisplay(w) _XmTextDisableRedisplay((XmTextWidget)w,True)
111
#define XmTextEnableRedisplay(w) _XmTextEnableRedisplay((XmTextWidget)w)