marco 1.29.1
Window manager
Loading...
Searching...
No Matches
boxes.h File Reference
View source
#include <glib.h>
#include "common.h"
Include dependency graph for boxes.h:
This graph shows which files directly or indirectly include this file:

Data Structures

struct  _MetaRectangle
 
struct  _MetaStrut
 
struct  _MetaEdge
 

Macros

#define BOX_LEFT(box)   ((box).x) /* Leftmost pixel of rect */
 
#define BOX_RIGHT(box)   ((box).x + (box).width) /* One pixel past right */
 
#define BOX_TOP(box)   ((box).y) /* Topmost pixel of rect */
 
#define BOX_BOTTOM(box)   ((box).y + (box).height) /* One pixel past bottom */
 
#define RECT_LENGTH   27
 
#define EDGE_LENGTH   37
 

Typedefs

typedef struct _MetaRectangle MetaRectangle
 
typedef struct _MetaStrut MetaStrut
 
typedef struct _MetaEdge MetaEdge
 

Enumerations

enum  MetaEdgeType { META_EDGE_WINDOW , META_EDGE_XINERAMA , META_EDGE_SCREEN }
 
enum  FixedDirections { FIXED_DIRECTION_NONE = 0 , FIXED_DIRECTION_X = 1 << 0 , FIXED_DIRECTION_Y = 1 << 1 }
 

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)
 
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)
 
gint meta_rectangle_edge_cmp (gconstpointer a, gconstpointer b)
 
gint meta_rectangle_edge_cmp_ignore_type (gconstpointer a, gconstpointer b)
 
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)
 

Macro Definition Documentation

◆ BOX_BOTTOM

#define BOX_BOTTOM (   box)    ((box).y + (box).height) /* One pixel past bottom */

◆ BOX_LEFT

#define BOX_LEFT (   box)    ((box).x) /* Leftmost pixel of rect */

◆ BOX_RIGHT

#define BOX_RIGHT (   box)    ((box).x + (box).width) /* One pixel past right */

◆ BOX_TOP

#define BOX_TOP (   box)    ((box).y) /* Topmost pixel of rect */

◆ EDGE_LENGTH

#define EDGE_LENGTH   37

◆ RECT_LENGTH

#define RECT_LENGTH   27

Typedef Documentation

◆ MetaEdge

typedef struct _MetaEdge MetaEdge

◆ MetaRectangle

typedef struct _MetaRectangle MetaRectangle

◆ MetaStrut

typedef struct _MetaStrut MetaStrut

Enumeration Type Documentation

◆ FixedDirections

Enumerator
FIXED_DIRECTION_NONE 
FIXED_DIRECTION_X 
FIXED_DIRECTION_Y 

◆ MetaEdgeType

Enumerator
META_EDGE_WINDOW 
META_EDGE_XINERAMA 
META_EDGE_SCREEN 

Function Documentation

◆ 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 
)