/*
*
* (c) Copyright 1993-1994 Adobe Systems Incorporated.
* All rights reserved.
*
* Permission to use, copy, modify, distribute, and sublicense this software
* and its documentation for any purpose and without fee is hereby granted,
* provided that the above copyright notices appear in all copies and that
* both those copyright notices and this permission notice appear in
* supporting documentation and that the name of Adobe Systems Incorporated
* not be used in advertising or publicity pertaining to distribution of the
* software without specific, written prior permission. No trademark license
* to use the Adobe trademarks is hereby granted. If the Adobe trademark
* "Display PostScript"(tm) is used to describe this software, its
* functionality or for any other purpose, such use shall be limited to a
* statement that this software works in conjunction with the Display
* PostScript system. Proper trademark attribution to reflect Adobe's
* ownership of the trademark shall be given whenever any such reference to
* the Display PostScript system is made.
*
* ADOBE MAKES NO REPRESENTATIONS ABOUT THE SUITABILITY OF THE SOFTWARE FOR
* ANY PURPOSE. IT IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY.
* ADOBE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
* IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NON- INFRINGEMENT OF THIRD PARTY RIGHTS. IN NO EVENT SHALL ADOBE BE LIABLE
* TO YOU OR ANY OTHER PARTY FOR ANY SPECIAL, INDIRECT, OR CONSEQUENTIAL
* DAMAGES OR ANY DAMAGES WHATSOEVER WHETHER IN AN ACTION OF CONTRACT,
* NEGLIGENCE, STRICT LIABILITY OR ANY OTHER ACTION ARISING OUT OF OR IN
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ADOBE WILL NOT
* PROVIDE ANY TRAINING OR OTHER SUPPORT FOR THE SOFTWARE.
*
* Adobe, PostScript, and Display PostScript are trademarks of Adobe Systems
* Incorporated which may be registered in certain jurisdictions
*
* Author: Adobe Systems Incorporated
*/
/* $XFree86$ */
#include <X11/IntrinsicP.h>
#include <X11/StringDefs.h>
#include <stdlib.h>
/* There are no words to describe how I feel about having to do this */
#if XmVersion > 1001
#include <Xm/ManagerP.h>
#else
#endif
#include <Xm/DrawingA.h>
#include <Xm/ScrolledW.h>
#include <Xm/ScrollBar.h>
#include <DPS/dpsXclient.h>
#include "dpsXcommonI.h"
#include <DPS/dpsXshare.h>
#include "DSWwraps.h"
#include <stdio.h>
#include <DPS/DPSScrollWP.h>
#define MIN(a, b) ((a) < (b) ? (a) : (b))
#define MAX(a, b) ((a) > (b) ? (a) : (b))
#define ABS(x) ((x) >= 0 ? (x) : -(x))
/* Define macros to get rectangle entries. All rectangles are stored as
x, y, width, height. NOTE: ONLY FOR USER SPACE RECTANGLES, NOT X
RECTANGLES!!!! */
#define LEFT(r) ((r)[0])
/* This is used in converting bounding boxes into user space to ensure
that we don't end up slopping over into another pixel */
XtRBoolean, sizeof(Boolean),
XtRBoolean, sizeof(Boolean),
};
static Boolean GiveFeedbackPixmap(Widget w, Pixmap p, int width, int height, int depth, Screen *screen);
static Boolean TakeFeedbackPixmap(Widget w, Pixmap *p, int *width, int *height, int *depth, Screen **screen);
static XtGeometryResult GeometryManager(Widget w, XtWidgetGeometry *desired, XtWidgetGeometry *allowed);
static XtGeometryResult QueryGeometry(Widget w, XtWidgetGeometry *desired, XtWidgetGeometry *allowed);
static void AbortPendingDrawing(Widget w);
static void DrawingAreaGraphicsExpose(Widget w, XtPointer clientData, XEvent *event, Boolean *goOn);
static void FinishPendingDrawing(Widget w);
static void GetDrawingInfo(Widget w, DSWDrawableType *type, Drawable *drawable, DPSGState *gstate, DPSContext *context);
static void GetScrollInfo(Widget w, int *h_value, int *h_size, int *h_max, int *v_value, int *v_size, int *v_max);
static void SetFeedbackDirtyArea(Widget w, float *rects, int count, XtPointer continue_feedback_data);
/* Core class part */
{
/* class_name */ "DPSScrolledWindow",
/* widget_size */ sizeof(DPSScrolledWindowRec),
/* class_initialize */ NULL,
/* class_part_initialize */ ClassPartInitialize,
/* class_inited */ False,
/* initialize */ Initialize,
/* initialize_hook */ NULL,
/* realize */ Realize,
/* actions */ NULL,
/* num_actions */ 0,
/* resources */ resources,
/* xrm_class */ NULLQUARK,
/* compress_motion */ True,
/* compress_exposure */ XtExposeCompressMultiple,
/* compress_enterleave */ True,
/* visible_interest */ False,
/* destroy */ Destroy,
/* resize */ Resize,
/* expose */ NULL,
/* set_values */ SetValues,
/* set_values_hook */ NULL,
/* set_values_almost */ XtInheritSetValuesAlmost,
/* get_values_hook */ NULL,
/* accept_focus */ NULL,
/* version */ XtVersion,
/* callback offsets */ NULL,
/* tm_table */ NULL,
/* query_geometry */ QueryGeometry,
/* display_accelerator */ NULL,
/* extension */ NULL,
},
/* Composite class part */
{
/* geometry_manager */ GeometryManager,
/* change_managed */ NULL,
/* insert_child */ XtInheritInsertChild,
/* delete_child */ XtInheritDeleteChild,
/* extension */ NULL,
},
/* Constraint class part */
{
/* resources */ NULL,
/* num_resources */ 0,
/* constraint_size */ 0,
/* initialize */ NULL,
/* destroy */ NULL,
/* set_values */ NULL,
/* extension */ NULL,
},
/* Manager class part */
{
/* translations */ XtInheritTranslations,
/* syn_resources */ NULL,
/* num_syn_resources */ 0,
/* syn_constraint_resources */ NULL,
/* num_syn_constraint_resources */ 0,
/* parent_process */ XmInheritParentProcess,
/* extension */ NULL,
},
/* DPSScrolledWindow class part */
{
/* set_scale */ SetScale,
/* scroll_point */ ScrollPoint,
/* scroll_by */ ScrollBy,
/* scroll_to */ ScrollTo,
/* set_scale_and_scroll */ SetScaleAndScroll,
/* convert_x_to_ps */ ConvertXToPS,
/* convert_ps_to_x */ ConvertPSToX,
/* add_to_dirty_area */ AddToDirtyArea,
/* take_feedback_pixmap */ TakeFeedbackPixmap,
/* give_feedback_pixmap */ GiveFeedbackPixmap,
/* start_feedback_drawing */ StartFeedbackDrawing,
/* end_feedback_drawing */ EndFeedbackDrawing,
/* set_feedback_dirty_area */ SetFeedbackDirtyArea,
/* finish_pending_drawing */ FinishPendingDrawing,
/* abort_pending_drawing */ AbortPendingDrawing,
/* get_drawing_info */ GetDrawingInfo,
/* update_drawing */ UpdateDrawing,
/* get_scroll_info */ GetScrollInfo,
/* extension */ NULL,
}
};
/***** UTILITY FUNCTIONS *****/
{
int i;
for (i = 0; i < num_r; i++) {
printf("Rectangle %d: ", i);
r += 4;
}
}
/* Make sure the list pointed to by r can hold n more rectangles. Always
grow by at least min_grow */
static void GrowRectList(
float **r,
short *r_size,
short num_r,
int n, int min_grow)
{
}
}
static void GrowIntRectList(
int **r,
short *r_size,
short num_r,
int n, int min_grow)
{
}
}
{
return True;
}
/* Subtract sub from src, putting result into dst. Return rectangle count */
{
int n = 0;
/* If bottom of sub is greater than bottom of src, there's a
rectangle across the bottom */
n++;
dst += 4;
}
/* If left of sub is greater than left of src, there's a left rectangle. */
n++;
dst += 4;
}
/* If right of sub is less than right of src, there's a right rect */
n++;
dst += 4;
}
/* If top of sub is less than top of src, there's a top rectangle */
n++;
dst += 4;
}
return n;
}
{
}
{
}
/* These are used by the SubtractRects and IntersectRects procedures */
static short rbuf_size = 0;
/* Replace the rectangle list in src with src minus sub */
static void SubtractRects(
float **src,
short *src_size,
short *num_src,
float *sub,
int num_sub)
{
short num_rbuf;
float *r;
int i;
/* Go through, subtracting the first sub rectangle from each src
rectangle. Put the result in the internal buffer, then copy this
list to the src. Repeat for each sub rectangle. */
while (num_sub > 0) {
num_rbuf = 0;
if (Intersects(r, sub)) {
/* Subtract sub from r, putting result into rbuf. First
make sure there are at least 4 spaces in the buffer */
/* Do the subtraction */
} else {
/* Copy r into buffer */
num_rbuf++;
}
}
/* Copy buffered rectangles back into src */
/* Check if we've taken everything away */
if (*num_src == 0) return;
/* Skip on to the next sub rectangle */
num_sub--;
sub += 4;
}
}
/* Replace list r1 with the intersection of r1 and r2 */
static void IntersectRects(
float **r1,
short *r1_size,
short *num_r1,
float *r2,
int num_r2)
{
short num_rbuf = 0;
float *r;
int i;
/* Fairly straightforward. Intersect each rectangle in r1 with each
rectangle in r2, then copy the results to r1 */
while (num_r2 > 0) {
if (Intersects(r, r2)) {
num_rbuf++;
}
}
num_r2--;
r2 += 4;
}
/* Copy intersection rectangles back into r1 */
}
{
int i, j, k;
float *r, *r1;
i = 0;
while (i < *num) {
r = rect + (i * 4);
(*num)--;
goto LOOPEND;
}
j = i+1;
while (j < *num) {
(*num)--;
(*num)--;
goto LOOPEND;
} else j++;
}
i++;
LOOPEND:;
}
}
{
} else {
}
}
{
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
{
Widget w;
XtVaCreateManagedWidget("scrolledWindow",
NULL);
XtVaCreateManagedWidget("horizontalScrollBar",
NULL);
XtVaCreateManagedWidget("verticalScrollBar",
NULL);
XtVaCreateManagedWidget("drawingArea",
xmDrawingAreaWidgetClass, w, NULL);
}
/* ARGSUSED */
{
/* Set the initial dirty area to everything */
/* Make the scratch list have at least one element */
/* Get the context */
}
/* Watch progress only works with pass-through event dispatching */
dps_init_bit_dsw, &inited) ==
}
&gcVal);
}
{
}
}
}
}
}
}
}
}
}
{
}
{
}
{
}
{
pixmapError = True;
return 0;
}
{
Pixmap p;
unsigned int dBytes;
unsigned area = (w * h);
return None;
}
}
pixmapError = False;
(void) XSetErrorHandler(oldHandler);
if (pixmapError) return None;
else return p;
}
{
Pixmap p;
if (p != None) {
return;
}
}
}
{
}
static void SetDrawingAreaPosition(
float ix,
float iy,
int vx,
int vy,
{
/* Convert ix, iy into X units */
/* The scaled width is narrower than the view window, so
center the picture and set scroll bar to be unscrollable */
/ 2.0;
scrollX = 0;
} else {
/* The scaled width is larger than the view window, so
turn on the scroll bar, and set up its maximum and
slider size. Do this by converting the image offset into X
coordinates and subtracting the view offset */
}
/* Now do the same thing for the height. We want to compute the offset
relative to the lower left corner, but X coordinates are relative
to the upper left, so the drawing height must be added in. Also, since
the coordinates go in the other direction, the view offset must be
added, not subtracted. */
} else {
}
/* Update the scrollbars */
scrollY + 0.5);
}
if (setOrigin) {
/* Set the origin in the X window to reflect the new location */
}
}
static void DrawBackground(
{
e.directions = DSWFinish;
e.results = DSWUndefined;
e.background = True;
if (which == DSWBackingPixmap) {
} else if (which == DSWFeedbackPixmap) {
} else {
}
do {
(XtPointer) &e);
if (e.results == DSWUndefined) {
"returnError", "backgroundCallback",
"DPSScrollError",
"Background callback did not set result field",
}
e.results = DSWFinished;
}
} while (e.results != DSWFinished);
}
static void ClipToDrawingSize(
{
int i;
float r[4];
/* Copy current drawing area to scratch */
}
/* Construct a rectangle of the drawing area */
r, r+1);
r+2, r+3);
r[2] -= r[0];
r[3] -= r[1];
/* Subtract the area of the drawing from the current drawing list */
/* Now intersect the rectangle with the current drawing area */
/* If nothing left, we won't be drawing anything more, so
synchronize. Otherwise wait until we're done drawing */
}
/* Copy scratch back into the current drawing list */
}
}
{
e.directions = howMuch;
e.results = DSWUndefined;
e.background = False;
if (which == DSWBackingPixmap) {
} else if (which == DSWFeedbackPixmap) {
} else {
}
if (first) {
}
}
do {
(XtPointer) &e);
if (e.results == DSWUndefined) {
"returnError", "exposeCallback",
"DPSScrollError",
"Expose callback did not set result field",
}
e.results = DSWFinished;
}
howMuch == DSWAbortOrFinish) ||
if (e.results == DSWFinished) {
}
return e.results;
}
static void SplitExposeEvent(
{
float *r;
int i;
/* Put the expose event into the scratch list */
/* Subtract the dirty area from the exposed area and copy the resulting
area to the window */
}
/* Now do it again, but intersect the exposed area with the dirty area
and add the intersection to the pending list */
}
/* ARGSUSED */
XEvent *e,
char *arg)
{
}
static void CopyWindowToBackingPixmap(
{
XEvent e;
int i;
float *r;
int copies = 0;
copies++;
}
/* Unfortunately the Intrinsics won't let us get ahold of the the
GraphicsExpose events for the pixmap, so we have to wait and
get them the old fashioned way. Yuck. */
while (copies > 0) {
(char *) dsw);
continue;
} else if (e.type == GraphicsExpose) {
} else copies--; /* NoExpose */
}
} else {
/* The dirty area is now the intersection of the old dirty area and
the newly-created current drawing list */
}
}
/* Subtract the window area from the dirty area, and make the
result be the new current drawing list */
static void SetCurrentDrawingToBackground(
{
int i;
float r[4];
r, r+1);
r+2, r+3);
r[2] -= r[0];
r[3] -= r[1];
}
}
{
int i;
int *r;
}
}
static void UpdateWindowFromBackingPixmap(
float *rects,
int n)
{
int i;
float *r;
for (i = 0; i < n; i++) {
r = rects + 4*i;
}
}
static void UpdateWindowFromFeedbackPixmap(
float *rects,
int n)
{
int i;
float *r;
for (i = 0; i < n; i++) {
r = rects + (i * 4);
}
}
/* This is the heart of the drawing code; it does one piece of drawing.
It can be called either directly or as a work procedure */
{
}
case DSWStart:
case DSWDrawingVisible:
} else which = DSWBackingPixmap;
if (results == DSWFinished) {
} else {
} else {
}
}
}
break;
case DSWDrewVisible:
case DSWDrawingBackground:
if (results == DSWFinished) {
}
break;
case DSWDone:
break;
}
}
/* Some of the background drawing may have been to areas that
are visible */
}
}
return True;
} else return False;
}
{
float r[4];
/* Intersect the current drawing area with the pending dirty area
(The pending dirty area represents the window exposures that
have happened so far) */
} else {
/* Intersect the current drawing area to the window to start */
r[2] -= r[0];
r[3] -= r[1];
}
}
return;
}
}
}
{
float r[8];
int n;
/* If one of the deltas is 0, then the area to update is just a
single rectangle. */
if (deltaX == 0) {
/* Just a single horizontal rectangle */
xllx = 0;
if (deltaY > 0) {
} else {
xury = 0;
}
} else if (deltaY == 0) {
/* Just a single vertical rectangle */
xury = 0;
if (deltaX > 0) {
} else {
xllx = 0;
}
}
/* Convert the rectangle into PS coordinates */
r[0] = llx;
r[1] = lly;
n = 1;
} else {
/* Scrolling in both directions, so there are two rectangles.
It's easiest to do if we let them overlap; fortunately that is
legal! First do the horizontal rectangle. */
xllx = 0;
if (deltaY > 0) {
} else {
xury = 0;
}
/* Store in point array */
r[0] = llx;
r[1] = lly;
/* Now do vertical rectangle and store in point array */
xury = 0;
if (deltaX > 0) {
} else {
xllx = 0;
}
r[4] = llx;
r[5] = lly;
n = 2;
}
AddRectsToDirtyArea(dsw, r, n);
}
{
/* Make the dirty area match the window */
} else {
llx = 0;
}
} else {
ury = 0;
}
r[2] -= r[0];
r[3] -= r[1];
}
}
}
/* ARGSUSED */
{
}
{
int i;
int match;
/* If the context's colormap matches the widget's colormap, assume that
everything is already set up right in the color cube department. This
allows an application to supply us with a custom color cube by
installing it in the context before calling us */
if (match) {
} else {
(XDPSStandardColormap *) &grayRamp,
}
}
}
/* If watching progress or no pixmap, clear the window to ensure
that things get started */
0, 0, 0, 0, True);
/* Set a timer so that we start drawing if nothing is visible */
}
} else {
/* Put a synthetic expose event in the pending queue */
}
}
static void Realize(
Widget w,
{
/* Let my parent do all the hard work */
/* We delay calling the setup callback so that the caller can use
XtAddCallback to add it */
/* Now, explicitly realize my children */
/* Et voila, now we have windows! */
}
{
}
case DSWStart:
return;
/* break; */
case DSWDrawingVisible:
} else which = DSWBackingPixmap;
if (results == DSWAborted) {
/* Add the current drawing area back into the pending
expose area */
}
return;
}
}
if (results == DSWAborted) {
return;
}
} else {
}
if (results == DSWAborted) {
return;
}
}
}
}
break;
case DSWDrewVisible:
case DSWDrawingBackground:
if (results == DSWAborted) {
return;
}
break;
case DSWDone:
break;
}
return;
}
{
}
case DSWStart:
case DSWDone:
case DSWDrewVisible:
break;
case DSWDrawingVisible:
} else which = DSWBackingPixmap;
break;
case DSWDrawingBackground:
break;
}
}
{
}
case DSWStart:
case DSWDrawingVisible:
} else which = DSWBackingPixmap;
}
}
} else {
}
}
}
}
break;
case DSWDrewVisible:
case DSWDrawingBackground:
break;
case DSWDone:
break;
}
}
static void DoScroll(
{
/* Set the PS origin in the X window to the new settings of
the scrollbars */
/* Update the graphics states for the window and backing pixmap to
reflect new origin */
}
/* Update the stored position of the scroll bars */
}
static void ShiftPendingExpose(
{
int i;
int *r;
r[0] -= deltaX;
r[1] -= deltaY;
}
}
static void HScrollCallback(
Widget w,
{
}
}
static void VScrollCallback(
Widget w,
{
}
}
/* ARGSUSED */
{
/* If we haven't started drawing yet, it must be because we're waiting
for GraphicsExpose events. Delay scrolling until they come in */
/* Calculate the delta in the scrolling */
/* If there is some scrolling to do, then scroll the pixmap and
copy the pixmap to the window */
/* Copy visible area to new location */
}
} else {
}
}
}
float *r;
r, r+1);
r+2, r+3);
r[2] -= r[0];
r[3] -= r[1];
/* Initialize the feedback pixmap with a copy of the drawing */
} else {
}
}
}
}
}
} else {
}
}
static void AddExposureToPending(
{
float *f;
int *i;
f[2] -= f[0];
f[3] -= f[1];
}
i[0] = ev->x;
i[1] = ev->y;
}
static void AddRectsToPending(
int *newRect,
int n)
{
int *r;
int i;
float *f;
for (i = 0; i < n; i++) {
r = newRect + (i * 4);
f[2] -= f[0];
f[3] -= f[1];
}
}
for (i = 0; i < 4*n; i++) r[i] = newRect[i];
}
static void AddUserSpaceRectsToPending(
float *newRect,
int n)
{
int *r;
int i;
float *f;
for (i = 0; i < 4*n; i++) f[i] = newRect[i];
}
for (i = 0; i < n; i++) {
f = newRect + (i * 4);
r[2] -= r[0];
r[3] -= r[1];
}
}
static void CopyRectsToCurrentDrawing(
float *newRect,
int n)
{
float *r;
int i;
0, n, 1);
for (i = 0; i < 4*n; i++) r[i] = newRect[i];
}
static void CopyRectsToDirtyArea(
float *newRect,
int n)
{
float *r;
int i;
for (i = 0; i < 4*n; i++) r[i] = newRect[i];
}
static void AddRectsToDirtyArea(
float *newRect,
int n)
{
float *r;
int i;
for (i = 0; i < 4*n; i++) r[i] = newRect[i];
}
static void CopyRectsToPrevDirtyArea(
float *newRect,
int n)
{
float *r;
int i;
for (i = 0; i < 4*n; i++) r[i] = newRect[i];
}
/* ARGSUSED */
static void DrawingAreaGraphicsExpose(
Widget w,
{
case GraphicsExpose:
/* GraphicsExpose occur during unbuffered scrolling */
/* Unbuffered scrolling case */
}
}
break;
}
}
{
return True;;
}
}
return False;
}
static void DrawingAreaExpose(
Widget w,
{
} else {
}
}
}
}
return;
}
if (MoreExposes(w)) return;
}
return;
}
return;
}
} else {
if (MoreExposes(w)) return;
}
}
}
}
{
float x, y;
r.x = r.y = 0;
if (XtIsRealized(w)) {
ConvertToPS(dsw, (float) r.x, (float) r.y, &x, &y);
} else if (r.x != 0 || r.y != 0) ScrollBy(w, r.x, r.y);
if (!XtIsRealized(w)) return;
0, 0, 0, 0, True);
} else {
}
}
float *r;
r, r+1);
r+2, r+3);
r[2] -= r[0];
r[3] -= r[1];
/* Initialize the feedback pixmap with a copy of the drawing */
} else {
}
} else {
} else {
}
}
}
}
}
}
{
}
}
}
}
}
{
/* Create graphics states for the window and backing pixmap in
the new context */
}
}
}
{
unsigned int dBytes;
}
}
}
if (freeIt) {
}
}
{
/* Make everything dirty */
}
/* Keep the upper left in the same place */
}
}
{
int i;
float *r;
}
}
{
/* Get rid of one if we have it */
}
} else {
float *r;
r[2] -= r[0];
r[3] -= r[1];
/* Initialize the feedback pixmap with a copy of the drawing */
} else {
}
}
}
}
}
/* ARGSUSED */
{
}
dps_init_bit_dsw, &inited) ==
}
if (XtIsRealized(newdsw)) {
}
}
/* Watch progress only works with pass-through event dispatching */
if (NE(watch_progress)) {
}
}
}
/* It's too confusing to let any of these things change in the middle
of drawing */
if (NE(use_backing_pixmap)) {
}
if (NE(document_size_pixmaps)) {
}
}
if (NE(dirty_areas)) {
AddRectsToDirtyArea(newdsw, r, n);
} else {
AddUserSpaceRectsToPending(newdsw, r, n);
}
}
return False;
}
Widget w,
{
/* Pass geometry requests up to our parent */
}
Widget w,
{
/* Pass geometry requests down to our child */
}
static void CopyToFeedbackPixmap(
float *rects,
int n)
{
int i;
float *r;
for (i = 0; i < n; i++) {
r = rects + (i * 4);
}
}
static void CallFeedbackCallback(
float *r,
int n)
{
} else {
f.type = DSWFeedbackPixmap;
}
f.dirty_rects = r;
f.dirty_count = n;
(XtPointer) &f);
}
static void SetScale(
Widget w,
double scale,
{
}
void DSWSetScale(
Widget w,
double scale,
{
(*((DPSScrolledWindowWidgetClass) XtClass(w))->
}
static void ScrollPoint(
Widget w,
{
if (!XtIsRealized(w)) {
return;
} else {
}
}
void DSWScrollPoint(
Widget w,
{
(*((DPSScrolledWindowWidgetClass) XtClass(w))->
}
{
int value;
} else {
}
}
}
}
}
}
{
(*((DPSScrolledWindowWidgetClass) XtClass(w))->
}
{
if (XtIsRealized(w)) {
if (x < 0) x = 0;
}
if (y < 0) y = 0;
}
}
}
}
{
(*((DPSScrolledWindowWidgetClass) XtClass(w))->
}
static void SetScaleAndScroll(
Widget w,
double scale,
{
union {
int i;
float f;
} kludge;
}
void DSWSetScaleAndScroll(
Widget w,
double scale,
{
(*((DPSScrolledWindowWidgetClass) XtClass(w))->
}
static void ConvertXToPS(
Widget w,
{
}
void DSWConvertXToPS(
Widget w,
{
(*((DPSScrolledWindowWidgetClass) XtClass(w))->
}
static void ConvertPSToX(
Widget w,
{
}
void DSWConvertPSToX(
Widget w,
{
(*((DPSScrolledWindowWidgetClass) XtClass(w))->
}
static void AddToDirtyArea(
Widget w,
float *rect,
long n)
{
}
}
void DSWAddToDirtyArea(
Widget w,
float *rect,
long n)
{
(*((DPSScrolledWindowWidgetClass) XtClass(w))->
}
Widget w,
Pixmap *p,
{
if (*p == None) {
return True;
}
return True;
}
Widget w,
Pixmap *p,
{
return (*((DPSScrolledWindowWidgetClass) XtClass(w))->
}
static void StartFeedbackDrawing(
Widget w,
{
float *r;
/* Initialize the feedback pixmap with a copy of the drawing */
0, 1, 1);
r, r+1);
r+2, r+3);
r[2] -= r[0];
r[3] -= r[1];
} else {
}
}
}
void DSWStartFeedbackDrawing(
Widget w,
{
(*((DPSScrolledWindowWidgetClass) XtClass(w))->
}
static void EndFeedbackDrawing(
Widget w,
int restore)
{
if (restore) {
} else {
}
}
}
}
void DSWEndFeedbackDrawing(
Widget w,
{
(*((DPSScrolledWindowWidgetClass) XtClass(w))->
}
static void SetFeedbackDirtyArea(
Widget w,
float *rects,
int count,
{
int i;
float *r;
for (i = 0; i < count; i++) {
r = rects + (i * 4);
if (WIDTH(r) < 0) {
}
if (HEIGHT(r) < 0) {
}
}
} else {
}
} else {
}
}
}
void DSWSetFeedbackDirtyArea(
Widget w,
float *rects,
int count,
{
(*((DPSScrolledWindowWidgetClass) XtClass(w))->
}
{
}
{
(*((DPSScrolledWindowWidgetClass) XtClass(w))->
}
{
}
{
(*((DPSScrolledWindowWidgetClass) XtClass(w))->
}
static void UpdateDrawing(
Widget w,
float *rects,
int count)
{
int i;
float *r;
return;
}
for (i = 0; i < count; i++) {
r = rects + (i * 4);
}
}
void DSWUpdateDrawing(
Widget w,
float *rects,
int count)
{
(*((DPSScrolledWindowWidgetClass) XtClass(w))->
}
static void GetScrollInfo(
Widget w,
{
}
void DSWGetScrollInfo(
Widget w,
{
(*((DPSScrolledWindowWidgetClass) XtClass(w))->
}
static void GetDrawingInfo(
Widget w,
{
*type = DSWBackingPixmap;
} else {
}
}
void DSWGetDrawingInfo(
Widget w,
{
(*((DPSScrolledWindowWidgetClass) XtClass(w))->
}
Widget w,
Pixmap p,
{
return True;
}
Widget w,
Pixmap p,
{
return (*((DPSScrolledWindowWidgetClass) XtClass(w))->
}
static void ConvertToX(
float psX,
float psY,
int *xX,
int *xY)
{
}
static void ConvertToPS(
{
}
static void ConvertToOrigPS(
{
}