changeset 12:3754aca8433a

Added Webkit#back and Webkit#forward
author unexist
date Mon, 14 Dec 2009 00:46:17 +0100
parents b9d162d77d00
children 13c2eeefadca
files subtly/webkit.rb
diffstat 1 files changed, 18 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/subtly/webkit.rb	Mon Dec 14 00:35:14 2009 +0100
+++ b/subtly/webkit.rb	Mon Dec 14 00:46:17 2009 +0100
@@ -35,6 +35,13 @@
       Subtly::Webkit.ffi_get_title(@widget)
     end
 
+    def back
+      Subtly::Webkit.ffi_go_steps(@widget, -1)
+    end
+
+    def forward
+      Subtly::Webkit.ffi_go_steps(@widget, 1)
+    end
 
     ## ffi_new
     # Create webkit view
@@ -78,5 +85,16 @@
     attach_function(:ffi_get_title,
       :webkit_web_view_get_title, [ :pointer ], :string
      )
+
+    ## ffi_go_steps
+    # Go back or forward in history
+    #
+    # @param  [Pointer, #read]  Webkit view, #GtkWidget
+    # @param  [Int,     #read]  Steps to go
+    ##
+
+    attach_function(:ffi_go_steps,
+      :webkit_web_view_go_back_or_forward, [ :pointer, :int ], :void
+    )
   end # }}}
 end