const char *url;
/* add current url if requested */
- if (VB_INPUT_CURRENT_URI == arg->i
- && (url = webkit_web_view_get_uri(vb.gui.webview))
- ) {
+ if (VB_INPUT_CURRENT_URI == arg->i && (url = GET_URI())) {
/* append the current url to the input message */
char *input = g_strconcat(arg->s, url, NULL);
vb_echo_force(VB_MSG_NORMAL, false, "%s", input);
Arg a = {arg->i};
if (arg->i & COMMAND_YANK_URI) {
/* yank current url */
- a.s = g_strdup(webkit_web_view_get_uri(vb.gui.webview));
+ a.s = g_strdup(GET_URI());
} else {
a.s = arg->s ? g_strdup(arg->s) : NULL;
}
{
vb_set_mode(VB_MODE_NORMAL, false);
- bookmark_add(webkit_web_view_get_uri(vb.gui.webview), arg->s);
+ bookmark_add(GET_URI(), arg->s);
return true;
}
int count = vb.state.count ? vb.state.count : 1;
const char *uri, *p = NULL, *domain = NULL;
- uri = webkit_web_view_get_uri(vb.gui.webview);
+ uri = GET_URI();
vb_set_mode(VB_MODE_NORMAL, false);
if (!uri || *uri == '\0') {
vb_set_mode(VB_MODE_NORMAL, false);
if (arg->i == COMMAND_SAVE_CURRENT) {
- uri = webkit_web_view_get_uri(vb.gui.webview);
+ uri = GET_URI();
/* given string is the path to save the download to */
if (arg->s && *(arg->s) != '\0') {
path = arg->s;
if (!str) {
return NULL;
}
- return util_str_replace("%", webkit_web_view_get_uri(vb.gui.webview), str);
+ return util_str_replace("%", GET_URI(), str);
}
static void webview_load_status_cb(WebKitWebView *view, GParamSpec *pspec)
{
- const char *uri = webkit_web_view_get_uri(vb.gui.webview);
+ const char *uri = GET_URI();
switch (webkit_web_view_get_load_status(vb.gui.webview)) {
case WEBKIT_LOAD_PROVISIONAL:
static void create_web_view_received_uri_cb(WebKitWebView *view)
{
- Arg a = {VB_TARGET_NEW, (char*)webkit_web_view_get_uri(view)};
+ Arg a = {VB_TARGET_NEW, (char*)GET_URI()};
/* destroy temporary webview */
webkit_web_view_stop_loading(view);
gtk_widget_destroy(GTK_WIDGET(view));
static void destroy_client()
{
- const char *uri = webkit_web_view_get_uri(vb.gui.webview);
+ const char *uri = GET_URI();
/* write last URL into file for recreation */
if (uri) {
g_file_set_contents(vb.files[FILES_CLOSED], uri, -1, NULL);
#endif
#define GET_TEXT() (gtk_entry_get_text(GTK_ENTRY(vb.gui.inputbox)))
+#define GET_URI() (webkit_web_view_get_uri(vb.gui.webview))
#define CLEAN_MODE(mode) ((mode) & ~(VB_MODE_COMPLETE | VB_MODE_SEARCH | VB_MODE_HINTING))
#define CLEAR_INPUT() (vb_echo(VB_MSG_NORMAL, ""))
#define PRIMARY_CLIPBOARD() gtk_clipboard_get(GDK_SELECTION_PRIMARY)