11 #define SLIB_PIN_DOWN 1
12 #define SLIB_PIN_LEFT 2
13 #define SLIB_PIN_RIGHT 3
17 #define SLIB_T_CIRCLE 4
20 #define MOTIF_T_LINE 2
24 // structure de calcul pour les transformations sur les symbols
26 typedef struct vecteur
{
34 // structures propres a MOTIF
36 typedef struct motif_arc
{
44 typedef struct motif_line
{
57 typedef struct motif_draw
{
58 struct motif_draw
*NEXT
;
63 typedef struct motif_symlist
{
64 struct motif_symlist
*NEXT
;
69 typedef struct motif_lib
{
74 // structures propres a SLIB
76 typedef struct slib_box
{
90 typedef struct circle
{
120 typedef struct draw_list
{
121 struct draw_list
*NEXT
;
126 typedef struct sub_list
{
127 struct sub_list
*NEXT
;
128 struct symbol_list
*ROOT
;
134 typedef struct symbol_list
{
135 struct symbol_list
*NEXT
;
139 motif_symlist
*MOTIF
;
144 typedef struct library
{
151 // fonction assurant le parse du fichier slib
152 library
*slib_get_library();
154 // fonctions 'outils' notaement pour EQT et la 'route_grid' de SLIB
155 void slib_set_function(eqt_ctx
*ctx
);
156 int slib_sign(float value
);
157 void slib_set_lib_grid(library
*ptlib
, int grid_value
);
158 long slib_apply_grid(double value
, int grid_value
);
160 // fonctions d'allocations des differents champs de la structure
161 library
*slib_create_lib(char *name
);
162 void slib_put_symbol(library
*ptlib
, symbol_list
*ptsym
);
163 symbol_list
*slib_add_symbol(library
*ptlib
, char *name
);
164 void slib_add_subsymbol(library
*ptlib
, symbol_list
*ptsym
, char *name
, double center_x
, double center_y
, double angle
);
165 void slib_add_draw_line(symbol_list
*ptsym
, double arg_0
, double arg_1
, double arg_2
, double arg_3
, int grid_value
);
166 void slib_add_draw_arc(symbol_list
*ptsym
, double arg_0
, double arg_1
, double arg_2
, double arg_3
, double arg_4
, double arg_5
, int grid_value
);
167 void slib_add_draw_circle(symbol_list
*ptsym
, double arg_0
, double arg_1
, float arg_2
, int grid_value
);
168 void slib_add_draw_pin(symbol_list
*ptsym
, char *name
, double x
, double y
, int direction
, int grid_value
);
170 // liberation des allocations memoires
171 void slib_free_box(symbol_list
*ptsym
);
172 void slib_free_motif(motif_symlist
*ptm_sym
);
173 void slib_free_subsymbols(symbol_list
*ptsym
);
174 void slib_free_draw(symbol_list
*ptsym
);
175 void slib_free_symbols(library
*ptlib
);
176 void slib_free_library(library
*ptlib
);
178 // fonctions permettant de gerer les coordonnees de points apres les subsymbols
179 void slib_vecteur(vecteur
*v
, double dalpha
, double xdebut
, double ydebut
, double xfinal
, double yfinal
);
180 void slib_coordonnee(vecteur
*v
, int grid
, double dx
, double dy
);
182 //fonction d'appel d'un symbol et de mise a plat
183 pin
*slib_getpin(symbol_list
*ptsym
, char *name
);
184 symbol_list
*slib_getsymbol(library
*ptlib
, char *name
);
185 symbol_list
*slib_get_flat_symbol(library
*ptlib
, char *name
);
186 void slib_flatsymbol(symbol_list
*ptsym
, long dx
,long dy
, long dalpha
,symbol_list
*ptresult
);
187 void slib_flatcalcul(vecteur
*name
, double dx
, double dy
, double dalpha
, long x
, long y
);
188 void slib_xbounding_box(slib_box
*ptm_box
, long value
);
189 void slib_ybounding_box(slib_box
*ptm_box
, long value
);
190 void slib_arc_box(symbol_list
*ptresult
,long x1
,long y1
,long x2
,long y2
,long x3
,long y3
);
191 void slib_line_box(symbol_list
*ptresult
,long x1
,long y1
,long x2
,long y2
);
192 void slib_circle_box(symbol_list
*ptresult
,long x
,long y
,long R
);
194 // fonctions de conversion d'une structure SLIB en une structure MOTIF
196 motif_symlist
*slib_motifconvert(symbol_list
*ptsym
);
197 void slib_add_motif_line(motif_draw
*ptm_draw
, long startx
,long starty
,long endx
,long endy
);
198 void slib_add_motif_arc(motif_draw
*ptm_draw
, long startx
,long starty
,long endx
,long endy
,long centerx
,long centery
);
199 void slib_add_motif_circle(motif_draw
*ptm_draw
, long cx
, long cy
, long rayon
);
200 //void slib_add_motif_pin();
202 // fonctions d'affichages et de test graphique
203 void slib_make_motif_file(library
*ptlib
);
204 void slib_display_motif(FILE *file
, library
*ptlib
, symbol_list
*ptsym
);
205 void slib_write_motif(FILE *file
,motif_symlist
*ptm_sym
);
207 // fonctions d'affichages et de test thread
208 void slib_view_structslib(library
*ptlib
);
209 void slib_view_structmotif(library
*ptlib
);
210 void slib_view_all(library
*ptlib
);
211 void slib_return_box(symbol_list
*pts
);
214 // library cree par le parser
215 library
*slib_load_library(char *buff
);
217 extern library
*SLIB_LIBRARY
;