]> git.lyx.org Git - lyx.git/blobdiff - src/WorkArea.C
use more explicit on constructors use the pimpl idom to reduce size with about 500k
[lyx.git] / src / WorkArea.C
index 5f95e0cada78a26bbfe15c90a711b138fc8f6626..f306e63550926dc83ef5027793d833b696261ed0 100644 (file)
 #include "support/lstrings.h"
 #include "BufferView.h"
 
+using std::endl;
+
 FL_OBJECT * figinset_canvas;
 
+// need to make the c++ compiler fint the correct version of abs.
+// This is at least true for g++.
+using std::abs;
+
 static inline
 void waitForX()
 {
@@ -203,6 +209,27 @@ WorkArea::~WorkArea()
 }
 
 
+bool WorkArea::belowMouse() const
+{
+       FL_Coord x, y;
+       unsigned int button;
+       fl_get_mouse(&x, &y, &button);
+       FL_Coord ulx = work_area->form->x + work_area->x;
+       FL_Coord uly = work_area->form->y + work_area->y;
+       FL_Coord w = work_area->w;
+       FL_Coord h = work_area->h;
+       if (x > ulx && y > uly && x < ulx + h && y < uly + w)
+               return true;
+       return false;
+       
+       
+       //lyxerr << "Mouse: (" << x << ", " << y <<") button = " << button << endl;
+       //lyxerr << "Workarea: (" << work_area->x + work_area->form->x << ", " << work_area->y + work_area->form->y << ", " << work_area->w << ", " << work_area->h << ")" << endl;
+       //lyxerr << "Below mouse: " << work_area->belowmouse << endl;
+       //return work_area->belowmouse;
+}
+
+
 void WorkArea::resize(int xpos, int ypos, int width, int height)
 {
        fl_freeze_all_forms();