bch
/
xmem
1
0
Fork 0

Whitespace

This commit is contained in:
Christian Barthel 2022-01-08 08:28:08 +01:00
parent 2458539dc7
commit a6e2ded980
1 changed files with 27 additions and 27 deletions

View File

@ -1,7 +1,7 @@
/***********************************************************************
*
* MemStripChart Widget
* from StripChart Widget derived
* from StripChart Widget derived
*
* Author: Hans-Helmut B"uhmann 20. Jan. 1996
*
@ -165,10 +165,10 @@ CreateGC(MemStripChartWidget w, unsigned int which)
static void
DestroyGC(MemStripChartWidget w, unsigned int which)
{
if (which & FOREGROUND)
if (which & FOREGROUND)
XtReleaseGC((Widget) w, w->mem_strip_chart.fgGC);
if (which & HIGHLIGHT)
if (which & HIGHLIGHT)
XtReleaseGC((Widget) w, w->mem_strip_chart.hiGC);
if (which & CODE) {
@ -229,7 +229,7 @@ DrawMemStrip(MemStripChartWidget w, unsigned int x)
if (w->mem_strip_chart.valuedata[x].buffer != 0.0) {
top = (int) (w->core.height
- (int)(w->core.height * (1.0 - w->mem_strip_chart.valuedata[x].free))
- (int)(w->core.height * (1.0 - w->mem_strip_chart.valuedata[x].free))
/ w->mem_strip_chart.scale);
XFillRectangle(XtDisplay(w), XtWindow(w), w->mem_strip_chart.bufferGC,
x, top, (unsigned int) 1, bottom - top);
@ -246,7 +246,7 @@ DrawMemStrip(MemStripChartWidget w, unsigned int x)
}
if (w->mem_strip_chart.valuedata[x].swap != 0.0) {
top = (int) (w->core.height
- (int)(w->core.height * (1.0 + w->mem_strip_chart.valuedata[x].swap))
- (int)(w->core.height * (1.0 + w->mem_strip_chart.valuedata[x].swap))
/ w->mem_strip_chart.scale);
XFillRectangle(XtDisplay(w), XtWindow(w), w->mem_strip_chart.swapGC,
x, top, (unsigned int) 1, bottom - top);
@ -261,7 +261,7 @@ static void Initialize (Widget greq, Widget gnew, ArgList args, Cardinal *num_ar
if (w->mem_strip_chart.update > 0)
w->mem_strip_chart.interval_id = XtAppAddTimeOut(
XtWidgetToApplicationContext(gnew),
w->mem_strip_chart.update * MS_PER_SEC,
w->mem_strip_chart.update * MS_PER_SEC,
draw_it, (XtPointer) gnew);
CreateGC(w, (unsigned int) ALL_GCS);
@ -271,7 +271,7 @@ static void Initialize (Widget greq, Widget gnew, ArgList args, Cardinal *num_ar
w->mem_strip_chart.points = NULL;
SetPoints(w);
}
static void Destroy (Widget gw)
{
MemStripChartWidget w = (MemStripChartWidget)gw;
@ -284,7 +284,7 @@ static void Destroy (Widget gw)
}
/*
* NOTE: This function really needs to recieve graphics exposure
* NOTE: This function really needs to recieve graphics exposure
* events, but since this is not easily supported until R4 I am
* going to hold off until then.
*/
@ -301,13 +301,13 @@ static void Redisplay(Widget w, XEvent *event, Region region)
}
/* ARGSUSED */
static void
static void
draw_it(XtPointer client_data, XtIntervalId *id)
{
MemStripChartWidget w = (MemStripChartWidget)client_data;
MemStripChartCallbackData value;
double usedmem;
if (w->mem_strip_chart.update > 0)
w->mem_strip_chart.interval_id =
XtAppAddTimeOut(XtWidgetToApplicationContext( (Widget) w),
@ -323,15 +323,15 @@ draw_it(XtPointer client_data, XtIntervalId *id)
XtCallCallbacks( (Widget)w, XtNgetValue, (XtPointer)&value );
/*
* Keep w->mem_strip_chart.max_value up to date, and if this data
* point is off the graph, change the scale to make it fit.
/*
* Keep w->mem_strip_chart.max_value up to date, and if this data
* point is off the graph, change the scale to make it fit.
*/
usedmem = 1.0 + value.swap;
if (usedmem > w->mem_strip_chart.max_value) {
w->mem_strip_chart.max_value = usedmem;
if (XtIsRealized((Widget)w) &&
if (XtIsRealized((Widget)w) &&
w->mem_strip_chart.max_value > w->mem_strip_chart.scale) {
XClearWindow( XtDisplay (w), XtWindow (w));
w->mem_strip_chart.interval = repaint_window(w, 0, (int) w->core.width);
@ -343,7 +343,7 @@ draw_it(XtPointer client_data, XtIntervalId *id)
/* XXX DrawMemStrip(w, w->mem_strip_chart.interval, value); */
DrawMemStrip(w, w->mem_strip_chart.interval);
/*
* Fill in the graph lines we just painted over.
*/
@ -370,7 +370,7 @@ draw_it(XtPointer client_data, XtIntervalId *id)
* largest data point.
*/
static int
static int
repaint_window(MemStripChartWidget w, int left, int width)
{
int i, j;
@ -393,7 +393,7 @@ repaint_window(MemStripChartWidget w, int left, int width)
SetPoints(w);
if (XtIsRealized ((Widget) w))
if (XtIsRealized ((Widget) w))
XClearWindow (XtDisplay (w), XtWindow (w));
}
@ -445,20 +445,20 @@ MoveChart(MemStripChartWidget w, Boolean blit)
if (j < 0) j = 0;
}
(void) memmove((char *)(w->mem_strip_chart.valuedata),
(void) memmove((char *)(w->mem_strip_chart.valuedata),
(char *)(w->mem_strip_chart.valuedata + next - j),
j * sizeof(MemStripChartCallbackData));
next = w->mem_strip_chart.interval = j;
/*
* Since we just lost some data, recompute the
* w->mem_strip_chart.max_value.
* Since we just lost some data, recompute the
* w->mem_strip_chart.max_value.
*/
old_max = w->mem_strip_chart.max_value;
w->mem_strip_chart.max_value = 0.0;
for (i = 0; i < next; i++) {
if (w->mem_strip_chart.valuedata[i].swap + 1.0 > w->mem_strip_chart.max_value)
if (w->mem_strip_chart.valuedata[i].swap + 1.0 > w->mem_strip_chart.max_value)
w->mem_strip_chart.max_value = w->mem_strip_chart.valuedata[i].swap + 1.0;
}
@ -475,8 +475,8 @@ MoveChart(MemStripChartWidget w, Boolean blit)
(unsigned int) j, (unsigned int) w->core.height,
0, 0);
XClearArea(XtDisplay((Widget)w), XtWindow((Widget)w),
(int) j, 0,
XClearArea(XtDisplay((Widget)w), XtWindow((Widget)w),
(int) j, 0,
(unsigned int) w->core.width - j, (unsigned int)w->core.height,
FALSE);
@ -510,12 +510,12 @@ static Boolean SetValues (Widget current, Widget request, Widget new, ArgList ar
if ( w->mem_strip_chart.min_scale > (int) ((w->mem_strip_chart.max_value) + 1) )
ret_val = TRUE;
if ( w->mem_strip_chart.fgpixel != old->mem_strip_chart.fgpixel ) {
new_gc |= FOREGROUND;
ret_val = True;
}
if ( w->mem_strip_chart.hipixel != old->mem_strip_chart.hipixel ) {
new_gc |= HIGHLIGHT;
ret_val = True;