Main Page | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | File Members

canvastools.C

Go to the documentation of this file.
00001 #include "canvastools.h"
00002 #include "mwindowgui.h"
00003 #include "trackcanvas.h"
00004 
00005 
00006 
00007 CanvasTool::CanvasTool(MWindow *mwindow, 
00008                 TrackCanvas *trackcanvas,
00009                 Edit *edit,
00010                 int x,
00011                 int y,
00012                 VFrame **data)
00013  : BC_Button(x, y, data)
00014 {
00015         this->mwindow = mwindow;
00016         this->trackcanvas = trackcanvas;
00017         this->edit = edit;
00018         visible = 1;
00019 }
00020 
00021 CanvasTool::~CanvasTool()
00022 {
00023 }
00024 
00025 
00026 
00027 
00028 CanvasTools::CanvasTools(MWindow *mwindow,
00029                 TrackCanvas *trackcanvas)
00030  : ArrayList<CanvasTool*>()
00031 {
00032         this->mwindow = mwindow;
00033         this->trackcanvas = trackcanvas;
00034 }
00035 
00036 CanvasTools::~CanvasTools()
00037 {
00038         remove_all_objects();
00039 }
00040 
00041 void CanvasTools::decrease_visible()
00042 {
00043         for(int i = 0; i < total; i++)
00044                 values[i]->visible--;
00045 }
00046 
00047 void CanvasTools::delete_invisible()
00048 {
00049         for(int i = total - 1; i >= 0; i--)
00050                 if(values[i]->visible < 1)
00051                 {
00052                         delete values[i];
00053                         remove(values[i]);
00054                 }       
00055 }
00056 
00057 // Region is visible on track canvas
00058 int CanvasTools::visible(int x, int y, int w, int h)
00059 {
00060         return MWindowGUI::visible(x, x + w, 0, trackcanvas->get_w()) &&
00061                 MWindowGUI::visible(y, y + h, 0, trackcanvas->get_h());
00062 }

Generated on Sun Jan 8 13:38:51 2006 for Cinelerra-svn by  doxygen 1.4.4