Formalized plugin interface
[WebThing.git] / plugins / FFNav.cs
index 1a3145c..f8ba39c 100644 (file)
@@ -2,30 +2,30 @@ using System;
 using Gtk;
 using bytex64.WebThing;
 
-public class Plugin {
-       WebThing wt;
+public class FFNav : WebThingPlugin {
+    WebThing wt;
 
-       public Plugin(WebThing wt) {
-               this.wt = wt;
-               wt.WebView.KeyPressEvent += WebView_KeyPress;
-       }
+    public void Init(WebThing wt) {
+        this.wt = wt;
+        wt.WebView.KeyPressEvent += WebView_KeyPress;
+    }
 
-       private void WebView_KeyPress(object o, KeyPressEventArgs e) {
-               if ((e.Event.State & Gdk.ModifierType.Mod1Mask) != 0) {
-                       switch(e.Event.Key) {
-                       case Gdk.Key.Left:
-                               wt.WebView.GoBack();
-                               break;
-                       case Gdk.Key.Right:
-                               wt.WebView.GoForward();
-                               break;
-                       }
-               } else {
-                       switch(e.Event.Key) {
-                       case Gdk.Key.BackSpace:
-                               wt.WebView.GoBack();
-                               break;
-                       }
-               }
-       }
+    private void WebView_KeyPress(object o, KeyPressEventArgs e) {
+        if ((e.Event.State & Gdk.ModifierType.Mod1Mask) != 0) {
+            switch(e.Event.Key) {
+            case Gdk.Key.Left:
+                wt.WebView.GoBack();
+                break;
+            case Gdk.Key.Right:
+                wt.WebView.GoForward();
+                break;
+            }
+        } else {
+            switch(e.Event.Key) {
+            case Gdk.Key.BackSpace:
+                wt.WebView.GoBack();
+                break;
+            }
+        }
+    }
 }