contrib/gmk_sym: Fix missing break
[geda-gaf.git] / gschem / include / gschem_page_geometry.h
blob2eeaa4843edc3006cb14b2a9506bb3e91dafa038
1 /* gEDA - GPL Electronic Design Automation
2 * gschem - gEDA Schematic Capture
3 * Copyright (C) 1998-2010 Ales Hvezda
4 * Copyright (C) 1998-2019 gEDA Contributors (see ChangeLog for details)
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 /*!
21 * \file gschem_page_geometry.h
23 * \brief
26 #define GSCHEM_TYPE_PAGE_GEOMETRY (gschem_page_geometry_get_type())
28 typedef struct _GschemPageGeometry GschemPageGeometry;
30 struct _GschemPageGeometry
32 int screen_width;
33 int screen_height;
35 int viewport_left;
36 int viewport_top; /* actually the bottom */
37 int viewport_right;
38 int viewport_bottom; /* actually the top, very confusing */
40 int world_left;
41 int world_top;
42 int world_right;
43 int world_bottom;
45 double scale; /* world to screen factor */
47 double to_screen_x_constant;
48 double to_screen_y_constant;
50 double to_world_x_constant;
51 double to_world_y_constant;
53 gboolean world_to_screen_calculated;
55 cairo_matrix_t world_to_screen_matrix;
60 GschemPageGeometry*
61 gschem_page_geometry_copy (GschemPageGeometry *geometry);
63 void
64 gschem_page_geometry_free (GschemPageGeometry *geometry);
66 int
67 gschem_page_geometry_get_screen_height (GschemPageGeometry *geometry);
69 int
70 gschem_page_geometry_get_screen_width (GschemPageGeometry *geometry);
72 GType
73 gschem_page_geometry_get_type ();
75 int
76 gschem_page_geometry_get_viewport_bottom (GschemPageGeometry *geometry);
78 int
79 gschem_page_geometry_get_viewport_left (GschemPageGeometry *geometry);
81 int
82 gschem_page_geometry_get_viewport_right (GschemPageGeometry *geometry);
84 int
85 gschem_page_geometry_get_viewport_top (GschemPageGeometry *geometry);
87 int
88 gschem_page_geometry_get_world_bottom (GschemPageGeometry *geometry);
90 int
91 gschem_page_geometry_get_world_left (GschemPageGeometry *geometry);
93 int
94 gschem_page_geometry_get_world_right (GschemPageGeometry *geometry);
96 cairo_matrix_t*
97 gschem_page_geometry_get_world_to_screen_matrix (GschemPageGeometry *geometry);
99 int
100 gschem_page_geometry_get_world_top (GschemPageGeometry *geometry);
103 gschem_page_geometry_mil_x (GschemPageGeometry *geometry, int value);
106 gschem_page_geometry_mil_y (GschemPageGeometry *geometry, int value);
108 GschemPageGeometry*
109 gschem_page_geometry_new_with_values (int screen_width,
110 int screen_height,
111 int viewport_left,
112 int viewport_top,
113 int viewport_right,
114 int viewport_bottom,
115 int world_left,
116 int world_top,
117 int world_right,
118 int world_bottom);
120 void
121 gschem_page_geometry_pan_general(GschemPageGeometry *geometry,
122 double world_cx,
123 double world_cy,
124 double relativ_zoom_factor);
127 gschem_page_geometry_pix_x (GschemPageGeometry *geometry, int value);
130 gschem_page_geometry_pix_y (GschemPageGeometry *geometry, int value);
132 void
133 gschem_page_geometry_set_values (GschemPageGeometry *geometry,
134 double scale,
135 int screen_width,
136 int screen_height,
137 int viewport_left,
138 int viewport_top,
139 int viewport_right,
140 int viewport_bottom);
141 void
142 gschem_page_geometry_set_viewport (GschemPageGeometry *geometry, int x, int y, double scale);
144 void
145 gschem_page_geometry_set_viewport_bottom (GschemPageGeometry *geometry, int viewport_bottom);
147 void
148 gschem_page_geometry_set_viewport_left (GschemPageGeometry *geometry, int viewport_left);
150 void
151 gschem_page_geometry_set_viewport_right (GschemPageGeometry *geometry, int viewport_right);
153 void
154 gschem_page_geometry_set_viewport_top (GschemPageGeometry *geometry, int viewport_top);
156 void
157 gschem_page_geometry_zoom_extents (GschemPageGeometry *geometry, TOPLEVEL *toplevel, const GList *list);