#include <gtkmm.h>
#include <iostream>

bool scroll_event (GdkEventScroll *ev)
{
    switch (ev->direction) {
#define CASE(x) \
        case x:                                 \
            std::cout << #x;                    \
            break;

        CASE(GDK_SCROLL_SMOOTH);
        CASE(GDK_SCROLL_UP);
        CASE(GDK_SCROLL_DOWN);
        CASE(GDK_SCROLL_LEFT);
        CASE(GDK_SCROLL_RIGHT);
    }

    if (ev->direction == GDK_SCROLL_SMOOTH) {
        std::cout << " " << ev->delta_x << ", " << ev->delta_y;
    }

    std::cout << std::endl;

    return false;
}

int main (int argc, char **argv)
{
    Gtk::Main kit (argc, argv);
    Gtk::Window window;

    window.set_events (Gdk::SCROLL_MASK | Gdk::SMOOTH_SCROLL_MASK);
    window.signal_scroll_event ().connect (sigc::ptr_fun (&scroll_event));

    kit.run (window);

    return 0;
}
