add -P flag blocking port connections while loading session
[ardour.git] / libs / gtkmm2ext / scroomer.cc
index 0f252070064e0999632a665f1e76f36a69037ac3..07e5b464528e3f9a1a8c4759b77e7811482c7185 100644 (file)
@@ -18,7 +18,9 @@
 */
 
 #include <iostream>
-#include <gtkmm2ext/scroomer.h>
+
+#include "gtkmm2ext/scroomer.h"
+#include "gtkmm2ext/keyboard.h"
 
 using namespace Gtkmm2ext;
 using namespace Gtk;
@@ -28,8 +30,8 @@ using namespace std;
 Scroomer::Scroomer(Gtk::Adjustment& adjustment)
        : adj(adjustment)
        , handle_size(0)
-       , grab_comp(None) {
-
+       , grab_comp(None)
+{
        position[TopBase] = 0;
        position[Handle1] = 0;
        position[Slider] = 0;
@@ -74,8 +76,8 @@ Scroomer::on_motion_notify_event (GdkEventMotion* ev)
 
        grab_y = ev->y;
 
-       if (ev->state & GDK_CONTROL_MASK) {
-               if (ev->state & GDK_MOD1_MASK) {
+       if (ev->state & Keyboard::PrimaryModifier) {
+               if (ev->state & Keyboard::SecondaryModifier) {
                        scale = 0.05;
                } else {
                        scale = 0.1;
@@ -88,7 +90,7 @@ Scroomer::on_motion_notify_event (GdkEventMotion* ev)
        fract = max (-1.0, fract);
        fract = -fract;
 
-       switch(grab_comp) {
+       switch (grab_comp) {
        case TopBase:
        case BottomBase:
                unzoomed_val += scale * fract * range;
@@ -118,8 +120,7 @@ Scroomer::on_motion_notify_event (GdkEventMotion* ev)
                break;
        }
 
-       /*
-        * Then we handle zoom, which is dragging horizontally. We zoom around the area that is
+       /* Then we handle zoom, which is dragging horizontally. We zoom around the area that is
         * the current y pointer value, not from the area that was the start of the drag.
         * the point of zoom must have the same 
         */
@@ -232,7 +233,7 @@ Scroomer::on_button_release_event (GdkEventButton* ev)
                return true;
        }
 
-       switch(grab_comp) {
+       switch (grab_comp) {
        case TopBase:
                break;
        case Handle1:
@@ -269,15 +270,14 @@ Scroomer::on_size_allocate (Allocation& a)
        update();
 }
 
-/*
- * assumes that x and width are correct, and they will not be altered
+/** Assumes that x and width are correct, and they will not be altered.
  */
 void
 Scroomer::set_comp_rect(GdkRectangle& r, Component c) const
 {
        int index = (int) c;
 
-       switch(c) {
+       switch (c) {
        case None:
                return;
        case Total:
@@ -374,7 +374,7 @@ Scroomer::adjustment_changed()
 std::string
 Scroomer::get_comp_name(Component c)
 {
-       switch(c) {
+       switch (c) {
        case TopBase:
                return "TopBase";
        case Handle1: