static ObDock *dock;
-Strut dock_strut;
+StrutPartial dock_strut;
void dock_startup()
{
XSetWindowAttributes attrib;
- STRUT_SET(dock_strut, 0, 0, 0, 0);
+ STRUT_PARTIAL_SET(dock_strut, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0);
dock = g_new0(ObDock, 1);
dock->obwin.type = Window_Dock;
}
if (!config_dock_floating && config_dock_hide) {
- strw = strh = ob_rr_theme->bwidth;
+ strw = ob_rr_theme->bwidth;
+ strh = ob_rr_theme->bwidth;
} else {
strw = dock->w;
strh = dock->h;
/* set the strut */
if (config_dock_floating) {
- STRUT_SET(dock_strut, 0, 0, 0, 0);
+ STRUT_PARTIAL_SET(dock_strut, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0);
} else {
switch (config_dock_pos) {
case OB_DIRECTION_NORTHWEST:
switch (config_dock_orient) {
case OB_ORIENTATION_HORZ:
- STRUT_SET(dock_strut, 0, strh, 0, 0);
+ STRUT_PARTIAL_SET(dock_strut, 0, strh, 0, 0,
+ 0, 0, dock->x, dock->x + dock->w - 1,
+ 0, 0, 0, 0);
break;
case OB_ORIENTATION_VERT:
- STRUT_SET(dock_strut, strw, 0, 0, 0);
+ STRUT_PARTIAL_SET(dock_strut, strw, 0, 0, 0,
+ dock->y, dock->y + dock->h - 1,
+ 0, 0, 0, 0, 0, 0);
break;
}
break;
case OB_DIRECTION_NORTH:
- STRUT_SET(dock_strut, 0, strh, 0, 0);
+ STRUT_PARTIAL_SET(dock_strut, 0, strh, 0, 0,
+ dock->x, dock->x + dock->w - 1,
+ 0, 0, 0, 0, 0, 0);
break;
case OB_DIRECTION_NORTHEAST:
switch (config_dock_orient) {
case OB_ORIENTATION_HORZ:
- STRUT_SET(dock_strut, 0, strh, 0, 0);
+ STRUT_PARTIAL_SET(dock_strut, 0, strh, 0, 0,
+ 0, 0, dock->x, dock->x + dock->w -1,
+ 0, 0, 0, 0);
break;
case OB_ORIENTATION_VERT:
- STRUT_SET(dock_strut, 0, 0, strw, 0);
+ STRUT_PARTIAL_SET(dock_strut, 0, 0, strw, 0,
+ 0, 0, 0, 0,
+ dock->y, dock->y + dock->h - 1, 0, 0);
break;
}
break;
case OB_DIRECTION_WEST:
- STRUT_SET(dock_strut, strw, 0, 0, 0);
+ STRUT_PARTIAL_SET(dock_strut, strw, 0, 0, 0,
+ dock->y, dock->y + dock->h - 1,
+ 0, 0, 0, 0, 0, 0);
break;
case OB_DIRECTION_EAST:
- STRUT_SET(dock_strut, 0, 0, strw, 0);
+ STRUT_PARTIAL_SET(dock_strut, 0, 0, strw, 0,
+ 0, 0, 0, 0,
+ dock->y, dock->y + dock->h - 1, 0, 0);
break;
case OB_DIRECTION_SOUTHWEST:
switch (config_dock_orient) {
case OB_ORIENTATION_HORZ:
- STRUT_SET(dock_strut, 0, 0, 0, strh);
+ STRUT_PARTIAL_SET(dock_strut, 0, 0, 0, strh,
+ 0, 0, 0, 0, 0, 0,
+ dock->x, dock->x + dock->w - 1);
break;
case OB_ORIENTATION_VERT:
- STRUT_SET(dock_strut, strw, 0, 0, 0);
+ STRUT_PARTIAL_SET(dock_strut, strw, 0, 0, 0,
+ dock->y, dock->y + dock->h - 1,
+ 0, 0, 0, 0, 0, 0);
break;
}
break;
case OB_DIRECTION_SOUTH:
- STRUT_SET(dock_strut, 0, 0, 0, strh);
+ STRUT_PARTIAL_SET(dock_strut, 0, 0, 0, strh,
+ 0, 0, 0, 0, 0, 0,
+ dock->x, dock->x + dock->w - 1);
break;
case OB_DIRECTION_SOUTHEAST:
switch (config_dock_orient) {
case OB_ORIENTATION_HORZ:
- STRUT_SET(dock_strut, 0, 0, 0, strh);
+ STRUT_PARTIAL_SET(dock_strut, 0, 0, 0, strh,
+ 0, 0, 0, 0, 0, 0,
+ dock->x, dock->x + dock->w - 1);
break;
case OB_ORIENTATION_VERT:
- STRUT_SET(dock_strut, 0, 0, strw, 0);
+ STRUT_PARTIAL_SET(dock_strut, 0, 0, strw, 0,
+ 0, 0, 0, 0,
+ dock->y, dock->y + dock->h - 1, 0, 0);
break;
}
break;
#ifndef __geom_h
#define __geom_h
-typedef struct Point {
+typedef struct _Point {
int x;
int y;
} Point;
#define POINT_SET(pt, nx, ny) (pt).x = (nx), (pt).y = (ny)
-typedef struct Size {
+typedef struct _Size {
int width;
int height;
} Size;
#define SIZE_SET(sz, w, h) (sz).width = (w), (sz).height = (h)
-typedef struct Rect {
+typedef struct _Rect {
int x;
int y;
int width;
((o).x < (r).x + (r).width && (o).x + (o).width > (r).x && \
(o).y < (r).y + (r).height && (o).y + (o).height > (r).y)
-typedef struct Strut {
+typedef struct _Strut {
int left;
int top;
int right;
int bottom;
} Strut;
+typedef struct _StrutPartial {
+ int left;
+ int top;
+ int right;
+ int bottom;
+
+ int left_start, left_end;
+ int top_start, top_end;
+ int right_start, right_end;
+ int bottom_start, bottom_end;
+} StrutPartial;
+
#define STRUT_SET(s, l, t, r, b) \
(s).left = (l), (s).top = (t), (s).right = (r), (s).bottom = (b)
+#define STRUT_PARTIAL_SET(s, l, t, r, b, ls, le, ts, te, rs, re, bs, be) \
+ (s).left = (l), (s).top = (t), (s).right = (r), (s).bottom = (b), \
+ (s).left_start = (ls), (s).left_end = (le), \
+ (s).top_start = (ts), (s).top_end = (te), \
+ (s).right_start = (rs), (s).right_end = (re), \
+ (s).bottom_start = (bs), (s).bottom_end = (be)
+
#define STRUT_ADD(s1, s2) \
(s1).left = MAX((s1).left, (s2).left), \
(s1).right = MAX((s1).right, (s2).right), \