unroll the CCTOSC macro; from Thomas Pfaff

ok oga@
This commit is contained in:
okan 2009-08-27 01:38:08 +00:00
parent b9f8367089
commit 7295c51155
4 changed files with 14 additions and 16 deletions

View File

@ -491,8 +491,6 @@ XftFont *font_make(struct screen_ctx *, const char *);
#define font_descent() Conf.DefaultFont->descent #define font_descent() Conf.DefaultFont->descent
#define font_height() Conf.FontHeight #define font_height() Conf.FontHeight
#define CCTOSC(cc) (cc->sc)
/* Externs */ /* Externs */
extern Display *X_Dpy; extern Display *X_Dpy;

View File

@ -126,7 +126,7 @@ client_new(Window win, struct screen_ctx *sc, int mapped)
int int
client_delete(struct client_ctx *cc) client_delete(struct client_ctx *cc)
{ {
struct screen_ctx *sc = CCTOSC(cc); struct screen_ctx *sc = cc->sc;
struct winname *wn; struct winname *wn;
group_client_delete(cc); group_client_delete(cc);
@ -169,7 +169,7 @@ client_leave(struct client_ctx *cc)
if (cc == NULL) if (cc == NULL)
return; return;
sc = CCTOSC(cc); sc = cc->sc;
xu_btn_ungrab(sc->rootwin, AnyModifier, Button1); xu_btn_ungrab(sc->rootwin, AnyModifier, Button1);
} }
@ -183,7 +183,7 @@ client_setactive(struct client_ctx *cc, int fg)
if (cc == NULL) if (cc == NULL)
return; return;
sc = CCTOSC(cc); sc = cc->sc;
if (fg) { if (fg) {
XInstallColormap(X_Dpy, cc->cmap); XInstallColormap(X_Dpy, cc->cmap);
@ -217,7 +217,7 @@ client_current(void)
void void
client_maximize(struct client_ctx *cc) client_maximize(struct client_ctx *cc)
{ {
struct screen_ctx *sc = CCTOSC(cc); struct screen_ctx *sc = cc->sc;
int xmax = sc->xmax, ymax = sc->ymax; int xmax = sc->xmax, ymax = sc->ymax;
int x_org = 0, y_org = 0; int x_org = 0, y_org = 0;
@ -257,7 +257,7 @@ calc:
void void
client_vertmaximize(struct client_ctx *cc) client_vertmaximize(struct client_ctx *cc)
{ {
struct screen_ctx *sc = CCTOSC(cc); struct screen_ctx *sc = cc->sc;
int y_org = 0, ymax = sc->ymax; int y_org = 0, ymax = sc->ymax;
if (cc->flags & CLIENT_VMAXIMIZED) { if (cc->flags & CLIENT_VMAXIMIZED) {
@ -288,7 +288,7 @@ calc:
void void
client_horizmaximize(struct client_ctx *cc) client_horizmaximize(struct client_ctx *cc)
{ {
struct screen_ctx *sc = CCTOSC(cc); struct screen_ctx *sc = cc->sc;
int x_org = 0, xmax = sc->xmax; int x_org = 0, xmax = sc->xmax;
if (cc->flags & CLIENT_HMAXIMIZED) { if (cc->flags & CLIENT_HMAXIMIZED) {
@ -411,7 +411,7 @@ client_unhide(struct client_ctx *cc)
void void
client_draw_border(struct client_ctx *cc) client_draw_border(struct client_ctx *cc)
{ {
struct screen_ctx *sc = CCTOSC(cc); struct screen_ctx *sc = cc->sc;
unsigned long pixel; unsigned long pixel;
if (cc->active) if (cc->active)
@ -551,7 +551,7 @@ client_cycle(int reverse)
static 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 = cc->sc;
struct client_ctx *ccc; struct client_ctx *ccc;
return ((ccc = TAILQ_NEXT(cc, mru_entry)) != NULL ? return ((ccc = TAILQ_NEXT(cc, mru_entry)) != NULL ?
@ -561,7 +561,7 @@ client_mrunext(struct client_ctx *cc)
static 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 = cc->sc;
struct client_ctx *ccc; struct client_ctx *ccc;
return ((ccc = TAILQ_PREV(cc, cycle_entry_q, mru_entry)) != NULL ? return ((ccc = TAILQ_PREV(cc, cycle_entry_q, mru_entry)) != NULL ?
@ -571,7 +571,7 @@ client_mruprev(struct client_ctx *cc)
static 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 = cc->sc;
int xslack, yslack; int xslack, yslack;
if (cc->size->flags & USPosition) { if (cc->size->flags & USPosition) {
@ -648,7 +648,7 @@ client_mtf(struct client_ctx *cc)
if (cc == NULL) if (cc == NULL)
return; return;
sc = CCTOSC(cc); sc = cc->sc;
/* Move to front. */ /* Move to front. */
TAILQ_REMOVE(&sc->mruq, cc, mru_entry); TAILQ_REMOVE(&sc->mruq, cc, mru_entry);

View File

@ -44,7 +44,7 @@ mousefunc_sweep_calc(struct client_ctx *cc, int x, int y, int mx, int my)
static void static void
mousefunc_sweep_draw(struct client_ctx *cc) mousefunc_sweep_draw(struct client_ctx *cc)
{ {
struct screen_ctx *sc = CCTOSC(cc); struct screen_ctx *sc = cc->sc;
char asize[10]; /* fits "nnnnxnnnn\0" */ char asize[10]; /* fits "nnnnxnnnn\0" */
int width, height, width_size, width_name; int width, height, width_size, width_name;
@ -72,7 +72,7 @@ mousefunc_window_resize(struct client_ctx *cc, void *arg)
{ {
XEvent ev; XEvent ev;
Time time = 0; Time time = 0;
struct screen_ctx *sc = CCTOSC(cc); struct screen_ctx *sc = cc->sc;
int x = cc->geom.x, y = cc->geom.y; int x = cc->geom.x, y = cc->geom.y;
client_raise(cc); client_raise(cc);

View File

@ -125,7 +125,7 @@ xev_handle_configurerequest(XEvent *ee)
XWindowChanges wc; XWindowChanges wc;
if ((cc = client_find(e->window)) != NULL) { if ((cc = client_find(e->window)) != NULL) {
sc = CCTOSC(cc); sc = cc->sc;
if (e->value_mask & CWWidth) if (e->value_mask & CWWidth)
cc->geom.width = e->width; cc->geom.width = e->width;