marco 1.29.1
Window manager
Loading...
Searching...
No Matches
boxes.c File Reference
View source
#include <config.h>
#include "boxes.h"
#include "util.h"
#include <X11/Xutil.h>
Include dependency graph for boxes.c:

Functions

char * meta_rectangle_to_string (const MetaRectangle *rect, char *output)
 
char * meta_rectangle_region_to_string (GList *region, const char *separator_string, char *output)
 
char * meta_rectangle_edge_to_string (const MetaEdge *edge, char *output)
 
char * meta_rectangle_edge_list_to_string (GList *edge_list, const char *separator_string, char *output)
 
MetaRectangle meta_rect (int x, int y, int width, int height)
 
int meta_rectangle_area (const MetaRectangle *rect)
 
gboolean meta_rectangle_intersect (const MetaRectangle *src1, const MetaRectangle *src2, MetaRectangle *dest)
 
gboolean meta_rectangle_equal (const MetaRectangle *src1, const MetaRectangle *src2)
 
void meta_rectangle_union (const MetaRectangle *rect1, const MetaRectangle *rect2, MetaRectangle *dest)
 
gboolean meta_rectangle_overlap (const MetaRectangle *rect1, const MetaRectangle *rect2)
 
gboolean meta_rectangle_vert_overlap (const MetaRectangle *rect1, const MetaRectangle *rect2)
 
gboolean meta_rectangle_horiz_overlap (const MetaRectangle *rect1, const MetaRectangle *rect2)
 
gboolean meta_rectangle_could_fit_rect (const MetaRectangle *outer_rect, const MetaRectangle *inner_rect)
 
gboolean meta_rectangle_contains_rect (const MetaRectangle *outer_rect, const MetaRectangle *inner_rect)
 
void meta_rectangle_resize_with_gravity (const MetaRectangle *old_rect, MetaRectangle *rect, int gravity, int new_width, int new_height)
 
static GList * merge_spanning_rects_in_region (GList *region)
 
static gint compare_rect_areas (gconstpointer a, gconstpointer b)
 
GList * meta_rectangle_get_minimal_spanning_set_for_region (const MetaRectangle *basic_rect, const GSList *all_struts, gboolean skip_middle_struts)
 
GList * meta_rectangle_expand_region (GList *region, const int left_expand, const int right_expand, const int top_expand, const int bottom_expand)
 
GList * meta_rectangle_expand_region_conditionally (GList *region, const int left_expand, const int right_expand, const int top_expand, const int bottom_expand, const int min_x, const int min_y)
 
void meta_rectangle_expand_to_avoiding_struts (MetaRectangle *rect, const MetaRectangle *expand_to, const MetaDirection direction, const GSList *all_struts)
 
gboolean meta_rectangle_could_fit_in_region (const GList *spanning_rects, const MetaRectangle *rect)
 
gboolean meta_rectangle_contained_in_region (const GList *spanning_rects, const MetaRectangle *rect)
 
gboolean meta_rectangle_overlaps_with_region (const GList *spanning_rects, const MetaRectangle *rect)
 
void meta_rectangle_clamp_to_fit_into_region (const GList *spanning_rects, FixedDirections fixed_directions, MetaRectangle *rect, const MetaRectangle *min_size)
 
void meta_rectangle_clip_to_region (const GList *spanning_rects, FixedDirections fixed_directions, MetaRectangle *rect)
 
void meta_rectangle_shove_into_region (const GList *spanning_rects, FixedDirections fixed_directions, MetaRectangle *rect)
 
void meta_rectangle_find_linepoint_closest_to_point (double x1, double y1, double x2, double y2, double px, double py, double *valx, double *valy)
 
gboolean meta_rectangle_edge_aligns (const MetaRectangle *rect, const MetaEdge *edge)
 
static GList * get_rect_minus_overlap (const GList *rect_in_list, MetaRectangle *overlap)
 
static GList * replace_rect_with_list (GList *old_element, GList *new_list)
 
static GList * get_disjoint_strut_rect_list_in_region (const GSList *old_struts, const MetaRectangle *region)
 
