#ifndef lint
#endif /* lint */
/***********************************************************
Copyright 1987, 1988 by Digital Equipment Corporation, Maynard, Massachusetts,
and the Massachusetts Institute of Technology, Cambridge, Massachusetts.
All Rights Reserved
Permission to use, copy, modify, and distribute this software and its
documentation for any purpose and without fee is hereby granted,
provided that the above copyright notice appear in all copies and that
both that copyright notice and this permission notice appear in
supporting documentation, and that the names of Digital or MIT not be
used in advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
SOFTWARE.
******************************************************************/
/*
* Command.c - Command button widget
*
*/
#include <stdio.h>
#include <X11/IntrinsicP.h>
#include <X11/StringDefs.h>
#include <./Xaw3_1XawInit.h>
#include <./Xaw3_1CommandP.h>
#ifdef SHAPE
#endif
#ifdef SHAPE
#endif
/****************************************************************
*
* Full class record constant
*
****************************************************************/
/* Private Data */
static char defaultTranslations[] =
"<EnterWindow>: highlight() \n\
<LeaveWindow>: reset() \n\
<Btn1Down>: set() \n\
<Btn1Up>: notify() unset() ";
#ifndef SHAPE
#else
XtRDimension, sizeof(Dimension),
#endif /*SHAPE*/
};
static void ClassInitialize();
#ifdef SHAPE
static Boolean ShapeButton();
#endif /* SHAPE */
{
{"set", Set},
{"notify", Notify},
{"highlight", Highlight},
{"reset", Reset},
{"unset", Unset},
{"unhighlight", Unhighlight},
};
/*
* This is a temporary exported actions list for the command
* widget I have added this code because there is a bug in the MIT
* Xtk Intrinsics implementation that does not allow the action table
* to be retreived from the widget class, Ralph Swick has promised me that
* this will eventually be fixed, but until then this is how the toggle
* widget will get the command widget's actions list.
*
* Chris D. Peterson - 12/28/88.
*/
{
"Command", /* class_name */
sizeof(CommandRec), /* size */
ClassInitialize, /* class_initialize */
NULL, /* class_part_initialize */
FALSE, /* class_inited */
Initialize, /* initialize */
NULL, /* initialize_hook */
#ifdef SHAPE
Realize, /* realize */
#else
XtInheritRealize, /* realize */
#endif /*SHAPE*/
actionsList, /* actions */
resources, /* resources */
NULLQUARK, /* xrm_class */
FALSE, /* compress_motion */
TRUE, /* compress_exposure */
TRUE, /* compress_enterleave */
FALSE, /* visible_interest */
Destroy, /* destroy */
#ifdef SHAPE
Resize, /* resize */
#else
XtInheritResize, /* resize */
#endif /* SHAPE */
Redisplay, /* expose */
SetValues, /* set_values */
NULL, /* set_values_hook */
XtInheritSetValuesAlmost, /* set_values_almost */
NULL, /* get_values_hook */
NULL, /* accept_focus */
XtVersion, /* version */
NULL, /* callback_private */
defaultTranslations, /* tm_table */
XtInheritQueryGeometry, /* query_geometry */
XtInheritDisplayAccelerator, /* display_accelerator */
NULL /* extension */
}, /* CoreClass fields initialization */
{
XtInheritChangeSensitive /* change_sensitive */
}, /* SimpleClass fields initialization */
{
0, /* field not used */
}, /* LabelClass fields initialization */
{
0, /* field not used */
}, /* CommandClass fields initialization */
};
/* for public consumption */
/****************************************************************
*
* Private Procedures
*
****************************************************************/
static GC
{
else
values.line_width = 0;
&values);
}
/* ARGSUSED */
static void
{
#ifdef SHAPE
else
}
#endif /*SHAPE*/
}
static Region
{
return(NULL);
if (outerRegion == NULL) {
/* save time by allocating scratch regions only once. */
outerRegion = XCreateRegion();
innerRegion = XCreateRegion();
emptyRegion = XCreateRegion();
}
return outerRegion;
}
/***************************
*
* Action Procedures
*
***************************/
/* ARGSUSED */
static void
Widget w;
{
return;
if (XtIsRealized(w))
}
/* ARGSUSED */
static void
Widget w;
{
return;
if (XtIsRealized(w)) {
}
}
/* ARGSUSED */
static void
Widget w;
{
}
else
}
/* ARGSUSED */
static void
Widget w;
{
if ( *num_params == (Cardinal) 0)
else {
XtWarning("Too many parameters passed to highlight action table.");
switch (params[0][0]) {
case 'A':
case 'a':
break;
default:
break;
}
}
if (XtIsRealized(w))
}
/* ARGSUSED */
static void
Widget w;
{
if (XtIsRealized(w))
}
/* ARGSUSED */
static void
Widget w;
{
/* check to be sure state is still Set so that user can cancel
the action (e.g. by moving outside the window, in the default
bindings.
*/
}
/*
* Repaint the widget window
*/
/************************
*
* REDISPLAY (DRAW)
*
************************/
/* ARGSUSED */
static void
Widget w;
{
}
/* Function Name: PaintCommandWidget
* Description: Paints the command widget.
* Arguments: w - the command widget.
* region - region to paint (passed to the superclass).
* change - did it change either set or highlight state?
* Returns: none
*/
static void
Widget w;
{
}
else
{
return;
}
/*
* If we are set then use the same colors as if we are not highlighted.
*/
}
else {
}
if (very_thick) {
}
else {
/* wide lines are centered on the path, so indent it */
}
}
}
static void
Destroy(w)
Widget w;
{
/* so Label can release it */
else
}
/*
* Set specified arguments into widget
*/
/* ARGSUSED */
static Boolean
{
/* about to become insensitive */
}
{
/* Label has release one of these */
else
}
#ifdef SHAPE
if ( XtIsRealized(new)
&& !ShapeButton(cbw))
{
}
#endif /*SHAPE*/
return (redisplay);
}
static void ClassInitialize()
{
#ifdef SHAPE
#endif
}
#ifdef SHAPE
static Boolean
{
}
corner_size, corner_size)) {
return(False);
}
}
return(TRUE);
}
Widget w;
{
(w, valueMask, attributes);
ShapeButton( (CommandWidget) w);
}
static void Resize(w)
Widget w;
{
if (XtIsRealized(w))
ShapeButton( (CommandWidget) w);
}
#endif /*SHAPE*/