Index: trunk/src/flag.c =================================================================== --- trunk/src/flag.c (revision 9317) +++ trunk/src/flag.c (revision 9318) @@ -29,26 +29,23 @@ #include "config.h" #include "flag.h" #include "operation.h" +#include "obj_all_op.h" pcb_opfunc_t ChgFlagFunctions = { -#if 0 - Rotate90Line, - Rotate90Text, - Rotate90Polygon, + ChgFlagLine, + ChgFlagText, + ChgFlagPolygon, NULL, - Rotate90Element, - Rotate90ElementName, NULL, NULL, - Rotate90LinePoint, NULL, - Rotate90Arc, NULL, NULL, - Rotate90Subc -#else - NULL -#endif + NULL, + ChgFlagArc, + NULL, + NULL, + ChgFlagSubc }; Index: trunk/src/obj_arc.c =================================================================== --- trunk/src/obj_arc.c (revision 9317) +++ trunk/src/obj_arc.c (revision 9318) @@ -703,6 +703,15 @@ return new_arc; } +#define PCB_ARC_FLAGS (PCB_FLAG_FOUND | PCB_FLAG_CLEARLINE | PCB_FLAG_SELECTED | PCB_FLAG_AUTO | PCB_FLAG_RUBBEREND | PCB_FLAG_LOCK | PCB_FLAG_VISIT) +void *ChgFlagArc(pcb_opctx_t *ctx, pcb_layer_t *Layer, pcb_arc_t *Arc) +{ + if ((ctx->chgflag.flag & PCB_ARC_FLAGS) != ctx->chgflag.flag) + return NULL; + PCB_FLAG_CHANGE(ctx->chgflag.how, ctx->chgflag.flag, Arc); +} + + /*** draw ***/ void _draw_arc(pcb_arc_t * arc) { Index: trunk/src/obj_arc_op.h =================================================================== --- trunk/src/obj_arc_op.h (revision 9317) +++ trunk/src/obj_arc_op.h (revision 9318) @@ -45,7 +45,9 @@ void *RemoveArc_op(pcb_opctx_t *ctx, pcb_layer_t *Layer, pcb_arc_t *Arc); void *RemoveArcPoint_op(pcb_opctx_t *ctx, pcb_layer_t *l, pcb_arc_t *a, int *end_id); void *Rotate90Arc(pcb_opctx_t *ctx, pcb_layer_t *Layer, pcb_arc_t *Arc); +void *ChgFlagArc(pcb_opctx_t *ctx, pcb_layer_t *Layer, pcb_arc_t *Arc); + void *pcb_arc_insert_point(pcb_opctx_t *ctx, pcb_layer_t *Layer, pcb_arc_t *arc); Index: trunk/src/obj_line.c =================================================================== --- trunk/src/obj_line.c (revision 9317) +++ trunk/src/obj_line.c (revision 9318) @@ -849,6 +849,15 @@ return (line); } +#define PCB_LINE_FLAGS (PCB_FLAG_FOUND | PCB_FLAG_RAT | PCB_FLAG_CLEARLINE | PCB_FLAG_SELECTED | PCB_FLAG_AUTO | PCB_FLAG_RUBBEREND | PCB_FLAG_LOCK | PCB_FLAG_VISIT) +void *ChgFlagLine(pcb_opctx_t *ctx, pcb_layer_t *Layer, pcb_line_t *Line) +{ + if ((ctx->chgflag.flag & PCB_LINE_FLAGS) != ctx->chgflag.flag) + return NULL; + PCB_FLAG_CHANGE(ctx->chgflag.how, ctx->chgflag.flag, Line); +} + + /*** draw ***/ void _draw_line(pcb_line_t * line) { Index: trunk/src/obj_line_op.h =================================================================== --- trunk/src/obj_line_op.h (revision 9317) +++ trunk/src/obj_line_op.h (revision 9318) @@ -48,6 +48,7 @@ void *RemoveLine_op(pcb_opctx_t *ctx, pcb_layer_t *Layer, pcb_line_t *Line); void *Rotate90LinePoint(pcb_opctx_t *ctx, pcb_layer_t *Layer, pcb_line_t *Line, pcb_point_t *Point); void *Rotate90Line(pcb_opctx_t *ctx, pcb_layer_t *Layer, pcb_line_t *Line); +void *ChgFlagLine(pcb_opctx_t *ctx, pcb_layer_t *Layer, pcb_line_t *Line); Index: trunk/src/obj_poly.c =================================================================== --- trunk/src/obj_poly.c (revision 9317) +++ trunk/src/obj_poly.c (revision 9318) @@ -744,6 +744,16 @@ return Polygon; } +#define PCB_POLY_FLAGS (PCB_FLAG_FOUND | PCB_FLAG_CLEARPOLY | PCB_FLAG_FULLPOLY | PCB_FLAG_SELECTED | PCB_FLAG_AUTO | PCB_FLAG_LOCK | PCB_FLAG_VISIT) +void *ChgFlagPolygon(pcb_opctx_t *ctx, pcb_layer_t *Layer, pcb_polygon_t *Polygon) +{ + if ((ctx->chgflag.flag & PCB_POLY_FLAGS) != ctx->chgflag.flag) + return NULL; + PCB_FLAG_CHANGE(ctx->chgflag.how, ctx->chgflag.flag, Polygon); +} + + + /*** draw ***/ pcb_r_dir_t draw_poly_callback(const pcb_box_t * b, void *cl) { Index: trunk/src/obj_poly_op.h =================================================================== --- trunk/src/obj_poly_op.h (revision 9317) +++ trunk/src/obj_poly_op.h (revision 9318) @@ -44,4 +44,6 @@ void *RemovePolygonPoint(pcb_opctx_t *ctx, pcb_layer_t *Layer, pcb_polygon_t *Polygon, pcb_point_t *Point); void *CopyPolygon(pcb_opctx_t *ctx, pcb_layer_t *Layer, pcb_polygon_t *Polygon); void *Rotate90Polygon(pcb_opctx_t *ctx, pcb_layer_t *Layer, pcb_polygon_t *Polygon); +void *ChgFlagPolygon(pcb_opctx_t *ctx, pcb_layer_t *Layer, pcb_polygon_t *Polygon); + Index: trunk/src/obj_text.c =================================================================== --- trunk/src/obj_text.c (revision 9317) +++ trunk/src/obj_text.c (revision 9318) @@ -538,6 +538,15 @@ pcb_poly_clear_from_poly(PCB->Data, PCB_TYPE_TEXT, layer, text); } +#define PCB_TEXT_FLAGS (PCB_FLAG_FOUND | PCB_FLAG_CLEARLINE | PCB_FLAG_SELECTED | PCB_FLAG_AUTO | PCB_FLAG_LOCK | PCB_FLAG_VISIT) +void *ChgFlagText(pcb_opctx_t *ctx, pcb_layer_t *Layer, pcb_text_t *Text) +{ + if ((ctx->chgflag.flag & PCB_TEXT_FLAGS) != ctx->chgflag.flag) + return NULL; + PCB_FLAG_CHANGE(ctx->chgflag.how, ctx->chgflag.flag, Text); +} + + /*** draw ***/ #define MAX_SIMPLE_POLY_POINTS 256 Index: trunk/src/obj_text_op.h =================================================================== --- trunk/src/obj_text_op.h (revision 9317) +++ trunk/src/obj_text_op.h (revision 9318) @@ -42,3 +42,5 @@ void *DestroyText(pcb_opctx_t *ctx, pcb_layer_t *Layer, pcb_text_t *Text); void *RemoveText_op(pcb_opctx_t *ctx, pcb_layer_t *Layer, pcb_text_t *Text); void *Rotate90Text(pcb_opctx_t *ctx, pcb_layer_t *Layer, pcb_text_t *Text); +void *ChgFlagText(pcb_opctx_t *ctx, pcb_layer_t *Layer, pcb_text_t *Text); +