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
21 * \file gschem_page_geometry.h
26 #define GSCHEM_TYPE_PAGE_GEOMETRY (gschem_page_geometry_get_type())
28 typedef struct _GschemPageGeometry GschemPageGeometry
;
30 struct _GschemPageGeometry
36 int viewport_top
; /* actually the bottom */
38 int viewport_bottom
; /* actually the top, very confusing */
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
;
61 gschem_page_geometry_copy (GschemPageGeometry
*geometry
);
64 gschem_page_geometry_free (GschemPageGeometry
*geometry
);
67 gschem_page_geometry_get_screen_height (GschemPageGeometry
*geometry
);
70 gschem_page_geometry_get_screen_width (GschemPageGeometry
*geometry
);
73 gschem_page_geometry_get_type ();
76 gschem_page_geometry_get_viewport_bottom (GschemPageGeometry
*geometry
);
79 gschem_page_geometry_get_viewport_left (GschemPageGeometry
*geometry
);
82 gschem_page_geometry_get_viewport_right (GschemPageGeometry
*geometry
);
85 gschem_page_geometry_get_viewport_top (GschemPageGeometry
*geometry
);
88 gschem_page_geometry_get_world_bottom (GschemPageGeometry
*geometry
);
91 gschem_page_geometry_get_world_left (GschemPageGeometry
*geometry
);
94 gschem_page_geometry_get_world_right (GschemPageGeometry
*geometry
);
97 gschem_page_geometry_get_world_to_screen_matrix (GschemPageGeometry
*geometry
);
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
);
109 gschem_page_geometry_new_with_values (int screen_width
,
121 gschem_page_geometry_pan_general(GschemPageGeometry
*geometry
,
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
);
133 gschem_page_geometry_set_values (GschemPageGeometry
*geometry
,
140 int viewport_bottom
);
142 gschem_page_geometry_set_viewport (GschemPageGeometry
*geometry
, int x
, int y
, double scale
);
145 gschem_page_geometry_set_viewport_bottom (GschemPageGeometry
*geometry
, int viewport_bottom
);
148 gschem_page_geometry_set_viewport_left (GschemPageGeometry
*geometry
, int viewport_left
);
151 gschem_page_geometry_set_viewport_right (GschemPageGeometry
*geometry
, int viewport_right
);
154 gschem_page_geometry_set_viewport_top (GschemPageGeometry
*geometry
, int viewport_top
);
157 gschem_page_geometry_zoom_extents (GschemPageGeometry
*geometry
, TOPLEVEL
*toplevel
, const GList
*list
);