Back to index

plt-scheme  4.2.1
Functions | Variables
xwScrollWin.c File Reference
#include <X11/IntrinsicP.h>
#include <X11/StringDefs.h>
#include <stdio.h>
#include <xwEnforcer.h>
#include <xwBoard.h>
#include <xwVScrollb.h>
#include <xwHScrollb.h>
#include <xwscroll.h>
#include <./xwScrollWinP.h>

Go to the source code of this file.

Functions

static void _resolve_inheritance ()
static void initialize ()
static Boolean set_values ()
static void resize ()
static void insert_child ()
static void compute_inside ()
static void destroy ()
static void scroll_response ()
static void compute_sizes ()
static void copy_vScrollAmount ()
static void scroll_callback ()
static void CW_killed ()
static void configure ()
static void compute_sizes (Widget self)
static void copy_vScrollAmount (Widget self, int offset, XrmValue *value)
static void scroll_callback (Widget w, XtPointer client_data, XtPointer call_data)
static void CW_killed (Widget w, XtPointer client_data, XtPointer call_data)
static void configure (Widget w, XtPointer client_data, XEvent *event, Boolean *cont)
static void _resolve_inheritance (WidgetClass class)
static void initialize (Widget request, Widget self, ArgList args, Cardinal *num_args)
static Boolean set_values (Widget old, Widget request, Widget self, ArgList args, Cardinal *num_args)
static void resize (Widget self)
static void insert_child (Widget child)
static void compute_inside (Widget self, Position *x, Position *y, int *w, int *h)
static void destroy (Widget self)
static void scroll_response (Widget w, XtPointer client_data, XtPointer call_data)
void xws_set_scroll_direct (Widget self, long hlen, long hpage, long hpos, long vlen, long vpage, long vpos)
void xws_get_scroll_pos (Widget self, double *x, double *y)
void xws_get_scroll_area (Widget self, Dimension *x, Dimension *y)
void ScrollWinViewableHeight (Widget self, int *boardht)

Variables

static XtResource resources []
XfwfScrolledWindowClassRec xfwfScrolledWindowClassRec
WidgetClass xfwfScrolledWindowWidgetClass = (WidgetClass) &xfwfScrolledWindowClassRec

Function Documentation

static void _resolve_inheritance ( ) [static]
static void _resolve_inheritance ( WidgetClass  class) [static]

Definition at line 364 of file xwScrollWin.c.

{
  XfwfScrolledWindowWidgetClass c = (XfwfScrolledWindowWidgetClass) class;
  XfwfScrolledWindowWidgetClass super;
  static CompositeClassExtensionRec extension_rec = {
    NULL, NULLQUARK, XtCompositeExtensionVersion,
    sizeof(CompositeClassExtensionRec), True};
  CompositeClassExtensionRec *ext;
  ext = (XtPointer)XtMalloc(sizeof(*ext));
  *ext = extension_rec;
  ext->next_extension = c->composite_class.extension;
  c->composite_class.extension = ext;
  if (class == xfwfScrolledWindowWidgetClass) return;
  super = (XfwfScrolledWindowWidgetClass)class->core_class.superclass;
  if (c->xfwfScrolledWindow_class.scroll_response == XtInherit_scroll_response)
    c->xfwfScrolledWindow_class.scroll_response = super->xfwfScrolledWindow_class.scroll_response;
}

Here is the call graph for this function:

static void compute_inside ( ) [static]
static void compute_inside ( Widget  self,
Position *  x,
Position *  y,
int w,
int h 
) [static]

Definition at line 528 of file xwScrollWin.c.

{
    xfwfBoardClassRec.xfwfCommon_class.compute_inside((((XfwfScrolledWindowWidget)self)->xfwfScrolledWindow.board ? ((XfwfScrolledWindowWidget)self)->xfwfScrolledWindow.board : self), x, y, w, h);
}
static void compute_sizes ( ) [static]

Here is the caller graph for this function:

static void compute_sizes ( Widget  self) [static]

Definition at line 82 of file xwScrollWin.c.

