Rename Area to area_t

This commit is contained in:
Julien Danjou 2008-03-14 09:37:25 +01:00
parent a2082ffbae
commit c6eec955c8
29 changed files with 102 additions and 102 deletions

View File

@ -116,7 +116,7 @@ exit_help(int exit_code)
static int static int
config_parse(int screen, const char *confpatharg, config_parse(int screen, const char *confpatharg,
const char *menu_title, Area *geometry) const char *menu_title, area_t *geometry)
{ {
int ret, i; int ret, i;
char *confpath; char *confpath;
@ -366,7 +366,7 @@ static void
redraw(void) redraw(void)
{ {
item_t *item; item_t *item;
Area geometry = { 0, 0, 0, 0, NULL, NULL }; area_t geometry = { 0, 0, 0, 0, NULL, NULL };
Bool selected_item_is_drawn = False; Bool selected_item_is_drawn = False;
int len, prompt_len, x_of_previous_item; int len, prompt_len, x_of_previous_item;
style_t style; style_t style;
@ -589,7 +589,7 @@ main(int argc, char **argv)
char *configfile = NULL, *cmd; char *configfile = NULL, *cmd;
ssize_t len; ssize_t len;
const char *shell = getenv("SHELL"); const char *shell = getenv("SHELL");
Area geometry = { 0, 0, 0, 0, NULL, NULL }; area_t geometry = { 0, 0, 0, 0, NULL, NULL };
ScreensInfo *si; ScreensInfo *si;
unsigned int ui; unsigned int ui;
Window dummy; Window dummy;

View File

@ -121,7 +121,7 @@ main(int argc, char **argv)
SimpleWindow *sw; SimpleWindow *sw;
DrawCtx *ctx; DrawCtx *ctx;
XEvent ev; XEvent ev;
Area geometry = { 0, 0, 200, 50, NULL, NULL }, area_t geometry = { 0, 0, 200, 50, NULL, NULL },
icon_geometry = { -1, -1, -1, -1, NULL, NULL }; icon_geometry = { -1, -1, -1, -1, NULL, NULL };
int opt, i, x, y, ret, screen = 0, delay = 0; int opt, i, x, y, ret, screen = 0, delay = 0;
unsigned int ui; unsigned int ui;

View File

@ -256,7 +256,7 @@ client_manage(Window w, XWindowAttributes *wa, int screen)
XWindowChanges wc; XWindowChanges wc;
Tag *tag; Tag *tag;
Rule *rule; Rule *rule;
Area screen_geom; area_t screen_geom;
int phys_screen = get_phys_screen(screen); int phys_screen = get_phys_screen(screen);
long flags; long flags;
@ -394,11 +394,11 @@ client_manage(Window w, XWindowAttributes *wa, int screen)
* \param return True if resize has been done * \param return True if resize has been done
*/ */
Bool Bool
client_resize(Client *c, Area geometry, Bool sizehints) client_resize(Client *c, area_t geometry, Bool sizehints)
{ {
int new_screen; int new_screen;
double dx, dy, max, min, ratio; double dx, dy, max, min, ratio;
Area area; area_t area;
XWindowChanges wc; XWindowChanges wc;
if(sizehints) if(sizehints)
@ -815,7 +815,7 @@ uicb_client_moveresize(int screen, char *arg)
int mx, my, dx, dy, nmx, nmy; int mx, my, dx, dy, nmx, nmy;
unsigned int dui; unsigned int dui;
Window dummy; Window dummy;
Area area; area_t area;
Client *sel = globalconf.focus->client; Client *sel = globalconf.focus->client;
Layout *curlay = layout_get_current(screen); Layout *curlay = layout_get_current(screen);
@ -892,7 +892,7 @@ uicb_client_kill(int screen __attribute__ ((unused)), char *arg __attribute__ ((
} }
static void static void
client_maximize(Client *c, Area geometry) client_maximize(Client *c, area_t geometry)
{ {
if((c->ismax = !c->ismax)) if((c->ismax = !c->ismax))
@ -932,7 +932,7 @@ void
uicb_client_togglemax(int screen, char *arg __attribute__ ((unused))) uicb_client_togglemax(int screen, char *arg __attribute__ ((unused)))
{ {
Client *sel = globalconf.focus->client; Client *sel = globalconf.focus->client;
Area area = screen_get_area(screen, area_t area = screen_get_area(screen,
globalconf.screens[screen].statusbar, globalconf.screens[screen].statusbar,
&globalconf.screens[screen].padding); &globalconf.screens[screen].padding);
@ -953,7 +953,7 @@ void
uicb_client_toggleverticalmax(int screen, char *arg __attribute__ ((unused))) uicb_client_toggleverticalmax(int screen, char *arg __attribute__ ((unused)))
{ {
Client *sel = globalconf.focus->client; Client *sel = globalconf.focus->client;
Area area = screen_get_area(screen, area_t area = screen_get_area(screen,
globalconf.screens[screen].statusbar, globalconf.screens[screen].statusbar,
&globalconf.screens[screen].padding); &globalconf.screens[screen].padding);
@ -976,7 +976,7 @@ void
uicb_client_togglehorizontalmax(int screen, char *arg __attribute__ ((unused))) uicb_client_togglehorizontalmax(int screen, char *arg __attribute__ ((unused)))
{ {
Client *sel = globalconf.focus->client; Client *sel = globalconf.focus->client;
Area area = screen_get_area(screen, area_t area = screen_get_area(screen,
globalconf.screens[screen].statusbar, globalconf.screens[screen].statusbar,
&globalconf.screens[screen].padding); &globalconf.screens[screen].padding);

View File

@ -31,7 +31,7 @@ void client_focus(Client *, int, Bool);
void client_ban(Client *); void client_ban(Client *);
void client_unban(Client *); void client_unban(Client *);
void client_manage(Window, XWindowAttributes *, int); void client_manage(Window, XWindowAttributes *, int);
Bool client_resize(Client *, Area, Bool); Bool client_resize(Client *, area_t, Bool);
void client_unmanage(Client *); void client_unmanage(Client *);
void client_updatewmhints(Client *); void client_updatewmhints(Client *);
long client_updatesizehints(Client *); long client_updatesizehints(Client *);

View File

@ -127,7 +127,7 @@ draw_context_delete(DrawCtx *ctx)
*/ */
void void
draw_text(DrawCtx *ctx, draw_text(DrawCtx *ctx,
Area area, area_t area,
Alignment align, Alignment align,
int padding, int padding,
char *text, char *text,
@ -225,7 +225,7 @@ draw_text(DrawCtx *ctx,
* \return pat pattern or NULL; needs to get cairo_pattern_destroy()'ed; * \return pat pattern or NULL; needs to get cairo_pattern_destroy()'ed;
*/ */
static cairo_pattern_t * static cairo_pattern_t *
draw_setup_cairo_color_source(DrawCtx *ctx, Area rect, draw_setup_cairo_color_source(DrawCtx *ctx, area_t rect,
XColor *pcolor, XColor *pcolor_center, XColor *pcolor_end) XColor *pcolor, XColor *pcolor_center, XColor *pcolor_end)
{ {
cairo_pattern_t *pat = NULL; cairo_pattern_t *pat = NULL;
@ -263,7 +263,7 @@ draw_setup_cairo_color_source(DrawCtx *ctx, Area rect,
* \param color color to use * \param color color to use
*/ */
void void
draw_rectangle(DrawCtx *ctx, Area geometry, Bool filled, XColor color) draw_rectangle(DrawCtx *ctx, area_t geometry, Bool filled, XColor color)
{ {
cairo_set_antialias(ctx->cr, CAIRO_ANTIALIAS_NONE); cairo_set_antialias(ctx->cr, CAIRO_ANTIALIAS_NONE);
cairo_set_line_width(ctx->cr, 1.0); cairo_set_line_width(ctx->cr, 1.0);
@ -290,8 +290,8 @@ draw_rectangle(DrawCtx *ctx, Area geometry, Bool filled, XColor color)
* \param pcolor_end color at pattern_start + pattern_width * \param pcolor_end color at pattern_start + pattern_width
*/ */
void void
draw_rectangle_gradient(DrawCtx *ctx, Area geometry, Bool filled, draw_rectangle_gradient(DrawCtx *ctx, area_t geometry, Bool filled,
Area pattern_rect, XColor *pcolor, XColor *pcolor_center, XColor *pcolor_end) area_t pattern_rect, XColor *pcolor, XColor *pcolor_center, XColor *pcolor_end)
{ {
cairo_pattern_t *pat; cairo_pattern_t *pat;
@ -340,8 +340,8 @@ draw_graph_setup(DrawCtx *ctx)
* \param pcolor_end color at the right * \param pcolor_end color at the right
*/ */
void void
draw_graph(DrawCtx *ctx, Area rect, int *from, int *to, int cur_index, draw_graph(DrawCtx *ctx, area_t rect, int *from, int *to, int cur_index,
Area patt_rect, XColor *pcolor, XColor *pcolor_center, XColor *pcolor_end) area_t patt_rect, XColor *pcolor, XColor *pcolor_center, XColor *pcolor_end)
{ {
int i, x, y, w; int i, x, y, w;
cairo_pattern_t *pat; cairo_pattern_t *pat;
@ -381,8 +381,8 @@ draw_graph(DrawCtx *ctx, Area rect, int *from, int *to, int cur_index,
* \param pcolor_end color at the right * \param pcolor_end color at the right
*/ */
void void
draw_graph_line(DrawCtx *ctx, Area rect, int *to, int cur_index, draw_graph_line(DrawCtx *ctx, area_t rect, int *to, int cur_index,
Area patt_rect, XColor *pcolor, XColor *pcolor_center, XColor *pcolor_end) area_t patt_rect, XColor *pcolor, XColor *pcolor_center, XColor *pcolor_end)
{ {
int i, x, y, w; int i, x, y, w;
int flag = 0; /* used to prevent drawing a line from 0 to 0 values */ int flag = 0; /* used to prevent drawing a line from 0 to 0 values */
@ -528,12 +528,12 @@ draw_image(DrawCtx *ctx, int x, int y, int wanted_h, const char *filename)
/** Get an imag size (PNG format only) /** Get an imag size (PNG format only)
* \param filename file name * \param filename file name
* \return Area structure with width and height set to image size * \return area_t structure with width and height set to image size
*/ */
Area area_t
draw_get_image_size(const char *filename) draw_get_image_size(const char *filename)
{ {
Area size = { -1, -1, -1, -1, NULL, NULL }; area_t size = { -1, -1, -1, -1, NULL, NULL };
cairo_surface_t *surface; cairo_surface_t *surface;
cairo_status_t cairo_st; cairo_status_t cairo_st;
@ -706,9 +706,9 @@ draw_style_init(Display *disp, int phys_screen, cfg_t *cfg,
* \param elem area to remove * \param elem area to remove
*/ */
void void
area_list_remove(Area **head, Area *elem) area_list_remove(area_t **head, area_t *elem)
{ {
Area *r, inter, *extra, *rnext; area_t *r, inter, *extra, *rnext;
for(r = *head; r; r = rnext) for(r = *head; r; r = rnext)
{ {
@ -722,7 +722,7 @@ area_list_remove(Area **head, Area *elem)
if(AREA_LEFT(inter) > AREA_LEFT(*r)) if(AREA_LEFT(inter) > AREA_LEFT(*r))
{ {
extra = p_new(Area, 1); extra = p_new(area_t, 1);
extra->x = r->x; extra->x = r->x;
extra->y = r->y; extra->y = r->y;
extra->width = AREA_LEFT(inter) - r->x; extra->width = AREA_LEFT(inter) - r->x;
@ -732,7 +732,7 @@ area_list_remove(Area **head, Area *elem)
if(AREA_TOP(inter) > AREA_TOP(*r)) if(AREA_TOP(inter) > AREA_TOP(*r))
{ {
extra = p_new(Area, 1); extra = p_new(area_t, 1);
extra->x = r->x; extra->x = r->x;
extra->y = r->y; extra->y = r->y;
extra->width = r->width; extra->width = r->width;
@ -742,7 +742,7 @@ area_list_remove(Area **head, Area *elem)
if(AREA_RIGHT(inter) < AREA_RIGHT(*r)) if(AREA_RIGHT(inter) < AREA_RIGHT(*r))
{ {
extra = p_new(Area, 1); extra = p_new(area_t, 1);
extra->x = AREA_RIGHT(inter); extra->x = AREA_RIGHT(inter);
extra->y = r->y; extra->y = r->y;
extra->width = AREA_RIGHT(*r) - AREA_RIGHT(inter); extra->width = AREA_RIGHT(*r) - AREA_RIGHT(inter);
@ -752,7 +752,7 @@ area_list_remove(Area **head, Area *elem)
if(AREA_BOTTOM(inter) < AREA_BOTTOM(*r)) if(AREA_BOTTOM(inter) < AREA_BOTTOM(*r))
{ {
extra = p_new(Area, 1); extra = p_new(area_t, 1);
extra->x = r->x; extra->x = r->x;
extra->y = AREA_BOTTOM(inter); extra->y = AREA_BOTTOM(inter);
extra->width = r->width; extra->width = r->width;

View File

@ -41,18 +41,18 @@ typedef enum
AlignAuto AlignAuto
} Alignment; } Alignment;
typedef struct Area Area; typedef struct area_t area_t;
struct Area struct area_t
{ {
/** Co-ords of upper left corner */ /** Co-ords of upper left corner */
int x; int x;
int y; int y;
int width; int width;
int height; int height;
Area *prev, *next; area_t *prev, *next;
}; };
DO_SLIST(Area, area, p_delete) DO_SLIST(area_t, area, p_delete)
#define AREA_LEFT(a) ((a).x) #define AREA_LEFT(a) ((a).x)
#define AREA_TOP(a) ((a).y) #define AREA_TOP(a) ((a).y)
@ -60,7 +60,7 @@ DO_SLIST(Area, area, p_delete)
#define AREA_BOTTOM(a) ((a).y + (a).height) #define AREA_BOTTOM(a) ((a).y + (a).height)
static inline Bool static inline Bool
area_intersect_area(Area a, Area b) area_intersect_area(area_t a, area_t b)
{ {
return (b.x < a.x + a.width return (b.x < a.x + a.width
&& b.x + b.width > a.x && b.x + b.width > a.x
@ -68,10 +68,10 @@ area_intersect_area(Area a, Area b)
&& b.y + b.height > a.y); && b.y + b.height > a.y);
} }
static inline Area static inline area_t
area_get_intersect_area(Area a, Area b) area_get_intersect_area(area_t a, area_t b)
{ {
Area g; area_t g;
g.x = MAX(a.x, b.x); g.x = MAX(a.x, b.x);
g.y = MAX(a.y, b.y); g.y = MAX(a.y, b.y);
@ -113,24 +113,24 @@ typedef struct
DrawCtx *draw_context_new(Display *, int, int, int, Drawable); DrawCtx *draw_context_new(Display *, int, int, int, Drawable);
void draw_context_delete(DrawCtx *); void draw_context_delete(DrawCtx *);
void draw_text(DrawCtx *, Area, Alignment, int, char *, style_t); void draw_text(DrawCtx *, area_t, Alignment, int, char *, style_t);
void draw_rectangle(DrawCtx *, Area, Bool, XColor); void draw_rectangle(DrawCtx *, area_t, Bool, XColor);
void draw_rectangle_gradient(DrawCtx *, Area, Bool, Area, XColor *, XColor *, XColor *); void draw_rectangle_gradient(DrawCtx *, area_t, Bool, area_t, XColor *, XColor *, XColor *);
void draw_graph_setup(DrawCtx *); void draw_graph_setup(DrawCtx *);
void draw_graph(DrawCtx *, Area, int *, int *, int, Area, XColor *, XColor *, XColor *); void draw_graph(DrawCtx *, area_t, int *, int *, int, area_t, XColor *, XColor *, XColor *);
void draw_graph_line(DrawCtx *, Area, int *, int, Area, XColor *, XColor *, XColor *); void draw_graph_line(DrawCtx *, area_t, int *, int, area_t, XColor *, XColor *, XColor *);
void draw_circle(DrawCtx *, int, int, int, Bool, XColor); void draw_circle(DrawCtx *, int, int, int, Bool, XColor);
void draw_image(DrawCtx *, int, int, int, const char *); void draw_image(DrawCtx *, int, int, int, const char *);
void draw_image_from_argb_data(DrawCtx *, int, int, int, int, int, unsigned char *); void draw_image_from_argb_data(DrawCtx *, int, int, int, int, int, unsigned char *);
Area draw_get_image_size(const char *filename); area_t draw_get_image_size(const char *filename);
Drawable draw_rotate(DrawCtx *, int, double, int, int); Drawable draw_rotate(DrawCtx *, int, double, int, int);
unsigned short draw_textwidth(Display *, XftFont *, char *); unsigned short draw_textwidth(Display *, XftFont *, char *);
Alignment draw_get_align(const char *); Alignment draw_get_align(const char *);
Bool draw_color_new(Display *, int, const char *, XColor *); Bool draw_color_new(Display *, int, const char *, XColor *);
void draw_style_init(Display *, int, cfg_t *, style_t *, style_t *); void draw_style_init(Display *, int, cfg_t *, style_t *, style_t *);
void area_list_remove(Area **, Area *); void area_list_remove(area_t **, area_t *);
#endif #endif
// vim: filetype=c:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=80 // vim: filetype=c:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=80

View File

@ -30,7 +30,7 @@ typedef struct SimpleWindow
Display *display; Display *display;
Window window; Window window;
Drawable drawable; Drawable drawable;
Area geometry; area_t geometry;
} SimpleWindow; } SimpleWindow;
SimpleWindow * simplewindow_new(Display *, int, int, int, unsigned int, unsigned int, unsigned int); SimpleWindow * simplewindow_new(Display *, int, int, int, unsigned int, unsigned int, unsigned int);

View File

@ -46,10 +46,10 @@ screen_get_bycoord(ScreensInfo *si, int screen, int x, int y)
return screen; return screen;
} }
static inline Area static inline area_t
screen_xsi_to_area(XineramaScreenInfo si) screen_xsi_to_area(XineramaScreenInfo si)
{ {
Area a; area_t a;
a.x = si.x_org; a.x = si.x_org;
a.y = si.y_org; a.y = si.y_org;
@ -80,7 +80,7 @@ screensinfo_new(Display *disp)
if((si->xinerama_is_active = XineramaIsActive(disp))) if((si->xinerama_is_active = XineramaIsActive(disp)))
{ {
xsi = XineramaQueryScreens(disp, &xinerama_screen_number); xsi = XineramaQueryScreens(disp, &xinerama_screen_number);
si->geometry = p_new(Area, xinerama_screen_number); si->geometry = p_new(area_t, xinerama_screen_number);
si->nscreen = 0; si->nscreen = 0;
/* now check if screens overlaps (same x,y): if so, we take only the biggest one */ /* now check if screens overlaps (same x,y): if so, we take only the biggest one */
@ -106,8 +106,8 @@ screensinfo_new(Display *disp)
/* realloc smaller if xinerama_screen_number != screen registered */ /* realloc smaller if xinerama_screen_number != screen registered */
if(xinerama_screen_number != si->nscreen) if(xinerama_screen_number != si->nscreen)
{ {
Area *newgeometry = p_new(Area, si->nscreen); area_t *newgeometry = p_new(area_t, si->nscreen);
memcpy(newgeometry, si->geometry, si->nscreen * sizeof(Area)); memcpy(newgeometry, si->geometry, si->nscreen * sizeof(area_t));
p_delete(&si->geometry); p_delete(&si->geometry);
si->geometry = newgeometry; si->geometry = newgeometry;
} }
@ -117,7 +117,7 @@ screensinfo_new(Display *disp)
else else
{ {
si->nscreen = ScreenCount(disp); si->nscreen = ScreenCount(disp);
si->geometry = p_new(Area, si->nscreen); si->geometry = p_new(area_t, si->nscreen);
for(screen = 0; screen < si->nscreen; screen++) for(screen = 0; screen < si->nscreen; screen++)
{ {
si->geometry[screen].x = 0; si->geometry[screen].x = 0;

View File

@ -28,7 +28,7 @@ typedef struct
{ {
int nscreen; int nscreen;
Bool xinerama_is_active; Bool xinerama_is_active;
Area *geometry; area_t *geometry;
} ScreensInfo; } ScreensInfo;
int screen_get_bycoord(ScreensInfo *, int, int, int); int screen_get_bycoord(ScreensInfo *, int, int, int);

View File

@ -161,7 +161,7 @@ event_handle_configurerequest(XEvent * e)
XConfigureRequestEvent *ev = &e->xconfigurerequest; XConfigureRequestEvent *ev = &e->xconfigurerequest;
XWindowChanges wc; XWindowChanges wc;
int old_screen; int old_screen;
Area geometry; area_t geometry;
if((c = client_get_bywin(globalconf.clients, ev->window))) if((c = client_get_bywin(globalconf.clients, ev->window)))
{ {

2
ewmh.c
View File

@ -251,7 +251,7 @@ ewmh_process_state_atom(Client *c, Atom state, int set)
} }
else if(state == net_wm_state_fullscreen) else if(state == net_wm_state_fullscreen)
{ {
Area geometry = c->geometry; area_t geometry = c->geometry;
if(set == _NET_WM_STATE_REMOVE) if(set == _NET_WM_STATE_REMOVE)
{ {
/* restore geometry */ /* restore geometry */

View File

@ -32,7 +32,7 @@ layout_fibonacci(int screen, int shape)
{ {
int n = 0, i = 0; int n = 0, i = 0;
Client *c; Client *c;
Area geometry, area; area_t geometry, area;
geometry = area = screen_get_area(screen, geometry = area = screen_get_area(screen,
globalconf.screens[screen].statusbar, globalconf.screens[screen].statusbar,
&globalconf.screens[screen].padding); &globalconf.screens[screen].padding);

View File

@ -31,7 +31,7 @@ void
layout_max(int screen) layout_max(int screen)
{ {
Client *c; Client *c;
Area area = screen_get_area(screen, area_t area = screen_get_area(screen,
globalconf.screens[screen].statusbar, globalconf.screens[screen].statusbar,
&globalconf.screens[screen].padding); &globalconf.screens[screen].padding);

View File

@ -133,7 +133,7 @@ _tile(int screen, const Position position)
unsigned int mw = 0, mh = 0; unsigned int mw = 0, mh = 0;
int n, i, masterwin = 0, otherwin = 0; int n, i, masterwin = 0, otherwin = 0;
int real_ncol = 1, win_by_col = 1, current_col = 0; int real_ncol = 1, win_by_col = 1, current_col = 0;
Area area, geometry = { 0, 0, 0, 0, NULL, NULL }; area_t area, geometry = { 0, 0, 0, 0, NULL, NULL };
Client *c; Client *c;
Tag **curtags = tags_get_current(screen); Tag **curtags = tags_get_current(screen);

View File

@ -48,7 +48,7 @@ uicb_client_movemouse(int screen, char *arg __attribute__ ((unused)))
unsigned int dui; unsigned int dui;
Window dummy, child; Window dummy, child;
XEvent ev; XEvent ev;
Area area, geometry; area_t area, geometry;
Client *c = globalconf.focus->client, *target; Client *c = globalconf.focus->client, *target;
Layout *layout = layout_get_current(screen); Layout *layout = layout_get_current(screen);
@ -150,7 +150,7 @@ uicb_client_resizemouse(int screen, char *arg __attribute__ ((unused)))
Client *c = globalconf.focus->client; Client *c = globalconf.focus->client;
Tag **curtags = tags_get_current(screen); Tag **curtags = tags_get_current(screen);
Layout *layout = curtags[0]->layout; Layout *layout = curtags[0]->layout;
Area area = { 0, 0, 0, 0, NULL, NULL }, geometry; area_t area = { 0, 0, 0, 0, NULL, NULL }, geometry;
double mwfact; double mwfact;
/* only handle floating and tiled layouts */ /* only handle floating and tiled layouts */

View File

@ -32,10 +32,10 @@ name_func_link_t FloatingPlacementList[] =
{ NULL, NULL } { NULL, NULL }
}; };
static Area static area_t
placement_fix_offscreen(Area geometry, int screen, int border) placement_fix_offscreen(area_t geometry, int screen, int border)
{ {
Area screen_geometry, newgeometry = geometry; area_t screen_geometry, newgeometry = geometry;
screen_geometry = screen_get_area(screen, screen_geometry = screen_get_area(screen,
globalconf.screens[screen].statusbar, globalconf.screens[screen].statusbar,
@ -60,15 +60,15 @@ placement_fix_offscreen(Area geometry, int screen, int border)
* \param screen screen used * \param screen screen used
* \return new geometry * \return new geometry
*/ */
Area area_t
placement_smart(Area geometry, int border, int screen) placement_smart(area_t geometry, int border, int screen)
{ {
Client *c; Client *c;
Area newgeometry = { 0, 0, 0, 0, NULL, NULL }; area_t newgeometry = { 0, 0, 0, 0, NULL, NULL };
Area *screen_geometry, *arealist = NULL, *r; area_t *screen_geometry, *arealist = NULL, *r;
Bool found = False; Bool found = False;
screen_geometry = p_new(Area, 1); screen_geometry = p_new(area_t, 1);
*screen_geometry = screen_get_area(screen, *screen_geometry = screen_get_area(screen,
globalconf.screens[screen].statusbar, globalconf.screens[screen].statusbar,
@ -116,13 +116,13 @@ placement_smart(Area geometry, int border, int screen)
return newgeometry; return newgeometry;
} }
Area area_t
placement_under_mouse(Area geometry, int border, int screen) placement_under_mouse(area_t geometry, int border, int screen)
{ {
Window dummy; Window dummy;
unsigned int m; unsigned int m;
int x, y, d; int x, y, d;
Area finalgeometry = geometry; area_t finalgeometry = geometry;
if(XQueryPointer(globalconf.display, RootWindow(globalconf.display, get_phys_screen(screen)), if(XQueryPointer(globalconf.display, RootWindow(globalconf.display, get_phys_screen(screen)),
&dummy, &dummy, &x, &y, &d, &d, &m)) &dummy, &dummy, &x, &y, &d, &d, &m))

View File

@ -31,12 +31,12 @@ extern AwesomeConf globalconf;
* \param screen Screen number * \param screen Screen number
* \param statusbar statusbar * \param statusbar statusbar
* \param padding Padding * \param padding Padding
* \return Area * \return area_t
*/ */
Area area_t
screen_get_area(int screen, Statusbar *statusbar, Padding *padding) screen_get_area(int screen, Statusbar *statusbar, Padding *padding)
{ {
Area area = globalconf.screens_info->geometry[screen]; area_t area = globalconf.screens_info->geometry[screen];
Statusbar *sb; Statusbar *sb;
/* make padding corrections */ /* make padding corrections */
@ -72,12 +72,12 @@ screen_get_area(int screen, Statusbar *statusbar, Padding *padding)
* \param screen Screen number * \param screen Screen number
* \param statusbar the statusbar * \param statusbar the statusbar
* \param padding Padding * \param padding Padding
* \return Area * \return area_t
*/ */
Area area_t
get_display_area(int screen, Statusbar *statusbar, Padding *padding) get_display_area(int screen, Statusbar *statusbar, Padding *padding)
{ {
Area area = { 0, 0, 0, 0, NULL, NULL }; area_t area = { 0, 0, 0, 0, NULL, NULL };
Statusbar *sb; Statusbar *sb;
area.width = DisplayWidth(globalconf.display, screen); area.width = DisplayWidth(globalconf.display, screen);
@ -124,7 +124,7 @@ move_client_to_screen(Client *c, int new_screen, Bool doresize)
{ {
Tag *tag; Tag *tag;
int old_screen = c->screen; int old_screen = c->screen;
Area from, to; area_t from, to;
for(tag = globalconf.screens[old_screen].tags; tag; tag = tag->next) for(tag = globalconf.screens[old_screen].tags; tag; tag = tag->next)
untag_client(c, tag); untag_client(c, tag);
@ -137,7 +137,7 @@ move_client_to_screen(Client *c, int new_screen, Bool doresize)
/* resize the windows if it's floating */ /* resize the windows if it's floating */
if(doresize && old_screen != c->screen) if(doresize && old_screen != c->screen)
{ {
Area new_geometry, new_f_geometry; area_t new_geometry, new_f_geometry;
new_f_geometry = c->f_geometry; new_f_geometry = c->f_geometry;
to = screen_get_area(c->screen, NULL, NULL); to = screen_get_area(c->screen, NULL, NULL);
@ -212,7 +212,7 @@ move_mouse_pointer_to_screen(int phys_screen)
{ {
if(globalconf.screens_info->xinerama_is_active) if(globalconf.screens_info->xinerama_is_active)
{ {
Area area = screen_get_area(phys_screen, NULL, NULL); area_t area = screen_get_area(phys_screen, NULL, NULL);
XWarpPointer(globalconf.display, XWarpPointer(globalconf.display,
None, None,
DefaultRootWindow(globalconf.display), DefaultRootWindow(globalconf.display),

View File

@ -24,8 +24,8 @@
#include "structs.h" #include "structs.h"
Area screen_get_area(int, Statusbar *, Padding *); area_t screen_get_area(int, Statusbar *, Padding *);
Area get_display_area(int, Statusbar *, Padding *); area_t get_display_area(int, Statusbar *, Padding *);
int get_phys_screen(int); int get_phys_screen(int);
void move_client_to_screen(Client *, int, Bool); void move_client_to_screen(Client *, int, Bool);

View File

@ -33,7 +33,7 @@ extern AwesomeConf globalconf;
static void static void
statusbar_update_position(Statusbar *statusbar) statusbar_update_position(Statusbar *statusbar)
{ {
Area area; area_t area;
XMapRaised(globalconf.display, statusbar->sw->window); XMapRaised(globalconf.display, statusbar->sw->window);
@ -74,7 +74,7 @@ statusbar_draw(Statusbar *statusbar)
int phys_screen = get_phys_screen(statusbar->screen); int phys_screen = get_phys_screen(statusbar->screen);
Widget *widget; Widget *widget;
int left = 0, right = 0; int left = 0, right = 0;
Area rectangle = { 0, 0, 0, 0, NULL, NULL }; area_t rectangle = { 0, 0, 0, 0, NULL, NULL };
Drawable d; Drawable d;
/* don't waste our time */ /* don't waste our time */
@ -178,7 +178,7 @@ statusbar_init(Statusbar *statusbar)
{ {
Statusbar *sb; Statusbar *sb;
int phys_screen = get_phys_screen(statusbar->screen); int phys_screen = get_phys_screen(statusbar->screen);
Area area = screen_get_area(statusbar->screen, area_t area = screen_get_area(statusbar->screen,
globalconf.screens[statusbar->screen].statusbar, globalconf.screens[statusbar->screen].statusbar,
&globalconf.screens[statusbar->screen].padding); &globalconf.screens[statusbar->screen].padding);

View File

@ -126,8 +126,8 @@ struct Widget
/** True if user supplied coords */ /** True if user supplied coords */
Bool user_supplied_x; Bool user_supplied_x;
Bool user_supplied_y; Bool user_supplied_y;
/** Area */ /** area_t */
Area area; area_t area;
/** Buttons bindings */ /** Buttons bindings */
Button *buttons; Button *buttons;
/** Cache */ /** Cache */
@ -170,11 +170,11 @@ struct Client
/** Client name */ /** Client name */
char name[256]; char name[256];
/** Window geometry */ /** Window geometry */
Area geometry; area_t geometry;
/** Floating window geometry */ /** Floating window geometry */
Area f_geometry; area_t f_geometry;
/** Max window geometry */ /** Max window geometry */
Area m_geometry; area_t m_geometry;
int basew, baseh, incw, inch, maxw, maxh, minw, minh; int basew, baseh, incw, inch, maxw, maxh, minw, minh;
int minax, maxax, minay, maxay; int minax, maxax, minay, maxay;
int border, oldborder; int border, oldborder;
@ -257,7 +257,7 @@ typedef struct
int right; int right;
} Padding; } Padding;
typedef Area (FloatingPlacement)(Area, int, int); typedef area_t (FloatingPlacement)(area_t, int, int);
typedef struct typedef struct
{ {
/** Number of pixels to snap windows */ /** Number of pixels to snap windows */

View File

@ -32,7 +32,7 @@ static int
focusicon_draw(Widget *widget, DrawCtx *ctx, int offset, focusicon_draw(Widget *widget, DrawCtx *ctx, int offset,
int used __attribute__ ((unused))) int used __attribute__ ((unused)))
{ {
Area area; area_t area;
Rule* r; Rule* r;
Client *sel = focus_get_current_client(widget->statusbar->screen); Client *sel = focus_get_current_client(widget->statusbar->screen);
NetWMIcon *icon; NetWMIcon *icon;

View File

@ -86,7 +86,7 @@ graph_draw(Widget *widget, DrawCtx *ctx, int offset,
int margin_top, left_offset; int margin_top, left_offset;
int z, y, x, tmp, cur_index, test_index; int z, y, x, tmp, cur_index, test_index;
Data *d = widget->data; Data *d = widget->data;
Area rectangle, pattern_area; area_t rectangle, pattern_area;
if(!d->data_items) if(!d->data_items)
return 0; return 0;

View File

@ -35,7 +35,7 @@ iconbox_draw(Widget *widget, DrawCtx *ctx, int offset,
int used __attribute__ ((unused))) int used __attribute__ ((unused)))
{ {
Data *d = widget->data; Data *d = widget->data;
Area area = draw_get_image_size(d->image); area_t area = draw_get_image_size(d->image);
/* image not valid */ /* image not valid */
if(area.width < 0 || area.height < 0) if(area.width < 0 || area.height < 0)

View File

@ -34,7 +34,7 @@ layoutinfo_draw(Widget *widget,
int used __attribute__ ((unused))) int used __attribute__ ((unused)))
{ {
Tag **curtags = tags_get_current(widget->statusbar->screen); Tag **curtags = tags_get_current(widget->statusbar->screen);
Area area = draw_get_image_size(curtags[0]->layout->image); area_t area = draw_get_image_size(curtags[0]->layout->image);
if(!widget->user_supplied_x) if(!widget->user_supplied_x)
widget->area.x = widget_calculate_offset(widget->statusbar->width, widget->area.x = widget_calculate_offset(widget->statusbar->width,

View File

@ -63,7 +63,7 @@ progressbar_draw(Widget *widget, DrawCtx *ctx, int offset,
int used __attribute__ ((unused))) int used __attribute__ ((unused)))
{ {
int i, pb_x, pb_y, pb_height, pb_width, pb_progress, pb_offset = 0; int i, pb_x, pb_y, pb_height, pb_width, pb_progress, pb_offset = 0;
Area rectangle, pattern_rect; area_t rectangle, pattern_rect;
Data *d = widget->data; Data *d = widget->data;

View File

@ -80,7 +80,7 @@ taglist_draw(Widget *widget,
VirtScreen vscreen = globalconf.screens[widget->statusbar->screen]; VirtScreen vscreen = globalconf.screens[widget->statusbar->screen];
int w = 0, flagsize; int w = 0, flagsize;
style_t style; style_t style;
Area area; area_t area;
flagsize = (vscreen.styles.normal.font->height + 2) / 3; flagsize = (vscreen.styles.normal.font->height + 2) / 3;
@ -119,7 +119,7 @@ taglist_draw(Widget *widget,
if(isoccupied(tag)) if(isoccupied(tag))
{ {
Area rectangle = { widget->area.x + widget->area.width, area_t rectangle = { widget->area.x + widget->area.width,
widget->area.y, widget->area.y,
flagsize, flagsize,
flagsize, flagsize,

View File

@ -82,7 +82,7 @@ tasklist_draw(Widget *widget, DrawCtx *ctx, int offset, int used)
Data *d = widget->data; Data *d = widget->data;
Client *sel = focus_get_current_client(widget->statusbar->screen); Client *sel = focus_get_current_client(widget->statusbar->screen);
Rule *r; Rule *r;
Area area; area_t area;
style_t style; style_t style;
int n = 0, i = 0, box_width = 0, icon_width = 0, box_width_rest = 0; int n = 0, i = 0, box_width = 0, icon_width = 0, box_width_rest = 0;
NetWMIcon *icon; NetWMIcon *icon;

View File

@ -74,7 +74,7 @@ window_getstate(Window w)
* \return the XSendEvent() status * \return the XSendEvent() status
*/ */
Status Status
window_configure(Window win, Area geometry, int border) window_configure(Window win, area_t geometry, int border)
{ {
XConfigureEvent ce; XConfigureEvent ce;

View File

@ -26,7 +26,7 @@
int window_setstate(Window, long); int window_setstate(Window, long);
long window_getstate(Window); long window_getstate(Window);
Status window_configure(Window, Area, int); Status window_configure(Window, area_t, int);
void window_grabbuttons(int, Window); void window_grabbuttons(int, Window);
void window_root_grabbuttons(int); void window_root_grabbuttons(int);
void window_root_grabkeys(int); void window_root_grabkeys(int);