Index: undo.h =================================================================== --- undo.h (revision 10661) +++ undo.h (revision 10662) @@ -29,13 +29,11 @@ #ifndef PCB_UNDO_H #define PCB_UNDO_H -#include "library.h" +#include -#define DRAW_FLAGS (PCB_FLAG_RAT | PCB_FLAG_SELECTED \ - | PCB_FLAG_HIDENAME | PCB_FLAG_HOLE | PCB_FLAG_OCTAGON | PCB_FLAG_FOUND | PCB_FLAG_CLEARLINE) +/* Temporary for compatibility */ +#include "undo_old.h" -/* different layers */ - int pcb_undo(pcb_bool); int pcb_redo(pcb_bool); void pcb_undo_inc_serial(void); @@ -43,65 +41,20 @@ void pcb_undo_restore_serial(void); void pcb_undo_clear_list(pcb_bool); -void pcb_undo_move_obj_to_remove(int, void *, void *, void *); -void pcb_undo_add_obj_to_remove_point(int, void *, void *, pcb_cardinal_t); -void pcb_undo_add_obj_to_insert_point(int, void *, void *, void *); -void pcb_undo_add_obj_to_remove_contour(int, pcb_layer_t *, pcb_polygon_t *); -void pcb_undo_add_obj_to_insert_contour(int, pcb_layer_t *, pcb_polygon_t *); -void pcb_undo_add_obj_to_move(int, void *, void *, void *, pcb_coord_t, pcb_coord_t); -void pcb_undo_add_obj_to_change_name(int, void *, void *, void *, char *); -void pcb_undo_add_obj_to_change_pinnum(int, void *, void *, void *, char *); -void pcb_undo_add_obj_to_rotate(int, void *, void *, void *, pcb_coord_t, pcb_coord_t, pcb_uint8_t); -void pcb_undo_add_obj_to_create(int, void *, void *, void *); -void pcb_undo_add_obj_to_mirror(int, void *, void *, void *, pcb_coord_t); -void pcb_undo_add_subc_to_otherside(int Type, void *Ptr1, void *Ptr2, void *Ptr3, pcb_coord_t yoff); -void pcb_undo_add_obj_to_move_to_layer(int, void *, void *, void *); -void pcb_undo_add_obj_to_flag(int, void *, void *, void *); -void pcb_undo_add_obj_to_size(int, void *, void *, void *); -void pcb_undo_add_obj_to_2nd_size(int, void *, void *, void *); -void pcb_undo_add_obj_to_clear_size(int, void *, void *, void *); -void pcb_undo_add_obj_to_mask_size(int, void *, void *, void *); -void pcb_undo_add_obj_to_change_angles(int, void *, void *, void *); -void pcb_undo_add_obj_to_change_radii(int, void *, void *, void *); -void pcb_undo_add_obj_to_clear_poly(int, void *, void *, void *, pcb_bool); -void pcb_undo_add_layer_move(int, int); -void pcb_undo_add_netlist_lib(pcb_lib_t *); - void pcb_undo_lock(void); void pcb_undo_unlock(void); pcb_bool pcb_undoing(void); -/* --------------------------------------------------------------------------- - * define supported types of undo operations - * note these must be separate bits now - */ -typedef enum { - PCB_UNDO_CHANGENAME = 0x000001, /* change of names */ - PCB_UNDO_MOVE = 0x000002, /* moving objects */ - PCB_UNDO_REMOVE = 0x000004, /* removing objects */ - PCB_UNDO_REMOVE_POINT = 0x000008, /* removing polygon/... points */ - PCB_UNDO_INSERT_POINT = 0x000010, /* inserting polygon/... points */ - PCB_UNDO_REMOVE_CONTOUR = 0x000020, /* removing a contour from a polygon */ - PCB_UNDO_INSERT_CONTOUR = 0x000040, /* inserting a contour from a polygon */ - PCB_UNDO_ROTATE = 0x000080, /* rotations */ - PCB_UNDO_CREATE = 0x000100, /* creation of objects */ - PCB_UNDO_MOVETOLAYER = 0x000200, /* moving objects to */ - PCB_UNDO_FLAG = 0x000400, /* toggling SELECTED flag */ - PCB_UNDO_CHANGESIZE = 0x000800, /* change size of object */ - PCB_UNDO_CHANGE2NDSIZE = 0x001000, /* change 2ndSize of object */ - PCB_UNDO_MIRROR = 0x002000, /* change side of board */ - PCB_UNDO_CHANGECLEARSIZE = 0x004000, /* change clearance size */ - PCB_UNDO_CHANGEMASKSIZE = 0x008000, /* change mask size */ - PCB_UNDO_CHANGEANGLES = 0x010000, /* change arc angles */ - PCB_UNDO_LAYERMOVE = 0x020000, /* layer new/delete/move */ - PCB_UNDO_CLEAR = 0x040000, /* clear/restore to polygons */ - PCB_UNDO_NETLISTCHANGE = 0x080000, /* netlist change */ - PCB_UNDO_CHANGEPINNUM = 0x100000, /* change of pin number */ - PCB_UNDO_CHANGERADII = 0x200000, /* change arc radii */ - PCB_UNDO_OTHERSIDE = 0x400000 /* change side of board (subcircuit) */ -} pcb_undo_op_t; +/* Returns 0 if undo integrity is not broken */ +int undo_check(void); +void undo_dump(void); + +void *GetUndoSlot(int CommandType, int ID, int Kind, size_t item_len); + +/* temporary */ +#include "pcb_bool.h" +extern pcb_data_t *RemoveList; +extern pcb_bool pcb_undo_and_draw; + #endif - -/* Returns 0 if undo integrity is not broken */ -int undo_check(void);