gerbv  2.6A
gerber.h
Go to the documentation of this file.
1 /*
2  * gEDA - GNU Electronic Design Automation
3  * This files is a part of gerbv.
4  *
5  * Copyright (C) 2000-2002 Stefan Petersen (spe@stacken.kth.se)
6  *
7  * $Id$
8  *
9  * This program is free software; you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License as published by
11  * the Free Software Foundation; either version 2 of the License, or
12  * (at your option) any later version.
13  *
14  * This program is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17  * GNU General Public License for more details.
18  *
19  * You should have received a copy of the GNU General Public License
20  * along with this program; if not, write to the Free Software
21  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA
22  */
23 
29 #ifndef GERBER_H
30 #define GERBER_H
31 
32 #ifdef __cplusplus
33 extern "C" {
34 #endif
35 
36 #include <stdio.h>
37 #include <glib.h>
38 
39 #include "gerb_file.h"
40 
41 typedef struct gerb_state {
42  int curr_x;
43  int curr_y;
44  int prev_x;
45  int prev_y;
46  int delta_cp_x;
47  int delta_cp_y;
48  int curr_aperture;
49  int changed;
50  gerbv_aperture_state_t aperture_state;
51  gerbv_interpolation_t interpolation;
52  gerbv_interpolation_t prev_interpolation;
53  gerbv_net_t *parea_start_node;
54  gerbv_layer_t *layer;
55  gerbv_netstate_t *state;
56  int in_parea_fill;
57  int mq_on;
58 } gerb_state_t;
59 
60 /*
61  * parse gerber file pointed to by fd
62  */
63 gerbv_image_t *parse_gerb(gerb_file_t *fd, gchar *directoryPath);
64 gboolean gerber_is_rs274x_p(gerb_file_t *fd, gboolean *returnFoundBinary);
65 gboolean gerber_is_rs274d_p(gerb_file_t *fd);
67 gerber_create_new_net (gerbv_net_t *currentNet, gerbv_layer_t *layer, gerbv_netstate_t *state);
68 
69 gboolean
70 gerber_create_new_aperture (gerbv_image_t *image, int *indexNumber,
71  gerbv_aperture_type_t apertureType, gdouble parameter1, gdouble parameter2);
72 
73 void gerber_update_image_min_max (gerbv_render_size_t *boundingBox, double repeat_off_X,
74  double repeat_off_Y, gerbv_image_t* image);
75 void gerber_update_min_and_max(gerbv_render_size_t *boundingBox,
76  gdouble x, gdouble y, gdouble apertureSizeX1,
77  gdouble apertureSizeX2,gdouble apertureSizeY1,
78  gdouble apertureSizeY2);
79 #ifdef __cplusplus
80 }
81 #endif
82 
83 #endif /* GERBER_H */