diff options
| Commit | 66289e480b2b3dca550628352675abc7b7b4f6ee (patch) | |
|---|---|---|
| Author | 2019-10-31 18:22:40 +0100 | |
| Committer | 2019-10-31 18:23:26 +0100 | |
| Files | b3e3c248a87476d90cc2da62d8b0f288f396f73c /badwolf.h | |
| goodwolf-0.4.0.tar goodwolf-0.4.0.tar.gz goodwolf-0.4.0.zip | ||
| Parent | 5030dbfd170c3eb35eac9e2be08365f72f52161b (diff) | |
| Parent | 416fa67dfd0dbd9b308c6db48d02c2dcdf879103 (diff) | |
Merge branch 'release-0.4' for 0.4.0 v0.4.0
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 */ |