From 4ffec70f50b1019dfb312b5d6f5c6324b203a8cb Mon Sep 17 00:00:00 2001 From: Dimitri Sokolyuk Date: Tue, 30 Sep 2014 20:41:38 +0000 Subject: rename XtNdata to XtNvalues to minimize the confusion --- Display.c | 3 ++- Sgraph.c | 9 ++++----- Sgraph.h | 9 +++------ SgraphP.h | 7 ++----- 4 files changed, 11 insertions(+), 17 deletions(-) diff --git a/Display.c b/Display.c index e80c939..7881b66 100644 --- a/Display.c +++ b/Display.c @@ -4,6 +4,7 @@ #include #include #include "DisplayP.h" +#include "SgraphP.h" #define Trace(w) do { \ warnx("%s.%s", XtClass(w)->core_class.class_name, __func__); \ @@ -116,7 +117,7 @@ ChangeManaged(Widget w) for (i = 0; i < dw->composite.num_children; i++) { child = dw->composite.children[i]; if (XtIsManaged(child)) { - XtSetArg(arg, XtNdata, &dw->display.data[i]); + XtSetArg(arg, XtNvalues, &dw->display.data[i]); XtGetValues(child, &arg, 1); XtMoveWidget(child, width, 0); diff --git a/Sgraph.c b/Sgraph.c index 0f8b686..eec068d 100644 --- a/Sgraph.c +++ b/Sgraph.c @@ -18,7 +18,6 @@ #include #include -#include #include "SgraphP.h" #include @@ -42,8 +41,8 @@ static XtResource resources[] = { Offset(foreground), XtRString, XtDefaultForeground }, { XtNmirror, XtCBoolean, XtRBoolean, sizeof(Boolean), Offset(mirror), XtRBoolean, False }, - { XtNdata, XtCData, XtRPointer, sizeof(int *), - Offset(data), XtRPointer, NULL }, + { XtNvalues, XtCValues, XtRPointer, sizeof(int *), + Offset(values), XtRPointer, NULL }, { XtNsize, XtCsize, XtRInt, sizeof(int), Offset(size), XtRImmediate, (XtPointer)0 }, { XtNsamples, XtCsamples, XtRInt, sizeof(int), @@ -145,7 +144,7 @@ Initialize(Widget request, Widget w, ArgList args, Cardinal *nargs) sw->core.width = 320; sw->core.height = 120; sw->sgraph.size = 2 * sw->core.width; - sw->sgraph.data = (int *)XtCalloc(sw->sgraph.samples, sizeof(int)); + sw->sgraph.values = (int *)XtCalloc(sw->sgraph.samples, sizeof(int)); GetGC(w); } @@ -208,7 +207,7 @@ Redisplay(Widget w, XEvent *event, Region r) visible = sw->sgraph.size / 2; for (i = 0; i < visible - 1; i++) { - y = sw->sgraph.data[i]; + y = sw->sgraph.values[i]; if (sw->sgraph.mirror) x = sw->core.width - i; else diff --git a/Sgraph.h b/Sgraph.h index e527e61..1f17369 100644 --- a/Sgraph.h +++ b/Sgraph.h @@ -47,8 +47,8 @@ /* define any special resource names here that are not in */ #define XtNmirror "mirror" -#define XtNdata "data" -#define XtCData "Data" +#define XtNvalues "values" +#define XtCValues "Values" #define XtNsamples "samples" #define XtCsamples "Samples" @@ -56,10 +56,7 @@ #define XtNsize "size" #define XtCsize "Size" -#define XtNdataCallback "dataCallback" -#define XtNfftCallback "fftCallback" - -/* declare specific SgraphWidget class and instance datatypes */ +/* declare specific SgraphWidget class and instance valuestypes */ typedef struct _SgraphClassRec *SgraphWidgetClass; typedef struct _SgraphRec *SgraphWidget; diff --git a/SgraphP.h b/SgraphP.h index 2060b48..877a51c 100644 --- a/SgraphP.h +++ b/SgraphP.h @@ -18,18 +18,15 @@ #ifndef _SgraphP_h #define _SgraphP_h +#include #include "Sgraph.h" typedef struct { Pixel foreground; Boolean mirror; - int *data; + int *values; size_t size; size_t samples; - /* - XtCallbackProc data; - XtCallbackProc fft; - */ XdbeBackBuffer backBuf; GC foreGC; -- cgit v1.2.3