{
    int selfw, selfh, framew, frameh, vsheight, hswidth;
    Dimension help;
    Position selfx, selfy;
    int edgeX;

    xfwfBoardClassRec.xfwfCommon_class.compute_inside(self, &selfx, &selfy, &selfw, &selfh);
    if (! ((XfwfScrolledWindowWidget)self)->xfwfScrolledWindow.hideHScrollbar)
       vsheight = (int)selfh - 3 * ((XfwfScrolledWindowWidget)self)->xfwfScrolledWindow.spacing - ((XfwfScrolledWindowWidget)self)->xfwfScrolledWindow.scrollbarWidth;
    else
       vsheight = (int)selfh - 2 * ((XfwfScrolledWindowWidget)self)->xfwfScrolledWindow.spacing;
    if (! ((XfwfScrolledWindowWidget)self)->xfwfScrolledWindow.hideVScrollbar)
       hswidth = (int)selfw - 3 * ((XfwfScrolledWindowWidget)self)->xfwfScrolledWindow.spacing - ((XfwfScrolledWindowWidget)self)->xfwfScrolledWindow.scrollbarWidth;
    else
       hswidth = (int)selfw - 2 * ((XfwfScrolledWindowWidget)self)->xfwfScrolledWindow.spacing;
    edgeX = (((XfwfScrolledWindowWidget)self)->xfwfScrolledWindow.edgeBars ? 1 + ((XfwfScrolledWindowWidget)self)->xfwfFrame.frameWidth : 0);
    XtVaGetValues(((XfwfScrolledWindowWidget)self)->xfwfScrolledWindow.vscroll, XtNhighlightThickness, &help, NULL);
    if (help > ((XfwfScrolledWindowWidget)self)->xfwfScrolledWindow.spacing) help = 0;
    help += ((XfwfScrolledWindowWidget)self)->xfwfFrame.frameWidth;
    XtConfigureWidget(((XfwfScrolledWindowWidget)self)->xfwfScrolledWindow.vscroll,
                    selfx + selfw - ((XfwfScrolledWindowWidget)self)->xfwfScrolledWindow.spacing - ((XfwfScrolledWindowWidget)self)->xfwfScrolledWindow.scrollbarWidth + edgeX,
                    selfy + ((XfwfScrolledWindowWidget)self)->xfwfScrolledWindow.spacing - help,
                    ((XfwfScrolledWindowWidget)self)->xfwfScrolledWindow.scrollbarWidth,
                    max(1, vsheight + 2*help + (((XfwfScrolledWindowWidget)self)->xfwfScrolledWindow.hideHScrollbar ? 0 : edgeX)),
                    0);
    XtVaGetValues(((XfwfScrolledWindowWidget)self)->xfwfScrolledWindow.hscroll, XtNhighlightThickness, &help, NULL);
    if (help > ((XfwfScrolledWindowWidget)self)->xfwfScrolledWindow.spacing) help = 0;
    help += ((XfwfScrolledWindowWidget)self)->xfwfFrame.frameWidth;
    XtConfigureWidget(((XfwfScrolledWindowWidget)self)->xfwfScrolledWindow.hscroll,
                    ((XfwfScrolledWindowWidget)self)->xfwfScrolledWindow.spacing /* - help */,
                    selfy + selfh - ((XfwfScrolledWindowWidget)self)->xfwfScrolledWindow.spacing - ((XfwfScrolledWindowWidget)self)->xfwfScrolledWindow.scrollbarWidth + edgeX,
                    max(1, hswidth + 2*help + (((XfwfScrolledWindowWidget)self)->xfwfScrolledWindow.hideVScrollbar ? 0 : edgeX)),
                    ((XfwfScrolledWindowWidget)self)->xfwfScrolledWindow.scrollbarWidth,
                    0);
    XtVaGetValues(((XfwfScrolledWindowWidget)self)->xfwfScrolledWindow.frame, XtNhighlightThickness, &help, NULL);
    if (help > ((XfwfScrolledWindowWidget)self)->xfwfScrolledWindow.spacing) help = 0;
    framew = selfw - 2 * ((XfwfScrolledWindowWidget)self)->xfwfScrolledWindow.spacing + 2 * help;
    frameh = selfh - 2 * ((XfwfScrolledWindowWidget)self)->xfwfScrolledWindow.spacing + 2 * help;
    if (! ((XfwfScrolledWindowWidget)self)->xfwfScrolledWindow.hideVScrollbar) framew -= ((XfwfScrolledWindowWidget)self)->xfwfScrolledWindow.scrollbarWidth + ((XfwfScrolledWindowWidget)self)->xfwfScrolledWindow.spacing - edgeX;
    if (! ((XfwfScrolledWindowWidget)self)->xfwfScrolledWindow.hideHScrollbar) frameh -= ((XfwfScrolledWindowWidget)self)->xfwfScrolledWindow.scrollbarWidth + ((XfwfScrolledWindowWidget)self)->xfwfScrolledWindow.spacing - edgeX;
    XtConfigureWidget(((XfwfScrolledWindowWidget)self)->xfwfScrolledWindow.frame,
                    selfx + ((XfwfScrolledWindowWidget)self)->xfwfScrolledWindow.spacing - help,
                    selfy + ((XfwfScrolledWindowWidget)self)->xfwfScrolledWindow.spacing - help,
                    max(1, framew),
                    max(1, frameh),
                    0);
}
static void configure ( ) [static]

Here is the caller graph for this function:

static void configure ( Widget  w,
XtPointer  client_data,
XEvent *  event,
Boolean *  cont 
) [static]

Definition at line 230 of file xwScrollWin.c.

