MCPcopy Create free account
hub / github.com/SimHacker/micropolis / SimGraphEventProc

Function SimGraphEventProc

micropolis-activity/src/sim/w_graph.c:153–189  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

151
152
153void
154SimGraphEventProc(ClientData clientData, XEvent *eventPtr)
155{
156 SimGraph *graph = (SimGraph *) clientData;
157
158 if ((eventPtr->type == Expose) && (eventPtr->xexpose.count == 0)) {
159 graph->visible = 1;
160 EventuallyRedrawGraph(graph);
161 } else if (eventPtr->type == MapNotify) {
162 graph->visible = 1;
163 } else if (eventPtr->type == UnmapNotify) {
164 graph->visible = 0;
165 } else if (eventPtr->type == VisibilityNotify) {
166 if (eventPtr->xvisibility.state == VisibilityFullyObscured)
167 graph->visible = 0;
168 else
169 graph->visible = 1;
170 } else if (eventPtr->type == ConfigureNotify) {
171 DoResizeGraph(graph,
172 eventPtr->xconfigure.width,
173 eventPtr->xconfigure.height);
174 EventuallyRedrawGraph(graph);
175 } else if (eventPtr->type == DestroyNotify) {
176 Tcl_DeleteCommand(graph->interp, Tk_PathName(graph->tkwin));
177 graph->tkwin = NULL;
178 if (graph->flags & VIEW_REDRAW_PENDING) {
179//fprintf(stderr, "SimGraphEventProc Destroy token %d\n", graph->draw_graph_token);
180 assert(graph->draw_graph_token != 0);
181 if (graph->draw_graph_token != 0) {
182 Tk_DeleteTimerHandler(graph->draw_graph_token);
183 graph->draw_graph_token = 0;
184 }
185 graph->flags &= ~VIEW_REDRAW_PENDING;
186 }
187 Tk_EventuallyFree((ClientData) graph, DestroySimGraph);
188 }
189}
190
191
192int GraphCmdconfigure(GRAPH_ARGS)

Callers

nothing calls this directly

Calls 3

Tk_EventuallyFreeFunction · 0.85
Tcl_DeleteCommandFunction · 0.50
Tk_DeleteTimerHandlerFunction · 0.50

Tested by

no test coverage detected