gint meta_rectangle_edge_cmp_ignore_type (gconstpointer a, gconstpointer b)
 
gint meta_rectangle_edge_cmp (gconstpointer a, gconstpointer b)
 
static gboolean edges_overlap (const MetaEdge *edge1, const MetaEdge *edge2)
 
static gboolean rectangle_and_edge_intersection (const MetaRectangle *rect, const MetaEdge *edge, MetaEdge *overlap, int *handle_type)
 
static GList * add_edges (GList *cur_edges, const MetaRectangle *rect, gboolean rect_is_internal)
 
static GList * split_edge (GList *cur_list, const MetaEdge *old_edge, const MetaEdge *remove)
 
static void fix_up_edges (MetaRectangle *rect, MetaEdge *edge, GList **strut_edges, GList **edge_splits, gboolean *edge_needs_removal)
 
GList * meta_rectangle_remove_intersections_with_boxes_from_edges (GList *edges, const GSList *rectangles)
 
GList * meta_rectangle_find_onscreen_edges (const MetaRectangle *basic_rect, const GSList *all_struts)
 
GList * meta_rectangle_find_nonintersected_xinerama_edges (const MetaRectangle *screen_rect, const GList *xinerama_rects, const GSList *all_struts)
 

Function Documentation

◆ add_edges()

◆ compare_rect_areas()

static gint compare_rect_areas ( gconstpointer  a,
gconstpointer  b 
)
static

References meta_rectangle_area().

Referenced by meta_rectangle_get_minimal_spanning_set_for_region().

Here is the call graph for this function:

◆ edges_overlap()

static gboolean edges_overlap ( const MetaEdge *  edge1,
const MetaEdge *  edge2 
)
static

References FALSE, _MetaRectangle::height, meta_rectangle_horiz_overlap(), meta_rectangle_vert_overlap(), _MetaEdge::rect, _MetaRectangle::width, _MetaRectangle::x, and _MetaRectangle::y.

Referenced by fix_up_edges().

Here is the call graph for this function:

◆ fix_up_edges()

static void fix_up_edges ( MetaRectangle *  rect,
MetaEdge *  edge,
GList **  strut_edges,
GList **  edge_splits,
gboolean *  edge_needs_removal 
)
static

References edges_overlap(), rectangle_and_edge_intersection(), split_edge(), and TRUE.

Referenced by meta_rectangle_find_onscreen_edges().

Here is the call graph for this function:

◆ get_disjoint_strut_rect_list_in_region()

static GList * get_disjoint_strut_rect_list_in_region ( const GSList *  old_struts,
const MetaRectangle *  region 
)
static

References get_rect_minus_overlap(), meta_rectangle_intersect(), NULL, and replace_rect_with_list().

Referenced by meta_rectangle_find_onscreen_edges().

Here is the call graph for this function:

◆ get_rect_minus_overlap()

static GList * get_rect_minus_overlap ( const GList *  rect_in_list,
MetaRectangle *  overlap 
)
static

◆ merge_spanning_rects_in_region()

static GList * merge_spanning_rects_in_region ( GList *  region)
static

References _MetaRectangle::height, meta_rectangle_contains_rect(), meta_rectangle_overlap(), meta_warning(), NULL, _MetaRectangle::width, _MetaRectangle::x, and _MetaRectangle::y.

Referenced by meta_rectangle_get_minimal_spanning_set_for_region().

Here is the call graph for this function:

◆ meta_rect()

◆ meta_rectangle_area()

◆ meta_rectangle_clamp_to_fit_into_region()

void meta_rectangle_clamp_to_fit_into_region ( const GList *  spanning_rects,
FixedDirections  fixed_directions,
MetaRectangle *  rect,
const MetaRectangle *  min_size 
)

References FIXED_DIRECTION_X, FIXED_DIRECTION_Y, _MetaRectangle::height, meta_warning(), NULL, _MetaRectangle::width, _MetaRectangle::x, and _MetaRectangle::y.

Referenced by do_screen_and_xinerama_relative_constraints(), and test_clamping_to_region().

Here is the call graph for this function:

