r13927 vince - in /trunk/netsurf/gtk: compat.c compat.h dialogs/about.c dialogs/source.c gui.c scaffolding.c theme.c treeview.c window.c

netsurf at semichrome.net netsurf at semichrome.net
Thu May 17 17:48:21 BST 2012


Author: vince
Date: Thu May 17 11:48:20 2012
New Revision: 13927

URL: http://source.netsurf-browser.org?rev=13927&view=rev
Log:
fix build on gtk 2.12

Modified:
    trunk/netsurf/gtk/compat.c
    trunk/netsurf/gtk/compat.h
    trunk/netsurf/gtk/dialogs/about.c
    trunk/netsurf/gtk/dialogs/source.c
    trunk/netsurf/gtk/gui.c
    trunk/netsurf/gtk/scaffolding.c
    trunk/netsurf/gtk/theme.c
    trunk/netsurf/gtk/treeview.c
    trunk/netsurf/gtk/window.c

Modified: trunk/netsurf/gtk/compat.c
URL: http://source.netsurf-browser.org/trunk/netsurf/gtk/compat.c?rev=13927&r1=13926&r2=13927&view=diff
==============================================================================
--- trunk/netsurf/gtk/compat.c (original)
+++ trunk/netsurf/gtk/compat.c Thu May 17 11:48:20 2012
@@ -24,6 +24,10 @@
 
 #include "gtk/compat.h"
 
+#if !GTK_CHECK_VERSION(2,16,0)
+#include "gtk/sexy_icon_entry.c"
+#endif
+
 void nsgtk_widget_set_can_focus(GtkWidget *widget, gboolean can_focus)
 {
   #if GTK_CHECK_VERSION(2,22,0)
@@ -250,7 +254,11 @@
 #if GTK_CHECK_VERSION(3,0,0)
 	return gtk_widget_get_state_flags(widget);
 #else
+#if GTK_CHECK_VERSION(2,18,0)
 	return gtk_widget_get_state(widget);
+#else
+	return 0; /* FIXME */
+#endif
 #endif
 }
 
@@ -300,4 +308,95 @@
 #endif
 }
 
-
+GdkWindow *nsgtk_widget_get_window(GtkWidget *widget)
+{
+#if GTK_CHECK_VERSION(2,14,0)
+return gtk_widget_get_window(widget);
+#else
+ return widget->window;
+#endif
+}
+
+GtkWidget *nsgtk_dialog_get_content_area(GtkDialog *dialog)
+{
+#if GTK_CHECK_VERSION(2,14,0)
+  return gtk_dialog_get_content_area(dialog);
+#else
+  return dialog->vbox;
+#endif
+}
+
+GtkWidget *nsgtk_dialog_get_action_area(GtkDialog *dialog)
+{
+#if GTK_CHECK_VERSION(2,14,0)
+  return gtk_dialog_get_action_area(dialog);
+#else
+  return dialog->action_area;
+#endif
+}
+
+gboolean nsgtk_show_uri(GdkScreen *screen, const gchar *uri, guint32 timestamp, GError **error)
+{
+#if GTK_CHECK_VERSION(2,14,0)
+  return gtk_show_uri(screen, uri, timestamp, error);
+#else
+  return FALSE; /* FIXME */
+#endif
+}
+
+GdkWindow *nsgtk_layout_get_bin_window(GtkLayout *layout)
+{
+#if GTK_CHECK_VERSION(2,14,0)
+  return gtk_layout_get_bin_window(layout);
+#else
+  return layout->bin_window;
+#endif
+}
+
+gdouble nsgtk_adjustment_get_step_increment(GtkAdjustment *adjustment)
+{
+#if GTK_CHECK_VERSION(2,14,0)
+  return gtk_adjustment_get_step_increment(adjustment);
+#else
+  return adjustment->step_increment;
+#endif
+}
+
+gdouble nsgtk_adjustment_get_upper(GtkAdjustment *adjustment)
+{
+#if GTK_CHECK_VERSION(2,14,0)
+  return gtk_adjustment_get_upper(adjustment);
+#else
+  return adjustment->upper;
+#endif
+}
+
+gdouble nsgtk_adjustment_get_lower(GtkAdjustment *adjustment)
+{
+#if GTK_CHECK_VERSION(2,14,0)
+  return gtk_adjustment_get_lower(adjustment);
+#else
+  return adjustment->lower;
+#endif
+}
+
+gdouble nsgtk_adjustment_get_page_increment(GtkAdjustment *adjustment)
+{
+#if GTK_CHECK_VERSION(2,14,0)
+  return gtk_adjustment_get_page_increment(adjustment);
+#else
+  return adjustment->page_increment;
+#endif
+}
+
+void nsgtk_widget_get_allocation(GtkWidget *widget, GtkAllocation *allocation)
+{
+#if GTK_CHECK_VERSION(2,18,0)
+  gtk_widget_get_allocation(widget, allocation);
+#else
+  allocation->x = widget->allocation.x;
+  allocation->y = widget->allocation.y;
+  allocation->width = widget->allocation.width;
+  allocation->height = widget->allocation.height;
+#endif
+}

