Commit 836da3a0 authored by Claes Sjofors's avatar Claes Sjofors

Ge dynamic DigCommand with in window object bugfix

parent 20a278ee
......@@ -113,6 +113,7 @@ static int graph_trace_disconnect_bc( grow_tObject object);
static int graph_trace_scan_bc( grow_tObject object, void *p);
static int graph_trace_connect_bc( grow_tObject object,
glow_sTraceData *trace_data);
static int graph_trace_ctrl_bc( int type, void *data);
static int graph_trace_grow_cb( GlowCtx *ctx, glow_tEvent event);
static int graph_get_subgraph_info_cb( void *g, char *name,
attr_sItem **itemlist, int *itemlist_cnt);
......@@ -3430,7 +3431,8 @@ int Graph::init_trace()
init_object_graph(0);
sts = grow_TraceInit( grow->ctx, graph_trace_connect_bc,
graph_trace_disconnect_bc, graph_trace_scan_bc);
graph_trace_disconnect_bc, graph_trace_scan_bc,
graph_trace_ctrl_bc);
// Look for object graph
if ( strcmp( object_name, "") != 0)
......@@ -3581,6 +3583,29 @@ static int graph_trace_disconnect_bc( grow_tObject object)
}
static int graph_trace_ctrl_bc( int type, void *data)
{
switch ( type) {
case glow_eTraceCtrl_CtxPop: {
Graph *graph;
grow_GetCtxUserData( (GrowCtx *)data, (void **) &graph);
graph->grow->pop((GrowCtx *)data);
break;
}
case glow_eTraceCtrl_CtxPush: {
Graph *graph;
grow_GetCtxUserData( (GrowCtx *)data, (void **) &graph);
graph->grow->push();
break;
}
default: ;
}
return 1;
}
static int graph_trace_scan_bc( grow_tObject object, void *p)
{
GeDyn *dyn;
......@@ -5205,7 +5230,7 @@ void Graph::swap( int mode)
// Swap done
if ( !trace_started) {
grow_TraceInit( grow->ctx, graph_trace_connect_bc,
graph_trace_disconnect_bc, graph_trace_scan_bc);
graph_trace_disconnect_bc, graph_trace_scan_bc, graph_trace_ctrl_bc);
trace_started = 1;
trace_scan( this);
}
......
......@@ -409,6 +409,7 @@ typedef enum {
glow_eHotIndication_LightColor //!< Lighter color for hot objects
} glow_eHotIndication;
//! Color index for a color
/*! The drawtype is index in an array that contains the gc for colors in the color palette.
The 300 first are the colors in the color palette, the seven last are used for erase, and texts. */
......@@ -1008,6 +1009,11 @@ typedef enum {
glow_eTraceType_User
} glow_eTraceType;
typedef enum {
glow_eTraceCtrl_CtxPop,
glow_eTraceCtrl_CtxPush
} glow_eTraceCtrl;
//! Type of item in a pulldown menu
typedef enum {
glow_eMenuItem_Button, //!< Item is a button
......
......@@ -1702,13 +1702,15 @@ void GlowCtx::remove_trace_objects()
int GlowCtx::trace_init( int (*connect_func)( void *, GlowTraceData *),
int (*disconnect_func)( void *),
int (*scan_func)( void *, void *))
int (*scan_func)( void *, void *),
int (*ctrl_func)( int, void *))
{
int sts;
trace_connect_func = connect_func;
trace_disconnect_func = disconnect_func;
trace_scan_func = scan_func;
trace_ctrl_func = ctrl_func;
sts = a.trace_init();
......
......@@ -691,6 +691,7 @@ class GlowCtx {
int (*trace_connect_func)( void *, GlowTraceData *); //!< Backcall function for trace connect of an object.
int (*trace_disconnect_func)( void *); //!< Backcall function for trace disconnect of an object.
int (*trace_scan_func)( void *, void *); //!< Backcall function for trace scan of an object.
int (*trace_ctrl_func)( int, void *); //!< Backcall function for trace control.
int trace_started; //!< Trace is started.
void remove_trace_objects();
......@@ -703,7 +704,8 @@ class GlowCtx {
*/
int trace_init( int (*connect_func)( void *, GlowTraceData *),
int (*disconnect_func)( void *),
int (*scan_func)( void *, void *));
int (*scan_func)( void *, void *),
int (*ctrl_func)( int, void *));
//! Trace close.
/*! Calls the disconnect backcall function for all connected objects. */
......
......@@ -627,10 +627,11 @@ void grow_SetTraceData( grow_tObject object, void *trace_data)
extern "C" int grow_TraceInit( grow_tCtx ctx,
int (*trace_connect_func)( grow_tObject, GlowTraceData *),
int (*trace_disconnect_func)( grow_tObject),
int (*trace_scan_func)( grow_tObject, void *))
int (*trace_scan_func)( grow_tObject, void *),
int (*trace_ctrl_func)( int, void *))
{
return ctx->trace_init( trace_connect_func, trace_disconnect_func,
trace_scan_func);
trace_scan_func, trace_ctrl_func);
}
void grow_TraceClose( grow_tCtx ctx)
......
......@@ -660,7 +660,8 @@ extern "C" {
int grow_TraceInit( grow_tCtx ctx,
int (*trace_connect_func)( grow_tObject, GlowTraceData *),
int (*trace_disconnect_func)( grow_tObject),
int (*trace_scan_func)( grow_tObject, void *));
int (*trace_scan_func)( grow_tObject, void *),
int (*trace_ctrl_func)( int, void *));
//! Close trace.
/*! \param ctx Grow context. */
......
......@@ -399,8 +399,14 @@ void GrowWindow::trace_scan()
// window_ctx->draw_buffer_only = ctx->draw_buffer_only;
ctx->gdraw->set_clip_rectangle( &ctx->mw, ll_x, ll_y, ur_x, ur_y);
if ( ctx->trace_ctrl_func)
(ctx->trace_ctrl_func) ( glow_eTraceCtrl_CtxPop, window_ctx);
window_ctx->trace_scan();
if ( ctx->trace_ctrl_func)
(ctx->trace_ctrl_func) ( glow_eTraceCtrl_CtxPush, window_ctx);
ctx->gdraw->reset_clip_rectangle( &ctx->mw);
}
}
......@@ -437,7 +443,8 @@ int GrowWindow::trace_init()
window_ctx->event_move_node = ctx->event_move_node;
window_ctx->trace_init( ctx->trace_connect_func,
ctx->trace_disconnect_func,
ctx->trace_scan_func);
ctx->trace_scan_func,
ctx->trace_ctrl_func);
}
return sts;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment