1 /* $Id$ $Revision$ */
2 /* vim:set shiftwidth=4 ts=8: */
3 
4 /*************************************************************************
5  * Copyright (c) 2011 AT&T Intellectual Property
6  * All rights reserved. This program and the accompanying materials
7  * are made available under the terms of the Eclipse Public License v1.0
8  * which accompanies this distribution, and is available at
9  * http://www.eclipse.org/legal/epl-v10.html
10  *
11  * Contributors: See CVS logs. Details at http://www.graphviz.org/
12  *************************************************************************/
13 
14 #ifdef __cplusplus
15 extern "C" {
16 #endif
17 
18 /*
19  * Copyright 1989 Software Research Associates, Inc., Tokyo, Japan
20  *
21  * Permission to use, copy, modify, and distribute this software and its
22  * documentation for any purpose and without fee is hereby granted, provided
23  * that the above copyright notice appear in all copies and that both that
24  * copyright notice and this permission notice appear in supporting
25  * documentation, and that the name of Software Research Associates not be used
26  * in advertising or publicity pertaining to distribution of the software
27  * without specific, written prior permission.  Software Research Associates
28  * makes no representations about the suitability of this software for any
29  * purpose.  It is provided "as is" without express or implied warranty.
30  *
31  * SOFTWARE RESEARCH ASSOCIATES DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
32  * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS,
33  * IN NO EVENT SHALL SOFTWARE RESEARCH ASSOCIATES BE LIABLE FOR ANY SPECIAL,
34  * INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
35  * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
36  * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
37  * PERFORMANCE OF THIS SOFTWARE.
38  *
39  * Author: Erik M. van der Poel
40  *         Software Research Associates, Inc., Tokyo, Japan
41  *         erik@sra.co.jp
42  */
43 
44 #include <X11/Intrinsic.h>
45 #include <X11/StringDefs.h>
46 #include <X11/Xos.h>
47 #include <X11/Xaw/Text.h>
48 #include <X11/Xaw/AsciiText.h>
49 #include <sys/types.h>
50 #include <sys/stat.h>
51 
52 #define SEL_FILE_CANCEL -1
53 #define SEL_FILE_OK      0
54 #define SEL_FILE_NULL    1
55 #define SEL_FILE_TEXT    2
56 
57 #define SF_DO_SCROLL     1
58 #define SF_DO_NOT_SCROLL 0
59 
60 typedef struct {
61     int  statDone;
62     char *real;
63     char *shown;
64 } SFEntry;
65 
66 typedef struct {
67     char    *dir;
68     char    *path;
69     SFEntry *entries;
70     int     nEntries;
71     int     vOrigin;
72     int     nChars;
73     int     hOrigin;
74     int     changed;
75     int     beginSelection;
76     int     endSelection;
77     time_t  mtime;
78 } SFDir;
79 
80 extern int SFstatus;
81 
82 extern char SFcurrentPath[], SFstartDir[], SFcurrentDir[];
83 
84 extern Widget selFile, selFileCancel, selFileField, selFileForm;
85 extern Widget selFileHScroll, selFileHScrolls[], selFileLists[];
86 extern Widget selFileOK, selFilePrompt, selFileVScrolls[];
87 
88 extern Display *SFdisplay;
89 
90 extern int SFcharWidth, SFcharHeight, SFcharAscent;
91 
92 extern SFDir *SFdirs;
93 
94 extern int SFdirEnd, SFdirPtr;
95 
96 extern Pixel SFfore, SFback;
97 
98 extern Atom SFwmDeleteWindow;
99 
100 extern XSegment SFsegs[], SFcompletionSegs[];
101 
102 extern XawTextPosition SFtextPos;
103 
104 void SFenterList (Widget, XtPointer, XEvent *, Boolean *);
105 void SFleaveList (Widget, XtPointer, XEvent *, Boolean *);
106 void SFmotionList (Widget, XtPointer, XEvent *, Boolean *);
107 
108 void SFvFloatSliderMovedCallback (Widget, XtPointer, XtPointer);
109 void SFvSliderMovedCallback (Widget, XtPointer, XtPointer);
110 void SFvAreaSelectedCallback (Widget, XtPointer, XtPointer);
111 void SFhSliderMovedCallback (Widget, XtPointer, XtPointer);
112 void SFhAreaSelectedCallback (Widget, XtPointer, XtPointer);
113 void SFpathSliderMovedCallback (Widget, XtPointer, XtPointer);
114 void SFpathAreaSelectedCallback (Widget, XtPointer, XtPointer);
115 
116 void SFbuttonPressList (Widget, XtPointer, XEvent *, Boolean *);
117 void SFbuttonReleaseList (Widget, XtPointer, XEvent *, Boolean *);
118 
119 extern int SFupperX, SFlowerY, SFupperY;
120 
121 extern int SFtextX, SFtextYoffset;
122 
123 extern int SFentryWidth, SFentryHeight;
124 
125 extern int SFlineToTextH, SFlineToTextV;
126 
127 extern int SFbesideText, SFaboveAndBelowText;
128 
129 extern int SFcharsPerEntry;
130 
131 extern int SFlistSize;
132 
133 extern int SFcurrentInvert[];
134 
135 extern int SFworkProcAdded;
136 extern XtWorkProcId SFworkProcId;
137 
138 extern Boolean SFworkProc (XtPointer);
139 
140 extern XtAppContext SFapp;
141 
142 extern int SFpathScrollWidth, SFvScrollHeight, SFhScrollWidth;
143 
144 extern char SFtextBuffer[];
145 
146 extern int SFbuttonPressed;
147 
148 void SFdirModTimer (XtPointer cl, XtIntervalId *id);
149 char SFstatChar (struct stat *);
150 
151 extern XtIntervalId SFdirModTimerId;
152 
153 extern int (*SFfunc) (char *, char **, struct stat *);
154 
155 #ifdef __cplusplus
156 }
157 #endif
158 
159