#include <glib/gi18n.h>
#include <tny-list.h>
#include <tny-simple-list.h>
-#include <tny-vfs-stream.h>
#include <modest-tny-msg.h>
#include <modest-text-utils.h>
static void disconnect_hadjustment (ModestGtkhtmlMsgView *obj);
static gboolean idle_readjust_scroll (ModestGtkhtmlMsgView *obj);
+/* vertical panning implementation */
+#ifdef MAEMO_CHANGES
+static gboolean motion_notify_event (GtkWidget *widget,
+ GdkEventMotion *event,
+ gpointer userdata);
+#endif
+
/* GtkContainer methods */
static void forall (GtkContainer *container, gboolean include_internals,
GtkCallback callback, gpointer userdata);
static GtkShadowType modest_gtkhtml_msg_view_get_shadow_type (ModestMsgView *self);
static TnyHeaderFlags modest_gtkhtml_msg_view_get_priority (ModestMsgView *self);
static void modest_gtkhtml_msg_view_set_priority (ModestMsgView *self, TnyHeaderFlags flags);
-static GList *modest_gtkhtml_msg_view_get_selected_attachments (ModestMsgView *self);
-static GList *modest_gtkhtml_msg_view_get_attachments (ModestMsgView *self);
+static TnyList *modest_gtkhtml_msg_view_get_selected_attachments (ModestMsgView *self);
+static TnyList *modest_gtkhtml_msg_view_get_attachments (ModestMsgView *self);
static void modest_gtkhtml_msg_view_grab_focus (ModestMsgView *self);
static void modest_gtkhtml_msg_view_remove_attachment (ModestMsgView *view, TnyMimePart *attachment);
static GtkAdjustment *modest_gtkhtml_msg_view_get_vadjustment_default (ModestMsgView *self);
static GtkShadowType modest_gtkhtml_msg_view_get_shadow_type_default (ModestMsgView *self);
static TnyHeaderFlags modest_gtkhtml_msg_view_get_priority_default (ModestMsgView *self);
static void modest_gtkhtml_msg_view_set_priority_default (ModestMsgView *self, TnyHeaderFlags flags);
-static GList *modest_gtkhtml_msg_view_get_selected_attachments_default (ModestMsgView *self);
-static GList *modest_gtkhtml_msg_view_get_attachments_default (ModestMsgView *self);
+static TnyList *modest_gtkhtml_msg_view_get_selected_attachments_default (ModestMsgView *self);
+static TnyList *modest_gtkhtml_msg_view_get_attachments_default (ModestMsgView *self);
static void modest_gtkhtml_msg_view_grab_focus_default (ModestMsgView *self);
static void modest_gtkhtml_msg_view_remove_attachment_default (ModestMsgView *view, TnyMimePart *attachment);
static GtkShadowType get_shadow_type (ModestGtkhtmlMsgView *self);
static TnyHeaderFlags get_priority (ModestGtkhtmlMsgView *self);
static void set_priority (ModestGtkhtmlMsgView *self, TnyHeaderFlags flags);
-static GList *get_selected_attachments (ModestGtkhtmlMsgView *self);
-static GList *get_attachments (ModestGtkhtmlMsgView *self);
+static TnyList *get_selected_attachments (ModestGtkhtmlMsgView *self);
+static TnyList *get_attachments (ModestGtkhtmlMsgView *self);
static void grab_focus (ModestGtkhtmlMsgView *self);
static void remove_attachment (ModestGtkhtmlMsgView *view, TnyMimePart *attachment);
G_CALLBACK(on_fetch_url), obj);
g_signal_connect (G_OBJECT(priv->body_view), "link_hover",
G_CALLBACK(on_link_hover), obj);
+#ifdef MAEMO_CHANGES
+ g_signal_connect (G_OBJECT(priv->body_view), "motion-notify-event",
+ G_CALLBACK (motion_notify_event), obj);
+#endif
g_signal_connect (G_OBJECT (priv->mail_header_view), "recpt-activated",
G_CALLBACK (on_recpt_activated), obj);
/* INTERNAL METHODS */
+#ifdef MAEMO_CHANGES
+static gboolean
+motion_notify_event (GtkWidget *widget,
+ GdkEventMotion *event,
+ gpointer userdata)
+{
+ ModestGtkhtmlMsgViewPrivate *priv = MODEST_GTKHTML_MSG_VIEW_GET_PRIVATE (userdata);
+
+ /* Use panning information in gtkhtml widget to support also vertical panning */
+
+ if (GTK_HTML (widget)->panning) {
+ gint y, dy;
+ gdouble value;
+
+ gdk_window_get_pointer (GTK_LAYOUT (widget)->bin_window, NULL, &y, NULL);
+ dy = y - GTK_HTML (widget)->lasty;
+ value = priv->vadj->value - (gdouble) dy;
+
+ if (value < priv->vadj->lower)
+ value = priv->vadj->lower;
+ else if (value > priv->vadj->upper - priv->vadj->page_size)
+ value = priv->vadj->upper - priv->vadj->page_size;
+ gtk_adjustment_set_value (priv->vadj, value);
+
+ }
+ return FALSE;
+}
+#endif
+
static GtkAdjustment *
get_vadjustment (ModestGtkhtmlMsgView *self)
{
return FALSE;
}
- tny_mime_part_decode_to_stream ((TnyMimePart*)part, stream);
+ tny_mime_part_decode_to_stream ((TnyMimePart*)part, stream, NULL);
g_object_unref (G_OBJECT(part));
return TRUE;
}
return result;
}
-static GList *
+static TnyList *
get_selected_attachments (ModestGtkhtmlMsgView *self)
{
ModestGtkhtmlMsgViewPrivate *priv;
}
-static GList *
+static TnyList *
get_attachments (ModestGtkhtmlMsgView *self)
{
ModestGtkhtmlMsgViewPrivate *priv;
{
TnyMsgViewIface *klass = (TnyMsgViewIface *)g;
- klass->get_msg_func = modest_msg_view_get_msg;
- klass->set_msg_func = modest_msg_view_set_msg;
- klass->set_unavailable_func = modest_msg_view_set_unavailable;
- klass->clear_func = modest_msg_view_clear;
- klass->create_mime_part_view_for_func = modest_msg_view_create_mime_part_view_for;
- klass->create_new_inline_viewer_func = modest_msg_view_create_new_inline_viewer;
+ klass->get_msg = modest_msg_view_get_msg;
+ klass->set_msg = modest_msg_view_set_msg;
+ klass->set_unavailable = modest_msg_view_set_unavailable;
+ klass->clear = modest_msg_view_clear;
+ klass->create_mime_part_view_for = modest_msg_view_create_mime_part_view_for;
+ klass->create_new_inline_viewer = modest_msg_view_create_new_inline_viewer;
return;
}
{
TnyMimePartViewIface *klass = (TnyMimePartViewIface *)g;
- klass->get_part_func = modest_msg_view_mp_get_part;
- klass->set_part_func = modest_msg_view_mp_set_part;
- klass->clear_func = modest_msg_view_mp_clear;
+ klass->get_part = modest_msg_view_mp_get_part;
+ klass->set_part = modest_msg_view_mp_set_part;
+ klass->clear = modest_msg_view_mp_clear;
return;
}
return get_priority (MODEST_GTKHTML_MSG_VIEW (self));
}
-static GList*
+static TnyList*
modest_gtkhtml_msg_view_get_selected_attachments (ModestMsgView *self)
{
return MODEST_GTKHTML_MSG_VIEW_GET_CLASS (self)->get_selected_attachments_func (self);
}
-static GList*
+static TnyList*
modest_gtkhtml_msg_view_get_selected_attachments_default (ModestMsgView *self)
{
return get_selected_attachments (MODEST_GTKHTML_MSG_VIEW (self));
}
-static GList*
+static TnyList*
modest_gtkhtml_msg_view_get_attachments (ModestMsgView *self)
{
return MODEST_GTKHTML_MSG_VIEW_GET_CLASS (self)->get_attachments_func (self);
}
-static GList*
+static TnyList*
modest_gtkhtml_msg_view_get_attachments_default (ModestMsgView *self)
{
return get_attachments (MODEST_GTKHTML_MSG_VIEW (self));
{
remove_attachment (MODEST_GTKHTML_MSG_VIEW (self), attachment);
}
-