Rename Area to area_t
This commit is contained in:
parent
a2082ffbae
commit
c6eec955c8
|
@ -116,7 +116,7 @@ exit_help(int exit_code)
|
|||
|
||||
static int
|
||||
config_parse(int screen, const char *confpatharg,
|
||||
const char *menu_title, Area *geometry)
|
||||
const char *menu_title, area_t *geometry)
|
||||
{
|
||||
int ret, i;
|
||||
char *confpath;
|
||||
|
@ -366,7 +366,7 @@ static void
|
|||
redraw(void)
|
||||
{
|
||||
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;
|
||||
int len, prompt_len, x_of_previous_item;
|
||||
style_t style;
|
||||
|
@ -589,7 +589,7 @@ main(int argc, char **argv)
|
|||
char *configfile = NULL, *cmd;
|
||||
ssize_t len;
|
||||
const char *shell = getenv("SHELL");
|
||||
Area geometry = { 0, 0, 0, 0, NULL, NULL };
|
||||
area_t geometry = { 0, 0, 0, 0, NULL, NULL };
|
||||
ScreensInfo *si;
|
||||
unsigned int ui;
|
||||
Window dummy;
|
||||
|
|
|
@ -121,7 +121,7 @@ main(int argc, char **argv)
|
|||
SimpleWindow *sw;
|
||||
DrawCtx *ctx;
|
||||
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 };
|
||||
int opt, i, x, y, ret, screen = 0, delay = 0;
|
||||
unsigned int ui;
|
||||
|
|
16
client.c
16
client.c
|
@ -256,7 +256,7 @@ client_manage(Window w, XWindowAttributes *wa, int screen)
|
|||
XWindowChanges wc;
|
||||
Tag *tag;
|
||||
Rule *rule;
|
||||
Area screen_geom;
|
||||
area_t screen_geom;
|
||||
int phys_screen = get_phys_screen(screen);
|
||||
long flags;
|
||||
|
||||
|
@ -394,11 +394,11 @@ client_manage(Window w, XWindowAttributes *wa, int screen)
|
|||
* \param return True if resize has been done
|
||||
*/
|
||||
Bool
|
||||
client_resize(Client *c, Area geometry, Bool sizehints)
|
||||
client_resize(Client *c, area_t geometry, Bool sizehints)
|
||||
{
|
||||
int new_screen;
|
||||
double dx, dy, max, min, ratio;
|
||||
Area area;
|
||||
area_t area;
|
||||
XWindowChanges wc;
|
||||
|
||||
if(sizehints)
|
||||
|
@ -815,7 +815,7 @@ uicb_client_moveresize(int screen, char *arg)
|
|||
int mx, my, dx, dy, nmx, nmy;
|
||||
unsigned int dui;
|
||||
Window dummy;
|
||||
Area area;
|
||||
area_t area;
|
||||
Client *sel = globalconf.focus->client;
|
||||
Layout *curlay = layout_get_current(screen);
|
||||
|
||||
|
@ -892,7 +892,7 @@ uicb_client_kill(int screen __attribute__ ((unused)), char *arg __attribute__ ((
|
|||
}
|
||||
|
||||
static void
|
||||
client_maximize(Client *c, Area geometry)
|
||||
client_maximize(Client *c, area_t geometry)
|
||||
{
|
||||
|
||||
if((c->ismax = !c->ismax))
|
||||
|
@ -932,7 +932,7 @@ void
|
|||
uicb_client_togglemax(int screen, char *arg __attribute__ ((unused)))
|
||||
{
|
||||
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].padding);
|
||||
|
||||
|
@ -953,7 +953,7 @@ void
|
|||
uicb_client_toggleverticalmax(int screen, char *arg __attribute__ ((unused)))
|
||||
{
|
||||
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].padding);
|
||||
|
||||
|
@ -976,7 +976,7 @@ void
|
|||
uicb_client_togglehorizontalmax(int screen, char *arg __attribute__ ((unused)))
|
||||
{
|
||||
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].padding);
|
||||
|
||||
|
|
2
client.h
2
client.h
|
@ -31,7 +31,7 @@ void client_focus(Client *, int, Bool);
|
|||
void client_ban(Client *);
|
||||
void client_unban(Client *);
|
||||
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_updatewmhints(Client *);
|
||||
long client_updatesizehints(Client *);
|
||||
|
|
|
@ -127,7 +127,7 @@ draw_context_delete(DrawCtx *ctx)
|
|||
*/
|
||||
void
|
||||
draw_text(DrawCtx *ctx,
|
||||
Area area,
|
||||
area_t area,
|
||||
Alignment align,
|
||||
int padding,
|
||||
char *text,
|
||||
|
@ -225,7 +225,7 @@ draw_text(DrawCtx *ctx,
|
|||
* \return pat pattern or NULL; needs to get cairo_pattern_destroy()'ed;
|
||||
*/
|
||||
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)
|
||||
{
|
||||
cairo_pattern_t *pat = NULL;
|
||||
|
@ -263,7 +263,7 @@ draw_setup_cairo_color_source(DrawCtx *ctx, Area rect,
|
|||
* \param color color to use
|
||||
*/
|
||||
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_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
|
||||
*/
|
||||
void
|
||||
draw_rectangle_gradient(DrawCtx *ctx, Area geometry, Bool filled,
|
||||
Area pattern_rect, XColor *pcolor, XColor *pcolor_center, XColor *pcolor_end)
|
||||
draw_rectangle_gradient(DrawCtx *ctx, area_t geometry, Bool filled,
|
||||
area_t pattern_rect, XColor *pcolor, XColor *pcolor_center, XColor *pcolor_end)
|
||||
{
|
||||
cairo_pattern_t *pat;
|
||||
|
||||
|
@ -340,8 +340,8 @@ draw_graph_setup(DrawCtx *ctx)
|
|||
* \param pcolor_end color at the right
|
||||
*/
|
||||
void
|
||||
draw_graph(DrawCtx *ctx, Area rect, int *from, int *to, int cur_index,
|
||||
Area patt_rect, XColor *pcolor, XColor *pcolor_center, XColor *pcolor_end)
|
||||
draw_graph(DrawCtx *ctx, area_t rect, int *from, int *to, int cur_index,
|
||||
area_t patt_rect, XColor *pcolor, XColor *pcolor_center, XColor *pcolor_end)
|
||||
{
|
||||
int i, x, y, w;
|
||||
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
|
||||
*/
|
||||
void
|
||||
draw_graph_line(DrawCtx *ctx, Area rect, int *to, int cur_index,
|
||||
Area patt_rect, XColor *pcolor, XColor *pcolor_center, XColor *pcolor_end)
|
||||
draw_graph_line(DrawCtx *ctx, area_t rect, int *to, int cur_index,
|
||||
area_t patt_rect, XColor *pcolor, XColor *pcolor_center, XColor *pcolor_end)
|
||||
{
|
||||
int i, x, y, w;
|
||||
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)
|
||||
* \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)
|
||||
{
|
||||
Area size = { -1, -1, -1, -1, NULL, NULL };
|
||||
area_t size = { -1, -1, -1, -1, NULL, NULL };
|
||||
cairo_surface_t *surface;
|
||||
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
|
||||
*/
|
||||
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)
|
||||
{
|
||||
|
@ -722,7 +722,7 @@ area_list_remove(Area **head, Area *elem)
|
|||
|
||||
if(AREA_LEFT(inter) > AREA_LEFT(*r))
|
||||
{
|
||||
extra = p_new(Area, 1);
|
||||
extra = p_new(area_t, 1);
|
||||
extra->x = r->x;
|
||||
extra->y = r->y;
|
||||
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))
|
||||
{
|
||||
extra = p_new(Area, 1);
|
||||
extra = p_new(area_t, 1);
|
||||
extra->x = r->x;
|
||||
extra->y = r->y;
|
||||
extra->width = r->width;
|
||||
|
@ -742,7 +742,7 @@ area_list_remove(Area **head, Area *elem)
|
|||
|
||||
if(AREA_RIGHT(inter) < AREA_RIGHT(*r))
|
||||
{
|
||||
extra = p_new(Area, 1);
|
||||
extra = p_new(area_t, 1);
|
||||
extra->x = AREA_RIGHT(inter);
|
||||
extra->y = r->y;
|
||||
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))
|
||||
{
|
||||
extra = p_new(Area, 1);
|
||||
extra = p_new(area_t, 1);
|
||||
extra->x = r->x;
|
||||
extra->y = AREA_BOTTOM(inter);
|
||||
extra->width = r->width;
|
||||
|
|
|
@ -41,18 +41,18 @@ typedef enum
|
|||
AlignAuto
|
||||
} Alignment;
|
||||
|
||||
typedef struct Area Area;
|
||||
struct Area
|
||||
typedef struct area_t area_t;
|
||||
struct area_t
|
||||
{
|
||||
/** Co-ords of upper left corner */
|
||||
int x;
|
||||
int y;
|
||||
int width;
|
||||
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_TOP(a) ((a).y)
|
||||
|
@ -60,7 +60,7 @@ DO_SLIST(Area, area, p_delete)
|
|||
#define AREA_BOTTOM(a) ((a).y + (a).height)
|
||||
|
||||
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
|
||||
&& b.x + b.width > a.x
|
||||
|
@ -68,10 +68,10 @@ area_intersect_area(Area a, Area b)
|
|||
&& b.y + b.height > a.y);
|
||||
}
|
||||
|
||||
static inline Area
|
||||
area_get_intersect_area(Area a, Area b)
|
||||
static inline area_t
|
||||
area_get_intersect_area(area_t a, area_t b)
|
||||
{
|
||||
Area g;
|
||||
area_t g;
|
||||
|
||||
g.x = MAX(a.x, b.x);
|
||||
g.y = MAX(a.y, b.y);
|
||||
|
@ -113,24 +113,24 @@ typedef struct
|
|||
DrawCtx *draw_context_new(Display *, int, int, int, Drawable);
|
||||
void draw_context_delete(DrawCtx *);
|
||||
|
||||
void draw_text(DrawCtx *, Area, Alignment, int, char *, style_t);
|
||||
void draw_rectangle(DrawCtx *, Area, Bool, XColor);
|
||||
void draw_rectangle_gradient(DrawCtx *, Area, Bool, Area, XColor *, XColor *, XColor *);
|
||||
void draw_text(DrawCtx *, area_t, Alignment, int, char *, style_t);
|
||||
void draw_rectangle(DrawCtx *, area_t, Bool, XColor);
|
||||
void draw_rectangle_gradient(DrawCtx *, area_t, Bool, area_t, XColor *, XColor *, XColor *);
|
||||
|
||||
void draw_graph_setup(DrawCtx *);
|
||||
void draw_graph(DrawCtx *, Area, int *, int *, int, Area, XColor *, XColor *, XColor *);
|
||||
void draw_graph_line(DrawCtx *, Area, 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_t, int *, int, area_t, XColor *, XColor *, XColor *);
|
||||
void draw_circle(DrawCtx *, int, int, int, Bool, XColor);
|
||||
void draw_image(DrawCtx *, int, int, int, const 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);
|
||||
unsigned short draw_textwidth(Display *, XftFont *, char *);
|
||||
Alignment draw_get_align(const char *);
|
||||
Bool draw_color_new(Display *, int, const char *, XColor *);
|
||||
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
|
||||
// vim: filetype=c:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=80
|
||||
|
|
|
@ -30,7 +30,7 @@ typedef struct SimpleWindow
|
|||
Display *display;
|
||||
Window window;
|
||||
Drawable drawable;
|
||||
Area geometry;
|
||||
area_t geometry;
|
||||
} SimpleWindow;
|
||||
|
||||
SimpleWindow * simplewindow_new(Display *, int, int, int, unsigned int, unsigned int, unsigned int);
|
||||
|
|
|
@ -46,10 +46,10 @@ screen_get_bycoord(ScreensInfo *si, int screen, int x, int y)
|
|||
return screen;
|
||||
}
|
||||
|
||||
static inline Area
|
||||
static inline area_t
|
||||
screen_xsi_to_area(XineramaScreenInfo si)
|
||||
{
|
||||
Area a;
|
||||
area_t a;
|
||||
|
||||
a.x = si.x_org;
|
||||
a.y = si.y_org;
|
||||
|
@ -80,7 +80,7 @@ screensinfo_new(Display *disp)
|
|||
if((si->xinerama_is_active = XineramaIsActive(disp)))
|
||||
{
|
||||
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;
|
||||
|
||||
/* 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 */
|
||||
if(xinerama_screen_number != si->nscreen)
|
||||
{
|
||||
Area *newgeometry = p_new(Area, si->nscreen);
|
||||
memcpy(newgeometry, si->geometry, si->nscreen * sizeof(Area));
|
||||
area_t *newgeometry = p_new(area_t, si->nscreen);
|
||||
memcpy(newgeometry, si->geometry, si->nscreen * sizeof(area_t));
|
||||
p_delete(&si->geometry);
|
||||
si->geometry = newgeometry;
|
||||
}
|
||||
|
@ -117,7 +117,7 @@ screensinfo_new(Display *disp)
|
|||
else
|
||||
{
|
||||
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++)
|
||||
{
|
||||
si->geometry[screen].x = 0;
|
||||
|
|
|
@ -28,7 +28,7 @@ typedef struct
|
|||
{
|
||||
int nscreen;
|
||||
Bool xinerama_is_active;
|
||||
Area *geometry;
|
||||
area_t *geometry;
|
||||
} ScreensInfo;
|
||||
|
||||
int screen_get_bycoord(ScreensInfo *, int, int, int);
|
||||
|
|
2
event.c
2
event.c
|
@ -161,7 +161,7 @@ event_handle_configurerequest(XEvent * e)
|
|||
XConfigureRequestEvent *ev = &e->xconfigurerequest;
|
||||
XWindowChanges wc;
|
||||
int old_screen;
|
||||
Area geometry;
|
||||
area_t geometry;
|
||||
|
||||
if((c = client_get_bywin(globalconf.clients, ev->window)))
|
||||
{
|
||||
|
|
2
ewmh.c
2
ewmh.c
|
@ -251,7 +251,7 @@ ewmh_process_state_atom(Client *c, Atom state, int set)
|
|||
}
|
||||
else if(state == net_wm_state_fullscreen)
|
||||
{
|
||||
Area geometry = c->geometry;
|
||||
area_t geometry = c->geometry;
|
||||
if(set == _NET_WM_STATE_REMOVE)
|
||||
{
|
||||
/* restore geometry */
|
||||
|
|
|
@ -32,7 +32,7 @@ layout_fibonacci(int screen, int shape)
|
|||
{
|
||||
int n = 0, i = 0;
|
||||
Client *c;
|
||||
Area geometry, area;
|
||||
area_t geometry, area;
|
||||
geometry = area = screen_get_area(screen,
|
||||
globalconf.screens[screen].statusbar,
|
||||
&globalconf.screens[screen].padding);
|
||||
|
|
|
@ -31,7 +31,7 @@ void
|
|||
layout_max(int screen)
|
||||
{
|
||||
Client *c;
|
||||
Area area = screen_get_area(screen,
|
||||
area_t area = screen_get_area(screen,
|
||||
globalconf.screens[screen].statusbar,
|
||||
&globalconf.screens[screen].padding);
|
||||
|
||||
|
|
|
@ -133,7 +133,7 @@ _tile(int screen, const Position position)
|
|||
unsigned int mw = 0, mh = 0;
|
||||
int n, i, masterwin = 0, otherwin = 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;
|
||||
Tag **curtags = tags_get_current(screen);
|
||||
|
||||
|
|
4
mouse.c
4
mouse.c
|
@ -48,7 +48,7 @@ uicb_client_movemouse(int screen, char *arg __attribute__ ((unused)))
|
|||
unsigned int dui;
|
||||
Window dummy, child;
|
||||
XEvent ev;
|
||||
Area area, geometry;
|
||||
area_t area, geometry;
|
||||
Client *c = globalconf.focus->client, *target;
|
||||
Layout *layout = layout_get_current(screen);
|
||||
|
||||
|
@ -150,7 +150,7 @@ uicb_client_resizemouse(int screen, char *arg __attribute__ ((unused)))
|
|||
Client *c = globalconf.focus->client;
|
||||
Tag **curtags = tags_get_current(screen);
|
||||
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;
|
||||
|
||||
/* only handle floating and tiled layouts */
|
||||
|
|
22
placement.c
22
placement.c
|
@ -32,10 +32,10 @@ name_func_link_t FloatingPlacementList[] =
|
|||
{ NULL, NULL }
|
||||
};
|
||||
|
||||
static Area
|
||||
placement_fix_offscreen(Area geometry, int screen, int border)
|
||||
static area_t
|
||||
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,
|
||||
globalconf.screens[screen].statusbar,
|
||||
|
@ -60,15 +60,15 @@ placement_fix_offscreen(Area geometry, int screen, int border)
|
|||
* \param screen screen used
|
||||
* \return new geometry
|
||||
*/
|
||||
Area
|
||||
placement_smart(Area geometry, int border, int screen)
|
||||
area_t
|
||||
placement_smart(area_t geometry, int border, int screen)
|
||||
{
|
||||
Client *c;
|
||||
Area newgeometry = { 0, 0, 0, 0, NULL, NULL };
|
||||
Area *screen_geometry, *arealist = NULL, *r;
|
||||
area_t newgeometry = { 0, 0, 0, 0, NULL, NULL };
|
||||
area_t *screen_geometry, *arealist = NULL, *r;
|
||||
Bool found = False;
|
||||
|
||||
screen_geometry = p_new(Area, 1);
|
||||
screen_geometry = p_new(area_t, 1);
|
||||
|
||||
*screen_geometry = screen_get_area(screen,
|
||||
globalconf.screens[screen].statusbar,
|
||||
|
@ -116,13 +116,13 @@ placement_smart(Area geometry, int border, int screen)
|
|||
return newgeometry;
|
||||
}
|
||||
|
||||
Area
|
||||
placement_under_mouse(Area geometry, int border, int screen)
|
||||
area_t
|
||||
placement_under_mouse(area_t geometry, int border, int screen)
|
||||
{
|
||||
Window dummy;
|
||||
unsigned int m;
|
||||
int x, y, d;
|
||||
Area finalgeometry = geometry;
|
||||
area_t finalgeometry = geometry;
|
||||
|
||||
if(XQueryPointer(globalconf.display, RootWindow(globalconf.display, get_phys_screen(screen)),
|
||||
&dummy, &dummy, &x, &y, &d, &d, &m))
|
||||
|
|
18
screen.c
18
screen.c
|
@ -31,12 +31,12 @@ extern AwesomeConf globalconf;
|
|||
* \param screen Screen number
|
||||
* \param statusbar statusbar
|
||||
* \param padding Padding
|
||||
* \return Area
|
||||
* \return area_t
|
||||
*/
|
||||
Area
|
||||
area_t
|
||||
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;
|
||||
|
||||
/* make padding corrections */
|
||||
|
@ -72,12 +72,12 @@ screen_get_area(int screen, Statusbar *statusbar, Padding *padding)
|
|||
* \param screen Screen number
|
||||
* \param statusbar the statusbar
|
||||
* \param padding Padding
|
||||
* \return Area
|
||||
* \return area_t
|
||||
*/
|
||||
Area
|
||||
area_t
|
||||
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;
|
||||
|
||||
area.width = DisplayWidth(globalconf.display, screen);
|
||||
|
@ -124,7 +124,7 @@ move_client_to_screen(Client *c, int new_screen, Bool doresize)
|
|||
{
|
||||
Tag *tag;
|
||||
int old_screen = c->screen;
|
||||
Area from, to;
|
||||
area_t from, to;
|
||||
|
||||
for(tag = globalconf.screens[old_screen].tags; tag; tag = tag->next)
|
||||
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 */
|
||||
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;
|
||||
|
||||
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)
|
||||
{
|
||||
Area area = screen_get_area(phys_screen, NULL, NULL);
|
||||
area_t area = screen_get_area(phys_screen, NULL, NULL);
|
||||
XWarpPointer(globalconf.display,
|
||||
None,
|
||||
DefaultRootWindow(globalconf.display),
|
||||
|
|
4
screen.h
4
screen.h
|
@ -24,8 +24,8 @@
|
|||
|
||||
#include "structs.h"
|
||||
|
||||
Area screen_get_area(int, Statusbar *, Padding *);
|
||||
Area get_display_area(int, Statusbar *, Padding *);
|
||||
area_t screen_get_area(int, Statusbar *, Padding *);
|
||||
area_t get_display_area(int, Statusbar *, Padding *);
|
||||
int get_phys_screen(int);
|
||||
void move_client_to_screen(Client *, int, Bool);
|
||||
|
||||
|
|
|
@ -33,7 +33,7 @@ extern AwesomeConf globalconf;
|
|||
static void
|
||||
statusbar_update_position(Statusbar *statusbar)
|
||||
{
|
||||
Area area;
|
||||
area_t area;
|
||||
|
||||
XMapRaised(globalconf.display, statusbar->sw->window);
|
||||
|
||||
|
@ -74,7 +74,7 @@ statusbar_draw(Statusbar *statusbar)
|
|||
int phys_screen = get_phys_screen(statusbar->screen);
|
||||
Widget *widget;
|
||||
int left = 0, right = 0;
|
||||
Area rectangle = { 0, 0, 0, 0, NULL, NULL };
|
||||
area_t rectangle = { 0, 0, 0, 0, NULL, NULL };
|
||||
Drawable d;
|
||||
|
||||
/* don't waste our time */
|
||||
|
@ -178,7 +178,7 @@ statusbar_init(Statusbar *statusbar)
|
|||
{
|
||||
Statusbar *sb;
|
||||
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].padding);
|
||||
|
||||
|
|
12
structs.h
12
structs.h
|
@ -126,8 +126,8 @@ struct Widget
|
|||
/** True if user supplied coords */
|
||||
Bool user_supplied_x;
|
||||
Bool user_supplied_y;
|
||||
/** Area */
|
||||
Area area;
|
||||
/** area_t */
|
||||
area_t area;
|
||||
/** Buttons bindings */
|
||||
Button *buttons;
|
||||
/** Cache */
|
||||
|
@ -170,11 +170,11 @@ struct Client
|
|||
/** Client name */
|
||||
char name[256];
|
||||
/** Window geometry */
|
||||
Area geometry;
|
||||
area_t geometry;
|
||||
/** Floating window geometry */
|
||||
Area f_geometry;
|
||||
area_t f_geometry;
|
||||
/** Max window geometry */
|
||||
Area m_geometry;
|
||||
area_t m_geometry;
|
||||
int basew, baseh, incw, inch, maxw, maxh, minw, minh;
|
||||
int minax, maxax, minay, maxay;
|
||||
int border, oldborder;
|
||||
|
@ -257,7 +257,7 @@ typedef struct
|
|||
int right;
|
||||
} Padding;
|
||||
|
||||
typedef Area (FloatingPlacement)(Area, int, int);
|
||||
typedef area_t (FloatingPlacement)(area_t, int, int);
|
||||
typedef struct
|
||||
{
|
||||
/** Number of pixels to snap windows */
|
||||
|
|
|
@ -32,7 +32,7 @@ static int
|
|||
focusicon_draw(Widget *widget, DrawCtx *ctx, int offset,
|
||||
int used __attribute__ ((unused)))
|
||||
{
|
||||
Area area;
|
||||
area_t area;
|
||||
Rule* r;
|
||||
Client *sel = focus_get_current_client(widget->statusbar->screen);
|
||||
NetWMIcon *icon;
|
||||
|
|
|
@ -86,7 +86,7 @@ graph_draw(Widget *widget, DrawCtx *ctx, int offset,
|
|||
int margin_top, left_offset;
|
||||
int z, y, x, tmp, cur_index, test_index;
|
||||
Data *d = widget->data;
|
||||
Area rectangle, pattern_area;
|
||||
area_t rectangle, pattern_area;
|
||||
|
||||
if(!d->data_items)
|
||||
return 0;
|
||||
|
|
|
@ -35,7 +35,7 @@ iconbox_draw(Widget *widget, DrawCtx *ctx, int offset,
|
|||
int used __attribute__ ((unused)))
|
||||
{
|
||||
Data *d = widget->data;
|
||||
Area area = draw_get_image_size(d->image);
|
||||
area_t area = draw_get_image_size(d->image);
|
||||
|
||||
/* image not valid */
|
||||
if(area.width < 0 || area.height < 0)
|
||||
|
|
|
@ -34,7 +34,7 @@ layoutinfo_draw(Widget *widget,
|
|||
int used __attribute__ ((unused)))
|
||||
{
|
||||
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)
|
||||
widget->area.x = widget_calculate_offset(widget->statusbar->width,
|
||||
|
|
|
@ -63,7 +63,7 @@ progressbar_draw(Widget *widget, DrawCtx *ctx, int offset,
|
|||
int used __attribute__ ((unused)))
|
||||
{
|
||||
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;
|
||||
|
||||
|
|
|
@ -80,7 +80,7 @@ taglist_draw(Widget *widget,
|
|||
VirtScreen vscreen = globalconf.screens[widget->statusbar->screen];
|
||||
int w = 0, flagsize;
|
||||
style_t style;
|
||||
Area area;
|
||||
area_t area;
|
||||
|
||||
flagsize = (vscreen.styles.normal.font->height + 2) / 3;
|
||||
|
||||
|
@ -119,7 +119,7 @@ taglist_draw(Widget *widget,
|
|||
|
||||
if(isoccupied(tag))
|
||||
{
|
||||
Area rectangle = { widget->area.x + widget->area.width,
|
||||
area_t rectangle = { widget->area.x + widget->area.width,
|
||||
widget->area.y,
|
||||
flagsize,
|
||||
flagsize,
|
||||
|
|
|
@ -82,7 +82,7 @@ tasklist_draw(Widget *widget, DrawCtx *ctx, int offset, int used)
|
|||
Data *d = widget->data;
|
||||
Client *sel = focus_get_current_client(widget->statusbar->screen);
|
||||
Rule *r;
|
||||
Area area;
|
||||
area_t area;
|
||||
style_t style;
|
||||
int n = 0, i = 0, box_width = 0, icon_width = 0, box_width_rest = 0;
|
||||
NetWMIcon *icon;
|
||||
|
|
2
window.c
2
window.c
|
@ -74,7 +74,7 @@ window_getstate(Window w)
|
|||
* \return the XSendEvent() status
|
||||
*/
|
||||
Status
|
||||
window_configure(Window win, Area geometry, int border)
|
||||
window_configure(Window win, area_t geometry, int border)
|
||||
{
|
||||
XConfigureEvent ce;
|
||||
|
||||
|
|
Loading…
Reference in New Issue