shuffle deck chairs: rename group actions to match intent for clarity

This commit is contained in:
okan 2019-03-07 12:54:21 +00:00
parent af76851447
commit 053c616a9b
4 changed files with 37 additions and 37 deletions

View File

@ -15,7 +15,7 @@
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
* $OpenBSD: calmwm.h,v 1.368 2019/03/04 19:28:17 okan Exp $
* $OpenBSD: calmwm.h,v 1.369 2019/03/07 12:54:21 okan Exp $
*/
#ifndef _CALMWM_H_
@ -436,12 +436,10 @@ void client_urgency(struct client_ctx *);
void client_vtile(struct client_ctx *);
void client_wm_hints(struct client_ctx *);
void group_alltoggle(struct screen_ctx *);
void group_assign(struct group_ctx *, struct client_ctx *);
int group_autogroup(struct client_ctx *);
void group_cycle(struct screen_ctx *, int);
void group_hide(struct group_ctx *);
void group_hidetoggle(struct screen_ctx *, int);
int group_holds_only_hidden(struct group_ctx *);
int group_holds_only_sticky(struct group_ctx *);
void group_init(struct screen_ctx *, int, const char *);
@ -450,6 +448,8 @@ void group_only(struct screen_ctx *, int);
void group_close(struct screen_ctx *, int);
int group_restore(struct client_ctx *);
void group_show(struct group_ctx *);
void group_toggle(struct screen_ctx *, int);
void group_toggle_all(struct screen_ctx *);
void group_toggle_membership(struct client_ctx *);
void group_update_names(struct screen_ctx *);
@ -513,7 +513,7 @@ void kbfunc_group_toggle(void *, struct cargs *);
void kbfunc_group_only(void *, struct cargs *);
void kbfunc_group_close(void *, struct cargs *);
void kbfunc_group_cycle(void *, struct cargs *);
void kbfunc_group_alltoggle(void *, struct cargs *);
void kbfunc_group_toggle_all(void *, struct cargs *);
void kbfunc_menu_client(void *, struct cargs *);
void kbfunc_menu_cmd(void *, struct cargs *);
void kbfunc_menu_group(void *, struct cargs *);

View File

@ -15,7 +15,7 @@
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
* $OpenBSD: conf.c,v 1.248 2019/03/04 19:28:18 okan Exp $
* $OpenBSD: conf.c,v 1.249 2019/03/07 12:54:21 okan Exp $
*/
#include <sys/types.h>
@ -139,7 +139,7 @@ static const struct {
{ FUNC_SC(group-cycle, group_cycle, (CWM_CYCLE_FORWARD)) },
{ FUNC_SC(group-rcycle, group_cycle, (CWM_CYCLE_REVERSE)) },
{ FUNC_SC(group-toggle-all, group_alltoggle, 0) },
{ FUNC_SC(group-toggle-all, group_toggle_all, 0) },
{ FUNC_SC(group-toggle-1, group_toggle, 1) },
{ FUNC_SC(group-toggle-2, group_toggle, 2) },
{ FUNC_SC(group-toggle-3, group_toggle, 3) },

View File

@ -16,7 +16,7 @@
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
* $OpenBSD: group.c,v 1.133 2019/03/01 14:32:01 okan Exp $
* $OpenBSD: group.c,v 1.134 2019/03/07 12:54:21 okan Exp $
*/
#include <sys/types.h>
@ -204,7 +204,20 @@ group_holds_only_hidden(struct group_ctx *gc)
}
void
group_hidetoggle(struct screen_ctx *sc, int idx)
group_only(struct screen_ctx *sc, int idx)
{
struct group_ctx *gc;
TAILQ_FOREACH(gc, &sc->groupq, entry) {
if (gc->num == idx)
group_show(gc);
else
group_hide(gc);
}
}
void
group_toggle(struct screen_ctx *sc, int idx)
{
struct group_ctx *gc;
@ -223,16 +236,17 @@ group_hidetoggle(struct screen_ctx *sc, int idx)
}
void
group_only(struct screen_ctx *sc, int idx)
group_toggle_all(struct screen_ctx *sc)
{
struct group_ctx *gc;
TAILQ_FOREACH(gc, &sc->groupq, entry) {
if (gc->num == idx)
if (sc->hideall)
group_show(gc);
else
group_hide(gc);
}
sc->hideall = !sc->hideall;
}
void
@ -301,20 +315,6 @@ group_prev(struct group_ctx *gc)
newgc : TAILQ_LAST(&sc->groupq, group_q));
}
void
group_alltoggle(struct screen_ctx *sc)
{
struct group_ctx *gc;
TAILQ_FOREACH(gc, &sc->groupq, entry) {
if (sc->hideall)
group_show(gc);
else
group_hide(gc);
}
sc->hideall = !sc->hideall;
}
int
group_restore(struct client_ctx *cc)
{

View File

@ -15,7 +15,7 @@
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
* $OpenBSD: kbfunc.c,v 1.163 2019/03/04 19:28:18 okan Exp $
* $OpenBSD: kbfunc.c,v 1.164 2019/03/07 12:54:21 okan Exp $
*/
#include <sys/types.h>
@ -427,18 +427,24 @@ kbfunc_client_movetogroup(void *ctx, struct cargs *cargs)
group_movetogroup(ctx, cargs->flag);
}
void
kbfunc_group_toggle(void *ctx, struct cargs *cargs)
{
group_hidetoggle(ctx, cargs->flag);
}
void
kbfunc_group_only(void *ctx, struct cargs *cargs)
{
group_only(ctx, cargs->flag);
}
void
kbfunc_group_toggle(void *ctx, struct cargs *cargs)
{
group_toggle(ctx, cargs->flag);
}
void
kbfunc_group_toggle_all(void *ctx, struct cargs *cargs)
{
group_toggle_all(ctx);
}
void
kbfunc_group_close(void *ctx, struct cargs *cargs)
{
@ -451,12 +457,6 @@ kbfunc_group_cycle(void *ctx, struct cargs *cargs)
group_cycle(ctx, cargs->flag);
}
void
kbfunc_group_alltoggle(void *ctx, struct cargs *cargs)
{
group_alltoggle(ctx);
}
void
kbfunc_menu_client(void *ctx, struct cargs *cargs)
{