pcb 4.1.1
An interactive printed circuit board layout editor.
|
Drawing routines. More...
#include "global.h"
#include "hid_draw.h"
#include "compat.h"
#include "crosshair.h"
#include "data.h"
#include "draw.h"
#include "error.h"
#include "mymem.h"
#include "misc.h"
#include "rotate.h"
#include "rtree.h"
#include "search.h"
#include "select.h"
#include "print.h"
#include <assert.h>
Go to the source code of this file.
Data Structures | |
struct | hole_info |
struct | poly_info |
Defines | |
#define | MAXINT (((unsigned int)(~0))>>1) |
#define | SMALL_SMALL_TEXT_SIZE 0 |
#define | SMALL_TEXT_SIZE 1 |
#define | NORMAL_TEXT_SIZE 2 |
#define | LARGE_TEXT_SIZE 3 |
#define | N_TEXT_SIZES 4 |
Functions | |
static void | DrawEverything (const BoxType *drawn_area) |
Initializes some identifiers for a new zoom factor and redraws whole screen. | |
static void | DrawPPV (int group, const BoxType *drawn_area) |
Draws pins pads and vias - Always draws for non-gui HIDs, otherwise drawing depends on PCB->PinOn and PCB->ViaOn. | |
static void | AddPart (void *b) |
Adds the update rect to the update region. | |
static void | DrawEMark (ElementType *, Coord, Coord, bool) |
static void | DrawRats (const BoxType *) |
static void | set_object_color (AnyObjectType *obj, char *warn_color, char *selected_color, char *connected_color, char *found_color, char *normal_color) |
static void | set_layer_object_color (LayerType *layer, AnyObjectType *obj) |
void | Draw (void) |
Initiate the actual redrawing of the updated area. | |
void | Redraw (void) |
Redraws all the data by the event handlers. | |
static void | _draw_pv_name (PinType *pv) |
static void | _draw_pv (PinType *pv, bool draw_hole) |
static void | draw_pin (PinType *pin, bool draw_hole) |
static int | pin_callback (const BoxType *b, void *cl) |
static void | draw_via (PinType *via, bool draw_hole) |
static bool | via_visible_on_layer_group (PinType *via) |
static int | via_callback (const BoxType *b, void *cl) |
static void | draw_pad_name (PadType *pad) |
static void | _draw_pad (hidGC gc, PadType *pad, bool clear, bool mask) |
static void | draw_pad (PadType *pad) |
static int | pad_callback (const BoxType *b, void *cl) |
static void | draw_element_name (ElementType *element) |
static int | name_callback (const BoxType *b, void *cl) |
static void | draw_element_pins_and_pads (ElementType *element) |
static int | EMark_callback (const BoxType *b, void *cl) |
static int | hole_callback (const BoxType *b, void *cl) |
void | DrawHoles (bool draw_plated, bool draw_unplated, const BoxType *drawn_area, Cardinal g_from, Cardinal g_to) |
static int | line_callback (const BoxType *b, void *cl) |
static int | rat_callback (const BoxType *b, void *cl) |
static int | arc_callback (const BoxType *b, void *cl) |
static void | draw_element_package (ElementType *element) |
static int | element_callback (const BoxType *b, void *cl) |
void | PrintAssembly (int side, const BoxType *drawn_area) |
Prints assembly drawing. | |
static int | clearPin_callback (const BoxType *b, void *cl) |
static int | poly_callback (const BoxType *b, void *cl) |
static int | clearPad_callback (const BoxType *b, void *cl) |
void | DrawSilk (int side, const BoxType *drawn_area) |
Draws silk layer. | |
static void | DrawMaskBoardArea (int mask_type, const BoxType *drawn_area) |
void | DrawMask (int side, const BoxType *screen) |
Draws solder mask layer - this will cover nearly everything. | |
void | DrawPaste (int side, const BoxType *drawn_area) |
Draws solder paste layer for a given side of the board. | |
static int | text_callback (const BoxType *b, void *cl) |
void | DrawLayer (LayerType *Layer, const BoxType *screen) |
void | DrawLayerGroup (int group, const BoxType *drawn_area) |
Draws one layer group. | |
static void | GatherPVName (PinType *Ptr) |
static void | GatherPadName (PadType *Pad) |
void | DrawVia (PinType *Via) |
Draw a via object. | |
void | DrawViaName (PinType *Via) |
Draws the name of a via. | |
void | DrawPin (PinType *Pin) |
Draw a pin object. | |
void | DrawPinName (PinType *Pin) |
Draws the name of a pin. | |
void | DrawPad (PadType *Pad) |
Draw a pad object. | |
void | DrawPadName (PadType *Pad) |
Draws the name of a pad. | |
void | DrawLine (LayerType *Layer, LineType *Line) |
Draws a line on a layer. | |
void | DrawRat (RatType *Rat) |
Draws a ratline. | |
void | DrawArc (LayerType *Layer, ArcType *Arc) |
Draws an arc on a layer. | |
void | DrawText (LayerType *Layer, TextType *Text) |
Draws a text on a layer. | |
void | DrawPolygon (LayerType *Layer, PolygonType *Polygon) |
Draws a polygon on a layer. | |
void | DrawElement (ElementType *Element) |
Draws an element. | |
void | DrawElementName (ElementType *Element) |
Draws the name of an element. | |
void | DrawElementPackage (ElementType *Element) |
Draws the package of an element. | |
void | DrawElementPinsAndPads (ElementType *Element) |
Draw pins of an element. | |
void | EraseVia (PinType *Via) |
Erase a via. | |
void | EraseRat (RatType *Rat) |
Erase a ratline. | |
void | EraseViaName (PinType *Via) |
Erase a via name. | |
void | ErasePad (PadType *Pad) |
Erase a pad object. | |
void | ErasePadName (PadType *Pad) |
Erase a pad name. | |
void | ErasePin (PinType *Pin) |
Erase a pin object. | |
void | ErasePinName (PinType *Pin) |
Erase a pin name. | |
void | EraseLine (LineType *Line) |
Erases a line on a layer. | |
void | EraseArc (ArcType *Arc) |
Erases an arc on a layer. | |
void | EraseText (LayerType *Layer, TextType *Text) |
Erases a text on a layer. | |
void | ErasePolygon (PolygonType *Polygon) |
Erases a polygon on a layer. | |
void | EraseElement (ElementType *Element) |
Erases an element. | |
void | EraseElementPinsAndPads (ElementType *Element) |
Erases all pins and pads of an element. | |
void | EraseElementName (ElementType *Element) |
Erases the name of an element. | |
void | EraseObject (int type, void *lptr, void *ptr) |
void | DrawObject (int type, void *ptr1, void *ptr2) |
static void | draw_element (ElementType *element) |
void | hid_expose_callback (HID *hid, BoxType *region, void *item) |
HID drawing callback. | |
Variables | |
static BoxType | Block = {MAXINT, MAXINT, -MAXINT, -MAXINT} |
static int | doing_pinout = 0 |
static bool | doing_assy = false |
static int | current_layergroup |
Drawing routines.
PCB, interactive printed circuit board design
Copyright (C) 1994,1995,1996, 2003, 2004 Thomas Nau
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 addresses for paper mail and Email: Thomas Nau, Schlehenweg 15, 88471 Baustetten, Germany Thomas.Nau@rz.uni-ulm.de
Definition in file draw.c.
#define MAXINT (((unsigned int)(~0))>>1) |
Definition at line 318 of file draw.c.
References hid_draw_st::fill_pcb_pad, hid_st::graphics, gui, PCB, TEST_FLAG, and hid_draw_st::thindraw_pcb_pad.
Referenced by clearPad_callback(), draw_pad(), and DrawPaste().
static void _draw_pv | ( | PinType * | pv, |
bool | draw_hole | ||
) | [static] |
Definition at line 191 of file draw.c.
References _draw_pv_name(), OutputType::bgGC, pin_st::BuriedFrom, pin_st::BuriedTo, LayerType::Color, PCBType::Data, doing_pinout, hid_draw_st::draw_arc, pin_st::DrillingHole, OutputType::fgGC, hid_draw_st::fill_pcb_pv, hid_st::graphics, hid_st::gui, gui, DataType::Layer, Output, PCB, hid_draw_st::set_color, hid_draw_st::set_line_cap, hid_draw_st::set_line_width, Square_Cap, TEST_FLAG, pin_st::Thickness, hid_draw_st::thindraw_pcb_pv, VIA_IS_BURIED, ViaIsOnAnyVisibleLayer(), pin_st::X, and pin_st::Y.
Referenced by draw_pin(), and draw_via().
static void _draw_pv_name | ( | PinType * | pv | ) | [static] |
Definition at line 150 of file draw.c.
References box, TextType::Direction, doing_pinout, hid_draw_st::draw_pcb_text, pin_st::DrillingHole, EMPTY, OutputType::fgGC, hid_st::graphics, hid_st::gui, gui, pin_st::Name, NoFlags, pin_st::Number, Output, PCB, PCBType::PinNameColor, SettingType::PinoutTextOffsetX, SettingType::PinoutTextOffsetY, TextType::Scale, hid_draw_st::set_color, Settings, TEST_FLAG, TextType::TextString, pin_st::Thickness, TextType::X, pin_st::X, BoxType::X1, TextType::Y, pin_st::Y, and BoxType::Y1.
Referenced by _draw_pv().
static void AddPart | ( | void * | b | ) | [static] |
Adds the update rect to the update region.
Definition at line 116 of file draw.c.
References box, MAX, MIN, BoxType::X1, BoxType::X2, BoxType::Y1, and BoxType::Y2.
Referenced by DrawArc(), DrawLine(), DrawPad(), DrawPin(), DrawPolygon(), DrawRat(), DrawText(), DrawVia(), EraseArc(), EraseLine(), ErasePad(), ErasePin(), ErasePolygon(), EraseRat(), EraseText(), EraseVia(), GatherPadName(), and GatherPVName().
static int arc_callback | ( | const BoxType * | b, |
void * | cl | ||
) | [static] |
Definition at line 551 of file draw.c.
References hid_draw_st::draw_pcb_arc, OutputType::fgGC, hid_st::graphics, gui, layer, Output, and set_layer_object_color().
Referenced by DrawLayer().
static int clearPad_callback | ( | const BoxType * | b, |
void * | cl | ||
) | [static] |
Definition at line 914 of file draw.c.
References _draw_pad(), pad_st::Mask, ON_SIDE, Output, and OutputType::pmGC.
Referenced by DrawMask(), and DrawSilk().
static int clearPin_callback | ( | const BoxType * | b, |
void * | cl | ||
) | [static] |
Definition at line 885 of file draw.c.
References hid_draw_st::fill_pcb_pv, hid_st::graphics, gui, Output, PCB, pin, OutputType::pmGC, TEST_FLAG, and hid_draw_st::thindraw_pcb_pv.
Referenced by DrawMask(), and DrawSilk().
void Draw | ( | void | ) |
Initiate the actual redrawing of the updated area.
Definition at line 130 of file draw.c.
References gui, hid_st::invalidate_lr, MAXINT, BoxType::X1, BoxType::X2, BoxType::Y1, and BoxType::Y2.
Referenced by ActionAddRats(), ActionChangeName(), ActionConnection(), ActionDisplay(), ActionFlip(), ActionMorphPolygon(), ActionSelect(), ActionSetThermal(), ActionToggleHideName(), ActionUnselect(), AddAllRats(), ChangeHole(), ChangeObject2ndSize(), ChangeObjectClearSize(), ChangeObjectJoin(), ChangeObjectMaskSize(), ChangeObjectName(), ChangeObjectOctagon(), ChangeObjectSize(), ChangeObjectSquare(), ChangeObjectThermal(), ChangeObjectViaLayers(), ChangePaste(), ChangeSelected2ndSize(), ChangeSelectedClearSize(), ChangeSelectedElementSide(), ChangeSelectedHole(), ChangeSelectedJoin(), ChangeSelectedOctagon(), ChangeSelectedPaste(), ChangeSelectedSize(), ChangeSelectedSquare(), ChangeSelectedThermals(), ChangeSelectedViaLayers(), ClearWarnings(), ClosePolygon(), ClrObjectJoin(), ClrObjectOctagon(), ClrObjectSquare(), ClrSelectedJoin(), ClrSelectedOctagon(), ClrSelectedSquare(), CopyPastebufferToLayout(), DeleteRats(), DoIt(), DRCAll(), escape(), InsertPointIntoLine(), InsertPointIntoPolygon(), InsertPointIntoRat(), LookupConnection(), LookupElementConnections(), LookupUnusedPins(), MoveArc(), MoveArcToLayer(), MoveElement(), MoveElementName(), MoveLine(), MoveLinePoint(), MoveLineToLayer(), MovePolygon(), MovePolygonPoint(), MovePolygonToLayer(), MoveRatToLayer(), MoveText(), MoveTextToLayer(), MoveVia(), nbcb_select_common(), netlist_select_cb(), NotifyMode(), QueryInputAndChangeObjectName(), Redo(), RemoveArc(), RemoveElement(), RemoveLine(), RemovePolygon(), RemovePolygonContour(), RemovePolygonPoint(), RemoveRat(), RemoveSelected(), RemoveText(), RemoveVia(), RotateArc(), RotateElement(), RotateElementName(), RotateLinePoint(), RotateObject(), RotateText(), RouteAll(), SelectBlock(), selection_changed_cb(), SelectObject(), SetMode(), SetObjectJoin(), SetObjectOctagon(), SetObjectSquare(), SetSelectedJoin(), SetSelectedOctagon(), SetSelectedSquare(), TracePath(), and Undo().
static void draw_element | ( | ElementType * | element | ) | [static] |
Definition at line 1659 of file draw.c.
References draw_element_name(), draw_element_package(), and draw_element_pins_and_pads().
Referenced by hid_expose_callback().
static void draw_element_name | ( | ElementType * | element | ) | [static] |
Definition at line 358 of file draw.c.
References doing_assy, doing_pinout, hid_draw_st::draw_pcb_text, ELEMENT_TEXT, PCBType::ElementColor, PCBType::ElementSelectedColor, OutputType::fgGC, FRONT, hid_st::graphics, hid_st::gui, gui, PCBType::InvisibleObjectsColor, PCBType::minSlk, Output, PCB, hid_draw_st::set_color, and TEST_FLAG.
Referenced by draw_element(), and name_callback().
static void draw_element_package | ( | ElementType * | element | ) | [static] |
Definition at line 563 of file draw.c.
References ARC_LOOP, doing_assy, doing_pinout, hid_draw_st::draw_pcb_arc, hid_draw_st::draw_pcb_line, PCBType::ElementColor, ELEMENTLINE_LOOP, PCBType::ElementSelectedColor, END_LOOP, OutputType::fgGC, FRONT, hid_st::graphics, gui, PCBType::InvisibleObjectsColor, line, Output, PCB, hid_draw_st::set_color, and TEST_FLAG.
Referenced by draw_element(), and element_callback().
static void draw_element_pins_and_pads | ( | ElementType * | element | ) | [static] |
Definition at line 390 of file draw.c.
References doing_assy, doing_pinout, draw_pad(), draw_pin(), END_LOOP, FRONT, PCBType::InvisibleObjectsOn, PAD_LOOP, PCB, pin, and PIN_LOOP.
Referenced by draw_element().
static void draw_pad | ( | PadType * | pad | ) | [static] |
Definition at line 331 of file draw.c.
References _draw_pad(), PCBType::ConnectedColor, doing_pinout, draw_pad_name(), OutputType::fgGC, PCBType::FoundColor, FRONT, hid_st::graphics, gui, PCBType::InvisibleObjectsColor, Output, PCB, PCBType::PinColor, PCBType::PinSelectedColor, hid_draw_st::set_color, set_object_color(), TEST_FLAG, and PCBType::WarnColor.
Referenced by draw_element_pins_and_pads(), and pad_callback().
static void draw_pad_name | ( | PadType * | pad | ) | [static] |
Definition at line 276 of file draw.c.
References box, TextType::Direction, hid_draw_st::draw_pcb_text, EMPTY, OutputType::fgGC, hid_st::graphics, gui, MAX, MIN, pad_st::Name, NoFlags, pad_st::Number, Output, PCB, PCBType::PinNameColor, SettingType::PinoutTextOffsetX, SettingType::PinoutTextOffsetY, TextType::Scale, hid_draw_st::set_color, Settings, TEST_FLAG, TextType::TextString, TextType::X, BoxType::X1, TextType::Y, and BoxType::Y1.
Referenced by draw_pad().
static void draw_pin | ( | PinType * | pin, |
bool | draw_hole | ||
) | [static] |
Definition at line 223 of file draw.c.
References _draw_pv(), PCBType::ConnectedColor, doing_pinout, OutputType::fgGC, PCBType::FoundColor, hid_st::graphics, gui, Output, PCB, PCBType::PinColor, PCBType::PinSelectedColor, hid_draw_st::set_color, set_object_color(), and PCBType::WarnColor.
Referenced by draw_element_pins_and_pads(), and pin_callback().
static void draw_via | ( | PinType * | via, |
bool | draw_hole | ||
) | [static] |
Definition at line 243 of file draw.c.
References _draw_pv(), PCBType::ConnectedColor, doing_pinout, OutputType::fgGC, PCBType::FoundColor, hid_st::graphics, gui, Output, PCB, hid_draw_st::set_color, set_object_color(), PCBType::ViaColor, PCBType::ViaSelectedColor, and PCBType::WarnColor.
Referenced by via_callback().
Draws an arc on a layer.
Definition at line 1314 of file draw.c.
References AddPart().
Referenced by ChangeArcClearSize(), ChangeArcJoin(), ChangeArcSize(), ClearFlagOnLinesAndPolygons(), CopyArc(), DrawElementPackage(), DrawNewConnections(), DrawObject(), DRCAll(), MoveArc(), MoveArcToLayer(), NotifyMode(), RotateArc(), SelectBlock(), SelectByFlag(), and SelectObject().
void DrawElement | ( | ElementType * | Element | ) |
Draws an element.
Definition at line 1342 of file draw.c.
References DrawElementName(), DrawElementPackage(), and DrawElementPinsAndPads().
Referenced by ChangeElementSide(), ChangeElementSize(), DrawObject(), DRCAll(), NotifyMode(), RotateElement(), SelectBlock(), and UndoMirror().
void DrawElementName | ( | ElementType * | Element | ) |
Draws the name of an element.
Definition at line 1353 of file draw.c.
References DrawText(), ELEMENT_TEXT, PCB, and TEST_FLAG.
Referenced by ActionDisplay(), ActionToggleHideName(), ChangeElementNameSize(), ChangeElementText(), CopyElement(), DrawElement(), DrawObject(), MoveElement(), MoveElementName(), NotifyMode(), RotateElementName(), SelectBlock(), and SelectObject().
void DrawElementPackage | ( | ElementType * | Element | ) |
Draws the package of an element.
Definition at line 1364 of file draw.c.
References ARC_LOOP, DrawArc(), DrawLine(), ELEMENTLINE_LOOP, END_LOOP, and line.
Referenced by CopyElement(), DrawElement(), MoveElement(), and SelectObject().
void DrawElementPinsAndPads | ( | ElementType * | Element | ) |
Draw pins of an element.
Definition at line 1382 of file draw.c.
References doing_assy, doing_pinout, DrawPad(), DrawPin(), END_LOOP, FRONT, PCBType::InvisibleObjectsOn, PAD_LOOP, PCB, pin, and PIN_LOOP.
Referenced by CopyElement(), DrawElement(), MoveElement(), and SelectObject().
static void DrawEMark | ( | ElementType * | e, |
Coord | X, | ||
Coord | Y, | ||
bool | invisible | ||
) | [static] |
Definition at line 799 of file draw.c.
References hid_draw_st::draw_line, pin_st::DrillingHole, PCBType::ElementColor, OutputType::fgGC, hid_st::graphics, gui, PCBType::InvisibleMarkColor, PCBType::InvisibleObjectsOn, MIN, Output, ElementType::Pad, PCB, ElementType::Pin, hid_draw_st::set_color, hid_draw_st::set_line_cap, hid_draw_st::set_line_width, TEST_FLAG, pin_st::Thickness, and Trace_Cap.
Referenced by EMark_callback().
static void DrawEverything | ( | const BoxType * | drawn_area | ) | [static] |
Initializes some identifiers for a new zoom factor and redraws whole screen.
Definition at line 622 of file draw.c.
References bottom_group, BOTTOM_SIDE, CountHoles(), CountHolesEx(), PCBType::Data, DrawHoles(), DrawLayer(), DrawLayerGroup(), DrawMask(), DrawPaste(), DrawPPV(), DrawRats(), DrawSilk(), element_callback(), DataType::element_tree, PCBType::ElementColor, PCBType::ElementOn, EMark_callback(), hid_st::end_layer, OutputType::fgGC, GetLayerGroupNumberByNumber(), GetLayerGroupNumberBySide(), hid_st::gui, gui, PCBType::InvisibleObjectsColor, IsPasteEmpty(), DataType::Layer, LAYER_ON_STACK, LayerStack, max_copper_layer, max_group, name_callback(), NAME_INDEX, DataType::name_tree, LayerType::On, Output, pad_callback(), DataType::pad_tree, PCB, PCBType::PinOn, PrintAssembly(), PrintFab(), r_search(), s, hid_st::set_layer, SL, SWAP_IDENT, TEST_FLAG, top_group, and TOP_SIDE.
Referenced by hid_expose_callback().
void DrawHoles | ( | bool | draw_plated, |
bool | draw_unplated, | ||
const BoxType * | drawn_area, | ||
Cardinal | g_from, | ||
Cardinal | g_to | ||
) |
Definition at line 498 of file draw.c.
References current_layergroup, PCBType::Data, hole_callback(), PCB, DataType::pin_tree, hole_info::plated, r_search(), and DataType::via_tree.
Referenced by DrawEverything().
Definition at line 1087 of file draw.c.
References arc_callback(), LayerType::arc_tree, LayerType::Color, hid_draw_st::draw_rect, OutputType::fgGC, hid_st::graphics, gui, IsLayerEmpty(), line_callback(), LayerType::line_tree, PCBType::MaxHeight, PCBType::MaxWidth, PCBType::minWid, LayerType::Name, Output, PCB, poly_callback(), LayerType::polygon_tree, r_search(), screen, hid_draw_st::set_color, hid_draw_st::set_line_width, TEST_FLAG, text_callback(), and LayerType::text_tree.
Referenced by DrawEverything(), DrawLayerGroup(), DrawSilk(), gerber_set_layer(), and ps_set_layer().
void DrawLayerGroup | ( | int | group, |
const BoxType * | drawn_area | ||
) |
Draws one layer group.
If the exporter is not a GUI, also draws the pins / pads / vias in this layer group.
Definition at line 1128 of file draw.c.
References PCBType::Data, DrawLayer(), DrawPPV(), LayerGroupType::Entries, hid_st::gui, gui, DataType::Layer, Layer, PCBType::LayerGroups, layers, LayerType::Name, LayerGroupType::Number, and PCB.
Referenced by DrawEverything(), and PrintAssembly().
Draws a line on a layer.
Definition at line 1280 of file draw.c.
References AddPart().
Referenced by ActionUndo(), ChangeLineClearSize(), ChangeLineJoin(), ChangeLineSize(), ClearFlagOnLinesAndPolygons(), CopyLine(), DrawElementPackage(), DrawNewConnections(), DrawObject(), DrawRat(), DRCAll(), escape(), InsertPointIntoLine(), InsertPointIntoRat(), MoveLine(), MoveLinePoint(), MoveLineToLayer(), MoveRatToLayer(), NotifyMode(), RD_DrawLine(), RotateLinePoint(), RotateObject(), SelectBlock(), SelectByFlag(), and SelectObject().
void DrawMask | ( | int | side, |
const BoxType * | screen | ||
) |
Draws solder mask layer - this will cover nearly everything.
Definition at line 986 of file draw.c.
References clearPad_callback(), clearPin_callback(), PCBType::Data, DrawMaskBoardArea(), hid_st::graphics, gui, HID_MASK_AFTER, HID_MASK_BEFORE, HID_MASK_CLEAR, HID_MASK_OFF, PCBType::MaskColor, Output, DataType::pad_tree, PCB, DataType::pin_tree, OutputType::pmGC, r_search(), hid_draw_st::set_color, TEST_FLAG, hid_draw_st::use_mask, and DataType::via_tree.
Referenced by DrawEverything().
static void DrawMaskBoardArea | ( | int | mask_type, |
const BoxType * | drawn_area | ||
) | [static] |
Definition at line 966 of file draw.c.
References OutputType::fgGC, hid_draw_st::fill_rect, hid_st::graphics, gui, HID_MASK_AFTER, HID_MASK_BEFORE, PCBType::MaskColor, PCBType::MaxHeight, PCBType::MaxWidth, Output, PCB, hid_st::poly_after, hid_st::poly_before, hid_draw_st::set_color, hid_draw_st::use_mask, BoxType::X1, BoxType::X2, BoxType::Y1, and BoxType::Y2.
Referenced by DrawMask().
void DrawObject | ( | int | type, |
void * | ptr1, | ||
void * | ptr2 | ||
) |
Definition at line 1609 of file draw.c.
References DrawArc(), DrawElement(), DrawElementName(), DrawLine(), DrawPad(), DrawPin(), DrawPolygon(), DrawRat(), DrawText(), DrawVia(), PCBType::ElementOn, FRONT, PCBType::InvisibleObjectsOn, PCB, PCBType::PinOn, PCBType::RatOn, and PCBType::ViaOn.
Referenced by DrawRecoveredObject(), drc_callback(), NotifyMode(), selection_changed_cb(), toggle_pin_selected(), UndoChange2ndSize(), UndoChangeAngles(), UndoChangeClearSize(), UndoChangeMaskSize(), UndoChangeSize(), UndoFlag(), and UndoSetViaLayers().
void DrawPad | ( | PadType * | Pad | ) |
Draw a pad object.
Definition at line 1260 of file draw.c.
References AddPart(), doing_pinout, DrawPadName(), and TEST_FLAG.
Referenced by ChangePadClearSize(), ChangePadMaskSize(), ChangePadSize(), ChangePadSquare(), ChangePaste(), ClearFlagOnPinsViasAndPads(), ClearWarnings(), DrawElementPinsAndPads(), DrawNewConnections(), DrawObject(), DRCAll(), PrintAndSelectUnusedPinsAndPadsOfElement(), SelectBlock(), SelectByFlag(), and SelectObject().
void DrawPadName | ( | PadType * | Pad | ) |
Draws the name of a pad.
Definition at line 1271 of file draw.c.
References GatherPadName().
Referenced by ActionDisplay(), ChangePadName(), and DrawPad().
void DrawPaste | ( | int | side, |
const BoxType * | drawn_area | ||
) |
Draws solder paste layer for a given side of the board.
Definition at line 1015 of file draw.c.
References _draw_pad(), ALLPAD_LOOP, COORD_TO_MM, PCBType::Data, PCBType::ElementColor, ENDALL_LOOP, OutputType::fgGC, hid_st::graphics, gui, ON_SIDE, Output, SettingType::PasteAdjust, PCB, hid_draw_st::set_color, Settings, and TEST_FLAG.
Referenced by DrawEverything().
void DrawPin | ( | PinType * | Pin | ) |
Draw a pin object.
Definition at line 1239 of file draw.c.
References AddPart(), doing_pinout, DrawPinName(), and TEST_FLAG.
Referenced by ChangeElement2ndSize(), ChangePin2ndSize(), ChangePinClearSize(), ChangePinMaskSize(), ChangePinOctagon(), ChangePinSize(), ChangePinSquare(), ChangePinThermal(), ClearFlagOnPinsViasAndPads(), ClearWarnings(), DrawElementPinsAndPads(), DrawNewConnections(), DrawObject(), DRCAll(), PrintAndSelectUnusedPinsAndPadsOfElement(), SelectBlock(), SelectByFlag(), and SelectObject().
void DrawPinName | ( | PinType * | Pin | ) |
Draws the name of a pin.
Definition at line 1251 of file draw.c.
References GatherPVName().
Referenced by ActionDisplay(), ChangePinName(), ChangeViaName(), and DrawPin().
void DrawPolygon | ( | LayerType * | Layer, |
PolygonType * | Polygon | ||
) |
Draws a polygon on a layer.
Definition at line 1333 of file draw.c.
References AddPart().
Referenced by ChangePolyClear(), ClearFlagOnLinesAndPolygons(), CopyAttachedPolygonToLayer(), CopyPolygon(), DrawNewConnections(), DrawObject(), drc_callback(), InsertPointIntoPolygon(), MorphPolygon(), MovePolygon(), MovePolygonPoint(), MovePolygonToLayer(), NotifyMode(), PolyToPolygonsOnLayer(), RemovePolygonContour(), RemovePolygonPoint(), SelectBlock(), SelectByFlag(), SelectObject(), UndoInsertPoint(), and UndoRemovePoint().
static void DrawPPV | ( | int | group, |
const BoxType * | drawn_area | ||
) | [static] |
Draws pins pads and vias - Always draws for non-gui HIDs, otherwise drawing depends on PCB->PinOn and PCB->ViaOn.
Definition at line 846 of file draw.c.
References bottom_group, BOTTOM_SIDE, current_layergroup, PCBType::Data, doing_assy, GetLayerGroupNumberBySide(), hid_st::gui, gui, hole_callback(), pad_callback(), DataType::pad_tree, PCB, pin_callback(), DataType::pin_tree, PCBType::PinOn, r_search(), top_group, TOP_SIDE, via_callback(), DataType::via_tree, and PCBType::ViaOn.
Referenced by DrawEverything(), and DrawLayerGroup().
void DrawRat | ( | RatType * | Rat | ) |
Draws a ratline.
Definition at line 1289 of file draw.c.
References AddPart(), DrawLine(), pixel_slop, SettingType::RatThickness, Settings, TEST_FLAG, BoxType::X1, BoxType::X2, BoxType::Y1, and BoxType::Y2.
Referenced by ActionAddRats(), AutoRoute(), ClearFlagOnLinesAndPolygons(), DrawNewConnections(), DrawObject(), DrawShortestRats(), MoveLinePoint(), NotifyMode(), RotateLinePoint(), RotateObject(), SelectBlock(), SelectByFlag(), and SelectObject().
static void DrawRats | ( | const BoxType * | drawn_area | ) | [static] |
Definition at line 1050 of file draw.c.
References PCBType::Data, hid_st::graphics, gui, HID_MASK_CLEAR, HID_MASK_OFF, hid_st::name, PCB, r_search(), rat_callback(), DataType::rat_tree, and hid_draw_st::use_mask.
Referenced by DrawEverything().
void DrawSilk | ( | int | side, |
const BoxType * | drawn_area | ||
) |
Draws silk layer.
Definition at line 927 of file draw.c.
References clearPad_callback(), clearPin_callback(), PCBType::Data, DrawLayer(), element_callback(), DataType::element_tree, hid_st::graphics, gui, HID_MASK_AFTER, HID_MASK_BEFORE, HID_MASK_CLEAR, HID_MASK_OFF, layer, LAYER_PTR, max_copper_layer, name_callback(), NAME_INDEX, DataType::name_tree, DataType::pad_tree, PCB, DataType::pin_tree, hid_st::poly_after, hid_st::poly_before, r_search(), hid_draw_st::use_mask, and DataType::via_tree.
Referenced by DrawEverything(), and PrintAssembly().
Draws a text on a layer.
Definition at line 1323 of file draw.c.
References AddPart().
Referenced by ChangeTextJoin(), ChangeTextName(), ChangeTextSize(), CopyText(), DrawElementName(), DrawObject(), MoveText(), MoveTextToLayer(), NotifyMode(), RotateText(), SelectBlock(), and SelectObject().
void DrawVia | ( | PinType * | Via | ) |
Draw a via object.
Definition at line 1219 of file draw.c.
References AddPart(), DrawViaName(), and TEST_FLAG.
Referenced by ChangeHole(), ChangeObjectViaLayers(), ChangeSelectedViaLayers(), ChangeVia2ndSize(), ChangeViaClearSize(), ChangeViaMaskSize(), ChangeViaOctagon(), ChangeViaSize(), ChangeViaThermal(), ClearFlagOnPinsViasAndPads(), CopyVia(), DrawNewConnections(), DrawObject(), DRCAll(), escape(), moveline_callback(), MoveVia(), NotifyMode(), RD_DrawVia(), SelectBlock(), SelectByFlag(), and SelectObject().
void DrawViaName | ( | PinType * | Via | ) |
Draws the name of a via.
Definition at line 1230 of file draw.c.
References GatherPVName().
Referenced by ActionDisplay(), and DrawVia().
static int element_callback | ( | const BoxType * | b, |
void * | cl | ||
) | [static] |
Definition at line 589 of file draw.c.
References draw_element_package(), and ON_SIDE.
Referenced by DrawEverything(), and DrawSilk().
static int EMark_callback | ( | const BoxType * | b, |
void * | cl | ||
) | [static] |
Definition at line 406 of file draw.c.
References DrawEMark(), FRONT, ElementType::MarkX, and ElementType::MarkY.
Referenced by DrawEverything().
void EraseArc | ( | ArcType * | Arc | ) |
Erases an arc on a layer.
Definition at line 1493 of file draw.c.
References AddPart(), and ArcType::Thickness.
Referenced by ChangeArcClearSize(), ChangeArcJoin(), ChangeArcSize(), EraseElement(), EraseObject(), MoveArc(), MoveArcToLayer(), RemoveArc(), and RotateArc().
void EraseElement | ( | ElementType * | Element | ) |
Erases an element.
Definition at line 1523 of file draw.c.
References ARC_LOOP, ELEMENTLINE_LOOP, END_LOOP, EraseArc(), EraseElementName(), EraseElementPinsAndPads(), EraseLine(), and line.
Referenced by ChangeElementSide(), ChangeElementSize(), EraseObject(), MoveElement(), RemoveElement(), RotateElement(), and UndoMirror().
void EraseElementName | ( | ElementType * | Element | ) |
Erases the name of an element.
Definition at line 1561 of file draw.c.
References ELEMENT_TEXT, EraseText(), PCB, and TEST_FLAG.
Referenced by ActionDisplay(), ActionToggleHideName(), ChangeElementNameSize(), ChangeElementText(), EraseElement(), EraseObject(), MoveElementName(), NotifyMode(), and RotateElementName().
void EraseElementPinsAndPads | ( | ElementType * | Element | ) |
Erases all pins and pads of an element.
Definition at line 1543 of file draw.c.
References END_LOOP, ErasePad(), ErasePin(), PAD_LOOP, pin, and PIN_LOOP.
Referenced by EraseElement(), and MoveElement().
void EraseLine | ( | LineType * | Line | ) |
Erases a line on a layer.
Definition at line 1484 of file draw.c.
References AddPart().
Referenced by ChangeLineClearSize(), ChangeLineJoin(), ChangeLineSize(), EraseElement(), EraseObject(), EraseRat(), InsertPointIntoLine(), MoveLine(), MoveLinePoint(), MoveLineToLayer(), RemoveLine(), ripout_livedraw_obj(), RotateLinePoint(), and RotateObject().
void EraseObject | ( | int | type, |
void * | lptr, | ||
void * | ptr | ||
) |
Definition at line 1569 of file draw.c.
References EraseArc(), EraseElement(), EraseElementName(), EraseLine(), ErasePad(), ErasePin(), ErasePolygon(), EraseText(), and Message().
Referenced by ActionRipUp(), UndoChange2ndSize(), UndoChangeAngles(), UndoChangeClearSize(), UndoChangeMaskSize(), UndoChangeSize(), UndoCopyOrCreate(), UndoFlag(), and UndoSetViaLayers().
void ErasePad | ( | PadType * | Pad | ) |
Erase a pad object.
Definition at line 1444 of file draw.c.
References AddPart(), ErasePadName(), and TEST_FLAG.
Referenced by ChangePadClearSize(), ChangePadMaskSize(), ChangePadSize(), ChangePadSquare(), ChangePaste(), EraseElementPinsAndPads(), and EraseObject().
void ErasePadName | ( | PadType * | Pad | ) |
Erase a pad name.
Definition at line 1455 of file draw.c.
References GatherPadName().
Referenced by ActionDisplay(), ChangePadName(), and ErasePad().
void ErasePin | ( | PinType * | Pin | ) |
Erase a pin object.
Definition at line 1464 of file draw.c.
References AddPart(), ErasePinName(), and TEST_FLAG.
Referenced by ChangeElement2ndSize(), ChangePin2ndSize(), ChangePinClearSize(), ChangePinMaskSize(), ChangePinOctagon(), ChangePinSize(), ChangePinSquare(), EraseElementPinsAndPads(), and EraseObject().
void ErasePinName | ( | PinType * | Pin | ) |
Erase a pin name.
Definition at line 1475 of file draw.c.
References GatherPVName().
Referenced by ActionDisplay(), ChangePinName(), ChangeViaName(), and ErasePin().
void ErasePolygon | ( | PolygonType * | Polygon | ) |
Erases a polygon on a layer.
Definition at line 1514 of file draw.c.
References AddPart().
Referenced by EraseObject(), InsertPointIntoPolygon(), MorphPolygon(), MovePolygon(), MovePolygonPoint(), MovePolygonToLayer(), RemovePolygon(), RemovePolygonContour(), RemovePolygonPoint(), UndoInsertPoint(), and UndoRemovePoint().
void EraseRat | ( | RatType * | Rat | ) |
Erase a ratline.
Definition at line 1412 of file draw.c.
References AddPart(), EraseLine(), TEST_FLAG, BoxType::X1, BoxType::X2, BoxType::Y1, and BoxType::Y2.
Referenced by ActionChangeName(), InsertPointIntoRat(), MoveLinePoint(), MoveRatToLayer(), NotifyMode(), and RemoveRat().
Erases a text on a layer.
Definition at line 1504 of file draw.c.
References AddPart().
Referenced by ChangeTextJoin(), ChangeTextName(), ChangeTextSize(), EraseElementName(), EraseObject(), MoveText(), MoveTextToLayer(), RemoveText(), and RotateText().
void EraseVia | ( | PinType * | Via | ) |
Erase a via.
Definition at line 1401 of file draw.c.
References AddPart(), EraseViaName(), and TEST_FLAG.
Referenced by ChangeHole(), ChangeVia2ndSize(), ChangeViaClearSize(), ChangeViaMaskSize(), ChangeViaOctagon(), ChangeViaSize(), MoveVia(), RemoveVia(), and ripout_livedraw_obj().
void EraseViaName | ( | PinType * | Via | ) |
Erase a via name.
Definition at line 1435 of file draw.c.
References GatherPVName().
Referenced by ActionDisplay(), and EraseVia().
static void GatherPadName | ( | PadType * | Pad | ) | [static] |
Definition at line 1184 of file draw.c.
References AddPart(), box, MAX, MIN, SettingType::PinoutTextOffsetX, SettingType::PinoutTextOffsetY, Settings, BoxType::X1, BoxType::X2, BoxType::Y1, and BoxType::Y2.
Referenced by DrawPadName(), and ErasePadName().
static void GatherPVName | ( | PinType * | Ptr | ) | [static] |
Definition at line 1154 of file draw.c.
References AddPart(), box, pin_st::DrillingHole, SettingType::PinoutTextOffsetX, SettingType::PinoutTextOffsetY, Settings, TEST_FLAG, pin_st::Thickness, pin_st::X, BoxType::X1, BoxType::X2, pin_st::Y, BoxType::Y1, and BoxType::Y2.
Referenced by DrawPinName(), DrawViaName(), ErasePinName(), and EraseViaName().
HID drawing callback.
This function (in the common code) will be called whenever the GUI needs to redraw the screen, print the board, or export a layer.
Definition at line 1670 of file draw.c.
References OutputType::bgGC, hid_draw_st::destroy_gc, doing_pinout, draw_element(), DrawEverything(), OutputType::fgGC, hid_st::graphics, gui, hid_draw_st::make_gc, Output, OutputType::pmGC, and hid_draw_st::set_color.
Referenced by Benchmark(), eps_hid_export_to_file(), gcode_start_png_export(), gerber_do_export(), ghid_drawing_area_expose_cb(), ghid_pinout_preview_expose(), ghid_render_pixmap(), gsvit_start_png_export(), hid_get_extents(), idle_proc(), nelma_start_png_export(), pinout_callback(), png_hid_export_to_file(), ps_hid_export_to_file(), and redraw_region().
static int hole_callback | ( | const BoxType * | b, |
void * | cl | ||
) | [static] |
Definition at line 423 of file draw.c.
References OutputType::bgGC, SettingType::BlackColor, pin_st::BuriedFrom, pin_st::BuriedTo, hid_draw_st::draw_arc, hole_info::drill_pair, pin_st::DrillingHole, OutputType::fgGC, hid_draw_st::fill_circle, GetLayerGroupNumberByNumber(), hid_st::graphics, hole_info::group_from, hole_info::group_to, gui, Output, PCB, hole_info::plated, Round_Cap, hid_draw_st::set_line_cap, hid_draw_st::set_line_width, set_object_color(), Settings, TEST_FLAG, VIA_IS_BURIED, via_visible_on_layer_group(), ViaIsOnAnyVisibleLayer(), PCBType::ViaSelectedColor, PCBType::WarnColor, pin_st::X, and pin_st::Y.
Referenced by DrawHoles(), and DrawPPV().
static int line_callback | ( | const BoxType * | b, |
void * | cl | ||
) | [static] |
Definition at line 512 of file draw.c.
References hid_draw_st::draw_pcb_line, OutputType::fgGC, hid_st::graphics, gui, layer, line, Output, and set_layer_object_color().
Referenced by DrawLayer().
static int name_callback | ( | const BoxType * | b, |
void * | cl | ||
) | [static] |
Definition at line 375 of file draw.c.
References draw_element_name(), TextType::Element, ON_SIDE, and TEST_FLAG.
Referenced by DrawEverything(), and DrawSilk().
static int pad_callback | ( | const BoxType * | b, |
void * | cl | ||
) | [static] |
Definition at line 347 of file draw.c.
References draw_pad(), and ON_SIDE.
Referenced by DrawEverything(), and DrawPPV().
static int pin_callback | ( | const BoxType * | b, |
void * | cl | ||
) | [static] |
Definition at line 236 of file draw.c.
References draw_pin().
Referenced by DrawPPV().
static int poly_callback | ( | const BoxType * | b, |
void * | cl | ||
) | [static] |
Definition at line 901 of file draw.c.
References hid_draw_st::draw_pcb_polygon, poly_info::drawn_area, OutputType::fgGC, hid_st::graphics, gui, poly_info::layer, Output, and set_layer_object_color().
Referenced by DrawLayer().
void PrintAssembly | ( | int | side, |
const BoxType * | drawn_area | ||
) |
Prints assembly drawing.
Definition at line 603 of file draw.c.
References doing_assy, DrawLayerGroup(), DrawSilk(), OutputType::fgGC, GetLayerGroupNumberBySide(), hid_st::graphics, gui, Output, and hid_draw_st::set_draw_faded.
Referenced by DrawEverything().
static int rat_callback | ( | const BoxType * | b, |
void * | cl | ||
) | [static] |
Definition at line 524 of file draw.c.
References PCBType::ConnectedColor, hid_draw_st::draw_arc, hid_draw_st::draw_pcb_line, OutputType::fgGC, PCBType::FoundColor, hid_st::graphics, gui, Output, PCB, pixel_slop, PCBType::RatColor, PCBType::RatSelectedColor, SettingType::RatThickness, hid_draw_st::set_line_width, set_object_color(), Settings, and TEST_FLAG.
Referenced by DrawRats().
void Redraw | ( | void | ) |
Redraws all the data by the event handlers.
Definition at line 144 of file draw.c.
References gui, and hid_st::invalidate_all.
Referenced by ActionDisperseElements(), ActionDisplay(), ActionNew(), ActionSetSame(), apply_vendor_map(), AutoPlaceSelected(), AutoRoute(), LookupConnectionsToAllElements(), relocate(), SetGrid(), smartdisperse(), and toporouter().
static void set_layer_object_color | ( | LayerType * | layer, |
AnyObjectType * | obj | ||
) | [static] |
Definition at line 107 of file draw.c.
References LayerType::Color, PCBType::ConnectedColor, PCBType::FoundColor, PCB, LayerType::SelectedColor, and set_object_color().
Referenced by arc_callback(), line_callback(), and poly_callback().
static void set_object_color | ( | AnyObjectType * | obj, |
char * | warn_color, | ||
char * | selected_color, | ||
char * | connected_color, | ||
char * | found_color, | ||
char * | normal_color | ||
) | [static] |
Definition at line 92 of file draw.c.
References OutputType::fgGC, hid_st::graphics, gui, Output, hid_draw_st::set_color, and TEST_FLAG.
Referenced by draw_pad(), draw_pin(), draw_via(), hole_callback(), rat_callback(), and set_layer_object_color().
static int text_callback | ( | const BoxType * | b, |
void * | cl | ||
) | [static] |
Definition at line 1067 of file draw.c.
References LayerType::Color, PCBType::Data, hid_draw_st::draw_pcb_text, OutputType::fgGC, hid_st::graphics, gui, layer, PCBType::minSlk, PCBType::minWid, Output, PCB, LayerType::SelectedColor, hid_draw_st::set_color, and TEST_FLAG.
Referenced by DrawLayer().
static int via_callback | ( | const BoxType * | b, |
void * | cl | ||
) | [static] |
Definition at line 265 of file draw.c.
References draw_via(), and via_visible_on_layer_group().
Referenced by DrawPPV().
static bool via_visible_on_layer_group | ( | PinType * | via | ) | [static] |
Definition at line 256 of file draw.c.
References current_layergroup, and ViaIsOnLayerGroup().
Referenced by hole_callback(), and via_callback().
int current_layergroup [static] |
Definition at line 80 of file draw.c.
Referenced by DrawHoles(), DrawPPV(), and via_visible_on_layer_group().
bool doing_assy = false [static] |
Definition at line 78 of file draw.c.
Referenced by draw_element_name(), draw_element_package(), draw_element_pins_and_pads(), DrawElementPinsAndPads(), DrawPPV(), and PrintAssembly().
int doing_pinout = 0 [static] |
Definition at line 77 of file draw.c.
Referenced by _draw_pv(), _draw_pv_name(), draw_element_name(), draw_element_package(), draw_element_pins_and_pads(), draw_pad(), draw_pin(), draw_via(), DrawElementPinsAndPads(), DrawPad(), DrawPin(), and hid_expose_callback().