aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/image-inline
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2010-02-20 01:11:52 +0800
committerMatthew Barnes <mbarnes@redhat.com>2010-02-20 01:11:52 +0800
commit59a54ea5a028455e92e3715277721f2d37131359 (patch)
treea41e9feb45d07fe978f94ab901fc0c20d6e18c3a /plugins/image-inline
parent6633112f54ffbff1a331b93de1cc00d6c849fc0d (diff)
downloadgsoc2013-evolution-59a54ea5a028455e92e3715277721f2d37131359.tar
gsoc2013-evolution-59a54ea5a028455e92e3715277721f2d37131359.tar.gz
gsoc2013-evolution-59a54ea5a028455e92e3715277721f2d37131359.tar.bz2
gsoc2013-evolution-59a54ea5a028455e92e3715277721f2d37131359.tar.lz
gsoc2013-evolution-59a54ea5a028455e92e3715277721f2d37131359.tar.xz
gsoc2013-evolution-59a54ea5a028455e92e3715277721f2d37131359.tar.zst
gsoc2013-evolution-59a54ea5a028455e92e3715277721f2d37131359.zip
Coding style and whitespace cleanup.
Diffstat (limited to 'plugins/image-inline')
-rw-r--r--plugins/image-inline/image-inline.c38
1 files changed, 32 insertions, 6 deletions
diff --git a/plugins/image-inline/image-inline.c b/plugins/image-inline/image-inline.c
index 12568eecca..5ea1070afb 100644
--- a/plugins/image-inline/image-inline.c
+++ b/plugins/image-inline/image-inline.c
@@ -259,19 +259,45 @@ size_allocate_cb (GtkHTMLEmbedded *embedded,
}
static void
-mouse_wheel_scroll_cb (GtkWidget *img_view, GdkScrollDirection direction, ImageInlinePObject *image_object)
+mouse_wheel_scroll_cb (GtkWidget *image_view,
+ GdkScrollDirection direction,
+ ImageInlinePObject *image_object)
{
+ GtkOrientation orientation;
+ GtkScrollType scroll_type;
GtkHTML *html;
gint steps = 2;
- g_return_if_fail (image_object != NULL);
- g_return_if_fail (image_object->object.format != NULL);
- g_return_if_fail (image_object->object.format->html != NULL);
-
html = image_object->object.format->html;
+ switch (direction) {
+ case GDK_SCROLL_UP:
+ orientation = GTK_ORIENTATION_VERTICAL;
+ scroll_type = GTK_SCROLL_STEP_BACKWARD;
+ break;
+
+ case GDK_SCROLL_DOWN:
+ orientation = GTK_ORIENTATION_VERTICAL;
+ scroll_type = GTK_SCROLL_STEP_FORWARD;
+ break;
+
+ case GDK_SCROLL_LEFT:
+ orientation = GTK_ORIENTATION_HORIZONTAL;
+ scroll_type = GTK_SCROLL_STEP_BACKWARD;
+ break;
+
+ case GDK_SCROLL_RIGHT:
+ orientation = GTK_ORIENTATION_HORIZONTAL;
+ scroll_type = GTK_SCROLL_STEP_FORWARD;
+ break;
+
+ default:
+ g_return_if_reached ();
+ }
+
while (steps > 0) {
- g_signal_emit_by_name (html, "scroll", (direction == GDK_SCROLL_DOWN || direction == GDK_SCROLL_UP) ? GTK_ORIENTATION_VERTICAL : GTK_ORIENTATION_HORIZONTAL, (direction == GDK_SCROLL_DOWN || direction == GDK_SCROLL_RIGHT) ? GTK_SCROLL_STEP_FORWARD : GTK_SCROLL_STEP_BACKWARD, 2.0, NULL);
+ g_signal_emit_by_name (
+ html, "scroll", orientation, scroll_type, 2.0, NULL);
steps--;
}
}