{
    Widget self = (Widget) client_data;
    int boardwd, boardht;
    Dimension gwd, ght;
    Position boardx, boardy, gx, gy, minx, miny;
    float wd, ht, x, y;

    if (((XfwfScrolledWindowWidget)self)->core.being_destroyed) {
       /*
        * it may be possible that a configure event
        * occures during destruction
        */
       return;
    }

    /* -- There is nothing wrong, when the event is something else */
    /* -- than a ConfigureNotify. The if prevents correct setting of */
    /* -- scrollbars during the insert_child method */
    /* if (event != NULL && event->type != ConfigureNotify) return; */
    if (((XfwfScrolledWindowWidget)self)->xfwfScrolledWindow.autoAdjustScrollbars) {
      xfwfBoardClassRec.xfwfCommon_class.compute_inside(((XfwfScrolledWindowWidget)self)->xfwfScrolledWindow.board, &boardx, &boardy, &boardwd, &boardht);
      boardwd = max(0, boardwd);
      boardht = max(0, boardht);
      XtVaGetValues(((XfwfScrolledWindowWidget)self)->xfwfScrolledWindow.CW, XtNx, &gx, XtNy, &gy, XtNwidth, &gwd,
                  XtNheight, &ght, NULL);
      minx = gwd <= boardwd ? 0 : boardwd - gwd;
      miny = ght <= boardht ? 0 : boardht - ght;
      if ((gx < minx) || (gy < miny)) {
       if (gx < minx) gx = minx;
       if (gy < miny) gy = miny;
       XtVaSetValues(((XfwfScrolledWindowWidget)self)->xfwfScrolledWindow.CW, XtNx, gx, XtNy, gy, NULL);
      }
      wd = gwd <= boardwd ? 1.0 : (float) boardwd/gwd;
      ht = ght <= boardht ? 1.0 : (float) boardht/ght;
      x = gwd <= boardwd ? 0.0 : gx/(((float) boardwd) - gwd);
      y = ght <= boardht ? 0.0 : gy/(((float) boardht) - ght);
      if (x > 1.0) x = 1.0;
      if (y > 1.0) y = 1.0;
      XfwfSetScrollbar(((XfwfScrolledWindowWidget)self)->xfwfScrolledWindow.hscroll, x, wd);
      XfwfSetScrollbar(((XfwfScrolledWindowWidget)self)->xfwfScrolledWindow.vscroll, y, ht);
   }
}

Here is the call graph for this function:

static void copy_vScrollAmount ( ) [static]
static void copy_vScrollAmount ( Widget  self,
int  offset,
XrmValue *  value 
) [static]

Definition at line 135 of file xwScrollWin.c.

{
    value->addr = (XtPointer) &((XfwfScrolledWindowWidget)self)->xfwfScrolledWindow.vScrollAmount;
}
static void CW_killed ( ) [static]

Here is the caller graph for this function:

static void CW_killed ( Widget  w,
XtPointer  client_data,
XtPointer  call_data 
) [static]

Definition at line 213 of file xwScrollWin.c.

{
    Widget self = (Widget) client_data;

    /* don't propagate key events from frame to child widget anymore */
    XtVaSetValues(((XfwfScrolledWindowWidget)self)->xfwfScrolledWindow.frame, XtNpropagateTarget, NULL, NULL);
    XtRemoveEventHandler(w, StructureNotifyMask, False, configure, self);
    XtRemoveEventHandler(((XfwfScrolledWindowWidget)self)->xfwfScrolledWindow.board, StructureNotifyMask, False, configure, self);
    ((XfwfScrolledWindowWidget)self)->xfwfScrolledWindow.CW = NULL;
    XfwfSetScrollbar(((XfwfScrolledWindowWidget)self)->xfwfScrolledWindow.vscroll, 0.0, 1.0);
    XfwfSetScrollbar(((XfwfScrolledWindowWidget)self)->xfwfScrolledWindow.hscroll, 0.0, 1.0);
}

Here is the call graph for this function:

static void destroy ( ) [static]
static void destroy ( Widget  self) [static]

Definition at line 537 of file xwScrollWin.c.

{
    if (((XfwfScrolledWindowWidget)self)->xfwfScrolledWindow.CW != NULL) {
       XtRemoveEventHandler(((XfwfScrolledWindowWidget)self)->xfwfScrolledWindow.CW, StructureNotifyMask, False,
                          configure, self);
       XtRemoveEventHandler(((XfwfScrolledWindowWidget)self)->xfwfScrolledWindow.board, StructureNotifyMask, False,
                          configure, self);
    }
}

Here is the call graph for this function:

static void initialize ( ) [static]
static void initialize ( Widget  request,
Widget  self,
ArgList  args,
Cardinal *  num_args 
) [static]

Definition at line 386 of file xwScrollWin.c.

