749N/A/* $XConsortium: Grip.c,v 1.33 94/04/17 20:12:10 kaleb Exp $ */
749N/A
749N/A/***********************************************************
749N/A
749N/ACopyright (c) 1987, 1988, 1994 X Consortium
749N/A
749N/APermission is hereby granted, free of charge, to any person obtaining a copy
749N/Aof this software and associated documentation files (the "Software"), to deal
749N/Ain the Software without restriction, including without limitation the rights
749N/Ato use, copy, modify, merge, publish, distribute, sublicense, and/or sell
749N/Acopies of the Software, and to permit persons to whom the Software is
749N/Afurnished to do so, subject to the following conditions:
749N/A
749N/AThe above copyright notice and this permission notice shall be included in
749N/Aall copies or substantial portions of the Software.
749N/A
749N/ATHE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
749N/AIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
749N/AFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
749N/AX CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
749N/AAN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
749N/ACONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
749N/A
749N/AExcept as contained in this notice, the name of the X Consortium shall not be
749N/Aused in advertising or otherwise to promote the sale, use or other dealings
749N/Ain this Software without prior written authorization from the X Consortium.
749N/A
749N/A
749N/ACopyright 1987, 1988 by Digital Equipment Corporation, Maynard, Massachusetts.
749N/A
749N/A All Rights Reserved
749N/A
749N/APermission to use, copy, modify, and distribute this software and its
749N/Adocumentation for any purpose and without fee is hereby granted,
749N/Aprovided that the above copyright notice appear in all copies and that
749N/Aboth that copyright notice and this permission notice appear in
749N/Asupporting documentation, and that the name of Digital not be
749N/Aused in advertising or publicity pertaining to distribution of the
749N/Asoftware without specific, written prior permission.
749N/A
749N/ADIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
749N/AALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
749N/ADIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
749N/AANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
749N/AWHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
749N/AARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
749N/ASOFTWARE.
749N/A
749N/A******************************************************************/
749N/A
749N/A/*
749N/A * Grip.c - Grip Widget (Used by Paned Widget)
749N/A *
749N/A */
749N/A#include <X11/IntrinsicP.h>
749N/A#include <X11/StringDefs.h>
749N/A#include <X11/Xaw/XawInit.h>
749N/A#include <X11/Xaw/GripP.h>
749N/A
749N/Astatic XtResource resources[] = {
749N/A {XtNwidth, XtCWidth, XtRDimension, sizeof(Dimension),
749N/A XtOffsetOf(GripRec, core.width), XtRImmediate,
749N/A (XtPointer) DEFAULT_GRIP_SIZE},
749N/A {XtNheight, XtCHeight, XtRDimension, sizeof(Dimension),
749N/A XtOffsetOf(GripRec, core.height), XtRImmediate,
749N/A (XtPointer) DEFAULT_GRIP_SIZE},
749N/A {XtNforeground, XtCForeground, XtRPixel, sizeof(Pixel),
749N/A XtOffsetOf(GripRec, core.background_pixel), XtRString,
749N/A XtDefaultForeground},
749N/A {XtNborderWidth, XtCBorderWidth, XtRDimension, sizeof(Dimension),
749N/A XtOffsetOf(GripRec, core.border_width), XtRImmediate, (XtPointer)0},
749N/A {XtNcallback, XtCCallback, XtRCallback, sizeof(XtPointer),
749N/A XtOffsetOf(GripRec, grip.grip_action), XtRCallback, NULL},
749N/A};
749N/A
749N/Astatic void GripAction( /* Widget, XEvent*, String*, Cardinal */ );
749N/A
749N/Astatic XtActionsRec actionsList[] =
749N/A{
749N/A {"GripAction", GripAction},
749N/A};
749N/A
749N/A#define SuperClass (&simpleClassRec)
749N/A
749N/AGripClassRec gripClassRec = {
749N/A {
749N/A/* core class fields */
749N/A /* superclass */ (WidgetClass) SuperClass,
749N/A /* class name */ "Grip",
749N/A /* size */ sizeof(GripRec),
749N/A /* class initialize */ XawInitializeWidgetSet,
749N/A /* class_part_init */ NULL,
749N/A /* class_inited */ FALSE,
749N/A /* initialize */ NULL,
749N/A /* initialize_hook */ NULL,
749N/A /* realize */ XtInheritRealize,
749N/A /* actions */ actionsList,
749N/A /* num_actions */ XtNumber(actionsList),
749N/A /* resources */ resources,
749N/A /* resource_count */ XtNumber(resources),
749N/A /* xrm_class */ NULLQUARK,
749N/A /* compress_motion */ TRUE,
749N/A /* compress_exposure */ TRUE,
749N/A /* compress_enterleave*/ TRUE,
749N/A /* visible_interest */ FALSE,
749N/A /* destroy */ NULL,
749N/A /* resize */ NULL,
749N/A /* expose */ NULL,
749N/A /* set_values */ NULL,
749N/A /* set_values_hook */ NULL,
749N/A /* set_values_almost */ XtInheritSetValuesAlmost,
749N/A /* get_values_hook */ NULL,
749N/A /* accept_focus */ NULL,
749N/A /* version */ XtVersion,
749N/A /* callback_private */ NULL,
749N/A /* tm_table */ NULL,
749N/A /* query_geometry */ XtInheritQueryGeometry,
749N/A /* display_accelerator*/ XtInheritDisplayAccelerator,
749N/A /* extension */ NULL
749N/A },
749N/A/* Simple class fields initialization */
749N/A {
749N/A /* change_sensitive */ XtInheritChangeSensitive
749N/A },
749N/A/* Grip class fields initialization */
749N/A {
749N/A /* not used */ 0
749N/A }
749N/A};
749N/A
749N/AWidgetClass gripWidgetClass = (WidgetClass) &gripClassRec;
749N/A
749N/Astatic void GripAction( widget, event, params, num_params )
749N/A Widget widget;
749N/A XEvent *event;
749N/A String *params;
749N/A Cardinal *num_params;
749N/A{
749N/A XawGripCallDataRec call_data;
749N/A
749N/A call_data.event = event;
749N/A call_data.params = params;
749N/A call_data.num_params = *num_params;
749N/A
749N/A XtCallCallbacks( widget, XtNcallback, (XtPointer)&call_data );
749N/A}