Modified: trunk/netsurf/gtk/compat.h
URL: http://source.netsurf-browser.org/trunk/netsurf/gtk/compat.h?rev=13927&r1=13926&r2=13927&view=diff
==============================================================================
--- trunk/netsurf/gtk/compat.h (original)
+++ trunk/netsurf/gtk/compat.h Thu May 17 11:48:20 2012
@@ -62,10 +62,6 @@
 void nsgtk_entry_set_icon_from_pixbuf(GtkWidget *entry, GtkEntryIconPosition icon_pos, GdkPixbuf *pixbuf);
 void nsgtk_entry_set_icon_from_stock(GtkWidget *entry, GtkEntryIconPosition icon_pos, const gchar *stock_id);
 void nsgtk_widget_override_background_color(GtkWidget *widget, GtkStateFlags state, uint16_t a, uint16_t r, uint16_t g, uint16_t b);
-GtkAdjustment *nsgtk_layout_get_vadjustment(GtkLayout *layout);
-GtkAdjustment *nsgtk_layout_get_hadjustment(GtkLayout *layout);
-void nsgtk_layout_set_hadjustment(GtkLayout *layout, GtkAdjustment *adj); 
-void nsgtk_layout_set_vadjustment(GtkLayout *layout, GtkAdjustment *adj);
 GtkWidget* nsgtk_hbox_new(gboolean homogeneous, gint spacing);
 GtkWidget* nsgtk_vbox_new(gboolean homogeneous, gint spacing);
 GtkStateFlags nsgtk_widget_get_state_flags(GtkWidget *widget);
@@ -74,5 +70,21 @@
 gulong nsgtk_connect_draw_event(GtkWidget *widget, GCallback callback, gpointer g);
 void nsgdk_cursor_unref(GdkCursor *cursor);
 void nsgtk_widget_modify_font(GtkWidget *widget, PangoFontDescription *font_desc);
+GdkWindow *nsgtk_widget_get_window(GtkWidget *widget);
+GtkWidget *nsgtk_dialog_get_action_area(GtkDialog *dialog);
+GtkWidget *nsgtk_dialog_get_content_area(GtkDialog *dialog);
+gboolean nsgtk_show_uri(GdkScreen *screen, const gchar *uri, guint32 timestamp, GError **error);
+GdkWindow *nsgtk_layout_get_bin_window(GtkLayout *layout);
+void nsgtk_widget_get_allocation(GtkWidget *widget, GtkAllocation *allocation);
+
+GtkAdjustment *nsgtk_layout_get_vadjustment(GtkLayout *layout);
+GtkAdjustment *nsgtk_layout_get_hadjustment(GtkLayout *layout);
+void nsgtk_layout_set_hadjustment(GtkLayout *layout, GtkAdjustment *adj); 
+void nsgtk_layout_set_vadjustment(GtkLayout *layout, GtkAdjustment *adj);
+gdouble nsgtk_adjustment_get_step_increment(GtkAdjustment *adjustment);
+gdouble nsgtk_adjustment_get_upper(GtkAdjustment *adjustment);
+gdouble nsgtk_adjustment_get_lower(GtkAdjustment *adjustment);
+gdouble nsgtk_adjustment_get_page_increment(GtkAdjustment *adjustment);
+
 
 #endif /* NETSURF_GTK_COMPAT_H */

