2 #include "edithandles.h"
3 #include "edithandles.inc"
11 #include "trackcanvas.h"
15 EditHandle::EditHandle(MWindow *mwindow,
16 TrackCanvas *trackcanvas,
26 side == EDIT_IN ? mwindow->theme->edithandlein_data : mwindow->theme->edithandleout_data)
31 EditHandle::~EditHandle()
35 int EditHandle::handle_event()
44 EditHandleIn::EditHandleIn(MWindow *mwindow,
45 TrackCanvas *trackcanvas,
58 EditHandleIn::~EditHandleIn()
63 int EditHandleIn::handle_event()
75 EditHandleOut::EditHandleOut(MWindow *mwindow,
76 TrackCanvas *trackcanvas,
87 this->mwindow = mwindow;
88 this->trackcanvas = trackcanvas;
93 EditHandleOut::~EditHandleOut()
98 int EditHandleOut::handle_event()
112 EditHandles::EditHandles(MWindow *mwindow,
113 TrackCanvas *trackcanvas)
114 : CanvasTools(mwindow, trackcanvas)
118 EditHandles::~EditHandles()
122 void EditHandles::update()
126 for(Track *current = mwindow->edl->tracks->first;
130 for(Edit *edit = current->edits->first; edit; edit = edit->next)
133 int64_t handle_x, handle_y, handle_w, handle_h;
134 trackcanvas->get_handle_coords(edit, handle_x, handle_y, handle_w, handle_h, EDIT_IN);
136 if(visible(handle_x, handle_y, handle_w, handle_h))
140 for(int i = 0; i < total; i++)
142 EditHandle *handle = (EditHandle*)values[i];
143 if(handle->edit->id == edit->id && handle->side == EDIT_IN)
145 handle->reposition_window(handle_x, handle_y);
146 handle->raise_window();
156 EditHandle *handle = new EditHandle(mwindow,
162 trackcanvas->add_subwindow(handle);
163 handle->set_cursor(ARROW_CURSOR);
170 trackcanvas->get_handle_coords(edit, handle_x, handle_y, handle_w, handle_h, EDIT_OUT);
172 if(visible(handle_x, handle_y, handle_w, handle_h))
176 for(int i = 0; i < total; i++)
178 EditHandle *handle = (EditHandle*)values[i];
179 if(handle->edit->id == edit->id && handle->side == EDIT_OUT)
181 handle->reposition_window(handle_x, handle_y);
182 handle->raise_window();
192 EditHandle *handle = new EditHandle(mwindow,
198 trackcanvas->add_subwindow(handle);
199 handle->set_cursor(ARROW_CURSOR);
211 // c-file-style: "linux"