summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
Diffstat (limited to 'app')
-rw-r--r--app/cwm/calmwm.c47
-rw-r--r--app/cwm/calmwm.h13
-rw-r--r--app/cwm/client.c38
-rw-r--r--app/cwm/conf.c32
-rw-r--r--app/cwm/grab.c20
-rw-r--r--app/cwm/group.c33
-rw-r--r--app/cwm/kbfunc.c3
-rw-r--r--app/cwm/search.c8
-rw-r--r--app/cwm/util.c9
-rw-r--r--app/cwm/xevents.c4
-rw-r--r--app/cwm/xutil.c23
11 files changed, 33 insertions, 197 deletions
diff --git a/app/cwm/calmwm.c b/app/cwm/calmwm.c
index bbc2cd713..b81d65035 100644
--- a/app/cwm/calmwm.c
+++ b/app/cwm/calmwm.c
@@ -15,14 +15,13 @@
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
- * $Id: calmwm.c,v 1.6 2008/01/14 15:21:10 oga Exp $
+ * $Id: calmwm.c,v 1.7 2008/01/16 11:39:20 oga Exp $
*/
#include "headers.h"
#include "calmwm.h"
Display *X_Dpy;
-XFontStruct *X_Font;
Cursor Cursor_move;
Cursor Cursor_resize;
@@ -47,15 +46,6 @@ char *DefaultFontName;
#define gray_height 2
static char gray_bits[] = {0x02, 0x01};
-/* List borrowed from 9wm/rio */
-char *tryfonts[] = {
- "9x15bold",
- "*-lucidatypewriter-bold-*-14-*-75-*",
- "*-lucidatypewriter-medium-*-12-*-75-*",
- "fixed",
- "*",
- NULL,
-};
static void _sigchld_cb(int);
@@ -140,15 +130,6 @@ x_setup(char *display_name)
Doshape = XShapeQueryExtension(X_Dpy, &Shape_ev, &i);
- i = 0;
- while ((fontname = tryfonts[i++]) != NULL) {
- if ((X_Font = XLoadQueryFont(X_Dpy, fontname)) != NULL)
- break;
- }
-
- if (fontname == NULL)
- errx(1, "Couldn't load any fonts.");
-
Nscreens = ScreenCount(X_Dpy);
for (i = 0; i < (int)Nscreens; i++) {
XMALLOC(sc, struct screen_ctx);
@@ -158,13 +139,12 @@ x_setup(char *display_name)
Cursor_move = XCreateFontCursor(X_Dpy, XC_fleur);
Cursor_resize = XCreateFontCursor(X_Dpy, XC_bottom_right_corner);
- /* (used to be) XCreateFontCursor(X_Dpy, XC_hand1); */
Cursor_select = XCreateFontCursor(X_Dpy, XC_hand1);
Cursor_default = XCreateFontCursor(X_Dpy, XC_X_cursor);
Cursor_question = XCreateFontCursor(X_Dpy, XC_question_arrow);
}
-int
+void
x_setupscreen(struct screen_ctx *sc, u_int which)
{
XColor tmp;
@@ -196,10 +176,6 @@ x_setupscreen(struct screen_ctx *sc, u_int which)
TAILQ_FOREACH(kb, &Conf.keybindingq, entry)
xu_key_grab(sc->rootwin, kb->modmask, kb->keysym);
- /* Special -- for alt state. */
-/* xu_key_grab(sc->rootwin, 0, XK_Alt_L); */
-/* xu_key_grab(sc->rootwin, 0, XK_Alt_R); */
-
sc->blackpixl = BlackPixel(X_Dpy, sc->which);
sc->whitepixl = WhitePixel(X_Dpy, sc->which);
sc->bluepixl = sc->fccolor.pixel;
@@ -223,32 +199,21 @@ x_setupscreen(struct screen_ctx *sc, u_int which)
gv.function = GXxor;
gv.line_width = 1;
gv.subwindow_mode = IncludeInferiors;
- gv.font = X_Font->fid;
sc->gc = XCreateGC(X_Dpy, sc->rootwin,
GCForeground|GCBackground|GCFunction|
- GCLineWidth|GCSubwindowMode|GCFont, &gv);
-
-#ifdef notyet
- gv2.foreground = sc->blackpixl^sc->cyanpixl;
- gv2.background = sc->cyanpixl;
- gv2.function = GXxor;
- gv2.line_width = 1;
- gv2.subwindow_mode = IncludeInferiors;
- gv2.font = X_Font->fid;
-#endif
+ GCLineWidth|GCSubwindowMode, &gv);
sc->hlgc = XCreateGC(X_Dpy, sc->rootwin,
GCForeground|GCBackground|GCFunction|
- GCLineWidth|GCSubwindowMode|GCFont, &gv);
+ GCLineWidth|GCSubwindowMode, &gv);
gv1.function = GXinvert;
gv1.subwindow_mode = IncludeInferiors;
gv1.line_width = 1;
- gv1.font = X_Font->fid;
sc->invgc = XCreateGC(X_Dpy, sc->rootwin,
- GCFunction|GCSubwindowMode|GCLineWidth|GCFont, &gv1);
+ GCFunction|GCSubwindowMode|GCLineWidth, &gv1);
font_init(sc);
DefaultFont = font_getx(sc, DefaultFontName);
@@ -290,7 +255,7 @@ x_setupscreen(struct screen_ctx *sc, u_int which)
XSync(X_Dpy, False);
- return (0);
+ return;
}
char *
diff --git a/app/cwm/calmwm.h b/app/cwm/calmwm.h
index a212218f7..50e7c3329 100644
--- a/app/cwm/calmwm.h
+++ b/app/cwm/calmwm.h
@@ -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.
*
- * $Id: calmwm.h,v 1.18 2008/01/14 15:21:10 oga Exp $
+ * $Id: calmwm.h,v 1.19 2008/01/16 11:39:20 oga Exp $
*/
#ifndef _CALMWM_H_
@@ -311,8 +311,7 @@ int input_keycodetrans(KeyCode, u_int, enum ctltype *, char *, int);
int x_errorhandler(Display *, XErrorEvent *);
void x_setup(char *display_name);
char *x_screenname(int);
-void x_loop(void);
-int x_setupscreen(struct screen_ctx *, u_int);
+void x_setupscreen(struct screen_ctx *, u_int);
struct client_ctx *client_find(Window);
void client_setup(void);
@@ -397,8 +396,8 @@ int dirent_isdir(char *);
int dirent_islink(char *);
int u_spawn(char *);
-int grab_sweep(struct client_ctx *);
-int grab_drag(struct client_ctx *);
+void grab_sweep(struct client_ctx *);
+void grab_drag(struct client_ctx *);
void grab_menuinit(struct screen_ctx *);
void *grab_menu(XButtonEvent *, struct menu_q *);
void grab_label(struct client_ctx *);
@@ -472,8 +471,7 @@ void search_match_exec(struct menu_q *, struct menu_q *, char *);
void search_rank_text(struct menu_q *, char *);
void group_init(void);
-int group_new(void);
-int group_select(int);
+void group_select(int);
void group_enter(void);
void group_exit(int);
void group_click(struct client_ctx *);
@@ -509,7 +507,6 @@ struct fontdesc *font_getx(struct screen_ctx *sc, const char *name);
/* Externs */
extern Display *X_Dpy;
-extern XFontStruct *X_Font;
extern Cursor Cursor_move;
extern Cursor Cursor_resize;
diff --git a/app/cwm/client.c b/app/cwm/client.c
index c22dd4e58..c01f11bd5 100644
--- a/app/cwm/client.c
+++ b/app/cwm/client.c
@@ -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.
*
- * $Id: client.c,v 1.10 2008/01/11 16:06:44 oga Exp $
+ * $Id: client.c,v 1.11 2008/01/16 11:39:20 oga Exp $
*/
#include "headers.h"
@@ -267,15 +267,6 @@ client_leave(struct client_ctx *cc)
}
void
-client_nocurrent(void)
-{
- if (_curcc != NULL)
- client_setactive(_curcc, 0);
-
- _curcc = NULL;
-}
-
-void
client_setactive(struct client_ctx *cc, int fg)
{
struct screen_ctx* sc;
@@ -362,19 +353,6 @@ client_maximize(struct client_ctx *cc)
}
void
-client_push_geometry(struct client_ctx *cc)
-{
- cc->savegeom = cc->geom;
-}
-
-void
-client_restore_geometry(struct client_ctx *cc)
-{
- cc->geom = cc->savegeom;
- client_resize(cc);
-}
-
-void
client_resize(struct client_ctx *cc)
{
XMoveResizeWindow(X_Dpy, cc->pwin, cc->geom.x - cc->bwidth,
@@ -408,13 +386,6 @@ client_raise(struct client_ctx *cc)
}
void
-client_warp(struct client_ctx *cc)
-{
- client_raise(cc);
- xu_ptr_setpos(cc->pwin, 0, 0);
-}
-
-void
client_ptrwarp(struct client_ctx *cc)
{
int x = cc->ptr.x, y = cc->ptr.y;
@@ -880,13 +851,6 @@ client_vertmaximize(struct client_ctx *cc)
}
void
-client_map(struct client_ctx *cc)
-{
- /* mtf? */
- client_ptrwarp(cc);
-}
-
-void
client_mtf(struct client_ctx *cc)
{
struct screen_ctx *sc;
diff --git a/app/cwm/conf.c b/app/cwm/conf.c
index 736daeaaa..6fb9f3b20 100644
--- a/app/cwm/conf.c
+++ b/app/cwm/conf.c
@@ -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.
*
- * $Id: conf.c,v 1.19 2008/01/11 16:06:44 oga Exp $
+ * $Id: conf.c,v 1.20 2008/01/16 11:39:20 oga Exp $
*/
#include "headers.h"
@@ -327,19 +327,6 @@ conf_get_int(struct client_ctx *cc, enum conftype ctype)
return (val);
}
-char *
-conf_get_str(struct client_ctx *cc, enum conftype ctype)
-{
- switch (ctype) {
- case CONF_NOTIFIER:
- return xstrdup("./notifier.py"); /* XXX */
- break;
- default:
- break;
- }
- return NULL;
-}
-
void
conf_client(struct client_ctx *cc)
{
@@ -410,23 +397,6 @@ struct {
};
void
-conf_bindkey(struct conf *c, void (*arg_callback)(struct client_ctx *, void *),
- int arg_keysym, int arg_modmask, int arg_flags, void * arg_arg)
-{
- struct keybinding *kb;
-
- XMALLOC(kb, struct keybinding);
-
- kb->modmask = arg_modmask;
- kb->keysym = arg_keysym;
- kb->keycode = 0;
- kb->flags = arg_flags;
- kb->callback = arg_callback;
- kb->argument = arg_arg;
- TAILQ_INSERT_TAIL(&c->keybindingq, kb, entry);
-}
-
-void
conf_parsekeys(struct conf *c, char *filename)
{
DIR *dir;
diff --git a/app/cwm/grab.c b/app/cwm/grab.c
index ac8e2a91e..6a79e76e6 100644
--- a/app/cwm/grab.c
+++ b/app/cwm/grab.c
@@ -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.
*
- * $Id: grab.c,v 1.7 2008/01/14 15:21:10 oga Exp $
+ * $Id: grab.c,v 1.8 2008/01/16 11:39:20 oga Exp $
*/
#include "headers.h"
@@ -53,7 +53,7 @@ grab_sweep_draw(struct client_ctx *cc, int dx, int dy)
wide/2 - wide_size/2, height + font_ascent(font) + 1);
}
-int
+void
grab_sweep(struct client_ctx *cc)
{
XEvent ev;
@@ -68,7 +68,7 @@ grab_sweep(struct client_ctx *cc)
client_ptrsave(cc);
if (xu_ptr_grab(sc->rootwin, MouseMask, Cursor_resize) < 0)
- return (-1);
+ return;
xu_ptr_setpos(cc->win, cc->geom.width, cc->geom.height);
grab_sweep_draw(cc, dx, dy);
@@ -101,13 +101,13 @@ grab_sweep(struct client_ctx *cc)
XReparentWindow(X_Dpy, sc->menuwin, sc->rootwin, 0, 0);
xu_ptr_ungrab();
client_ptrwarp(cc);
- return (0);
+ return;
}
}
/* NOTREACHED */
}
-int
+void
grab_drag(struct client_ctx *cc)
{
int x0 = cc->geom.x, y0 = cc->geom.y, xm, ym;
@@ -117,7 +117,7 @@ grab_drag(struct client_ctx *cc)
client_raise(cc);
if (xu_ptr_grab(sc->rootwin, MouseMask, Cursor_move) < 0)
- return (-1);
+ return;
xu_ptr_getpos(sc->rootwin, &xm, &ym);
@@ -138,7 +138,7 @@ grab_drag(struct client_ctx *cc)
break;
case ButtonRelease:
xu_ptr_ungrab();
- return (0);
+ return;
}
}
/* NOTREACHED */
@@ -219,9 +219,7 @@ grab_menu(XButtonEvent *e, struct menu_q *menuq)
sc->menuwin, fx, fy);
i++;
}
- if (entry != -1)
- XFillRectangle(X_Dpy, sc->menuwin, sc->hlgc,
- 0, entry*height, width, height);
+ /* FALLTHROUGH */
case MotionNotify:
prev = entry;
entry = menu_calc_entry(event.xbutton.x,
@@ -320,7 +318,7 @@ grab_label(struct client_ctx *cc)
xfree(cc->label);
cc->label = xstrdup(labelstr);
-
+ /* FALLTHROUGH */
case CTL_ABORT:
goto out;
default:
diff --git a/app/cwm/group.c b/app/cwm/group.c
index 8147fa8a9..26c0acd30 100644
--- a/app/cwm/group.c
+++ b/app/cwm/group.c
@@ -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.
*
- * $Id: group.c,v 1.4 2008/01/14 15:21:10 oga Exp $
+ * $Id: group.c,v 1.5 2008/01/16 11:39:20 oga Exp $
*/
#include "headers.h"
@@ -197,36 +197,15 @@ group_init(void)
* manipulate the 'current group'
*/
-#if 0
-/* set current group to the first empty group
- * returns 0 on success, -1 if there are no empty groups
- */
-int
-group_new(void)
-{
- int i;
-
- for (i=0; i < CALMWM_NGROUPS; i++) {
- if (TAILQ_EMPTY(&Groups[i].clients)) {
- Group_current = &Groups[i];
-
- return (0);
- }
- }
-
- return (-1);
-}
-#endif
-
/* change the current group */
-int
+void
group_select(int idx)
{
struct group_ctx *gc = Group_current;
struct client_ctx *cc;
if (idx < 0 || idx >= CALMWM_NGROUPS)
- return (-1);
+ return;
TAILQ_FOREACH(cc, &gc->clients, group_entry) {
cc->highlight = 0;
@@ -237,7 +216,7 @@ group_select(int idx)
Group_current = &Groups[idx];
group_display_draw(screen_current());
- return (0);
+ return;
}
/* enter group mode */
@@ -353,7 +332,7 @@ void
group_display_draw(struct screen_ctx *sc)
{
struct group_ctx *gc = Group_current;
- int x, y, dx, dy, fontheight, titlelen;
+ int x, y, dx, dy, fontheight;
struct client_ctx *cc;
char titlebuf[1024];
struct fontdesc *font = DefaultFont;
@@ -363,7 +342,7 @@ group_display_draw(struct screen_ctx *sc)
x = y = 0;
fontheight = font_ascent(font) + font_descent(font) + 1;
- dx = titlelen = font_width(font, titlebuf, strlen(titlebuf));
+ dx = font_width(font, titlebuf, strlen(titlebuf));
dy = fontheight;
TAILQ_FOREACH(cc, &gc->clients, group_entry) {
diff --git a/app/cwm/kbfunc.c b/app/cwm/kbfunc.c
index 5ab243e11..2eee457a6 100644
--- a/app/cwm/kbfunc.c
+++ b/app/cwm/kbfunc.c
@@ -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.
*
- * $Id: kbfunc.c,v 1.12 2008/01/11 16:06:44 oga Exp $
+ * $Id: kbfunc.c,v 1.13 2008/01/16 11:39:20 oga Exp $
*/
#include <paths.h>
@@ -171,7 +171,6 @@ kbfunc_client_search(struct client_ctx *scratch, void *arg)
TAILQ_INIT(&menuq);
TAILQ_FOREACH(cc, &Clientq, entry) {
- struct menu *mi;
XCALLOC(mi, struct menu);
strlcpy(mi->text, cc->name, sizeof(mi->text));
mi->ctx = cc;
diff --git a/app/cwm/search.c b/app/cwm/search.c
index ffeec07e6..cc091ddee 100644
--- a/app/cwm/search.c
+++ b/app/cwm/search.c
@@ -14,7 +14,7 @@
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
- * $Id: search.c,v 1.5 2008/01/11 16:06:44 oga Exp $
+ * $Id: search.c,v 1.6 2008/01/16 11:39:20 oga Exp $
*/
#include "headers.h"
@@ -457,12 +457,6 @@ search_match_exec(struct menu_q *menuq, struct menu_q *resultq, char *search)
TAILQ_INSERT_TAIL(resultq, mi, resultentry);
}
-void
-search_rank_text(struct menu_q *resultq, char *search)
-{
- return;
-}
-
static int
_strsubmatch(char *sub, char *str, int zeroidx)
{
diff --git a/app/cwm/util.c b/app/cwm/util.c
index 31e6c30bc..b7002e308 100644
--- a/app/cwm/util.c
+++ b/app/cwm/util.c
@@ -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.
*
- * $Id: util.c,v 1.3 2008/01/11 16:06:44 oga Exp $
+ * $Id: util.c,v 1.4 2008/01/16 11:39:20 oga Exp $
*/
#include "headers.h"
@@ -65,13 +65,6 @@ exec_wm(char *argstr)
err(1, args[0]);
}
-
-int dirent_exists(char *filename) {
- struct stat buffer;
-
- return stat(filename, &buffer);
-}
-
int dirent_isdir(char *filename) {
struct stat buffer;
int return_value;
diff --git a/app/cwm/xevents.c b/app/cwm/xevents.c
index 6f59c20b3..bf505ce5f 100644
--- a/app/cwm/xevents.c
+++ b/app/cwm/xevents.c
@@ -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.
*
- * $Id: xevents.c,v 1.3 2008/01/11 16:06:44 oga Exp $
+ * $Id: xevents.c,v 1.4 2008/01/16 11:39:20 oga Exp $
*/
/*
@@ -27,8 +27,6 @@
#include "headers.h"
#include "calmwm.h"
-void _sendxmsg(Window, Atom, long);
-
/*
* NOTE: in reality, many of these should move to client.c now that
* we've got this nice event layer.
diff --git a/app/cwm/xutil.c b/app/cwm/xutil.c
index b74b3f78c..59efd819d 100644
--- a/app/cwm/xutil.c
+++ b/app/cwm/xutil.c
@@ -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.
*
- * $Id: xutil.c,v 1.3 2008/01/11 16:06:44 oga Exp $
+ * $Id: xutil.c,v 1.4 2008/01/16 11:39:20 oga Exp $
*/
#include "headers.h"
@@ -84,16 +84,6 @@ xu_key_grab(Window win, int mask, int keysym)
XGrabKey(X_Dpy, XKeysymToKeycode(X_Dpy, keysym), mask, win, True,
GrabModeAsync, GrabModeAsync);
-#if 0
- XGrabKey(X_Dpy, XKeysymToKeycode(X_Dpy, keysym), LockMask|mask,
- win, True, GrabModeAsync, GrabModeAsync);
-#endif
-}
-
-void
-xu_key_grab_keycode(Window win, int mask, int keycode)
-{
- XGrabKey(X_Dpy, keycode, mask, win, True, GrabModeAsync, GrabModeAsync);
}
void
@@ -144,17 +134,6 @@ xu_getstate(struct client_ctx *cc, int *state)
return (0);
}
-char *
-xu_getstrprop(struct client_ctx *cc, Atom atm)
-{
- u_char *cp;
-
- if (xu_getprop(cc, atm, XA_STRING, 100L, &cp) <= 0)
- return (NULL);
-
- return ((char *)cp);
-}
-
void
xu_setstate(struct client_ctx *cc, int state)
{