Merge branch 'master' into cairocanvas
[ardour.git] / libs / canvas / drag_handle.cc
1 /*
2     Copyright (C) 2014 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 #include <iostream>
20 #include <cairomm/context.h>
21 #include "pbd/stacktrace.h"
22 #include "pbd/compose.h"
23
24 #include "canvas/drag_handle.h"
25
26 using namespace ArdourCanvas;
27
28 DragHandle::DragHandle (Group* g, Rect const & r, bool left_side)
29         : Item (g)
30         , Rectangle (g, r)
31         , _left_side (left_side)
32 {
33 }
34
35 void
36 DragHandle::render (Rect const & area, Cairo::RefPtr<Cairo::Context> context) const
37 {
38         Rectangle::render (area, context);
39
40 #if 0
41         Duple circle_center (_left_side ? x0() : x1(), (y1() - y0())/2.0);
42         Duple window_circle_center = item_to_window (circle_center);
43         
44         context->set_source_rgba (1.0, 0.0, 0.0, 1.0);
45
46         if (_left_side) {
47                 context->arc (window_circle_center.x, window_circle_center.y, 7.0, -M_PI/2.0, +M_PI/2.0);
48         } else {
49                 context->arc_negative (window_circle_center.x, window_circle_center.y, 7.0, -M_PI/2.0, +M_PI/2.0);
50         }
51
52         context->fill ();
53 #endif
54
55 }