void XAttNav::swap( int mode) { if ( mode == 0) { if ( trace_started) { brow_TraceClose( brow->ctx); trace_timerid->remove(); } } else if ( mode == 1) { if ( trace_started) { brow_TraceInit( brow->ctx, trace_connect_bc, trace_disconnect_bc, trace_scan_bc); trace_scan( this); } } }
// // Backcall routine called at creation of the brow widget // Enable event, create nodeclasses and insert the root objects. // int XAttNav::init_brow_cb( FlowCtx *fctx, void *client_data) { int sts; XAttNav *xattnav = (XAttNav *) client_data; BrowCtx *ctx = (BrowCtx *)fctx; xattnav->brow = new XNavBrow( ctx, (void *)xattnav, brow_eUserType_XAttNav); xattnav->brow->brow_setup(); xattnav->brow->create_nodeclasses(); xattnav->enable_events(); // Create the items if ( xattnav->init_cb) (xattnav->init_cb) ( xattnav->parent_ctx); sts = brow_TraceInit( ctx, trace_connect_bc, trace_disconnect_bc, trace_scan_bc); xattnav->trace_started = 1; trace_scan( xattnav); return 1; }
void WGreMotif::trace_start() { trace_started = 1; trace_scan( this); }
void GrowWindow::new_ctx() { char fname[200]; int sts; int no_file = strcmp( file_name, "_no_") == 0 ? 1 : 0; // No initial graph if ( strchr( file_name, '/') == 0) { strcpy( fname, "$pwrp_exe/"); strcat( fname, file_name); } else strcpy( fname, file_name); if ( !strchr( fname, '.')) strcat( fname, ".pwg"); dcli_translate_filename( fname, fname); window_ctx = new GrowCtx( "WindowComponent", ctx->mw.zoom_factor_x * window_scale); window_ctx->gdraw = ctx->gdraw; window_ctx->mw.window = ctx->mw.window; window_ctx->navw.window = ctx->navw.window; window_ctx->userdata_save_callback = ctx->userdata_save_callback; window_ctx->userdata_open_callback = ctx->userdata_open_callback; window_ctx->userdata_copy_callback = ctx->userdata_copy_callback; // window_ctx->double_buffer_on = ctx->double_buffer_on; window_ctx->user_data = ctx->user_data; window_ctx->hot_mode = ctx->hot_mode; window_ctx->default_hot_mode = ctx->default_hot_mode; window_ctx->is_component = 1; memcpy( window_ctx->event_callback, ctx->event_callback, sizeof( ctx->event_callback)); window_ctx->event_move_node = ctx->event_move_node; window_ctx->background_disabled = 1; strcpy( window_ctx->owner, owner); if ( !no_file) { sts = window_ctx->open( fname, glow_eSaveMode_Edit); if ( EVEN(sts)) printf( "** Unable to open graph %s\n", fname); } strcpy( input_file_name, file_name); if ( window_ctx->background_color != glow_eDrawType_Inherit) { fill_drawtype = original_fill_drawtype = window_ctx->background_color; fill = 1; } if ( window_ctx->x0 != window_ctx->x1 && window_ctx->y0 != window_ctx->y1) { wctx_x0 = window_ctx->x0; wctx_x1 = window_ctx->x1; wctx_y0 = window_ctx->y0; wctx_y1 = window_ctx->y1; } else { wctx_x0 = window_ctx->x_left; wctx_x1 = window_ctx->x_right; wctx_y0 = window_ctx->y_low; wctx_y1 = window_ctx->y_high; } window_ctx->mw.window_width = int((x_right - x_left) * ctx->mw.zoom_factor_x); window_ctx->mw.window_height = int((y_high - y_low) * ctx->mw.zoom_factor_y); window_ctx->mw.subwindow_x = int(x_left * ctx->mw.zoom_factor_x - ctx->mw.offset_x); window_ctx->mw.subwindow_y = int(y_low * ctx->mw.zoom_factor_y - ctx->mw.offset_y); window_ctx->mw.subwindow_scale = ctx->mw.subwindow_scale * window_scale; window_ctx->mw.zoom_factor_x = window_ctx->mw.zoom_factor_y = ctx->mw.zoom_factor_x * window_ctx->mw.subwindow_scale; window_ctx->move_restriction = glow_eMoveRestriction_Disable; window_ctx->a.zoom(); if ( ctx->trace_started) { trace_init(); trace_scan(); } if ( input_focus) window_ctx->inputfocus_init_event(); }