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,
}
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 ( 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;
else if ( highlight)
gc_type = flow_eDrawType(gc_type + 1);
gdk_draw_rectangle( window,
gcs[gc_type+highlight][idx], 0,
gcs[gc_type][idx], 0,
x, y, width, height);
return 1;
}
......@@ -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 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 ( 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;
else if ( highlight)
gc_type = flow_eDrawType(gc_type + 1);
gdk_draw_arc( window,
gcs[gc_type+highlight][idx], 0,
gcs[gc_type][idx], 0,
x, y, width, height, angle1*64, angle2*64);
return 1;
}
......@@ -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,
flow_eDrawType gc_type, int idx, int highlight)
flow_eDrawType gc_type, int idx, int highlight, int dimmed)
{
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;
else if ( highlight)
gc_type = flow_eDrawType(gc_type + 1);
gdk_draw_line( window,
gcs[gc_type+highlight][idx],
gcs[gc_type][idx],
x1, y1, x2, y2);
return 1;
}
......@@ -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,
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;
PangoRenderer *pr = gdk_pango_renderer_get_default( screen);
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]);
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,
pango_font_description_free( desc);
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;
}
......@@ -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,
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 ( 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);
......
......@@ -88,7 +88,7 @@ class FlowDrawGtk : public FlowDraw {
void set_nav_window_size( FlowCtx *ctx, 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 idx);
int nav_rect( FlowCtx *ctx, int x, int y, int width, int height,
......@@ -109,7 +109,7 @@ class FlowDrawGtk : public FlowDraw {
int idx);
int arc( FlowCtx *ctx, int x, int y, int width, int height,
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 angle1, int angle2,
int idx);
......@@ -120,7 +120,7 @@ class FlowDrawGtk : public FlowDraw {
int angle1, int angle2,
int idx);
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 idx);
int nav_line( FlowCtx *ctx, int x1, int y1, int x2, int y2,
......@@ -128,7 +128,7 @@ class FlowDrawGtk : public FlowDraw {
int nav_line_erase( FlowCtx *ctx, int x1, int y1, int x2, int y2,
int idx);
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,
flow_eDrawType gc_type, int idx, int line, double size);
int text_erase( FlowCtx *ctx, int x, int y, char *text, int len,
......@@ -198,7 +198,7 @@ class FlowDrawGtk : public FlowDraw {
flow_tPixmap *im_pixmap, flow_tPixmap *im_mask,
flow_tPixmap *im_nav_pixmap, flow_tPixmap *im_nav_mask);
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,
flow_eDrawType gc_type, int idx, int line, double size);
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,
}
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 ( 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;
else if ( highlight)
gc_type++;
XDrawRectangle( display, window,
gcs[gc_type+highlight][idx],
gcs[gc_type][idx],
x, y, width, height);
return 1;
}
......@@ -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 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 ( 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;
else if ( highlight)
gc_type++;
XDrawArc( display, window,
gcs[gc_type+highlight][idx],
gcs[gc_type][idx],
x, y, width, height, angle1*64, angle2*64);
return 1;
}
......@@ -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,
flow_eDrawType gc_type, int idx, int highlight)
flow_eDrawType gc_type, int idx, int highlight, int dimmed)
{
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;
else if ( highlight)
gc_type++;
XDrawLine( display, window,
gcs[gc_type+highlight][idx],
gcs[gc_type][idx],
x1, y1, x2, y2);
return 1;
}
......@@ -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,
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;
......
......@@ -111,7 +111,7 @@ class FlowDrawXLib : public FlowDraw {
void set_nav_window_size( FlowCtx *ctx, 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 idx);
int nav_rect( FlowCtx *ctx, int x, int y, int width, int height,
......@@ -132,7 +132,7 @@ class FlowDrawXLib : public FlowDraw {
int idx);
int arc( FlowCtx *ctx, int x, int y, int width, int height,
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 angle1, int angle2,
int idx);
......@@ -143,7 +143,7 @@ class FlowDrawXLib : public FlowDraw {
int angle1, int angle2,
int idx);
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 idx);
int nav_line( FlowCtx *ctx, int x1, int y1, int x2, int y2,
......@@ -151,7 +151,7 @@ class FlowDrawXLib : public FlowDraw {
int nav_line_erase( FlowCtx *ctx, int x1, int y1, int x2, int y2,
int idx);
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,
flow_eDrawType gc_type, int idx, int line, double size);
int text_inverse( FlowCtx *ctx, int x, int y, char *text, int len,
......
......@@ -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;
......@@ -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,
((FlowNode *) node)->annotv[number],
strlen(((FlowNode *) node)->annotv[number]), draw_type, idx,
highlight, 0,
highlight, dimmed, 0,
tsize(text_size));
if ( ((FlowNode *) node)->annotv_inputmode[number])
ctx->fdraw->move_input( ctx,
......@@ -234,7 +234,7 @@ void FlowAnnot::draw( void *pos, int highlight, int hot, void *node)
if ( len) {
*s = 0;
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));
*s = 10;
}
......@@ -247,7 +247,7 @@ void FlowAnnot::draw( void *pos, int highlight, int hot, void *node)
}
if ( len)
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));
break;
}
......
......@@ -65,7 +65,7 @@ class FlowAnnot : public FlowArrayElem {
void print( void *pos, void *node, int highlight);
void save( ofstream& fp, flow_eSaveMode mode);
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 draw_inverse( void *pos, int hot, void *node);
void erase( void *pos, int hot, void *node);
......
......@@ -149,7 +149,7 @@ void FlowAnnotPixmap::open( ifstream& fp)
#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;
......@@ -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);
nav_erase( pos, NULL);
......@@ -315,12 +315,12 @@ void FlowAnnotPixmap::move( void *pos, double x, double y, int highlight, int ho
p.y = y;
zoom();
nav_zoom();
draw( pos, highlight, hot, NULL);
draw( pos, highlight, dimmed, hot, NULL);
nav_draw( pos, highlight, NULL);
}
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);
nav_erase( pos, NULL);
......@@ -329,7 +329,7 @@ void FlowAnnotPixmap::shift( void *pos, double delta_x, double delta_y,
zoom();
nav_zoom();
draw( pos, highlight, hot, NULL);
draw( pos, highlight, dimmed, hot, NULL);
nav_draw( pos, highlight, NULL);
}
......
......@@ -62,14 +62,14 @@ class FlowAnnotPixmap : public FlowArrayElem {
void print( void *pos, void *node, int highlight);
void save( ofstream& fp, flow_eSaveMode mode);
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 draw_inverse( void *pos, int hot, void *node);
void erase( void *pos, int hot, 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,
int highlight, int hot);
int highlight, int dimmed, int hot);
void get_borders( double pos_x, double pos_y, double *x_right,
double *x_left, double *y_high, double *y_low, void *node);
int get_conpoint( int num, double *x, double *y, flow_eDirection *dir)
......
......@@ -105,6 +105,11 @@ void flow_ResetHighlightAll( flow_tCtx ctx)
ctx->set_highlight( 0);
}
void flow_ResetDimmedAll( flow_tCtx ctx)
{
ctx->set_dimmed( 0);
}
void flow_ResetInverseAll( flow_tCtx ctx)
{
ctx->set_inverse( 0);
......@@ -185,6 +190,16 @@ void flow_GetHighlight( flow_tObject object, int *value)
*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)
{
((FlowArrayElem *) object)->set_inverse( value);
......
......@@ -109,6 +109,7 @@ void flow_DeleteNode( flow_tNode node);
void flow_DeleteConnection( flow_tCon con);
int flow_FindSelectedObject( flow_tCtx ctx, flow_tObject object);
void flow_ResetHighlightAll( flow_tCtx ctx);
void flow_ResetDimmedAll( flow_tCtx ctx);
void flow_ResetInverseAll( flow_tCtx ctx);
void flow_SetSelectHighlight( flow_tCtx ctx);
void flow_ResetSelectHighlight( flow_tCtx ctx);
......@@ -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_SetHighlight( 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_CreateNode( flow_tCtx ctx, const char *name, flow_tNodeClass nc,
double x, double y, void *user_data, flow_tNode *node);
......
......@@ -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);
idx += hot;
......@@ -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,
ll.z_y + ((FlowPoint *)pos)->z_y - ctx->offset_y,
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)
......@@ -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,
int ang1, int ang2, int highlight, int hot)
int ang1, int ang2, int highlight, int dimmed, int hot)
{
erase( pos, hot, NULL);
nav_erase( pos, NULL);
......@@ -210,12 +210,12 @@ void FlowArc::move( void *pos, double x1, double y1, double x2, double y2,
angle2 = ang2;
zoom();
nav_zoom();
draw( pos, highlight, hot, NULL);
draw( pos, highlight, dimmed, hot, NULL);
nav_draw( pos, highlight, NULL);
}
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);
nav_erase( pos, NULL);
......@@ -226,7 +226,7 @@ void FlowArc::shift( void *pos, double delta_x, double delta_y,
zoom();
nav_zoom();
draw( pos, highlight, hot, NULL);
draw( pos, highlight, dimmed, hot, NULL);
nav_draw( pos, highlight, NULL);
}
......
......@@ -65,7 +65,7 @@ class FlowArc : public FlowArrayElem {
void print( void *pos, void *node, int highlight);
void save( ofstream& fp, flow_eSaveMode mode);
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 erase( void *pos, int hot, void *node);
void draw_inverse( void *pos, int hot, void *node)
......@@ -74,9 +74,9 @@ class FlowArc : public FlowArrayElem {
void get_borders( double pos_x, double pos_y, double *x_right,
double *x_left, double *y_high, double *y_low, void *node);
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,
int highlight, int hot);
int highlight, int dimmed, int hot);
int get_conpoint( int num, double *x, double *y, flow_eDirection *dir)
{ return 0;};
flow_eObjectType type() { return flow_eObjectType_Arc;};
......
......@@ -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;
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)
}
}
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)
{
int i;
......@@ -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;
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 {
void print( void *pos, void *node, int highlight);
void save( ofstream& fp, flow_eSaveMode mode);
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 draw_inverse( void *pos, int hot, void *node);
void nav_draw( void *pos, int highlight, void *node);
......@@ -82,10 +82,11 @@ class FlowArray {
void **cp);
int get_conpoint( int num, double *x, double *y, flow_eDirection *dir);
void set_highlight( int on);
void set_dimmed( int on);
void set_hot( int on);
void select_region_insert( double ll_x, double ll_y, double ur_x,
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);
void move( 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 {
virtual void open( ifstream& fp) {};
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( 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( 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_noerase( int delta_x, int delta_y, int grid) {};
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( void *pos, int highlight, void *node) {};
virtual void nav_erase() {};
......@@ -84,6 +84,8 @@ class FlowArrayElem {
virtual int delete_node_cons( void *node) {return 0;};
virtual void set_highlight( int on) {};
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_hot( int on) {};
virtual void select_region_insert( double ll_x, double ll_y, double ur_x,
......
......@@ -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);
idx += hot;
......@@ -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,
int highlight, int hot)
int highlight, int dimmed, int hot)
{
erase( pos, hot, NULL);
nav_erase( pos, NULL);
......@@ -301,12 +301,12 @@ void FlowArrow::move( void *pos, double x1, double y1, double x2, double y2,
p_dest.y = y2;
zoom();
nav_zoom();
draw( pos, highlight, hot, NULL);
draw( pos, highlight, dimmed, hot, NULL);
nav_draw( pos, highlight, NULL);
}
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);
nav_erase( pos, NULL);
......@@ -319,7 +319,7 @@ void FlowArrow::shift( void *pos, double delta_x, double delta_y,
zoom();
nav_zoom();
draw( pos, highlight, hot, NULL);
draw( pos, highlight, dimmed, hot, NULL);
nav_draw( pos, highlight, NULL);
}
......
......@@ -59,7 +59,7 @@ class FlowArrow : public FlowArrayElem {
void print( void *pos, void *node, int highlight);
void save( ofstream& fp, flow_eSaveMode mode);
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 erase( void *pos, int hot, void *node);
void draw_inverse( void *pos, int hot, void *node)
......@@ -72,9 +72,9 @@ class FlowArrow : public FlowArrayElem {
{ return 0;};
flow_eObjectType type() { return flow_eObjectType_Arrow;};
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);
int highlight, int dimmed, int hot);
FlowCtx *ctx;
FlowPoint p_dest;
FlowPoint p1;
......
......@@ -125,7 +125,7 @@ FlowCon::FlowCon( FlowCtx *flow_ctx, const char *name, FlowConClass *con_class,
ctx(flow_ctx), cc(con_class),
source_node(source), dest_node(dest), source_conpoint(source_cp),
dest_conpoint(dest_cp), p_num(0), l_num(0), a_num(0), line_a(10,10),
arc_a(10,10), hot(0), highlight(0), arrow_num(0), arrow_a(1,1),
arc_a(10,10), hot(0), highlight(0), dimmed(0), arrow_num(0), arrow_a(1,1),
ref_num(0), ref_a(4,4), temporary_ref(0), trace_p(NULL)
{
double x1, y1, x2, y2;
......@@ -152,7 +152,7 @@ FlowCon::FlowCon( FlowCtx *flow_ctx, const char *name, FlowConClass *con_class,
dest_node(dest), source_node(source), dest_conpoint(dest_cp), source_conpoint(source_cp),
p_num(point_num), l_num(0), a_num(0), arrow_num(0), ref_num(0),
line_a(10,10), arc_a(10,10), arrow_a(1,1), ref_a(4,4), temporary_ref(0),
hot(0), highlight(0),
hot(0), highlight(0), dimmed(0),
movement_type(flow_eMoveType_Route),
trace_attr_type(flow_eTraceType_Boolean),
trace_p(NULL)
......@@ -190,7 +190,7 @@ FlowCon::FlowCon( FlowCtx *flow_ctx, const char *name, FlowConClass *con_class,
nav_zoom();
if ( nodraw)
break;
l1->draw( &cc->zero, highlight, hot, NULL);
l1->draw( &cc->zero, highlight, dimmed, hot, NULL);
l1->nav_draw( &cc->zero, highlight, NULL);
break;
case flow_eConType_StraightOneArrow:
......@@ -204,9 +204,9 @@ FlowCon::FlowCon( FlowCtx *flow_ctx, const char *name, FlowConClass *con_class,
nav_zoom();
if ( nodraw)
break;
l1->draw( &cc->zero, highlight, hot, NULL);
l1->draw( &cc->zero, highlight, dimmed, hot, NULL);
l1->nav_draw( &cc->zero, highlight, NULL);
arrow->draw( &cc->zero, highlight, hot, NULL);
arrow->draw( &cc->zero, highlight, dimmed, hot, NULL);
arrow->nav_draw( &cc->zero, highlight, NULL);
break;
case flow_eConType_StepDiv:
......@@ -382,7 +382,7 @@ FlowCon::FlowCon( FlowCtx *flow_ctx, const char *name, FlowConClass *con_class,
source_ref_cnt = source->refcon_cnt[source_cp]++;
dest_ref_cnt = dest->refcon_cnt[dest_cp]++;
nav_zoom();
ref_a.draw( &cc->zero, highlight, hot, NULL);
ref_a.draw( &cc->zero, highlight, dimmed, hot, NULL);
ref_a.nav_draw( &cc->zero, highlight, NULL);
}
......@@ -461,22 +461,22 @@ void FlowCon::set_highlight( int on)
highlight = on;
if ( temporary_ref || cc->con_type == flow_eConType_Reference)
{
ref_a.draw( &cc->zero, highlight, hot, NULL);
ref_a.draw( &cc->zero, highlight, dimmed, hot, NULL);
ref_a.nav_draw( &cc->zero, highlight, NULL);
}
else
{
for ( i = 0; i < l_num; i++)
{
((FlowLine *)line_a[i])->draw( &cc->zero, highlight, hot, NULL);
((FlowLine *)line_a[i])->draw( &cc->zero, highlight, dimmed, hot, NULL);
((FlowLine *)line_a[i])->nav_draw( &cc->zero, highlight, NULL);
}
for ( i = 0; i < a_num; i++)
{
((FlowArc *)arc_a[i])->draw( &cc->zero, highlight, hot, NULL);
((FlowArc *)arc_a[i])->draw( &cc->zero, highlight, dimmed, hot, NULL);
((FlowArc *)arc_a[i])->nav_draw( &cc->zero, highlight, NULL);
}
arrow_a.draw( &cc->zero, highlight, hot, NULL);
arrow_a.draw( &cc->zero, highlight, dimmed, hot, NULL);
arrow_a.nav_draw( &cc->zero, highlight, NULL);
}
}
......@@ -490,22 +490,22 @@ void FlowCon::set_hot( int on)
hot = on;
if ( temporary_ref || cc->con_type == flow_eConType_Reference)
{
ref_a.draw( &cc->zero, highlight, hot, NULL);
ref_a.draw( &cc->zero, highlight, dimmed, hot, NULL);
ref_a.nav_draw( &cc->zero, highlight, NULL);
}
else
{
for ( i = 0; i < l_num; i++)
{
((FlowLine *)line_a[i])->draw( &cc->zero, highlight, hot, NULL);
((FlowLine *)line_a[i])->draw( &cc->zero, highlight, dimmed, hot, NULL);
((FlowLine *)line_a[i])->nav_draw( &cc->zero, highlight, NULL);
}
for ( i = 0; i < a_num; i++)
{
((FlowArc *)arc_a[i])->draw( &cc->zero, highlight, hot, NULL);
((FlowArc *)arc_a[i])->draw( &cc->zero, highlight, dimmed, hot, NULL);
((FlowArc *)arc_a[i])->nav_draw( &cc->zero, highlight, NULL);
}
arrow_a.draw( &cc->zero, highlight, hot, NULL);
arrow_a.draw( &cc->zero, highlight, dimmed, hot, NULL);
arrow_a.nav_draw( &cc->zero, highlight, NULL);
}
}
......@@ -622,14 +622,14 @@ void FlowCon::move( int delta_x, int delta_y, int grid)
point_y[i] += y;
}
if ( temporary_ref || cc->con_type == flow_eConType_Reference)
ref_a.shift( &cc->zero, x, y, highlight, hot);
ref_a.shift( &cc->zero, x, y, highlight, dimmed, hot);
else
{
for ( i = 0; i < l_num; i++)
((FlowLine *)line_a[i])->shift( &cc->zero, x, y, highlight, hot);
((FlowLine *)line_a[i])->shift( &cc->zero, x, y, highlight, dimmed, hot);
for ( i = 0; i < a_num; i++)
((FlowArc *)arc_a[i])->shift( &cc->zero, x, y, highlight, hot);
arrow_a.shift( &cc->zero, x, y, highlight, hot);
((FlowArc *)arc_a[i])->shift( &cc->zero, x, y, highlight, dimmed, hot);
arrow_a.shift( &cc->zero, x, y, highlight, dimmed, hot);
}
get_con_borders();
ctx->draw( int(x_left * ctx->zoom_factor - ctx->offset_x - 20),
......@@ -707,7 +707,7 @@ void FlowCon::reconfigure()
{
case flow_eConType_Straight:
l1 = (FlowLine *)line_a[0];
l1->move( &cc->zero, x1, y1, x2, y2, highlight, hot);
l1->move( &cc->zero, x1, y1, x2, y2, highlight, dimmed, hot);
break;
case flow_eConType_Reference:
{
......@@ -716,9 +716,9 @@ void FlowCon::reconfigure()
}
case flow_eConType_StraightOneArrow:
l1 = (FlowLine *)line_a[0];
l1->move( &cc->zero, x1, y1, x2, y2, highlight, hot);
l1->move( &cc->zero, x1, y1, x2, y2, highlight, dimmed, hot);
arrow = (FlowArrow *)arrow_a[0];
arrow->move( &cc->zero, x1, y1, x2, y2, highlight, hot);
arrow->move( &cc->zero, x1, y1, x2, y2, highlight, dimmed, hot);
break;
case flow_eConType_StepDiv:
case flow_eConType_StepConv:
......@@ -730,15 +730,15 @@ void FlowCon::reconfigure()
if ( !p_num)
{
l1 = (FlowLine *)line_a[0];
l1->move( &cc->zero, x1, y1, x2, y2, highlight, hot);
l1->move( &cc->zero, x1, y1, x2, y2, highlight, dimmed, hot);
}
else
{
l1 = (FlowLine *)line_a[0];
l1->move( &cc->zero, x1, y1, point_x[0], point_y[0], highlight, hot);
l1->move( &cc->zero, x1, y1, point_x[0], point_y[0], highlight, dimmed, hot);
l1 = (FlowLine *)line_a[p_num];
l1->move( &cc->zero, point_x[p_num-1], point_y[p_num-1], x2, y2,
highlight, hot);
highlight, dimmed, hot);
}
break;
case flow_eConType_AllFixed:
......@@ -986,14 +986,14 @@ void FlowCon::draw( int ll_x, int ll_y, int ur_x, int ur_y)
y_low * ctx->zoom_factor - ctx->offset_y <= ur_y)
{
if ( temporary_ref || cc->con_type == flow_eConType_Reference)
ref_a.draw( &cc->zero, highlight, hot, NULL);
ref_a.draw( &cc->zero, highlight, dimmed, hot, NULL);
else
{
for ( i = 0; i < l_num; i++)
((FlowLine *)line_a[i])->draw( &cc->zero, highlight, hot, NULL);
((FlowLine *)line_a[i])->draw( &cc->zero, highlight, dimmed, hot, NULL);
for ( i = 0; i < a_num; i++)
((FlowArc *)arc_a[i])->draw( &cc->zero, highlight, hot, NULL);
arrow_a.draw( &cc->zero, highlight, hot, NULL);
((FlowArc *)arc_a[i])->draw( &cc->zero, highlight, dimmed, hot, NULL);
arrow_a.draw( &cc->zero, highlight, dimmed, hot, NULL);
}
}
}
......@@ -2049,7 +2049,7 @@ void draw_line( FlowCtx *ctx, double x1, double y1, double x2, double y2)
int( y1*ctx->zoom_factor-ctx->offset_y),
int( x2*ctx->zoom_factor-ctx->offset_x),
int( y2*ctx->zoom_factor-ctx->offset_y),
flow_eDrawType_Line, 0, 0);
flow_eDrawType_Line, 0, 0, 0);
}
void print_line()
{
......@@ -3360,14 +3360,14 @@ int FlowCon::event_handler( flow_eEvent event, int x, int y)
ctx->fdraw->set_cursor( ctx, draw_eCursor_CrossHair);
hot = 1;
if ( temporary_ref || cc->con_type == flow_eConType_Reference)
ref_a.draw( &cc->zero, highlight, hot, NULL);
ref_a.draw( &cc->zero, highlight, dimmed, hot, NULL);
else
{
for ( i = 0; i < l_num; i++)
((FlowLine *)line_a[i])->draw( &cc->zero, highlight, hot, NULL);
((FlowLine *)line_a[i])->draw( &cc->zero, highlight, dimmed, hot, NULL);
for ( i = 0; i < a_num; i++)
((FlowArc *)arc_a[i])->draw( &cc->zero, highlight, hot, NULL);
arrow_a.draw( &cc->zero, highlight, hot, NULL);
((FlowArc *)arc_a[i])->draw( &cc->zero, highlight, dimmed, hot, NULL);
arrow_a.draw( &cc->zero, highlight, dimmed, hot, NULL);
}
}
if ( !sts && hot)
......@@ -3385,14 +3385,14 @@ int FlowCon::event_handler( flow_eEvent event, int x, int y)
}
hot = 0;
if ( temporary_ref || cc->con_type == flow_eConType_Reference)
ref_a.draw( &cc->zero, highlight, hot, NULL);
ref_a.draw( &cc->zero, highlight, dimmed, hot, NULL);
else
{
for ( i = 0; i < l_num; i++)
((FlowLine *)line_a[i])->draw( &cc->zero, highlight, hot, NULL);
((FlowLine *)line_a[i])->draw( &cc->zero, highlight, dimmed, hot, NULL);
for ( i = 0; i < a_num; i++)
((FlowArc *)arc_a[i])->draw( &cc->zero, highlight, hot, NULL);
arrow_a.draw( &cc->zero, highlight, hot, NULL);
((FlowArc *)arc_a[i])->draw( &cc->zero, highlight, dimmed, hot, NULL);
arrow_a.draw( &cc->zero, highlight, dimmed, hot, NULL);
}
}
break;
......@@ -3423,7 +3423,7 @@ void FlowCon::draw_routed( int points, double *x, double *y)
{
l = (FlowLine *) line_a[i];
l->move( &cc->zero, x[i], y[i],
x[i+1], y[i+1], highlight, hot);
x[i+1], y[i+1], highlight, dimmed, hot);
}
for ( i = points - 1; i < l_num; i++)
......@@ -3456,7 +3456,7 @@ void FlowCon::draw_routed_trans( int points, double *x, double *y)
continue;
l = (FlowLine *) line_a[j];
l->move( &cc->zero, x[i], y[i],
x[i+1], y[i+1], highlight, hot);
x[i+1], y[i+1], highlight, dimmed, hot);
j++;
}
......@@ -3723,14 +3723,14 @@ void FlowCon::draw_routed_roundcorner( int points, double *x, double *y)
{
l = (FlowLine *) line_a[i];
l->move( &cc->zero, line_x1[i], line_y1[i],
line_x2[i], line_y2[i], highlight, hot);
line_x2[i], line_y2[i], highlight, dimmed, hot);
}
for ( i = 0; i < points - 2; i++)
{
a = (FlowArc *) arc_a[i];
a->move( &cc->zero, arc_ll_x[i], arc_ll_y[i],
arc_ur_x[i], arc_ur_y[i], arc_angle1[i], arc_angle2[i],
highlight, hot);
highlight, dimmed, hot);
}
for ( i = points - 1; i < l_num; i++)
{
......@@ -3822,8 +3822,8 @@ void FlowCon::move_ref( double x1, double y1, double x2, double y2)
{
r1 = (FlowRect *)ref_a[0];
t1 = (FlowText *)ref_a[1];
r1->move( &cc->zero, rect_x, rect_y, highlight, hot);
t1->move( &cc->zero, text_x, text_y, highlight, hot);
r1->move( &cc->zero, rect_x, rect_y, highlight, dimmed, hot);
t1->move( &cc->zero, text_x, text_y, highlight, dimmed, hot);
}
switch ( dest_direction)
{
......@@ -3863,8 +3863,8 @@ void FlowCon::move_ref( double x1, double y1, double x2, double y2)
{
r2 = (FlowRect *)ref_a[2];
t2 = (FlowText *)ref_a[3];
r2->move( &cc->zero, rect_x, rect_y, highlight, hot);
t2->move( &cc->zero, text_x, text_y, highlight, hot);
r2->move( &cc->zero, rect_x, rect_y, highlight, dimmed, hot);
t2->move( &cc->zero, text_x, text_y, highlight, dimmed, hot);
}
}
......
......@@ -151,6 +151,7 @@ class FlowCon : public FlowArrayElem {
flow_tName c_name;
int hot;
int highlight;
int dimmed;
flow_eMoveType movement_type;
flow_tTraceObj trace_object;
flow_tTraceAttr trace_attribute;
......
......@@ -158,7 +158,7 @@ void FlowConPoint::get_trace_attr( char *object, char *attribute,
*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 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)
y = p.z_y + ((FlowPoint *)pos)->z_y - ctx->offset_y - size/2;
}
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 {
void print( void *pos, void *node) {};
void save( ofstream& fp, flow_eSaveMode mode);
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 erase( void *pos, int hot, void *node);
void nav_erase( void *pos, void *node) {};
......
/*
/*
* Proview Open Source Process Control.
* 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)
{
fdraw->rect( this, select_rect_ll_x, select_rect_ll_y,
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();
}
......@@ -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,
con_create_last_x, con_create_last_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_y = y;
for ( i = 0; i < a.a_size; i++)
......
......@@ -127,6 +127,8 @@ class FlowCtx {
void copy();
void set_highlight( int on)
{ a.set_highlight( on);};
void set_dimmed( int on)
{ a.set_dimmed( on);};
void set_inverse( int on)
{ a.set_inverse( on);};
void set_select_highlight( int on)
......
......@@ -61,7 +61,7 @@ class FlowDraw {
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,
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,
int idx) {return 1;}
virtual int nav_rect( FlowCtx *ctx, int x, int y, int width, int height,
......@@ -82,7 +82,7 @@ class FlowDraw {
int idx) {return 1;}
virtual int arc( FlowCtx *ctx, int x, int y, int width, int height,
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,
int angle1, int angle2,
int idx) {return 1;}
......@@ -93,7 +93,7 @@ class FlowDraw {
int angle1, int angle2,
int idx) {return 1;}
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,
int idx) {return 1;}
virtual int nav_line( FlowCtx *ctx, int x1, int y1, int x2, int y2,
......@@ -101,7 +101,7 @@ class FlowDraw {
virtual int nav_line_erase( FlowCtx *ctx, int x1, int y1, int x2, int y2,
int idx) {return 1;}
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;}
virtual int text_inverse( FlowCtx *ctx, int x, int y, char *text, int len,
flow_eDrawType gc_type, int idx, int line, double size)
......
......@@ -54,7 +54,7 @@ void FlowFrame::open( ifstream& fp)
// 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;
int idx;
......@@ -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,
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),
draw_type, idx, highlight);
draw_type, idx, highlight, 0);
}
void FlowFrame::erase( void *pos, int hot, void *node)
......
......@@ -53,7 +53,7 @@ class FlowFrame : public FlowRect {
FlowRect( flow_ctx, x, y, w, h, d_type, line_w, fix_line_w) {};
void save( ofstream& fp, flow_eSaveMode mode);
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 get_borders( double pos_x, double pos_y, double *x_right,
double *x_left, double *y_high, double *y_low, void *node);
......
......@@ -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))
return;
......@@ -249,7 +249,7 @@ void FlowImage::get_borders( double pos_x, double pos_y, double *x_right,
*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;
......@@ -263,12 +263,12 @@ void FlowImage::move( void *pos, double x, double y, int highlight, int hot)
ur.y = y + height;
zoom();
nav_zoom();
draw( pos, highlight, hot, NULL);
draw( pos, highlight, dimmed, hot, NULL);
nav_draw( pos, highlight, NULL);
}
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);
nav_erase( pos, NULL);
......@@ -279,7 +279,7 @@ void FlowImage::shift( void *pos, double delta_x, double delta_y,
zoom();
nav_zoom();
draw( pos, highlight, hot, NULL);
draw( pos, highlight, dimmed, hot, NULL);
nav_draw( pos, highlight, NULL);
}
......
......@@ -60,7 +60,7 @@ class FlowImage : public FlowArrayElem {
void print( void *pos, void *node, int highlight);
void save( ofstream& fp, flow_eSaveMode mode);
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 draw_inverse( void *pos, int hot, void *node)
{ erase( pos, hot, node);};
......@@ -68,9 +68,9 @@ class FlowImage : public FlowArrayElem {
void nav_erase( void *pos, void *node);
void get_borders( double pos_x, double pos_y, double *x_right,
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,
int highlight, int hot);
int highlight, int dimmed, int hot);
int get_conpoint( int num, double *x, double *y, flow_eDirection *dir)
{ return 0;};
flow_eObjectType type() { return flow_eObjectType_Image;};
......
......@@ -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)
return;
......@@ -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,
p2.z_x + ((FlowPoint *)pos)->z_x - ctx->offset_x,
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)
......@@ -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,
int highlight, int hot)
int highlight, int dimmed, int hot)
{
erase( pos, hot, NULL);
nav_erase( pos, NULL);
......@@ -253,12 +253,12 @@ void FlowLine::move( void *pos, double x1, double y1, double x2, double y2,
p2.y = y2;
zoom();
nav_zoom();
draw( pos, highlight, hot, NULL);
draw( pos, highlight, dimmed, hot, NULL);
nav_draw( pos, highlight, NULL);
}
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);
nav_erase( pos, NULL);
......@@ -269,7 +269,7 @@ void FlowLine::shift( void *pos, double delta_x, double delta_y,
zoom();
nav_zoom();
draw( pos, highlight, hot, NULL);
draw( pos, highlight, dimmed, hot, NULL);
nav_draw( pos, highlight, NULL);
}
......
......@@ -64,7 +64,7 @@ class FlowLine : public FlowArrayElem {
void print( void *pos, void *node, int highlight);
void save( ofstream& fp, flow_eSaveMode mode);
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 draw_inverse( void *pos, int hot, void *node)
{ erase( pos, hot, node);};
......@@ -73,8 +73,8 @@ class FlowLine : public FlowArrayElem {
void get_borders( double pos_x, double pos_y, double *x_right,
double *x_left, double *y_high, double *y_low, void *node);
void move( void *pos, double x1, double y1, double x2, double y2,
int highlight, int hot);
void shift( void *pos, double delta_x, double delta_y, int highlight, int hot);
int highlight, int dimmed, 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)
{ return 0;};
flow_eObjectType type() { return flow_eObjectType_Line;};
......
......@@ -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),
hot(0), ctx(flow_ctx), nc(node_class), 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),
level(0), node_open(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)
y_low * ctx->zoom_factor - ctx->offset_y <= ur_y)
{
if ( !inverse)
nc->draw( &pos, highlight, hot, (void *)this);
nc->draw( &pos, highlight, dimmed, hot, (void *)this);
else
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_y_high * ctx->zoom_factor - obst_y_low * ctx->zoom_factor),
flow_eDrawType_Line);
nc->draw( &pos, highlight, hot, (void *)this);
nc->draw( &pos, highlight, dimmed, hot, (void *)this);
}
else {
ctx->fdraw->fill_rect( ctx,
......@@ -531,7 +531,17 @@ void FlowNode::set_highlight( int on)
{
highlight = on;
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
draw_inverse();
nc->nav_draw( &pos, highlight, (void *)this);
......@@ -545,7 +555,7 @@ void FlowNode::set_hot( int on)
nc->erase( &pos, hot, (void *)this);
hot = on;
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);
......@@ -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_y_high * ctx->zoom_factor - obst_y_low * ctx->zoom_factor),
flow_eDrawType_LineErase);
nc->draw( &pos, highlight, hot, (void *)this);
nc->draw( &pos, highlight, dimmed, hot, (void *)this);
}
else {
ctx->fdraw->fill_rect( ctx,
......@@ -580,7 +590,7 @@ void FlowNode::set_inverse( int on)
int( x_r * ctx->zoom_factor - x_left * ctx->zoom_factor),
int( y_high * ctx->zoom_factor - y_low * ctx->zoom_factor + 1),
flow_eDrawType_LineErase);
nc->draw( &pos, highlight, hot, (void *)this);
nc->draw( &pos, highlight, dimmed, hot, (void *)this);
}
}
else
......@@ -635,7 +645,7 @@ void FlowNode::set_annotation( int num, const char *text, int size, int nodraw)
relative_annot_x = 0;
nc->configure_annotations( &pos, (void *)this);
if ( !inverse)
nc->draw( &pos, highlight, hot, (void *)this);
nc->draw( &pos, highlight, dimmed, hot, (void *)this);
else
draw_inverse();
}
......@@ -715,7 +725,7 @@ void FlowNode::set_annot_pixmap( int num, flow_sAnnotPixmap *pixmap,
return;
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);
......@@ -736,7 +746,7 @@ void FlowNode::remove_annot_pixmap( int num)
annotpixmapv[num] = 0;
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);
......@@ -751,7 +761,7 @@ void FlowNode::set_radiobutton( int num, int value, int nodraw)
return;
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);
......@@ -865,7 +875,7 @@ int FlowNode::event_handler( flow_eEvent event, int x, int y)
if ( redraw)
{
if ( !inverse)
nc->draw( &pos, highlight, hot, (void *)this);
nc->draw( &pos, highlight, dimmed, hot, (void *)this);
else
draw_inverse();
}
......@@ -1053,7 +1063,7 @@ void FlowNode::conpoint_select( int num)
sel_conpoint1 = num;
else if ( sel_conpoint2 == -1)
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)
......@@ -1061,12 +1071,12 @@ void FlowNode::conpoint_select_clear( int num)
if ( sel_conpoint1 == num) {
erase();
sel_conpoint1 = -1;
nc->draw( &pos, highlight, hot, (void *)this);
nc->draw( &pos, highlight, dimmed, hot, (void *)this);
}
else if ( sel_conpoint2 == num) {
erase();
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()
erase();
sel_conpoint1 = -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)
erase();
nc = new_nc;
if ( !inverse)
nc->draw( &pos, highlight, hot, (void *)this);
nc->draw( &pos, highlight, dimmed, hot, (void *)this);
else
draw_inverse();
}
......@@ -88,6 +88,8 @@ class FlowNode : public FlowArrayElem {
int delete_node_cons( void *node) {return 0;};
void set_highlight( int on);
int get_highlight() {return highlight;};
void set_dimmed( int on);
int get_dimmed() {return dimmed;};
void set_inverse( int on);
int get_inverse() {return inverse;};
void set_hot( int on);
......@@ -120,6 +122,7 @@ class FlowNode : public FlowArrayElem {
FlowPoint stored_pos;
flow_tName n_name;
int highlight;
int dimmed;
int inverse;
char *annotv[10];
int annotsize[10];
......
......@@ -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;
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)
{
case flow_eObjectType_Radiobutton:
case flow_eObjectType_Image:
a.a[i]->draw( pos, 0, hot, node);
a.a[i]->draw( pos, 0, 0, hot, node);
break;
default:
a.a[i]->draw_inverse( pos, hot, node);
......@@ -237,7 +237,7 @@ void FlowNodeClass::draw_annotation( void *pos, int highlight, int hot,
if ( a.a[i]->type() == flow_eObjectType_Annot &&
((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);
break;
}
......
......@@ -64,7 +64,7 @@ class FlowNodeClass : public FlowArrayElem {
void save( ofstream& fp, flow_eSaveMode mode);
void open( ifstream& fp);
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 draw_inverse( FlowPoint *pos, int hot, void *node);
void erase( FlowPoint *pos, int hot, void *node);
......
......@@ -142,7 +142,7 @@ void FlowPixmap::open( ifstream& fp)
#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) -
4);
......@@ -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);
......@@ -259,12 +259,12 @@ void FlowPixmap::move( void *pos, double x, double y, int highlight, int hot)
p.y = y;
zoom();
nav_zoom();
draw( pos, highlight, hot, NULL);
draw( pos, highlight, dimmed, hot, NULL);
nav_draw( pos, highlight, NULL);
}
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);
nav_erase( pos, NULL);
......@@ -273,7 +273,7 @@ void FlowPixmap::shift( void *pos, double delta_x, double delta_y,
zoom();
nav_zoom();
draw( pos, highlight, hot, NULL);
draw( pos, highlight, dimmed, hot, NULL);
nav_draw( pos, highlight, NULL);
}
......
......@@ -62,14 +62,14 @@ class FlowPixmap : public FlowArrayElem {
void print( void *pos, void *node, int highlight);
void save( ofstream& fp, flow_eSaveMode mode);
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 draw_inverse( void *pos, int hot, void *node);
void erase( void *pos, int hot, 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,
int highlight, int hot);
int highlight, int dimmed, int hot);
void get_borders( double pos_x, double pos_y, double *x_right,
double *x_left, double *y_high, double *y_low, void *node);
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)
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.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,
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));
}
......
......@@ -115,7 +115,7 @@ void FlowRadiobutton::open( ifstream& fp)
// 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 idx = 0;
......@@ -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_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,
draw_type, idx, 0);
draw_type, idx, 0, 0);
if ( ((FlowNode *)node)->rbuttonv[number])
{
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,
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,
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,
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,
idx);
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)
ctx->fdraw->line_erase( ctx, ll_x + 2, ll_y + 2, ll_x + 2, ur_y - 2,
idx);
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,
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,
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,
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,
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,
*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;
......@@ -287,12 +287,12 @@ void FlowRadiobutton::move( void *pos, double x, double y, int highlight, int ho
ur.y = y + height;
zoom();
nav_zoom();
draw( pos, highlight, hot, NULL);
draw( pos, highlight, dimmed, hot, NULL);
nav_draw( pos, highlight, NULL);
}
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);
nav_erase( pos, NULL);
......@@ -303,7 +303,7 @@ void FlowRadiobutton::shift( void *pos, double delta_x, double delta_y,
zoom();
nav_zoom();
draw( pos, highlight, hot, NULL);
draw( pos, highlight, dimmed, hot, NULL);
nav_draw( pos, highlight, NULL);
}
......
......@@ -64,7 +64,7 @@ class FlowRadiobutton : public FlowArrayElem {
void print( void *pos, void *node, int highlight);
void save( ofstream& fp, flow_eSaveMode mode);
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 draw_inverse( void *pos, int hot, void *node)
{ erase( pos, hot, node);};
......@@ -72,9 +72,9 @@ class FlowRadiobutton : public FlowArrayElem {
void nav_erase( void *pos, void *node);
void get_borders( double pos_x, double pos_y, double *x_right,
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,
int highlight, int hot);
int highlight, int dimmed, int hot);
int get_conpoint( int num, double *x, double *y, flow_eDirection *dir)
{ return 0;};
flow_eObjectType type() { return flow_eObjectType_Radiobutton;};
......
......@@ -138,12 +138,12 @@ void FlowRect::draw_inverse( void *pos, int hot, void *node)
draw_type == flow_eDrawType_Green ||
draw_type == flow_eDrawType_DarkGray ||
draw_type == flow_eDrawType_Yellow))
draw( pos, hot, 0, node);
draw( pos, 0, 0, hot, node);
else
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))
return;
......@@ -168,7 +168,7 @@ void FlowRect::draw( void *pos, int highlight, int hot, void *node)
if ( !fill)
ctx->fdraw->rect( ctx, ll.z_x + ((FlowPoint *)pos)->z_x - ctx->offset_x, ll.z_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 {
flow_eDrawType dtype;
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,
*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;
......@@ -304,12 +304,12 @@ void FlowRect::move( void *pos, double x, double y, int highlight, int hot)
ur.y = y + height;
zoom();
nav_zoom();
draw( pos, highlight, hot, NULL);
draw( pos, highlight, dimmed, hot, NULL);
nav_draw( pos, highlight, NULL);
}
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);
nav_erase( pos, NULL);
......@@ -320,7 +320,7 @@ void FlowRect::shift( void *pos, double delta_x, double delta_y,
zoom();
nav_zoom();
draw( pos, highlight, hot, NULL);
draw( pos, highlight, dimmed, hot, NULL);
nav_draw( pos, highlight, NULL);
}
......
......@@ -66,16 +66,16 @@ class FlowRect : public FlowArrayElem {
void print( void *pos, void *node, int highlight);
void save( ofstream& fp, flow_eSaveMode mode);
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 draw_inverse( void *pos, int hot, void *node);
void erase( void *pos, int hot, void *node);
void nav_erase( void *pos, void *node);
void get_borders( double pos_x, double pos_y, double *x_right,
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,
int highlight, int hot);
int highlight, int dimmed, int hot);
int get_conpoint( int num, double *x, double *y, flow_eDirection *dir)
{ return 0;};
flow_eObjectType type() { return flow_eObjectType_Rect;};
......
......@@ -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);
if ( idx < 0)
......@@ -123,7 +123,7 @@ void FlowText::draw( void *pos, int highlight, int hot, void *node)
idx = MIN( idx, DRAW_TYPE_SIZE-1);
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),
draw_type, idx, highlight, 0,
draw_type, idx, highlight, dimmed, 0,
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,
*/
}
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);
......@@ -230,12 +230,12 @@ void FlowText::move( void *pos, double x, double y, int highlight, int hot)
p.y = y;
zoom();
nav_zoom();
draw( pos, highlight, hot, NULL);
draw( pos, highlight, dimmed, hot, NULL);
nav_draw( pos, highlight, NULL);
}
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);
nav_erase( pos, NULL);
......@@ -244,7 +244,7 @@ void FlowText::shift( void *pos, double delta_x, double delta_y,
zoom();
nav_zoom();
draw( pos, highlight, hot, NULL);
draw( pos, highlight, dimmed, hot, NULL);
nav_draw( pos, highlight, NULL);
}
......
......@@ -61,14 +61,14 @@ class FlowText : public FlowArrayElem {
void print( void *pos, void *node, int highlight);
void save( ofstream& fp, flow_eSaveMode mode);
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 draw_inverse( void *pos, int hot, void *node);
void erase( void *pos, int hot, 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,
int highlight, int hot);
int highlight, int dimmed, int hot);
void get_borders( double pos_x, double pos_y, double *x_right,
double *x_left, double *y_high, double *y_low, void *node);
int get_conpoint( int num, double *x, double *y, flow_eDirection *dir)
......
......@@ -129,13 +129,13 @@ void FlowTipText::draw()
ctx->fdraw->fill_rect( ctx, text_x, text_y, text_width, text_height,
flow_eDrawType_LineErase);
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;
for ( int i = 0; i < tiptext_rows; i++) {
ctx->fdraw->text( ctx, text_x + 6, y - text_descent - 2,
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;
}
......
......@@ -273,6 +273,63 @@ int RtTrace::disconnect_bc( flow_tObject object)
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)
{
......@@ -1285,7 +1342,7 @@ int RtTrace::trace_start()
flow_ResetHighlightAll( 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))
return sts;
trace_started = 1;
......@@ -1323,6 +1380,7 @@ int RtTrace::trace_stop()
if ( trace_started) {
flow_TraceClose( flow_ctx);
flow_ResetHighlightAll( flow_ctx);
flow_ResetDimmedAll( flow_ctx);
flow_SelectClear( flow_ctx);
flow_RemoveTraceObjects( flow_ctx);
trace_started = 0;
......
......@@ -145,6 +145,7 @@ class RtTrace {
static int connect_bc( flow_tObject object, char *name, char *attr,
flow_eTraceType type, void **p);
static int disconnect_bc( flow_tObject object);
static int scan_bc( flow_tObject object, void *p);
static void trace_scan( void *data);
static int init_flow( FlowCtx *ctx, void *client_data);
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