Patch from jdavisp3 to fix bug #1841.
[ardour.git] / gtk2_ardour / draginfo.h
1 /*
2     Copyright (C) 2000-2007 Paul Davis 
3
4     This program is free software; you can redistribute it and/or modify
5     it under the terms of the GNU General Public License as published by
6     the Free Software Foundation; either version 2 of the License, or
7     (at your option) any later version.
8
9     This program is distributed in the hope that it will be useful,
10     but WITHOUT ANY WARRANTY; without even the implied warranty of
11     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12     GNU General Public License for more details.
13
14     You should have received a copy of the GNU General Public License
15     along with this program; if not, write to the Free Software
16     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
17
18 */
19
20 #ifndef __gtk2_ardour_drag_info_h_
21 #define __gtk2_ardour_drag_info_h_
22
23 #include <gdk/gdk.h>
24 #include <stdint.h>
25
26 #include "canvas.h"
27 #include "editor_items.h"
28
29 #include <ardour/types.h>
30
31 namespace ARDOUR {
32         class Location;
33 }
34
35 class Editor;
36 class TimeAxisView;
37
38 struct DragInfo {
39     ArdourCanvas::Item* item;
40     ItemType            item_type;
41     void* data;
42     nframes64_t last_frame_position;
43     nframes64_t pointer_frame_offset;
44     nframes64_t grab_frame;
45     nframes64_t last_pointer_frame;
46     nframes64_t current_pointer_frame;
47     double grab_x, grab_y;
48     double cumulative_x_drag;
49     double cumulative_y_drag;
50     double current_pointer_x;
51     double current_pointer_y;
52     double last_pointer_x;
53     double last_pointer_y;
54     void (Editor::*motion_callback)(ArdourCanvas::Item*, GdkEvent*);
55     void (Editor::*finished_callback)(ArdourCanvas::Item*, GdkEvent*);
56     TimeAxisView* last_trackview;
57     bool x_constrained;
58     bool y_constrained;
59     bool copy;
60     bool was_rolling;
61     bool first_move;
62     bool move_threshold_passed;
63     bool want_move_threshold;
64     bool brushing;
65     ARDOUR::Location* copied_location;
66 };
67
68 struct LineDragInfo {
69     uint32_t before;
70     uint32_t after;
71 };
72
73 #endif /* __gtk2_ardour_drag_info_h_ */
74