-asdfasdf
\ No newline at end of file
+
+//valac --vapidir=./vapi --pkg gtk+-3.0 --pkg webkit2gtk-3.0 --pkg libsoup-2.4 webkitpdf.vala BrowserWindow -o /usr/bin/wksnapshot
+
+public class webkitpdf {
+
+ public static string? opt_url = null;
+ public static uint opt_delay = 0;
+ public static string opt_target_png = null;
+ const OptionEntry[] options = {
+
+
+ { "url", 0, 0, OptionArg.STRING, ref opt_url, "Url to grab", null },
+ { "delay", 0, 0, OptionArg.INT, ref opt_delay, "Delay before snapshot in seconds", null },
+ { "png", 0, 0, OptionArg.STRING, ref opt_target_png, "File to write (PNG)", null },
+ { null }
+ };
+ public static int main(string[] args) {
+ Gtk.init(ref args);
+
+
+ var opt_context = new OptionContext ("webkitpdf");
+
+
+ try {
+ opt_context.set_help_enabled (true);
+ opt_context.add_main_entries (options, null);
+ opt_context.parse (ref args);
+
+ if (Browser.opt_url == null) {
+ throw new OptionError.BAD_VALUE("missing url");
+ }
+ if (Browser.opt_target_png == null) {
+ throw new OptionError.BAD_VALUE("missing png");
+ }
+
+ } catch (OptionError e) {
+ stdout.printf ("error: %s\n", e.message);
+ stdout.printf ("Run '%s --help' to see a full list of available command line options.\n %s",
+ args[0], opt_context.get_help(true,null));
+ return 0;
+ }
+
+
+ var browser = new Browser();
+ browser.show_all();
+
+ Gtk.main();
+
+ return 0;
+ }
+}
+
+
+
\ No newline at end of file