home *** CD-ROM | disk | FTP | other *** search
- From: eddyg@syma.sussex.ac.uk (Edward J. Groenendaal)
- Newsgroups: alt.sources
- Subject: X Desktop Manager(7)
- Message-ID: <4870@syma.sussex.ac.uk>
- Date: 17 Apr 91 20:51:48 GMT
-
- ---- Cut Here and unpack ----
- #!/bin/sh
- # this is part 7 of a multipart archive
- # do not concatenate these parts, unpack them in order with /bin/sh
- # file code/Xedw/XedwList.c continued
- #
- CurArch=7
- if test ! -r s2_seq_.tmp
- then echo "Please unpack part 1 first!"
- exit 1; fi
- ( read Scheck
- if test "$Scheck" != $CurArch
- then echo "Please unpack part $Scheck next!"
- exit 1;
- else exit 0; fi
- ) < s2_seq_.tmp || exit 1
- echo "x - Continuing file code/Xedw/XedwList.c"
- sed 's/^X//' << 'SHAR_EOF' >> code/Xedw/XedwList.c
- X "when computing layout");
- X XtAppWarning(XtWidgetToApplicationContext(w), buf);
- X }
- X request.request_mode = CWWidth | CWHeight;
- X XtMakeGeometryRequest(w, &request, &reply);
- X break;
- X default:
- X XtAppWarning(XtWidgetToApplicationContext(w),
- X "XedwList Widget: Unknown geometry return.");
- X break;
- X }
- X break;
- X default:
- X XtAppWarning(XtWidgetToApplicationContext(w),
- X "XedwList Widget: Unknown geometry return.");
- X break;
- X }
- X}
- X
- X/* Function Name: Initialise
- X * Description: Function that initilises the widget instance.
- X * Arguments: junk - NOT USED.
- X * new - the new widget.
- X * Returns: none
- X */
- X
- Xstatic void Initialize(Widget junk, Widget new)
- X{
- X XedwListWidget ilw = (XedwListWidget) new;
- X
- X/*
- X * Initialize all private resources.
- X */
- X
- X GetGCs(new);
- X
- X /* Set row height. */
- X if (ilw->xedwList.show_icons)
- X ilw->xedwList.row_height = ilw->xedwList.font->max_bounds.ascent
- X + ilw->xedwList.font->max_bounds.descent
- X + ilw->xedwList.row_space
- X + ilw->xedwList.icon_height;
- X else
- X ilw->xedwList.row_height = ilw->xedwList.font->max_bounds.ascent
- X + ilw->xedwList.font->max_bounds.descent
- X + ilw->xedwList.row_space;
- X
- X ResetXedwList(new, (new->core.width == 0), (new->core.height == 0));
- X
- X ilw->xedwList.is_highlighted = (LinkedList*) XtMalloc (sizeof(LinkedList));
- X
- X ilw->xedwList.highlight = ilw->xedwList.is_highlighted->index = NO_HIGHLIGHT;
- X ilw->xedwList.is_highlighted->next = NULL;
- X
- X} /* Initialize */
- X
- X/* Function Name: CvtToItem
- X * Description: Converts Xcoord to item number of item containing that
- X * point.
- X * Arguments: w - the xedwList widget.
- X * xloc, yloc - x location, and y location.
- X * Returns: the item number.
- X */
- X
- Xstatic int CvtToItem(Widget w, int xloc, int yloc, int *item)
- X{
- X int one, another;
- X XedwListWidget ilw = (XedwListWidget) w;
- X int ret_val = OKAY;
- X
- X if (ilw->xedwList.vertical_cols) {
- X one = ilw->xedwList.nrows * ((xloc - (int) ilw->xedwList.internal_width)
- X / ilw->xedwList.col_width);
- X another = (yloc - (int) ilw->xedwList.internal_height)
- X / ilw->xedwList.row_height;
- X /* If out of range, return minimum possible value. */
- X if (another >= ilw->xedwList.nrows) {
- X another = ilw->xedwList.nrows - 1;
- X ret_val = OUT_OF_RANGE;
- X }
- X }
- X else {
- X one = (ilw->xedwList.ncols * ((yloc - (int) ilw->xedwList.internal_height)
- X / ilw->xedwList.row_height)) ;
- X /* If in right margin handle things right. */
- X another = (xloc - (int) ilw->xedwList.internal_width) / ilw->xedwList.col_width;
- X if (another >= ilw->xedwList.ncols) {
- X another = ilw->xedwList.ncols - 1;
- X ret_val = OUT_OF_RANGE;
- X }
- X }
- X if ((xloc < 0) || (yloc < 0))
- X ret_val = OUT_OF_RANGE;
- X if (one < 0) one = 0;
- X if (another < 0) another = 0;
- X *item = one + another;
- X if (*item >= ilw->xedwList.nitems) return(OUT_OF_RANGE);
- X return(ret_val);
- X}
- X
- X/* Function Name: FindCornerItems.
- X * Description: Find the corners of the rectangle in item space.
- X * Arguments: w - the xedwList widget.
- X * event - the event structure that has the rectangle it it.
- X * ul_ret, lr_ret - the corners ** RETURNED **.
- X * Returns: none.
- X */
- X
- Xstatic int FindCornerItems(Widget w, XEvent *event, int *ul_ret, int *lr_ret)
- X{
- X int xloc, yloc;
- X
- X xloc = event->xexpose.x;
- X yloc = event->xexpose.y;
- X CvtToItem(w, xloc, yloc, ul_ret);
- X xloc += event->xexpose.width;
- X yloc += event->xexpose.height;
- X CvtToItem(w, xloc, yloc, lr_ret);
- X}
- X
- X/* Function Name: ItemInRectangle
- X * Description: returns TRUE if the item passed is in the given rectangle.
- X * Arguments: w - the xedwList widget.
- X * ul, lr - corners of the rectangle in item space.
- X * item - item to check.
- X * Returns: TRUE if the item passed is in the given rectangle.
- X */
- X
- Xstatic int ItemInRectangle(Widget w, int ul, int lr, int item)
- X{
- X XedwListWidget ilw = (XedwListWidget) w;
- X register int mod_item;
- X int things;
- X
- X if (item < ul || item > lr)
- X return(FALSE);
- X if (ilw->xedwList.vertical_cols)
- X things = ilw->xedwList.nrows;
- X else
- X things = ilw->xedwList.ncols;
- X
- X mod_item = item % things;
- X if ( (mod_item >= ul % things) && (mod_item <= lr % things ) )
- X return(TRUE);
- X return(FALSE);
- X}
- X
- X/* Function Name: HighlightBackground
- X * Description: paints the color of the background for the given item.
- X * Arguments: w - the widget.
- X * x, y - ul corner of the area item occupies.
- X * item - the item we are dealing with.
- X * gc - the gc that is used to paint this rectangle
- X * Returns:
- X */
- X
- Xstatic int HighlightBackground(Widget w, int x, int y, int item, GC gc)
- X{
- X XedwListWidget ilw = (XedwListWidget) w;
- X int hl_x, hl_y, width, height;
- X
- X hl_x = x - ilw->xedwList.column_space/2;
- X width = XTextWidth(ilw->xedwList.font, ilw->xedwList.xedwList[item]->string,
- X strlen(ilw->xedwList.xedwList[item]->string))
- X + ilw->xedwList.column_space;
- X hl_y = y + ((ilw->xedwList.show_icons) ? ilw->xedwList.icon_height : 0);
- X height = ilw->xedwList.row_height - ilw->xedwList.row_space -
- X ((ilw->xedwList.show_icons) ? ilw->xedwList.icon_height : 0);
- X
- X XFillRectangle(XtDisplay(w), XtWindow(w), gc, hl_x, hl_y, width, height);
- X}
- X
- X/* Function Name: PaintItemName
- X * Description: paints the name of the item in the appropriate location.
- X * Arguments: w - the xedwList widget.
- X
- X * item - the item to draw.
- X * op - XedwOn, XedwOff
- X * Returns: none.
- X *
- X * NOTE: no action taken on an unrealized widget.
- X */
- X
- Xstatic int PaintItemName(Widget w, int item, int operation)
- X{
- X char * str;
- X GC gc;
- X unsigned normalmode, inversemode;
- X int x, y, str_y, str_x;
- X XedwListWidget ilw = (XedwListWidget) w;
- X
- X if (!XtIsRealized(w)) return; /* Just in case... */
- X
- X
- X if (ilw->xedwList.vertical_cols) {
- X x = ilw->xedwList.col_width * (item / ilw->xedwList.nrows)
- X + ilw->xedwList.internal_width;
- X y = ilw->xedwList.row_height * (item % ilw->xedwList.nrows)
- X + ilw->xedwList.internal_height;
- X }
- X else {
- X x = ilw->xedwList.col_width * (item % ilw->xedwList.ncols)
- X + ilw->xedwList.internal_width;
- X y = ilw->xedwList.row_height * (item / ilw->xedwList.ncols)
- X + ilw->xedwList.internal_height;
- X }
- X
- X
- X str = ilw->xedwList.xedwList[item]->string;
- X
- X str_y = y + ilw->xedwList.font->max_bounds.ascent;
- X
- X if (ilw->xedwList.show_icons)
- X str_x = x + ((ilw->xedwList.longest/2) -
- X (XTextWidth(ilw->xedwList.font, str, strlen(str))/2));
- X else
- X str_x = x;
- X
- X if ((BlackPixelOfScreen(XtScreen(ilw))) == 1) {
- X normalmode = GXcopy;
- X inversemode = GXcopyInverted;
- X } else {
- X normalmode = GXcopyInverted;
- X inversemode = GXcopy;
- X }
- X
- X if (ilw->xedwList.is_highlighted->index != NO_HIGHLIGHT) {
- X /* There are some highlighted items */
- X if (ilw->xedwList.highlight == NO_HIGHLIGHT) {
- X /* This is an update */
- X if (operation == XedwOn) {
- X if (XtIsSensitive(w)) {
- X /* Draw Inverse item */
- X gc = ilw->xedwList.revgc;
- X XSetFunction(XtDisplay(w), gc, inversemode);
- X HighlightBackground(w, str_x, y, item, ilw->xedwList.normgc);
- X } else {
- X /* Draw Grey item */
- X }
- X } else {
- X gc = ilw->xedwList.normgc;
- X /* XSetFunction(XtDisplay(w), gc, normalmode); */
- X }
- X } else {
- X /* Were toggling something */
- X if (operation == XedwOn) {
- X if (XtIsSensitive(w)) {
- X /* Draw Inverse item */
- X gc = ilw->xedwList.revgc;
- X XSetFunction(XtDisplay(w), gc, inversemode);
- X HighlightBackground(w, str_x, y, item, ilw->xedwList.normgc);
- X } else {
- X /* Draw Grey item */
- X }
- X } else {
- X /* Draw Normal item */
- X gc = ilw->xedwList.normgc;
- X XSetFunction(XtDisplay(ilw), gc, normalmode);
- X HighlightBackground(w, str_x, y, item, ilw->xedwList.revgc);
- X }
- X }
- X } else {
- X gc = ilw->xedwList.normgc;
- X XSetFunction(XtDisplay(ilw), gc, normalmode);
- X }
- X
- X if (ilw->xedwList.default_icon == NULL)
- X ilw->xedwList.default_icon =
- X XCreateBitmapFromData(XtDisplay(ilw), XtWindow(ilw), default_bits,
- X default_width, default_height);
- X
- X if (ilw->xedwList.show_icons){
- X Pixmap icon;
- X if (ilw->xedwList.xedwList[item]->icon == NULL &&
- X ilw->xedwList.default_icon != NULL)
- X icon = ilw->xedwList.default_icon;
- X else
- X icon = ilw->xedwList.xedwList[item]->icon;
- X if (DefaultDepthOfScreen(XtScreen(ilw)) == 1)
- X XCopyArea(XtDisplay(ilw), icon,
- X XtWindow(ilw), gc, 0, 0,
- X ilw->xedwList.icon_width, ilw->xedwList.icon_height, x +
- X ((ilw->xedwList.longest/2) - (ilw->xedwList.icon_width/2)), y);
- X else
- X XCopyPlane(XtDisplay(ilw), icon,
- X XtWindow(ilw), gc, 0,0,
- X ilw->xedwList.icon_width,ilw->xedwList.icon_height,x +
- X ((ilw->xedwList.longest/2) - (ilw->xedwList.icon_width/2)), y,1);
- X /* Draw string */
- X XSetFunction(XtDisplay(ilw), gc, GXcopy);
- X XDrawString(XtDisplay(ilw), XtWindow(ilw), gc, str_x,
- X str_y+ilw->xedwList.icon_height, str, strlen(str));
- X } else { /* No Icons */
- X XSetFunction(XtDisplay(ilw), gc, GXcopy);
- X XDrawString(XtDisplay(ilw), XtWindow(ilw), gc, str_x, str_y, str, strlen(str));
- X }
- X}
- X
- X/* Function Name: Redisplay
- X * Description: Repaints the widget window on expose events.
- X * Arguments: w - the xedwList widget.
- X * event - the expose event for this repaint.
- X * junk - NOT USED.
- X * Returns:
- X */
- X
- Xstatic void Redisplay(Widget w, XEvent *event, Region junk)
- X{
- X int item; /* an item to work with. */
- X int ul_item, lr_item; /* corners of items we need to paint. */
- X XedwListWidget ilw = (XedwListWidget) w;
- X
- X if (event == NULL) { /* repaint all. */
- X ul_item = 0;
- X lr_item = ilw->xedwList.nrows * ilw->xedwList.ncols - 1;
- X XClearWindow(XtDisplay(w), XtWindow(w));
- X }
- X else
- X FindCornerItems(w, event, &ul_item, &lr_item);
- X
- X ilw->xedwList.highlight = NO_HIGHLIGHT;
- X for (item = ul_item; (item <= lr_item && item < ilw->xedwList.nitems) ; item++)
- X if (ItemInRectangle(w, ul_item, lr_item, item))
- X if (IsHighlighted(w, item))
- X PaintItemName(w, item, XedwOn);
- X else
- X PaintItemName(w, item, XedwOff);
- X}
- X
- X/* Function Name: PreferredGeom
- X * Description: This tells the parent what size we would like to be
- X * given certain constraints.
- X * Arguments: w - the widget.
- X * intended - what the parent intends to do with us.
- X * requested - what we want to happen.
- X * Returns: none.
- X */
- X
- Xstatic XtGeometryResult PreferredGeom(Widget w,
- X XtWidgetGeometry *intended,
- X XtWidgetGeometry *requested)
- X{
- X Dimension new_width, new_height;
- X Boolean change, width_req, height_req;
- X
- X width_req = intended->request_mode & CWWidth;
- X height_req = intended->request_mode & CWHeight;
- X
- X if (width_req)
- X new_width = intended->width;
- X else
- X new_width = w->core.width;
- X
- X if (height_req)
- X new_height = intended->height;
- X else
- X new_height = w->core.height;
- X
- X requested->request_mode = 0;
- X
- X /*
- X * We only care about our height and width.
- X */
- X
- X if ( !width_req && !height_req)
- X return(XtGeometryYes);
- X
- X change = Layout(w, !width_req, !height_req, &new_width, &new_height);
- X
- X requested->request_mode |= CWWidth;
- X requested->width = new_width;
- X requested->request_mode |= CWHeight;
- X requested->height = new_height;
- X
- X if (change)
- X return(XtGeometryAlmost);
- X return(XtGeometryYes);
- X}
- X
- X/* Function Name: Resize
- X * Description: resizes the widget, by changing the number of rows and
- X * columns.
- X * Arguments: w - the widget.
- X * Returns: none.
- X */
- X
- Xstatic void Resize(Widget w)
- X{
- X Dimension width, height;
- X
- X width = w->core.width;
- X height = w->core.height;
- X
- X if (Layout(w, FALSE, FALSE, &width, &height))
- X XtAppWarning(XtWidgetToApplicationContext(w),
- X "XedwList Widget: Size changed when it shouldn't have when resising.");
- X}
- X
- X/* Function Name: Layout
- X * Description: lays out the item in the xedwList.
- X * Arguments: w - the widget.
- X * xfree, yfree - TRUE if we are free to resize the widget in
- X * this direction.
- X * width, height - the is the current width and height that
- X * we are going to layout the xedwList widget to,
- X * depending on xfree and yfree of course.
- X *
- X * Returns: TRUE if width or height have been changed.
- X */
- X
- Xstatic Boolean Layout(Widget w, Boolean xfree, Boolean yfree,
- X Dimension *width, Dimension *height)
- X{
- X XedwListWidget ilw = (XedwListWidget) w;
- X Boolean change = FALSE;
- X
- X /*
- X * If force columns is set then always use number of columns specified
- X * by default_cols.
- X */
- X
- X if (ilw->xedwList.force_cols) {
- X ilw->xedwList.ncols = ilw->xedwList.default_cols;
- X if (ilw->xedwList.ncols <= 0) ilw->xedwList.ncols = 1;
- X /* 12/3 = 4 and 10/3 = 4, but 9/3 = 3 */
- X ilw->xedwList.nrows = ( ( ilw->xedwList.nitems - 1) / ilw->xedwList.ncols) + 1 ;
- X if (xfree) { /* If allowed resize width. */
- X *width = ilw->xedwList.ncols * ilw->xedwList.col_width
- X + 2 * ilw->xedwList.internal_width;
- X change = TRUE;
- X }
- X if (yfree) { /* If allowed resize height. */
- X *height = (ilw->xedwList.nrows * ilw->xedwList.row_height)
- X + 2 * ilw->xedwList.internal_height;
- X change = TRUE;
- X }
- X return(change);
- X }
- X
- X /*
- X * If both width and height are free to change the use default_cols
- X * to determine the number columns and set new width and height to
- X * just fit the window.
- X */
- X
- X if (xfree && yfree) {
- X ilw->xedwList.ncols = ilw->xedwList.default_cols;
- X if (ilw->xedwList.ncols <= 0) ilw->xedwList.ncols = 1;
- X ilw->xedwList.nrows = ( ( ilw->xedwList.nitems - 1) / ilw->xedwList.ncols) + 1 ;
- X *width = ilw->xedwList.ncols * ilw->xedwList.col_width
- X + 2 * ilw->xedwList.internal_width;
- X *height = (ilw->xedwList.nrows * ilw->xedwList.row_height)
- X + 2 * ilw->xedwList.internal_height;
- X change = TRUE;
- X }
- X /*
- X * If the width is fixed then use it to determine the number of columns.
- X * If the height is free to move (width still fixed) then resize the height
- X * of the widget to fit the current xedwList exactly.
- X */
- X else if (!xfree) {
- X ilw->xedwList.ncols = ( (*width - 2 * ilw->xedwList.internal_width)
- X / ilw->xedwList.col_width);
- X if (ilw->xedwList.ncols <= 0) ilw->xedwList.ncols = 1;
- X ilw->xedwList.nrows = ( ( ilw->xedwList.nitems - 1) / ilw->xedwList.ncols) + 1 ;
- X if ( yfree ) {
- X *height = (ilw->xedwList.nrows * ilw->xedwList.row_height)
- X + 2 * ilw->xedwList.internal_height;
- X change = TRUE;
- X }
- X }
- X /*
- X * The last case is xfree and !yfree we use the height to determine
- X * the number of rows and then set the width to just fit the resulting
- X * number of columns.
- X */
- X else if (!yfree) { /* xfree must be TRUE. */
- X ilw->xedwList.nrows = (*height - 2 * ilw->xedwList.internal_height)
- X / ilw->xedwList.row_height;
- X if (ilw->xedwList.nrows <= 0) ilw->xedwList.nrows = 1;
- X ilw->xedwList.ncols = (( ilw->xedwList.nitems - 1 ) / ilw->xedwList.nrows) + 1;
- X *width = ilw->xedwList.ncols * ilw->xedwList.col_width
- X + 2 * ilw->xedwList.internal_width;
- X change = TRUE;
- X }
- X return(change);
- X}
- X
- X/* Function Name: Notify
- X * Description: Notifies the user that a button has been pressed, and
- X * calles the callback, if the XtNpasteBuffer resource
- X * is true then the name of the item is also put in the
- X * X cut buffer ( buf (0) ).
- X * Arguments: w - the widget that the notify occured in.
- X * event - event that caused this notification.
- X * params, num_params - not used.
- X * Returns: none.
- X */
- X
- Xstatic void Notify(Widget w, XEvent *event, String *params,
- X Cardinal *num_params)
- X{
- X XedwListWidget ilw = ( XedwListWidget ) w;
- X LinkedList *list = ilw->xedwList.is_highlighted;
- X int item, item_len;
- X XedwListReturnStruct ret_value;
- X
- X if ( ((CvtToItem(w, event->xbutton.x, event->xbutton.y, &item))
- X == OUT_OF_RANGE) || (ilw->xedwList.highlight != item) ) {
- X XedwListUnhighlight(w, ilw->xedwList.highlight);
- X RemoveNode(w, ilw->xedwList.highlight);
- X XtCallCallbacks(w, XtNcallback, (caddr_t) 0);
- X return;
- X }
- X
- X /* Put the name of ALL highlighted strings into the X cut buffer,
- X * seperated by spaces.
- X
- X item_len = 0;
- X while(list != NULL) {
- X item_len += strlen(ilw->xedwList.xedwList[list.index]->string) + 1;
- X list=list->next;
- X }
- X
- X */
- X
- X item_len = strlen(ilw->xedwList.xedwList[item]->string);
- X
- X if ( ilw->xedwList.paste ) /* if XtNpasteBuffer set then paste it. */
- X XStoreBytes(XtDisplay(w), ilw->xedwList.xedwList[item]->string, item_len);
- X
- X /*
- X * Call Callback function.
- X */
- X
- X ret_value.string = ilw->xedwList.xedwList[item]->string;
- X ret_value.xedwList_index = item;
- X ret_value.next = NULL;
- X
- X XtCallCallbacks( w, XtNcallback, (caddr_t) &ret_value);
- X}
- X
- X/* Function Name: Unset
- X * Description: unhighlights the current elements.
- X * Arguments: w - the widget that the event occured in.
- X * event - not used.
- X * params, num_params - not used.
- X * Returns: none.
- X */
- X
- Xstatic void Unset(Widget w, XEvent *event, String *params,
- X Cardinal *num_params)
- X{
- X XedwListUnhighlight(w, XedwAll);
- X}
- X
- X/* Function Name: Set
- X * Description: Highlights the current element.
- X * Arguments: w - the widget that the event occured in.
- X * event - event that caused this notification.
- X * params, num_params - not used.
- X * Returns: none.
- X */
- X
- Xstatic void Set(Widget w, XEvent *event, String *params,
- X Cardinal *num_params)
- X{
- X int item;
- X XedwListWidget ilw = (XedwListWidget) w;
- X
- X if ( (CvtToItem(w, event->xbutton.x, event->xbutton.y, &item))
- X == OUT_OF_RANGE)
- X XedwListUnhighlight(w, XedwAll); /* Unhighlight current items. */
- X else {
- X if (ilw->xedwList.highlight != item ||
- X ilw->xedwList.is_highlighted->next != NULL)
- X XedwListUnhighlight(w, XedwAll); /* Unhighlight any others */
- X XedwListHighlight(w, item); /* highlight it */
- X }
- X}
- X
- X/* Function Name: MultipleSet
- X * Description: Highlights the current element.
- X * Arguments: w - the widget that the event occured in.
- X * event - event that caused this notification.
- X * params, num_params - not used.
- X * Returns: none.
- X */
- X
- Xstatic void MultipleSet(Widget w, XEvent *event, String *params,
- X Cardinal *num_params)
- X{
- X int item;
- X XedwListWidget ilw = (XedwListWidget) w;
- X
- X if (ilw->xedwList.multiple == True)
- X if ( (CvtToItem(w, event->xbutton.x, event->xbutton.y, &item))
- X == OUT_OF_RANGE)
- X XedwListUnhighlight(w, XedwAll); /* Unhighlight all current items. */
- X else
- X if (IsHighlighted(w, item)) /* If already highlighted, */
- X XedwListUnhighlight(w, item); /* unhighlight it */
- X else
- X XedwListHighlight(w, item); /* otherwise highlight it */
- X else
- X XBell(XtDisplay(w), 100);
- X}
- X
- X/*
- X * Return state of a list item
- X */
- Xstatic Boolean IsHighlighted(Widget w, int item)
- X{
- X XedwListWidget ilw = (XedwListWidget) w;
- X LinkedList *list = ilw->xedwList.is_highlighted;
- X Boolean ret_val;
- X
- X while (list != NULL && list->index != item && list->index != NO_HIGHLIGHT)
- X list = list->next;
- X
- X if (list == NULL || list->index == NO_HIGHLIGHT)
- X ret_val=FALSE;
- X else
- X ret_val=TRUE;
- X
- X return(ret_val); /* true if item was in list false otherwise */
- X}
- X
- X/*
- X * Set specified arguments into widget
- X */
- X
- Xstatic Boolean SetValues(Widget current,
- X Widget request,
- X Widget new)
- X{
- X XedwListWidget cl = (XedwListWidget) current;
- X XedwListWidget rl = (XedwListWidget) request;
- X XedwListWidget nl = (XedwListWidget) new;
- X Boolean redraw = FALSE;
- X
- X if ((cl->xedwList.foreground != rl->xedwList.foreground) ||
- X (cl->core.background_pixel != rl->core.background_pixel) ||
- X (cl->xedwList.font != rl->xedwList.font) ) {
- X XtDestroyGC(cl->xedwList.normgc);
- X XtDestroyGC(cl->xedwList.graygc);
- X XtDestroyGC(cl->xedwList.revgc);
- X GetGCs(new);
- X redraw = TRUE;
- X }
- X
- X /* Reset row height. */
- X
- X if ((cl->xedwList.row_space != rl->xedwList.row_space) ||
- X (cl->xedwList.font != rl->xedwList.font) ||
- X (cl->xedwList.show_icons != rl->xedwList.show_icons) ||
- X (cl->xedwList.icon_width != rl->xedwList.icon_width) ||
- X (cl->xedwList.icon_height != rl->xedwList.icon_height))
- X if (rl->xedwList.show_icons)
- X nl->xedwList.row_height = nl->xedwList.font->max_bounds.ascent
- X + nl->xedwList.font->max_bounds.descent
- X + nl->xedwList.row_space
- X + nl->xedwList.icon_height;
- X else
- X nl->xedwList.row_height = nl->xedwList.font->max_bounds.ascent
- X + nl->xedwList.font->max_bounds.descent
- X + nl->xedwList.row_space;
- X
- X if ((cl->core.width != rl->core.width) ||
- X (cl->core.height != rl->core.height) ||
- X (cl->xedwList.internal_width != rl->xedwList.internal_width) ||
- X (cl->xedwList.internal_height != rl->xedwList.internal_height) ||
- X (cl->xedwList.column_space != rl->xedwList.column_space) ||
- X (cl->xedwList.row_space != rl->xedwList.row_space) ||
- X (cl->xedwList.default_cols != rl->xedwList.default_cols) ||
- X ((cl->xedwList.force_cols != rl->xedwList.force_cols) &&
- X (rl->xedwList.force_cols != rl->xedwList.ncols)) ||
- X (cl->xedwList.vertical_cols != rl->xedwList.vertical_cols) ||
- X (cl->xedwList.longest != rl->xedwList.longest) ||
- X (cl->xedwList.nitems != rl->xedwList.nitems) ||
- X (cl->xedwList.font != rl->xedwList.font) ||
- X (cl->xedwList.show_icons != rl->xedwList.show_icons) ||
- X (cl->xedwList.icon_width != rl->xedwList.icon_width) ||
- X (cl->xedwList.icon_height != rl->xedwList.icon_height) ||
- X (cl->xedwList.default_icon != rl->xedwList.default_icon) ||
- X (cl->xedwList.xedwList != rl->xedwList.xedwList) ) {
- X
- X ResetXedwList(new, TRUE, TRUE);
- X redraw = TRUE;
- X }
- X
- X if (cl->xedwList.xedwList != rl->xedwList.xedwList)
- X nl->xedwList.highlight = NO_HIGHLIGHT;
- X
- X if ((cl->core.sensitive != rl->core.sensitive) ||
- X (cl->core.ancestor_sensitive != rl->core.ancestor_sensitive)) {
- X nl->xedwList.highlight = NO_HIGHLIGHT;
- X redraw = TRUE;
- X }
- X
- X if (!XtIsRealized(current))
- X return(FALSE);
- X
- X return(redraw);
- X}
- X
- X/* Exported Functions */
- X
- X/* Function Name: XedwListChange.
- X * Description: Changes the xedwList being used and shown.
- X * Arguments: w - the xedwList widget.
- X * xedwList - the new xedwList.
- X * nitems - the number of items in the xedwList.
- X * longest - the length (in Pixels) of the longest element
- X * in the xedwList.
- X * resize - if TRUE the the xedwList widget will
- X * try to resize itself.
- X * Returns: none.
- X * NOTE: If nitems of longest are <= 0 then they will be calculated.
- X * If nitems is <= 0 then the xedwList needs to be NULL terminated.
- X */
- X
- Xvoid XedwListChange(Widget w, XedwList **xedwList,
- X int nitems, int longest, Boolean resize_it)
- X{
- X XedwListWidget ilw = (XedwListWidget) w;
- X
- X ilw->xedwList.xedwList = xedwList;
- X
- X if (nitems <= 0) nitems = 0;
- X ilw->xedwList.nitems = nitems;
- X if (longest <= 0) longest = 0;
- X ilw->xedwList.longest = longest;
- X
- X ResetXedwList(w, resize_it, resize_it);
- X /* Free the memeory in the old list TODO */
- X ilw->xedwList.is_highlighted->index = ilw->xedwList.highlight = NO_HIGHLIGHT;
- X ilw->xedwList.is_highlighted->next = NULL;
- X if ( XtIsRealized(w) )
- X Redisplay(w, NULL, NULL);
- X}
- X
- X/* Function Name: XedwListUnhighlight
- X * Description: unlights the current highlighted element.
- X * Arguments: w - the widget.
- X * Returns: none.
- X */
- X
- Xvoid XedwListUnhighlight(Widget w, int item)
- X{
- X XedwListWidget ilw = ( XedwListWidget ) w;
- X LinkedList *list = ilw->xedwList.is_highlighted;
- X LinkedList *temp;
- X
- X if (ilw->xedwList.is_highlighted->index != NO_HIGHLIGHT)
- X if (item == XedwAll) {
- X ilw->xedwList.highlight = list->index;
- X PaintItemName(w, list->index, XedwOff); /* unhighlight ALL */
- X while (list->next != NULL) {
- X temp = list;
- X list = list->next;
- X ilw->xedwList.highlight = list->index;
- X PaintItemName(w, list->index, XedwOff);
- X XtFree(temp);
- X }
- X list->index = NO_HIGHLIGHT;
- X ilw->xedwList.is_highlighted = list;
- X } else {
- X ilw->xedwList.highlight = item;
- X PaintItemName(w, item, XedwOff);
- X RemoveNode(w, item);
- X }
- X}
- X
- X/* Function Name: XedwListHighlight
- X * Description: Highlights the given item.
- X * Arguments: w - the xedwList widget.
- X * item - the item to hightlight.
- X * Returns: none.
- X */
- X
- Xvoid XedwListHighlight(Widget w, int item)
- X{
- X XedwListWidget ilw = ( XedwListWidget ) w;
- X int n;
- X
- X if (XtIsSensitive(w)) {
- X if (item == XedwAll) {
- X for(n=0; n < ilw->xedwList.nitems; n++) {
- X ilw->xedwList.highlight = n;
- X RemoveNode(w, n);
- X AddNode(w, n);
- X PaintItemName(w, n, XedwOn);
- X }
- X } else {
- X ilw->xedwList.highlight = item;
- X RemoveNode(w, item);
- X AddNode(w, item);
- X PaintItemName(w, item, XedwOn);
- X }
- X }
- X}
- X
- X/* Function Name: XedwListShowCurrent
- X * Description: returns the currently highlighted object.
- X * Arguments: w - the xedwList widget.
- X * Returns: the info about the currently highlighted object.
- X */
- X
- XXedwListReturnStruct *XedwListShowCurrent(Widget w)
- X{
- X XedwListWidget ilw = ( XedwListWidget ) w;
- X LinkedList *hl = ilw->xedwList.is_highlighted;
- X XedwListReturnStruct *ret_val, *rest;
- X
- X rest = NULL;
- X while (hl != NULL) {
- X ret_val = (XedwListReturnStruct *) XtMalloc (sizeof (XedwListReturnStruct));
- X
- X ret_val->xedwList_index = hl->index;
- X if (ret_val->xedwList_index == XDTM_LIST_NONE)
- X ret_val->string = "";
- X else
- X ret_val->string =
- X XtNewString(ilw->xedwList.xedwList[ret_val->xedwList_index]->string);
- X hl = hl->next;
- X ret_val->next = rest;
- X rest = ret_val;
- X }
- X return(ret_val);
- X}
- X
- XBoolean XedwListSelection(Widget w)
- X{
- X XedwListWidget ilw = ( XedwListWidget ) w;
- X LinkedList *hl = ilw->xedwList.is_highlighted;
- X Boolean ret_val = True;
- X
- X if (hl->index == NO_HIGHLIGHT)
- X ret_val = False;
- X
- X return(ret_val);
- X}
- X
- X/* AddNode to LinkedList of highlighted items
- X */
- Xstatic void AddNode(Widget w, int item)
- X{
- X XedwListWidget ilw = ( XedwListWidget ) w;
- X LinkedList *list = ilw->xedwList.is_highlighted;
- X LinkedList *temp;
- X
- X if (list->index != NO_HIGHLIGHT) {
- X temp = (LinkedList*) XtMalloc (sizeof(LinkedList));
- X temp->index = item;
- X temp->next = list;
- X ilw->xedwList.is_highlighted = temp;
- X } else
- X list->index = item;
- X}
- X
- X
- Xstatic void RemoveNode(Widget w, int item)
- X{
- X XedwListWidget ilw = ( XedwListWidget ) w;
- X LinkedList *list = ilw->xedwList.is_highlighted;
- X LinkedList *last;
- X
- X last = list;
- X while (list != NULL && list->index != item) {
- X last = list;
- X list=list->next;
- X }
- X if (list != NULL) { /* item WAS found */
- X if (last == list) { /* it was the first item */
- X if (list->next == NULL) /* there are no more in the list */
- X list->index = NO_HIGHLIGHT;
- X else {
- X ilw->xedwList.is_highlighted = list->next;
- X XtFree(list);
- X }
- X } else {
- X last->next = list->next;
- X XtFree(list);
- X }
- X }
- X}
- SHAR_EOF
- echo "File code/Xedw/XedwList.c is complete"
- chmod 0644 code/Xedw/XedwList.c || echo "restore of code/Xedw/XedwList.c fails"
- echo "x - extracting code/Xedw/XedwList.h (Text)"
- sed 's/^X//' << 'SHAR_EOF' > code/Xedw/XedwList.h &&
- X/*
- X * Copyright 1989 Massachusetts Institute of Technology
- X *
- X * Permission to use, copy, modify, distribute, and sell this software and its
- X * documentation for any purpose is hereby granted without fee, provided that
- X * the above copyright notice appear in all copies and that both that
- X * copyright notice and this permission notice appear in supporting
- X * documentation, and that the name of M.I.T. not be used in advertising or
- X * publicity pertaining to distribution of the software without specific,
- X * written prior permission. M.I.T. makes no representations about the
- X * suitability of this software for any purpose. It is provided "as is"
- X * without express or implied warranty.
- X *
- X * M.I.T. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
- X * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL M.I.T.
- X * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- X * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
- X * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
- X * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- X */
- X
- X/*
- X * XedwList.h - XedwList widget
- X *
- X * This is the XedwList widget. It is very similar to the Athena Widget List,
- X * except it has the ability to display an icon with the string.
- X * It allows the user to select an item in a xedwList and notifies the
- X * application through a callback function.
- X *
- X * List Created: 8/13/88
- X * By: Chris D. Peterson
- X * MIT X Consortium
- X *
- X * Modified to XedwList: 1/26/90
- X * By: Edward Groenendaal
- X * University of Sussex, UK.
- X */
- X
- X#ifndef _XawXedwList_h
- X#define _XawXedwList_h
- X
- X/***********************************************************************
- X *
- X * XedwList Widget
- X *
- X ***********************************************************************/
- X
- X#include <X11/Xaw/Simple.h>
- X
- X/* Resources:
- X
- X Name Class RepType Default Value
- X ---- ----- ------- -------------
- X background Background Pixel XtDefaultBackground
- X border BorderColor Pixel XtDefaultForeground
- X borderWidth BorderWidth Dimension 1
- X callback Callback XtCallbackXedwList NULL **6
- X columnSpacing Spacing Dimension 6
- X cursor Cursor Cursor left_ptr
- X defaultColumns Columns int 2 **5
- X destroyCallback Callback Pointer NULL
- X font Font XFontStruct* XtDefaultFont
- X forceColumns Columns Boolean False **5
- X foreground Foreground Pixel XtDefaultForeground
- X height Height Dimension 0 **1
- X insensitiveBorder Insensitive Pixmap Gray
- X internalHeight Height Dimension 2
- X internalWidth Width Dimension 4
- X xedwList XedwList XedwList ** NULL **2
- X iconWidth Width Dimension 32
- X iconHeight Height Dimension 32
- X longest Longest int 0 **3 **4
- X mappedWhenManaged MappedWhenManaged Boolean True
- X mSelections Boolean Boolean False
- X numberStrings NumberStrings int 0 **4
- X pasteBuffer Boolean Boolean False
- X rowSpacing Spacing Dimension 4
- X sensitive Sensitive Boolean True
- X showIcons Boolean Boolean False
- X verticalList Boolean Boolean False
- X width Width Dimension 0 **1
- X x Position Position 0
- X y Position Position 0
- X
- X **1 - If the Width or Height of the xedwList widget is zero (0) then the value
- X is set to the minimum size necessay to fit the entire list.
- X
- X If both Width and Height are zero then they are adjusted to fit the
- X entire list that is created width the number of default columns
- X specified in the defaultColumns resource.
- X
- X **2 - This is an array of strings the specify elements of the xedwList.
- X This resource must be specified.
- X
- X **3 - Longest is the length of the widest string in pixels.
- X
- X **4 - If either of these values are zero (0) then the xedwList widget calculates
- X the correct value.
- X
- X (This allows you to make startup faster if you already have
- X this information calculated)
- X
- X NOTE: If the numberStrings value is zero the xedwList must
- X be NULL terminated.
- X
- X **5 - By setting the XedwList.Columns resource you can force the application to
- X have a given number of columns.
- X
- X **6 - This returns the name and index of the item selected in an
- X XedwListReturnStruct that is pointed to by the client_data
- X in the CallbackProc.
- X
- X*/
- X
- X
- X/*
- X * Value returned when there are no highlighted objects.
- X */
- X
- X#define XDTM_LIST_NONE -1
- X
- X#define XtCXedwList "XedwList"
- X#define XtCSpacing "Spacing"
- X#define XtCColumns "Columns"
- X#define XtCLongest "Longest"
- X#define XtCNumberStrings "NumberStrings"
- X
- X#define XtNcursor "cursor"
- X#define XtNcolumnSpacing "columnSpacing"
- X#define XtNdefaultColumns "defaultColumns"
- X#define XtNforceColumns "forceColumns"
- X#define XtNxedwList "xedwList"
- X#define XtNiconWidth "iconWidth"
- X#define XtNiconHeight "iconHeight"
- X#define XtNdefaultIcon "defaultIcon"
- X#define XtNlongest "longest"
- X#define XtNnumberStrings "numberStrings"
- X#define XtNpasteBuffer "pasteBuffer"
- X#define XtNrowSpacing "rowSpacing"
- X#define XtNshowIcons "showIcons"
- X#define XtNmSelections "mSelections"
- X#define XtNverticalList "verticalList"
- X
- X#define XedwSingle 1
- X#define XedwMultiple 2
- X
- X#define XedwAll -1
- X
- X#define IconBitmapWidth 32
- X#define IconBitmapHeight 32
- X
- X/* Class record constants */
- X
- Xextern WidgetClass xedwListWidgetClass;
- X
- Xtypedef struct _XedwListClassRec *XedwListWidgetClass;
- Xtypedef struct _XedwListRec *XedwListWidget;
- X
- X/* The structure of XedwList */
- X
- Xtypedef struct _XedwList {
- X String string;
- X Pixmap icon;
- X} XedwList;
- X
- X/* The xedwList return structure. */
- X
- Xtypedef struct _XedwListReturnStruct {
- X String string; /* String */
- X int xedwList_index; /* Index into list */
- X struct _XedwListReturnStruct *next; /* Next highlighted entry */
- X} XedwListReturnStruct;
- X
- X/******************************************************************
- X *
- X * Exported Functions
- X *
- X *****************************************************************/
- X
- X/* Function Name: XedwListChange.
- X * Description: Changes the xedwList being used and shown.
- X * Arguments: w - the xedwList widget.
- X * xedwList - the new xedwList.
- X * nitems - the number of items in the xedwList.
- X * longest - the length (in Pixels) of the longest element
- X * in the xedwList.
- X * resize - if TRUE the the xedwList widget will
- X * try to resize itself.
- X * Returns: none.
- X * NOTE: If nitems of longest are <= 0 then they will be caluculated.
- X * If nitems is <= 0 then the xedwList needs to be NULL terminated.
- X */
- X
- Xextern void XedwListChange(Widget, XedwList**,int,int,Boolean);
- X
- X/* Function Name: XedwListUnhighlight
- X * Description: unlights the current highlighted element.
- X * Arguments: w - the widget.
- X * Returns: none.
- X */
- X
- Xextern void XedwListUnhighlight(Widget, int);
- X
- X/* Function Name: XedwListHighlight
- X * Description: Highlights the given item.
- X * Arguments: w - the xedwList widget.
- X * item - the item to hightlight.
- X * Returns: none.
- X */
- X
- Xextern void XedwListHighlight(Widget, int);
- X
- X
- X/* Function Name: XedwListShowCurrent
- X * Description: returns the currently highlighted objects.
- X * Arguments: w - the xedwList widget.
- X * Returns: the info about the currently highlighted object.
- X */
- X
- Xextern XedwListReturnStruct *XedwListShowCurrent(Widget);
- X
- Xextern Boolean XedwListSelection(Widget);
- X
- X#endif /* _XedwList_h */
- X
- SHAR_EOF
- chmod 0644 code/Xedw/XedwList.h || echo "restore of code/Xedw/XedwList.h fails"
- echo "x - extracting code/Xedw/XedwListP.h (Text)"
- sed 's/^X//' << 'SHAR_EOF' > code/Xedw/XedwListP.h &&
- X/*
- X * $XConsortium: XedwListP.h,v 1.12 89/12/11 15:09:04 kit Exp $
- X *
- X * Copyright 1989 Massachusetts Institute of Technology
- X *
- X * Permission to use, copy, modify, distribute, and sell this software and its
- X * documentation for any purpose is hereby granted without fee, provided that
- X * the above copyright notice appear in all copies and that both that
- X * copyright notice and this permission notice appear in supporting
- X * documentation, and that the name of M.I.T. not be used in advertising or
- X * publicity pertaining to distribution of the software without specific,
- X * written prior permission. M.I.T. makes no representations about the
- X * suitability of this software for any purpose. It is provided "as is"
- X * without express or implied warranty.
- X *
- X * M.I.T. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
- X * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL M.I.T.
- X * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- X * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
- X * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
- X * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- X *
- X * Author: Chris D. Peterson, MIT X Consortium
- X */
- X
- X
- X/*
- X * XedwListP.h - Private definitions for XedwList widget
- X *
- X * This is the XedwList widget, it is useful to display a xedwList, without the
- X * overhead of having a widget for each item in the xedwList. It allows
- X * the user to select an item in a xedwList and notifies the application through
- X * a callback function.
- X *
- X * Created: 8/13/88
- X * By: Chris D. Peterson
- X * MIT - Project Athena
- X */
- X
- X#ifndef _XedwListP_h
- X#define _XedwListP_h
- X
- X/***********************************************************************
- X *
- X * XedwList Widget Private Data
- X *
- X ***********************************************************************/
- X
- X#include <X11/Xaw/SimpleP.h>
- X#include "XedwList.h"
- X
- X#define NO_HIGHLIGHT XDTM_LIST_NONE
- X#define OUT_OF_RANGE -1
- X#define OKAY 0
- X#define XedwOff 0
- X#define XedwOn 1
- X
- X/* New fields for the XedwList widget class record */
- X
- Xtypedef struct {int foo;} XedwListClassPart;
- X
- X/* Full class record declaration */
- Xtypedef struct _XedwListClassRec {
- X CoreClassPart core_class;
- X SimpleClassPart simple_class;
- X XedwListClassPart xedwList_class;
- X} XedwListClassRec;
- X
- Xextern XedwListClassRec xedwListClassRec;
- X
- Xtypedef struct _LinkedList {
- X int index;
- X struct _LinkedList *next;
- X} LinkedList;
- X
- X/* New fields for the XedwList widget record */
- Xtypedef struct {
- X /* resources */
- X Pixel foreground;
- X Dimension internal_width,
- X internal_height,
- X column_space,
- X row_space,
- X icon_width,
- X icon_height;
- X int default_cols;
- X Boolean force_cols,
- X paste,
- X vertical_cols,
- X show_icons, /* Show icons with list */
- X multiple; /* Allow multiple selections */
- X int longest;
- X int nitems; /* number of items in the xedwList. */
- X XFontStruct *font;
- X XedwList **xedwList;
- X XtCallbackList callback;
- X
- X /* private state */
- X
- X LinkedList *is_highlighted; /* set to the items currently highlighted. */
- X int highlight, /* set to the item that should be highlighted.*/
- X col_width, /* width of each column. */
- X row_height, /* height of each row. */
- X nrows, /* number of rows in the xedwList. */
- X ncols; /* number of columns in the xedwList. */
- X GC normgc, /* a couple o' GC's. */
- X revgc,
- X graygc; /* used when inactive. */
- X Pixmap default_icon;
- X
- X} XedwListPart;
- X
- X
- X/****************************************************************
- X *
- X * Full instance record declaration
- X *
- X ****************************************************************/
- X
- Xtypedef struct _XedwListRec {
- X CorePart core;
- X SimplePart simple;
- X XedwListPart xedwList;
- X} XedwListRec;
- X
- X#endif /* _XedwListP_h */
- X
- X
- X
- SHAR_EOF
- chmod 0644 code/Xedw/XedwListP.h || echo "restore of code/Xedw/XedwListP.h fails"
- echo "x - extracting code/Xedw/XedwTree.c (Text)"
- sed 's/^X//' << 'SHAR_EOF' > code/Xedw/XedwTree.c &&
- X#include <X11/copyright.h>
- X
- X/* $XConsortium: Template.c,v 1.2 88/10/25 17:40:25 swick Exp $ */
- X/* Copyright Massachusetts Institute of Technology 1987, 1988 */
- X
- X#include <X11/IntrinsicP.h>
- X#include <X11/StringDefs.h>
- X#include "TemplateP.h"
- X
- Xstatic XtResource resources[] = {
- X#define offset(field) XtOffset(TemplateWidget, template.field)
- X /* {name, class, type, size, offset, default_type, default_addr}, */
- X { XtNtemplateResource, XtCTemplateResource, XtRTemplateResource, sizeof(char*),
- X offset(resource), XtRString, "default" },
- X#undef offset
- X};
- X
- Xstatic void TemplateAction(/* Widget, XEvent*, String*, Cardinal* */);
- X
- Xstatic XtActionsRec actions[] =
- X{
- X /* {name, procedure}, */
- X {"template", TemplateAction},
- X};
- X
- Xstatic char translations[] =
- X"<Key>: template() \n\
- X";
- X
- XTemplateClassRec templateClassRec = {
- X { /* core fields */
- X /* superclass */ (WidgetClass) &widgetClassRec,
- X /* class_name */ "Template",
- X /* widget_size */ sizeof(TemplateRec),
- X /* class_initialize */ NULL,
- X /* class_part_initialize */ NULL,
- X /* class_inited */ FALSE,
- X /* initialize */ NULL,
- X /* initialize_hook */ NULL,
- X /* realize */ XtInheritRealize,
- X /* actions */ actions,
- X /* num_actions */ XtNumber(actions),
- X /* resources */ resources,
- X /* num_resources */ XtNumber(resources),
- X /* xrm_class */ NULLQUARK,
- X /* compress_motion */ TRUE,
- X /* compress_exposure */ TRUE,
- X /* compress_enterleave */ TRUE,
- X /* visible_interest */ FALSE,
- X /* destroy */ NULL,
- X /* resize */ NULL,
- X /* expose */ NULL,
- X /* set_values */ NULL,
- X /* set_values_hook */ NULL,
- X /* set_values_almost */ XtInheritSetValuesAlmost,
- X /* get_values_hook */ NULL,
- X /* accept_focus */ NULL,
- X /* version */ XtVersion,
- X /* callback_private */ NULL,
- X /* tm_table */ translations,
- X /* query_geometry */ XtInheritQueryGeometry,
- X /* display_accelerator */ XtInheritDisplayAccelerator,
- X /* extension */ NULL
- X },
- X { /* template fields */
- X /* empty */ 0
- X }
- X};
- X
- XWidgetClass templateWidgetClass = (WidgetClass)&templateClassRec;
- SHAR_EOF
- chmod 0644 code/Xedw/XedwTree.c || echo "restore of code/Xedw/XedwTree.c fails"
- echo "x - extracting code/Xedw/XedwTree.h (Text)"
- sed 's/^X//' << 'SHAR_EOF' > code/Xedw/XedwTree.h &&
- X#include <X11/copyright.h>
- X
- X/* $XConsortium: Template.h,v 1.4 89/07/21 01:41:49 kit Exp $ */
- X/* Copyright Massachusetts Institute of Technology 1987, 1988 */
- X
- X#ifndef _Template_h
- X#define _Template_h
- X
- X/****************************************************************
- X *
- X * Template widget
- X *
- X ****************************************************************/
- X
- X/* Resources:
- X
- X Name Class RepType Default Value
- X ---- ----- ------- -------------
- X background Background Pixel XtDefaultBackground
- X border BorderColor Pixel XtDefaultForeground
- X borderWidth BorderWidth Dimension 1
- X destroyCallback Callback Pointer NULL
- X height Height Dimension 0
- X mappedWhenManaged MappedWhenManaged Boolean True
- X sensitive Sensitive Boolean True
- X width Width Dimension 0
- X x Position Position 0
- X y Position Position 0
- X
- X*/
- X
- X/* define any special resource names here that are not in <X11/StringDefs.h> */
- X
- X#define XtNtemplateResource "templateResource"
- X
- X#define XtCTemplateResource "TemplateResource"
- X
- X/* declare specific TemplateWidget class and instance datatypes */
- X
- Xtypedef struct _TemplateClassRec* TemplateWidgetClass;
- Xtypedef struct _TemplateRec* TemplateWidget;
- X
- X/* declare the class constant */
- X
- Xextern WidgetClass templateWidgetClass;
- X
- X#endif /* _Template_h */
- SHAR_EOF
- chmod 0644 code/Xedw/XedwTree.h || echo "restore of code/Xedw/XedwTree.h fails"
- echo "x - extracting code/Xedw/XedwTreeP.h (Text)"
- sed 's/^X//' << 'SHAR_EOF' > code/Xedw/XedwTreeP.h &&
- X#include <X11/copyright.h>
- X
- X/* $XConsortium: TemplateP.h,v 1.4 89/07/21 01:41:48 kit Exp $ */
- X/* Copyright Massachusetts Institute of Technology 1987, 1988 */
- X
- X#ifndef _TemplateP_h
- X#define _TemplateP_h
- X
- X#include "Template.h"
- X/* include superclass private header file */
- X#include <X11/CoreP.h>
- X
- X/* define unique representation types not found in <X11/StringDefs.h> */
- X
- X#define XtRTemplateResource "TemplateResource"
- X
- Xtypedef struct {
- X int empty;
- X} TemplateClassPart;
- X
- Xtypedef struct _TemplateClassRec {
- X CoreClassPart core_class;
- X TemplateClassPart template_class;
- X} TemplateClassRec;
- X
- Xextern TemplateClassRec templateClassRec;
- X
- Xtypedef struct {
- X /* resources */
- X char* resource;
- X /* private state */
- X} TemplatePart;
- X
- Xtypedef struct _TemplateRec {
- X CorePart core;
- X TemplatePart template;
- X} TemplateRec;
- X
- X#endif /* _TemplateP_h */
- SHAR_EOF
- chmod 0644 code/Xedw/XedwTreeP.h || echo "restore of code/Xedw/XedwTreeP.h fails"
- rm -f s2_seq_.tmp
- echo "You have unpacked the last part"
- exit 0
-