2014-10-19 22:17:43 +00:00
|
|
|
/*
|
|
|
|
* This program source code file is part of KiCad, a free EDA CAD application.
|
|
|
|
*
|
|
|
|
* Copyright (C) 2007 Jean-Pierre Charras, jp.charras at wanadoo.fr
|
2016-04-16 07:49:17 +00:00
|
|
|
* Copyright (C) 2016 KiCad Developers, see CHANGELOG.TXT for contributors.
|
2014-10-19 22:17:43 +00:00
|
|
|
*
|
|
|
|
* 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, you may find one here:
|
|
|
|
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
|
|
|
* or you may search the http://www.gnu.org website for the version 2 license,
|
|
|
|
* or you may write to the Free Software Foundation, Inc.,
|
|
|
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
|
|
|
*/
|
|
|
|
|
2011-10-07 14:41:30 +00:00
|
|
|
/**
|
|
|
|
* @file general.h
|
|
|
|
*/
|
2007-05-06 16:03:28 +00:00
|
|
|
|
2008-02-26 01:07:38 +00:00
|
|
|
#ifndef _GENERAL_H_
|
|
|
|
#define _GENERAL_H_
|
|
|
|
|
2017-02-20 16:57:41 +00:00
|
|
|
#include <gal/color4d.h>
|
2017-03-13 03:19:33 +00:00
|
|
|
#include <layers_id_colors_and_visibility.h>
|
2017-02-20 16:57:41 +00:00
|
|
|
|
|
|
|
using KIGFX::COLOR4D;
|
2010-10-08 20:40:57 +00:00
|
|
|
|
2019-03-11 21:32:05 +00:00
|
|
|
class CONNECTION_GRAPH;
|
2010-11-10 15:30:12 +00:00
|
|
|
class TRANSFORM;
|
2013-09-25 19:09:57 +00:00
|
|
|
class SCH_SHEET;
|
2019-03-11 21:32:05 +00:00
|
|
|
class SCH_SHEET_PATH;
|
2010-11-10 15:30:12 +00:00
|
|
|
|
2019-03-19 00:19:00 +00:00
|
|
|
#define EESCHEMA_VERSION 5
|
2007-05-06 16:03:28 +00:00
|
|
|
#define SCHEMATIC_HEAD_STRING "Schematic File Version"
|
|
|
|
|
2013-09-25 19:09:57 +00:00
|
|
|
#define DANGLING_SYMBOL_SIZE 12
|
2007-05-06 16:03:28 +00:00
|
|
|
|
2015-04-22 11:39:00 +00:00
|
|
|
|
|
|
|
#define DEFAULT_REPEAT_OFFSET_X 0 ///< the default X value (overwritten by the eeschema config)
|
|
|
|
#define DEFAULT_REPEAT_OFFSET_Y 100 ///< the default Y value (overwritten by the eeschema config)
|
|
|
|
#define REPEAT_OFFSET_MAX 1000 ///< the max value of repeat offset value
|
|
|
|
#define DEFAULT_REPEAT_LABEL_INC 1 ///< the default value (overwritten by the eeschema config)
|
|
|
|
#define DEFAULT_REPEAT_OFFSET_PIN 100 ///< the default value (overwritten by the eeschema config)
|
|
|
|
///< when repeating a pin
|
|
|
|
|
2014-08-25 16:31:32 +00:00
|
|
|
///< The thickness to draw busses that do not have a specific width
|
2015-04-22 11:39:00 +00:00
|
|
|
///< (can be changed in preference menu)
|
2014-08-25 16:31:32 +00:00
|
|
|
#define DEFAULTBUSTHICKNESS 12
|
|
|
|
|
|
|
|
///< The thickness to draw lines that thickness is set to 0 (default thickness)
|
|
|
|
///< (can be changed in preference menu)
|
|
|
|
#define DEFAULTDRAWLINETHICKNESS 6
|
|
|
|
|
|
|
|
///< The default pin len value when creating pins(can be changed in preference menu)
|
2017-01-08 10:50:46 +00:00
|
|
|
#define DEFAULTPINLENGTH 100
|
2014-08-25 16:31:32 +00:00
|
|
|
|
2017-01-08 10:50:46 +00:00
|
|
|
///< The default pin number size when creating pins(can be changed in preference menu)
|
2014-08-25 16:31:32 +00:00
|
|
|
#define DEFAULTPINNUMSIZE 50
|
|
|
|
|
2017-01-08 10:50:46 +00:00
|
|
|
///< The default pin name size when creating pins(can be changed in preference menu)
|
2014-08-25 16:31:32 +00:00
|
|
|
#define DEFAULTPINNAMESIZE 50
|
|
|
|
|
2019-02-05 15:06:36 +00:00
|
|
|
///< The default library pane width
|
|
|
|
#define DEFAULTLIBWIDTH 250
|
|
|
|
|
2019-11-20 19:54:33 +00:00
|
|
|
///< The default selection highlight thickness
|
2019-12-03 19:47:36 +00:00
|
|
|
#define DEFAULTSELECTIONTHICKNESS 3
|
2019-11-20 19:54:33 +00:00
|
|
|
|
2010-11-10 15:30:12 +00:00
|
|
|
/* Rotation, mirror of graphic items in components bodies are handled by a
|
2012-09-28 17:47:41 +00:00
|
|
|
* transform matrix. The default matrix is useful to draw lib entries with
|
|
|
|
* using this default matrix ( no rotation, no mirror but Y axis is bottom to top, and
|
2015-04-22 11:39:00 +00:00
|
|
|
* Y draw axis is to to bottom so we must have a default matrix that reverses
|
2010-11-10 15:30:12 +00:00
|
|
|
* the Y coordinate and keeps the X coordiate
|
|
|
|
*/
|
|
|
|
extern TRANSFORM DefaultTransform;
|
|
|
|
|
2009-06-02 07:26:49 +00:00
|
|
|
/* First and main (root) screen */
|
2012-09-28 17:47:41 +00:00
|
|
|
extern SCH_SHEET* g_RootSheet;
|
2011-10-15 13:25:57 +00:00
|
|
|
|
2019-03-11 21:32:05 +00:00
|
|
|
/**
|
|
|
|
* With the new connectivity algorithm, many more places than before want to
|
|
|
|
* know what the current sheet is. This was moved here from SCH_EDIT_FRAME
|
|
|
|
* but we could refactor things to get rid of this global.
|
|
|
|
*/
|
|
|
|
extern SCH_SHEET_PATH* g_CurrentSheet; ///< which sheet we are presently working on.
|
|
|
|
|
|
|
|
/**
|
|
|
|
* This also wants to live in the eventual SCHEMATIC object
|
|
|
|
*/
|
|
|
|
extern CONNECTION_GRAPH* g_ConnectionGraph;
|
|
|
|
|
2012-04-05 18:27:56 +00:00
|
|
|
/**
|
2012-09-28 17:47:41 +00:00
|
|
|
* Default line thickness used to draw/plot items having a
|
2012-04-05 18:27:56 +00:00
|
|
|
* default thickness line value (i.e. = 0 ).
|
|
|
|
*/
|
2012-09-28 17:47:41 +00:00
|
|
|
int GetDefaultLineThickness();
|
2014-05-12 16:57:46 +00:00
|
|
|
void SetDefaultLineThickness( int aThickness );
|
|
|
|
|
2014-05-16 13:57:53 +00:00
|
|
|
/**
|
|
|
|
* Default size for text in general
|
|
|
|
*/
|
|
|
|
int GetDefaultTextSize();
|
|
|
|
void SetDefaultTextSize( int aSize );
|
|
|
|
|
2012-09-28 17:47:41 +00:00
|
|
|
/**
|
|
|
|
* Default line thickness used to draw/plot busses.
|
|
|
|
*/
|
|
|
|
int GetDefaultBusThickness();
|
|
|
|
void SetDefaultBusThickness( int aThickness );
|
2009-06-02 07:26:49 +00:00
|
|
|
|
2019-06-30 10:12:18 +00:00
|
|
|
/**
|
|
|
|
* Default line thickness used to draw/plot wires.
|
|
|
|
*/
|
|
|
|
int GetDefaultWireThickness();
|
|
|
|
void SetDefaultWireThickness( int aThickness );
|
|
|
|
|
2019-11-21 15:48:44 +00:00
|
|
|
/**
|
|
|
|
* Draw selected text items as box
|
|
|
|
*/
|
|
|
|
bool GetSelectionTextAsBox();
|
|
|
|
void SetSelectionTextAsBox( bool aBool );
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Draw selected child items or not
|
|
|
|
*/
|
|
|
|
bool GetSelectionDrawChildItems();
|
|
|
|
void SetSelectionDrawChildItems( bool aBool );
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Draw selected shapes as filled or not
|
|
|
|
*/
|
|
|
|
bool GetSelectionFillShapes();
|
|
|
|
void SetSelectionFillShapes( bool aBool );
|
|
|
|
|
2019-11-20 19:54:33 +00:00
|
|
|
/**
|
|
|
|
* Selection highlight thickness
|
|
|
|
*/
|
2019-12-03 19:47:36 +00:00
|
|
|
int GetSelectionThickness();
|
|
|
|
void SetSelectionThickness( int aThickness );
|
2019-11-21 15:48:44 +00:00
|
|
|
|
2017-03-13 03:19:33 +00:00
|
|
|
COLOR4D GetLayerColor( SCH_LAYER_ID aLayer );
|
|
|
|
void SetLayerColor( COLOR4D aColor, SCH_LAYER_ID aLayer );
|
2008-09-13 18:59:57 +00:00
|
|
|
|
2012-09-28 17:47:41 +00:00
|
|
|
// Color to draw selected items
|
2017-02-20 16:57:41 +00:00
|
|
|
COLOR4D GetItemSelectedColor();
|
2010-12-31 19:47:39 +00:00
|
|
|
|
2012-09-28 17:47:41 +00:00
|
|
|
// Color to draw items flagged invisible, in libedit (they are invisible in Eeschema
|
2017-02-20 16:57:41 +00:00
|
|
|
COLOR4D GetInvisibleItemColor();
|
2010-12-31 19:47:39 +00:00
|
|
|
|
2012-09-28 17:47:41 +00:00
|
|
|
#endif // _GENERAL_H_
|