Xaw3_1Viewport.c revision 749
341N/A/*********************************************************** 341N/ACopyright 1987, 1988 by Digital Equipment Corporation, Maynard, Massachusetts, 919N/Aand the Massachusetts Institute of Technology, Cambridge, Massachusetts. 919N/APermission to use, copy, modify, and distribute this software and its 919N/Adocumentation for any purpose and without fee is hereby granted, 919N/Aprovided that the above copyright notice appear in all copies and that 919N/Aboth that copyright notice and this permission notice appear in 919N/Asupporting documentation, and that the names of Digital or MIT not be 919N/Aused in advertising or publicity pertaining to distribution of the 919N/Asoftware without specific, written prior permission. 919N/ADIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING 919N/AALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL 919N/ADIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR 919N/AANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, 919N/AWHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, 341N/AARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS 341N/A******************************************************************/ {
/* core_class fields */ /* class_name */ "Viewport",
/* class_part_init */ NULL,
/* class_inited */ FALSE,
/* initialize_hook */ NULL,
/* compress_motion */ TRUE,
/* compress_exposure */ TRUE,
/* compress_enterleave*/ TRUE,
/* visible_interest */ FALSE,
/* set_values_hook */ NULL,
/* get_values_hook */ NULL,
/* callback_private */ NULL,
{
/* composite_class fields */ {
/* constraint_class fields */ /* subresource_count */ 0,
{
/* form_class fields */ {
/* viewport_class fields */ * Initialize all widget pointers to NULL. return;
/* If we are not forcing the bars then we are done. */ * Set the clip widget to the correct height. /* take care of bars, &tc. */ /* this is dirty, but it saves the following code: */ /* %%% do we need to hide this child from Form? */ /* make sure we never move past right/bottom borders */ /* make sure we never move past left/top borders */ * intended.{width,height} caches the eventual child dimensions, * but we don't set the mode bits until after we decide that the * child's preferences are not acceptable. do {
/* while intended != prev */ * note that having once decided to turn on either bar * we'll not change our mind until we're next resized, * thus avoiding potential oscillations. /* Function Name: ComputeWithForceBars * Description: Computes the layout give forcebars is set. * Arguments: widget - the viewport widget. * query - whether or not to query the child. * intended - the cache of the childs height is * stored here ( USED AND RETURNED ). * clip_width, clip_height - size of clip window. * If forcebars then needs = allows = has. * Thus if needsvert is set it MUST have a scrollbar. if (
child ==
NULL)
return;
/* no child to scroll. */ if (
child ==
NULL)
return;
/* no child to scroll. */ #
ifdef macII /* bug in the macII A/UX 1.0 cc */#
else /* else not macII */#
ifdef macII /* bug in the macII A/UX 1.0 cc */#
else /* else not macII */ /* horizontal scrollbar will be needed so possibly reduce height */ /* vertical scrollbar will be needed, so possibly reduce width */ /* This is the Realize call; we'll inherit a w&h iff none currently */