void get_shaded_client_window_pos( FvwmWindow *fw, rectangle *ret_g) { rectangle big_g; size_borders b; get_window_borders(fw, &b); big_g = (IS_MAXIMIZED(fw)) ? fw->g.max : fw->g.normal; get_relative_geometry(&big_g, &big_g); switch (SHADED_DIR(fw)) { case DIR_S: case DIR_SW: case DIR_SE: ret_g->y = 1 - big_g.height + b.total_size.height; break; default: ret_g->y = 0; break; } switch (SHADED_DIR(fw)) { case DIR_E: case DIR_NE: case DIR_SE: ret_g->x = 1 - big_g.width + b.total_size.width; break; default: ret_g->x = 0; break; } return; }
/* update the g.normal or g.max according to the window's current position */ void update_absolute_geometry(MvwmWindow *fw) { rectangle *dest_g; rectangle frame_g; struct monitor *m = fw->m; if (m == NULL) m = monitor_get_current(); /* store orig values in absolute coords */ dest_g = (IS_MAXIMIZED(fw)) ? &fw->g.max : &fw->g.normal; frame_g = *dest_g; dest_g->x = fw->g.frame.x + m->virtual_scr.Vx; dest_g->y = fw->g.frame.y + m->virtual_scr.Vy; dest_g->width = fw->g.frame.width; dest_g->height = fw->g.frame.height; if (IS_SHADED(fw)) { switch (SHADED_DIR(fw)) { case DIR_SW: case DIR_S: case DIR_SE: dest_g->y += fw->g.frame.height - frame_g.height; /* fall through */ case DIR_NW: case DIR_N: case DIR_NE: dest_g->height = frame_g.height; break; } switch (SHADED_DIR(fw)) { case DIR_NE: case DIR_E: case DIR_SE: dest_g->x += fw->g.frame.width - frame_g.width; /* fall through */ case DIR_NW: case DIR_W: case DIR_SW: dest_g->width = frame_g.width; break; } } return; }
void get_shaded_geometry_with_dir( FvwmWindow *fw, rectangle *small_g, rectangle *big_g, direction_t shade_dir) { direction_t old_shade_dir; old_shade_dir = SHADED_DIR(fw); SET_SHADED_DIR(fw, shade_dir); get_shaded_geometry(fw, small_g, big_g); SET_SHADED_DIR(fw, old_shade_dir); return; }
void get_shaded_geometry( FvwmWindow *fw, rectangle *small_g, rectangle *big_g) { size_borders b; /* this variable is necessary so the function can be called with * small_g == big_g */ int big_width = big_g->width; int big_height = big_g->height; int d; switch (SHADED_DIR(fw)) { case DIR_SW: case DIR_SE: case DIR_NW: case DIR_NE: get_window_borders_no_title(fw, &b); break; default: get_window_borders(fw, &b); break; } *small_g = *big_g; d = 0; switch (SHADED_DIR(fw)) { case DIR_S: case DIR_SW: case DIR_SE: small_g->y = big_g->y + big_height - b.total_size.height; d = 1; /* fall through */ case DIR_N: case DIR_NW: case DIR_NE: small_g->height = b.total_size.height; if (small_g->height == 0) { small_g->height = 1; small_g->y -= d; } break; default: break; } d = 0; switch (SHADED_DIR(fw)) { case DIR_E: case DIR_NE: case DIR_SE: small_g->x = big_g->x + big_width - b.total_size.width; d = 1; /* fall through */ case DIR_W: case DIR_NW: case DIR_SW: small_g->width = b.total_size.width; if (small_g->width == 0) { small_g->width = 1; small_g->x -= d; } break; default: break; } return; }