{
    XtPointer bg;

    ((XfwfScrolledWindowWidget)self)->xfwfScrolledWindow.initializing = True;
    if (((XfwfScrolledWindowWidget)self)->xfwfScrolledWindow.initialX > 0) ((XfwfScrolledWindowWidget)self)->xfwfScrolledWindow.initialX = 0;
    if (((XfwfScrolledWindowWidget)self)->xfwfScrolledWindow.initialY > 0) ((XfwfScrolledWindowWidget)self)->xfwfScrolledWindow.initialY = 0;
    ((XfwfScrolledWindowWidget)self)->xfwfScrolledWindow.CW = NULL; ((XfwfScrolledWindowWidget)self)->xfwfScrolledWindow.board = NULL;
    XtVaGetValues(self, XtNbackground, &bg, NULL),
    ((XfwfScrolledWindowWidget)self)->xfwfScrolledWindow.frame = XtVaCreateManagedWidget
       ("_frame", xfwfEnforcerWidgetClass, self,
        XtNframeType, XfwfSunken, XtNframeWidth, ((XfwfScrolledWindowWidget)self)->xfwfScrolledWindow.shadowWidth,
        XtNborderWidth, 0, XtNhighlightThickness, 0,
        XtNtraversalOn, ((XfwfScrolledWindowWidget)self)->xfwfScrolledWindow.traverseToChild, 
        XtNbackground, bg,
         XtNtraversalTranslationDone, ((XfwfScrolledWindowWidget)self)->xfwfCommon.traversalTranslationDone, 
        NULL);
    ((XfwfScrolledWindowWidget)self)->xfwfScrolledWindow.board = XtVaCreateManagedWidget
       ("_board", xfwfBoardWidgetClass, ((XfwfScrolledWindowWidget)self)->xfwfScrolledWindow.frame, XtNframeWidth, 0,
        XtNborderWidth, 0, XtNhighlightThickness, 0,
        XtNbackground, bg,
        XtNtraversalOn, False, NULL);
    ((XfwfScrolledWindowWidget)self)->xfwfScrolledWindow.vscroll = XtVaCreateWidget
       ("_vscroll", xfwfVScrollbarWidgetClass, self, XtNframeWidth,
        1, XtNframeType, XfwfSunken, XtNborderWidth, 0, 
         XtNhighlightColor, ((XfwfScrolledWindowWidget)self)->xfwfCommon.highlightColor,
        XtNhighlightThickness, 0, XtNbackground, bg, NULL);
    ((XfwfScrolledWindowWidget)self)->xfwfScrolledWindow.hscroll = XtVaCreateWidget
       ("_hscroll", xfwfHScrollbarWidgetClass, self, XtNframeWidth,
        1, XtNframeType, XfwfSunken, XtNborderWidth, 0, 
         XtNhighlightColor, ((XfwfScrolledWindowWidget)self)->xfwfCommon.highlightColor,
        XtNhighlightThickness, 0, XtNbackground, bg, NULL);
    if (! ((XfwfScrolledWindowWidget)self)->xfwfScrolledWindow.hideVScrollbar) XtManageChild(((XfwfScrolledWindowWidget)self)->xfwfScrolledWindow.vscroll);
    if (! ((XfwfScrolledWindowWidget)self)->xfwfScrolledWindow.hideHScrollbar) XtManageChild(((XfwfScrolledWindowWidget)self)->xfwfScrolledWindow.hscroll);
    compute_sizes(self);
    XtAddCallback(((XfwfScrolledWindowWidget)self)->xfwfScrolledWindow.vscroll, XtNscrollCallback, scroll_callback, self);
    XtAddCallback(((XfwfScrolledWindowWidget)self)->xfwfScrolledWindow.hscroll, XtNscrollCallback, scroll_callback, self);
    XtVaGetValues(((XfwfScrolledWindowWidget)self)->xfwfScrolledWindow.vscroll, XtNscrollResponse, &((XfwfScrolledWindowWidget)self)->xfwfScrolledWindow.vscroll_resp, NULL);
    XtVaGetValues(((XfwfScrolledWindowWidget)self)->xfwfScrolledWindow.hscroll, XtNscrollResponse, &((XfwfScrolledWindowWidget)self)->xfwfScrolledWindow.hscroll_resp, NULL);
    ((XfwfScrolledWindowWidget)self)->xfwfScrolledWindow.initializing = False;
    if (((XfwfScrolledWindowWidget)self)->xfwfScrolledWindow.scrollResponse != scroll_response) {
       ((XfwfScrolledWindowWidget)self)->xfwfScrolledWindow.scrollResponse = scroll_response;
       XtWarning("scrollResponse resource may only be queried, not set");
    }
}

Here is the call graph for this function:

static void insert_child ( ) [static]
static void insert_child ( Widget  child) [static]

Definition at line 487 of file xwScrollWin.c.

{ Widget self = XtParent(child); {
    Position boardx, boardy, gx, gy;
    int boardwd, boardht;
    Dimension gwd, ght;
    Boolean dummy;

    if (((XfwfScrolledWindowWidget)self)->xfwfScrolledWindow.initializing) {
       xfwfBoardClassRec.composite_class.insert_child(child);
    } else if (((XfwfScrolledWindowWidget)self)->xfwfScrolledWindow.CW == NULL) {
       ((XfwfScrolledWindowWidget)self)->xfwfScrolledWindow.CW = child;
       ((XfwfScrolledWindowWidget)child)->core.parent = ((XfwfScrolledWindowWidget)self)->xfwfScrolledWindow.board;
       XtAddCallback(child, XtNdestroyCallback, CW_killed, self);
       xfwfBoardClassRec.composite_class.insert_child(child);
       XtAddEventHandler(child, StructureNotifyMask, False, configure, self);
       XtAddEventHandler(((XfwfScrolledWindowWidget)self)->xfwfScrolledWindow.board, StructureNotifyMask, False, configure, self);
       xfwfBoardClassRec.xfwfCommon_class.compute_inside(((XfwfScrolledWindowWidget)self)->xfwfScrolledWindow.board, &boardx, &boardy, &boardwd, &boardht);
        boardwd = max(0, boardwd);
        boardht = max(0, boardht);
       XtVaGetValues(child, XtNwidth, &gwd, XtNheight, &ght, NULL);
       gx = gwd <= boardwd ? 0 : max(((XfwfScrolledWindowWidget)self)->xfwfScrolledWindow.initialX, boardwd - gwd);
       gy = ght <= boardht ? 0 : max(((XfwfScrolledWindowWidget)self)->xfwfScrolledWindow.initialY, boardht - ght);
       XtVaSetValues(child, XtNx, gx, XtNy, gy, NULL);
       /* propagate key events from frame to child widget */
       if (((XfwfScrolledWindowWidget)self)->xfwfScrolledWindow.traverseToChild)
           XtVaSetValues(((XfwfScrolledWindowWidget)self)->xfwfScrolledWindow.frame, XtNpropagateTarget, ((XfwfScrolledWindowWidget)self)->xfwfScrolledWindow.CW, NULL);
       XtVaSetValues(((XfwfScrolledWindowWidget)self)->xfwfScrolledWindow.board, XtNpropagateTarget, ((XfwfScrolledWindowWidget)self)->xfwfScrolledWindow.CW, NULL);
       configure(self, self, NULL, &dummy);
    } else {
       char s[500];
       (void) sprintf(s, "Cannot add <%s>, %s <%s> already has a child\n",
                     XtName(child), "ScrolledWindow", XtName(self));
       XtWarning(s);
    }
}
}

