diff options
author | Alan Coopersmith <alan.coopersmith@oracle.com> | 2023-02-28 19:19:13 -0800 |
---|---|---|
committer | Alan Coopersmith <alan.coopersmith@oracle.com> | 2023-09-23 09:42:20 -0700 |
commit | e1b030770a2d489ff832b619ba646aa96e0bfb5c (patch) | |
tree | 2aca7459aee00a427366e6b1649c71d5dbe219cb | |
parent | 77533b88018c2923075562e106ef2970c7e6c6a9 (diff) |
Use C99 designated initializers where appropriate
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
-rw-r--r-- | src/AsciiSink.c | 33 | ||||
-rw-r--r-- | src/Box.c | 8 | ||||
-rw-r--r-- | src/Command.c | 15 | ||||
-rw-r--r-- | src/DisplayList.c | 12 | ||||
-rw-r--r-- | src/Grip.c | 10 | ||||
-rw-r--r-- | src/Label.c | 34 | ||||
-rw-r--r-- | src/List.c | 43 | ||||
-rw-r--r-- | src/MultiSink.c | 18 | ||||
-rw-r--r-- | src/Paned.c | 4 | ||||
-rw-r--r-- | src/Panner.c | 10 | ||||
-rw-r--r-- | src/Porthole.c | 21 | ||||
-rw-r--r-- | src/SmeBSB.c | 17 | ||||
-rw-r--r-- | src/SmeLine.c | 10 | ||||
-rw-r--r-- | src/Text.c | 34 | ||||
-rw-r--r-- | src/TextAction.c | 34 | ||||
-rw-r--r-- | src/TextSrc.c | 14 | ||||
-rw-r--r-- | src/Tip.c | 11 | ||||
-rw-r--r-- | src/Vendor.c | 12 | ||||
-rw-r--r-- | src/Viewport.c | 19 |
19 files changed, 189 insertions, 170 deletions
diff --git a/src/AsciiSink.c b/src/AsciiSink.c index 74587c6..ac2d78f 100644 --- a/src/AsciiSink.c +++ b/src/AsciiSink.c @@ -982,8 +982,6 @@ AsciiDoPaint(Widget w) /* dont care on order of drawing or caching of state (by now) */ paint = list->bearings; while (paint) { - XRectangle rect2; - if (paint->highlight) XSetForeground(XtDisplay(ctx), gc, sink->text_sink.background); if (!paint->property || !(paint->property->mask & XAW_TPROP_FONT)) @@ -999,10 +997,13 @@ AsciiDoPaint(Widget w) XSetForeground(XtDisplay(ctx), gc, paint->property->foreground); } if (paint->x < XtWidth(ctx) && paint->x + paint->width > 0) { - rect2.x = (short)(paint->x + paint->width); - rect2.width = (XawAbs(paint->width)); /* more than enough */ - rect2.y = (short)(paint->y - font->ascent); - rect2.height = (unsigned short)(rect2.y + font->ascent + font->descent); + XRectangle rect2 = { + .x = (short)(paint->x + paint->width), + .width = (XawAbs(paint->width)), /* more than enough */ + .y = (short)(paint->y - font->ascent), + .height = (unsigned short)((paint->y - font->ascent) + + font->ascent + font->descent) + }; XSetClipRectangles(XtDisplay((Widget)ctx), gc, 0, 0, &rect2, 1, Unsorted); XDrawString(XtDisplay(ctx), XtWindow(ctx), gc, paint->x, paint->y, @@ -1654,16 +1655,16 @@ GetGC(AsciiSinkObject sink) { XtGCMask valuemask = (GCFont | GCGraphicsExposures | GCClipXOrigin | GCForeground | GCBackground); - XGCValues values; - - /* XXX We dont want do share a gc that will change the clip-mask */ - values.clip_x_origin = (int)(long)sink; - values.clip_mask = None; - values.font = sink->ascii_sink.font->fid; - values.graphics_exposures = False; - - values.foreground = sink->text_sink.foreground; - values.background = sink->text_sink.background; + XGCValues values = { + /* XXX We dont want to share a gc that will change the clip-mask */ + .clip_x_origin = (int)(long)sink, + .clip_mask = None, + .font = sink->ascii_sink.font->fid, + .graphics_exposures = False, + + .foreground = sink->text_sink.foreground, + .background = sink->text_sink.background + }; sink->ascii_sink.normgc = XtAllocateGC((Widget)sink, 0, valuemask, &values, GCClipMask | GCFont | GCForeground | GCBackground, 0); @@ -497,10 +497,12 @@ TryNewLayout(BoxWidget bbw) proposed_height = preferred_height; } else { /* proposed_height != preferred_height */ - XtWidgetGeometry constraints, reply; + XtWidgetGeometry constraints = { + .request_mode = CWHeight, + .height = proposed_height + }; + XtWidgetGeometry reply; - constraints.request_mode = CWHeight; - constraints.height = proposed_height; (void)XawBoxQueryGeometry((Widget)bbw, &constraints, &reply); proposed_width = preferred_width; } diff --git a/src/Command.c b/src/Command.c index 7adf3fd..8417f9d 100644 --- a/src/Command.c +++ b/src/Command.c @@ -219,17 +219,16 @@ WidgetClass commandWidgetClass = (WidgetClass)&commandClassRec; static GC Get_GC(CommandWidget cbw, Pixel fg, Pixel bg) { - XGCValues values; - - values.foreground = fg; - values.background = bg; - values.font = cbw->label.font->fid; - values.cap_style = CapProjecting; + XGCValues values = { + .foreground = fg, + .background = bg, + .font = cbw->label.font->fid, + .cap_style = CapProjecting, + .line_width = 0 + }; if (cbw->command.highlight_thickness > 1) values.line_width = cbw->command.highlight_thickness; - else - values.line_width = 0; if (cbw->simple.international == True) return (XtAllocateGC((Widget)cbw, 0, diff --git a/src/DisplayList.c b/src/DisplayList.c index 135da85..936c3a8 100644 --- a/src/DisplayList.c +++ b/src/DisplayList.c @@ -880,12 +880,14 @@ DlMask(Widget w, XtPointer args _X_UNUSED, XtPointer data, XSetRegion(display, xdata->gc, region); else if (event) { - XRectangle rect; + XRectangle rect = + { + .x = (short)event->xexpose.x, + .y = (short)event->xexpose.y, + .width = (unsigned short)event->xexpose.width, + .height = (unsigned short)event->xexpose.height + }; - rect.x = (short)event->xexpose.x; - rect.y = (short)event->xexpose.y; - rect.width = (unsigned short)event->xexpose.width; - rect.height = (unsigned short)event->xexpose.height; XSetClipRectangles(display, xdata->gc, 0, 0, &rect, 1, Unsorted); } } @@ -175,11 +175,11 @@ WidgetClass gripWidgetClass = (WidgetClass)&gripClassRec; static void GripAction(Widget widget, XEvent *event, String *params, Cardinal *num_params) { - XawGripCallDataRec call_data; - - call_data.event = event; - call_data.params = params; - call_data.num_params = *num_params; + XawGripCallDataRec call_data = { + .event = event, + .params = params, + .num_params = *num_params + }; XtCallCallbacks(widget, XtNcallback, (XtPointer)&call_data); } diff --git a/src/Label.c b/src/Label.c index ffdad56..fd37881 100644 --- a/src/Label.c +++ b/src/Label.c @@ -384,12 +384,12 @@ SetTextWidthAndHeight(LabelWidget lw) static void GetNormalGC(LabelWidget lw) { - XGCValues values; - - values.foreground = lw->label.foreground; - values.background = lw->core.background_pixel; - values.font = lw->label.font->fid; - values.graphics_exposures = False; + XGCValues values = { + .foreground = lw->label.foreground, + .background = lw->core.background_pixel, + .font = lw->label.font->fid, + .graphics_exposures = False + }; if (lw->simple.international == True) /* Since Xmb/wcDrawString eats the font, I must use XtAllocateGC */ @@ -406,17 +406,17 @@ GetNormalGC(LabelWidget lw) static void GetGrayGC(LabelWidget lw) { - XGCValues values; - - values.foreground = lw->label.foreground; - values.background = lw->core.background_pixel; - values.font = lw->label.font->fid; - values.fill_style = FillTiled; - values.tile = XmuCreateStippledPixmap(XtScreen((Widget)lw), - lw->label.foreground, - lw->core.background_pixel, - lw->core.depth); - values.graphics_exposures = False; + XGCValues values = { + .foreground = lw->label.foreground, + .background = lw->core.background_pixel, + .font = lw->label.font->fid, + .fill_style = FillTiled, + .tile = XmuCreateStippledPixmap(XtScreen((Widget)lw), + lw->label.foreground, + lw->core.background_pixel, + lw->core.depth), + .graphics_exposures = False + }; lw->label.stipple = values.tile; if (lw->simple.international == True) @@ -319,11 +319,11 @@ WidgetClass listWidgetClass = (WidgetClass)&listClassRec; static void GetGCs(Widget w) { - XGCValues values; ListWidget lw = (ListWidget)w; - - values.foreground = lw->list.foreground; - values.font = lw->list.font->fid; + XGCValues values = { + .foreground = lw->list.foreground, + .font = lw->list.font->fid + }; if (lw->simple.international == True) lw->list.normgc = XtAllocateGC(w, 0, GCForeground, &values, GCFont, 0); @@ -433,11 +433,12 @@ ResetList(Widget w, Bool changex, Bool changey) static void ChangeSize(Widget w, unsigned int width, unsigned int height) { - XtWidgetGeometry request, reply; - - request.request_mode = CWWidth | CWHeight; - request.width = (Dimension)width; - request.height = (Dimension)height; + XtWidgetGeometry request = { + .request_mode = CWWidth | CWHeight, + .width = (Dimension)width, + .height = (Dimension)height + }; + XtWidgetGeometry reply; switch (XtMakeGeometryRequest(w, &request, &reply)) { case XtGeometryYes: @@ -669,12 +670,15 @@ HighlightBackground(Widget w, int x, int y, GC gc) static void ClipToShadowInteriorAndLongest(ListWidget lw, GC *gc_p, unsigned int x) { - XRectangle rect; + XRectangle rect = { + .x = (short)x, + .y = (short)lw->list.internal_height, + .height = (unsigned short) + (XtHeight(lw) - (lw->list.internal_height << 1)), + .width = (unsigned short) + (XtWidth(lw) - (unsigned)lw->list.internal_width - x), + }; - rect.x = (short)x; - rect.y = (short)lw->list.internal_height; - rect.height = (unsigned short)(XtHeight(lw) - (lw->list.internal_height << 1)); - rect.width = (unsigned short)(XtWidth(lw) - (unsigned)lw->list.internal_width - x); if (rect.width > lw->list.longest) rect.width = (unsigned short)lw->list.longest; @@ -981,7 +985,6 @@ Notify(Widget w, XEvent *event, String *params _X_UNUSED, Cardinal *num_params _ { ListWidget lw = (ListWidget)w; int item, item_len; - XawListReturnStruct ret_value; /* * Find item and if out of range then unhighlight and return @@ -1013,10 +1016,14 @@ Notify(Widget w, XEvent *event, String *params _X_UNUSED, Cardinal *num_params _ /* * Call Callback function */ - ret_value.string = lw->list.list[item]; - ret_value.list_index = item; + { + XawListReturnStruct ret_value = { + .string = lw->list.list[item], + .list_index = item + }; - XtCallCallbacks(w, XtNcallback, (XtPointer)&ret_value); + XtCallCallbacks(w, XtNcallback, (XtPointer)&ret_value); + } } /* Unset() - Action diff --git a/src/MultiSink.c b/src/MultiSink.c index c93eeea..6bb2465 100644 --- a/src/MultiSink.c +++ b/src/MultiSink.c @@ -657,15 +657,15 @@ GetGC(MultiSinkObject sink) { XtGCMask valuemask = (GCGraphicsExposures | GCClipXOrigin | GCForeground | GCBackground); - XGCValues values; - - /* XXX We dont want do share a gc that will change the clip-mask */ - values.clip_x_origin = (int)(long)sink; - values.clip_mask = None; - values.graphics_exposures = False; - - values.foreground = sink->text_sink.foreground; - values.background = sink->text_sink.background; + XGCValues values = { + /* XXX We dont want to share a gc that will change the clip-mask */ + .clip_x_origin = (int)(long)sink, + .clip_mask = None, + .graphics_exposures = False, + + .foreground = sink->text_sink.foreground, + .background = sink->text_sink.background + }; sink->multi_sink.normgc = XtAllocateGC((Widget)sink, 0, valuemask, &values, GCFont | GCClipMask, 0); diff --git a/src/Paned.c b/src/Paned.c index 13e238d..736003b 100644 --- a/src/Paned.c +++ b/src/Paned.c @@ -792,9 +792,7 @@ static void CommitNewLocations(PanedWidget pw) { Widget *childP; - XWindowChanges changes; - - changes.stack_mode = Above; + XWindowChanges changes = { .stack_mode = Above }; ForAllPanes(pw, childP) { Pane pane = PaneInfo(*childP); diff --git a/src/Panner.c b/src/Panner.c index d8334eb..d8f1883 100644 --- a/src/Panner.c +++ b/src/Panner.c @@ -981,11 +981,11 @@ ActionPage(Widget gw, XEvent *event, String *params, Cardinal *num_params) y += pw->panner.knob_y; if (isin) { /* if in, then use move */ - XEvent ev; - - ev.xbutton.type = ButtonPress; - ev.xbutton.x = x; - ev.xbutton.y = y; + XEvent ev = { + .xbutton.type = ButtonPress, + .xbutton.x = x, + .xbutton.y = y + }; ActionMove(gw, &ev, NULL, &zero); } else { diff --git a/src/Porthole.c b/src/Porthole.c index c87be98..2bbf967 100644 --- a/src/Porthole.c +++ b/src/Porthole.c @@ -153,15 +153,15 @@ SendReport(PortholeWidget pw, unsigned int changed) Widget child = find_child(pw); if (pw->porthole.report_callbacks && child) { - XawPannerReport prep; - - prep.changed = changed; - prep.slider_x = (Position)(-XtX(child)); /* porthole is "inner" */ - prep.slider_y = (Position)(-XtY(child)); /* child is outer since it is larger */ - prep.slider_width = XtWidth(pw); - prep.slider_height = XtHeight(pw); - prep.canvas_width = XtWidth(child); - prep.canvas_height = XtHeight(child); + XawPannerReport prep = { + .changed = changed, + .slider_x = (Position)(-XtX(child)), /* porthole is "inner" */ + .slider_y = (Position)(-XtY(child)), /* child is outer since it is larger */ + .slider_width = XtWidth(pw), + .slider_height = XtHeight(pw), + .canvas_width = XtWidth(child), + .canvas_height = XtHeight(child) + }; XtCallCallbackList((Widget)pw, pw->porthole.report_callbacks, (XtPointer)&prep); } @@ -351,9 +351,8 @@ XawPortholeChangeManaged(Widget gw) if (child) { if (!XtIsRealized (gw)) { - XtWidgetGeometry geom, retgeom; + XtWidgetGeometry geom = { .request_mode = 0 }, retgeom; - geom.request_mode = 0; if (XtWidth(pw) == 0) { geom.width = XtWidth(child); geom.request_mode |= CWWidth; diff --git a/src/SmeBSB.c b/src/SmeBSB.c index 380a215..d4653f7 100644 --- a/src/SmeBSB.c +++ b/src/SmeBSB.c @@ -705,15 +705,16 @@ static void CreateGCs(Widget w) { SmeBSBObject entry = (SmeBSBObject)w; - XGCValues values; - XtGCMask mask, mask_i18n; + XGCValues values = { + .foreground = XtParent(w)->core.background_pixel, + .background = entry->sme_bsb.foreground, + .font = entry->sme_bsb.font->fid, + .graphics_exposures = False + }; + + XtGCMask mask = GCForeground | GCBackground | GCGraphicsExposures | GCFont; + XtGCMask mask_i18n = GCForeground | GCBackground | GCGraphicsExposures; - values.foreground = XtParent(w)->core.background_pixel; - values.background = entry->sme_bsb.foreground; - values.font = entry->sme_bsb.font->fid; - values.graphics_exposures = False; - mask = GCForeground | GCBackground | GCGraphicsExposures | GCFont; - mask_i18n = GCForeground | GCBackground | GCGraphicsExposures; if (entry->sme.international == True) entry->sme_bsb.rev_gc = XtAllocateGC(w, 0, mask_i18n, &values, GCFont, 0); else diff --git a/src/SmeLine.c b/src/SmeLine.c index 350b3fd..2298032 100644 --- a/src/SmeLine.c +++ b/src/SmeLine.c @@ -181,12 +181,12 @@ static void CreateGC(Widget w) { SmeLineObject entry = (SmeLineObject)w; - XGCValues values; XtGCMask mask = GCForeground | GCGraphicsExposures | GCLineWidth; - - values.foreground = entry->sme_line.foreground; - values.graphics_exposures = False; - values.line_width = entry->sme_line.line_width; + XGCValues values = { + .foreground = entry->sme_line.foreground, + .graphics_exposures = False, + .line_width = entry->sme_line.line_width + }; if (entry->sme_line.stipple != XtUnspecifiedPixmap) { values.stipple = entry->sme_line.stipple; @@ -1069,14 +1069,16 @@ void _XawTextNeedsUpdating(TextWidget ctx, XawTextPosition left, XawTextPosition right) { - XmuSegment segment; - if (left >= right) return; + else { + XmuSegment segment = { + .x1 = (int)left, + .x2 = (int)right + }; - segment.x1 = (int)left; - segment.x2 = (int)right; - (void)XmuScanlineOrSegment(ctx->text.update, &segment); + (void)XmuScanlineOrSegment(ctx->text.update, &segment); + } } /* @@ -2055,14 +2057,15 @@ TextConvertSelection(Widget w, Atom *selection, Atom *target, Atom *type, } /* Got *value,*length, now in COMPOUND_TEXT format. */ if (XawTextFormat(ctx, XawFmtWide) && *type == XA_STRING) { - XTextProperty textprop; wchar_t **wlist; int count; + XTextProperty textprop = { + .encoding = XA_COMPOUND_TEXT(d), + .value = (unsigned char *)*value, + .nitems = strlen(*value), + .format = 8 + }; - textprop.encoding = XA_COMPOUND_TEXT(d); - textprop.value = (unsigned char *)*value; - textprop.nitems = strlen(*value); - textprop.format = 8; if (XwcTextPropertyToTextList(d, &textprop, &wlist, &count) < Success || count < 1) { @@ -2079,14 +2082,15 @@ TextConvertSelection(Widget w, Atom *selection, Atom *target, Atom *type, *length = textprop.nitems; XwcFreeStringList(wlist); } else if (*type == XA_UTF8_STRING(d)) { - XTextProperty textprop; char **list; int count; + XTextProperty textprop = { + .encoding = XA_COMPOUND_TEXT(d), + .value = (unsigned char *)*value, + .nitems = strlen(*value), + .format = 8 + }; - textprop.encoding = XA_COMPOUND_TEXT(d); - textprop.value = (unsigned char *)*value; - textprop.nitems = strlen(*value); - textprop.format = 8; if (Xutf8TextPropertyToTextList(d, &textprop, &list, &count) < Success || count < 1) { diff --git a/src/TextAction.c b/src/TextAction.c index 0e546fb..01cc752 100644 --- a/src/TextAction.c +++ b/src/TextAction.c @@ -403,14 +403,14 @@ _SelectionReceived(Widget w, XtPointer client_data, Atom *selection _X_UNUSED, StartAction(ctx, NULL); if (XawTextFormat(ctx, XawFmtWide)) { - XTextProperty textprop; wchar_t **wlist; int count; - - textprop.encoding = *type; - textprop.value = (unsigned char *)value; - textprop.nitems = strlen(value); - textprop.format = 8; + XTextProperty textprop = { + .encoding = *type, + .value = (unsigned char *)value, + .nitems = strlen(value), + .format = 8 + }; if (XwcTextPropertyToTextList(d, &textprop, &wlist, &count) != Success @@ -1044,14 +1044,15 @@ ConvertSelection(Widget w, Atom *selection, Atom *target, Atom *type, /* Got *value,*length, now in COMPOUND_TEXT format. */ if (XawTextFormat(ctx, XawFmtWide)) { if (*type == XA_STRING) { - XTextProperty textprop; wchar_t **wlist; int count; + XTextProperty textprop = { + .encoding = XA_COMPOUND_TEXT(d), + .value = (unsigned char *)*value, + .nitems = strlen(*value), + .format = 8 + }; - textprop.encoding = XA_COMPOUND_TEXT(d); - textprop.value = (unsigned char *)*value; - textprop.nitems = strlen(*value); - textprop.format = 8; if (XwcTextPropertyToTextList(d, &textprop, &wlist, &count) < Success || count < 1) { @@ -1069,14 +1070,15 @@ ConvertSelection(Widget w, Atom *selection, Atom *target, Atom *type, XwcFreeStringList((wchar_t**) wlist); } else if (*type == XA_UTF8_STRING(d)) { - XTextProperty textprop; char **list; int count; + XTextProperty textprop = { + .encoding = XA_COMPOUND_TEXT(d), + .value = (unsigned char *)*value, + .nitems = strlen(*value), + .format = 8 + }; - textprop.encoding = XA_COMPOUND_TEXT(d); - textprop.value = (unsigned char *)*value; - textprop.nitems = strlen(*value); - textprop.format = 8; if (Xutf8TextPropertyToTextList(d, &textprop, &list, &count) < Success || count < 1) { diff --git a/src/TextSrc.c b/src/TextSrc.c index c59c3fc..d22bb11 100644 --- a/src/TextSrc.c +++ b/src/TextSrc.c @@ -983,7 +983,6 @@ XawTextSourceReplace(Widget w, XawTextPosition left, src->textSrc.changed = True; if (error == XawEditDone) { - XawTextPropertyInfo info; XawTextAnchor *anchor; /* find anchor and index */ @@ -1183,10 +1182,15 @@ exit_anchor_loop: } } - info.left = left; - info.right = right; - info.block = block; - XtCallCallbacks(w, XtNpropertyCallback, &info); + { + XawTextPropertyInfo info = { + .left = left, + .right = right, + .block = block + }; + + XtCallCallbacks(w, XtNpropertyCallback, &info); + } TellSourceChanged(src, left, right, block, lines); /* Call callbacks, we have changed the buffer */ @@ -380,12 +380,13 @@ XawTipSetValues(Widget current, Widget request _X_UNUSED, Widget cnew, if (curtip->tip.font->fid != newtip->tip.font->fid || curtip->tip.foreground != newtip->tip.foreground) { - XGCValues values; + XGCValues values = { + .foreground = newtip->tip.foreground, + .background = newtip->core.background_pixel, + .font = newtip->tip.font->fid, + .graphics_exposures = False + }; - values.foreground = newtip->tip.foreground; - values.background = newtip->core.background_pixel; - values.font = newtip->tip.font->fid; - values.graphics_exposures = False; XtReleaseGC(cnew, curtip->tip.gc); newtip->tip.gc = XtAllocateGC(cnew, 0, GCForeground | GCBackground | GCFont | GCGraphicsExposures, &values, diff --git a/src/Vendor.c b/src/Vendor.c index 7940d2e..ed4bc73 100644 --- a/src/Vendor.c +++ b/src/Vendor.c @@ -280,16 +280,16 @@ XawCvtCompoundTextToString(Display *dpy, XrmValuePtr args _X_UNUSED, Cardinal *n XrmValue *fromVal, XrmValue *toVal, XtPointer *cvt_data _X_UNUSED) { - XTextProperty prop; char **list; int count; static char *mbs = NULL; int len; - - prop.value = (unsigned char *)fromVal->addr; - prop.encoding = XA_COMPOUND_TEXT(dpy); - prop.format = 8; - prop.nitems = fromVal->size; + XTextProperty prop = { + .value = (unsigned char *)fromVal->addr, + .encoding = XA_COMPOUND_TEXT(dpy), + .format = 8, + .nitems = fromVal->size + }; if(XmbTextPropertyToTextList(dpy, &prop, &list, &count) < Success) { XtAppWarningMsg(XtDisplayToApplicationContext(dpy), diff --git a/src/Viewport.c b/src/Viewport.c index 9256ffa..fbd701e 100644 --- a/src/Viewport.c +++ b/src/Viewport.c @@ -472,19 +472,18 @@ RedrawThumbs(ViewportWidget w) static void SendReport(ViewportWidget w, unsigned int changed) { - XawPannerReport rep; - if (w->viewport.report_callbacks) { Widget child = w->viewport.child; Widget clip = w->viewport.clip; - - rep.changed = changed; - rep.slider_x = (Position) -XtX(child); /* child is canvas */ - rep.slider_y = (Position) -XtY(child); /* clip is slider */ - rep.slider_width = XtWidth(clip); - rep.slider_height = XtHeight(clip); - rep.canvas_width = XtWidth(child); - rep.canvas_height = XtHeight(child); + XawPannerReport rep = { + .changed = changed, + .slider_x = (Position) -XtX(child), /* child is canvas */ + .slider_y = (Position) -XtY(child), /* clip is slider */ + .slider_width = XtWidth(clip), + .slider_height = XtHeight(clip), + .canvas_width = XtWidth(child), + .canvas_height = XtHeight(child) + }; XtCallCallbackList((Widget)w, w->viewport.report_callbacks, (XtPointer)&rep); } |