Some operators need to have different visibility (as they're now used outside of...
[ardour.git] / libs / gtkmm2ext / waves_fastmeter.cc
index 680fca2833a9bb2d89ea77fb133e3b3aa1197584..e6b973b13025826cbfaa709fd318654727a8cbd4 100644 (file)
@@ -111,13 +111,13 @@ FastMeter::FastMeter (long hold, unsigned long dimen, Orientation o, int len,
                pixheight = len;
                pixwidth = dimen;
                fgpattern = request_vertical_meter(pixwidth, pixheight, _clr, _stp, _styleflags);
-               bgpattern = request_vertical_background (pixwidth, pixheight, _bgc);
+               bgpattern = request_vertical_background (pixwidth, pixheight, _bgc, false);
 
        } else {
                pixheight = dimen;
                pixwidth = len;
                fgpattern = request_horizontal_meter(pixwidth, pixheight, _clr, _stp, _styleflags);
-               bgpattern = request_horizontal_background (pixwidth, pixheight, _bgc);
+               bgpattern = request_horizontal_background (pixwidth, pixheight, _bgc, false);
        }
 
        pixrect.width = pixwidth;
@@ -136,24 +136,10 @@ FastMeter::~FastMeter ()
 void
 FastMeter::flush_pattern_cache ()
 {
-       Pattern10Map::iterator i1;
-       PatternBgMap::iterator ib;
-
-       for (ib = hb_pattern_cache.begin(); ib !=  hb_pattern_cache.end(); ++ib) {
-               hb_pattern_cache.erase(ib);
-       }
-
-       for (i1 = hm_pattern_cache.begin(); i1 !=  hm_pattern_cache.end(); ++i1) {
-               hm_pattern_cache.erase(i1);
-       }
-
-       for (ib = vb_pattern_cache.begin(); ib !=  vb_pattern_cache.end(); ++ib) {
-               vb_pattern_cache.erase(ib);
-       }
-
-       for (i1 = vm_pattern_cache.begin(); i1 !=  vm_pattern_cache.end(); ++i1) {
-               vm_pattern_cache.erase(i1);
-       }
+       hb_pattern_cache.clear();
+       hm_pattern_cache.clear();
+       vb_pattern_cache.clear();
+       vm_pattern_cache.clear();
 }
 
 Cairo::RefPtr<Cairo::Pattern>
@@ -522,7 +508,7 @@ FastMeter::vertical_size_allocate (Gtk::Allocation &alloc)
 
        if (pixheight != h) {
                fgpattern = request_vertical_meter (request_width, h, _clr, _stp, _styleflags);
-               bgpattern = request_vertical_background (request_width, h, highlight ? _bgh : _bgc);
+               bgpattern = request_vertical_background (request_width, h, highlight ? _bgh : _bgc, false);
                pixheight = h;
                pixwidth  = request_width;
        }
@@ -547,7 +533,7 @@ FastMeter::horizontal_size_allocate (Gtk::Allocation &alloc)
 
        if (pixwidth != w) {
                fgpattern = request_horizontal_meter (w, request_height, _clr, _stp, _styleflags);
-               bgpattern = request_horizontal_background (w, request_height, highlight ? _bgh : _bgc);
+               bgpattern = request_horizontal_background (w, request_height, highlight ? _bgh : _bgc, false);
                pixwidth = w;
                pixheight  = request_height;
        }
@@ -569,9 +555,8 @@ void
 FastMeter::vertical_expose (cairo_t* cr, cairo_rectangle_t* area)
 {
        gint top_of_meter;
-       GdkRectangle intersection;
-       GdkRectangle background;
-       GdkRectangle eventarea;
+       // GdkRectangle background;
+       // GdkRectangle eventarea;
 
        //cairo_set_source_rgb (cr, 0, 0, 0); // black
        //rounded_rectangle (cr, 0, 0, pixwidth + 2, pixheight + 2, 2);
@@ -585,15 +570,15 @@ FastMeter::vertical_expose (cairo_t* cr, cairo_rectangle_t* area)
        pixrect.height = top_of_meter;
        pixrect.y = pixheight - top_of_meter;
 
-       background.x = 0;
-       background.y = 0;
-       background.width = pixrect.width;
-       background.height = pixheight - top_of_meter;
+       // background.x = 0;
+       // background.y = 0;
+       // background.width = pixrect.width;
+       // background.height = pixheight - top_of_meter;
 
-       eventarea.x = area->x;
-       eventarea.y = area->y;
-       eventarea.width = area->width;
-       eventarea.height = area->height;
+       // eventarea.x = area->x;
+       // eventarea.y = area->y;
+       // eventarea.width = area->width;
+       // eventarea.height = area->height;
 
        // Switching to CAIRO we would like to draw on the container's bkg.
        // if (gdk_rectangle_intersect (&background, &eventarea, &intersection)) {
@@ -605,7 +590,7 @@ FastMeter::vertical_expose (cairo_t* cr, cairo_rectangle_t* area)
        // MEMO: Normaly MATURE OS clips so called invalidated rects itself making APP free of
        //       heavy operations which OS does with graphic HW
 
-        // NOTE FROM PAUL: GTK does clip already. The invalidated rect isn't the only area 
+        // NOTE FROM PAUL: GTK does clip already. The invalidated rect isn't the only area
         // we want to clip to however, which is why this object/class is called FastMeter.
         // I have left stuff commented out as I found it when I merged from Ardour in August 2014,
         // but this commenting and the previous MEMO comment represent a misunderstanding
@@ -650,9 +635,6 @@ void
 FastMeter::horizontal_expose (cairo_t* cr, cairo_rectangle_t* area)
 {
        gint right_of_meter;
-       GdkRectangle intersection;
-       GdkRectangle background;
-       GdkRectangle eventarea;
 
        //cairo_set_source_rgb (cr, 0, 0, 0); // black
        //rounded_rectangle (cr, 0, 0, pixwidth + 2, pixheight + 2, 2);
@@ -665,28 +647,6 @@ FastMeter::horizontal_expose (cairo_t* cr, cairo_rectangle_t* area)
 
        pixrect.width = right_of_meter;
 
-       background.x = 1 + right_of_meter;
-       background.y = 1;
-       background.width = pixwidth - right_of_meter;
-       background.height = pixheight;
-
-       eventarea.x = area->x;
-       eventarea.y = area->y;
-       eventarea.width = area->width;
-       eventarea.height = area->height;
-
-       // if (gdk_rectangle_intersect (&background, &eventarea, &intersection)) {
-       //      cairo_set_source (cr, bgpattern->cobj());
-       //      cairo_rectangle (cr, intersection.x, intersection.y, intersection.width, intersection.height);
-       //      cairo_fill (cr);
-       // }
-
-       // if (gdk_rectangle_intersect (&pixrect, &eventarea, &intersection)) {
-       //      cairo_set_source (cr, fgpattern->cobj());
-       //      cairo_rectangle (cr, intersection.x, intersection.y, intersection.width, intersection.height);
-       //      cairo_fill (cr);
-       // }
-
        // draw peak bar
 
        if (hold_state) {
@@ -918,9 +878,9 @@ FastMeter::set_highlight (bool onoff)
        }
        highlight = onoff;
        if (orientation == Vertical) {
-               bgpattern = request_vertical_background (pixwidth + 2, pixheight + 2, highlight ? _bgh : _bgc);
+               bgpattern = request_vertical_background (pixwidth + 2, pixheight + 2, highlight ? _bgh : _bgc, false);
        } else {
-               bgpattern = request_horizontal_background (pixwidth + 2, pixheight + 2, highlight ? _bgh : _bgc);
+               bgpattern = request_horizontal_background (pixwidth + 2, pixheight + 2, highlight ? _bgh : _bgc, false);
        }
        queue_draw ();
 }