Here is the call graph for this function:

static void resize ( ) [static]
static void resize ( Widget  self) [static]

Definition at line 478 of file xwScrollWin.c.

{
    compute_sizes(self);
}

Here is the call graph for this function:

static void scroll_callback ( ) [static]

Here is the caller graph for this function:

static void scroll_callback ( Widget  w,
XtPointer  client_data,
XtPointer  call_data 
) [static]

Definition at line 144 of file xwScrollWin.c.

{
    Widget self = (Widget) client_data;
    XfwfScrollInfo *info = (XfwfScrollInfo *) call_data;
    XfwfScrollInfo new;
    Position boardx, boardy, gx, gy, minx = 0, miny = 0;
    int boardwd, boardht;
    Dimension gwd, ght;

    if (((XfwfScrolledWindowWidget)self)->xfwfScrolledWindow.autoAdjustScrollbars) {
      xfwfBoardClassRec.xfwfCommon_class.compute_inside(((XfwfScrolledWindowWidget)self)->xfwfScrolledWindow.board, &boardx, &boardy, &boardwd, &boardht);
      boardwd = max(0, boardwd);
      boardht = max(0, boardht);
      XtVaGetValues(((XfwfScrolledWindowWidget)self)->xfwfScrolledWindow.CW, XtNx, &gx, XtNy, &gy, XtNwidth, &gwd,
                  XtNheight, &ght, NULL);
      minx = gwd <= boardwd ? 0 : boardwd - gwd;
      miny = ght <= boardht ? 0 : boardht - ght;
      switch (info->reason) {
      case XfwfSUp: gy = min(gy + ((XfwfScrolledWindowWidget)self)->xfwfScrolledWindow.vScrollAmount, 0); break;
      case XfwfSDown: gy = max(gy - ((XfwfScrolledWindowWidget)self)->xfwfScrolledWindow.vScrollAmount, miny); break;
      case XfwfSLeft: gx = min(gx + ((XfwfScrolledWindowWidget)self)->xfwfScrolledWindow.hScrollAmount, 0); break;
      case XfwfSRight: gx = max(gx - ((XfwfScrolledWindowWidget)self)->xfwfScrolledWindow.hScrollAmount, minx); break;
      case XfwfSPageUp: gy = min(gy + boardht, 0); break;
      case XfwfSPageDown: gy = max(gy - boardht, miny); break;
      case XfwfSPageLeft: gx = min(gx + boardwd, 0); break;
      case XfwfSPageRight: gx = max(gx - boardwd, minx); break;
      case XfwfSDrag:
       if (w == ((XfwfScrolledWindowWidget)self)->xfwfScrolledWindow.vscroll) gy = info->vpos * miny;
       else gx = info->hpos * minx;
       break;
      case XfwfSMove: break;
      case XfwfSTop: gy = 0; break;
      case XfwfSBottom: gy = miny; break;
      case XfwfSLeftSide: gx = 0; break;
      case XfwfSRightSide: gx = minx; break;
      default: break;
      }
    
      if (((XfwfScrolledWindowWidget)self)->xfwfScrolledWindow.doScroll)
        XtVaSetValues(((XfwfScrolledWindowWidget)self)->xfwfScrolledWindow.CW, XtNx, gx, XtNy, gy, NULL);
    }

    if (info->reason != XfwfSNotify) {
       new.reason = info->reason;
       if (((XfwfScrolledWindowWidget)self)->xfwfScrolledWindow.autoAdjustScrollbars) {
         new.flags  = XFWF_VPOS | XFWF_HPOS | XFWF_HSIZE | XFWF_VSIZE ;
         new.hpos   = minx == 0 ? 0.0 : gx/minx;
         new.vpos   = miny == 0 ? 0.0 : gy/miny;
         new.hsize  = gwd <= boardwd ? 1.0 : (float)boardwd/(float)gwd;
         new.vsize  = ght <= boardht ? 1.0 : (float)boardht/(float)ght;
         new.gx     = gx;
         new.gy     = gy;
       } else {
         if (info->reason == XfwfSDrag) {
           if (w == ((XfwfScrolledWindowWidget)self)->xfwfScrolledWindow.vscroll)
             new.flags  = XFWF_VPOS;
           else
             new.flags  = XFWF_HPOS;
         } else
           new.flags  = 0;
       }
       XtCallCallbackList(self, ((XfwfScrolledWindowWidget)self)->xfwfScrolledWindow.scrollCallback, &new);
    }
}
static void scroll_response ( ) [static]
static void scroll_response ( Widget  w,
XtPointer  client_data,
XtPointer  call_data 
) [static]

