file: bound.c

/* * bound.c - This file contains all routines associated with * brush boundary operation. */ #include "XmdvTool.h" #include "bound.h" #include "cursor.h" #include "brush.h" /* external variables */ extern Brush *brush; /* the current brush */ /* extern int dims; extern double *br_pos, *br_size; extern double dim_min[MAXDIM], dim_max[MAXDIM]; */ /* global multi_select variables */ static int bound_drag = FALSE; /* * BrushBoundaryACT() - Action that toggles the bound_drag flag * when a control key is pressed or released. * * PARAMETERS * w Widget * event Pointer to XEvent structure that caused the action * params User supplied parameters * num_params The number of parameters * * RETURNS * void */ void BrushBoundaryACT(Widget w, XEvent *event, String *params, Cardinal *num_params) { /* check to make sure brushing is on */ if(brush->bound == BOUND_STEP) return; /* check the parameters */ if(*num_params != 1) { fprintf(stderr, "Error in BrushBoundaryACT() - Invalid # of params passed\n"); return; } if(!strcmp(params[0], "On")) { bound_drag = TRUE; RightArrowCursor(w); } else if(!strcmp(params[0], "Off")) { bound_drag = FALSE; ArrowCursor(w); } else { fprintf(stderr, "Error in BrushBoundaryACT() - Incorrect parameter passed: %s\n", params[0]); return; } } /* * CheckBoundaryDrag() - Checks if the boundary is being dragged * * PARAMETERS * void * * RETURNS * TRUE Boundary is being dragged. * FALSE Boundary is not being dragged. */ int CheckBoundaryDrag(void) { return(bound_drag); }


Back to Source File Index


C++ to HTML Conversion by ctoohtml