2 #include "cwindowgui.h"
3 #include "cwindowtool.h"
5 #include "edlsession.h"
14 CPanel::CPanel(MWindow *mwindow,
15 CWindowGUI *subwindow,
21 this->mwindow = mwindow;
22 this->subwindow = subwindow;
33 int CPanel::create_objects()
35 int x = this->x, y = this->y;
36 subwindow->add_subwindow(operation[CWINDOW_PROTECT] = new CPanelProtect(mwindow, this, x, y));
37 y += operation[CWINDOW_PROTECT]->get_h();
38 subwindow->add_subwindow(operation[CWINDOW_ZOOM] = new CPanelMagnify(mwindow, this, x, y));
39 y += operation[CWINDOW_ZOOM]->get_h();
40 subwindow->add_subwindow(operation[CWINDOW_MASK] = new CPanelMask(mwindow, this, x, y));
41 y += operation[CWINDOW_MASK]->get_h();
42 subwindow->add_subwindow(operation[CWINDOW_CAMERA] = new CPanelCamera(mwindow, this, x, y));
43 y += operation[CWINDOW_CAMERA]->get_h();
44 subwindow->add_subwindow(operation[CWINDOW_PROJECTOR] = new CPanelProj(mwindow, this, x, y));
45 y += operation[CWINDOW_PROJECTOR]->get_h();
46 subwindow->add_subwindow(operation[CWINDOW_CROP] = new CPanelCrop(mwindow, this, x, y));
47 y += operation[CWINDOW_CROP]->get_h();
48 subwindow->add_subwindow(operation[CWINDOW_EYEDROP] = new CPanelEyedrop(mwindow, this, x, y));
49 y += operation[CWINDOW_EYEDROP]->get_h();
50 subwindow->add_subwindow(operation[CWINDOW_TOOL_WINDOW] = new CPanelToolWindow(mwindow, this, x, y));
51 y += operation[CWINDOW_TOOL_WINDOW]->get_h();
52 subwindow->add_subwindow(operation[CWINDOW_TITLESAFE] = new CPanelTitleSafe(mwindow, this, x, y));
56 void CPanel::reposition_buttons(int x, int y)
61 for(int i = 0; i < CPANEL_OPERATIONS; i++)
63 operation[i]->reposition_window(x, y);
64 y += operation[i]->get_h();
69 void CPanel::set_operation(int value)
71 for(int i = 0; i < CPANEL_OPERATIONS; i++)
73 if(i == CWINDOW_TOOL_WINDOW)
75 operation[i]->update(mwindow->edl->session->tool_window);
78 if(i == CWINDOW_TITLESAFE)
80 operation[i]->update(mwindow->edl->session->safe_regions);
83 // if(i == CWINDOW_SHOW_METERS)
85 // operation[i]->update(mwindow->edl->session->cwindow_meter);
90 operation[i]->update(0);
92 operation[i]->update(1);
101 CPanelProtect::CPanelProtect(MWindow *mwindow, CPanel *gui, int x, int y)
104 mwindow->theme->get_image_set("protect"),
105 mwindow->edl->session->cwindow_operation == CWINDOW_PROTECT)
107 this->mwindow = mwindow;
109 set_tooltip(_("Protect video from changes"));
111 CPanelProtect::~CPanelProtect()
114 int CPanelProtect::handle_event()
116 gui->subwindow->set_operation(CWINDOW_PROTECT);
125 CPanelMask::CPanelMask(MWindow *mwindow, CPanel *gui, int x, int y)
128 mwindow->theme->get_image_set("mask"),
129 mwindow->edl->session->cwindow_operation == CWINDOW_MASK)
131 this->mwindow = mwindow;
133 set_tooltip(_("Edit mask"));
135 CPanelMask::~CPanelMask()
138 int CPanelMask::handle_event()
140 gui->subwindow->set_operation(CWINDOW_MASK);
145 CPanelMagnify::CPanelMagnify(MWindow *mwindow, CPanel *gui, int x, int y)
148 mwindow->theme->get_image_set("magnify"),
149 mwindow->edl->session->cwindow_operation == CWINDOW_ZOOM)
151 this->mwindow = mwindow;
153 set_tooltip(_("Zoom view"));
155 CPanelMagnify::~CPanelMagnify()
158 int CPanelMagnify::handle_event()
160 gui->subwindow->set_operation(CWINDOW_ZOOM);
165 CPanelCamera::CPanelCamera(MWindow *mwindow, CPanel *gui, int x, int y)
168 mwindow->theme->get_image_set("camera"),
169 mwindow->edl->session->cwindow_operation == CWINDOW_CAMERA)
171 this->mwindow = mwindow;
173 set_tooltip(_("Adjust camera automation"));
175 CPanelCamera::~CPanelCamera()
178 int CPanelCamera::handle_event()
180 gui->subwindow->set_operation(CWINDOW_CAMERA);
185 CPanelProj::CPanelProj(MWindow *mwindow, CPanel *gui, int x, int y)
188 mwindow->theme->get_image_set("projector"),
189 mwindow->edl->session->cwindow_operation == CWINDOW_PROJECTOR)
191 this->mwindow = mwindow;
193 set_tooltip(_("Adjust projector automation"));
195 CPanelProj::~CPanelProj()
198 int CPanelProj::handle_event()
200 gui->subwindow->set_operation(CWINDOW_PROJECTOR);
205 CPanelCrop::CPanelCrop(MWindow *mwindow, CPanel *gui, int x, int y)
208 mwindow->theme->get_image_set("crop"),
209 mwindow->edl->session->cwindow_operation == CWINDOW_CROP)
211 this->mwindow = mwindow;
213 set_tooltip(_("Crop a layer or output"));
216 CPanelCrop::~CPanelCrop()
220 int CPanelCrop::handle_event()
222 gui->subwindow->set_operation(CWINDOW_CROP);
229 CPanelEyedrop::CPanelEyedrop(MWindow *mwindow, CPanel *gui, int x, int y)
232 mwindow->theme->get_image_set("eyedrop"),
233 mwindow->edl->session->cwindow_operation == CWINDOW_EYEDROP)
235 this->mwindow = mwindow;
237 set_tooltip(_("Get color"));
240 CPanelEyedrop::~CPanelEyedrop()
244 int CPanelEyedrop::handle_event()
246 gui->subwindow->set_operation(CWINDOW_EYEDROP);
253 CPanelToolWindow::CPanelToolWindow(MWindow *mwindow, CPanel *gui, int x, int y)
256 mwindow->theme->get_image_set("tool"),
257 mwindow->edl->session->tool_window)
259 this->mwindow = mwindow;
261 set_tooltip(_("Show tool info"));
264 CPanelToolWindow::~CPanelToolWindow()
268 int CPanelToolWindow::handle_event()
270 mwindow->edl->session->tool_window = get_value();
271 gui->subwindow->tool_panel->update_show_window();
275 int CPanelToolWindow::set_shown(int shown)
278 mwindow->edl->session->tool_window = shown;
279 gui->subwindow->tool_panel->update_show_window();
284 CPanelTitleSafe::CPanelTitleSafe(MWindow *mwindow, CPanel *gui, int x, int y)
287 mwindow->theme->get_image_set("titlesafe"),
288 mwindow->edl->session->safe_regions)
290 this->mwindow = mwindow;
292 set_tooltip(_("Show safe regions"));
294 CPanelTitleSafe::~CPanelTitleSafe()
297 int CPanelTitleSafe::handle_event()
299 mwindow->edl->session->safe_regions = get_value();
300 gui->subwindow->canvas->draw_refresh();
307 // c-file-style: "linux"