Definition at line 551 of file xwScrollWin.c.

{
    Widget self = (Widget) client_data;
    XfwfScrollInfo *info = (XfwfScrollInfo *) call_data;
    XfwfScrollInfo new;
    Position boardx, boardy, gx, gy, minx, miny;
    int boardwd, boardht;
    Dimension gwd, ght;

    xfwfBoardClassRec.xfwfCommon_class.compute_inside(((XfwfScrolledWindowWidget)self)->xfwfScrolledWindow.board, &boardx, &boardy, &boardwd, &boardht);
    boardwd = max(0, boardwd);
    boardht = max(0, boardht);
    XtVaGetValues(((XfwfScrolledWindowWidget)self)->xfwfScrolledWindow.CW, XtNx, &gx, XtNy, &gy, XtNwidth, &gwd,
                XtNheight, &ght, NULL);
    minx = gwd <= boardwd ? 0 : boardwd - gwd;
    miny = ght <= boardht ? 0 : boardht - ght;

    if (info->flags & XFWF_VPOS) gy = info->vpos * miny;
    if (info->flags & XFWF_HPOS) gx = info->hpos * minx;

    XtVaSetValues(((XfwfScrolledWindowWidget)self)->xfwfScrolledWindow.CW, XtNx, gx, XtNy, gy, NULL);

    if (info->reason != XfwfSNotify && ((XfwfScrolledWindowWidget)self)->xfwfScrolledWindow.doScroll) {
       new.reason = XfwfSNotify;
       new.flags = info->flags & (XFWF_VPOS | XFWF_HPOS);
       new.hpos = info->hpos;
       new.vpos = info->vpos;
       XtCallCallbackList(self, ((XfwfScrolledWindowWidget)self)->xfwfScrolledWindow.scrollCallback, info);
    }
}
void ScrollWinViewableHeight ( Widget  self,
int boardht 
)

Definition at line 617 of file xwScrollWin.c.

{
  Position boardx, boardy;
  int boardwd;
       
  ((XfwfScrolledWindowWidgetClass)self->core.widget_class)->xfwfCommon_class.compute_inside(self, &boardx, &boardy, &boardwd, boardht);  
}
static Boolean set_values ( ) [static]
static Boolean set_values ( Widget  old,
Widget  request,
Widget  self,
ArgList  args,
Cardinal *  num_args 
) [static]

Definition at line 436 of file xwScrollWin.c.

