From adf885b667ead647bb5b19d0963afd6fc24cd991 Mon Sep 17 00:00:00 2001 From: Seth Hillbrand Date: Fri, 19 Mar 2021 16:38:11 -0700 Subject: [PATCH] Move pcbnew swig Separates the python scripts into those using swig and those needed for other scripting --- pcbnew/CMakeLists.txt | 60 +++++++++---------- .../dialogs/dialog_footprint_wizard_list.cpp | 2 +- .../dialogs/panel_pcbnew_action_plugins.cpp | 2 +- pcbnew/footprint_edit_frame.cpp | 2 +- pcbnew/pcb_edit_frame.cpp | 2 +- .../scripting}/pcb_scripting_tool.cpp | 0 .../scripting}/pcb_scripting_tool.h | 0 .../scripting}/pcbnew_action_plugins.cpp | 0 .../scripting}/pcbnew_action_plugins.h | 0 .../scripting}/pcbnew_footprint_wizards.cpp | 0 .../scripting}/pcbnew_footprint_wizards.h | 0 .../scripting}/pcbnew_scripting.cpp | 0 .../scripting}/pcbnew_scripting.h | 0 .../scripting}/pcbnew_scripting_helpers.cpp | 2 + .../scripting}/pcbnew_scripting_helpers.h | 0 pcbnew/{ => python}/swig/board.i | 0 .../{ => python}/swig/board_connected_item.i | 0 .../{ => python}/swig/board_design_settings.i | 0 pcbnew/{ => python}/swig/board_item.i | 0 .../{ => python}/swig/board_item_container.i | 0 pcbnew/{ => python}/swig/connectivity.i | 0 pcbnew/{ => python}/swig/dimension.i | 0 pcbnew/{ => python}/swig/footprint.i | 0 pcbnew/{ => python}/swig/fp_shape.i | 0 pcbnew/{ => python}/swig/fp_text.i | 0 .../swig/layers_id_colors_and_visibility.i | 0 pcbnew/{ => python}/swig/marker_pcb.i | 0 pcbnew/{ => python}/swig/netinfo.i | 0 pcbnew/{ => python}/swig/pad.i | 0 pcbnew/{ => python}/swig/pcb_plot_params.i | 0 pcbnew/{ => python}/swig/pcb_shape.i | 0 pcbnew/{ => python}/swig/pcb_target.i | 0 pcbnew/{ => python}/swig/pcb_text.i | 0 pcbnew/{ => python}/swig/pcbnew.i | 0 pcbnew/{ => python}/swig/plugins.i | 0 pcbnew/{ => python}/swig/track.i | 0 pcbnew/{ => python}/swig/typeinfo.i | 0 pcbnew/{ => python}/swig/units.i | 0 pcbnew/{ => python}/swig/zone.i | 0 pcbnew/{ => python}/swig/zone_settings.i | 0 40 files changed, 36 insertions(+), 34 deletions(-) rename pcbnew/{swig => python/scripting}/pcb_scripting_tool.cpp (100%) rename pcbnew/{swig => python/scripting}/pcb_scripting_tool.h (100%) rename pcbnew/{swig => python/scripting}/pcbnew_action_plugins.cpp (100%) rename pcbnew/{swig => python/scripting}/pcbnew_action_plugins.h (100%) rename pcbnew/{swig => python/scripting}/pcbnew_footprint_wizards.cpp (100%) rename pcbnew/{swig => python/scripting}/pcbnew_footprint_wizards.h (100%) rename pcbnew/{swig => python/scripting}/pcbnew_scripting.cpp (100%) rename pcbnew/{swig => python/scripting}/pcbnew_scripting.h (100%) rename pcbnew/{swig => python/scripting}/pcbnew_scripting_helpers.cpp (99%) rename pcbnew/{swig => python/scripting}/pcbnew_scripting_helpers.h (100%) rename pcbnew/{ => python}/swig/board.i (100%) rename pcbnew/{ => python}/swig/board_connected_item.i (100%) rename pcbnew/{ => python}/swig/board_design_settings.i (100%) rename pcbnew/{ => python}/swig/board_item.i (100%) rename pcbnew/{ => python}/swig/board_item_container.i (100%) rename pcbnew/{ => python}/swig/connectivity.i (100%) rename pcbnew/{ => python}/swig/dimension.i (100%) rename pcbnew/{ => python}/swig/footprint.i (100%) rename pcbnew/{ => python}/swig/fp_shape.i (100%) rename pcbnew/{ => python}/swig/fp_text.i (100%) rename pcbnew/{ => python}/swig/layers_id_colors_and_visibility.i (100%) rename pcbnew/{ => python}/swig/marker_pcb.i (100%) rename pcbnew/{ => python}/swig/netinfo.i (100%) rename pcbnew/{ => python}/swig/pad.i (100%) rename pcbnew/{ => python}/swig/pcb_plot_params.i (100%) rename pcbnew/{ => python}/swig/pcb_shape.i (100%) rename pcbnew/{ => python}/swig/pcb_target.i (100%) rename pcbnew/{ => python}/swig/pcb_text.i (100%) rename pcbnew/{ => python}/swig/pcbnew.i (100%) rename pcbnew/{ => python}/swig/plugins.i (100%) rename pcbnew/{ => python}/swig/track.i (100%) rename pcbnew/{ => python}/swig/typeinfo.i (100%) rename pcbnew/{ => python}/swig/units.i (100%) rename pcbnew/{ => python}/swig/zone.i (100%) rename pcbnew/{ => python}/swig/zone_settings.i (100%) diff --git a/pcbnew/CMakeLists.txt b/pcbnew/CMakeLists.txt index b319a31caa..02c8fae3bb 100644 --- a/pcbnew/CMakeLists.txt +++ b/pcbnew/CMakeLists.txt @@ -21,7 +21,7 @@ add_dependencies( pnsrouter pcbcommon ) file( MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/swig ) # Infrequently needed headers go at end of search paths, append to INC_AFTER -set( INC_AFTER ${INC_AFTER} swig ) +set( INC_AFTER ${INC_AFTER} python/scripting ) set( INC_AFTER ${INC_AFTER} ${CMAKE_SOURCE_DIR}/common/swig ) include_directories( BEFORE ${INC_BEFORE} ) @@ -366,11 +366,11 @@ set( PCBNEW_COMMON_SRCS set( PCBNEW_SCRIPTING_PYTHON_HELPERS ${CMAKE_SOURCE_DIR}/common/swig/wx_python_helpers.cpp - swig/pcbnew_action_plugins.cpp - swig/pcbnew_footprint_wizards.cpp - swig/pcbnew_scripting_helpers.cpp - swig/pcbnew_scripting.cpp - swig/pcb_scripting_tool.cpp + python/scripting/pcbnew_action_plugins.cpp + python/scripting/pcbnew_footprint_wizards.cpp + python/scripting/pcbnew_scripting_helpers.cpp + python/scripting/pcbnew_scripting.cpp + python/scripting/pcb_scripting_tool.cpp ) @@ -442,30 +442,30 @@ add_custom_command( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/pcbnew_wrap.cxx DEPENDS plotcontroller.h DEPENDS exporters/gendrill_Excellon_writer.h DEPENDS exporters/export_vrml.h - DEPENDS swig/pcbnew.i - DEPENDS swig/board.i - DEPENDS swig/board_connected_item.i - DEPENDS swig/board_design_settings.i - DEPENDS swig/board_item.i - DEPENDS swig/board_item_container.i - DEPENDS swig/connectivity.i - DEPENDS swig/dimension.i - DEPENDS swig/pcb_shape.i - DEPENDS swig/fp_shape.i - DEPENDS swig/marker_pcb.i - DEPENDS swig/pcb_target.i - DEPENDS swig/pcb_plot_params.i - DEPENDS swig/footprint.i - DEPENDS swig/netinfo.i - DEPENDS swig/pad.i - DEPENDS swig/pcb_text.i - DEPENDS swig/plugins.i - DEPENDS swig/fp_text.i - DEPENDS swig/track.i - DEPENDS swig/units.i - DEPENDS swig/typeinfo.i - DEPENDS swig/zone.i - DEPENDS swig/zone_settings.i + DEPENDS python/swig/pcbnew.i + DEPENDS python/swig/board.i + DEPENDS python/swig/board_connected_item.i + DEPENDS python/swig/board_design_settings.i + DEPENDS python/swig/board_item.i + DEPENDS python/swig/board_item_container.i + DEPENDS python/swig/connectivity.i + DEPENDS python/swig/dimension.i + DEPENDS python/swig/pcb_shape.i + DEPENDS python/swig/fp_shape.i + DEPENDS python/swig/marker_pcb.i + DEPENDS python/swig/pcb_target.i + DEPENDS python/swig/pcb_plot_params.i + DEPENDS python/swig/footprint.i + DEPENDS python/swig/netinfo.i + DEPENDS python/swig/pad.i + DEPENDS python/swig/pcb_text.i + DEPENDS python/swig/plugins.i + DEPENDS python/swig/fp_text.i + DEPENDS python/swig/track.i + DEPENDS python/swig/units.i + DEPENDS python/swig/typeinfo.i + DEPENDS python/swig/zone.i + DEPENDS python/swig/zone_settings.i DEPENDS ${CMAKE_SOURCE_DIR}/common/swig/kicad.i DEPENDS ${CMAKE_SOURCE_DIR}/common/swig/wx.i diff --git a/pcbnew/dialogs/dialog_footprint_wizard_list.cpp b/pcbnew/dialogs/dialog_footprint_wizard_list.cpp index cbe72f42a1..f2af04de0d 100644 --- a/pcbnew/dialogs/dialog_footprint_wizard_list.cpp +++ b/pcbnew/dialogs/dialog_footprint_wizard_list.cpp @@ -36,7 +36,7 @@ #include #include -#include +#include enum FPGeneratorRowNames { diff --git a/pcbnew/dialogs/panel_pcbnew_action_plugins.cpp b/pcbnew/dialogs/panel_pcbnew_action_plugins.cpp index e2b34344f9..0e8e2ea3bc 100644 --- a/pcbnew/dialogs/panel_pcbnew_action_plugins.cpp +++ b/pcbnew/dialogs/panel_pcbnew_action_plugins.cpp @@ -25,7 +25,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/pcbnew/footprint_edit_frame.cpp b/pcbnew/footprint_edit_frame.cpp index 3985d53449..e24e3d861c 100644 --- a/pcbnew/footprint_edit_frame.cpp +++ b/pcbnew/footprint_edit_frame.cpp @@ -31,7 +31,7 @@ #include "tools/placement_tool.h" #include "tools/pcb_point_editor.h" #include "tools/pcb_selection_tool.h" -#include +#include #include <3d_viewer/eda_3d_viewer.h> #include #include diff --git a/pcbnew/pcb_edit_frame.cpp b/pcbnew/pcb_edit_frame.cpp index 3f6bf3c00e..76f49751ca 100644 --- a/pcbnew/pcb_edit_frame.cpp +++ b/pcbnew/pcb_edit_frame.cpp @@ -84,7 +84,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/pcbnew/swig/pcb_scripting_tool.cpp b/pcbnew/python/scripting/pcb_scripting_tool.cpp similarity index 100% rename from pcbnew/swig/pcb_scripting_tool.cpp rename to pcbnew/python/scripting/pcb_scripting_tool.cpp diff --git a/pcbnew/swig/pcb_scripting_tool.h b/pcbnew/python/scripting/pcb_scripting_tool.h similarity index 100% rename from pcbnew/swig/pcb_scripting_tool.h rename to pcbnew/python/scripting/pcb_scripting_tool.h diff --git a/pcbnew/swig/pcbnew_action_plugins.cpp b/pcbnew/python/scripting/pcbnew_action_plugins.cpp similarity index 100% rename from pcbnew/swig/pcbnew_action_plugins.cpp rename to pcbnew/python/scripting/pcbnew_action_plugins.cpp diff --git a/pcbnew/swig/pcbnew_action_plugins.h b/pcbnew/python/scripting/pcbnew_action_plugins.h similarity index 100% rename from pcbnew/swig/pcbnew_action_plugins.h rename to pcbnew/python/scripting/pcbnew_action_plugins.h diff --git a/pcbnew/swig/pcbnew_footprint_wizards.cpp b/pcbnew/python/scripting/pcbnew_footprint_wizards.cpp similarity index 100% rename from pcbnew/swig/pcbnew_footprint_wizards.cpp rename to pcbnew/python/scripting/pcbnew_footprint_wizards.cpp diff --git a/pcbnew/swig/pcbnew_footprint_wizards.h b/pcbnew/python/scripting/pcbnew_footprint_wizards.h similarity index 100% rename from pcbnew/swig/pcbnew_footprint_wizards.h rename to pcbnew/python/scripting/pcbnew_footprint_wizards.h diff --git a/pcbnew/swig/pcbnew_scripting.cpp b/pcbnew/python/scripting/pcbnew_scripting.cpp similarity index 100% rename from pcbnew/swig/pcbnew_scripting.cpp rename to pcbnew/python/scripting/pcbnew_scripting.cpp diff --git a/pcbnew/swig/pcbnew_scripting.h b/pcbnew/python/scripting/pcbnew_scripting.h similarity index 100% rename from pcbnew/swig/pcbnew_scripting.h rename to pcbnew/python/scripting/pcbnew_scripting.h diff --git a/pcbnew/swig/pcbnew_scripting_helpers.cpp b/pcbnew/python/scripting/pcbnew_scripting_helpers.cpp similarity index 99% rename from pcbnew/swig/pcbnew_scripting_helpers.cpp rename to pcbnew/python/scripting/pcbnew_scripting_helpers.cpp index 2aab89f0e6..85bdcf8388 100644 --- a/pcbnew/swig/pcbnew_scripting_helpers.cpp +++ b/pcbnew/python/scripting/pcbnew_scripting_helpers.cpp @@ -30,6 +30,8 @@ #include #undef HAVE_CLOCK_GETTIME // macro is defined in Python.h and causes redefine warning +#include "pcbnew_scripting_helpers.h" + #include #include #include diff --git a/pcbnew/swig/pcbnew_scripting_helpers.h b/pcbnew/python/scripting/pcbnew_scripting_helpers.h similarity index 100% rename from pcbnew/swig/pcbnew_scripting_helpers.h rename to pcbnew/python/scripting/pcbnew_scripting_helpers.h diff --git a/pcbnew/swig/board.i b/pcbnew/python/swig/board.i similarity index 100% rename from pcbnew/swig/board.i rename to pcbnew/python/swig/board.i diff --git a/pcbnew/swig/board_connected_item.i b/pcbnew/python/swig/board_connected_item.i similarity index 100% rename from pcbnew/swig/board_connected_item.i rename to pcbnew/python/swig/board_connected_item.i diff --git a/pcbnew/swig/board_design_settings.i b/pcbnew/python/swig/board_design_settings.i similarity index 100% rename from pcbnew/swig/board_design_settings.i rename to pcbnew/python/swig/board_design_settings.i diff --git a/pcbnew/swig/board_item.i b/pcbnew/python/swig/board_item.i similarity index 100% rename from pcbnew/swig/board_item.i rename to pcbnew/python/swig/board_item.i diff --git a/pcbnew/swig/board_item_container.i b/pcbnew/python/swig/board_item_container.i similarity index 100% rename from pcbnew/swig/board_item_container.i rename to pcbnew/python/swig/board_item_container.i diff --git a/pcbnew/swig/connectivity.i b/pcbnew/python/swig/connectivity.i similarity index 100% rename from pcbnew/swig/connectivity.i rename to pcbnew/python/swig/connectivity.i diff --git a/pcbnew/swig/dimension.i b/pcbnew/python/swig/dimension.i similarity index 100% rename from pcbnew/swig/dimension.i rename to pcbnew/python/swig/dimension.i diff --git a/pcbnew/swig/footprint.i b/pcbnew/python/swig/footprint.i similarity index 100% rename from pcbnew/swig/footprint.i rename to pcbnew/python/swig/footprint.i diff --git a/pcbnew/swig/fp_shape.i b/pcbnew/python/swig/fp_shape.i similarity index 100% rename from pcbnew/swig/fp_shape.i rename to pcbnew/python/swig/fp_shape.i diff --git a/pcbnew/swig/fp_text.i b/pcbnew/python/swig/fp_text.i similarity index 100% rename from pcbnew/swig/fp_text.i rename to pcbnew/python/swig/fp_text.i diff --git a/pcbnew/swig/layers_id_colors_and_visibility.i b/pcbnew/python/swig/layers_id_colors_and_visibility.i similarity index 100% rename from pcbnew/swig/layers_id_colors_and_visibility.i rename to pcbnew/python/swig/layers_id_colors_and_visibility.i diff --git a/pcbnew/swig/marker_pcb.i b/pcbnew/python/swig/marker_pcb.i similarity index 100% rename from pcbnew/swig/marker_pcb.i rename to pcbnew/python/swig/marker_pcb.i diff --git a/pcbnew/swig/netinfo.i b/pcbnew/python/swig/netinfo.i similarity index 100% rename from pcbnew/swig/netinfo.i rename to pcbnew/python/swig/netinfo.i diff --git a/pcbnew/swig/pad.i b/pcbnew/python/swig/pad.i similarity index 100% rename from pcbnew/swig/pad.i rename to pcbnew/python/swig/pad.i diff --git a/pcbnew/swig/pcb_plot_params.i b/pcbnew/python/swig/pcb_plot_params.i similarity index 100% rename from pcbnew/swig/pcb_plot_params.i rename to pcbnew/python/swig/pcb_plot_params.i diff --git a/pcbnew/swig/pcb_shape.i b/pcbnew/python/swig/pcb_shape.i similarity index 100% rename from pcbnew/swig/pcb_shape.i rename to pcbnew/python/swig/pcb_shape.i diff --git a/pcbnew/swig/pcb_target.i b/pcbnew/python/swig/pcb_target.i similarity index 100% rename from pcbnew/swig/pcb_target.i rename to pcbnew/python/swig/pcb_target.i diff --git a/pcbnew/swig/pcb_text.i b/pcbnew/python/swig/pcb_text.i similarity index 100% rename from pcbnew/swig/pcb_text.i rename to pcbnew/python/swig/pcb_text.i diff --git a/pcbnew/swig/pcbnew.i b/pcbnew/python/swig/pcbnew.i similarity index 100% rename from pcbnew/swig/pcbnew.i rename to pcbnew/python/swig/pcbnew.i diff --git a/pcbnew/swig/plugins.i b/pcbnew/python/swig/plugins.i similarity index 100% rename from pcbnew/swig/plugins.i rename to pcbnew/python/swig/plugins.i diff --git a/pcbnew/swig/track.i b/pcbnew/python/swig/track.i similarity index 100% rename from pcbnew/swig/track.i rename to pcbnew/python/swig/track.i diff --git a/pcbnew/swig/typeinfo.i b/pcbnew/python/swig/typeinfo.i similarity index 100% rename from pcbnew/swig/typeinfo.i rename to pcbnew/python/swig/typeinfo.i diff --git a/pcbnew/swig/units.i b/pcbnew/python/swig/units.i similarity index 100% rename from pcbnew/swig/units.i rename to pcbnew/python/swig/units.i diff --git a/pcbnew/swig/zone.i b/pcbnew/python/swig/zone.i similarity index 100% rename from pcbnew/swig/zone.i rename to pcbnew/python/swig/zone.i diff --git a/pcbnew/swig/zone_settings.i b/pcbnew/python/swig/zone_settings.i similarity index 100% rename from pcbnew/swig/zone_settings.i rename to pcbnew/python/swig/zone_settings.i