Modified: trunk/netsurf/gtk/dialogs/about.c
URL: http://source.netsurf-browser.org/trunk/netsurf/gtk/dialogs/about.c?rev=13927&r1=13926&r2=13927&view=diff
==============================================================================
--- trunk/netsurf/gtk/dialogs/about.c (original)
+++ trunk/netsurf/gtk/dialogs/about.c Thu May 17 11:48:20 2012
@@ -59,7 +59,7 @@
 
 	vbox = nsgtk_vbox_new(FALSE, 8);
 
-	gtk_box_pack_start(GTK_BOX(gtk_dialog_get_content_area(GTK_DIALOG(dialog))), vbox, TRUE, TRUE, 0);
+	gtk_box_pack_start(GTK_BOX(nsgtk_dialog_get_content_area(GTK_DIALOG(dialog))), vbox, TRUE, TRUE, 0);
 	
 	if (pixbufs != NULL) {
 		GtkIconSet *icon_set = gtk_icon_set_new_from_pixbuf(GDK_PIXBUF(g_list_nth_data(pixbufs, 0)));
@@ -103,16 +103,16 @@
 
 	/* Add the credits button */
 	button = gtk_button_new_from_stock ("Credits");
-	gtk_box_pack_end(GTK_BOX(gtk_dialog_get_action_area(GTK_DIALOG(dialog))),
+	gtk_box_pack_end(GTK_BOX(nsgtk_dialog_get_action_area(GTK_DIALOG(dialog))),
 			 button, FALSE, TRUE, 0);
-	gtk_button_box_set_child_secondary (GTK_BUTTON_BOX(gtk_dialog_get_action_area(GTK_DIALOG(dialog))), button, TRUE);
+	gtk_button_box_set_child_secondary (GTK_BUTTON_BOX(nsgtk_dialog_get_action_area(GTK_DIALOG(dialog))), button, TRUE);
 	g_signal_connect(button, "clicked", G_CALLBACK(nsgtk_about_dialog_credits), (gpointer)bw);
 
 	/* Add the Licence button */
 	button = gtk_button_new_from_stock ("Licence");
-	gtk_box_pack_end(GTK_BOX (GTK_DIALOG(gtk_dialog_get_action_area(GTK_DIALOG(dialog)))),
+	gtk_box_pack_end(GTK_BOX (GTK_DIALOG(nsgtk_dialog_get_action_area(GTK_DIALOG(dialog)))),
 			 button, FALSE, TRUE, 0);
-	gtk_button_box_set_child_secondary (GTK_BUTTON_BOX(gtk_dialog_get_action_area(GTK_DIALOG(dialog))), button, TRUE);
+	gtk_button_box_set_child_secondary (GTK_BUTTON_BOX(nsgtk_dialog_get_action_area(GTK_DIALOG(dialog))), button, TRUE);
 	g_signal_connect(button, "clicked", G_CALLBACK(nsgtk_about_dialog_licence), (gpointer)bw);
 
 

Modified: trunk/netsurf/gtk/dialogs/source.c
URL: http://source.netsurf-browser.org/trunk/netsurf/gtk/dialogs/source.c?rev=13927&r1=13926&r2=13927&view=diff
==============================================================================
--- trunk/netsurf/gtk/dialogs/source.c (original)
+++ trunk/netsurf/gtk/dialogs/source.c Thu May 17 11:48:20 2012
@@ -332,7 +332,7 @@
 		warn[len] = '\0';
 
 		label = gtk_label_new(warn);
-		gtk_container_add(GTK_CONTAINER(gtk_dialog_get_content_area(GTK_DIALOG(confd))), 
+		gtk_container_add(GTK_CONTAINER(nsgtk_dialog_get_content_area(GTK_DIALOG(confd))), 
 				label);
 		gtk_widget_show(label);
 		if (gtk_dialog_run(GTK_DIALOG(confd)) == GTK_RESPONSE_ACCEPT) {
@@ -360,7 +360,7 @@
 	g_signal_connect_swapped(notif, "response",
 			G_CALLBACK(gtk_widget_destroy), notif);
 	label = gtk_label_new(temp);
-	gtk_container_add(GTK_CONTAINER(gtk_dialog_get_content_area(GTK_DIALOG(notif))), label);
+	gtk_container_add(GTK_CONTAINER(nsgtk_dialog_get_content_area(GTK_DIALOG(notif))), label);
 	gtk_widget_show_all(notif);
 }
 

Modified: trunk/netsurf/gtk/gui.c
URL: http://source.netsurf-browser.org/trunk/netsurf/gtk/gui.c?rev=13927&r1=13926&r2=13927&view=diff
==============================================================================
--- trunk/netsurf/gtk/gui.c (original)
+++ trunk/netsurf/gtk/gui.c Thu May 17 11:48:20 2012
@@ -670,7 +670,7 @@
 	gboolean ok;
 	GError *error = NULL;
 
-	ok = gtk_show_uri(NULL, url, GDK_CURRENT_TIME, &error);
+	ok = nsgtk_show_uri(NULL, url, GDK_CURRENT_TIME, &error);
 	if (ok == TRUE)
 		return;
 

Modified: trunk/netsurf/gtk/scaffolding.c
URL: http://source.netsurf-browser.org/trunk/netsurf/gtk/scaffolding.c?rev=13927&r1=13926&r2=13927&view=diff
==============================================================================
--- trunk/netsurf/gtk/scaffolding.c (original)
+++ trunk/netsurf/gtk/scaffolding.c Thu May 17 11:48:20 2012
@@ -1410,7 +1410,7 @@
 	gtk_widget_show(GTK_WIDGET(g->history_window->window));
 	gtk_window_move(g->history_window->window, x + g->historybase, y +
 			g->toolbarbase);
-	gdk_window_raise(gtk_widget_get_window(GTK_WIDGET(g->history_window->window)));
+	gdk_window_raise(nsgtk_widget_get_window(GTK_WIDGET(g->history_window->window)));
 
 	return TRUE;
 }
@@ -1418,7 +1418,7 @@
 MULTIHANDLER(globalhistory)
 {
 	gtk_widget_show(GTK_WIDGET(wndHistory));
-	gdk_window_raise(gtk_widget_get_window(GTK_WIDGET(wndHistory)));
+	gdk_window_raise(nsgtk_widget_get_window(GTK_WIDGET(wndHistory)));
 
 	return TRUE;
 }
@@ -1437,7 +1437,7 @@
 MULTIHANDLER(showbookmarks)
 {
 	gtk_widget_show(GTK_WIDGET(wndHotlist));
-	gdk_window_raise(gtk_widget_get_window(GTK_WIDGET(wndHotlist)));
+	gdk_window_raise(nsgtk_widget_get_window(GTK_WIDGET(wndHotlist)));
 	gtk_window_set_focus(wndHotlist, NULL);
 
 	return TRUE;
@@ -1446,7 +1446,7 @@
 MULTIHANDLER(showcookies)
 {
 	gtk_widget_show(GTK_WIDGET(wndCookies));
-	gdk_window_raise(gtk_widget_get_window(GTK_WIDGET(wndCookies)));
+	gdk_window_raise(nsgtk_widget_get_window(GTK_WIDGET(wndCookies)));
 
 	return TRUE;
 }
@@ -1577,7 +1577,7 @@
 
 	current_widget = widget;
 
-	current_cr = gdk_cairo_create(gtk_widget_get_window(widget));
+	current_cr = gdk_cairo_create(nsgtk_widget_get_window(widget));
 
 	clip.x0 = event->area.x;
 	clip.y0 = event->area.y;

Modified: trunk/netsurf/gtk/theme.c
URL: http://source.netsurf-browser.org/trunk/netsurf/gtk/theme.c?rev=13927&r1=13926&r2=13927&view=diff
==============================================================================
--- trunk/netsurf/gtk/theme.c (original)
+++ trunk/netsurf/gtk/theme.c Thu May 17 11:48:20 2012
@@ -18,12 +18,14 @@
 
 #include <gtk/gtk.h>
 #include <stdio.h>
+#include <stdint.h>
 #include <sys/stat.h>
 #include <unistd.h>
 
 #include "content/content.h"
 #include "content/content_type.h"
 #include "content/hlcache.h"
+#include "gtk/compat.h"
 #include "gtk/gui.h"
 #include "gtk/scaffolding.h"
 #include "gtk/menu.h"
@@ -254,7 +256,7 @@
 	}
 	g_signal_connect_swapped(notification, "response",
 				 G_CALLBACK(gtk_widget_destroy), notification);
-	gtk_container_add(GTK_CONTAINER(gtk_dialog_get_action_area(GTK_DIALOG(notification))), label);
+	gtk_container_add(GTK_CONTAINER(nsgtk_dialog_get_action_area(GTK_DIALOG(notification))), label);
 	gtk_widget_show_all(notification);
 
 	/* update combo */

Modified: trunk/netsurf/gtk/treeview.c
URL: http://source.netsurf-browser.org/trunk/netsurf/gtk/treeview.c?rev=13927&r1=13926&r2=13927&view=diff
==============================================================================
--- trunk/netsurf/gtk/treeview.c (original)
+++ trunk/netsurf/gtk/treeview.c Thu May 17 11:48:20 2012
@@ -215,7 +215,7 @@
 	height = event->area.height;
 	
 	current_widget = widget;
-	current_cr = gdk_cairo_create(gtk_widget_get_window(widget));
+	current_cr = gdk_cairo_create(nsgtk_widget_get_window(widget));
 	
 	tree_set_redraw(tree, true);
 	tree_draw(tree, 0, 0, x, y, width, height, &ctx);
@@ -422,7 +422,7 @@
 			if (edited)
 				break;
 			scroll = vscroll;
-			value = gtk_adjustment_get_lower(scroll);
+			value = nsgtk_adjustment_get_lower(scroll);
 			break;
 
 	case GDK_KEY(End):
@@ -430,9 +430,9 @@
 			if (edited)
 				break;			
 			scroll = vscroll;
-			value = gtk_adjustment_get_upper(scroll) - vpage;
-			if (value < gtk_adjustment_get_lower(scroll))
-				value = gtk_adjustment_get_lower(scroll);
+			value = nsgtk_adjustment_get_upper(scroll) - vpage;
+			if (value < nsgtk_adjustment_get_lower(scroll))
+				value = nsgtk_adjustment_get_lower(scroll);
 			break;
 
 	case GDK_KEY(Left):
@@ -441,18 +441,18 @@
 				break;			
 			scroll = hscroll;
 			value = gtk_adjustment_get_value(scroll) -
-				gtk_adjustment_get_step_increment(scroll);
-			if (value < gtk_adjustment_get_lower(scroll))
-				value = gtk_adjustment_get_lower(scroll);
+				nsgtk_adjustment_get_step_increment(scroll);
+			if (value < nsgtk_adjustment_get_lower(scroll))
+				value = nsgtk_adjustment_get_lower(scroll);
 			break;
 
 	case GDK_KEY(Up):
 	case GDK_KEY(KP_Up):
 			scroll = vscroll;
 			value = gtk_adjustment_get_value(scroll) -
-				gtk_adjustment_get_step_increment(scroll);
-			if (value < gtk_adjustment_get_lower(scroll))
-				value = gtk_adjustment_get_lower(scroll);
+				nsgtk_adjustment_get_step_increment(scroll);
+			if (value < nsgtk_adjustment_get_lower(scroll))
+				value = nsgtk_adjustment_get_lower(scroll);
 			break;
 
 	case GDK_KEY(Right):
@@ -461,28 +461,28 @@
 				break;
 			scroll = hscroll;
 			value = gtk_adjustment_get_value(scroll) +
-				gtk_adjustment_get_step_increment(scroll);
-			if (value > gtk_adjustment_get_upper(scroll) - hpage)
-				value = gtk_adjustment_get_upper(scroll) - hpage;
+				nsgtk_adjustment_get_step_increment(scroll);
+			if (value > nsgtk_adjustment_get_upper(scroll) - hpage)
+				value = nsgtk_adjustment_get_upper(scroll) - hpage;
 			break;
 
 	case GDK_KEY(Down):
 	case GDK_KEY(KP_Down):
 			scroll = vscroll;
 			value = gtk_adjustment_get_value(scroll) +
-				gtk_adjustment_get_step_increment(scroll);
-			if (value > gtk_adjustment_get_upper(scroll) - vpage)
-				value = gtk_adjustment_get_upper(scroll) - vpage;
+				nsgtk_adjustment_get_step_increment(scroll);
+			if (value > nsgtk_adjustment_get_upper(scroll) - vpage)
+				value = nsgtk_adjustment_get_upper(scroll) - vpage;
 			break;
 
 	case GDK_KEY(Page_Up):
 	case GDK_KEY(KP_Page_Up):
 			scroll = vscroll;
 			value = gtk_adjustment_get_value(scroll) -
-				gtk_adjustment_get_page_increment(scroll);
-
-			if (value < gtk_adjustment_get_lower(scroll))
-				value = gtk_adjustment_get_lower(scroll);
+				nsgtk_adjustment_get_page_increment(scroll);
+
+			if (value < nsgtk_adjustment_get_lower(scroll))
+				value = nsgtk_adjustment_get_lower(scroll);
 
 			break;
 
@@ -490,10 +490,10 @@
 	case GDK_KEY(KP_Page_Down):
 			scroll = vscroll;
 			value = gtk_adjustment_get_value(scroll) +
-				gtk_adjustment_get_page_increment(scroll);
-
-			if (value > gtk_adjustment_get_upper(scroll) - vpage)
-				value = gtk_adjustment_get_upper(scroll) - vpage;
+				nsgtk_adjustment_get_page_increment(scroll);
+
+			if (value > nsgtk_adjustment_get_upper(scroll) - vpage)
+				value = nsgtk_adjustment_get_upper(scroll) - vpage;
 			break;			
 
 		default:

Modified: trunk/netsurf/gtk/window.c
URL: http://source.netsurf-browser.org/trunk/netsurf/gtk/window.c?rev=13927&r1=13926&r2=13927&view=diff
==============================================================================
--- trunk/netsurf/gtk/window.c (original)
+++ trunk/netsurf/gtk/window.c Thu May 17 11:48:20 2012
@@ -218,7 +218,7 @@
 	assert(GTK_WIDGET(gw->layout) == widget);
 
 	current_widget = (GtkWidget *)gw->layout;
-	current_cr = gdk_cairo_create(gtk_layout_get_bin_window(gw->layout));
+	current_cr = gdk_cairo_create(nsgtk_layout_get_bin_window(gw->layout));
 
 	clip.x0 = event->area.x;
 	clip.y0 = event->area.y;
@@ -391,10 +391,10 @@
 			/* core did not handle event do horizontal scroll */
 
 			value = gtk_adjustment_get_value(hscroll) -
-				(gtk_adjustment_get_step_increment(hscroll) *2);
-
-			if (value < gtk_adjustment_get_lower(hscroll)) {
-				value = gtk_adjustment_get_lower(hscroll);
+				(nsgtk_adjustment_get_step_increment(hscroll) *2);
+
+			if (value < nsgtk_adjustment_get_lower(hscroll)) {
+				value = nsgtk_adjustment_get_lower(hscroll);
 			}
 
 			gtk_adjustment_set_value(hscroll, value);
@@ -411,10 +411,10 @@
 			 */
 
 			value = gtk_adjustment_get_value(vscroll) -
-				(gtk_adjustment_get_step_increment(vscroll) * 2);
-
-			if (value < gtk_adjustment_get_lower(vscroll)) {
-				value = gtk_adjustment_get_lower(vscroll);
+				(nsgtk_adjustment_get_step_increment(vscroll) * 2);
+
+			if (value < nsgtk_adjustment_get_lower(vscroll)) {
+				value = nsgtk_adjustment_get_lower(vscroll);
 			}
 
 			gtk_adjustment_set_value(vscroll, value);
@@ -432,13 +432,13 @@
 			 */
 
 			value = gtk_adjustment_get_value(hscroll) +
-				(gtk_adjustment_get_step_increment(hscroll) * 2);
+				(nsgtk_adjustment_get_step_increment(hscroll) * 2);
 
 			/* @todo consider gtk_widget_get_allocated_width() */
-			gtk_widget_get_allocation(GTK_WIDGET(g->layout), &alloc);
-
-			if (value > gtk_adjustment_get_upper(hscroll) - alloc.width) {
-				value = gtk_adjustment_get_upper(hscroll) - 
+			nsgtk_widget_get_allocation(GTK_WIDGET(g->layout), &alloc);
+
+			if (value > nsgtk_adjustment_get_upper(hscroll) - alloc.width) {
+				value = nsgtk_adjustment_get_upper(hscroll) - 
 					alloc.width;
 			}
 
@@ -456,12 +456,12 @@
 			 */
 
 			value = gtk_adjustment_get_value(vscroll) +
-				(gtk_adjustment_get_step_increment(vscroll) * 2);
+				(nsgtk_adjustment_get_step_increment(vscroll) * 2);
 			/* @todo consider gtk_widget_get_allocated_height */
-			gtk_widget_get_allocation(GTK_WIDGET(g->layout), &alloc);
-
-			if (value > gtk_adjustment_get_upper(vscroll) - alloc.height) {
-				value = gtk_adjustment_get_upper(vscroll) - 
+			nsgtk_widget_get_allocation(GTK_WIDGET(g->layout), &alloc);
+
+			if (value > nsgtk_adjustment_get_upper(vscroll) - alloc.height) {
+				value = nsgtk_adjustment_get_upper(vscroll) - 
 					alloc.height;
 			}
 
@@ -494,22 +494,22 @@
 	GtkAllocation alloc;
 
 	/* @todo consider gtk_widget_get_allocated_width() */
-	gtk_widget_get_allocation(GTK_WIDGET(g->layout), &alloc);
+	nsgtk_widget_get_allocation(GTK_WIDGET(g->layout), &alloc);
 
 	switch (event->keyval) {
 
 	case GDK_KEY(Home):
 	case GDK_KEY(KP_Home):
-		value = gtk_adjustment_get_lower(vscroll);
+		value = nsgtk_adjustment_get_lower(vscroll);
 		gtk_adjustment_set_value(vscroll, value);
 		break;
 
 	case GDK_KEY(End):
 	case GDK_KEY(KP_End):
-		value = gtk_adjustment_get_upper(vscroll) - alloc.height;
-
-		if (value < gtk_adjustment_get_lower(vscroll))
-			value = gtk_adjustment_get_lower(vscroll);
+		value = nsgtk_adjustment_get_upper(vscroll) - alloc.height;
+
+		if (value < nsgtk_adjustment_get_lower(vscroll))
+			value = nsgtk_adjustment_get_lower(vscroll);
 
 		gtk_adjustment_set_value(vscroll, value);
 		break;
@@ -517,10 +517,10 @@
 	case GDK_KEY(Left):
 	case GDK_KEY(KP_Left):
 		value = gtk_adjustment_get_value(hscroll) -
-			gtk_adjustment_get_step_increment(hscroll);
-
-		if (value < gtk_adjustment_get_lower(hscroll))
-			value = gtk_adjustment_get_lower(hscroll);
+			nsgtk_adjustment_get_step_increment(hscroll);
+
+		if (value < nsgtk_adjustment_get_lower(hscroll))
+			value = nsgtk_adjustment_get_lower(hscroll);
 
 		gtk_adjustment_set_value(hscroll, value);
 		break;
@@ -528,10 +528,10 @@
 	case GDK_KEY(Up):
 	case GDK_KEY(KP_Up):
 		value = gtk_adjustment_get_value(vscroll) -
-			gtk_adjustment_get_step_increment(vscroll);
-
-		if (value < gtk_adjustment_get_lower(vscroll))
-			value = gtk_adjustment_get_lower(vscroll);
+			nsgtk_adjustment_get_step_increment(vscroll);
+
+		if (value < nsgtk_adjustment_get_lower(vscroll))
+			value = nsgtk_adjustment_get_lower(vscroll);
 
 		gtk_adjustment_set_value(vscroll, value);
 		break;
@@ -539,10 +539,10 @@
 	case GDK_KEY(Right):
 	case GDK_KEY(KP_Right):
 		value = gtk_adjustment_get_value(hscroll) +
-			gtk_adjustment_get_step_increment(hscroll);
-
-		if (value > gtk_adjustment_get_upper(hscroll) - alloc.width)
-			value = gtk_adjustment_get_upper(hscroll) - alloc.width;
+			nsgtk_adjustment_get_step_increment(hscroll);
+
+		if (value > nsgtk_adjustment_get_upper(hscroll) - alloc.width)
+			value = nsgtk_adjustment_get_upper(hscroll) - alloc.width;
 
 		gtk_adjustment_set_value(hscroll, value);
 		break;
@@ -550,10 +550,10 @@
 	case GDK_KEY(Down):
 	case GDK_KEY(KP_Down):
 		value = gtk_adjustment_get_value(vscroll) +
-			gtk_adjustment_get_step_increment(vscroll);
-
-		if (value > gtk_adjustment_get_upper(vscroll) - alloc.height)
-			value = gtk_adjustment_get_upper(vscroll) - alloc.height;
+			nsgtk_adjustment_get_step_increment(vscroll);
+
+		if (value > nsgtk_adjustment_get_upper(vscroll) - alloc.height)
+			value = nsgtk_adjustment_get_upper(vscroll) - alloc.height;
 
 		gtk_adjustment_set_value(vscroll, value);
 		break;
@@ -561,10 +561,10 @@
 	case GDK_KEY(Page_Up):
 	case GDK_KEY(KP_Page_Up):
 		value = gtk_adjustment_get_value(vscroll) -
-			gtk_adjustment_get_page_increment(vscroll);
-
-		if (value < gtk_adjustment_get_lower(vscroll))
-			value = gtk_adjustment_get_lower(vscroll);
+			nsgtk_adjustment_get_page_increment(vscroll);
+
+		if (value < nsgtk_adjustment_get_lower(vscroll))
+			value = nsgtk_adjustment_get_lower(vscroll);
 
 		gtk_adjustment_set_value(vscroll, value);
 		break;
@@ -572,10 +572,10 @@
 	case GDK_KEY(Page_Down):
 	case GDK_KEY(KP_Page_Down):
 		value = gtk_adjustment_get_value(vscroll) +
-			gtk_adjustment_get_page_increment(vscroll);
-
-		if (value > gtk_adjustment_get_upper(vscroll) - alloc.height)
-			value = gtk_adjustment_get_upper(vscroll) - alloc.height;
+			nsgtk_adjustment_get_page_increment(vscroll);
+
+		if (value > nsgtk_adjustment_get_upper(vscroll) - alloc.height)
+			value = nsgtk_adjustment_get_upper(vscroll) - alloc.height;
 
 		gtk_adjustment_set_value(vscroll, value);
 		break;
@@ -775,7 +775,7 @@
 		g->bw->reformat_pending = false;
 
 		/* @todo consider gtk_widget_get_allocated_width() */
-		gtk_widget_get_allocation(GTK_WIDGET(g->layout), &alloc);
+		nsgtk_widget_get_allocation(GTK_WIDGET(g->layout), &alloc);
 
 		browser_window_reformat(g->bw, false, alloc.width, alloc.height);
 	}
@@ -1042,7 +1042,7 @@
 				gtk_widget_get_display(
 					GTK_WIDGET(g->layout)),
 					cursortype);
-	gdk_window_set_cursor(gtk_widget_get_window(GTK_WIDGET(g->layout)), 
+	gdk_window_set_cursor(nsgtk_widget_get_window(GTK_WIDGET(g->layout)), 
 			      cursor);
 
 	if (!nullcursor)
@@ -1100,7 +1100,7 @@
 	GtkAllocation alloc;
 
 	/* @todo consider gtk_widget_get_allocated_width() */
-	gtk_widget_get_allocation(GTK_WIDGET(g->layout), &alloc);
+	nsgtk_widget_get_allocation(GTK_WIDGET(g->layout), &alloc);
 
 	*width = alloc.width;
 	*height = alloc.height;




More information about the netsurf-commits mailing list