{
    if (((XfwfScrolledWindowWidget)self)->xfwfScrolledWindow.traverseToChild && !((XfwfScrolledWindowWidget)old)->xfwfCommon.traversalTranslationDone && ((XfwfScrolledWindowWidget)self)->xfwfCommon.traversalTranslationDone) {
       XtVaSetValues(((XfwfScrolledWindowWidget)self)->xfwfScrolledWindow.frame, XtNtraversalTranslationDone, ((XfwfScrolledWindowWidget)self)->xfwfCommon.traversalTranslationDone, NULL);
    }

    if (((XfwfScrolledWindowWidget)old)->xfwfScrolledWindow.hideVScrollbar && ! ((XfwfScrolledWindowWidget)self)->xfwfScrolledWindow.hideVScrollbar) {
       XtManageChild(((XfwfScrolledWindowWidget)self)->xfwfScrolledWindow.vscroll);
    } else if (! ((XfwfScrolledWindowWidget)old)->xfwfScrolledWindow.hideVScrollbar && ((XfwfScrolledWindowWidget)self)->xfwfScrolledWindow.hideVScrollbar) {
       XtUnmanageChild(((XfwfScrolledWindowWidget)self)->xfwfScrolledWindow.vscroll);
    }
    if (((XfwfScrolledWindowWidget)old)->xfwfScrolledWindow.hideHScrollbar && ! ((XfwfScrolledWindowWidget)self)->xfwfScrolledWindow.hideHScrollbar) {
       XtManageChild(((XfwfScrolledWindowWidget)self)->xfwfScrolledWindow.hscroll);
    } else if (! ((XfwfScrolledWindowWidget)old)->xfwfScrolledWindow.hideHScrollbar && ((XfwfScrolledWindowWidget)self)->xfwfScrolledWindow.hideHScrollbar) {
       XtUnmanageChild(((XfwfScrolledWindowWidget)self)->xfwfScrolledWindow.hscroll);
    }
    if (((XfwfScrolledWindowWidget)old)->xfwfScrolledWindow.traverseToChild != ((XfwfScrolledWindowWidget)self)->xfwfScrolledWindow.traverseToChild) {
       XtVaSetValues(((XfwfScrolledWindowWidget)self)->xfwfScrolledWindow.frame, XtNtraversalOn, ((XfwfScrolledWindowWidget)self)->xfwfScrolledWindow.traverseToChild, NULL);
       XtVaSetValues(((XfwfScrolledWindowWidget)self)->xfwfScrolledWindow.frame, XtNpropagateTarget, (((XfwfScrolledWindowWidget)self)->xfwfScrolledWindow.traverseToChild ? ((XfwfScrolledWindowWidget)self)->xfwfScrolledWindow.CW : NULL), NULL);
    }
    if (((XfwfScrolledWindowWidget)old)->xfwfScrolledWindow.spacing != ((XfwfScrolledWindowWidget)self)->xfwfScrolledWindow.spacing
       || ((XfwfScrolledWindowWidget)old)->xfwfScrolledWindow.scrollbarWidth != ((XfwfScrolledWindowWidget)self)->xfwfScrolledWindow.scrollbarWidth
       || ((XfwfScrolledWindowWidget)old)->xfwfScrolledWindow.shadowWidth != ((XfwfScrolledWindowWidget)self)->xfwfScrolledWindow.shadowWidth
       || ((XfwfScrolledWindowWidget)old)->xfwfScrolledWindow.hideHScrollbar != ((XfwfScrolledWindowWidget)self)->xfwfScrolledWindow.hideHScrollbar
       || ((XfwfScrolledWindowWidget)old)->xfwfScrolledWindow.hideVScrollbar != ((XfwfScrolledWindowWidget)self)->xfwfScrolledWindow.hideVScrollbar)
       compute_sizes(self);
    if (((XfwfScrolledWindowWidget)self)->xfwfScrolledWindow.scrollResponse != ((XfwfScrolledWindowWidget)old)->xfwfScrolledWindow.scrollResponse) {
       ((XfwfScrolledWindowWidget)self)->xfwfScrolledWindow.scrollResponse = ((XfwfScrolledWindowWidget)old)->xfwfScrolledWindow.scrollResponse;
       XtWarning("scrollResponse resource may only be queried, not set");
    }
    if (((XfwfScrolledWindowWidget)old)->xfwfScrolledWindow.drawgrayScrollWin != ((XfwfScrolledWindowWidget)self)->xfwfScrolledWindow.drawgrayScrollWin) {
      XtVaSetValues(((XfwfScrolledWindowWidget)self)->xfwfScrolledWindow.vscroll, XtNdrawgrayScrollbar, ((XfwfScrolledWindowWidget)self)->xfwfScrolledWindow.drawgrayScrollWin, NULL);
      XtVaSetValues(((XfwfScrolledWindowWidget)self)->xfwfScrolledWindow.hscroll, XtNdrawgrayScrollbar, ((XfwfScrolledWindowWidget)self)->xfwfScrolledWindow.drawgrayScrollWin, NULL);
    }

    return False;
}

Here is the call graph for this function:

void xws_get_scroll_area ( Widget  self,
Dimension *  x,
Dimension *  y 
)

Definition at line 608 of file xwScrollWin.c.

{
  XtVaGetValues(((XfwfScrolledWindowWidget)self)->xfwfScrolledWindow.board, XtNwidth, x, XtNheight, y, NULL);
}

Here is the caller graph for this function:

void xws_get_scroll_pos ( Widget  self,
double *  x,
double *  y 
)

Definition at line 598 of file xwScrollWin.c.

{
  XfwfGetScrollbar(((XfwfScrolledWindowWidget)self)->xfwfScrolledWindow.hscroll, x, NULL);
  XfwfGetScrollbar(((XfwfScrolledWindowWidget)self)->xfwfScrolledWindow.vscroll, NULL, y);
}

Here is the call graph for this function:

void xws_set_scroll_direct ( Widget  self,
long  hlen,
long  hpage,
long  hpos,
long  vlen,
long  vpage,
long  vpos 
)

Definition at line 586 of file xwScrollWin.c.

{
  if (!hpage) hpage = 1;
  XfwfSetScrollbar(((XfwfScrolledWindowWidget)self)->xfwfScrolledWindow.hscroll, !hlen ? 0 : (float)hpos / hlen, (float)hpage / (hlen + hpage));
  if (!vpage) vpage = 1;
  XfwfSetScrollbar(((XfwfScrolledWindowWidget)self)->xfwfScrolledWindow.vscroll, !vlen ? 0 : (float)vpos / vlen, (float)vpage / (vlen + vpage));
}

Here is the call graph for this function:

Here is the caller graph for this function:


Variable Documentation

