mirror of
https://gitlab.com/kicad/code/kicad.git
synced 2025-04-19 18:51:40 +00:00
Jean-Pierre's changes for kicad-2007-05-25 release
This commit is contained in:
parent
1db1374098
commit
ae74527bc2
3d-viewer
bitmaps
common
base_screen.cppbase_struct.cppbasicframe.cppblock_commande.cppcommon_plotHPGL_functions.cppcommon_plotPS_functions.cppcommon_plot_functions.cppdcsvg.cppdispllst.cppdrawtxt.cppeda_dde.cppedaappl.cppgestfich.cppgr_basic.cppmakefile.g95makefile.gtkmakefile.includemakefile.macosxpyhandler.cppstring.cppworksheet.cpp
cvpcb
eeschema
affiche.cppblock_libedit.cppclass_hierarchy_sheet.cppclass_text-label.cppcomponent_class.hcontrole.cppdelete.cppdialog_build_BOM.cppdialog_build_BOM.hdialog_build_BOM.pjddialog_cmp_graphic_properties.cppdialog_cmp_graphic_properties.hdialog_cmp_graphic_properties.pjddialog_eeschema_config.cppdialog_eeschema_config.hdialog_eeschema_config.pjddialog_options.cppdialog_options.hdialog_options.pjdedit_component_in_schematic.cppedit_label.cppeeconfig.heelibs_draw_components.cppeelibs_read_libraryfiles.cppeeload.cppeeredraw.cppeestring.cppfiles-io.cppgeneral.hhotkeys.cpplibclass.cpplibcmp.hlibedit_onleftclick.cpplibedit_onrightclick.cpplibfield.cpplocate.cppmakefile.g95makefile.gtkmakefile.includemakefile.macosxmenubar.cppnetlist.hpinedit-dialog.cpppinedit-dialog.hpinedit-dialog.pjdpinedit.cppplot.cppplothpgl.cppplotps.cppplotps.hplotps.pjdprotos.hsavelib.cppschedit.cppschframe.cppsheet.cppsymbdraw.cppsymbedit.cpp
gerbview
deltrack.cppedit.cppexport_to_pcbnew.cppfiles.cppgerberframe.cppgerbview.hlocate.cppmakefile.g95makefile.gtkmakefile.includemakefile.macosxonrightclick.cppprotos.hreadgerb.cpprs274d.cpprs274x.cppselect_layers_to_pcb.cppset_color.cpptool_gerber.cpptracepcb.cpptrpiste.cpp
include
appl_wxstruct.hbase_struct.hbitmaps.hbuild_version.hcolors.hcommon.hdcsvg.hdrawpanel_wxstruct.hgr_basic.hid.hpcbstruct.hplot_common.hpyhandler.hworksheet.hwxstruct.h
kicad
bitmaps
icon_cvpcb_small.xpmicon_gerbview_small.xpmnew_cvpcb.xpmnew_gerb.xpmnew_pcb.xpmnew_python.xpmnew_sch.xpmreload.xpmunknown.xpm
buildmnu.cppfiles-io.cppkicad.cppkicad.hmakefile.g95makefile.gtkmakefile.includemakefile.macosxmdiframe.cpppreferences.cppprjconfig.cpptreeprj.cpptreeprj_datas.cpptreeprj_frame.cpppcbnew
autoplac.cpp
regex_doc.txtbitmaps
Drag_Segment_WithSlope.xpmDrag_Track_Segment.xpmFootprint_Text.xpmMove_Track.xpmMove_Track_Segment.xpm
class_cotation.cppclass_edge_mod.cppclass_mire.cppclass_module.cppclass_pad.cppclass_text_mod.cppclass_track.cppcontrole.cppcopy_track.cppdrag.hdragsegm.cppdupltrac.cppedit.cppeditrack-part2.cppgen_modules_placefile.cppgendrill.cppinitpcb.cppioascii.cpplay2plot.cpploadcmp.cpplocate.cppmakefile.g95makefile.gtkmakefile.includemakefile.macosxmodedit.cppmodules.cppmove_or_drag_track.cppmuonde.cppnetlist.cpponrightclick.cpppcbnew.hpcbplot.cppplotps.cppprotos.hratsnest.cppsel_layer.cppset_color.cppsolve.cppsurbrill.cppswap_layers.cpptracemod.cpptracepcb.cpptrpiste.cppxchgmod.cppzones.cppshare
@ -225,16 +225,34 @@ float spin_quat[4];
|
||||
|
||||
if ( event.m_wheelRotation )
|
||||
{
|
||||
if ( event.GetWheelRotation() > 0 )
|
||||
{
|
||||
g_Parm_3D_Visu.m_Zoom /= 1.4;
|
||||
if ( g_Parm_3D_Visu.m_Zoom <= 0.01)
|
||||
g_Parm_3D_Visu.m_Zoom = 0.01;
|
||||
}
|
||||
|
||||
else g_Parm_3D_Visu.m_Zoom *= 1.4;
|
||||
DisplayStatus();
|
||||
Refresh(FALSE);
|
||||
if( event.ShiftDown() ) {
|
||||
if ( event.GetWheelRotation() < 0 ) {
|
||||
/* up */
|
||||
SetView3D(WXK_UP);
|
||||
} else {
|
||||
/* down */
|
||||
SetView3D(WXK_DOWN);
|
||||
}
|
||||
} else if( event.ControlDown() ) {
|
||||
if ( event.GetWheelRotation() > 0 ) {
|
||||
/* right */
|
||||
SetView3D(WXK_RIGHT);
|
||||
} else {
|
||||
/* left */
|
||||
SetView3D(WXK_LEFT);
|
||||
}
|
||||
}
|
||||
else {
|
||||
if ( event.GetWheelRotation() > 0 )
|
||||
{
|
||||
g_Parm_3D_Visu.m_Zoom /= 1.4;
|
||||
if ( g_Parm_3D_Visu.m_Zoom <= 0.01)
|
||||
g_Parm_3D_Visu.m_Zoom = 0.01;
|
||||
}
|
||||
else g_Parm_3D_Visu.m_Zoom *= 1.4;
|
||||
DisplayStatus();
|
||||
Refresh(FALSE);
|
||||
}
|
||||
}
|
||||
|
||||
if (event.Dragging())
|
||||
@ -582,6 +600,8 @@ bool fmt_is_jpeg = FALSE;
|
||||
);
|
||||
if ( FullFileName.IsEmpty() ) return;
|
||||
}
|
||||
|
||||
wxYield(); // Requested to allow tne window redraw after closing the dialog box
|
||||
wxSize image_size = GetClientSize();
|
||||
wxClientDC dc(this);
|
||||
wxBitmap bitmap(image_size.x, image_size.y );
|
||||
|
@ -49,6 +49,8 @@ int LineNum = 0;
|
||||
return -1;
|
||||
}
|
||||
|
||||
// Switch the locale to standard C (needed to print floating point numbers like 1.3)
|
||||
setlocale(LC_NUMERIC, "C");
|
||||
while ( GetLine(file, line, &LineNum, 512) )
|
||||
{
|
||||
text = strtok(line, " \t\n\r");
|
||||
@ -68,6 +70,7 @@ int LineNum = 0;
|
||||
}
|
||||
|
||||
fclose (file);
|
||||
setlocale(LC_NUMERIC, ""); // revert to the current locale
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -130,44 +133,44 @@ S3D_Material * material = NULL;
|
||||
if ( stricmp (text, "diffuseColor") == 0 )
|
||||
{
|
||||
text = strtok(NULL," \t\n\r");
|
||||
material->m_DiffuseColor.x = atof(from_point(text));
|
||||
material->m_DiffuseColor.x = atof(text);
|
||||
text = strtok(NULL," \t\n\r");
|
||||
material->m_DiffuseColor.y = atof(from_point(text));
|
||||
material->m_DiffuseColor.y = atof(text);
|
||||
text = strtok(NULL," \t\n\r");
|
||||
material->m_DiffuseColor.z = atof(from_point(text));
|
||||
material->m_DiffuseColor.z = atof(text);
|
||||
}
|
||||
else if ( stricmp (text, "emissiveColor") == 0 )
|
||||
{
|
||||
text = strtok(NULL," \t\n\r");
|
||||
material->m_EmissiveColor.x = atof(from_point(text));
|
||||
material->m_EmissiveColor.x = atof(text);
|
||||
text = strtok(NULL," \t\n\r");
|
||||
material->m_EmissiveColor.y = atof(from_point(text));
|
||||
material->m_EmissiveColor.y = atof(text);
|
||||
text = strtok(NULL," \t\n\r");
|
||||
material->m_EmissiveColor.z = atof(from_point(text));
|
||||
material->m_EmissiveColor.z = atof(text);
|
||||
}
|
||||
else if ( strnicmp (text, "specularColor", 13 ) == 0 )
|
||||
{
|
||||
text = strtok(NULL," \t\n\r");
|
||||
material->m_SpecularColor.x = atof(from_point(text));
|
||||
material->m_SpecularColor.x = atof(text);
|
||||
text = strtok(NULL," \t\n\r");
|
||||
material->m_SpecularColor.y = atof(from_point(text));
|
||||
material->m_SpecularColor.y = atof(text);
|
||||
text = strtok(NULL," \t\n\r");
|
||||
material->m_SpecularColor.z = atof(from_point(text));
|
||||
material->m_SpecularColor.z = atof(text);
|
||||
}
|
||||
else if ( strnicmp (text, "ambientIntensity", 16 ) == 0 )
|
||||
{
|
||||
text = strtok(NULL," \t\n\r");
|
||||
material->m_AmbientIntensity = atof(from_point(text));
|
||||
material->m_AmbientIntensity = atof(text);
|
||||
}
|
||||
else if ( strnicmp (text, "transparency", 12 ) == 0 )
|
||||
{
|
||||
text = strtok(NULL," \t\n\r");
|
||||
material->m_Transparency = atof(from_point(text));
|
||||
material->m_Transparency = atof(text);
|
||||
}
|
||||
else if ( strnicmp (text, "shininess", 9 ) == 0 )
|
||||
{
|
||||
text = strtok(NULL," \t\n\r");
|
||||
material->m_Shininess = atof(from_point(text));
|
||||
material->m_Shininess = atof(text);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -323,7 +326,7 @@ char string_num[512];
|
||||
case ',':
|
||||
jj = 0;
|
||||
if ( ! StartData || !HasData) break;
|
||||
data_list[ii] = atof(from_point(string_num));
|
||||
data_list[ii] = atof(string_num);
|
||||
string_num[jj] = 0;
|
||||
ii++;
|
||||
if ( ii >= nn )
|
||||
@ -463,7 +466,7 @@ int * index = NULL;
|
||||
while ( text )
|
||||
{
|
||||
if ( *text == ']') break;
|
||||
jj = atoi(from_point(text));
|
||||
jj = atoi(text);
|
||||
if ( jj < 0 )
|
||||
{
|
||||
S3D_Vertex * curr_coord = coords;
|
||||
|
@ -4,7 +4,7 @@ CC = gcc
|
||||
# Compiler flags.
|
||||
|
||||
CPPFLAGS = -Wall -O2 -DPCBNEW -I../pcbnew -I ../include -I../common\
|
||||
`wx-config --cxxflags`
|
||||
`wx-config --cxxflags` -fno-strict-aliasing
|
||||
|
||||
|
||||
include ../libs.linux
|
||||
@ -23,6 +23,7 @@ $(TARGET).a: $(OBJECTS3D) makefile.gtk makefile.include
|
||||
ar -rv $@ $(OBJECTS3D)
|
||||
ranlib $@
|
||||
|
||||
install:$(TARGET).a
|
||||
|
||||
clean:
|
||||
rm -f *.o
|
||||
|
@ -1,17 +1,11 @@
|
||||
EXTRALIBS =
|
||||
EXTRACPPFLAGS= -I./ -I../include -I../common -I../pcbnew
|
||||
|
||||
CPPFLAGS += $(EXTRACPPFLAGS)
|
||||
|
||||
OBJECTS3D = 3d_frame.o 3d_read_mesh.o 3d_canvas.o trackball.o 3d_aux.o\
|
||||
3d_draw.o 3d_toolbar.o 3d_class.o
|
||||
|
||||
|
||||
OBJECTS= ../common/trigo.o
|
||||
|
||||
AUXLIBS= -mthreads -o $(TARGET)$(DLLSUFF)\
|
||||
$(WXLIB_BASE) $(LIBS3D)\
|
||||
-lrpcrt4 -loleaut32 -lole32 -luuid -lwinspool -lwinmm\
|
||||
-lshell32 -lcomctl32 -lcomdlg32 -lctl3d32 -ladvapi32 -lwsock32 -lgdi32
|
||||
|
||||
3d_class.o: 3d_class.cpp 3d_struct.h 3d_viewer.h
|
||||
|
||||
3d_read_mesh.o: 3d_read_mesh.cpp 3d_struct.h 3d_viewer.h
|
||||
|
@ -5,6 +5,7 @@ CC = gcc
|
||||
|
||||
CPPFLAGS = -Wall -O2 -DPCBNEW -I../pcbnew -I ../include -I../common\
|
||||
`wx-config --cxxflags`
|
||||
CPPFLAGS += -arch i386 -arch ppc
|
||||
|
||||
|
||||
include ../libs.macosx
|
||||
|
160
bitmaps/directory.xpm
Normal file
160
bitmaps/directory.xpm
Normal file
@ -0,0 +1,160 @@
|
||||
/* XPM */
|
||||
#ifndef XPMMAIN
|
||||
extern char * directory_xpm[];
|
||||
|
||||
#else
|
||||
char * directory_xpm[] = {
|
||||
"16 16 136 2",
|
||||
" c None",
|
||||
". c #469FFF",
|
||||
"+ c #4193FF",
|
||||
"@ c #4499FF",
|
||||
"# c #2C63AC",
|
||||
"$ c #4DA0FF",
|
||||
"% c #B5D9FB",
|
||||
"& c #AAD3FB",
|
||||
"* c #ADD3FB",
|
||||
"= c #89C4FF",
|
||||
"- c #184888",
|
||||
"; c #4495FF",
|
||||
"> c #AED5FB",
|
||||
", c #6DB3F9",
|
||||
"' c #6FB2F9",
|
||||
") c #6BAEF8",
|
||||
"! c #67ABF6",
|
||||
"~ c #549FF9",
|
||||
"{ c #3E91FF",
|
||||
"] c #ACD4FB",
|
||||
"^ c #6BAEF9",
|
||||
"/ c #6CAFF8",
|
||||
"( c #66AAF7",
|
||||
"_ c #5DA3F6",
|
||||
": c #74AEF7",
|
||||
"< c #9EC4F8",
|
||||
"[ c #92BCF7",
|
||||
"} c #8DB5F5",
|
||||
"| c #88B1F3",
|
||||
"1 c #83ABF2",
|
||||
"2 c #80A8F0",
|
||||
"3 c #87AEF5",
|
||||
"4 c #0940B7",
|
||||
"5 c #AAD2FB",
|
||||
"6 c #67ACF8",
|
||||
"7 c #68ABF8",
|
||||
"8 c #61A4F7",
|
||||
"9 c #5B9FF5",
|
||||
"0 c #5399F3",
|
||||
"a c #498FF1",
|
||||
"b c #3F85EF",
|
||||
"c c #367CEB",
|
||||
"d c #2E73E8",
|
||||
"e c #286BE6",
|
||||
"f c #2164E2",
|
||||
"g c #2163E5",
|
||||
"h c #023AB6",
|
||||
"i c #4394FF",
|
||||
"j c #A7D0FA",
|
||||
"k c #63A9F7",
|
||||
"l c #61A7F7",
|
||||
"m c #5BA0F6",
|
||||
"n c #5499F4",
|
||||
"o c #4B90F2",
|
||||
"p c #4186EF",
|
||||
"q c #377DEB",
|
||||
"r c #2E73E7",
|
||||
"s c #266AE5",
|
||||
"t c #2062E2",
|
||||
"u c #1C5DDF",
|
||||
"v c #1A5CE2",
|
||||
"w c #A4CEF9",
|
||||
"x c #5DA5F7",
|
||||
"y c #5DA1F6",
|
||||
"z c #559AF4",
|
||||
"A c #4C91F3",
|
||||
"B c #4489F1",
|
||||
"C c #3A7FED",
|
||||
"D c #3075E9",
|
||||
"E c #276BE5",
|
||||
"F c #2062E1",
|
||||
"G c #1B5CDE",
|
||||
"H c #1758DB",
|
||||
"I c #1857DE",
|
||||
"J c #0239B6",
|
||||
"K c #A1CBF9",
|
||||
"L c #589FF6",
|
||||
"M c #559BF5",
|
||||
"N c #4F96F3",
|
||||
"O c #478CF2",
|
||||
"P c #3D84F0",
|
||||
"Q c #3378EB",
|
||||
"R c #2B6EE7",
|
||||
"S c #2265E3",
|
||||
"T c #1C5DDE",
|
||||
"U c #1757DB",
|
||||
"V c #1554DA",
|
||||
"W c #1555DD",
|
||||
"X c #0139B5",
|
||||
"Y c #4696FF",
|
||||
"Z c #FFFFFF",
|
||||
"` c #FBFBFB",
|
||||
" . c #F2F2F2",
|
||||
".. c #E9E9E9",
|
||||
"+. c #E0E0E0",
|
||||
"@. c #D7D7D7",
|
||||
"#. c #D4D4D4",
|
||||
"$. c #A9A9A9",
|
||||
"%. c #BABABA",
|
||||
"&. c #9E9990",
|
||||
"*. c #0A3DAF",
|
||||
"=. c #FEFEFE",
|
||||
"-. c #F8F8F8",
|
||||
";. c #F1F1F1",
|
||||
">. c #E8E8E8",
|
||||
",. c #DCDCDC",
|
||||
"'. c #D6D6D6",
|
||||
"). c #D2D2D2",
|
||||
"!. c #A7A7A7",
|
||||
"~. c #B7B7B7",
|
||||
"{. c #929292",
|
||||
"]. c #BAB6AC",
|
||||
"^. c #0E41B3",
|
||||
"/. c #F0F0F0",
|
||||
"(. c #E5E5E5",
|
||||
"_. c #DDDDDD",
|
||||
":. c #D3D3D3",
|
||||
"<. c #D0D0D0",
|
||||
"[. c #ABABAB",
|
||||
"}. c #B5B5B5",
|
||||
"|. c #939393",
|
||||
"1. c #ADADAD",
|
||||
"2. c #938E85",
|
||||
"3. c #0A3DAE",
|
||||
"4. c #FFFFFE",
|
||||
"5. c #F4F4F4",
|
||||
"6. c #EDEDED",
|
||||
"7. c #DBDBDB",
|
||||
"8. c #AEAEAE",
|
||||
"9. c #969696",
|
||||
"0. c #878787",
|
||||
"a. c #AFABA1",
|
||||
"b. c #0D40B2",
|
||||
"c. c #0037B2",
|
||||
"d. c #0034A8",
|
||||
"e. c #0038B6",
|
||||
" ",
|
||||
" . + @ # ",
|
||||
" $ % & * = - ",
|
||||
"; > , ' ) ! ~ { + + + + + . ",
|
||||
"; ] ^ / ( _ : < [ } | 1 2 3 4 ",
|
||||
"; 5 6 7 8 9 0 a b c d e f g h ",
|
||||
"i j k l m n o p q r s t u v h ",
|
||||
"i w x y z A B C D E F G H I J ",
|
||||
"i K L M N O P Q R S T U V W X ",
|
||||
"Y Z Z Z Z ` ...+.@.#.$.%.&.*. ",
|
||||
"Y Z Z =.-.;.>.,.'.).!.~.{.].^. ",
|
||||
"Y Z =.-./.(._.:.<.[.}.|.1.2.3. ",
|
||||
"Y 4.5.6.(.7.#.<.1.8.9.!.0.a.b. ",
|
||||
" c.d.d.d.d.d.d.d.d.d.d.d.e. ",
|
||||
" ",
|
||||
" "};
|
||||
#endif
|
113
bitmaps/icon_python.xpm
Normal file
113
bitmaps/icon_python.xpm
Normal file
@ -0,0 +1,113 @@
|
||||
/* XPM */
|
||||
#ifndef XPMMAIN
|
||||
extern char * icon_python_xpm[];
|
||||
|
||||
#else
|
||||
char * icon_python_xpm[] = {
|
||||
"32 32 72 1",
|
||||
" c None",
|
||||
". c #7EA5C6",
|
||||
"+ c #6495BD",
|
||||
"@ c #4383B6",
|
||||
"# c #437FB2",
|
||||
"$ c #6491B5",
|
||||
"% c #7DA1BF",
|
||||
"& c #3882BE",
|
||||
"* c #387CB5",
|
||||
"= c #3779AF",
|
||||
"- c #3776AB",
|
||||
"; c #4988BB",
|
||||
"> c #CDDFEE",
|
||||
", c #F7F7FF",
|
||||
"' c #82ADD1",
|
||||
") c #3773A5",
|
||||
"! c #7096B5",
|
||||
"~ c #4385BB",
|
||||
"{ c #FFFFFF",
|
||||
"] c #F6F5F5",
|
||||
"^ c #3C729E",
|
||||
"/ c #9BBDDA",
|
||||
"( c #366D9C",
|
||||
"_ c #387FBA",
|
||||
": c #5A91BF",
|
||||
"< c #376A94",
|
||||
"[ c #FFED60",
|
||||
"} c #FFE659",
|
||||
"| c #F8E16E",
|
||||
"1 c #FFEB5E",
|
||||
"2 c #FFE354",
|
||||
"3 c #4489C0",
|
||||
"4 c #3885C3",
|
||||
"5 c #FFDB4C",
|
||||
"6 c #FBCE47",
|
||||
"7 c #FFD544",
|
||||
"8 c #72A0C5",
|
||||
"9 c #507CA1",
|
||||
"0 c #FFE052",
|
||||
"a c #FFD040",
|
||||
"b c #F5D98D",
|
||||
"c c #7F9EB8",
|
||||
"d c #F1ECDA",
|
||||
"e c #FFCC3B",
|
||||
"f c #FBC840",
|
||||
"g c #FBD54F",
|
||||
"h c #FCC539",
|
||||
"i c #4379A7",
|
||||
"j c #DCE1E7",
|
||||
"k c #FAE262",
|
||||
"l c #FFC532",
|
||||
"m c #FBC037",
|
||||
"n c #80A6C6",
|
||||
"o c #FFBC29",
|
||||
"p c #F7CD74",
|
||||
"q c #427DAE",
|
||||
"r c #FABE40",
|
||||
"s c #FFB521",
|
||||
"t c #497FAC",
|
||||
"u c #FFCD57",
|
||||
"v c #FFE097",
|
||||
"w c #FFD67B",
|
||||
"x c #FFD849",
|
||||
"y c #FFFBF2",
|
||||
"z c #F7DE92",
|
||||
"A c #FFCF6A",
|
||||
"B c #FFEDC8",
|
||||
"C c #FFE4AC",
|
||||
"D c #F7D284",
|
||||
"E c #FFB531",
|
||||
"F c #F7D47B",
|
||||
"G c #FDBE2E",
|
||||
" ",
|
||||
" ",
|
||||
" .+@###$% ",
|
||||
" &&&**==--- ",
|
||||
" ;&>,'*===))))! ",
|
||||
" ~&{{]==--))))^ ",
|
||||
" &&'/@===)))((( ",
|
||||
" __**===)))(((( ",
|
||||
" ((((( ",
|
||||
" :&&&**====)))(((<<[[}}| ",
|
||||
" &&&&&**===)))(((<<<11}22 ",
|
||||
" 34&__***---))(((<<<<222556 ",
|
||||
" 4&&&**====)))((<<<<<225557 ",
|
||||
" 84&&***==--))(((<<<<900577ab ",
|
||||
" ~&&&**===)))(((<<<<cd5577aef ",
|
||||
" ___**====)))((<<<<9dg577eeeh ",
|
||||
" __***==ijk[[[[[}225557aeelll ",
|
||||
" @_**===j|[[[[[}}00577aeelllm ",
|
||||
" n*==---k[[[[}}225577aellllop ",
|
||||
" **=---}[[[[}225577eelllloo ",
|
||||
" q===))[[[[}225577aeellloor ",
|
||||
" --)))[[}}00577aeelllooos ",
|
||||
" tiii11}005566fffffmmmmp ",
|
||||
" 22255 ",
|
||||
" 225557aeelllom ",
|
||||
" 00557aeeeuvwoo ",
|
||||
" gx77aeelly{{sm ",
|
||||
" z77aellllABCsD ",
|
||||
" 6ellloossE ",
|
||||
" FmGoop ",
|
||||
" ",
|
||||
" "};
|
||||
|
||||
#endif
|
123
bitmaps/icon_python_small.xpm
Normal file
123
bitmaps/icon_python_small.xpm
Normal file
@ -0,0 +1,123 @@
|
||||
/* XPM */
|
||||
#ifndef XPMMAIN
|
||||
extern char * icon_python_small_xpm[];
|
||||
|
||||
#else
|
||||
char *icon_python_small_xpm[] = {
|
||||
"16 16 98 2",
|
||||
" c None",
|
||||
". c #5490C0",
|
||||
"+ c #3E7EB4",
|
||||
"@ c #3D7CB0",
|
||||
"# c #5488B2",
|
||||
"$ c #4686BB",
|
||||
"% c #8FB8DA",
|
||||
"& c #DCE6F1",
|
||||
"* c #377AB0",
|
||||
"= c #3778AD",
|
||||
"- c #3773A5",
|
||||
"; c #5684AA",
|
||||
"> c #3880BC",
|
||||
", c #4A8AC0",
|
||||
"' c #538DBD",
|
||||
") c #3779AF",
|
||||
"! c #3774A8",
|
||||
"~ c #3772A3",
|
||||
"{ c #366D9C",
|
||||
"] c #366C9A",
|
||||
"^ c #799785",
|
||||
"/ c #FFEA5C",
|
||||
"( c #FCE464",
|
||||
"_ c #3883BF",
|
||||
": c #387EB7",
|
||||
"< c #387AB1",
|
||||
"[ c #366E9E",
|
||||
"} c #376A94",
|
||||
"| c #9BA876",
|
||||
"1 c #FFE658",
|
||||
"2 c #FFDF50",
|
||||
"3 c #4B8EC4",
|
||||
"4 c #3882BE",
|
||||
"5 c #387AB2",
|
||||
"6 c #3778AE",
|
||||
"7 c #3775A9",
|
||||
"8 c #A1AA77",
|
||||
"9 c #FFDE50",
|
||||
"0 c #FFD848",
|
||||
"a c #FCD55B",
|
||||
"b c #3B81BB",
|
||||
"c c #3880BB",
|
||||
"d c #387BB4",
|
||||
"e c #3776AA",
|
||||
"f c #376B96",
|
||||
"g c #7E9CB2",
|
||||
"h c #FADE70",
|
||||
"i c #FFD646",
|
||||
"j c #FFCF3E",
|
||||
"k c #FDC93C",
|
||||
"l c #3B80B9",
|
||||
"m c #387CB5",
|
||||
"n c #6393BB",
|
||||
"o c #F3E486",
|
||||
"p c #FFED60",
|
||||
"q c #FFE85B",
|
||||
"r c #FFE253",
|
||||
"s c #FFDA4A",
|
||||
"t c #FFD545",
|
||||
"u c #FFCD3C",
|
||||
"v c #FFC734",
|
||||
"w c #FEC433",
|
||||
"x c #508ABB",
|
||||
"y c #3776AB",
|
||||
"z c #9AAD84",
|
||||
"A c #FFE558",
|
||||
"B c #FFE152",
|
||||
"C c #FFD342",
|
||||
"D c #FFCB3A",
|
||||
"E c #FFC532",
|
||||
"F c #FFC330",
|
||||
"G c #FCC242",
|
||||
"H c #9BB082",
|
||||
"I c #FFEB5E",
|
||||
"J c #FFE659",
|
||||
"K c #FFE052",
|
||||
"L c #FFD241",
|
||||
"M c #FFC02E",
|
||||
"N c #FFBA27",
|
||||
"O c #4379A7",
|
||||
"P c #C0C273",
|
||||
"Q c #FFDE4F",
|
||||
"R c #FFDB4C",
|
||||
"S c #FFD040",
|
||||
"T c #FFCC3B",
|
||||
"U c #FFCE54",
|
||||
"V c #FFC540",
|
||||
"W c #FDBE30",
|
||||
"X c #F9DA70",
|
||||
"Y c #FFD645",
|
||||
"Z c #FFC836",
|
||||
"` c #FFEEC9",
|
||||
" . c #FFD37B",
|
||||
".. c #F9C95E",
|
||||
"+. c #FCCC4D",
|
||||
"@. c #FEC232",
|
||||
"#. c #FFBC29",
|
||||
"$. c #FCBD3D",
|
||||
" ",
|
||||
" . + @ # ",
|
||||
" $ % & * = - - ; ",
|
||||
" > , ' ) ! ~ { { ",
|
||||
" { ] ^ / ( ",
|
||||
" _ > : < = - [ ] } | 1 2 ",
|
||||
" 3 4 : 5 6 7 ~ { } } 8 9 0 a ",
|
||||
" b c d ) e - { f } g h i j k ",
|
||||
" l m * n o p p q r s t u v w ",
|
||||
" x * y z p p A B s C D E F G ",
|
||||
" = ! H I J K 0 L D v M N ",
|
||||
" O P 1 Q R ",
|
||||
" r 9 s S T U V W ",
|
||||
" X Y S Z E ` ... ",
|
||||
" +.@.#.$. ",
|
||||
" "
|
||||
};
|
||||
#endif
|
125
bitmaps/icon_txt.xpm
Normal file
125
bitmaps/icon_txt.xpm
Normal file
@ -0,0 +1,125 @@
|
||||
/* XPM */
|
||||
#ifndef XPMMAIN
|
||||
extern char * icon_txt_xpm[];
|
||||
|
||||
#else
|
||||
char * icon_txt_xpm[] = {
|
||||
"16 16 100 2",
|
||||
" c None",
|
||||
". c #AFAFAF",
|
||||
"+ c #B8CEF8",
|
||||
"@ c #B4CBF6",
|
||||
"# c #9EBDF1",
|
||||
"$ c #7CA5EA",
|
||||
"% c #719EE6",
|
||||
"& c #6697E2",
|
||||
"* c #5B8FDE",
|
||||
"= c #5088DA",
|
||||
"- c #4581D6",
|
||||
"; c #3A7AD2",
|
||||
"> c #3072CE",
|
||||
", c #256BCA",
|
||||
"' c #F2F6FD",
|
||||
") c #F1F5FD",
|
||||
"! c #EFF4FC",
|
||||
"~ c #EEF3FC",
|
||||
"{ c #ECF1FA",
|
||||
"] c #E9EFF8",
|
||||
"^ c #E6ECF6",
|
||||
"/ c #E3EAF5",
|
||||
"( c #E0E8F2",
|
||||
"_ c #DDE5F0",
|
||||
": c #DBE3EF",
|
||||
"< c #D8E1EC",
|
||||
"[ c #FFFFFF",
|
||||
"} c #FDFDFD",
|
||||
"| c #FDE080",
|
||||
"1 c #F2CC84",
|
||||
"2 c #E0AB8A",
|
||||
"3 c #F6F6F6",
|
||||
"4 c #F5F5F5",
|
||||
"5 c #F3F3F3",
|
||||
"6 c #F0F0F0",
|
||||
"7 c #FEFEFE",
|
||||
"8 c #FCFBF8",
|
||||
"9 c #FCE135",
|
||||
"0 c #FFC729",
|
||||
"a c #F6AB5E",
|
||||
"b c #F2EBE8",
|
||||
"c c #F4F4F4",
|
||||
"d c #F2F2F2",
|
||||
"e c #EDEDED",
|
||||
"f c #FDE394",
|
||||
"g c #FFDB35",
|
||||
"h c #FFC340",
|
||||
"i c #EAA871",
|
||||
"j c #EAEAEA",
|
||||
"k c #FCFCFC",
|
||||
"l c #FDE24E",
|
||||
"m c #FFCC36",
|
||||
"n c #FCAC4C",
|
||||
"o c #EEE1D8",
|
||||
"p c #F1F1F1",
|
||||
"q c #ECECEC",
|
||||
"r c #FCE8B2",
|
||||
"s c #FFE458",
|
||||
"t c #FFCD55",
|
||||
"u c #EDAA6D",
|
||||
"v c #EEEEEE",
|
||||
"w c #FEE473",
|
||||
"x c #FFD861",
|
||||
"y c #FDC16A",
|
||||
"z c #EAD4C5",
|
||||
"A c #F7E8C4",
|
||||
"B c #FEEB80",
|
||||
"C c #FFD871",
|
||||
"D c #EFB579",
|
||||
"E c #EEEEEF",
|
||||
"F c #E3E3E6",
|
||||
"G c #DDDDE1",
|
||||
"H c #EDEDEE",
|
||||
"I c #FCDF8D",
|
||||
"J c #FFE389",
|
||||
"K c #FED58A",
|
||||
"L c #E7C8B2",
|
||||
"M c #ECECED",
|
||||
"N c #E1E1E4",
|
||||
"O c #DBDBE0",
|
||||
"P c #F7D090",
|
||||
"Q c #FFEAB7",
|
||||
"R c #ECB989",
|
||||
"S c #E0E0E4",
|
||||
"T c #DCDCE1",
|
||||
"U c #E0B98F",
|
||||
"V c #E2AD8A",
|
||||
"W c #DBD1D1",
|
||||
"X c #DDDDE2",
|
||||
"Y c #DFDFE3",
|
||||
"Z c #FBFBFB",
|
||||
"` c #F9F9F9",
|
||||
" . c #F8F8F8",
|
||||
".. c #D3A78A",
|
||||
"+. c #DFD9DA",
|
||||
"@. c #E0E0E5",
|
||||
"#. c #E4E4E8",
|
||||
"$. c #EEEEF0",
|
||||
"%. c #F7F7F7",
|
||||
"&. c #E6E6E6",
|
||||
" . . . . . . . . . . . . . . ",
|
||||
" . + @ # $ % & * = - ; > , . ",
|
||||
" . ' ) ! ~ { ] ^ / ( _ : < . ",
|
||||
" . [ [ [ [ } | 1 2 3 4 5 6 . ",
|
||||
" . [ [ [ 7 8 9 0 a b c d e . ",
|
||||
" . [ [ 7 } f g h i c 5 6 j . ",
|
||||
" . [ [ 7 k l m n o c p q q . ",
|
||||
" . [ 7 } r s t u c d v v v . ",
|
||||
" . } } k w x y z p 6 6 6 6 . ",
|
||||
" . d 5 A B C D d d E F G H . ",
|
||||
" . 5 5 I J K L M N O O O F . ",
|
||||
" . 4 4 P Q R S T T . . . . . ",
|
||||
" . 3 3 U V W X X Y . Z k ` . ",
|
||||
" . . ...+.@.#.$.%.. d v . ",
|
||||
" . ` ` ` ` ` ` ` ` . &.. ",
|
||||
" . . . . . . . . . . . "};
|
||||
|
||||
#endif
|
102
bitmaps/new_txt.xpm
Normal file
102
bitmaps/new_txt.xpm
Normal file
@ -0,0 +1,102 @@
|
||||
/* XPM */
|
||||
#ifndef XPMMAIN
|
||||
extern char * new_txt_xpm[];
|
||||
|
||||
#else
|
||||
char * new_txt_xpm[] = {
|
||||
"16 16 78 1",
|
||||
" c None",
|
||||
". c #000000",
|
||||
"+ c #FEFEFE",
|
||||
"@ c #090909",
|
||||
"# c #EEEEEE",
|
||||
"$ c #F1F1F1",
|
||||
"% c #FBFBFB",
|
||||
"& c #FBE291",
|
||||
"* c #F2CC84",
|
||||
"= c #E2B497",
|
||||
"- c #F3F3F3",
|
||||
"; c #767676",
|
||||
"> c #F3F2F1",
|
||||
", c #FCE135",
|
||||
"' c #FFC729",
|
||||
") c #F6AB5E",
|
||||
"! c #F1EBE9",
|
||||
"~ c #F0F0F0",
|
||||
"{ c #161616",
|
||||
"] c #FCE397",
|
||||
"^ c #FFDB35",
|
||||
"/ c #FFC340",
|
||||
"( c #EAA871",
|
||||
"_ c #EFEFEF",
|
||||
": c #C4C4C4",
|
||||
"< c #F6F6F6",
|
||||
"[ c #FDE24E",
|
||||
"} c #FFCC36",
|
||||
"| c #FCAC4C",
|
||||
"1 c #EEE2D9",
|
||||
"2 c #ECECEC",
|
||||
"3 c #FBE8B5",
|
||||
"4 c #FFE458",
|
||||
"5 c #FFCD55",
|
||||
"6 c #EDAA6D",
|
||||
"7 c #EBEBEB",
|
||||
"8 c #FEE473",
|
||||
"9 c #FFD861",
|
||||
"0 c #FDC16A",
|
||||
"a c #EADBD1",
|
||||
"b c #EDEDED",
|
||||
"c c #EAEAEA",
|
||||
"d c #F4E9CE",
|
||||
"e c #FEEB80",
|
||||
"f c #FFD871",
|
||||
"g c #EFB579",
|
||||
"h c #E9E9E9",
|
||||
"i c #E8E8E8",
|
||||
"j c #E3E3E6",
|
||||
"k c #DDDDE1",
|
||||
"l c #FDFDFD",
|
||||
"m c #FBDF8D",
|
||||
"n c #FFE389",
|
||||
"o c #FED58A",
|
||||
"p c #E7C8B2",
|
||||
"q c #E2E2E5",
|
||||
"r c #DEDEE2",
|
||||
"s c #DFDFE2",
|
||||
"t c #E7E7E7",
|
||||
"u c #FCFCFC",
|
||||
"v c #F7D090",
|
||||
"w c #FFEAB7",
|
||||
"x c #ECB989",
|
||||
"y c #E0E0E4",
|
||||
"z c #DCDCE1",
|
||||
"A c #E6E6E6",
|
||||
"B c #E5E5E5",
|
||||
"C c #E0B98F",
|
||||
"D c #E2AD8A",
|
||||
"E c #DBD1D1",
|
||||
"F c #DDDDE2",
|
||||
"G c #E0E0E3",
|
||||
"H c #E4E4E4",
|
||||
"I c #DBBDA9",
|
||||
"J c #E0DBDC",
|
||||
"K c #E1E1E6",
|
||||
"L c #E5E5E8",
|
||||
"M c #E3E3E3",
|
||||
" ............ ",
|
||||
".++++++++++@+. ",
|
||||
".+###$$$$$$@%+. ",
|
||||
".+###&*=-$$@;++.",
|
||||
".+##>,')!$~@@@{.",
|
||||
".+#~]^/(-___##:.",
|
||||
".+#<[}|1_####2:.",
|
||||
".+#3456~#####7:.",
|
||||
".+-890a222bccc:.",
|
||||
".+defghihjkhii:.",
|
||||
".lmnop7qkrsttt:.",
|
||||
".uvwxyzzAAAAAB:.",
|
||||
".uCDEFFGAABBHH:.",
|
||||
".lIJKL####HMMM:.",
|
||||
".::::::::::::::.",
|
||||
" .............. "};
|
||||
#endif
|
@ -64,7 +64,7 @@ void BASE_SCREEN::InitDatas(void)
|
||||
case CVPCB_DISPLAY_FRAME:
|
||||
case MODULE_EDITOR_FRAME:
|
||||
case PCB_FRAME:
|
||||
m_CurrentSheet = &g_Sheet_A3;
|
||||
m_CurrentSheet = &g_Sheet_A4;
|
||||
break;
|
||||
|
||||
case GERBER_FRAME:
|
||||
@ -98,7 +98,22 @@ void BASE_SCREEN::InitDatas(void)
|
||||
m_FlagSave = 1; // indique sauvegarde auto faite
|
||||
}
|
||||
|
||||
|
||||
|
||||
/******************************************************************/
|
||||
wxPoint BASE_SCREEN::CursorRealPosition(const wxPoint & ScreenPos)
|
||||
/******************************************************************/
|
||||
{
|
||||
wxPoint curpos;
|
||||
|
||||
curpos.x = ScreenPos.x * GetZoom();
|
||||
curpos.y = ScreenPos.y * GetZoom();
|
||||
|
||||
curpos.x += m_DrawOrg.x;
|
||||
curpos.y += m_DrawOrg.y;
|
||||
|
||||
return curpos;
|
||||
}
|
||||
|
||||
/***************************************/
|
||||
int BASE_SCREEN::GetInternalUnits(void)
|
||||
/***************************************/
|
||||
|
@ -12,8 +12,8 @@
|
||||
#include "common.h"
|
||||
#include "wxstruct.h"
|
||||
#include "base_struct.h"
|
||||
#include "grfonte.h"
|
||||
|
||||
#include "grfonte.h"
|
||||
|
||||
#include "macros.h"
|
||||
|
||||
|
||||
@ -65,7 +65,7 @@ wxT("lib cmp draw line"),
|
||||
wxT("lib cmp pin"),
|
||||
wxT("lib cmp field"),
|
||||
wxT("unknown"),
|
||||
wxT("unknown")
|
||||
wxT("unknown")
|
||||
};
|
||||
|
||||
|
||||
@ -84,32 +84,32 @@ EDA_BaseStruct::EDA_BaseStruct(EDA_BaseStruct * parent, int idType)
|
||||
m_StructType = idType;
|
||||
m_Parent = parent; /* Chainage hierarchique sur struct racine */
|
||||
}
|
||||
|
||||
|
||||
|
||||
/********************************************/
|
||||
EDA_BaseStruct::EDA_BaseStruct(int idType)
|
||||
/********************************************/
|
||||
{
|
||||
{
|
||||
InitVars();
|
||||
m_StructType = idType;
|
||||
}
|
||||
|
||||
|
||||
/********************************************/
|
||||
void EDA_BaseStruct::InitVars(void)
|
||||
void EDA_BaseStruct::InitVars(void)
|
||||
/********************************************/
|
||||
{
|
||||
{
|
||||
m_StructType = TYPE_NOT_INIT;
|
||||
Pnext = NULL; /* Linked list: Link (next struct) */
|
||||
Pback = NULL; /* Linked list: Link (previous struct) */
|
||||
m_Parent = NULL; /* Linked list: Link (parent struct) */
|
||||
m_Son = NULL; /* Linked list: Link (son struct) */
|
||||
m_Son = NULL; /* Linked list: Link (son struct) */
|
||||
m_Image = NULL; /* Link to an image copy for undelete or abort command */
|
||||
m_Flags = 0; /* flags for editions and other */
|
||||
m_TimeStamp = 0; // Time stamp used for logical links
|
||||
m_Status = 0;
|
||||
m_Selected = 0; /* Used by block commands, and selective editing */
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/* Gestion de l'etat (status) de la structure (active, deleted..) */
|
||||
int EDA_BaseStruct::GetState(int type)
|
||||
@ -136,20 +136,20 @@ addition d'une nouvelle struct a la liste chain
|
||||
laststruct->Pnext = this;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**************************************************************************************/
|
||||
void EDA_BaseStruct::Draw(WinEDA_DrawPanel * panel, wxDC * DC, const wxPoint & offset,
|
||||
int draw_mode, int Color)
|
||||
/**************************************************************************************/
|
||||
/* Virtual
|
||||
void EDA_BaseStruct::Draw(WinEDA_DrawPanel * panel, wxDC * DC, const wxPoint & offset,
|
||||
int draw_mode, int Color)
|
||||
/**************************************************************************************/
|
||||
/* Virtual
|
||||
*/
|
||||
{
|
||||
wxString msg, name;
|
||||
msg.Printf( wxT("EDA_BaseStruct::Draw() error. Method for struct type %d used but not implemented ("),
|
||||
m_StructType);
|
||||
msg += ReturnClassName() + wxT(")\n");
|
||||
printf ( CONV_TO_UTF8(msg));
|
||||
}
|
||||
{
|
||||
wxString msg, name;
|
||||
msg.Printf( wxT("EDA_BaseStruct::Draw() error. Method for struct type %d used but not implemented ("),
|
||||
m_StructType);
|
||||
msg += ReturnClassName() + wxT(")\n");
|
||||
printf ( CONV_TO_UTF8(msg));
|
||||
}
|
||||
|
||||
#if 0
|
||||
/**************************************************************/
|
||||
@ -219,20 +219,20 @@ EDA_TextStruct::~EDA_TextStruct(void)
|
||||
}
|
||||
m_TextDrawingsSize = 0; /* nombre de sommets a dessiner */
|
||||
}
|
||||
|
||||
/********************************/
|
||||
int EDA_TextStruct::Len_Size(void)
|
||||
/********************************/
|
||||
// Return the text lenght in internal units
|
||||
{
|
||||
int nbchar = m_Text.Len();
|
||||
int len;
|
||||
if ( nbchar == 0 ) return 0;
|
||||
|
||||
len = ((10 * m_Size.x ) / 9) * nbchar;
|
||||
return len;
|
||||
}
|
||||
|
||||
|
||||
/********************************/
|
||||
int EDA_TextStruct::Len_Size(void)
|
||||
/********************************/
|
||||
// Return the text lenght in internal units
|
||||
{
|
||||
int nbchar = m_Text.Len();
|
||||
int len;
|
||||
if ( nbchar == 0 ) return 0;
|
||||
|
||||
len = ((10 * m_Size.x ) / 9) * nbchar;
|
||||
return len;
|
||||
}
|
||||
|
||||
|
||||
/*************************************************/
|
||||
int EDA_TextStruct::Locate(const wxPoint & posref)
|
||||
@ -302,7 +302,7 @@ int width;
|
||||
m_TextDrawings[2] + offset.y + m_Pos.y,
|
||||
m_TextDrawings[3] + offset.x + m_Pos.x,
|
||||
m_TextDrawings[4] + offset.y + m_Pos.y,
|
||||
color);
|
||||
width, color);
|
||||
}
|
||||
|
||||
else
|
||||
@ -317,9 +317,9 @@ int width;
|
||||
int cY = m_Pos.y - offset.y;
|
||||
/* trace ancre du texte */
|
||||
GRLine(&panel->m_ClipBox, DC, cX - anchor_size, cY,
|
||||
cX + anchor_size, cY, anchor_color);
|
||||
cX + anchor_size, cY, 0, anchor_color);
|
||||
GRLine(&panel->m_ClipBox, DC, cX, cY - anchor_size ,
|
||||
cX, cY + anchor_size , anchor_color);
|
||||
cX, cY + anchor_size , 0, anchor_color);
|
||||
}
|
||||
jj = 5; ii = jj+1;
|
||||
while (ii < m_TextDrawingsSize)
|
||||
@ -352,7 +352,7 @@ int width;
|
||||
}
|
||||
}
|
||||
else
|
||||
GRPoly(&panel->m_ClipBox, DC, nbpoints, coord, 0, color, color);
|
||||
GRPoly(&panel->m_ClipBox, DC, nbpoints, coord, 0, 0, color, color);
|
||||
|
||||
}
|
||||
}
|
||||
@ -377,7 +377,7 @@ int ii, jj, kk,nbchar, nbpoints, AsciiCode, endcar;
|
||||
int k1 , k2 , x0 , y0 ;
|
||||
int size_h , size_v , espacement ;
|
||||
char f_cod , plume = 'U';
|
||||
const wxChar * ptr;
|
||||
const wxChar * ptr;
|
||||
const SH_CODE * ptcar;
|
||||
int ux0, uy0, dx, dy; // Coord de trace des segments de texte & variables de calcul */
|
||||
int cX, cY; // Centre du texte
|
||||
|
@ -29,7 +29,7 @@ wxSize minsize;
|
||||
SetFont(*g_StdFont);
|
||||
m_MenuBar = NULL; // menu du haut d'ecran
|
||||
m_HToolBar = NULL;
|
||||
m_FrameIsActive = FALSE;
|
||||
m_FrameIsActive = TRUE;
|
||||
m_MsgFrameHeight = MSG_PANEL_DEFAULT_HEIGHT;
|
||||
|
||||
minsize.x = 470;
|
||||
|
@ -112,10 +112,10 @@ void DrawBlockStruct::Draw(WinEDA_DrawPanel * panel, wxDC * DC)
|
||||
int h = GetHeight()/panel->GetZoom();
|
||||
if ( w == 0 || h == 0 )
|
||||
GRLine(&panel->m_ClipBox, DC, GetX(), GetY(),
|
||||
GetRight(), GetBottom(), m_Color);
|
||||
GetRight(), GetBottom(), 0, m_Color);
|
||||
else
|
||||
GRRect(&panel->m_ClipBox, DC, GetX(), GetY(),
|
||||
GetRight(), GetBottom(), m_Color);
|
||||
GetRight(), GetBottom(), 0, m_Color);
|
||||
}
|
||||
|
||||
/*************************************************************************/
|
||||
|
@ -1,206 +1,207 @@
|
||||
/******************************************/
|
||||
/* Kicad: Common plot HPGL Routines */
|
||||
/******************************************/
|
||||
|
||||
#include "fctsys.h"
|
||||
#include "gr_basic.h"
|
||||
#include "trigo.h"
|
||||
#include "wxstruct.h"
|
||||
#include "base_struct.h"
|
||||
#include "common.h"
|
||||
#include "plot_common.h"
|
||||
#include "macros.h"
|
||||
|
||||
/* parametre HPGL pour trace de cercle: */
|
||||
#define CHORD_ANGLE 10
|
||||
|
||||
// Variables partagees avec Common plot Postscript Routines
|
||||
extern wxPoint LastPenPosition;
|
||||
extern wxPoint PlotOffset;
|
||||
extern FILE * PlotOutputFile;
|
||||
extern double XScale, YScale;
|
||||
extern int PenWidth;
|
||||
extern int PlotOrientOptions, etat_plume;
|
||||
|
||||
//Variables locales
|
||||
void Move_Plume_HPGL( wxPoint pos, int plume );
|
||||
void Plume_HPGL( int plume );
|
||||
|
||||
|
||||
/***********************************************************************************/
|
||||
void InitPlotParametresHPGL(wxPoint offset, double xscale, double yscale, int orient)
|
||||
/***********************************************************************************/
|
||||
/* Set the plot offset for the current plotting
|
||||
xscale,yscale = coordinate scale (scale coefficient for coordinates)
|
||||
device_xscale,device_yscale = device coordinate scale (i.e scale used by plot device)
|
||||
*/
|
||||
{
|
||||
PlotOffset = offset;
|
||||
XScale = xscale;
|
||||
YScale = yscale;
|
||||
PenWidth = 6; /* epaisseur du trait standard en 1/1000 pouce */
|
||||
PlotOrientOptions = orient;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*****************************************************************/
|
||||
bool PrintHeaderHPGL(FILE * plot_file, int pen_speed, int pen_num)
|
||||
/*****************************************************************/
|
||||
{
|
||||
char Line[256];
|
||||
|
||||
PlotOutputFile = plot_file;
|
||||
etat_plume = 'U';
|
||||
sprintf(Line,"IN;VS%d;PU;PA;SP%d;\n",pen_speed,pen_num);
|
||||
fputs(Line,plot_file);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/**********************************/
|
||||
bool CloseFileHPGL(FILE * plot_file)
|
||||
/**********************************/
|
||||
{
|
||||
fputs("PU;PA;SP0;\n",PlotOutputFile) ; fclose(PlotOutputFile) ;
|
||||
fclose(plot_file);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
/************************************************************/
|
||||
void PlotCircle_HPGL(wxPoint centre, int diameter, int width)
|
||||
/************************************************************/
|
||||
{
|
||||
int rayon;
|
||||
char Line[256];
|
||||
|
||||
UserToDeviceCoordinate(centre);
|
||||
rayon = (int)(diameter / 2 * XScale);
|
||||
|
||||
if(rayon < 0 ) rayon = 0 ;
|
||||
|
||||
Plume_HPGL('U');
|
||||
sprintf(Line,"PA %d,%d;CI %d,%d;\n", centre.x, centre.y, rayon , CHORD_ANGLE);
|
||||
fputs(Line,PlotOutputFile) ;
|
||||
|
||||
Plume_HPGL('U'); return ;
|
||||
}
|
||||
|
||||
|
||||
/********************************************************************/
|
||||
void PlotArcHPGL(wxPoint centre, int StAngle, int EndAngle, int rayon)
|
||||
/********************************************************************/
|
||||
/* trace d'un arc de cercle:
|
||||
centre = coord du centre
|
||||
StAngle, EndAngle = angle de debut et fin
|
||||
rayon = rayon de l'arc
|
||||
commande
|
||||
PU;PA x,y;PD;AA start_arc_X, start_arc_Y, angle, NbSegm; PU;
|
||||
ou PU;PA x,y;PD;AA start_arc_X, start_arc_Y, angle; PU;
|
||||
*/
|
||||
{
|
||||
char Line[256];
|
||||
wxPoint cmap; /* point de depart */
|
||||
wxPoint cpos; /* centre */
|
||||
float angle; /* angle de l'arc*/
|
||||
|
||||
if(rayon <= 0 ) return ;
|
||||
|
||||
cpos = centre; UserToDeviceCoordinate(cpos);
|
||||
|
||||
if( PlotOrientOptions == PLOT_MIROIR)
|
||||
{
|
||||
EndAngle = - EndAngle;
|
||||
StAngle = - StAngle;
|
||||
EXCHG (StAngle, EndAngle);
|
||||
}
|
||||
angle = (EndAngle - StAngle) /10.0;
|
||||
/* Calcul des coord du point de depart : */
|
||||
cmap.x = (int)( centre.x + ( rayon * cos(StAngle * M_PI / 1800 ) ) );
|
||||
cmap.y = (int)(centre.y + ( rayon * sin(StAngle * M_PI / 1800 ) ) );
|
||||
UserToDeviceCoordinate(cmap);
|
||||
|
||||
Plume_HPGL('U');
|
||||
sprintf(Line,"PU;PA %d,%d;PD;AA %d,%d, ", cmap.x, cmap.y, cpos.x, cpos.y);
|
||||
fputs(Line,PlotOutputFile) ;
|
||||
sprintf(Line,"%f", - angle); to_point(Line); // Transforme , et . du separateur
|
||||
fputs(Line,PlotOutputFile) ;
|
||||
sprintf(Line,", %d", CHORD_ANGLE); fputs(Line,PlotOutputFile) ;
|
||||
sprintf(Line,";PU;\n"); fputs(Line,PlotOutputFile) ;
|
||||
Plume_HPGL('U');
|
||||
}
|
||||
|
||||
|
||||
/*****************************************************/
|
||||
void PlotPolyHPGL( int nb, int * coord, int fill)
|
||||
/*****************************************************/
|
||||
/* Trace un polygone (ferme si rempli) en format HPGL
|
||||
coord = tableau des coord des sommets
|
||||
nb = nombre de coord ( 1 coord = 2 elements: X et Y du tableau )
|
||||
fill : si != 0 polygone rempli
|
||||
*/
|
||||
{
|
||||
int ii;
|
||||
if( nb <= 1 ) return;
|
||||
|
||||
Move_Plume_HPGL( wxPoint(coord[0],coord[1]), 'U');
|
||||
for( ii = 1; ii < nb ; ii ++ )
|
||||
{
|
||||
Move_Plume_HPGL( wxPoint(coord[ii * 2],coord[(ii*2) +1]), 'D');
|
||||
}
|
||||
|
||||
/* Fermeture eventuelle du polygone */
|
||||
if ( fill )
|
||||
{
|
||||
ii = (nb - 1) * 2;
|
||||
if( (coord[ii] != coord[0] ) || (coord[ii+1] != coord[0]) )
|
||||
Move_Plume_HPGL( wxPoint(coord[0],coord[1]), 'D');
|
||||
}
|
||||
Plume_HPGL('U');
|
||||
}
|
||||
|
||||
|
||||
/**********************************************/
|
||||
void Move_Plume_HPGL( wxPoint pos, int plume )
|
||||
/**********************************************/
|
||||
/*
|
||||
deplace la plume levee (plume = 'U') ou baissee (plume = 'D')
|
||||
en position x,y
|
||||
Unites en Unites DESSIN
|
||||
Si plume = 'Z' lever de plume sans deplacement
|
||||
*/
|
||||
{
|
||||
char Line[256];
|
||||
|
||||
if ( plume == 'Z')
|
||||
{
|
||||
Plume_HPGL('U');
|
||||
return;
|
||||
}
|
||||
Plume_HPGL(plume);
|
||||
UserToDeviceCoordinate(pos);
|
||||
|
||||
sprintf(Line,"PA %d,%d;\n",pos.x,pos.y) ; fputs(Line,PlotOutputFile) ;
|
||||
}
|
||||
|
||||
|
||||
/***************************/
|
||||
void Plume_HPGL( int plume )
|
||||
/***************************/
|
||||
/* leve (plume = 'U') ou baisse (plume = 'D') la plume
|
||||
*/
|
||||
{
|
||||
if ( plume == 'U')
|
||||
{
|
||||
if(etat_plume != 'U' ) fputs("PU;",PlotOutputFile) ;
|
||||
etat_plume = 'U';
|
||||
}
|
||||
else
|
||||
{
|
||||
if(etat_plume != 'D' )fputs("PD;",PlotOutputFile) ;
|
||||
etat_plume = 'D';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/******************************************/
|
||||
/* Kicad: Common plot HPGL Routines */
|
||||
/******************************************/
|
||||
|
||||
#include "fctsys.h"
|
||||
#include "gr_basic.h"
|
||||
#include "trigo.h"
|
||||
#include "wxstruct.h"
|
||||
#include "base_struct.h"
|
||||
#include "common.h"
|
||||
#include "plot_common.h"
|
||||
#include "macros.h"
|
||||
|
||||
/* parametre HPGL pour trace de cercle: */
|
||||
#define CHORD_ANGLE 10
|
||||
|
||||
// Variables partagees avec Common plot Postscript Routines
|
||||
extern wxPoint LastPenPosition;
|
||||
extern wxPoint PlotOffset;
|
||||
extern FILE * PlotOutputFile;
|
||||
extern double XScale, YScale;
|
||||
extern int g_DefaultPenWidth, g_CurrentPenWidth;
|
||||
extern int PlotOrientOptions, etat_plume;
|
||||
|
||||
//Variables locales
|
||||
void Move_Plume_HPGL( wxPoint pos, int plume );
|
||||
void Plume_HPGL( int plume );
|
||||
|
||||
|
||||
/***********************************************************************************/
|
||||
void InitPlotParametresHPGL(wxPoint offset, double xscale, double yscale, int orient)
|
||||
/***********************************************************************************/
|
||||
/* Set the plot offset for the current plotting
|
||||
xscale,yscale = coordinate scale (scale coefficient for coordinates)
|
||||
device_xscale,device_yscale = device coordinate scale (i.e scale used by plot device)
|
||||
*/
|
||||
{
|
||||
PlotOffset = offset;
|
||||
XScale = xscale;
|
||||
YScale = yscale;
|
||||
g_DefaultPenWidth = 6; /* epaisseur du trait standard en 1/1000 pouce */
|
||||
PlotOrientOptions = orient;
|
||||
g_CurrentPenWidth = -1;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*****************************************************************/
|
||||
bool PrintHeaderHPGL(FILE * plot_file, int pen_speed, int pen_num)
|
||||
/*****************************************************************/
|
||||
{
|
||||
char Line[256];
|
||||
|
||||
PlotOutputFile = plot_file;
|
||||
etat_plume = 'U';
|
||||
sprintf(Line,"IN;VS%d;PU;PA;SP%d;\n",pen_speed,pen_num);
|
||||
fputs(Line,plot_file);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/**********************************/
|
||||
bool CloseFileHPGL(FILE * plot_file)
|
||||
/**********************************/
|
||||
{
|
||||
fputs("PU;PA;SP0;\n",plot_file);
|
||||
fclose(plot_file);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
/************************************************************/
|
||||
void PlotCircle_HPGL(wxPoint centre, int diameter, int width)
|
||||
/************************************************************/
|
||||
{
|
||||
int rayon;
|
||||
char Line[256];
|
||||
|
||||
UserToDeviceCoordinate(centre);
|
||||
rayon = (int)(diameter / 2 * XScale);
|
||||
|
||||
if(rayon < 0 ) rayon = 0 ;
|
||||
|
||||
Plume_HPGL('U');
|
||||
sprintf(Line,"PA %d,%d;CI %d,%d;\n", centre.x, centre.y, rayon , CHORD_ANGLE);
|
||||
fputs(Line,PlotOutputFile) ;
|
||||
|
||||
Plume_HPGL('U'); return ;
|
||||
}
|
||||
|
||||
|
||||
/********************************************************************/
|
||||
void PlotArcHPGL(wxPoint centre, int StAngle, int EndAngle, int rayon, int width)
|
||||
/********************************************************************/
|
||||
/* trace d'un arc de cercle:
|
||||
centre = coord du centre
|
||||
StAngle, EndAngle = angle de debut et fin
|
||||
rayon = rayon de l'arc
|
||||
commande
|
||||
PU;PA x,y;PD;AA start_arc_X, start_arc_Y, angle, NbSegm; PU;
|
||||
ou PU;PA x,y;PD;AA start_arc_X, start_arc_Y, angle; PU;
|
||||
*/
|
||||
{
|
||||
char Line[256];
|
||||
wxPoint cmap; /* point de depart */
|
||||
wxPoint cpos; /* centre */
|
||||
float angle; /* angle de l'arc*/
|
||||
|
||||
if(rayon <= 0 ) return ;
|
||||
|
||||
cpos = centre; UserToDeviceCoordinate(cpos);
|
||||
|
||||
if( PlotOrientOptions == PLOT_MIROIR)
|
||||
{
|
||||
EndAngle = - EndAngle;
|
||||
StAngle = - StAngle;
|
||||
EXCHG (StAngle, EndAngle);
|
||||
}
|
||||
angle = (EndAngle - StAngle) /10.0;
|
||||
/* Calcul des coord du point de depart : */
|
||||
cmap.x = (int)( centre.x + ( rayon * cos(StAngle * M_PI / 1800 ) ) );
|
||||
cmap.y = (int)(centre.y + ( rayon * sin(StAngle * M_PI / 1800 ) ) );
|
||||
UserToDeviceCoordinate(cmap);
|
||||
|
||||
Plume_HPGL('U');
|
||||
sprintf(Line,"PU;PA %d,%d;PD;AA %d,%d, ", cmap.x, cmap.y, cpos.x, cpos.y);
|
||||
fputs(Line,PlotOutputFile) ;
|
||||
sprintf(Line,"%f", - angle); to_point(Line); // Transforme , et . du separateur
|
||||
fputs(Line,PlotOutputFile) ;
|
||||
sprintf(Line,", %d", CHORD_ANGLE); fputs(Line,PlotOutputFile) ;
|
||||
sprintf(Line,";PU;\n"); fputs(Line,PlotOutputFile) ;
|
||||
Plume_HPGL('U');
|
||||
}
|
||||
|
||||
|
||||
/*****************************************************/
|
||||
void PlotPolyHPGL( int nb, int * coord, int fill, int width)
|
||||
/*****************************************************/
|
||||
/* Trace un polygone (ferme si rempli) en format HPGL
|
||||
coord = tableau des coord des sommets
|
||||
nb = nombre de coord ( 1 coord = 2 elements: X et Y du tableau )
|
||||
fill : si != 0 polygone rempli
|
||||
*/
|
||||
{
|
||||
int ii;
|
||||
if( nb <= 1 ) return;
|
||||
|
||||
Move_Plume_HPGL( wxPoint(coord[0],coord[1]), 'U');
|
||||
for( ii = 1; ii < nb ; ii ++ )
|
||||
{
|
||||
Move_Plume_HPGL( wxPoint(coord[ii * 2],coord[(ii*2) +1]), 'D');
|
||||
}
|
||||
|
||||
/* Fermeture eventuelle du polygone */
|
||||
if ( fill )
|
||||
{
|
||||
ii = (nb - 1) * 2;
|
||||
if( (coord[ii] != coord[0] ) || (coord[ii+1] != coord[0]) )
|
||||
Move_Plume_HPGL( wxPoint(coord[0],coord[1]), 'D');
|
||||
}
|
||||
Plume_HPGL('U');
|
||||
}
|
||||
|
||||
|
||||
/**********************************************/
|
||||
void Move_Plume_HPGL( wxPoint pos, int plume )
|
||||
/**********************************************/
|
||||
/*
|
||||
deplace la plume levee (plume = 'U') ou baissee (plume = 'D')
|
||||
en position x,y
|
||||
Unites en Unites DESSIN
|
||||
Si plume = 'Z' lever de plume sans deplacement
|
||||
*/
|
||||
{
|
||||
char Line[256];
|
||||
|
||||
if ( plume == 'Z')
|
||||
{
|
||||
Plume_HPGL('U');
|
||||
return;
|
||||
}
|
||||
Plume_HPGL(plume);
|
||||
UserToDeviceCoordinate(pos);
|
||||
|
||||
sprintf(Line,"PA %d,%d;\n",pos.x,pos.y) ; fputs(Line,PlotOutputFile) ;
|
||||
}
|
||||
|
||||
|
||||
/***************************/
|
||||
void Plume_HPGL( int plume )
|
||||
/***************************/
|
||||
/* leve (plume = 'U') ou baisse (plume = 'D') la plume
|
||||
*/
|
||||
{
|
||||
if ( plume == 'U')
|
||||
{
|
||||
if(etat_plume != 'U' ) fputs("PU;",PlotOutputFile) ;
|
||||
etat_plume = 'U';
|
||||
}
|
||||
else
|
||||
{
|
||||
if(etat_plume != 'D' )fputs("PD;",PlotOutputFile) ;
|
||||
etat_plume = 'D';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@ -16,7 +16,7 @@ extern wxPoint LastPenPosition;
|
||||
extern wxPoint PlotOffset;
|
||||
extern FILE * PlotOutputFile;
|
||||
extern double XScale, YScale;
|
||||
extern int PenWidth;
|
||||
extern int g_DefaultPenWidth, g_CurrentPenWidth;
|
||||
extern int PlotOrientOptions, etat_plume;
|
||||
|
||||
// Locales
|
||||
@ -36,6 +36,7 @@ void InitPlotParametresPS(wxPoint offset, Ki_PageDescr * sheet,
|
||||
SheetPS = sheet;
|
||||
XScale = xscale;
|
||||
YScale = yscale;
|
||||
g_CurrentPenWidth = -1;
|
||||
}
|
||||
|
||||
/*************************************************************************************/
|
||||
@ -44,7 +45,23 @@ void SetDefaultLineWidthPS( int width)
|
||||
/* Set the default line width (in 1/1000 inch) for the current plotting
|
||||
*/
|
||||
{
|
||||
PenWidth = width; /* epaisseur du trait standard en 1/1000 pouce */
|
||||
g_DefaultPenWidth = width; /* epaisseur du trait standard en 1/1000 pouce */
|
||||
g_CurrentPenWidth = -1;
|
||||
}
|
||||
|
||||
/***************************************/
|
||||
void SetCurrentLineWidthPS( int width)
|
||||
/***************************************/
|
||||
/* Set the Current line width (in 1/1000 inch) for the next plot
|
||||
*/
|
||||
{
|
||||
int pen_width;
|
||||
|
||||
if ( width > 0 ) pen_width = width;
|
||||
else pen_width = g_DefaultPenWidth;
|
||||
if ( pen_width != g_CurrentPenWidth )
|
||||
fprintf(PlotOutputFile,"%d setlinewidth\n", (int)(XScale * pen_width));
|
||||
g_CurrentPenWidth = pen_width;
|
||||
}
|
||||
|
||||
/******************************/
|
||||
@ -77,7 +94,7 @@ void PlotFilledSegmentPS(wxPoint start , wxPoint end, int width)
|
||||
UserToDeviceCoordinate(start);
|
||||
UserToDeviceCoordinate(end);
|
||||
|
||||
fprintf(PlotOutputFile,"%d setlinewidth\n", (int)(XScale * width));
|
||||
SetCurrentLineWidthPS(width);
|
||||
fprintf(PlotOutputFile,"%d %d %d %d line\n", start.x, start.y, end.x, end.y);
|
||||
}
|
||||
|
||||
@ -94,21 +111,16 @@ char Line[256];
|
||||
|
||||
if(rayon < 0 ) rayon = 0 ;
|
||||
|
||||
if ( width > 0 )
|
||||
{
|
||||
sprintf(Line,"%d setlinewidth\n", (int)( width * XScale) ) ;
|
||||
fputs(Line,PlotOutputFile);
|
||||
}
|
||||
|
||||
SetCurrentLineWidthPS(width);
|
||||
sprintf(Line,"newpath %d %d %d 0 360 arc stroke\n", pos.x, pos.y, rayon);
|
||||
fputs(Line,PlotOutputFile) ;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/********************************************************************/
|
||||
void PlotArcPS(wxPoint centre, int StAngle, int EndAngle, int rayon)
|
||||
/********************************************************************/
|
||||
/**************************************************************************************/
|
||||
void PlotArcPS(wxPoint centre, int StAngle, int EndAngle, int rayon, int width)
|
||||
/**************************************************************************************/
|
||||
/* Plot an arc:
|
||||
StAngle, EndAngle = start and end arc in 0.1 degree
|
||||
*/
|
||||
@ -117,6 +129,7 @@ char Line[256];
|
||||
|
||||
if(rayon <= 0 ) return ;
|
||||
|
||||
SetCurrentLineWidthPS(width);
|
||||
/* Calcul des coord du point de depart : */
|
||||
UserToDeviceCoordinate(centre);
|
||||
|
||||
@ -132,29 +145,11 @@ char Line[256];
|
||||
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
void PlotArcPS(wxPoint centre, int StAngle, int EndAngle, int rayon, int width)
|
||||
/*****************************************************************************/
|
||||
/* trace d'un arc de cercle:
|
||||
x, y = coord du centre
|
||||
StAngle, EndAngle = angle de debut et fin
|
||||
rayon = rayon de l'arc
|
||||
w = epaisseur de l'arc
|
||||
*/
|
||||
{
|
||||
char Line[256];
|
||||
|
||||
if(rayon <= 0 ) return ;
|
||||
|
||||
sprintf(Line,"%d setlinewidth\n", (int) (width * XScale) );
|
||||
fputs(Line, PlotOutputFile);
|
||||
PlotArcPS( centre, StAngle, EndAngle, rayon);
|
||||
}
|
||||
|
||||
|
||||
/***************************************************/
|
||||
void PlotPolyPS( int nb_segm, int * coord, int fill)
|
||||
/***************************************************/
|
||||
/****************************************************************/
|
||||
void PlotPolyPS( int nb_segm, int * coord, int fill, int width)
|
||||
/*****************************************************************/
|
||||
/* Trace un polygone ( ferme si rempli ) en format POSTSCRIPT
|
||||
coord = tableau des coord des sommets
|
||||
nb_segm = nombre de coord ( 1 coord = 2 elements: X et Y du tableau )
|
||||
@ -166,6 +161,8 @@ wxPoint pos;
|
||||
|
||||
if( nb_segm <= 1 ) return;
|
||||
|
||||
SetCurrentLineWidthPS(width);
|
||||
|
||||
pos.x = coord[0]; pos.y = coord[1];
|
||||
UserToDeviceCoordinate(pos);
|
||||
fprintf(PlotOutputFile, "newpath %d %d moveto\n", pos.x, pos.y);
|
||||
@ -275,7 +272,7 @@ time_t time1970 = time(NULL);
|
||||
fputs(Line,PlotOutputFile);
|
||||
|
||||
// Set default line width:
|
||||
fprintf(PlotOutputFile,"%d setlinewidth\n", PenWidth ); //PenWidth in user units
|
||||
fprintf(PlotOutputFile,"%d setlinewidth\n", g_DefaultPenWidth ); //g_DefaultPenWidth in user units
|
||||
}
|
||||
|
||||
|
||||
|
@ -18,13 +18,24 @@ wxPoint LastPenPosition;
|
||||
wxPoint PlotOffset;
|
||||
FILE * PlotOutputFile;
|
||||
double XScale, YScale;
|
||||
int PenWidth;
|
||||
int g_DefaultPenWidth;
|
||||
int g_CurrentPenWidth = -1;
|
||||
int PlotOrientOptions, etat_plume;
|
||||
|
||||
|
||||
// Locales
|
||||
static Ki_PageDescr * SheetPS;
|
||||
|
||||
/*************************/
|
||||
void ForcePenReinit(void)
|
||||
/*************************/
|
||||
/* set the flag g_CurrentPenWidth to -1 in order to force a pen width redefinition
|
||||
for the next draw command
|
||||
*/
|
||||
{
|
||||
g_CurrentPenWidth = -1;
|
||||
}
|
||||
|
||||
/**********************************************/
|
||||
void SetPlotScale(double xscale, double yscale)
|
||||
/**********************************************/
|
||||
@ -56,7 +67,8 @@ void InitPlotParametresGERBER(wxPoint offset, double xscale, double yscale)
|
||||
SheetPS = NULL;
|
||||
XScale = xscale;
|
||||
YScale = yscale;
|
||||
PenWidth = 120; /* epaisseur du trait standard en 1/1000 pouce */
|
||||
g_DefaultPenWidth = 120; /* epaisseur du trait standard en 1/1000 pouce */
|
||||
g_CurrentPenWidth = -1;
|
||||
}
|
||||
|
||||
|
||||
@ -74,7 +86,8 @@ wxSize PageSize;
|
||||
wxPoint pos, ref;
|
||||
int color;
|
||||
Ki_WorkSheetData * WsItem;
|
||||
int conv_unit = screen->GetInternalUnits()/1000;
|
||||
int conv_unit = screen->GetInternalUnits()/1000; /* Scale to convert dimension in 1/1000 in into internal units
|
||||
(1/1000 inc for EESchema, 1/10000 for pcbnew */
|
||||
wxString msg;
|
||||
wxSize text_size;
|
||||
void (*FctPlume)(wxPoint pos, int state);
|
||||
@ -124,10 +137,10 @@ int UpperLimit = VARIABLE_BLOCK_START_POSITION;
|
||||
text_size.x = WSTEXTSIZE * conv_unit;
|
||||
text_size.y = WSTEXTSIZE * conv_unit;
|
||||
|
||||
ref.x = Sheet->m_LeftMargin * conv_unit;
|
||||
ref.y = Sheet->m_TopMargin * conv_unit; /* Upper left corner */
|
||||
xg = (PageSize.x - Sheet->m_RightMargin) * conv_unit;
|
||||
yg = (PageSize.y - Sheet->m_BottomMargin) * conv_unit; /* lower right corner */
|
||||
ref.x = Sheet->m_LeftMargin;
|
||||
ref.y = Sheet->m_TopMargin; /* Upper left corner in 1/1000 inch */
|
||||
xg = (PageSize.x - Sheet->m_RightMargin);
|
||||
yg = (PageSize.y - Sheet->m_BottomMargin); /* lower right corner in 1/1000 inch */
|
||||
|
||||
/* Trace des reperes selon l'axe X */
|
||||
ipas = (xg - ref.x) / PAS_REF;
|
||||
|
@ -137,9 +137,6 @@ void wxSVGFileDC::Init (wxString f, int Width, int Height, float dpi)
|
||||
|
||||
s.Printf ( wxT("<svg\n") );
|
||||
write(s);
|
||||
// s.Printf ( wxT(" xmlns:svg=\"http://www.w3.org/2000/svg\"\n") );
|
||||
//
|
||||
write(s);
|
||||
s.Printf ( wxT(" xmlns=\"http://www.w3.org/2000/svg\"\n") );
|
||||
write(s);
|
||||
s.Printf ( wxT(" version=\"1.1\"\n") );
|
||||
|
@ -26,6 +26,8 @@ BEGIN_EVENT_TABLE(WinEDAListBox, wxDialog)
|
||||
EVT_BUTTON(ID_LISTBOX_CANCEL, WinEDAListBox::Cancel)
|
||||
EVT_LISTBOX(ID_LISTBOX_LIST, WinEDAListBox::ClickOnList)
|
||||
EVT_LISTBOX_DCLICK(ID_LISTBOX_LIST, WinEDAListBox::D_ClickOnList)
|
||||
EVT_CHAR(WinEDAListBox::OnKeyEvent)
|
||||
EVT_CHAR_HOOK(WinEDAListBox::OnKeyEvent)
|
||||
EVT_CLOSE( WinEDAListBox::OnClose )
|
||||
END_EVENT_TABLE()
|
||||
|
||||
@ -39,7 +41,7 @@ END_EVENT_TABLE()
|
||||
movefct = fonction de création de commentaires a afficher
|
||||
*/
|
||||
|
||||
WinEDAListBox::WinEDAListBox( wxWindow * parent, const wxString & title,
|
||||
WinEDAListBox::WinEDAListBox( WinEDA_DrawFrame * parent, const wxString & title,
|
||||
const wxChar ** itemlist,
|
||||
const wxString & reftext,
|
||||
void(* movefct)(wxString & Text),
|
||||
@ -186,12 +188,12 @@ void WinEDAListBox::ClickOnList(wxCommandEvent& event)
|
||||
wxString text;
|
||||
|
||||
if (m_MoveFct)
|
||||
{
|
||||
{
|
||||
m_WinMsg->Clear();
|
||||
text = m_List->GetStringSelection();
|
||||
m_MoveFct(text);
|
||||
m_WinMsg->WriteText(text.GetData());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*******************************************************/
|
||||
@ -259,3 +261,10 @@ const wxString ** BufList;
|
||||
}
|
||||
|
||||
|
||||
/****************************************************/
|
||||
void WinEDAListBox::OnKeyEvent(wxKeyEvent& event)
|
||||
/****************************************************/
|
||||
{
|
||||
event.Skip();
|
||||
}
|
||||
|
||||
|
@ -170,7 +170,7 @@ bool sketch_mode = FALSE;
|
||||
dx += cX; dy = cY;
|
||||
RotatePoint(&ux0, &uy0, cX, cY, orient);
|
||||
RotatePoint(&dx, &dy, cX, cY, orient);
|
||||
GRLine(&panel->m_ClipBox, DC, ux0, uy0, dx, dy, gcolor);
|
||||
GRLine(&panel->m_ClipBox, DC, ux0, uy0, dx, dy, width, gcolor);
|
||||
|
||||
return;
|
||||
}
|
||||
@ -210,7 +210,7 @@ return;
|
||||
if(ii && (plume == 'D' ) )
|
||||
{
|
||||
if ( width <= 1 )
|
||||
GRPoly(&panel->m_ClipBox, DC, ii /2, coord, 0,
|
||||
GRPoly(&panel->m_ClipBox, DC, ii /2, coord, 0, 0,
|
||||
gcolor, gcolor);
|
||||
else if ( sketch_mode )
|
||||
{
|
||||
@ -222,8 +222,8 @@ return;
|
||||
}
|
||||
|
||||
else
|
||||
GRPolyLines(&panel->m_ClipBox, DC, ii /2, coord,
|
||||
gcolor, gcolor, width);
|
||||
GRPoly(&panel->m_ClipBox, DC, ii /2, coord, 0,
|
||||
width, gcolor, gcolor);
|
||||
}
|
||||
plume = f_cod; ii = 0;
|
||||
break;
|
||||
|
@ -1,7 +1,7 @@
|
||||
|
||||
//////////////////////
|
||||
// Name: eda_dde.cc //
|
||||
//////////////////////
|
||||
///////////////////////
|
||||
// Name: eda_dde.cpp //
|
||||
///////////////////////
|
||||
|
||||
// For compilers that support precompilation, includes "wx/wx.h".
|
||||
#include <wx/wxprec.h>
|
||||
@ -21,13 +21,16 @@
|
||||
#include "id.h"
|
||||
|
||||
#include "common.h"
|
||||
#include "macros.h"
|
||||
|
||||
#define ID_CONN "CAO_COM"
|
||||
|
||||
wxString HOSTNAME(wxT("localhost"));
|
||||
|
||||
/* variables locales */
|
||||
#define IPC_BUF_SIZE 4000
|
||||
|
||||
// buffers for read and write data in socket connections
|
||||
#define IPC_BUF_SIZE 4096
|
||||
char client_ipc_buffer[IPC_BUF_SIZE];
|
||||
char server_ipc_buffer[IPC_BUF_SIZE];
|
||||
|
||||
@ -77,22 +80,24 @@ size_t len;
|
||||
wxSocketBase *sock = evt.GetSocket();
|
||||
|
||||
switch (evt.GetSocketEvent())
|
||||
{
|
||||
{
|
||||
case wxSOCKET_INPUT:
|
||||
sock->Read(server_ipc_buffer,1);
|
||||
len = sock->Read(server_ipc_buffer+1,IPC_BUF_SIZE-2).LastCount();
|
||||
server_ipc_buffer[len+1] = 0;
|
||||
if(RemoteFct ) RemoteFct(server_ipc_buffer);
|
||||
break;
|
||||
sock->Read(server_ipc_buffer,1);
|
||||
if( sock->LastCount() == 0 ) break; // No data: Occurs on open connection
|
||||
sock->Read(server_ipc_buffer+1,IPC_BUF_SIZE-2);
|
||||
len = 1 + sock->LastCount();
|
||||
server_ipc_buffer[len] = 0;
|
||||
if(RemoteFct ) RemoteFct(server_ipc_buffer);
|
||||
break;
|
||||
|
||||
case wxSOCKET_LOST:
|
||||
case wxSOCKET_LOST:
|
||||
return;
|
||||
break;
|
||||
|
||||
default:
|
||||
default:
|
||||
wxPrintf( wxT("WinEDA_DrawFrame::OnSockRequest() error: Invalid event !"));
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**************************************************************/
|
||||
@ -120,12 +125,12 @@ wxSocketServer *server = (wxSocketServer *) evt.GetSocket();
|
||||
/********************************************/
|
||||
bool SendCommand( int service, char * cmdline)
|
||||
/********************************************/
|
||||
/* Fonction utilisee par un client pour envoyer une information a un serveur.
|
||||
- Etablit une connection Socket Client
|
||||
- envoie le contenu du buffer cmdline
|
||||
- ferme la connexion
|
||||
/* Used by a client to sent (by a socket connection) a data to a server.
|
||||
- Open a Socket Client connection
|
||||
- Send the buffer cmdline
|
||||
- Close the socket connection
|
||||
|
||||
service contient le numéro de service en ascii.
|
||||
service is the service number for the TC/IP connection
|
||||
*/
|
||||
{
|
||||
wxSocketClient * sock_client;
|
||||
|
@ -8,6 +8,10 @@
|
||||
#define EDA_BASE
|
||||
#define COMMON_GLOBL
|
||||
|
||||
#ifdef KICAD_PYTHON
|
||||
#include <pyhandler.h>
|
||||
#endif
|
||||
|
||||
#include "fctsys.h"
|
||||
#include <wx/image.h>
|
||||
#include "wx/html/htmlwin.h"
|
||||
@ -95,8 +99,6 @@ WinEDA_App::~WinEDA_App(void)
|
||||
delete g_ItalicFont;
|
||||
delete g_FixedFont;
|
||||
delete g_MsgFont;
|
||||
delete DrawPen;
|
||||
delete DrawBrush;
|
||||
if ( m_Checker ) delete m_Checker;
|
||||
delete m_Locale;
|
||||
}
|
||||
@ -130,10 +132,6 @@ wxString EnvLang;
|
||||
m_EDA_Config = new wxConfig(name);
|
||||
m_EDA_CommonConfig = new wxConfig(wxT("kicad_common"));
|
||||
|
||||
/* Creation des outils de trace */
|
||||
DrawPen = new wxPen( wxT("GREEN"), 1, wxSOLID);
|
||||
DrawBrush = new wxBrush(wxT("BLACK"), wxTRANSPARENT);
|
||||
|
||||
/* Creation des fontes utiles */
|
||||
g_StdFontPointSize = FONT_DEFAULT_SIZE;
|
||||
g_MsgFontPointSize = FONT_DEFAULT_SIZE;
|
||||
@ -166,6 +164,9 @@ bool succes = SetLanguage(TRUE);
|
||||
if ( atof("0,1") ) g_FloatSeparator = ','; // Nombres flottants = 0,1
|
||||
else g_FloatSeparator = '.';
|
||||
|
||||
#ifdef KICAD_PYTHON
|
||||
PyHandler::GetInstance()->SetAppName( name );
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@ -590,3 +591,12 @@ wxMenuItem * item;
|
||||
}
|
||||
|
||||
|
||||
int WinEDA_App::OnRun(void)
|
||||
/* Run init scripts */
|
||||
{
|
||||
#ifdef KICAD_PYTHON
|
||||
PyHandler::GetInstance()->RunScripts();
|
||||
#endif
|
||||
return wxApp::OnRun();
|
||||
}
|
||||
|
||||
|
@ -5,6 +5,7 @@
|
||||
|
||||
// For compilers that support precompilation, includes "wx.h".
|
||||
#include "wx/wxprec.h"
|
||||
#include "wx/mimetype.h"
|
||||
|
||||
#ifdef __BORLANDC__
|
||||
#pragma hdrstop
|
||||
@ -276,6 +277,8 @@ wxString defaultpath = Path;
|
||||
defaultpath.Replace(wxT("/"), STRING_DIR_SEP);
|
||||
if ( defaultpath.IsEmpty() ) defaultpath = wxGetCwd();
|
||||
|
||||
wxSetWorkingDirectory( defaultpath );
|
||||
|
||||
fullfilename = wxFileSelector( wxString(Title),
|
||||
defaultpath,
|
||||
defaultname,
|
||||
@ -415,12 +418,24 @@ wxString FullFileName;
|
||||
/***********************************************************************************/
|
||||
int ExecuteFile(wxWindow * frame, const wxString & ExecFile, const wxString & param)
|
||||
/***********************************************************************************/
|
||||
/* appelle le logiciel ExecFile, avec les parametres filename
|
||||
/* Call the executable file "ExecFile", with params "param"
|
||||
*/
|
||||
{
|
||||
wxString FullFileName;
|
||||
|
||||
|
||||
#ifdef __WXMAC__
|
||||
// Mac part
|
||||
wxGetEnv("HOME", &FullFileName);
|
||||
FullFileName += wxString("/bin/") + newExecFile;
|
||||
if (! wxFileExists(FullFileName) )
|
||||
{
|
||||
FullFileName = FindKicadFile(ExecFile);
|
||||
}
|
||||
|
||||
#else
|
||||
FullFileName = FindKicadFile(ExecFile);
|
||||
#endif
|
||||
|
||||
if ( wxFileExists(FullFileName) )
|
||||
{
|
||||
@ -429,7 +444,6 @@ wxString FullFileName;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
wxString msg;
|
||||
msg.Printf( wxT("Command file <%s> not found"), FullFileName.GetData() );
|
||||
DisplayError(frame, msg, 20);
|
||||
@ -569,3 +583,71 @@ wxString GetEditorName(void)
|
||||
}
|
||||
return g_EditorName;
|
||||
}
|
||||
|
||||
void OpenPDF( const wxString & file )
|
||||
{
|
||||
wxString command;
|
||||
wxString filename = file;
|
||||
wxString type;
|
||||
|
||||
EDA_Appl->ReadPdfBrowserInfos();
|
||||
if ( !EDA_Appl->m_PdfBrowserIsDefault )
|
||||
{
|
||||
AddDelimiterString(filename);
|
||||
command = EDA_Appl->m_PdfBrowser + filename;
|
||||
}
|
||||
else
|
||||
{
|
||||
bool success = false;
|
||||
wxFileType * filetype = NULL;
|
||||
|
||||
wxFileType::MessageParameters params(filename, type);
|
||||
filetype = wxTheMimeTypesManager->GetFileTypeFromExtension(wxT(".pdf"));
|
||||
if (filetype ) success = filetype->GetOpenCommand( &command, params);
|
||||
delete filetype;
|
||||
|
||||
if (!success)
|
||||
{
|
||||
AddDelimiterString(filename);
|
||||
command.Empty();
|
||||
wxString tries[] =
|
||||
{
|
||||
wxT("/usr/bin/evince"),
|
||||
wxT("/usr/bin/xpdf"),
|
||||
wxT("/usr/bin/konqueror"),
|
||||
wxT("/usr/bin/gpdf"),
|
||||
wxT(""),
|
||||
};
|
||||
for ( int i = 0;; i++ )
|
||||
{
|
||||
if (tries[i].IsEmpty()) break;
|
||||
if (wxFileExists(tries[i]))
|
||||
{
|
||||
command = tries[i] + wxT(" ") + filename;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!command.IsEmpty()) wxExecute(command);
|
||||
}
|
||||
|
||||
|
||||
void OpenFile( const wxString & file )
|
||||
{
|
||||
wxString command;
|
||||
wxString filename = file;
|
||||
|
||||
wxFileName CurrentFileName(filename);
|
||||
wxString ext, type;
|
||||
ext = CurrentFileName.GetExt();
|
||||
wxFileType * filetype = wxTheMimeTypesManager->GetFileTypeFromExtension(ext);
|
||||
|
||||
bool success = false;
|
||||
|
||||
wxFileType::MessageParameters params(filename, type);
|
||||
if (filetype) success = filetype->GetOpenCommand( &command, params);
|
||||
delete filetype;
|
||||
|
||||
if (success && !command.IsEmpty()) wxExecute(command);
|
||||
}
|
||||
|
@ -31,8 +31,8 @@ static int xcliplo = 0,
|
||||
ycliphi = 2000; /* coord de la surface de trace */
|
||||
static int lastcolor = -1;
|
||||
static int lastwidth = -1;
|
||||
static int s_Last_Pen_Style = -1;
|
||||
static wxDC * lastDC = NULL;
|
||||
|
||||
/*
|
||||
Macro de clipping du trace d'une ligne:
|
||||
la ligne (x1,y1 x2,y2) est clippee pour rester dans le cadre
|
||||
@ -217,7 +217,7 @@ void SetPenMinWidth(int minwidth)
|
||||
|
||||
|
||||
/* Routine de changement de couleurs et epaisseur de la plume courante */
|
||||
void GRSetColorPen(wxDC * DC, int Color , int width)
|
||||
void GRSetColorPen(wxDC * DC, int Color , int width, int style)
|
||||
{
|
||||
Color &= MASKCOLOR; // Pour 32 couleurs Max
|
||||
|
||||
@ -225,17 +225,21 @@ void GRSetColorPen(wxDC * DC, int Color , int width)
|
||||
|
||||
if( ForceBlackPen && Color != WHITE ) Color = BLACK;
|
||||
|
||||
if( (lastcolor != Color) || (lastwidth != width) || (lastDC != DC ) )
|
||||
if( (lastcolor != Color) || (lastwidth != width) || (s_Last_Pen_Style != style) || (lastDC != DC ) )
|
||||
{
|
||||
DrawPen->SetColour(
|
||||
wxPen DrawPen;
|
||||
DrawPen.SetColour(
|
||||
ColorRefs[Color].m_Red,
|
||||
ColorRefs[Color].m_Green,
|
||||
ColorRefs[Color].m_Blue
|
||||
);
|
||||
|
||||
DrawPen->SetWidth(width);
|
||||
if ( &DC->GetPen() != DrawPen ) DC->SetPen(*DrawPen);
|
||||
DrawPen.SetWidth(width);
|
||||
DrawPen.SetStyle(style);
|
||||
// if ( &DC->GetPen() != DrawPen )
|
||||
DC->SetPen(DrawPen);
|
||||
lastcolor = Color; lastwidth = width; lastDC = DC;
|
||||
s_Last_Pen_Style = style;
|
||||
}
|
||||
}
|
||||
|
||||
@ -245,15 +249,16 @@ void GRSetBrush(wxDC * DC, int Color , int fill)
|
||||
{
|
||||
Color &= MASKCOLOR; // Pour 32 couleurs Max
|
||||
if( ForceBlackPen && Color != WHITE ) Color = BLACK;
|
||||
DrawBrush->SetColour(
|
||||
wxBrush DrawBrush;
|
||||
DrawBrush.SetColour(
|
||||
ColorRefs[Color].m_Red,
|
||||
ColorRefs[Color].m_Green,
|
||||
ColorRefs[Color].m_Blue
|
||||
);
|
||||
|
||||
if ( fill ) DrawBrush->SetStyle(wxSOLID);
|
||||
else DrawBrush->SetStyle(wxTRANSPARENT);
|
||||
if ( &DC->GetBrush() != DrawBrush ) DC->SetBrush(*DrawBrush);
|
||||
if ( fill ) DrawBrush.SetStyle(wxSOLID);
|
||||
else DrawBrush.SetStyle(wxTRANSPARENT);
|
||||
DC->SetBrush(DrawBrush);
|
||||
}
|
||||
|
||||
/*************************************/
|
||||
@ -340,68 +345,46 @@ int ii;
|
||||
/****************************************************************************
|
||||
* Routine to draw a line, in Object spaces. *
|
||||
****************************************************************************/
|
||||
void GRLine(EDA_Rect * ClipBox,wxDC * DC, int x1, int y1, int x2, int y2, int Color)
|
||||
void GRLine(EDA_Rect * ClipBox,wxDC * DC, int x1, int y1, int x2, int y2, int width, int Color)
|
||||
{
|
||||
GRSLine(ClipBox, DC, GRMapX(x1), GRMapY(y1), GRMapX(x2), GRMapY(y2), Color);
|
||||
GRSLine(ClipBox, DC, GRMapX(x1), GRMapY(y1), GRMapX(x2), GRMapY(y2), ZoomValue(width), Color);
|
||||
}
|
||||
|
||||
/***************************************************/
|
||||
/* Routine to draw a Dashed line, in Screen space. */
|
||||
/***************************************************/
|
||||
void GRSDashedLine(EDA_Rect * ClipBox,wxDC * DC, int x1, int y1, int x2, int y2, int Color)
|
||||
void GRSDashedLine(EDA_Rect * ClipBox,wxDC * DC, int x1, int y1, int x2, int y2, int width, int Color)
|
||||
{
|
||||
GRLastMoveToX = x2;
|
||||
GRLastMoveToY = y2;
|
||||
lastcolor = -1;
|
||||
DrawPen->SetStyle(wxSHORT_DASH);
|
||||
GRSLine(ClipBox, DC, x1, y1, x2, y2, Color);
|
||||
GRSetColorPen(DC, Color, width, wxSHORT_DASH);
|
||||
GRSLine(ClipBox, DC, x1, y1, x2, y2, width, Color);
|
||||
lastcolor = -1;
|
||||
DrawPen->SetStyle(wxSOLID);
|
||||
GRSetColorPen(DC, Color, width);
|
||||
}
|
||||
|
||||
void GRSDashedLineTo(EDA_Rect * ClipBox,wxDC * DC, int x2, int y2, int Color)
|
||||
void GRSDashedLineTo(EDA_Rect * ClipBox,wxDC * DC, int x2, int y2, int width, int Color)
|
||||
{
|
||||
lastcolor = -1;
|
||||
DrawPen->SetStyle(wxSHORT_DASH);
|
||||
GRSLine(ClipBox, DC, GRLastMoveToX, GRLastMoveToY, x2, y2, Color);
|
||||
GRSetColorPen(DC, Color, width, wxSHORT_DASH);
|
||||
GRSLine(ClipBox, DC, GRLastMoveToX, GRLastMoveToY, x2, y2, width, Color);
|
||||
lastcolor = -1;
|
||||
DrawPen->SetStyle(wxSOLID);
|
||||
GRSetColorPen(DC, Color, width);
|
||||
GRLastMoveToX = x2;
|
||||
GRLastMoveToY = y2;
|
||||
}
|
||||
/****************************************************************************
|
||||
* Routine to draw a Dashed line, in Object spaces. *
|
||||
****************************************************************************/
|
||||
void GRDashedLineTo(EDA_Rect * ClipBox,wxDC * DC,int x2, int y2, int Color)
|
||||
void GRDashedLineTo(EDA_Rect * ClipBox,wxDC * DC,int x2, int y2, int width, int Color)
|
||||
{
|
||||
GRSDashedLineTo(ClipBox, DC, GRMapX(x2), GRMapY(y2), Color);
|
||||
GRSDashedLineTo(ClipBox, DC, GRMapX(x2), GRMapY(y2), ZoomValue(width), Color);
|
||||
}
|
||||
|
||||
void GRDashedLine(EDA_Rect * ClipBox,wxDC * DC, int x1, int y1, int x2, int y2, int Color)
|
||||
void GRDashedLine(EDA_Rect * ClipBox,wxDC * DC, int x1, int y1, int x2, int y2, int width, int Color)
|
||||
{
|
||||
GRSDashedLine(ClipBox, DC, GRMapX(x1), GRMapY(y1), GRMapX(x2), GRMapY(y2), Color);
|
||||
}
|
||||
|
||||
|
||||
/*************************************************/
|
||||
/* Routine to draw a Bus line, in Object spaces. */
|
||||
/*************************************************/
|
||||
|
||||
void GRBusLine(EDA_Rect * ClipBox,wxDC * DC, int x1, int y1, int x2, int y2, int Color)
|
||||
{
|
||||
x1 = GRMapX(x1); x2 = GRMapX(x2);
|
||||
y1 = GRMapY(y1); y2 = GRMapY(y2);
|
||||
GRSBusLine(ClipBox, DC, x1, y1, x2, y2, Color);
|
||||
}
|
||||
|
||||
/****************************************************************
|
||||
* Routine to draw a Bus Line, in Screen (pixels) space. *
|
||||
****************************************************************************/
|
||||
void GRSBusLine(EDA_Rect * ClipBox, wxDC * DC, int x1, int y1, int x2, int y2, int Color)
|
||||
{
|
||||
GRSFillCSegm(ClipBox, DC, x1, y1, x2, y2, 3*PenMinWidth, Color);
|
||||
GRLastMoveToX = x2;
|
||||
GRLastMoveToY = y2;
|
||||
GRSDashedLine(ClipBox, DC, GRMapX(x1), GRMapY(y1), GRMapX(x2), GRMapY(y2), ZoomValue(width), Color);
|
||||
}
|
||||
|
||||
|
||||
@ -417,46 +400,32 @@ void GRMoveTo(int x, int y)
|
||||
/*******************************************************/
|
||||
/* Routine to draw to a new position, in Object space. */
|
||||
/*******************************************************/
|
||||
void GRLineTo(EDA_Rect * ClipBox,wxDC * DC, int x, int y, int Color)
|
||||
void GRLineTo(EDA_Rect * ClipBox,wxDC * DC, int x, int y, int width, int Color)
|
||||
{
|
||||
int GRLineToX, GRLineToY;
|
||||
|
||||
GRLineToX = GRMapX(x); GRLineToY = GRMapY(y);
|
||||
GRSLine(ClipBox, DC, GRLastMoveToX, GRLastMoveToY, GRLineToX, GRLineToY, Color);
|
||||
GRSLine(ClipBox, DC, GRLastMoveToX, GRLastMoveToY, GRLineToX, GRLineToY, ZoomValue(width), Color);
|
||||
}
|
||||
|
||||
/*************************************************/
|
||||
/* Routine to draw a Mixed line, in Object space */
|
||||
/*************************************************/
|
||||
void GRMixedLine(EDA_Rect * ClipBox,wxDC * DC, int x1, int y1, int x2, int y2, int Color)
|
||||
void GRMixedLine(EDA_Rect * ClipBox,wxDC * DC, int x1, int y1, int x2, int y2, int width, int Color)
|
||||
{
|
||||
GRSMixedLine(ClipBox, DC, GRMapX(x1), GRMapY(y1), GRMapX(x2), GRMapY(y2), Color);
|
||||
GRSMixedLine(ClipBox, DC, GRMapX(x1), GRMapY(y1), GRMapX(x2), GRMapY(y2), ZoomValue(width), Color);
|
||||
}
|
||||
|
||||
/***********************************************************/
|
||||
/* Routine to draw a Mixed line, in Screen (Pixels) space */
|
||||
/***********************************************************/
|
||||
void GRSMixedLine(EDA_Rect * ClipBox,wxDC * DC, int x1, int y1, int x2, int y2, int Color)
|
||||
void GRSMixedLine(EDA_Rect * ClipBox,wxDC * DC, int x1, int y1, int x2, int y2, int width, int Color)
|
||||
{
|
||||
DrawPen->SetStyle(wxDOT_DASH);
|
||||
GRSLine(ClipBox, DC, x1, y1, x2, y2, Color);
|
||||
DrawPen->SetStyle(wxSOLID);
|
||||
GRSetColorPen(DC, Color, width, wxDOT_DASH);
|
||||
GRSLine(ClipBox, DC, x1, y1, x2, y2, width, Color);
|
||||
GRSetColorPen(DC, Color, width);
|
||||
}
|
||||
|
||||
/*******************************************************************/
|
||||
/* Routine to draw a Bus line to a new position, in Object spaces. */
|
||||
/*******************************************************************/
|
||||
void GRBusLineTo(EDA_Rect * ClipBox,wxDC * DC, int x, int y, int Color)
|
||||
{
|
||||
int GRLineToX, GRLineToY;
|
||||
|
||||
GRLineToX = GRMapX(x); GRLineToY = GRMapY(y);
|
||||
|
||||
GRSBusLine(ClipBox, DC, GRLastMoveToX, GRLastMoveToY, GRLineToX, GRLineToY,
|
||||
Color);
|
||||
GRLastMoveToX = GRLineToX;
|
||||
GRLastMoveToY = GRLineToY;
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Routine to move to a new position, in Screen (pixels) space. *
|
||||
@ -470,18 +439,18 @@ void GRSMoveTo(int x, int y)
|
||||
/****************************************************************************
|
||||
* Routine to draw to a new position, in Screen (pixels) space. *
|
||||
****************************************************************************/
|
||||
void GRSLineTo(EDA_Rect * ClipBox, wxDC * DC, int x, int y, int Color)
|
||||
void GRSLineTo(EDA_Rect * ClipBox, wxDC * DC, int x, int y, int width, int Color)
|
||||
{
|
||||
GRSLine(ClipBox, DC, GRLastMoveToX, GRLastMoveToY, x, y, Color);
|
||||
GRSLine(ClipBox, DC, GRLastMoveToX, GRLastMoveToY, x, y, width, Color);
|
||||
GRLastMoveToX = x; GRLastMoveToY = y;
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Routine to draw to a new position, in Screen (pixels) space. *
|
||||
****************************************************************************/
|
||||
void GRSLine(EDA_Rect * ClipBox, wxDC *DC, int x1, int y1, int x2, int y2, int Color)
|
||||
void GRSLine(EDA_Rect * ClipBox, wxDC *DC, int x1, int y1, int x2, int y2, int width, int Color)
|
||||
{
|
||||
WinClipAndDrawLine(ClipBox, DC, x1, y1, x2, y2, Color);
|
||||
WinClipAndDrawLine(ClipBox, DC, x1, y1, x2, y2, Color, width );
|
||||
GRLastMoveToX = x2; GRLastMoveToY = y2;
|
||||
}
|
||||
|
||||
@ -499,7 +468,7 @@ void GRMoveRel(int x, int y)
|
||||
* Routine to line to a new position relative to current one, as in Object *
|
||||
* space. *
|
||||
****************************************************************************/
|
||||
void GRLineRel(EDA_Rect * ClipBox,wxDC * DC, int x, int y, int Color)
|
||||
void GRLineRel(EDA_Rect * ClipBox,wxDC * DC, int x, int y, int width, int Color)
|
||||
{
|
||||
int GRLineToX = GRLastMoveToX,
|
||||
GRLineToY = GRLastMoveToY;
|
||||
@ -507,7 +476,7 @@ int GRLineToX = GRLastMoveToX,
|
||||
GRLineToX += ZoomValue(x);
|
||||
GRLineToY += ZoomValue(y);
|
||||
|
||||
GRSLine(ClipBox, DC, GRLastMoveToX, GRLastMoveToY, GRLineToX, GRLineToY, Color);
|
||||
GRSLine(ClipBox, DC, GRLastMoveToX, GRLastMoveToY, GRLineToX, GRLineToY, ZoomValue(width), Color);
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
@ -524,12 +493,12 @@ void GRSMoveRel(int x, int y)
|
||||
* Routine to line to a new position relative to current one, as in Screen *
|
||||
* space (pixel coords.). *
|
||||
****************************************************************************/
|
||||
void GRSLineRel(EDA_Rect * ClipBox,wxDC * DC, int x, int y, int Color)
|
||||
void GRSLineRel(EDA_Rect * ClipBox,wxDC * DC, int x, int y, int width, int Color)
|
||||
{
|
||||
long GRLineToX = GRLastMoveToX + x,
|
||||
GRLineToY = GRLastMoveToY + y;
|
||||
|
||||
GRSLine(ClipBox, DC, GRLastMoveToX, GRLastMoveToY, GRLineToX, GRLineToY, Color);
|
||||
GRSLine(ClipBox, DC, GRLastMoveToX, GRLastMoveToY, GRLineToX, GRLineToY, width, Color);
|
||||
GRLastMoveToX = GRLineToX;
|
||||
GRLastMoveToY = GRLineToY;
|
||||
}
|
||||
@ -724,13 +693,13 @@ int Xmin, Xmax, Ymin, Ymax;
|
||||
/* Routine to draw a new polyline and fill it if Fill, in screen space. */
|
||||
/************************************************************************/
|
||||
void GRSPoly(EDA_Rect * ClipBox,wxDC * DC, int n, int *Points, int Fill,
|
||||
int Color, int BgColor)
|
||||
int width, int Color, int BgColor)
|
||||
{
|
||||
int startx, starty;
|
||||
|
||||
if ( ! IsGRSPolyDrawable(ClipBox, n, Points) ) return;
|
||||
|
||||
GRSetColorPen(DC, Color );
|
||||
GRSetColorPen(DC, Color, width );
|
||||
|
||||
if( Fill && ( n > 2 ) )
|
||||
{
|
||||
@ -745,34 +714,24 @@ int startx, starty;
|
||||
}
|
||||
}
|
||||
|
||||
/************************************************************************/
|
||||
/* Routine to draw a new polyline (line width = Width), in screen space. */
|
||||
/************************************************************************/
|
||||
void GRSPolyLines(EDA_Rect * ClipBox,wxDC * DC, int n, int *Points,
|
||||
int Color, int BgColor, int Width)
|
||||
{
|
||||
int startx, starty;
|
||||
|
||||
if ( ! IsGRSPolyDrawable(ClipBox, n, Points) ) return;
|
||||
|
||||
GRSetColorPen(DC, Color, Width );
|
||||
|
||||
startx = Points[n * 2 - 2]; starty = Points[n * 2 - 1];
|
||||
GRSetBrush(DC, Color);
|
||||
DC->DrawLines(n, (wxPoint*)Points);
|
||||
}
|
||||
|
||||
/******************************************************************************/
|
||||
/* Routine to draw a new closed polyline and fill it if Fill, in screen space */
|
||||
/******************************************************************************/
|
||||
void GRSClosedPoly(EDA_Rect * ClipBox,wxDC * DC, int n, int *Points,
|
||||
int Fill, int Color, int BgColor)
|
||||
{
|
||||
GRSClosedPoly( ClipBox, DC, n, Points, Fill, 0, Color, BgColor);
|
||||
}
|
||||
|
||||
void GRSClosedPoly(EDA_Rect * ClipBox,wxDC * DC, int n, int *Points,
|
||||
int Fill, int width, int Color, int BgColor)
|
||||
{
|
||||
int startx, starty;
|
||||
|
||||
if ( ! IsGRSPolyDrawable(ClipBox, n, Points) ) return;
|
||||
|
||||
GRSetColorPen(DC, Color );
|
||||
GRSetColorPen(DC, Color, width );
|
||||
|
||||
if( Fill && ( n > 2 ) )
|
||||
{
|
||||
@ -789,7 +748,7 @@ int startx, starty;
|
||||
/* Fermeture du polygone */
|
||||
if( (startx != Points[0]) || (starty != Points[1]) )
|
||||
{
|
||||
GRSLine(ClipBox, DC, Points[0], Points[1], startx, starty, Color);
|
||||
GRSLine(ClipBox, DC, Points[0], Points[1], startx, starty, width, Color);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -799,27 +758,11 @@ int startx, starty;
|
||||
/* Routine to draw a new polyline and fill it if Fill, in drawing space. */
|
||||
/************************************************************************/
|
||||
void GRPoly(EDA_Rect * ClipBox, wxDC * DC, int n, int *Points,
|
||||
int Fill, int Color, int BgColor)
|
||||
{
|
||||
int ii, jj;
|
||||
|
||||
for (ii = 0; ii < n; ii++)
|
||||
{
|
||||
jj = ii << 1;
|
||||
Points[jj] = GRMapX(Points[jj]);
|
||||
jj++;
|
||||
Points[jj] = GRMapY(Points[jj]);
|
||||
}
|
||||
GRSPoly(ClipBox, DC, n, Points, Fill, Color, BgColor);
|
||||
}
|
||||
|
||||
void GRPolyLines(EDA_Rect * ClipBox, wxDC * DC, int n, int *Points,
|
||||
int Color, int BgColor, int width)
|
||||
int Fill, int width, int Color, int BgColor)
|
||||
{
|
||||
int ii, jj;
|
||||
|
||||
width = ZoomValue(width);
|
||||
|
||||
for (ii = 0; ii < n; ii++)
|
||||
{
|
||||
jj = ii << 1;
|
||||
@ -827,17 +770,24 @@ int ii, jj;
|
||||
jj++;
|
||||
Points[jj] = GRMapY(Points[jj]);
|
||||
}
|
||||
if ( width <= 1 ) GRSPoly(ClipBox, DC, n, Points, 0, Color, BgColor);
|
||||
else GRSPolyLines(ClipBox, DC, n, Points, Color, BgColor, width);
|
||||
GRSPoly(ClipBox, DC, n, Points, Fill, width, Color, BgColor);
|
||||
}
|
||||
|
||||
/**************************************************************************/
|
||||
/* Routine to draw a closed polyline and fill it if Fill, in object space */
|
||||
/**************************************************************************/
|
||||
void GRClosedPoly(EDA_Rect * ClipBox,wxDC * DC, int n, int *Points,
|
||||
int Fill, int Color, int BgColor)
|
||||
{
|
||||
GRClosedPoly(ClipBox, DC, n, Points, Fill, 0, Color, BgColor);
|
||||
}
|
||||
|
||||
void GRClosedPoly(EDA_Rect * ClipBox,wxDC * DC, int n, int *Points,
|
||||
int Fill, int width, int Color, int BgColor)
|
||||
{
|
||||
int ii, jj;
|
||||
|
||||
width = ZoomValue(width);
|
||||
for (ii = 0; ii < n; ii++)
|
||||
{
|
||||
jj = ii << 1;
|
||||
@ -845,7 +795,7 @@ int ii, jj;
|
||||
jj++;
|
||||
Points[jj] = GRMapY(Points[jj]);
|
||||
}
|
||||
GRSClosedPoly(ClipBox, DC, n, Points, Fill, Color, BgColor);
|
||||
GRSClosedPoly(ClipBox, DC, n, Points, Fill, width, Color, BgColor);
|
||||
}
|
||||
|
||||
/***********************************************/
|
||||
@ -857,21 +807,48 @@ int cx = GRMapX(x);
|
||||
int cy = GRMapY(y);
|
||||
int rayon = ZoomValue(r);
|
||||
|
||||
GRSCircle(ClipBox, DC, cx, cy, rayon, Color );
|
||||
GRSCircle(ClipBox, DC, cx, cy, rayon, 0, Color );
|
||||
}
|
||||
|
||||
/*****************************************************/
|
||||
/* Routine to draw a Filled circle, in object space. */
|
||||
/*****************************************************/
|
||||
void GRFilledCircle(EDA_Rect * ClipBox,wxDC * DC, int x, int y, int r,
|
||||
int Color, int BgColor)
|
||||
int width, int Color, int BgColor)
|
||||
{
|
||||
r = ZoomValue(r);
|
||||
GRSFilledCircle(ClipBox, DC, GRMapX(x), GRMapY(y), r, Color, BgColor );
|
||||
width = ZoomValue(width);
|
||||
GRSFilledCircle(ClipBox, DC, GRMapX(x), GRMapY(y), r, width, Color, BgColor );
|
||||
}
|
||||
|
||||
/******************************************************/
|
||||
/* Routine to draw a FILLED circle, in drawing space. */
|
||||
/******************************************************/
|
||||
void GRSFilledCircle(EDA_Rect * ClipBox, wxDC * DC, int x, int y, int r,
|
||||
int width, int Color, int BgColor)
|
||||
{
|
||||
/* suppression des cercles hors ecran */
|
||||
if ( ClipBox )
|
||||
{
|
||||
int x0, y0, xm, ym;
|
||||
x0 = ClipBox->GetX();
|
||||
y0 = ClipBox->GetY();
|
||||
xm = ClipBox->GetRight();
|
||||
ym = ClipBox->GetBottom();
|
||||
if ( x < (x0-r) ) return;
|
||||
if ( y < (y0-r) ) return;
|
||||
if ( x > (r+xm) ) return;
|
||||
if ( y > (r+ym) ) return;
|
||||
}
|
||||
|
||||
GRSetColorPen(DC, Color, width );
|
||||
GRSetBrush(DC, BgColor, FILLED);
|
||||
DC->DrawEllipse(x-r, y-r, r+r, r+r);
|
||||
}
|
||||
|
||||
|
||||
/***********************************************************/
|
||||
/* Routine to draw un anneau, epaisseur w, in object space. */
|
||||
/* Routine to draw a circle, in object space. */
|
||||
/***********************************************************/
|
||||
void GRCircle(EDA_Rect * ClipBox, wxDC * DC, int x, int y, int r, int width, int Color)
|
||||
{
|
||||
@ -884,58 +861,6 @@ void GRCircle(EDA_Rect * ClipBox, wxDC * DC, int x, int y, int r, int width, in
|
||||
/***********************************************/
|
||||
/* Routine to draw a circle, in drawing space. */
|
||||
/***********************************************/
|
||||
void GRSCircle(EDA_Rect * ClipBox, wxDC * DC, int x, int y, int r, int Color)
|
||||
{
|
||||
int d = r + r;
|
||||
|
||||
/* suppression des cercles hors ecran */
|
||||
if ( ClipBox )
|
||||
{
|
||||
int x0, y0, xm, ym;
|
||||
x0 = ClipBox->GetX();
|
||||
y0 = ClipBox->GetY();
|
||||
xm = ClipBox->GetRight();
|
||||
ym = ClipBox->GetBottom();
|
||||
if ( x < (x0-r) ) return;
|
||||
if ( y < (y0-r) ) return;
|
||||
if ( x > (r+xm) ) return;
|
||||
if ( y > (r+ym) ) return;
|
||||
}
|
||||
|
||||
GRSetColorPen(DC, Color);
|
||||
GRSetBrush(DC,Color,FALSE);
|
||||
DC->DrawEllipse(x-r,y-r, d, d);
|
||||
}
|
||||
|
||||
/******************************************************/
|
||||
/* Routine to draw a FILLED circle, in drawing space. */
|
||||
/******************************************************/
|
||||
void GRSFilledCircle(EDA_Rect * ClipBox, wxDC * DC, int x, int y, int r,
|
||||
int Color, int BgColor)
|
||||
{
|
||||
/* suppression des cercles hors ecran */
|
||||
if ( ClipBox )
|
||||
{
|
||||
int x0, y0, xm, ym;
|
||||
x0 = ClipBox->GetX();
|
||||
y0 = ClipBox->GetY();
|
||||
xm = ClipBox->GetRight();
|
||||
ym = ClipBox->GetBottom();
|
||||
if ( x < (x0-r) ) return;
|
||||
if ( y < (y0-r) ) return;
|
||||
if ( x > (r+xm) ) return;
|
||||
if ( y > (r+ym) ) return;
|
||||
}
|
||||
|
||||
GRSetColorPen(DC, Color );
|
||||
GRSetBrush(DC, BgColor, FILLED);
|
||||
DC->DrawEllipse(x-r, y-r, r+r, r+r);
|
||||
}
|
||||
|
||||
/***********************************************************************/
|
||||
/* Routine de trace d'un cercle epais ( Screen space = pixel coords.) */
|
||||
/***********************************************************************/
|
||||
|
||||
void GRSCircle(EDA_Rect * ClipBox,wxDC * DC, int xc, int yc, int r, int width, int Color)
|
||||
{
|
||||
/* suppression des cercles hors ecran */
|
||||
@ -958,6 +883,7 @@ void GRSCircle(EDA_Rect * ClipBox,wxDC * DC, int xc, int yc, int r, int width, i
|
||||
}
|
||||
|
||||
|
||||
|
||||
/************************************************/
|
||||
/* Routine to draw an arc, in USER space. */
|
||||
/* Debut et fin de l'arc donnes par leur coord. */
|
||||
@ -967,7 +893,7 @@ void GRArc1(EDA_Rect * ClipBox,wxDC * DC, int x1, int y1, int x2, int y2,
|
||||
{
|
||||
GRSArc1(ClipBox, DC,
|
||||
GRMapX(x1), GRMapY(y1), GRMapX(x2), GRMapY(y2),
|
||||
GRMapX(xc), GRMapY(yc), Color);
|
||||
GRMapX(xc), GRMapY(yc), 0, Color);
|
||||
}
|
||||
|
||||
/************************************************/
|
||||
@ -982,32 +908,6 @@ void GRArc1(EDA_Rect * ClipBox,wxDC * DC, int x1, int y1, int x2, int y2,
|
||||
GRMapX(xc), GRMapY(yc), ZoomValue(width), Color);
|
||||
}
|
||||
|
||||
/************************************************/
|
||||
/* Routine to draw an arc, in screen space. */
|
||||
/* Debut et fin de l'arc donnes par leur coord. */
|
||||
/************************************************/
|
||||
void GRSArc1(EDA_Rect * ClipBox,wxDC * DC, int x1, int y1, int x2, int y2,
|
||||
int xc, int yc, int Color)
|
||||
{
|
||||
/* suppression des cercles hors ecran */
|
||||
if ( ClipBox )
|
||||
{
|
||||
int x0, y0, xm, ym, r;
|
||||
x0 = ClipBox->GetX();
|
||||
y0 = ClipBox->GetY();
|
||||
xm = ClipBox->GetRight();
|
||||
ym = ClipBox->GetBottom();
|
||||
r = (int)hypot(x1-xc, y1-yc);
|
||||
if ( xc < (x0-r) ) return;
|
||||
if ( yc < (y0-r) ) return;
|
||||
if ( xc > (r+xm) ) return;
|
||||
if ( yc > (r+ym) ) return;
|
||||
}
|
||||
|
||||
GRSetColorPen(DC, Color );
|
||||
GRSetBrush(DC,Color,FALSE);
|
||||
DC->DrawArc(x1, y1, x2, y2, xc, yc);
|
||||
}
|
||||
|
||||
/************************************************/
|
||||
/* Routine to draw an arc, width = width, in screen space. */
|
||||
@ -1040,40 +940,6 @@ void GRSArc1(EDA_Rect * ClipBox,wxDC * DC, int x1, int y1, int x2, int y2,
|
||||
/* Routine to draw an arc, in screen space. */
|
||||
/* As the Y axe is inverted the Angles should be inverted as well. */
|
||||
/********************************************************************/
|
||||
void GRSArc(EDA_Rect * ClipBox,wxDC * DC, int xc, int yc,
|
||||
int StAngle, int EndAngle, int r, int Color)
|
||||
{
|
||||
int x1, y1, x2, y2;
|
||||
|
||||
/* suppression des cercles hors ecran */
|
||||
if ( ClipBox )
|
||||
{
|
||||
int x0, y0, xm, ym;
|
||||
x0 = ClipBox->GetX();
|
||||
y0 = ClipBox->GetY();
|
||||
xm = ClipBox->GetRight();
|
||||
ym = ClipBox->GetBottom();
|
||||
if ( xc < (x0-r - 1) ) return;
|
||||
if ( yc < (y0-r - 1) ) return;
|
||||
if ( xc > (r+xm + 1) ) return;
|
||||
if ( yc > (r+ym + 1) ) return;
|
||||
}
|
||||
|
||||
x1 = r; y1 = 0;
|
||||
RotatePoint( &x1, & y1, EndAngle);
|
||||
|
||||
x2 = r; y2 = 0;
|
||||
RotatePoint( &x2, & y2, StAngle);
|
||||
|
||||
GRSetColorPen(DC, Color);
|
||||
GRSetBrush(DC,Color,FALSE);
|
||||
DC->DrawArc(xc + x1, yc - y1, xc + x2, yc - y2, xc, yc);
|
||||
}
|
||||
|
||||
/********************************************************************/
|
||||
/* Routine to draw an arc, width = width, in screen space. */
|
||||
/* As the Y axe is inverted the Angles should be inverted as well. */
|
||||
/********************************************************************/
|
||||
void GRSArc(EDA_Rect * ClipBox,wxDC * DC, int xc, int yc, int StAngle, int EndAngle,
|
||||
int r, int width, int Color)
|
||||
{
|
||||
@ -1109,7 +975,7 @@ int x1, y1, x2, y2;
|
||||
/* As the Y axes is inverted the Angles should be inverted as well. */
|
||||
/********************************************************************/
|
||||
void GRSFilledArc(EDA_Rect * ClipBox,wxDC * DC, int xc, int yc,
|
||||
int StAngle, int EndAngle, int r, int Color, int BgColor)
|
||||
int StAngle, int EndAngle, int r, int width, int Color, int BgColor)
|
||||
{
|
||||
int x1, y1, x2, y2;
|
||||
|
||||
@ -1134,7 +1000,7 @@ int x1, y1, x2, y2;
|
||||
RotatePoint( &x2, & y2, StAngle);
|
||||
|
||||
GRSetBrush(DC, BgColor, FILLED);
|
||||
GRSetColorPen(DC, Color);
|
||||
GRSetColorPen(DC, Color, width);
|
||||
DC->DrawArc(xc + x1, yc - y1, xc + x2, yc - y2, xc, yc);
|
||||
}
|
||||
|
||||
@ -1142,12 +1008,21 @@ int x1, y1, x2, y2;
|
||||
/* Routine to draw a Filled arc, in drawing space. */
|
||||
/* As the Y axes is inverted the Angles should be inverted as well. */
|
||||
/********************************************************************/
|
||||
void GRFilledArc(EDA_Rect * ClipBox,wxDC * DC, int x, int y,
|
||||
int StAngle, int EndAngle, int r, int width, int Color, int BgColor)
|
||||
{
|
||||
width = ZoomValue(width);
|
||||
GRSFilledArc(ClipBox, DC, GRMapX(x), GRMapY(y),
|
||||
StAngle, EndAngle,
|
||||
ZoomValue(r), width, Color, BgColor);
|
||||
}
|
||||
|
||||
void GRFilledArc(EDA_Rect * ClipBox,wxDC * DC, int x, int y,
|
||||
int StAngle, int EndAngle, int r, int Color, int BgColor)
|
||||
{
|
||||
GRSFilledArc(ClipBox, DC, GRMapX(x), GRMapY(y),
|
||||
StAngle, EndAngle,
|
||||
ZoomValue(r), Color, BgColor);
|
||||
ZoomValue(r), 0, Color, BgColor);
|
||||
}
|
||||
|
||||
/********************************************************************/
|
||||
@ -1213,6 +1088,17 @@ void GRRect(EDA_Rect * ClipBox,wxDC * DC, int x1, int y1, int x2, int y2, int Co
|
||||
GRSRect(ClipBox, DC, x1, y1, x2, y2, Color );
|
||||
}
|
||||
|
||||
/**************************************************/
|
||||
/* Routine to draw a Rectangle, in drawing space. */
|
||||
/**************************************************/
|
||||
void GRRect(EDA_Rect * ClipBox,wxDC * DC, int x1, int y1, int x2, int y2, int width, int Color)
|
||||
{
|
||||
x1 = GRMapX(x1); y1 = GRMapY(y1);
|
||||
x2 = GRMapX(x2); y2 = GRMapY(y2);
|
||||
width = ZoomValue(width);
|
||||
|
||||
GRSRect(ClipBox, DC, x1, y1, x2, y2, width, Color );
|
||||
}
|
||||
/************************************************************************************/
|
||||
void GRFilledRect(EDA_Rect * ClipBox,wxDC * DC, int x1, int y1, int x2, int y2,
|
||||
int Color, int BgColor)
|
||||
@ -1222,14 +1108,32 @@ void GRFilledRect(EDA_Rect * ClipBox,wxDC * DC, int x1, int y1, int x2, int y2,
|
||||
x1 = GRMapX(x1); y1 = GRMapY(y1);
|
||||
x2 = GRMapX(x2); y2 = GRMapY(y2);
|
||||
|
||||
GRSFilledRect(ClipBox, DC, x1, y1, x2, y2, Color, BgColor );
|
||||
GRSFilledRect(ClipBox, DC, x1, y1, x2, y2, 0, Color, BgColor );
|
||||
}
|
||||
|
||||
/************************************************************************************/
|
||||
void GRFilledRect(EDA_Rect * ClipBox,wxDC * DC, int x1, int y1, int x2, int y2,
|
||||
int width, int Color, int BgColor)
|
||||
/************************************************************************************/
|
||||
/* Routine to draw a Rectangle (filled with AreaColor), in drawing space. */
|
||||
{
|
||||
x1 = GRMapX(x1); y1 = GRMapY(y1);
|
||||
x2 = GRMapX(x2); y2 = GRMapY(y2);
|
||||
width = ZoomValue(width);
|
||||
|
||||
GRSFilledRect(ClipBox, DC, x1, y1, x2, y2, width, Color, BgColor );
|
||||
}
|
||||
|
||||
/*************************************************/
|
||||
/* Routine to draw a Rectangle, in screen space. */
|
||||
/*************************************************/
|
||||
void GRSRect(EDA_Rect * ClipBox,wxDC * DC, int x1, int y1, int x2, int y2, int Color)
|
||||
{
|
||||
GRSRect(ClipBox, DC, x1, y1, x2, y2, 0, Color);
|
||||
}
|
||||
|
||||
void GRSRect(EDA_Rect * ClipBox,wxDC * DC, int x1, int y1, int x2, int y2,
|
||||
int width, int Color)
|
||||
{
|
||||
if(x1 > x2) EXCHG(x1,x2);
|
||||
if(y1 > y2) EXCHG(y1,y2);
|
||||
@ -1248,7 +1152,7 @@ void GRSRect(EDA_Rect * ClipBox,wxDC * DC, int x1, int y1, int x2, int y2, int C
|
||||
if ( y2 < ymin ) return;
|
||||
}
|
||||
|
||||
GRSetColorPen(DC, Color );
|
||||
GRSetColorPen(DC, Color, width );
|
||||
if ( (x1 == x2) || (y1 == y2) ) DC->DrawLine(x1, y1, x2, y2);
|
||||
else
|
||||
{
|
||||
@ -1258,11 +1162,18 @@ void GRSRect(EDA_Rect * ClipBox,wxDC * DC, int x1, int y1, int x2, int y2, int C
|
||||
}
|
||||
|
||||
|
||||
/* Routine to draw a Filled Rectangle, in screen space. */
|
||||
/***************************************************************************************/
|
||||
void GRSFilledRect(EDA_Rect * ClipBox,wxDC * DC, int x1, int y1, int x2, int y2,
|
||||
int Color, int BgColor)
|
||||
/***************************************************************************************/
|
||||
/* Routine to draw a Filled Rectangle, in screen space. */
|
||||
{
|
||||
GRSFilledRect( ClipBox, DC, x1, y1, x2, y2, 0, Color, BgColor);
|
||||
}
|
||||
/***************************************************************************************/
|
||||
void GRSFilledRect(EDA_Rect * ClipBox,wxDC * DC, int x1, int y1, int x2, int y2,
|
||||
int width, int Color, int BgColor)
|
||||
/***************************************************************************************/
|
||||
{
|
||||
if(x1 > x2) EXCHG(x1,x2);
|
||||
if(y1 > y2) EXCHG(y1,y2);
|
||||
@ -1278,14 +1189,14 @@ void GRSFilledRect(EDA_Rect * ClipBox,wxDC * DC, int x1, int y1, int x2, int y2,
|
||||
if ( y1 > ymax ) return;
|
||||
if ( y2 < ymin ) return;
|
||||
|
||||
// Clipping des coordonnees
|
||||
// Clipping coordinates
|
||||
if ( x1 < xmin )x1 = xmin -1;
|
||||
if ( y1 < ymin )y1 = ymin -1;
|
||||
if ( x2 > xmax ) x2 = xmax +1;
|
||||
if ( y2 > ymax ) y2 = ymax +1;
|
||||
}
|
||||
|
||||
GRSetColorPen(DC, Color );
|
||||
GRSetColorPen(DC, Color, width );
|
||||
if ( (x1 == x2) || (y1 == y2) ) DC->DrawLine(x1, y1, x2, y2);
|
||||
else
|
||||
{
|
||||
@ -1295,25 +1206,22 @@ void GRSFilledRect(EDA_Rect * ClipBox,wxDC * DC, int x1, int y1, int x2, int y2,
|
||||
}
|
||||
|
||||
|
||||
/****************************************/
|
||||
/* Routines relatives au trace de texte */
|
||||
/****************************************/
|
||||
|
||||
/*********************************************/
|
||||
/* Routine de selection de la fonte courante */
|
||||
/*********************************************/
|
||||
/*******************************/
|
||||
/* Routines used to draw texts */
|
||||
/*******************************/
|
||||
|
||||
/*********************************************/
|
||||
void GRSetFont(wxDC * DC, wxFont * Font)
|
||||
/*********************************************/
|
||||
/* Routine to set the current font */
|
||||
{
|
||||
DC->SetFont(*Font);
|
||||
}
|
||||
|
||||
/*********************************************************/
|
||||
/* void GRSetTextFgColor(wxFont * Font, int Color) */
|
||||
/*********************************************************/
|
||||
|
||||
/* Mise a la valeur Color des textes a afficher */
|
||||
/*********************************************************/
|
||||
void GRSetTextFgColor(wxDC * DC, int Color)
|
||||
/*********************************************************/
|
||||
/* Set the foreground color used to draw texts */
|
||||
{
|
||||
DC->SetTextForeground(wxColour(
|
||||
ColorRefs[Color].m_Red,
|
||||
@ -1322,7 +1230,6 @@ void GRSetTextFgColor(wxDC * DC, int Color)
|
||||
);
|
||||
}
|
||||
|
||||
/* Mise a la valeur Color des textes a afficher */
|
||||
void GRSetTextFgColor(wxDC * DC, wxFont *, int Color)
|
||||
{
|
||||
DC->SetTextForeground(wxColour(
|
||||
@ -1336,7 +1243,7 @@ void GRSetTextFgColor(wxDC * DC, wxFont *, int Color)
|
||||
/*****************************************************************************/
|
||||
void GRGetTextExtent(wxDC * DC, const wxChar * Text, long * width, long * height)
|
||||
/*****************************************************************************/
|
||||
/* donne la taille du rectangle d'encadrement du texte Text
|
||||
/* Return the size of the text
|
||||
*/
|
||||
{
|
||||
long w = 0, h = 0;
|
||||
@ -1349,25 +1256,21 @@ long w = 0, h = 0;
|
||||
if ( height ) * height = h;
|
||||
}
|
||||
|
||||
/********************************/
|
||||
/* void GRReseTextFgColor(void) */
|
||||
/********************************/
|
||||
|
||||
/* Mise a la couleur par defaut des textes a afficher */
|
||||
/********************************/
|
||||
void GRResetTextFgColor(wxDC * DC)
|
||||
/********************************/
|
||||
/* Set the foreground color used to draw texts to the default value */
|
||||
{
|
||||
GRSetTextFgColor(DC, Text_Color);
|
||||
}
|
||||
|
||||
|
||||
/*********************************************************/
|
||||
/* void GRSetTextBgColor(wxFont * Font, int Color) */
|
||||
/*********************************************************/
|
||||
|
||||
/* Mise a la valeur Color du fond pour les textes a afficher */
|
||||
/*********************************************************/
|
||||
void GRSetTextBgColor(wxDC * DC, int Color)
|
||||
/*********************************************************/
|
||||
/* Set the background color used to draw texts */
|
||||
{
|
||||
Color &= MASKCOLOR; // Pour 32 couleurs Max
|
||||
Color &= MASKCOLOR; // keep only the bits used to select the color
|
||||
DC->SetTextBackground(wxColour(
|
||||
ColorRefs[Color].m_Red,
|
||||
ColorRefs[Color].m_Green,
|
||||
@ -1377,7 +1280,7 @@ void GRSetTextBgColor(wxDC * DC, int Color)
|
||||
|
||||
void GRSetTextBgColor(wxDC * DC, wxFont *, int Color)
|
||||
{
|
||||
Color &= MASKCOLOR; // Pour 32 couleurs Max
|
||||
Color &= MASKCOLOR; // keep only the bits used to select the color
|
||||
DC->SetTextBackground(wxColour(
|
||||
ColorRefs[Color].m_Red,
|
||||
ColorRefs[Color].m_Green,
|
||||
|
@ -2,9 +2,10 @@ WXDIR = $(WXWIN)
|
||||
|
||||
all: common.a
|
||||
|
||||
include makefile.include
|
||||
include ../libs.win
|
||||
|
||||
include makefile.include
|
||||
|
||||
common.a: $(OBJECTS) ../libs.win makefile.include
|
||||
ar ruv $@ $(OBJECTS)
|
||||
ranlib $@
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user