Go to the source code of this file.
Data Structures | |
| struct | _MetaRectangle |
| struct | _MetaStrut |
| struct | _MetaEdge |
Defines | |
| #define | BOX_LEFT(box) ((box).x) |
| #define | BOX_RIGHT(box) ((box).x + (box).width) |
| #define | BOX_TOP(box) ((box).y) |
| #define | BOX_BOTTOM(box) ((box).y + (box).height) |
| #define | RECT_LENGTH 27 |
| #define | EDGE_LENGTH 37 |
Typedefs | |
| typedef struct _MetaRectangle | MetaRectangle |
| typedef struct _MetaStrut | MetaStrut |
| typedef struct _MetaEdge | MetaEdge |
Enumerations | |
| enum | FixedDirections { FIXED_DIRECTION_NONE = 0, FIXED_DIRECTION_X = 1 << 0, FIXED_DIRECTION_Y = 1 << 1 } |
| enum | MetaEdgeType { META_EDGE_WINDOW, META_EDGE_XINERAMA, META_EDGE_SCREEN } |
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) |
| 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) |
| 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) |
| void | meta_rectangle_free_list_and_elements (GList *filled_list) |
| 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 GList *xinerama_rects, const GSList *all_struts) |
| #define BOX_BOTTOM | ( | box | ) | ((box).y + (box).height) |
Definition at line 49 of file boxes.h.
Referenced by apply_edge_resistance_to_each_side(), get_rect_minus_overlap(), meta_rectangle_edge_aligns(), meta_rectangle_expand_to_avoiding_struts(), meta_rectangle_find_nonintersected_xinerama_edges(), meta_rectangle_get_minimal_spanning_set_for_region(), meta_window_edge_resistance_for_move(), meta_window_update_struts(), rectangle_and_edge_intersection(), and split_edge().
| #define BOX_LEFT | ( | box | ) | ((box).x) |
Definition at line 46 of file boxes.h.
Referenced by apply_edge_resistance_to_each_side(), get_rect_minus_overlap(), meta_rectangle_edge_aligns(), meta_rectangle_expand_to_avoiding_struts(), meta_rectangle_find_nonintersected_xinerama_edges(), meta_rectangle_get_minimal_spanning_set_for_region(), meta_window_edge_resistance_for_move(), and split_edge().
| #define BOX_RIGHT | ( | box | ) | ((box).x + (box).width) |
Definition at line 47 of file boxes.h.
Referenced by apply_edge_resistance_to_each_side(), get_rect_minus_overlap(), meta_rectangle_edge_aligns(), meta_rectangle_expand_to_avoiding_struts(), meta_rectangle_find_nonintersected_xinerama_edges(), meta_rectangle_get_minimal_spanning_set_for_region(), meta_window_edge_resistance_for_move(), meta_window_update_struts(), rectangle_and_edge_intersection(), and split_edge().
| #define BOX_TOP | ( | box | ) | ((box).y) |
Definition at line 48 of file boxes.h.
Referenced by apply_edge_resistance_to_each_side(), get_rect_minus_overlap(), meta_rectangle_edge_aligns(), meta_rectangle_expand_to_avoiding_struts(), meta_rectangle_find_nonintersected_xinerama_edges(), meta_rectangle_get_minimal_spanning_set_for_region(), meta_window_edge_resistance_for_move(), and split_edge().
| #define EDGE_LENGTH 37 |
Definition at line 82 of file boxes.h.
Referenced by cache_edges(), meta_rectangle_edge_list_to_string(), meta_rectangle_edge_to_string(), test_find_nonintersected_xinerama_edges(), and test_find_onscreen_edges().
| #define RECT_LENGTH 27 |
Definition at line 81 of file boxes.h.
Referenced by find_first_fit(), meta_rectangle_region_to_string(), meta_rectangle_to_string(), and test_regions_okay().
| typedef struct _MetaRectangle MetaRectangle |
| typedef struct _MetaStrut MetaStrut |
| enum FixedDirections |
| enum MetaEdgeType |
| MetaRectangle meta_rect | ( | int | x, | |
| int | y, | |||
| int | width, | |||
| int | height | |||
| ) |
Definition at line 135 of file boxes.c.
References _MetaRectangle::height, _MetaRectangle::width, _MetaRectangle::x, and _MetaRectangle::y.
Referenced by apply_edge_resistance_to_each_side(), ensure_work_areas_validated(), get_screen_edges(), get_screen_region(), meta_frame_style_draw(), meta_rectangle_find_nonintersected_xinerama_edges(), new_meta_strut(), run_position_expression_tests(), test_area(), test_basic_fitting(), test_clamping_to_region(), test_clipping_to_region(), test_gravity_resize(), test_intersect(), test_overlap_funcs(), test_region_fitting(), and test_shoving_into_region().
| int meta_rectangle_area | ( | const MetaRectangle * | rect | ) |
Definition at line 147 of file boxes.c.
References _MetaRectangle::height, NULL, and _MetaRectangle::width.
Referenced by compare_rect_areas(), meta_rectangle_clip_to_region(), meta_screen_get_xinerama_for_rect(), meta_window_titlebar_is_onscreen(), test_area(), and test_intersect().
| void meta_rectangle_clamp_to_fit_into_region | ( | const GList * | spanning_rects, | |
| FixedDirections | fixed_directions, | |||
| MetaRectangle * | rect, | |||
| const MetaRectangle * | min_size | |||
| ) |
Definition at line 798 of file boxes.c.
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().
| void meta_rectangle_clip_to_region | ( | const GList * | spanning_rects, | |
| FixedDirections | fixed_directions, | |||
| MetaRectangle * | rect | |||
| ) |
Definition at line 868 of file boxes.c.
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().
| gboolean meta_rectangle_contained_in_region | ( | const GList * | spanning_rects, | |
| const MetaRectangle * | rect | |||
| ) |
Definition at line 761 of file boxes.c.
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().
| gboolean meta_rectangle_contains_rect | ( | const MetaRectangle * | outer_rect, | |
| const MetaRectangle * | inner_rect | |||
| ) |
Definition at line 238 of file boxes.c.
References _MetaRectangle::height, _MetaRectangle::width, _MetaRectangle::x, and _MetaRectangle::y.
Referenced by find_first_fit(), merge_spanning_rects_in_region(), meta_rectangle_contained_in_region(), meta_screen_get_current_xinerama(), and test_basic_fitting().
| gboolean meta_rectangle_could_fit_in_region | ( | const GList * | spanning_rects, | |
| const MetaRectangle * | rect | |||
| ) |
Definition at line 743 of file boxes.c.
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().
| gboolean meta_rectangle_could_fit_rect | ( | const MetaRectangle * | outer_rect, | |
| const MetaRectangle * | inner_rect | |||
| ) |
Definition at line 230 of file boxes.c.
References _MetaRectangle::height, and _MetaRectangle::width.
Referenced by constrain_fullscreen(), constrain_size_limits(), meta_rectangle_could_fit_in_region(), and test_basic_fitting().
| gboolean meta_rectangle_edge_aligns | ( | const MetaRectangle * | rect, | |
| const MetaEdge * | edge | |||
| ) |
Definition at line 1108 of file boxes.c.
References BOX_BOTTOM, BOX_LEFT, BOX_RIGHT, BOX_TOP, META_DIRECTION_BOTTOM, META_DIRECTION_LEFT, META_DIRECTION_RIGHT, META_DIRECTION_TOP, _MetaEdge::rect, and _MetaEdge::side_type.
Referenced by apply_edge_resistance(), and find_nearest_position().
| gint meta_rectangle_edge_cmp | ( | gconstpointer | a, | |
| gconstpointer | b | |||
| ) |
Definition at line 1338 of file boxes.c.
References meta_rectangle_edge_cmp_ignore_type(), and _MetaEdge::side_type.
Referenced by meta_display_compute_resistance_and_snapping_edges(), meta_rectangle_find_nonintersected_xinerama_edges(), and meta_rectangle_find_onscreen_edges().
| gint meta_rectangle_edge_cmp_ignore_type | ( | gconstpointer | a, | |
| gconstpointer | b | |||
| ) |
Definition at line 1294 of file boxes.c.
References _MetaRectangle::height, META_DIRECTION_BOTTOM, META_DIRECTION_LEFT, META_DIRECTION_RIGHT, META_DIRECTION_TOP, _MetaEdge::rect, _MetaEdge::side_type, _MetaRectangle::width, _MetaRectangle::x, and _MetaRectangle::y.
Referenced by meta_rectangle_edge_cmp(), and stupid_sort_requiring_extra_pointer_dereference().
| char* meta_rectangle_edge_list_to_string | ( | GList * | edge_list, | |
| const char * | separator_string, | |||
| char * | output | |||
| ) |
Definition at line 98 of file boxes.c.
References EDGE_LENGTH, _MetaEdge::edge_type, _MetaRectangle::height, NULL, _MetaEdge::rect, _MetaEdge::side_type, _MetaRectangle::width, _MetaRectangle::x, and _MetaRectangle::y.
Referenced by cache_edges(), test_find_nonintersected_xinerama_edges(), and test_find_onscreen_edges().
| char* meta_rectangle_edge_to_string | ( | const MetaEdge * | edge, | |
| char * | output | |||
| ) |
Definition at line 80 of file boxes.c.
References EDGE_LENGTH, _MetaEdge::edge_type, _MetaRectangle::height, _MetaEdge::rect, _MetaEdge::side_type, _MetaRectangle::width, _MetaRectangle::x, and _MetaRectangle::y.
| gboolean meta_rectangle_equal | ( | const MetaRectangle * | src1, | |
| const MetaRectangle * | src2 | |||
| ) |
Definition at line 191 of file boxes.c.
References _MetaRectangle::height, _MetaRectangle::width, _MetaRectangle::x, and _MetaRectangle::y.
Referenced by apply_edge_resistance_to_each_side(), constrain_fullscreen(), meta_ui_resize_popup_set(), meta_window_update_struts(), setup_constraint_info(), test_clipping_to_region(), test_equal(), test_gravity_resize(), test_intersect(), test_shoving_into_region(), and verify_edge_lists_are_equal().
| GList* meta_rectangle_expand_region | ( | GList * | region, | |
| const int | left_expand, | |||
| const int | right_expand, | |||
| const int | top_expand, | |||
| const int | bottom_expand | |||
| ) |
Definition at line 619 of file boxes.c.
References meta_rectangle_expand_region_conditionally().
Referenced by meta_window_shove_titlebar_onscreen().
| 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 | |||
| ) |
Definition at line 635 of file boxes.c.
References _MetaRectangle::height, _MetaRectangle::width, _MetaRectangle::x, and _MetaRectangle::y.
Referenced by constrain_partially_onscreen(), constrain_titlebar_visible(), and meta_rectangle_expand_region().
| void meta_rectangle_expand_to_avoiding_struts | ( | MetaRectangle * | rect, | |
| const MetaRectangle * | expand_to, | |||
| const MetaDirection | direction, | |||
| const GSList * | all_struts | |||
| ) |
Definition at line 664 of file boxes.c.
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().
| void meta_rectangle_find_linepoint_closest_to_point | ( | double | x1, | |
| double | y1, | |||
| double | x2, | |||
| double | y2, | |||
| double | px, | |||
| double | py, | |||
| double * | valx, | |||
| double * | valy | |||
| ) |
Definition at line 1045 of file boxes.c.
Referenced by constrain_aspect_ratio(), and test_find_closest_point_to_line().
| GList* meta_rectangle_find_nonintersected_xinerama_edges | ( | const GList * | xinerama_rects, | |
| const GSList * | all_struts | |||
| ) |
Definition at line 1761 of file boxes.c.
References BOX_BOTTOM, BOX_LEFT, BOX_RIGHT, BOX_TOP, _MetaEdge::edge_type, META_DIRECTION_BOTTOM, META_DIRECTION_LEFT, META_DIRECTION_RIGHT, META_DIRECTION_TOP, META_EDGE_XINERAMA, meta_rect(), meta_rectangle_edge_cmp(), meta_rectangle_horiz_overlap(), meta_rectangle_remove_intersections_with_boxes_from_edges(), meta_rectangle_vert_overlap(), NULL, _MetaEdge::rect, _MetaEdge::side_type, _MetaRectangle::x, and _MetaRectangle::y.
Referenced by ensure_work_areas_validated(), and get_xinerama_edges().
| GList* meta_rectangle_find_onscreen_edges | ( | const MetaRectangle * | basic_rect, | |
| const GSList * | all_struts | |||
| ) |
Definition at line 1679 of file boxes.c.
References add_edges(), FALSE, fix_up_edges(), get_disjoint_strut_rect_list_in_region(), meta_rectangle_edge_cmp(), meta_rectangle_free_list_and_elements(), NULL, and TRUE.
Referenced by ensure_work_areas_validated(), and get_screen_edges().
| void meta_rectangle_free_list_and_elements | ( | GList * | filled_list | ) |
Definition at line 734 of file boxes.c.
References NULL.
Referenced by get_xinerama_edges(), meta_rectangle_find_onscreen_edges(), meta_workspace_free(), meta_workspace_invalidate_work_area(), test_clamping_to_region(), test_clipping_to_region(), test_find_nonintersected_xinerama_edges(), test_find_onscreen_edges(), test_region_fitting(), test_regions_okay(), and test_shoving_into_region().
| GList* meta_rectangle_get_minimal_spanning_set_for_region | ( | const MetaRectangle * | basic_rect, | |
| const GSList * | all_struts | |||
| ) |
Definition at line 488 of file boxes.c.
References BOX_BOTTOM, BOX_LEFT, BOX_RIGHT, BOX_TOP, compare_rect_areas(), _MetaRectangle::height, merge_spanning_rects_in_region(), meta_rectangle_overlap(), NULL, _MetaRectangle::width, _MetaRectangle::x, and _MetaRectangle::y.
Referenced by ensure_work_areas_validated(), and get_screen_region().
| gboolean meta_rectangle_horiz_overlap | ( | const MetaRectangle * | rect1, | |
| const MetaRectangle * | rect2 | |||
| ) |
Definition at line 222 of file boxes.c.
References _MetaRectangle::width, and _MetaRectangle::x.
Referenced by edges_overlap(), find_nearest_position(), meta_rectangle_find_nonintersected_xinerama_edges(), meta_screen_get_xinerama_neighbor(), split_edge(), and test_overlap_funcs().
| gboolean meta_rectangle_intersect | ( | const MetaRectangle * | src1, | |
| const MetaRectangle * | src2, | |||
| MetaRectangle * | dest | |||
| ) |
Definition at line 154 of file boxes.c.
References FALSE, _MetaRectangle::height, NULL, TRUE, _MetaRectangle::width, _MetaRectangle::x, and _MetaRectangle::y.
Referenced by avoid_being_obscured_as_second_modal_dialog(), get_disjoint_strut_rect_list_in_region(), get_work_area_xinerama(), handle_raise_or_lower(), meta_display_compute_resistance_and_snapping_edges(), meta_rectangle_clip_to_region(), meta_screen_get_xinerama_for_rect(), meta_window_get_work_area_all_xineramas(), meta_window_place(), meta_window_titlebar_is_onscreen(), rectangle_overlaps_some_window(), and test_intersect().
| gboolean meta_rectangle_overlap | ( | const MetaRectangle * | rect1, | |
| const MetaRectangle * | rect2 | |||
| ) |
Definition at line 201 of file boxes.c.
References FALSE, _MetaRectangle::height, NULL, _MetaRectangle::width, _MetaRectangle::x, and _MetaRectangle::y.
Referenced by merge_spanning_rects_in_region(), meta_rectangle_expand_to_avoiding_struts(), meta_rectangle_get_minimal_spanning_set_for_region(), meta_rectangle_overlaps_with_region(), meta_window_set_demands_attention(), rect_overlaps_region(), test_overlap_funcs(), and windows_overlap().
| gboolean meta_rectangle_overlaps_with_region | ( | const GList * | spanning_rects, | |
| const MetaRectangle * | rect | |||
| ) |
Definition at line 779 of file boxes.c.
References FALSE, meta_rectangle_overlap(), and NULL.
Referenced by update_onscreen_requirements().
| char* meta_rectangle_region_to_string | ( | GList * | region, | |
| const char * | separator_string, | |||
| char * | output | |||
| ) |
Definition at line 48 of file boxes.c.
References _MetaRectangle::height, NULL, RECT_LENGTH, _MetaRectangle::width, _MetaRectangle::x, and _MetaRectangle::y.
Referenced by do_screen_and_xinerama_relative_constraints(), and test_regions_okay().
| GList* meta_rectangle_remove_intersections_with_boxes_from_edges | ( | GList * | edges, | |
| const GSList * | rectangles | |||
| ) |
Definition at line 1615 of file boxes.c.
References FALSE, rectangle_and_edge_intersection(), split_edge(), and TRUE.
Referenced by meta_display_compute_resistance_and_snapping_edges(), and meta_rectangle_find_nonintersected_xinerama_edges().
| void meta_rectangle_resize_with_gravity | ( | const MetaRectangle * | old_rect, | |
| MetaRectangle * | rect, | |||
| int | gravity, | |||
| int | new_width, | |||
| int | new_height | |||
| ) |
Definition at line 249 of file boxes.c.
References _MetaRectangle::height, _MetaRectangle::width, _MetaRectangle::x, and _MetaRectangle::y.
Referenced by constrain_aspect_ratio(), constrain_size_increments(), constrain_size_limits(), meta_window_edge_resistance_for_resize(), meta_window_move_resize_internal(), process_keyboard_resize_grab(), and test_gravity_resize().
| void meta_rectangle_shove_into_region | ( | const GList * | spanning_rects, | |
| FixedDirections | fixed_directions, | |||
| MetaRectangle * | rect | |||
| ) |
Definition at line 945 of file boxes.c.
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().
| char* meta_rectangle_to_string | ( | const MetaRectangle * | rect, | |
| char * | output | |||
| ) |
Definition at line 34 of file boxes.c.
References _MetaRectangle::height, RECT_LENGTH, _MetaRectangle::width, _MetaRectangle::x, and _MetaRectangle::y.
Referenced by find_first_fit().
| gboolean meta_rectangle_vert_overlap | ( | const MetaRectangle * | rect1, | |
| const MetaRectangle * | rect2 | |||
| ) |
Definition at line 214 of file boxes.c.
References _MetaRectangle::height, and _MetaRectangle::y.
Referenced by edges_overlap(), find_nearest_position(), meta_rectangle_find_nonintersected_xinerama_edges(), meta_screen_get_xinerama_neighbor(), split_edge(), and test_overlap_funcs().
1.5.5