Summary Files Commits Branches @commit @diff @stats
path: root / badwolf.h
diff options
context:
space:
mode:
Commitc5c20e8f0d45a13503826062a0db508ad5eebf2d (patch)
Author
 Haelwenn (lanodan) Monnier <contact@hacktivis.me>
2019-07-18 10:52:11 +0200
Committer
 Haelwenn (lanodan) Monnier <contact@hacktivis.me>
2019-07-18 10:52:11 +0200
Files83e153dae3c0f94dd7b7da6966c0396456d5c51f /badwolf.h
goodwolf-c5c20e8f0d45a13503826062a0db508ad5eebf2d.tar
goodwolf-c5c20e8f0d45a13503826062a0db508ad5eebf2d.tar.gz
goodwolf-c5c20e8f0d45a13503826062a0db508ad5eebf2d.zip
Parentf2fd43fd7335ceb6acdfd3f7483be616ae611406 (diff)
Parent4d30c11f4c7ff59805c770ca972a24088c9f2604 (diff)
Merge branch 'chores/files-separation' into develop
1 files changed, 51 insertions, 0 deletions
-rw-r--r--badwolf.h51
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 */