~ubuntu-branches/ubuntu/utopic/gridengine/utopic

« back to all changes in this revision

Viewing changes to source/3rdparty/qmon/Xmt310/Xmt/CliP.h

  • Committer: Bazaar Package Importer
  • Author(s): Mark Hymers
  • Date: 2008-06-25 22:36:13 UTC
  • Revision ID: james.westby@ubuntu.com-20080625223613-tvd9xlhuoct9kyhm
Tags: upstream-6.2~beta2
ImportĀ upstreamĀ versionĀ 6.2~beta2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* 
 
2
 * Motif Tools Library, Version 3.1
 
3
 * $Id$
 
4
 * 
 
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.
 
10
 *
 
11
 * $Log$
 
12
 * Revision 1.1.1.1  2001/07/18 11:06:02  root
 
13
 * Initial checkin.
 
14
 *
 
15
 * Revision 1.2  2001/06/12 16:25:28  andre
 
16
 * *** empty log message ***
 
17
 *
 
18
 *
 
19
 */
 
20
 
 
21
#ifndef _XmtCliP_h
 
22
#define _XmtCliP_h    
 
23
 
 
24
#include <Xmt/Xmt.h>
 
25
#include <Xm/TextP.h>
 
26
#include <Xm/TextOutP.h>
 
27
#include <Xmt/Cli.h>
 
28
 
 
29
typedef struct {
 
30
    String translations;
 
31
    XtPointer extension;
 
32
} XmtCliClassPart;
 
33
 
 
34
typedef struct _XmtCliClassRec {
 
35
    CoreClassPart core_class;
 
36
    XmPrimitiveClassPart primitive_class;
 
37
    XmTextClassPart text_class;
 
38
    XmtCliClassPart cli_class;
 
39
} XmtCliClassRec;
 
40
 
 
41
externalref XmtCliClassRec xmtCliClassRec;
 
42
 
 
43
typedef struct _XmtCliPart {
 
44
    /* resources */
 
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;
 
60
 
 
61
    /* private state */
 
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 */
 
78
} XmtCliPart;
 
79
 
 
80
typedef struct _XmtCliRec {
 
81
    CorePart core;
 
82
    XmPrimitivePart primitive;
 
83
    XmTextPart text;
 
84
    XmtCliPart cli;
 
85
} XmtCliRec;
 
86
 
 
87
/*
 
88
 * macros for getting at the internal state of the text widget.
 
89
 * These work in both Motif 1.1 and Motif 1.2
 
90
 */
 
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)
 
104
 
 
105
/*
 
106
 * 1.1 to 1.2 portability stuff
 
107
 */
 
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)
 
112
#endif
 
113
 
 
114
#endif
 
115
 
 
116