1 /* gEDA - GPL Electronic Design Automation
2 * gschem - gEDA Schematic Capture
3 * Copyright (C) 1998-2010 Ales Hvezda
4 * Copyright (C) 1998-2020 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
28 /*! \todo Finish function documentation!!!
30 * \par Function Description
33 void o_copy_start(GschemToplevel
*w_current
, int w_x
, int w_y
)
37 GschemPageView
*page_view
= gschem_toplevel_get_current_page_view (w_current
);
38 g_return_if_fail (page_view
!= NULL
);
40 PAGE
*page
= gschem_page_view_get_page (page_view
);
41 g_return_if_fail (page
!= NULL
);
43 /* Copy the objects into the buffer at their current position,
44 * with future motion relative to the mouse origin, (w_x, w_y). */
46 w_current
->first_wx
= w_x
;
47 w_current
->first_wy
= w_y
;
49 if (!o_select_selected (w_current
))
52 s_current
= geda_list_get_glist (page
->selection_list
);
54 if (page
->place_list
!= NULL
) {
55 s_delete_object_glist (page
->toplevel
, page
->place_list
);
56 page
->place_list
= NULL
;
59 page
->place_list
= o_glist_copy_all (page
->toplevel
,
63 g_run_hook_object_list (w_current
,
67 o_place_start (w_current
, w_x
, w_y
);
70 /*! \todo Finish function documentation!!!
72 * \par Function Description
75 void o_copy_end(GschemToplevel
*w_current
)
77 o_place_end (w_current
, w_current
->second_wx
, w_current
->second_wy
,
78 (w_current
->event_state
== MCOPYMODE
),
79 (w_current
->event_state
!= MCOPYMODE
),
80 "%paste-objects-hook", _("Copy"));