XtResource resources[] [static]
Initial value:
 {
{XtNautoAdjustScrollbars,XtCAutoAdjustScrollbars,XtRBoolean,sizeof(((XfwfScrolledWindowRec*)NULL)->xfwfScrolledWindow.autoAdjustScrollbars),XtOffsetOf(XfwfScrolledWindowRec,xfwfScrolledWindow.autoAdjustScrollbars),XtRImmediate,(XtPointer)TRUE },
{XtNhighlightThickness,XtCHighlightThickness,XtRDimension,sizeof(((XfwfScrolledWindowRec*)NULL)->xfwfCommon.highlightThickness),XtOffsetOf(XfwfScrolledWindowRec,xfwfCommon.highlightThickness),XtRImmediate,(XtPointer)0 },
{XtNtraverseToChild,XtCTraverseToChild,XtRBoolean,sizeof(((XfwfScrolledWindowRec*)NULL)->xfwfScrolledWindow.traverseToChild),XtOffsetOf(XfwfScrolledWindowRec,xfwfScrolledWindow.traverseToChild),XtRImmediate,(XtPointer)TRUE },
{XtNspacing,XtCSpacing,XtRDimension,sizeof(((XfwfScrolledWindowRec*)NULL)->xfwfScrolledWindow.spacing),XtOffsetOf(XfwfScrolledWindowRec,xfwfScrolledWindow.spacing),XtRImmediate,(XtPointer)0 },
{XtNedgeBars,XtCEdgeBars,XtRBoolean,sizeof(((XfwfScrolledWindowRec*)NULL)->xfwfScrolledWindow.edgeBars),XtOffsetOf(XfwfScrolledWindowRec,xfwfScrolledWindow.edgeBars),XtRImmediate,(XtPointer)FALSE },
{XtNscrollbarWidth,XtCScrollbarWidth,XtRDimension,sizeof(((XfwfScrolledWindowRec*)NULL)->xfwfScrolledWindow.scrollbarWidth),XtOffsetOf(XfwfScrolledWindowRec,xfwfScrolledWindow.scrollbarWidth),XtRImmediate,(XtPointer)16 },
{XtNshadowWidth,XtCShadowWidth,XtRDimension,sizeof(((XfwfScrolledWindowRec*)NULL)->xfwfScrolledWindow.shadowWidth),XtOffsetOf(XfwfScrolledWindowRec,xfwfScrolledWindow.shadowWidth),XtRImmediate,(XtPointer)2 },
{XtNhideHScrollbar,XtCHideHScrollbar,XtRBoolean,sizeof(((XfwfScrolledWindowRec*)NULL)->xfwfScrolledWindow.hideHScrollbar),XtOffsetOf(XfwfScrolledWindowRec,xfwfScrolledWindow.hideHScrollbar),XtRImmediate,(XtPointer)False },
{XtNhideVScrollbar,XtCHideVScrollbar,XtRBoolean,sizeof(((XfwfScrolledWindowRec*)NULL)->xfwfScrolledWindow.hideVScrollbar),XtOffsetOf(XfwfScrolledWindowRec,xfwfScrolledWindow.hideVScrollbar),XtRImmediate,(XtPointer)False },
{XtNvScrollAmount,XtCVScrollAmount,XtRInt,sizeof(((XfwfScrolledWindowRec*)NULL)->xfwfScrolledWindow.vScrollAmount),XtOffsetOf(XfwfScrolledWindowRec,xfwfScrolledWindow.vScrollAmount),XtRImmediate,(XtPointer)20 },
{XtNhScrollAmount,XtCHScrollAmount,XtRInt,sizeof(((XfwfScrolledWindowRec*)NULL)->xfwfScrolledWindow.hScrollAmount),XtOffsetOf(XfwfScrolledWindowRec,xfwfScrolledWindow.hScrollAmount),XtRCallProc,(XtPointer)copy_vScrollAmount },
{XtNinitialX,XtCInitialX,XtRPosition,sizeof(((XfwfScrolledWindowRec*)NULL)->xfwfScrolledWindow.initialX),XtOffsetOf(XfwfScrolledWindowRec,xfwfScrolledWindow.initialX),XtRImmediate,(XtPointer)0 },
{XtNinitialY,XtCInitialY,XtRPosition,sizeof(((XfwfScrolledWindowRec*)NULL)->xfwfScrolledWindow.initialY),XtOffsetOf(XfwfScrolledWindowRec,xfwfScrolledWindow.initialY),XtRImmediate,(XtPointer)0 },
{XtNdrawgrayScrollWin,XtCDrawgrayScrollWin,XtRBoolean,sizeof(((XfwfScrolledWindowRec*)NULL)->xfwfScrolledWindow.drawgrayScrollWin),XtOffsetOf(XfwfScrolledWindowRec,xfwfScrolledWindow.drawgrayScrollWin),XtRImmediate,(XtPointer)FALSE },
{XtNdoScroll,XtCDoScroll,XtRBoolean,sizeof(((XfwfScrolledWindowRec*)NULL)->xfwfScrolledWindow.doScroll),XtOffsetOf(XfwfScrolledWindowRec,xfwfScrolledWindow.doScroll),XtRImmediate,(XtPointer)TRUE },
{XtNscrollCallback,XtCScrollCallback,XtRCallback,sizeof(((XfwfScrolledWindowRec*)NULL)->xfwfScrolledWindow.scrollCallback),XtOffsetOf(XfwfScrolledWindowRec,xfwfScrolledWindow.scrollCallback),XtRImmediate,(XtPointer)NULL },
{XtNscrollResponse,XtCScrollResponse,XtRXTCallbackProc,sizeof(((XfwfScrolledWindowRec*)NULL)->xfwfScrolledWindow.scrollResponse),XtOffsetOf(XfwfScrolledWindowRec,xfwfScrolledWindow.scrollResponse),XtRImmediate,(XtPointer)scroll_response },
}

Definition at line 275 of file xwScrollWin.c.

Definition at line 295 of file xwScrollWin.c.

Definition at line 363 of file xwScrollWin.c.