Index: trunk/src/find.h =================================================================== --- trunk/src/find.h (revision 29381) +++ trunk/src/find.h (revision 29382) @@ -30,7 +30,7 @@ #define PCB_FIND2_H #include -#include +#include "global_typedefs.h" #include "flag.h" typedef enum { Index: trunk/src/global_typedefs.h =================================================================== --- trunk/src/global_typedefs.h (nonexistent) +++ trunk/src/global_typedefs.h (revision 29382) @@ -0,0 +1,64 @@ +/* + * COPYRIGHT + * + * pcb-rnd, interactive printed circuit board design + * (this file is based on PCB, interactive printed circuit board design) + * Copyright (C) 2016..2020 Tibor 'Igor2' Palinkas + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Contact: + * Project page: http://repo.hu/projects/pcb-rnd + * lead developer: http://repo.hu/projects/pcb-rnd/contact.html + * mailing list: pcb-rnd (at) list.repo.hu (send "subscribe") + */ + +#ifndef GLOBAL_TYPEDEFS_H +#define GLOBAL_TYPEDEFS_H + +#include + +typedef struct pcb_board_s pcb_board_t; +typedef struct pcb_data_s pcb_data_t; +typedef struct pcb_layer_stack_s pcb_layer_stack_t; +typedef struct pcb_layer_s pcb_layer_t; +typedef struct pcb_layergrp_s pcb_layergrp_t; +typedef struct pcb_buffer_s pcb_buffer_t; +typedef struct pcb_net_s pcb_net_t; +typedef struct pcb_net_term_s pcb_net_term_t; +typedef struct pcb_oldnet_s pcb_oldnet_t; +typedef struct pcb_connection_s pcb_connection_t; +typedef struct pcb_font_s pcb_font_t; +typedef struct pcb_fontkit_s pcb_fontkit_t; +typedef struct pcb_line_s pcb_line_t; +typedef struct pcb_arc_s pcb_arc_t; +typedef struct pcb_rat_line_s pcb_rat_t; + +typedef struct pcb_poly_s pcb_poly_t; +typedef struct pcb_pstk_s pcb_pstk_t; + +typedef struct pcb_ratspatch_line_s pcb_ratspatch_line_t; +typedef struct pcb_subc_s pcb_subc_t; +typedef struct pcb_text_s pcb_text_t; + +typedef struct pcb_any_obj_s pcb_any_obj_t; +typedef struct pcb_any_line_s pcb_any_line_t; + +typedef union pcb_parent_s pcb_parent_t; + +typedef struct pcb_plug_io_s pcb_plug_io_t; + +typedef struct pcb_view_s pcb_view_t; +#endif Index: trunk/src/librnd/core/global_typedefs.h =================================================================== --- trunk/src/librnd/core/global_typedefs.h (revision 29381) +++ trunk/src/librnd/core/global_typedefs.h (revision 29382) @@ -3,7 +3,7 @@ * * pcb-rnd, interactive printed circuit board design * (this file is based on PCB, interactive printed circuit board design) - * Copyright (C) 2016 Tibor 'Igor2' Palinkas + * Copyright (C) 2016..2020 Tibor 'Igor2' Palinkas * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -25,8 +25,8 @@ * mailing list: pcb-rnd (at) list.repo.hu (send "subscribe") */ -#ifndef GLOBAL_TYPEDEFS_H -#define GLOBAL_TYPEDEFS_H +#ifndef RND_GLOBAL_TYPEDEFS_H +#define RND_GLOBAL_TYPEDEFS_H #include struct pcb_box_s { /* a bounding box */ @@ -41,43 +41,14 @@ typedef double pcb_angle_t; /* degrees */ typedef struct pcb_unit_s pcb_unit_t; -typedef struct pcb_board_s pcb_board_t; -typedef struct pcb_data_s pcb_data_t; -typedef struct pcb_layer_stack_s pcb_layer_stack_t; -typedef struct pcb_layer_s pcb_layer_t; -typedef struct pcb_layergrp_s pcb_layergrp_t; -typedef long int pcb_layer_id_t; -typedef long int pcb_layergrp_id_t; -typedef struct pcb_polyarea_s pcb_polyarea_t; -typedef struct pcb_buffer_s pcb_buffer_t; -typedef struct pcb_net_s pcb_net_t; -typedef struct pcb_net_term_s pcb_net_term_t; -typedef struct pcb_oldnet_s pcb_oldnet_t; -typedef struct pcb_connection_s pcb_connection_t; +typedef struct pcb_point_s pcb_point_t; typedef struct pcb_box_s pcb_box_t; typedef struct pcb_box_list_s pcb_box_list_t; -typedef struct pcb_font_s pcb_font_t; -typedef struct pcb_fontkit_s pcb_fontkit_t; -typedef struct pcb_line_s pcb_line_t; -typedef struct pcb_arc_s pcb_arc_t; -typedef struct pcb_point_s pcb_point_t; -typedef struct pcb_rat_line_s pcb_rat_t; +typedef struct pcb_polyarea_s pcb_polyarea_t; -typedef struct pcb_poly_s pcb_poly_t; -typedef struct pcb_pstk_s pcb_pstk_t; typedef struct pcb_rtree_s pcb_rtree_t; typedef struct pcb_rtree_it_s pcb_rtree_it_t; -typedef struct pcb_ratspatch_line_s pcb_ratspatch_line_t; -typedef struct pcb_subc_s pcb_subc_t; -typedef struct pcb_text_s pcb_text_t; -typedef struct pcb_any_obj_s pcb_any_obj_t; -typedef struct pcb_any_line_s pcb_any_line_t; - -typedef union pcb_parent_s pcb_parent_t; - -typedef struct pcb_plug_io_s pcb_plug_io_t; - typedef struct pcb_hid_cfg_s pcb_hid_cfg_t; typedef unsigned int pcb_cardinal_t; @@ -87,8 +58,6 @@ typedef struct pcb_action_s pcb_action_t; -typedef struct pcb_view_s pcb_view_t; - typedef struct pcb_hid_dad_subdialog_s pcb_hid_dad_subdialog_t; typedef struct pcb_event_arg_s pcb_event_arg_t; @@ -95,7 +64,7 @@ typedef struct pcb_hid_expose_ctx_s pcb_hid_expose_ctx_t; typedef struct pcb_hid_s pcb_hid_t; -typedef struct pcb_xform_s pcb_xform_t; +typedef struct pcb_xform_s pcb_xform_t; /* declared by the app */ /* This graphics context is an opaque pointer defined by the HID. GCs are HID-specific; attempts to use one HID's GC for a different HID @@ -107,6 +76,9 @@ typedef struct pcb_hid_attribute_s pcb_hid_attribute_t; typedef struct pcb_export_opt_s pcb_export_opt_t; +typedef long int pcb_layer_id_t; +typedef long int pcb_layergrp_id_t; + #include #endif Index: trunk/src/librnd/poly/polyarea.c =================================================================== --- trunk/src/librnd/poly/polyarea.c (revision 29381) +++ trunk/src/librnd/poly/polyarea.c (revision 29382) @@ -52,7 +52,6 @@ #include #include #include -#include "obj_common.h" #include #include Index: trunk/src/obj_common.h =================================================================== --- trunk/src/obj_common.h (revision 29381) +++ trunk/src/obj_common.h (revision 29382) @@ -33,7 +33,7 @@ #include #include "flag.h" #include -#include +#include "global_typedefs.h" #include "data_parent.h" /* Real objects that have actual struct; can be used as a bitfield */ Index: trunk/src/operation.h =================================================================== --- trunk/src/operation.h (revision 29381) +++ trunk/src/operation.h (revision 29382) @@ -30,7 +30,7 @@ #ifndef PCB_OPERATION_H #define PCB_OPERATION_H -#include +#include "global_typedefs.h" /* Each object operation gets an operation-context with some operation-specific configuration, and the board to operate on. Optionally this is the place to Index: trunk/src/plug_io.h =================================================================== --- trunk/src/plug_io.h (revision 29381) +++ trunk/src/plug_io.h (revision 29382) @@ -30,7 +30,7 @@ #ifndef PCB_PLUG_IO_H #define PCB_PLUG_IO_H -#include +#include "global_typedefs.h" #include typedef enum { /* I/O type bitmask; each bit is one thing to save or load, not all formats support all things */ Index: trunk/src/polygon.h =================================================================== --- trunk/src/polygon.h (revision 29381) +++ trunk/src/polygon.h (revision 29382) @@ -33,6 +33,7 @@ #define PCB_POLYGON_H #include "config.h" +#include "global_typedefs.h" #include "flag.h" #include #include Index: trunk/src/rotate.h =================================================================== --- trunk/src/rotate.h (revision 29381) +++ trunk/src/rotate.h (revision 29382) @@ -29,6 +29,7 @@ #ifndef PCB_ROTATE_H #define PCB_ROTATE_H +#include "global_typedefs.h" #include #define PCB_ROTATE_TYPES (PCB_OBJ_PSTK | PCB_OBJ_SUBC | PCB_OBJ_TEXT | PCB_OBJ_ARC | PCB_OBJ_LINE_POINT | PCB_OBJ_LINE | PCB_OBJ_POLY | PCB_OBJ_FLOATER) Index: trunk/src/undo_old.h =================================================================== --- trunk/src/undo_old.h (revision 29381) +++ trunk/src/undo_old.h (revision 29382) @@ -31,7 +31,7 @@ #ifndef PCB_UNDO_OLD_H #define PCB_UNDO_OLD_H -#include +#include "global_typedefs.h" 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); Index: trunk/src/view.h =================================================================== --- trunk/src/view.h (revision 29381) +++ trunk/src/view.h (revision 29382) @@ -31,6 +31,7 @@ #include #include #include +#include "global_typedefs.h" #include #include "idpath.h" #include Index: trunk/src/vtonpoint.h =================================================================== --- trunk/src/vtonpoint.h (revision 29381) +++ trunk/src/vtonpoint.h (revision 29382) @@ -3,7 +3,7 @@ #include #include -#include +#include "global_typedefs.h" typedef struct pcb_onpoint_st { int type; Index: trunk/src_plugins/lib_gtk_common/wt_preview.c =================================================================== --- trunk/src_plugins/lib_gtk_common/wt_preview.c (revision 29381) +++ trunk/src_plugins/lib_gtk_common/wt_preview.c (revision 29382) @@ -127,10 +127,8 @@ { pcb_box_t view; - view.X1 = preview->obj->BoundingBox.X1; - view.Y1 = preview->obj->BoundingBox.Y1; - view.X2 = preview->obj->BoundingBox.X2; - view.Y2 = preview->obj->BoundingBox.Y2; + memcpy(&view, preview->obj, sizeof(pcb_box_t)); /* assumes the object's first field is pcb_box_t */ + pcb_gtk_preview_zoomto(preview, &view); }