mirror of
https://github.com/leahneukirchen/cwm.git
synced 2023-08-10 21:13:12 +03:00
static local functions and data; almost identical diff from Thomas Pfaff
ok oga@
This commit is contained in:
parent
b13d592c57
commit
f44862be9c
13
calmwm.c
13
calmwm.c
@ -40,6 +40,7 @@ struct conf Conf;
|
|||||||
|
|
||||||
static void sigchld_cb(int);
|
static void sigchld_cb(int);
|
||||||
static void dpy_init(const char *);
|
static void dpy_init(const char *);
|
||||||
|
static int x_errorhandler(Display *, XErrorEvent *);
|
||||||
static void x_setup(void);
|
static void x_setup(void);
|
||||||
static void x_setupscreen(struct screen_ctx *, u_int);
|
static void x_setupscreen(struct screen_ctx *, u_int);
|
||||||
static void x_teardown(void);
|
static void x_teardown(void);
|
||||||
@ -89,7 +90,7 @@ main(int argc, char **argv)
|
|||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
static void
|
||||||
dpy_init(const char *dpyname)
|
dpy_init(const char *dpyname)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
@ -103,7 +104,7 @@ dpy_init(const char *dpyname)
|
|||||||
HasRandr = XRRQueryExtension(X_Dpy, &Randr_ev, &i);
|
HasRandr = XRRQueryExtension(X_Dpy, &Randr_ev, &i);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
static void
|
||||||
x_setup(void)
|
x_setup(void)
|
||||||
{
|
{
|
||||||
struct screen_ctx *sc;
|
struct screen_ctx *sc;
|
||||||
@ -130,7 +131,7 @@ x_setup(void)
|
|||||||
Cursor_question = XCreateFontCursor(X_Dpy, XC_question_arrow);
|
Cursor_question = XCreateFontCursor(X_Dpy, XC_question_arrow);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
static void
|
||||||
x_teardown(void)
|
x_teardown(void)
|
||||||
{
|
{
|
||||||
struct screen_ctx *sc;
|
struct screen_ctx *sc;
|
||||||
@ -141,7 +142,7 @@ x_teardown(void)
|
|||||||
XCloseDisplay(X_Dpy);
|
XCloseDisplay(X_Dpy);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
static void
|
||||||
x_setupscreen(struct screen_ctx *sc, u_int which)
|
x_setupscreen(struct screen_ctx *sc, u_int which)
|
||||||
{
|
{
|
||||||
Window *wins, w0, w1;
|
Window *wins, w0, w1;
|
||||||
@ -200,11 +201,9 @@ x_setupscreen(struct screen_ctx *sc, u_int which)
|
|||||||
screen_init_xinerama(sc);
|
screen_init_xinerama(sc);
|
||||||
|
|
||||||
XSync(X_Dpy, False);
|
XSync(X_Dpy, False);
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
static int
|
||||||
x_errorhandler(Display *dpy, XErrorEvent *e)
|
x_errorhandler(Display *dpy, XErrorEvent *e)
|
||||||
{
|
{
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
|
9
calmwm.h
9
calmwm.h
@ -324,7 +324,6 @@ struct mwm_hints {
|
|||||||
int input_keycodetrans(KeyCode, u_int, enum ctltype *,
|
int input_keycodetrans(KeyCode, u_int, enum ctltype *,
|
||||||
char *);
|
char *);
|
||||||
|
|
||||||
int x_errorhandler(Display *, XErrorEvent *);
|
|
||||||
__dead void usage(void);
|
__dead void usage(void);
|
||||||
|
|
||||||
struct client_ctx *client_find(Window);
|
struct client_ctx *client_find(Window);
|
||||||
@ -346,17 +345,11 @@ void client_warp(struct client_ctx *);
|
|||||||
void client_ptrwarp(struct client_ctx *);
|
void client_ptrwarp(struct client_ctx *);
|
||||||
void client_ptrsave(struct client_ctx *);
|
void client_ptrsave(struct client_ctx *);
|
||||||
void client_draw_border(struct client_ctx *);
|
void client_draw_border(struct client_ctx *);
|
||||||
void client_update(struct client_ctx *);
|
|
||||||
void client_placecalc(struct client_ctx *);
|
|
||||||
void client_maximize(struct client_ctx *);
|
void client_maximize(struct client_ctx *);
|
||||||
void client_vertmaximize(struct client_ctx *);
|
void client_vertmaximize(struct client_ctx *);
|
||||||
void client_map(struct client_ctx *);
|
void client_map(struct client_ctx *);
|
||||||
void client_mtf(struct client_ctx *);
|
void client_mtf(struct client_ctx *);
|
||||||
struct client_ctx *client_cycle(int);
|
struct client_ctx *client_cycle(int);
|
||||||
struct client_ctx *client_mrunext(struct client_ctx *);
|
|
||||||
struct client_ctx *client_mruprev(struct client_ctx *);
|
|
||||||
void client_gethints(struct client_ctx *);
|
|
||||||
void client_freehints(struct client_ctx *);
|
|
||||||
|
|
||||||
struct menu *menu_filter(struct menu_q *, char *, char *, int,
|
struct menu *menu_filter(struct menu_q *, char *, char *, int,
|
||||||
void (*)(struct menu_q *, struct menu_q *, char *),
|
void (*)(struct menu_q *, struct menu_q *, char *),
|
||||||
@ -407,9 +400,7 @@ void conf_client(struct client_ctx *);
|
|||||||
void conf_grab(struct conf *, struct keybinding *);
|
void conf_grab(struct conf *, struct keybinding *);
|
||||||
void conf_ungrab(struct conf *, struct keybinding *);
|
void conf_ungrab(struct conf *, struct keybinding *);
|
||||||
void conf_bindname(struct conf *, char *, char *);
|
void conf_bindname(struct conf *, char *, char *);
|
||||||
void conf_unbind(struct conf *, struct keybinding *);
|
|
||||||
void conf_mousebind(struct conf *, char *, char *);
|
void conf_mousebind(struct conf *, char *, char *);
|
||||||
void conf_mouseunbind(struct conf *, struct mousebinding *);
|
|
||||||
void conf_grab_mouse(struct client_ctx *);
|
void conf_grab_mouse(struct client_ctx *);
|
||||||
void conf_reload(struct conf *);
|
void conf_reload(struct conf *);
|
||||||
void conf_font(struct conf *);
|
void conf_font(struct conf *);
|
||||||
|
20
client.c
20
client.c
@ -21,7 +21,13 @@
|
|||||||
#include "headers.h"
|
#include "headers.h"
|
||||||
#include "calmwm.h"
|
#include "calmwm.h"
|
||||||
|
|
||||||
static int client_inbound(struct client_ctx *, int, int);
|
static struct client_ctx *client_mrunext(struct client_ctx *);
|
||||||
|
static struct client_ctx *client_mruprev(struct client_ctx *);
|
||||||
|
static void client_placecalc(struct client_ctx *);
|
||||||
|
static void client_update(struct client_ctx *);
|
||||||
|
static void client_gethints(struct client_ctx *);
|
||||||
|
static void client_freehints(struct client_ctx *);
|
||||||
|
static int client_inbound(struct client_ctx *, int, int);
|
||||||
|
|
||||||
static char emptystring[] = "";
|
static char emptystring[] = "";
|
||||||
struct client_ctx *_curcc = NULL;
|
struct client_ctx *_curcc = NULL;
|
||||||
@ -407,7 +413,7 @@ client_draw_border(struct client_ctx *cc)
|
|||||||
XSetWindowBorder(X_Dpy, cc->win, pixel);
|
XSetWindowBorder(X_Dpy, cc->win, pixel);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
static void
|
||||||
client_update(struct client_ctx *cc)
|
client_update(struct client_ctx *cc)
|
||||||
{
|
{
|
||||||
Atom *p;
|
Atom *p;
|
||||||
@ -522,7 +528,7 @@ client_cycle(int reverse)
|
|||||||
return (newcc);
|
return (newcc);
|
||||||
}
|
}
|
||||||
|
|
||||||
struct client_ctx *
|
static struct client_ctx *
|
||||||
client_mrunext(struct client_ctx *cc)
|
client_mrunext(struct client_ctx *cc)
|
||||||
{
|
{
|
||||||
struct screen_ctx *sc = CCTOSC(cc);
|
struct screen_ctx *sc = CCTOSC(cc);
|
||||||
@ -532,7 +538,7 @@ client_mrunext(struct client_ctx *cc)
|
|||||||
ccc : TAILQ_FIRST(&sc->mruq));
|
ccc : TAILQ_FIRST(&sc->mruq));
|
||||||
}
|
}
|
||||||
|
|
||||||
struct client_ctx *
|
static struct client_ctx *
|
||||||
client_mruprev(struct client_ctx *cc)
|
client_mruprev(struct client_ctx *cc)
|
||||||
{
|
{
|
||||||
struct screen_ctx *sc = CCTOSC(cc);
|
struct screen_ctx *sc = CCTOSC(cc);
|
||||||
@ -542,7 +548,7 @@ client_mruprev(struct client_ctx *cc)
|
|||||||
ccc : TAILQ_LAST(&sc->mruq, cycle_entry_q));
|
ccc : TAILQ_LAST(&sc->mruq, cycle_entry_q));
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
static void
|
||||||
client_placecalc(struct client_ctx *cc)
|
client_placecalc(struct client_ctx *cc)
|
||||||
{
|
{
|
||||||
struct screen_ctx *sc = CCTOSC(cc);
|
struct screen_ctx *sc = CCTOSC(cc);
|
||||||
@ -629,7 +635,7 @@ client_mtf(struct client_ctx *cc)
|
|||||||
TAILQ_INSERT_HEAD(&sc->mruq, cc, mru_entry);
|
TAILQ_INSERT_HEAD(&sc->mruq, cc, mru_entry);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
static void
|
||||||
client_gethints(struct client_ctx *cc)
|
client_gethints(struct client_ctx *cc)
|
||||||
{
|
{
|
||||||
XClassHint xch;
|
XClassHint xch;
|
||||||
@ -675,7 +681,7 @@ client_gethints(struct client_ctx *cc)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
static void
|
||||||
client_freehints(struct client_ctx *cc)
|
client_freehints(struct client_ctx *cc)
|
||||||
{
|
{
|
||||||
if (cc->app_name != NULL)
|
if (cc->app_name != NULL)
|
||||||
|
11
conf.c
11
conf.c
@ -28,6 +28,9 @@
|
|||||||
((tsp)->tv_sec cmp (usp)->tv_sec))
|
((tsp)->tv_sec cmp (usp)->tv_sec))
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
static void conf_mouseunbind(struct conf *, struct mousebinding *);
|
||||||
|
static void conf_unbind(struct conf *, struct keybinding *);
|
||||||
|
|
||||||
extern struct screen_ctx *Curscreen;
|
extern struct screen_ctx *Curscreen;
|
||||||
|
|
||||||
/* Add an command menu entry to the end of the menu */
|
/* Add an command menu entry to the end of the menu */
|
||||||
@ -278,7 +281,7 @@ conf_client(struct client_ctx *cc)
|
|||||||
cc->flags |= ignore ? CLIENT_IGNORE : 0;
|
cc->flags |= ignore ? CLIENT_IGNORE : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
struct {
|
static struct {
|
||||||
char *tag;
|
char *tag;
|
||||||
void (*handler)(struct client_ctx *, union arg *);
|
void (*handler)(struct client_ctx *, union arg *);
|
||||||
int flags;
|
int flags;
|
||||||
@ -493,7 +496,7 @@ conf_bindname(struct conf *c, char *name, char *binding)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
static void
|
||||||
conf_unbind(struct conf *c, struct keybinding *unbind)
|
conf_unbind(struct conf *c, struct keybinding *unbind)
|
||||||
{
|
{
|
||||||
struct keybinding *key = NULL, *keynxt;
|
struct keybinding *key = NULL, *keynxt;
|
||||||
@ -515,7 +518,7 @@ conf_unbind(struct conf *c, struct keybinding *unbind)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
struct {
|
static struct {
|
||||||
char *tag;
|
char *tag;
|
||||||
void (*handler)(struct client_ctx *, void *);
|
void (*handler)(struct client_ctx *, void *);
|
||||||
int context;
|
int context;
|
||||||
@ -583,7 +586,7 @@ conf_mousebind(struct conf *c, char *name, char *binding)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
static void
|
||||||
conf_mouseunbind(struct conf *c, struct mousebinding *unbind)
|
conf_mouseunbind(struct conf *c, struct mousebinding *unbind)
|
||||||
{
|
{
|
||||||
struct mousebinding *mb = NULL, *mbnxt;
|
struct mousebinding *mb = NULL, *mbnxt;
|
||||||
|
6
menu.c
6
menu.c
@ -43,7 +43,7 @@ static struct menu *menu_handle_key(XEvent *, struct menu_ctx *,
|
|||||||
struct menu_q *, struct menu_q *);
|
struct menu_q *, struct menu_q *);
|
||||||
static void menu_handle_move(XEvent *, struct menu_ctx *,
|
static void menu_handle_move(XEvent *, struct menu_ctx *,
|
||||||
struct screen_ctx *);
|
struct screen_ctx *);
|
||||||
struct menu *menu_handle_release(XEvent *, struct menu_ctx *,
|
static struct menu *menu_handle_release(XEvent *, struct menu_ctx *,
|
||||||
struct screen_ctx *, struct menu_q *);
|
struct screen_ctx *, struct menu_q *);
|
||||||
static void menu_draw(struct screen_ctx *, struct menu_ctx *,
|
static void menu_draw(struct screen_ctx *, struct menu_ctx *,
|
||||||
struct menu_q *, struct menu_q *);
|
struct menu_q *, struct menu_q *);
|
||||||
@ -349,7 +349,7 @@ menu_draw(struct screen_ctx *sc, struct menu_ctx *mc, struct menu_q *menuq,
|
|||||||
0, 0, mc->width, font_height());
|
0, 0, mc->width, font_height());
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
static void
|
||||||
menu_handle_move(XEvent *e, struct menu_ctx *mc, struct screen_ctx *sc)
|
menu_handle_move(XEvent *e, struct menu_ctx *mc, struct screen_ctx *sc)
|
||||||
{
|
{
|
||||||
mc->prev = mc->entry;
|
mc->prev = mc->entry;
|
||||||
@ -366,7 +366,7 @@ menu_handle_move(XEvent *e, struct menu_ctx *mc, struct screen_ctx *sc)
|
|||||||
xu_ptr_regrab(MenuGrabMask, Cursor_default);
|
xu_ptr_regrab(MenuGrabMask, Cursor_default);
|
||||||
}
|
}
|
||||||
|
|
||||||
struct menu *
|
static struct menu *
|
||||||
menu_handle_release(XEvent *e, struct menu_ctx *mc, struct screen_ctx *sc,
|
menu_handle_release(XEvent *e, struct menu_ctx *mc, struct screen_ctx *sc,
|
||||||
struct menu_q *resultq)
|
struct menu_q *resultq)
|
||||||
{
|
{
|
||||||
|
1
screen.c
1
screen.c
@ -21,7 +21,6 @@
|
|||||||
#include "headers.h"
|
#include "headers.h"
|
||||||
#include "calmwm.h"
|
#include "calmwm.h"
|
||||||
|
|
||||||
extern struct screen_ctx_q Screenq;
|
|
||||||
extern struct screen_ctx *Curscreen;
|
extern struct screen_ctx *Curscreen;
|
||||||
|
|
||||||
void
|
void
|
||||||
|
2
xutil.c
2
xutil.c
@ -21,7 +21,7 @@
|
|||||||
#include "headers.h"
|
#include "headers.h"
|
||||||
#include "calmwm.h"
|
#include "calmwm.h"
|
||||||
|
|
||||||
unsigned int ign_mods[] = { 0, LockMask, Mod2Mask, Mod2Mask | LockMask };
|
static unsigned int ign_mods[] = { 0, LockMask, Mod2Mask, Mod2Mask | LockMask };
|
||||||
|
|
||||||
int
|
int
|
||||||
xu_ptr_grab(Window win, int mask, Cursor curs)
|
xu_ptr_grab(Window win, int mask, Cursor curs)
|
||||||
|
Loading…
Reference in New Issue
Block a user