From 52c7b6e3cc5f3abd0928c2dfb6c9615c468ee0a0 Mon Sep 17 00:00:00 2001 From: Dimitri Sokolyuk Date: Fri, 26 Sep 2014 15:02:34 +0000 Subject: sipmlify afaik --- BarDisplay.c | 9 +-------- Graph.c | 19 +++++-------------- GraphDisplay.c | 5 +---- README | 8 ++++++++ 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 -- cgit v1.2.3