/*
* $XConsortium: Porthole.c,v 1.16 94/04/17 20:12:34 kaleb Exp $
*
Copyright (c) 1990, 1994 X Consortium
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Except as contained in this notice, the name of the X Consortium shall not be
used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from the X Consortium.
*
* Author: Jim Fulton, MIT X Consortium
*
* This widget is a trivial clipping widget. It is typically used with a
* panner or scrollbar to navigate.
*/
#include <X11/IntrinsicP.h>
/*
* resources for the porthole
*/
};
/*
* widget class methods used below
*/
static void Realize(); /* set gravity and upcall */
static void Resize(); /* report new size */
static void ChangeManaged(); /* somebody added a new widget */
{ /* core fields */
/* class_name */ "Porthole",
/* widget_size */ sizeof(PortholeRec),
/* class_initialize */ XawInitializeWidgetSet,
/* class_part_initialize */ NULL,
/* class_inited */ FALSE,
/* initialize */ NULL,
/* initialize_hook */ NULL,
/* realize */ Realize,
/* actions */ NULL,
/* num_actions */ 0,
/* resources */ resources,
/* xrm_class */ NULLQUARK,
/* compress_motion */ TRUE,
/* compress_exposure */ TRUE,
/* compress_enterleave */ TRUE,
/* visible_interest */ FALSE,
/* destroy */ NULL,
/* resize */ Resize,
/* expose */ NULL,
/* set_values */ NULL,
/* set_values_hook */ NULL,
/* set_values_almost */ XtInheritSetValuesAlmost,
/* get_values_hook */ NULL,
/* accept_focus */ NULL,
/* version */ XtVersion,
/* callback_private */ NULL,
/* tm_table */ NULL,
/* query_geometry */ QueryGeometry,
/* display_accelerator */ XtInheritDisplayAccelerator,
/* extension */ NULL
},
{ /* composite fields */
/* geometry_manager */ GeometryManager,
/* change_managed */ ChangeManaged,
/* insert_child */ XtInheritInsertChild,
/* delete_child */ XtInheritDeleteChild,
/* extension */ NULL
},
{ /* porthole fields */
/* ignore */ 0
}
};
/*****************************************************************************
* *
* utility routines *
* *
*****************************************************************************/
{
int i;
/*
* Find the managed child on which we should operate. Ignore multiple
* managed children.
*/
}
}
unsigned int changed;
{
}
}
{
if (geomp) { /* mix in any requested changes */
}
/*
* Make sure that the child is at least as large as the porthole; there
* is no maximum size.
*/
/*
* Make sure that the child is still on the screen. Note that this must
* be done *after* the size computation so that we know where to put it.
*/
}
/*****************************************************************************
* *
* Porthole Widget Class Methods *
* *
*****************************************************************************/
{
*valueMask |= CWBitGravity;
}
{
/*
* If we have a child, we need to make sure that it is at least as big
* as we are and in the right place.
*/
if (child) {
Position x, y;
}
}
{
if (child) {
return XtGeometryYes;
return XtGeometryNo;
else
return XtGeometryAlmost;
}
return XtGeometryNo;
}
Widget w;
{
}
/*
* If we failed on anything, simply return without touching widget
*/
if (!okay) return XtGeometryAlmost;
/*
* If not just doing a query, update widget and send report. Note that
* we will often set fields that weren't requested because we want to keep
* the child visible.
*/
unsigned int changed = 0;
changed |= XawPRSliderX;
}
changed |= XawPRSliderY;
}
}
}
}
return XtGeometryYes; /* success! */
}
{
if (child) {
if (!XtIsRealized (gw)) {
geom.request_mode = 0;
}
}
if (geom.request_mode &&
}
}
}
}