◆ meta_rectangle_clip_to_region()

void meta_rectangle_clip_to_region ( const GList *  spanning_rects,
FixedDirections  fixed_directions,
MetaRectangle *  rect 
)

References FIXED_DIRECTION_X, FIXED_DIRECTION_Y, _MetaRectangle::height, meta_rectangle_area(), meta_rectangle_intersect(), meta_warning(), NULL, _MetaRectangle::width, _MetaRectangle::x, and _MetaRectangle::y.

Referenced by do_screen_and_xinerama_relative_constraints(), ensure_work_areas_validated(), and test_clipping_to_region().

Here is the call graph for this function:

◆ meta_rectangle_contained_in_region()

gboolean meta_rectangle_contained_in_region ( const GList *  spanning_rects,
const MetaRectangle *  rect 
)

References FALSE, meta_rectangle_contains_rect(), and NULL.

Referenced by do_screen_and_xinerama_relative_constraints(), test_clipping_to_region(), test_region_fitting(), test_shoving_into_region(), and update_onscreen_requirements().

Here is the call graph for this function:

◆ meta_rectangle_contains_rect()

◆ meta_rectangle_could_fit_in_region()

gboolean meta_rectangle_could_fit_in_region ( const GList *  spanning_rects,
const MetaRectangle *  rect 
)

References FALSE, meta_rectangle_could_fit_rect(), and NULL.

Referenced by do_screen_and_xinerama_relative_constraints(), test_clamping_to_region(), test_region_fitting(), and test_shoving_into_region().

Here is the call graph for this function:

◆ meta_rectangle_could_fit_rect()

gboolean meta_rectangle_could_fit_rect ( const MetaRectangle *  outer_rect,
const MetaRectangle *  inner_rect 
)

◆ meta_rectangle_edge_aligns()

gboolean meta_rectangle_edge_aligns ( const MetaRectangle *  rect,
const MetaEdge *  edge 
)

◆ meta_rectangle_edge_cmp()

gint meta_rectangle_edge_cmp ( gconstpointer  a,
gconstpointer  b 
)

References meta_rectangle_edge_cmp_ignore_type(), and _MetaEdge::side_type.

Referenced by compute_resistance_and_snapping_edges(), meta_rectangle_find_nonintersected_xinerama_edges(), and meta_rectangle_find_onscreen_edges().

Here is the call graph for this function:

◆ meta_rectangle_edge_cmp_ignore_type()

◆ meta_rectangle_edge_list_to_string()

char * meta_rectangle_edge_list_to_string ( GList *  edge_list,
const char *  separator_string,
char *  output 
)

◆ meta_rectangle_edge_to_string()

char * meta_rectangle_edge_to_string ( const MetaEdge *  edge,
char *  output 
)

◆ meta_rectangle_equal()

◆ meta_rectangle_expand_region()

GList * meta_rectangle_expand_region ( GList *  region,
const int  left_expand,
const int  right_expand,
const int  top_expand,
const int  bottom_expand 
)

References meta_rectangle_expand_region_conditionally().

Referenced by meta_window_shove_titlebar_onscreen().

Here is the call graph for this function:

◆ meta_rectangle_expand_region_conditionally()

GList * meta_rectangle_expand_region_conditionally ( GList *  region,
const int  left_expand,
const int  right_expand,
const int  top_expand,
const int  bottom_expand,
const int  min_x,
const int  min_y 
)

◆ meta_rectangle_expand_to_avoiding_struts()

void meta_rectangle_expand_to_avoiding_struts ( MetaRectangle *  rect,
const MetaRectangle *  expand_to,
const MetaDirection  direction,
const GSList *  all_struts 
)

References BOX_BOTTOM, BOX_LEFT, BOX_RIGHT, BOX_TOP, _MetaRectangle::height, META_DIRECTION_HORIZONTAL, META_DIRECTION_VERTICAL, meta_rectangle_overlap(), META_SIDE_BOTTOM, META_SIDE_LEFT, META_SIDE_RIGHT, META_SIDE_TOP, _MetaStrut::rect, _MetaStrut::side, _MetaRectangle::width, _MetaRectangle::x, and _MetaRectangle::y.

