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 #include "tkgate.h"
19
20 static iconDimensions vdd_iconDims[] = {
21 {0, 0, 35, 8, 19, 4},
22 {36, 0, 8, 35, 4, 15},
23 {8, 36, 35, 8, 15, 3},
24 {0, 9, 8, 35, 3, 19},
25 };
26 static int vdd_iconBoldOffset = 45;
27
28 GPadLoc vdd_out_loc[] = {
29 {-11, 0, -11, 0, D_DOWN},
30 {0, 11, 0, 11, D_RIGHT},
31 {11, 0, 11, 0, D_UP},
32 {0, -11, 0, -11, D_LEFT}
33 };
34
35
36 static char *psVdd[] = {
37 "%",
38 "% x y r vdd",
39 "%",
40 "/psvdd {",
41 " startgate",
42 " -19 0 moveto -3 0 lineto stroke",
43 " 10 rfont",
44 " -1 -4 moveto (V) show",
45 " 8 rfont",
46 " 0 -3 rmoveto (dd) show",
47 " grestore",
48 "} def",
49 0
50 };
51
52 GGateInfo gate_vdd_info = {
53 0, /* code */
54 "VDD", /* name */
55 "supply1", /* vnames */
56 0x0, /* vmask */
57 "psvdd", /* psprint */
58 psVdd, /* psdef */
59 -1 /* gi_multipad */,
60 -1, /* gi_bitpad */
61
62 {
63 {"v", /* key_seq */
64 {"gm.signals",0},/* root */
65 {"gm.signals.vdd",0,0,400}, /* entry */
66 "gat_make VDD"},/* cmds[0] */
67 {0} /* cmds[1] */
68 }, /* cmds */
69 vdd_iconDims, /* dim */
70 1, /* NumPads */
71 {
72 {"Z", /* name */
73 OUT, /* iotype */
74 1, /* size */
75 1, /* num */
76 vdd_out_loc
77 } /* Pad[0] */
78 }, /* Pad */
79 { /* x y just */
80 { 5, 15, LJ}, /* lpos[0] */
81 { 5, 15, LJ}, /* lpos[1] */
82 { 5, 15, LJ}, /* lpos[2] */
83 { 5, 15, LJ} /* lpos[3] */
84 }, /* lpos */
85 /* CanRot NoInvert IsIONet */
86 { 1, 1, 1}, /* flags */
87 {0}, /* delayNames */
88 Generic_Make, /* MakeFunction */
89 Nop_WriteCellDef, /* WriteCellDef */
90 Generic_Init, /* InitGate */
91 Generic_Delete, /* DeleteGate */
92 Generic_GetExtents, /* GetExtents */
93 Generic_HitDistance,
94 Generic_Draw,
95 Generic_Move,
96 Generic_Copy,
97 Err_AddInput,
98 Err_AddOutput,
99 Err_AddInOut,
100 Generic_Rotate,
101 Err_RemovePort,
102 Err_ChangePin,
103 Nop_SimInitFunc,
104 Nop_SimHitFunc,
105 Generic_PSWrite,
106 Generic_EditProps,
107 InOut_VerSave
108 };
109
init_vdd()110 void init_vdd()
111 {
112 Pixmap P;
113
114 P = Pixmap_registerFromFile("vdd","vdd.b");
115 gateinfo_iconInit(&gate_vdd_info,P,vdd_iconDims,vdd_iconBoldOffset);
116 RegisterGate(&gate_vdd_info);
117 }
118