aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDimitri Sokolyuk <demon@dim13.org>2014-09-15 00:28:06 +0000
committerDimitri Sokolyuk <demon@dim13.org>2014-09-15 00:28:06 +0000
commitd5ac9a9b3a3ca48f92daea4ae7ae54a2a1c33297 (patch)
tree04d328cff040e00194f3fcfaa35c40d1f04e8f13
parentbe3b1b4e98b4c6341d40ecbde86c12adebdac6d2 (diff)
add experimental data pointer
-rw-r--r--Sgraph.c6
-rw-r--r--Sgraph.h2
-rw-r--r--SgraphP.h1
3 files changed, 9 insertions, 0 deletions
diff --git a/Sgraph.c b/Sgraph.c
index 3c26fef..04b1e4f 100644
--- a/Sgraph.c
+++ b/Sgraph.c
@@ -142,7 +142,10 @@ GetGC(Widget w)
static void
Initialize(Widget request, Widget w, ArgList args, Cardinal *nargs)
{
+ SgraphWidget sw = (SgraphWidget)w;
+ sw->sgraph.data = NULL;
+
warnx("Initialize");
GetGC(w);
}
@@ -209,6 +212,9 @@ Redisplay(Widget w, XEvent *event, Region r)
width + BORDER, BORDER,
width - 2 * BORDER, height - 2 * BORDER);
*/
+ if (sw->sgraph.data != NULL)
+ warnx("%d", *sw->sgraph.data);
+
XClearWindow(XtDisplay(sw), XtWindow(sw));
n = (n + 1) % width;
XCopyArea(XtDisplay(sw), sw->sgraph.bg, XtWindow(sw), sw->sgraph.foreGC,
diff --git a/Sgraph.h b/Sgraph.h
index 093971e..084713f 100644
--- a/Sgraph.h
+++ b/Sgraph.h
@@ -45,6 +45,8 @@
/* define any special resource names here that are not in <X11/StringDefs.h> */
#define XtNmirror "mirror"
+#define XtNdata "data"
+#define XtNdataSize "dataSize"
#define XtNsgraphResource "sgraphResource"
#define XtCSgraphResource "SgraphResource"
diff --git a/SgraphP.h b/SgraphP.h
index 4d75faa..b917fd1 100644
--- a/SgraphP.h
+++ b/SgraphP.h
@@ -41,6 +41,7 @@ typedef struct {
Pixel foreground;
Pixel background;
Boolean mirror;
+ XtPointer data;
GC foreGC;
GC backGC;