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_view.h
23 * \brief A widget for viewing a schematic page
26 #define GSCHEM_TYPE_PAGE_VIEW (gschem_page_view_get_type())
27 #define GSCHEM_PAGE_VIEW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GSCHEM_TYPE_PAGE_VIEW, GschemPageView))
28 #define GSCHEM_PAGE_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GSCHEM_TYPE_PAGE_VIEW, GschemPageViewClass))
29 #define GSCHEM_IS_PAGE_VIEW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GSCHEM_TYPE_PAGE_VIEW))
30 #define GSCHEM_PAGE_VIEW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GSCHEM_TYPE_PAGE_VIEW, GschemPageViewClass))
32 typedef struct _GschemPageViewClass GschemPageViewClass
;
33 typedef struct _GschemPageView GschemPageView
;
35 struct _GschemPageViewClass
37 GtkWindowClass parent_class
;
40 struct _GschemPageView
44 GtkAllocation previous_allocation
;
46 GtkAdjustment
*hadjustment
;
47 GtkAdjustment
*vadjustment
;
49 GHashTable
*geometry_table
;
53 gboolean doing_pan
; /* mouse pan status flag */
64 gschem_page_view_get_hadjustment (GschemPageView
*view
);
67 gschem_page_view_get_page (GschemPageView
*view
);
70 gschem_page_view_get_page_geometry (GschemPageView
*view
);
73 gschem_page_view_get_type ();
76 gschem_page_view_get_vadjustment (GschemPageView
*view
);
79 gschem_page_view_invalidate_all (GschemPageView
*view
);
82 gschem_page_view_invalidate_object (GschemPageView
*view
, OBJECT
*object
);
85 gschem_page_view_invalidate_screen_rect (GschemPageView
*view
, int left
, int top
, int right
, int bottom
);
88 gschem_page_view_invalidate_world_rect (GschemPageView
*view
, int left
, int top
, int right
, int bottom
);
91 gschem_page_view_new_with_page (PAGE
*page
);
94 gschem_page_view_pan_general(GschemPageView
*page_view
, int x
, int y
, double relativ_zoom_factor
);
97 gschem_page_view_pan(GschemPageView
*page_view
, int x
, int y
);
100 gschem_page_view_pan_mouse(GschemPageView
*page_view
, int diff_x
, int diff_y
);
103 gschem_page_view_pan_start(GschemPageView
*page_view
, int x
, int y
);
106 gschem_page_view_pan_motion (GschemPageView
*view
, int mousepan_gain
, int x
, int y
);
109 gschem_page_view_pan_end(GschemPageView
*page_view
);
112 gschem_page_view_redraw (GschemPageView
*view
, GdkEventExpose
*event
, GschemToplevel
*w_current
);
115 gschem_page_view_SCREENabs(GschemPageView
*view
, int val
);
118 gschem_page_view_SCREENtoWORLD (GschemPageView
*view
, int mx
, int my
, int *x
, int *y
);
121 gschem_page_view_set_hadjustment (GschemPageView
*view
, GtkAdjustment
*hadjustment
);
124 gschem_page_view_set_page (GschemPageView
*view
, PAGE
*page
);
127 gschem_page_view_set_vadjustment (GschemPageView
*view
, GtkAdjustment
*vadjustment
);
130 gschem_page_view_WORLDabs(GschemPageView
*view
, int val
);
133 gschem_page_view_WORLDtoSCREEN (GschemPageView
*view
, int x
, int y
, int *px
, int *py
);
136 gschem_page_view_zoom_extents (GschemPageView
*view
, const GList
*list
);
139 gschem_page_get_page_object(OBJECT
*object
);
142 gschem_page_view_zoom_text (GschemPageView
*view
, OBJECT
*object
, gboolean zoom_hidden
);
145 gschem_page_view_update_scroll_adjustments (GschemPageView
*view
);