1 /****************************************************************************
2 Copyright (C) 1987-2015 by Jeffery P. Hansen
3
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or
7 (at your option) any later version.
8
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
13
14 You should have received a copy of the GNU General Public License along
15 with this program; if not, write to the Free Software Foundation, Inc.,
16 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
17
18 Last edit by hansen on Mon Jan 19 18:17:05 2009
19 ****************************************************************************/
20 #include "tkgate.h"
21
22 #define LOGICOUT_IN 0
23
24 extern iconDimensions in_iconDims[];
25 extern int in_iconBoldOffset;
26
27 GPadLoc out_in_loc[] = {
28 {3,0,3,0,D_LEFT},
29 {0,-3,0,-3,D_DOWN},
30 {-3,0,-3,0,D_RIGHT},
31 {0,3,0,3,D_UP}};
32
33 static char *psOut[] = {
34 "%",
35 "% An output pin",
36 "%",
37 "/psout {",
38 " startgate",
39 " -6 -3 moveto",
40 " 3 0 lineto",
41 " -6 3 lineto",
42 " stroke",
43 " grestore",
44 "} bind def",
45 0
46 };
47
48 GGateInfo gate_out_info = {
49 GC_LOGICOUT,
50 "OUT",
51 "output",0x0,
52 "psout",psOut,
53 -1,-1,
54
55 {{"{", {"gm.mod",2}, {"gm.mod.out",7,0,300}, "gat_make OUT"},
56 {0}},
57
58 in_iconDims, /* Same dimensions as 'in' */
59
60 1,{{"I",IN,1,1,out_in_loc}},
61 {{8,4,LJ},{0,-7,CT},{-8,4,RJ},{0,16,CT}},
62 {1,1,1},
63
64 {0},
65
66 InOut_Make,
67 Nop_WriteCellDef,
68 Generic_Init,
69 Generic_Delete,
70 Generic_GetExtents,
71 Generic_HitDistance,
72 InOut_Draw,
73 Generic_Move,
74 Generic_Copy,
75 Err_AddInput,
76 Err_AddOutput,
77 Err_AddInOut,
78 Generic_Rotate,
79 Err_RemovePort,
80 Err_ChangePin,
81 Nop_SimInitFunc,
82 Nop_SimHitFunc,
83 InOut_PSWrite,
84 Generic_EditProps,
85 InOut_VerSave,
86 };
87
init_out()88 void init_out()
89 {
90 Pixmap P;
91
92 P = Pixmap_find("inout");
93 gateinfo_iconInit(&gate_out_info,P,in_iconDims,in_iconBoldOffset);
94
95 RegisterGate(&gate_out_info);
96 }
97