changeset 2363:08c66712364c

[gaim-migrate @ 2376] my cs165a (AI) teacher used to work at microsoft, and today he was wearing a microsoft t-shirt, so i've decided that every day that i go to his class i'll wear a different sun/netscape/linux t-shirt. committer: Tailor Script <tailor@pidgin.im>
author Eric Warmenhoven <eric@warmenhoven.org>
date Wed, 26 Sep 2001 19:48:50 +0000
parents ba6d3f0467cb
children 94314b9dbda4
files src/conversation.c src/gtkimhtml.c src/gtkimhtml.h
diffstat 3 files changed, 36 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/conversation.c	Wed Sep 26 19:22:19 2001 +0000
+++ b/src/conversation.c	Wed Sep 26 19:48:50 2001 +0000
@@ -586,6 +586,10 @@
 			gtk_signal_emit_stop_by_name(GTK_OBJECT(entry), "key_press_event");
 			close_callback(c->close, c);
 		}
+	} else if (event->keyval == GDK_Page_Up) {
+		gtk_imhtml_page_up(GTK_IMHTML(c->text));
+	} else if (event->keyval == GDK_Page_Down) {
+		gtk_imhtml_page_down(GTK_IMHTML(c->text));
 	} else if ((event->keyval == GDK_F2) && (convo_options & OPT_CONVO_F2_TOGGLES)) {
 		gtk_imhtml_show_comments(GTK_IMHTML(c->text), !GTK_IMHTML(c->text)->comments);
 	} else if ((event->keyval == GDK_Return) || (event->keyval == GDK_KP_Enter)) {
--- a/src/gtkimhtml.c	Wed Sep 26 19:22:19 2001 +0000
+++ b/src/gtkimhtml.c	Wed Sep 26 19:48:50 2001 +0000
@@ -3477,3 +3477,31 @@
 	if (GTK_WIDGET_REALIZED (GTK_WIDGET (imhtml)))
 		gdk_window_clear (GTK_LAYOUT (imhtml)->bin_window);
 }
+
+void
+gtk_imhtml_page_up (GtkIMHtml *imhtml)
+{
+	GtkAdjustment *vadj;
+
+	g_return_if_fail (imhtml != NULL);
+	g_return_if_fail (GTK_IS_IMHTML (imhtml));
+
+	vadj = GTK_LAYOUT (imhtml)->vadjustment;
+	gtk_adjustment_set_value (vadj, MAX (vadj->value - vadj->page_increment,
+					     vadj->lower));
+	gtk_signal_emit_by_name (GTK_OBJECT (vadj), "changed");
+}
+
+void
+gtk_imhtml_page_down (GtkIMHtml *imhtml)
+{
+	GtkAdjustment *vadj;
+
+	g_return_if_fail (imhtml != NULL);
+	g_return_if_fail (GTK_IS_IMHTML (imhtml));
+
+	vadj = GTK_LAYOUT (imhtml)->vadjustment;
+	gtk_adjustment_set_value (vadj, MIN (vadj->value + vadj->page_increment,
+					     vadj->upper - vadj->page_size));
+	gtk_signal_emit_by_name (GTK_OBJECT (vadj), "changed");
+}
--- a/src/gtkimhtml.h	Wed Sep 26 19:22:19 2001 +0000
+++ b/src/gtkimhtml.h	Wed Sep 26 19:48:50 2001 +0000
@@ -129,6 +129,10 @@
 
 void       gtk_imhtml_clear            (GtkIMHtml        *imhtml);
 
+void       gtk_imhtml_page_up          (GtkIMHtml        *imhtml);
+
+void       gtk_imhtml_page_down        (GtkIMHtml        *imhtml);
+
 #ifdef __cplusplus
 }
 #endif