summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/commands.c53
-rw-r--r--src/commands.h3
-rw-r--r--src/config.h19
-rw-r--r--src/tabs.c134
-rw-r--r--src/tabs.h29
5 files changed, 0 insertions, 238 deletions
diff --git a/src/commands.c b/src/commands.c
index 1198e9dd..7b05a6ec 100644
--- a/src/commands.c
+++ b/src/commands.c
@@ -30,7 +30,6 @@
#include "download.h"
#include "js.h"
#include "scripts.h"
-#include "tabs.h"
inline static int
dwb_floor(double x) {
@@ -1023,55 +1022,3 @@ commands_reload_quickmarks(KeyMap *km, Arg *arg)
dwb_reload_quickmarks();
return STATUS_OK;
}
-
-#if 0
-DwbStatus
-commands_group_show(KeyMap *km, Arg *arg) {
- int n = MIN(NUMMOD, 9);
- for (GList *gl = dwb.state.views; gl != NULL; gl=gl->next) {
- if (VIEW(gl)->status->group & (1<<n)) {
- dwb_show_tab(gl);
- }
- else {
- dwb_hide_tab(gl);
- }
- }
- return STATUS_OK;
-}
-DwbStatus
-commands_group_toggle(KeyMap *km, Arg *arg)
-{
- int n = MIN(NUMMOD, 9), i=0;
- dwb.state.current_groups ^= (1<<n);
- for (GList *gl = dwb.state.views; gl; gl=gl->next, i++)
- {
-
- }
- printf("%d\n", dwb.state.current_groups);
- return STATUS_OK;
-}
-DwbStatus
-commands_group_tag(KeyMap *km, Arg *arg)
-{
- int n = MIN(NUMMOD, 9);
- if (dwb.state.nummod > 9 || dwb.state.nummod < 0)
- return STATUS_ERROR;
- CURRENT_VIEW()->status->group &= (1<<n);
- tab_update(dwb.state.fview);
-
- //if (CURRENT_VIEW()->status->group & (1<<n)) {
- // CURRENT_VIEW()->status->group &= ~(1<<n);
- // if (!GROUP_VISIBLE(dwb.state.fview))
- // dwb_hide_tab(dwb.state.fview);
- // dwb_set_normal_message(dwb.state.fview, true, "Untagged group %d", n);
- //}
- //else {
- // CURRENT_VIEW()->status->group |= 1<<n;
- // if (GROUP_VISIBLE(dwb.state.fview))
- // dwb_show_tab(dwb.state.fview);
- // dwb_set_normal_message(dwb.state.fview, true, "Tagged group %d", n);
- //}
-
- return STATUS_OK;
-}
-#endif
diff --git a/src/commands.h b/src/commands.h
index ab961f4a..e99d15a9 100644
--- a/src/commands.h
+++ b/src/commands.h
@@ -95,9 +95,6 @@ DwbStatus commands_sanitize(KeyMap *, Arg *);
DwbStatus commands_eval(KeyMap *, Arg *);
DwbStatus commands_download(KeyMap *, Arg *);
DwbStatus commands_toggle_tab(KeyMap *, Arg *);
-DwbStatus commands_group_tag(KeyMap *, Arg *);
-DwbStatus commands_group_toggle(KeyMap *, Arg *);
-DwbStatus commands_group_show(KeyMap *, Arg *);
DwbStatus commands_reload_bookmarks(KeyMap *, Arg *);
DwbStatus commands_reload_quickmarks(KeyMap *, Arg *);
diff --git a/src/config.h b/src/config.h
index 36db4718..d902c864 100644
--- a/src/config.h
+++ b/src/config.h
@@ -186,11 +186,6 @@ static KeyValue KEYS[] = {
{ "toggle_tab", { "@Tab@", GDK_CONTROL_MASK, 0 }, },
{ "reload_bookmarks", { NULL, 0, 0 }, },
{ "reload_quickmarks", { NULL, 0, 0 }, },
-#if 1
- { "group_tag", { "am", 0, 0 }, },
- { "group_show", { "as", 0, 0 }, },
- { "group_toggle", { "at", 0, 0 }, },
-#endif
};
/* FUNCTION_MAP{{{*/
@@ -198,20 +193,6 @@ static FunctionMap FMAP [] = {
{ { "tab_new", "Add a new tab", }, CP_COMMANDLINE,
(Func)commands_add_view, NULL, ALWAYS_SM,
{ .p = NULL }, EP_NONE, { NULL }, },
-#if 0
- { { "group_tag", "Tag current tab to group", }, CP_COMMANDLINE,
- (Func)commands_group_tag, NULL, POST_SM,
- { .p = NULL }, EP_NONE, { NULL }, },
-
- { { "group_show", "Show group", }, CP_COMMANDLINE,
- (Func)commands_group_show, NULL, POST_SM,
- { .p = NULL }, EP_NONE, { NULL }, },
-
- { { "group_toggle", "Toggle group", }, CP_COMMANDLINE,
- (Func)commands_group_toggle, NULL, POST_SM,
- { .p = NULL }, EP_NONE, { NULL }, },
-#endif
-
{ { "reload_quickmarks", "Reload quickmarks", }, CP_COMMANDLINE,
(Func)commands_reload_quickmarks, NULL, ALWAYS_SM,
{ .p = NULL }, EP_NONE, { NULL }, },
diff --git a/src/tabs.c b/src/tabs.c
deleted file mode 100644
index 5e2d212a..00000000
--- a/src/tabs.c
+++ /dev/null
@@ -1,134 +0,0 @@
-/*
- * Copyright (c) 2010-2012 Stefan Bolte <portix@gmx.net>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
-
-#include "dwb.h"
-#include "tabs.h"
-
-#define TAB_VISIBLE(gl) (VIEW((gl))->status->group & dwb.state.current_groups)
-
-static gint
-count_visible() {
- int n=0;
- for (GList *gl = dwb.state.views; gl; gl=gl->next) {
- if (TAB_VISIBLE(gl))
- n++;
- }
- return n;
-}
-GList *
-tab_next(GList *gl, gint steps, gboolean skip)
-{
- g_return_val_if_fail(gl != NULL, dwb.state.fview);
-
- GList *n, *last = gl;
- gint l, i;
-
- if (!dwb.state.views->next)
- return gl;
-
- l = count_visible(dwb.state.views);
- steps %= l;
-
- for (i=0, n=gl->next; i<steps && n; n=n->prev)
- {
- if (n == gl)
- return gl;
- if (n == NULL)
- {
- if (skip)
- n = dwb.state.views;
- else
- return last;
- }
- if (TAB_VISIBLE(n)) {
- i++;
- last = n;
- }
- }
- return n;
-}
-GList *
-tab_prev(GList *gl, gint steps, gboolean skip)
-{
- g_return_val_if_fail(gl != NULL, dwb.state.fview);
-
- GList *p, *last = gl;
- gint l, i;
-
- if (!dwb.state.views->next)
- return gl;
-
- l = count_visible(dwb.state.views);
- steps %= l;
-
- for (i=0, p=gl->prev; i<steps && p; p=p->prev)
- {
- if (p == gl)
- return gl;
- if (p == NULL)
- {
- if (skip)
- p = g_list_last(dwb.state.views);
- else
- return last;
- }
- if (TAB_VISIBLE(p))
- {
- i++;
- last = p;
- }
- }
-
- return p;
-}
-int
-tab_position(GList *gl)
-{
- int n=0;
-
- if (dwb.state.current_groups == 0)
- return g_list_position(dwb.state.views, gl);
-
- for (GList *l = dwb.state.views; l; l=l->next)
- {
- if (TAB_VISIBLE(l))
- {
- if (l == gl)
- return n;
- n++;
- }
- }
- return -1;
-}
-void
-tab_update(GList *gl)
-{
- if (TAB_VISIBLE(gl))
- tab_show(gl);
- else
- tab_hide(gl);
-}
-void
-tab_show(GList *gl)
-{
-
-}
-void
-tab_hide(GList *gl)
-{
-}
diff --git a/src/tabs.h b/src/tabs.h
deleted file mode 100644
index 0ee58c2e..00000000
--- a/src/tabs.h
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * Copyright (c) 2010-2012 Stefan Bolte <portix@gmx.net>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
-
-#ifndef TABS_H
-#define TABS_H
-
-
-GList * tab_next(GList *, gint steps, gboolean skip);
-GList * tab_prev(GList *, gint steps, gboolean skip);
-void tab_show(GList *);
-void tab_hide(GList *);
-void tab_update(GList *gl);
-
-#endif