aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDimitri Sokolyuk <demon@dim13.org>2014-09-26 15:02:34 +0000
committerDimitri Sokolyuk <demon@dim13.org>2014-09-26 15:02:34 +0000
commit52c7b6e3cc5f3abd0928c2dfb6c9615c468ee0a0 (patch)
treec2343b107aad7100a966453e35219ed543ccc90d
parent84a554f9511fe86728d62b93e609491b77ccda08 (diff)
sipmlify afaik
-rw-r--r--BarDisplay.c9
-rw-r--r--Graph.c19
-rw-r--r--GraphDisplay.c5
-rw-r--r--README8
4 files changed, 15 insertions, 26 deletions
diff --git a/BarDisplay.c b/BarDisplay.c
index a54b885..f22b373 100644
--- a/BarDisplay.c
+++ b/BarDisplay.c
@@ -79,15 +79,8 @@ SetValues(Widget old,
BarDisplayObject newbd = (BarDisplayObject) new;
#define NE(field) (oldbd->barDisplay.field != newbd->barDisplay.field)
-
- if (NE(space) || NE(format)) {
- if (XtIsRealized(XtParent((Widget)newbd)))
- XClearArea(XtDisplayOfObject(new),
- XtWindowOfObject(new), 0, 0, 0, 0, True);
+ return XtIsRealized(XtParent(new)) && (NE(space) || NE(format));
#undef NE
- }
-
- return False;
}
static void
diff --git a/Graph.c b/Graph.c
index 83be919..6a27016 100644
--- a/Graph.c
+++ b/Graph.c
@@ -24,7 +24,6 @@ static void ClassInitialize();
static void Initialize();
static void Redisplay();
static void Destroy();
-static void Resize();
static void Realize();
static void InsertChild();
static Boolean SetValues();
@@ -59,7 +58,7 @@ GraphClassRec graphClassRec = {
.compress_enterleave = True,
.visible_interest = False,
.destroy = Destroy,
- .resize = Resize,
+ .resize = NULL,
.expose = Redisplay,
.set_values = SetValues,
.set_values_hook = NULL,
@@ -229,7 +228,9 @@ InsertChild(Widget w)
{
String params[2];
Cardinal num_params;
- CompositeWidget parent = (CompositeWidget) XtParent(w);
+ CompositeWidget parent = (CompositeWidget)XtParent(w);
+ CompositeWidgetClass superClass = (CompositeWidgetClass)
+ graphWidgetClass->core_class.superclass;
GraphDisplayObjectClass childClass;
if (!XtIsSubclass(w, graphDisplayObjectClass)) {
@@ -251,8 +252,7 @@ InsertChild(Widget w)
params, &num_params);
}
- (*((CompositeWidgetClass)(graphWidgetClass->
- core_class.superclass))->composite_class.insert_child)(w);
+ superClass->composite_class.insert_child(w);
childClass = (GraphDisplayObjectClass)XtClass(w);
if (childClass->graphDisplay_class.compute_size != NULL)
@@ -294,12 +294,3 @@ Redisplay(Widget w,
if (childClass->graphDisplay_class.expose != NULL)
(*childClass->graphDisplay_class.expose)(w, event, region);
}
-
-static void
-Resize(Widget w)
-{
- if (XtIsRealized(w)) {
- XClearWindow(XtDisplay(w), XtWindow(w));
- (*(XtClass(w)->core_class.expose))(w, NULL, NULL);
- }
-}
diff --git a/GraphDisplay.c b/GraphDisplay.c
index c6a953f..7b7ed5c 100644
--- a/GraphDisplay.c
+++ b/GraphDisplay.c
@@ -102,10 +102,7 @@ SetValues(Widget old,
}
#undef NE
- if (XtIsRealized(XtParent((Widget)newgd)))
- XClearArea(XtDisplayOfObject(new),
- XtWindowOfObject(new), 0, 0, 0, 0, True);
- return False;
+ return XtIsRealized(XtParent(new));
}
static void
diff --git a/README b/README
index 6edb691..11c26ff 100644
--- a/README
+++ b/README
@@ -1,3 +1,11 @@
# $Id$
DemoMonitor example from `X Window System Toolkit: the complete programmers's
guide and specification' by Paul J. Asente and Ralph R. Swick
+
+Class Relations:
+
+ Class SuperClass
+ ----- ----------
+ Graph Composite
+ GraphDisplay Object
+ BarDisplay GraphDisplay