diff options
1 files changed, 51 insertions, 0 deletions
| -rw-r--r-- | badwolf.h | 51 |
diff --git a/badwolf.h b/badwolf.h new file mode 100644 index 0000000..4c9fa65 --- /dev/null +++ b/badwolf.h @@ -0,0 +1,51 @@ +#ifndef BADWOLF_H_INCLUDED +#define BADWOLF_H_INCLUDED + +#include <gtk/gtk.h> +#include <webkit2/webkit2.h> + +const gchar *homepage; +const gchar *version; + +struct Window +{ + GtkWidget *main_window; + GtkWidget *notebook; + GtkWidget *new_tab; +}; + +struct Client +{ + GtkWidget *box; + + GtkWidget *toolbar; + GtkWidget *javascript; + GtkWidget *location; + + WebKitWebView *webView; + struct Window *window; + + GtkWidget *statusbar; + GtkWidget *statuslabel; + GtkWidget *search; +}; + +/* badwolf_ensure_uri_scheme: tries to add a scheme on a pseudo-URL missing a scheme + * - gchar text: pseudo-URL missing a scheme + * - gboolean try_file: when TRUE check try first if it can be a file:// path + * + * When `text` isn't exploitable (ie. NULL), returns "about:blank", + * when the URL seems to be valid, return it, + * if try_file is TRUE, check if it can be file:// path, + * some other checks might be added. + * In the end use the fallback (`http://` for now, might get configuration), + * might get some safeguard. + */ +gchar *badwolf_ensure_uri_scheme(gchar *text, gboolean try_file); +GtkWidget *badwolf_new_tab_box(const gchar *title, struct Client *browser); +void webView_tab_label_change(struct Client *browser, const gchar *title); +struct Client * +new_browser(struct Window *window, gchar *target_url, WebKitWebView *related_web_view); +int badwolf_new_tab(GtkNotebook *notebook, struct Client *browser); +gint badwolf_get_tab_position(GtkContainer *notebook, GtkWidget *child); +#endif /* BADWOLF_H_INCLUDED */ |