Commit 3b3dee69 authored by Claes Sjofors's avatar Claes Sjofors

Plc trace, objects with old subscriptions dimmed

parent 78367e33
...@@ -992,15 +992,19 @@ void FlowDrawGtk::enable_event( FlowCtx *ctx, flow_eEvent event, ...@@ -992,15 +992,19 @@ void FlowDrawGtk::enable_event( FlowCtx *ctx, flow_eEvent event,
} }
int FlowDrawGtk::rect( FlowCtx *ctx, int x, int y, int width, int height, int FlowDrawGtk::rect( FlowCtx *ctx, int x, int y, int width, int height,
flow_eDrawType gc_type, int idx, int highlight) flow_eDrawType gc_type, int idx, int highlight, int dimmed)
{ {
if ( ctx->nodraw) return 1; if ( ctx->nodraw) return 1;
if ( gc_type == flow_eDrawType_LineGray && highlight) if ( dimmed)
gc_type = flow_eDrawType_LineGray;
else if ( gc_type == flow_eDrawType_LineGray && highlight)
gc_type = flow_eDrawType_Line; gc_type = flow_eDrawType_Line;
else if ( highlight)
gc_type = flow_eDrawType(gc_type + 1);
gdk_draw_rectangle( window, gdk_draw_rectangle( window,
gcs[gc_type+highlight][idx], 0, gcs[gc_type][idx], 0,
x, y, width, height); x, y, width, height);
return 1; return 1;
} }
...@@ -1099,15 +1103,19 @@ int FlowDrawGtk::nav_arrow_erase( FlowCtx *ctx, int x1, int y1, int x2, int y2, ...@@ -1099,15 +1103,19 @@ int FlowDrawGtk::nav_arrow_erase( FlowCtx *ctx, int x1, int y1, int x2, int y2,
int FlowDrawGtk::arc( FlowCtx *ctx, int x, int y, int width, int height, int FlowDrawGtk::arc( FlowCtx *ctx, int x, int y, int width, int height,
int angle1, int angle2, int angle1, int angle2,
flow_eDrawType gc_type, int idx, int highlight) flow_eDrawType gc_type, int idx, int highlight, int dimmed)
{ {
if ( ctx->nodraw) return 1; if ( ctx->nodraw) return 1;
if ( gc_type == flow_eDrawType_LineGray && highlight) if ( dimmed)
gc_type = flow_eDrawType_LineGray;
else if ( gc_type == flow_eDrawType_LineGray && highlight)
gc_type = flow_eDrawType_Line; gc_type = flow_eDrawType_Line;
else if ( highlight)
gc_type = flow_eDrawType(gc_type + 1);
gdk_draw_arc( window, gdk_draw_arc( window,
gcs[gc_type+highlight][idx], 0, gcs[gc_type][idx], 0,
x, y, width, height, angle1*64, angle2*64); x, y, width, height, angle1*64, angle2*64);
return 1; return 1;
} }
...@@ -1152,15 +1160,19 @@ int FlowDrawGtk::nav_arc_erase( FlowCtx *ctx, int x, int y, int width, int heigh ...@@ -1152,15 +1160,19 @@ int FlowDrawGtk::nav_arc_erase( FlowCtx *ctx, int x, int y, int width, int heigh
} }
int FlowDrawGtk::line( FlowCtx *ctx, int x1, int y1, int x2, int y2, int FlowDrawGtk::line( FlowCtx *ctx, int x1, int y1, int x2, int y2,
flow_eDrawType gc_type, int idx, int highlight) flow_eDrawType gc_type, int idx, int highlight, int dimmed)
{ {
if ( ctx->nodraw) return 1; if ( ctx->nodraw) return 1;
if ( gc_type == flow_eDrawType_LineGray && highlight) if ( dimmed)
gc_type = flow_eDrawType_LineGray;
else if ( gc_type == flow_eDrawType_LineGray && highlight)
gc_type = flow_eDrawType_Line; gc_type = flow_eDrawType_Line;
else if ( highlight)
gc_type = flow_eDrawType(gc_type + 1);
gdk_draw_line( window, gdk_draw_line( window,
gcs[gc_type+highlight][idx], gcs[gc_type][idx],
x1, y1, x2, y2); x1, y1, x2, y2);
return 1; return 1;
} }
...@@ -1222,12 +1234,21 @@ static char *font_string( flow_eDrawType gc_type, double size) ...@@ -1222,12 +1234,21 @@ static char *font_string( flow_eDrawType gc_type, double size)
} }
int FlowDrawGtk::text_pango( FlowCtx *ctx, int x, int y, char *text, int len, int FlowDrawGtk::text_pango( FlowCtx *ctx, int x, int y, char *text, int len,
flow_eDrawType gc_type, int idx, int highlight, int line, double size) flow_eDrawType gc_type, int idx, int highlight, int dimmed, int line, double size)
{ {
if ( ctx->nodraw) return 1; if ( ctx->nodraw) return 1;
PangoRenderer *pr = gdk_pango_renderer_get_default( screen); PangoRenderer *pr = gdk_pango_renderer_get_default( screen);
gdk_pango_renderer_set_drawable( GDK_PANGO_RENDERER(pr), window); gdk_pango_renderer_set_drawable( GDK_PANGO_RENDERER(pr), window);
if ( dimmed) {
GdkGCValues xgcv;
gdk_gc_get_values( gcs[flow_eDrawType_LineGray][0], &xgcv);
gdk_gc_set_values( gcs[gc_type][0], &xgcv, GDK_GC_FOREGROUND);
}
gdk_pango_renderer_set_gc( GDK_PANGO_RENDERER(pr), gcs[gc_type][0]); gdk_pango_renderer_set_gc( GDK_PANGO_RENDERER(pr), gcs[gc_type][0]);
PangoContext *pctx = gdk_pango_context_get_for_screen( screen); PangoContext *pctx = gdk_pango_context_get_for_screen( screen);
...@@ -1259,6 +1280,13 @@ int FlowDrawGtk::text_pango( FlowCtx *ctx, int x, int y, char *text, int len, ...@@ -1259,6 +1280,13 @@ int FlowDrawGtk::text_pango( FlowCtx *ctx, int x, int y, char *text, int len,
pango_font_description_free( desc); pango_font_description_free( desc);
g_object_unref( pctx); g_object_unref( pctx);
if ( dimmed) {
GdkGCValues xgcv;
gdk_gc_get_values( gcs[flow_eDrawType_Line][0], &xgcv);
gdk_gc_set_values( gcs[gc_type][0], &xgcv, GDK_GC_FOREGROUND);
}
return 1; return 1;
} }
...@@ -1348,12 +1376,12 @@ int FlowDrawGtk::text_erase_pango( FlowCtx *ctx, int x, int y, char *text, int l ...@@ -1348,12 +1376,12 @@ int FlowDrawGtk::text_erase_pango( FlowCtx *ctx, int x, int y, char *text, int l
} }
int FlowDrawGtk::text( FlowCtx *ctx, int x, int y, char *text, int len, int FlowDrawGtk::text( FlowCtx *ctx, int x, int y, char *text, int len,
flow_eDrawType gc_type, int idx, int highlight, int line, double size) flow_eDrawType gc_type, int idx, int highlight, int dimmed, int line, double size)
{ {
if ( ctx->nodraw) return 1; if ( ctx->nodraw) return 1;
if ( pango) if ( pango)
return text_pango( ctx, x, y, text, len, gc_type, idx, highlight, line, size); return text_pango( ctx, x, y, text, len, gc_type, idx, highlight, dimmed, line, size);
int font_idx = get_font_idx( gc_type); int font_idx = get_font_idx( gc_type);
......
...@@ -88,7 +88,7 @@ class FlowDrawGtk : public FlowDraw { ...@@ -88,7 +88,7 @@ class FlowDrawGtk : public FlowDraw {
void set_nav_window_size( FlowCtx *ctx, int width, int height); void set_nav_window_size( FlowCtx *ctx, int width, int height);
int rect( FlowCtx *ctx, int x, int y, int width, int height, int rect( FlowCtx *ctx, int x, int y, int width, int height,
flow_eDrawType gc_type, int idx, int highlight); flow_eDrawType gc_type, int idx, int highlight, int dimmed);
int rect_erase( FlowCtx *ctx, int x, int y, int width, int height, int rect_erase( FlowCtx *ctx, int x, int y, int width, int height,
int idx); int idx);
int nav_rect( FlowCtx *ctx, int x, int y, int width, int height, int nav_rect( FlowCtx *ctx, int x, int y, int width, int height,
...@@ -109,7 +109,7 @@ class FlowDrawGtk : public FlowDraw { ...@@ -109,7 +109,7 @@ class FlowDrawGtk : public FlowDraw {
int idx); int idx);
int arc( FlowCtx *ctx, int x, int y, int width, int height, int arc( FlowCtx *ctx, int x, int y, int width, int height,
int angle1, int angle2, int angle1, int angle2,
flow_eDrawType gc_type, int idx, int highlight); flow_eDrawType gc_type, int idx, int highlight, int dimmed);
int arc_erase( FlowCtx *ctx, int x, int y, int width, int height, int arc_erase( FlowCtx *ctx, int x, int y, int width, int height,
int angle1, int angle2, int angle1, int angle2,
int idx); int idx);
...@@ -120,7 +120,7 @@ class FlowDrawGtk : public FlowDraw { ...@@ -120,7 +120,7 @@ class FlowDrawGtk : public FlowDraw {
int angle1, int angle2, int angle1, int angle2,
int idx); int idx);
int line( FlowCtx *ctx, int x1, int y1, int x2, int y2, int line( FlowCtx *ctx, int x1, int y1, int x2, int y2,
flow_eDrawType gc_type, int idx, int highlight); flow_eDrawType gc_type, int idx, int highlight, int dimmed);
int line_erase( FlowCtx *ctx, int x1, int y1, int x2, int y2, int line_erase( FlowCtx *ctx, int x1, int y1, int x2, int y2,
int idx); int idx);
int nav_line( FlowCtx *ctx, int x1, int y1, int x2, int y2, int nav_line( FlowCtx *ctx, int x1, int y1, int x2, int y2,
...@@ -128,7 +128,7 @@ class FlowDrawGtk : public FlowDraw { ...@@ -128,7 +128,7 @@ class FlowDrawGtk : public FlowDraw {
int nav_line_erase( FlowCtx *ctx, int x1, int y1, int x2, int y2, int nav_line_erase( FlowCtx *ctx, int x1, int y1, int x2, int y2,
int idx); int idx);
int text( FlowCtx *ctx, int x, int y, char *text, int len, int text( FlowCtx *ctx, int x, int y, char *text, int len,
flow_eDrawType gc_type, int idx, int highlight, int line, double size); flow_eDrawType gc_type, int idx, int highlight, int dimmed, int line, double size);
int text_inverse( FlowCtx *ctx, int x, int y, char *text, int len, int text_inverse( FlowCtx *ctx, int x, int y, char *text, int len,
flow_eDrawType gc_type, int idx, int line, double size); flow_eDrawType gc_type, int idx, int line, double size);
int text_erase( FlowCtx *ctx, int x, int y, char *text, int len, int text_erase( FlowCtx *ctx, int x, int y, char *text, int len,
...@@ -198,7 +198,7 @@ class FlowDrawGtk : public FlowDraw { ...@@ -198,7 +198,7 @@ class FlowDrawGtk : public FlowDraw {
flow_tPixmap *im_pixmap, flow_tPixmap *im_mask, flow_tPixmap *im_pixmap, flow_tPixmap *im_mask,
flow_tPixmap *im_nav_pixmap, flow_tPixmap *im_nav_mask); flow_tPixmap *im_nav_pixmap, flow_tPixmap *im_nav_mask);
int text_pango( FlowCtx *ctx, int x, int y, char *text, int len, int text_pango( FlowCtx *ctx, int x, int y, char *text, int len,
flow_eDrawType gc_type, int idx, int highlight, int line, double size); flow_eDrawType gc_type, int idx, int highlight, int dimmed, int line, double size);
int text_inverse_pango( FlowCtx *ctx, int x, int y, char *text, int len, int text_inverse_pango( FlowCtx *ctx, int x, int y, char *text, int len,
flow_eDrawType gc_type, int idx, int line, double size); flow_eDrawType gc_type, int idx, int line, double size);
int text_erase_pango( FlowCtx *ctx, int x, int y, char *text, int len, int text_erase_pango( FlowCtx *ctx, int x, int y, char *text, int len,
......
...@@ -936,15 +936,19 @@ void FlowDrawXLib::enable_event( FlowCtx *ctx, flow_eEvent event, ...@@ -936,15 +936,19 @@ void FlowDrawXLib::enable_event( FlowCtx *ctx, flow_eEvent event,
} }
int FlowDrawXLib::rect( FlowCtx *ctx, int x, int y, int width, int height, int FlowDrawXLib::rect( FlowCtx *ctx, int x, int y, int width, int height,
flow_eDrawType gc_type, int idx, int highlight) flow_eDrawType gc_type, int idx, int highlight, int dimmed)
{ {
if ( ctx->nodraw) return 1; if ( ctx->nodraw) return 1;
if ( gc_type == flow_eDrawType_LineGray && highlight) if ( dimmed)
gc_type = flow_eDrawType_LineGray;
else if ( gc_type == flow_eDrawType_LineGray && highlight)
gc_type = flow_eDrawType_Line; gc_type = flow_eDrawType_Line;
else if ( highlight)
gc_type++;
XDrawRectangle( display, window, XDrawRectangle( display, window,
gcs[gc_type+highlight][idx], gcs[gc_type][idx],
x, y, width, height); x, y, width, height);
return 1; return 1;
} }
...@@ -1043,15 +1047,19 @@ int FlowDrawXLib::nav_arrow_erase( FlowCtx *ctx, int x1, int y1, int x2, int y2, ...@@ -1043,15 +1047,19 @@ int FlowDrawXLib::nav_arrow_erase( FlowCtx *ctx, int x1, int y1, int x2, int y2,
int FlowDrawXLib::arc( FlowCtx *ctx, int x, int y, int width, int height, int FlowDrawXLib::arc( FlowCtx *ctx, int x, int y, int width, int height,
int angle1, int angle2, int angle1, int angle2,
flow_eDrawType gc_type, int idx, int highlight) flow_eDrawType gc_type, int idx, int highlight, int dimmed)
{ {
if ( ctx->nodraw) return 1; if ( ctx->nodraw) return 1;
if ( gc_type == flow_eDrawType_LineGray && highlight) if ( dimmed)
gc_type = flow_eDrawType_LineGray;
else if ( gc_type == flow_eDrawType_LineGray && highlight)
gc_type = flow_eDrawType_Line; gc_type = flow_eDrawType_Line;
else if ( highlight)
gc_type++;
XDrawArc( display, window, XDrawArc( display, window,
gcs[gc_type+highlight][idx], gcs[gc_type][idx],
x, y, width, height, angle1*64, angle2*64); x, y, width, height, angle1*64, angle2*64);
return 1; return 1;
} }
...@@ -1096,15 +1104,19 @@ int FlowDrawXLib::nav_arc_erase( FlowCtx *ctx, int x, int y, int width, int heig ...@@ -1096,15 +1104,19 @@ int FlowDrawXLib::nav_arc_erase( FlowCtx *ctx, int x, int y, int width, int heig
} }
int FlowDrawXLib::line( FlowCtx *ctx, int x1, int y1, int x2, int y2, int FlowDrawXLib::line( FlowCtx *ctx, int x1, int y1, int x2, int y2,
flow_eDrawType gc_type, int idx, int highlight) flow_eDrawType gc_type, int idx, int highlight, int dimmed)
{ {
if ( ctx->nodraw) return 1; if ( ctx->nodraw) return 1;
if ( gc_type == flow_eDrawType_LineGray && highlight) if ( dimmed)
gc_type = flow_eDrawType_LineGray;
else if ( gc_type == flow_eDrawType_LineGray && highlight)
gc_type = flow_eDrawType_Line; gc_type = flow_eDrawType_Line;
else if ( highlight)
gc_type++;
XDrawLine( display, window, XDrawLine( display, window,
gcs[gc_type+highlight][idx], gcs[gc_type][idx],
x1, y1, x2, y2); x1, y1, x2, y2);
return 1; return 1;
} }
...@@ -1146,7 +1158,7 @@ int FlowDrawXLib::nav_line_erase( FlowCtx *ctx, int x1, int y1, int x2, int y2, ...@@ -1146,7 +1158,7 @@ int FlowDrawXLib::nav_line_erase( FlowCtx *ctx, int x1, int y1, int x2, int y2,
} }
int FlowDrawXLib::text( FlowCtx *ctx, int x, int y, char *text, int len, int FlowDrawXLib::text( FlowCtx *ctx, int x, int y, char *text, int len,
flow_eDrawType gc_type, int idx, int highlight, int line, double size) flow_eDrawType gc_type, int idx, int highlight, int dimmed, int line, double size)
{ {
if ( ctx->nodraw) return 1; if ( ctx->nodraw) return 1;
......
...@@ -111,7 +111,7 @@ class FlowDrawXLib : public FlowDraw { ...@@ -111,7 +111,7 @@ class FlowDrawXLib : public FlowDraw {
void set_nav_window_size( FlowCtx *ctx, int width, int height); void set_nav_window_size( FlowCtx *ctx, int width, int height);
int rect( FlowCtx *ctx, int x, int y, int width, int height, int rect( FlowCtx *ctx, int x, int y, int width, int height,
flow_eDrawType gc_type, int idx, int highlight); flow_eDrawType gc_type, int idx, int highlight, int dimmed);
int rect_erase( FlowCtx *ctx, int x, int y, int width, int height, int rect_erase( FlowCtx *ctx, int x, int y, int width, int height,
int idx); int idx);
int nav_rect( FlowCtx *ctx, int x, int y, int width, int height, int nav_rect( FlowCtx *ctx, int x, int y, int width, int height,
...@@ -132,7 +132,7 @@ class FlowDrawXLib : public FlowDraw { ...@@ -132,7 +132,7 @@ class FlowDrawXLib : public FlowDraw {
int idx); int idx);
int arc( FlowCtx *ctx, int x, int y, int width, int height, int arc( FlowCtx *ctx, int x, int y, int width, int height,
int angle1, int angle2, int angle1, int angle2,
flow_eDrawType gc_type, int idx, int highlight); flow_eDrawType gc_type, int idx, int highlight, int dimmed);
int arc_erase( FlowCtx *ctx, int x, int y, int width, int height, int arc_erase( FlowCtx *ctx, int x, int y, int width, int height,
int angle1, int angle2, int angle1, int angle2,
int idx); int idx);
...@@ -143,7 +143,7 @@ class FlowDrawXLib : public FlowDraw { ...@@ -143,7 +143,7 @@ class FlowDrawXLib : public FlowDraw {
int angle1, int angle2, int angle1, int angle2,
int idx); int idx);
int line( FlowCtx *ctx, int x1, int y1, int x2, int y2, int line( FlowCtx *ctx, int x1, int y1, int x2, int y2,
flow_eDrawType gc_type, int idx, int highlight); flow_eDrawType gc_type, int idx, int highlight, int dimmed);
int line_erase( FlowCtx *ctx, int x1, int y1, int x2, int y2, int line_erase( FlowCtx *ctx, int x1, int y1, int x2, int y2,
int idx); int idx);
int nav_line( FlowCtx *ctx, int x1, int y1, int x2, int y2, int nav_line( FlowCtx *ctx, int x1, int y1, int x2, int y2,
...@@ -151,7 +151,7 @@ class FlowDrawXLib : public FlowDraw { ...@@ -151,7 +151,7 @@ class FlowDrawXLib : public FlowDraw {
int nav_line_erase( FlowCtx *ctx, int x1, int y1, int x2, int y2, int nav_line_erase( FlowCtx *ctx, int x1, int y1, int x2, int y2,
int idx); int idx);
int text( FlowCtx *ctx, int x, int y, char *text, int len, int text( FlowCtx *ctx, int x, int y, char *text, int len,
flow_eDrawType gc_type, int idx, int highlight, int line, double size); flow_eDrawType gc_type, int idx, int highlight, int dimmed, int line, double size);
int text_erase( FlowCtx *ctx, int x, int y, char *text, int len, int text_erase( FlowCtx *ctx, int x, int y, char *text, int len,
flow_eDrawType gc_type, int idx, int line, double size); flow_eDrawType gc_type, int idx, int line, double size);
int text_inverse( FlowCtx *ctx, int x, int y, char *text, int len, int text_inverse( FlowCtx *ctx, int x, int y, char *text, int len,
......
...@@ -182,7 +182,7 @@ void FlowAnnot::open( ifstream& fp) ...@@ -182,7 +182,7 @@ void FlowAnnot::open( ifstream& fp)
} }
} }
void FlowAnnot::draw( void *pos, int highlight, int hot, void *node) void FlowAnnot::draw( void *pos, int highlight, int dimmed, int hot, void *node)
{ {
int x; int x;
...@@ -208,7 +208,7 @@ void FlowAnnot::draw( void *pos, int highlight, int hot, void *node) ...@@ -208,7 +208,7 @@ void FlowAnnot::draw( void *pos, int highlight, int hot, void *node)
p.z_y + ((FlowPoint *)pos)->z_y - ctx->offset_y, p.z_y + ((FlowPoint *)pos)->z_y - ctx->offset_y,
((FlowNode *) node)->annotv[number], ((FlowNode *) node)->annotv[number],
strlen(((FlowNode *) node)->annotv[number]), draw_type, idx, strlen(((FlowNode *) node)->annotv[number]), draw_type, idx,
highlight, 0, highlight, dimmed, 0,
tsize(text_size)); tsize(text_size));
if ( ((FlowNode *) node)->annotv_inputmode[number]) if ( ((FlowNode *) node)->annotv_inputmode[number])
ctx->fdraw->move_input( ctx, ctx->fdraw->move_input( ctx,
...@@ -234,7 +234,7 @@ void FlowAnnot::draw( void *pos, int highlight, int hot, void *node) ...@@ -234,7 +234,7 @@ void FlowAnnot::draw( void *pos, int highlight, int hot, void *node)
if ( len) { if ( len) {
*s = 0; *s = 0;
ctx->fdraw->text( ctx, z_x, z_y + line_cnt * z_height, line, ctx->fdraw->text( ctx, z_x, z_y + line_cnt * z_height, line,
len, draw_type, idx, highlight, 0, len, draw_type, idx, highlight, dimmed, 0,
tsize(text_size)); tsize(text_size));
*s = 10; *s = 10;
} }
...@@ -247,7 +247,7 @@ void FlowAnnot::draw( void *pos, int highlight, int hot, void *node) ...@@ -247,7 +247,7 @@ void FlowAnnot::draw( void *pos, int highlight, int hot, void *node)
} }
if ( len) if ( len)
ctx->fdraw->text( ctx, z_x, z_y + line_cnt * z_height, line, ctx->fdraw->text( ctx, z_x, z_y + line_cnt * z_height, line,
len, draw_type, idx, highlight, 0, len, draw_type, idx, highlight, dimmed, 0,
tsize(text_size)); tsize(text_size));
break; break;
} }
......
...@@ -65,7 +65,7 @@ class FlowAnnot : public FlowArrayElem { ...@@ -65,7 +65,7 @@ class FlowAnnot : public FlowArrayElem {
void print( void *pos, void *node, int highlight); void print( void *pos, void *node, int highlight);
void save( ofstream& fp, flow_eSaveMode mode); void save( ofstream& fp, flow_eSaveMode mode);
void open( ifstream& fp); void open( ifstream& fp);
void draw( void *pos, int highlight, int hot, void *node); void draw( void *pos, int highlight, int dimmed, int hot, void *node);
void nav_draw( void *pos, int highlight, void *node); void nav_draw( void *pos, int highlight, void *node);
void draw_inverse( void *pos, int hot, void *node); void draw_inverse( void *pos, int hot, void *node);
void erase( void *pos, int hot, void *node); void erase( void *pos, int hot, void *node);
......
...@@ -149,7 +149,7 @@ void FlowAnnotPixmap::open( ifstream& fp) ...@@ -149,7 +149,7 @@ void FlowAnnotPixmap::open( ifstream& fp)
#endif #endif
} }
void FlowAnnotPixmap::draw( void *pos, int highlight, int hot, void *node) void FlowAnnotPixmap::draw( void *pos, int highlight, int dimmed, int hot, void *node)
{ {
int x; int x;
...@@ -307,7 +307,7 @@ void FlowAnnotPixmap::get_borders( double pos_x, double pos_y, double *x_right, ...@@ -307,7 +307,7 @@ void FlowAnnotPixmap::get_borders( double pos_x, double pos_y, double *x_right,
*/ */
} }
void FlowAnnotPixmap::move( void *pos, double x, double y, int highlight, int hot) void FlowAnnotPixmap::move( void *pos, double x, double y, int highlight, int dimmed, int hot)
{ {
erase( pos, hot, NULL); erase( pos, hot, NULL);
nav_erase( pos, NULL); nav_erase( pos, NULL);
...@@ -315,12 +315,12 @@ void FlowAnnotPixmap::move( void *pos, double x, double y, int highlight, int ho ...@@ -315,12 +315,12 @@ void FlowAnnotPixmap::move( void *pos, double x, double y, int highlight, int ho
p.y = y; p.y = y;
zoom(); zoom();
nav_zoom(); nav_zoom();
draw( pos, highlight, hot, NULL); draw( pos, highlight, dimmed, hot, NULL);
nav_draw( pos, highlight, NULL); nav_draw( pos, highlight, NULL);
} }
void FlowAnnotPixmap::shift( void *pos, double delta_x, double delta_y, void FlowAnnotPixmap::shift( void *pos, double delta_x, double delta_y,
int highlight, int hot) int highlight, int dimmed, int hot)
{ {
erase( pos, hot, NULL); erase( pos, hot, NULL);
nav_erase( pos, NULL); nav_erase( pos, NULL);
...@@ -329,7 +329,7 @@ void FlowAnnotPixmap::shift( void *pos, double delta_x, double delta_y, ...@@ -329,7 +329,7 @@ void FlowAnnotPixmap::shift( void *pos, double delta_x, double delta_y,
zoom(); zoom();
nav_zoom(); nav_zoom();
draw( pos, highlight, hot, NULL); draw( pos, highlight, dimmed, hot, NULL);
nav_draw( pos, highlight, NULL); nav_draw( pos, highlight, NULL);
} }
......
...@@ -62,14 +62,14 @@ class FlowAnnotPixmap : public FlowArrayElem { ...@@ -62,14 +62,14 @@ class FlowAnnotPixmap : public FlowArrayElem {
void print( void *pos, void *node, int highlight); void print( void *pos, void *node, int highlight);
void save( ofstream& fp, flow_eSaveMode mode); void save( ofstream& fp, flow_eSaveMode mode);
void open( ifstream& fp); void open( ifstream& fp);
void draw( void *pos, int highlight, int hot, void *node); void draw( void *pos, int highlight, int dimmed, int hot, void *node);
void nav_draw( void *pos, int highlight, void *node); void nav_draw( void *pos, int highlight, void *node);
void draw_inverse( void *pos, int hot, void *node); void draw_inverse( void *pos, int hot, void *node);
void erase( void *pos, int hot, void *node); void erase( void *pos, int hot, void *node);
void nav_erase( void *pos, void *node); void nav_erase( void *pos, void *node);
void move( void *pos, double x, double y, int highlight, int hot); void move( void *pos, double x, double y, int highlight, int dimmed, int hot);
void shift( void *pos, double delta_x, double delta_y, void shift( void *pos, double delta_x, double delta_y,
int highlight, int hot); int highlight, int dimmed, int hot);
void get_borders( double pos_x, double pos_y, double *x_right, void get_borders( double pos_x, double pos_y, double *x_right,
double *x_left, double *y_high, double *y_low, void *node); double *x_left, double *y_high, double *y_low, void *node);
int get_conpoint( int num, double *x, double *y, flow_eDirection *dir) int get_conpoint( int num, double *x, double *y, flow_eDirection *dir)
......
...@@ -105,6 +105,11 @@ void flow_ResetHighlightAll( flow_tCtx ctx) ...@@ -105,6 +105,11 @@ void flow_ResetHighlightAll( flow_tCtx ctx)
ctx->set_highlight( 0); ctx->set_highlight( 0);
} }
void flow_ResetDimmedAll( flow_tCtx ctx)
{
ctx->set_dimmed( 0);
}
void flow_ResetInverseAll( flow_tCtx ctx) void flow_ResetInverseAll( flow_tCtx ctx)
{ {
ctx->set_inverse( 0); ctx->set_inverse( 0);
...@@ -185,6 +190,16 @@ void flow_GetHighlight( flow_tObject object, int *value) ...@@ -185,6 +190,16 @@ void flow_GetHighlight( flow_tObject object, int *value)
*value = ((FlowArrayElem *) object)->get_highlight(); *value = ((FlowArrayElem *) object)->get_highlight();
} }
void flow_SetDimmed( flow_tObject object, int value)
{
((FlowArrayElem *) object)->set_dimmed( value);
}
void flow_GetDimmed( flow_tObject object, int *value)
{
*value = ((FlowArrayElem *) object)->get_dimmed();
}
void flow_SetInverse( flow_tObject object, int value) void flow_SetInverse( flow_tObject object, int value)
{ {
((FlowArrayElem *) object)->set_inverse( value); ((FlowArrayElem *) object)->set_inverse( value);
......
...@@ -109,6 +109,7 @@ void flow_DeleteNode( flow_tNode node); ...@@ -109,6 +109,7 @@ void flow_DeleteNode( flow_tNode node);
void flow_DeleteConnection( flow_tCon con); void flow_DeleteConnection( flow_tCon con);
int flow_FindSelectedObject( flow_tCtx ctx, flow_tObject object); int flow_FindSelectedObject( flow_tCtx ctx, flow_tObject object);
void flow_ResetHighlightAll( flow_tCtx ctx); void flow_ResetHighlightAll( flow_tCtx ctx);
void flow_ResetDimmedAll( flow_tCtx ctx);
void flow_ResetInverseAll( flow_tCtx ctx); void flow_ResetInverseAll( flow_tCtx ctx);
void flow_SetSelectHighlight( flow_tCtx ctx); void flow_SetSelectHighlight( flow_tCtx ctx);
void flow_ResetSelectHighlight( flow_tCtx ctx); void flow_ResetSelectHighlight( flow_tCtx ctx);
...@@ -125,6 +126,8 @@ void flow_GetSelectedNodes( flow_tCtx ctx, flow_tNode **nodes, int *num); ...@@ -125,6 +126,8 @@ void flow_GetSelectedNodes( flow_tCtx ctx, flow_tNode **nodes, int *num);
void flow_GetSelectedCons( flow_tCtx ctx, flow_tCon **cons, int *num); void flow_GetSelectedCons( flow_tCtx ctx, flow_tCon **cons, int *num);
void flow_SetHighlight( flow_tObject object, int value); void flow_SetHighlight( flow_tObject object, int value);
void flow_GetHighlight( flow_tObject object, int *value); void flow_GetHighlight( flow_tObject object, int *value);
void flow_SetDimmed( flow_tObject object, int value);
void flow_GetDimmed( flow_tObject object, int *value);
void flow_SetInverse( flow_tObject object, int value); void flow_SetInverse( flow_tObject object, int value);
void flow_CreateNode( flow_tCtx ctx, const char *name, flow_tNodeClass nc, void flow_CreateNode( flow_tCtx ctx, const char *name, flow_tNodeClass nc,
double x, double y, void *user_data, flow_tNode *node); double x, double y, void *user_data, flow_tNode *node);
......
...@@ -119,7 +119,7 @@ void FlowArc::open( ifstream& fp) ...@@ -119,7 +119,7 @@ void FlowArc::open( ifstream& fp)
} }
} }
void FlowArc::draw( void *pos, int highlight, int hot, void *node) void FlowArc::draw( void *pos, int highlight, int dimmed, int hot, void *node)
{ {
int idx = int( ctx->zoom_factor / ctx->base_zoom_factor * line_width - 1); int idx = int( ctx->zoom_factor / ctx->base_zoom_factor * line_width - 1);
idx += hot; idx += hot;
...@@ -128,7 +128,7 @@ void FlowArc::draw( void *pos, int highlight, int hot, void *node) ...@@ -128,7 +128,7 @@ void FlowArc::draw( void *pos, int highlight, int hot, void *node)
ctx->fdraw->arc( ctx, ll.z_x + ((FlowPoint *)pos)->z_x - ctx->offset_x, ctx->fdraw->arc( ctx, ll.z_x + ((FlowPoint *)pos)->z_x - ctx->offset_x,
ll.z_y + ((FlowPoint *)pos)->z_y - ctx->offset_y, ll.z_y + ((FlowPoint *)pos)->z_y - ctx->offset_y,
ur.z_x - ll.z_x, ur.z_y - ll.z_y, angle1, angle2, ur.z_x - ll.z_x, ur.z_y - ll.z_y, angle1, angle2,
draw_type, idx, highlight); draw_type, idx, highlight, dimmed);
} }
void FlowArc::erase( void *pos, int hot, void *node) void FlowArc::erase( void *pos, int hot, void *node)
...@@ -198,7 +198,7 @@ void FlowArc::get_borders( double pos_x, double pos_y, double *x_right, ...@@ -198,7 +198,7 @@ void FlowArc::get_borders( double pos_x, double pos_y, double *x_right,
} }
void FlowArc::move( void *pos, double x1, double y1, double x2, double y2, void FlowArc::move( void *pos, double x1, double y1, double x2, double y2,
int ang1, int ang2, int highlight, int hot) int ang1, int ang2, int highlight, int dimmed, int hot)
{ {
erase( pos, hot, NULL); erase( pos, hot, NULL);
nav_erase( pos, NULL); nav_erase( pos, NULL);
...@@ -210,12 +210,12 @@ void FlowArc::move( void *pos, double x1, double y1, double x2, double y2, ...@@ -210,12 +210,12 @@ void FlowArc::move( void *pos, double x1, double y1, double x2, double y2,
angle2 = ang2; angle2 = ang2;
zoom(); zoom();
nav_zoom(); nav_zoom();
draw( pos, highlight, hot, NULL); draw( pos, highlight, dimmed, hot, NULL);
nav_draw( pos, highlight, NULL); nav_draw( pos, highlight, NULL);
} }
void FlowArc::shift( void *pos, double delta_x, double delta_y, void FlowArc::shift( void *pos, double delta_x, double delta_y,
int highlight, int hot) int highlight, int dimmed, int hot)
{ {
erase( pos, hot, NULL); erase( pos, hot, NULL);
nav_erase( pos, NULL); nav_erase( pos, NULL);
...@@ -226,7 +226,7 @@ void FlowArc::shift( void *pos, double delta_x, double delta_y, ...@@ -226,7 +226,7 @@ void FlowArc::shift( void *pos, double delta_x, double delta_y,
zoom(); zoom();
nav_zoom(); nav_zoom();
draw( pos, highlight, hot, NULL); draw( pos, highlight, dimmed, hot, NULL);
nav_draw( pos, highlight, NULL); nav_draw( pos, highlight, NULL);
} }
......
...@@ -65,7 +65,7 @@ class FlowArc : public FlowArrayElem { ...@@ -65,7 +65,7 @@ class FlowArc : public FlowArrayElem {
void print( void *pos, void *node, int highlight); void print( void *pos, void *node, int highlight);
void save( ofstream& fp, flow_eSaveMode mode); void save( ofstream& fp, flow_eSaveMode mode);
void open( ifstream& fp); void open( ifstream& fp);
void draw( void *pos, int highlight, int hot, void *node); void draw( void *pos, int highlight, int dimmed, int hot, void *node);
void nav_draw( void *pos, int highlight, void *node); void nav_draw( void *pos, int highlight, void *node);
void erase( void *pos, int hot, void *node); void erase( void *pos, int hot, void *node);
void draw_inverse( void *pos, int hot, void *node) void draw_inverse( void *pos, int hot, void *node)
...@@ -74,9 +74,9 @@ class FlowArc : public FlowArrayElem { ...@@ -74,9 +74,9 @@ class FlowArc : public FlowArrayElem {
void get_borders( double pos_x, double pos_y, double *x_right, void get_borders( double pos_x, double pos_y, double *x_right,
double *x_left, double *y_high, double *y_low, void *node); double *x_left, double *y_high, double *y_low, void *node);
void move( void *pos, double x1, double y1, double x2, double y2, void move( void *pos, double x1, double y1, double x2, double y2,
int ang1, int ang2, int highlight, int hot); int ang1, int ang2, int highlight, int dimmed, int hot);
void shift( void *pos, double delta_x, double delta_y, void shift( void *pos, double delta_x, double delta_y,
int highlight, int hot); int highlight, int dimmed, int hot);
int get_conpoint( int num, double *x, double *y, flow_eDirection *dir) int get_conpoint( int num, double *x, double *y, flow_eDirection *dir)
{ return 0;}; { return 0;};
flow_eObjectType type() { return flow_eObjectType_Arc;}; flow_eObjectType type() { return flow_eObjectType_Arc;};
......
...@@ -787,13 +787,13 @@ void FlowArray::open( void *ctx, ifstream& fp) ...@@ -787,13 +787,13 @@ void FlowArray::open( void *ctx, ifstream& fp)
} }
} }
void FlowArray::draw( void *pos, int highlight, int hot, void *node) void FlowArray::draw( void *pos, int highlight, int dimmed, int hot, void *node)
{ {
int i; int i;
for ( i = 0; i < a_size; i++) for ( i = 0; i < a_size; i++)
{ {
a[i]->draw( pos, highlight, hot, node); a[i]->draw( pos, highlight, dimmed, hot, node);
} }
} }
...@@ -901,6 +901,16 @@ void FlowArray::set_highlight( int on) ...@@ -901,6 +901,16 @@ void FlowArray::set_highlight( int on)
} }
} }
void FlowArray::set_dimmed( int on)
{
int i;
for ( i = 0; i < a_size; i++)
{
a[i]->set_dimmed( on);
}
}
void FlowArray::set_hot( int on) void FlowArray::set_hot( int on)
{ {
int i; int i;
...@@ -963,13 +973,13 @@ void FlowArray::move( int delta_x, int delta_y, int grid) ...@@ -963,13 +973,13 @@ void FlowArray::move( int delta_x, int delta_y, int grid)
} }
} }
void FlowArray::shift( void *pos, double delta_x, double delta_y, int highlight, int hot) void FlowArray::shift( void *pos, double delta_x, double delta_y, int highlight, int dimmed, int hot)
{ {
int i; int i;
for ( i = 0; i < a_size; i++) for ( i = 0; i < a_size; i++)
{ {
a[i]->shift( pos, delta_x, delta_y, highlight, hot); a[i]->shift( pos, delta_x, delta_y, highlight, dimmed, hot);
} }
} }
......
...@@ -64,7 +64,7 @@ class FlowArray { ...@@ -64,7 +64,7 @@ class FlowArray {
void print( void *pos, void *node, int highlight); void print( void *pos, void *node, int highlight);
void save( ofstream& fp, flow_eSaveMode mode); void save( ofstream& fp, flow_eSaveMode mode);
void open( void *ctx, ifstream& fp); void open( void *ctx, ifstream& fp);
void draw( void *pos, int highlight, int hot, void *node); void draw( void *pos, int highlight, int dimmed, int hot, void *node);
void erase( void *pos, int hot, void *node); void erase( void *pos, int hot, void *node);
void draw_inverse( void *pos, int hot, void *node); void draw_inverse( void *pos, int hot, void *node);
void nav_draw( void *pos, int highlight, void *node); void nav_draw( void *pos, int highlight, void *node);
...@@ -82,10 +82,11 @@ class FlowArray { ...@@ -82,10 +82,11 @@ class FlowArray {
void **cp); void **cp);
int get_conpoint( int num, double *x, double *y, flow_eDirection *dir); int get_conpoint( int num, double *x, double *y, flow_eDirection *dir);
void set_highlight( int on); void set_highlight( int on);
void set_dimmed( int on);
void set_hot( int on); void set_hot( int on);
void select_region_insert( double ll_x, double ll_y, double ur_x, void select_region_insert( double ll_x, double ll_y, double ur_x,
double ur_y); double ur_y);
void shift( void *pos, double delta_x, double delta_y, int highlight, void shift( void *pos, double delta_x, double delta_y, int highlight, int dimmed,
int hot); int hot);
void move( int delta_x, int delta_y, int grid); void move( int delta_x, int delta_y, int grid);
void move_noerase( int delta_x, int delta_y, int grid); void move_noerase( int delta_x, int delta_y, int grid);
......
...@@ -64,14 +64,14 @@ class FlowArrayElem { ...@@ -64,14 +64,14 @@ class FlowArrayElem {
virtual void open( ifstream& fp) {}; virtual void open( ifstream& fp) {};
virtual void print( void *pos, void *node, int highlight) {}; virtual void print( void *pos, void *node, int highlight) {};
virtual void draw( int ll_x, int ll_y, int ur_x, int ur_y) {}; virtual void draw( int ll_x, int ll_y, int ur_x, int ur_y) {};
virtual void draw( void *pos, int highlight, int hot, void *node) {}; virtual void draw( void *pos, int highlight, int dimmed, int hot, void *node) {};
virtual void erase() {}; virtual void erase() {};
virtual void erase( void *pos, int hot, void *node) {}; virtual void erase( void *pos, int hot, void *node) {};
virtual void draw_inverse( void *pos, int hot, void *node) {}; virtual void draw_inverse( void *pos, int hot, void *node) {};
virtual void move( int delta_x, int delta_y, int grid) {}; virtual void move( int delta_x, int delta_y, int grid) {};
virtual void move_noerase( int delta_x, int delta_y, int grid) {}; virtual void move_noerase( int delta_x, int delta_y, int grid) {};
virtual void shift( void *pos, double delta_x, double delta_y, virtual void shift( void *pos, double delta_x, double delta_y,
int highlight, int hot) {}; int highlight, int dimmed, int hot) {};
virtual void nav_draw( int ll_x, int ll_y, int ur_x, int ur_y) {}; virtual void nav_draw( int ll_x, int ll_y, int ur_x, int ur_y) {};
virtual void nav_draw( void *pos, int highlight, void *node) {}; virtual void nav_draw( void *pos, int highlight, void *node) {};
virtual void nav_erase() {}; virtual void nav_erase() {};
...@@ -84,6 +84,8 @@ class FlowArrayElem { ...@@ -84,6 +84,8 @@ class FlowArrayElem {
virtual int delete_node_cons( void *node) {return 0;}; virtual int delete_node_cons( void *node) {return 0;};
virtual void set_highlight( int on) {}; virtual void set_highlight( int on) {};
virtual int get_highlight() {return 1;}; virtual int get_highlight() {return 1;};
virtual void set_dimmed( int on) {};
virtual int get_dimmed() {return 1;};
virtual void set_inverse( int on) {}; virtual void set_inverse( int on) {};
virtual void set_hot( int on) {}; virtual void set_hot( int on) {};
virtual void select_region_insert( double ll_x, double ll_y, double ur_x, virtual void select_region_insert( double ll_x, double ll_y, double ur_x,
......
...@@ -187,7 +187,7 @@ void FlowArrow::open( ifstream& fp) ...@@ -187,7 +187,7 @@ void FlowArrow::open( ifstream& fp)
} }
} }
void FlowArrow::draw( void *pos, int highlight, int hot, void *node) void FlowArrow::draw( void *pos, int highlight, int dimmed, int hot, void *node)
{ {
int idx = int( ctx->zoom_factor / ctx->base_zoom_factor * line_width - 1); int idx = int( ctx->zoom_factor / ctx->base_zoom_factor * line_width - 1);
idx += hot; idx += hot;
...@@ -250,7 +250,7 @@ void FlowArrow::nav_erase( void *pos, void *node) ...@@ -250,7 +250,7 @@ void FlowArrow::nav_erase( void *pos, void *node)
} }
void FlowArrow::move( void *pos, double x1, double y1, double x2, double y2, void FlowArrow::move( void *pos, double x1, double y1, double x2, double y2,
int highlight, int hot) int highlight, int dimmed, int hot)
{ {
erase( pos, hot, NULL); erase( pos, hot, NULL);
nav_erase( pos, NULL); nav_erase( pos, NULL);
...@@ -301,12 +301,12 @@ void FlowArrow::move( void *pos, double x1, double y1, double x2, double y2, ...@@ -301,12 +301,12 @@ void FlowArrow::move( void *pos, double x1, double y1, double x2, double y2,
p_dest.y = y2; p_dest.y = y2;
zoom(); zoom();
nav_zoom(); nav_zoom();
draw( pos, highlight, hot, NULL); draw( pos, highlight, dimmed, hot, NULL);
nav_draw( pos, highlight, NULL); nav_draw( pos, highlight, NULL);
} }
void FlowArrow::shift( void *pos, double delta_x, double delta_y, void FlowArrow::shift( void *pos, double delta_x, double delta_y,
int highlight, int hot) int highlight, int dimmed, int hot)
{ {
erase( pos, hot, NULL); erase( pos, hot, NULL);
nav_erase( pos, NULL); nav_erase( pos, NULL);
...@@ -319,7 +319,7 @@ void FlowArrow::shift( void *pos, double delta_x, double delta_y, ...@@ -319,7 +319,7 @@ void FlowArrow::shift( void *pos, double delta_x, double delta_y,
zoom(); zoom();
nav_zoom(); nav_zoom();
draw( pos, highlight, hot, NULL); draw( pos, highlight, dimmed, hot, NULL);
nav_draw( pos, highlight, NULL); nav_draw( pos, highlight, NULL);
} }
......
...@@ -59,7 +59,7 @@ class FlowArrow : public FlowArrayElem { ...@@ -59,7 +59,7 @@ class FlowArrow : public FlowArrayElem {
void print( void *pos, void *node, int highlight); void print( void *pos, void *node, int highlight);
void save( ofstream& fp, flow_eSaveMode mode); void save( ofstream& fp, flow_eSaveMode mode);
void open( ifstream& fp); void open( ifstream& fp);
void draw( void *pos, int hightlight, int hot, void *node); void draw( void *pos, int hightlight, int dimmed, int hot, void *node);
void nav_draw( void *pos, int highlight, void *node); void nav_draw( void *pos, int highlight, void *node);
void erase( void *pos, int hot, void *node); void erase( void *pos, int hot, void *node);
void draw_inverse( void *pos, int hot, void *node) void draw_inverse( void *pos, int hot, void *node)
...@@ -72,9 +72,9 @@ class FlowArrow : public FlowArrayElem { ...@@ -72,9 +72,9 @@ class FlowArrow : public FlowArrayElem {
{ return 0;}; { return 0;};
flow_eObjectType type() { return flow_eObjectType_Arrow;}; flow_eObjectType type() { return flow_eObjectType_Arrow;};
void move( void *pos, double x1, double y1, double x2, double y2, void move( void *pos, double x1, double y1, double x2, double y2,
int highlight, int hot); int highlight, int dimmed, int hot);
void shift( void *pos, double delta_x, double delta_y, void shift( void *pos, double delta_x, double delta_y,
int highlight, int hot); int highlight, int dimmed, int hot);
FlowCtx *ctx; FlowCtx *ctx;
FlowPoint p_dest; FlowPoint p_dest;
FlowPoint p1; FlowPoint p1;
......
This diff is collapsed.
...@@ -151,6 +151,7 @@ class FlowCon : public FlowArrayElem { ...@@ -151,6 +151,7 @@ class FlowCon : public FlowArrayElem {
flow_tName c_name; flow_tName c_name;
int hot; int hot;
int highlight; int highlight;
int dimmed;
flow_eMoveType movement_type; flow_eMoveType movement_type;
flow_tTraceObj trace_object; flow_tTraceObj trace_object;
flow_tTraceAttr trace_attribute; flow_tTraceAttr trace_attribute;
......
...@@ -158,7 +158,7 @@ void FlowConPoint::get_trace_attr( char *object, char *attribute, ...@@ -158,7 +158,7 @@ void FlowConPoint::get_trace_attr( char *object, char *attribute,
*inverted = 0; *inverted = 0;
} }
void FlowConPoint::draw( void *pos, int highlight, int hot, void *node) void FlowConPoint::draw( void *pos, int highlight, int dimmed, int hot, void *node)
{ {
int line_width = 1; int line_width = 1;
int idx = int( ctx->zoom_factor / ctx->base_zoom_factor * line_width - 1) + 2; int idx = int( ctx->zoom_factor / ctx->base_zoom_factor * line_width - 1) + 2;
...@@ -191,7 +191,7 @@ void FlowConPoint::draw( void *pos, int highlight, int hot, void *node) ...@@ -191,7 +191,7 @@ void FlowConPoint::draw( void *pos, int highlight, int hot, void *node)
y = p.z_y + ((FlowPoint *)pos)->z_y - ctx->offset_y - size/2; y = p.z_y + ((FlowPoint *)pos)->z_y - ctx->offset_y - size/2;
} }
ctx->fdraw->arc( ctx, x, y, size, size, 0, 360, ctx->fdraw->arc( ctx, x, y, size, size, 0, 360,
flow_eDrawType_LineRed, idx, 0); flow_eDrawType_LineRed, idx, 0, 0);
} }
} }
......
...@@ -63,7 +63,7 @@ class FlowConPoint : public FlowArrayElem { ...@@ -63,7 +63,7 @@ class FlowConPoint : public FlowArrayElem {
void print( void *pos, void *node) {}; void print( void *pos, void *node) {};
void save( ofstream& fp, flow_eSaveMode mode); void save( ofstream& fp, flow_eSaveMode mode);
void open( ifstream& fp); void open( ifstream& fp);
void draw( void *pos, int highlight, int hot, void *node); void draw( void *pos, int highlight, int dimmed, int hot, void *node);
void nav_draw( void *pos, int highlight, void *node) {}; void nav_draw( void *pos, int highlight, void *node) {};
void erase( void *pos, int hot, void *node); void erase( void *pos, int hot, void *node);
void nav_erase( void *pos, void *node) {}; void nav_erase( void *pos, void *node) {};
......
/* /*
* Proview Open Source Process Control. * Proview Open Source Process Control.
* Copyright (C) 2005-2014 SSAB EMEA AB. * Copyright (C) 2005-2014 SSAB EMEA AB.
* *
...@@ -571,7 +571,7 @@ void FlowCtx::draw( int ll_x, int ll_y, int ur_x, int ur_y) ...@@ -571,7 +571,7 @@ void FlowCtx::draw( int ll_x, int ll_y, int ur_x, int ur_y)
{ {
fdraw->rect( this, select_rect_ll_x, select_rect_ll_y, fdraw->rect( this, select_rect_ll_x, select_rect_ll_y,
select_rect_ur_x - select_rect_ll_x, select_rect_ur_x - select_rect_ll_x,
select_rect_ur_y - select_rect_ll_y, flow_eDrawType_Line, 0, 0); select_rect_ur_y - select_rect_ll_y, flow_eDrawType_Line, 0, 0, 0);
} }
tiptext->draw(); tiptext->draw();
} }
...@@ -1148,7 +1148,7 @@ int FlowCtx::event_handler( flow_eEvent event, int x, int y, int w, int h) ...@@ -1148,7 +1148,7 @@ int FlowCtx::event_handler( flow_eEvent event, int x, int y, int w, int h)
draw( con_create_conpoint_x, con_create_conpoint_y, draw( con_create_conpoint_x, con_create_conpoint_y,
con_create_last_x, con_create_last_y); con_create_last_x, con_create_last_y);
fdraw->line( this, con_create_conpoint_x, con_create_conpoint_y, fdraw->line( this, con_create_conpoint_x, con_create_conpoint_y,
x, y, flow_eDrawType_Line, 0, 0); x, y, flow_eDrawType_Line, 0, 0, 0);
con_create_last_x = x; con_create_last_x = x;
con_create_last_y = y; con_create_last_y = y;
for ( i = 0; i < a.a_size; i++) for ( i = 0; i < a.a_size; i++)
......
...@@ -127,6 +127,8 @@ class FlowCtx { ...@@ -127,6 +127,8 @@ class FlowCtx {
void copy(); void copy();
void set_highlight( int on) void set_highlight( int on)
{ a.set_highlight( on);}; { a.set_highlight( on);};
void set_dimmed( int on)
{ a.set_dimmed( on);};
void set_inverse( int on) void set_inverse( int on)
{ a.set_inverse( on);}; { a.set_inverse( on);};
void set_select_highlight( int on) void set_select_highlight( int on)
......
...@@ -61,7 +61,7 @@ class FlowDraw { ...@@ -61,7 +61,7 @@ class FlowDraw {
virtual void set_nav_window_size( FlowCtx *ctx, int width, int height) {} virtual void set_nav_window_size( FlowCtx *ctx, int width, int height) {}
virtual int rect( FlowCtx *ctx, int x, int y, int width, int height, virtual int rect( FlowCtx *ctx, int x, int y, int width, int height,
flow_eDrawType gc_type, int idx, int highlight) {return 1;} flow_eDrawType gc_type, int idx, int highlight, int dimmed) {return 1;}
virtual int rect_erase( FlowCtx *ctx, int x, int y, int width, int height, virtual int rect_erase( FlowCtx *ctx, int x, int y, int width, int height,
int idx) {return 1;} int idx) {return 1;}
virtual int nav_rect( FlowCtx *ctx, int x, int y, int width, int height, virtual int nav_rect( FlowCtx *ctx, int x, int y, int width, int height,
...@@ -82,7 +82,7 @@ class FlowDraw { ...@@ -82,7 +82,7 @@ class FlowDraw {
int idx) {return 1;} int idx) {return 1;}
virtual int arc( FlowCtx *ctx, int x, int y, int width, int height, virtual int arc( FlowCtx *ctx, int x, int y, int width, int height,
int angle1, int angle2, int angle1, int angle2,
flow_eDrawType gc_type, int idx, int highlight) {return 1;} flow_eDrawType gc_type, int idx, int highlight, int dimmed) {return 1;}
virtual int arc_erase( FlowCtx *ctx, int x, int y, int width, int height, virtual int arc_erase( FlowCtx *ctx, int x, int y, int width, int height,
int angle1, int angle2, int angle1, int angle2,
int idx) {return 1;} int idx) {return 1;}
...@@ -93,7 +93,7 @@ class FlowDraw { ...@@ -93,7 +93,7 @@ class FlowDraw {
int angle1, int angle2, int angle1, int angle2,
int idx) {return 1;} int idx) {return 1;}
virtual int line( FlowCtx *ctx, int x1, int y1, int x2, int y2, virtual int line( FlowCtx *ctx, int x1, int y1, int x2, int y2,
flow_eDrawType gc_type, int idx, int highlight) {return 1;} flow_eDrawType gc_type, int idx, int highlight, int dimmed) {return 1;}
virtual int line_erase( FlowCtx *ctx, int x1, int y1, int x2, int y2, virtual int line_erase( FlowCtx *ctx, int x1, int y1, int x2, int y2,
int idx) {return 1;} int idx) {return 1;}
virtual int nav_line( FlowCtx *ctx, int x1, int y1, int x2, int y2, virtual int nav_line( FlowCtx *ctx, int x1, int y1, int x2, int y2,
...@@ -101,7 +101,7 @@ class FlowDraw { ...@@ -101,7 +101,7 @@ class FlowDraw {
virtual int nav_line_erase( FlowCtx *ctx, int x1, int y1, int x2, int y2, virtual int nav_line_erase( FlowCtx *ctx, int x1, int y1, int x2, int y2,
int idx) {return 1;} int idx) {return 1;}
virtual int text( FlowCtx *ctx, int x, int y, char *text, int len, virtual int text( FlowCtx *ctx, int x, int y, char *text, int len,
flow_eDrawType gc_type, int idx, int highlight, int line, double size) flow_eDrawType gc_type, int idx, int highlight, int dimmed, int line, double size)
{return 1;} {return 1;}
virtual int text_inverse( FlowCtx *ctx, int x, int y, char *text, int len, virtual int text_inverse( FlowCtx *ctx, int x, int y, char *text, int len,
flow_eDrawType gc_type, int idx, int line, double size) flow_eDrawType gc_type, int idx, int line, double size)
......
...@@ -54,7 +54,7 @@ void FlowFrame::open( ifstream& fp) ...@@ -54,7 +54,7 @@ void FlowFrame::open( ifstream& fp)
// nyi // nyi
} }
void FlowFrame::draw( void *pos, int highlight, int hot, void *node) void FlowFrame::draw( void *pos, int highlight, int dimmed, int hot, void *node)
{ {
double ur_x, ur_y; double ur_x, ur_y;
int idx; int idx;
...@@ -83,7 +83,7 @@ void FlowFrame::draw( void *pos, int highlight, int hot, void *node) ...@@ -83,7 +83,7 @@ void FlowFrame::draw( void *pos, int highlight, int hot, void *node)
ll.z_y + ((FlowPoint *)pos)->z_y - ctx->offset_y, ll.z_y + ((FlowPoint *)pos)->z_y - ctx->offset_y,
int( ur_x * ctx->zoom_factor - ll.z_x - ((FlowPoint *)pos)->z_x - 1), int( ur_x * ctx->zoom_factor - ll.z_x - ((FlowPoint *)pos)->z_x - 1),
int( ur_y * ctx->zoom_factor - ll.z_y - ((FlowPoint *)pos)->z_y - 1), int( ur_y * ctx->zoom_factor - ll.z_y - ((FlowPoint *)pos)->z_y - 1),
draw_type, idx, highlight); draw_type, idx, highlight, 0);
} }
void FlowFrame::erase( void *pos, int hot, void *node) void FlowFrame::erase( void *pos, int hot, void *node)
......
...@@ -53,7 +53,7 @@ class FlowFrame : public FlowRect { ...@@ -53,7 +53,7 @@ class FlowFrame : public FlowRect {
FlowRect( flow_ctx, x, y, w, h, d_type, line_w, fix_line_w) {}; FlowRect( flow_ctx, x, y, w, h, d_type, line_w, fix_line_w) {};
void save( ofstream& fp, flow_eSaveMode mode); void save( ofstream& fp, flow_eSaveMode mode);
void open( ifstream& fp); void open( ifstream& fp);
void draw( void *pos, int hightlight, int hot, void *node); void draw( void *pos, int hightlight, int dimmed, int hot, void *node);
void erase( void *pos, int hot, void *node); void erase( void *pos, int hot, void *node);
void get_borders( double pos_x, double pos_y, double *x_right, void get_borders( double pos_x, double pos_y, double *x_right,
double *x_left, double *y_high, double *y_low, void *node); double *x_left, double *y_high, double *y_low, void *node);
......
...@@ -171,7 +171,7 @@ void FlowImage::open( ifstream& fp) ...@@ -171,7 +171,7 @@ void FlowImage::open( ifstream& fp)
} }
} }
void FlowImage::draw( void *pos, int highlight, int hot, void *node) void FlowImage::draw( void *pos, int highlight, int dimmed, int hot, void *node)
{ {
if ( !(display_level & ctx->display_level)) if ( !(display_level & ctx->display_level))
return; return;
...@@ -249,7 +249,7 @@ void FlowImage::get_borders( double pos_x, double pos_y, double *x_right, ...@@ -249,7 +249,7 @@ void FlowImage::get_borders( double pos_x, double pos_y, double *x_right,
*y_high = pos_y + ur.y; *y_high = pos_y + ur.y;
} }
void FlowImage::move( void *pos, double x, double y, int highlight, int hot) void FlowImage::move( void *pos, double x, double y, int highlight, int dimmed, int hot)
{ {
double width, height; double width, height;
...@@ -263,12 +263,12 @@ void FlowImage::move( void *pos, double x, double y, int highlight, int hot) ...@@ -263,12 +263,12 @@ void FlowImage::move( void *pos, double x, double y, int highlight, int hot)
ur.y = y + height; ur.y = y + height;
zoom(); zoom();
nav_zoom(); nav_zoom();
draw( pos, highlight, hot, NULL); draw( pos, highlight, dimmed, hot, NULL);
nav_draw( pos, highlight, NULL); nav_draw( pos, highlight, NULL);
} }
void FlowImage::shift( void *pos, double delta_x, double delta_y, void FlowImage::shift( void *pos, double delta_x, double delta_y,
int highlight, int hot) int highlight, int dimmed, int hot)
{ {
erase( pos, hot, NULL); erase( pos, hot, NULL);
nav_erase( pos, NULL); nav_erase( pos, NULL);
...@@ -279,7 +279,7 @@ void FlowImage::shift( void *pos, double delta_x, double delta_y, ...@@ -279,7 +279,7 @@ void FlowImage::shift( void *pos, double delta_x, double delta_y,
zoom(); zoom();
nav_zoom(); nav_zoom();
draw( pos, highlight, hot, NULL); draw( pos, highlight, dimmed, hot, NULL);
nav_draw( pos, highlight, NULL); nav_draw( pos, highlight, NULL);
} }
......
...@@ -60,7 +60,7 @@ class FlowImage : public FlowArrayElem { ...@@ -60,7 +60,7 @@ class FlowImage : public FlowArrayElem {
void print( void *pos, void *node, int highlight); void print( void *pos, void *node, int highlight);
void save( ofstream& fp, flow_eSaveMode mode); void save( ofstream& fp, flow_eSaveMode mode);
void open( ifstream& fp); void open( ifstream& fp);
void draw( void *pos, int hightlight, int hot, void *node); void draw( void *pos, int hightlight, int dimmed, int hot, void *node);
void nav_draw( void *pos, int highlight, void *node); void nav_draw( void *pos, int highlight, void *node);
void draw_inverse( void *pos, int hot, void *node) void draw_inverse( void *pos, int hot, void *node)
{ erase( pos, hot, node);}; { erase( pos, hot, node);};
...@@ -68,9 +68,9 @@ class FlowImage : public FlowArrayElem { ...@@ -68,9 +68,9 @@ class FlowImage : public FlowArrayElem {
void nav_erase( void *pos, void *node); void nav_erase( void *pos, void *node);
void get_borders( double pos_x, double pos_y, double *x_right, void get_borders( double pos_x, double pos_y, double *x_right,
double *x_left, double *y_high, double *y_low, void *node); double *x_left, double *y_high, double *y_low, void *node);
void move( void *pos, double x, double y, int highlight, int hot); void move( void *pos, double x, double y, int highlight, int dimmed, int hot);
void shift( void *pos, double delta_x, double delta_y, void shift( void *pos, double delta_x, double delta_y,
int highlight, int hot); int highlight, int dimmed, int hot);
int get_conpoint( int num, double *x, double *y, flow_eDirection *dir) int get_conpoint( int num, double *x, double *y, flow_eDirection *dir)
{ return 0;}; { return 0;};
flow_eObjectType type() { return flow_eObjectType_Image;}; flow_eObjectType type() { return flow_eObjectType_Image;};
......
...@@ -117,7 +117,7 @@ void FlowLine::open( ifstream& fp) ...@@ -117,7 +117,7 @@ void FlowLine::open( ifstream& fp)
} }
} }
void FlowLine::draw( void *pos, int hightlight, int hot, void *node) void FlowLine::draw( void *pos, int highlight, int dimmed, int hot, void *node)
{ {
if ( p1.z_x == p2.z_x && p1.z_y == p2.z_y) if ( p1.z_x == p2.z_x && p1.z_y == p2.z_y)
return; return;
...@@ -129,7 +129,7 @@ void FlowLine::draw( void *pos, int hightlight, int hot, void *node) ...@@ -129,7 +129,7 @@ void FlowLine::draw( void *pos, int hightlight, int hot, void *node)
p1.z_y + ((FlowPoint *)pos)->z_y - ctx->offset_y, p1.z_y + ((FlowPoint *)pos)->z_y - ctx->offset_y,
p2.z_x + ((FlowPoint *)pos)->z_x - ctx->offset_x, p2.z_x + ((FlowPoint *)pos)->z_x - ctx->offset_x,
p2.z_y + ((FlowPoint *)pos)->z_y - ctx->offset_y, p2.z_y + ((FlowPoint *)pos)->z_y - ctx->offset_y,
draw_type, idx, hightlight); draw_type, idx, highlight, dimmed);
} }
void FlowLine::erase( void *pos, int hot, void *node) void FlowLine::erase( void *pos, int hot, void *node)
...@@ -243,7 +243,7 @@ void FlowLine::get_borders( double pos_x, double pos_y, ...@@ -243,7 +243,7 @@ void FlowLine::get_borders( double pos_x, double pos_y,
} }
void FlowLine::move( void *pos, double x1, double y1, double x2, double y2, void FlowLine::move( void *pos, double x1, double y1, double x2, double y2,
int highlight, int hot) int highlight, int dimmed, int hot)
{ {
erase( pos, hot, NULL); erase( pos, hot, NULL);
nav_erase( pos, NULL); nav_erase( pos, NULL);
...@@ -253,12 +253,12 @@ void FlowLine::move( void *pos, double x1, double y1, double x2, double y2, ...@@ -253,12 +253,12 @@ void FlowLine::move( void *pos, double x1, double y1, double x2, double y2,
p2.y = y2; p2.y = y2;
zoom(); zoom();
nav_zoom(); nav_zoom();
draw( pos, highlight, hot, NULL); draw( pos, highlight, dimmed, hot, NULL);
nav_draw( pos, highlight, NULL); nav_draw( pos, highlight, NULL);
} }
void FlowLine::shift( void *pos, double delta_x, double delta_y, void FlowLine::shift( void *pos, double delta_x, double delta_y,
int highlight, int hot) int highlight, int dimmed, int hot)
{ {
erase( pos, hot, NULL); erase( pos, hot, NULL);
nav_erase( pos, NULL); nav_erase( pos, NULL);
...@@ -269,7 +269,7 @@ void FlowLine::shift( void *pos, double delta_x, double delta_y, ...@@ -269,7 +269,7 @@ void FlowLine::shift( void *pos, double delta_x, double delta_y,
zoom(); zoom();
nav_zoom(); nav_zoom();
draw( pos, highlight, hot, NULL); draw( pos, highlight, dimmed, hot, NULL);
nav_draw( pos, highlight, NULL); nav_draw( pos, highlight, NULL);
} }
......
...@@ -64,7 +64,7 @@ class FlowLine : public FlowArrayElem { ...@@ -64,7 +64,7 @@ class FlowLine : public FlowArrayElem {
void print( void *pos, void *node, int highlight); void print( void *pos, void *node, int highlight);
void save( ofstream& fp, flow_eSaveMode mode); void save( ofstream& fp, flow_eSaveMode mode);
void open( ifstream& fp); void open( ifstream& fp);
void draw( void *pos, int highlight, int hot, void *node); void draw( void *pos, int highlight, int dimmed, int hot, void *node);
void nav_draw( void *pos, int hightlight, void *node); void nav_draw( void *pos, int hightlight, void *node);
void draw_inverse( void *pos, int hot, void *node) void draw_inverse( void *pos, int hot, void *node)
{ erase( pos, hot, node);}; { erase( pos, hot, node);};
...@@ -73,8 +73,8 @@ class FlowLine : public FlowArrayElem { ...@@ -73,8 +73,8 @@ class FlowLine : public FlowArrayElem {
void get_borders( double pos_x, double pos_y, double *x_right, void get_borders( double pos_x, double pos_y, double *x_right,
double *x_left, double *y_high, double *y_low, void *node); double *x_left, double *y_high, double *y_low, void *node);
void move( void *pos, double x1, double y1, double x2, double y2, void move( void *pos, double x1, double y1, double x2, double y2,
int highlight, int hot); int highlight, int dimmed, int hot);
void shift( void *pos, double delta_x, double delta_y, int highlight, int hot); void shift( void *pos, double delta_x, double delta_y, int highlight, int dimmed, int hot);
int get_conpoint( int num, double *x, double *y, flow_eDirection *dir) int get_conpoint( int num, double *x, double *y, flow_eDirection *dir)
{ return 0;}; { return 0;};
flow_eObjectType type() { return flow_eObjectType_Line;}; flow_eObjectType type() { return flow_eObjectType_Line;};
......
...@@ -54,7 +54,7 @@ FlowNode::FlowNode( FlowCtx *flow_ctx, const char *name, FlowNodeClass *node_cla ...@@ -54,7 +54,7 @@ FlowNode::FlowNode( FlowCtx *flow_ctx, const char *name, FlowNodeClass *node_cla
obst_x_right(x1), obst_x_left(x1), obst_y_high(y1), obst_y_low(y1), obst_x_right(x1), obst_x_left(x1), obst_y_high(y1), obst_y_low(y1),
hot(0), ctx(flow_ctx), nc(node_class), pos(flow_ctx, x1,y1), hot(0), ctx(flow_ctx), nc(node_class), pos(flow_ctx, x1,y1),
stored_pos(flow_ctx, x1, y1), stored_pos(flow_ctx, x1, y1),
highlight(0), inverse(0), trace_attr_type(flow_eTraceType_Boolean), highlight(0), dimmed(0), inverse(0), trace_attr_type(flow_eTraceType_Boolean),
trace_inverted(0), trace_p(NULL), user_data(0), trace_inverted(0), trace_p(NULL), user_data(0),
level(0), node_open(0), level(0), node_open(0),
relative_annot_pos(rel_annot_pos), relative_annot_x(0), relative_annot_pos(rel_annot_pos), relative_annot_x(0),
...@@ -424,7 +424,7 @@ void FlowNode::draw( int ll_x, int ll_y, int ur_x, int ur_y) ...@@ -424,7 +424,7 @@ void FlowNode::draw( int ll_x, int ll_y, int ur_x, int ur_y)
y_low * ctx->zoom_factor - ctx->offset_y <= ur_y) y_low * ctx->zoom_factor - ctx->offset_y <= ur_y)
{ {
if ( !inverse) if ( !inverse)
nc->draw( &pos, highlight, hot, (void *)this); nc->draw( &pos, highlight, dimmed, hot, (void *)this);
else else
draw_inverse(); draw_inverse();
} }
...@@ -447,7 +447,7 @@ void FlowNode::draw_inverse() ...@@ -447,7 +447,7 @@ void FlowNode::draw_inverse()
int( obst_x_right * ctx->zoom_factor - obst_x_left * ctx->zoom_factor), int( obst_x_right * ctx->zoom_factor - obst_x_left * ctx->zoom_factor),
int( obst_y_high * ctx->zoom_factor - obst_y_low * ctx->zoom_factor), int( obst_y_high * ctx->zoom_factor - obst_y_low * ctx->zoom_factor),
flow_eDrawType_Line); flow_eDrawType_Line);
nc->draw( &pos, highlight, hot, (void *)this); nc->draw( &pos, highlight, dimmed, hot, (void *)this);
} }
else { else {
ctx->fdraw->fill_rect( ctx, ctx->fdraw->fill_rect( ctx,
...@@ -531,7 +531,17 @@ void FlowNode::set_highlight( int on) ...@@ -531,7 +531,17 @@ void FlowNode::set_highlight( int on)
{ {
highlight = on; highlight = on;
if ( !inverse) if ( !inverse)
nc->draw( &pos, highlight, hot, (void *)this); nc->draw( &pos, highlight, dimmed, hot, (void *)this);
else
draw_inverse();
nc->nav_draw( &pos, highlight, (void *)this);
}
void FlowNode::set_dimmed( int on)
{
dimmed = on;
if ( !inverse)
nc->draw( &pos, highlight, dimmed, hot, (void *)this);
else else
draw_inverse(); draw_inverse();
nc->nav_draw( &pos, highlight, (void *)this); nc->nav_draw( &pos, highlight, (void *)this);
...@@ -545,7 +555,7 @@ void FlowNode::set_hot( int on) ...@@ -545,7 +555,7 @@ void FlowNode::set_hot( int on)
nc->erase( &pos, hot, (void *)this); nc->erase( &pos, hot, (void *)this);
hot = on; hot = on;
if ( !inverse) if ( !inverse)
nc->draw( &pos, highlight, hot, (void *)this); nc->draw( &pos, highlight, dimmed, hot, (void *)this);
else else
draw_inverse(); draw_inverse();
nc->nav_draw( &pos, highlight, (void *)this); nc->nav_draw( &pos, highlight, (void *)this);
...@@ -571,7 +581,7 @@ void FlowNode::set_inverse( int on) ...@@ -571,7 +581,7 @@ void FlowNode::set_inverse( int on)
int( obst_x_right * ctx->zoom_factor - obst_x_left * ctx->zoom_factor), int( obst_x_right * ctx->zoom_factor - obst_x_left * ctx->zoom_factor),
int( obst_y_high * ctx->zoom_factor - obst_y_low * ctx->zoom_factor), int( obst_y_high * ctx->zoom_factor - obst_y_low * ctx->zoom_factor),
flow_eDrawType_LineErase); flow_eDrawType_LineErase);
nc->draw( &pos, highlight, hot, (void *)this); nc->draw( &pos, highlight, dimmed, hot, (void *)this);
} }
else { else {
ctx->fdraw->fill_rect( ctx, ctx->fdraw->fill_rect( ctx,
...@@ -580,7 +590,7 @@ void FlowNode::set_inverse( int on) ...@@ -580,7 +590,7 @@ void FlowNode::set_inverse( int on)
int( x_r * ctx->zoom_factor - x_left * ctx->zoom_factor), int( x_r * ctx->zoom_factor - x_left * ctx->zoom_factor),
int( y_high * ctx->zoom_factor - y_low * ctx->zoom_factor + 1), int( y_high * ctx->zoom_factor - y_low * ctx->zoom_factor + 1),
flow_eDrawType_LineErase); flow_eDrawType_LineErase);
nc->draw( &pos, highlight, hot, (void *)this); nc->draw( &pos, highlight, dimmed, hot, (void *)this);
} }
} }
else else
...@@ -635,7 +645,7 @@ void FlowNode::set_annotation( int num, const char *text, int size, int nodraw) ...@@ -635,7 +645,7 @@ void FlowNode::set_annotation( int num, const char *text, int size, int nodraw)
relative_annot_x = 0; relative_annot_x = 0;
nc->configure_annotations( &pos, (void *)this); nc->configure_annotations( &pos, (void *)this);
if ( !inverse) if ( !inverse)
nc->draw( &pos, highlight, hot, (void *)this); nc->draw( &pos, highlight, dimmed, hot, (void *)this);
else else
draw_inverse(); draw_inverse();
} }
...@@ -715,7 +725,7 @@ void FlowNode::set_annot_pixmap( int num, flow_sAnnotPixmap *pixmap, ...@@ -715,7 +725,7 @@ void FlowNode::set_annot_pixmap( int num, flow_sAnnotPixmap *pixmap,
return; return;
if ( !inverse) if ( !inverse)
nc->draw( &pos, highlight, hot, (void *)this); nc->draw( &pos, highlight, dimmed, hot, (void *)this);
else else
draw_inverse(); draw_inverse();
nc->nav_draw( &pos, highlight, (void *)this); nc->nav_draw( &pos, highlight, (void *)this);
...@@ -736,7 +746,7 @@ void FlowNode::remove_annot_pixmap( int num) ...@@ -736,7 +746,7 @@ void FlowNode::remove_annot_pixmap( int num)
annotpixmapv[num] = 0; annotpixmapv[num] = 0;
if ( !inverse) if ( !inverse)
nc->draw( &pos, highlight, hot, (void *)this); nc->draw( &pos, highlight, dimmed, hot, (void *)this);
else else
draw_inverse(); draw_inverse();
nc->nav_draw( &pos, highlight, (void *)this); nc->nav_draw( &pos, highlight, (void *)this);
...@@ -751,7 +761,7 @@ void FlowNode::set_radiobutton( int num, int value, int nodraw) ...@@ -751,7 +761,7 @@ void FlowNode::set_radiobutton( int num, int value, int nodraw)
return; return;
if ( !inverse) if ( !inverse)
nc->draw( &pos, highlight, hot, (void *)this); nc->draw( &pos, highlight, dimmed, hot, (void *)this);
else else
draw_inverse(); draw_inverse();
nc->nav_draw( &pos, highlight, (void *)this); nc->nav_draw( &pos, highlight, (void *)this);
...@@ -865,7 +875,7 @@ int FlowNode::event_handler( flow_eEvent event, int x, int y) ...@@ -865,7 +875,7 @@ int FlowNode::event_handler( flow_eEvent event, int x, int y)
if ( redraw) if ( redraw)
{ {
if ( !inverse) if ( !inverse)
nc->draw( &pos, highlight, hot, (void *)this); nc->draw( &pos, highlight, dimmed, hot, (void *)this);
else else
draw_inverse(); draw_inverse();
} }
...@@ -1053,7 +1063,7 @@ void FlowNode::conpoint_select( int num) ...@@ -1053,7 +1063,7 @@ void FlowNode::conpoint_select( int num)
sel_conpoint1 = num; sel_conpoint1 = num;
else if ( sel_conpoint2 == -1) else if ( sel_conpoint2 == -1)
sel_conpoint2 = num; sel_conpoint2 = num;
nc->draw( &pos, highlight, hot, (void *)this); nc->draw( &pos, highlight, dimmed, hot, (void *)this);
} }
void FlowNode::conpoint_select_clear( int num) void FlowNode::conpoint_select_clear( int num)
...@@ -1061,12 +1071,12 @@ void FlowNode::conpoint_select_clear( int num) ...@@ -1061,12 +1071,12 @@ void FlowNode::conpoint_select_clear( int num)
if ( sel_conpoint1 == num) { if ( sel_conpoint1 == num) {
erase(); erase();
sel_conpoint1 = -1; sel_conpoint1 = -1;
nc->draw( &pos, highlight, hot, (void *)this); nc->draw( &pos, highlight, dimmed, hot, (void *)this);
} }
else if ( sel_conpoint2 == num) { else if ( sel_conpoint2 == num) {
erase(); erase();
sel_conpoint2 = -1; sel_conpoint2 = -1;
nc->draw( &pos, highlight, hot, (void *)this); nc->draw( &pos, highlight, dimmed, hot, (void *)this);
} }
} }
...@@ -1076,7 +1086,7 @@ void FlowNode::conpoint_select_clear() ...@@ -1076,7 +1086,7 @@ void FlowNode::conpoint_select_clear()
erase(); erase();
sel_conpoint1 = -1; sel_conpoint1 = -1;
sel_conpoint2 = -1; sel_conpoint2 = -1;
nc->draw( &pos, highlight, hot, (void *)this); nc->draw( &pos, highlight, dimmed, hot, (void *)this);
} }
} }
...@@ -1090,7 +1100,7 @@ void FlowNode::change_nodeclass( FlowNodeClass *new_nc) ...@@ -1090,7 +1100,7 @@ void FlowNode::change_nodeclass( FlowNodeClass *new_nc)
erase(); erase();
nc = new_nc; nc = new_nc;
if ( !inverse) if ( !inverse)
nc->draw( &pos, highlight, hot, (void *)this); nc->draw( &pos, highlight, dimmed, hot, (void *)this);
else else
draw_inverse(); draw_inverse();
} }
...@@ -88,6 +88,8 @@ class FlowNode : public FlowArrayElem { ...@@ -88,6 +88,8 @@ class FlowNode : public FlowArrayElem {
int delete_node_cons( void *node) {return 0;}; int delete_node_cons( void *node) {return 0;};
void set_highlight( int on); void set_highlight( int on);
int get_highlight() {return highlight;}; int get_highlight() {return highlight;};
void set_dimmed( int on);
int get_dimmed() {return dimmed;};
void set_inverse( int on); void set_inverse( int on);
int get_inverse() {return inverse;}; int get_inverse() {return inverse;};
void set_hot( int on); void set_hot( int on);
...@@ -120,6 +122,7 @@ class FlowNode : public FlowArrayElem { ...@@ -120,6 +122,7 @@ class FlowNode : public FlowArrayElem {
FlowPoint stored_pos; FlowPoint stored_pos;
flow_tName n_name; flow_tName n_name;
int highlight; int highlight;
int dimmed;
int inverse; int inverse;
char *annotv[10]; char *annotv[10];
int annotsize[10]; int annotsize[10];
......
...@@ -115,13 +115,13 @@ void FlowNodeClass::open( ifstream& fp) ...@@ -115,13 +115,13 @@ void FlowNodeClass::open( ifstream& fp)
} }
} }
void FlowNodeClass::draw( FlowPoint *pos, int highlight, int hot, void *node) void FlowNodeClass::draw( FlowPoint *pos, int highlight, int dimmed, int hot, void *node)
{ {
int i; int i;
for ( i = 0; i < a.a_size; i++) for ( i = 0; i < a.a_size; i++)
{ {
a.a[i]->draw( pos, highlight, hot, node); a.a[i]->draw( pos, highlight, dimmed, hot, node);
} }
} }
...@@ -145,7 +145,7 @@ void FlowNodeClass::draw_inverse( FlowPoint *pos, int hot, void *node) ...@@ -145,7 +145,7 @@ void FlowNodeClass::draw_inverse( FlowPoint *pos, int hot, void *node)
{ {
case flow_eObjectType_Radiobutton: case flow_eObjectType_Radiobutton:
case flow_eObjectType_Image: case flow_eObjectType_Image:
a.a[i]->draw( pos, 0, hot, node); a.a[i]->draw( pos, 0, 0, hot, node);
break; break;
default: default:
a.a[i]->draw_inverse( pos, hot, node); a.a[i]->draw_inverse( pos, hot, node);
...@@ -237,7 +237,7 @@ void FlowNodeClass::draw_annotation( void *pos, int highlight, int hot, ...@@ -237,7 +237,7 @@ void FlowNodeClass::draw_annotation( void *pos, int highlight, int hot,
if ( a.a[i]->type() == flow_eObjectType_Annot && if ( a.a[i]->type() == flow_eObjectType_Annot &&
((FlowAnnot *)a.a[i])->number == num) ((FlowAnnot *)a.a[i])->number == num)
{ {
a.a[i]->draw( pos, highlight, hot, node); a.a[i]->draw( pos, highlight, 0, hot, node);
a.a[i]->nav_draw( pos, highlight, node); a.a[i]->nav_draw( pos, highlight, node);
break; break;
} }
......
...@@ -64,7 +64,7 @@ class FlowNodeClass : public FlowArrayElem { ...@@ -64,7 +64,7 @@ class FlowNodeClass : public FlowArrayElem {
void save( ofstream& fp, flow_eSaveMode mode); void save( ofstream& fp, flow_eSaveMode mode);
void open( ifstream& fp); void open( ifstream& fp);
int load( char *filename); int load( char *filename);
void draw( FlowPoint *pos, int highlight, int hot, void *node); void draw( FlowPoint *pos, int highlight, int dimmed, int hot, void *node);
void nav_draw( FlowPoint *pos, int highlight, void *node); void nav_draw( FlowPoint *pos, int highlight, void *node);
void draw_inverse( FlowPoint *pos, int hot, void *node); void draw_inverse( FlowPoint *pos, int hot, void *node);
void erase( FlowPoint *pos, int hot, void *node); void erase( FlowPoint *pos, int hot, void *node);
......
...@@ -142,7 +142,7 @@ void FlowPixmap::open( ifstream& fp) ...@@ -142,7 +142,7 @@ void FlowPixmap::open( ifstream& fp)
#endif #endif
} }
void FlowPixmap::draw( void *pos, int highlight, int hot, void *node) void FlowPixmap::draw( void *pos, int highlight, int dimmed, int hot, void *node)
{ {
int idx = int( ctx->zoom_factor / ctx->base_zoom_factor * (pixmap_size + 4) - int idx = int( ctx->zoom_factor / ctx->base_zoom_factor * (pixmap_size + 4) -
4); 4);
...@@ -250,7 +250,7 @@ void FlowPixmap::get_borders( double pos_x, double pos_y, double *x_right, ...@@ -250,7 +250,7 @@ void FlowPixmap::get_borders( double pos_x, double pos_y, double *x_right,
*/ */
} }
void FlowPixmap::move( void *pos, double x, double y, int highlight, int hot) void FlowPixmap::move( void *pos, double x, double y, int highlight, int dimmed, int hot)
{ {
erase( pos, hot, NULL); erase( pos, hot, NULL);
...@@ -259,12 +259,12 @@ void FlowPixmap::move( void *pos, double x, double y, int highlight, int hot) ...@@ -259,12 +259,12 @@ void FlowPixmap::move( void *pos, double x, double y, int highlight, int hot)
p.y = y; p.y = y;
zoom(); zoom();
nav_zoom(); nav_zoom();
draw( pos, highlight, hot, NULL); draw( pos, highlight, dimmed, hot, NULL);
nav_draw( pos, highlight, NULL); nav_draw( pos, highlight, NULL);
} }
void FlowPixmap::shift( void *pos, double delta_x, double delta_y, void FlowPixmap::shift( void *pos, double delta_x, double delta_y,
int highlight, int hot) int highlight, int dimmed, int hot)
{ {
erase( pos, hot, NULL); erase( pos, hot, NULL);
nav_erase( pos, NULL); nav_erase( pos, NULL);
...@@ -273,7 +273,7 @@ void FlowPixmap::shift( void *pos, double delta_x, double delta_y, ...@@ -273,7 +273,7 @@ void FlowPixmap::shift( void *pos, double delta_x, double delta_y,
zoom(); zoom();
nav_zoom(); nav_zoom();
draw( pos, highlight, hot, NULL); draw( pos, highlight, dimmed, hot, NULL);
nav_draw( pos, highlight, NULL); nav_draw( pos, highlight, NULL);
} }
......
...@@ -62,14 +62,14 @@ class FlowPixmap : public FlowArrayElem { ...@@ -62,14 +62,14 @@ class FlowPixmap : public FlowArrayElem {
void print( void *pos, void *node, int highlight); void print( void *pos, void *node, int highlight);
void save( ofstream& fp, flow_eSaveMode mode); void save( ofstream& fp, flow_eSaveMode mode);
void open( ifstream& fp); void open( ifstream& fp);
void draw( void *pos, int highlight, int hot, void *node); void draw( void *pos, int highlight, int dimmed, int hot, void *node);
void nav_draw( void *pos, int highlight, void *node); void nav_draw( void *pos, int highlight, void *node);
void draw_inverse( void *pos, int hot, void *node); void draw_inverse( void *pos, int hot, void *node);
void erase( void *pos, int hot, void *node); void erase( void *pos, int hot, void *node);
void nav_erase( void *pos, void *node); void nav_erase( void *pos, void *node);
void move( void *pos, double x, double y, int highlight, int hot); void move( void *pos, double x, double y, int highlight, int dimmed, int hot);
void shift( void *pos, double delta_x, double delta_y, void shift( void *pos, double delta_x, double delta_y,
int highlight, int hot); int highlight, int dimmed, int hot);
void get_borders( double pos_x, double pos_y, double *x_right, void get_borders( double pos_x, double pos_y, double *x_right,
double *x_left, double *y_high, double *y_low, void *node); double *x_left, double *y_high, double *y_low, void *node);
int get_conpoint( int num, double *x, double *y, flow_eDirection *dir) int get_conpoint( int num, double *x, double *y, flow_eDirection *dir)
......
...@@ -69,9 +69,9 @@ void FlowPushButton::draw( int ll_x, int ll_y, int ur_x, int ur_y) ...@@ -69,9 +69,9 @@ void FlowPushButton::draw( int ll_x, int ll_y, int ur_x, int ur_y)
ctx->fdraw->rect( ctx, pos.z_x + r.ll.z_x, pos.z_y + r.ll.z_y, ctx->fdraw->rect( ctx, pos.z_x + r.ll.z_x, pos.z_y + r.ll.z_y,
r.ur.z_x - r.ll.z_x, r.ur.z_y - r.ll.z_y, r.draw_type, r.ur.z_x - r.ll.z_x, r.ur.z_y - r.ll.z_y, r.draw_type,
r.line_width-1, 0); r.line_width-1, 0, 0);
ctx->fdraw->text( ctx, pos.z_x + t.p.z_x, pos.z_y + t.p.z_y, t.text, ctx->fdraw->text( ctx, pos.z_x + t.p.z_x, pos.z_y + t.p.z_y, t.text,
strlen(t.text), t.draw_type, t.text_size, 0, 0, strlen(t.text), t.draw_type, t.text_size, 0, 0, 0,
ctx->zoom_factor / ctx->base_zoom_factor * (8+2*t.text_size)); ctx->zoom_factor / ctx->base_zoom_factor * (8+2*t.text_size));
} }
......
...@@ -115,7 +115,7 @@ void FlowRadiobutton::open( ifstream& fp) ...@@ -115,7 +115,7 @@ void FlowRadiobutton::open( ifstream& fp)
// Not yet implemented // Not yet implemented
} }
void FlowRadiobutton::draw( void *pos, int highlight, int hot, void *node) void FlowRadiobutton::draw( void *pos, int highlight, int dimmed, int hot, void *node)
{ {
int ll_x, ll_y, ur_x, ur_y; int ll_x, ll_y, ur_x, ur_y;
int idx = 0; int idx = 0;
...@@ -125,17 +125,17 @@ void FlowRadiobutton::draw( void *pos, int highlight, int hot, void *node) ...@@ -125,17 +125,17 @@ void FlowRadiobutton::draw( void *pos, int highlight, int hot, void *node)
ur_x = ll_x + ur.z_x - ll.z_x; ur_x = ll_x + ur.z_x - ll.z_x;
ur_y = ll_y + ur.z_y - ll.z_y; ur_y = ll_y + ur.z_y - ll.z_y;
ctx->fdraw->rect( ctx, ll_x, ll_y, ur_x - ll_x, ur_y - ll_y, ctx->fdraw->rect( ctx, ll_x, ll_y, ur_x - ll_x, ur_y - ll_y,
draw_type, idx, 0); draw_type, idx, 0, 0);
if ( ((FlowNode *)node)->rbuttonv[number]) if ( ((FlowNode *)node)->rbuttonv[number])
{ {
ctx->fdraw->line( ctx, ll_x + 1, ll_y + 1, ur_x - 1, ll_y + 1, ctx->fdraw->line( ctx, ll_x + 1, ll_y + 1, ur_x - 1, ll_y + 1,
flow_eDrawType_LineGray, idx, 0); flow_eDrawType_LineGray, idx, 0, 0);
ctx->fdraw->line( ctx, ll_x + 2, ll_y + 2, ur_x - 2, ll_y + 2, ctx->fdraw->line( ctx, ll_x + 2, ll_y + 2, ur_x - 2, ll_y + 2,
flow_eDrawType_LineGray, idx, 0); flow_eDrawType_LineGray, idx, 0, 0);
ctx->fdraw->line( ctx, ll_x + 1, ll_y + 1, ll_x + 1, ur_y - 1, ctx->fdraw->line( ctx, ll_x + 1, ll_y + 1, ll_x + 1, ur_y - 1,
flow_eDrawType_LineGray, idx, 0); flow_eDrawType_LineGray, idx, 0, 0);
ctx->fdraw->line( ctx, ll_x + 2, ll_y + 2, ll_x + 2, ur_y - 2, ctx->fdraw->line( ctx, ll_x + 2, ll_y + 2, ll_x + 2, ur_y - 2,
flow_eDrawType_LineGray, idx, 0); flow_eDrawType_LineGray, idx, 0, 0);
ctx->fdraw->line_erase( ctx, ur_x - 1, ur_y - 1, ll_x + 1, ur_y - 1, ctx->fdraw->line_erase( ctx, ur_x - 1, ur_y - 1, ll_x + 1, ur_y - 1,
idx); idx);
ctx->fdraw->line_erase( ctx, ur_x - 2, ur_y - 2, ll_x + 2, ur_y - 2, ctx->fdraw->line_erase( ctx, ur_x - 2, ur_y - 2, ll_x + 2, ur_y - 2,
...@@ -158,13 +158,13 @@ void FlowRadiobutton::draw( void *pos, int highlight, int hot, void *node) ...@@ -158,13 +158,13 @@ void FlowRadiobutton::draw( void *pos, int highlight, int hot, void *node)
ctx->fdraw->line_erase( ctx, ll_x + 2, ll_y + 2, ll_x + 2, ur_y - 2, ctx->fdraw->line_erase( ctx, ll_x + 2, ll_y + 2, ll_x + 2, ur_y - 2,
idx); idx);
ctx->fdraw->line( ctx, ur_x - 1, ur_y - 1, ll_x + 1, ur_y - 1, ctx->fdraw->line( ctx, ur_x - 1, ur_y - 1, ll_x + 1, ur_y - 1,
flow_eDrawType_LineGray, idx, 0); flow_eDrawType_LineGray, idx, 0, 0);
ctx->fdraw->line( ctx, ur_x - 2, ur_y - 2, ll_x + 2, ur_y - 2, ctx->fdraw->line( ctx, ur_x - 2, ur_y - 2, ll_x + 2, ur_y - 2,
flow_eDrawType_LineGray, idx, 0); flow_eDrawType_LineGray, idx, 0, 0);
ctx->fdraw->line( ctx, ur_x - 1, ur_y - 1, ur_x - 1, ll_y + 1, ctx->fdraw->line( ctx, ur_x - 1, ur_y - 1, ur_x - 1, ll_y + 1,
flow_eDrawType_LineGray, idx, 0); flow_eDrawType_LineGray, idx, 0, 0);
ctx->fdraw->line( ctx, ur_x - 2, ur_y - 2, ur_x - 2, ll_y + 2, ctx->fdraw->line( ctx, ur_x - 2, ur_y - 2, ur_x - 2, ll_y + 2,
flow_eDrawType_LineGray, idx, 0); flow_eDrawType_LineGray, idx, 0, 0);
ctx->fdraw->fill_rect( ctx, ll_x + 3, ll_y + 3, ur_x - ll_x - 5, ctx->fdraw->fill_rect( ctx, ll_x + 3, ll_y + 3, ur_x - ll_x - 5,
ur_y - ll_y - 5, flow_eDrawType_LineErase); ur_y - ll_y - 5, flow_eDrawType_LineErase);
} }
...@@ -273,7 +273,7 @@ void FlowRadiobutton::get_borders( double pos_x, double pos_y, double *x_right, ...@@ -273,7 +273,7 @@ void FlowRadiobutton::get_borders( double pos_x, double pos_y, double *x_right,
*y_high = pos_y + ur.y; *y_high = pos_y + ur.y;
} }
void FlowRadiobutton::move( void *pos, double x, double y, int highlight, int hot) void FlowRadiobutton::move( void *pos, double x, double y, int highlight, int dimmed, int hot)
{ {
double width, height; double width, height;
...@@ -287,12 +287,12 @@ void FlowRadiobutton::move( void *pos, double x, double y, int highlight, int ho ...@@ -287,12 +287,12 @@ void FlowRadiobutton::move( void *pos, double x, double y, int highlight, int ho
ur.y = y + height; ur.y = y + height;
zoom(); zoom();
nav_zoom(); nav_zoom();
draw( pos, highlight, hot, NULL); draw( pos, highlight, dimmed, hot, NULL);
nav_draw( pos, highlight, NULL); nav_draw( pos, highlight, NULL);
} }
void FlowRadiobutton::shift( void *pos, double delta_x, double delta_y, void FlowRadiobutton::shift( void *pos, double delta_x, double delta_y,
int highlight, int hot) int highlight, int dimmed, int hot)
{ {
erase( pos, hot, NULL); erase( pos, hot, NULL);
nav_erase( pos, NULL); nav_erase( pos, NULL);
...@@ -303,7 +303,7 @@ void FlowRadiobutton::shift( void *pos, double delta_x, double delta_y, ...@@ -303,7 +303,7 @@ void FlowRadiobutton::shift( void *pos, double delta_x, double delta_y,
zoom(); zoom();
nav_zoom(); nav_zoom();
draw( pos, highlight, hot, NULL); draw( pos, highlight, dimmed, hot, NULL);
nav_draw( pos, highlight, NULL); nav_draw( pos, highlight, NULL);
} }
......
...@@ -64,7 +64,7 @@ class FlowRadiobutton : public FlowArrayElem { ...@@ -64,7 +64,7 @@ class FlowRadiobutton : public FlowArrayElem {
void print( void *pos, void *node, int highlight); void print( void *pos, void *node, int highlight);
void save( ofstream& fp, flow_eSaveMode mode); void save( ofstream& fp, flow_eSaveMode mode);
void open( ifstream& fp); void open( ifstream& fp);
void draw( void *pos, int hightlight, int hot, void *node); void draw( void *pos, int hightlight, int dimmed, int hot, void *node);
void nav_draw( void *pos, int highlight, void *node); void nav_draw( void *pos, int highlight, void *node);
void draw_inverse( void *pos, int hot, void *node) void draw_inverse( void *pos, int hot, void *node)
{ erase( pos, hot, node);}; { erase( pos, hot, node);};
...@@ -72,9 +72,9 @@ class FlowRadiobutton : public FlowArrayElem { ...@@ -72,9 +72,9 @@ class FlowRadiobutton : public FlowArrayElem {
void nav_erase( void *pos, void *node); void nav_erase( void *pos, void *node);
void get_borders( double pos_x, double pos_y, double *x_right, void get_borders( double pos_x, double pos_y, double *x_right,
double *x_left, double *y_high, double *y_low, void *node); double *x_left, double *y_high, double *y_low, void *node);
void move( void *pos, double x, double y, int highlight, int hot); void move( void *pos, double x, double y, int highlight, int dimmed, int hot);
void shift( void *pos, double delta_x, double delta_y, void shift( void *pos, double delta_x, double delta_y,
int highlight, int hot); int highlight, int dimmed, int hot);
int get_conpoint( int num, double *x, double *y, flow_eDirection *dir) int get_conpoint( int num, double *x, double *y, flow_eDirection *dir)
{ return 0;}; { return 0;};
flow_eObjectType type() { return flow_eObjectType_Radiobutton;}; flow_eObjectType type() { return flow_eObjectType_Radiobutton;};
......
...@@ -138,12 +138,12 @@ void FlowRect::draw_inverse( void *pos, int hot, void *node) ...@@ -138,12 +138,12 @@ void FlowRect::draw_inverse( void *pos, int hot, void *node)
draw_type == flow_eDrawType_Green || draw_type == flow_eDrawType_Green ||
draw_type == flow_eDrawType_DarkGray || draw_type == flow_eDrawType_DarkGray ||
draw_type == flow_eDrawType_Yellow)) draw_type == flow_eDrawType_Yellow))
draw( pos, hot, 0, node); draw( pos, 0, 0, hot, node);
else else
erase( pos, hot, node); erase( pos, hot, node);
} }
void FlowRect::draw( void *pos, int highlight, int hot, void *node) void FlowRect::draw( void *pos, int highlight, int dimmed, int hot, void *node)
{ {
if ( !(display_level & ctx->display_level)) if ( !(display_level & ctx->display_level))
return; return;
...@@ -168,7 +168,7 @@ void FlowRect::draw( void *pos, int highlight, int hot, void *node) ...@@ -168,7 +168,7 @@ void FlowRect::draw( void *pos, int highlight, int hot, void *node)
if ( !fill) if ( !fill)
ctx->fdraw->rect( ctx, ll.z_x + ((FlowPoint *)pos)->z_x - ctx->offset_x, ll.z_y + ctx->fdraw->rect( ctx, ll.z_x + ((FlowPoint *)pos)->z_x - ctx->offset_x, ll.z_y +
((FlowPoint *)pos)->z_y - ctx->offset_y, ((FlowPoint *)pos)->z_y - ctx->offset_y,
ur.z_x - ll.z_x, ur.z_y - ll.z_y, draw_type, idx, highlight); ur.z_x - ll.z_x, ur.z_y - ll.z_y, draw_type, idx, highlight, dimmed);
else { else {
flow_eDrawType dtype; flow_eDrawType dtype;
if ( node && ((FlowNode *)node)->fill_color != flow_eDrawType_Inherit) if ( node && ((FlowNode *)node)->fill_color != flow_eDrawType_Inherit)
...@@ -290,7 +290,7 @@ void FlowRect::get_borders( double pos_x, double pos_y, double *x_right, ...@@ -290,7 +290,7 @@ void FlowRect::get_borders( double pos_x, double pos_y, double *x_right,
*y_high = pos_y + ur.y; *y_high = pos_y + ur.y;
} }
void FlowRect::move( void *pos, double x, double y, int highlight, int hot) void FlowRect::move( void *pos, double x, double y, int highlight, int dimmed, int hot)
{ {
double width, height; double width, height;
...@@ -304,12 +304,12 @@ void FlowRect::move( void *pos, double x, double y, int highlight, int hot) ...@@ -304,12 +304,12 @@ void FlowRect::move( void *pos, double x, double y, int highlight, int hot)
ur.y = y + height; ur.y = y + height;
zoom(); zoom();
nav_zoom(); nav_zoom();
draw( pos, highlight, hot, NULL); draw( pos, highlight, dimmed, hot, NULL);
nav_draw( pos, highlight, NULL); nav_draw( pos, highlight, NULL);
} }
void FlowRect::shift( void *pos, double delta_x, double delta_y, void FlowRect::shift( void *pos, double delta_x, double delta_y,
int highlight, int hot) int highlight, int dimmed, int hot)
{ {
erase( pos, hot, NULL); erase( pos, hot, NULL);
nav_erase( pos, NULL); nav_erase( pos, NULL);
...@@ -320,7 +320,7 @@ void FlowRect::shift( void *pos, double delta_x, double delta_y, ...@@ -320,7 +320,7 @@ void FlowRect::shift( void *pos, double delta_x, double delta_y,
zoom(); zoom();
nav_zoom(); nav_zoom();
draw( pos, highlight, hot, NULL); draw( pos, highlight, dimmed, hot, NULL);
nav_draw( pos, highlight, NULL); nav_draw( pos, highlight, NULL);
} }
......
...@@ -66,16 +66,16 @@ class FlowRect : public FlowArrayElem { ...@@ -66,16 +66,16 @@ class FlowRect : public FlowArrayElem {
void print( void *pos, void *node, int highlight); void print( void *pos, void *node, int highlight);
void save( ofstream& fp, flow_eSaveMode mode); void save( ofstream& fp, flow_eSaveMode mode);
void open( ifstream& fp); void open( ifstream& fp);
void draw( void *pos, int hightlight, int hot, void *node); void draw( void *pos, int hightlight, int dimmed, int hot, void *node);
void nav_draw( void *pos, int highlight, void *node); void nav_draw( void *pos, int highlight, void *node);
void draw_inverse( void *pos, int hot, void *node); void draw_inverse( void *pos, int hot, void *node);
void erase( void *pos, int hot, void *node); void erase( void *pos, int hot, void *node);
void nav_erase( void *pos, void *node); void nav_erase( void *pos, void *node);
void get_borders( double pos_x, double pos_y, double *x_right, void get_borders( double pos_x, double pos_y, double *x_right,
double *x_left, double *y_high, double *y_low, void *node); double *x_left, double *y_high, double *y_low, void *node);
void move( void *pos, double x, double y, int highlight, int hot); void move( void *pos, double x, double y, int highlight, int dimmed, int hot);
void shift( void *pos, double delta_x, double delta_y, void shift( void *pos, double delta_x, double delta_y,
int highlight, int hot); int highlight, int dimmed, int hot);
int get_conpoint( int num, double *x, double *y, flow_eDirection *dir) int get_conpoint( int num, double *x, double *y, flow_eDirection *dir)
{ return 0;}; { return 0;};
flow_eObjectType type() { return flow_eObjectType_Rect;}; flow_eObjectType type() { return flow_eObjectType_Rect;};
......
...@@ -115,7 +115,7 @@ void FlowText::open( ifstream& fp) ...@@ -115,7 +115,7 @@ void FlowText::open( ifstream& fp)
} }
} }
void FlowText::draw( void *pos, int highlight, int hot, void *node) void FlowText::draw( void *pos, int highlight, int dimmed, int hot, void *node)
{ {
int idx = int( ctx->zoom_factor / ctx->base_zoom_factor * (text_size +4) - 4); int idx = int( ctx->zoom_factor / ctx->base_zoom_factor * (text_size +4) - 4);
if ( idx < 0) if ( idx < 0)
...@@ -123,7 +123,7 @@ void FlowText::draw( void *pos, int highlight, int hot, void *node) ...@@ -123,7 +123,7 @@ void FlowText::draw( void *pos, int highlight, int hot, void *node)
idx = MIN( idx, DRAW_TYPE_SIZE-1); idx = MIN( idx, DRAW_TYPE_SIZE-1);
ctx->fdraw->text( ctx, p.z_x + ((FlowPoint *)pos)->z_x - ctx->offset_x, ctx->fdraw->text( ctx, p.z_x + ((FlowPoint *)pos)->z_x - ctx->offset_x,
p.z_y + ((FlowPoint *)pos)->z_y - ctx->offset_y, text, strlen(text), p.z_y + ((FlowPoint *)pos)->z_y - ctx->offset_y, text, strlen(text),
draw_type, idx, highlight, 0, draw_type, idx, highlight, dimmed, 0,
ctx->zoom_factor / ctx->base_zoom_factor * (8+2*text_size)); ctx->zoom_factor / ctx->base_zoom_factor * (8+2*text_size));
} }
...@@ -221,7 +221,7 @@ void FlowText::get_borders( double pos_x, double pos_y, double *x_right, ...@@ -221,7 +221,7 @@ void FlowText::get_borders( double pos_x, double pos_y, double *x_right,
*/ */
} }
void FlowText::move( void *pos, double x, double y, int highlight, int hot) void FlowText::move( void *pos, double x, double y, int highlight, int dimmed, int hot)
{ {
erase( pos, hot, NULL); erase( pos, hot, NULL);
...@@ -230,12 +230,12 @@ void FlowText::move( void *pos, double x, double y, int highlight, int hot) ...@@ -230,12 +230,12 @@ void FlowText::move( void *pos, double x, double y, int highlight, int hot)
p.y = y; p.y = y;
zoom(); zoom();
nav_zoom(); nav_zoom();
draw( pos, highlight, hot, NULL); draw( pos, highlight, dimmed, hot, NULL);
nav_draw( pos, highlight, NULL); nav_draw( pos, highlight, NULL);
} }
void FlowText::shift( void *pos, double delta_x, double delta_y, void FlowText::shift( void *pos, double delta_x, double delta_y,
int highlight, int hot) int highlight, int dimmed, int hot)
{ {
erase( pos, hot, NULL); erase( pos, hot, NULL);
nav_erase( pos, NULL); nav_erase( pos, NULL);
...@@ -244,7 +244,7 @@ void FlowText::shift( void *pos, double delta_x, double delta_y, ...@@ -244,7 +244,7 @@ void FlowText::shift( void *pos, double delta_x, double delta_y,
zoom(); zoom();
nav_zoom(); nav_zoom();
draw( pos, highlight, hot, NULL); draw( pos, highlight, dimmed, hot, NULL);
nav_draw( pos, highlight, NULL); nav_draw( pos, highlight, NULL);
} }
......
...@@ -61,14 +61,14 @@ class FlowText : public FlowArrayElem { ...@@ -61,14 +61,14 @@ class FlowText : public FlowArrayElem {
void print( void *pos, void *node, int highlight); void print( void *pos, void *node, int highlight);
void save( ofstream& fp, flow_eSaveMode mode); void save( ofstream& fp, flow_eSaveMode mode);
void open( ifstream& fp); void open( ifstream& fp);
void draw( void *pos, int highlight, int hot, void *node); void draw( void *pos, int highlight, int dimmed, int hot, void *node);
void nav_draw( void *pos, int highlight, void *node); void nav_draw( void *pos, int highlight, void *node);
void draw_inverse( void *pos, int hot, void *node); void draw_inverse( void *pos, int hot, void *node);
void erase( void *pos, int hot, void *node); void erase( void *pos, int hot, void *node);
void nav_erase( void *pos, void *node); void nav_erase( void *pos, void *node);
void move( void *pos, double x, double y, int highlight, int hot); void move( void *pos, double x, double y, int highlight, int dimmed, int hot);
void shift( void *pos, double delta_x, double delta_y, void shift( void *pos, double delta_x, double delta_y,
int highlight, int hot); int highlight, int dimmed, int hot);
void get_borders( double pos_x, double pos_y, double *x_right, void get_borders( double pos_x, double pos_y, double *x_right,
double *x_left, double *y_high, double *y_low, void *node); double *x_left, double *y_high, double *y_low, void *node);
int get_conpoint( int num, double *x, double *y, flow_eDirection *dir) int get_conpoint( int num, double *x, double *y, flow_eDirection *dir)
......
...@@ -129,13 +129,13 @@ void FlowTipText::draw() ...@@ -129,13 +129,13 @@ void FlowTipText::draw()
ctx->fdraw->fill_rect( ctx, text_x, text_y, text_width, text_height, ctx->fdraw->fill_rect( ctx, text_x, text_y, text_width, text_height,
flow_eDrawType_LineErase); flow_eDrawType_LineErase);
ctx->fdraw->rect( ctx, text_x, text_y, text_width, text_height, ctx->fdraw->rect( ctx, text_x, text_y, text_width, text_height,
flow_eDrawType_Line, 0, 0); flow_eDrawType_Line, 0, 0, 0);
int y = text_y + 4 + (text_height-4)/tiptext_rows; int y = text_y + 4 + (text_height-4)/tiptext_rows;
for ( int i = 0; i < tiptext_rows; i++) { for ( int i = 0; i < tiptext_rows; i++) {
ctx->fdraw->text( ctx, text_x + 6, y - text_descent - 2, ctx->fdraw->text( ctx, text_x + 6, y - text_descent - 2,
tiptext[i], strlen(tiptext[i]), flow_eDrawType_TextHelvetica, text_size, tiptext[i], strlen(tiptext[i]), flow_eDrawType_TextHelvetica, text_size,
0, 0, ctx->zoom_factor / ctx->base_zoom_factor * (8+2*text_size)); 0, 0, 0, ctx->zoom_factor / ctx->base_zoom_factor * (8+2*text_size));
y += (text_height-3)/tiptext_rows; y += (text_height-3)/tiptext_rows;
} }
......
...@@ -273,6 +273,63 @@ int RtTrace::disconnect_bc( flow_tObject object) ...@@ -273,6 +273,63 @@ int RtTrace::disconnect_bc( flow_tObject object)
return 1; return 1;
} }
int RtTrace::scan_bc( flow_tObject object, void *trace_p)
{
flow_tTraceObj trace_object;
flow_tTraceAttr trace_attribute;
flow_eTraceType trace_attr_type;
int trace_inverted;
int highlight;
int on;
char txt[80];
pwr_tSubid *subid_p;
pwr_tStatus sts;
pwr_tBoolean old;
int dimmed;
if ( flow_GetObjectType( object) == flow_eObjectType_Node) {
flow_GetTraceAttr( object, trace_object, trace_attribute, &trace_attr_type, &trace_inverted);
flow_GetHighlight( object, &highlight);
switch( trace_attr_type) {
case flow_eTraceType_Boolean:
on = trace_inverted ? *(unsigned int *) trace_p == 0 : *(unsigned int *) trace_p != 0;
if ( highlight != on)
flow_SetHighlight( object, on);
if ( flow_GetNodeGroup( object) == flow_eNodeGroup_Trace) {
sprintf( txt, "%d", *(unsigned int *) trace_p);
flow_SetAnnotation( object, 0, txt, strlen(txt));
}
break;
case flow_eTraceType_Int32:
sprintf( txt, "%d", *(unsigned int *) trace_p);
flow_SetAnnotation( object, 0, txt, strlen(txt));
break;
case flow_eTraceType_Float32:
sprintf( txt, "%f", *(float *) trace_p);
flow_SetAnnotation( object, 0, txt, strlen(txt));
break;
default:
break;
}
if ( !( strcmp( trace_object, "") == 0 || strcmp( trace_attribute, "") == 0)) {
flow_GetUserData( object, (void **) &subid_p);
if ( subid_p) {
sts = gdh_GetSubscriptionOldness( *subid_p, &old, 0, 0);
if ( ODD(sts)) {
flow_GetDimmed( object, &dimmed);
if ( (int)old != dimmed)
flow_SetDimmed( object, old);
}
}
}
}
return 1;
}
void RtTrace::trace_scan( void *data) void RtTrace::trace_scan( void *data)
{ {
...@@ -1285,7 +1342,7 @@ int RtTrace::trace_start() ...@@ -1285,7 +1342,7 @@ int RtTrace::trace_start()
flow_ResetHighlightAll( flow_ctx); flow_ResetHighlightAll( flow_ctx);
flow_SelectClear( flow_ctx); flow_SelectClear( flow_ctx);
sts = flow_TraceInit( flow_ctx, connect_bc, disconnect_bc, NULL); sts = flow_TraceInit( flow_ctx, connect_bc, disconnect_bc, scan_bc);
if ( EVEN(sts)) if ( EVEN(sts))
return sts; return sts;
trace_started = 1; trace_started = 1;
...@@ -1323,6 +1380,7 @@ int RtTrace::trace_stop() ...@@ -1323,6 +1380,7 @@ int RtTrace::trace_stop()
if ( trace_started) { if ( trace_started) {
flow_TraceClose( flow_ctx); flow_TraceClose( flow_ctx);
flow_ResetHighlightAll( flow_ctx); flow_ResetHighlightAll( flow_ctx);
flow_ResetDimmedAll( flow_ctx);
flow_SelectClear( flow_ctx); flow_SelectClear( flow_ctx);
flow_RemoveTraceObjects( flow_ctx); flow_RemoveTraceObjects( flow_ctx);
trace_started = 0; trace_started = 0;
......
...@@ -145,6 +145,7 @@ class RtTrace { ...@@ -145,6 +145,7 @@ class RtTrace {
static int connect_bc( flow_tObject object, char *name, char *attr, static int connect_bc( flow_tObject object, char *name, char *attr,
flow_eTraceType type, void **p); flow_eTraceType type, void **p);
static int disconnect_bc( flow_tObject object); static int disconnect_bc( flow_tObject object);
static int scan_bc( flow_tObject object, void *p);
static void trace_scan( void *data); static void trace_scan( void *data);
static int init_flow( FlowCtx *ctx, void *client_data); static int init_flow( FlowCtx *ctx, void *client_data);
static int flow_cb( FlowCtx *ctx, flow_tEvent event); static int flow_cb( FlowCtx *ctx, flow_tEvent event);
......
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