| 151 | |
| 152 | |
| 153 | void |
| 154 | SimGraphEventProc(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 | |
| 192 | int GraphCmdconfigure(GRAPH_ARGS) |
nothing calls this directly
no test coverage detected