Initial import of the CDE 2.1.30 sources from the Open Group.
This commit is contained in:
401
cde/programs/dtterm/DtTermLogit.c
Normal file
401
cde/programs/dtterm/DtTermLogit.c
Normal file
@@ -0,0 +1,401 @@
|
||||
/* $TOG: DtTermLogit.c /main/6 1998/07/23 18:08:59 mgreess $ */
|
||||
/* *
|
||||
* (c) Copyright 1993, 1994 Hewlett-Packard Company *
|
||||
* (c) Copyright 1993, 1994 International Business Machines Corp. *
|
||||
* (c) Copyright 1993, 1994 Sun Microsystems, Inc. *
|
||||
* (c) Copyright 1993, 1994 Novell, Inc. *
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
#include <signal.h>
|
||||
#include <errno.h>
|
||||
#include <time.h>
|
||||
#include <string.h>
|
||||
#include <ctype.h>
|
||||
#include <sys/times.h>
|
||||
#include <pwd.h>
|
||||
|
||||
#include <sys/utsname.h>
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/socket.h>
|
||||
#include <netinet/in.h>
|
||||
#include <netdb.h>
|
||||
|
||||
#define LOG_HOST "hpcvusj.cv.hp.com"
|
||||
#define LOG_ADDR "15.0.209.35"
|
||||
#define LOG_PORT "4444"
|
||||
#define WAIT_INTERVAL 5
|
||||
#define RETRIES 5
|
||||
|
||||
/*
|
||||
#define DEBUG_LOGIT
|
||||
*/
|
||||
#ifdef DEBUG_LOGIT
|
||||
#define logitmain main
|
||||
#endif /* DEBUG_LOGIT */
|
||||
|
||||
#ifdef LOG_USAGE
|
||||
void LogStart(int noFork, int argc, char **argv);
|
||||
void LogFinish(int noFork, int sessions);
|
||||
void LogBumpSessionCount(int count);
|
||||
static void doLog(int noFork, char *msg);
|
||||
static void ding(int sig);
|
||||
static void autoLogFinish();
|
||||
|
||||
static time_t startTime;
|
||||
static char *id = (char *) 0;
|
||||
static int sessionCount = 0;
|
||||
static int savedNoFork = 0;
|
||||
static int sequence = 0;
|
||||
|
||||
void
|
||||
LogBumpSessionCount(int count)
|
||||
{
|
||||
sessionCount += count;
|
||||
}
|
||||
|
||||
void
|
||||
LogStart(int noFork, int argc, char **argv)
|
||||
{
|
||||
char buffer[BUFSIZ];
|
||||
char *c1;
|
||||
char *c2;
|
||||
char *tstring;
|
||||
struct utsname uts;
|
||||
struct passwd *pw;
|
||||
int i1;
|
||||
|
||||
if (getenv("DTTERM_NOLOG")) {
|
||||
return;
|
||||
}
|
||||
|
||||
/* save away noFork... */
|
||||
savedNoFork = noFork;
|
||||
|
||||
*buffer = '\0';
|
||||
(void) strcat(buffer, "START");
|
||||
(void) strcat(buffer, " USER=\"");
|
||||
if (c1 = getlogin()) {
|
||||
(void) strcat(buffer, c1);
|
||||
} else {
|
||||
if ((pw = getpwuid(getuid())) && pw->pw_name && *pw->pw_name) {
|
||||
(void) strcat(buffer, pw->pw_name);
|
||||
} else {
|
||||
(void) strcat(buffer, "???");
|
||||
}
|
||||
}
|
||||
|
||||
(void) strcat(buffer, "\"" );
|
||||
if (uname(&uts) != -1) {
|
||||
(void) strcat(buffer, " UNAME=\"");
|
||||
(void) strcat(buffer, uts.sysname);
|
||||
(void) strcat(buffer, " ");
|
||||
(void) strcat(buffer, uts.nodename);
|
||||
(void) strcat(buffer, " ");
|
||||
(void) strcat(buffer, uts.release);
|
||||
(void) strcat(buffer, " ");
|
||||
(void) strcat(buffer, uts.version);
|
||||
(void) strcat(buffer, " ");
|
||||
(void) strcat(buffer, uts.machine);
|
||||
(void) strcat(buffer, "\"");
|
||||
}
|
||||
|
||||
(void) time(&startTime);
|
||||
tstring = ctime(&startTime);
|
||||
/* remove the trailing '\n'... */
|
||||
tstring[strlen(tstring) - 1] = '\0';
|
||||
(void) strcat(buffer, " TIME=\"");
|
||||
(void) strcat(buffer, tstring);
|
||||
(void) strcat(buffer, "\"");
|
||||
|
||||
(void) strcat(buffer, " ARGS=\"");
|
||||
c1 = buffer + strlen(buffer);
|
||||
for (i1 = 0; i1 < argc; i1++) {
|
||||
if (i1 > 0) {
|
||||
*c1++ = ' ';
|
||||
}
|
||||
|
||||
for (c2 = argv[i1]; *c2; c2++) {
|
||||
if (iscntrl(*c2)) {
|
||||
*c1++ = '^';
|
||||
*c1++ = '@' + *c2;
|
||||
} else if (isprint(*c2)) {
|
||||
switch (*c2) {
|
||||
case '"' :
|
||||
case '\\' :
|
||||
case ' ' :
|
||||
*c1++ = '\\';
|
||||
*c1++ = *c2;
|
||||
break;
|
||||
|
||||
default:
|
||||
*c1++ = *c2;
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
*c1++ = '\\';
|
||||
*c1++ = '0' + (*c2 / 0100) & 07;
|
||||
*c1++ = '0' + (*c2 / 0010) & 07;
|
||||
*c1++ = '0' + (*c2 / 0001) & 07;
|
||||
}
|
||||
}
|
||||
}
|
||||
*c1++ = '"';
|
||||
*c1++ = '\0';
|
||||
|
||||
(void) doLog(noFork, buffer);
|
||||
atexit(autoLogFinish);
|
||||
}
|
||||
|
||||
void
|
||||
LogFinish(int noFork, int sessions)
|
||||
{
|
||||
char buffer[BUFSIZ];
|
||||
char buffer2[BUFSIZ];
|
||||
time_t now;
|
||||
long cpuTime;
|
||||
int i1;
|
||||
struct tms tms;
|
||||
long clkTick = 0;
|
||||
|
||||
if (getenv("DTTERM_NOLOG")) {
|
||||
return;
|
||||
}
|
||||
|
||||
*buffer = '\0';
|
||||
(void) strcat(buffer, "FINISH");
|
||||
|
||||
(void) sprintf(buffer2, " SESSIONS=\"%d\"", sessions);
|
||||
(void) strcat(buffer, buffer2);
|
||||
|
||||
(void) time(&now);
|
||||
(void) sprintf(buffer2, " ELAPSED=\"%ld\"", now - startTime);
|
||||
(void) strcat(buffer, buffer2);
|
||||
|
||||
(void) times(&tms);
|
||||
|
||||
clkTick = sysconf(_SC_CLK_TCK);
|
||||
if (clkTick) {
|
||||
cpuTime = (tms.tms_utime = tms.tms_stime) / clkTick;
|
||||
} else {
|
||||
cpuTime = -1;
|
||||
}
|
||||
|
||||
(void) sprintf(buffer2, " CPU=\"%ld\"", cpuTime);
|
||||
(void) strcat(buffer, buffer2);
|
||||
|
||||
(void) doLog(noFork, buffer);
|
||||
}
|
||||
|
||||
static void
|
||||
autoLogFinish()
|
||||
{
|
||||
(void) LogFinish(savedNoFork, sessionCount);
|
||||
}
|
||||
|
||||
static void
|
||||
doLog(int noFork, char *msg)
|
||||
{
|
||||
char *sbuffer;
|
||||
char rbuffer[BUFSIZ];
|
||||
char thisId[BUFSIZ];
|
||||
static int s = -1;
|
||||
int i1;
|
||||
int len;
|
||||
char *c1;
|
||||
int retries = RETRIES;
|
||||
struct hostent *hp;
|
||||
static struct sockaddr_in myaddr_in;
|
||||
static struct sockaddr_in servaddr_in;
|
||||
struct sigaction sa;
|
||||
struct sigaction oldSa;
|
||||
time_t now;
|
||||
pid_t pid;
|
||||
int doRead;
|
||||
|
||||
sbuffer = malloc(2*BUFSIZ);
|
||||
if (!id) {
|
||||
(void) time(&now);
|
||||
(void) sprintf(sbuffer, "%ld.%ld", now, (long)getpid());
|
||||
id = strdup(sbuffer);
|
||||
}
|
||||
|
||||
/* bump the sequence number before we fork()... */
|
||||
(void) sequence++;
|
||||
|
||||
if (noFork) {
|
||||
pid = 0;
|
||||
} else {
|
||||
pid = fork();
|
||||
}
|
||||
|
||||
if (pid != 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (s < 0) {
|
||||
(void) memset(&servaddr_in, '\0', sizeof(servaddr_in));
|
||||
(void) memset(&myaddr_in, '\0', sizeof(myaddr_in));
|
||||
|
||||
/* set up the server address... */
|
||||
servaddr_in.sin_family = AF_INET;
|
||||
hp = gethostbyname((c1 = getenv("DTTERM_LOG_HOST")) ? c1 : LOG_HOST);
|
||||
|
||||
if (hp) {
|
||||
servaddr_in.sin_addr.s_addr =
|
||||
((struct in_addr *)(hp->h_addr))->s_addr;
|
||||
} else {
|
||||
servaddr_in.sin_addr.s_addr =
|
||||
inet_addr((c1 = getenv("DTTERM_LOG_ADDR")) ? c1 : LOG_ADDR);
|
||||
}
|
||||
|
||||
servaddr_in.sin_port =
|
||||
atoi((c1 = getenv("DTTERM_LOG_PORT")) ? c1 : LOG_PORT);
|
||||
|
||||
/* create the socket... */
|
||||
s = socket(AF_INET, SOCK_DGRAM, 0);
|
||||
if (s < 0) {
|
||||
if (!noFork) {
|
||||
(void) _exit(1);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
/* bind to some local address so we can get a reply... */
|
||||
myaddr_in.sin_family = AF_INET;
|
||||
myaddr_in.sin_port = 0;
|
||||
myaddr_in.sin_addr.s_addr = INADDR_ANY;
|
||||
if (bind(s, &myaddr_in, sizeof(myaddr_in)) == -1) {
|
||||
if (!noFork) {
|
||||
(void) _exit(1);
|
||||
}
|
||||
(void) close(s);
|
||||
s = -1;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (!noFork) {
|
||||
for (i1 = 0; i1 < _NFILE; i1++) {
|
||||
if (i1 != s) {
|
||||
(void) close(i1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
(void) sprintf(thisId, "ID=\"%s.%d\"", id, sequence);
|
||||
(void) sprintf(sbuffer, "%s %s", thisId, msg);
|
||||
|
||||
/* set up a signal handler... */
|
||||
(void) sigemptyset(&sa.sa_mask);
|
||||
sa.sa_flags = 0;
|
||||
sa.sa_handler = ding;
|
||||
|
||||
(void) sigaction(SIGALRM, &sa, &oldSa);
|
||||
|
||||
/* try to send the message... */
|
||||
while (retries > 0) {
|
||||
if (sendto(s, sbuffer, strlen(sbuffer), 0, &servaddr_in,
|
||||
sizeof(servaddr_in)) < 0) {
|
||||
if (!noFork) {
|
||||
(void) _exit(1);
|
||||
}
|
||||
(void) close(s);
|
||||
s = -1;
|
||||
return;
|
||||
}
|
||||
|
||||
/* set a timeout... */
|
||||
(void) alarm(WAIT_INTERVAL);
|
||||
|
||||
for (doRead = 1; doRead; ) {
|
||||
if ((len = recv(s, rbuffer, sizeof(rbuffer) -1, 0)) < 0) {
|
||||
if (errno == EINTR) {
|
||||
if (--retries < 0) {
|
||||
/* give up... */
|
||||
if (!noFork) {
|
||||
(void) _exit(1);
|
||||
}
|
||||
(void) alarm(0);
|
||||
(void) close(s);
|
||||
s = -1;
|
||||
return;
|
||||
}
|
||||
|
||||
/* we need to resend before doing another read... */
|
||||
doRead = 0;
|
||||
} else {
|
||||
/* give up... */
|
||||
if (!noFork) {
|
||||
(void) _exit(1);
|
||||
}
|
||||
(void) alarm(0);
|
||||
(void) close(s);
|
||||
s = -1;
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
/* got ack... */
|
||||
(void) alarm(0);
|
||||
|
||||
/* null term the string... */
|
||||
rbuffer[len] = '\0';
|
||||
|
||||
/* compare it against the id... */
|
||||
if (!strncmp(rbuffer, thisId, strlen(thisId))) {
|
||||
/* match... */
|
||||
doRead = 0;
|
||||
retries = 0;
|
||||
break;
|
||||
}
|
||||
/* ignore it and get the next one... */
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* clear the alarm and re-install the old signal handler... */
|
||||
(void) alarm(0);
|
||||
(void) sigaction(SIGALRM, &oldSa, (struct sigaction *) 0);
|
||||
if (!noFork) {
|
||||
_exit(0);
|
||||
}
|
||||
free(sbuffer);
|
||||
return;
|
||||
}
|
||||
|
||||
static void
|
||||
ding(int sig)
|
||||
{
|
||||
/* since we are using sigaction, we don't need to reinstall
|
||||
* ourself...
|
||||
*/
|
||||
}
|
||||
|
||||
#ifdef DEBUG_LOGIT
|
||||
int
|
||||
logitmain(int argc, char **argv)
|
||||
{
|
||||
int i1;
|
||||
int noFork = 0;
|
||||
extern char *optarg;
|
||||
extern int optind, optopt;
|
||||
|
||||
while(EOF != (i1 = getopt(argc, argv, "f"))) {
|
||||
switch(i1) {
|
||||
case 'f' :
|
||||
noFork = 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
(void) LogStart(noFork, argc, argv);
|
||||
(void) sleep(5);
|
||||
/*
|
||||
(void) LogFinish(noFork, 123);
|
||||
*/
|
||||
}
|
||||
#endif /* DEBUG_LOGIT */
|
||||
#endif /* LOG_USAGE */
|
||||
28
cde/programs/dtterm/DtTermLogit.h
Normal file
28
cde/programs/dtterm/DtTermLogit.h
Normal file
@@ -0,0 +1,28 @@
|
||||
/*
|
||||
* $XConsortium: DtTermLogit.h /main/3 1995/10/31 11:16:43 rswiston $";
|
||||
*/
|
||||
|
||||
/* *
|
||||
* (c) Copyright 1993, 1994 Hewlett-Packard Company *
|
||||
* (c) Copyright 1993, 1994 International Business Machines Corp. *
|
||||
* (c) Copyright 1993, 1994 Sun Microsystems, Inc. *
|
||||
* (c) Copyright 1993, 1994 Novell, Inc. *
|
||||
*/
|
||||
|
||||
#ifndef _DtTermLogit_h
|
||||
#define _DtTermLogit_h
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
void LogStart(int noFork, int argc, char **argv);
|
||||
void LogFinish(int noFork, int sessions);
|
||||
void LogBumpSessionCount(int count);
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* close scope of 'extern "C"'... */
|
||||
#endif /* __cplusplus */
|
||||
|
||||
/* DON'T ADD ANYTHING AFTER THIS #endif... */
|
||||
#endif /* _DtTermLogit_h */
|
||||
2098
cde/programs/dtterm/DtTermMain.c
Normal file
2098
cde/programs/dtterm/DtTermMain.c
Normal file
File diff suppressed because it is too large
Load Diff
24
cde/programs/dtterm/DtTermMain.h
Normal file
24
cde/programs/dtterm/DtTermMain.h
Normal file
@@ -0,0 +1,24 @@
|
||||
/*
|
||||
* $XConsortium: DtTermMain.h /main/3 1995/10/31 11:17:25 rswiston $";
|
||||
*/
|
||||
|
||||
/* *
|
||||
* (c) Copyright 1993, 1994 Hewlett-Packard Company *
|
||||
* (c) Copyright 1993, 1994 International Business Machines Corp. *
|
||||
* (c) Copyright 1993, 1994 Sun Microsystems, Inc. *
|
||||
* (c) Copyright 1993, 1994 Novell, Inc. *
|
||||
*/
|
||||
|
||||
#ifndef _DtTermMain_h
|
||||
#define _DtTermMain_h
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* close scope of 'extern "C"'... */
|
||||
#endif /* __cplusplus */
|
||||
|
||||
/* DON'T ADD ANYTHING AFTER THIS #endif... */
|
||||
#endif /* _DtTermMain_h */
|
||||
760
cde/programs/dtterm/DtTermServer.c
Normal file
760
cde/programs/dtterm/DtTermServer.c
Normal file
@@ -0,0 +1,760 @@
|
||||
#ifndef lint
|
||||
#ifdef VERBOSE_REV_INFO
|
||||
static char rcs_id[] = "$TOG: DtTermServer.c /main/5 1998/07/23 18:09:38 mgreess $";
|
||||
#endif /* VERBOSE_REV_INFO */
|
||||
#endif /* lint */
|
||||
|
||||
/* *
|
||||
* (c) Copyright 1993, 1994 Hewlett-Packard Company *
|
||||
* (c) Copyright 1993, 1994 International Business Machines Corp. *
|
||||
* (c) Copyright 1993, 1994 Sun Microsystems, Inc. *
|
||||
* (c) Copyright 1993, 1994 Novell, Inc. *
|
||||
*/
|
||||
|
||||
#include <sys/types.h>
|
||||
#ifdef TERMINAL_SERVER
|
||||
#include "TermHeader.h"
|
||||
#include "TermPrimDebug.h"
|
||||
#include "TermView.h"
|
||||
#include "DtTermServer.h"
|
||||
#include "TermPrimSetPty.h"
|
||||
#ifdef LOG_USAGE
|
||||
#include "DtTermLogit.h"
|
||||
#endif /* LOG_USAGE */
|
||||
#include <signal.h>
|
||||
#include <errno.h>
|
||||
#include <Dt/Service.h>
|
||||
|
||||
/* defines for types of service requests. Upper case for the requestor
|
||||
* types, lower case for the server types...
|
||||
*/
|
||||
#define SVC_SUCCESS 'S'
|
||||
#define SVC_FAIL 'F'
|
||||
#define SVC_NOTIFY 'N'
|
||||
|
||||
#define SVC_REQUEST 'r'
|
||||
#define SVC_LOSE 'l'
|
||||
|
||||
#define DTTERM_SVC_CLASS "DTTERM"
|
||||
#define DTTERM_SVC_START_MSG "DTTERM-START"
|
||||
#define DTTERM_SVC_TERMINATE_MSG "DTTERM-TERMINATE"
|
||||
#define DTTERM_SVC_TERMINATION_MSG "DTTERM-TERMINATION"
|
||||
|
||||
static XtIntervalId pingId = (XtIntervalId) 0;
|
||||
int PingInterval = 5;
|
||||
|
||||
#ifdef TIMEOUT
|
||||
#define STICKAROUND 15 /* 15 minutes... */
|
||||
static XtIntervalId waitId = (XtIntervalId) 0;
|
||||
#endif /* TIMEOUT */
|
||||
|
||||
static Boolean ExitOnLastClose;
|
||||
|
||||
static char *serviceName = (char *) 0;
|
||||
static DtSvcHandle serviceHandle;
|
||||
static Boolean iAmTheServer = False;
|
||||
static Boolean waitingForReply = False;
|
||||
static Boolean waitedForReply = False;
|
||||
static Widget refWidget;
|
||||
char *ServerFailureMessage = (char *) 0;
|
||||
int ServerFailureErrno = 0;
|
||||
int InstanceCount = 0;
|
||||
|
||||
typedef struct _ServiceClientInfoRec {
|
||||
pid_t pid;
|
||||
Widget shellWidget;
|
||||
struct _ServiceClientInfoRec *prev;
|
||||
struct _ServiceClientInfoRec *next;
|
||||
} ServiceClientInfoRec, *ServiceClientInfo;
|
||||
|
||||
static ServiceClientInfoRec serviceClientInfoHeadRec;
|
||||
static ServiceClientInfo serviceClientInfoHead = &serviceClientInfoHeadRec;
|
||||
static Boolean initFlag = False;
|
||||
|
||||
static void Initialize(
|
||||
Widget topLevel,
|
||||
int argc,
|
||||
char **argv,
|
||||
char *serverId
|
||||
);
|
||||
|
||||
static void clientMessageProc(
|
||||
DtSvcHandle service,
|
||||
Pointer clientData,
|
||||
String *messageFields,
|
||||
int numFields
|
||||
);
|
||||
|
||||
static void serverRequestProc(
|
||||
DtSvcHandle service,
|
||||
DtSvcMsgContext replyContext,
|
||||
Pointer clientData,
|
||||
String *messageFields,
|
||||
int numFields
|
||||
);
|
||||
|
||||
static void serverMessageProc(
|
||||
DtSvcHandle service,
|
||||
Pointer clientData,
|
||||
String *messageFields,
|
||||
int numFields
|
||||
);
|
||||
|
||||
static void Ping(
|
||||
XtPointer clientData,
|
||||
XtIntervalId *id
|
||||
);
|
||||
|
||||
#ifdef TIMEOUT
|
||||
static void TimeOut(
|
||||
XtPointer clientData,
|
||||
XtIntervalId *id
|
||||
);
|
||||
#endif /* TIMEOUT */
|
||||
|
||||
static void CleanUp(
|
||||
int sig
|
||||
);
|
||||
|
||||
|
||||
static const int trapSignalList[] = {
|
||||
SIGINT,
|
||||
SIGQUIT,
|
||||
SIGTERM,
|
||||
SIGUSR1,
|
||||
SIGUSR2,
|
||||
};
|
||||
|
||||
/*ARGSUSED*/
|
||||
static void
|
||||
Initialize(
|
||||
Widget topLevel,
|
||||
int argc,
|
||||
char **argv,
|
||||
char *serverId
|
||||
)
|
||||
{
|
||||
char hostname[BUFSIZ];
|
||||
int i;
|
||||
pid_t pid;
|
||||
struct sigaction sa;
|
||||
|
||||
if (initFlag) {
|
||||
/* already initialized... */
|
||||
return;
|
||||
}
|
||||
|
||||
refWidget = topLevel;
|
||||
|
||||
#ifdef NOTDEF
|
||||
/* build a service name. The service name needs to be application,
|
||||
* host, and username specific. Since we are talking through the
|
||||
* display connection, it will already be display specific.
|
||||
* The format of the service name will be "DTTERM-hostname-uid"
|
||||
* (i.e., "DTTERM-hpcvxds.cv.hp.com-201")...
|
||||
*/
|
||||
char *buffer = (char*) malloc(BUFSIZ);
|
||||
if (gethostname(hostname, sizeof(hostname))) {
|
||||
(void) strcpy(hostname, "unknown");
|
||||
}
|
||||
(void) sprintf(buffer, "%s-%s-%ld", DTTERM_SVC_CLASS, hostname, (long)getuid());
|
||||
serviceName = XtMalloc(strlen(buffer) + 1);
|
||||
(void) strcpy(serviceName, buffer);
|
||||
free(buffer);
|
||||
#endif /* NOTDEF */
|
||||
|
||||
/* we will use serverId as the service name... */
|
||||
serviceName = XtMalloc(strlen(serverId) + 1);
|
||||
(void) strcpy(serviceName, serverId);
|
||||
|
||||
/* get a handle... */
|
||||
serviceHandle = _DtSvcNewHandle(serviceName, refWidget);
|
||||
|
||||
/* register with the server... */
|
||||
if (DT_SVC_SUCCESS == _DtSvcRegister(
|
||||
serviceHandle,
|
||||
False,
|
||||
serverRequestProc,
|
||||
(XtPointer) SVC_REQUEST,
|
||||
serverMessageProc,
|
||||
(XtPointer) SVC_LOSE)) {
|
||||
|
||||
/* We are the new server. We need to do several things:
|
||||
*
|
||||
* -fork ourself off. The server needs to run as a child of
|
||||
* our application so that it can stay around when our session
|
||||
* is done.
|
||||
*
|
||||
* -dissassociate ourself from our parent.
|
||||
*
|
||||
* -have the child re-exec ourself. This will allow the child
|
||||
* to request a session and talk to us as any other normal
|
||||
* requestor process.
|
||||
*/
|
||||
/* if the 'n' flag is set, we will not daemonize ourself (i.e.,
|
||||
* fork off and run as a child of the current process)...
|
||||
*/
|
||||
if (!isDebugSet('n')) {
|
||||
for (i = 0; (i < 10) && ((pid = fork()) < 0); i++) {
|
||||
/* if we are out of process slots, then let's sleep
|
||||
* a bit and try again...
|
||||
*/
|
||||
if (errno != EAGAIN) {
|
||||
break;
|
||||
}
|
||||
|
||||
/* give it a chance to clear up... */
|
||||
(void) sleep((unsigned long) 2);
|
||||
}
|
||||
} else {
|
||||
pid = 0;
|
||||
}
|
||||
|
||||
if (pid < 0) {
|
||||
/* can't do much of anything and we haven't done much of
|
||||
* anything. Let's just error out...
|
||||
*/
|
||||
(void) perror("fork()");
|
||||
(void) exit(1);
|
||||
} else if (pid > 0) {
|
||||
/* parent. Let's clean up, restart, and let the new process
|
||||
* try again...
|
||||
*/
|
||||
/* close the server connection... */
|
||||
(void) close(ConnectionNumber(XtDisplay(refWidget)));
|
||||
(void) execvp(argv[0], argv);
|
||||
(void) perror(argv[0]);
|
||||
(void) _exit(1);
|
||||
}
|
||||
|
||||
/* child server process...
|
||||
*/
|
||||
/* set the iAmTheServer flag to True. This flag will remain True
|
||||
* until we lose ownership of the service...
|
||||
*/
|
||||
iAmTheServer = True;
|
||||
|
||||
/* set up signal handlers so that we can clean up nicely... */
|
||||
(void) sigemptyset(&sa.sa_mask);
|
||||
sa.sa_flags = 0;
|
||||
sa.sa_handler = CleanUp;
|
||||
|
||||
for (i = 0; i < (sizeof(trapSignalList) / sizeof(trapSignalList[0]));
|
||||
i++) {
|
||||
(void) sigaction(trapSignalList[i], &sa, (struct sigaction *) 0);
|
||||
}
|
||||
|
||||
/* register for service. This will allow us to deal with the
|
||||
* case where we lose ownership of the service. We will then
|
||||
* be able to listen to termination requests from our client
|
||||
* applications and shut down the sessions when requested to
|
||||
* do so...
|
||||
*/
|
||||
(void) _DtSvcNotifyGroupRegister(
|
||||
serviceHandle,
|
||||
serverMessageProc,
|
||||
(XtPointer) SVC_NOTIFY);
|
||||
|
||||
/* get our initial tty modes before we go and create a new
|
||||
* session id...
|
||||
*/
|
||||
(void) _DtTermPrimPtyGetDefaultModes();
|
||||
|
||||
/* new session group... */
|
||||
(void) setsid();
|
||||
} else {
|
||||
|
||||
/* we are not the server. We need to register for messages. Then
|
||||
* we are done and the service world is now for us...
|
||||
*/
|
||||
(void) _DtSvcNotifyGroupRegister(
|
||||
serviceHandle,
|
||||
clientMessageProc,
|
||||
(XtPointer) SVC_NOTIFY);
|
||||
}
|
||||
|
||||
/* install a ping timeout... */
|
||||
if (PingInterval > 0) {
|
||||
pingId = XtAppAddTimeOut(XtWidgetToApplicationContext(topLevel),
|
||||
1000 * 60 * PingInterval, Ping, (XtPointer) topLevel);
|
||||
}
|
||||
|
||||
/* make sure we are never called again... */
|
||||
initFlag = True;
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
NiceCleanUp(
|
||||
XtPointer clientData,
|
||||
XtIntervalId *id
|
||||
)
|
||||
{
|
||||
ServiceClientInfo serviceClientInfo;
|
||||
char buffer[BUFSIZ];
|
||||
String args[20];
|
||||
int argcnt;
|
||||
|
||||
/* find the serviceClientInfoRec for this widget... */
|
||||
for (serviceClientInfo = serviceClientInfoHead->next; serviceClientInfo;
|
||||
serviceClientInfo = serviceClientInfo->next) {
|
||||
|
||||
/* notify each client that the session (is being) terminated... */
|
||||
argcnt = 0;
|
||||
(void) sprintf(buffer, "%ld", (long)serviceClientInfo->pid);
|
||||
args[argcnt] = buffer; argcnt++;
|
||||
(void) _DtSvcNotifySend(
|
||||
serviceHandle,
|
||||
DTTERM_SVC_TERMINATION_MSG,
|
||||
args,
|
||||
argcnt);
|
||||
(void) XSync(XtDisplay(refWidget), 0);
|
||||
}
|
||||
|
||||
/* we can now exit... */
|
||||
(void) exit(1);
|
||||
}
|
||||
|
||||
static void
|
||||
CleanUp(
|
||||
int sig
|
||||
)
|
||||
{
|
||||
static Boolean firstTime = True;
|
||||
|
||||
if (firstTime) {
|
||||
/* let's try to do this nicely and invoke our cleanup routine
|
||||
* via the toolkit (i.e., outside of a signal handler)...
|
||||
*/
|
||||
(void) XtAppAddTimeOut(XtWidgetToApplicationContext(refWidget),
|
||||
0, NiceCleanUp, (XtPointer) refWidget);
|
||||
firstTime = False;
|
||||
} else {
|
||||
/* we have received multiple attempts to kill ourself. Just
|
||||
* exit...
|
||||
*/
|
||||
(void) exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*ARGSUSED*/
|
||||
static void
|
||||
serverMessageProc(
|
||||
DtSvcHandle service,
|
||||
Pointer clientData,
|
||||
String *messageFields,
|
||||
int numFields
|
||||
)
|
||||
{
|
||||
switch ((int) clientData) {
|
||||
case SVC_LOSE:
|
||||
/* we lost control of the service... */
|
||||
iAmTheServer = False;
|
||||
|
||||
if (InstanceCount <= 0) {
|
||||
/* no reason to stay around... */
|
||||
(void) _DtSvcDestroyHandle(serviceHandle);
|
||||
(void) exit(0);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*ARGSUSED*/
|
||||
static void
|
||||
serverRequestProc(
|
||||
DtSvcHandle service,
|
||||
DtSvcMsgContext replyContext,
|
||||
Pointer clientData,
|
||||
String *messageFields,
|
||||
int numFields
|
||||
)
|
||||
{
|
||||
Widget shellWidget;
|
||||
ServiceClientInfo serviceClientInfo;
|
||||
char buffer[BUFSIZ];
|
||||
String reply[20];
|
||||
pid_t pid = -1;
|
||||
Arg arglist[20];
|
||||
int i1;
|
||||
int i2;
|
||||
int argcnt = 0;
|
||||
char **commandToExecute = (char **) 0;
|
||||
|
||||
switch ((int) clientData) {
|
||||
case SVC_REQUEST:
|
||||
if (!strcmp(messageFields[0], DTTERM_SVC_START_MSG)) {
|
||||
/* create our shell widget... */
|
||||
argcnt = 0;
|
||||
(void) XtSetArg(arglist[argcnt], XmNallowShellResize, True);
|
||||
argcnt++;
|
||||
shellWidget = XtAppCreateShell((char *) 0, "Dtterm",
|
||||
applicationShellWidgetClass, XtDisplay((Widget) refWidget),
|
||||
arglist, argcnt);
|
||||
|
||||
/* parse off messageFields and build the dttermview arglist... */
|
||||
argcnt = 0;
|
||||
|
||||
for (i2 = 1; i2 < numFields; i2++) {
|
||||
if (!strcmp(messageFields[i2], "-pid")) {
|
||||
(void) i2++;
|
||||
if (i2 < numFields) {
|
||||
pid = (pid_t) strtol(messageFields[i2], (char **) 0, 0);
|
||||
}
|
||||
|
||||
} else if (!strcmp(messageFields[i2], "-ls")) {
|
||||
(void) XtSetArg(arglist[argcnt], XmNloginShell,
|
||||
True); argcnt++;
|
||||
|
||||
} else if (!strcmp(messageFields[i2], "+ls")) {
|
||||
(void) XtSetArg(arglist[argcnt], XmNloginShell,
|
||||
False); argcnt++;
|
||||
|
||||
} else if (!strcmp(messageFields[i2], "-e")) {
|
||||
(void) i2++;
|
||||
if (i2 < numFields) {
|
||||
/* DKS: somewhere we will need to free this... */
|
||||
commandToExecute = (char **)
|
||||
XtMalloc((numFields - i2 + 1) *
|
||||
sizeof(char *));
|
||||
for (i1 = 0; i2 < numFields; i1++, i2++) {
|
||||
commandToExecute[i1] = messageFields[i2];
|
||||
}
|
||||
/* null term commandToExecute... */
|
||||
commandToExecute[i1] = (char *) 0;
|
||||
(void) XtSetArg(arglist[argcnt], XmNsubprocessArgv,
|
||||
commandToExecute); argcnt++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* create the dtterm... */
|
||||
(void) CreateInstance(shellWidget, "Dtterm",
|
||||
arglist, argcnt);
|
||||
|
||||
/* create the ServiceClientInfoRec for this instance...
|
||||
*/
|
||||
serviceClientInfo =
|
||||
(ServiceClientInfo) XtMalloc(sizeof(ServiceClientInfoRec));
|
||||
serviceClientInfo->pid = pid;
|
||||
serviceClientInfo->shellWidget = shellWidget;
|
||||
/* insert it at the head of the list... */
|
||||
serviceClientInfo->next = serviceClientInfoHead->next;
|
||||
serviceClientInfo->prev = serviceClientInfoHead;
|
||||
if (serviceClientInfoHead->next) {
|
||||
serviceClientInfoHead->next->prev = serviceClientInfo;
|
||||
}
|
||||
serviceClientInfoHead->next = serviceClientInfo;
|
||||
|
||||
(void) XtRealizeWidget(shellWidget);
|
||||
|
||||
InstanceCount++;
|
||||
/* since we now have active instances, we can remove our
|
||||
* wait timeout...
|
||||
*/
|
||||
#ifdef TIMEOUT
|
||||
if (waitId) {
|
||||
(void) XtRemoveTimeOut(waitId);
|
||||
waitId = (XtIntervalId) 0;
|
||||
}
|
||||
#endif /* TIMEOUT */
|
||||
|
||||
/* ack the reply... */
|
||||
i2 = 0;
|
||||
(void) sprintf(buffer, "0x%lx", shellWidget);
|
||||
reply[i2] = buffer; i2++;
|
||||
(void) _DtSvcRequestReply(
|
||||
serviceHandle,
|
||||
replyContext,
|
||||
reply,
|
||||
i2,
|
||||
True);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*ARGSUSED*/
|
||||
static void
|
||||
clientMessageProc(
|
||||
DtSvcHandle service,
|
||||
Pointer clientData,
|
||||
String *messageFields,
|
||||
int numFields
|
||||
)
|
||||
{
|
||||
int i1;
|
||||
pid_t pid;
|
||||
char buffer[BUFSIZ];
|
||||
|
||||
switch ((int) clientData) {
|
||||
case SVC_NOTIFY:
|
||||
/* process the notify message... */
|
||||
if (!strcmp(messageFields[0], DTTERM_SVC_TERMINATION_MSG)) {
|
||||
if (numFields >= 2) {
|
||||
pid = (pid_t) strtol(messageFields[1], (char **) 0, 0);
|
||||
} else {
|
||||
pid = -1;
|
||||
}
|
||||
|
||||
if (pid == getpid()) {
|
||||
/* our session terminated -- exit... */
|
||||
(void) _DtSvcDestroyHandle(serviceHandle);
|
||||
(void) exit(0);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case SVC_FAIL:
|
||||
/* turn on the waitingForReply flag... */
|
||||
waitingForReply = False;
|
||||
/* set the waitedForReply flag to True (i.e., failure)... */
|
||||
waitedForReply = True;
|
||||
|
||||
/* get errno (if returned)... */
|
||||
if (numFields >= 2) {
|
||||
errno = (int) strtol(messageFields[1], (char **) 0, 0);
|
||||
}
|
||||
/* build any failure message... */
|
||||
*buffer = '\0';
|
||||
for (i1 = 2; i1 < numFields; i1++) {
|
||||
if (*buffer) {
|
||||
(void) strcat(buffer, " ");
|
||||
}
|
||||
(void) strcat(buffer, messageFields[i1]);
|
||||
}
|
||||
ServerFailureMessage =
|
||||
XtRealloc(ServerFailureMessage,
|
||||
strlen(buffer));
|
||||
(void) strcpy(ServerFailureMessage, buffer);
|
||||
break;
|
||||
|
||||
case SVC_SUCCESS:
|
||||
/* turn on the waitingForReply flag... */
|
||||
waitingForReply = False;
|
||||
/* set the waitedForReply flag to False (i.e., success)... */
|
||||
waitedForReply = False;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Boolean
|
||||
ServerStartSession(
|
||||
Widget topLevel,
|
||||
int argc,
|
||||
char **argv,
|
||||
Boolean server,
|
||||
char *serverId,
|
||||
Boolean exitOnLastClose,
|
||||
Boolean block,
|
||||
Boolean loginShell,
|
||||
char **commandToExec
|
||||
)
|
||||
{
|
||||
char buffer[BUFSIZ];
|
||||
String args[20];
|
||||
int argcnt;
|
||||
int i1;
|
||||
XEvent event;
|
||||
XtAppContext appContext;
|
||||
|
||||
ExitOnLastClose = exitOnLastClose;
|
||||
|
||||
(void) Initialize(topLevel, argc, argv, serverId);
|
||||
if (iAmTheServer) {
|
||||
/* we are the server. We need to wait for our clients to make
|
||||
* a request of us.
|
||||
*/
|
||||
|
||||
#ifdef LOG_USAGE
|
||||
/* log our startup... */
|
||||
(void) LogStart(0, argc, argv);
|
||||
#endif /* LOG_USAGE */
|
||||
|
||||
return(True);
|
||||
}
|
||||
|
||||
/* if we go to this point and the -server option was specified, we
|
||||
* should go away. Otherwise we should request service...
|
||||
*/
|
||||
if (server) {
|
||||
/* all that was requested was creation of a server. We can go
|
||||
* away now...
|
||||
*/
|
||||
(void) exit(0);
|
||||
}
|
||||
|
||||
/* make a request of the server to start a session...
|
||||
*/
|
||||
/* need 2 for "-pid" and "<pid>"... */
|
||||
argcnt = 2;
|
||||
if (commandToExec && *commandToExec) {
|
||||
/* need one for "-e"... */
|
||||
(void) argcnt++;
|
||||
|
||||
/* need one for each string in the command... */
|
||||
/*EMPTY*/
|
||||
for (i1 = 0; commandToExec[i1]; i1++) {
|
||||
;
|
||||
}
|
||||
argcnt += i1;
|
||||
}
|
||||
|
||||
argcnt = 0;
|
||||
args[argcnt] = "-pid"; argcnt++;
|
||||
(void) sprintf(buffer, "%ld", (long)getpid());
|
||||
args[argcnt] = buffer; argcnt++;
|
||||
|
||||
if (loginShell) {
|
||||
args[argcnt] = "-ls"; argcnt++;
|
||||
} else {
|
||||
args[argcnt] = "+ls"; argcnt++;
|
||||
}
|
||||
|
||||
if (commandToExec && *commandToExec) {
|
||||
args[argcnt] = "-e"; argcnt++;
|
||||
for (i1 = 0; commandToExec[i1]; i1++) {
|
||||
args[argcnt] = commandToExec[i1]; argcnt++;
|
||||
}
|
||||
}
|
||||
|
||||
if (DT_SVC_FAIL == _DtSvcRequestSend(
|
||||
serviceHandle,
|
||||
DTTERM_SVC_START_MSG,
|
||||
args,
|
||||
argcnt,
|
||||
clientMessageProc,
|
||||
(XtPointer) SVC_SUCCESS,
|
||||
clientMessageProc,
|
||||
(XtPointer) SVC_FAIL)) {
|
||||
(void) fprintf(stderr, "request to server failed\n");
|
||||
return(True);
|
||||
}
|
||||
|
||||
/* dispatch locally until we get back the results from our server... */
|
||||
appContext = XtWidgetToApplicationContext(topLevel);
|
||||
for (waitingForReply = True; waitingForReply; ) {
|
||||
(void) XtAppNextEvent(appContext, &event);
|
||||
(void) XtDispatchEvent(&event);
|
||||
}
|
||||
|
||||
if (!block) {
|
||||
/* we succeeded, we can exit now... */
|
||||
(void) _DtSvcDestroyHandle(serviceHandle);
|
||||
(void) exit(0);
|
||||
}
|
||||
|
||||
return(waitedForReply);
|
||||
}
|
||||
|
||||
void
|
||||
ServerInstanceTerminated(
|
||||
Widget w
|
||||
)
|
||||
{
|
||||
ServiceClientInfo serviceClientInfo;
|
||||
char buffer[BUFSIZ];
|
||||
String args[20];
|
||||
int argcnt;
|
||||
|
||||
/* find the serviceClientInfoRec for this widget... */
|
||||
for (serviceClientInfo = serviceClientInfoHead->next; serviceClientInfo;
|
||||
serviceClientInfo = serviceClientInfo->next) {
|
||||
if (serviceClientInfo->shellWidget == w) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (serviceClientInfo && (serviceClientInfo->shellWidget == w)) {
|
||||
/* notify the client that the session terminated... */
|
||||
argcnt = 0;
|
||||
(void) sprintf(buffer, "%ld", (long)serviceClientInfo->pid);
|
||||
args[argcnt] = buffer; argcnt++;
|
||||
(void) _DtSvcNotifySend(
|
||||
serviceHandle,
|
||||
DTTERM_SVC_TERMINATION_MSG,
|
||||
args,
|
||||
argcnt);
|
||||
|
||||
/* free up the serviceClientInfoRec... */
|
||||
serviceClientInfo->prev->next = serviceClientInfo->next;
|
||||
if (serviceClientInfo->next) {
|
||||
serviceClientInfo->next->prev = serviceClientInfo->prev;
|
||||
}
|
||||
(void) XtFree((char *) serviceClientInfo);
|
||||
}
|
||||
|
||||
if ((--InstanceCount <= 0) && (!iAmTheServer)) {
|
||||
(void) _DtSvcDestroyHandle(serviceHandle);
|
||||
(void) exit(0);
|
||||
} else
|
||||
#ifdef TIMEOUT
|
||||
if ((InstanceCount <= 0) && !waitId) {
|
||||
/* set up a wait timeout and stick around for a while before
|
||||
* we exit...
|
||||
*/
|
||||
waitId = XtAppAddTimeOut(XtWidgetToApplicationContext(refWidget),
|
||||
1000 * 60 * STICKAROUND, TimeOut, (XtPointer) refWidget);
|
||||
}
|
||||
#endif /* TIMEOUT */
|
||||
|
||||
if ((InstanceCount <= 0) && ExitOnLastClose) {
|
||||
(void) exit(0);
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef TIMEOUT
|
||||
static void
|
||||
TimeOut(
|
||||
XtPointer clientData,
|
||||
XtIntervalId *id
|
||||
)
|
||||
{
|
||||
/* if we have no instances active, go away... */
|
||||
if (InstanceCount <= 0) {
|
||||
(void) exit(0);
|
||||
}
|
||||
|
||||
/* otherwise, clear the waitId... */
|
||||
if (*id == waitId) {
|
||||
waitId = (XtIntervalId) 0;
|
||||
}
|
||||
}
|
||||
#endif /* TIMEOUT */
|
||||
|
||||
static void
|
||||
Ping(
|
||||
XtPointer clientData,
|
||||
XtIntervalId *id
|
||||
)
|
||||
{
|
||||
Widget w = (Widget) clientData;
|
||||
Window root;
|
||||
Window child;
|
||||
int rootX;
|
||||
int rootY;
|
||||
int winX;
|
||||
int winY;
|
||||
unsigned int mask;
|
||||
|
||||
if (*id != pingId) {
|
||||
return;
|
||||
}
|
||||
|
||||
/* cause a round trip to the server... */
|
||||
(void) XQueryPointer(XtDisplay(w), XtWindow(w), &root, &child,
|
||||
&rootX, &rootY, &winX, &winY, &mask);
|
||||
|
||||
/* reset the timeout... */
|
||||
if (PingInterval > 0) {
|
||||
pingId = XtAppAddTimeOut(XtWidgetToApplicationContext(w),
|
||||
1000 * 60 * PingInterval, Ping, clientData);
|
||||
}
|
||||
}
|
||||
#else
|
||||
/* dummy variable to get pass compilation phase */
|
||||
static char *foo;
|
||||
#endif /* TERMINAL_SERVER */
|
||||
45
cde/programs/dtterm/DtTermServer.h
Normal file
45
cde/programs/dtterm/DtTermServer.h
Normal file
@@ -0,0 +1,45 @@
|
||||
/*
|
||||
* $XConsortium: DtTermServer.h /main/3 1995/10/31 11:17:48 rswiston $";
|
||||
*/
|
||||
|
||||
/*
|
||||
* (c) Copyright 1993, 1994 Hewlett-Packard Company *
|
||||
* (c) Copyright 1993, 1994 International Business Machines Corp. *
|
||||
* (c) Copyright 1993, 1994 Sun Microsystems, Inc. *
|
||||
* (c) Copyright 1993, 1994 Novell, Inc. *
|
||||
*/
|
||||
|
||||
#ifndef _DtTermServer_h
|
||||
#define _DtTermServer_h
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
extern char *ServerFailureMessage;
|
||||
extern int ServerFailureErrno;
|
||||
extern int InstanceCount;
|
||||
extern int PingInterval;
|
||||
|
||||
extern Boolean ServerStartSession(
|
||||
Widget topLevel,
|
||||
int argc,
|
||||
char **argv,
|
||||
Boolean server,
|
||||
char *serverId,
|
||||
Boolean exitOnLastClose,
|
||||
Boolean block,
|
||||
Boolean loginShell,
|
||||
char **commandToExec
|
||||
);
|
||||
|
||||
extern void ServerInstanceTerminated(
|
||||
Widget w
|
||||
);
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* close scope of 'extern "C"'... */
|
||||
#endif /* __cplusplus */
|
||||
|
||||
/* DON'T ADD ANYTHING AFTER THIS #endif... */
|
||||
#endif /* _DtTermServer_h */
|
||||
292
cde/programs/dtterm/DtTermSyntax.c
Normal file
292
cde/programs/dtterm/DtTermSyntax.c
Normal file
@@ -0,0 +1,292 @@
|
||||
#ifndef lint
|
||||
#ifdef VERBOSE_REV_INFO
|
||||
static char rcs_id[] = "$XConsortium: DtTermSyntax.c /main/4 1996/05/16 11:22:57 ageorge $";
|
||||
#endif /* VERBOSE_REV_INFO */
|
||||
#endif /* lint */
|
||||
|
||||
/* *
|
||||
* (c) Copyright 1993, 1994 Hewlett-Packard Company *
|
||||
* (c) Copyright 1993, 1994 International Business Machines Corp. *
|
||||
* (c) Copyright 1993, 1994 Sun Microsystems, Inc. *
|
||||
* (c) Copyright 1993, 1994 Novell, Inc. *
|
||||
*/
|
||||
|
||||
#include "TermHeader.h"
|
||||
#include "TermPrimMessageCatI.h"
|
||||
struct _options {
|
||||
char *opt;
|
||||
char *desc;
|
||||
struct _options *next;
|
||||
};
|
||||
|
||||
static struct _options *optHead;
|
||||
static struct _options *messageHead;
|
||||
|
||||
static char *options_default[] = {
|
||||
"-/+132 enable/disable 80<->132 column escape seq",
|
||||
"-/+aw enable/disable autowrap",
|
||||
"-/+bs turn off/on Term background is select color",
|
||||
"-display displayname X server to contact",
|
||||
"-e command args command to execute",
|
||||
"-fb fontset bold text font",
|
||||
"-fn fontset normal text font",
|
||||
"-geometry geom size (in characters) and position of window",
|
||||
"-help print out this message",
|
||||
"-/+iconic start/do not start iconic",
|
||||
"-/+j enable/disable jump scroll",
|
||||
"-/+kshMode enable/disable ksh mode",
|
||||
"-/+l enable/disable logging",
|
||||
"-lf filename logging filename",
|
||||
"-/+ls enable/disable login shell",
|
||||
"-/+map enable/disable map window on pty output",
|
||||
"-/+mb enable/disable margin bell",
|
||||
"-ms color pointer color",
|
||||
"-n string specify icon name",
|
||||
"-name string client instance, icon, and title strings",
|
||||
"-nb distance specify distance for right margin bell",
|
||||
"-/+rw enable/disable reverse wrap",
|
||||
"-/+sb enable/disable scroll bar",
|
||||
"-/+sf enable/disable SUN function keys",
|
||||
"-sl number[s] number of scrolled lines [screens] to save",
|
||||
"-ti name string used for programmatic identification",
|
||||
"-title string title string for window",
|
||||
"-tm string terminal mode keywords and characters",
|
||||
"-tn name TERM environment variable name",
|
||||
"-usage print out this message",
|
||||
"-/+vb enable/disable visual bell",
|
||||
"-xrm resourcestring additional resource specifications",
|
||||
"-C console mode",
|
||||
"-Sxxd slave mode on \"ttyxx\" file descriptor \"d\"",
|
||||
"-Sxxx.d slave mode on \"ttyxxx\" file descriptor \"d\"",
|
||||
"End-Of-List",
|
||||
};
|
||||
|
||||
static char *message_defaults[] = {
|
||||
"The -e option, if given must appear at the end of the command line,",
|
||||
"otherwise the user's default shell will be started. Options that start",
|
||||
"with a plus sign (+) restore the default.",
|
||||
"End-Of-List",
|
||||
};
|
||||
|
||||
static void GetUsage()
|
||||
{
|
||||
register struct _options *optPtr;
|
||||
register int i;
|
||||
register char *c;
|
||||
char *c2;
|
||||
int num_messages;
|
||||
optHead = (struct _options *) 0;
|
||||
optPtr = (struct _options *) 0;
|
||||
|
||||
for (i = 1; ; i++) {
|
||||
/*
|
||||
** get the next option...
|
||||
*/
|
||||
num_messages = i;
|
||||
c2 = GETMESSAGE(NL_SETN_Syntax, i, options_default[i-1]);
|
||||
c = XtMalloc(strlen(c2) + 1);
|
||||
(void) strcpy(c, c2);
|
||||
/*
|
||||
** check and see if we are at the end of the list...
|
||||
*/
|
||||
if (!strcmp(c, "End-Of-List"))
|
||||
break;
|
||||
|
||||
/*
|
||||
** allocate the next entry...
|
||||
*/
|
||||
if (!optHead) {
|
||||
optHead = (struct _options *) malloc(sizeof(struct _options));
|
||||
optPtr = optHead;
|
||||
} else {
|
||||
optPtr->next = (struct _options *) malloc(sizeof(struct _options));
|
||||
optPtr = optPtr->next;
|
||||
}
|
||||
|
||||
#ifdef DKS
|
||||
/*
|
||||
** did we run out of malloc space...
|
||||
*/
|
||||
if (!optPtr) {
|
||||
errno = 0;
|
||||
#ifdef _VUE_NO_PROTO
|
||||
SysError(HPT_MALLOC4);
|
||||
#else /* _VUE_NO_PROTO */
|
||||
SysError(HPT_MALLOC4, NULL);
|
||||
#endif /* _VUE_NO_PROTO */
|
||||
}
|
||||
#endif /* DKS */
|
||||
|
||||
/*
|
||||
** there is no next element yet...
|
||||
*/
|
||||
optPtr->next = (struct _options *) 0;
|
||||
|
||||
/*
|
||||
** the first part of the string is the option...
|
||||
*/
|
||||
optPtr->opt = c;
|
||||
/*
|
||||
** find a tab...
|
||||
*/
|
||||
while (*c && ('\t' != *c))
|
||||
(void) c++;
|
||||
/*
|
||||
** this marks the end of the option...
|
||||
*/
|
||||
if (*c)
|
||||
*c++ = '\0';
|
||||
/*
|
||||
** skip over any more tabs...
|
||||
*/
|
||||
while (*c && ('\t' == *c))
|
||||
(void) c++;
|
||||
/*
|
||||
** and this is the beginning of the option desc..
|
||||
*/
|
||||
optPtr->desc = c;
|
||||
}
|
||||
|
||||
messageHead = (struct _options *) 0;
|
||||
optPtr = (struct _options *) 0;
|
||||
|
||||
for (i = num_messages + 1; ; i++) {
|
||||
/*
|
||||
** get the next message string...
|
||||
*/
|
||||
c2 = GETMESSAGE(NL_SETN_Syntax, i,message_defaults[i - num_messages - 1]);
|
||||
c = XtMalloc(strlen(c2) + 1);
|
||||
(void) strcpy(c, c2);
|
||||
/*
|
||||
** check and see if we are at the end of the list...
|
||||
*/
|
||||
if (!strcmp(c, "End-Of-List"))
|
||||
break;
|
||||
|
||||
/*
|
||||
** allocate the next entry...
|
||||
*/
|
||||
if (!messageHead) {
|
||||
messageHead = (struct _options *) malloc(sizeof(struct _options));
|
||||
optPtr = messageHead;
|
||||
} else {
|
||||
optPtr->next = (struct _options *) malloc(sizeof(struct _options));
|
||||
optPtr = optPtr->next;
|
||||
}
|
||||
|
||||
#ifdef DKS
|
||||
/*
|
||||
** did we run out of malloc space...
|
||||
*/
|
||||
if (!optPtr) {
|
||||
errno = 0;
|
||||
#ifdef _VUE_NO_PROTO
|
||||
SysError(HPT_MALLOC5);
|
||||
#else /* _VUE_NO_PROTO */
|
||||
SysError(HPT_MALLOC5, NULL);
|
||||
#endif /* _VUE_NO_PROTO */
|
||||
}
|
||||
#endif /* DKS */
|
||||
|
||||
/*
|
||||
** there is no next element yet...
|
||||
*/
|
||||
optPtr->next = (struct _options *) 0;
|
||||
|
||||
/*
|
||||
** the entire string is the "desc"...
|
||||
*/
|
||||
optPtr->desc = c;
|
||||
}
|
||||
}
|
||||
|
||||
void Syntax(char *programName, char *badOption)
|
||||
{
|
||||
register struct _options *optPtr;
|
||||
int col;
|
||||
int cols;
|
||||
char *c;
|
||||
char *fmt;
|
||||
int fmtlen;
|
||||
char buffer[BUFSIZ];
|
||||
|
||||
/*
|
||||
** get the usage message string...
|
||||
*/
|
||||
GetUsage();
|
||||
|
||||
/* suppress codecenter "Assignment in conditional 'if' expression."
|
||||
* warning...
|
||||
*/
|
||||
/*SUPPRESS 624*/
|
||||
if (c = getenv("COLUMNS")) cols = atoi(c);
|
||||
else cols = 80;
|
||||
|
||||
(void) fprintf(stderr, (GETMESSAGE(NL_SETN_Syntax,47,
|
||||
"%s: bad command line option \"%s\"\r\n\n")),
|
||||
programName, badOption);
|
||||
|
||||
(void) fprintf(stderr, (GETMESSAGE(NL_SETN_Syntax,48, "usage: %s")),
|
||||
programName);
|
||||
col = 8 + strlen(programName);
|
||||
/*
|
||||
** now that we are NLSized, we need to figure out the width that the
|
||||
** format string adds to each option...
|
||||
*/
|
||||
|
||||
c = GETMESSAGE(NL_SETN_Syntax,50, " [%s]");
|
||||
fmt = XtMalloc(strlen(c) + 1);
|
||||
(void) strcpy(fmt, c);
|
||||
(void) sprintf(buffer, fmt, "");
|
||||
fmtlen = strlen(buffer);
|
||||
|
||||
for (optPtr = optHead; optPtr; optPtr = optPtr->next) {
|
||||
/*DKS*DKS*DKS*
|
||||
** the following 3 assumes that the msg_catalog doesn't add more than
|
||||
** 2 characters to the string...
|
||||
*/
|
||||
int len = fmtlen + strlen(optPtr->opt);
|
||||
if (col + len >= cols) {
|
||||
(void) fprintf(stderr, (GETMESSAGE(NL_SETN_Syntax,49, "\r\n ")));
|
||||
col = 3;
|
||||
}
|
||||
(void) fprintf(stderr, fmt, optPtr->opt);
|
||||
col += len;
|
||||
}
|
||||
(void) fprintf(stderr, (GETMESSAGE(NL_SETN_Syntax,51,
|
||||
"\r\n\nType \"%s -help\" for a full description.\r\n\n")),
|
||||
programName);
|
||||
|
||||
(void) exit(1);
|
||||
}
|
||||
|
||||
void Help(char *programName)
|
||||
{
|
||||
register struct _options *optPtr;
|
||||
int width = 0;
|
||||
|
||||
/*
|
||||
** get the usage message string...
|
||||
*/
|
||||
GetUsage();
|
||||
|
||||
(void) fprintf(stderr, (GETMESSAGE(NL_SETN_Syntax,52, "usage:\n")));
|
||||
(void) fprintf(stderr, (GETMESSAGE(NL_SETN_Syntax,53,
|
||||
"\t%s [-options ...] [-e command args]\n\n")),
|
||||
programName);
|
||||
(void) fprintf(stderr, (GETMESSAGE(NL_SETN_Syntax,54,
|
||||
"where options include:\n")));
|
||||
for (optPtr = optHead; optPtr; optPtr = optPtr->next)
|
||||
if (strlen(optPtr->opt) > (size_t) width) width = strlen(optPtr->opt);
|
||||
|
||||
for (optPtr = optHead; optPtr; optPtr = optPtr->next)
|
||||
(void) fprintf(stderr, " %-*s %s\n", width, optPtr->opt,
|
||||
optPtr->desc);
|
||||
|
||||
(void) fprintf(stderr, "\n");
|
||||
for (optPtr = messageHead; optPtr; optPtr = optPtr->next)
|
||||
(void) fprintf(stderr, "%s\n", optPtr->desc);
|
||||
|
||||
(void) fprintf(stderr, "\n");
|
||||
(void) exit(0);
|
||||
}
|
||||
27
cde/programs/dtterm/DtTermSyntax.h
Normal file
27
cde/programs/dtterm/DtTermSyntax.h
Normal file
@@ -0,0 +1,27 @@
|
||||
/*
|
||||
* $XConsortium: DtTermSyntax.h /main/3 1995/10/31 11:18:08 rswiston $";
|
||||
*/
|
||||
|
||||
/* *
|
||||
* (c) Copyright 1993, 1994 Hewlett-Packard Company *
|
||||
* (c) Copyright 1993, 1994 International Business Machines Corp. *
|
||||
* (c) Copyright 1993, 1994 Sun Microsystems, Inc. *
|
||||
* (c) Copyright 1993, 1994 Novell, Inc. *
|
||||
*/
|
||||
|
||||
#ifndef _DtTermSyntax_h
|
||||
#define _DtTermSyntax_h
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
void Syntax(char *programName, char *badOption);
|
||||
void Help(char *programName);
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* close scope of 'extern "C"'... */
|
||||
#endif /* __cplusplus */
|
||||
|
||||
/* DON'T ADD ANYTHING AFTER THIS #endif... */
|
||||
#endif /* _DtTermSyntax_h */
|
||||
359
cde/programs/dtterm/Dtterm.ad.src
Normal file
359
cde/programs/dtterm/Dtterm.ad.src
Normal file
@@ -0,0 +1,359 @@
|
||||
XCOMM include "Dt"
|
||||
|
||||
!######################################################################
|
||||
!#
|
||||
!# Dtterm
|
||||
!#
|
||||
!# Common Desktop Enviornment (CDE)
|
||||
!#
|
||||
!# Application Defaults for the CDE DT Terminal
|
||||
!#
|
||||
!# (c) Copyright 1993, 1994 Hewlett-Packard Company
|
||||
!# (c) Copyright 1993, 1994 International Business Machines Corp.
|
||||
!# (c) Copyright 1993, 1994 Sun Microsystems, Inc.
|
||||
!# (c) Copyright 1993, 1994 Unix System Labs, Inc., a subsidiary of
|
||||
!# Novell, Inc.
|
||||
!#
|
||||
!######################################################################
|
||||
! When using the following as an xrdb resource, preceed the string
|
||||
! with "Dtterm", i.e., "Dtterm*saveLines: 10s".
|
||||
|
||||
! To make ONLY the terminal text area background a different color:
|
||||
! Dtterm*term.background: dimGray
|
||||
|
||||
! To turn on/off the scroll bar:
|
||||
! *scrollBar: true
|
||||
! *scrollBar: false
|
||||
|
||||
! To turn on/off the visual bell:
|
||||
! *visualBell: true
|
||||
! *visualBell: false
|
||||
|
||||
! To turn on/off initial display of the menu bar:
|
||||
! *menuBar: true
|
||||
! *menuBar: false
|
||||
|
||||
! Since we are bypassing the normal OSF Motif key bindings for terminal
|
||||
! windows, we need to explicitly specify the menu accelerators. These
|
||||
! will disable the menu accelerators which is necessary to allow F10
|
||||
! to be used as a function key:
|
||||
*menu_pulldown.menuAccelerator: <Key>None
|
||||
*menu_popup.menuAccelerator: <Key>None
|
||||
! These will enable the menu accelerators which will allow F10 to act
|
||||
! as the menu pulldown and popup accelerator:
|
||||
!*menu_pulldown.menuAccelerator: <Key>osfMenuBar
|
||||
!*menu_popup.menuAccelerator: <Key>osfMenu
|
||||
|
||||
! The following resources define dtterm's appearance. They follow the
|
||||
! current dtterm widget heirarchy which may change in future releases
|
||||
! of dtterm without notice.
|
||||
!
|
||||
! Widget Class Instance Name
|
||||
! ------------------------------ ----------------
|
||||
! applicationShellWidgetClass "Dtterm"
|
||||
! dtTermViewWidgetClass "dtTermView"
|
||||
! xmFrameWidgetClass "dtTermScrolledWindowFrame"
|
||||
! xmScrolledWindowWidgetClass "dtTermScrolledWindow"
|
||||
! dtTermWidgetClass "dtTerm"
|
||||
!
|
||||
*dtTermView.marginWidth: 3
|
||||
*dtTermView.marginHeight: 3
|
||||
*dtTermScrolledWindowFrame.shadowThickness: 0
|
||||
*dtTermScrolledWindowFrame.shadowType: shadow_etched_in
|
||||
*dtTermScrolledWindowFrame.marginWidth: 0
|
||||
*dtTermScrolledWindowFrame.marginHeight: 0
|
||||
*dtTermScrolledWindow.shadowThickness: 0
|
||||
*dtTermScrolledWindow.scrolledWindowMarginWidth: 0
|
||||
*dtTermScrolledWindow.scrolledWindowMarginHeight: 0
|
||||
*dtTermScrolledWindow.spacing: 2
|
||||
|
||||
#ifndef FALLBACK_RESOURCES
|
||||
#ifdef HPVUE
|
||||
! The following resource specifies the fonts that can be chosen from the
|
||||
! font size pulldown/popup menu:
|
||||
*userFontList: \
|
||||
-adobe-courier-medium-r-normal--10-*:\n\
|
||||
-adobe-courier-medium-r-normal--12-*:\n\
|
||||
-bitstream-prestige-medium-r-normal--16-*:\n\
|
||||
-bitstream-prestige-medium-r-normal--17-*:\n\
|
||||
-bitstream-prestige-medium-r-normal--19-*:\n\
|
||||
-bitstream-prestige-medium-r-normal--23-*:\n\
|
||||
-bitstream-prestige-medium-r-normal--26-*:
|
||||
#else /* HPVUE */
|
||||
! The following resource specifies the fonts that can be chosen from the
|
||||
! font size pulldown/popup menu:
|
||||
*userFontList: \
|
||||
%|nls-1-#list_of_alternate_fonts#|
|
||||
#endif /* HPVUE */
|
||||
#endif /* FALLBACK_RESOURCES */
|
||||
|
||||
#ifdef HPVUE
|
||||
! The following is for helpview...
|
||||
|
||||
!######################################################################
|
||||
!#
|
||||
!# Vue
|
||||
!#
|
||||
!# Global Defaults for the HP Visual User Environment
|
||||
!#
|
||||
!# Hewlett-Packard Visual User Environment, Version 2.0
|
||||
!#
|
||||
!# Copyright (c) 1990 Hewlett-Packard Company
|
||||
!#
|
||||
!# $XConsortium: Dtterm.ad.src /main/4 1996/04/23 20:21:48 drk $
|
||||
!#
|
||||
!######################################################################
|
||||
|
||||
!###
|
||||
!#
|
||||
!# Help system specific resources
|
||||
!#
|
||||
!###
|
||||
|
||||
!########
|
||||
!#
|
||||
!# Default Window Size
|
||||
!#
|
||||
!# The "rows" and "columns" resources determine the default size of the
|
||||
!# help windows, where row and column size is determined by the base
|
||||
!# font being used in the dialog. (If the font is proportional, width
|
||||
!# is based on average character width for the font.)
|
||||
!#
|
||||
!# The "leading" resource determines additional spacing between lines
|
||||
!# of text (measured in pixels).
|
||||
!#
|
||||
!########
|
||||
|
||||
*XvhHelpDialogWidget.rows: 25
|
||||
*XvhHelpDialogWidget.columns: 50
|
||||
*XvhHelpDialogWidget*leading: 2
|
||||
|
||||
!########
|
||||
!#
|
||||
!# Display Area Colors
|
||||
!#
|
||||
!# These resources set the colors for the display area (where
|
||||
!# actual help text is displayed). The resources are complex
|
||||
!# because they have to override the standard color resources
|
||||
!# in all cases.
|
||||
!#
|
||||
!#####
|
||||
*XmDialogShell.XvhHelpDialogWidget*DisplayArea.background: White
|
||||
*XmDialogShell*XmDialogShell.XvhHelpDialogWidget*DisplayArea.background: White
|
||||
*XmDialogShell.XvhHelpDialogWidget*DisplayArea.foreground: Black
|
||||
*XmDialogShell*XmDialogShell.XvhHelpDialogWidget*DisplayArea.foreground: Black
|
||||
|
||||
!########
|
||||
!#
|
||||
!# Default Help Volume and Topic
|
||||
!#
|
||||
!# The "helpVolume" resource specifies the help volume to be
|
||||
!# displayed by default if no other help volume is specified.
|
||||
!#
|
||||
!# The "locationId" resource specifies the location ID of the topic
|
||||
!# to be displayed by default if no other topic is specified. The ID
|
||||
!# _HOMETOPIC specifies the "home," or top, topic in the volume's
|
||||
!# topic hierarchy.
|
||||
!#
|
||||
!########
|
||||
*XvhHelpDialogWidget*helpVolume: browser
|
||||
*XvhHelpDialogWidget*locationId: _HOMETOPIC
|
||||
|
||||
!########
|
||||
!#
|
||||
!# Help On Help
|
||||
!#
|
||||
!# The "helpOnHelpVolume" resource specifies the help volume to be used
|
||||
!# to display the "help on help" topics (when a help request is made
|
||||
!# while using a help window).
|
||||
!#
|
||||
!########
|
||||
|
||||
*XvhHelpDialogWidget*helpOnHelpVolume: Help4Help
|
||||
*XvhHelpDialogWidget*onHelpDialog*rows: 14
|
||||
*XvhHelpDialogWidget*onHelpDialog*columns: 40
|
||||
|
||||
|
||||
!########
|
||||
!#
|
||||
!# Definition Box
|
||||
!#
|
||||
!# The "definitionBox*rows" resource specifies the height to be used
|
||||
!# when displaying the definition box window
|
||||
!#
|
||||
!# The "definitionBox*columns" resource specifies the width to be used
|
||||
!# when displaying the definition box window
|
||||
!#
|
||||
!########
|
||||
|
||||
*XvhHelpDialogWidget*definitionBox*rows: 12
|
||||
*XvhHelpDialogWidget*definitionBox*columns: 40
|
||||
|
||||
!########
|
||||
!#
|
||||
!# Menu Accelerators
|
||||
!#
|
||||
!# The following resources establish keyboard accelerators
|
||||
!# for the most frequently accessed menu commands.
|
||||
!#
|
||||
!########
|
||||
|
||||
*XvhHelpDialogWidget*fileMenu.close.acceleratorText: Alt+F4
|
||||
*XvhHelpDialogWidget*fileMenu.close.accelerator: Alt<Key>f4
|
||||
*XvhHelpDialogWidget*searchMenu.keyword.acceleratorText: Ctrl+K
|
||||
*XvhHelpDialogWidget*searchMenu.keyword.accelerator: Ctrl<Key>k
|
||||
*XvhHelpDialogWidget*navigateMenu.backTrack.acceleratorText: Ctrl+B
|
||||
*XvhHelpDialogWidget*navigateMenu.backTrack.accelerator: Ctrl<Key>b
|
||||
*XvhHelpDialogWidget*navigateMenu.up.acceleratorText: Ctrl+U
|
||||
*XvhHelpDialogWidget*navigateMenu.up.accelerator: Ctrl<Key>u
|
||||
*XvhHelpDialogWidget*navigateMenu.homeTopic.acceleratorText: Ctrl+H
|
||||
*XvhHelpDialogWidget*navigateMenu.homeTopic.accelerator: Ctrl<Key>h
|
||||
|
||||
|
||||
!########
|
||||
!#
|
||||
!# Font Scheme
|
||||
!#
|
||||
!# The remainder of the resources control the font scheme used to display
|
||||
!# help text. To use a different font scheme, replace these resources
|
||||
!# with those listed in one of the font schemes in:
|
||||
!#
|
||||
!# /usr/vhelp/examples/fontschemes/
|
||||
!#
|
||||
!########
|
||||
|
||||
! Help Font File for X Displays
|
||||
! based on 10 pt = 14 pixels
|
||||
! spacing.size.angle.weight.type.charset
|
||||
|
||||
! The serif proportional family
|
||||
! medium upright
|
||||
*p.8.roman.medium.serif.iso8859-1: -adobe-*schoolbook*-medium-r-normal--12-*-*-*-p-*-iso8859-1
|
||||
*p.10.roman.medium.serif.iso8859-1: -adobe-*schoolbook*-medium-r-normal--14-*-*-*-p-*-iso8859-1
|
||||
*p.12.roman.medium.serif.iso8859-1: -adobe-*schoolbook*-medium-r-normal--17-*-*-*-p-*-iso8859-1
|
||||
*p.14.roman.medium.serif.iso8859-1: -adobe-*schoolbook*-medium-r-normal--20-*-*-*-p-*-iso8859-1
|
||||
! bold upright
|
||||
*p.8.roman.bold.serif.iso8859-1: -adobe-*schoolbook*-bold-r-normal--12-*-*-*-p-*-iso8859-1
|
||||
*p.10.roman.bold.serif.iso8859-1: -adobe-*schoolbook*-bold-r-normal--14-*-*-*-p-*-iso8859-1
|
||||
*p.12.roman.bold.serif.iso8859-1: -adobe-*schoolbook*-bold-r-normal--17-*-*-*-p-*-iso8859-1
|
||||
*p.14.roman.bold.serif.iso8859-1: -adobe-*schoolbook*-bold-r-normal--20-*-*-*-p-*-iso8859-1
|
||||
! medium italic
|
||||
*p.8.italic.medium.serif.iso8859-1: -adobe-*schoolbook*-medium-i-normal--12-*-*-*-p-*-iso8859-1
|
||||
*p.10.italic.medium.serif.iso8859-1: -adobe-*schoolbook*-medium-i-normal--14-*-*-*-p-*-iso8859-1
|
||||
*p.12.italic.medium.serif.iso8859-1: -adobe-*schoolbook*-medium-i-normal--17-*-*-*-p-*-iso8859-1
|
||||
*p.14.italic.medium.serif.iso8859-1: -adobe-*schoolbook*-medium-i-normal--20-*-*-*-p-*-iso8859-1
|
||||
! bold italic
|
||||
*p.8.italic.bold.serif.iso8859-1: -adobe-*schoolbook*-bold-i-normal--12-*-*-*-p-*-iso8859-1
|
||||
*p.10.italic.bold.serif.iso8859-1: -adobe-*schoolbook*-bold-i-normal--14-*-*-*-p-*-iso8859-1
|
||||
*p.12.italic.bold.serif.iso8859-1: -adobe-*schoolbook*-bold-i-normal--17-*-*-*-p-*-iso8859-1
|
||||
*p.14.italic.bold.serif.iso8859-1: -adobe-*schoolbook*-bold-i-normal--20-*-*-*-p-*-iso8859-1
|
||||
|
||||
! The sans serif proportional family
|
||||
! medium upright
|
||||
*p.8.roman.medium.sans_serif.iso8859-1: -adobe-helvetica-medium-r-normal--12-*-*-*-p-*-iso8859-1
|
||||
*p.10.roman.medium.sans_serif.iso8859-1: -adobe-helvetica-medium-r-normal--14-*-*-*-p-*-iso8859-1
|
||||
*p.12.roman.medium.sans_serif.iso8859-1: -adobe-helvetica-medium-r-normal--17-*-*-*-p-*-iso8859-1
|
||||
*p.14.roman.medium.sans_serif.iso8859-1: -adobe-helvetica-medium-r-normal--20-*-*-*-p-*-iso8859-1
|
||||
!bold upright
|
||||
*p.8.roman.bold.sans_serif.iso8859-1: -adobe-helvetica-bold-r-normal--12-*-*-*-p-*-iso8859-1
|
||||
*p.10.roman.bold.sans_serif.iso8859-1: -adobe-helvetica-bold-r-normal--14-*-*-*-p-*-iso8859-1
|
||||
*p.12.roman.bold.sans_serif.iso8859-1: -adobe-helvetica-bold-r-normal--17-*-*-*-p-*-iso8859-1
|
||||
*p.14.roman.bold.sans_serif.iso8859-1: -adobe-helvetica-bold-r-normal--20-*-*-*-p-*-iso8859-1
|
||||
! medium italic
|
||||
*p.8.italic.medium.sans_serif.iso8859-1: -adobe-helvetica-medium-o-normal--12-*-*-*-p-*-iso8859-1
|
||||
*p.10.italic.medium.sans_serif.iso8859-1: -adobe-helvetica-medium-o-normal--14-*-*-*-p-*-iso8859-1
|
||||
*p.12.italic.medium.sans_serif.iso8859-1: -adobe-helvetica-medium-o-normal--17-*-*-*-p-*-iso8859-1
|
||||
*p.14.italic.medium.sans_serif.iso8859-1: -adobe-helvetica-medium-o-normal--20-*-*-*-p-*-iso8859-1
|
||||
! bold italic
|
||||
*p.8.italic.bold.sans_serif.iso8859-1: -adobe-helvetica-bold-o-normal--12-*-*-*-p-*-iso8859-1
|
||||
*p.10.italic.bold.sans_serif.iso8859-1: -adobe-helvetica-bold-o-normal--14-*-*-*-p-*-iso8859-1
|
||||
*p.12.italic.bold.sans_serif.iso8859-1: -adobe-helvetica-bold-o-normal--17-*-*-*-p-*-iso8859-1
|
||||
*p.14.italic.bold.sans_serif.iso8859-1: -adobe-helvetica-bold-o-normal--20-*-*-*-p-*-iso8859-1
|
||||
|
||||
! The serif monospace family
|
||||
! medium upright
|
||||
*m.8.roman.medium.serif.iso8859-1: -adobe-courier-medium-r-normal--12-*-*-*-m-*-iso8859-1
|
||||
*m.10.roman.medium.serif.iso8859-1: -adobe-courier-medium-r-normal--14-*-*-*-m-*-iso8859-1
|
||||
*m.12.roman.medium.serif.iso8859-1: -adobe-courier-medium-r-normal--17-*-*-*-m-*-iso8859-1
|
||||
*m.14.roman.medium.serif.iso8859-1: -adobe-courier-medium-r-normal--20-*-*-*-m-*-iso8859-1
|
||||
! bold upright
|
||||
*m.8.roman.bold.serif.iso8859-1: -adobe-courier-bold-r-normal--12-*-*-*-m-*-iso8859-1
|
||||
*m.10.roman.bold.serif.iso8859-1: -adobe-courier-bold-r-normal--14-*-*-*-m-iso8859-1
|
||||
*m.12.roman.bold.serif.iso8859-1: -adobe-courier-bold-r-normal--17-*-*-*-m-*-iso8859-1
|
||||
*m.14.roman.bold.serif.iso8859-1: -adobe-courier-bold-r-normal--20-*-*-*-m-*-iso8859-1
|
||||
! medium italic
|
||||
*m.8.italic.medium.serif.iso8859-1: -adobe-courier-medium-o-normal--12-*-*-*-m-*-iso8859-1
|
||||
*m.10.italic.medium.serif.iso8859-1: -adobe-courier-medium-o-normal--14-*-*-*-m-*-iso8859-1
|
||||
*m.12.italic.medium.serif.iso8859-1: -adobe-courier-medium-o-normal--17-*-*-*-m-*-iso8859-1
|
||||
*m.14.italic.medium.serif.iso8859-1: -adobe-courier-medium-o-normal--20-*-*-*-m-*-iso8859-1
|
||||
|
||||
! SYMBOL
|
||||
*8.*.*.*.symbol: -adobe-symbol-medium-r-normal--12-*-*-*-p-*-adobe-fontspecific
|
||||
*10.*.*.*.symbol: -adobe-symbol-medium-r-normal--14-*-*-*-p-*-adobe-fontspecific
|
||||
*12.*.*.*.symbol: -adobe-symbol-medium-r-normal--17-*-*-*-p-*-adobe-fontspecific
|
||||
*14.*.*.*.symbol: -adobe-symbol-medium-r-normal--20-*-*-*-p-*-adobe-fontspecific
|
||||
|
||||
|
||||
! The fonts below are in the HP Roman 8 character set.
|
||||
|
||||
! The serif proportional family
|
||||
! medium upright
|
||||
*p.8.roman.medium.serif.hp-roman8: -adobe-*schoolbook*-medium-r-normal--12-*-*-*-p-*-hp-roman8
|
||||
*p.10.roman.medium.serif.hp-roman8: -adobe-*schoolbook*-medium-r-normal--14-*-*-*-p-*-hp-roman8
|
||||
*p.12.roman.medium.serif.hp-roman8: -adobe-*schoolbook*-medium-r-normal--18-*-*-*-p-*-hp-roman8
|
||||
*p.14.roman.medium.serif.hp-roman8: -adobe-*schoolbook*-medium-r-normal--24-*-*-*-p-*-hp-roman8
|
||||
! bold upright
|
||||
*p.8.roman.bold.serif.hp-roman8: -adobe-*schoolbook*-bold-r-normal--12-*-*-*-p-*-hp-roman8
|
||||
*p.10.roman.bold.serif.hp-roman8: -adobe-*schoolbook*-bold-r-normal--14-*-*-*-p-*-hp-roman8
|
||||
*p.12.roman.bold.serif.hp-roman8: -adobe-*schoolbook*-bold-r-normal--18-*-*-*-p-*-hp-roman8
|
||||
*p.14.roman.bold.serif.hp-roman8: -adobe-*schoolbook*-bold-r-normal--24-*-*-*-p-*-hp-roman8
|
||||
! medium italic
|
||||
*p.8.italic.medium.serif.hp-roman8: -adobe-*schoolbook*-medium-i-normal--12-*-*-*-p-*-hp-roman8
|
||||
*p.10.italic.medium.serif.hp-roman8: -adobe-*schoolbook*-medium-i-normal--14-*-*-*-p-*-hp-roman8
|
||||
*p.12.italic.medium.serif.hp-roman8: -adobe-*schoolbook*-medium-i-normal--18-*-*-*-p-*-hp-roman8
|
||||
*p.14.italic.medium.serif.hp-roman8: -adobe-*schoolbook*-medium-i-normal--24-*-*-*-p-*-hp-roman8
|
||||
! bold italic
|
||||
*p.8.italic.bold.serif.hp-roman8: -adobe-*schoolbook*-bold-i-normal--12-*-*-*-p-*-hp-roman8
|
||||
*p.10.italic.bold.serif.hp-roman8: -adobe-*schoolbook*-bold-i-normal--14-*-*-*-p-*-hp-roman8
|
||||
*p.12.italic.bold.serif.hp-roman8: -adobe-*schoolbook*-bold-i-normal--18-*-*-*-p-*-hp-roman8
|
||||
*p.14.italic.bold.serif.hp-roman8: -adobe-*schoolbook*-bold-i-normal--24-*-*-*-p-*-hp-roman8
|
||||
|
||||
! The sans serif proportional family
|
||||
! medium upright
|
||||
*p.8.roman.medium.sans_serif.hp-roman8: -adobe-helvetica-medium-r-normal--12-*-*-*-p-*-hp-roman8
|
||||
*p.10.roman.medium.sans_serif.hp-roman8: -adobe-helvetica-medium-r-normal--14-*-*-*-p-*-hp-roman8
|
||||
*p.12.roman.medium.sans_serif.hp-roman8: -adobe-helvetica-medium-r-normal--18-*-*-*-p-*-hp-roman8
|
||||
*p.14.roman.medium.sans_serif.hp-roman8: -adobe-helvetica-medium-r-normal--24-*-*-*-p-*-hp-roman8
|
||||
!bold upright
|
||||
*p.8.roman.bold.sans_serif.hp-roman8: -adobe-helvetica-bold-r-normal--12-*-*-*-p-*-hp-roman8
|
||||
*p.10.roman.bold.sans_serif.hp-roman8: -adobe-helvetica-bold-r-normal--14-*-*-*-p-*-hp-roman8
|
||||
*p.12.roman.bold.sans_serif.hp-roman8: -adobe-helvetica-bold-r-normal--18-*-*-*-p-*-hp-roman8
|
||||
*p.14.roman.bold.sans_serif.hp-roman8: -adobe-helvetica-bold-r-normal--24-*-*-*-p-*-hp-roman8
|
||||
! medium italic
|
||||
*p.8.italic.medium.sans_serif.hp-roman8: -adobe-helvetica-medium-o-normal--12-*-*-*-p-*-hp-roman8
|
||||
*p.10.italic.medium.sans_serif.hp-roman8: -adobe-helvetica-medium-o-normal--14-*-*-*-p-*-hp-roman8
|
||||
*p.12.italic.medium.sans_serif.hp-roman8: -adobe-helvetica-medium-o-normal--18-*-*-*-p-*-hp-roman8
|
||||
*p.14.italic.medium.sans_serif.hp-roman8: -adobe-helvetica-medium-o-normal--24-*-*-*-p-*-hp-roman8
|
||||
! bold italic
|
||||
*p.8.italic.bold.sans_serif.hp-roman8: -adobe-helvetica-bold-o-normal--12-*-*-*-p-*-hp-roman8
|
||||
*p.10.italic.bold.sans_serif.hp-roman8: -adobe-helvetica-bold-o-normal--14-*-*-*-p-*-hp-roman8
|
||||
*p.12.italic.bold.sans_serif.hp-roman8: -adobe-helvetica-bold-o-normal--18-*-*-*-p-*-hp-roman8
|
||||
*p.14.italic.bold.sans_serif.hp-roman8: -adobe-helvetica-bold-o-normal--24-*-*-*-p-*-hp-roman8
|
||||
|
||||
! The serif monospace family
|
||||
! medium upright
|
||||
*m.8.roman.medium.serif.hp-roman8: -adobe-courier-medium-r-normal--12-*-*-*-m-*-hp-roman8
|
||||
*m.10.roman.medium.serif.hp-roman8: -adobe-courier-medium-r-normal--14-*-*-*-m-*-hp-roman8
|
||||
*m.12.roman.medium.serif.hp-roman8: -adobe-courier-medium-r-normal--18-*-*-*-m-*-hp-roman8
|
||||
*m.14.roman.medium.serif.hp-roman8: -adobe-courier-medium-r-normal--24-*-*-*-m-*-hp-roman8
|
||||
! bold upright
|
||||
*m.8.roman.bold.serif.hp-roman8: -adobe-courier-bold-r-normal--12-*-*-*-m-*-hp-roman8
|
||||
*m.10.roman.bold.serif.hp-roman8: -adobe-courier-bold-r-normal--14-*-*-*-m-hp-roman8
|
||||
*m.12.roman.bold.serif.hp-roman8: -adobe-courier-bold-r-normal--18-*-*-*-m-*-hp-roman8
|
||||
*m.14.roman.bold.serif.hp-roman8: -adobe-courier-bold-r-normal--24-*-*-*-m-*-hp-roman8
|
||||
! medium italic
|
||||
*m.8.italic.medium.serif.hp-roman8: -adobe-courier-medium-o-normal--12-*-*-*-m-*-hp-roman8
|
||||
*m.10.italic.medium.serif.hp-roman8: -adobe-courier-medium-o-normal--14-*-*-*-m-*-hp-roman8
|
||||
*m.12.italic.medium.serif.hp-roman8: -adobe-courier-medium-o-normal--18-*-*-*-m-*-hp-roman8
|
||||
*m.14.italic.medium.serif.hp-roman8: -adobe-courier-medium-o-normal--24-*-*-*-m-*-hp-roman8
|
||||
#endif /* HPVUE */
|
||||
97
cde/programs/dtterm/Imakefile
Normal file
97
cde/programs/dtterm/Imakefile
Normal file
@@ -0,0 +1,97 @@
|
||||
XCOMM $XConsortium: Imakefile /main/17 1996/07/23 17:10:41 drk $
|
||||
#define IHaveSubdirs
|
||||
#define PassCDebugFlags 'CDEBUGFLAGS=$(CDEBUGFLAGS)'
|
||||
|
||||
#ifdef SunArchitecture
|
||||
.NO_PARALLEL:
|
||||
#endif
|
||||
|
||||
SUBDIRS = util
|
||||
|
||||
MakeSubdirs($(SUBDIRS))
|
||||
DependSubdirs($(SUBDIRS))
|
||||
|
||||
DEFINES = $(ARCHITECTURE_DEFINES) -DSUN_TERMINAL_SERVER
|
||||
|
||||
#ifdef Build_HpVue
|
||||
EXTRA_DEFINES = -DBUILD_HPVUE -DHPVUE
|
||||
#endif /* Build_HpVue */
|
||||
|
||||
#ifdef SunArchitecture
|
||||
HELPLIB = $(DTSVCLIB) $(TTLIB)
|
||||
DEPHELPLIB = $(DEPDTSVCLIB) $(DEPTTLIB)
|
||||
#else
|
||||
HELPLIB = $(DTHELPLIB) $(DTSVCLIB) $(TTLIB)
|
||||
DEPHELPLIB = $(DEPDTHELPLIB) $(DEPDTSVCLIB) $(DEPTTLIB)
|
||||
#endif /* SunArchitecture */
|
||||
|
||||
#ifdef HPArchitecture
|
||||
USE_XHPLIB = $(XHPLIB)
|
||||
#endif /* HPArchitecture */
|
||||
|
||||
/* DEPLIBS contains the list of library depencies for a client.
|
||||
* LOCAL_LIBRARIES contains the list of libraries on the link line.
|
||||
* Generally, the dependency form of a library has DEP as a prefix.
|
||||
* e.g. put $(XLIB) in LOCAL_LIBRARIES and $(DEPXLIB) in DEPLIBS.
|
||||
* NOTE: if DEPLIBS is not set here, it is by default null and there
|
||||
* are no library dependencies for clients.
|
||||
* You cannot put -Llibpath into DEPLIBS. You must put actual
|
||||
* paths to the library.
|
||||
*/
|
||||
DEPLIBS = $(DEPDTTERMLIB) $(DEPARCHLIBS) $(DEPXINPUTLIB) $(DEPHELPLIB) \
|
||||
$(DEPXMLIB) $(DEPXTOOLLIB) $(DEPXPLIB) $(DEPXLIB)
|
||||
LOCAL_LIBRARIES = $(DTTERMLIB) $(USE_XHPLIB) $(XINPUTLIB) $(HELPLIB) \
|
||||
$(XMLIB) $(XTOOLLIB) $(XPLIB) $(XLIB)
|
||||
SYS_LIBRARIES = DtClientSysLibs
|
||||
|
||||
INCLUDES = -I. -I$(DTTERMSRC)/TermPrim -I$(DTTERMSRC)/Term -I$(DTTERMSRC)/TermView
|
||||
|
||||
SRCS = \
|
||||
DtTermLogit.c \
|
||||
DtTermMain.c \
|
||||
DtTermFallBackResources.c \
|
||||
sunDtTermServer.c \
|
||||
DtTermSyntax.c
|
||||
|
||||
OBJS = \
|
||||
DtTermLogit.o \
|
||||
DtTermMain.o \
|
||||
DtTermFallBackResources.o \
|
||||
sunDtTermServer.o \
|
||||
DtTermSyntax.o
|
||||
|
||||
#ifdef HPArchitecture
|
||||
ARCHLIBS = $(XHPLIB)
|
||||
#endif /* HPArchitecture */
|
||||
|
||||
|
||||
PROGRAMS = dtterm
|
||||
LINTLIBS = $(USE_XHPLIB) $(XINPUTLIB) $(HELPLIB) \
|
||||
$(XPMLIB) $(XMLIB) $(XTOOLLIB) $(XLIB)
|
||||
|
||||
#ifdef CdeTicDefines
|
||||
XCOMM Some systems support non-standard tic options.
|
||||
TIC_DEFINES = CdeTicDefines
|
||||
#endif
|
||||
|
||||
CppSourceFile(Dtterm.ad,Dtterm.ad.src,$(EXTRA_DEFINES),)
|
||||
CppFileTarget(DtTermFallBackResources.c.src,Dtterm.ad.src,$(EXTRA_DEFINES) -DFALLBACK_RESOURCES,)
|
||||
|
||||
DtTermFallBackResources.c: DtTermFallBackResources.c.src
|
||||
$(RM) $@
|
||||
./mkfallbk < DtTermFallBackResources.c.src > $@
|
||||
includes:: DtTermFallBackResources.c
|
||||
depend:: DtTermFallBackResources.c
|
||||
clean::
|
||||
$(RM) DtTermFallBackResources.c
|
||||
|
||||
dtterm.ti: terminfoChecklist
|
||||
$(RM) $@
|
||||
CPP="$(CPP) $(TIC_DEFINES)" ./terminfoCreate < terminfoChecklist > $@
|
||||
includes:: dtterm.ti
|
||||
depend:: dtterm.ti
|
||||
all:: dtterm.ti
|
||||
clean::
|
||||
$(RM) dtterm.ti
|
||||
|
||||
ComplexProgramTarget(dtterm)
|
||||
1471
cde/programs/dtterm/dtterm.1
Normal file
1471
cde/programs/dtterm/dtterm.1
Normal file
File diff suppressed because it is too large
Load Diff
1135
cde/programs/dtterm/dtterm.5
Normal file
1135
cde/programs/dtterm/dtterm.5
Normal file
File diff suppressed because it is too large
Load Diff
348
cde/programs/dtterm/dtterm.msg
Normal file
348
cde/programs/dtterm/dtterm.msg
Normal file
@@ -0,0 +1,348 @@
|
||||
$ $TOG: dtterm.msg /main/4 1999/09/17 13:27:14 mgreess $
|
||||
$ *************************************<+>*************************************
|
||||
$ *****************************************************************************
|
||||
$ **
|
||||
$ ** File: dtterm.msg
|
||||
$ **
|
||||
$ ** Project: Common Desktop Environment dtterm
|
||||
$ **
|
||||
$ ** Description:
|
||||
$ ** -----------
|
||||
$ ** This file is the source for the message catalog for dtterm
|
||||
$ ** Any additional messages are to be added to this file by hand,
|
||||
$ ** and the associated index number placed in the code.
|
||||
$ **
|
||||
$ *****************************************************************************
|
||||
$ **
|
||||
$ ** (c) Copyright 1993, 1994 Hewlett-Packard Company
|
||||
$ ** All Rights reserved
|
||||
$ **
|
||||
$ **
|
||||
$ *****************************************************************************
|
||||
$ *************************************<+>*************************************
|
||||
|
||||
$ *************************************<L>*************************************
|
||||
$ ** -----------------GENERAL LOCALIZATION NOTES SECTION---------------------
|
||||
$ * Comment lines begin with a $ except $set which indicates the start of a
|
||||
$ * new set.
|
||||
$ *
|
||||
$ * Do not delete any comments; you may add comments for your use.
|
||||
$ *
|
||||
$ ** ----------------GENERAL LOCALIZATION NOTES SECTION END------------------
|
||||
$ *************************************<L>*************************************
|
||||
|
||||
$ *****************************************************************************
|
||||
$
|
||||
$ ***** NOTE FOR MESSAGE CATALOG TRANSLATORS *****
|
||||
$
|
||||
$ There may be three types of messages in this file:
|
||||
$
|
||||
$ 1. Messages that appear in dialogs or are displayed to the user.
|
||||
$
|
||||
$ These messages are the default and they should ALL BE LOCALIZED.
|
||||
$ Note that these messages do NOT have any identification (see the
|
||||
$ comments for type 2 and 3 below).
|
||||
$
|
||||
$ 2. Messages that only appear in the DT error log file ($HOME?.dt/errorlog).
|
||||
$
|
||||
$ The localization of these messages is OPTIONAL. These messages are
|
||||
$ identified by the following:
|
||||
$
|
||||
$ MESSAGES xx-yy WILL ONLY APPEAR IN THE DT ERRORLOG FILE
|
||||
$
|
||||
$ 3. Messages that should not be localized.
|
||||
$
|
||||
$ These messages are identified by the following:
|
||||
$
|
||||
$ DO NOT TRANSLATE or CHANGE or LOCALIZE MESSAGES xx-yy
|
||||
$
|
||||
$ ***** END (NOTE FOR MESSAGE CATALOG TRANSLATORS) *****
|
||||
$
|
||||
$ ********** PROLOGUE ****************
|
||||
$ Date Name Note
|
||||
$ ======== ================= ===============================================
|
||||
$ 03/15/94 B. May Initial rev
|
||||
$
|
||||
$ *****************************************************************************
|
||||
|
||||
$set 1
|
||||
$ ****** Module: DtTermMain.c
|
||||
$ Message 1 is the window menu addition - do not translate f.separator or
|
||||
$ f.send_msg. It will be used as the format string for a sprintf() command,
|
||||
$ so it is necessary to double up on any percent signs ('%') that you
|
||||
$ want to keep in the string.
|
||||
$ Message 2 is an error message
|
||||
|
||||
1 \
|
||||
Sep f.separator\n\
|
||||
Toggle\\ Menu\\ Bar f.send_msg %d\
|
||||
|
||||
2 %s: the -S option can not be used with the -server or -serverid options\n
|
||||
3 Terminal
|
||||
|
||||
$set 2
|
||||
$ ****** Module: DtTermSyntax.c
|
||||
$ These are the usage messages.
|
||||
$ DO NOT TRANSLATE Messages 37 or 41 ("End-of-list")
|
||||
|
||||
1 -/+132 enable/disable 80<->132 column escape seq
|
||||
2 -/+aw enable/disable autowrap
|
||||
3 -bg color background color
|
||||
4 -/+bs turn off/on Term background is select color
|
||||
5 -display displayname X server to contact
|
||||
6 -e command args command to execute
|
||||
7 -fb fontset bold text font
|
||||
8 -fg color foreground color
|
||||
9 -fn fontset normal text font
|
||||
10 -geometry geom size (in characters) and position of window
|
||||
11 -help print out this message
|
||||
12 -/+iconic start/do not start iconic
|
||||
13 -/+j enable/disable jump scroll
|
||||
14 -/+kshMode enable/disable ksh mode
|
||||
15 -/+l enable/disable logging
|
||||
16 -lf filename logging filename
|
||||
17 -/+ls enable/disable login shell
|
||||
18 -/+map enable/disable map window on pty output
|
||||
19 -/+mb enable/disable margin bell
|
||||
20 -ms color pointer color
|
||||
21 -n string specify icon name
|
||||
22 -name string client instance, icon, and title strings
|
||||
23 -nb distance specify distance for right margin bell
|
||||
24 -/+rw enable/disable reverse wrap
|
||||
25 -/+sb enable/disable scroll bar
|
||||
26 -/+sf enable/disable SUN function keys
|
||||
27 -sl number[s] number of scrolled lines [screens] to save
|
||||
28 -ti name string used for programmatic identification
|
||||
29 -title string title string for window
|
||||
30 -tm string terminal mode keywords and characters
|
||||
31 -tn name TERM environment variable name
|
||||
32 -/+vb enable/disable visual bell
|
||||
33 -xrm resourcestring additional resource specifications
|
||||
34 -C console mode
|
||||
35 -Sxxd slave mode on \"ttyxx\" file descriptor \"d\"
|
||||
36 -Sxxx.d slave mode on \"ttyxxx\" file descriptor \"d\"
|
||||
37 End-Of-List
|
||||
38 The -e option, if given must appear at the end of the command line,
|
||||
39 otherwise the user's default shell will be started. Options that start
|
||||
40 with a plus sign (+) restore the default.
|
||||
41 End-Of-List
|
||||
47 %s: bad command line option \"%s\"\r\n\n
|
||||
48 usage: %s
|
||||
49 \r\n
|
||||
50 [%s]
|
||||
51 \r\n\nType \"%s -help\" for a full description.\r\n\n
|
||||
52 usage:\n
|
||||
53 \t%s [-options ...] [-e command args]\n\n
|
||||
54 where options include:\n
|
||||
|
||||
$set 3
|
||||
$ ****** Module: TermFunction.c
|
||||
$ This is a warning message dialog box
|
||||
1 MEMORY FULL\nPress OK to clear
|
||||
|
||||
$set 4
|
||||
$ ****** Module: TermPrim.c
|
||||
$ This is the title of a dialog box
|
||||
2 Terminal - Warning
|
||||
|
||||
$set 5
|
||||
$ ****** Module: TermFunction.c
|
||||
$ This is a warning message dialog box
|
||||
1 MEMORY FULL\nPress OK to clear
|
||||
|
||||
$set 6
|
||||
$ ****** Module: TermView.c
|
||||
$ DO NOT TRANSLATE Message 1
|
||||
$ Messages 2 and 3 are titles for dialog boxes.
|
||||
1 80x24 132x24
|
||||
4 Terminal - Man Page
|
||||
5 Terminal - Help
|
||||
|
||||
$set 7
|
||||
$ ****** Module: TermViewGlobalDialog.c
|
||||
$ These are the user-visible labels in the Global Options dialog box.
|
||||
$ #1 is the title.
|
||||
$ The rest are resource types and values - look at the dialog box and
|
||||
$ documentation for full specs.
|
||||
$
|
||||
$ DO NOT TRANSLATE MESSAGE 15
|
||||
$
|
||||
2 OK
|
||||
3 Cancel
|
||||
4 Help
|
||||
5 global
|
||||
6 Cursor Control
|
||||
7 Box
|
||||
8 Underline
|
||||
9 Cursor Style
|
||||
10 Enabled
|
||||
11 Disabled
|
||||
12 Blinking Cursor
|
||||
13 Blink Rate (milliseconds)
|
||||
14 Invisible
|
||||
15 blinkRate
|
||||
16 Color Control
|
||||
17 Inverse
|
||||
18 Normal
|
||||
19 Window Background
|
||||
20 Scroll Behavior
|
||||
21 Disabled
|
||||
22 Enabled
|
||||
23 Smooth Scrolling
|
||||
24 Bell Control
|
||||
25 Audible
|
||||
26 Visible
|
||||
27 Bell Type
|
||||
28 Enabled
|
||||
29 Disabled
|
||||
30 Margin Warning
|
||||
31 Margin Distance
|
||||
32 Apply
|
||||
33 Reset
|
||||
34 Terminal - Global Options
|
||||
$set 8
|
||||
$ ****** Module: TermViewMenu.c
|
||||
$ These are the menu bar entries and menu pane choices.
|
||||
$ NOTE TO TRANSLATORS: The Single letter entries are the menu mnemonic
|
||||
$ for the entry above them (i.e. message 11 "F" is the mnemonic for
|
||||
$ message 10 "Font Size").
|
||||
$ The items with a "+" in them are the accellerators for an item.
|
||||
$ The single-character items are the mnemonics for a menu item, where the
|
||||
$ text of the menu item is specified in the previous message
|
||||
$ Do not translate messages 24 and 28.
|
||||
1 Default
|
||||
2 Window Size
|
||||
3 W
|
||||
4 -iso8859-1
|
||||
5 %d point
|
||||
6 %.1f point
|
||||
7 %.1f point
|
||||
8 %.2f point
|
||||
9 Default
|
||||
10 Font Size
|
||||
11 F
|
||||
|
||||
$ Window menu
|
||||
12 New
|
||||
13 N
|
||||
14 Print
|
||||
15 P
|
||||
16 Print...
|
||||
17 r
|
||||
18 Close
|
||||
19 C
|
||||
20 Window
|
||||
21 W
|
||||
|
||||
$ Edit menu
|
||||
22 Copy
|
||||
23 C
|
||||
$ IBM fixed msg 24 for 41J
|
||||
$ 24 Ctrl osfInsert
|
||||
24 Ctrl<Key>osfInsert
|
||||
25 Ctrl+Insert
|
||||
26 Paste
|
||||
27 P
|
||||
$ IBM fixed msg 28 for 41J
|
||||
$ 28 Shift osfInsert
|
||||
28 Shift<Key>osfInsert
|
||||
29 Shift+Insert
|
||||
30 Edit
|
||||
31 E
|
||||
|
||||
$ Option menu
|
||||
|
||||
32 Menu Bar
|
||||
33 M
|
||||
34 Scroll Bar
|
||||
35 S
|
||||
36 Global...
|
||||
37 G
|
||||
38 Terminal...
|
||||
39 T
|
||||
40 Soft Reset
|
||||
41 S
|
||||
42 Hard Reset
|
||||
43 H
|
||||
44 Reset
|
||||
45 R
|
||||
46 Options
|
||||
47 O
|
||||
|
||||
$ Old Help menu (no longer used for CDE)
|
||||
|
||||
48 Overview
|
||||
49 O
|
||||
50 Tasks
|
||||
51 T
|
||||
52 Reference
|
||||
53 R
|
||||
54 On Item
|
||||
55 O
|
||||
56 Using Help
|
||||
57 U
|
||||
59 A
|
||||
60 Help
|
||||
61 H
|
||||
|
||||
62 Alt+F4
|
||||
|
||||
63 dtterm
|
||||
|
||||
$ Current CDE Help menu
|
||||
|
||||
64 Overview
|
||||
65 v
|
||||
66 Index
|
||||
67 I
|
||||
68 Table Of Contents
|
||||
69 C
|
||||
70 Tasks
|
||||
71 T
|
||||
72 Reference
|
||||
73 R
|
||||
74 Keyboard
|
||||
75 K
|
||||
76 Using Help
|
||||
77 U
|
||||
79 A
|
||||
80 Help
|
||||
81 H
|
||||
82 About Terminal
|
||||
83 About Terminal
|
||||
|
||||
$set 9
|
||||
$ ****** Module: TermTerminalDialog.c
|
||||
$ These are the messages for the terminal options dialog
|
||||
2 OK
|
||||
3 Cancel
|
||||
4 Help
|
||||
5 Keyboard Control
|
||||
6 Normal
|
||||
7 Application
|
||||
8 Cursor Key Mode
|
||||
9 Numeric
|
||||
10 Application
|
||||
11 Keypad Mode
|
||||
12 Return Only
|
||||
13 Return/Line Feed
|
||||
14 Newline Sequence
|
||||
15 Locked
|
||||
16 Unlocked
|
||||
17 User Function Keys
|
||||
18 Screen Control
|
||||
19 Enabled
|
||||
20 Disabled
|
||||
21 132 Column Switching
|
||||
22 End-of-line Wrapping
|
||||
23 Reverse End-of-line Wrapping
|
||||
24 Apply
|
||||
25 Reset
|
||||
26 Terminal - Terminal Options
|
||||
|
||||
$set 10
|
||||
$ ****** Module: sunDtTermServer.c
|
||||
$ These are the messages for the ToolTalk error dialog
|
||||
1 Terminal - Error
|
||||
2 "Could not connect to ToolTalk:\n%s\nExiting ..."
|
||||
3 OK
|
||||
14
cde/programs/dtterm/dtterm_main.c
Normal file
14
cde/programs/dtterm/dtterm_main.c
Normal file
@@ -0,0 +1,14 @@
|
||||
/* $XConsortium: dtterm_main.c /main/3 1995/10/31 11:19:36 rswiston $ */
|
||||
/* *
|
||||
* (c) Copyright 1993, 1994 Hewlett-Packard Company *
|
||||
* (c) Copyright 1993, 1994 International Business Machines Corp. *
|
||||
* (c) Copyright 1993, 1994 Sun Microsystems, Inc. *
|
||||
* (c) Copyright 1993, 1994 Novell, Inc. *
|
||||
*/
|
||||
|
||||
dtterm(argc,argv)
|
||||
int argc;
|
||||
char *argv[];
|
||||
{
|
||||
main(argc,argv);
|
||||
}
|
||||
89
cde/programs/dtterm/flags
Normal file
89
cde/programs/dtterm/flags
Normal file
@@ -0,0 +1,89 @@
|
||||
There are 3 ways to specify debug flags. The debug flag to set to force
|
||||
multibyte treatment of single byte locales is "m:1". The format for the
|
||||
flags is the same for all 3 ways. The string is of the format:
|
||||
|
||||
flags:bits
|
||||
|
||||
where
|
||||
|
||||
flags are in the range A-Z, a-z.
|
||||
bits are in the range 0-99.
|
||||
|
||||
It is possible to combine flags and bits by either specifying a range of
|
||||
the form:
|
||||
|
||||
[<flag1>]-[<flag2>]
|
||||
|
||||
or separating individual flags or ranges by commas.
|
||||
|
||||
It is possible to specify bits in the same fashion. If no value bits
|
||||
are specified, all 100 bits are set. If no flags are specfied, none
|
||||
are set. Individual entries may be separated by spaces. A few examples:
|
||||
|
||||
A-z: sets all debug bits
|
||||
A,c: sets all 'A' and all 'c' debug bits
|
||||
-: sets all bits
|
||||
t,a-c:0,1,20-30 sets bits 0, 1, and 20 through 30 for flags
|
||||
t, a, b, and c
|
||||
a:0 b:1 c:2 sets bit 0 for flag a, bit 1 for flag b, and
|
||||
bit 2 for flag c
|
||||
|
||||
Flags can be set via either:
|
||||
|
||||
- the -~ option
|
||||
- the "*debugLevel" resource
|
||||
- the "dttermDebugFlags" environment variable
|
||||
|
||||
A few examples:
|
||||
|
||||
dttermDebugFlags=t:1 dtterm
|
||||
dtterm -~ t:1
|
||||
dtterm -xrm "*dttermLevel: t:1"
|
||||
|
||||
If flag v:0 is set, the list of set debug flags will be dumped to
|
||||
stderr. The current list of debug flags are rather disorganized. In
|
||||
the future, the function DebugF() should be used, and bits > 0 with an
|
||||
attempt at trying to make some sort of sense. The following list
|
||||
sepecfies all the current debug flags. There is some overlap between
|
||||
different chunks of code with the same flag. The current list of debug
|
||||
flags and bits are:
|
||||
|
||||
B:1 text buffer: verify text buffer before/after line moves
|
||||
F:0 focus
|
||||
F:1 focus and XmIM setting
|
||||
P:0 TermParse.c functions
|
||||
T:0 timestamps
|
||||
b:0 scrollbar
|
||||
c:0 selection
|
||||
e:0 exposure
|
||||
f:0 font / XFontStruct / XFontSet construction
|
||||
f:10 force subprocess fork() failures specified by
|
||||
$dttermDebugForkFailures
|
||||
i:0 enable not yet implemented function warnings
|
||||
i:0 pty input
|
||||
i:0 server key press and release
|
||||
l:0 linedraw font code
|
||||
m:1 force multibyte mode
|
||||
m:2 validate multibyte/wide char strings
|
||||
n:0 terminal server not run in daemon mode
|
||||
o:0 StartOrStopPtyInput()
|
||||
o:0 StartOrStopPtyOutput()
|
||||
o:0 pty output
|
||||
p:0 print error on pty open failures
|
||||
p:1 parser: call ParseTrap() on parse of specified char
|
||||
p:2 ttyModes parsing
|
||||
p:10 pty: allocation: cause allocation failure
|
||||
p:20 property change events
|
||||
q:0 pending text
|
||||
s:0 selection
|
||||
s:1 disable COMPOUND_TEXT selection target
|
||||
s:2 disable CS_OF_LOCALE selection target
|
||||
s:3 disable COMPOUND_STRING selection target
|
||||
s:4 disable TEXT selection target
|
||||
s:5 disable XA_STRING selection target
|
||||
s:10 signal handler
|
||||
t:0 cursor / scrolling code
|
||||
t:0 text rendering
|
||||
t:1 fill areas before rendering text
|
||||
v:0 verbose listing of debug flags
|
||||
w:0 terminal window width / height
|
||||
55
cde/programs/dtterm/mkfallbk
Executable file
55
cde/programs/dtterm/mkfallbk
Executable file
@@ -0,0 +1,55 @@
|
||||
#!/bin/sh
|
||||
# $XConsortium: mkfallbk.sh /main/2 1995/07/19 17:10:17 drk $
|
||||
|
||||
# this file will make a source file for the fallback resources from
|
||||
# the app-defaults file.
|
||||
|
||||
# quote all double quotes (i.e., `"' becomes `\"') and
|
||||
# strip off all comments (anything after a `!')...
|
||||
sed -e 's@"@\\"@g' \
|
||||
-e 's@[ ]*!.*@@' |
|
||||
|
||||
# now let's convert the rest with awk...
|
||||
awk '
|
||||
BEGIN {
|
||||
printf "#include <Xm/Xm.h>\n\n"; # to define String...
|
||||
printf "String fallbackResources[] = {\n"; # preamble...
|
||||
contLine = 0;
|
||||
buffer = "";
|
||||
}
|
||||
{
|
||||
# drop blank lines...
|
||||
if (length($0) == 0) {
|
||||
next;
|
||||
}
|
||||
|
||||
# if this is not a continuation of the previous line, begin it with
|
||||
# a "...
|
||||
if (!contLine) {
|
||||
printf " \"";
|
||||
}
|
||||
|
||||
# if the last char is a backslash \, then it is continued on the
|
||||
# next line...
|
||||
if (substr($0, length($0), 1) == "\\") {
|
||||
contLine = 1;
|
||||
} else {
|
||||
contLine = 0;
|
||||
}
|
||||
|
||||
# print out the line...
|
||||
printf "%s", $0;
|
||||
|
||||
# if it is not continued on the next line, then terminate the string...
|
||||
if (!contLine) {
|
||||
printf "\",";
|
||||
}
|
||||
|
||||
# print the newline...
|
||||
printf "\n";
|
||||
}
|
||||
END {
|
||||
# postamble...
|
||||
printf " NULL,\n";
|
||||
printf "};\n"
|
||||
}'
|
||||
376
cde/programs/dtterm/sunDtTermServer.c
Normal file
376
cde/programs/dtterm/sunDtTermServer.c
Normal file
@@ -0,0 +1,376 @@
|
||||
/* $TOG: sunDtTermServer.c /main/6 1999/09/17 13:29:51 mgreess $ */
|
||||
/* *
|
||||
* (c) Copyright 1993, 1994 Hewlett-Packard Company *
|
||||
* (c) Copyright 1993, 1994 International Business Machines Corp. *
|
||||
* (c) Copyright 1993, 1994 Sun Microsystems, Inc. *
|
||||
* (c) Copyright 1993, 1994 Novell, Inc. *
|
||||
*/
|
||||
|
||||
#include "TermHeader.h"
|
||||
#include "TermPrimDebug.h"
|
||||
#include "TermView.h"
|
||||
#include "TermPrimMessageCatI.h"
|
||||
#include "TermPrimSetPty.h"
|
||||
#ifdef LOG_USAGE
|
||||
#include "DtTermLogit.h"
|
||||
#endif /* LOG_USAGE */
|
||||
#include <signal.h>
|
||||
#include <errno.h>
|
||||
#include <Dt/Service.h>
|
||||
#include <Dt/UserMsg.h>
|
||||
#include <Dt/DtP.h>
|
||||
#include <Tt/tttk.h>
|
||||
#include <X11/IntrinsicP.h>
|
||||
#include <X11/CoreP.h>
|
||||
#include <Xm/XmAll.h>
|
||||
|
||||
#define GETXMSTRING(s, m, d) XmStringCreateLocalized(GETMESSAGE(s,m,d))
|
||||
|
||||
#define VENDOR "CDE"
|
||||
#define VERSION "1.0"
|
||||
|
||||
static char * procId;
|
||||
static Tt_pattern * DtTermToolTalkPattern = NULL;
|
||||
static Boolean sendStopped = False;
|
||||
XtInputId ProcessToolTalkInputId = 0;
|
||||
static int ttFd;
|
||||
char DTTERM_CLASS_NAME[] = "Dtterm";
|
||||
char *displayString = NULL;
|
||||
Widget refWidget;
|
||||
|
||||
#ifdef TIMEOUT
|
||||
#define STICKAROUND 15 /* 15 minutes... */
|
||||
static XtIntervalId waitId = (XtIntervalId) 0;
|
||||
#endif /* TIMEOUT */
|
||||
|
||||
extern void
|
||||
sunSetupIA(Widget w);
|
||||
|
||||
void
|
||||
DieFromToolTalkError(Widget, char*, Tt_status);
|
||||
|
||||
Tt_message
|
||||
SessionCallback( Tt_message msg, void * client_data, Tt_message contract);
|
||||
|
||||
Tt_callback_action
|
||||
HandleTtRequest(Tt_message msg, Tt_pattern pat);
|
||||
|
||||
static void
|
||||
dttermNewHandler(Tt_message msg);
|
||||
|
||||
#ifdef TIMEOUT
|
||||
static void TimeOut(XtPointer clientData, XtIntervalId *id);
|
||||
#endif /* TIMEOUT */
|
||||
|
||||
Boolean
|
||||
FinalizeToolTalkSession( )
|
||||
{
|
||||
Tt_status ttRc;
|
||||
int i;
|
||||
|
||||
if (DtTermToolTalkPattern && tt_ptr_error(DtTermToolTalkPattern) == TT_OK) {
|
||||
ttRc = ttdt_session_quit(NULL, DtTermToolTalkPattern, 1);
|
||||
if (ProcessToolTalkInputId)
|
||||
XtRemoveInput(ProcessToolTalkInputId);
|
||||
return(True);
|
||||
}
|
||||
ttRc = ttdt_close(NULL, NULL, sendStopped);
|
||||
return(True);
|
||||
}
|
||||
|
||||
Tt_message
|
||||
SessionCallback( Tt_message msg, void * client_data, Tt_message contract)
|
||||
{
|
||||
char *opString = tt_message_op(msg);
|
||||
Tttk_op op = tttk_string_op(opString);
|
||||
|
||||
tt_free(opString);
|
||||
|
||||
switch (op) {
|
||||
int i;
|
||||
|
||||
default:
|
||||
break;
|
||||
case TTDT_QUIT:
|
||||
if (contract == 0) {
|
||||
tt_message_reply(msg);
|
||||
FinalizeToolTalkSession( );
|
||||
exit(0);
|
||||
}
|
||||
/* Should we send some type of tt failure message? */
|
||||
return 0;
|
||||
}
|
||||
return msg;
|
||||
}
|
||||
|
||||
int
|
||||
InitializeToolTalkSession(Widget topLevel, Boolean sendStarted)
|
||||
{
|
||||
Tt_status ttstat;
|
||||
char *errfmt;
|
||||
|
||||
sendStopped = sendStarted;
|
||||
procId = ttdt_open(&ttFd,
|
||||
DTTERM_CLASS_NAME,
|
||||
VENDOR,
|
||||
VERSION,
|
||||
sendStarted);
|
||||
|
||||
ttstat = tt_ptr_error(procId);
|
||||
errfmt =
|
||||
GETMESSAGE(10, 2, "Could not connect to ToolTalk:\n%s\nExiting ...");
|
||||
DieFromToolTalkError( topLevel, errfmt, ttstat );
|
||||
|
||||
ttstat = tt_ptype_declare("DT_Terminal");
|
||||
DieFromToolTalkError( topLevel, "tt_ptype_declare", ttstat );
|
||||
|
||||
ttstat = tt_ptype_opnum_callback_add("DT_Terminal", 0, HandleTtRequest);
|
||||
DieFromToolTalkError( topLevel, "tt_ptype_opnum_callback_add", ttstat );
|
||||
|
||||
ttstat = tt_ptype_declare("SDT_Terminal");
|
||||
DieFromToolTalkError( topLevel, "tt_ptype_declare", ttstat );
|
||||
|
||||
ttstat = tt_ptype_opnum_callback_add("SDT_Terminal", 0, HandleTtRequest);
|
||||
DieFromToolTalkError( topLevel, "tt_ptype_opnum_callback_add", ttstat );
|
||||
|
||||
/*
|
||||
* If we were started by a message, the following call to
|
||||
* tttk_Xt_input_handler will process it. Otherwise,
|
||||
* tttk_Xt_input_handler will just return.
|
||||
*/
|
||||
tttk_Xt_input_handler(NULL, 0, 0);
|
||||
|
||||
return(TT_OK);
|
||||
}
|
||||
|
||||
int
|
||||
FinishToolTalkInit(Widget topLevel)
|
||||
{
|
||||
ProcessToolTalkInputId =
|
||||
XtAppAddInput(XtWidgetToApplicationContext(topLevel),
|
||||
ttFd, (XtPointer)XtInputReadMask,
|
||||
tttk_Xt_input_handler, procId);
|
||||
DtTermToolTalkPattern = ttdt_session_join(tt_default_session( ),
|
||||
SessionCallback,
|
||||
topLevel,
|
||||
NULL,
|
||||
1);
|
||||
if (tt_is_err(tt_ptr_error(DtTermToolTalkPattern))) {
|
||||
ttdt_close(NULL, NULL, sendStopped);
|
||||
return(0);
|
||||
}
|
||||
refWidget = topLevel;
|
||||
if (!displayString) {
|
||||
/* This dtterm -sdtserver must have been started up from either a
|
||||
* session startup or the command line. */
|
||||
displayString = DisplayString(XtDisplay(refWidget));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
Tt_callback_action
|
||||
HandleTtRequest(Tt_message msg, Tt_pattern pat)
|
||||
{
|
||||
char *op;
|
||||
Tt_status status;
|
||||
|
||||
op = tt_message_op( msg );
|
||||
status = tt_ptr_error( op );
|
||||
if (tt_is_err(status) || (op == 0)) {
|
||||
/* Let tttk_Xt_input_handler() Do The Right Thing */
|
||||
return TT_CALLBACK_CONTINUE;
|
||||
}
|
||||
if ((!strcmp(op, "SDtTerminal_New")) || (!strcmp(op, "DtTerminal_New"))) {
|
||||
if ((getuid() == tt_message_uid(msg)) &&
|
||||
(getgid() == tt_message_gid(msg))) {
|
||||
dttermNewHandler( msg );
|
||||
} else {
|
||||
tt_message_reject(msg);
|
||||
tt_message_destroy(msg);
|
||||
return TT_CALLBACK_PROCESSED;
|
||||
}
|
||||
} else {
|
||||
tt_free(op);
|
||||
return TT_CALLBACK_CONTINUE;
|
||||
}
|
||||
|
||||
tt_free(op);
|
||||
return TT_CALLBACK_PROCESSED;
|
||||
}
|
||||
|
||||
/*ARGSUSED*/
|
||||
static void
|
||||
dttermNewHandler(
|
||||
Tt_message msg)
|
||||
{
|
||||
Widget shellWidget;
|
||||
int pid = -1;
|
||||
Arg arglist[20];
|
||||
int argcnt = 0;
|
||||
char *msgFile;
|
||||
char numArgs;
|
||||
int i, j, k;
|
||||
char *displayEnv, *newDisplayString;
|
||||
|
||||
msgFile = tt_message_file(msg);
|
||||
if (tt_is_err(tt_ptr_error(msgFile))) msgFile = 0;
|
||||
numArgs = tt_message_args_count(msg);
|
||||
if (tt_is_err( tt_int_error(numArgs))) numArgs = 0;
|
||||
for (i = 0; i < numArgs; i++) {
|
||||
char *vtype, *val;
|
||||
|
||||
vtype = tt_message_arg_type(msg, i);
|
||||
if ((vtype == 0) || (tt_is_err(tt_ptr_error(vtype)))) {
|
||||
continue;
|
||||
}
|
||||
val = tt_message_arg_val(msg, i);
|
||||
if(strcmp(vtype, "-display") == 0) {
|
||||
newDisplayString = XtNewString(val);
|
||||
}
|
||||
tt_free( val );
|
||||
tt_free( vtype );
|
||||
}
|
||||
|
||||
if (!displayString) {
|
||||
/* This tt message is part of an action dtterm -server startup. */
|
||||
displayString = newDisplayString;
|
||||
displayEnv = (char *)malloc(strlen("DISPLAY=") +
|
||||
strlen(displayString) + 2);
|
||||
displayEnv[0]=NULL;
|
||||
strcat(displayEnv, "DISPLAY=");
|
||||
strcat(displayEnv, displayString);
|
||||
putenv(displayEnv);
|
||||
tt_free(msgFile);
|
||||
tt_message_reply(msg);
|
||||
tttk_message_destroy(msg);
|
||||
return;
|
||||
} else {
|
||||
if (strcmp(displayString, newDisplayString)) {
|
||||
tt_free(msgFile);
|
||||
tt_message_reject(msg);
|
||||
XtFree(newDisplayString);
|
||||
return;
|
||||
}
|
||||
XtFree(newDisplayString);
|
||||
}
|
||||
|
||||
argcnt = 0;
|
||||
(void) XtSetArg(arglist[argcnt], XmNallowShellResize, True);
|
||||
argcnt++;
|
||||
shellWidget = XtAppCreateShell((char *) 0, "Dtterm",
|
||||
applicationShellWidgetClass, XtDisplay((Widget) refWidget),
|
||||
arglist, argcnt);
|
||||
|
||||
/* parse off messageFields and build the dttermview arglist... */
|
||||
argcnt = 0;
|
||||
|
||||
/* create the dtterm... */
|
||||
(void) CreateInstance(shellWidget, "dtTermView", arglist, argcnt, True);
|
||||
|
||||
(void) XtRealizeWidget(shellWidget);
|
||||
#ifdef sun
|
||||
sunSetupIA(shellWidget);
|
||||
#endif
|
||||
|
||||
#ifdef TIMEOUT
|
||||
/* since we now have active instances, we can remove our
|
||||
* wait timeout...
|
||||
*/
|
||||
if (waitId) {
|
||||
(void) XtRemoveTimeOut(waitId);
|
||||
waitId = (XtIntervalId) 0;
|
||||
}
|
||||
#endif /* TIMEOUT */
|
||||
|
||||
tt_free(msgFile);
|
||||
tt_message_reply(msg);
|
||||
tttk_message_destroy(msg);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Boolean
|
||||
ServerStartSession(Widget topLevel, int argc, char **argv, Boolean loginShell,
|
||||
char **commandToExec)
|
||||
{
|
||||
return(InitializeToolTalkSession(topLevel, True));
|
||||
}
|
||||
|
||||
#ifdef TIMEOUT
|
||||
static void
|
||||
TimeOut(
|
||||
XtPointer clientData,
|
||||
XtIntervalId *id
|
||||
)
|
||||
{
|
||||
/* if we have no instances active, go away... */
|
||||
if (InstanceCount <= 0) {
|
||||
(void) exit(0);
|
||||
}
|
||||
|
||||
/* otherwise, clear the waitId... */
|
||||
if (*id == waitId) {
|
||||
waitId = (XtIntervalId) 0;
|
||||
}
|
||||
}
|
||||
#endif /* TIMEOUT */
|
||||
|
||||
|
||||
static void
|
||||
ExitCB (Widget dialog, XtPointer client_data, XtPointer call_data)
|
||||
{
|
||||
exit((int) client_data);
|
||||
}
|
||||
|
||||
void
|
||||
DieFromToolTalkError(Widget parent, char *errfmt, Tt_status status)
|
||||
{
|
||||
Arg args[10];
|
||||
Widget dialog, dialogShell;
|
||||
char *errmsg, *statmsg, *title;
|
||||
XmString xms_errmsg, xms_ok, xms_title;
|
||||
int n;
|
||||
|
||||
if (! tt_is_err(status)) return;
|
||||
statmsg = tt_status_message(status);
|
||||
errmsg = XtMalloc(strlen(errfmt) + strlen(statmsg) + 2);
|
||||
sprintf(errmsg, errfmt, statmsg);
|
||||
|
||||
xms_ok = GETXMSTRING(10, 3, "OK");
|
||||
xms_errmsg = XmStringCreateLocalized(errmsg);
|
||||
xms_title = GETXMSTRING(10, 1, "Terminal - Error");
|
||||
|
||||
n = 0;
|
||||
XtSetArg(args[n], XmNautoUnmanage, False); n++;
|
||||
XtSetArg(args[n], XmNokLabelString, xms_ok); n++;
|
||||
XtSetArg(args[n], XmNdialogTitle, xms_title); n++;
|
||||
XtSetArg(args[n], XmNmessageString, xms_errmsg); n++;
|
||||
XtSetArg(args[n], XmNdialogStyle, XmDIALOG_FULL_APPLICATION_MODAL); n++;
|
||||
|
||||
dialog = XmCreateErrorDialog(parent, "IconEditorError", args, n);
|
||||
XtAddCallback(dialog, XmNokCallback, ExitCB, (XtPointer) status);
|
||||
XtUnmanageChild(XmMessageBoxGetChild(dialog, XmDIALOG_CANCEL_BUTTON));
|
||||
XtUnmanageChild(XmMessageBoxGetChild(dialog, XmDIALOG_HELP_BUTTON));
|
||||
|
||||
/*
|
||||
* Disable the frame menu from dialog since we don't want the user
|
||||
* to be able to close dialogs with the frame menu
|
||||
*/
|
||||
dialogShell = XtParent(dialog);
|
||||
n = 0;
|
||||
XtSetArg(args[n], XmNmwmDecorations, MWM_DECOR_ALL | MWM_DECOR_MENU); n++;
|
||||
XtSetValues(dialogShell, args, n);
|
||||
XtManageChild(dialog);
|
||||
XtRealizeWidget(dialogShell);
|
||||
|
||||
_DtSimpleError("Dtterm", DtFatalError, NULL, errmsg);
|
||||
|
||||
XtFree(errmsg);
|
||||
XmStringFree(xms_ok);
|
||||
XmStringFree(xms_errmsg);
|
||||
XmStringFree(xms_title);
|
||||
|
||||
while (TRUE)
|
||||
XtAppProcessEvent(XtWidgetToApplicationContext(dialog), XtIMAll);
|
||||
}
|
||||
495
cde/programs/dtterm/terminfoChecklist
Normal file
495
cde/programs/dtterm/terminfoChecklist
Normal file
@@ -0,0 +1,495 @@
|
||||
/* $TOG: terminfoChecklist /main/4 1997/05/20 16:45:31 samborn $
|
||||
*
|
||||
* COMPONENT_NAME: desktop
|
||||
*
|
||||
* FUNCTIONS: E
|
||||
*
|
||||
* ORIGINS: 27,118,119,120,121
|
||||
*
|
||||
* This module contains IBM CONFIDENTIAL code. -- (IBM
|
||||
* Confidential Restricted when combined with the aggregated
|
||||
* modules for this product)
|
||||
* OBJECT CODE ONLY SOURCE MATERIALS
|
||||
*
|
||||
* (C) COPYRIGHT International Business Machines Corp. 1995
|
||||
* All Rights Reserved
|
||||
* US Government Users Restricted Rights - Use, duplication or
|
||||
* disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
|
||||
*/
|
||||
dtterm,
|
||||
##Wnum, /* Maximum number of definable windows */
|
||||
acsc=``aaffggjjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~,
|
||||
/* Graphic charset pairs aAbBcC */
|
||||
am, /* terminal has automatic margins */
|
||||
/* we do not erase the screen in the current background color... */
|
||||
##bce, /* Screen erased with background color */
|
||||
bel=^G, /* Audible signal (bell) */
|
||||
##bicr, /* Move to beginning of same row (use tparm) */
|
||||
##binel, /* Move to next row of bit image (use tparm) */
|
||||
##birep, /* Repeat bit-image cell #1 #2 times (use tparm) */
|
||||
##bitwin, /* Number of passes for each bit-map row */
|
||||
##bitype, /* Type of bit image device */
|
||||
blink=\E[5m, /* Turn on blinking */
|
||||
bold=\E[1m, /* Turn on bold (extra bright) mode */
|
||||
##btns, /* Number of buttons on the mouse */
|
||||
/* DKS: this relates to reverse wrap... */
|
||||
##bw, /* cub1 wraps from column 0 to last column */
|
||||
##cbt, /* Back tab */
|
||||
##ccc, /* Terminal can re-define existing color */
|
||||
##chts, /* Cursor is hard to see */
|
||||
civis=\E[?25l, /* Make cursor invisible */
|
||||
clear=\E[H\E[J, /* Clear screen and home cursor */
|
||||
##cmdch, /* Terminal settable cmd char in prototype */
|
||||
cnorm=\E[?25h, /* Make cursor appear normal (undo vs/vi) */
|
||||
##colornm, /* Give name for color #1 */
|
||||
colors#8, /* Maximum number of colors on the screen */
|
||||
cols#80, /* Number of columns in a line */
|
||||
cr=\r, /* Carriage return */
|
||||
##csin, /* Init sequence for multiple codesets */
|
||||
##csnm, /* List of character set names */
|
||||
csr=\E[%i%p1%d;%p2%dr, /* Change to lines #1 through #2 (vt100) */
|
||||
cub=\E[%p1%dD, /* Move left one space. */
|
||||
cub1=\b, /* Move cursor left #1 spaces */
|
||||
cud=\E[%p1%dB, /* Down one line */
|
||||
cud1=\n, /* Move down #1 lines. */
|
||||
cuf=\E[%p1%dC, /* Non-destructive space (cursor or carriage right) */
|
||||
cuf1=\E[C, /* Move right #1 spaces. */
|
||||
cup=\E[%i%p1%d;%p2%dH, /* Move to row #1 col #2 */
|
||||
cuu=\E[%p1%dA, /* Move cursor up #1 lines. */
|
||||
cuu1=\E[A, /* Upline (cursor up) */
|
||||
##cvvis, /* Make cursor very visible */
|
||||
##cwin, /* Define win #1 to go from #2,#3 to #4,#5 */
|
||||
##da, /* Display may be retained above the screen */
|
||||
##db, /* Display may be retained below the screen */
|
||||
dch=\E[%p1%dP, /* Delete #1 chars */
|
||||
dch1=\E[P, /* Delete character */
|
||||
##dclk, /* Display time-of-day clock */
|
||||
##defbi, /* Define rectangular bit-image region (use tparm) */
|
||||
##defc, /* Define a character in a character set */
|
||||
##devt, /* Indicate language/codeset support */
|
||||
##dial, /* Dial phone number #1 */
|
||||
dim=\E[2m, /* Turn on half-bright mode */
|
||||
##dispc, /* Display PC character */
|
||||
dl=\E[%p1%dM, /* Delete #1 lines */
|
||||
dl1=\E[M, /* Delete line */
|
||||
##docr, /* Printing any of these chars causes cr */
|
||||
##dsl, /* Disable status line */
|
||||
ech=\E[%p1%dX, /* Erase #1 characters */
|
||||
ed=\E[J, /* Clear to end of display */
|
||||
##ehhlm, /* turn on horizontal highlight mode */
|
||||
el=\E[K, /* Clear to end of line */
|
||||
el1=\E[1K, /* Clear to beginning of line, inclusive */
|
||||
##elhlm, /* turn on left highlight mode */
|
||||
##elohlm, /* turn on low highlight mode */
|
||||
##enacs=\E)0, /* Enable alternate character set */
|
||||
##endbi, /* End a bit-image region (use tparm) */
|
||||
##eo, /* Can erase overstrikes with a blank */
|
||||
##erhlm, /* turn on right highlight mode */
|
||||
##eslok, /* Escape can be used on the status line */
|
||||
##ethlm, /* Turn on top highlight mode */
|
||||
##evhlm, /* turn on vertical highlight mode */
|
||||
flash=\E[?5h$<200>\E[?5l, /* Visible bell (may not move cursor) */
|
||||
##fln, /* Label format */
|
||||
##fsl, /* Return from status line */
|
||||
##getm, /* Curses should get button events */
|
||||
##gn, /* Generic line type (e.g., dialup, switch) */
|
||||
##hc, /* Hardcopy terminal */
|
||||
##hls, /* Term uses only HLS color notation (Tektronix) */
|
||||
home=\E[H, /* Home cursor (if no cup) */
|
||||
##hook, /* Flash the switch hook */
|
||||
##hpa, /* Horizontal position absolute */
|
||||
##hs, /* Has extra "status line" */
|
||||
ht=\t, /* Tab to next 8-space hardware tab stop */
|
||||
hts=\EH, /* Set a tab in all rows, current column */
|
||||
##hup, /* Hang-up phone */
|
||||
##hz, /* Hazeltine; can't print tilde (~) */
|
||||
ich=\E[%p1%d@, /* Insert #1 blank chars */
|
||||
/* this needs to be left out for multi-byte functionality to work... */
|
||||
##ich1, /* Insert character */
|
||||
##if, /* Name of initialization file */
|
||||
il=\E[%p1%dL, /* Add #1 new blank lines */
|
||||
il1=\E[L, /* Add new blank line */
|
||||
##in, /* Insert mode distinguishes nulls */
|
||||
ind=\ED, /* Scroll text up */
|
||||
##indn, /* Scroll forward #1 lines. */
|
||||
##initc, /* Initialize the definition of color */
|
||||
##initp, /* Initialize color-pair */
|
||||
invis=\E[8m, /* Turn on blank mode (characters invisible) */
|
||||
##ip, /* Insert pad after character inserted */
|
||||
##iprog, /* Path name of program for initialization */
|
||||
##is1, /* Terminal or printer initialization string */
|
||||
is2=\E\sF\E>\E[?1l\E[?7h\E[?45l,/* Terminal or printer initialization string */
|
||||
##is3, /* Terminal or printer initialization string */
|
||||
it#8, /* Tabs initially every # spaces */
|
||||
##kBEG, /* sent by shifted beginning key */
|
||||
##kCAN, /* sent by shifted cancel key */
|
||||
##kCMD, /* sent by shifted command key */
|
||||
##kCPY, /* sent by shifted copy key */
|
||||
##kCRT, /* sent by shifted create key */
|
||||
##kDC, /* sent by shifted delete-char key */
|
||||
##kDL, /* sent by shifted delete-line key */
|
||||
##kEND, /* sent by shifted end key */
|
||||
##kEOL, /* sent by shifted clear-line key */
|
||||
##kEXT, /* sent by shifted exit key */
|
||||
##kFND, /* sent by shifted find key */
|
||||
##kHLP, /* sent by shifted help key */
|
||||
##kHOM, /* sent by shifted home key */
|
||||
##kIC, /* sent by shifted input key */
|
||||
##kLFT, /* sent by shifted left-arrow key */
|
||||
##kMOV, /* sent by shifted move key */
|
||||
##kMSG, /* sent by shifted message key */
|
||||
##kNXT, /* sent by shifted next key */
|
||||
##kOPT, /* sent by shifted options key */
|
||||
##kPRT, /* sent by shifted print key */
|
||||
##kPRV, /* sent by shifted prev key */
|
||||
##kRDO, /* sent by shifted redo key */
|
||||
##kRES, /* sent by shifted resume key */
|
||||
##kRIT, /* sent by shifted right-arrow key */
|
||||
##kRPL, /* sent by shifted replace key */
|
||||
##kSAV, /* sent by shifted save key */
|
||||
##kSPD, /* sent by shifted suspend key */
|
||||
##kUND, /* sent by shifted undo key */
|
||||
##ka1, /* upper left of keypad */
|
||||
##ka3, /* upper right of keypad */
|
||||
##kb2, /* center of keypad */
|
||||
##kbeg, /* sent by beg(inning) key */
|
||||
kbs=\b, /* sent by backspace key */
|
||||
##kc1, /* lower left of keypad */
|
||||
##kcan, /* sent by cancel key */
|
||||
##kcbt, /* sent by back-tab key */
|
||||
##kclo, /* sent by close key */
|
||||
##kclr, /* sent by clear-screen or erase key */
|
||||
##kcmd, /* sent by cmd (command) key */
|
||||
##kcpy, /* sent by copy key */
|
||||
##kcrt, /* sent by create key */
|
||||
##kctab, /* sent by clear-tab key */
|
||||
kcub1=\E[D, /* sent by terminal left-arrow key */
|
||||
kcud1=\E[B, /* sent by terminal down-arrow key */
|
||||
kcuf1=\E[C, /* sent by terminal right-arrow key */
|
||||
kcuu1=\E[A, /* sent by terminal up-arrow key */
|
||||
kdch1=\E[3~, /* sent by delete-character key */
|
||||
##kdl1, /* sent by delete-line key */
|
||||
##ked, /* sent by clear-to-end-of-screen key */
|
||||
##kel, /* sent by clear-to-end-of-line key */
|
||||
##kend, /* sent by end key */
|
||||
##kent, /* sent by enter/send key */
|
||||
##kext, /* sent by exit key */
|
||||
##kf0, /* sent by function key f0 */
|
||||
kf1=\E[11~, /* sent by function key f1 */
|
||||
kf2=\E[12~, /* sent by function key f2 */
|
||||
kf3=\E[13~, /* sent by function key f3 */
|
||||
kf4=\E[14~, /* sent by function key f4 */
|
||||
kf5=\E[15~, /* sent by function key f5 */
|
||||
kf6=\E[17~, /* sent by function key f6 */
|
||||
kf7=\E[18~, /* sent by function key f7 */
|
||||
kf8=\E[19~, /* sent by function key f8 */
|
||||
kf9=\E[20~, /* sent by function key f9 */
|
||||
kf10=\E[21~, /* sent by function key f10 */
|
||||
kf11=\E[23~, /* sent by function key f11 */
|
||||
kf12=\E[24~, /* sent by function key f12 */
|
||||
kf13=\E[25~, /* sent by function key f13 */
|
||||
kf14=\E[26~, /* sent by function key f14 */
|
||||
kf15=\E[28~, /* sent by function key f15 */
|
||||
kf16=\E[29~, /* sent by function key f16 */
|
||||
kf17=\E[31~, /* sent by function key f17 */
|
||||
kf18=\E[32~, /* sent by function key f18 */
|
||||
kf19=\E[33~, /* sent by function key f19 */
|
||||
kf20=\E[34~, /* sent by function key f20 */
|
||||
##kf21, /* sent by function key f21 */
|
||||
##kf22, /* sent by function key f22 */
|
||||
##kf23, /* sent by function key f23 */
|
||||
##kf24, /* sent by function key f24 */
|
||||
##kf25, /* sent by function key f25 */
|
||||
##kf26, /* sent by function key f26 */
|
||||
##kf27, /* sent by function key f27 */
|
||||
##kf28, /* sent by function key f28 */
|
||||
##kf29, /* sent by function key f29 */
|
||||
##kf30, /* sent by function key f30 */
|
||||
##kf31, /* sent by function key f31 */
|
||||
##kf32, /* sent by function key f32 */
|
||||
##kf33, /* sent by function key f33 */
|
||||
##kf34, /* sent by function key f34 */
|
||||
##kf35, /* sent by function key f35 */
|
||||
##kf36, /* sent by function key f36 */
|
||||
##kf37, /* sent by function key f37 */
|
||||
##kf38, /* sent by function key f38 */
|
||||
##kf39, /* sent by function key f39 */
|
||||
##kf40, /* sent by function key f40 */
|
||||
##kf41, /* sent by function key f41 */
|
||||
##kf42, /* sent by function key f42 */
|
||||
##kf43, /* sent by function key f43 */
|
||||
##kf44, /* sent by function key f44 */
|
||||
##kf45, /* sent by function key f45 */
|
||||
##kf46, /* sent by function key f46 */
|
||||
##kf47, /* sent by function key f47 */
|
||||
##kf48, /* sent by function key f48 */
|
||||
##kf49, /* sent by function key f49 */
|
||||
##kf50, /* sent by function key f50 */
|
||||
##kf51, /* sent by function key f51 */
|
||||
##kf52, /* sent by function key f52 */
|
||||
##kf53, /* sent by function key f53 */
|
||||
##kf54, /* sent by function key f54 */
|
||||
##kf55, /* sent by function key f55 */
|
||||
##kf56, /* sent by function key f56 */
|
||||
##kf57, /* sent by function key f57 */
|
||||
##kf58, /* sent by function key f58 */
|
||||
##kf59, /* sent by function key f59 */
|
||||
##kf60, /* sent by function key f60 */
|
||||
##kf61, /* sent by function key f61 */
|
||||
##kf62, /* sent by function key f62 */
|
||||
##kf63, /* sent by function key f63 */
|
||||
kfnd=\E[1~, /* sent by find key */
|
||||
khlp=\E[28~, /* sent by help key */
|
||||
##khome, /* sent by home key */
|
||||
##khts, /* sent by set-tab key */
|
||||
kich1=\E[2~, /* sent by ins-char/enter ins-mode key */
|
||||
##kil1, /* sent by insert-line key */
|
||||
##kind, /* sent by scroll-forward/down key */
|
||||
##kll, /* sent by home-down key */
|
||||
##km, /* Has a meta key (shift, sets parity bit) */
|
||||
##kmous, /* 0631, Mouse event has occured */
|
||||
##kmov, /* sent by move key */
|
||||
##kmrk, /* sent by mark key */
|
||||
##kmsg, /* sent by message key */
|
||||
#ifdef HAS_KNL
|
||||
knl=\r, /* sent by newline key */
|
||||
#endif
|
||||
knp=\E[6~, /* sent by next-page key */
|
||||
##knxt, /* sent by next-object key */
|
||||
##kopn, /* sent by open key */
|
||||
##kopt, /* sent by options key */
|
||||
kpp=\E[5~, /* sent by previous-page key */
|
||||
##kprt, /* sent by print or copy key */
|
||||
##kprv, /* sent by previous-object key */
|
||||
##krdo, /* sent by redo key */
|
||||
##kref, /* sent by ref(erence) key */
|
||||
##kres, /* sent by resume key */
|
||||
##krfr, /* sent by refresh key */
|
||||
##kri, /* sent by scroll-backward/up key */
|
||||
##krmir, /* sent by rmir or smir in insert mode */
|
||||
##krpl, /* sent by replace key */
|
||||
##krst, /* sent by restart key */
|
||||
##ksav, /* sent by save key */
|
||||
kslt=\E[4~, /* sent by select key */
|
||||
##kspd, /* sent by suspend key */
|
||||
#ifdef HAS_KTAB
|
||||
ktab=^I, /* sent by tab key */
|
||||
#endif
|
||||
##ktbc, /* sent by clear-all-tabs key */
|
||||
##kund, /* sent by undo key */
|
||||
##lf0, /* Labels on function key f0 if not f0 */
|
||||
##lf1, /* Labels on function key f1 if not f1 */
|
||||
##lf2, /* Labels on function key f2 if not f2 */
|
||||
##lf3, /* Labels on function key f3 if not f3 */
|
||||
##lf4, /* Labels on function key f4 if not f4 */
|
||||
##lf5, /* Labels on function key f5 if not f5 */
|
||||
##lf6, /* Labels on function key f6 if not f6 */
|
||||
##lf7, /* Labels on function key f7 if not f7 */
|
||||
##lf8, /* Labels on function key f8 if not f8 */
|
||||
##lf9, /* Labels on function key f9 if not f9 */
|
||||
##lf10, /* Labels on function key f10 if not f10 */
|
||||
##lh, /* Number of rows in each label */
|
||||
lines#24, /* Number of lines on a screen or a page */
|
||||
##ll, /* Last line, first column (if no cup) */
|
||||
lm#0, /* Lines of memory if > lines; 0 means varies */
|
||||
##lw, /* Number of columns in each label */
|
||||
##ma, /* Max video attributes terminal can display */
|
||||
##maddr, /* Maximum value in micro_..._address */
|
||||
##mc0, /* Print contents of the screen */
|
||||
##mc4, /* Turn off the printer */
|
||||
##mc5, /* Turn on the printer */
|
||||
##mc5i, /* Printer won't echo on screen */
|
||||
##mc5p, /* Turn on the printer for #1 bytes */
|
||||
##mgc, /* Clear all margins (top, bottom, and sides) */
|
||||
##minfo, /* Mouse status information */
|
||||
mir, /* Safe to move while in insert mode */
|
||||
##mrcup, /* Memory relative cursor addressing */
|
||||
msgr, /* Safe to move in standout modes */
|
||||
##ncv, /* Video attrs that can't be used with colors */
|
||||
##ndscr, /* Scrolling region is nondestructive */
|
||||
nel=\EE, /* Newline (behaves like cr followed by lf) */
|
||||
##nlab, /* Number of labels on screen (start at 1) */
|
||||
##npc, /* Pad character doesn't exist */
|
||||
##nrrmc, /* smcup does not reverse rmcup */
|
||||
##nxon, /* Padding won't work, xon/xoff required */
|
||||
##oc, /* Set all color(-pair)s to the original ones */
|
||||
op=\E[39;49m, /* Set default color-pair to the original one */
|
||||
##os, /* Terminal overstrikes on hard-copy terminal */
|
||||
##pad, /* Pad character (rather than null) */
|
||||
pairs#8, /* Max number of color-pairs on the screen */
|
||||
##pause, /* Pause for 2-3 secondse */
|
||||
##pb, /* Lowest baud rate where padding needed */
|
||||
##pctrm, /* PC terminal options */
|
||||
##pfkey, /* Prog funct key #1 to type string #2 */
|
||||
##pfloc, /* Prog funct key #1 to execute string #2 */
|
||||
##pfx, /* Prog funct key #1 to xmit string #2 */
|
||||
##pfxl, /* Prog key #1 to xmit string #2 and show string #3 */
|
||||
##pln, /* Prog label #1 to show string #2 */
|
||||
##prot, /* Turn on protected mode */
|
||||
##pulse, /* Select pulse dialing */
|
||||
##qdial, /* Dial phone number #1, without progress detection */
|
||||
rc=\E8, /* Restore cursor to position of last sc */
|
||||
##rep, /* Repeat char #1 #2 times */
|
||||
##reqmp, /* Request mouse position report */
|
||||
rev=\E[7m, /* Turn on reverse video mode */
|
||||
##rf, /* Name of file containing reset string */
|
||||
##rfi, /* Send next input char (for ptys) */
|
||||
ri=\EM, /* Scroll text down */
|
||||
##rin, /* Scroll backward #1 lines. */
|
||||
##rlm, /* Enable rightward (normal) carriage motion */
|
||||
rmacs=^O, /* End alternate character set */
|
||||
rmam=\E[?7l, /* Turn off automatic margins */
|
||||
##rmclk, /* Remove time-of-day clock */
|
||||
##rmcup, /* String to end programs that use cup */
|
||||
##rmdc, /* End delete mode */
|
||||
rmir=\E[4l, /* End insert mode */
|
||||
##rmkx, /* Out of ``keypad-transmit'' mode */
|
||||
##rmln, /* Turn off soft labels */
|
||||
##rmm, /* Turn off "meta mode" */
|
||||
##rmp, /* Like ip but when in replace mode */
|
||||
##rmpch, /* Disable PC character display mode */
|
||||
##rmsc, /* Disable PC scancode mode */
|
||||
rmso=\E[22;27m, /* End standout mode */
|
||||
rmul=\E[24m, /* End underscore mode */
|
||||
##rmxon, /* Turn off xon/xoff handshaking */
|
||||
##rs1, /* Reset terminal completely to sane modes */
|
||||
##rs2, /* Reset terminal completely to sane modes */
|
||||
##rs3, /* Reset terminal completely to sane modes */
|
||||
##rum, /* Enable downward (normal) carriage motion */
|
||||
##s0ds, /* Shift into codeset 0 (EUC set 0, ASCII) */
|
||||
##s1ds, /* Shift into codeset 1 */
|
||||
##s2ds, /* Shift into codeset 2 */
|
||||
##s3ds, /* Shift into codeset 3 */
|
||||
##sam, /* Printing in last column causes cr */
|
||||
##sbim, /* Start printing bit image graphics */
|
||||
sc=\E7, /* Save cursor position */
|
||||
##scesa, /* Alternate escape for scancode emulation (default is for vt100) */
|
||||
##scesc, /* Escape for scancode emulation */
|
||||
##sclk, /* Set time-of-day clock */
|
||||
##scp, /* Set current color-pair */
|
||||
##scs, /* Select character set */
|
||||
##scsd, /* Start definition of a character set */
|
||||
setab=\E[%p1%{40}%+%dm, /* Set background color using ANSI escape */
|
||||
setaf=\E[%p1%{30}%+%dm, /* Set foreground color using ANSI escape */
|
||||
##setb, /* Set current background color */
|
||||
##setcolor, /* Change to ribbon color #1 */
|
||||
##setf, /* Set current foreground color1 */
|
||||
sgr=\E[0%?%p1%t;2;7%;%?%p2%t;4%;%?%p3%t;7%;%?%p4%t;5%;%?%p5%t;2%;%?%p6%t;1%;%?%p7%t;8%;m%?%p9%t^N%e^O%;,
|
||||
/* Define the video attributes #1-#9 */
|
||||
sgr0=\E[0m, /* Turn off all attributes */
|
||||
##slm, /* Enable leftward carriage motion */
|
||||
smacs=^N, /* Start alternate character set */
|
||||
smam=\E[?7h, /* Turn on automatic margins */
|
||||
##smcup, /* String to begin programs that use cup */
|
||||
##smdc, /* Delete mode (enter) */
|
||||
##smgb, /* Set bottom margin at current line */
|
||||
##smgl, /* Set left margin at current line */
|
||||
##smglp, /* Set left (right) margin at column #1 (#2) */
|
||||
##smglr, /* Sets both left and right margins */
|
||||
##smgr, /* Set right margin at current column */
|
||||
##smgrp, /* Set right margin at column #1 */
|
||||
##smgt, /* Set top margin at current line */
|
||||
##smgtb, /* Sets both top and bottom margins */
|
||||
##smgtp, /* Set top (bottom) margin at line #1 (#2) */
|
||||
smir=\E[4h, /* Insert mode (enter) */
|
||||
##smkx, /* Put terminal in ``keypad-transmit'' mode */
|
||||
##smln, /* Turn on soft labels */
|
||||
##smm, /* Turn on "meta mode" (8th bit) */
|
||||
##smpch, /* Enter PC character display mode */
|
||||
##smsc, /* Enter PC scancode mode */
|
||||
smso=\E[2;7m, /* Begin standout mode */
|
||||
smul=\E[4m, /* Start underscore mode */
|
||||
##smxon, /* Turn on xon/xoff handshaking */
|
||||
##supcs, /* List of ``superscript-able'' characters */
|
||||
tbc=\E[3g, /* Clear all tab stops */
|
||||
##tone, /* Select touch tone dialing */
|
||||
##tsl, /* Go to status line, col #1 */
|
||||
##u0, /* User string 0 */
|
||||
##u1, /* User string 1 */
|
||||
##u2, /* User string 2 */
|
||||
##u3, /* User string 3 */
|
||||
##u4, /* User string 4 */
|
||||
##u5, /* User string 5 */
|
||||
##u6, /* User string 6 */
|
||||
##u7, /* User string 7 */
|
||||
##u8, /* User string 8 */
|
||||
##u9, /* User string 9 */
|
||||
##uc, /* Underscore one char and move past it */
|
||||
##ul, /* Underline character overstrikes */
|
||||
##vpa, /* Vertical position absolute */
|
||||
##vt, /* Virtual terminal number */
|
||||
##wait, /* Wait for dial tone */
|
||||
##widcs, /* Char step size when in double wide mode */
|
||||
##wind, /* Current window is lines #1-#2 cols #3-#4 */
|
||||
##wingo, /* Got to window #1 */
|
||||
##wsl, /* Number of columns in status line */
|
||||
xenl, /* Newline ignored after 80 columns */
|
||||
##xhp, /* Standout not erased by overwriting (hp) */
|
||||
##xhpa, /* Only positive motion for hpa/mhpa caps */
|
||||
##xmc, /* Number of blank chars left by smso or rmso */
|
||||
##xoffc, /* X-off character */
|
||||
xon, /* Terminal uses xon/xoff handshaking */
|
||||
##xonc, /* X-on character */
|
||||
##xsb, /* Beehive (f1=escape, f2=ctrl C) */
|
||||
##xt, /* Destructive tabs, magic smso char (t1061) */
|
||||
##xvpa, /* Only positive motion for vpa/mvpa caps */
|
||||
##zerom, /* No motion for the subsequent character */
|
||||
|
||||
/* printer functionality... */
|
||||
##bufsz, /* Number of bytes buffered before printing */
|
||||
##chr, /* Change horizontal resolution */
|
||||
##cpi, /* Change number of characters per inch */
|
||||
##cpix, /* Changing char pitch changes resolution */
|
||||
##cps, /* Print rate in characters per second */
|
||||
##crxm, /* Using cr turns off micro mode */
|
||||
##cvr, /* Change vertical resolution */
|
||||
##daisy, /* Printer needs operator to change char set */
|
||||
##ff, /* Hardcopy terminal page eject */
|
||||
##hd, /* Half-line down (forward 1/2 linefeed) */
|
||||
##hu, /* Half-line up (reverse 1/2 linefeed) */
|
||||
##kc3, /* lower right of keypad */
|
||||
##lpi, /* Change number of lines per inch */
|
||||
##lpix, /* Changing line pitch changes resolution */
|
||||
##mcs, /* Character step size when in micro mode */
|
||||
##mcub, /* Like parm_left_cursor for micro adjust. */
|
||||
##mcub1, /* Like cursor_left for micro adjustment */
|
||||
##mcud, /* Like parm_down_cursor for micro adjust. */
|
||||
##mcud1, /* Like cursor_down for micro adjustment */
|
||||
##mcuf, /* Like parm_right_cursor for micro adjust. */
|
||||
##mcuf1, /* Like cursor_right for micro adjustment */
|
||||
##mcuu, /* Like parm_up_cursor for micro adjust. */
|
||||
##mcuu1, /* Like cursor_up for micro adjustment */
|
||||
##mhpa, /* Like column_address for micro adjustment */
|
||||
##mjump, /* Maximum value in parm_..._micro */
|
||||
##mls, /* Line step size when in micro mode */
|
||||
##mvpa, /* Like row_address for micro adjustment */
|
||||
##npins, /* Number of pins in print-head */
|
||||
##orc, /* Horizontal resolution in units per char */
|
||||
##orhi, /* Horizontal resolution in units per inch */
|
||||
##orl, /* Vertical resolution in units per line */
|
||||
##orvi, /* Vertical resolution in units per inch */
|
||||
##porder, /* Matches software bits to print-head pins */
|
||||
##rbim, /* End printing bit image graphics */
|
||||
##rcsd, /* End definition of a character set */
|
||||
##ritm, /* Disable italics */
|
||||
##rmicm, /* Disable micro motion capabilities */
|
||||
##rshm, /* Disable shadow printing */
|
||||
##rsubm, /* Disable subscript printing */
|
||||
##rsupm, /* Disable superscript printing */
|
||||
##rwidm, /* Disable double wide printing */
|
||||
##sdrfq, /* Set draft quality print */
|
||||
##sitm, /* Enable italics */
|
||||
##slength, /* Set page length to #1 hundredth of an inch (use tparm) */
|
||||
##slines, /* Set page length to #1 lines (use tparm) */
|
||||
##smgbp, /* Set bottom margin at line #1 or #2 lines from bottom */
|
||||
##smicm, /* Enable micro motion capabilities */
|
||||
##snlq, /* Set near-letter quality print */
|
||||
##snrmq, /* Set normal quality print */
|
||||
##spinh, /* Spacing of dots horiz. in dots per inch */
|
||||
##spinv, /* Spacing of pins vert. in pins per inch */
|
||||
##sshm, /* Enable shadow printing */
|
||||
##ssubm, /* Enable subscript printing */
|
||||
##ssupm, /* Enable superscript printing */
|
||||
##subcs, /* List of ``subscript-able'' characters */
|
||||
##sum, /* Enable upward carriage motion */
|
||||
##swidm, /* Enable double wide printing */
|
||||
30
cde/programs/dtterm/terminfoCreate
Executable file
30
cde/programs/dtterm/terminfoCreate
Executable file
@@ -0,0 +1,30 @@
|
||||
#!/bin/ksh
|
||||
# $XConsortium: terminfoCreate /main/3 1996/07/23 17:11:13 drk $
|
||||
|
||||
sed -e '/^##/d' |
|
||||
${CPP:-/lib/cpp} |
|
||||
sed -e '/^[ ]*$/d' \
|
||||
-e '/^#/d' \
|
||||
-e 's/[ ][ ]*$//' |
|
||||
awk '
|
||||
{
|
||||
if (NR == 1) {
|
||||
printf "%s\n", $0;
|
||||
buflen = 0;
|
||||
buffer = "";
|
||||
} else {
|
||||
if ((buflen + length($0)) >= 71) {
|
||||
printf "\t%s\n", buffer;
|
||||
buffer = $0" ";
|
||||
buflen = length($0) + 1;
|
||||
} else {
|
||||
buffer = buffer""$0" ";
|
||||
buflen += length($0) + 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
END {
|
||||
if (buflen > 0) {
|
||||
printf "\t%s\n", buffer;
|
||||
}
|
||||
}'
|
||||
85
cde/programs/dtterm/tests/Cborder/Cborder.c
Normal file
85
cde/programs/dtterm/tests/Cborder/Cborder.c
Normal file
@@ -0,0 +1,85 @@
|
||||
/* $XConsortium: Cborder.c /main/3 1995/10/31 11:47:04 rswiston $ */
|
||||
#include <stdio.h>
|
||||
#include <math.h>
|
||||
#include "synvar.h"
|
||||
|
||||
#ifdef LOG
|
||||
FILE *TermLog;
|
||||
#define SAVELOG fclose(TermLog); TermLog = fopen("term.log", "a");
|
||||
#endif
|
||||
|
||||
char LogStr[200];
|
||||
|
||||
|
||||
void TestBorder(WinName, String, TestNum)
|
||||
char *WinName, *String;
|
||||
int TestNum;
|
||||
{
|
||||
char Str[IMAGE_FILE_LEN];
|
||||
PrintTermString(WinName, String);
|
||||
sprintf(Str, "%sborder%d", IMAGE_DIR, TestNum);
|
||||
MatchWindows(WinName, Str);
|
||||
CloseTerm(WinName);
|
||||
}
|
||||
|
||||
static char *OptionArr[] = {
|
||||
/*0*/ " -bd red -bw 10",
|
||||
/*1*/ " -bd green -bw 6",
|
||||
/*2*/ " -bd blue -bw 12",
|
||||
/*3*/ " -bd yellow -bw 15",
|
||||
/*4*/ " -bordercolor cyan -borderwidth 7",
|
||||
/*5*/ " -bordercolor brown -borderwidth 8",
|
||||
/*6*/ " -w 10"
|
||||
};
|
||||
|
||||
static char *LogAction[] = {
|
||||
/*0*/ "Testing option -bd red -bw 10",
|
||||
/*1*/ "Testing option -bd green -bw 6",
|
||||
/*2*/ "Testing option -bd blue -bw 12",
|
||||
/*3*/ "Testing option -bd yellow -bw 15",
|
||||
/*4*/ "Testing option -bordercolor cyan -borderwidth 7",
|
||||
/*5*/ "Testing option -bordercolor brown -borderwidth 8",
|
||||
/*6*/ "Testing option -w 10"
|
||||
};
|
||||
|
||||
#define ArrCount (int) (sizeof(OptionArr) / sizeof(char *))
|
||||
|
||||
main(argc, argv)
|
||||
int argc;
|
||||
char *argv[];
|
||||
{
|
||||
SynStatus Result;
|
||||
char Command[NEED_LEN];
|
||||
int i;
|
||||
|
||||
#ifdef LOG
|
||||
if ((TermLog = fopen("term.log", "a")) == NULL) {
|
||||
if ((TermLog = fopen("term.log", "w")) == NULL)
|
||||
{printf("Logfile could not be opened \n"); exit(-1);}
|
||||
}
|
||||
LogError("****************************************************************************");
|
||||
LogTime();
|
||||
sprintf(Command, "TestName: <%s> STARTS\n", argv[0]);
|
||||
LogError(Command);
|
||||
#endif
|
||||
InitTest(argc, argv);
|
||||
for (i=0; i < ArrCount; i++) {
|
||||
strcpy(Command, TERM_EMU);
|
||||
strcat(Command, OptionArr[i]);
|
||||
CheckCapsLock();
|
||||
LogError(LogAction[i]);
|
||||
ExecCommand(Command);
|
||||
if (WaitWinMap("TermWin") < 0) continue;
|
||||
AssignWinName("TermWin", TERM_EMU);
|
||||
TestBorder("TermWin", OptionArr[i], i+1);
|
||||
WaitWinUnMap("TermWin", 60L);
|
||||
}
|
||||
CloseTest(False);
|
||||
#ifdef LOG
|
||||
sprintf(Command, "TestName: <%s> ENDS\n", argv[0]);
|
||||
LogError(Command);
|
||||
LogError("****************************************************************************");
|
||||
fclose(TermLog);
|
||||
#endif
|
||||
}
|
||||
|
||||
51
cde/programs/dtterm/tests/Cborder/Imakefile
Normal file
51
cde/programs/dtterm/tests/Cborder/Imakefile
Normal file
@@ -0,0 +1,51 @@
|
||||
XCOMM $XConsortium: Imakefile /main/8 1996/10/09 14:06:46 drk $
|
||||
PROGRAMS = Cborder
|
||||
|
||||
INCLUDES = -I. -I$(DTINCLUDESRC)
|
||||
LOCAL_INCLUDES = -I../shared -I$(TOP)/lib/
|
||||
SYS_LIBRARIES = -lm
|
||||
|
||||
EXTRA_DEFINES = -DLOG -DSYNLIB
|
||||
|
||||
#if defined(ApolloArchitecture)
|
||||
EXTRA_DEFINES = -Dapollo -D_CMDINV
|
||||
#if defined(SHLIB)
|
||||
LOCAL_LIBRARIES = -A inlib,$(XLIB)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(SunArchitecture)
|
||||
SYS_LIBRARIES = -lm -ldl -lgen -lC
|
||||
SYNLIB=$(TOP)/lib/synlib/libsynlibTst.a
|
||||
XTST=/usr/openwin/lib/libXtst.a
|
||||
#endif
|
||||
|
||||
#if defined(USLArchitecture)
|
||||
SYS_LIBRARIES = -lm -ldl -lgen
|
||||
#endif
|
||||
|
||||
#if defined(UXPArchitecture)
|
||||
SYS_LIBRARIES = -lm -ldl -lgen
|
||||
#endif
|
||||
|
||||
LOCAL_LIBRARIES = ../shared/libtermtest.a $(SYNLIB) $(XTST) $(XEXT) $(XLIB)
|
||||
|
||||
SRCS = Cborder.c
|
||||
|
||||
OBJS = Cborder.o
|
||||
|
||||
NormalLibraryObjectRule()
|
||||
ComplexProgramTarget($(PROGRAMS))
|
||||
|
||||
saber_src: $(SRCS)
|
||||
XCOMM setopt load_flags $(CFLAGS)
|
||||
XCOMM load $(SRCS) $(LOCAL_LIBRARIES)
|
||||
|
||||
unsaber_src:
|
||||
XCOMM unload $(SRCS)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
26
cde/programs/dtterm/tests/Cborder/README
Normal file
26
cde/programs/dtterm/tests/Cborder/README
Normal file
@@ -0,0 +1,26 @@
|
||||
/* $XConsortium: README /main/2 1996/07/15 14:16:05 drk $ */
|
||||
TestName: Cborder
|
||||
|
||||
Description: This program tests the functionality of dtterm with
|
||||
command line options
|
||||
" -bd red -bw 10",
|
||||
" -bd green -bw 6",
|
||||
" -bd blue -bw 12",
|
||||
" -bd yellow -bw 15",
|
||||
" -bordercolor cyan -borderwidth 7",
|
||||
" -bordercolor brown -borderwidth 8",
|
||||
" -w 10"
|
||||
|
||||
and recordes or compares the image. the result of the test
|
||||
is logged in file term.log
|
||||
|
||||
How to run: have two displays, run the program in one pointing to other
|
||||
display. Also, you have to set the PATH to ../util. (i.e
|
||||
TOP/cde1/dtterm/tests/util)
|
||||
|
||||
|
||||
commandline: -o dtterm.object
|
||||
-o dtterm.object -r -save (for recording)
|
||||
-o dtterm.object -compare -save (for comparing)
|
||||
|
||||
|
||||
94
cde/programs/dtterm/tests/Cgeomcolor/Cgeomcolor.c
Normal file
94
cde/programs/dtterm/tests/Cgeomcolor/Cgeomcolor.c
Normal file
@@ -0,0 +1,94 @@
|
||||
/* $XConsortium: Cgeomcolor.c /main/3 1995/10/31 11:47:36 rswiston $ */
|
||||
#include <stdio.h>
|
||||
#include <math.h>
|
||||
#include "synvar.h"
|
||||
|
||||
#ifdef LOG
|
||||
FILE *TermLog;
|
||||
#define SAVELOG fclose(TermLog); TermLog = fopen("term.log", "a");
|
||||
#endif
|
||||
|
||||
char LogStr[200];
|
||||
|
||||
|
||||
void TestGeomFgBg(WinName, String, TestNum)
|
||||
char *WinName, *String;
|
||||
int TestNum;
|
||||
{
|
||||
char Str[IMAGE_FILE_LEN];
|
||||
PrintTermString(WinName, String);
|
||||
sprintf(Str, "%sgeomcolor%d", IMAGE_DIR, TestNum);
|
||||
MatchWindows(WinName, Str);
|
||||
CloseTerm(WinName);
|
||||
}
|
||||
static char *OptionArr[] = {
|
||||
/*0*/ " -geometry 40x20 -fg green -bg red ",
|
||||
/*1*/ " -geometry 60x15 -fg red -bg green ",
|
||||
/*2*/ " -geometry 80x10 -fg green -bg yellow ",
|
||||
/*3*/ " -geometry 80x40 -foreground blue -background cyan ",
|
||||
/*4*/ " -geometry 20x40 -foreground white -background black ",
|
||||
/*5*/ " -rv",
|
||||
/*6*/ " -reverse",
|
||||
/*7*/ " +rv",
|
||||
/*8*/ " -bs ",
|
||||
/*9*/ " +bs ",
|
||||
/*10*/ " -ms red -cr blue",
|
||||
/*11*/ " -ms blue -cr green"
|
||||
};
|
||||
|
||||
static char *LogAction[] = {
|
||||
/*0*/ "Testing Option -geometry 40x20 -fg green -bg red ",
|
||||
/*1*/ "Testing Option -geometry 60x15 -fg red -bg green ",
|
||||
/*2*/ "Testing Option -geometry 80x10 -fg green -bg yellow ",
|
||||
/*3*/ "Testing Option -geometry 80x40 -foreground blue -background cyan ",
|
||||
/*4*/ "Testing Option -geometry 20x40 -foreground white -background black ",
|
||||
/*5*/ "Testing Option -rv",
|
||||
/*6*/ "Testing Option -reverse",
|
||||
/*7*/ "Testing Option +rv",
|
||||
/*8*/ "Testing Option -bs ",
|
||||
/*9*/ "Testing Option +bs ",
|
||||
/*10*/ "Testing Option -ms red -cr blue",
|
||||
/*11*/ "Testing Option -ms blue -cr green"
|
||||
};
|
||||
|
||||
#define ArrCount (int) (sizeof(OptionArr) / sizeof(char *))
|
||||
|
||||
main(argc, argv)
|
||||
int argc;
|
||||
char *argv[];
|
||||
{
|
||||
SynStatus Result;
|
||||
char Command[NEED_LEN];
|
||||
int i;
|
||||
|
||||
#ifdef LOG
|
||||
if ((TermLog = fopen("term.log", "a")) == NULL) {
|
||||
if ((TermLog = fopen("term.log", "w")) == NULL)
|
||||
{printf("Logfile could not be opened \n"); exit(-1);}
|
||||
}
|
||||
LogError("****************************************************************************");
|
||||
LogTime();
|
||||
sprintf(Command, "TestName: <%s> STARTS\n", argv[0]);
|
||||
LogError(Command);
|
||||
#endif
|
||||
InitTest(argc, argv);
|
||||
for (i=0; i < ArrCount; i++) {
|
||||
strcpy(Command, TERM_EMU);
|
||||
strcat(Command, OptionArr[i]);
|
||||
CheckCapsLock();
|
||||
LogError(LogAction[i]);
|
||||
ExecCommand(Command);
|
||||
if (WaitWinMap("TermWin") < 0) continue;
|
||||
AssignWinName("TermWin", TERM_EMU);
|
||||
TestGeomFgBg("TermWin", OptionArr[i], i+1);
|
||||
WaitWinUnMap("TermWin", 60L);
|
||||
}
|
||||
CloseTest(False);
|
||||
#ifdef LOG
|
||||
sprintf(Command, "TestName: <%s> ENDS\n", argv[0]);
|
||||
LogError(Command);
|
||||
LogError("****************************************************************************");
|
||||
fclose(TermLog);
|
||||
#endif
|
||||
}
|
||||
|
||||
51
cde/programs/dtterm/tests/Cgeomcolor/Imakefile
Normal file
51
cde/programs/dtterm/tests/Cgeomcolor/Imakefile
Normal file
@@ -0,0 +1,51 @@
|
||||
XCOMM $XConsortium: Imakefile /main/8 1996/10/09 14:06:54 drk $
|
||||
PROGRAMS = Cgeomcolor
|
||||
|
||||
INCLUDES = -I. -I$(DTINCLUDESRC)
|
||||
LOCAL_INCLUDES = -I../shared -I$(TOP)/lib/
|
||||
SYS_LIBRARIES = -lm
|
||||
|
||||
EXTRA_DEFINES = -DLOG -DSYNLIB
|
||||
|
||||
#if defined(ApolloArchitecture)
|
||||
EXTRA_DEFINES = -Dapollo -D_CMDINV
|
||||
#if defined(SHLIB)
|
||||
LOCAL_LIBRARIES = -A inlib,$(XLIB)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(SunArchitecture)
|
||||
SYS_LIBRARIES = -lm -ldl -lgen -lC
|
||||
SYNLIB=$(TOP)/lib/synlib/libsynlibTst.a
|
||||
XTST=/usr/openwin/lib/libXtst.a
|
||||
#endif
|
||||
|
||||
#if defined(USLArchitecture)
|
||||
SYS_LIBRARIES = -lm -ldl -lgen
|
||||
#endif
|
||||
|
||||
#if defined(UXPArchitecture)
|
||||
SYS_LIBRARIES = -lm -ldl -lgen
|
||||
#endif
|
||||
|
||||
LOCAL_LIBRARIES = ../shared/libtermtest.a $(SYNLIB) $(XTST) $(XEXT) $(XLIB)
|
||||
|
||||
SRCS = Cgeomcolor.c
|
||||
|
||||
OBJS = Cgeomcolor.o
|
||||
|
||||
NormalLibraryObjectRule()
|
||||
ComplexProgramTarget($(PROGRAMS))
|
||||
|
||||
saber_src: $(SRCS)
|
||||
XCOMM setopt load_flags $(CFLAGS)
|
||||
XCOMM load $(SRCS) $(LOCAL_LIBRARIES)
|
||||
|
||||
unsaber_src:
|
||||
XCOMM unload $(SRCS)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
31
cde/programs/dtterm/tests/Cgeomcolor/README
Normal file
31
cde/programs/dtterm/tests/Cgeomcolor/README
Normal file
@@ -0,0 +1,31 @@
|
||||
/* $XConsortium: README /main/2 1996/07/15 14:16:48 drk $ */
|
||||
TestName: Cgeomcolor
|
||||
|
||||
Description: This program tests the functionality of dtterm with
|
||||
command line options
|
||||
" -geometry 40x20 -fg green -bg red ",
|
||||
" -geometry 60x15 -fg red -bg green ",
|
||||
" -geometry 80x10 -fg green -bg yellow ",
|
||||
" -geometry 80x40 -foreground blue -background cyan ",
|
||||
" -geometry 20x40 -foreground white -background black ",
|
||||
" -rv",
|
||||
" -reverse",
|
||||
" +rv",
|
||||
" -bs ",
|
||||
" +bs ",
|
||||
" -ms red -cr blue",
|
||||
" -ms blue -cr green"
|
||||
|
||||
and recordes or compares the image. the result of the test
|
||||
is logged in file term.log
|
||||
|
||||
How to run: have two displays, run the program in one pointing to other
|
||||
display. Also, you have to set the PATH to ../util. (i.e
|
||||
TOP/cde1/dtterm/tests/util)
|
||||
|
||||
|
||||
commandline: -o dtterm.object
|
||||
-o dtterm.object -r -save (for recording)
|
||||
-o dtterm.object -compare -save (for comparing)
|
||||
|
||||
|
||||
109
cde/programs/dtterm/tests/Ciconic/Ciconic.c
Normal file
109
cde/programs/dtterm/tests/Ciconic/Ciconic.c
Normal file
@@ -0,0 +1,109 @@
|
||||
/* $XConsortium: Ciconic.c /main/3 1995/10/31 11:48:03 rswiston $ */
|
||||
#include <stdio.h>
|
||||
#include <math.h>
|
||||
#include "synvar.h"
|
||||
|
||||
#ifdef LOG
|
||||
FILE *TermLog;
|
||||
#define SAVELOG fclose(TermLog); TermLog = fopen("term.log", "a");
|
||||
#endif
|
||||
|
||||
char LogStr[200];
|
||||
|
||||
|
||||
void TestIconify(WinName, String, TestNum)
|
||||
char *WinName, *String;
|
||||
int TestNum;
|
||||
{
|
||||
char Str[IMAGE_FILE_LEN];
|
||||
sprintf(Str, "%siconic%d", IMAGE_DIR, TestNum);
|
||||
MatchWindows(WinName, Str);
|
||||
Deiconify(WinName);
|
||||
if (WaitWinMap(WinName) < 0) LogError("Deiconify did not work");
|
||||
PrintTermString(WinName, String);
|
||||
sprintf(Str, "%siconic%dA", IMAGE_DIR, TestNum);
|
||||
MatchWindows(WinName, Str);
|
||||
CloseTerm(WinName);
|
||||
}
|
||||
|
||||
void TestIconifyMap(WinName, String, TestNum)
|
||||
char *WinName, *String;
|
||||
int TestNum;
|
||||
{
|
||||
char Str[IMAGE_FILE_LEN];
|
||||
sprintf(Str, "%siconic%d", IMAGE_DIR, TestNum);
|
||||
MatchWindows(WinName, Str);
|
||||
if (TestNum == 3) {
|
||||
if (WaitWinMap(WinName) < 0) LogError("Deiconify did not work");
|
||||
PrintTermString(WinName, String);
|
||||
sprintf(Str, "%siconic%dA", IMAGE_DIR, TestNum);
|
||||
MatchWindows(WinName, Str);
|
||||
PrintTermString(WinName, "1");
|
||||
CloseTerm(WinName);
|
||||
}
|
||||
else {
|
||||
if (WaitWinMap(WinName) == 0) LogError("+map did not work");
|
||||
else {
|
||||
Deiconify(WinName);
|
||||
if (WaitWinMap(WinName) < 0) LogError("Deiconify did not work");
|
||||
CloseTerm(WinName);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static char *OptionArr[] = {
|
||||
/*0*/ " -iconic ",
|
||||
/*1*/ " -iconic -xrm 'dtterm*iconName: test' ",
|
||||
/*2*/ " -iconic -map -xrm 'dtterm*mapOnOutputDelay: 5' -e wait5write",
|
||||
/*3*/ " -iconic +map -xrm 'dtterm*mapOnOutputDelay: 5' -e wait5write"
|
||||
};
|
||||
|
||||
static char *LogAction[] = {
|
||||
"Testing Option -iconic ",
|
||||
"Testing Option -iconic -xrm 'dtterm*iconName: test' ",
|
||||
"Testing Option -iconic -map -xrm 'dtterm*mapOnOutputDelay: 5' -e wait5write",
|
||||
"Testing Option -iconic +map -xrm 'dtterm*mapOnOutputDelay: 5' -e wait5write"
|
||||
};
|
||||
|
||||
#define ArrCount (int) (sizeof(OptionArr) / sizeof(char *))
|
||||
|
||||
main(argc, argv)
|
||||
int argc;
|
||||
char *argv[];
|
||||
{
|
||||
SynStatus Result;
|
||||
char Command[NEED_LEN];
|
||||
int i;
|
||||
|
||||
#ifdef LOG
|
||||
if ((TermLog = fopen("term.log", "a")) == NULL) {
|
||||
if ((TermLog = fopen("term.log", "w")) == NULL)
|
||||
{printf("Logfile could not be opened \n"); exit(-1);}
|
||||
}
|
||||
LogError("****************************************************************************");
|
||||
LogTime();
|
||||
sprintf(Command, "TestName: <%s> STARTS\n", argv[0]);
|
||||
LogError(Command);
|
||||
#endif
|
||||
InitTest(argc, argv);
|
||||
for (i=0; i < ArrCount; i++) {
|
||||
strcpy(Command, TERM_EMU);
|
||||
strcat(Command, OptionArr[i]);
|
||||
CheckCapsLock();
|
||||
LogError(LogAction[i]);
|
||||
ExecCommand(Command);
|
||||
if (WaitWinMap("TermWin") < 0) continue;
|
||||
AssignWinName("TermWin", TERM_EMU);
|
||||
if (i <= 1) TestIconify("TermWin", OptionArr[i], i+1);
|
||||
else TestIconifyMap("TermWin", OptionArr[i], i+1);
|
||||
WaitWinUnMap("TermWin", 60L);
|
||||
}
|
||||
CloseTest(False);
|
||||
#ifdef LOG
|
||||
sprintf(Command, "TestName: <%s> ENDS\n", argv[0]);
|
||||
LogError(Command);
|
||||
LogError("****************************************************************************");
|
||||
fclose(TermLog);
|
||||
#endif
|
||||
}
|
||||
|
||||
52
cde/programs/dtterm/tests/Ciconic/Imakefile
Normal file
52
cde/programs/dtterm/tests/Ciconic/Imakefile
Normal file
@@ -0,0 +1,52 @@
|
||||
XCOMM $XConsortium: Imakefile /main/8 1996/10/09 14:07:03 drk $
|
||||
PROGRAMS = Ciconic
|
||||
|
||||
INCLUDES = -I. -I$(DTINCLUDESRC)
|
||||
LOCAL_INCLUDES = -I../shared -I$(TOP)/lib/
|
||||
SYS_LIBRARIES = -lm
|
||||
|
||||
|
||||
EXTRA_DEFINES = -DLOG -DSYNLIB
|
||||
|
||||
#if defined(ApolloArchitecture)
|
||||
EXTRA_DEFINES = -Dapollo -D_CMDINV
|
||||
#if defined(SHLIB)
|
||||
LOCAL_LIBRARIES = -A inlib,$(XLIB)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(SunArchitecture)
|
||||
SYS_LIBRARIES = -lm -ldl -lgen -lC
|
||||
SYNLIB=$(TOP)/lib/synlib/libsynlibTst.a
|
||||
XTST=/usr/openwin/lib/libXtst.a
|
||||
#endif
|
||||
|
||||
#if defined(USLArchitecture)
|
||||
SYS_LIBRARIES = -lm -ldl -lgen
|
||||
#endif
|
||||
|
||||
#if defined(UXPArchitecture)
|
||||
SYS_LIBRARIES = -lm -ldl -lgen
|
||||
#endif
|
||||
|
||||
LOCAL_LIBRARIES = ../shared/libtermtest.a $(SYNLIB) $(XTST) $(XEXT) $(XLIB)
|
||||
|
||||
SRCS = Ciconic.c
|
||||
|
||||
OBJS = Ciconic.o
|
||||
|
||||
NormalLibraryObjectRule()
|
||||
ComplexProgramTarget($(PROGRAMS))
|
||||
|
||||
saber_src: $(SRCS)
|
||||
XCOMM setopt load_flags $(CFLAGS)
|
||||
XCOMM load $(SRCS) $(LOCAL_LIBRARIES)
|
||||
|
||||
unsaber_src:
|
||||
XCOMM unload $(SRCS)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
23
cde/programs/dtterm/tests/Ciconic/README
Normal file
23
cde/programs/dtterm/tests/Ciconic/README
Normal file
@@ -0,0 +1,23 @@
|
||||
/* $XConsortium: README /main/2 1996/07/15 14:17:20 drk $ */
|
||||
TestName: Ciconic
|
||||
|
||||
Description: This program tests the functionality of dtterm with
|
||||
command line options
|
||||
" -iconic ",
|
||||
" -iconic -xrm 'dtterm*iconName: test' ",
|
||||
" -iconic -map -xrm 'dtterm*mapOnOutputDelay: 5' -e wait5write",
|
||||
" -iconic +map -xrm 'dtterm*mapOnOutputDelay: 5' -e wait5write"
|
||||
|
||||
and recordes or compares the image. the result of the test
|
||||
is logged in file term.log
|
||||
|
||||
How to run: have two displays, run the program in one pointing to other
|
||||
display. Also, you have to set the PATH to ../util. (i.e
|
||||
TOP/cde1/dtterm/tests/util)
|
||||
|
||||
|
||||
commandline: -o dtterm.object
|
||||
-o dtterm.object -r -save (for recording)
|
||||
-o dtterm.object -compare -save (for comparing)
|
||||
|
||||
|
||||
99
cde/programs/dtterm/tests/Clogging/Clogging.c
Normal file
99
cde/programs/dtterm/tests/Clogging/Clogging.c
Normal file
@@ -0,0 +1,99 @@
|
||||
/* $XConsortium: Clogging.c /main/3 1995/10/31 11:48:35 rswiston $ */
|
||||
#include <stdio.h>
|
||||
#include <math.h>
|
||||
#include "synvar.h"
|
||||
|
||||
#ifdef LOG
|
||||
FILE *TermLog;
|
||||
#define SAVELOG fclose(TermLog); TermLog = fopen("term.log", "a");
|
||||
#endif
|
||||
|
||||
char LogStr[200];
|
||||
|
||||
|
||||
|
||||
static char *OptionArr[] = {
|
||||
/*0*/ " -l ", /* Normal option */
|
||||
/*1*/ " -xrm 'dtterm*logging: off' -l ", /* By resource log off*/
|
||||
/*2*/ " -l ", /* try in un writable directory */
|
||||
/*3*/ " -xrm 'dtterm*logging: on' -xrm 'dtterm*logFile: Term.Log ' +l ",
|
||||
/*4*/ " -lf Term.Log"
|
||||
};
|
||||
|
||||
|
||||
static char *LogAction[] = {
|
||||
/*0*/ "Testing option: -l ",
|
||||
/*1*/ "Testing option -xrm 'dtterm*logging: off' -l ",
|
||||
/*2*/ "Testing option -l in an unwritable directory",
|
||||
/*3*/ "Testing option -xrm 'dtterm*logging: on' -xrm 'dtterm*logFile: Term.Log' +l",
|
||||
/*4*/ "Testing option -lf Term.Log"
|
||||
};
|
||||
|
||||
#define ArrCount (int) (sizeof(OptionArr) / sizeof(char *))
|
||||
|
||||
main(argc, argv)
|
||||
int argc;
|
||||
char *argv[];
|
||||
{
|
||||
SynStatus Result;
|
||||
char Command[NEED_LEN];
|
||||
int i;
|
||||
|
||||
#ifdef LOG
|
||||
if ((TermLog = fopen("term.log", "a")) == NULL) {
|
||||
if ((TermLog = fopen("term.log", "w")) == NULL)
|
||||
{printf("Logfile could not be opened \n"); exit(-1);}
|
||||
}
|
||||
LogError("****************************************************************************");
|
||||
LogTime();
|
||||
sprintf(Command, "TestName: <%s> STARTS\n", argv[0]);
|
||||
LogError(Command);
|
||||
#endif
|
||||
InitTest(argc, argv);
|
||||
CheckCapsLock();
|
||||
ExecCommand("mkdir tmplog");
|
||||
for (i=0; i < ArrCount; i++) {
|
||||
strcpy(Command, TERM_EMU);
|
||||
strcat(Command, OptionArr[i]);
|
||||
CheckCapsLock();
|
||||
ExecCommand("mv DTtermLog* tmplog"); sleep(1);
|
||||
ExecCommand("mv Term.Log tmplog"); sleep(1);
|
||||
if (i == 2) { /* try in un writable directory */
|
||||
ExecCommand("mkdir unwrite"); sleep(1);
|
||||
ExecCommand("chmod 555 unwrite"); sleep(1);
|
||||
ExecCommand("cd unwrite"); sleep(1);
|
||||
}
|
||||
LogError(LogAction[i]);
|
||||
ExecCommand(Command); sleep(1);
|
||||
if (WaitWinMap("TermWin") < 0) continue;
|
||||
AssignWinName("TermWin", TERM_EMU);
|
||||
JustExit("TermWin");
|
||||
WaitWinUnMap("TermWin", 10L);
|
||||
switch (i) {
|
||||
case 0:
|
||||
ExecCommand("test-l"); break;
|
||||
case 1:
|
||||
ExecCommand("test-l"); break;
|
||||
case 2:
|
||||
ExecCommand("test+l"); break;
|
||||
case 3: ExecCommand("test+l"); break;
|
||||
case 4: ExecCommand("test-lf"); break;
|
||||
}
|
||||
if (i == 2) {
|
||||
ExecCommand("cd ..");
|
||||
ExecCommand("rmdir unwrite");
|
||||
}
|
||||
sleep(2);
|
||||
}
|
||||
ExecCommand("mv tmplog/DTtermLog* ."); sleep(1);
|
||||
ExecCommand("mv tmplog/Term.Log ."); sleep(1);
|
||||
ExecCommand("rmdir tmplog");
|
||||
CloseTest(False);
|
||||
#ifdef LOG
|
||||
sprintf(Command, "TestName: <%s> ENDS\n", argv[0]);
|
||||
LogError(Command);
|
||||
LogError("****************************************************************************");
|
||||
fclose(TermLog);
|
||||
#endif
|
||||
}
|
||||
|
||||
51
cde/programs/dtterm/tests/Clogging/Imakefile
Normal file
51
cde/programs/dtterm/tests/Clogging/Imakefile
Normal file
@@ -0,0 +1,51 @@
|
||||
XCOMM $XConsortium: Imakefile /main/8 1996/10/09 14:07:11 drk $
|
||||
PROGRAMS = Clogging
|
||||
|
||||
INCLUDES = -I. -I$(DTINCLUDESRC)
|
||||
LOCAL_INCLUDES = -I../shared -I$(TOP)/lib/
|
||||
SYS_LIBRARIES = -lm
|
||||
|
||||
EXTRA_DEFINES = -DLOG -DSYNLIB
|
||||
|
||||
#if defined(ApolloArchitecture)
|
||||
EXTRA_DEFINES = -Dapollo -D_CMDINV
|
||||
#if defined(SHLIB)
|
||||
LOCAL_LIBRARIES = -A inlib,$(XLIB)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(SunArchitecture)
|
||||
SYS_LIBRARIES = -lm -ldl -lgen -lC
|
||||
SYNLIB=$(TOP)/lib/synlib/libsynlibTst.a
|
||||
XTST=/usr/openwin/lib/libXtst.a
|
||||
#endif
|
||||
|
||||
#if defined(USLArchitecture)
|
||||
SYS_LIBRARIES = -lm -ldl -lgen
|
||||
#endif
|
||||
|
||||
#if defined(UXPArchitecture)
|
||||
SYS_LIBRARIES = -lm -ldl -lgen
|
||||
#endif
|
||||
|
||||
LOCAL_LIBRARIES = ../shared/libtermtest.a $(SYNLIB) $(XTST) $(XEXT) $(XLIB)
|
||||
|
||||
SRCS = Clogging.c
|
||||
|
||||
OBJS = Clogging.o
|
||||
|
||||
NormalLibraryObjectRule()
|
||||
ComplexProgramTarget($(PROGRAMS))
|
||||
|
||||
saber_src: $(SRCS)
|
||||
XCOMM setopt load_flags $(CFLAGS)
|
||||
XCOMM load $(SRCS) $(LOCAL_LIBRARIES)
|
||||
|
||||
unsaber_src:
|
||||
XCOMM unload $(SRCS)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
24
cde/programs/dtterm/tests/Clogging/README
Normal file
24
cde/programs/dtterm/tests/Clogging/README
Normal file
@@ -0,0 +1,24 @@
|
||||
/* $XConsortium: README /main/2 1996/07/15 14:17:58 drk $ */
|
||||
TestName: Clogging
|
||||
|
||||
Description: This program tests the functionality of dtterm with
|
||||
command line options
|
||||
|
||||
"Testing option: -l ",
|
||||
"Testing option -xrm 'dtterm*logging: off' -l ",
|
||||
"Testing option -l in an unwritable directory",
|
||||
"Testing option -xrm 'dtterm*logging: on'
|
||||
-xrm 'dtterm*logFile: Term.Log' +l",
|
||||
"Testing option -lf Term.Log"
|
||||
|
||||
and invokes one of the programs (test-l, test+l, test-lf)
|
||||
to verify the functionality
|
||||
|
||||
How to run: have two displays, run the program in one pointing to other
|
||||
display. Also, you have to set the PATH to ../util. (i.e
|
||||
TOP/cde1/dtterm/tests/util)
|
||||
|
||||
|
||||
commandline: -o dtterm.object
|
||||
|
||||
|
||||
82
cde/programs/dtterm/tests/Clogin/Clogin.c
Normal file
82
cde/programs/dtterm/tests/Clogin/Clogin.c
Normal file
@@ -0,0 +1,82 @@
|
||||
/* $XConsortium: Clogin.c /main/3 1995/10/31 11:48:57 rswiston $ */
|
||||
#include <stdio.h>
|
||||
#include <math.h>
|
||||
#include "synvar.h"
|
||||
|
||||
#ifdef LOG
|
||||
FILE *TermLog;
|
||||
#define SAVELOG fclose(TermLog); TermLog = fopen("term.log", "a");
|
||||
#endif
|
||||
|
||||
char LogStr[200];
|
||||
|
||||
|
||||
|
||||
static char *OptionArr[] = {
|
||||
/*0*/ " -ls " , /* Normal option */
|
||||
/*1*/ " -xrm 'dtterm*loginShell: off' -ls ",
|
||||
/*2*/ " -xrm 'dtterm*loginShell: on' +ls ",
|
||||
};
|
||||
|
||||
|
||||
static char *LogAction[] = {
|
||||
/*0*/ "Testing Option -ls ",
|
||||
/*1*/ "Testing Option -xrm 'dtterm*loginShell: off' -ls ",
|
||||
/*2*/ "Testing Option -xrm 'dtterm*loginShell: on' +ls "
|
||||
};
|
||||
|
||||
#define ArrCount (int) (sizeof(OptionArr) / sizeof(char *))
|
||||
|
||||
main(argc, argv)
|
||||
int argc;
|
||||
char *argv[];
|
||||
{
|
||||
SynStatus Result;
|
||||
char Command[NEED_LEN], *Shell, *Path;
|
||||
int i;
|
||||
|
||||
#ifdef LOG
|
||||
if ((TermLog = fopen("term.log", "a")) == NULL) {
|
||||
if ((TermLog = fopen("term.log", "w")) == NULL)
|
||||
{printf("Logfile could not be opened \n"); exit(-1);}
|
||||
}
|
||||
LogError("****************************************************************************");
|
||||
LogTime();
|
||||
sprintf(Command, "TestName: <%s> STARTS\n", argv[0]);
|
||||
LogError(Command);
|
||||
#endif
|
||||
InitTest(argc, argv);
|
||||
CheckCapsLock();
|
||||
Path = getenv("PATH");
|
||||
ExecCommand("PATH=/clone/vels/cdetest/bin:/usr/bin/X11:/bin:/opt/dt/bin");
|
||||
for (i=0; i < ArrCount; i++) {
|
||||
strcpy(Command, TERM_EMU);
|
||||
strcat(Command, OptionArr[i]);
|
||||
CheckCapsLock();
|
||||
LogError(LogAction[i]);
|
||||
ExecCommand(Command); sleep(2);
|
||||
if (WaitWinMap("TermWin") < 0) continue;
|
||||
switch (i) {
|
||||
case 0:
|
||||
ExecCommand("test-ls"); break;
|
||||
case 1:
|
||||
ExecCommand("test-ls"); break;
|
||||
case 2:
|
||||
ExecCommand("test+ls"); break;
|
||||
}
|
||||
CloseTerm("TermWin");
|
||||
WaitWinUnMap("TermWin", 10L);
|
||||
sleep(2);
|
||||
}
|
||||
strcpy(Command, "PATH=");
|
||||
strcat(Command, Path);
|
||||
ExecCommand(Command);
|
||||
CloseTest(False);
|
||||
#ifdef LOG
|
||||
sprintf(Command, "TestName: <%s> ENDS\n", argv[0]);
|
||||
LogError(Command);
|
||||
LogError("****************************************************************************");
|
||||
fclose(TermLog);
|
||||
#endif
|
||||
}
|
||||
|
||||
51
cde/programs/dtterm/tests/Clogin/Imakefile
Normal file
51
cde/programs/dtterm/tests/Clogin/Imakefile
Normal file
@@ -0,0 +1,51 @@
|
||||
XCOMM $XConsortium: Imakefile /main/8 1996/10/09 14:07:19 drk $
|
||||
PROGRAMS = Clogin
|
||||
|
||||
INCLUDES = -I. -I$(DTINCLUDESRC)
|
||||
LOCAL_INCLUDES = -I../shared -I$(TOP)/lib/
|
||||
SYS_LIBRARIES = -lm
|
||||
|
||||
EXTRA_DEFINES = -DLOG -DSYNLIB
|
||||
|
||||
#if defined(ApolloArchitecture)
|
||||
EXTRA_DEFINES = -Dapollo -D_CMDINV
|
||||
#if defined(SHLIB)
|
||||
LOCAL_LIBRARIES = -A inlib,$(XLIB)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(SunArchitecture)
|
||||
SYS_LIBRARIES = -lm -ldl -lgen -lC
|
||||
SYNLIB=$(TOP)/lib/synlib/libsynlibTst.a
|
||||
XTST=/usr/openwin/lib/libXtst.a
|
||||
#endif
|
||||
|
||||
#if defined(USLArchitecture)
|
||||
SYS_LIBRARIES = -lm -ldl -lgen
|
||||
#endif
|
||||
|
||||
#if defined(UXPArchitecture)
|
||||
SYS_LIBRARIES = -lm -ldl -lgen
|
||||
#endif
|
||||
|
||||
LOCAL_LIBRARIES = ../shared/libtermtest.a $(SYNLIB) $(XTST) $(XEXT) $(XLIB)
|
||||
|
||||
SRCS = Clogin.c
|
||||
|
||||
OBJS = Clogin.o
|
||||
|
||||
NormalLibraryObjectRule()
|
||||
ComplexProgramTarget($(PROGRAMS))
|
||||
|
||||
saber_src: $(SRCS)
|
||||
XCOMM setopt load_flags $(CFLAGS)
|
||||
XCOMM load $(SRCS) $(LOCAL_LIBRARIES)
|
||||
|
||||
unsaber_src:
|
||||
XCOMM unload $(SRCS)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
21
cde/programs/dtterm/tests/Clogin/README
Normal file
21
cde/programs/dtterm/tests/Clogin/README
Normal file
@@ -0,0 +1,21 @@
|
||||
/* $XConsortium: README /main/2 1996/07/15 14:18:33 drk $ */
|
||||
TestName: Clogin
|
||||
|
||||
Description: This program tests the functionality of dtterm with
|
||||
command line options
|
||||
|
||||
" -ls " ,
|
||||
" -xrm 'dtterm*loginShell: off' -ls ",
|
||||
" -xrm 'dtterm*loginShell: on' +ls ",
|
||||
|
||||
and invokes one of the programs (test-ls, test+ls)
|
||||
to verify the functionality
|
||||
|
||||
How to run: have two displays, run the program in one pointing to other
|
||||
display. Also, you have to set the PATH to ../util. (i.e
|
||||
TOP/cde1/dtterm/tests/util)
|
||||
|
||||
|
||||
commandline: -o dtterm.object
|
||||
|
||||
|
||||
88
cde/programs/dtterm/tests/Csavelines/Csavelines.c
Normal file
88
cde/programs/dtterm/tests/Csavelines/Csavelines.c
Normal file
@@ -0,0 +1,88 @@
|
||||
/* $XConsortium: Csavelines.c /main/3 1995/10/31 11:49:19 rswiston $ */
|
||||
#include <stdio.h>
|
||||
#include <math.h>
|
||||
#include "synvar.h"
|
||||
|
||||
#ifdef LOG
|
||||
FILE *TermLog;
|
||||
#define SAVELOG fclose(TermLog); TermLog = fopen("term.log", "a");
|
||||
#endif
|
||||
|
||||
char LogStr[200];
|
||||
|
||||
|
||||
void TestSavelines(WinName, TestNum)
|
||||
char *WinName;
|
||||
int TestNum;
|
||||
{
|
||||
char Str[IMAGE_FILE_LEN];
|
||||
int i;
|
||||
ExecWinCommand(WinName, "printlines");
|
||||
sleep(2);
|
||||
for (i=0; i < 4; i++) PressPrevKey(WinName);
|
||||
sleep(2);
|
||||
sprintf(Str, "%ssavelines%d", IMAGE_DIR, TestNum);
|
||||
MatchWindows(WinName, Str);
|
||||
sleep(2);
|
||||
CloseTerm(WinName);
|
||||
}
|
||||
|
||||
static char *OptionArr[] = {
|
||||
/*1*/ " -sl 24l",
|
||||
/*2*/ " -sl 48l",
|
||||
/*3*/ " -sl 96l",
|
||||
/*4*/ " -sl 1s",
|
||||
/*5*/ " -sl 2s",
|
||||
/*6*/ " -sl 4s"
|
||||
};
|
||||
|
||||
static char *LogAction[] = {
|
||||
/*1*/ "Testing Option -sl 24l",
|
||||
/*2*/ "Testing Option -sl 48l",
|
||||
/*3*/ "Testing Option -sl 96l",
|
||||
/*4*/ "Testing Option -sl 1s",
|
||||
/*5*/ "Testing Option -sl 2s",
|
||||
/*6*/ "Testing Option -sl 4s"
|
||||
};
|
||||
|
||||
#define ArrCount (int) (sizeof(OptionArr) / sizeof(char *))
|
||||
|
||||
main(argc, argv)
|
||||
int argc;
|
||||
char *argv[];
|
||||
{
|
||||
SynStatus Result;
|
||||
char Command[NEED_LEN];
|
||||
int i;
|
||||
|
||||
#ifdef LOG
|
||||
if ((TermLog = fopen("term.log", "a")) == NULL) {
|
||||
if ((TermLog = fopen("term.log", "w")) == NULL)
|
||||
{printf("Logfile could not be opened \n"); exit(-1);}
|
||||
}
|
||||
LogError("****************************************************************************");
|
||||
LogTime();
|
||||
sprintf(Command, "TestName: <%s> STARTS\n", argv[0]);
|
||||
LogError(Command);
|
||||
#endif
|
||||
InitTest(argc, argv);
|
||||
for (i=0; i < ArrCount; i++) {
|
||||
strcpy(Command, TERM_EMU);
|
||||
strcat(Command, OptionArr[i]);
|
||||
CheckCapsLock();
|
||||
LogError(LogAction[i]);
|
||||
ExecCommand(Command);
|
||||
if (WaitWinMap("TermWin") < 0) continue;
|
||||
AssignWinName("TermWin", TERM_EMU);
|
||||
TestSavelines("TermWin", i+1);
|
||||
WaitWinUnMap("TermWin", 60L);
|
||||
}
|
||||
CloseTest(False);
|
||||
#ifdef LOG
|
||||
sprintf(Command, "TestName: <%s> ENDS\n", argv[0]);
|
||||
LogError(Command);
|
||||
LogError("****************************************************************************");
|
||||
fclose(TermLog);
|
||||
#endif
|
||||
}
|
||||
|
||||
52
cde/programs/dtterm/tests/Csavelines/Imakefile
Normal file
52
cde/programs/dtterm/tests/Csavelines/Imakefile
Normal file
@@ -0,0 +1,52 @@
|
||||
XCOMM $XConsortium: Imakefile /main/8 1996/10/09 14:07:34 drk $
|
||||
PROGRAMS = Csavelines
|
||||
|
||||
INCLUDES = -I. -I$(DTINCLUDESRC)
|
||||
LOCAL_INCLUDES = -I../shared -I$(TOP)/lib/
|
||||
SYS_LIBRARIES = -lm
|
||||
|
||||
|
||||
EXTRA_DEFINES = -DLOG -DSYNLIB
|
||||
|
||||
#if defined(ApolloArchitecture)
|
||||
EXTRA_DEFINES = -Dapollo -D_CMDINV
|
||||
#if defined(SHLIB)
|
||||
LOCAL_LIBRARIES = -A inlib,$(XLIB)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(SunArchitecture)
|
||||
SYS_LIBRARIES = -lm -ldl -lgen -lC
|
||||
SYNLIB=$(TOP)/lib/synlib/libsynlibTst.a
|
||||
XTST=/usr/openwin/lib/libXtst.a
|
||||
#endif
|
||||
|
||||
#if defined(USLArchitecture)
|
||||
SYS_LIBRARIES = -lm -ldl -lgen
|
||||
#endif
|
||||
|
||||
#if defined(UXPArchitecture)
|
||||
SYS_LIBRARIES = -lm -ldl -lgen
|
||||
#endif
|
||||
|
||||
LOCAL_LIBRARIES = ../shared/libtermtest.a $(SYNLIB) $(XTST) $(XEXT) $(XLIB)
|
||||
|
||||
SRCS = Csavelines.c
|
||||
|
||||
OBJS = Csavelines.o
|
||||
|
||||
NormalLibraryObjectRule()
|
||||
ComplexProgramTarget($(PROGRAMS))
|
||||
|
||||
saber_src: $(SRCS)
|
||||
XCOMM setopt load_flags $(CFLAGS)
|
||||
XCOMM load $(SRCS) $(LOCAL_LIBRARIES)
|
||||
|
||||
unsaber_src:
|
||||
XCOMM unload $(SRCS)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
26
cde/programs/dtterm/tests/Csavelines/README
Normal file
26
cde/programs/dtterm/tests/Csavelines/README
Normal file
@@ -0,0 +1,26 @@
|
||||
/* $XConsortium: README /main/2 1996/07/15 14:18:51 drk $ */
|
||||
TestName: Csavelines
|
||||
|
||||
Description: This program tests the functionality of dtterm with
|
||||
command line options
|
||||
|
||||
" -sl 24l",
|
||||
" -sl 48l",
|
||||
" -sl 96l",
|
||||
" -sl 1s",
|
||||
" -sl 2s",
|
||||
" -sl 4s"
|
||||
|
||||
and recordes or compares the image. the result of the test
|
||||
is logged in file term.log
|
||||
|
||||
How to run: have two displays, run the program in one pointing to other
|
||||
display. Also, you have to set the PATH to ../util. (i.e
|
||||
TOP/cde1/dtterm/tests/util)
|
||||
|
||||
|
||||
commandline: -o dtterm.object
|
||||
-o dtterm.object -r -save (for recording)
|
||||
-o dtterm.object -compare -save (for comparing)
|
||||
|
||||
|
||||
79
cde/programs/dtterm/tests/Cscrolltitle/Cscrolltitle.c
Normal file
79
cde/programs/dtterm/tests/Cscrolltitle/Cscrolltitle.c
Normal file
@@ -0,0 +1,79 @@
|
||||
/* $XConsortium: Cscrolltitle.c /main/3 1995/10/31 11:49:44 rswiston $ */
|
||||
#include <stdio.h>
|
||||
#include <math.h>
|
||||
#include "synvar.h"
|
||||
|
||||
#ifdef LOG
|
||||
FILE *TermLog;
|
||||
#define SAVELOG fclose(TermLog); TermLog = fopen("term.log", "a");
|
||||
#endif
|
||||
|
||||
char LogStr[200];
|
||||
|
||||
|
||||
void TestScrollbar(WinName, String, TestNum)
|
||||
char *WinName, *String;
|
||||
int TestNum;
|
||||
{
|
||||
char Str[IMAGE_FILE_LEN];
|
||||
PrintTermString(WinName, String);
|
||||
sprintf(Str, "%sscrollbar%d", IMAGE_DIR, TestNum);
|
||||
MatchWindows(WinName, Str);
|
||||
CloseTerm(WinName);
|
||||
}
|
||||
|
||||
static char *OptionArr[] = {
|
||||
/*0*/ " -sb -title TITLE1",
|
||||
/*1*/ " +sb -title title2",
|
||||
/*2*/ " -xrm 'dtterm*scrollBar: False' -sb -title TITLE3",
|
||||
/*3*/ " -xrm 'dtterm*scrollBar: True' +sb -title title4"
|
||||
};
|
||||
|
||||
static char *LogAction[] = {
|
||||
/*0*/ "Testing Option -sb ",
|
||||
/*1*/ "Testing Option +sb ",
|
||||
/*2*/ "Testing Option -xrm 'dtterm*scrollBar: False' -sb",
|
||||
/*3*/ "Testing Option -xrm 'dtterm*scrollBar: True' +sb"
|
||||
};
|
||||
|
||||
#define ArrCount (int) (sizeof(OptionArr) / sizeof(char *))
|
||||
|
||||
main(argc, argv)
|
||||
int argc;
|
||||
char *argv[];
|
||||
{
|
||||
SynStatus Result;
|
||||
char Command[NEED_LEN];
|
||||
int i;
|
||||
|
||||
#ifdef LOG
|
||||
if ((TermLog = fopen("term.log", "a")) == NULL) {
|
||||
if ((TermLog = fopen("term.log", "w")) == NULL)
|
||||
{printf("Logfile could not be opened \n"); exit(-1);}
|
||||
}
|
||||
LogError("****************************************************************************");
|
||||
LogTime();
|
||||
sprintf(Command, "TestName: <%s> STARTS\n", argv[0]);
|
||||
LogError(Command);
|
||||
#endif
|
||||
InitTest(argc, argv);
|
||||
for (i=0; i < ArrCount; i++) {
|
||||
strcpy(Command, TERM_EMU);
|
||||
strcat(Command, OptionArr[i]);
|
||||
CheckCapsLock();
|
||||
LogError(LogAction[i]);
|
||||
ExecCommand(Command);
|
||||
if (WaitWinMap("TermWin") < 0) continue;
|
||||
AssignWinName("TermWin", TERM_EMU);
|
||||
TestScrollbar("TermWin", OptionArr[i], i+1);
|
||||
WaitWinUnMap("TermWin", 60L);
|
||||
}
|
||||
CloseTest(False);
|
||||
#ifdef LOG
|
||||
sprintf(Command, "TestName: <%s> ENDS\n", argv[0]);
|
||||
LogError(Command);
|
||||
LogError("****************************************************************************");
|
||||
fclose(TermLog);
|
||||
#endif
|
||||
}
|
||||
|
||||
52
cde/programs/dtterm/tests/Cscrolltitle/Imakefile
Normal file
52
cde/programs/dtterm/tests/Cscrolltitle/Imakefile
Normal file
@@ -0,0 +1,52 @@
|
||||
XCOMM $XConsortium: Imakefile /main/8 1996/10/09 14:07:43 drk $
|
||||
PROGRAMS = Cscrolltitle
|
||||
|
||||
INCLUDES = -I. -I$(DTINCLUDESRC)
|
||||
LOCAL_INCLUDES = -I../shared -I$(TOP)/lib/
|
||||
SYS_LIBRARIES = -lm
|
||||
|
||||
|
||||
EXTRA_DEFINES = -DLOG -DSYNLIB
|
||||
|
||||
#if defined(ApolloArchitecture)
|
||||
EXTRA_DEFINES = -Dapollo -D_CMDINV
|
||||
#if defined(SHLIB)
|
||||
LOCAL_LIBRARIES = -A inlib,$(XLIB)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(SunArchitecture)
|
||||
SYS_LIBRARIES = -lm -ldl -lgen -lC
|
||||
SYNLIB=$(TOP)/lib/synlib/libsynlibTst.a
|
||||
XTST=/usr/openwin/lib/libXtst.a
|
||||
#endif
|
||||
|
||||
#if defined(USLArchitecture)
|
||||
SYS_LIBRARIES = -lm -ldl -lgen
|
||||
#endif
|
||||
|
||||
#if defined(UXPArchitecture)
|
||||
SYS_LIBRARIES = -lm -ldl -lgen
|
||||
#endif
|
||||
|
||||
LOCAL_LIBRARIES = ../shared/libtermtest.a $(SYNLIB) $(XTST) $(XEXT) $(XLIB)
|
||||
|
||||
SRCS = Cscrolltitle.c
|
||||
|
||||
OBJS = Cscrolltitle.o
|
||||
|
||||
NormalLibraryObjectRule()
|
||||
ComplexProgramTarget($(PROGRAMS))
|
||||
|
||||
saber_src: $(SRCS)
|
||||
XCOMM setopt load_flags $(CFLAGS)
|
||||
XCOMM load $(SRCS) $(LOCAL_LIBRARIES)
|
||||
|
||||
unsaber_src:
|
||||
XCOMM unload $(SRCS)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
25
cde/programs/dtterm/tests/Cscrolltitle/README
Normal file
25
cde/programs/dtterm/tests/Cscrolltitle/README
Normal file
@@ -0,0 +1,25 @@
|
||||
/* $XConsortium: README /main/2 1996/07/15 14:19:09 drk $ */
|
||||
TestName: Cscrolltitle
|
||||
|
||||
|
||||
Description: This program tests the functionality of dtterm with
|
||||
command line options
|
||||
|
||||
" -sb -title TITLE1",
|
||||
" +sb -title title2",
|
||||
" -xrm 'dtterm*scrollBar: False' -sb -title TITLE3",
|
||||
" -xrm 'dtterm*scrollBar: True' +sb -title title4"
|
||||
|
||||
and recordes or compares the image. the result of the test
|
||||
is logged in file term.log
|
||||
|
||||
How to run: have two displays, run the program in one pointing to other
|
||||
display. Also, you have to set the PATH to ../util. (i.e
|
||||
TOP/cde1/dtterm/tests/util)
|
||||
|
||||
|
||||
commandline: -o dtterm.object
|
||||
-o dtterm.object -r -save (for recording)
|
||||
-o dtterm.object -compare -save (for comparing)
|
||||
|
||||
|
||||
65
cde/programs/dtterm/tests/Ctm/Ctm.c
Normal file
65
cde/programs/dtterm/tests/Ctm/Ctm.c
Normal file
@@ -0,0 +1,65 @@
|
||||
/* $XConsortium: Ctm.c /main/3 1995/10/31 11:50:16 rswiston $ */
|
||||
#include <stdio.h>
|
||||
#include <math.h>
|
||||
#include "synvar.h"
|
||||
|
||||
#ifdef LOG
|
||||
FILE *TermLog;
|
||||
#define SAVELOG fclose(TermLog); TermLog = fopen("term.log", "a");
|
||||
#endif
|
||||
|
||||
char LogStr[200];
|
||||
|
||||
|
||||
|
||||
static char *OptionArr[] = {
|
||||
/*0*/ " -tm 'intr ! quit @ erase # kill $ eof % eol ^ swtch & start * stop ( susp ) dsusp _'" /* Normal option */
|
||||
};
|
||||
|
||||
|
||||
static char *LogAction[] = {
|
||||
/*0*/ "Testing Option -tm "
|
||||
};
|
||||
|
||||
#define ArrCount (int) (sizeof(OptionArr) / sizeof(char *))
|
||||
|
||||
main(argc, argv)
|
||||
int argc;
|
||||
char *argv[];
|
||||
{
|
||||
SynStatus Result;
|
||||
char Command[NEED_LEN], *Shell, *Path;
|
||||
int i;
|
||||
|
||||
#ifdef LOG
|
||||
if ((TermLog = fopen("term.log", "a")) == NULL) {
|
||||
if ((TermLog = fopen("term.log", "w")) == NULL)
|
||||
{printf("Logfile could not be opened \n"); exit(-1);}
|
||||
}
|
||||
LogError("****************************************************************************");
|
||||
LogTime();
|
||||
sprintf(Command, "TestName: <%s> STARTS\n", argv[0]);
|
||||
LogError(Command);
|
||||
#endif
|
||||
InitTest(argc, argv);
|
||||
for (i=0; i < ArrCount; i++) {
|
||||
strcpy(Command, TERM_EMU);
|
||||
strcat(Command, OptionArr[i]);
|
||||
CheckCapsLock();
|
||||
LogError(LogAction[i]);
|
||||
ExecCommand(Command); sleep(2);
|
||||
if (WaitWinMap("TermWin") < 0) continue;
|
||||
ExecCommand("termget");
|
||||
CloseTerm("TermWin");
|
||||
WaitWinUnMap("TermWin", 10L);
|
||||
sleep(2);
|
||||
}
|
||||
CloseTest(False);
|
||||
#ifdef LOG
|
||||
sprintf(Command, "TestName: <%s> ENDS\n", argv[0]);
|
||||
LogError(Command);
|
||||
LogError("****************************************************************************");
|
||||
fclose(TermLog);
|
||||
#endif
|
||||
}
|
||||
|
||||
52
cde/programs/dtterm/tests/Ctm/Imakefile
Normal file
52
cde/programs/dtterm/tests/Ctm/Imakefile
Normal file
@@ -0,0 +1,52 @@
|
||||
XCOMM $XConsortium: Imakefile /main/8 1996/10/09 14:07:51 drk $
|
||||
PROGRAMS = Ctm
|
||||
|
||||
INCLUDES = -I. -I$(DTINCLUDESRC)
|
||||
LOCAL_INCLUDES = -I../shared -I$(TOP)/lib/
|
||||
SYS_LIBRARIES = -lm
|
||||
|
||||
|
||||
EXTRA_DEFINES = -DLOG -DSYNLIB
|
||||
|
||||
#if defined(ApolloArchitecture)
|
||||
EXTRA_DEFINES = -Dapollo -D_CMDINV
|
||||
#if defined(SHLIB)
|
||||
LOCAL_LIBRARIES = -A inlib,$(XLIB)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(SunArchitecture)
|
||||
SYS_LIBRARIES = -lm -ldl -lgen -lC
|
||||
SYNLIB=$(TOP)/lib/synlib/libsynlibTst.a
|
||||
XTST=/usr/openwin/lib/libXtst.a
|
||||
#endif
|
||||
|
||||
#if defined(USLArchitecture)
|
||||
SYS_LIBRARIES = -lm -ldl -lgen
|
||||
#endif
|
||||
|
||||
#if defined(UXPArchitecture)
|
||||
SYS_LIBRARIES = -lm -ldl -lgen
|
||||
#endif
|
||||
|
||||
LOCAL_LIBRARIES = ../shared/libtermtest.a $(SYNLIB) $(XTST) $(XEXT) $(XLIB)
|
||||
|
||||
SRCS = Ctm.c
|
||||
|
||||
OBJS = Ctm.o
|
||||
|
||||
NormalLibraryObjectRule()
|
||||
ComplexProgramTarget($(PROGRAMS))
|
||||
|
||||
saber_src: $(SRCS)
|
||||
XCOMM setopt load_flags $(CFLAGS)
|
||||
XCOMM load $(SRCS) $(LOCAL_LIBRARIES)
|
||||
|
||||
unsaber_src:
|
||||
XCOMM unload $(SRCS)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
23
cde/programs/dtterm/tests/Ctm/README
Normal file
23
cde/programs/dtterm/tests/Ctm/README
Normal file
@@ -0,0 +1,23 @@
|
||||
/* $XConsortium: README /main/2 1996/07/15 14:19:28 drk $ */
|
||||
TestName: Ctm
|
||||
|
||||
Description: This program tests the functionality of dtterm with
|
||||
command line options
|
||||
|
||||
" -tm 'intr ! quit @ erase # kill $ eof % eol ^ swtch &
|
||||
start * stop ( susp ) dsusp _'"
|
||||
|
||||
it runs a program 'termget' (in util directory) to verify
|
||||
whether above things are set and reportes whatever is not
|
||||
set.
|
||||
|
||||
How to run: have two displays, run the program in one pointing to other
|
||||
display. Also, you have to set the PATH to ../util. (i.e
|
||||
TOP/cde1/dtterm/tests/util)
|
||||
|
||||
|
||||
commandline: -o dtterm.object
|
||||
-o dtterm.object -r -save (for recording)
|
||||
-o dtterm.object -compare -save (for comparing)
|
||||
|
||||
|
||||
84
cde/programs/dtterm/tests/Cvisualbell/Cvisualbell.c
Normal file
84
cde/programs/dtterm/tests/Cvisualbell/Cvisualbell.c
Normal file
@@ -0,0 +1,84 @@
|
||||
/* $XConsortium: Cvisualbell.c /main/3 1995/10/31 11:50:50 rswiston $ */
|
||||
#include <stdio.h>
|
||||
#include <math.h>
|
||||
#include "synvar.h"
|
||||
|
||||
#ifdef LOG
|
||||
FILE *TermLog;
|
||||
#define SAVELOG fclose(TermLog); TermLog = fopen("term.log", "a");
|
||||
#endif
|
||||
|
||||
char LogStr[200];
|
||||
|
||||
|
||||
void TestVisualbell(WinName, TestNum)
|
||||
char *WinName;
|
||||
int TestNum;
|
||||
{
|
||||
char Str[IMAGE_FILE_LEN];
|
||||
int i;
|
||||
for (i=0; i < 4; i++)
|
||||
PressCtrlGKey(WinName);
|
||||
if (TestNum > 2)
|
||||
PrintTermString(WinName, "You should have heard beep");
|
||||
else
|
||||
PrintTermString(WinName, "You should have seen screen flashing");
|
||||
sleep(5);
|
||||
CloseTerm(WinName);
|
||||
}
|
||||
|
||||
static char *OptionArr[] = {
|
||||
/*0*/ " -vb ",
|
||||
/*1*/ " -xrm 'visualBell: False' -vb",
|
||||
/*2*/ " +vb ",
|
||||
/*3*/ " -xrm 'visualBell: True' +vb"
|
||||
};
|
||||
|
||||
static char *LogAction[] = {
|
||||
/*0*/ " Testing Option: -vb ",
|
||||
/*1*/ " Testing Option: -xrm 'visualBell: False' -vb",
|
||||
/*2*/ " Testing Option: +vb ",
|
||||
/*3*/ " Testing Option: -xrm 'visualBell: True' +vb"
|
||||
};
|
||||
|
||||
#define ArrCount (int) (sizeof(OptionArr) / sizeof(char *))
|
||||
|
||||
main(argc, argv)
|
||||
int argc;
|
||||
char *argv[];
|
||||
{
|
||||
SynStatus Result;
|
||||
char Command[NEED_LEN];
|
||||
int i;
|
||||
|
||||
#ifdef LOG
|
||||
if ((TermLog = fopen("term.log", "a")) == NULL) {
|
||||
if ((TermLog = fopen("term.log", "w")) == NULL)
|
||||
{printf("Logfile could not be opened \n"); exit(-1);}
|
||||
}
|
||||
LogError("****************************************************************************");
|
||||
LogTime();
|
||||
sprintf(Command, "TestName: <%s> STARTS\n", argv[0]);
|
||||
LogError(Command);
|
||||
#endif
|
||||
InitTest(argc, argv);
|
||||
for (i=0; i < ArrCount; i++) {
|
||||
strcpy(Command, TERM_EMU);
|
||||
strcat(Command, OptionArr[i]);
|
||||
CheckCapsLock();
|
||||
LogError(LogAction[i]);
|
||||
ExecCommand(Command);
|
||||
if (WaitWinMap("TermWin") < 0) continue;
|
||||
AssignWinName("TermWin", TERM_EMU);
|
||||
TestVisualbell("TermWin", i+1);
|
||||
WaitWinUnMap("TermWin", 60L);
|
||||
}
|
||||
CloseTest(False);
|
||||
#ifdef LOG
|
||||
sprintf(Command, "TestName: <%s> ENDS\n", argv[0]);
|
||||
LogError(Command);
|
||||
LogError("****************************************************************************");
|
||||
fclose(TermLog);
|
||||
#endif
|
||||
}
|
||||
|
||||
52
cde/programs/dtterm/tests/Cvisualbell/Imakefile
Normal file
52
cde/programs/dtterm/tests/Cvisualbell/Imakefile
Normal file
@@ -0,0 +1,52 @@
|
||||
XCOMM $XConsortium: Imakefile /main/8 1996/10/09 14:07:58 drk $
|
||||
PROGRAMS = Cvisualbell
|
||||
|
||||
INCLUDES = -I. -I$(DTINCLUDESRC)
|
||||
LOCAL_INCLUDES = -I../shared -I$(TOP)/lib/
|
||||
SYS_LIBRARIES = -lm
|
||||
|
||||
|
||||
EXTRA_DEFINES = -DLOG -DSYNLIB
|
||||
|
||||
#if defined(ApolloArchitecture)
|
||||
EXTRA_DEFINES = -Dapollo -D_CMDINV
|
||||
#if defined(SHLIB)
|
||||
LOCAL_LIBRARIES = -A inlib,$(XLIB)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(SunArchitecture)
|
||||
SYS_LIBRARIES = -lm -ldl -lgen -lC
|
||||
SYNLIB=$(TOP)/lib/synlib/libsynlibTst.a
|
||||
XTST=/usr/openwin/lib/libXtst.a
|
||||
#endif
|
||||
|
||||
#if defined(USLArchitecture)
|
||||
SYS_LIBRARIES = -lm -ldl -lgen
|
||||
#endif
|
||||
|
||||
#if defined(UXPArchitecture)
|
||||
SYS_LIBRARIES = -lm -ldl -lgen
|
||||
#endif
|
||||
|
||||
LOCAL_LIBRARIES = ../shared/libtermtest.a $(SYNLIB) $(XTST) $(XEXT) $(XLIB)
|
||||
|
||||
SRCS = Cvisualbell.c
|
||||
|
||||
OBJS = Cvisualbell.o
|
||||
|
||||
NormalLibraryObjectRule()
|
||||
ComplexProgramTarget($(PROGRAMS))
|
||||
|
||||
saber_src: $(SRCS)
|
||||
XCOMM setopt load_flags $(CFLAGS)
|
||||
XCOMM load $(SRCS) $(LOCAL_LIBRARIES)
|
||||
|
||||
unsaber_src:
|
||||
XCOMM unload $(SRCS)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
23
cde/programs/dtterm/tests/Cvisualbell/README
Normal file
23
cde/programs/dtterm/tests/Cvisualbell/README
Normal file
@@ -0,0 +1,23 @@
|
||||
/* $XConsortium: README /main/2 1996/07/15 14:19:50 drk $ */
|
||||
TestName: Cvisualbell
|
||||
|
||||
Description: This program tests the functionality of dtterm with
|
||||
command line options
|
||||
|
||||
" -vb ",
|
||||
" -xrm 'visualBell: False' -vb",
|
||||
" +vb ",
|
||||
" -xrm 'visualBell: True' +vb"
|
||||
|
||||
this ia mannual verification test
|
||||
|
||||
How to run: have two displays, run the program in one pointing to other
|
||||
display. Also, you have to set the PATH to ../util. (i.e
|
||||
TOP/cde1/dtterm/tests/util)
|
||||
|
||||
|
||||
commandline: -o dtterm.object
|
||||
-o dtterm.object -r -save (for recording)
|
||||
-o dtterm.object -compare -save (for comparing)
|
||||
|
||||
|
||||
15
cde/programs/dtterm/tests/Imakefile
Normal file
15
cde/programs/dtterm/tests/Imakefile
Normal file
@@ -0,0 +1,15 @@
|
||||
XCOMM $XConsortium: Imakefile /main/3 1995/10/31 11:46:52 rswiston $
|
||||
#define IHaveSubdirs
|
||||
#define PassCDebugFlags 'CDEBUGFLAGS=$(CDEBUGFLAGS)'
|
||||
|
||||
|
||||
/*SUBDIRS = access format helpApiTest quickApiTest terminal*/
|
||||
SUBDIRS = shared Cborder Cgeomcolor Ciconic Clogging Clogin Csavelines \
|
||||
Cscrolltitle \
|
||||
Ctm Cvisualbell Rborder Rgeomcolor Riconic Rlogging \
|
||||
Rlogin Rpointer Rsavelines Rscrolltitle Rtm Rvisualbell Rwrap \
|
||||
charatt curmove decmode edittest erase keypad scroll sgr \
|
||||
tabctrl util
|
||||
|
||||
MakeSubdirs($(SUBDIRS))
|
||||
DependSubdirs($(SUBDIRS))
|
||||
25
cde/programs/dtterm/tests/README
Normal file
25
cde/programs/dtterm/tests/README
Normal file
@@ -0,0 +1,25 @@
|
||||
/* $XConsortium: README /main/2 1996/07/15 14:20:15 drk $ */
|
||||
this test directory contains subdirectories (one for each test)
|
||||
|
||||
directory which starts with R - contains program to test some of the
|
||||
resources
|
||||
|
||||
directory which starts with C - contains program to test some of the
|
||||
command line option
|
||||
|
||||
directory which does not start with C or R -
|
||||
contains program to test some of the
|
||||
escape sequences
|
||||
|
||||
You will find README in each subdirectory which gives information
|
||||
about the test and if it refers to dtterm.object, you can find the
|
||||
file in data subdirectory.
|
||||
|
||||
all resource tests (starts with R) expect a file named xrdb.out in
|
||||
the directory in which you tests. you can create that file by
|
||||
executing the command xrdb -q > xrdb.out (it's basically the current
|
||||
resource setup)
|
||||
|
||||
let me know if in case you need. my email add vels@hpcvlx.cv.hp.com
|
||||
|
||||
|
||||
52
cde/programs/dtterm/tests/Rborder/Imakefile
Normal file
52
cde/programs/dtterm/tests/Rborder/Imakefile
Normal file
@@ -0,0 +1,52 @@
|
||||
XCOMM $XConsortium: Imakefile /main/8 1996/10/09 14:08:06 drk $
|
||||
PROGRAMS = Rborder
|
||||
|
||||
INCLUDES = -I. -I$(DTINCLUDESRC)
|
||||
LOCAL_INCLUDES = -I../shared -I$(TOP)/lib/
|
||||
SYS_LIBRARIES = -lm
|
||||
|
||||
|
||||
EXTRA_DEFINES = -DLOG -DSYNLIB
|
||||
|
||||
#if defined(ApolloArchitecture)
|
||||
EXTRA_DEFINES = -Dapollo -D_CMDINV
|
||||
#if defined(SHLIB)
|
||||
LOCAL_LIBRARIES = -A inlib,$(XLIB)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(SunArchitecture)
|
||||
SYS_LIBRARIES = -lm -ldl -lgen -lC
|
||||
SYNLIB=$(TOP)/lib/synlib/libsynlibTst.a
|
||||
XTST=/usr/openwin/lib/libXtst.a
|
||||
#endif
|
||||
|
||||
#if defined(USLArchitecture)
|
||||
SYS_LIBRARIES = -lm -ldl -lgen
|
||||
#endif
|
||||
|
||||
#if defined(UXPArchitecture)
|
||||
SYS_LIBRARIES = -lm -ldl -lgen
|
||||
#endif
|
||||
|
||||
LOCAL_LIBRARIES = ../shared/libtermtest.a $(SYNLIB) $(XTST) $(XEXT) $(XLIB)
|
||||
|
||||
SRCS = Rborder.c
|
||||
|
||||
OBJS = Rborder.o
|
||||
|
||||
NormalLibraryObjectRule()
|
||||
ComplexProgramTarget($(PROGRAMS))
|
||||
|
||||
saber_src: $(SRCS)
|
||||
XCOMM setopt load_flags $(CFLAGS)
|
||||
XCOMM load $(SRCS) $(LOCAL_LIBRARIES)
|
||||
|
||||
unsaber_src:
|
||||
XCOMM unload $(SRCS)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
27
cde/programs/dtterm/tests/Rborder/README
Normal file
27
cde/programs/dtterm/tests/Rborder/README
Normal file
@@ -0,0 +1,27 @@
|
||||
/* $XConsortium: README /main/2 1996/07/15 14:20:52 drk $ */
|
||||
TestName: Rborder
|
||||
|
||||
Description: This program tests the functionality of dtterm with
|
||||
following resource options set.
|
||||
|
||||
"borderColor red borderWidth 10 ",
|
||||
"borderColor green borderWidth 6 ",
|
||||
"borderColor blue borderWidth 12 ",
|
||||
"borderColor yellow borderWidth 15 ",
|
||||
"borderColor cyan borderWidth 7 ",
|
||||
"borderColor brown borderWidth 8 ",
|
||||
"borderWidth 10 ",
|
||||
|
||||
and recordes or compares the image. the result of the test
|
||||
is logged in file term.log
|
||||
|
||||
How to run: have two displays, run the program in one pointing to other
|
||||
display. Also, you have to set the PATH to ../util. (i.e
|
||||
TOP/cde1/dtterm/tests/util)
|
||||
|
||||
|
||||
commandline: -o dtterm.object
|
||||
-o dtterm.object -r -save (for recording)
|
||||
-o dtterm.object -compare -save (for comparing)
|
||||
|
||||
|
||||
128
cde/programs/dtterm/tests/Rborder/Rborder.c
Normal file
128
cde/programs/dtterm/tests/Rborder/Rborder.c
Normal file
@@ -0,0 +1,128 @@
|
||||
/* $XConsortium: Rborder.c /main/3 1995/10/31 11:51:22 rswiston $ */
|
||||
#include <stdio.h>
|
||||
#include <math.h>
|
||||
#include "synvar.h"
|
||||
#include "common.h"
|
||||
|
||||
#ifdef LOG
|
||||
FILE *TermLog;
|
||||
#define SAVELOG fclose(TermLog); TermLog = fopen("term.log", "a");
|
||||
#endif
|
||||
|
||||
char LogStr[200];
|
||||
|
||||
|
||||
void TestBorder(WinName, String, TestNum)
|
||||
char *WinName, *String;
|
||||
int TestNum;
|
||||
{
|
||||
char Str[IMAGE_FILE_LEN];
|
||||
PrintTermString(WinName, String);
|
||||
sprintf(Str, "%srborder%d", IMAGE_DIR, TestNum);
|
||||
MatchWindows(WinName, Str);
|
||||
CloseTerm(WinName);
|
||||
}
|
||||
|
||||
static char *OptionArr[] = {
|
||||
/*0*/ " -bd red -bw 10",
|
||||
/*1*/ " -bd green -bw 6",
|
||||
/*2*/ " -bd blue -bw 12",
|
||||
/*3*/ " -bd yellow -bw 15",
|
||||
/*4*/ " -bordercolor cyan -borderwidth 7",
|
||||
/*5*/ " -bordercolor brown -borderwidth 8",
|
||||
/*6*/ " -w 10"
|
||||
};
|
||||
|
||||
static char *ResourceArr[] = {
|
||||
/*0*/ "borderColor red borderWidth 10 ",
|
||||
/*1*/ "borderColor green borderWidth 6 ",
|
||||
/*2*/ "borderColor blue borderWidth 12 ",
|
||||
/*3*/ "borderColor yellow borderWidth 15 ",
|
||||
/*4*/ "borderColor cyan borderWidth 7 ",
|
||||
/*5*/ "borderColor brown borderWidth 8 ",
|
||||
/*6*/ "borderWidth 10 ",
|
||||
};
|
||||
|
||||
static char *LogAction[] = {
|
||||
/*0*/ "Testing Resourse Option:borderColor red borderWidth 10 ",
|
||||
/*1*/ "Testing Resourse Option:borderColor green borderWidth 6 ",
|
||||
/*2*/ "Testing Resourse Option:borderColor blue borderWidth 12 ",
|
||||
/*3*/ "Testing Resourse Option:borderColor yellow borderWidth 15 ",
|
||||
/*4*/ "Testing Resourse Option:borderColor cyan borderWidth 7 ",
|
||||
/*5*/ "Testing Resourse Option:borderColor brown borderWidth 8 ",
|
||||
/*6*/ "Testing Resourse Option:borderWidth 10 ",
|
||||
};
|
||||
|
||||
|
||||
int MakeResourceFile(ResArr)
|
||||
char *ResArr;
|
||||
{
|
||||
FILE *ResFile;
|
||||
int i, j, Len;
|
||||
char Resource[50], Value[50];
|
||||
|
||||
if ((ResFile = fopen("res", "w")) == NULL)
|
||||
{LogError("Resource File Creation fail"); return(-1);}
|
||||
for (i=0; i < 50; i++) Resource[i] = BLANK;
|
||||
for (i=0; i < 50; i++) Value[i] = BLANK;
|
||||
Len = strlen(ResArr); i=0;
|
||||
while (i < Len) {
|
||||
j = 0;
|
||||
while (ResArr[i] != BLANK) Resource[j++] = ResArr[i++];
|
||||
Resource[j] = NULLCHAR;
|
||||
i++; j = 0;
|
||||
while ((ResArr[i] != BLANK) && (ResArr[i] != NULLCHAR))
|
||||
Value[j++] = ResArr[i++];
|
||||
Value[j] = NULLCHAR;
|
||||
i++;
|
||||
fprintf(ResFile, "%s*%s: %s\n", TERM_EMU, Resource, Value);
|
||||
}
|
||||
fclose(ResFile);
|
||||
}
|
||||
|
||||
#define ArrCount (int) (sizeof(OptionArr) / sizeof(char *))
|
||||
|
||||
main(argc, argv)
|
||||
int argc;
|
||||
char *argv[];
|
||||
{
|
||||
SynStatus Result;
|
||||
char Command[NEED_LEN];
|
||||
int i;
|
||||
|
||||
#ifdef LOG
|
||||
if ((TermLog = fopen("term.log", "a")) == NULL) {
|
||||
if ((TermLog = fopen("term.log", "w")) == NULL)
|
||||
{printf("Logfile could not be opened \n"); exit(-1);}
|
||||
}
|
||||
LogError("****************************************************************************");
|
||||
LogTime();
|
||||
sprintf(Command, "TestName: <%s> STARTS\n", argv[0]);
|
||||
LogError(Command);
|
||||
#endif
|
||||
InitTest(argc, argv);
|
||||
for (i=0; i < ArrCount; i++) {
|
||||
CheckCapsLock();
|
||||
ExecCommand("xrdb -load xrdb.out");
|
||||
MakeResourceFile(ResourceArr[i]);
|
||||
CheckCapsLock();
|
||||
strcpy(Command, "xrdb -merge res; ");
|
||||
strcat(Command, TERM_EMU);
|
||||
LogError(LogAction[i]);
|
||||
ExecCommand(Command);
|
||||
if (WaitWinMap("TermWin") < 0) continue;
|
||||
AssignWinName("TermWin", TERM_EMU);
|
||||
TestBorder("TermWin", OptionArr[i], i+1);
|
||||
WaitWinUnMap("TermWin", 60L);
|
||||
}
|
||||
CheckCapsLock();
|
||||
ExecCommand("xrdb -load xrdb.out");
|
||||
CloseTest(False);
|
||||
#ifdef LOG
|
||||
sprintf(Command, "TestName: <%s> ENDS\n", argv[0]);
|
||||
LogError(Command);
|
||||
LogError("****************************************************************************");
|
||||
fclose(TermLog);
|
||||
#endif
|
||||
}
|
||||
|
||||
52
cde/programs/dtterm/tests/Rgeomcolor/Imakefile
Normal file
52
cde/programs/dtterm/tests/Rgeomcolor/Imakefile
Normal file
@@ -0,0 +1,52 @@
|
||||
XCOMM $XConsortium: Imakefile /main/8 1996/10/09 14:08:14 drk $
|
||||
PROGRAMS = Rgeomcolor
|
||||
|
||||
INCLUDES = -I. -I$(DTINCLUDESRC)
|
||||
LOCAL_INCLUDES = -I../shared -I$(TOP)/lib/
|
||||
SYS_LIBRARIES = -lm
|
||||
|
||||
|
||||
EXTRA_DEFINES = -DLOG -DSYNLIB
|
||||
|
||||
#if defined(ApolloArchitecture)
|
||||
EXTRA_DEFINES = -Dapollo -D_CMDINV
|
||||
#if defined(SHLIB)
|
||||
LOCAL_LIBRARIES = -A inlib,$(XLIB)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(SunArchitecture)
|
||||
SYS_LIBRARIES = -lm -ldl -lgen -lC
|
||||
SYNLIB=$(TOP)/lib/synlib/libsynlibTst.a
|
||||
XTST=/usr/openwin/lib/libXtst.a
|
||||
#endif
|
||||
|
||||
#if defined(USLArchitecture)
|
||||
SYS_LIBRARIES = -lm -ldl -lgen
|
||||
#endif
|
||||
|
||||
#if defined(UXPArchitecture)
|
||||
SYS_LIBRARIES = -lm -ldl -lgen
|
||||
#endif
|
||||
|
||||
LOCAL_LIBRARIES = ../shared/libtermtest.a $(SYNLIB) $(XTST) $(XEXT) $(XLIB)
|
||||
|
||||
SRCS = Rgeomcolor.c
|
||||
|
||||
OBJS = Rgeomcolor.o
|
||||
|
||||
NormalLibraryObjectRule()
|
||||
ComplexProgramTarget($(PROGRAMS))
|
||||
|
||||
saber_src: $(SRCS)
|
||||
XCOMM setopt load_flags $(CFLAGS)
|
||||
XCOMM load $(SRCS) $(LOCAL_LIBRARIES)
|
||||
|
||||
unsaber_src:
|
||||
XCOMM unload $(SRCS)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
32
cde/programs/dtterm/tests/Rgeomcolor/README
Normal file
32
cde/programs/dtterm/tests/Rgeomcolor/README
Normal file
@@ -0,0 +1,32 @@
|
||||
/* $XConsortium: README /main/2 1996/07/15 14:21:26 drk $ */
|
||||
TestName: Rgeomcolor
|
||||
|
||||
Description: This program tests the functionality of dtterm with
|
||||
following resource options set
|
||||
|
||||
"geometry 40x20 foreground green background red",
|
||||
"geometry 60x15 foreground red background green",
|
||||
"geometry 80x10 foreground green background yellow",
|
||||
"geometry 80x40 foreground blue background cyan",
|
||||
"geometry 20x40 foreground white background black",
|
||||
"reverseVideo True",
|
||||
"reverseVideo On",
|
||||
"reverseVideo False",
|
||||
"backgroundIsSelect True",
|
||||
"backgroundIsSelect False",
|
||||
"pointerColor red",
|
||||
"pointerColor blue"
|
||||
|
||||
and recordes or compares the image. the result of the test
|
||||
is logged in file term.log
|
||||
|
||||
How to run: have two displays, run the program in one pointing to other
|
||||
display. Also, you have to set the PATH to ../util. (i.e
|
||||
TOP/cde1/dtterm/tests/util)
|
||||
|
||||
|
||||
commandline: -o dtterm.object
|
||||
-o dtterm.object -r -save (for recording)
|
||||
-o dtterm.object -compare -save (for comparing)
|
||||
|
||||
|
||||
140
cde/programs/dtterm/tests/Rgeomcolor/Rgeomcolor.c
Normal file
140
cde/programs/dtterm/tests/Rgeomcolor/Rgeomcolor.c
Normal file
@@ -0,0 +1,140 @@
|
||||
/* $XConsortium: Rgeomcolor.c /main/3 1995/10/31 11:51:45 rswiston $ */
|
||||
#include <stdio.h>
|
||||
#include <math.h>
|
||||
#include "synvar.h"
|
||||
#include "common.h"
|
||||
|
||||
#ifdef LOG
|
||||
FILE *TermLog;
|
||||
#define SAVELOG fclose(TermLog); TermLog = fopen("term.log", "a");
|
||||
#endif
|
||||
|
||||
char LogStr[200];
|
||||
|
||||
|
||||
#define BLANK ' '
|
||||
|
||||
void TestGeomFgBg(WinName, String, TestNum)
|
||||
char *WinName, *String;
|
||||
int TestNum;
|
||||
{
|
||||
char Str[IMAGE_FILE_LEN];
|
||||
PrintTermString(WinName, String);
|
||||
sprintf(Str, "%srgeomcolor%d", IMAGE_DIR, TestNum);
|
||||
MatchWindows(WinName, Str);
|
||||
CloseTerm(WinName);
|
||||
}
|
||||
|
||||
static char *OptionArr[] = {
|
||||
/*0*/ " -geometry 40x20 -fg green -bg red ",
|
||||
/*1*/ " -geometry 60x15 -fg red -bg green ",
|
||||
/*2*/ " -geometry 80x10 -fg green -bg yellow ",
|
||||
/*3*/ " -geometry 80x40 -foreground blue -background cyan ",
|
||||
/*4*/ " -geometry 20x40 -foreground white -background black ",
|
||||
/*5*/ " -rv",
|
||||
/*6*/ " -reverse",
|
||||
/*7*/ " +rv",
|
||||
/*8*/ " -bs ",
|
||||
/*9*/ " +bs ",
|
||||
/*10*/ " -ms red ",
|
||||
/*11*/ " -ms blue "
|
||||
};
|
||||
|
||||
static char *ResourceArr[] = {
|
||||
/*0*/ "geometry 40x20 foreground green background red",
|
||||
/*1*/ "geometry 60x15 foreground red background green",
|
||||
/*2*/ "geometry 80x10 foreground green background yellow",
|
||||
/*3*/ "geometry 80x40 foreground blue background cyan",
|
||||
/*4*/ "geometry 20x40 foreground white background black",
|
||||
/*5*/ "reverseVideo True",
|
||||
/*6*/ "reverseVideo On",
|
||||
/*7*/ "reverseVideo False",
|
||||
/*8*/ "backgroundIsSelect True",
|
||||
/*9*/ "backgroundIsSelect False",
|
||||
/*10*/ "pointerColor red",
|
||||
/*11*/ "pointerColor blue"
|
||||
};
|
||||
|
||||
static char *LogAction[] = {
|
||||
"Testing Resource Option: geometry 40x20 foreground green background red",
|
||||
"Testing Resource Option: geometry 60x15 foreground red background green",
|
||||
"Testing Resource Option: geometry 80x10 foreground green background yellow",
|
||||
"Testing Resource Option: geometry 80x40 foreground blue background cyan",
|
||||
"Testing Resource Option: geometry 20x40 foreground white background black",
|
||||
"Testing Resource Option: reverseVideo True",
|
||||
"Testing Resource Option: reverseVideo On",
|
||||
"Testing Resource Option: reverseVideo False",
|
||||
"Testing Resource Option: backgroundIsSelect True",
|
||||
"Testing Resource Option: backgroundIsSelect False",
|
||||
"Testing Resource Option: pointerColor red",
|
||||
"Testing Resource Option: pointerColor blue"
|
||||
};
|
||||
|
||||
#define ArrCount (int) (sizeof(ResourceArr) / sizeof(char *))
|
||||
|
||||
int MakeResourceFile(ResArr)
|
||||
char *ResArr;
|
||||
{
|
||||
FILE *ResFile;
|
||||
int i, j, Len;
|
||||
char Resource[50], Value[50];
|
||||
|
||||
if ((ResFile = fopen("res", "w")) == NULL)
|
||||
{LogError("Resource File Creation fail"); return(-1);}
|
||||
for (i=0; i < 50; i++) Resource[i] = BLANK;
|
||||
for (i=0; i < 50; i++) Value[i] = BLANK;
|
||||
Len = strlen(ResArr); i=0;
|
||||
while (i < Len) {
|
||||
j = 0;
|
||||
while (ResArr[i] != BLANK) Resource[j++] = ResArr[i++];
|
||||
Resource[j] = NULLCHAR;
|
||||
i++; j = 0;
|
||||
while ((ResArr[i] != BLANK) && (ResArr[i] != NULLCHAR))
|
||||
Value[j++] = ResArr[i++];
|
||||
Value[j] = NULLCHAR;
|
||||
i++;
|
||||
fprintf(ResFile, "%s*%s: %s\n", TERM_EMU, Resource, Value);
|
||||
}
|
||||
fclose(ResFile);
|
||||
}
|
||||
|
||||
main(argc, argv)
|
||||
int argc;
|
||||
char *argv[];
|
||||
{
|
||||
SynStatus Result;
|
||||
char Command[NEED_LEN];
|
||||
int i;
|
||||
|
||||
#ifdef LOG
|
||||
if ((TermLog = fopen("term.log", "a")) == NULL) {
|
||||
if ((TermLog = fopen("term.log", "w")) == NULL)
|
||||
{printf("Logfile could not be opened \n"); exit(-1);}
|
||||
}
|
||||
fprintf(TermLog, "**************************************************\n");
|
||||
LogTime();
|
||||
fprintf(TermLog, "TestName: <%s> STARTS\n", argv[0]);
|
||||
#endif
|
||||
InitTest(argc, argv);
|
||||
for (i=0; i < ArrCount; i++) {
|
||||
CheckCapsLock();
|
||||
ExecCommand("xrdb -load xrdb.out");
|
||||
MakeResourceFile(ResourceArr[i]);
|
||||
CheckCapsLock();
|
||||
strcpy(Command, "xrdb -merge res; ");
|
||||
strcat(Command, TERM_EMU);
|
||||
ExecCommand(Command);
|
||||
if (WaitWinMap("TermWin") < 0) continue;
|
||||
AssignWinName("TermWin", TERM_EMU);
|
||||
TestGeomFgBg("TermWin", OptionArr[i], i+1);
|
||||
WaitWinUnMap("TermWin", 60L);
|
||||
}
|
||||
CheckCapsLock();
|
||||
ExecCommand("xrdb -load xrdb.out");
|
||||
CloseTest(False);
|
||||
#ifdef LOG
|
||||
fprintf(TermLog, "TestName: <%s> ENDS\n", argv[0]);
|
||||
fclose(TermLog);
|
||||
#endif
|
||||
}
|
||||
|
||||
51
cde/programs/dtterm/tests/Riconic/Imakefile
Normal file
51
cde/programs/dtterm/tests/Riconic/Imakefile
Normal file
@@ -0,0 +1,51 @@
|
||||
XCOMM $XConsortium: Imakefile /main/8 1996/10/09 14:08:23 drk $
|
||||
PROGRAMS = Riconic
|
||||
|
||||
INCLUDES = -I. -I$(DTINCLUDESRC)
|
||||
LOCAL_INCLUDES = -I../shared -I$(TOP)/lib/
|
||||
SYS_LIBRARIES = -lm
|
||||
|
||||
EXTRA_DEFINES = -DLOG -DSYNLIB
|
||||
|
||||
#if defined(ApolloArchitecture)
|
||||
EXTRA_DEFINES = -Dapollo -D_CMDINV
|
||||
#if defined(SHLIB)
|
||||
LOCAL_LIBRARIES = -A inlib,$(XLIB)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(SunArchitecture)
|
||||
SYS_LIBRARIES = -lm -ldl -lgen -lC
|
||||
SYNLIB=$(TOP)/lib/synlib/libsynlibTst.a
|
||||
XTST=/usr/openwin/lib/libXtst.a
|
||||
#endif
|
||||
|
||||
#if defined(USLArchitecture)
|
||||
SYS_LIBRARIES = -lm -ldl -lgen
|
||||
#endif
|
||||
|
||||
#if defined(UXPArchitecture)
|
||||
SYS_LIBRARIES = -lm -ldl -lgen
|
||||
#endif
|
||||
|
||||
LOCAL_LIBRARIES = ../shared/libtermtest.a $(SYNLIB) $(XTST) $(XEXT) $(XLIB)
|
||||
|
||||
SRCS = Riconic.c
|
||||
|
||||
OBJS = Riconic.o
|
||||
|
||||
NormalLibraryObjectRule()
|
||||
ComplexProgramTarget($(PROGRAMS))
|
||||
|
||||
saber_src: $(SRCS)
|
||||
XCOMM setopt load_flags $(CFLAGS)
|
||||
XCOMM load $(SRCS) $(LOCAL_LIBRARIES)
|
||||
|
||||
unsaber_src:
|
||||
XCOMM unload $(SRCS)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
24
cde/programs/dtterm/tests/Riconic/README
Normal file
24
cde/programs/dtterm/tests/Riconic/README
Normal file
@@ -0,0 +1,24 @@
|
||||
/* $XConsortium: README /main/2 1996/07/15 14:21:45 drk $ */
|
||||
TestName: Riconic
|
||||
|
||||
Description: This program tests the functionality of dtterm with
|
||||
following resources options set
|
||||
|
||||
"iconic True",
|
||||
"iconic True iconName test",
|
||||
"iconic True mapOnOutput True mapOnOutputDelay 5",
|
||||
"iconic True mapOnOutput False mapOnOutputDelay 5"
|
||||
|
||||
and recordes or compares the image. the result of the test
|
||||
is logged in file term.log
|
||||
|
||||
How to run: have two displays, run the program in one pointing to other
|
||||
display. Also, you have to set the PATH to ../util. (i.e
|
||||
TOP/cde1/dtterm/tests/util)
|
||||
|
||||
|
||||
commandline: -o dtterm.object
|
||||
-o dtterm.object -r -save (for recording)
|
||||
-o dtterm.object -compare -save (for comparing)
|
||||
|
||||
|
||||
151
cde/programs/dtterm/tests/Riconic/Riconic.c
Normal file
151
cde/programs/dtterm/tests/Riconic/Riconic.c
Normal file
@@ -0,0 +1,151 @@
|
||||
/* $XConsortium: Riconic.c /main/3 1995/10/31 11:52:08 rswiston $ */
|
||||
#include <stdio.h>
|
||||
#include <math.h>
|
||||
#include "synvar.h"
|
||||
#include "common.h"
|
||||
|
||||
#ifdef LOG
|
||||
FILE *TermLog;
|
||||
#define SAVELOG fclose(TermLog); TermLog = fopen("term.log", "a");
|
||||
#endif
|
||||
|
||||
#define BLANK ' '
|
||||
|
||||
char LogStr[200];
|
||||
|
||||
|
||||
void TestIconify(WinName, String, TestNum)
|
||||
char *WinName, *String;
|
||||
int TestNum;
|
||||
{
|
||||
char Str[IMAGE_FILE_LEN];
|
||||
sprintf(Str, "%sriconic%d", IMAGE_DIR, TestNum);
|
||||
MatchWindows(WinName, Str);
|
||||
Deiconify(WinName);
|
||||
if (WaitWinMap(WinName) < 0) LogError("Deiconify did not work");
|
||||
PrintTermString(WinName, String);
|
||||
sprintf(Str, "%sriconic%dA", IMAGE_DIR, TestNum);
|
||||
MatchWindows(WinName, Str);
|
||||
CloseTerm(WinName);
|
||||
}
|
||||
|
||||
void TestIconifyMap(WinName, String, TestNum)
|
||||
char *WinName, *String;
|
||||
int TestNum;
|
||||
{
|
||||
char Str[IMAGE_FILE_LEN];
|
||||
sprintf(Str, "%sriconic%d", IMAGE_DIR, TestNum);
|
||||
MatchWindows(WinName, Str);
|
||||
if (TestNum == 3) {
|
||||
if (WaitWinMap(WinName) < 0) LogError("mapOnOutput: True did not work");
|
||||
PrintTermString(WinName, String);
|
||||
sprintf(Str, "%sriconic%dA", IMAGE_DIR, TestNum);
|
||||
MatchWindows(WinName, Str);
|
||||
PrintTermString(WinName, "1");
|
||||
CloseTerm(WinName);
|
||||
}
|
||||
else {
|
||||
if (WaitWinMap(WinName) == 0) LogError("mapOnOutput:False did not work");
|
||||
else {
|
||||
Deiconify(WinName);
|
||||
if (WaitWinMap(WinName) < 0) LogError("Deiconify did not work");
|
||||
CloseTerm(WinName);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static char *OptionArr[] = {
|
||||
/*0*/ " -iconic ",
|
||||
/*1*/ " -iconic -xrm 'dtterm*iconName: Test' ",
|
||||
/*2*/ " -iconic -map -xrm 'dtterm*mapOnOutputDelay: 5' -e wait5write",
|
||||
/*3*/ " -iconic +map -xrm 'dtterm*mapOnOutputDelay: 5' -e wait5write"
|
||||
};
|
||||
|
||||
static char *ResourceArr[] = {
|
||||
/*0*/ "iconic True",
|
||||
/*1*/ "iconic True iconName test",
|
||||
/*2*/ "iconic True mapOnOutput True mapOnOutputDelay 5",
|
||||
/*3*/ "iconic True mapOnOutput False mapOnOutputDelay 5"
|
||||
};
|
||||
|
||||
static char *LogAction[] = {
|
||||
"Testing Option iconic True ",
|
||||
"Testing Option iconic True iconName Test",
|
||||
"Testing Option iconic True mapOnOutput True mapOnOutputDelay 5",
|
||||
"Testing Option iconic True mapOnOutput False mapOnOutputDelay 5"
|
||||
};
|
||||
|
||||
int MakeResourceFile(ResArr)
|
||||
char *ResArr;
|
||||
{
|
||||
FILE *ResFile;
|
||||
int i, j, Len;
|
||||
char Resource[50], Value[50];
|
||||
|
||||
if ((ResFile = fopen("res", "w")) == NULL)
|
||||
{LogError("Resource File Creation fail"); return(-1);}
|
||||
for (i=0; i < 50; i++) Resource[i] = BLANK;
|
||||
for (i=0; i < 50; i++) Value[i] = BLANK;
|
||||
Len = strlen(ResArr); i=0;
|
||||
while (i < Len) {
|
||||
j = 0;
|
||||
while (ResArr[i] != BLANK) Resource[j++] = ResArr[i++];
|
||||
Resource[j] = NULLCHAR;
|
||||
i++; j = 0;
|
||||
while ((ResArr[i] != BLANK) && (ResArr[i] != NULLCHAR))
|
||||
Value[j++] = ResArr[i++];
|
||||
Value[j] = NULLCHAR;
|
||||
i++;
|
||||
fprintf(ResFile, "%s*%s: %s\n", TERM_EMU, Resource, Value);
|
||||
}
|
||||
fclose(ResFile);
|
||||
}
|
||||
|
||||
#define ArrCount (int) (sizeof(OptionArr) / sizeof(char *))
|
||||
|
||||
main(argc, argv)
|
||||
int argc;
|
||||
char *argv[];
|
||||
{
|
||||
SynStatus Result;
|
||||
char Command[NEED_LEN];
|
||||
int i;
|
||||
|
||||
#ifdef LOG
|
||||
if ((TermLog = fopen("term.log", "a")) == NULL) {
|
||||
if ((TermLog = fopen("term.log", "w")) == NULL)
|
||||
{printf("Logfile could not be opened \n"); exit(-1);}
|
||||
}
|
||||
LogError("****************************************************************************");
|
||||
LogTime();
|
||||
sprintf(Command, "TestName: <%s> STARTS\n", argv[0]);
|
||||
LogError(Command);
|
||||
#endif
|
||||
InitTest(argc, argv);
|
||||
for (i=0; i < ArrCount; i++) {
|
||||
CheckCapsLock();
|
||||
ExecCommand("xrdb -load xrdb.out");
|
||||
MakeResourceFile(ResourceArr[i]);
|
||||
CheckCapsLock();
|
||||
strcpy(Command, "xrdb -merge res; ");
|
||||
strcat(Command, TERM_EMU);
|
||||
if (i > 1) strcat(Command, " -e wait5write");
|
||||
ExecCommand(Command);
|
||||
if (WaitWinMap("TermWin") < 0) continue;
|
||||
AssignWinName("TermWin", TERM_EMU);
|
||||
if (i <= 1) TestIconify("TermWin", OptionArr[i], i+1);
|
||||
else TestIconifyMap("TermWin", OptionArr[i], i+1);
|
||||
WaitWinUnMap("TermWin", 60L);
|
||||
}
|
||||
CheckCapsLock();
|
||||
ExecCommand("xrdb -load xrdb.out");
|
||||
CloseTest(False);
|
||||
#ifdef LOG
|
||||
sprintf(Command, "TestName: <%s> ENDS\n", argv[0]);
|
||||
LogError(Command);
|
||||
LogError("****************************************************************************");
|
||||
fclose(TermLog);
|
||||
#endif
|
||||
}
|
||||
|
||||
52
cde/programs/dtterm/tests/Rlogging/Imakefile
Normal file
52
cde/programs/dtterm/tests/Rlogging/Imakefile
Normal file
@@ -0,0 +1,52 @@
|
||||
XCOMM $XConsortium: Imakefile /main/8 1996/10/09 14:08:30 drk $
|
||||
PROGRAMS = Rlogging
|
||||
|
||||
INCLUDES = -I. -I$(DTINCLUDESRC)
|
||||
LOCAL_INCLUDES = -I../shared -I$(TOP)/lib/
|
||||
SYS_LIBRARIES = -lm
|
||||
|
||||
|
||||
EXTRA_DEFINES = -DLOG -DSYNLIB
|
||||
|
||||
#if defined(ApolloArchitecture)
|
||||
EXTRA_DEFINES = -Dapollo -D_CMDINV
|
||||
#if defined(SHLIB)
|
||||
LOCAL_LIBRARIES = -A inlib,$(XLIB)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(SunArchitecture)
|
||||
SYS_LIBRARIES = -lm -ldl -lgen -lC
|
||||
SYNLIB=$(TOP)/lib/synlib/libsynlibTst.a
|
||||
XTST=/usr/openwin/lib/libXtst.a
|
||||
#endif
|
||||
|
||||
#if defined(USLArchitecture)
|
||||
SYS_LIBRARIES = -lm -ldl -lgen
|
||||
#endif
|
||||
|
||||
#if defined(UXPArchitecture)
|
||||
SYS_LIBRARIES = -lm -ldl -lgen
|
||||
#endif
|
||||
|
||||
LOCAL_LIBRARIES = ../shared/libtermtest.a $(SYNLIB) $(XTST) $(XEXT) $(XLIB)
|
||||
|
||||
SRCS = Rlogging.c
|
||||
|
||||
OBJS = Rlogging.o
|
||||
|
||||
NormalLibraryObjectRule()
|
||||
ComplexProgramTarget($(PROGRAMS))
|
||||
|
||||
saber_src: $(SRCS)
|
||||
XCOMM setopt load_flags $(CFLAGS)
|
||||
XCOMM load $(SRCS) $(LOCAL_LIBRARIES)
|
||||
|
||||
unsaber_src:
|
||||
XCOMM unload $(SRCS)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
23
cde/programs/dtterm/tests/Rlogging/README
Normal file
23
cde/programs/dtterm/tests/Rlogging/README
Normal file
@@ -0,0 +1,23 @@
|
||||
/* $XConsortium: README /main/2 1996/07/15 14:22:05 drk $ */
|
||||
TestName: Rlogging
|
||||
|
||||
Description: This program tests the functionality of dtterm with
|
||||
following resource options set
|
||||
|
||||
|
||||
"logging True",
|
||||
"logging True ",
|
||||
"logging True logFile Term.Log",
|
||||
"logging False logFile Term.Log",
|
||||
|
||||
and invokes either one the scripts (test-l, test+l, test-lf)
|
||||
to verify the functionality
|
||||
|
||||
How to run: have two displays, run the program in one pointing to other
|
||||
display. Also, you have to set the PATH to ../util. (i.e
|
||||
TOP/cde1/dtterm/tests/util)
|
||||
|
||||
|
||||
commandline: -o dtterm.object
|
||||
|
||||
|
||||
129
cde/programs/dtterm/tests/Rlogging/Rlogging.c
Normal file
129
cde/programs/dtterm/tests/Rlogging/Rlogging.c
Normal file
@@ -0,0 +1,129 @@
|
||||
/* $XConsortium: Rlogging.c /main/3 1995/10/31 11:52:32 rswiston $ */
|
||||
#include <stdio.h>
|
||||
#include <math.h>
|
||||
#include "synvar.h"
|
||||
#include "common.h"
|
||||
|
||||
#ifdef LOG
|
||||
FILE *TermLog;
|
||||
#define SAVELOG fclose(TermLog); TermLog = fopen("term.log", "a");
|
||||
#endif
|
||||
|
||||
char LogStr[200];
|
||||
|
||||
static char *LogAction[] = {
|
||||
/*0*/ "Testing Resourse Option:logging True",
|
||||
/*1*/ "Testing Resourse Option:logging True but in unwritable directory",
|
||||
/*2*/ "Testing Resourse Option:logging True logFile Term.Log",
|
||||
/*3*/ "Testing Resourse Option:logging False logFile Term.Log",
|
||||
};
|
||||
|
||||
|
||||
static char *ResourceArr[] = {
|
||||
/*0*/ "logging True",
|
||||
/*1*/ "logging True ",
|
||||
/*2*/ "logging True logFile Term.Log",
|
||||
/*3*/ "logging False logFile Term.Log",
|
||||
};
|
||||
|
||||
int MakeResourceFile(ResArr)
|
||||
char *ResArr;
|
||||
{
|
||||
FILE *ResFile;
|
||||
int i, j, Len;
|
||||
char Resource[50], Value[50];
|
||||
|
||||
if ((ResFile = fopen("res", "w")) == NULL)
|
||||
{LogError("Resource File Creation fail"); return(-1);}
|
||||
for (i=0; i < 50; i++) Resource[i] = BLANK;
|
||||
for (i=0; i < 50; i++) Value[i] = BLANK;
|
||||
Len = strlen(ResArr); i=0;
|
||||
while (i < Len) {
|
||||
j = 0;
|
||||
while (ResArr[i] != BLANK) Resource[j++] = ResArr[i++];
|
||||
Resource[j] = NULLCHAR;
|
||||
i++; j = 0;
|
||||
while ((ResArr[i] != BLANK) && (ResArr[i] != NULLCHAR))
|
||||
Value[j++] = ResArr[i++];
|
||||
Value[j] = NULLCHAR;
|
||||
i++;
|
||||
fprintf(ResFile, "%s*%s: %s\n", TERM_EMU, Resource, Value);
|
||||
}
|
||||
fclose(ResFile);
|
||||
}
|
||||
|
||||
|
||||
#define ArrCount (int) (sizeof(ResourceArr) / sizeof(char *))
|
||||
|
||||
main(argc, argv)
|
||||
int argc;
|
||||
char *argv[];
|
||||
{
|
||||
SynStatus Result;
|
||||
char Command[NEED_LEN];
|
||||
int i;
|
||||
|
||||
#ifdef LOG
|
||||
if ((TermLog = fopen("term.log", "a")) == NULL) {
|
||||
if ((TermLog = fopen("term.log", "w")) == NULL)
|
||||
{printf("Logfile could not be opened \n"); exit(-1);}
|
||||
}
|
||||
LogError("****************************************************************************");
|
||||
LogTime();
|
||||
sprintf(Command, "TestName: <%s> STARTS\n", argv[0]);
|
||||
LogError(Command);
|
||||
#endif
|
||||
InitTest(argc, argv);
|
||||
CheckCapsLock();
|
||||
ExecCommand("mkdir tmplog");
|
||||
for (i=0; i < ArrCount; i++) {
|
||||
CheckCapsLock();
|
||||
ExecCommand("xrdb -load xrdb.out");
|
||||
MakeResourceFile(ResourceArr[i]);
|
||||
CheckCapsLock();
|
||||
ExecCommand("xrdb -merge res"); sleep(5);
|
||||
CheckCapsLock();
|
||||
ExecCommand("mv DTtermLog* tmplog"); sleep(1);
|
||||
ExecCommand("mv Term.Log tmplog"); sleep(1);
|
||||
if (i == 1) { /* try in un writable directory */
|
||||
ExecCommand("mkdir unwrite"); sleep(1);
|
||||
ExecCommand("chmod 555 unwrite"); sleep(1);
|
||||
ExecCommand("cd unwrite"); sleep(1);
|
||||
}
|
||||
LogError(LogAction[i]);
|
||||
strcpy(Command, TERM_EMU);
|
||||
CheckCapsLock();
|
||||
ExecCommand(Command); sleep(1);
|
||||
if (WaitWinMap("TermWin") < 0) continue;
|
||||
AssignWinName("TermWin", TERM_EMU);
|
||||
JustExit("TermWin");
|
||||
WaitWinUnMap("TermWin", 10L);
|
||||
switch (i) {
|
||||
case 0:
|
||||
ExecCommand("test-l"); break;
|
||||
case 1:
|
||||
ExecCommand("test+l"); break;
|
||||
case 2:
|
||||
ExecCommand("test-lf"); break;
|
||||
case 3: ExecCommand("test+l"); break;
|
||||
}
|
||||
if (i == 1) {
|
||||
ExecCommand("cd ..");
|
||||
ExecCommand("rmdir unwrite");
|
||||
}
|
||||
sleep(2);
|
||||
}
|
||||
ExecCommand("mv tmplog/DTtermLog* ."); sleep(1);
|
||||
ExecCommand("mv tmplog/Term.Log ."); sleep(1);
|
||||
ExecCommand("rmdir tmplog");
|
||||
CheckCapsLock();
|
||||
ExecCommand("xrdb -load xrdb.out");
|
||||
CloseTest(False);
|
||||
#ifdef LOG
|
||||
sprintf(Command, "TestName: <%s> ENDS\n", argv[0]);
|
||||
LogError(Command);
|
||||
LogError("****************************************************************************");
|
||||
fclose(TermLog);
|
||||
#endif
|
||||
}
|
||||
|
||||
52
cde/programs/dtterm/tests/Rlogin/Imakefile
Normal file
52
cde/programs/dtterm/tests/Rlogin/Imakefile
Normal file
@@ -0,0 +1,52 @@
|
||||
XCOMM $XConsortium: Imakefile /main/8 1996/10/09 14:08:38 drk $
|
||||
PROGRAMS = Rlogin
|
||||
|
||||
INCLUDES = -I. -I$(DTINCLUDESRC)
|
||||
LOCAL_INCLUDES = -I../shared -I$(TOP)/lib/
|
||||
SYS_LIBRARIES = -lm
|
||||
|
||||
|
||||
EXTRA_DEFINES = -DLOG -DSYNLIB
|
||||
|
||||
#if defined(ApolloArchitecture)
|
||||
EXTRA_DEFINES = -Dapollo -D_CMDINV
|
||||
#if defined(SHLIB)
|
||||
LOCAL_LIBRARIES = -A inlib,$(XLIB)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(SunArchitecture)
|
||||
SYS_LIBRARIES = -lm -ldl -lgen -lC
|
||||
SYNLIB=$(TOP)/lib/synlib/libsynlibTst.a
|
||||
XTST=/usr/openwin/lib/libXtst.a
|
||||
#endif
|
||||
|
||||
#if defined(USLArchitecture)
|
||||
SYS_LIBRARIES = -lm -ldl -lgen
|
||||
#endif
|
||||
|
||||
#if defined(UXPArchitecture)
|
||||
SYS_LIBRARIES = -lm -ldl -lgen
|
||||
#endif
|
||||
|
||||
LOCAL_LIBRARIES = ../shared/libtermtest.a $(SYNLIB) $(XTST) $(XEXT) $(XLIB)
|
||||
|
||||
SRCS = Rlogin.c
|
||||
|
||||
OBJS = Rlogin.o
|
||||
|
||||
NormalLibraryObjectRule()
|
||||
ComplexProgramTarget($(PROGRAMS))
|
||||
|
||||
saber_src: $(SRCS)
|
||||
XCOMM setopt load_flags $(CFLAGS)
|
||||
XCOMM load $(SRCS) $(LOCAL_LIBRARIES)
|
||||
|
||||
unsaber_src:
|
||||
XCOMM unload $(SRCS)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
22
cde/programs/dtterm/tests/Rlogin/README
Normal file
22
cde/programs/dtterm/tests/Rlogin/README
Normal file
@@ -0,0 +1,22 @@
|
||||
/* $XConsortium: README /main/2 1996/07/15 14:22:27 drk $ */
|
||||
TestName: Rlogin
|
||||
|
||||
Description: This program tests the functionality of dtterm with
|
||||
following resource options set
|
||||
|
||||
"loginShell True",
|
||||
"loginShell False",
|
||||
"loginShell on",
|
||||
"loginShell off",
|
||||
|
||||
and invokes either one the scripts (test-ls, test+ls)
|
||||
to verify the functionality
|
||||
|
||||
How to run: have two displays, run the program in one pointing to other
|
||||
display. Also, you have to set the PATH to ../util. (i.e
|
||||
TOP/cde1/dtterm/tests/util)
|
||||
|
||||
|
||||
commandline: -o dtterm.object
|
||||
|
||||
|
||||
124
cde/programs/dtterm/tests/Rlogin/Rlogin.c
Normal file
124
cde/programs/dtterm/tests/Rlogin/Rlogin.c
Normal file
@@ -0,0 +1,124 @@
|
||||
/* $XConsortium: Rlogin.c /main/3 1995/10/31 11:52:58 rswiston $ */
|
||||
#include <stdio.h>
|
||||
#include <math.h>
|
||||
#include "synvar.h"
|
||||
#include "common.h"
|
||||
|
||||
#ifdef LOG
|
||||
FILE *TermLog;
|
||||
#define SAVELOG fclose(TermLog); TermLog = fopen("term.log", "a");
|
||||
#endif
|
||||
|
||||
char LogStr[200];
|
||||
|
||||
|
||||
static char *LogAction[] = {
|
||||
/*0*/ "Testing Resource Option: loginShell True",
|
||||
/*1*/ "Testing Resource Option: loginShell False",
|
||||
/*2*/ "Testing Resource Option: loginShell on",
|
||||
/*3*/ "Testing Resource Option: loginShell off",
|
||||
};
|
||||
|
||||
|
||||
static char *ResourceArr[] = {
|
||||
/*0*/ "loginShell True",
|
||||
/*1*/ "loginShell False",
|
||||
/*2*/ "loginShell on",
|
||||
/*2*/ "loginShell off",
|
||||
};
|
||||
|
||||
int MakeResourceFile(ResArr)
|
||||
char *ResArr;
|
||||
{
|
||||
FILE *ResFile;
|
||||
int i, j, Len;
|
||||
char Resource[50], Value[50];
|
||||
|
||||
if ((ResFile = fopen("res", "w")) == NULL)
|
||||
{LogError("Resource File Creation fail"); return(-1);}
|
||||
for (i=0; i < 50; i++) Resource[i] = BLANK;
|
||||
for (i=0; i < 50; i++) Value[i] = BLANK;
|
||||
Len = strlen(ResArr); i=0;
|
||||
while (i < Len) {
|
||||
j = 0;
|
||||
while (ResArr[i] != BLANK) Resource[j++] = ResArr[i++];
|
||||
Resource[j] = NULLCHAR;
|
||||
i++; j = 0;
|
||||
while ((ResArr[i] != BLANK) && (ResArr[i] != NULLCHAR))
|
||||
Value[j++] = ResArr[i++];
|
||||
Value[j] = NULLCHAR;
|
||||
i++;
|
||||
fprintf(ResFile, "%s*%s: %s\n", TERM_EMU, Resource, Value);
|
||||
}
|
||||
fclose(ResFile);
|
||||
}
|
||||
|
||||
|
||||
#define ArrCount (int) (sizeof(ResourceArr) / sizeof(char *))
|
||||
|
||||
main(argc, argv)
|
||||
int argc;
|
||||
char *argv[];
|
||||
{
|
||||
SynStatus Result;
|
||||
char Command[NEED_LEN], *Shell, *Path, *CurDir;
|
||||
int i;
|
||||
|
||||
#ifdef LOG
|
||||
if ((TermLog = fopen("term.log", "a")) == NULL) {
|
||||
if ((TermLog = fopen("term.log", "w")) == NULL)
|
||||
{printf("Logfile could not be opened \n"); exit(-1);}
|
||||
}
|
||||
LogError("****************************************************************************");
|
||||
LogTime();
|
||||
sprintf(Command, "TestName: <%s> STARTS\n", argv[0]);
|
||||
LogError(Command);
|
||||
#endif
|
||||
InitTest(argc, argv);
|
||||
CheckCapsLock();
|
||||
Path = getenv("PATH");
|
||||
CurDir = getenv("PWD");
|
||||
ExecCommand("PATH=.:../bin:../util:/usr/bin/X11:/bin:/opt/dt/bin");
|
||||
for (i=0; i < ArrCount; i++) {
|
||||
CheckCapsLock();
|
||||
ExecCommand("xrdb -load xrdb.out");
|
||||
MakeResourceFile(ResourceArr[i]);
|
||||
CheckCapsLock();
|
||||
LogError(LogAction[i]);
|
||||
strcpy(Command, "xrdb -merge res; ");
|
||||
strcat(Command, TERM_EMU);
|
||||
ExecCommand(Command); sleep(2);
|
||||
if (WaitWinMap("TermWin") < 0) continue;
|
||||
strcpy(Command, CurDir); strcat(Command, "/../util/");
|
||||
switch (i) {
|
||||
case 0:
|
||||
strcat(Command, "test-ls");
|
||||
ExecCommand(Command); break;
|
||||
case 1:
|
||||
strcat(Command, "test+ls");
|
||||
ExecCommand(Command); break;
|
||||
case 2:
|
||||
strcat(Command, "test-ls");
|
||||
ExecCommand(Command); break;
|
||||
case 3:
|
||||
strcat(Command, "test+ls");
|
||||
ExecCommand(Command); break;
|
||||
}
|
||||
CloseTerm("TermWin");
|
||||
WaitWinUnMap("TermWin", 10L);
|
||||
sleep(2);
|
||||
}
|
||||
strcpy(Command, "PATH=");
|
||||
strcat(Command, Path);
|
||||
ExecCommand(Command);
|
||||
CheckCapsLock();
|
||||
ExecCommand("xrdb -load xrdb.out");
|
||||
CloseTest(False);
|
||||
#ifdef LOG
|
||||
sprintf(Command, "TestName: <%s> ENDS\n", argv[0]);
|
||||
LogError(Command);
|
||||
LogError("****************************************************************************");
|
||||
fclose(TermLog);
|
||||
#endif
|
||||
}
|
||||
|
||||
52
cde/programs/dtterm/tests/Rpointer/Imakefile
Normal file
52
cde/programs/dtterm/tests/Rpointer/Imakefile
Normal file
@@ -0,0 +1,52 @@
|
||||
XCOMM $XConsortium: Imakefile /main/8 1996/10/09 14:08:46 drk $
|
||||
PROGRAMS = Rpointer
|
||||
|
||||
INCLUDES = -I. -I$(DTINCLUDESRC)
|
||||
LOCAL_INCLUDES = -I../shared -I$(TOP)/lib/
|
||||
SYS_LIBRARIES = -lm
|
||||
|
||||
|
||||
EXTRA_DEFINES = -DLOG -DSYNLIB
|
||||
|
||||
#if defined(ApolloArchitecture)
|
||||
EXTRA_DEFINES = -Dapollo -D_CMDINV
|
||||
#if defined(SHLIB)
|
||||
LOCAL_LIBRARIES = -A inlib,$(XLIB)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(SunArchitecture)
|
||||
SYS_LIBRARIES = -lm -ldl -lgen -lC
|
||||
SYNLIB=$(TOP)/lib/synlib/libsynlibTst.a
|
||||
XTST=/usr/openwin/lib/libXtst.a
|
||||
#endif
|
||||
|
||||
#if defined(USLArchitecture)
|
||||
SYS_LIBRARIES = -lm -ldl -lgen
|
||||
#endif
|
||||
|
||||
#if defined(UXPArchitecture)
|
||||
SYS_LIBRARIES = -lm -ldl -lgen
|
||||
#endif
|
||||
|
||||
LOCAL_LIBRARIES = ../shared/libtermtest.a $(SYNLIB) $(XTST) $(XEXT) $(XLIB)
|
||||
|
||||
SRCS = Rpointer.c
|
||||
|
||||
OBJS = Rpointer.o
|
||||
|
||||
NormalLibraryObjectRule()
|
||||
ComplexProgramTarget($(PROGRAMS))
|
||||
|
||||
saber_src: $(SRCS)
|
||||
XCOMM setopt load_flags $(CFLAGS)
|
||||
XCOMM load $(SRCS) $(LOCAL_LIBRARIES)
|
||||
|
||||
unsaber_src:
|
||||
XCOMM unload $(SRCS)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
24
cde/programs/dtterm/tests/Rpointer/README
Normal file
24
cde/programs/dtterm/tests/Rpointer/README
Normal file
@@ -0,0 +1,24 @@
|
||||
/* $XConsortium: README /main/2 1996/07/15 14:22:51 drk $ */
|
||||
TestName: Rpointer
|
||||
|
||||
Description: This program tests the functionality of dtterm with
|
||||
following resource options set
|
||||
|
||||
"pointerBlank True pointerBlankDelay 5 pointerColor red
|
||||
pointerColorBackground black pointerShape hand1",
|
||||
"pointerBlank False pointerBlankDelay 5 pointerColor blue
|
||||
pointerColorBackground green pointerShape hand2"
|
||||
|
||||
and recordes or compares the image. the result of the test
|
||||
is logged in file term.log
|
||||
|
||||
How to run: have two displays, run the program in one pointing to other
|
||||
display. Also, you have to set the PATH to ../util. (i.e
|
||||
TOP/cde1/dtterm/tests/util)
|
||||
|
||||
|
||||
commandline: -o dtterm.object
|
||||
-o dtterm.object -r -save (for recording)
|
||||
-o dtterm.object -compare -save (for comparing)
|
||||
|
||||
|
||||
107
cde/programs/dtterm/tests/Rpointer/Rpointer.c
Normal file
107
cde/programs/dtterm/tests/Rpointer/Rpointer.c
Normal file
@@ -0,0 +1,107 @@
|
||||
/* $XConsortium: Rpointer.c /main/3 1995/10/31 11:53:23 rswiston $ */
|
||||
#include <stdio.h>
|
||||
#include <math.h>
|
||||
#include "synvar.h"
|
||||
#include "common.h"
|
||||
|
||||
#ifdef LOG
|
||||
FILE *TermLog;
|
||||
#define SAVELOG fclose(TermLog); TermLog = fopen("term.log", "a");
|
||||
#endif
|
||||
|
||||
char LogStr[200];
|
||||
|
||||
|
||||
#define BLANK ' '
|
||||
|
||||
void TestPointer(WinName, String, TestNum, Delay)
|
||||
char *WinName, *String;
|
||||
int TestNum, Delay;
|
||||
{
|
||||
char Str[IMAGE_FILE_LEN];
|
||||
PrintTermString(WinName, String);
|
||||
sleep(Delay+1);
|
||||
sprintf(Str, "%srpointer%d", IMAGE_DIR, TestNum);
|
||||
MatchWindows(WinName, Str);
|
||||
CloseTerm(WinName);
|
||||
}
|
||||
|
||||
static char *ResourceArr[] = {
|
||||
/*0*/ "pointerBlank True pointerBlankDelay 5 pointerColor red pointerColorBackground black pointerShape hand1",
|
||||
/*1*/ "pointerBlank False pointerBlankDelay 5 pointerColor blue pointerColorBackground greem pointerShape hand2"
|
||||
};
|
||||
|
||||
static char *LogAction[] = {
|
||||
"Testing Resource Option: pointerBlank True pointerBlankDelay 5 pointerColor red pointerColorBackground black pointerShape hand1",
|
||||
"Testing Resource Option: pointerBlank False pointerBlankDelay 5 pointerColor blue pointerColorBackground greem pointerShape hand2"
|
||||
};
|
||||
|
||||
#define ArrCount (int) (sizeof(ResourceArr) / sizeof(char *))
|
||||
|
||||
int MakeResourceFile(ResArr)
|
||||
char *ResArr;
|
||||
{
|
||||
FILE *ResFile;
|
||||
int i, j, Len;
|
||||
char Resource[50], Value[50];
|
||||
|
||||
if ((ResFile = fopen("res", "w")) == NULL)
|
||||
{LogError("Resource File Creation fail"); return(-1);}
|
||||
for (i=0; i < 50; i++) Resource[i] = BLANK;
|
||||
for (i=0; i < 50; i++) Value[i] = BLANK;
|
||||
Len = strlen(ResArr); i=0;
|
||||
while (i < Len) {
|
||||
j = 0;
|
||||
while (ResArr[i] != BLANK) Resource[j++] = ResArr[i++];
|
||||
Resource[j] = NULLCHAR;
|
||||
i++; j = 0;
|
||||
while ((ResArr[i] != BLANK) && (ResArr[i] != NULLCHAR))
|
||||
Value[j++] = ResArr[i++];
|
||||
Value[j] = NULLCHAR;
|
||||
i++;
|
||||
fprintf(ResFile, "%s*%s: %s\n", TERM_EMU, Resource, Value);
|
||||
}
|
||||
fclose(ResFile);
|
||||
}
|
||||
|
||||
main(argc, argv)
|
||||
int argc;
|
||||
char *argv[];
|
||||
{
|
||||
SynStatus Result;
|
||||
char Command[NEED_LEN];
|
||||
int i;
|
||||
|
||||
#ifdef LOG
|
||||
if ((TermLog = fopen("term.log", "a")) == NULL) {
|
||||
if ((TermLog = fopen("term.log", "w")) == NULL)
|
||||
{printf("Logfile could not be opened \n"); exit(-1);}
|
||||
}
|
||||
fprintf(TermLog, "**************************************************\n");
|
||||
LogTime();
|
||||
fprintf(TermLog, "TestName: <%s> STARTS\n", argv[0]);
|
||||
#endif
|
||||
InitTest(argc, argv);
|
||||
for (i=0; i < ArrCount; i++) {
|
||||
CheckCapsLock();
|
||||
ExecCommand("xrdb -load xrdb.out");
|
||||
MakeResourceFile(ResourceArr[i]);
|
||||
CheckCapsLock();
|
||||
LogError(LogAction[i]);
|
||||
if (WaitWinMap("TermWin") < 0) continue;
|
||||
strcpy(Command, "xrdb -merge res; ");
|
||||
strcat(Command, TERM_EMU);
|
||||
ExecCommand(Command);
|
||||
AssignWinName("TermWin", TERM_EMU);
|
||||
TestPointer("TermWin", "Checking Pointer Resources ", i+1, 5);
|
||||
WaitWinUnMap("TermWin", 60L);
|
||||
}
|
||||
CheckCapsLock();
|
||||
ExecCommand("xrdb -load xrdb.out");
|
||||
CloseTest(False);
|
||||
#ifdef LOG
|
||||
fprintf(TermLog, "TestName: <%s> ENDS\n", argv[0]);
|
||||
fclose(TermLog);
|
||||
#endif
|
||||
}
|
||||
|
||||
52
cde/programs/dtterm/tests/Rsavelines/Imakefile
Normal file
52
cde/programs/dtterm/tests/Rsavelines/Imakefile
Normal file
@@ -0,0 +1,52 @@
|
||||
XCOMM $XConsortium: Imakefile /main/8 1996/10/09 14:08:54 drk $
|
||||
PROGRAMS = Rsavelines
|
||||
|
||||
INCLUDES = -I. -I$(DTINCLUDESRC)
|
||||
LOCAL_INCLUDES = -I../shared -I$(TOP)/lib/
|
||||
SYS_LIBRARIES = -lm
|
||||
|
||||
|
||||
EXTRA_DEFINES = -DLOG -DSYNLIB
|
||||
|
||||
#if defined(ApolloArchitecture)
|
||||
EXTRA_DEFINES = -Dapollo -D_CMDINV
|
||||
#if defined(SHLIB)
|
||||
LOCAL_LIBRARIES = -A inlib,$(XLIB)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(SunArchitecture)
|
||||
SYS_LIBRARIES = -lm -ldl -lgen -lC
|
||||
SYNLIB=$(TOP)/lib/synlib/libsynlibTst.a
|
||||
XTST=/usr/openwin/lib/libXtst.a
|
||||
#endif
|
||||
|
||||
#if defined(USLArchitecture)
|
||||
SYS_LIBRARIES = -lm -ldl -lgen
|
||||
#endif
|
||||
|
||||
#if defined(UXPArchitecture)
|
||||
SYS_LIBRARIES = -lm -ldl -lgen
|
||||
#endif
|
||||
|
||||
LOCAL_LIBRARIES = ../shared/libtermtest.a $(SYNLIB) $(XTST) $(XEXT) $(XLIB)
|
||||
|
||||
SRCS = Rsavelines.c
|
||||
|
||||
OBJS = Rsavelines.o
|
||||
|
||||
NormalLibraryObjectRule()
|
||||
ComplexProgramTarget($(PROGRAMS))
|
||||
|
||||
saber_src: $(SRCS)
|
||||
XCOMM setopt load_flags $(CFLAGS)
|
||||
XCOMM load $(SRCS) $(LOCAL_LIBRARIES)
|
||||
|
||||
unsaber_src:
|
||||
XCOMM unload $(SRCS)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
26
cde/programs/dtterm/tests/Rsavelines/README
Normal file
26
cde/programs/dtterm/tests/Rsavelines/README
Normal file
@@ -0,0 +1,26 @@
|
||||
/* $XConsortium: README /main/2 1996/07/15 14:23:16 drk $ */
|
||||
TestName: Rsavelines
|
||||
|
||||
Description: This program tests the functionality of dtterm with
|
||||
following resource options set
|
||||
|
||||
"saveLines 24l",
|
||||
"saveLines 48l",
|
||||
"saveLines 96l",
|
||||
"saveLines 1s",
|
||||
"saveLines 2s",
|
||||
"saveLines 4s"
|
||||
|
||||
and recordes or compares the image. the result of the test
|
||||
is logged in file term.log
|
||||
|
||||
How to run: have two displays, run the program in one pointing to other
|
||||
display. Also, you have to set the PATH to ../util. (i.e
|
||||
TOP/cde1/dtterm/tests/util)
|
||||
|
||||
|
||||
commandline: -o dtterm.object
|
||||
-o dtterm.object -r -save (for recording)
|
||||
-o dtterm.object -compare -save (for comparing)
|
||||
|
||||
|
||||
130
cde/programs/dtterm/tests/Rsavelines/Rsavelines.c
Normal file
130
cde/programs/dtterm/tests/Rsavelines/Rsavelines.c
Normal file
@@ -0,0 +1,130 @@
|
||||
/* $XConsortium: Rsavelines.c /main/3 1995/10/31 11:53:46 rswiston $ */
|
||||
#include <stdio.h>
|
||||
#include <math.h>
|
||||
#include "synvar.h"
|
||||
#include "common.h"
|
||||
|
||||
#ifdef LOG
|
||||
FILE *TermLog;
|
||||
#define SAVELOG fclose(TermLog); TermLog = fopen("term.log", "a");
|
||||
#endif
|
||||
|
||||
char LogStr[200];
|
||||
|
||||
|
||||
void TestSavelines(WinName, TestNum)
|
||||
char *WinName;
|
||||
int TestNum;
|
||||
{
|
||||
char Str[IMAGE_FILE_LEN];
|
||||
int i;
|
||||
ExecWinCommand(WinName, "printlines");
|
||||
sleep(2);
|
||||
for (i=0; i < 4; i++) PressPrevKey(WinName);
|
||||
sleep(2);
|
||||
sprintf(Str, "%srsavelines%d", IMAGE_DIR, TestNum);
|
||||
MatchWindows(WinName, Str);
|
||||
sleep(2);
|
||||
CloseTerm(WinName);
|
||||
}
|
||||
|
||||
static char *OptionArr[] = {
|
||||
/*1*/ " -sl 24l",
|
||||
/*2*/ " -sl 48l",
|
||||
/*3*/ " -sl 96l",
|
||||
/*4*/ " -sl 1s",
|
||||
/*5*/ " -sl 2s",
|
||||
/*6*/ " -sl 4s"
|
||||
};
|
||||
|
||||
static char *LogAction[] = {
|
||||
/*1*/ "Testing Resource Option: saveLines 24l",
|
||||
/*2*/ "Testing Resource Option: saveLines 48l",
|
||||
/*3*/ "Testing Resource Option: saveLines 96l",
|
||||
/*4*/ "Testing Resource Option: saveLines 1s",
|
||||
/*5*/ "Testing Resource Option: saveLines 2s",
|
||||
/*6*/ "Testing Resource Option: saveLines 4s"
|
||||
};
|
||||
|
||||
static char *ResourceArr[] = {
|
||||
/*1*/ "saveLines 24l",
|
||||
/*2*/ "saveLines 48l",
|
||||
/*3*/ "saveLines 96l",
|
||||
/*4*/ "saveLines 1s",
|
||||
/*5*/ "saveLines 2s",
|
||||
/*6*/ "saveLines 4s"
|
||||
};
|
||||
|
||||
int MakeResourceFile(ResArr)
|
||||
char *ResArr;
|
||||
{
|
||||
FILE *ResFile;
|
||||
int i, j, Len;
|
||||
char Resource[50], Value[50];
|
||||
|
||||
if ((ResFile = fopen("res", "w")) == NULL)
|
||||
{LogError("Resource File Creation fail"); return(-1);}
|
||||
for (i=0; i < 50; i++) Resource[i] = BLANK;
|
||||
for (i=0; i < 50; i++) Value[i] = BLANK;
|
||||
Len = strlen(ResArr); i=0;
|
||||
while (i < Len) {
|
||||
j = 0;
|
||||
while (ResArr[i] != BLANK) Resource[j++] = ResArr[i++];
|
||||
Resource[j] = NULLCHAR;
|
||||
i++; j = 0;
|
||||
while ((ResArr[i] != BLANK) && (ResArr[i] != NULLCHAR))
|
||||
Value[j++] = ResArr[i++];
|
||||
Value[j] = NULLCHAR;
|
||||
i++;
|
||||
fprintf(ResFile, "%s*%s: %s\n", TERM_EMU, Resource, Value);
|
||||
}
|
||||
fclose(ResFile);
|
||||
}
|
||||
|
||||
|
||||
#define ArrCount (int) (sizeof(OptionArr) / sizeof(char *))
|
||||
|
||||
main(argc, argv)
|
||||
int argc;
|
||||
char *argv[];
|
||||
{
|
||||
SynStatus Result;
|
||||
char Command[NEED_LEN];
|
||||
int i;
|
||||
|
||||
#ifdef LOG
|
||||
if ((TermLog = fopen("term.log", "a")) == NULL) {
|
||||
if ((TermLog = fopen("term.log", "w")) == NULL)
|
||||
{printf("Logfile could not be opened \n"); exit(-1);}
|
||||
}
|
||||
LogError("****************************************************************************");
|
||||
LogTime();
|
||||
sprintf(Command, "TestName: <%s> STARTS\n", argv[0]);
|
||||
LogError(Command);
|
||||
#endif
|
||||
InitTest(argc, argv);
|
||||
for (i=0; i < ArrCount; i++) {
|
||||
CheckCapsLock();
|
||||
ExecCommand("xrdb -load xrdb.out");
|
||||
MakeResourceFile(ResourceArr[i]);
|
||||
LogError(LogAction[i]);
|
||||
strcpy(Command, "xrdb -merge res; ");
|
||||
strcat(Command, TERM_EMU);
|
||||
CheckCapsLock();
|
||||
ExecCommand(Command);
|
||||
if (WaitWinMap("TermWin") < 0) continue;
|
||||
AssignWinName("TermWin", TERM_EMU);
|
||||
TestSavelines("TermWin", i+1);
|
||||
WaitWinUnMap("TermWin", 60L);
|
||||
}
|
||||
CheckCapsLock();
|
||||
ExecCommand("xrdb -load xrdb.out");
|
||||
CloseTest(False);
|
||||
#ifdef LOG
|
||||
sprintf(Command, "TestName: <%s> ENDS\n", argv[0]);
|
||||
LogError(Command);
|
||||
LogError("****************************************************************************");
|
||||
fclose(TermLog);
|
||||
#endif
|
||||
}
|
||||
|
||||
52
cde/programs/dtterm/tests/Rscrolltitle/Imakefile
Normal file
52
cde/programs/dtterm/tests/Rscrolltitle/Imakefile
Normal file
@@ -0,0 +1,52 @@
|
||||
XCOMM $XConsortium: Imakefile /main/8 1996/10/09 14:09:02 drk $
|
||||
PROGRAMS = Rscrolltitle
|
||||
|
||||
INCLUDES = -I. -I$(DTINCLUDESRC)
|
||||
LOCAL_INCLUDES = -I../shared -I$(TOP)/lib/
|
||||
SYS_LIBRARIES = -lm
|
||||
|
||||
|
||||
EXTRA_DEFINES = -DLOG -DSYNLIB
|
||||
|
||||
#if defined(ApolloArchitecture)
|
||||
EXTRA_DEFINES = -Dapollo -D_CMDINV
|
||||
#if defined(SHLIB)
|
||||
LOCAL_LIBRARIES = -A inlib,$(XLIB)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(SunArchitecture)
|
||||
SYS_LIBRARIES = -lm -ldl -lgen -lC
|
||||
SYNLIB=$(TOP)/lib/synlib/libsynlibTst.a
|
||||
XTST=/usr/openwin/lib/libXtst.a
|
||||
#endif
|
||||
|
||||
#if defined(USLArchitecture)
|
||||
SYS_LIBRARIES = -lm -ldl -lgen
|
||||
#endif
|
||||
|
||||
#if defined(UXPArchitecture)
|
||||
SYS_LIBRARIES = -lm -ldl -lgen
|
||||
#endif
|
||||
|
||||
LOCAL_LIBRARIES = ../shared/libtermtest.a $(SYNLIB) $(XTST) $(XEXT) $(XLIB)
|
||||
|
||||
SRCS = Rscrolltitle.c
|
||||
|
||||
OBJS = Rscrolltitle.o
|
||||
|
||||
NormalLibraryObjectRule()
|
||||
ComplexProgramTarget($(PROGRAMS))
|
||||
|
||||
saber_src: $(SRCS)
|
||||
XCOMM setopt load_flags $(CFLAGS)
|
||||
XCOMM load $(SRCS) $(LOCAL_LIBRARIES)
|
||||
|
||||
unsaber_src:
|
||||
XCOMM unload $(SRCS)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
24
cde/programs/dtterm/tests/Rscrolltitle/README
Normal file
24
cde/programs/dtterm/tests/Rscrolltitle/README
Normal file
@@ -0,0 +1,24 @@
|
||||
/* $XConsortium: README /main/2 1996/07/15 14:23:56 drk $ */
|
||||
TestName: Rscrolltitle
|
||||
|
||||
Description: This program tests the functionality of dtterm with
|
||||
following resource options set
|
||||
|
||||
"scrollBar True title TITLE1",
|
||||
"scrollBar False title title2",
|
||||
"scrollBar on title TITLE3",
|
||||
"scrollBar off title title4"
|
||||
|
||||
and recordes or compares the image. the result of the test
|
||||
is logged in file term.log
|
||||
|
||||
How to run: have two displays, run the program in one pointing to other
|
||||
display. Also, you have to set the PATH to ../util. (i.e
|
||||
TOP/cde1/dtterm/tests/util)
|
||||
|
||||
|
||||
commandline: -o dtterm.object
|
||||
-o dtterm.object -r -save (for recording)
|
||||
-o dtterm.object -compare -save (for comparing)
|
||||
|
||||
|
||||
119
cde/programs/dtterm/tests/Rscrolltitle/Rscrolltitle.c
Normal file
119
cde/programs/dtterm/tests/Rscrolltitle/Rscrolltitle.c
Normal file
@@ -0,0 +1,119 @@
|
||||
/* $XConsortium: Rscrolltitle.c /main/3 1995/10/31 11:54:12 rswiston $ */
|
||||
#include <stdio.h>
|
||||
#include <math.h>
|
||||
#include "synvar.h"
|
||||
#include "common.h"
|
||||
|
||||
#ifdef LOG
|
||||
FILE *TermLog;
|
||||
#define SAVELOG fclose(TermLog); TermLog = fopen("term.log", "a");
|
||||
#endif
|
||||
|
||||
char LogStr[200];
|
||||
|
||||
|
||||
void TestScrollbar(WinName, String, TestNum)
|
||||
char *WinName, *String;
|
||||
int TestNum;
|
||||
{
|
||||
char Str[IMAGE_FILE_LEN];
|
||||
PrintTermString(WinName, String);
|
||||
sprintf(Str, "%srscrolltitle%d", IMAGE_DIR, TestNum);
|
||||
MatchWindows(WinName, Str);
|
||||
CloseTerm(WinName);
|
||||
}
|
||||
|
||||
static char *OptionArr[] = {
|
||||
/*0*/ " -sb -title TITLE1",
|
||||
/*1*/ " +sb -title title2",
|
||||
/*2*/ " -xrm 'dtterm*scrollBar: False' -sb -title TITLE3",
|
||||
/*3*/ " -xrm 'dtterm*scrollBar: True' +sb -title title4"
|
||||
};
|
||||
|
||||
static char *LogAction[] = {
|
||||
/*0*/ "Testing Resource Option: scrollBar True title TITLE1",
|
||||
/*1*/ "Testing Resource Option: scrollBar False title title2",
|
||||
/*2*/ "Testing Resource Option: scrollBar on title TITLE3",
|
||||
/*3*/ "Testing Resource Option: scrollBar off title title4",
|
||||
};
|
||||
|
||||
static char *ResourceArr[] = {
|
||||
/*0*/ "scrollBar True title TITLE1",
|
||||
/*1*/ "scrollBar False title title2",
|
||||
/*2*/ "scrollBar on title TITLE3",
|
||||
/*3*/ "scrollBar off title title4"
|
||||
};
|
||||
|
||||
int MakeResourceFile(ResArr)
|
||||
char *ResArr;
|
||||
{
|
||||
FILE *ResFile;
|
||||
int i, j, Len;
|
||||
char Resource[50], Value[50];
|
||||
|
||||
if ((ResFile = fopen("res", "w")) == NULL)
|
||||
{LogError("Resource File Creation fail"); return(-1);}
|
||||
for (i=0; i < 50; i++) Resource[i] = BLANK;
|
||||
for (i=0; i < 50; i++) Value[i] = BLANK;
|
||||
Len = strlen(ResArr); i=0;
|
||||
while (i < Len) {
|
||||
j = 0;
|
||||
while (ResArr[i] != BLANK) Resource[j++] = ResArr[i++];
|
||||
Resource[j] = NULLCHAR;
|
||||
i++; j = 0;
|
||||
while ((ResArr[i] != BLANK) && (ResArr[i] != NULLCHAR))
|
||||
Value[j++] = ResArr[i++];
|
||||
Value[j] = NULLCHAR;
|
||||
i++;
|
||||
fprintf(ResFile, "%s*%s: %s\n", TERM_EMU, Resource, Value);
|
||||
}
|
||||
fclose(ResFile);
|
||||
}
|
||||
|
||||
|
||||
#define ArrCount (int) (sizeof(OptionArr) / sizeof(char *))
|
||||
|
||||
main(argc, argv)
|
||||
int argc;
|
||||
char *argv[];
|
||||
{
|
||||
SynStatus Result;
|
||||
char Command[NEED_LEN];
|
||||
int i;
|
||||
|
||||
#ifdef LOG
|
||||
if ((TermLog = fopen("term.log", "a")) == NULL) {
|
||||
if ((TermLog = fopen("term.log", "w")) == NULL)
|
||||
{printf("Logfile could not be opened \n"); exit(-1);}
|
||||
}
|
||||
LogError("****************************************************************************");
|
||||
LogTime();
|
||||
sprintf(Command, "TestName: <%s> STARTS\n", argv[0]);
|
||||
LogError(Command);
|
||||
#endif
|
||||
InitTest(argc, argv);
|
||||
for (i=0; i < ArrCount; i++) {
|
||||
CheckCapsLock();
|
||||
ExecCommand("xrdb -load xrdb.out");
|
||||
MakeResourceFile(ResourceArr[i]);
|
||||
LogError(LogAction[i]);
|
||||
strcpy(Command, "xrdb -merge res; ");
|
||||
strcat(Command, TERM_EMU);
|
||||
CheckCapsLock();
|
||||
ExecCommand(Command);
|
||||
if (WaitWinMap("TermWin") < 0) continue;
|
||||
AssignWinName("TermWin", TERM_EMU);
|
||||
TestScrollbar("TermWin", OptionArr[i], i+1);
|
||||
WaitWinUnMap("TermWin", 60L);
|
||||
}
|
||||
CheckCapsLock();
|
||||
ExecCommand("xrdb -load xrdb.out");
|
||||
CloseTest(False);
|
||||
#ifdef LOG
|
||||
sprintf(Command, "TestName: <%s> ENDS\n", argv[0]);
|
||||
LogError(Command);
|
||||
LogError("****************************************************************************");
|
||||
fclose(TermLog);
|
||||
#endif
|
||||
}
|
||||
|
||||
52
cde/programs/dtterm/tests/Rtm/Imakefile
Normal file
52
cde/programs/dtterm/tests/Rtm/Imakefile
Normal file
@@ -0,0 +1,52 @@
|
||||
XCOMM $XConsortium: Imakefile /main/8 1996/10/09 14:09:11 drk $
|
||||
PROGRAMS = Rtm
|
||||
|
||||
INCLUDES = -I. -I$(DTINCLUDESRC)
|
||||
LOCAL_INCLUDES = -I../shared -I$(TOP)/lib/
|
||||
SYS_LIBRARIES = -lm
|
||||
|
||||
|
||||
EXTRA_DEFINES = -DLOG -DSYNLIB
|
||||
|
||||
#if defined(ApolloArchitecture)
|
||||
EXTRA_DEFINES = -Dapollo -D_CMDINV
|
||||
#if defined(SHLIB)
|
||||
LOCAL_LIBRARIES = -A inlib,$(XLIB)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(SunArchitecture)
|
||||
SYS_LIBRARIES = -lm -ldl -lgen -lC
|
||||
SYNLIB=$(TOP)/lib/synlib/libsynlibTst.a
|
||||
XTST=/usr/openwin/lib/libXtst.a
|
||||
#endif
|
||||
|
||||
#if defined(USLArchitecture)
|
||||
SYS_LIBRARIES = -lm -ldl -lgen
|
||||
#endif
|
||||
|
||||
#if defined(UXPArchitecture)
|
||||
SYS_LIBRARIES = -lm -ldl -lgen
|
||||
#endif
|
||||
|
||||
LOCAL_LIBRARIES = ../shared/libtermtest.a $(SYNLIB) $(XTST) $(XEXT) $(XLIB)
|
||||
|
||||
SRCS = Rtm.c
|
||||
|
||||
OBJS = Rtm.o
|
||||
|
||||
NormalLibraryObjectRule()
|
||||
ComplexProgramTarget($(PROGRAMS))
|
||||
|
||||
saber_src: $(SRCS)
|
||||
XCOMM setopt load_flags $(CFLAGS)
|
||||
XCOMM load $(SRCS) $(LOCAL_LIBRARIES)
|
||||
|
||||
unsaber_src:
|
||||
XCOMM unload $(SRCS)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
20
cde/programs/dtterm/tests/Rtm/README
Normal file
20
cde/programs/dtterm/tests/Rtm/README
Normal file
@@ -0,0 +1,20 @@
|
||||
/* $XConsortium: README /main/2 1996/07/15 14:24:24 drk $ */
|
||||
TestName: Rtm
|
||||
|
||||
Description: This program tests the functionality of dtterm with
|
||||
following resource options set
|
||||
|
||||
ttyModes: intr ! quit @ erase # kill $ eof % eol ^ swtch & start *
|
||||
stop ( susp ) dsusp _
|
||||
|
||||
and invokes a program termget to verify the functionality
|
||||
and logs whatever is not set.
|
||||
|
||||
How to run: have two displays, run the program in one pointing to other
|
||||
display. Also, you have to set the PATH to ../util. (i.e
|
||||
TOP/cde1/dtterm/tests/util)
|
||||
|
||||
|
||||
commandline: -o dtterm.object
|
||||
|
||||
|
||||
88
cde/programs/dtterm/tests/Rtm/Rtm.c
Normal file
88
cde/programs/dtterm/tests/Rtm/Rtm.c
Normal file
@@ -0,0 +1,88 @@
|
||||
/* $XConsortium: Rtm.c /main/3 1995/10/31 11:54:45 rswiston $ */
|
||||
#include <stdio.h>
|
||||
#include <math.h>
|
||||
#include "synvar.h"
|
||||
|
||||
#ifdef LOG
|
||||
FILE *TermLog;
|
||||
#define SAVELOG fclose(TermLog); TermLog = fopen("term.log", "a");
|
||||
#endif
|
||||
|
||||
char LogStr[200];
|
||||
|
||||
|
||||
|
||||
static char *OptionArr[] = {
|
||||
/*0*/ " -tm 'intr ! quit @ erase # kill $ eof % eol ^ swtch & start * stop ( susp ) dsusp _'" /* Normal option */
|
||||
};
|
||||
|
||||
|
||||
static char *LogAction[] = {
|
||||
/*0*/ "Testing Resource Option -tm "
|
||||
};
|
||||
|
||||
static char *ResourceArr[] = {
|
||||
"intr ! quit @ erase # kill $ eof % eol ^ swtch & start * stop ( susp ) dsusp _"
|
||||
};
|
||||
|
||||
int MakeResourceFile(ResArr)
|
||||
char *ResArr;
|
||||
{
|
||||
FILE *ResFile;
|
||||
int i, j, Len;
|
||||
char Resource[50], Value[50];
|
||||
|
||||
if ((ResFile = fopen("res", "w")) == NULL)
|
||||
{LogError("Resource File Creation fail"); return(-1);}
|
||||
fprintf(ResFile, "%s*%s: %s\n", TERM_EMU, "ttyModes", ResourceArr[0]);
|
||||
fclose(ResFile);
|
||||
}
|
||||
|
||||
|
||||
#define ArrCount (int) (sizeof(ResourceArr) / sizeof(char *))
|
||||
|
||||
main(argc, argv)
|
||||
int argc;
|
||||
char *argv[];
|
||||
{
|
||||
SynStatus Result;
|
||||
char Command[NEED_LEN], *Shell, *Path;
|
||||
int i;
|
||||
|
||||
#ifdef LOG
|
||||
if ((TermLog = fopen("term.log", "a")) == NULL) {
|
||||
if ((TermLog = fopen("term.log", "w")) == NULL)
|
||||
{printf("Logfile could not be opened \n"); exit(-1);}
|
||||
}
|
||||
LogError("****************************************************************************");
|
||||
LogTime();
|
||||
sprintf(Command, "TestName: <%s> STARTS\n", argv[0]);
|
||||
LogError(Command);
|
||||
#endif
|
||||
InitTest(argc, argv);
|
||||
for (i=0; i < ArrCount; i++) {
|
||||
CheckCapsLock();
|
||||
ExecCommand("xrdb -load xrdb.out");
|
||||
MakeResourceFile(ResourceArr[i]);
|
||||
LogError(LogAction[i]);
|
||||
strcpy(Command, "xrdb -merge res; ");
|
||||
strcat(Command, TERM_EMU);
|
||||
CheckCapsLock();
|
||||
ExecCommand(Command); sleep(2);
|
||||
if (WaitWinMap("TermWin") < 0) continue;
|
||||
ExecCommand("termget");
|
||||
CloseTerm("TermWin");
|
||||
WaitWinUnMap("TermWin", 10L);
|
||||
sleep(2);
|
||||
}
|
||||
CheckCapsLock();
|
||||
ExecCommand("xrdb -load xrdb.out");
|
||||
CloseTest(False);
|
||||
#ifdef LOG
|
||||
sprintf(Command, "TestName: <%s> ENDS\n", argv[0]);
|
||||
LogError(Command);
|
||||
LogError("****************************************************************************");
|
||||
fclose(TermLog);
|
||||
#endif
|
||||
}
|
||||
|
||||
52
cde/programs/dtterm/tests/Rvisualbell/Imakefile
Normal file
52
cde/programs/dtterm/tests/Rvisualbell/Imakefile
Normal file
@@ -0,0 +1,52 @@
|
||||
XCOMM $XConsortium: Imakefile /main/8 1996/10/09 14:09:19 drk $
|
||||
PROGRAMS = Rvisualbell
|
||||
|
||||
INCLUDES = -I. -I$(DTINCLUDESRC)
|
||||
LOCAL_INCLUDES = -I../shared -I$(TOP)/lib/
|
||||
SYS_LIBRARIES = -lm
|
||||
|
||||
|
||||
EXTRA_DEFINES = -DLOG -DSYNLIB
|
||||
|
||||
#if defined(ApolloArchitecture)
|
||||
EXTRA_DEFINES = -Dapollo -D_CMDINV
|
||||
#if defined(SHLIB)
|
||||
LOCAL_LIBRARIES = -A inlib,$(XLIB)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(SunArchitecture)
|
||||
SYS_LIBRARIES = -lm -ldl -lgen -lC
|
||||
SYNLIB=$(TOP)/lib/synlib/libsynlibTst.a
|
||||
XTST=/usr/openwin/lib/libXtst.a
|
||||
#endif
|
||||
|
||||
#if defined(USLArchitecture)
|
||||
SYS_LIBRARIES = -lm -ldl -lgen
|
||||
#endif
|
||||
|
||||
#if defined(UXPArchitecture)
|
||||
SYS_LIBRARIES = -lm -ldl -lgen
|
||||
#endif
|
||||
|
||||
LOCAL_LIBRARIES = ../shared/libtermtest.a $(SYNLIB) $(XTST) $(XEXT) $(XLIB)
|
||||
|
||||
SRCS = Rvisualbell.c
|
||||
|
||||
OBJS = Rvisualbell.o
|
||||
|
||||
NormalLibraryObjectRule()
|
||||
ComplexProgramTarget($(PROGRAMS))
|
||||
|
||||
saber_src: $(SRCS)
|
||||
XCOMM setopt load_flags $(CFLAGS)
|
||||
XCOMM load $(SRCS) $(LOCAL_LIBRARIES)
|
||||
|
||||
unsaber_src:
|
||||
XCOMM unload $(SRCS)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
20
cde/programs/dtterm/tests/Rvisualbell/README
Normal file
20
cde/programs/dtterm/tests/Rvisualbell/README
Normal file
@@ -0,0 +1,20 @@
|
||||
/* $XConsortium: README /main/2 1996/07/15 14:24:53 drk $ */
|
||||
TestName: Rvisualbell
|
||||
|
||||
Description: This program tests the functionality of dtterm with
|
||||
|
||||
"visualBell True",
|
||||
"visualBell False ",
|
||||
"visualBell on ",
|
||||
"visualBell off "
|
||||
|
||||
this has to be verified mannually
|
||||
|
||||
How to run: have two displays, run the program in one pointing to other
|
||||
display. Also, you have to set the PATH to ../util. (i.e
|
||||
TOP/cde1/dtterm/tests/util)
|
||||
|
||||
|
||||
commandline: -o dtterm.object
|
||||
|
||||
|
||||
124
cde/programs/dtterm/tests/Rvisualbell/Rvisualbell.c
Normal file
124
cde/programs/dtterm/tests/Rvisualbell/Rvisualbell.c
Normal file
@@ -0,0 +1,124 @@
|
||||
/* $XConsortium: Rvisualbell.c /main/3 1995/10/31 11:55:11 rswiston $ */
|
||||
#include <stdio.h>
|
||||
#include <math.h>
|
||||
#include "synvar.h"
|
||||
#include "common.h"
|
||||
|
||||
#ifdef LOG
|
||||
FILE *TermLog;
|
||||
#define SAVELOG fclose(TermLog); TermLog = fopen("term.log", "a");
|
||||
#endif
|
||||
|
||||
char LogStr[200];
|
||||
|
||||
|
||||
void TestVisualbell(WinName, TestNum)
|
||||
char *WinName;
|
||||
int TestNum;
|
||||
{
|
||||
char Str[IMAGE_FILE_LEN];
|
||||
int i;
|
||||
for (i=0; i < 4; i++)
|
||||
PressCtrlGKey(WinName);
|
||||
if ((TestNum % 2) == 0)
|
||||
PrintTermString(WinName, "You should have heard beep");
|
||||
else
|
||||
PrintTermString(WinName, "You should have seen screen flashing");
|
||||
sleep(5);
|
||||
CloseTerm(WinName);
|
||||
}
|
||||
|
||||
static char *OptionArr[] = {
|
||||
/*0*/ " -vb ",
|
||||
/*1*/ " -xrm 'visualBell: False' -vb",
|
||||
/*2*/ " +vb ",
|
||||
/*3*/ " -xrm 'visualBell: True' +vb"
|
||||
};
|
||||
|
||||
static char *LogAction[] = {
|
||||
/*0*/ " Testing Option: -vb ",
|
||||
/*1*/ " Testing Option: -xrm 'visualBell: False' -vb",
|
||||
/*2*/ " Testing Option: +vb ",
|
||||
/*3*/ " Testing Option: -xrm 'visualBell: True' +vb"
|
||||
};
|
||||
|
||||
static char *ResourceArr[] = {
|
||||
/*0*/ "visualBell True",
|
||||
/*1*/ "visualBell False ",
|
||||
/*2*/ "visualBell on ",
|
||||
/*3*/ "visualBell off "
|
||||
};
|
||||
|
||||
int MakeResourceFile(ResArr)
|
||||
char *ResArr;
|
||||
{
|
||||
FILE *ResFile;
|
||||
int i, j, Len;
|
||||
char Resource[50], Value[50];
|
||||
|
||||
if ((ResFile = fopen("res", "w")) == NULL)
|
||||
{LogError("Resource File Creation fail"); return(-1);}
|
||||
for (i=0; i < 50; i++) Resource[i] = BLANK;
|
||||
for (i=0; i < 50; i++) Value[i] = BLANK;
|
||||
Len = strlen(ResArr); i=0;
|
||||
while (i < Len) {
|
||||
j = 0;
|
||||
while (ResArr[i] != BLANK) Resource[j++] = ResArr[i++];
|
||||
Resource[j] = NULLCHAR;
|
||||
i++; j = 0;
|
||||
while ((ResArr[i] != BLANK) && (ResArr[i] != NULLCHAR))
|
||||
Value[j++] = ResArr[i++];
|
||||
Value[j] = NULLCHAR;
|
||||
i++;
|
||||
fprintf(ResFile, "%s*%s: %s\n", TERM_EMU, Resource, Value);
|
||||
}
|
||||
fclose(ResFile);
|
||||
}
|
||||
|
||||
|
||||
#define ArrCount (int) (sizeof(ResourceArr) / sizeof(char *))
|
||||
|
||||
main(argc, argv)
|
||||
int argc;
|
||||
char *argv[];
|
||||
{
|
||||
SynStatus Result;
|
||||
char Command[NEED_LEN];
|
||||
int i;
|
||||
|
||||
#ifdef LOG
|
||||
if ((TermLog = fopen("term.log", "a")) == NULL) {
|
||||
if ((TermLog = fopen("term.log", "w")) == NULL)
|
||||
{printf("Logfile could not be opened \n"); exit(-1);}
|
||||
}
|
||||
LogError("****************************************************************************");
|
||||
LogTime();
|
||||
sprintf(Command, "TestName: <%s> STARTS\n", argv[0]);
|
||||
LogError(Command);
|
||||
#endif
|
||||
InitTest(argc, argv);
|
||||
for (i=0; i < ArrCount; i++) {
|
||||
CheckCapsLock();
|
||||
ExecCommand("xrdb -load xrdb.out");
|
||||
MakeResourceFile(ResourceArr[i]);
|
||||
LogError(LogAction[i]);
|
||||
strcpy(Command, "xrdb -merge res; ");
|
||||
strcat(Command, TERM_EMU);
|
||||
CheckCapsLock();
|
||||
ExecCommand(Command);
|
||||
if (WaitWinMap("TermWin") < 0) continue;
|
||||
AssignWinName("TermWin", TERM_EMU);
|
||||
TestVisualbell("TermWin", i+1);
|
||||
WaitWinUnMap("TermWin", 60L);
|
||||
}
|
||||
CheckCapsLock();
|
||||
ExecCommand("xrdb -load xrdb.out");
|
||||
CloseTest(False);
|
||||
#ifdef LOG
|
||||
sprintf(Command, "TestName: <%s> ENDS\n", argv[0]);
|
||||
LogError(Command);
|
||||
LogError("****************************************************************************");
|
||||
fclose(TermLog);
|
||||
#endif
|
||||
}
|
||||
|
||||
52
cde/programs/dtterm/tests/Rwrap/Imakefile
Normal file
52
cde/programs/dtterm/tests/Rwrap/Imakefile
Normal file
@@ -0,0 +1,52 @@
|
||||
XCOMM $XConsortium: Imakefile /main/8 1996/10/09 14:09:28 drk $
|
||||
PROGRAMS = Rwrap
|
||||
|
||||
INCLUDES = -I. -I$(DTINCLUDESRC)
|
||||
LOCAL_INCLUDES = -I../shared -I$(TOP)/lib/
|
||||
SYS_LIBRARIES = -lm
|
||||
|
||||
|
||||
EXTRA_DEFINES = -DLOG -DSYNLIB
|
||||
|
||||
#if defined(ApolloArchitecture)
|
||||
EXTRA_DEFINES = -Dapollo -D_CMDINV
|
||||
#if defined(SHLIB)
|
||||
LOCAL_LIBRARIES = -A inlib,$(XLIB)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(SunArchitecture)
|
||||
SYS_LIBRARIES = -lm -ldl -lgen -lC
|
||||
SYNLIB=$(TOP)/lib/synlib/libsynlibTst.a
|
||||
XTST=/usr/openwin/lib/libXtst.a
|
||||
#endif
|
||||
|
||||
#if defined(USLArchitecture)
|
||||
SYS_LIBRARIES = -lm -ldl -lgen
|
||||
#endif
|
||||
|
||||
#if defined(UXPArchitecture)
|
||||
SYS_LIBRARIES = -lm -ldl -lgen
|
||||
#endif
|
||||
|
||||
LOCAL_LIBRARIES = ../shared/libtermtest.a $(SYNLIB) $(XTST) $(XEXT) $(XLIB)
|
||||
|
||||
SRCS = Rwrap.c
|
||||
|
||||
OBJS = Rwrap.o
|
||||
|
||||
NormalLibraryObjectRule()
|
||||
ComplexProgramTarget($(PROGRAMS))
|
||||
|
||||
saber_src: $(SRCS)
|
||||
XCOMM setopt load_flags $(CFLAGS)
|
||||
XCOMM load $(SRCS) $(LOCAL_LIBRARIES)
|
||||
|
||||
unsaber_src:
|
||||
XCOMM unload $(SRCS)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
23
cde/programs/dtterm/tests/Rwrap/README
Normal file
23
cde/programs/dtterm/tests/Rwrap/README
Normal file
@@ -0,0 +1,23 @@
|
||||
/* $XConsortium: README /main/2 1996/07/15 14:25:23 drk $ */
|
||||
TestName: Rwrap
|
||||
|
||||
Description: This program tests the functionality of dtterm with
|
||||
following resource options set
|
||||
|
||||
"autoWrap True reverseWrap True ",
|
||||
"autoWrap False reverseWrap False ",
|
||||
"autoWrap True reverseWrap False "
|
||||
|
||||
and recordes or compares the image. the result of the test
|
||||
is logged in file term.log
|
||||
|
||||
How to run: have two displays, run the program in one pointing to other
|
||||
display. Also, you have to set the PATH to ../util. (i.e
|
||||
TOP/cde1/dtterm/tests/util)
|
||||
|
||||
|
||||
commandline: -o dtterm.object
|
||||
-o dtterm.object -r -save (for recording)
|
||||
-o dtterm.object -compare -save (for comparing)
|
||||
|
||||
|
||||
111
cde/programs/dtterm/tests/Rwrap/Rwrap.c
Normal file
111
cde/programs/dtterm/tests/Rwrap/Rwrap.c
Normal file
@@ -0,0 +1,111 @@
|
||||
/* $XConsortium: Rwrap.c /main/3 1995/10/31 11:55:31 rswiston $ */
|
||||
#include <stdio.h>
|
||||
#include <math.h>
|
||||
#include "synvar.h"
|
||||
#include "common.h"
|
||||
|
||||
#ifdef LOG
|
||||
FILE *TermLog;
|
||||
#define SAVELOG fclose(TermLog); TermLog = fopen("term.log", "a");
|
||||
#endif
|
||||
|
||||
char LogStr[200];
|
||||
|
||||
|
||||
#define BLANK ' '
|
||||
|
||||
void TestWrap(WinName, String, TestNum)
|
||||
char *WinName, *String;
|
||||
int TestNum;
|
||||
{
|
||||
char Str[IMAGE_FILE_LEN];
|
||||
int i;
|
||||
PressKeyNtimes(WinName, "C", 100);
|
||||
for (i=0; i < 75; i++)
|
||||
PressBackSpace(WinName);
|
||||
sprintf(Str, "%srwrap%d", IMAGE_DIR, TestNum);
|
||||
MatchWindows(WinName, Str);
|
||||
CloseTerm(WinName);
|
||||
}
|
||||
|
||||
static char *ResourceArr[] = {
|
||||
/*0*/ "autoWrap True reverseWrap True ",
|
||||
/*1*/ "autoWrap False reverseWrap False ",
|
||||
/*2*/ "autoWrap True reverseWrap False "
|
||||
};
|
||||
|
||||
static char *LogAction[] = {
|
||||
"Testing Resource Option: autoWrap True reverseWrap True ",
|
||||
"Testing Resource Option:autoWrap False reverseWrap False ",
|
||||
"Testing Resource Option:autoWrap True reverseWrap False "
|
||||
};
|
||||
|
||||
#define ArrCount (int) (sizeof(ResourceArr) / sizeof(char *))
|
||||
|
||||
int MakeResourceFile(ResArr)
|
||||
char *ResArr;
|
||||
{
|
||||
FILE *ResFile;
|
||||
int i, j, Len;
|
||||
char Resource[50], Value[50];
|
||||
|
||||
if ((ResFile = fopen("res", "w")) == NULL)
|
||||
{LogError("Resource File Creation fail"); return(-1);}
|
||||
for (i=0; i < 50; i++) Resource[i] = BLANK;
|
||||
for (i=0; i < 50; i++) Value[i] = BLANK;
|
||||
Len = strlen(ResArr); i=0;
|
||||
while (i < Len) {
|
||||
j = 0;
|
||||
while (ResArr[i] != BLANK) Resource[j++] = ResArr[i++];
|
||||
Resource[j] = NULLCHAR;
|
||||
i++; j = 0;
|
||||
while ((ResArr[i] != BLANK) && (ResArr[i] != NULLCHAR))
|
||||
Value[j++] = ResArr[i++];
|
||||
Value[j] = NULLCHAR;
|
||||
i++;
|
||||
fprintf(ResFile, "%s*%s: %s\n", TERM_EMU, Resource, Value);
|
||||
}
|
||||
fclose(ResFile);
|
||||
}
|
||||
|
||||
main(argc, argv)
|
||||
int argc;
|
||||
char *argv[];
|
||||
{
|
||||
SynStatus Result;
|
||||
char Command[NEED_LEN];
|
||||
int i;
|
||||
|
||||
#ifdef LOG
|
||||
if ((TermLog = fopen("term.log", "a")) == NULL) {
|
||||
if ((TermLog = fopen("term.log", "w")) == NULL)
|
||||
{printf("Logfile could not be opened \n"); exit(-1);}
|
||||
}
|
||||
fprintf(TermLog, "**************************************************\n");
|
||||
LogTime();
|
||||
fprintf(TermLog, "TestName: <%s> STARTS\n", argv[0]);
|
||||
#endif
|
||||
InitTest(argc, argv);
|
||||
for (i=0; i < ArrCount; i++) {
|
||||
CheckCapsLock();
|
||||
ExecCommand("xrdb -load xrdb.out");
|
||||
MakeResourceFile(ResourceArr[i]);
|
||||
LogError(LogAction[i]);
|
||||
strcpy(Command, "xrdb -merge res; ");
|
||||
strcat(Command, TERM_EMU);
|
||||
CheckCapsLock();
|
||||
ExecCommand(Command);
|
||||
if (WaitWinMap("TermWin") < 0) continue;
|
||||
AssignWinName("TermWin", TERM_EMU);
|
||||
TestWrap("TermWin", "Checking Pointer Resources ", i+1);
|
||||
WaitWinUnMap("TermWin", 60L);
|
||||
}
|
||||
CheckCapsLock();
|
||||
ExecCommand("xrdb -load xrdb.out");
|
||||
CloseTest(False);
|
||||
#ifdef LOG
|
||||
fprintf(TermLog, "TestName: <%s> ENDS\n", argv[0]);
|
||||
fclose(TermLog);
|
||||
#endif
|
||||
}
|
||||
|
||||
51
cde/programs/dtterm/tests/charatt/Imakefile
Normal file
51
cde/programs/dtterm/tests/charatt/Imakefile
Normal file
@@ -0,0 +1,51 @@
|
||||
XCOMM $XConsortium: Imakefile /main/8 1996/10/09 14:09:37 drk $
|
||||
PROGRAMS = charatt
|
||||
|
||||
INCLUDES = -I. -I$(DTINCLUDESRC)
|
||||
LOCAL_INCLUDES = -I../shared -I$(TOP)/lib/
|
||||
SYS_LIBRARIES = -lm
|
||||
|
||||
EXTRA_DEFINES = -DLOG -DSYNLIB
|
||||
|
||||
#if defined(ApolloArchitecture)
|
||||
EXTRA_DEFINES = -Dapollo -D_CMDINV
|
||||
#if defined(SHLIB)
|
||||
LOCAL_LIBRARIES = -A inlib,$(XLIB)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(SunArchitecture)
|
||||
SYS_LIBRARIES = -lm -ldl -lgen -lC
|
||||
SYNLIB=$(TOP)/lib/synlib/libsynlibTst.a
|
||||
XTST=/usr/openwin/lib/libXtst.a
|
||||
#endif
|
||||
|
||||
#if defined(USLArchitecture)
|
||||
SYS_LIBRARIES = -lm -ldl -lgen
|
||||
#endif
|
||||
|
||||
#if defined(UXPArchitecture)
|
||||
SYS_LIBRARIES = -lm -ldl -lgen
|
||||
#endif
|
||||
|
||||
LOCAL_LIBRARIES = ../shared/libtermtest.a $(SYNLIB) $(XTST) $(XEXT) $(XLIB)
|
||||
|
||||
SRCS = charatt.c
|
||||
|
||||
OBJS = charatt.o
|
||||
|
||||
NormalLibraryObjectRule()
|
||||
ComplexProgramTarget($(PROGRAMS))
|
||||
|
||||
saber_src: $(SRCS)
|
||||
XCOMM setopt load_flags $(CFLAGS)
|
||||
XCOMM load $(SRCS) $(LOCAL_LIBRARIES)
|
||||
|
||||
unsaber_src:
|
||||
XCOMM unload $(SRCS)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
25
cde/programs/dtterm/tests/charatt/README
Normal file
25
cde/programs/dtterm/tests/charatt/README
Normal file
@@ -0,0 +1,25 @@
|
||||
/* $XConsortium: README /main/2 1996/07/15 14:25:49 drk $ */
|
||||
TestName: charatt
|
||||
|
||||
Description: This program tests the character attibutes functionality of dtterm.
|
||||
The following escape sequences are tested
|
||||
|
||||
"\033[0m"
|
||||
"\033[1m"
|
||||
"\033[4m"
|
||||
"\033[5m"
|
||||
"\033[7m"
|
||||
"\0337"
|
||||
"\0338"
|
||||
|
||||
and recordes or compares the image. the result of the test
|
||||
is logged in file term.log
|
||||
|
||||
How to run: invoke dtterm and run the program with any of the following
|
||||
option
|
||||
|
||||
commandline: -o dtterm.object
|
||||
-o dtterm.object -r -save (for recording)
|
||||
-o dtterm.object -compare -save (for comparing)
|
||||
|
||||
|
||||
150
cde/programs/dtterm/tests/charatt/charatt.c
Normal file
150
cde/programs/dtterm/tests/charatt/charatt.c
Normal file
@@ -0,0 +1,150 @@
|
||||
/* $XConsortium: charatt.c /main/3 1995/10/31 11:55:53 rswiston $ */
|
||||
#include <stdio.h>
|
||||
#include "synvar.h"
|
||||
#include "common.h"
|
||||
|
||||
#ifdef LOG
|
||||
FILE *TermLog;
|
||||
#define SAVELOG fclose(TermLog); TermLog = fopen("term.log", "a");
|
||||
#endif
|
||||
|
||||
char LogStr[200];
|
||||
|
||||
#define Normal 0
|
||||
#define Bold 1
|
||||
#define Underscore 2
|
||||
#define Inverse 3
|
||||
#define Blink 4
|
||||
|
||||
static char *DispAttArr[] = {"Normal","Bold", "Underscore", "Inverse", "Blink"};
|
||||
|
||||
static SetDispAttr(WhichAttr, NewLine, BlinkOn)
|
||||
int WhichAttr;
|
||||
Bool NewLine, BlinkOn;
|
||||
{
|
||||
switch (WhichAttr) {
|
||||
case Normal:
|
||||
SetDispNormal(); break;
|
||||
case Bold:
|
||||
SetDispBold(); break;
|
||||
case Underscore:
|
||||
SetDispUnderscore(); break;
|
||||
case Inverse:
|
||||
SetDispInverse(); break;
|
||||
}
|
||||
if (BlinkOn == True) SetDispBlink();
|
||||
WRITETEST(DispAttArr[WhichAttr]);
|
||||
if (NewLine == True) {
|
||||
NextLine();
|
||||
SetDispNormal();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void TestDispAtt(WinName)
|
||||
char *WinName;
|
||||
{
|
||||
int i, j, k, Lines, Cols;
|
||||
char Str[IMAGE_FILE_LEN];
|
||||
Bool BlinkOn;
|
||||
|
||||
ClearScreen();
|
||||
for (i=0; i < 2; i++) {
|
||||
if (i == 1) BlinkOn = True;
|
||||
else BlinkOn = False;
|
||||
SetDispAttr(Normal, True, BlinkOn);
|
||||
SetDispAttr(Bold, True, BlinkOn);
|
||||
SetDispAttr(Underscore, True, BlinkOn);
|
||||
SetDispAttr(Inverse, True, BlinkOn);
|
||||
SetDispAttr(Bold, False, BlinkOn);
|
||||
SetDispAttr(Underscore, True, BlinkOn);
|
||||
SetDispAttr(Bold, False, BlinkOn);
|
||||
SetDispAttr(Inverse, True, BlinkOn);
|
||||
SetDispAttr(Bold, False, BlinkOn);
|
||||
SetDispAttr(Underscore, False, BlinkOn);
|
||||
SetDispAttr(Inverse, True, BlinkOn);
|
||||
SetDispAttr(Underscore, False, BlinkOn);
|
||||
SetDispAttr(Inverse, True, BlinkOn);
|
||||
}
|
||||
#ifdef SYNLIB
|
||||
sprintf(Str, "%scharatt1", IMAGE_DIR);
|
||||
MatchWindows(WinName, Str);
|
||||
#endif
|
||||
SetDispNormal();
|
||||
FLUSHTEST();
|
||||
}
|
||||
|
||||
void TestCursor(WinName)
|
||||
char *WinName;
|
||||
{
|
||||
char Str[IMAGE_FILE_LEN];
|
||||
SetScrollRegn(5, 15);
|
||||
SetDispBold();
|
||||
SetDispInverse();
|
||||
SetDispUnderscore();
|
||||
SetOriginMode(DECModeSet); /* To Origin Mode */
|
||||
SetWrapMode(DECModeSet);
|
||||
AbsoluteGoToXY(46, 14);
|
||||
SaveCursor();
|
||||
SetDispNormal();
|
||||
SetOriginMode(DECModeReset);
|
||||
SetWrapMode(DECModeReset);
|
||||
ClearScreen();
|
||||
WRITETEST("Now In Normal Char Att; Cursor Mode; in Line 1; with no wrap and on restoring cursor");
|
||||
NextLine();
|
||||
WRITETEST("You did not see full line because of no wrap;On Restoring Cursor");
|
||||
RestoreCursor();
|
||||
WRITETEST("I Should start at (46,14) with char attribute Bold Inverse Underline, Origin mode set, scrolling region is 5,15 with wrap mode on");
|
||||
#ifdef SYNLIB
|
||||
sprintf(Str, "%scharatt2", IMAGE_DIR);
|
||||
MatchWindows(WinName, Str);
|
||||
#endif
|
||||
}
|
||||
|
||||
void ResetTerm(Cols)
|
||||
int Cols;
|
||||
{
|
||||
SetDispNormal();
|
||||
SetOriginMode(DECModeReset);
|
||||
SetScrollRegn(1, Cols);
|
||||
}
|
||||
|
||||
main(argc, argv)
|
||||
int argc;
|
||||
char *argv[];
|
||||
{
|
||||
|
||||
int NumLines, NumCols;
|
||||
#ifdef LOG
|
||||
if ((TermLog = fopen("term.log", "a")) == NULL) {
|
||||
if ((TermLog = fopen("term.log", "w")) == NULL)
|
||||
{printf("Logfile could not be opened \n"); exit(-1);}
|
||||
}
|
||||
fprintf(TermLog, "**************************************************\n");
|
||||
LogTime();
|
||||
fprintf(TermLog, "TestName: <%s> STARTS\n", argv[0]);
|
||||
#endif
|
||||
START(1,0,0,0,0);
|
||||
if (CheckTermStatus() == -1)
|
||||
{printf("terminal emulator malfunctioning\n"); DONE(); return;}
|
||||
GetWinSize(&NumLines, &NumCols);
|
||||
#ifdef SYNLIB
|
||||
InitTest(argc, argv);
|
||||
AssignWinName("TermWin", TERM_EMU);
|
||||
#endif
|
||||
TestDispAtt("TermWin");
|
||||
#ifdef SLOW
|
||||
sleep(10);
|
||||
#endif
|
||||
TestCursor("TermWin");
|
||||
ResetTerm(NumCols);
|
||||
#ifdef SYNLIB
|
||||
CloseTest(False);
|
||||
#endif
|
||||
DONE();
|
||||
#ifdef LOG
|
||||
fprintf(TermLog, "TestName: <%s> ENDS\n", argv[0]);
|
||||
fclose(TermLog);
|
||||
#endif
|
||||
}
|
||||
|
||||
51
cde/programs/dtterm/tests/curmove/Imakefile
Normal file
51
cde/programs/dtterm/tests/curmove/Imakefile
Normal file
@@ -0,0 +1,51 @@
|
||||
XCOMM $XConsortium: Imakefile /main/8 1996/10/09 14:09:45 drk $
|
||||
PROGRAMS = curmove
|
||||
|
||||
INCLUDES = -I. -I$(DTINCLUDESRC)
|
||||
LOCAL_INCLUDES = -I../shared -I$(TOP)/lib/
|
||||
SYS_LIBRARIES = -lm
|
||||
|
||||
EXTRA_DEFINES = -DLOG -DSYNLIB
|
||||
|
||||
#if defined(ApolloArchitecture)
|
||||
EXTRA_DEFINES = -Dapollo -D_CMDINV
|
||||
#if defined(SHLIB)
|
||||
LOCAL_LIBRARIES = -A inlib,$(XLIB)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(SunArchitecture)
|
||||
SYS_LIBRARIES = -lm -ldl -lgen -lC
|
||||
SYNLIB=$(TOP)/lib/synlib/libsynlibTst.a
|
||||
XTST=/usr/openwin/lib/libXtst.a
|
||||
#endif
|
||||
|
||||
#if defined(USLArchitecture)
|
||||
SYS_LIBRARIES = -lm -ldl -lgen
|
||||
#endif
|
||||
|
||||
#if defined(UXPArchitecture)
|
||||
SYS_LIBRARIES = -lm -ldl -lgen
|
||||
#endif
|
||||
|
||||
LOCAL_LIBRARIES = ../shared/libtermtest.a $(SYNLIB) $(XTST) $(XEXT) $(XLIB)
|
||||
|
||||
SRCS = curmove.c
|
||||
|
||||
OBJS = curmove.o
|
||||
|
||||
NormalLibraryObjectRule()
|
||||
ComplexProgramTarget($(PROGRAMS))
|
||||
|
||||
saber_src: $(SRCS)
|
||||
XCOMM setopt load_flags $(CFLAGS)
|
||||
XCOMM load $(SRCS) $(LOCAL_LIBRARIES)
|
||||
|
||||
unsaber_src:
|
||||
XCOMM unload $(SRCS)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
32
cde/programs/dtterm/tests/curmove/README
Normal file
32
cde/programs/dtterm/tests/curmove/README
Normal file
@@ -0,0 +1,32 @@
|
||||
/* $XConsortium: README /main/2 1996/07/15 14:26:14 drk $ */
|
||||
TestName: curmove
|
||||
|
||||
Description: This program tests the cursor movement functionality of dtterm.
|
||||
The following escape sequences are tested
|
||||
|
||||
"\033[A"
|
||||
"\033[%dA"
|
||||
"\033[B"
|
||||
"\033[%dB"
|
||||
"\033[%dC"
|
||||
"\033[%dD"
|
||||
"\033[%d;%dH"
|
||||
"\033[%d;%df"
|
||||
"\033[%dF"
|
||||
"\033[%dG"
|
||||
"\033[6n"
|
||||
"\033[%d;%dR"
|
||||
|
||||
note: %d means a parameter
|
||||
|
||||
and recordes or compares the image. the result of the test
|
||||
is logged in file term.log
|
||||
|
||||
How to run: invoke dtterm and run the program with any of the following
|
||||
option
|
||||
|
||||
commandline: -o dtterm.object
|
||||
-o dtterm.object -r -save (for recording)
|
||||
-o dtterm.object -compare -save (for comparing)
|
||||
|
||||
|
||||
149
cde/programs/dtterm/tests/curmove/curmove.c
Normal file
149
cde/programs/dtterm/tests/curmove/curmove.c
Normal file
@@ -0,0 +1,149 @@
|
||||
/* $XConsortium: curmove.c /main/3 1995/10/31 11:56:15 rswiston $ */
|
||||
#include <stdio.h>
|
||||
#include <math.h>
|
||||
#include "synvar.h"
|
||||
#include "common.h"
|
||||
|
||||
#ifdef LOG
|
||||
FILE *TermLog;
|
||||
#define SAVELOG fclose(TermLog); TermLog = fopen("term.log", "a");
|
||||
#endif
|
||||
|
||||
char LogStr[200];
|
||||
|
||||
#define InitArr(Arr, NumCols, NumLines) \
|
||||
{ \
|
||||
for (i=0; i < NumCols; i++) \
|
||||
for (j=0; j < NumLines; j++) Arr[i][j] = 0; \
|
||||
}
|
||||
|
||||
void TestCurMove(WinName)
|
||||
char *WinName;
|
||||
{
|
||||
|
||||
int i,j, Count=0, Position, Arr[200][100];
|
||||
int CurrX, CurrY, PrevX, PrevY, GotX, GotY;
|
||||
int Relative=1, Wrap=0, NumLines, NumCols;
|
||||
char Str[IMAGE_FILE_LEN];
|
||||
|
||||
START(1,0,0,0,0);
|
||||
if (CheckTermStatus() == -1)
|
||||
{printf("terminal emulator malfunctioning\n"); DONE(); return;}
|
||||
GetWinSize(&NumLines, &NumCols);
|
||||
#ifdef DEBUG
|
||||
sprintf(LogStr, "WINDOW Size Cols: %d Lines: %d \n", NumCols, NumLines);
|
||||
LogError(LogStr);
|
||||
#endif
|
||||
ClearScreen(); InitArr(Arr, NumCols, NumLines);
|
||||
PrevX = 0; PrevY = 0;
|
||||
while (1) {
|
||||
CurrX = (int) (rand() % NumCols);
|
||||
CurrY = (int) (rand() % NumLines);
|
||||
if (Arr[CurrX][CurrY] == 1) continue;
|
||||
if ((CurrX == PrevX) && (CurrY == PrevY)) continue;
|
||||
if (Relative == 1) RelativeGoToXY(PrevX, PrevY, CurrX, CurrY);
|
||||
else if (Relative == 2) AbsoluteGoToXY(CurrX+1, CurrY+1);
|
||||
else AbsoluteGoToXY_HVP(CurrX+1, CurrY+1);
|
||||
Arr[CurrX][CurrY] = 1;
|
||||
if (CurrX != (NumCols - 1))
|
||||
{WRITETEST("0"); CursorBack(1);}
|
||||
else {
|
||||
WRITETEST("0");
|
||||
if (Wrap == 1) AbsoluteGoToXY(CurrX+1, CurrY+1);
|
||||
}
|
||||
GetCursorPosn(&GotX, &GotY);
|
||||
if ((CurrX != (GotX - 1)) || (CurrY != (GotY -1))) {
|
||||
if (Relative == 1) printf("Relative :");
|
||||
else printf("Absolute:");
|
||||
sprintf(LogStr, "Expeted X Y: %3d %3d Got X Y: %3d %3d \n",
|
||||
CurrX+1, CurrY+1, GotX, GotY);
|
||||
printf("%s", LogStr); LogError(LogStr);
|
||||
DONE(); return;
|
||||
}
|
||||
#ifdef DEBUG
|
||||
sprintf(LogStr, "CurrX: %3d CurrY: %3d GotX: %3d GotY: %3d \n",
|
||||
CurrX+1, CurrY+1, GotX, GotY);
|
||||
LogError(LogStr);
|
||||
#endif
|
||||
PrevX= CurrX; PrevY = CurrY;
|
||||
Count++;
|
||||
if (Count >= ( NumLines *NumCols)) {
|
||||
#ifdef SYNLIB
|
||||
sprintf(Str, "%scurmove%d", IMAGE_DIR, Relative);
|
||||
MatchWindows(WinName, Str);
|
||||
#endif
|
||||
if ((Relative == 1) || (Relative == 2)) {
|
||||
ClearScreen(); InitArr(Arr, NumCols, NumLines);
|
||||
Relative += 1; Count = 0;
|
||||
}
|
||||
else break;
|
||||
}
|
||||
}
|
||||
DONE();
|
||||
}
|
||||
|
||||
#define STARLEN 120
|
||||
|
||||
void TestCurColLine(WinName)
|
||||
char *WinName;
|
||||
{
|
||||
int i, Cols, Lines;
|
||||
char Str[STARLEN];
|
||||
START(1,0,0,0,0);
|
||||
if (CheckTermStatus() == -1)
|
||||
{printf("terminal emulator malfunctioning\n"); DONE(); return;}
|
||||
GetWinSize(&Lines, &Cols);
|
||||
ClearScreen(); HomeUp();
|
||||
CursorDown(Lines);
|
||||
CursorPrevLine(Lines/2 + 1);
|
||||
CursorColumn(Cols/10);
|
||||
for (i=0; i < (STARLEN/2); i++) Str[i] = '*';
|
||||
Str[STARLEN/2] = NULLCHAR;
|
||||
WRITETEST(Str);
|
||||
NextLine();
|
||||
CursorColumn(Cols/10);
|
||||
WRITETEST("*");
|
||||
CursorColumn(((Cols/10) + (STARLEN/2) - 1));
|
||||
WRITETEST("*");
|
||||
NextLine();
|
||||
CursorColumn(Cols/10);
|
||||
WRITETEST(Str);
|
||||
CursorPrevLine(1);
|
||||
CursorColumn((Cols/10) + (Cols/20));
|
||||
WRITETEST("DO YOU SEE A BOX USING * IN THE CENTER ENCLOSING THIS");
|
||||
#ifdef SYNLIB
|
||||
sprintf(Str, "%scurmove4", IMAGE_DIR);
|
||||
MatchWindows(WinName, Str);
|
||||
#endif
|
||||
DONE();
|
||||
}
|
||||
|
||||
main(argc, argv)
|
||||
int argc;
|
||||
char *argv[];
|
||||
{
|
||||
|
||||
#ifdef LOG
|
||||
if ((TermLog = fopen("term.log", "a")) == NULL) {
|
||||
if ((TermLog = fopen("term.log", "w")) == NULL)
|
||||
{printf("Logfile could not be opened \n"); exit(-1);}
|
||||
}
|
||||
fprintf(TermLog, "**************************************************\n");
|
||||
LogTime();
|
||||
fprintf(TermLog, "TestName: <%s> STARTS\n", argv[0]);
|
||||
#endif
|
||||
#ifdef SYNLIB
|
||||
InitTest(argc, argv);
|
||||
AssignWinName("TermWin", TERM_EMU);
|
||||
#endif
|
||||
TestCurMove("TermWin");
|
||||
TestCurColLine("TermWin");
|
||||
#ifdef SYNLIB
|
||||
CloseTest(False);
|
||||
#endif
|
||||
#ifdef LOG
|
||||
fprintf(TermLog, "TestName: <%s> ENDS\n", argv[0]);
|
||||
fclose(TermLog);
|
||||
#endif
|
||||
}
|
||||
|
||||
2
cde/programs/dtterm/tests/data/dtterm.object
Normal file
2
cde/programs/dtterm/tests/data/dtterm.object
Normal file
@@ -0,0 +1,2 @@
|
||||
Location LocTerm 400 400
|
||||
Location LocTerm1 200 200
|
||||
52
cde/programs/dtterm/tests/decmode/Imakefile
Normal file
52
cde/programs/dtterm/tests/decmode/Imakefile
Normal file
@@ -0,0 +1,52 @@
|
||||
XCOMM $XConsortium: Imakefile /main/8 1996/10/09 14:09:53 drk $
|
||||
PROGRAMS = decmode
|
||||
|
||||
INCLUDES = -I. -I$(DTINCLUDESRC)
|
||||
LOCAL_INCLUDES = -I../shared -I$(TOP)/lib/
|
||||
SYS_LIBRARIES = -lm
|
||||
|
||||
|
||||
EXTRA_DEFINES = -DLOG -DSYNLIB
|
||||
|
||||
#if defined(ApolloArchitecture)
|
||||
EXTRA_DEFINES = -Dapollo -D_CMDINV
|
||||
#if defined(SHLIB)
|
||||
LOCAL_LIBRARIES = -A inlib,$(XLIB)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(SunArchitecture)
|
||||
SYS_LIBRARIES = -lm -ldl -lgen -lC
|
||||
SYNLIB=$(TOP)/lib/synlib/libsynlibTst.a
|
||||
XTST=/usr/openwin/lib/libXtst.a
|
||||
#endif
|
||||
|
||||
#if defined(USLArchitecture)
|
||||
SYS_LIBRARIES = -lm -ldl -lgen
|
||||
#endif
|
||||
|
||||
#if defined(UXPArchitecture)
|
||||
SYS_LIBRARIES = -lm -ldl -lgen
|
||||
#endif
|
||||
|
||||
LOCAL_LIBRARIES = ../shared/libtermtest.a $(SYNLIB) $(XTST) $(XEXT) $(XLIB)
|
||||
|
||||
SRCS = decmode.c
|
||||
|
||||
OBJS = decmode.o
|
||||
|
||||
NormalLibraryObjectRule()
|
||||
ComplexProgramTarget($(PROGRAMS))
|
||||
|
||||
saber_src: $(SRCS)
|
||||
XCOMM setopt load_flags $(CFLAGS)
|
||||
XCOMM load $(SRCS) $(LOCAL_LIBRARIES)
|
||||
|
||||
unsaber_src:
|
||||
XCOMM unload $(SRCS)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
56
cde/programs/dtterm/tests/decmode/README
Normal file
56
cde/programs/dtterm/tests/decmode/README
Normal file
@@ -0,0 +1,56 @@
|
||||
/* $XConsortium: README /main/2 1996/07/15 14:26:42 drk $ */
|
||||
TestName: decmode
|
||||
|
||||
Description: This program tests the DECMODE functionality of dtterm.
|
||||
The following escape sequences are tested
|
||||
|
||||
|
||||
"\033[%d;%dr"
|
||||
"\033[?1h"
|
||||
"\033[?3h"
|
||||
"\033[?4h"
|
||||
"\033[?5h"
|
||||
"\033[?6h"
|
||||
"\033[?7h"
|
||||
"\033[?44h"
|
||||
"\033[?45h"
|
||||
"\033[?46h"
|
||||
"\033[?1l"
|
||||
"\033[?3l"
|
||||
"\033[?4l"
|
||||
"\033[?5l"
|
||||
"\033[?6l"
|
||||
"\033[?7l"
|
||||
"\033[?44l"
|
||||
"\033[?45l"
|
||||
"\033[?46l"
|
||||
"\033[?1s"
|
||||
"\033[?3s"
|
||||
"\033[?4s"
|
||||
"\033[?5s"
|
||||
"\033[?6s"
|
||||
"\033[?7s"
|
||||
"\033[?44s"
|
||||
"\033[?45s"
|
||||
"\033[?46s"
|
||||
"\033[?1r"
|
||||
"\033[?3r"
|
||||
"\033[?4r"
|
||||
"\033[?5r"
|
||||
"\033[?6r"
|
||||
"\033[?7r"
|
||||
"\033[?44r"
|
||||
"\033[?45r"
|
||||
"\033[?46r"
|
||||
|
||||
and recordes or compares the image. the result of the test
|
||||
is logged in file term.log
|
||||
|
||||
How to run: invoke dtterm and run the program with any of the following
|
||||
option
|
||||
|
||||
commandline: -o dtterm.object
|
||||
-o dtterm.object -r -save (for recording)
|
||||
-o dtterm.object -compare -save (for comparing)
|
||||
|
||||
|
||||
206
cde/programs/dtterm/tests/decmode/decmode.c
Normal file
206
cde/programs/dtterm/tests/decmode/decmode.c
Normal file
@@ -0,0 +1,206 @@
|
||||
/* $XConsortium: decmode.c /main/3 1995/10/31 11:56:41 rswiston $ */
|
||||
#include <stdio.h>
|
||||
#include "synvar.h"
|
||||
#include "common.h"
|
||||
|
||||
#ifdef LOG
|
||||
FILE *TermLog;
|
||||
#define SAVELOG fclose(TermLog); TermLog = fopen("term.log", "a");
|
||||
#endif
|
||||
|
||||
char LogStr[200];
|
||||
|
||||
void FillScrLnNumbers(Lines, Cols)
|
||||
int Lines, Cols;
|
||||
{
|
||||
int i, j;
|
||||
char Str[10];
|
||||
HomeUp(); ClearScreen();
|
||||
for (i=0; i < Lines; i++) {
|
||||
sprintf(Str, "%x", (i % 15) +1);
|
||||
for (j=0; j < Cols; j++) WRITETEST(Str);
|
||||
}
|
||||
}
|
||||
|
||||
void TestScrollRegn(Lines, Cols, ScrollTop, ScrollBottom, WinName, ImageFile)
|
||||
int Lines, Cols, ScrollTop, ScrollBottom;
|
||||
char *WinName, *ImageFile;
|
||||
{
|
||||
char Str[IMAGE_FILE_LEN];
|
||||
ClearScreen();
|
||||
SetScrollRegn(ScrollTop, ScrollBottom);
|
||||
SetOriginMode(DECModeSet); /* To Origin Mode */
|
||||
FillScrLnNumbers(Lines, Cols);
|
||||
FLUSHTEST();
|
||||
HomeUp();
|
||||
#ifdef SYNLIB
|
||||
sprintf(Str, "%sA", ImageFile);
|
||||
MatchWindows(WinName, Str);
|
||||
#endif
|
||||
SetOriginMode(DECModeSave); /* Save the mode set (Origin Mode) */
|
||||
SetOriginMode(DECModeReset); /* Set the mode to cursor mode */
|
||||
ClearScreen();
|
||||
FillScrLnNumbers(Lines, Cols);
|
||||
FLUSHTEST();
|
||||
HomeUp();
|
||||
#ifdef SYNLIB
|
||||
sprintf(Str, "%sB", ImageFile);
|
||||
MatchWindows(WinName, Str);
|
||||
#endif
|
||||
ClearScreen();
|
||||
SetOriginMode(DECModeRestore); /* Restore the saved mode (Origin Mode)*/
|
||||
FillScrLnNumbers(Lines, Cols);
|
||||
FLUSHTEST();
|
||||
HomeUp();
|
||||
#ifdef SYNLIB
|
||||
sprintf(Str, "%sC", ImageFile);
|
||||
MatchWindows(WinName, Str);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
void TestReverseWrap(Lines, Cols, WinName, ImageFile)
|
||||
int Lines, Cols;
|
||||
char *WinName, *ImageFile;
|
||||
{
|
||||
char Str[IMAGE_FILE_LEN];
|
||||
SetScrollRegn(1, Lines);
|
||||
SetOriginMode(DECModeReset);
|
||||
SetWrapMode(DECModeSet);
|
||||
SetWrapMode(DECModeSave);
|
||||
FillScrLnNumbers(Lines, Cols);
|
||||
FLUSHTEST();
|
||||
HomeUp();
|
||||
SetReverseWrap(DECModeSet);
|
||||
SetReverseWrap(DECModeSave);
|
||||
CursorBack((Lines*Cols) / 2);
|
||||
InsertBlanks(Cols);
|
||||
#ifdef SYNLIB
|
||||
sprintf(Str, "%sA", ImageFile);
|
||||
MatchWindows(WinName, Str);
|
||||
#endif
|
||||
SetReverseWrap(DECModeReset);
|
||||
SetWrapMode(DECModeReset);
|
||||
CursorForward(Cols*Lines);
|
||||
CursorBack((Lines*Cols));
|
||||
sleep(10);
|
||||
#ifdef SYNLIB
|
||||
sprintf(Str, "%sB", ImageFile);
|
||||
MatchWindows(WinName, Str);
|
||||
#endif
|
||||
SetWrapMode(DECModeRestore);
|
||||
FillScrLnNumbers(Lines, Cols);
|
||||
FLUSHTEST();
|
||||
HomeUp();
|
||||
SetReverseWrap(DECModeRestore);
|
||||
BackSpace(((Lines*Cols) / 2) + 1);
|
||||
InsertBlanks(Cols);
|
||||
#ifdef SYNLIB
|
||||
sprintf(Str, "%sC", ImageFile);
|
||||
MatchWindows(WinName, Str);
|
||||
#endif
|
||||
}
|
||||
|
||||
void TestReverseVideo(Lines, Cols, WinName, ImageFile)
|
||||
int Lines, Cols;
|
||||
char *WinName, *ImageFile;
|
||||
{
|
||||
char Str[IMAGE_FILE_LEN];
|
||||
SetOriginMode(DECModeReset);
|
||||
SetWrapMode(DECModeSet);
|
||||
FillScrLnNumbers(Lines, Cols);
|
||||
SetVideoType(DECModeSet);
|
||||
SetVideoType(DECModeSave);
|
||||
#ifdef SYNLIB
|
||||
sprintf(Str, "%sA", ImageFile);
|
||||
MatchWindows(WinName, Str);
|
||||
#endif
|
||||
SetVideoType(DECModeReset);
|
||||
FillScrLnNumbers(Lines, Cols);
|
||||
#ifdef SYNLIB
|
||||
sprintf(Str, "%sB", ImageFile);
|
||||
MatchWindows(WinName, Str);
|
||||
#endif
|
||||
SetVideoType(DECModeRestore);
|
||||
FillScrLnNumbers(Lines, Cols);
|
||||
#ifdef SYNLIB
|
||||
sprintf(Str, "%sC", ImageFile);
|
||||
MatchWindows(WinName, Str);
|
||||
#endif
|
||||
SetVideoType(DECModeReset);
|
||||
}
|
||||
|
||||
void WriteTwiceCols(Cols)
|
||||
int Cols;
|
||||
{
|
||||
int i;
|
||||
for (i=0; i < (2*Cols); i++)
|
||||
if (i <= Cols) WRITETEST("a");
|
||||
else WRITETEST("b");
|
||||
}
|
||||
|
||||
void TestDECMode(WinName)
|
||||
char *WinName;
|
||||
{
|
||||
int Lines, Cols, GotX, GotY;
|
||||
char Str1[IMAGE_FILE_LEN], Str2[IMAGE_FILE_LEN];
|
||||
|
||||
START(1, 0, 0, 0,0);
|
||||
if (CheckTermStatus() == -1)
|
||||
{printf("terminal emulator malfunctioning\n"); exit(-1);}
|
||||
ClearScreen();
|
||||
GetWinSize(&Lines, &Cols);
|
||||
#ifdef DEBUG
|
||||
fprintf(TermLog, "WINDOW Size Cols: %d Lines: %d \n", Cols, Lines);
|
||||
SAVELOG;
|
||||
#endif
|
||||
sprintf(Str1, "%sdecmode1", IMAGE_DIR);
|
||||
TestScrollRegn(Lines, Cols, 5, 15, WinName, Str1);
|
||||
sprintf(Str1, "%sdecmode2", IMAGE_DIR);
|
||||
TestScrollRegn(Lines, Cols, 3, 23, WinName, Str1);
|
||||
SetWrapMode(DECModeReset);
|
||||
ClearScreen();
|
||||
WriteTwiceCols(Cols);
|
||||
GetCursorPosn(&GotX, &GotY);
|
||||
if (GotX != Cols) LogError("WrapMode Off failed");
|
||||
else LogError("WrapMode Off Success");
|
||||
NextLine();
|
||||
WriteTwiceCols(Cols);
|
||||
GetCursorPosn(&GotX, &GotY);
|
||||
if (GotX != Cols) LogError("WrapMode Off failed");
|
||||
else LogError("WrapMode Off Success");
|
||||
sprintf(Str1, "%sdecmode3", IMAGE_DIR);
|
||||
TestReverseWrap(Lines, Cols, WinName, Str1);
|
||||
sprintf(Str1, "%sdecmode4", IMAGE_DIR);
|
||||
TestReverseVideo(Lines, Cols, WinName, Str1);
|
||||
DONE();
|
||||
}
|
||||
|
||||
main(argc, argv)
|
||||
int argc;
|
||||
char *argv[];
|
||||
{
|
||||
|
||||
#ifdef LOG
|
||||
if ((TermLog = fopen("term.log", "a")) == NULL) {
|
||||
if ((TermLog = fopen("term.log", "w")) == NULL)
|
||||
{printf("Logfile could not be opened \n"); exit(-1);}
|
||||
}
|
||||
fprintf(TermLog, "**************************************************\n");
|
||||
LogTime();
|
||||
fprintf(TermLog, "TestName: <%s> STARTS\n", argv[0]);
|
||||
#endif
|
||||
#ifdef SYNLIB
|
||||
InitTest(argc, argv);
|
||||
AssignWinName("TermWin", TERM_EMU);
|
||||
#endif
|
||||
TestDECMode("TermWin");
|
||||
#ifdef SYNLIB
|
||||
CloseTest(False);
|
||||
#endif
|
||||
#ifdef LOG
|
||||
fprintf(TermLog, "TestName: <%s> ENDS\n", argv[0]);
|
||||
fclose(TermLog);
|
||||
#endif
|
||||
}
|
||||
|
||||
52
cde/programs/dtterm/tests/edittest/Imakefile
Normal file
52
cde/programs/dtterm/tests/edittest/Imakefile
Normal file
@@ -0,0 +1,52 @@
|
||||
XCOMM $XConsortium: Imakefile /main/8 1996/10/09 14:10:03 drk $
|
||||
PROGRAMS = edittest
|
||||
|
||||
INCLUDES = -I. -I$(DTINCLUDESRC)
|
||||
LOCAL_INCLUDES = -I../shared -I$(TOP)/lib/
|
||||
SYS_LIBRARIES = -lm
|
||||
|
||||
|
||||
EXTRA_DEFINES = -DLOG -DSYNLIB
|
||||
|
||||
#if defined(ApolloArchitecture)
|
||||
EXTRA_DEFINES = -Dapollo -D_CMDINV
|
||||
#if defined(SHLIB)
|
||||
LOCAL_LIBRARIES = -A inlib,$(XLIB)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(SunArchitecture)
|
||||
SYS_LIBRARIES = -lm -ldl -lgen -lC
|
||||
SYNLIB=$(TOP)/lib/synlib/libsynlibTst.a
|
||||
XTST=/usr/openwin/lib/libXtst.a
|
||||
#endif
|
||||
|
||||
#if defined(USLArchitecture)
|
||||
SYS_LIBRARIES = -lm -ldl -lgen
|
||||
#endif
|
||||
|
||||
#if defined(UXPArchitecture)
|
||||
SYS_LIBRARIES = -lm -ldl -lgen
|
||||
#endif
|
||||
|
||||
LOCAL_LIBRARIES = ../shared/libtermtest.a $(SYNLIB) $(XTST) $(XEXT) $(XLIB)
|
||||
|
||||
SRCS = edittest.c
|
||||
|
||||
OBJS = edittest.o
|
||||
|
||||
NormalLibraryObjectRule()
|
||||
ComplexProgramTarget($(PROGRAMS))
|
||||
|
||||
saber_src: $(SRCS)
|
||||
XCOMM setopt load_flags $(CFLAGS)
|
||||
XCOMM load $(SRCS) $(LOCAL_LIBRARIES)
|
||||
|
||||
unsaber_src:
|
||||
XCOMM unload $(SRCS)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
28
cde/programs/dtterm/tests/edittest/README
Normal file
28
cde/programs/dtterm/tests/edittest/README
Normal file
@@ -0,0 +1,28 @@
|
||||
/* $XConsortium: README /main/2 1996/07/15 14:27:09 drk $ */
|
||||
TestName: edittest
|
||||
|
||||
Description: This program tests the character attibutes functionality of dtterm.
|
||||
The following escape sequences are tested
|
||||
|
||||
"\033D"
|
||||
"\033M"
|
||||
"\033E"
|
||||
"\033[%dL"
|
||||
"\033[%d@"
|
||||
"\033[%dM"
|
||||
"\033[%dP"
|
||||
"\033[4h"
|
||||
"\033[4l"
|
||||
note: %d means a parameter
|
||||
|
||||
and recordes or compares the image. the result of the test
|
||||
is logged in file term.log
|
||||
|
||||
How to run: invoke dtterm and run the program with any of the following
|
||||
option
|
||||
|
||||
commandline: -o dtterm.object
|
||||
-o dtterm.object -r -save (for recording)
|
||||
-o dtterm.object -compare -save (for comparing)
|
||||
|
||||
|
||||
312
cde/programs/dtterm/tests/edittest/edittest.c
Normal file
312
cde/programs/dtterm/tests/edittest/edittest.c
Normal file
@@ -0,0 +1,312 @@
|
||||
/* $XConsortium: edittest.c /main/3 1995/10/31 11:57:08 rswiston $ */
|
||||
#include <stdio.h>
|
||||
#include "synvar.h"
|
||||
|
||||
#ifdef LOG
|
||||
FILE *TermLog;
|
||||
#define SAVELOG fclose(TermLog); TermLog = fopen("term.log", "a");
|
||||
#endif
|
||||
|
||||
char LogStr[200];
|
||||
|
||||
void FillScrLnNumbers(Lines, Cols)
|
||||
int Lines, Cols;
|
||||
{
|
||||
int i, j;
|
||||
char Str[10];
|
||||
HomeUp(); ClearScreen();
|
||||
for (i=0; i < Lines; i++) {
|
||||
sprintf(Str, "%x", (i % 15) +1);
|
||||
for (j=0; j < Cols; j++) WRITETEST(Str);
|
||||
}
|
||||
}
|
||||
|
||||
void FillHalfScrLnNumbers(Lines, Cols)
|
||||
int Lines, Cols;
|
||||
{
|
||||
int i, j;
|
||||
char Str[10];
|
||||
HomeUp(); ClearScreen();
|
||||
for (i=0; i < Lines; i++) {
|
||||
sprintf(Str, "%x", (i % 15) +1);
|
||||
for (j=0; j < Cols/2; j++) WRITETEST(Str);
|
||||
if (i != (Lines-1)) NextLine();
|
||||
}
|
||||
}
|
||||
|
||||
void InsertTest(Lines, Cols)
|
||||
int Lines, Cols;
|
||||
{
|
||||
int i, Count=5; char Str[100];
|
||||
|
||||
for (i=0; i < Count; i++) NextLine();
|
||||
#ifdef SLOW
|
||||
sleep(5);
|
||||
#endif
|
||||
InsertLines(1);
|
||||
#ifdef SLOW
|
||||
sleep(5);
|
||||
#endif
|
||||
sprintf(Str,"CameDown by %d Lines and inserted this line", Count);
|
||||
WRITETEST(Str);
|
||||
#ifdef SLOW
|
||||
sleep(5);
|
||||
#endif
|
||||
Count = 10;
|
||||
for (i=0; i < Count; i++) NextLine();
|
||||
InsertLines(2);
|
||||
sprintf(Str,"CameDown by %d Lines and inserted two lines ", Count);
|
||||
WRITETEST(Str);
|
||||
#ifdef SLOW
|
||||
sleep(5);
|
||||
#endif
|
||||
}
|
||||
|
||||
void IndexTest(Lines)
|
||||
int Lines;
|
||||
{
|
||||
int i; char Str[100];
|
||||
HomeUp();
|
||||
for (i=0; i < Lines; i++) Index();
|
||||
InsertLines(1);
|
||||
#ifdef SLOW
|
||||
sleep(5);
|
||||
#endif
|
||||
sprintf(Str,"Screen Should have scrolled by a line; let me scroll two more");
|
||||
WRITETEST(Str);
|
||||
#ifdef SLOW
|
||||
sleep(5);
|
||||
#endif
|
||||
Index(); Index();
|
||||
#ifdef SLOW
|
||||
sleep(5);
|
||||
#endif
|
||||
}
|
||||
|
||||
void ReverseIndexTest(Lines, Cols)
|
||||
int Lines, Cols;
|
||||
{
|
||||
int i, Count; char Str[100];
|
||||
for (i=0; i < Lines; i++) ReverseIndex();
|
||||
#ifdef SLOW
|
||||
sleep(5);
|
||||
#endif
|
||||
Count = 1;
|
||||
for (i=0; i < Count; i++) ReverseIndex();
|
||||
InsertLines(1); CursorBack(Cols);
|
||||
sprintf(Str,"Screen should have scrolled down by 3 lines;");
|
||||
WRITETEST(Str);
|
||||
#ifdef SLOW
|
||||
sleep(5);
|
||||
#endif
|
||||
Count = 2;
|
||||
ReverseIndex();
|
||||
CursorBack(Cols);
|
||||
sprintf(Str,"Let me scroll %d more ", Count);
|
||||
WRITETEST(Str);
|
||||
#ifdef SLOW
|
||||
sleep(5);
|
||||
#endif
|
||||
for (i=0; i < Count; i++) ReverseIndex();
|
||||
#ifdef SLOW
|
||||
sleep(5);
|
||||
#endif
|
||||
}
|
||||
|
||||
void DeleteLnTest(Lines, Cols)
|
||||
int Lines, Cols;
|
||||
{
|
||||
int i, Count=10; char Str[100];
|
||||
sleep(2);
|
||||
FLUSHTEST();
|
||||
CursorBack(Cols);
|
||||
sleep(5);
|
||||
FLUSHTEST();
|
||||
CursorUp(Count);
|
||||
sleep(5);
|
||||
FLUSHTEST();
|
||||
DeleteLines(2);
|
||||
sleep(5);
|
||||
FLUSHTEST();
|
||||
InsertLines(1);
|
||||
sprintf(Str,"CameUp by %d Lines and deleted two lines ", Count);
|
||||
WRITETEST(Str);
|
||||
sleep(5);
|
||||
FLUSHTEST();
|
||||
#ifdef SLOW
|
||||
sleep(5);
|
||||
#endif
|
||||
CursorBack(Cols);
|
||||
Count = 5;
|
||||
CursorUp(Count);
|
||||
DeleteLines(1);
|
||||
InsertLines(1);
|
||||
sprintf(Str,"CameUp by %d Lines and deleted a line ", Count);
|
||||
WRITETEST(Str);
|
||||
#ifdef SLOW
|
||||
sleep(5);
|
||||
#endif
|
||||
}
|
||||
|
||||
void DeleteCharTest()
|
||||
{
|
||||
int i, Count=3; char Str[100];
|
||||
CursorUp(Count);
|
||||
CursorBack(20);
|
||||
DeleteChars(10); NextLine();
|
||||
InsertLines(1);
|
||||
sprintf(Str, "Came Up %d lines and deleted ten charactes; ", Count);
|
||||
WRITETEST(Str);
|
||||
#ifdef SLOW
|
||||
sleep(5);
|
||||
#endif
|
||||
Count = 2;
|
||||
CursorBack(20);
|
||||
CursorUp(Count);
|
||||
DeleteChars(90); NextLine();
|
||||
InsertLines(1);
|
||||
sprintf(Str,"Came Up %d lines and tried to delete 90 chars", Count);
|
||||
WRITETEST(Str);
|
||||
#ifdef SLOW
|
||||
sleep(5);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
void InsertCharTest(Lines, Cols)
|
||||
int Lines, Cols;
|
||||
{
|
||||
int i, Count;
|
||||
FillScrLnNumbers(Lines, Cols);
|
||||
FLUSHTEST();
|
||||
HomeUp();
|
||||
CursorForward(Cols/2);
|
||||
for (i=0; i < Lines; i++) {
|
||||
CursorBack(1); DeleteChars(i*2+1);
|
||||
#ifdef SLOW
|
||||
FLUSHTEST(); sleep(1);
|
||||
#endif
|
||||
InsertBlanks(i*2+1); CursorDown(1);
|
||||
#ifdef SLOW
|
||||
FLUSHTEST(); sleep(1);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
void InsertReplTest(Lines, Cols)
|
||||
int Lines, Cols;
|
||||
{
|
||||
int i;
|
||||
FillHalfScrLnNumbers(Lines, Cols);
|
||||
FLUSHTEST();
|
||||
HomeUp();
|
||||
for (i=0; i < (Lines/2); i++) {
|
||||
CursorForward(2*i+1);
|
||||
SetInsertMode();
|
||||
WRITETEST("Now In Insert Mode");
|
||||
NextLine(); CursorBack(Cols);
|
||||
CursorForward(2*i+1);
|
||||
SetReplaceMode();
|
||||
WRITETEST("Now In Repalce Mode");
|
||||
if (i != ((Lines/2) -1)) {NextLine(); CursorBack(Cols);}
|
||||
}
|
||||
FLUSHTEST();
|
||||
}
|
||||
|
||||
#define FILLSCR \
|
||||
sleep(5); \
|
||||
FillScrLnNumbers(Lines, Cols); \
|
||||
FLUSHTEST(); \
|
||||
sleep(5);
|
||||
|
||||
|
||||
void TestAllEdit(WinName)
|
||||
char *WinName;
|
||||
{
|
||||
int i,j,k, l, Wrap;
|
||||
int Lines, Cols, TabSpace, TabCount;
|
||||
char Str[IMAGE_FILE_LEN];
|
||||
|
||||
START(1, 0, 0, 0,0);
|
||||
if (CheckTermStatus() == -1)
|
||||
{printf("terminal emulator malfunctioning\n"); exit(-1);}
|
||||
ClearScreen();
|
||||
GetWinSize(&Lines, &Cols);
|
||||
#ifdef DEBUG
|
||||
fprintf(TermLog, "WINDOW Size Cols: %d Lines: %d \n", Cols, Lines);
|
||||
SAVELOG;
|
||||
#endif
|
||||
FILLSCR;
|
||||
HomeUp();
|
||||
InsertTest(Lines, Cols);
|
||||
#ifdef SYNLIB
|
||||
sprintf(Str, "%sedit1", IMAGE_DIR);
|
||||
MatchWindows(WinName, Str);
|
||||
#endif
|
||||
FILLSCR;
|
||||
IndexTest(Lines);
|
||||
#ifdef SYNLIB
|
||||
sprintf(Str, "%sedit2", IMAGE_DIR);
|
||||
MatchWindows(WinName, Str);
|
||||
#endif
|
||||
FILLSCR;
|
||||
DeleteLnTest(Lines, Cols);
|
||||
#ifdef SYNLIB
|
||||
sprintf(Str, "%sedit3", IMAGE_DIR);
|
||||
MatchWindows(WinName, Str);
|
||||
#endif
|
||||
FILLSCR;
|
||||
DeleteCharTest();
|
||||
#ifdef SYNLIB
|
||||
sprintf(Str, "%sedit4", IMAGE_DIR);
|
||||
MatchWindows(WinName, Str);
|
||||
#endif
|
||||
FILLSCR;
|
||||
ReverseIndexTest(Lines, Cols);
|
||||
#ifdef SYNLIB
|
||||
sprintf(Str, "%sedit5", IMAGE_DIR);
|
||||
MatchWindows(WinName, Str);
|
||||
#endif
|
||||
FILLSCR;
|
||||
InsertCharTest(Lines, Cols);
|
||||
#ifdef SYNLIB
|
||||
sprintf(Str, "%sedit6", IMAGE_DIR);
|
||||
MatchWindows(WinName, Str);
|
||||
#endif
|
||||
FILLSCR;
|
||||
InsertReplTest(Lines, Cols);
|
||||
#ifdef SYNLIB
|
||||
sprintf(Str, "%sedit7", IMAGE_DIR);
|
||||
MatchWindows(WinName, Str);
|
||||
#endif
|
||||
DONE();
|
||||
}
|
||||
|
||||
main(argc, argv)
|
||||
int argc;
|
||||
char *argv[];
|
||||
{
|
||||
|
||||
#ifdef LOG
|
||||
if ((TermLog = fopen("term.log", "a")) == NULL) {
|
||||
if ((TermLog = fopen("term.log", "w")) == NULL)
|
||||
{printf("Logfile could not be opened \n"); exit(-1);}
|
||||
}
|
||||
fprintf(TermLog, "**************************************************\n");
|
||||
LogTime();
|
||||
fprintf(TermLog, "TestName: <%s> STARTS\n", argv[0]);
|
||||
#endif
|
||||
#ifdef SYNLIB
|
||||
InitTest(argc, argv);
|
||||
AssignWinName("TermWin", TERM_EMU);
|
||||
#endif
|
||||
TestAllEdit("TermWin");
|
||||
#ifdef SYNLIB
|
||||
CloseTest(False);
|
||||
#endif
|
||||
#ifdef LOG
|
||||
fprintf(TermLog, "TestName: <%s> ENDS\n", argv[0]);
|
||||
fclose(TermLog);
|
||||
#endif
|
||||
}
|
||||
|
||||
52
cde/programs/dtterm/tests/erase/Imakefile
Normal file
52
cde/programs/dtterm/tests/erase/Imakefile
Normal file
@@ -0,0 +1,52 @@
|
||||
XCOMM $XConsortium: Imakefile /main/8 1996/10/09 14:10:12 drk $
|
||||
PROGRAMS = erase
|
||||
|
||||
INCLUDES = -I. -I$(DTINCLUDESRC)
|
||||
LOCAL_INCLUDES = -I../shared -I$(TOP)/lib/
|
||||
SYS_LIBRARIES = -lm
|
||||
|
||||
|
||||
EXTRA_DEFINES = -DLOG -DSYNLIB
|
||||
|
||||
#if defined(ApolloArchitecture)
|
||||
EXTRA_DEFINES = -Dapollo -D_CMDINV
|
||||
#if defined(SHLIB)
|
||||
LOCAL_LIBRARIES = -A inlib,$(XLIB)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(SunArchitecture)
|
||||
SYS_LIBRARIES = -lm -ldl -lgen -lC
|
||||
SYNLIB=$(TOP)/lib/synlib/libsynlibTst.a
|
||||
XTST=/usr/openwin/lib/libXtst.a
|
||||
#endif
|
||||
|
||||
#if defined(USLArchitecture)
|
||||
SYS_LIBRARIES = -lm -ldl -lgen
|
||||
#endif
|
||||
|
||||
#if defined(UXPArchitecture)
|
||||
SYS_LIBRARIES = -lm -ldl -lgen
|
||||
#endif
|
||||
|
||||
LOCAL_LIBRARIES = ../shared/libtermtest.a $(SYNLIB) $(XTST) $(XEXT) $(XLIB)
|
||||
|
||||
SRCS = erase.c
|
||||
|
||||
OBJS = erase.o
|
||||
|
||||
NormalLibraryObjectRule()
|
||||
ComplexProgramTarget($(PROGRAMS))
|
||||
|
||||
saber_src: $(SRCS)
|
||||
XCOMM setopt load_flags $(CFLAGS)
|
||||
XCOMM load $(SRCS) $(LOCAL_LIBRARIES)
|
||||
|
||||
unsaber_src:
|
||||
XCOMM unload $(SRCS)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
25
cde/programs/dtterm/tests/erase/README
Normal file
25
cde/programs/dtterm/tests/erase/README
Normal file
@@ -0,0 +1,25 @@
|
||||
/* $XConsortium: README /main/2 1996/07/15 14:27:33 drk $ */
|
||||
TestName: erase
|
||||
|
||||
Description: This program tests the character attibutes functionality of dtterm.
|
||||
The following escape sequences are tested
|
||||
|
||||
"\033[J"
|
||||
"\033[1J"
|
||||
"\033[2J"
|
||||
"\033[K"
|
||||
"\033[1K"
|
||||
"\033[2K"
|
||||
"\033[%dX"
|
||||
|
||||
and recordes or compares the image. the result of the test
|
||||
is logged in file term.log
|
||||
|
||||
How to run: invoke dtterm and run the program with any of the following
|
||||
option
|
||||
|
||||
commandline: -o dtterm.object
|
||||
-o dtterm.object -r -save (for recording)
|
||||
-o dtterm.object -compare -save (for comparing)
|
||||
|
||||
|
||||
185
cde/programs/dtterm/tests/erase/erase.c
Normal file
185
cde/programs/dtterm/tests/erase/erase.c
Normal file
@@ -0,0 +1,185 @@
|
||||
/* $XConsortium: erase.c /main/3 1995/10/31 11:57:36 rswiston $ */
|
||||
#include <stdio.h>
|
||||
#include "synvar.h"
|
||||
|
||||
#ifdef LOG
|
||||
FILE *TermLog;
|
||||
#define SAVELOG fclose(TermLog); TermLog = fopen("term.log", "a");
|
||||
#endif
|
||||
|
||||
char LogStr[200];
|
||||
|
||||
void FillScreen(Lines, Cols, Ch)
|
||||
int Lines, Cols;
|
||||
char Ch;
|
||||
{
|
||||
int i, j; char Str[10];
|
||||
ClearScreen();
|
||||
sprintf(Str, "%c", Ch);
|
||||
for (i=0; i < Lines; i++)
|
||||
for (j=0; j < Cols; j++)
|
||||
WRITETEST(Str);
|
||||
}
|
||||
|
||||
void EraseLnTest(Lines, Cols, WinName)
|
||||
int Lines, Cols;
|
||||
char *WinName;
|
||||
{
|
||||
int i; char Str[IMAGE_FILE_LEN];
|
||||
FillScreen(Lines, Cols, 'X');
|
||||
FLUSHTEST();
|
||||
HomeUp();
|
||||
for (i=0; i < Lines; i++) {
|
||||
CursorForward(1); EraseLnFromCur(); CursorDown(1);
|
||||
#ifdef SLOW
|
||||
sleep(1); FLUSHTEST();
|
||||
#endif
|
||||
}
|
||||
#ifdef SYNLIB
|
||||
sprintf(Str, "%serase1", IMAGE_DIR);
|
||||
MatchWindows(WinName, Str);
|
||||
#endif
|
||||
HomeUp();
|
||||
FillScreen(Lines, Cols, 'M');
|
||||
FLUSHTEST();
|
||||
HomeUp();
|
||||
for (i=0; i < Lines; i++) {
|
||||
CursorForward(1); EraseLnToCur(); CursorDown(1);
|
||||
#ifdef SLOW
|
||||
sleep(1); FLUSHTEST();
|
||||
#endif
|
||||
}
|
||||
#ifdef SYNLIB
|
||||
sprintf(Str, "%serase2", IMAGE_DIR);
|
||||
MatchWindows(WinName, Str);
|
||||
#endif
|
||||
HomeUp();
|
||||
FillScreen(Lines, Cols, 'M');
|
||||
FLUSHTEST();
|
||||
HomeUp();
|
||||
for (i=0; i < (Lines/2); i++) {
|
||||
CursorForward(2); EraseLnAll(); CursorDown(2);
|
||||
#ifdef SLOW
|
||||
sleep(1); FLUSHTEST();
|
||||
#endif
|
||||
}
|
||||
#ifdef SYNLIB
|
||||
sprintf(Str, "%serase3", IMAGE_DIR);
|
||||
MatchWindows(WinName, Str);
|
||||
#endif
|
||||
}
|
||||
|
||||
#define MoveBy 5
|
||||
|
||||
void EraseScrTest(Lines, Cols, WinName)
|
||||
int Lines, Cols;
|
||||
char *WinName;
|
||||
{
|
||||
int i, Count;
|
||||
char Str[IMAGE_FILE_LEN];
|
||||
FillScreen(Lines, Cols, 'R');
|
||||
FLUSHTEST();
|
||||
Count = Lines / MoveBy;
|
||||
for (i=0; i < Count; i++) {
|
||||
CursorBack(((Cols-MoveBy) /Count)); CursorUp(MoveBy);
|
||||
EraseScrFromCur();
|
||||
#ifdef SLOW
|
||||
sleep(2); FLUSHTEST();
|
||||
#endif
|
||||
}
|
||||
sprintf(Str, "%serase4", IMAGE_DIR);
|
||||
#ifdef SYNLIB
|
||||
MatchWindows(WinName, Str);
|
||||
#endif
|
||||
ClearScreen();
|
||||
FillScreen(Lines, Cols, 'M');
|
||||
FLUSHTEST();
|
||||
HomeUp();
|
||||
for (i=0; i < Count; i++) {
|
||||
CursorForward(((Cols-MoveBy) /Count)); CursorDown(MoveBy);
|
||||
EraseScrToCur();
|
||||
#ifdef SLOW
|
||||
sleep(2); FLUSHTEST();
|
||||
#endif
|
||||
}
|
||||
#ifdef SYNLIB
|
||||
sprintf(Str, "%serase5", IMAGE_DIR);
|
||||
MatchWindows(WinName, Str);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
void EraseCharTest(Lines, Cols, WinName)
|
||||
int Lines, Cols;
|
||||
char *WinName;
|
||||
{
|
||||
int i, Count;
|
||||
char Str[IMAGE_FILE_LEN];
|
||||
FillScreen(Lines, Cols, 'R');
|
||||
FLUSHTEST();
|
||||
HomeUp();
|
||||
CursorForward(Cols/2);
|
||||
for (i=0; i < Lines; i++) {
|
||||
CursorBack(1); EraseChars(i*2+1); CursorDown(1);
|
||||
#ifdef SLOW
|
||||
sleep(1); FLUSHTEST();
|
||||
#endif
|
||||
}
|
||||
#ifdef SYNLIB
|
||||
sprintf(Str, "%serase6", IMAGE_DIR);
|
||||
MatchWindows(WinName, Str);
|
||||
#endif
|
||||
}
|
||||
|
||||
void TestAllErase(WinName)
|
||||
char *WinName;
|
||||
{
|
||||
int i,j,k, l, Wrap;
|
||||
int Lines, Cols, TabSpace, TabCount;
|
||||
char Str[IMAGE_FILE_LEN];
|
||||
|
||||
START(1, 0, 0, 0, 0);
|
||||
/*
|
||||
if (CheckTermStatus() == -1)
|
||||
{printf("terminal emulator malfunctioning\n"); exit(-1);}
|
||||
*/
|
||||
ClearScreen();
|
||||
GetWinSize(&Lines, &Cols);
|
||||
#ifdef DEBUG
|
||||
fprintf(TermLog, "WINDOW Size Cols: %d Lines: %d \n", Cols, Lines);
|
||||
SAVELOG;
|
||||
#endif
|
||||
EraseLnTest(Lines, Cols, WinName);
|
||||
EraseScrTest(Lines, Cols, WinName);
|
||||
EraseCharTest(Lines, Cols, WinName);
|
||||
DONE();
|
||||
}
|
||||
|
||||
main(argc, argv)
|
||||
int argc;
|
||||
char *argv[];
|
||||
{
|
||||
|
||||
#ifdef LOG
|
||||
if ((TermLog = fopen("term.log", "a")) == NULL) {
|
||||
if ((TermLog = fopen("term.log", "w")) == NULL)
|
||||
{printf("Logfile could not be opened \n"); exit(-1);}
|
||||
}
|
||||
fprintf(TermLog, "**************************************************\n");
|
||||
LogTime();
|
||||
fprintf(TermLog, "TestName: <%s> STARTS\n", argv[0]);
|
||||
#endif
|
||||
#ifdef SYNLIB
|
||||
InitTest(argc, argv);
|
||||
AssignWinName("TermWin", TERM_EMU);
|
||||
#endif
|
||||
TestAllErase("TermWin");
|
||||
#ifdef SYNLIB
|
||||
CloseTest(False);
|
||||
#endif
|
||||
#ifdef LOG
|
||||
fprintf(TermLog, "TestName: <%s> ENDS\n", argv[0]);
|
||||
fclose(TermLog);
|
||||
#endif
|
||||
}
|
||||
|
||||
52
cde/programs/dtterm/tests/keypad/Imakefile
Normal file
52
cde/programs/dtterm/tests/keypad/Imakefile
Normal file
@@ -0,0 +1,52 @@
|
||||
XCOMM $XConsortium: Imakefile /main/8 1996/10/09 14:10:21 drk $
|
||||
PROGRAMS = keypad
|
||||
|
||||
INCLUDES = -I. -I$(DTINCLUDESRC)
|
||||
LOCAL_INCLUDES = -I../shared -I$(TOP)/lib/
|
||||
SYS_LIBRARIES = -lm
|
||||
|
||||
|
||||
EXTRA_DEFINES = -DLOG -DSYNLIB
|
||||
|
||||
#if defined(ApolloArchitecture)
|
||||
EXTRA_DEFINES = -Dapollo -D_CMDINV
|
||||
#if defined(SHLIB)
|
||||
LOCAL_LIBRARIES = -A inlib,$(XLIB)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(SunArchitecture)
|
||||
SYS_LIBRARIES = -lm -ldl -lgen -lC
|
||||
SYNLIB=$(TOP)/lib/synlib/libsynlibTst.a
|
||||
XTST=/usr/openwin/lib/libXtst.a
|
||||
#endif
|
||||
|
||||
#if defined(USLArchitecture)
|
||||
SYS_LIBRARIES = -lm -ldl -lgen
|
||||
#endif
|
||||
|
||||
#if defined(UXPArchitecture)
|
||||
SYS_LIBRARIES = -lm -ldl -lgen
|
||||
#endif
|
||||
|
||||
LOCAL_LIBRARIES = ../shared/libtermtest.a $(SYNLIB) $(XTST) $(XEXT) $(XLIB)
|
||||
|
||||
SRCS = keypad.c
|
||||
|
||||
OBJS = keypad.o
|
||||
|
||||
NormalLibraryObjectRule()
|
||||
ComplexProgramTarget($(PROGRAMS))
|
||||
|
||||
saber_src: $(SRCS)
|
||||
XCOMM setopt load_flags $(CFLAGS)
|
||||
XCOMM load $(SRCS) $(LOCAL_LIBRARIES)
|
||||
|
||||
unsaber_src:
|
||||
XCOMM unload $(SRCS)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
21
cde/programs/dtterm/tests/keypad/README
Normal file
21
cde/programs/dtterm/tests/keypad/README
Normal file
@@ -0,0 +1,21 @@
|
||||
/* $XConsortium: README /main/2 1996/07/15 14:27:57 drk $ */
|
||||
TestName: keypad
|
||||
|
||||
Description: This program tests the character attibutes functionality of dtterm.
|
||||
The following escape sequences are tested
|
||||
|
||||
|
||||
"\033="
|
||||
"\033>"
|
||||
|
||||
and recordes or compares the image. the result of the test
|
||||
is logged in file term.log
|
||||
|
||||
How to run: invoke dtterm and run the program with any of the following
|
||||
option
|
||||
|
||||
commandline: -o dtterm.object
|
||||
-o dtterm.object -r -save (for recording)
|
||||
-o dtterm.object -compare -save (for comparing)
|
||||
|
||||
|
||||
66
cde/programs/dtterm/tests/keypad/keypad.c
Normal file
66
cde/programs/dtterm/tests/keypad/keypad.c
Normal file
@@ -0,0 +1,66 @@
|
||||
/* $XConsortium: keypad.c /main/3 1995/10/31 11:58:09 rswiston $ */
|
||||
#include <stdio.h>
|
||||
#include "synvar.h"
|
||||
|
||||
#ifdef LOG
|
||||
FILE *TermLog;
|
||||
#define SAVELOG fclose(TermLog); TermLog = fopen("term.log", "a");
|
||||
#endif
|
||||
|
||||
char LogStr[200];
|
||||
|
||||
|
||||
void TestKeypad(WinName)
|
||||
char *WinName;
|
||||
{
|
||||
int i, Lines, Cols;
|
||||
char Str[IMAGE_FILE_LEN];
|
||||
|
||||
START(1, 0, 0, 0, 1);
|
||||
if (CheckTermStatus() == -1)
|
||||
{printf("terminal emulator malfunctioning\n"); exit(-1);}
|
||||
ClearScreen();
|
||||
GetWinSize(&Lines, &Cols); HomeUp();
|
||||
for (i=0; i < 2; i++) {
|
||||
SetNormalKeyPad();
|
||||
PressKeypadKeys();
|
||||
NextLine();
|
||||
SetApplnKeyPad();
|
||||
PressKeypadKeys();
|
||||
NextLine();
|
||||
}
|
||||
#ifdef SYNLIB
|
||||
sprintf(Str, "%skeypad", IMAGE_DIR);
|
||||
MatchWindows(WinName, Str);
|
||||
#endif
|
||||
DONE();
|
||||
}
|
||||
|
||||
main(argc, argv)
|
||||
int argc;
|
||||
char *argv[];
|
||||
{
|
||||
|
||||
#ifdef LOG
|
||||
if ((TermLog = fopen("term.log", "a")) == NULL) {
|
||||
if ((TermLog = fopen("term.log", "w")) == NULL)
|
||||
{printf("Logfile could not be opened \n"); exit(-1);}
|
||||
}
|
||||
fprintf(TermLog, "**************************************************\n");
|
||||
LogTime();
|
||||
fprintf(TermLog, "TestName: <%s> STARTS\n", argv[0]);
|
||||
#endif
|
||||
#ifdef SYNLIB
|
||||
InitTest(argc, argv);
|
||||
AssignWinName("TermWin", TERM_EMU);
|
||||
#endif
|
||||
TestKeypad("TermWin");
|
||||
#ifdef SYNLIB
|
||||
CloseTest(False);
|
||||
#endif
|
||||
#ifdef LOG
|
||||
fprintf(TermLog, "TestName: <%s> ENDS\n", argv[0]);
|
||||
fclose(TermLog);
|
||||
#endif
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user