Referenced by constrain_maximization().

Here is the call graph for this function:

◆ meta_rectangle_find_linepoint_closest_to_point()

void meta_rectangle_find_linepoint_closest_to_point ( double  x1,
double  y1,
double  x2,
double  y2,
double  px,
double  py,
double *  valx,
double *  valy 
)

◆ meta_rectangle_find_nonintersected_xinerama_edges()

GList * meta_rectangle_find_nonintersected_xinerama_edges ( const MetaRectangle *  screen_rect,
const GList *  xinerama_rects,
const GSList *  all_struts 
)

◆ meta_rectangle_find_onscreen_edges()

GList * meta_rectangle_find_onscreen_edges ( const MetaRectangle *  basic_rect,
const GSList *  all_struts 
)

References add_edges(), FALSE, fix_up_edges(), get_disjoint_strut_rect_list_in_region(), meta_rectangle_edge_cmp(), NULL, and TRUE.

Referenced by ensure_work_areas_validated(), and get_screen_edges().

Here is the call graph for this function:

◆ meta_rectangle_get_minimal_spanning_set_for_region()

GList * meta_rectangle_get_minimal_spanning_set_for_region ( const MetaRectangle *  basic_rect,
const GSList *  all_struts,
gboolean  skip_middle_struts 
)

◆ meta_rectangle_horiz_overlap()

gboolean meta_rectangle_horiz_overlap ( const MetaRectangle *  rect1,
const MetaRectangle *  rect2 
)

◆ meta_rectangle_intersect()

◆ meta_rectangle_overlap()

◆ meta_rectangle_overlaps_with_region()

gboolean meta_rectangle_overlaps_with_region ( const GList *  spanning_rects,
const MetaRectangle *  rect 
)

References FALSE, meta_rectangle_overlap(), and NULL.

Referenced by update_onscreen_requirements().

Here is the call graph for this function:

◆ meta_rectangle_region_to_string()

char * meta_rectangle_region_to_string ( GList *  region,
const char *  separator_string,
char *  output 
)

◆ meta_rectangle_remove_intersections_with_boxes_from_edges()

GList * meta_rectangle_remove_intersections_with_boxes_from_edges ( GList *  edges,
const GSList *  rectangles 
)

References FALSE, rectangle_and_edge_intersection(), split_edge(), and TRUE.

Referenced by compute_resistance_and_snapping_edges(), and meta_rectangle_find_nonintersected_xinerama_edges().

Here is the call graph for this function:

◆ meta_rectangle_resize_with_gravity()

◆ meta_rectangle_shove_into_region()

void meta_rectangle_shove_into_region ( const GList *  spanning_rects,
FixedDirections  fixed_directions,
MetaRectangle *  rect 
)

References FIXED_DIRECTION_X, FIXED_DIRECTION_Y, _MetaRectangle::height, meta_warning(), NULL, _MetaRectangle::width, _MetaRectangle::x, and _MetaRectangle::y.

Referenced by do_screen_and_xinerama_relative_constraints(), meta_window_shove_titlebar_onscreen(), and test_shoving_into_region().

Here is the call graph for this function:

◆ meta_rectangle_to_string()

char * meta_rectangle_to_string ( const MetaRectangle *  rect,
char *  output 
)

◆ meta_rectangle_union()

void meta_rectangle_union ( const MetaRectangle *  rect1,
const MetaRectangle *  rect2,
MetaRectangle *  dest 
)

◆ meta_rectangle_vert_overlap()

gboolean meta_rectangle_vert_overlap ( const MetaRectangle *  rect1,
const MetaRectangle *  rect2 
)

◆ rectangle_and_edge_intersection()

◆ replace_rect_with_list()

static GList * replace_rect_with_list ( GList *  old_element,
GList *  new_list 
)
static

References NULL.

Referenced by get_disjoint_strut_rect_list_in_region().

◆ split_edge()

static GList * split_edge ( GList *  cur_list,
const MetaEdge *  old_edge,
const MetaEdge *  remove 
)
static