mirror of
https://gitlab.com/kicad/code/kicad.git
synced 2025-04-14 13:09:35 +00:00
Move all CTL_OMIT_xxx flags definitions into a new file ctl_flags.h
Previously, they were defined in different files, and sometimes redefined. This change should not create an actual code change. However, this move shows there are the same value used for different flags, so another fix should be made later.
This commit is contained in:
parent
f2d32b64d6
commit
a075a80b3c
common
include
pcbnew
@ -48,6 +48,7 @@
|
||||
#include <font/outline_font.h>
|
||||
#include <geometry/shape_poly_set.h>
|
||||
#include <properties/property_validators.h>
|
||||
#include <ctl_flags.h> // for CTL_OMIT_HIDE definition
|
||||
|
||||
#include <wx/debug.h> // for wxASSERT
|
||||
#include <wx/string.h>
|
||||
|
44
include/ctl_flags.h
Normal file
44
include/ctl_flags.h
Normal file
@ -0,0 +1,44 @@
|
||||
/*
|
||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2024 Jean-Pierre Charras.
|
||||
* Copyright (C) 2024 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
*
|
||||
* 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 3 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, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
// These flags are used to control the data items that must be disabled when creating
|
||||
// mainly a netlist but also some other kicad files.
|
||||
// They allow skipping specified data in these files.
|
||||
|
||||
#define CTL_OMIT_EXTRA (1 << 0)
|
||||
#define CTL_OMIT_NETS (1 << 1)
|
||||
#define CTL_OMIT_PAD_NETS (1 << 1) ///< Omit pads net names (useless in library)
|
||||
#define CTL_OMIT_FILTERS (1 << 2)
|
||||
#define CTL_OMIT_UUIDS (1 << 2) ///< Omit component unique ids (useless in library)
|
||||
#define CTL_OMIT_FP_UUID (1 << 3) ///< Don't prefix the footprint UUID to the sheet path.
|
||||
#define CTL_OMIT_INITIAL_COMMENTS (1 << 3) ///< omit FOOTPRINT initial comments
|
||||
#define CTL_OMIT_PATH (1 << 4) ///< Omit component sheet time stamp (useless in library)
|
||||
#define CTL_OMIT_AT (1 << 5) ///< Omit position and rotation. (always saved
|
||||
///< with position 0,0 and rotation = 0 in library).
|
||||
|
||||
// If set, when calling EDA_TEXT::Format, disable writing the "hide" keyword in save file
|
||||
#define CTL_OMIT_HIDE (1 << 6)
|
||||
|
||||
#define CTL_OMIT_LIBNAME (1 << 7) ///< Omit lib alias when saving (used for
|
||||
///< board/not library).
|
||||
#define CTL_OMIT_FOOTPRINT_VERSION (1 << 8) ///< Omit the version string from the (footprint)
|
||||
///< sexpr group
|
@ -33,6 +33,7 @@
|
||||
#include <font/glyph.h>
|
||||
#include <font/text_attributes.h>
|
||||
|
||||
|
||||
class OUTPUTFORMATTER;
|
||||
class SHAPE_COMPOUND;
|
||||
class SHAPE_POLY_SET;
|
||||
@ -60,11 +61,6 @@ namespace KIFONT
|
||||
using KIGFX::RENDER_SETTINGS;
|
||||
using KIGFX::COLOR4D;
|
||||
|
||||
// part of the kicad_plugin.h family of defines.
|
||||
// See kicad_plugin.h for the choice of the value
|
||||
// When set when calling EDA_TEXT::Format, disable writing the "hide" keyword in save file
|
||||
#define CTL_OMIT_HIDE (1 << 6)
|
||||
|
||||
|
||||
/**
|
||||
* This is the "default-of-the-default" hardcoded text size; individual application define their
|
||||
|
@ -32,6 +32,7 @@
|
||||
|
||||
#include <lib_id.h>
|
||||
#include <footprint.h>
|
||||
#include <ctl_flags.h>
|
||||
|
||||
|
||||
class REPORTER;
|
||||
@ -293,11 +294,6 @@ public:
|
||||
|
||||
void Format( const char* aDocName, OUTPUTFORMATTER* aOut, int aNestLevel, int aCtl = 0 );
|
||||
|
||||
#define CTL_OMIT_EXTRA (1<<0)
|
||||
#define CTL_OMIT_NETS (1<<1)
|
||||
#define CTL_OMIT_FILTERS (1<<2)
|
||||
#define CTL_OMIT_FP_UUID (1<<3) ///< Don't prefix the footprint UUID to the sheet path.
|
||||
|
||||
#define CTL_FOR_CVPCB (CTL_OMIT_NETS | CTL_OMIT_FILTERS | CTL_OMIT_EXTRA)
|
||||
|
||||
void FormatCvpcbNetlist( OUTPUTFORMATTER* aOut )
|
||||
|
@ -69,6 +69,7 @@
|
||||
|
||||
#include <build_version.h>
|
||||
#include <filter_reader.h>
|
||||
#include <ctl_flags.h>
|
||||
|
||||
|
||||
using namespace PCB_KEYS_T;
|
||||
|
@ -27,6 +27,7 @@
|
||||
|
||||
#include <pcb_io/pcb_io.h>
|
||||
#include <pcb_io/pcb_io_mgr.h>
|
||||
#include <ctl_flags.h>
|
||||
|
||||
#include <richio.h>
|
||||
#include <string>
|
||||
@ -165,17 +166,6 @@ class PCB_IO_KICAD_SEXPR; // forward decl
|
||||
///< to indicate a net-tie.
|
||||
#define FIRST_NORMALIZED_VERISON 20230924 ///< Earlier files did not have normalized bools
|
||||
|
||||
#define CTL_OMIT_PAD_NETS (1 << 1) ///< Omit pads net names (useless in library)
|
||||
#define CTL_OMIT_UUIDS (1 << 2) ///< Omit component unique ids (useless in library)
|
||||
#define CTL_OMIT_INITIAL_COMMENTS (1 << 3) ///< omit FOOTPRINT initial comments
|
||||
#define CTL_OMIT_PATH (1 << 4) ///< Omit component sheet time stamp (useless in library)
|
||||
#define CTL_OMIT_AT (1 << 5) ///< Omit position and rotation. (always saved
|
||||
///< with position 0,0 and rotation = 0 in library).
|
||||
//#define CTL_OMIT_HIDE (1 << 6) // found and defined in eda_text.h
|
||||
#define CTL_OMIT_LIBNAME (1 << 7) ///< Omit lib alias when saving (used for
|
||||
///< board/not library).
|
||||
#define CTL_OMIT_FOOTPRINT_VERSION (1 << 8) ///< Omit the version string from the (footprint)
|
||||
///<sexpr group
|
||||
|
||||
// common combinations of the above:
|
||||
|
||||
@ -183,7 +173,7 @@ class PCB_IO_KICAD_SEXPR; // forward decl
|
||||
#define CTL_FOR_CLIPBOARD (CTL_OMIT_INITIAL_COMMENTS) // (CTL_OMIT_NETS)
|
||||
|
||||
/// Format output for a footprint library instead of clipboard or BOARD
|
||||
#define CTL_FOR_LIBRARY \
|
||||
#define CTL_FOR_LIBRARY \
|
||||
( CTL_OMIT_PAD_NETS | CTL_OMIT_UUIDS | CTL_OMIT_PATH | CTL_OMIT_AT | CTL_OMIT_LIBNAME )
|
||||
|
||||
/// The zero arg constructor when PCB_PLUGIN is used for PLUGIN::Load() and PLUGIN::Save()ing
|
||||
|
Loading…
Reference in New Issue
Block a user