wdwmgmt.c revision 7c478bd95313f5f23a4c958a745db2134aa03244
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (the "License"). You may not use this file except in compliance
* with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
/* All Rights Reserved */
/*
* Copyright (c) 1985 AT&T
* All Rights Reserved
*/
#ident "%Z%%M% %I% %E% SMI" /* SVr4.0 1.13 */
#include <stdio.h>
#include "wish.h"
#include "token.h"
#include "slk.h"
#include "actrec.h"
#include "terror.h"
#include "ctl.h"
#include "menudefs.h"
#include "vtdefs.h"
#include "moremacros.h"
#define NMUDGES 4
{ "list", "list all frames", 0 },
{ "move", "move a frame", 0 },
{ "reshape", "reshape a frame", 0 },
};
static struct menu_line
int n;
char *ptr;
{
if (n >= NMUDGES)
n = NMUDGES - 1;
return Mgmt_lines[n];
}
static int
mgmt_odsh(a, t)
struct actrec *a;
token t;
{
int line;
token menu_stream();
t = menu_stream(t);
switch (line) {
case 0: /* list */
list_create();
break;
case 1: /* move */
break;
case 2: /* reshape */
mess_temp("Forms cannot be reshaped");
t = TOK_NOP;
}
else
break;
}
t = TOK_NOP;
} else if (t == TOK_CANCEL) {
ar_backup();
t = TOK_NOP;
} else if (t == TOK_NEXT)
t = TOK_NOP; /* filter out, see menu_stream */
return t;
}
static int
mgmt_help(a)
struct actrec *a;
{
}
int
{
char *cmd;
int len;
extern int Arg_count;
extern char *Args[];
switch (Arg_count) {
case 0:
case 1:
/*
* no arguments to frm-mgmt
*
* assume the current frame and prompt the user for
* the command
*/
ar = ar_get_current();
break;
case 2:
/*
* One argument to frm-mgmt
*
* This case is ambiguous, since the argument could be
* either one of the three commands "move" "reshape" or "list"
* or it could be a window path or number. So, assume it
* is a window if it isn't a command. (Hope nobody tries this
* on a window named "list")
*/
ar = ar_get_current();
}
else {
return(FAIL);
}
}
break;
default:
/*
* Two arguments to frm-mgmt
*
* first arg is the command, the second is the frame
*/
return(FAIL);
}
}
mess_temp("Arguments to \"list\" ignored");
}
else {
"\" ignored", NULL));
return(FAIL);
}
}
/*
* if the command (list, reshape, move ...) is not specified
* then display a menu of available (frame management) commands
*/
return(FAIL);
ar_menu_init(&a);
a.flags = 0;
}
/*
* if the command is "list" then generate a menu that
* will list all active frames
*/
list_create();
}
/*
* if the command is "move" then enter "move" mode ...
*/
}
/*
* if the command is "reshape" then make sure the
* frame can be reshaped before performing the operation
*/
mess_temp("Forms cannot be reshaped");
else
}
else {
mess_temp("Bad argument to frmmgmt: try list, move or reshape");
return(FAIL);
}
return(SUCCESS);
}