aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/nav.c26
-rw-r--r--src/nav.h2
-rw-r--r--src/ui.cc4
-rw-r--r--src/uicmd.cc16
-rw-r--r--src/uicmd.hh2
5 files changed, 50 insertions, 0 deletions
diff --git a/src/nav.c b/src/nav.c
index 7b620b66..7814ae22 100644
--- a/src/nav.c
+++ b/src/nav.c
@@ -447,6 +447,19 @@ void a_Nav_back(BrowserWindow *bw)
}
/*
+ * Send the browser back to previous page in new tab
+ */
+void a_Nav_back_nt(BrowserWindow *bw)
+{
+ int idx = a_Nav_stack_ptr(bw);
+
+ if (--idx >= 0){
+ a_UIcmd_set_msg(bw, "");
+ a_UIcmd_open_url_nt(bw, a_History_get_url(NAV_UIDX(bw, idx)), -1);
+ }
+}
+
+/*
* Send the browser to next page in the history list
*/
void a_Nav_forw(BrowserWindow *bw)
@@ -461,6 +474,19 @@ void a_Nav_forw(BrowserWindow *bw)
}
/*
+ * Send the browser to next page in the history list in new tab
+ */
+void a_Nav_forw_nt(BrowserWindow *bw)
+{
+ int idx = a_Nav_stack_ptr(bw);
+
+ if (++idx < a_Nav_stack_size(bw)) {
+ a_UIcmd_set_msg(bw, "");
+ a_UIcmd_open_url_nt(bw, a_History_get_url(NAV_UIDX(bw, idx)), +1);
+ }
+}
+
+/*
* Redirect the browser to the HOME page!
*/
void a_Nav_home(BrowserWindow *bw)
diff --git a/src/nav.h b/src/nav.h
index 2bec7e32..e9c03438 100644
--- a/src/nav.h
+++ b/src/nav.h
@@ -18,7 +18,9 @@ void a_Nav_push(BrowserWindow *bw, const DilloUrl *url,
const DilloUrl *requester);
void a_Nav_repush(BrowserWindow *bw);
void a_Nav_back(BrowserWindow *bw);
+void a_Nav_back_nt(BrowserWindow *bw);
void a_Nav_forw(BrowserWindow *bw);
+void a_Nav_forw_nt(BrowserWindow *bw);
void a_Nav_home(BrowserWindow *bw);
void a_Nav_reload(BrowserWindow *bw);
void a_Nav_jump(BrowserWindow *bw, int offset, int new_bw);
diff --git a/src/ui.cc b/src/ui.cc
index 2f05c811..c5870b04 100644
--- a/src/ui.cc
+++ b/src/ui.cc
@@ -312,6 +312,8 @@ static void b1_cb(Fl_Widget *wid, void *cb_data)
case UI_BACK:
if (b == FL_LEFT_MOUSE) {
a_UIcmd_back(a_UIcmd_get_bw_by_widget(wid));
+ } else if (b == FL_MIDDLE_MOUSE) {
+ a_UIcmd_back_nt(a_UIcmd_get_bw_by_widget(wid));
} else if (b == FL_RIGHT_MOUSE) {
a_UIcmd_back_popup(a_UIcmd_get_bw_by_widget(wid), wid->x(),
wid->y() + wid->h());
@@ -320,6 +322,8 @@ static void b1_cb(Fl_Widget *wid, void *cb_data)
case UI_FORW:
if (b == FL_LEFT_MOUSE) {
a_UIcmd_forw(a_UIcmd_get_bw_by_widget(wid));
+ } else if (b == FL_MIDDLE_MOUSE) {
+ a_UIcmd_forw_nt(a_UIcmd_get_bw_by_widget(wid));
} else if (b == FL_RIGHT_MOUSE) {
a_UIcmd_forw_popup(a_UIcmd_get_bw_by_widget(wid), wid->x(),
wid->y() + wid->h());
diff --git a/src/uicmd.cc b/src/uicmd.cc
index 60381867..15207408 100644
--- a/src/uicmd.cc
+++ b/src/uicmd.cc
@@ -868,6 +868,14 @@ void a_UIcmd_back(void *vbw)
}
/*
+ * Send the browser back to previous page in a new tab
+ */
+void a_UIcmd_back_nt(void *vbw)
+{
+ a_Nav_back_nt((BrowserWindow*)vbw);
+}
+
+/*
* Popup the navigation menu of the Back button
*/
void a_UIcmd_back_popup(void *vbw, int x, int y)
@@ -884,6 +892,14 @@ void a_UIcmd_forw(void *vbw)
}
/*
+ * Send the browser to next page in the history list in new tab
+ */
+void a_UIcmd_forw_nt(void *vbw)
+{
+ a_Nav_forw_nt((BrowserWindow*)vbw);
+}
+
+/*
* Popup the navigation menu of the Forward button
*/
void a_UIcmd_forw_popup(void *vbw, int x, int y)
diff --git a/src/uicmd.hh b/src/uicmd.hh
index fe72486a..1343a4a9 100644
--- a/src/uicmd.hh
+++ b/src/uicmd.hh
@@ -29,8 +29,10 @@ void a_UIcmd_open_url(BrowserWindow *bw, const DilloUrl *url);
void a_UIcmd_open_url_nw(BrowserWindow *bw, const DilloUrl *url);
void a_UIcmd_open_url_nt(void *vbw, const DilloUrl *url, int focus);
void a_UIcmd_back(void *vbw);
+void a_UIcmd_back_nt(void *vbw);
void a_UIcmd_back_popup(void *vbw, int x, int y);
void a_UIcmd_forw(void *vbw);
+void a_UIcmd_forw_nt(void *vbw);
void a_UIcmd_forw_popup(void *vbw, int x, int y);
void a_UIcmd_home(void *vbw);
void a_UIcmd_zoom_in(void *vbw);