diff --git a/src/backends/meta-cursor-renderer.c b/src/backends/meta-cursor-renderer.c index 904a21a0f..1a06f3865 100644 --- a/src/backends/meta-cursor-renderer.c +++ b/src/backends/meta-cursor-renderer.c @@ -173,7 +173,7 @@ meta_cursor_renderer_after_paint (ClutterStage *stage, if (priv->displayed_cursor && priv->needs_overlay) { graphene_rect_t rect; - MetaRectangle view_layout; + MtkRectangle view_layout; graphene_rect_t view_rect; rect = meta_cursor_renderer_calculate_rect (renderer, diff --git a/src/backends/meta-input-capture-session.c b/src/backends/meta-input-capture-session.c index af6c37a75..88076f4d7 100644 --- a/src/backends/meta-input-capture-session.c +++ b/src/backends/meta-input-capture-session.c @@ -617,7 +617,7 @@ typedef enum } LineAdjacency; static LineAdjacency -get_barrier_adjacency (MetaRectangle *rect, +get_barrier_adjacency (MtkRectangle *rect, int x1, int y1, int x2, @@ -719,7 +719,7 @@ check_barrier (MetaInputCaptureSession *session, for (l = logical_monitors; l; l = l->next) { MetaLogicalMonitor *logical_monitor = l->data; - MetaRectangle layout; + MtkRectangle layout; layout = meta_logical_monitor_get_layout (logical_monitor); switch (get_barrier_adjacency (&layout, x1, y1, x2, y2, error)) @@ -877,7 +877,7 @@ handle_get_zones (MetaDBusInputCaptureSession *object, for (l = logical_monitors; l; l = l->next) { MetaLogicalMonitor *logical_monitor = l->data; - MetaRectangle layout; + MtkRectangle layout; layout = meta_logical_monitor_get_layout (logical_monitor); g_variant_builder_add (&zones_builder, "(uuii)", diff --git a/src/backends/meta-input-mapper.c b/src/backends/meta-input-mapper.c index 967b4435d..49f00f427 100644 --- a/src/backends/meta-input-mapper.c +++ b/src/backends/meta-input-mapper.c @@ -912,7 +912,7 @@ handle_get_device_mapping (MetaDBusInputMapping *skeleton, if (logical_monitor) { - MetaRectangle rect; + MtkRectangle rect; rect = meta_logical_monitor_get_layout (logical_monitor); g_dbus_method_invocation_return_value (invocation, diff --git a/src/backends/meta-logical-monitor.c b/src/backends/meta-logical-monitor.c index fa7e498b8..70d23b092 100644 --- a/src/backends/meta-logical-monitor.c +++ b/src/backends/meta-logical-monitor.c @@ -132,7 +132,7 @@ derive_monitor_transform (MetaMonitor *monitor) MetaLogicalMonitor * meta_logical_monitor_new_derived (MetaMonitorManager *monitor_manager, MetaMonitor *monitor, - MetaRectangle *layout, + MtkRectangle *layout, float scale, int monitor_number) { @@ -214,7 +214,7 @@ meta_logical_monitor_get_transform (MetaLogicalMonitor *logical_monitor) return logical_monitor->transform; } -MetaRectangle +MtkRectangle meta_logical_monitor_get_layout (MetaLogicalMonitor *logical_monitor) { return logical_monitor->rect; diff --git a/src/backends/meta-logical-monitor.h b/src/backends/meta-logical-monitor.h index 26e800bba..824d804f2 100644 --- a/src/backends/meta-logical-monitor.h +++ b/src/backends/meta-logical-monitor.h @@ -34,7 +34,7 @@ struct _MetaLogicalMonitor GObject parent; int number; - MetaRectangle rect; + MtkRectangle rect; gboolean is_primary; gboolean is_presentation; /* XXX: not yet used */ gboolean in_fullscreen; @@ -71,7 +71,7 @@ MetaLogicalMonitor * meta_logical_monitor_new (MetaMonitorManager *monitor MetaLogicalMonitor * meta_logical_monitor_new_derived (MetaMonitorManager *monitor_manager, MetaMonitor *monitor, - MetaRectangle *layout, + MtkRectangle *layout, float scale, int monitor_number); @@ -88,7 +88,7 @@ float meta_logical_monitor_get_scale (MetaLogicalMonitor *logical_monitor); MetaMonitorTransform meta_logical_monitor_get_transform (MetaLogicalMonitor *logical_monitor); META_EXPORT_TEST -MetaRectangle meta_logical_monitor_get_layout (MetaLogicalMonitor *logical_monitor); +MtkRectangle meta_logical_monitor_get_layout (MetaLogicalMonitor *logical_monitor); META_EXPORT_TEST GList * meta_logical_monitor_get_monitors (MetaLogicalMonitor *logical_monitor); diff --git a/src/backends/meta-monitor-config-manager.c b/src/backends/meta-monitor-config-manager.c index cf084c48a..60f32ff4c 100644 --- a/src/backends/meta-monitor-config-manager.c +++ b/src/backends/meta-monitor-config-manager.c @@ -773,7 +773,7 @@ create_preferred_logical_monitor_config (MetaMonitorManager *monitor_ma logical_monitor_config = g_new0 (MetaLogicalMonitorConfig, 1); *logical_monitor_config = (MetaLogicalMonitorConfig) { - .layout = (MetaRectangle) { + .layout = (MtkRectangle) { .x = x, .y = y, .width = width, @@ -898,7 +898,7 @@ verify_suggested_monitors_config (GList *logical_monitor_configs) for (l = logical_monitor_configs; l; l = l->next) { MetaLogicalMonitorConfig *logical_monitor_config = l->data; - MetaRectangle *rect = &logical_monitor_config->layout; + MtkRectangle *rect = &logical_monitor_config->layout; if (meta_rectangle_overlaps_with_region (region, rect)) { @@ -912,7 +912,7 @@ verify_suggested_monitors_config (GList *logical_monitor_configs) for (l = region; region->next && l; l = l->next) { - MetaRectangle *rect = l->data; + MtkRectangle *rect = l->data; if (!meta_rectangle_is_adjacent_to_any_in_region (region, rect)) { @@ -1351,12 +1351,7 @@ create_for_switch_config_all_mirror (MetaMonitorConfigManager *config_manager) logical_monitor_config = g_new0 (MetaLogicalMonitorConfig, 1); *logical_monitor_config = (MetaLogicalMonitorConfig) { - .layout = (MetaRectangle) { - .x = 0, - .y = 0, - .width = width, - .height = height - }, + .layout = MTK_RECTANGLE_INIT (0, 0, width, height), .scale = best_scale, .monitor_configs = monitor_configs, .is_primary = TRUE, diff --git a/src/backends/meta-monitor-config-manager.h b/src/backends/meta-monitor-config-manager.h index 53f5ed3e5..29ac41e92 100644 --- a/src/backends/meta-monitor-config-manager.h +++ b/src/backends/meta-monitor-config-manager.h @@ -37,7 +37,7 @@ typedef struct _MetaMonitorConfig typedef struct _MetaLogicalMonitorConfig { - MetaRectangle layout; + MtkRectangle layout; GList *monitor_configs; MetaMonitorTransform transform; float scale; diff --git a/src/backends/meta-monitor-config-migration.c b/src/backends/meta-monitor-config-migration.c index f768ffa5c..803dbf0c5 100644 --- a/src/backends/meta-monitor-config-migration.c +++ b/src/backends/meta-monitor-config-migration.c @@ -67,7 +67,7 @@ typedef struct typedef struct { gboolean enabled; - MetaRectangle rect; + MtkRectangle rect; float refresh_rate; MetaMonitorTransform transform; @@ -720,7 +720,7 @@ try_derive_tiled_monitor_config (MetaLegacyMonitorsConfig *config, MetaOutputKey *output_key, MetaOutputConfig *output_config, MetaMonitorConfigStore *config_store, - MetaRectangle *out_layout, + MtkRectangle *out_layout, GError **error) { MonitorTile top_left_tile = { 0 }; @@ -752,7 +752,7 @@ try_derive_tiled_monitor_config (MetaLegacyMonitorsConfig *config, { MetaOutputKey *other_output_key = &config->keys[i]; MetaOutputConfig *other_output_config = &config->outputs[i]; - MetaRectangle *rect; + MtkRectangle *rect; if (strcmp (output_key->vendor, other_output_key->vendor) != 0 || strcmp (output_key->product, other_output_key->product) != 0 || @@ -871,7 +871,7 @@ try_derive_tiled_monitor_config (MetaLegacyMonitorsConfig *config, if (!monitor_config) return NULL; - *out_layout = (MetaRectangle) { + *out_layout = (MtkRectangle) { .x = min_x, .y = min_y, .width = max_x - min_x, @@ -884,7 +884,7 @@ try_derive_tiled_monitor_config (MetaLegacyMonitorsConfig *config, static MetaMonitorConfig * derive_monitor_config (MetaOutputKey *output_key, MetaOutputConfig *output_config, - MetaRectangle *out_layout, + MtkRectangle *out_layout, GError **error) { int mode_width; @@ -916,7 +916,7 @@ derive_monitor_config (MetaOutputKey *output_key, static MetaLogicalMonitorConfig * ensure_logical_monitor (GList **logical_monitor_configs, MetaOutputConfig *output_config, - MetaRectangle *layout) + MtkRectangle *layout) { MetaLogicalMonitorConfig *new_logical_monitor_config; GList *l; @@ -957,7 +957,7 @@ derive_logical_monitor_configs (MetaLegacyMonitorsConfig *config, MetaOutputKey *output_key = &config->keys[i]; MetaOutputConfig *output_config = &config->outputs[i]; MetaMonitorConfig *monitor_config = NULL; - MetaRectangle layout; + MtkRectangle layout; MetaLogicalMonitorConfig *logical_monitor_config; if (!output_config->enabled) diff --git a/src/backends/meta-monitor-manager-private.h b/src/backends/meta-monitor-manager-private.h index 62c7f19eb..782ccb0f0 100644 --- a/src/backends/meta-monitor-manager-private.h +++ b/src/backends/meta-monitor-manager-private.h @@ -290,10 +290,10 @@ MetaLogicalMonitor *meta_monitor_manager_get_logical_monitor_at (MetaMonitorMana float y); MetaLogicalMonitor *meta_monitor_manager_get_logical_monitor_from_rect (MetaMonitorManager *manager, - MetaRectangle *rect); + MtkRectangle *rect); MetaLogicalMonitor *meta_monitor_manager_get_highest_scale_monitor_from_rect (MetaMonitorManager *manager, - MetaRectangle *rect); + MtkRectangle *rect); MetaLogicalMonitor *meta_monitor_manager_get_logical_monitor_neighbor (MetaMonitorManager *manager, MetaLogicalMonitor *logical_monitor, diff --git a/src/backends/meta-monitor-manager.c b/src/backends/meta-monitor-manager.c index f46129f07..00a6a5cf5 100644 --- a/src/backends/meta-monitor-manager.c +++ b/src/backends/meta-monitor-manager.c @@ -169,7 +169,7 @@ is_main_tiled_monitor_output (MetaOutput *output) static MetaLogicalMonitor * logical_monitor_from_layout (MetaMonitorManager *manager, GList *logical_monitors, - MetaRectangle *layout) + MtkRectangle *layout) { GList *l; @@ -318,7 +318,7 @@ derive_calculated_global_scale (MetaMonitorManager *manager) static float derive_scale_from_config (MetaMonitorManager *manager, MetaMonitorsConfig *config, - MetaRectangle *layout) + MtkRectangle *layout) { GList *l; @@ -364,7 +364,7 @@ meta_monitor_manager_rebuild_logical_monitors_derived (MetaMonitorManager *manag { MetaMonitor *monitor = l->data; MetaLogicalMonitor *logical_monitor; - MetaRectangle layout; + MtkRectangle layout; if (!meta_monitor_is_active (monitor)) continue; @@ -3349,7 +3349,7 @@ meta_monitor_manager_get_logical_monitor_at (MetaMonitorManager *manager, */ MetaLogicalMonitor * meta_monitor_manager_get_logical_monitor_from_rect (MetaMonitorManager *manager, - MetaRectangle *rect) + MtkRectangle *rect) { MetaLogicalMonitor *best_logical_monitor; int best_logical_monitor_area; @@ -3363,7 +3363,7 @@ meta_monitor_manager_get_logical_monitor_from_rect (MetaMonitorManager *manager, for (l = manager->logical_monitors; l; l = l->next) { MetaLogicalMonitor *logical_monitor = l->data; - MetaRectangle intersection; + MtkRectangle intersection; int intersection_area; if (META_POINT_IN_RECT (center_x, center_y, logical_monitor->rect)) @@ -3401,7 +3401,7 @@ meta_monitor_manager_get_logical_monitor_from_rect (MetaMonitorManager *manager, */ MetaLogicalMonitor * meta_monitor_manager_get_highest_scale_monitor_from_rect (MetaMonitorManager *manager, - MetaRectangle *rect) + MtkRectangle *rect) { MetaLogicalMonitor *best_logical_monitor = NULL; GList *l; @@ -3410,7 +3410,7 @@ meta_monitor_manager_get_highest_scale_monitor_from_rect (MetaMonitorManager *ma for (l = manager->logical_monitors; l; l = l->next) { MetaLogicalMonitor *logical_monitor = l->data; - MetaRectangle intersection; + MtkRectangle intersection; float scale; if (!mtk_rectangle_intersect (&logical_monitor->rect, diff --git a/src/backends/meta-monitor.c b/src/backends/meta-monitor.c index 71f30ee08..1062926d7 100644 --- a/src/backends/meta-monitor.c +++ b/src/backends/meta-monitor.c @@ -452,8 +452,8 @@ meta_monitor_get_current_resolution (MetaMonitor *monitor, } void -meta_monitor_derive_layout (MetaMonitor *monitor, - MetaRectangle *layout) +meta_monitor_derive_layout (MetaMonitor *monitor, + MtkRectangle *layout) { META_MONITOR_GET_CLASS (monitor)->derive_layout (monitor, layout); } @@ -843,8 +843,8 @@ meta_monitor_normal_get_main_output (MetaMonitor *monitor) } static void -meta_monitor_normal_derive_layout (MetaMonitor *monitor, - MetaRectangle *layout) +meta_monitor_normal_derive_layout (MetaMonitor *monitor, + MtkRectangle *layout) { MetaOutput *output; MetaCrtc *crtc; @@ -1540,8 +1540,8 @@ meta_monitor_tiled_get_main_output (MetaMonitor *monitor) } static void -meta_monitor_tiled_derive_layout (MetaMonitor *monitor, - MetaRectangle *layout) +meta_monitor_tiled_derive_layout (MetaMonitor *monitor, + MtkRectangle *layout) { MetaMonitorPrivate *monitor_priv = meta_monitor_get_instance_private (monitor); @@ -1574,7 +1574,7 @@ meta_monitor_tiled_derive_layout (MetaMonitor *monitor, max_y = MAX (crtc_layout->origin.y + crtc_layout->size.height, max_y); } - *layout = (MetaRectangle) { + *layout = (MtkRectangle) { .x = roundf (min_x), .y = roundf (min_y), .width = roundf (max_x - min_x), diff --git a/src/backends/meta-monitor.h b/src/backends/meta-monitor.h index e8375dc56..d8e9fd301 100644 --- a/src/backends/meta-monitor.h +++ b/src/backends/meta-monitor.h @@ -70,8 +70,8 @@ struct _MetaMonitorClass GObjectClass parent_class; MetaOutput * (* get_main_output) (MetaMonitor *monitor); - void (* derive_layout) (MetaMonitor *monitor, - MetaRectangle *layout); + void (* derive_layout) (MetaMonitor *monitor, + MtkRectangle *layout); void (* calculate_crtc_pos) (MetaMonitor *monitor, MetaMonitorMode *monitor_mode, MetaOutput *output, @@ -135,8 +135,8 @@ void meta_monitor_get_current_resolution (MetaMonitor *monitor, int *width, int *height); -void meta_monitor_derive_layout (MetaMonitor *monitor, - MetaRectangle *layout); +void meta_monitor_derive_layout (MetaMonitor *monitor, + MtkRectangle *layout); META_EXPORT_TEST void meta_monitor_get_physical_dimensions (MetaMonitor *monitor, diff --git a/src/backends/meta-renderer-view.c b/src/backends/meta-renderer-view.c index a456c3102..bceb4c765 100644 --- a/src/backends/meta-renderer-view.c +++ b/src/backends/meta-renderer-view.c @@ -102,11 +102,11 @@ meta_renderer_view_setup_offscreen_blit_pipeline (ClutterStageView *view, } static void -meta_renderer_view_transform_rect_to_onscreen (ClutterStageView *view, - const MtkRectangle *src_rect, - int dst_width, - int dst_height, - MtkRectangle *dst_rect) +meta_renderer_view_transform_rect_to_onscreen (ClutterStageView *view, + const MtkRectangle *src_rect, + int dst_width, + int dst_height, + MtkRectangle *dst_rect) { MetaRendererView *renderer_view = META_RENDERER_VIEW (view); MetaRendererViewPrivate *priv = diff --git a/src/backends/meta-screen-cast-area-stream-src.c b/src/backends/meta-screen-cast-area-stream-src.c index de9ca18d9..44a364cbb 100644 --- a/src/backends/meta-screen-cast-area-stream-src.c +++ b/src/backends/meta-screen-cast-area-stream-src.c @@ -91,7 +91,7 @@ meta_screen_cast_area_stream_src_get_specs (MetaScreenCastStreamSrc *src, { MetaScreenCastStream *stream = meta_screen_cast_stream_src_get_stream (src); MetaScreenCastAreaStream *area_stream = META_SCREEN_CAST_AREA_STREAM (stream); - MetaRectangle *area; + MtkRectangle *area; float scale; area = meta_screen_cast_area_stream_get_area (area_stream); @@ -113,7 +113,7 @@ is_cursor_in_stream (MetaScreenCastAreaStreamSrc *area_src) MetaBackend *backend = get_backend (area_src); MetaCursorRenderer *cursor_renderer = meta_backend_get_cursor_renderer (backend); - MetaRectangle *area; + MtkRectangle *area; graphene_rect_t area_rect; MetaCursorSprite *cursor_sprite; @@ -275,7 +275,7 @@ stage_painted (MetaStage *stage, MetaScreenCastStream *stream = meta_screen_cast_stream_src_get_stream (src); MetaScreenCastAreaStream *area_stream = META_SCREEN_CAST_AREA_STREAM (stream); const cairo_region_t *redraw_clip; - MetaRectangle *area; + MtkRectangle *area; if (area_src->maybe_record_idle_id) return; @@ -308,7 +308,7 @@ add_view_painted_watches (MetaScreenCastAreaStreamSrc *area_src) MetaRenderer *renderer = meta_backend_get_renderer (backend); ClutterStage *stage; MetaStage *meta_stage; - MetaRectangle *area; + MtkRectangle *area; GList *l; stage = get_stage (area_src); @@ -318,7 +318,7 @@ add_view_painted_watches (MetaScreenCastAreaStreamSrc *area_src) for (l = meta_renderer_get_views (renderer); l; l = l->next) { MetaRendererView *view = l->data; - MetaRectangle view_layout; + MtkRectangle view_layout; clutter_stage_view_get_layout (CLUTTER_STAGE_VIEW (view), &view_layout); if (mtk_rectangle_overlap (area, &view_layout)) @@ -466,7 +466,7 @@ meta_screen_cast_area_stream_src_record_to_buffer (MetaScreenCastStreamSrc *src MetaScreenCastStream *stream = meta_screen_cast_stream_src_get_stream (src); MetaScreenCastAreaStream *area_stream = META_SCREEN_CAST_AREA_STREAM (stream); ClutterStage *stage; - MetaRectangle *area; + MtkRectangle *area; float scale; ClutterPaintFlag paint_flags = CLUTTER_PAINT_FLAG_CLEAR; @@ -507,7 +507,7 @@ meta_screen_cast_area_stream_src_record_to_framebuffer (MetaScreenCastStreamSrc MetaScreenCastAreaStream *area_stream = META_SCREEN_CAST_AREA_STREAM (stream); MetaBackend *backend = get_backend (area_src); ClutterStage *stage; - MetaRectangle *area; + MtkRectangle *area; float scale; ClutterPaintFlag paint_flags = CLUTTER_PAINT_FLAG_CLEAR; @@ -561,7 +561,7 @@ meta_screen_cast_area_stream_src_set_cursor_metadata (MetaScreenCastStreamSrc *s MetaCursorTracker *cursor_tracker = meta_backend_get_cursor_tracker (backend); MetaCursorSprite *cursor_sprite; - MetaRectangle *area; + MtkRectangle *area; float scale; graphene_point_t cursor_position; int x, y; diff --git a/src/backends/meta-screen-cast-area-stream.c b/src/backends/meta-screen-cast-area-stream.c index 3f8964645..266f894f6 100644 --- a/src/backends/meta-screen-cast-area-stream.c +++ b/src/backends/meta-screen-cast-area-stream.c @@ -28,7 +28,7 @@ struct _MetaScreenCastAreaStream ClutterStage *stage; - MetaRectangle area; + MtkRectangle area; float scale; }; @@ -42,7 +42,7 @@ meta_screen_cast_area_stream_get_stage (MetaScreenCastAreaStream *area_stream) return area_stream->stage; } -MetaRectangle * +MtkRectangle * meta_screen_cast_area_stream_get_area (MetaScreenCastAreaStream *area_stream) { return &area_stream->area; @@ -55,9 +55,9 @@ meta_screen_cast_area_stream_get_scale (MetaScreenCastAreaStream *area_stream) } static gboolean -calculate_scale (ClutterStage *stage, - MetaRectangle *area, - float *out_scale) +calculate_scale (ClutterStage *stage, + MtkRectangle *area, + float *out_scale) { GList *l; float scale = 0.0; @@ -65,7 +65,7 @@ calculate_scale (ClutterStage *stage, for (l = clutter_stage_peek_stage_views (stage); l; l = l->next) { ClutterStageView *stage_view = l->data; - MetaRectangle view_layout; + MtkRectangle view_layout; clutter_stage_view_get_layout (stage_view, &view_layout); if (mtk_rectangle_overlap (area, &view_layout)) @@ -82,7 +82,7 @@ calculate_scale (ClutterStage *stage, MetaScreenCastAreaStream * meta_screen_cast_area_stream_new (MetaScreenCastSession *session, GDBusConnection *connection, - MetaRectangle *area, + MtkRectangle *area, ClutterStage *stage, MetaScreenCastCursorMode cursor_mode, MetaScreenCastFlag flags, diff --git a/src/backends/meta-screen-cast-area-stream.h b/src/backends/meta-screen-cast-area-stream.h index 62df727ea..869dfb6f1 100644 --- a/src/backends/meta-screen-cast-area-stream.h +++ b/src/backends/meta-screen-cast-area-stream.h @@ -31,7 +31,7 @@ G_DECLARE_FINAL_TYPE (MetaScreenCastAreaStream, MetaScreenCastAreaStream * meta_screen_cast_area_stream_new (MetaScreenCastSession *session, GDBusConnection *connection, - MetaRectangle *area, + MtkRectangle *area, ClutterStage *stage, MetaScreenCastCursorMode cursor_mode, MetaScreenCastFlag flags, @@ -39,6 +39,6 @@ MetaScreenCastAreaStream * meta_screen_cast_area_stream_new (MetaScreenCastSessi ClutterStage * meta_screen_cast_area_stream_get_stage (MetaScreenCastAreaStream *area_stream); -MetaRectangle * meta_screen_cast_area_stream_get_area (MetaScreenCastAreaStream *area_stream); +MtkRectangle * meta_screen_cast_area_stream_get_area (MetaScreenCastAreaStream *area_stream); float meta_screen_cast_area_stream_get_scale (MetaScreenCastAreaStream *area_stream); diff --git a/src/backends/meta-screen-cast-monitor-stream-src.c b/src/backends/meta-screen-cast-monitor-stream-src.c index 0564d2f94..603b364ad 100644 --- a/src/backends/meta-screen-cast-monitor-stream-src.c +++ b/src/backends/meta-screen-cast-monitor-stream-src.c @@ -226,7 +226,7 @@ is_cursor_in_stream (MetaScreenCastMonitorStreamSrc *monitor_src) meta_backend_get_cursor_renderer (backend); MetaMonitor *monitor; MetaLogicalMonitor *logical_monitor; - MetaRectangle logical_monitor_layout; + MtkRectangle logical_monitor_layout; graphene_rect_t logical_monitor_rect; MetaCursorSprite *cursor_sprite; @@ -364,7 +364,7 @@ add_view_watches (MetaScreenCastMonitorStreamSrc *monitor_src, MetaStage *meta_stage; MetaMonitor *monitor; MetaLogicalMonitor *logical_monitor; - MetaRectangle logical_monitor_layout; + MtkRectangle logical_monitor_layout; GList *l; stage = get_stage (monitor_src); @@ -376,7 +376,7 @@ add_view_watches (MetaScreenCastMonitorStreamSrc *monitor_src, for (l = meta_renderer_get_views (renderer); l; l = l->next) { MetaRendererView *view = l->data; - MetaRectangle view_layout; + MtkRectangle view_layout; clutter_stage_view_get_layout (CLUTTER_STAGE_VIEW (view), &view_layout); if (mtk_rectangle_overlap (&logical_monitor_layout, &view_layout)) @@ -590,7 +590,7 @@ meta_screen_cast_monitor_stream_src_record_to_framebuffer (MetaScreenCastStreamS ClutterStage *stage = get_stage (monitor_src); MetaMonitor *monitor; MetaLogicalMonitor *logical_monitor; - MetaRectangle logical_monitor_layout; + MtkRectangle logical_monitor_layout; float view_scale; ClutterPaintFlag paint_flags = CLUTTER_PAINT_FLAG_CLEAR; @@ -635,7 +635,7 @@ meta_screen_cast_monitor_stream_record_follow_up (MetaScreenCastStreamSrc *src) ClutterStage *stage = get_stage (monitor_src); MetaMonitor *monitor; MetaLogicalMonitor *logical_monitor; - MetaRectangle logical_monitor_layout; + MtkRectangle logical_monitor_layout; GList *l; g_clear_handle_id (&monitor_src->maybe_record_idle_id, g_source_remove); @@ -647,8 +647,8 @@ meta_screen_cast_monitor_stream_record_follow_up (MetaScreenCastStreamSrc *src) for (l = meta_renderer_get_views (renderer); l; l = l->next) { MetaRendererView *view = l->data; - MetaRectangle view_layout; - MetaRectangle damage; + MtkRectangle view_layout; + MtkRectangle damage; clutter_stage_view_get_layout (CLUTTER_STAGE_VIEW (view), &view_layout); @@ -679,7 +679,7 @@ meta_screen_cast_monitor_stream_src_set_cursor_metadata (MetaScreenCastStreamSrc MetaCursorSprite *cursor_sprite; MetaMonitor *monitor; MetaLogicalMonitor *logical_monitor; - MetaRectangle logical_monitor_layout; + MtkRectangle logical_monitor_layout; graphene_rect_t logical_monitor_rect; float view_scale; graphene_point_t cursor_position; diff --git a/src/backends/meta-screen-cast-monitor-stream.c b/src/backends/meta-screen-cast-monitor-stream.c index a76d54564..a94955b59 100644 --- a/src/backends/meta-screen-cast-monitor-stream.c +++ b/src/backends/meta-screen-cast-monitor-stream.c @@ -165,7 +165,7 @@ meta_screen_cast_monitor_stream_set_parameters (MetaScreenCastStream *stream, { MetaScreenCastMonitorStream *monitor_stream = META_SCREEN_CAST_MONITOR_STREAM (stream); - MetaRectangle logical_monitor_layout; + MtkRectangle logical_monitor_layout; const char *output_name; logical_monitor_layout = @@ -197,7 +197,7 @@ meta_screen_cast_monitor_stream_transform_position (MetaScreenCastStream *stream MetaScreenCastMonitorStream *monitor_stream = META_SCREEN_CAST_MONITOR_STREAM (stream); MetaBackend *backend = meta_monitor_get_backend (monitor_stream->monitor); - MetaRectangle logical_monitor_layout; + MtkRectangle logical_monitor_layout; double scale; logical_monitor_layout = diff --git a/src/backends/meta-screen-cast-session.c b/src/backends/meta-screen-cast-session.c index e19cea47b..424a58926 100644 --- a/src/backends/meta-screen-cast-session.c +++ b/src/backends/meta-screen-cast-session.c @@ -606,7 +606,7 @@ handle_record_area (MetaDBusScreenCastSession *skeleton, gboolean is_recording; MetaScreenCastFlag flags; g_autoptr (GError) error = NULL; - MetaRectangle rect; + MtkRectangle rect; MetaScreenCastAreaStream *area_stream; MetaScreenCastStream *stream; char *stream_path; @@ -646,7 +646,7 @@ handle_record_area (MetaDBusScreenCastSession *skeleton, if (is_recording) flags |= META_SCREEN_CAST_FLAG_IS_RECORDING; - rect = (MetaRectangle) { + rect = (MtkRectangle) { .x = x, .y = y, .width = width, diff --git a/src/backends/meta-screen-cast-stream-src.c b/src/backends/meta-screen-cast-stream-src.c index 39dd72da7..838e771ba 100644 --- a/src/backends/meta-screen-cast-stream-src.c +++ b/src/backends/meta-screen-cast-stream-src.c @@ -241,7 +241,7 @@ meta_screen_cast_stream_src_get_specs (MetaScreenCastStreamSrc *src, static gboolean meta_screen_cast_stream_src_get_videocrop (MetaScreenCastStreamSrc *src, - MetaRectangle *crop_rect) + MtkRectangle *crop_rect) { MetaScreenCastStreamSrcClass *klass = META_SCREEN_CAST_STREAM_SRC_GET_CLASS (src); @@ -746,7 +746,7 @@ meta_screen_cast_stream_src_maybe_record_frame_with_timestamp (MetaScreenCastStr meta_screen_cast_stream_src_get_instance_private (src); MetaScreenCastRecordResult record_result = META_SCREEN_CAST_RECORD_RESULT_RECORDED_NOTHING; - MetaRectangle crop_rect; + MtkRectangle crop_rect; struct pw_buffer *buffer; struct spa_buffer *spa_buffer; struct spa_meta_header *header; diff --git a/src/backends/meta-screen-cast-stream-src.h b/src/backends/meta-screen-cast-stream-src.h index ffddef9b1..9a850b7dd 100644 --- a/src/backends/meta-screen-cast-stream-src.h +++ b/src/backends/meta-screen-cast-stream-src.h @@ -75,7 +75,7 @@ struct _MetaScreenCastStreamSrcClass void (* record_follow_up) (MetaScreenCastStreamSrc *src); gboolean (* get_videocrop) (MetaScreenCastStreamSrc *src, - MetaRectangle *crop_rect); + MtkRectangle *crop_rect); void (* set_cursor_metadata) (MetaScreenCastStreamSrc *src, struct spa_meta_cursor *spa_meta_cursor); diff --git a/src/backends/meta-screen-cast-virtual-stream-src.c b/src/backends/meta-screen-cast-virtual-stream-src.c index e2517a23a..c1c80bcf9 100644 --- a/src/backends/meta-screen-cast-virtual-stream-src.c +++ b/src/backends/meta-screen-cast-virtual-stream-src.c @@ -360,7 +360,7 @@ meta_screen_cast_virtual_stream_src_record_to_buffer (MetaScreenCastStreamSrc * MetaScreenCastStream *stream; ClutterPaintFlag paint_flags; ClutterStageView *view; - MetaRectangle view_rect; + MtkRectangle view_rect; float scale; stream = meta_screen_cast_stream_src_get_stream (src); @@ -419,7 +419,7 @@ meta_screen_cast_virtual_stream_src_record_to_framebuffer (MetaScreenCastStreamS static void meta_screen_cast_virtual_stream_record_follow_up (MetaScreenCastStreamSrc *src) { - MetaRectangle damage; + MtkRectangle damage; clutter_stage_view_get_layout (view_from_src (src), &damage); damage.width = 1; @@ -437,7 +437,7 @@ is_cursor_in_stream (MetaScreenCastVirtualStreamSrc *virtual_src) MetaCursorRenderer *cursor_renderer = meta_backend_get_cursor_renderer (backend); ClutterStageView *stage_view = view_from_src (src); - MetaRectangle view_layout; + MtkRectangle view_layout; graphene_rect_t view_rect; MetaCursorSprite *cursor_sprite; @@ -478,7 +478,7 @@ meta_screen_cast_virtual_stream_src_set_cursor_metadata (MetaScreenCastStreamSrc meta_backend_get_cursor_tracker (backend); MetaCursorSprite *cursor_sprite; ClutterStageView *stage_view; - MetaRectangle view_layout; + MtkRectangle view_layout; float view_scale; graphene_rect_t view_rect; graphene_point_t cursor_position; diff --git a/src/backends/meta-screen-cast-virtual-stream.c b/src/backends/meta-screen-cast-virtual-stream.c index e049869ee..7acb12781 100644 --- a/src/backends/meta-screen-cast-virtual-stream.c +++ b/src/backends/meta-screen-cast-virtual-stream.c @@ -89,7 +89,7 @@ meta_screen_cast_virtual_stream_transform_position (MetaScreenCastStream *stream MetaScreenCastVirtualStreamSrc *virtual_src = META_SCREEN_CAST_VIRTUAL_STREAM_SRC (src); ClutterStageView *view; - MetaRectangle view_layout; + MtkRectangle view_layout; if (!meta_screen_cast_stream_src_is_enabled (src)) return FALSE; diff --git a/src/backends/meta-screen-cast-window-stream-src.c b/src/backends/meta-screen-cast-window-stream-src.c index 82c352c6a..5cdbcd2b2 100644 --- a/src/backends/meta-screen-cast-window-stream-src.c +++ b/src/backends/meta-screen-cast-window-stream-src.c @@ -109,7 +109,7 @@ get_stream_height (MetaScreenCastWindowStreamSrc *window_src) static void maybe_draw_cursor_sprite (MetaScreenCastWindowStreamSrc *window_src, uint8_t *data, - MetaRectangle *stream_rect) + MtkRectangle *stream_rect) { MetaScreenCastStreamSrc *src = META_SCREEN_CAST_STREAM_SRC (window_src); MetaBackend *backend = get_backend (window_src); @@ -192,7 +192,7 @@ maybe_draw_cursor_sprite (MetaScreenCastWindowStreamSrc *window_src, static void maybe_blit_cursor_sprite (MetaScreenCastWindowStreamSrc *window_src, CoglFramebuffer *framebuffer, - MetaRectangle *stream_rect) + MtkRectangle *stream_rect) { MetaBackend *backend = get_backend (window_src); CoglContext *cogl_context = @@ -266,10 +266,10 @@ capture_into (MetaScreenCastWindowStreamSrc *window_src, uint8_t *data) { MetaScreenCastStreamSrc *src = META_SCREEN_CAST_STREAM_SRC (window_src); - MetaRectangle stream_rect; + MtkRectangle stream_rect; MetaScreenCastStream *stream; - stream_rect = (MetaRectangle) { + stream_rect = (MtkRectangle) { .width = width, .height = height, }; @@ -309,11 +309,11 @@ meta_screen_cast_window_stream_src_get_specs (MetaScreenCastStreamSrc *src, static gboolean meta_screen_cast_window_stream_src_get_videocrop (MetaScreenCastStreamSrc *src, - MetaRectangle *crop_rect) + MtkRectangle *crop_rect) { MetaScreenCastWindowStreamSrc *window_src = META_SCREEN_CAST_WINDOW_STREAM_SRC (src); - MetaRectangle stream_rect; + MtkRectangle stream_rect; meta_screen_cast_window_get_buffer_bounds (window_src->screen_cast_window, crop_rect); @@ -511,7 +511,7 @@ meta_screen_cast_window_stream_src_record_to_framebuffer (MetaScreenCastStreamSr MetaScreenCastWindowStreamSrc *window_src = META_SCREEN_CAST_WINDOW_STREAM_SRC (src); MetaScreenCastStream *stream; - MetaRectangle stream_rect; + MtkRectangle stream_rect; stream_rect.x = 0; stream_rect.y = 0; diff --git a/src/backends/meta-screen-cast-window.c b/src/backends/meta-screen-cast-window.c index d1726add7..4601ad7c3 100644 --- a/src/backends/meta-screen-cast-window.c +++ b/src/backends/meta-screen-cast-window.c @@ -29,7 +29,7 @@ meta_screen_cast_window_default_init (MetaScreenCastWindowInterface *iface) void meta_screen_cast_window_get_buffer_bounds (MetaScreenCastWindow *screen_cast_window, - MetaRectangle *bounds) + MtkRectangle *bounds) { META_SCREEN_CAST_WINDOW_GET_IFACE (screen_cast_window)->get_buffer_bounds (screen_cast_window, bounds); @@ -70,7 +70,7 @@ meta_screen_cast_window_transform_cursor_position (MetaScreenCastWindow *screen_ void meta_screen_cast_window_capture_into (MetaScreenCastWindow *screen_cast_window, - MetaRectangle *bounds, + MtkRectangle *bounds, uint8_t *data) { META_SCREEN_CAST_WINDOW_GET_IFACE (screen_cast_window)->capture_into (screen_cast_window, @@ -80,7 +80,7 @@ meta_screen_cast_window_capture_into (MetaScreenCastWindow *screen_cast_window, gboolean meta_screen_cast_window_blit_to_framebuffer (MetaScreenCastWindow *screen_cast_window, - MetaRectangle *bounds, + MtkRectangle *bounds, CoglFramebuffer *framebuffer) { MetaScreenCastWindowInterface *iface = diff --git a/src/backends/meta-screen-cast-window.h b/src/backends/meta-screen-cast-window.h index 44c709828..95dcb9f68 100644 --- a/src/backends/meta-screen-cast-window.h +++ b/src/backends/meta-screen-cast-window.h @@ -35,7 +35,7 @@ struct _MetaScreenCastWindowInterface GTypeInterface parent_iface; void (*get_buffer_bounds) (MetaScreenCastWindow *screen_cast_window, - MetaRectangle *bounds); + MtkRectangle *bounds); void (*transform_relative_position) (MetaScreenCastWindow *screen_cast_window, double x, @@ -51,11 +51,11 @@ struct _MetaScreenCastWindowInterface graphene_point_t *out_relative_cursor_position); void (*capture_into) (MetaScreenCastWindow *screen_cast_window, - MetaRectangle *bounds, + MtkRectangle *bounds, uint8_t *data); gboolean (*blit_to_framebuffer) (MetaScreenCastWindow *screen_cast_window, - MetaRectangle *bounds, + MtkRectangle *bounds, CoglFramebuffer *framebuffer); gboolean (*has_damage) (MetaScreenCastWindow *screen_cast_window); @@ -65,7 +65,7 @@ struct _MetaScreenCastWindowInterface }; void meta_screen_cast_window_get_buffer_bounds (MetaScreenCastWindow *screen_cast_window, - MetaRectangle *bounds); + MtkRectangle *bounds); void meta_screen_cast_window_transform_relative_position (MetaScreenCastWindow *screen_cast_window, double x, @@ -81,11 +81,11 @@ gboolean meta_screen_cast_window_transform_cursor_position (MetaScreenCastWindow graphene_point_t *out_relative_cursor_position); void meta_screen_cast_window_capture_into (MetaScreenCastWindow *screen_cast_window, - MetaRectangle *bounds, + MtkRectangle *bounds, uint8_t *data); gboolean meta_screen_cast_window_blit_to_framebuffer (MetaScreenCastWindow *screen_cast_window, - MetaRectangle *bounds, + MtkRectangle *bounds, CoglFramebuffer *framebuffer); gboolean meta_screen_cast_window_has_damage (MetaScreenCastWindow *screen_cast_window); diff --git a/src/backends/meta-viewport-info.c b/src/backends/meta-viewport-info.c index 5f51f9ba7..f96875144 100644 --- a/src/backends/meta-viewport-info.c +++ b/src/backends/meta-viewport-info.c @@ -27,7 +27,7 @@ typedef struct _ViewInfo ViewInfo; struct _ViewInfo { - MetaRectangle rect; + MtkRectangle rect; float scale; }; @@ -65,10 +65,10 @@ meta_viewport_info_init (MetaViewportInfo *info) } MetaViewportInfo * -meta_viewport_info_new (MtkRectangle *views, - float *scales, - int n_views, - gboolean is_views_scaled) +meta_viewport_info_new (MtkRectangle *views, + float *scales, + int n_views, + gboolean is_views_scaled) { MetaViewportInfo *viewport_info; int i; @@ -108,10 +108,10 @@ meta_viewport_info_get_view_at (MetaViewportInfo *viewport_info, } gboolean -meta_viewport_info_get_view_info (MetaViewportInfo *viewport_info, - int idx, - MtkRectangle *rect, - float *scale) +meta_viewport_info_get_view_info (MetaViewportInfo *viewport_info, + int idx, + MtkRectangle *rect, + float *scale) { ViewInfo *info; @@ -128,9 +128,9 @@ meta_viewport_info_get_view_info (MetaViewportInfo *viewport_info, } static gboolean -view_has_neighbor (MtkRectangle *view, - MtkRectangle *neighbor, - MetaDisplayDirection neighbor_direction) +view_has_neighbor (MtkRectangle *view, + MtkRectangle *neighbor, + MetaDisplayDirection neighbor_direction) { switch (neighbor_direction) { diff --git a/src/backends/meta-viewport-info.h b/src/backends/meta-viewport-info.h index 72bf6a426..eec10a667 100644 --- a/src/backends/meta-viewport-info.h +++ b/src/backends/meta-viewport-info.h @@ -29,19 +29,19 @@ G_DECLARE_FINAL_TYPE (MetaViewportInfo, meta_viewport_info, META, VIEWPORT_INFO, GObject) -MetaViewportInfo * meta_viewport_info_new (MtkRectangle *views, - float *scales, - int n_views, - gboolean is_views_scaled); +MetaViewportInfo * meta_viewport_info_new (MtkRectangle *views, + float *scales, + int n_views, + gboolean is_views_scaled); int meta_viewport_info_get_view_at (MetaViewportInfo *info, float x, float y); -gboolean meta_viewport_info_get_view_info (MetaViewportInfo *viewport_info, - int idx, - MtkRectangle *rect, - float *scale); +gboolean meta_viewport_info_get_view_info (MetaViewportInfo *viewport_info, + int idx, + MtkRectangle *rect, + float *scale); int meta_viewport_info_get_neighbor (MetaViewportInfo *info, int idx, diff --git a/src/backends/native/meta-crtc-kms.c b/src/backends/native/meta-crtc-kms.c index a09a0060e..29b6a253c 100644 --- a/src/backends/native/meta-crtc-kms.c +++ b/src/backends/native/meta-crtc-kms.c @@ -265,7 +265,7 @@ meta_crtc_kms_assign_primary_plane (MetaCrtcKms *crtc_kms, const MetaCrtcConfig *crtc_config; const MetaCrtcModeInfo *crtc_mode_info; MetaFixed16Rectangle src_rect; - MetaRectangle dst_rect; + MtkRectangle dst_rect; MetaKmsAssignPlaneFlag flags; MetaKmsCrtc *kms_crtc; MetaKmsDevice *kms_device; @@ -281,7 +281,7 @@ meta_crtc_kms_assign_primary_plane (MetaCrtcKms *crtc_kms, .width = meta_fixed_16_from_int (crtc_mode_info->width), .height = meta_fixed_16_from_int (crtc_mode_info->height), }; - dst_rect = (MetaRectangle) { + dst_rect = (MtkRectangle) { .x = 0, .y = 0, .width = crtc_mode_info->width, diff --git a/src/backends/native/meta-kms-crtc.c b/src/backends/native/meta-kms-crtc.c index 2622b1413..707da9dc1 100644 --- a/src/backends/native/meta-kms-crtc.c +++ b/src/backends/native/meta-kms-crtc.c @@ -247,7 +247,7 @@ meta_kms_crtc_read_state (MetaKmsCrtc *crtc, crtc->prop_table.props, META_KMS_CRTC_N_PROPS); - crtc_state.rect = (MetaRectangle) { + crtc_state.rect = (MtkRectangle) { .x = drm_crtc->x, .y = drm_crtc->y, .width = drm_crtc->width, @@ -311,7 +311,7 @@ meta_kms_crtc_update_state_in_impl (MetaKmsCrtc *crtc) if (!drm_crtc || !drm_props) { crtc->current_state.is_active = FALSE; - crtc->current_state.rect = (MetaRectangle) { }; + crtc->current_state.rect = (MtkRectangle) { }; crtc->current_state.is_drm_mode_valid = FALSE; changes = META_KMS_RESOURCE_CHANGE_FULL; goto out; @@ -330,7 +330,7 @@ void meta_kms_crtc_disable_in_impl (MetaKmsCrtc *crtc) { crtc->current_state.is_active = FALSE; - crtc->current_state.rect = (MetaRectangle) { 0 }; + crtc->current_state.rect = (MtkRectangle) { 0 }; crtc->current_state.is_drm_mode_valid = FALSE; crtc->current_state.drm_mode = (drmModeModeInfo) { 0 }; } @@ -369,7 +369,7 @@ meta_kms_crtc_predict_state_in_impl (MetaKmsCrtc *crtc, else { crtc->current_state.is_active = FALSE; - crtc->current_state.rect = (MetaRectangle) { 0 }; + crtc->current_state.rect = (MtkRectangle) { 0 }; crtc->current_state.is_drm_mode_valid = FALSE; crtc->current_state.drm_mode = (drmModeModeInfo) { 0 }; } diff --git a/src/backends/native/meta-kms-crtc.h b/src/backends/native/meta-kms-crtc.h index cc178dadd..b26b682dd 100644 --- a/src/backends/native/meta-kms-crtc.h +++ b/src/backends/native/meta-kms-crtc.h @@ -30,7 +30,7 @@ typedef struct _MetaKmsCrtcState { gboolean is_active; - MetaRectangle rect; + MtkRectangle rect; gboolean is_drm_mode_valid; drmModeModeInfo drm_mode; diff --git a/src/backends/native/meta-kms-cursor-manager.c b/src/backends/native/meta-kms-cursor-manager.c index 3ecc5205d..68798b16a 100644 --- a/src/backends/native/meta-kms-cursor-manager.c +++ b/src/backends/native/meta-kms-cursor-manager.c @@ -371,7 +371,7 @@ maybe_update_cursor_plane (MetaKmsCursorManagerImpl *cursor_manager_impl, { int width, height; MetaFixed16Rectangle src_rect; - MetaRectangle dst_rect; + MtkRectangle dst_rect; MetaKmsAssignPlaneFlag assign_plane_flags = META_KMS_ASSIGN_PLANE_FLAG_NONE; MetaKmsPlaneAssignment *plane_assignment; @@ -395,7 +395,7 @@ maybe_update_cursor_plane (MetaKmsCursorManagerImpl *cursor_manager_impl, .width = meta_fixed_16_from_int (width), .height = meta_fixed_16_from_int (height), }; - dst_rect = (MetaRectangle) { + dst_rect = (MtkRectangle) { .x = round (cursor_rect.origin.x), .y = round (cursor_rect.origin.y), .width = round (cursor_rect.size.width), diff --git a/src/backends/native/meta-kms-update-private.h b/src/backends/native/meta-kms-update-private.h index e28fc07a6..edddd3e4a 100644 --- a/src/backends/native/meta-kms-update-private.h +++ b/src/backends/native/meta-kms-update-private.h @@ -60,7 +60,7 @@ typedef struct _MetaKmsPlaneAssignment MetaKmsPlane *plane; MetaDrmBuffer *buffer; MetaFixed16Rectangle src_rect; - MetaRectangle dst_rect; + MtkRectangle dst_rect; MetaKmsAssignPlaneFlag flags; MetaKmsFbDamage *fb_damage; MetaKmsPlaneRotation rotation; diff --git a/src/backends/native/meta-kms-update.c b/src/backends/native/meta-kms-update.c index 398e17b21..5189c5ab3 100644 --- a/src/backends/native/meta-kms-update.c +++ b/src/backends/native/meta-kms-update.c @@ -269,7 +269,7 @@ meta_kms_update_assign_plane (MetaKmsUpdate *update, MetaKmsPlane *plane, MetaDrmBuffer *buffer, MetaFixed16Rectangle src_rect, - MetaRectangle dst_rect, + MtkRectangle dst_rect, MetaKmsAssignPlaneFlag flags) { MetaKmsPlaneAssignment *plane_assignment; diff --git a/src/backends/native/meta-kms-update.h b/src/backends/native/meta-kms-update.h index 41a5e3cd6..c4d120d92 100644 --- a/src/backends/native/meta-kms-update.h +++ b/src/backends/native/meta-kms-update.h @@ -162,7 +162,7 @@ MetaKmsPlaneAssignment * meta_kms_update_assign_plane (MetaKmsUpdate *u MetaKmsPlane *plane, MetaDrmBuffer *buffer, MetaFixed16Rectangle src_rect, - MetaRectangle dst_rect, + MtkRectangle dst_rect, MetaKmsAssignPlaneFlag flags); MetaKmsPlaneAssignment * meta_kms_update_unassign_plane (MetaKmsUpdate *update, @@ -216,10 +216,10 @@ meta_fixed_16_to_double (MetaFixed16 fixed) return fixed / 65536.0; } -static inline MetaRectangle +static inline MtkRectangle meta_fixed_16_rectangle_to_rectangle (MetaFixed16Rectangle fixed_rect) { - return (MetaRectangle) { + return (MtkRectangle) { .x = meta_fixed_16_to_int (fixed_rect.x), .y = meta_fixed_16_to_int (fixed_rect.y), .width = meta_fixed_16_to_int (fixed_rect.width), diff --git a/src/backends/native/meta-renderer-native.c b/src/backends/native/meta-renderer-native.c index 7c3d354de..9103c04b2 100644 --- a/src/backends/native/meta-renderer-native.c +++ b/src/backends/native/meta-renderer-native.c @@ -1103,7 +1103,7 @@ meta_renderer_native_queue_modes_reset (MetaRendererNative *renderer_native) META_ONSCREEN_NATIVE (framebuffer); MetaCrtc *crtc; MetaKmsCrtc *kms_crtc; - MetaRectangle view_layout; + MtkRectangle view_layout; float view_scale; MetaKmsCrtcLayout crtc_layout; @@ -1320,7 +1320,7 @@ meta_renderer_native_create_view (MetaRenderer *renderer, float scale; int onscreen_width; int onscreen_height; - MetaRectangle view_layout; + MtkRectangle view_layout; MetaRendererViewNative *view_native; EGLSurface egl_surface; GError *error = NULL; diff --git a/src/backends/native/meta-stage-native.c b/src/backends/native/meta-stage-native.c index 6e60b6319..74b12a608 100644 --- a/src/backends/native/meta-stage-native.c +++ b/src/backends/native/meta-stage-native.c @@ -73,8 +73,8 @@ meta_stage_native_can_clip_redraws (ClutterStageWindow *stage_window) } static void -meta_stage_native_get_geometry (ClutterStageWindow *stage_window, - MtkRectangle *geometry) +meta_stage_native_get_geometry (ClutterStageWindow *stage_window, + MtkRectangle *geometry) { MetaStageImpl *stage_impl = META_STAGE_IMPL (stage_window); MetaBackend *backend = meta_stage_impl_get_backend (stage_impl); diff --git a/src/backends/x11/meta-crtc-xrandr.c b/src/backends/x11/meta-crtc-xrandr.c index e962d8fb9..d580a39b9 100644 --- a/src/backends/x11/meta-crtc-xrandr.c +++ b/src/backends/x11/meta-crtc-xrandr.c @@ -48,7 +48,7 @@ struct _MetaCrtcXrandr { MetaCrtc parent; - MetaRectangle rect; + MtkRectangle rect; MetaMonitorTransform transform; MetaCrtcMode *current_mode; }; @@ -254,7 +254,7 @@ meta_crtc_xrandr_new (MetaGpuXrandr *gpu_xrandr, panning = XRRGetPanning (xdisplay, resources, crtc_id); if (panning && panning->width > 0 && panning->height > 0) { - crtc_xrandr->rect = (MetaRectangle) { + crtc_xrandr->rect = (MtkRectangle) { .x = panning->left, .y = panning->top, .width = panning->width, @@ -263,7 +263,7 @@ meta_crtc_xrandr_new (MetaGpuXrandr *gpu_xrandr, } else { - crtc_xrandr->rect = (MetaRectangle) { + crtc_xrandr->rect = (MtkRectangle) { .x = xrandr_crtc->x, .y = xrandr_crtc->y, .width = xrandr_crtc->width, diff --git a/src/backends/x11/meta-stage-x11.c b/src/backends/x11/meta-stage-x11.c index 3956aeeb8..ae7a7fe0d 100644 --- a/src/backends/x11/meta-stage-x11.c +++ b/src/backends/x11/meta-stage-x11.c @@ -136,8 +136,8 @@ meta_stage_x11_set_wm_protocols (MetaStageX11 *stage_x11) } static void -meta_stage_x11_get_geometry (ClutterStageWindow *stage_window, - MtkRectangle *geometry) +meta_stage_x11_get_geometry (ClutterStageWindow *stage_window, + MtkRectangle *geometry) { MetaStageX11 *stage_x11 = META_STAGE_X11 (stage_window); diff --git a/src/backends/x11/nested/meta-renderer-x11-nested.c b/src/backends/x11/nested/meta-renderer-x11-nested.c index 0de6fed24..ca5ff061a 100644 --- a/src/backends/x11/nested/meta-renderer-x11-nested.c +++ b/src/backends/x11/nested/meta-renderer-x11-nested.c @@ -105,7 +105,7 @@ meta_renderer_x11_nested_create_view (MetaRenderer *renderer, int width, height; CoglOffscreen *fake_onscreen; CoglOffscreen *offscreen; - MetaRectangle view_layout; + MtkRectangle view_layout; const MetaCrtcModeInfo *mode_info; MetaRendererView *view; diff --git a/src/compositor/compositor-private.h b/src/compositor/compositor-private.h index 1bda3aa90..e8ff62430 100644 --- a/src/compositor/compositor-private.h +++ b/src/compositor/compositor-private.h @@ -123,11 +123,11 @@ void meta_compositor_switch_workspace (MetaCompositor *compositor, MetaWorkspace *to, MetaMotionDirection direction); -void meta_compositor_size_change_window (MetaCompositor *compositor, - MetaWindow *window, - MetaSizeChange which_change, - MetaRectangle *old_frame_rect, - MetaRectangle *old_buffer_rect); +void meta_compositor_size_change_window (MetaCompositor *compositor, + MetaWindow *window, + MetaSizeChange which_change, + MtkRectangle *old_frame_rect, + MtkRectangle *old_buffer_rect); void meta_compositor_sync_window_geometry (MetaCompositor *compositor, MetaWindow *window, @@ -148,7 +148,7 @@ void meta_compositor_flash_display (MetaCompositor *compositor, void meta_compositor_show_tile_preview (MetaCompositor *compositor, MetaWindow *window, - MetaRectangle *tile_rect, + MtkRectangle *tile_rect, int tile_monitor_number); void meta_compositor_hide_tile_preview (MetaCompositor *compositor); diff --git a/src/compositor/compositor.c b/src/compositor/compositor.c index 00b0dcca1..dac170e9f 100644 --- a/src/compositor/compositor.c +++ b/src/compositor/compositor.c @@ -620,11 +620,11 @@ meta_compositor_hide_window (MetaCompositor *compositor, } void -meta_compositor_size_change_window (MetaCompositor *compositor, - MetaWindow *window, - MetaSizeChange which_change, - MetaRectangle *old_frame_rect, - MetaRectangle *old_buffer_rect) +meta_compositor_size_change_window (MetaCompositor *compositor, + MetaWindow *window, + MetaSizeChange which_change, + MtkRectangle *old_frame_rect, + MtkRectangle *old_buffer_rect) { MetaWindowActor *window_actor = meta_window_actor_from_window (window); @@ -769,8 +769,8 @@ update_top_window_actor (MetaCompositor *compositor) { MetaWindowActor *window_actor = l->data; MetaWindow *window = meta_window_actor_get_meta_window (window_actor); - MetaRectangle buffer_rect; - MetaRectangle display_rect = { 0 }; + MtkRectangle buffer_rect; + MtkRectangle display_rect = { 0 }; if (!window->visible_to_compositor) continue; @@ -1515,7 +1515,7 @@ meta_compositor_monotonic_to_high_res_xserver_time (MetaCompositor *compositor, void meta_compositor_show_tile_preview (MetaCompositor *compositor, MetaWindow *window, - MetaRectangle *tile_rect, + MtkRectangle *tile_rect, int tile_monitor_number) { MetaCompositorPrivate *priv = diff --git a/src/compositor/edge-resistance.c b/src/compositor/edge-resistance.c index e15c70232..f3005714b 100644 --- a/src/compositor/edge-resistance.c +++ b/src/compositor/edge-resistance.c @@ -165,12 +165,12 @@ points_on_same_side (int ref, int pt1, int pt2) } static int -find_nearest_position (const GArray *edges, - int position, - int old_position, - const MetaRectangle *new_rect, - gboolean horizontal, - gboolean only_forward) +find_nearest_position (const GArray *edges, + int position, + int old_position, + const MtkRectangle *new_rect, + gboolean horizontal, + gboolean only_forward) { /* This is basically just a binary search except that we're looking * for the value closest to position, rather than finding that @@ -300,15 +300,15 @@ movement_towards_edge (MetaSide side, int increment) } static int -apply_edge_resistance (MetaWindow *window, - int old_pos, - int new_pos, - const MetaRectangle *old_rect, - const MetaRectangle *new_rect, - GArray *edges, - gboolean xdir, - gboolean include_windows, - gboolean keyboard_op) +apply_edge_resistance (MetaWindow *window, + int old_pos, + int new_pos, + const MtkRectangle *old_rect, + const MtkRectangle *new_rect, + GArray *edges, + gboolean xdir, + gboolean include_windows, + gboolean keyboard_op) { int i, begin, end; int last_edge; @@ -418,7 +418,7 @@ apply_edge_resistance (MetaWindow *window, static int apply_edge_snapping (int old_pos, int new_pos, - const MetaRectangle *new_rect, + const MtkRectangle *new_rect, GArray *edges, gboolean xdir, gboolean keyboard_op) @@ -460,12 +460,12 @@ apply_edge_snapping (int old_pos, static gboolean apply_edge_resistance_to_each_side (MetaEdgeResistanceData *edge_data, MetaWindow *window, - const MetaRectangle *old_outer, - MetaRectangle *new_outer, + const MtkRectangle *old_outer, + MtkRectangle *new_outer, MetaEdgeResistanceFlags flags, gboolean is_resize) { - MetaRectangle modified_rect; + MtkRectangle modified_rect; gboolean modified; int new_left, new_right, new_top, new_bottom; gboolean auto_snap, keyboard_op; @@ -510,7 +510,7 @@ apply_edge_resistance_to_each_side (MetaEdgeResistanceData *edge_data, } else if (auto_snap && META_WINDOW_TILED_SIDE_BY_SIDE (window)) { - MetaRectangle workarea; + MtkRectangle workarea; guint i; const gfloat tile_edges[] = @@ -918,8 +918,8 @@ compute_resistance_and_snapping_edges (MetaWindowDrag *window_drag) MetaWindow *cur_window = cur_window_iter->data; if (WINDOW_EDGES_RELEVANT (cur_window, display)) { - MetaRectangle *new_rect; - new_rect = g_new (MetaRectangle, 1); + MtkRectangle *new_rect; + new_rect = g_new (MtkRectangle, 1); meta_window_get_frame_rect (cur_window, new_rect); obscuring_windows = g_slist_prepend (obscuring_windows, new_rect); window_stacking = @@ -943,7 +943,7 @@ compute_resistance_and_snapping_edges (MetaWindowDrag *window_drag) cur_window_iter = stacked_windows; while (cur_window_iter != NULL) { - MetaRectangle cur_rect; + MtkRectangle cur_rect; MetaWindow *cur_window = cur_window_iter->data; meta_window_get_frame_rect (cur_window, &cur_rect); @@ -956,8 +956,8 @@ compute_resistance_and_snapping_edges (MetaWindowDrag *window_drag) { GList *new_edges; MetaEdge *new_edge; - MetaRectangle display_rect = { 0 }; - MetaRectangle reduced; + MtkRectangle display_rect = { 0 }; + MtkRectangle reduced; meta_display_get_size (display, &display_rect.width, &display_rect.height); @@ -1098,7 +1098,7 @@ meta_window_drag_edge_resistance_for_move (MetaWindowDrag *window_drag, MetaEdgeResistanceFlags flags) { MetaEdgeResistanceData *edge_data; - MetaRectangle old_outer, proposed_outer, new_outer; + MtkRectangle old_outer, proposed_outer, new_outer; gboolean is_resize, is_keyboard_op, snap; MetaWindow *window; @@ -1130,7 +1130,7 @@ meta_window_drag_edge_resistance_for_move (MetaWindowDrag *window_drag, * just have both edges move according to the stricter of the * resistances. Same thing goes for top & bottom edges. */ - MetaRectangle *reference; + MtkRectangle *reference; int left_change, right_change, smaller_x_change; int top_change, bottom_change, smaller_y_change; @@ -1181,7 +1181,7 @@ meta_window_drag_edge_resistance_for_resize (MetaWindowDrag *window_dra MetaEdgeResistanceFlags flags) { MetaEdgeResistanceData *edge_data; - MetaRectangle old_outer, new_outer; + MtkRectangle old_outer, new_outer; int proposed_outer_width, proposed_outer_height; MetaWindow *window; diff --git a/src/compositor/meta-background-content.c b/src/compositor/meta-background-content.c index 6f4137630..4d6cdb51e 100644 --- a/src/compositor/meta-background-content.c +++ b/src/compositor/meta-background-content.c @@ -456,7 +456,7 @@ setup_pipeline (MetaBackgroundContent *self, if (self->changed & CHANGED_GRADIENT_PARAMETERS) { - MetaRectangle monitor_geometry; + MtkRectangle monitor_geometry; float gradient_height_perc; meta_display_get_monitor_geometry (self->display, @@ -780,7 +780,7 @@ meta_background_content_get_preferred_size (ClutterContent *content, { MetaBackgroundContent *background_content = META_BACKGROUND_CONTENT (content); - MetaRectangle monitor_geometry; + MtkRectangle monitor_geometry; meta_display_get_monitor_geometry (background_content->display, background_content->monitor, @@ -806,8 +806,8 @@ static void set_monitor (MetaBackgroundContent *self, int monitor) { - MetaRectangle old_monitor_geometry; - MetaRectangle new_monitor_geometry; + MtkRectangle old_monitor_geometry; + MtkRectangle new_monitor_geometry; MetaDisplay *display = self->display; if(self->monitor == monitor) diff --git a/src/compositor/meta-background.c b/src/compositor/meta-background.c index 5ddd3977e..49dcf2a87 100644 --- a/src/compositor/meta-background.c +++ b/src/compositor/meta-background.c @@ -379,11 +379,11 @@ set_texture_area_from_monitor_area (MtkRectangle *monitor_area, } static void -get_texture_area (MetaBackground *self, - MtkRectangle *monitor_rect, - float monitor_scale, - CoglTexture *texture, - MtkRectangle *texture_area) +get_texture_area (MetaBackground *self, + MtkRectangle *monitor_rect, + float monitor_scale, + CoglTexture *texture, + MtkRectangle *texture_area) { MtkRectangle image_area; int screen_width, screen_height; @@ -489,12 +489,12 @@ get_texture_area (MetaBackground *self, } static gboolean -draw_texture (MetaBackground *self, - CoglFramebuffer *framebuffer, - CoglPipeline *pipeline, - CoglTexture *texture, - MtkRectangle *monitor_area, - float monitor_scale) +draw_texture (MetaBackground *self, + CoglFramebuffer *framebuffer, + CoglPipeline *pipeline, + CoglTexture *texture, + MtkRectangle *monitor_area, + float monitor_scale) { MtkRectangle texture_area; gboolean bare_region_visible; @@ -750,13 +750,13 @@ get_best_mipmap_level (CoglTexture *texture, } CoglTexture * -meta_background_get_texture (MetaBackground *self, - int monitor_index, - MtkRectangle *texture_area, - CoglPipelineWrapMode *wrap_mode) +meta_background_get_texture (MetaBackground *self, + int monitor_index, + MtkRectangle *texture_area, + CoglPipelineWrapMode *wrap_mode) { MetaBackgroundMonitor *monitor; - MetaRectangle geometry; + MtkRectangle geometry; MtkRectangle monitor_area; CoglTexture *texture1, *texture2; float monitor_scale; diff --git a/src/compositor/meta-compositor-view-native.c b/src/compositor/meta-compositor-view-native.c index 06a6e1fe4..33d8c0670 100644 --- a/src/compositor/meta-compositor-view-native.c +++ b/src/compositor/meta-compositor-view-native.c @@ -81,7 +81,7 @@ find_scanout_candidate (MetaCompositorView *compositor_view, CoglFramebuffer *framebuffer; MetaWindowActor *window_actor; MetaWindow *window; - MetaRectangle view_rect; + MtkRectangle view_rect; ClutterActorBox actor_box; MetaSurfaceActor *surface_actor; MetaSurfaceActorWayland *surface_actor_wayland; diff --git a/src/compositor/meta-compositor-view.c b/src/compositor/meta-compositor-view.c index e9f7ee7ad..ded69b3d7 100644 --- a/src/compositor/meta-compositor-view.c +++ b/src/compositor/meta-compositor-view.c @@ -70,8 +70,8 @@ find_top_window_actor_on_view (ClutterStageView *stage_view, MetaWindowActor *window_actor = l->data; MetaWindow *window = meta_window_actor_get_meta_window (window_actor); - MetaRectangle buffer_rect; - MetaRectangle view_layout; + MtkRectangle buffer_rect; + MtkRectangle view_layout; if (!window->visible_to_compositor) continue; diff --git a/src/compositor/meta-compositor-x11.c b/src/compositor/meta-compositor-x11.c index dc24b90a6..1ad3327dd 100644 --- a/src/compositor/meta-compositor-x11.c +++ b/src/compositor/meta-compositor-x11.c @@ -242,7 +242,7 @@ shape_cow_for_window (MetaCompositorX11 *compositor_x11, XserverRegion output_region; XRectangle screen_rect, window_bounds; int width, height; - MetaRectangle rect; + MtkRectangle rect; meta_window_get_frame_rect (window, &rect); diff --git a/src/compositor/meta-plugin-manager.c b/src/compositor/meta-plugin-manager.c index c455ccb61..7f5cc8324 100644 --- a/src/compositor/meta-plugin-manager.c +++ b/src/compositor/meta-plugin-manager.c @@ -272,8 +272,8 @@ gboolean meta_plugin_manager_event_size_change (MetaPluginManager *plugin_mgr, MetaWindowActor *actor, MetaSizeChange which_change, - MetaRectangle *old_frame_rect, - MetaRectangle *old_buffer_rect) + MtkRectangle *old_frame_rect, + MtkRectangle *old_buffer_rect) { MetaPlugin *plugin = plugin_mgr->plugin; MetaPluginClass *klass = META_PLUGIN_GET_CLASS (plugin); @@ -357,7 +357,7 @@ meta_plugin_manager_confirm_display_change (MetaPluginManager *plugin_mgr) gboolean meta_plugin_manager_show_tile_preview (MetaPluginManager *plugin_mgr, MetaWindow *window, - MetaRectangle *tile_rect, + MtkRectangle *tile_rect, int tile_monitor_number) { MetaPlugin *plugin = plugin_mgr->plugin; diff --git a/src/compositor/meta-plugin-manager.h b/src/compositor/meta-plugin-manager.h index e58f64db7..3e6ed75dd 100644 --- a/src/compositor/meta-plugin-manager.h +++ b/src/compositor/meta-plugin-manager.h @@ -59,8 +59,8 @@ void meta_plugin_manager_event_size_changed (MetaPluginManager *mgr, gboolean meta_plugin_manager_event_size_change (MetaPluginManager *mgr, MetaWindowActor *actor, MetaSizeChange which_change, - MetaRectangle *old_frame_rect, - MetaRectangle *old_buffer_rect); + MtkRectangle *old_frame_rect, + MtkRectangle *old_buffer_rect); gboolean meta_plugin_manager_switch_workspace (MetaPluginManager *mgr, gint from, @@ -79,7 +79,7 @@ void meta_plugin_manager_confirm_display_change (MetaPluginManager *mgr); gboolean meta_plugin_manager_show_tile_preview (MetaPluginManager *mgr, MetaWindow *window, - MetaRectangle *tile_rect, + MtkRectangle *tile_rect, int tile_monitor_number); gboolean meta_plugin_manager_hide_tile_preview (MetaPluginManager *mgr); diff --git a/src/compositor/meta-shadow-factory.c b/src/compositor/meta-shadow-factory.c index 5122e2db3..3875b8d3e 100644 --- a/src/compositor/meta-shadow-factory.c +++ b/src/compositor/meta-shadow-factory.c @@ -365,12 +365,12 @@ meta_shadow_paint (MetaShadow *shadow, * meta_shadow_paint() */ void -meta_shadow_get_bounds (MetaShadow *shadow, - int window_x, - int window_y, - int window_width, - int window_height, - MtkRectangle *bounds) +meta_shadow_get_bounds (MetaShadow *shadow, + int window_x, + int window_y, + int window_width, + int window_height, + MtkRectangle *bounds) { bounds->x = window_x - shadow->outer_border_left; bounds->y = window_y - shadow->outer_border_top; diff --git a/src/compositor/meta-shaped-texture-private.h b/src/compositor/meta-shaped-texture-private.h index 48e2bc676..24298db2b 100644 --- a/src/compositor/meta-shaped-texture-private.h +++ b/src/compositor/meta-shaped-texture-private.h @@ -53,12 +53,12 @@ void meta_shaped_texture_set_buffer_scale (MetaShapedTexture *stex, int buffer_scale); int meta_shaped_texture_get_buffer_scale (MetaShapedTexture *stex); -gboolean meta_shaped_texture_update_area (MetaShapedTexture *stex, - int x, - int y, - int width, - int height, - MtkRectangle *clip); +gboolean meta_shaped_texture_update_area (MetaShapedTexture *stex, + int x, + int y, + int width, + int height, + MtkRectangle *clip); int meta_shaped_texture_get_width (MetaShapedTexture *stex); int meta_shaped_texture_get_height (MetaShapedTexture *stex); diff --git a/src/compositor/meta-shaped-texture.c b/src/compositor/meta-shaped-texture.c index ea51f1d7e..6f57cd0d0 100644 --- a/src/compositor/meta-shaped-texture.c +++ b/src/compositor/meta-shaped-texture.c @@ -525,11 +525,11 @@ get_blended_overlay_pipeline (CoglContext *ctx) } static void -paint_clipped_rectangle_node (MetaShapedTexture *stex, - ClutterPaintNode *root_node, - CoglPipeline *pipeline, - MtkRectangle *rect, - ClutterActorBox *alloc) +paint_clipped_rectangle_node (MetaShapedTexture *stex, + ClutterPaintNode *root_node, + CoglPipeline *pipeline, + MtkRectangle *rect, + ClutterActorBox *alloc) { g_autoptr (ClutterPaintNode) node = NULL; float ratio_h, ratio_v; @@ -1006,12 +1006,12 @@ meta_shaped_texture_set_mask_texture (MetaShapedTexture *stex, * Return value: Whether a redraw have been queued or not */ gboolean -meta_shaped_texture_update_area (MetaShapedTexture *stex, - int x, - int y, - int width, - int height, - MtkRectangle *clip) +meta_shaped_texture_update_area (MetaShapedTexture *stex, + int x, + int y, + int width, + int height, + MtkRectangle *clip) { MetaMonitorTransform inverted_transform; MtkRectangle buffer_rect; @@ -1256,7 +1256,7 @@ meta_shaped_texture_is_opaque (MetaShapedTexture *stex) meta_shaped_texture_ensure_size_valid (stex); return mtk_rectangle_equal (&opaque_rect, - &(MetaRectangle) { + &(MtkRectangle) { .width = stex->dst_width, .height = stex->dst_height }); @@ -1416,8 +1416,8 @@ meta_shaped_texture_should_get_via_offscreen (MetaShapedTexture *stex) * cairo_surface_destroy(). */ cairo_surface_t * -meta_shaped_texture_get_image (MetaShapedTexture *stex, - MtkRectangle *clip) +meta_shaped_texture_get_image (MetaShapedTexture *stex, + MtkRectangle *clip) { MtkRectangle *image_clip = NULL; CoglTexture *texture; @@ -1452,7 +1452,7 @@ meta_shaped_texture_get_image (MetaShapedTexture *stex, image_clip)) return NULL; - *image_clip = (MetaRectangle) { + *image_clip = (MtkRectangle) { .x = image_clip->x * stex->buffer_scale, .y = image_clip->y * stex->buffer_scale, .width = image_clip->width * stex->buffer_scale, diff --git a/src/compositor/meta-surface-actor-x11.c b/src/compositor/meta-surface-actor-x11.c index 2d639c408..7834982e3 100644 --- a/src/compositor/meta-surface-actor-x11.c +++ b/src/compositor/meta-surface-actor-x11.c @@ -199,7 +199,7 @@ meta_surface_actor_x11_process_damage (MetaSurfaceActor *actor, if (meta_window_is_fullscreen (self->window) && !self->unredirected && !self->does_full_damage) { - MetaRectangle window_rect; + MtkRectangle window_rect; meta_window_get_frame_rect (self->window, &window_rect); if (x == 0 && diff --git a/src/compositor/meta-window-actor-private.h b/src/compositor/meta-window-actor-private.h index 766039f7d..e79910d72 100644 --- a/src/compositor/meta-window-actor-private.h +++ b/src/compositor/meta-window-actor-private.h @@ -33,8 +33,8 @@ struct _MetaWindowActorClass void (*update_regions) (MetaWindowActor *actor); gboolean (*can_freeze_commits) (MetaWindowActor *actor); - void (*sync_geometry) (MetaWindowActor *actor, - const MetaRectangle *actor_rect); + void (*sync_geometry) (MetaWindowActor *actor, + const MtkRectangle *actor_rect); gboolean (*is_single_surface_actor) (MetaWindowActor *actor); }; @@ -53,8 +53,8 @@ void meta_window_actor_hide (MetaWindowActor *self, void meta_window_actor_size_change (MetaWindowActor *self, MetaSizeChange which_change, - MetaRectangle *old_frame_rect, - MetaRectangle *old_buffer_rect); + MtkRectangle *old_frame_rect, + MtkRectangle *old_buffer_rect); void meta_window_actor_before_paint (MetaWindowActor *self, ClutterStageView *stage_view); diff --git a/src/compositor/meta-window-actor-wayland.c b/src/compositor/meta-window-actor-wayland.c index 755366581..7522df05b 100644 --- a/src/compositor/meta-window-actor-wayland.c +++ b/src/compositor/meta-window-actor-wayland.c @@ -107,7 +107,7 @@ surface_container_apply_transform (ClutterActor *actor, CLUTTER_ACTOR_CLASS (meta_surface_container_actor_wayland_parent_class); MetaWindow *window; MetaLogicalMonitor *logical_monitor; - MetaRectangle monitor_rect; + MtkRectangle monitor_rect; float scale; float rel_x, rel_y; float abs_x, abs_y; @@ -478,7 +478,7 @@ maybe_configure_black_background (MetaWindowActorWayland *self, MetaWindow *window = meta_window_actor_get_meta_window (window_actor); MetaLogicalMonitor *logical_monitor; int geometry_scale; - MetaRectangle fullscreen_layout; + MtkRectangle fullscreen_layout; ClutterActor *child; ClutterActorIter iter; float max_width = 0; @@ -526,8 +526,8 @@ maybe_configure_black_background (MetaWindowActorWayland *self, } static void -meta_window_actor_wayland_sync_geometry (MetaWindowActor *actor, - const MetaRectangle *actor_rect) +meta_window_actor_wayland_sync_geometry (MetaWindowActor *actor, + const MtkRectangle *actor_rect) { MetaWindowActorWayland *self = META_WINDOW_ACTOR_WAYLAND (actor); ClutterActor *surface_container = CLUTTER_ACTOR (self->surface_container); diff --git a/src/compositor/meta-window-actor-x11.c b/src/compositor/meta-window-actor-x11.c index 19bd41f59..70c5fa642 100644 --- a/src/compositor/meta-window-actor-x11.c +++ b/src/compositor/meta-window-actor-x11.c @@ -520,16 +520,16 @@ get_shadow_params (MetaWindowActorX11 *actor_x11, } static void -get_shape_bounds (MetaWindowActorX11 *actor_x11, - MtkRectangle *bounds) +get_shape_bounds (MetaWindowActorX11 *actor_x11, + MtkRectangle *bounds) { cairo_region_get_extents (actor_x11->shape_region, bounds); } static void -get_shadow_bounds (MetaWindowActorX11 *actor_x11, - gboolean appears_focused, - MtkRectangle *bounds) +get_shadow_bounds (MetaWindowActorX11 *actor_x11, + gboolean appears_focused, + MtkRectangle *bounds) { MetaShadow *shadow; MtkRectangle shape_bounds; @@ -737,9 +737,9 @@ scan_visible_region (guchar *mask_data, } static void -get_client_area_rect_from_texture (MetaWindowActorX11 *actor_x11, - MetaShapedTexture *shaped_texture, - MtkRectangle *client_area) +get_client_area_rect_from_texture (MetaWindowActorX11 *actor_x11, + MetaShapedTexture *shaped_texture, + MtkRectangle *client_area) { MetaWindow *window = meta_window_actor_get_meta_window (META_WINDOW_ACTOR (actor_x11)); @@ -753,8 +753,8 @@ get_client_area_rect_from_texture (MetaWindowActorX11 *actor_x11, } static void -get_client_area_rect (MetaWindowActorX11 *actor_x11, - MtkRectangle *client_area) +get_client_area_rect (MetaWindowActorX11 *actor_x11, + MtkRectangle *client_area) { MetaSurfaceActor *surface = meta_window_actor_get_surface (META_WINDOW_ACTOR (actor_x11)); @@ -1406,8 +1406,8 @@ meta_window_actor_x11_is_single_surface_actor (MetaWindowActor *actor) } static void -meta_window_actor_x11_sync_geometry (MetaWindowActor *actor, - const MetaRectangle *actor_rect) +meta_window_actor_x11_sync_geometry (MetaWindowActor *actor, + const MtkRectangle *actor_rect) { } diff --git a/src/compositor/meta-window-actor.c b/src/compositor/meta-window-actor.c index c82d5a8fa..c7948e0b2 100644 --- a/src/compositor/meta-window-actor.c +++ b/src/compositor/meta-window-actor.c @@ -939,7 +939,7 @@ meta_window_actor_sync_actor_geometry (MetaWindowActor *self, { MetaWindowActorPrivate *priv = meta_window_actor_get_instance_private (self); - MetaRectangle actor_rect; + MtkRectangle actor_rect; ClutterActor *actor = CLUTTER_ACTOR (self); MetaWindowActorChanges changes = 0; @@ -1074,10 +1074,10 @@ meta_window_actor_hide (MetaWindowActor *self, } void -meta_window_actor_size_change (MetaWindowActor *self, - MetaSizeChange which_change, - MetaRectangle *old_frame_rect, - MetaRectangle *old_buffer_rect) +meta_window_actor_size_change (MetaWindowActor *self, + MetaSizeChange which_change, + MtkRectangle *old_frame_rect, + MtkRectangle *old_buffer_rect) { MetaWindowActorPrivate *priv = meta_window_actor_get_instance_private (self); @@ -1224,7 +1224,7 @@ meta_window_actor_get_geometry_scale (MetaWindowActor *window_actor) static void meta_window_actor_get_buffer_bounds (MetaScreenCastWindow *screen_cast_window, - MetaRectangle *bounds) + MtkRectangle *bounds) { MetaWindowActor *window_actor = META_WINDOW_ACTOR (screen_cast_window); MetaWindowActorPrivate *priv = @@ -1232,7 +1232,7 @@ meta_window_actor_get_buffer_bounds (MetaScreenCastWindow *screen_cast_window, MetaShapedTexture *stex; stex = meta_surface_actor_get_texture (priv->surface); - *bounds = (MetaRectangle) { + *bounds = (MtkRectangle) { .width = floorf (meta_shaped_texture_get_unscaled_width (stex)), .height = floorf (meta_shaped_texture_get_unscaled_height (stex)), }; @@ -1249,7 +1249,7 @@ meta_window_actor_transform_relative_position (MetaScreenCastWindow *screen_cast MetaWindowActor *window_actor = META_WINDOW_ACTOR (screen_cast_window); MetaWindowActorPrivate *priv = meta_window_actor_get_instance_private (window_actor); - MetaRectangle bounds; + MtkRectangle bounds; graphene_point3d_t v1 = { 0.f, }, v2 = { 0.f, }; meta_window_actor_get_buffer_bounds (screen_cast_window, &bounds); @@ -1344,7 +1344,7 @@ meta_window_actor_transform_cursor_position (MetaScreenCastWindow *screen_cast_w static void meta_window_actor_capture_into (MetaScreenCastWindow *screen_cast_window, - MetaRectangle *bounds, + MtkRectangle *bounds, uint8_t *data) { MetaWindowActor *window_actor = META_WINDOW_ACTOR (screen_cast_window); @@ -1400,7 +1400,7 @@ meta_window_actor_capture_into (MetaScreenCastWindow *screen_cast_window, static gboolean meta_window_actor_blit_to_framebuffer (MetaScreenCastWindow *screen_cast_window, - MetaRectangle *bounds, + MtkRectangle *bounds, CoglFramebuffer *framebuffer) { MetaWindowActor *window_actor = META_WINDOW_ACTOR (screen_cast_window); @@ -1560,7 +1560,7 @@ meta_window_actor_notify_damaged (MetaWindowActor *window_actor) static CoglFramebuffer * create_framebuffer_from_window_actor (MetaWindowActor *self, - MetaRectangle *clip, + MtkRectangle *clip, GError **error) { MetaWindowActorPrivate *priv = meta_window_actor_get_instance_private (self); @@ -1636,14 +1636,14 @@ meta_window_actor_is_single_surface_actor (MetaWindowActor *self) */ cairo_surface_t * meta_window_actor_get_image (MetaWindowActor *self, - MetaRectangle *clip) + MtkRectangle *clip) { MetaWindowActorPrivate *priv = meta_window_actor_get_instance_private (self); ClutterActor *actor = CLUTTER_ACTOR (self); MetaShapedTexture *stex; cairo_surface_t *surface = NULL; CoglFramebuffer *framebuffer; - MetaRectangle framebuffer_clip; + MtkRectangle framebuffer_clip; float resource_scale; float x, y, width, height; @@ -1656,7 +1656,7 @@ meta_window_actor_get_image (MetaWindowActor *self, if (!meta_shaped_texture_should_get_via_offscreen (stex) && meta_window_actor_is_single_surface_actor (self)) { - MetaRectangle *surface_clip = NULL; + MtkRectangle *surface_clip = NULL; if (clip) { @@ -1665,7 +1665,7 @@ meta_window_actor_get_image (MetaWindowActor *self, geometry_scale = meta_window_actor_get_geometry_scale (self); - surface_clip = g_alloca (sizeof (MetaRectangle)); + surface_clip = g_alloca (sizeof (MtkRectangle)); surface_clip->x = clip->x / geometry_scale, surface_clip->y = clip->y / geometry_scale; surface_clip->width = clip->width / geometry_scale; @@ -1682,7 +1682,7 @@ meta_window_actor_get_image (MetaWindowActor *self, if (width == 0 || height == 0) goto out; - framebuffer_clip = (MetaRectangle) { + framebuffer_clip = (MtkRectangle) { .x = floorf (x), .y = floorf (y), .width = ceilf (width), @@ -1691,8 +1691,8 @@ meta_window_actor_get_image (MetaWindowActor *self, if (clip) { - MetaRectangle tmp_clip; - MetaRectangle intersected_clip; + MtkRectangle tmp_clip; + MtkRectangle intersected_clip; tmp_clip = *clip; tmp_clip.x += floorf (x); @@ -1746,7 +1746,7 @@ out: */ ClutterContent * meta_window_actor_paint_to_content (MetaWindowActor *self, - MetaRectangle *clip, + MtkRectangle *clip, GError **error) { MetaWindowActorPrivate *priv = meta_window_actor_get_instance_private (self); @@ -1754,7 +1754,7 @@ meta_window_actor_paint_to_content (MetaWindowActor *self, ClutterContent *content = NULL; CoglFramebuffer *framebuffer; CoglTexture *texture; - MetaRectangle framebuffer_clip; + MtkRectangle framebuffer_clip; float x, y, width, height; if (!priv->surface) @@ -1768,7 +1768,7 @@ meta_window_actor_paint_to_content (MetaWindowActor *self, if (width == 0 || height == 0) goto out; - framebuffer_clip = (MetaRectangle) { + framebuffer_clip = (MtkRectangle) { .x = floorf (x), .y = floorf (y), .width = ceilf (width), @@ -1777,7 +1777,7 @@ meta_window_actor_paint_to_content (MetaWindowActor *self, if (clip) { - MetaRectangle tmp_clip; + MtkRectangle tmp_clip; if (!mtk_rectangle_intersect (&framebuffer_clip, clip, &tmp_clip)) goto out; diff --git a/src/compositor/meta-window-drag.c b/src/compositor/meta-window-drag.c index 16c32e405..bd71d9e9c 100644 --- a/src/compositor/meta-window-drag.c +++ b/src/compositor/meta-window-drag.c @@ -63,7 +63,7 @@ struct _MetaWindowDrag { int tile_monitor_number; int latest_motion_x; int latest_motion_y; - MetaRectangle initial_window_pos; + MtkRectangle initial_window_pos; int initial_x, initial_y; /* These are only relevant for */ gboolean threshold_movement_reached; /* raise_on_click == FALSE. */ unsigned int last_edge_resistance_flags; @@ -112,7 +112,7 @@ update_tile_preview_timeout (MetaWindowDrag *window_drag) if (needs_preview) { - MetaRectangle tile_rect; + MtkRectangle tile_rect; int monitor; monitor = meta_window_get_current_tile_monitor_number (window); @@ -428,8 +428,8 @@ warp_grab_pointer (MetaWindowDrag *window_drag, int *x, int *y) { - MetaRectangle rect; - MetaRectangle display_rect = { 0 }; + MtkRectangle rect; + MtkRectangle display_rect = { 0 }; MetaDisplay *display; ClutterSeat *seat; @@ -589,7 +589,7 @@ process_keyboard_move_grab (MetaWindowDrag *window_drag, { MetaEdgeResistanceFlags flags; gboolean handled; - MetaRectangle frame_rect; + MtkRectangle frame_rect; ClutterModifierType modifiers; uint32_t keyval; int x, y; @@ -841,7 +841,7 @@ process_keyboard_resize_grab (MetaWindowDrag *window_drag, MetaWindow *window, ClutterKeyEvent *event) { - MetaRectangle frame_rect; + MtkRectangle frame_rect; gboolean handled; int height_inc; int width_inc; @@ -1133,7 +1133,7 @@ update_move_maybe_tile (MetaWindowDrag *window_drag, MetaMonitorManager *monitor_manager = meta_backend_get_monitor_manager (backend); MetaLogicalMonitor *logical_monitor; - MetaRectangle work_area; + MtkRectangle work_area; /* For side-by-side tiling we are interested in the inside vertical * edges of the work area of the monitor where the pointer is located, @@ -1186,7 +1186,7 @@ update_move (MetaWindowDrag *window_drag, MetaWindow *window; int dx, dy; int new_x, new_y; - MetaRectangle old, frame_rect; + MtkRectangle old, frame_rect; int shake_threshold; window = window_drag->effective_grab_window; @@ -1271,7 +1271,7 @@ update_move (MetaWindowDrag *window_drag, * instead, as the "correct" anchoring looks wrong. */ if (window_drag->anchor_root_y < window_drag->initial_window_pos.y) { - MetaRectangle titlebar_rect; + MtkRectangle titlebar_rect; meta_window_get_titlebar_rect (window, &titlebar_rect); window_drag->anchor_root_y = window_drag->initial_window_pos.y + titlebar_rect.height / 2; } @@ -1296,7 +1296,7 @@ update_move (MetaWindowDrag *window_drag, meta_backend_get_monitor_manager (backend); int n_logical_monitors; const MetaLogicalMonitor *wmonitor; - MetaRectangle work_area; + MtkRectangle work_area; int monitor; window->tile_mode = META_TILE_NONE; @@ -1424,8 +1424,8 @@ update_resize (MetaWindowDrag *window_drag, { int dx, dy; MetaGravity gravity; - MetaRectangle new_rect; - MetaRectangle old_rect; + MtkRectangle new_rect; + MtkRectangle old_rect; MetaWindow *window; window = window_drag->effective_grab_window; @@ -1581,7 +1581,7 @@ queue_update_resize (MetaWindowDrag *window_drag, static void maybe_maximize_tiled_window (MetaWindow *window) { - MetaRectangle work_area; + MtkRectangle work_area; gint shake_threshold; if (!META_WINDOW_TILED_SIDE_BY_SIDE (window)) diff --git a/src/compositor/plugins/default.c b/src/compositor/plugins/default.c index 5d68c2d26..99de19ec7 100644 --- a/src/compositor/plugins/default.c +++ b/src/compositor/plugins/default.c @@ -99,10 +99,10 @@ static void kill_window_effects (MetaPlugin *plugin, MetaWindowActor *actor); static void kill_switch_workspace (MetaPlugin *plugin); -static void show_tile_preview (MetaPlugin *plugin, - MetaWindow *window, - MetaRectangle *tile_rect, - int tile_monitor_number); +static void show_tile_preview (MetaPlugin *plugin, + MetaWindow *window, + MtkRectangle *tile_rect, + int tile_monitor_number); static void hide_tile_preview (MetaPlugin *plugin); static const MetaPluginInfo * plugin_info (MetaPlugin *plugin); @@ -150,7 +150,7 @@ typedef struct _DisplayTilePreview { ClutterActor *actor; - MetaRectangle tile_rect; + MtkRectangle tile_rect; } DisplayTilePreview; static void @@ -323,7 +323,7 @@ on_monitors_changed (MetaMonitorManager *monitor_manager, { MetaBackgroundContent *background_content; ClutterContent *content; - MetaRectangle rect; + MtkRectangle rect; ClutterActor *background_actor; MetaBackground *background; uint8_t red; @@ -611,7 +611,7 @@ static void minimize (MetaPlugin *plugin, MetaWindowActor *window_actor) { MetaWindowType type; - MetaRectangle icon_geometry; + MtkRectangle icon_geometry; MetaWindow *meta_window = meta_window_actor_get_meta_window (window_actor); ClutterTimeline *timeline = NULL; ClutterActor *actor = CLUTTER_ACTOR (window_actor); @@ -834,10 +834,10 @@ get_display_tile_preview (MetaDisplay *display) } static void -show_tile_preview (MetaPlugin *plugin, - MetaWindow *window, - MetaRectangle *tile_rect, - int tile_monitor_number) +show_tile_preview (MetaPlugin *plugin, + MetaWindow *window, + MtkRectangle *tile_rect, + int tile_monitor_number) { MetaDisplay *display = meta_plugin_get_display (plugin); DisplayTilePreview *preview = get_display_tile_preview (display); diff --git a/src/core/boxes-private.h b/src/core/boxes-private.h index 2f92d204d..da5a18e4e 100644 --- a/src/core/boxes-private.h +++ b/src/core/boxes-private.h @@ -57,8 +57,8 @@ typedef enum _MetaRoundingStrategy */ #define RECT_LENGTH 27 #define EDGE_LENGTH 37 -char* meta_rectangle_to_string (const MetaRectangle *rect, - char *output); +char* meta_rectangle_to_string (const MtkRectangle *rect, + char *output); char* meta_rectangle_region_to_string (GList *region, const char *separator_string, char *output); @@ -75,11 +75,11 @@ char* meta_rectangle_edge_list_to_string ( * it in a MoveResize operation if you muck with old_rect just right). */ META_EXPORT_TEST -void meta_rectangle_resize_with_gravity (const MetaRectangle *old_rect, - MetaRectangle *rect, - MetaGravity gravity, - int new_width, - int new_height); +void meta_rectangle_resize_with_gravity (const MtkRectangle *old_rect, + MtkRectangle *rect, + MetaGravity gravity, + int new_width, + int new_height); /* find a list of rectangles with the property that a window is contained * in the given region if and only if it is contained in one of the @@ -94,8 +94,8 @@ void meta_rectangle_resize_with_gravity (const MetaRectangle *old_rect, */ META_EXPORT_TEST GList* meta_rectangle_get_minimal_spanning_set_for_region ( - const MetaRectangle *basic_rect, - const GSList *all_struts); + const MtkRectangle *basic_rect, + const GSList *all_struts); /* Expand all rectangles in region by the given amount on each side */ GList* meta_rectangle_expand_region (GList *region, @@ -121,8 +121,8 @@ GList* meta_rectangle_expand_region_conditionally ( */ META_EXPORT_TEST void meta_rectangle_expand_to_avoiding_struts ( - MetaRectangle *rect, - const MetaRectangle *expand_to, + MtkRectangle *rect, + const MtkRectangle *expand_to, const MetaDirection direction, const GSList *all_struts); @@ -142,49 +142,49 @@ void meta_rectangle_free_list_and_elements (GList *filled_list); */ META_EXPORT_TEST gboolean meta_rectangle_could_fit_in_region ( - const GList *spanning_rects, - const MetaRectangle *rect); + const GList *spanning_rects, + const MtkRectangle *rect); META_EXPORT_TEST gboolean meta_rectangle_contained_in_region ( - const GList *spanning_rects, - const MetaRectangle *rect); + const GList *spanning_rects, + const MtkRectangle *rect); META_EXPORT_TEST gboolean meta_rectangle_overlaps_with_region ( - const GList *spanning_rects, - const MetaRectangle *rect); + const GList *spanning_rects, + const MtkRectangle *rect); gboolean meta_rectangle_is_adjacent_to_any_in_region ( - const GList *spanning_rects, - MetaRectangle *rect); + const GList *spanning_rects, + MtkRectangle *rect); /* Make the rectangle small enough to fit into one of the spanning_rects, * but make it no smaller than min_size. */ META_EXPORT_TEST void meta_rectangle_clamp_to_fit_into_region ( - const GList *spanning_rects, - FixedDirections fixed_directions, - MetaRectangle *rect, - const MetaRectangle *min_size); + const GList *spanning_rects, + FixedDirections fixed_directions, + MtkRectangle *rect, + const MtkRectangle *min_size); /* Clip the rectangle so that it fits into one of the spanning_rects, assuming * it overlaps with at least one of them */ META_EXPORT_TEST -void meta_rectangle_clip_to_region (const GList *spanning_rects, - FixedDirections fixed_directions, - MetaRectangle *rect); +void meta_rectangle_clip_to_region (const GList *spanning_rects, + FixedDirections fixed_directions, + MtkRectangle *rect); /* Shove the rectangle into one of the spanning_rects, assuming it fits in * one of them. */ META_EXPORT_TEST void meta_rectangle_shove_into_region( - const GList *spanning_rects, - FixedDirections fixed_directions, - MetaRectangle *rect); + const GList *spanning_rects, + FixedDirections fixed_directions, + MtkRectangle *rect); /* Finds the point on the line connecting (x1,y1) to (x2,y2) which is closest * to (px, py). Useful for finding an optimal rectangle size when given a @@ -206,8 +206,8 @@ void meta_rectangle_find_linepoint_closest_to_point (double x1, double y1, * nonzero-width dimension of the edge. */ META_EXPORT_TEST -gboolean meta_rectangle_edge_aligns (const MetaRectangle *rect, - const MetaEdge *edge); +gboolean meta_rectangle_edge_aligns (const MtkRectangle *rect, + const MetaEdge *edge); /* Compare two edges, so that sorting functions can put a list of edges in * canonical order. @@ -233,8 +233,8 @@ GList* meta_rectangle_remove_intersections_with_boxes_from_edges ( * MetaEdgeRect's. */ META_EXPORT_TEST -GList* meta_rectangle_find_onscreen_edges (const MetaRectangle *basic_rect, - const GSList *all_struts); +GList* meta_rectangle_find_onscreen_edges (const MtkRectangle *basic_rect, + const GSList *all_struts); /* Finds edges between adjacent monitors which are not covered by the given * struts. @@ -245,17 +245,17 @@ GList* meta_rectangle_find_nonintersected_monitor_edges ( const GSList *all_struts); META_EXPORT_TEST -gboolean meta_rectangle_is_adjacent_to (MetaRectangle *rect, - MetaRectangle *other); +gboolean meta_rectangle_is_adjacent_to (MtkRectangle *rect, + MtkRectangle *other); META_EXPORT_TEST -void meta_rectangle_scale_double (const MetaRectangle *rect, +void meta_rectangle_scale_double (const MtkRectangle *rect, double scale, MetaRoundingStrategy rounding_strategy, - MetaRectangle *dest); + MtkRectangle *dest); static inline graphene_rect_t -meta_rectangle_to_graphene_rect (MetaRectangle *rect) +meta_rectangle_to_graphene_rect (MtkRectangle *rect) { return (graphene_rect_t) { .origin = { @@ -270,18 +270,18 @@ meta_rectangle_to_graphene_rect (MetaRectangle *rect) } META_EXPORT_TEST -void meta_rectangle_transform (const MetaRectangle *rect, +void meta_rectangle_transform (const MtkRectangle *rect, MetaMonitorTransform transform, int width, int height, - MetaRectangle *dest); + MtkRectangle *dest); void meta_rectangle_from_graphene_rect (const graphene_rect_t *rect, MetaRoundingStrategy rounding_strategy, - MetaRectangle *dest); + MtkRectangle *dest); -void meta_rectangle_crop_and_scale (const MetaRectangle *rect, - graphene_rect_t *src_rect, - int dst_width, - int dst_height, - MetaRectangle *dest); +void meta_rectangle_crop_and_scale (const MtkRectangle *rect, + graphene_rect_t *src_rect, + int dst_width, + int dst_height, + MtkRectangle *dest); diff --git a/src/core/boxes.c b/src/core/boxes.c index 02e37d6ac..c82af6fb8 100644 --- a/src/core/boxes.c +++ b/src/core/boxes.c @@ -31,29 +31,9 @@ #include "meta/util.h" -/* It would make sense to use GSlice here, but until we clean up the - * rest of this file and the internal API to use these functions, we - * leave it using g_malloc()/g_free() for consistency. - */ - -MetaRectangle * -meta_rectangle_copy (const MetaRectangle *rect) -{ - return g_memdup2 (rect, sizeof (MetaRectangle)); -} - -void -meta_rectangle_free (MetaRectangle *rect) -{ - g_free (rect); -} - -G_DEFINE_BOXED_TYPE (MetaRectangle, meta_rectangle, - meta_rectangle_copy, meta_rectangle_free); - char* -meta_rectangle_to_string (const MetaRectangle *rect, - char *output) +meta_rectangle_to_string (const MtkRectangle *rect, + char *output) { /* 25 chars: 2 commas, space, plus, trailing \0 + 5 for each digit. * Should be more than enough space. Note that of this space, the @@ -85,7 +65,7 @@ meta_rectangle_region_to_string (GList *region, while (tmp) { - MetaRectangle *rect = tmp->data; + MtkRectangle *rect = tmp->data; g_snprintf (rect_string, RECT_LENGTH, "[%d,%d +%d,%d]", rect->x, rect->y, rect->width, rect->height); cur = g_stpcpy (cur, rect_string); @@ -121,7 +101,7 @@ meta_rectangle_edge_list_to_string (GList *edge_list, while (tmp) { MetaEdge *edge = tmp->data; - MetaRectangle *rect = &edge->rect; + MtkRectangle *rect = &edge->rect; g_snprintf (rect_string, EDGE_LENGTH, "([%d,%d +%d,%d], %2d, %2d)", rect->x, rect->y, rect->width, rect->height, edge->side_type, edge->edge_type); @@ -135,11 +115,11 @@ return output; } void -meta_rectangle_resize_with_gravity (const MetaRectangle *old_rect, - MetaRectangle *rect, - MetaGravity gravity, - int new_width, - int new_height) +meta_rectangle_resize_with_gravity (const MtkRectangle *old_rect, + MtkRectangle *rect, + MetaGravity gravity, + int new_width, + int new_height) { /* FIXME: I'm too deep into this to know whether the below comment is * still clear or not now that I've moved it out of constraints.c. @@ -251,14 +231,14 @@ merge_spanning_rects_in_region (GList *region) while (compare && compare->next) { - MetaRectangle *a = compare->data; + MtkRectangle *a = compare->data; GList *other = compare->next; g_assert (a->width > 0 && a->height > 0); while (other) { - MetaRectangle *b = other->data; + MtkRectangle *b = other->data; GList *delete_me = NULL; g_assert (b->width > 0 && b->height > 0); @@ -344,8 +324,8 @@ merge_spanning_rects_in_region (GList *region) static gint compare_rect_areas (gconstpointer a, gconstpointer b) { - const MetaRectangle *a_rect = (gconstpointer) a; - const MetaRectangle *b_rect = (gconstpointer) b; + const MtkRectangle *a_rect = (gconstpointer) a; + const MtkRectangle *b_rect = (gconstpointer) b; int a_area = mtk_rectangle_area (a_rect); int b_area = mtk_rectangle_area (b_rect); @@ -355,7 +335,8 @@ compare_rect_areas (gconstpointer a, gconstpointer b) /* ... and another helper for get_minimal_spanning_set_for_region()... */ static gboolean -check_strut_align (MetaStrut *strut, const MetaRectangle *rect) +check_strut_align (MetaStrut *strut, + const MtkRectangle *rect) { /* Check whether @strut actually aligns to the side of @rect it claims */ switch (strut->side) @@ -395,8 +376,8 @@ check_strut_align (MetaStrut *strut, const MetaRectangle *rect) */ GList* meta_rectangle_get_minimal_spanning_set_for_region ( - const MetaRectangle *basic_rect, - const GSList *all_struts) + const MtkRectangle *basic_rect, + const GSList *all_struts) { /* NOTE FOR OPTIMIZERS: This function *might* be somewhat slow, * especially due to the call to merge_spanning_rects_in_region() (which @@ -437,7 +418,7 @@ meta_rectangle_get_minimal_spanning_set_for_region ( GList *ret; GList *tmp_list; const GSList *strut_iter; - MetaRectangle *temp_rect; + MtkRectangle *temp_rect; /* The algorithm is basically as follows: * Initialize rectangle_set to basic_rect @@ -450,7 +431,7 @@ meta_rectangle_get_minimal_spanning_set_for_region ( * splitting */ - temp_rect = g_new (MetaRectangle, 1); + temp_rect = g_new (MtkRectangle, 1); *temp_rect = *basic_rect; ret = g_list_prepend (NULL, temp_rect); @@ -458,14 +439,14 @@ meta_rectangle_get_minimal_spanning_set_for_region ( { GList *rect_iter; MetaStrut *strut = (MetaStrut*)strut_iter->data; - MetaRectangle *strut_rect = &strut->rect; + MtkRectangle *strut_rect = &strut->rect; tmp_list = ret; ret = NULL; rect_iter = tmp_list; while (rect_iter) { - MetaRectangle *rect = (MetaRectangle*) rect_iter->data; + MtkRectangle *rect = (MtkRectangle*) rect_iter->data; if (!mtk_rectangle_overlap (strut_rect, rect) || !check_strut_align (strut, basic_rect)) @@ -475,7 +456,7 @@ meta_rectangle_get_minimal_spanning_set_for_region ( /* If there is area in rect left of strut */ if (BOX_LEFT (*rect) < BOX_LEFT (*strut_rect)) { - temp_rect = g_new (MetaRectangle, 1); + temp_rect = g_new (MtkRectangle, 1); *temp_rect = *rect; temp_rect->width = BOX_LEFT (*strut_rect) - BOX_LEFT (*rect); ret = g_list_prepend (ret, temp_rect); @@ -484,7 +465,7 @@ meta_rectangle_get_minimal_spanning_set_for_region ( if (BOX_RIGHT (*rect) > BOX_RIGHT (*strut_rect)) { int new_x; - temp_rect = g_new (MetaRectangle, 1); + temp_rect = g_new (MtkRectangle, 1); *temp_rect = *rect; new_x = BOX_RIGHT (*strut_rect); temp_rect->width = BOX_RIGHT (*rect) - new_x; @@ -494,7 +475,7 @@ meta_rectangle_get_minimal_spanning_set_for_region ( /* If there is area in rect above strut */ if (BOX_TOP (*rect) < BOX_TOP (*strut_rect)) { - temp_rect = g_new (MetaRectangle, 1); + temp_rect = g_new (MtkRectangle, 1); *temp_rect = *rect; temp_rect->height = BOX_TOP (*strut_rect) - BOX_TOP (*rect); ret = g_list_prepend (ret, temp_rect); @@ -503,7 +484,7 @@ meta_rectangle_get_minimal_spanning_set_for_region ( if (BOX_BOTTOM (*rect) > BOX_BOTTOM (*strut_rect)) { int new_y; - temp_rect = g_new (MetaRectangle, 1); + temp_rect = g_new (MtkRectangle, 1); *temp_rect = *rect; new_y = BOX_BOTTOM (*strut_rect); temp_rect->height = BOX_BOTTOM (*rect) - new_y; @@ -562,7 +543,7 @@ meta_rectangle_expand_region_conditionally (GList *region, GList *tmp_list = region; while (tmp_list) { - MetaRectangle *rect = (MetaRectangle*) tmp_list->data; + MtkRectangle *rect = (MtkRectangle*) tmp_list->data; if (rect->width >= min_x) { rect->x -= left_expand; @@ -580,8 +561,8 @@ meta_rectangle_expand_region_conditionally (GList *region, } void -meta_rectangle_expand_to_avoiding_struts (MetaRectangle *rect, - const MetaRectangle *expand_to, +meta_rectangle_expand_to_avoiding_struts (MtkRectangle *rect, + const MtkRectangle *expand_to, const MetaDirection direction, const GSList *all_struts) { @@ -656,8 +637,8 @@ meta_rectangle_free_list_and_elements (GList *filled_list) } gboolean -meta_rectangle_could_fit_in_region (const GList *spanning_rects, - const MetaRectangle *rect) +meta_rectangle_could_fit_in_region (const GList *spanning_rects, + const MtkRectangle *rect) { const GList *temp; gboolean could_fit; @@ -674,11 +655,11 @@ meta_rectangle_could_fit_in_region (const GList *spanning_rects, } gboolean -meta_rectangle_contained_in_region (const GList *spanning_rects, - const MetaRectangle *rect) +meta_rectangle_contained_in_region (const GList * spanning_rects, + const MtkRectangle * rect) { const GList *temp; - gboolean contained; + gboolean contained; temp = spanning_rects; contained = FALSE; @@ -692,8 +673,8 @@ meta_rectangle_contained_in_region (const GList *spanning_rects, } gboolean -meta_rectangle_overlaps_with_region (const GList *spanning_rects, - const MetaRectangle *rect) +meta_rectangle_overlaps_with_region (const GList * spanning_rects, + const MtkRectangle * rect) { const GList *temp; gboolean overlaps; @@ -710,14 +691,14 @@ meta_rectangle_overlaps_with_region (const GList *spanning_rects, } gboolean -meta_rectangle_is_adjacent_to_any_in_region (const GList *spanning_rects, - MetaRectangle *rect) +meta_rectangle_is_adjacent_to_any_in_region (const GList *spanning_rects, + MtkRectangle *rect) { const GList *l; for (l = spanning_rects; l; l = l->next) { - MetaRectangle *other = (MetaRectangle *) l->data; + MtkRectangle *other = (MtkRectangle *) l->data; if (rect == other || mtk_rectangle_equal (rect, other)) continue; @@ -730,13 +711,13 @@ meta_rectangle_is_adjacent_to_any_in_region (const GList *spanning_rects, } void -meta_rectangle_clamp_to_fit_into_region (const GList *spanning_rects, - FixedDirections fixed_directions, - MetaRectangle *rect, - const MetaRectangle *min_size) +meta_rectangle_clamp_to_fit_into_region (const GList *spanning_rects, + FixedDirections fixed_directions, + MtkRectangle *rect, + const MtkRectangle *min_size) { const GList *temp; - const MetaRectangle *best_rect = NULL; + const MtkRectangle *best_rect = NULL; int best_overlap = 0; /* First, find best rectangle from spanning_rects to which we can clamp @@ -744,7 +725,7 @@ meta_rectangle_clamp_to_fit_into_region (const GList *spanning_rects, */ for (temp = spanning_rects; temp; temp = temp->next) { - MetaRectangle *compare_rect = temp->data; + MtkRectangle *compare_rect = temp->data; int maximal_overlap_amount_for_compare; /* If x is fixed and the entire width of rect doesn't fit in compare, @@ -800,12 +781,12 @@ meta_rectangle_clamp_to_fit_into_region (const GList *spanning_rects, } void -meta_rectangle_clip_to_region (const GList *spanning_rects, - FixedDirections fixed_directions, - MetaRectangle *rect) +meta_rectangle_clip_to_region (const GList *spanning_rects, + FixedDirections fixed_directions, + MtkRectangle *rect) { const GList *temp; - const MetaRectangle *best_rect = NULL; + const MtkRectangle *best_rect = NULL; int best_overlap = 0; /* First, find best rectangle from spanning_rects to which we will clip @@ -813,8 +794,8 @@ meta_rectangle_clip_to_region (const GList *spanning_rects, */ for (temp = spanning_rects; temp; temp = temp->next) { - MetaRectangle *compare_rect = temp->data; - MetaRectangle overlap; + MtkRectangle *compare_rect = temp->data; + MtkRectangle overlap; int maximal_overlap_amount_for_compare; /* If x is fixed and the entire width of rect doesn't fit in compare, @@ -879,12 +860,12 @@ meta_rectangle_clip_to_region (const GList *spanning_rects, } void -meta_rectangle_shove_into_region (const GList *spanning_rects, - FixedDirections fixed_directions, - MetaRectangle *rect) +meta_rectangle_shove_into_region (const GList *spanning_rects, + FixedDirections fixed_directions, + MtkRectangle *rect) { const GList *temp; - const MetaRectangle *best_rect = NULL; + const MtkRectangle *best_rect = NULL; int best_overlap = 0; int shortest_distance = G_MAXINT; @@ -894,7 +875,7 @@ meta_rectangle_shove_into_region (const GList *spanning_rects, for (temp = spanning_rects; temp; temp = temp->next) { - MetaRectangle *compare_rect = temp->data; + MtkRectangle *compare_rect = temp->data; int maximal_overlap_amount_for_compare; int dist_to_compare; @@ -1044,7 +1025,8 @@ meta_rectangle_find_linepoint_closest_to_point (double x1, /***************************************************************************/ gboolean -meta_rectangle_edge_aligns (const MetaRectangle *rect, const MetaEdge *edge) +meta_rectangle_edge_aligns (const MtkRectangle *rect, + const MetaEdge *edge) { /* The reason for the usage of <= below instead of < is because we are * interested in in-the-way-or-adject'ness. So, a left (i.e. vertical @@ -1069,23 +1051,23 @@ meta_rectangle_edge_aligns (const MetaRectangle *rect, const MetaEdge *edge) } static GList* -get_rect_minus_overlap (const GList *rect_in_list, - MetaRectangle *overlap) +get_rect_minus_overlap (const GList *rect_in_list, + MtkRectangle *overlap) { - MetaRectangle *temp; - MetaRectangle *rect = rect_in_list->data; + MtkRectangle *temp; + MtkRectangle *rect = rect_in_list->data; GList *ret = NULL; if (BOX_LEFT (*rect) < BOX_LEFT (*overlap)) { - temp = g_new (MetaRectangle, 1); + temp = g_new (MtkRectangle, 1); *temp = *rect; temp->width = BOX_LEFT (*overlap) - BOX_LEFT (*rect); ret = g_list_prepend (ret, temp); } if (BOX_RIGHT (*rect) > BOX_RIGHT (*overlap)) { - temp = g_new (MetaRectangle, 1); + temp = g_new (MtkRectangle, 1); *temp = *rect; temp->x = BOX_RIGHT (*overlap); temp->width = BOX_RIGHT (*rect) - BOX_RIGHT (*overlap); @@ -1093,7 +1075,7 @@ get_rect_minus_overlap (const GList *rect_in_list, } if (BOX_TOP (*rect) < BOX_TOP (*overlap)) { - temp = g_new (MetaRectangle, 1); + temp = g_new (MtkRectangle, 1); temp->x = overlap->x; temp->width = overlap->width; temp->y = BOX_TOP (*rect); @@ -1102,7 +1084,7 @@ get_rect_minus_overlap (const GList *rect_in_list, } if (BOX_BOTTOM (*rect) > BOX_BOTTOM (*overlap)) { - temp = g_new (MetaRectangle, 1); + temp = g_new (MtkRectangle, 1); temp->x = overlap->x; temp->width = overlap->width; temp->y = BOX_BOTTOM (*overlap); @@ -1155,8 +1137,8 @@ replace_rect_with_list (GList *old_element, * once, so it's not really magic...). */ static GList* -get_disjoint_strut_rect_list_in_region (const GSList *old_struts, - const MetaRectangle *region) +get_disjoint_strut_rect_list_in_region (const GSList *old_struts, + const MtkRectangle *region) { GList *strut_rects; GList *tmp; @@ -1165,8 +1147,8 @@ get_disjoint_strut_rect_list_in_region (const GSList *old_struts, strut_rects = NULL; while (old_struts) { - MetaRectangle *cur = &((MetaStrut*)old_struts->data)->rect; - MetaRectangle *copy = g_new (MetaRectangle, 1); + MtkRectangle *cur = &((MetaStrut*)old_struts->data)->rect; + MtkRectangle *copy = g_new (MtkRectangle, 1); *copy = *cur; if (mtk_rectangle_intersect (copy, region, copy)) strut_rects = g_list_prepend (strut_rects, copy); @@ -1184,13 +1166,13 @@ get_disjoint_strut_rect_list_in_region (const GSList *old_struts, { GList *compare; - MetaRectangle *cur = tmp->data; + MtkRectangle *cur = tmp->data; compare = tmp->next; while (compare) { - MetaRectangle *comp = compare->data; - MetaRectangle overlap; + MtkRectangle *comp = compare->data; + MtkRectangle overlap; if (mtk_rectangle_intersect (cur, comp, &overlap)) { @@ -1201,7 +1183,7 @@ get_disjoint_strut_rect_list_in_region (const GSList *old_struts, GList *comp_leftover = get_rect_minus_overlap (compare, &overlap); /* Add the intersection region to cur_leftover */ - MetaRectangle *overlap_allocated = g_new (MetaRectangle, 1); + MtkRectangle *overlap_allocated = g_new (MtkRectangle, 1); *overlap_allocated = overlap; cur_leftover = g_list_prepend (cur_leftover, overlap_allocated); @@ -1313,13 +1295,13 @@ edges_overlap (const MetaEdge *edge1, } static gboolean -rectangle_and_edge_intersection (const MetaRectangle *rect, - const MetaEdge *edge, - MetaEdge *overlap, - int *handle_type) +rectangle_and_edge_intersection (const MtkRectangle *rect, + const MetaEdge *edge, + MetaEdge *overlap, + int *handle_type) { - const MetaRectangle *rect2 = &edge->rect; - MetaRectangle *result = &overlap->rect; + const MtkRectangle *rect2 = &edge->rect; + MtkRectangle *result = &overlap->rect; gboolean intersect = TRUE; /* We don't know how to set these, so set them to invalid values */ @@ -1397,9 +1379,9 @@ rectangle_and_edge_intersection (const MetaRectangle *rect, * TOP<->BOTTOM). */ static GList* -add_edges (GList *cur_edges, - const MetaRectangle *rect, - gboolean rect_is_internal) +add_edges (GList *cur_edges, + const MtkRectangle *rect, + gboolean rect_is_internal) { MetaEdge *temp_edge; int i; @@ -1504,9 +1486,11 @@ split_edge (GList *cur_list, * if and how rect and edge intersect. */ static void -fix_up_edges (MetaRectangle *rect, MetaEdge *edge, - GList **strut_edges, GList **edge_splits, - gboolean *edge_needs_removal) +fix_up_edges (MtkRectangle *rect, + MetaEdge *edge, + GList **strut_edges, + GList **edge_splits, + gboolean *edge_needs_removal) { MetaEdge overlap; int handle_type; @@ -1566,7 +1550,7 @@ meta_rectangle_remove_intersections_with_boxes_from_edges ( rect_iter = rectangles; while (rect_iter) { - MetaRectangle *rect = rect_iter->data; + MtkRectangle *rect = rect_iter->data; GList *edge_iter = edges; while (edge_iter) { @@ -1623,8 +1607,8 @@ meta_rectangle_remove_intersections_with_boxes_from_edges ( * This function is trying to find all the edges of an onscreen region. */ GList* -meta_rectangle_find_onscreen_edges (const MetaRectangle *basic_rect, - const GSList *all_struts) +meta_rectangle_find_onscreen_edges (const MtkRectangle *basic_rect, + const GSList *all_struts) { GList *ret; GList *fixed_strut_rects; @@ -1656,7 +1640,7 @@ meta_rectangle_find_onscreen_edges (const MetaRectangle *basic_rect, strut_rect_iter = fixed_strut_rects; while (strut_rect_iter) { - MetaRectangle *strut_rect = (MetaRectangle*) strut_rect_iter->data; + MtkRectangle *strut_rect = (MtkRectangle*) strut_rect_iter->data; /* Get the new possible edges we may need to add from the strut */ GList *new_strut_edges = add_edges (NULL, strut_rect, FALSE); @@ -1731,11 +1715,11 @@ meta_rectangle_find_nonintersected_monitor_edges ( cur = monitor_rects; while (cur) { - MetaRectangle *cur_rect = cur->data; + MtkRectangle *cur_rect = cur->data; const GList *compare = monitor_rects; while (compare) { - MetaRectangle *compare_rect = compare->data; + MtkRectangle *compare_rect = compare->data; /* Check if cur might be horizontally adjacent to compare */ if (mtk_rectangle_vert_overlap (cur_rect, compare_rect)) @@ -1843,8 +1827,8 @@ meta_rectangle_find_nonintersected_monitor_edges ( } gboolean -meta_rectangle_is_adjacent_to (MetaRectangle *rect, - MetaRectangle *other) +meta_rectangle_is_adjacent_to (MtkRectangle *rect, + MtkRectangle *other) { int rect_x1 = rect->x; int rect_y1 = rect->y; @@ -1866,10 +1850,10 @@ meta_rectangle_is_adjacent_to (MetaRectangle *rect, } void -meta_rectangle_scale_double (const MetaRectangle *rect, +meta_rectangle_scale_double (const MtkRectangle *rect, double scale, MetaRoundingStrategy rounding_strategy, - MetaRectangle *dest) + MtkRectangle *dest) { graphene_rect_t tmp = GRAPHENE_RECT_INIT (rect->x, rect->y, rect->width, rect->height); @@ -1880,11 +1864,11 @@ meta_rectangle_scale_double (const MetaRectangle *rect, /** * meta_rectangle_transform: - * @rect: the #MetaRectangle to be transformed + * @rect: the #MtkRectangle to be transformed * @transform: the #MetaMonitorTransform * @width: the width of the target space * @height: the height of the target space - * @dest: the transformed #MetaRectangle + * @dest: the transformed #MtkRectangle * * This function transforms the values in @rect in order to compensate for * @transform applied to a #MetaMonitor, making them match the viewport. Note @@ -1892,11 +1876,11 @@ meta_rectangle_scale_double (const MetaRectangle *rect, * an anti-clockwise rotation has to be applied to @rect. */ void -meta_rectangle_transform (const MetaRectangle *rect, +meta_rectangle_transform (const MtkRectangle *rect, MetaMonitorTransform transform, int width, int height, - MetaRectangle *dest) + MtkRectangle *dest) { switch (transform) { @@ -1904,7 +1888,7 @@ meta_rectangle_transform (const MetaRectangle *rect, *dest = *rect; break; case META_MONITOR_TRANSFORM_90: - *dest = (MetaRectangle) { + *dest = (MtkRectangle) { .x = rect->y, .y = height - (rect->x + rect->width), .width = rect->height, @@ -1912,7 +1896,7 @@ meta_rectangle_transform (const MetaRectangle *rect, }; break; case META_MONITOR_TRANSFORM_180: - *dest = (MetaRectangle) { + *dest = (MtkRectangle) { .x = width - (rect->x + rect->width), .y = height - (rect->y + rect->height), .width = rect->width, @@ -1920,7 +1904,7 @@ meta_rectangle_transform (const MetaRectangle *rect, }; break; case META_MONITOR_TRANSFORM_270: - *dest = (MetaRectangle) { + *dest = (MtkRectangle) { .x = width - (rect->y + rect->height), .y = rect->x, .width = rect->height, @@ -1928,7 +1912,7 @@ meta_rectangle_transform (const MetaRectangle *rect, }; break; case META_MONITOR_TRANSFORM_FLIPPED: - *dest = (MetaRectangle) { + *dest = (MtkRectangle) { .x = width - (rect->x + rect->width), .y = rect->y, .width = rect->width, @@ -1936,7 +1920,7 @@ meta_rectangle_transform (const MetaRectangle *rect, }; break; case META_MONITOR_TRANSFORM_FLIPPED_90: - *dest = (MetaRectangle) { + *dest = (MtkRectangle) { .x = rect->y, .y = rect->x, .width = rect->height, @@ -1944,7 +1928,7 @@ meta_rectangle_transform (const MetaRectangle *rect, }; break; case META_MONITOR_TRANSFORM_FLIPPED_180: - *dest = (MetaRectangle) { + *dest = (MtkRectangle) { .x = rect->x, .y = height - (rect->y + rect->height), .width = rect->width, @@ -1952,7 +1936,7 @@ meta_rectangle_transform (const MetaRectangle *rect, }; break; case META_MONITOR_TRANSFORM_FLIPPED_270: - *dest = (MetaRectangle) { + *dest = (MtkRectangle) { .x = width - (rect->y + rect->height), .y = height - (rect->x + rect->width), .width = rect->height, @@ -1965,13 +1949,13 @@ meta_rectangle_transform (const MetaRectangle *rect, void meta_rectangle_from_graphene_rect (const graphene_rect_t *rect, MetaRoundingStrategy rounding_strategy, - MetaRectangle *dest) + MtkRectangle *dest) { switch (rounding_strategy) { case META_ROUNDING_STRATEGY_SHRINK: { - *dest = (MetaRectangle) { + *dest = (MtkRectangle) { .x = ceilf (rect->origin.x), .y = ceilf (rect->origin.y), .width = floorf (rect->size.width), @@ -1985,7 +1969,7 @@ meta_rectangle_from_graphene_rect (const graphene_rect_t *rect, graphene_rect_round_extents (&clamped, &clamped); - *dest = (MetaRectangle) { + *dest = (MtkRectangle) { .x = clamped.origin.x, .y = clamped.origin.y, .width = clamped.size.width, @@ -1995,7 +1979,7 @@ meta_rectangle_from_graphene_rect (const graphene_rect_t *rect, break; case META_ROUNDING_STRATEGY_ROUND: { - *dest = (MetaRectangle) { + *dest = (MtkRectangle) { .x = roundf (rect->origin.x), .y = roundf (rect->origin.y), .width = roundf (rect->size.width), @@ -2006,11 +1990,11 @@ meta_rectangle_from_graphene_rect (const graphene_rect_t *rect, } void -meta_rectangle_crop_and_scale (const MetaRectangle *rect, - graphene_rect_t *src_rect, - int dst_width, - int dst_height, - MetaRectangle *dest) +meta_rectangle_crop_and_scale (const MtkRectangle *rect, + graphene_rect_t *src_rect, + int dst_width, + int dst_height, + MtkRectangle *dest) { graphene_rect_t tmp = GRAPHENE_RECT_INIT (rect->x, rect->y, rect->width, rect->height); diff --git a/src/core/constraints.c b/src/core/constraints.c index 4dae1aab6..3fd05a103 100644 --- a/src/core/constraints.c +++ b/src/core/constraints.c @@ -124,9 +124,9 @@ typedef struct { MetaBackend *backend; - MetaRectangle orig; - MetaRectangle current; - MetaRectangle temporary; + MtkRectangle orig; + MtkRectangle current; + MtkRectangle temporary; int rel_x; int rel_y; ActionType action_type; @@ -143,8 +143,8 @@ typedef struct /* work_area_monitor - current monitor region minus struts * entire_monitor - current monitor, including strut regions */ - MetaRectangle work_area_monitor; - MetaRectangle entire_monitor; + MtkRectangle work_area_monitor; + MtkRectangle entire_monitor; /* Spanning rectangles for the non-covered (by struts) region of the * screen and also for just the current monitor @@ -213,8 +213,8 @@ static void setup_constraint_info (MetaBackend *backend, MetaWindow *window, MetaMoveResizeFlags flags, MetaGravity resize_gravity, - const MetaRectangle *orig, - MetaRectangle *new); + const MtkRectangle *orig, + MtkRectangle *new); static void place_window_if_needed (MetaWindow *window, ConstraintInfo *info); static void update_onscreen_requirements (MetaWindow *window, @@ -289,9 +289,9 @@ void meta_window_constrain (MetaWindow *window, MetaMoveResizeFlags flags, MetaGravity resize_gravity, - const MetaRectangle *orig, - MetaRectangle *new, - MetaRectangle *temporary, + const MtkRectangle *orig, + MtkRectangle *new, + MtkRectangle *temporary, int *rel_x, int *rel_y) { @@ -351,8 +351,8 @@ setup_constraint_info (MetaBackend *backend, MetaWindow *window, MetaMoveResizeFlags flags, MetaGravity resize_gravity, - const MetaRectangle *orig, - MetaRectangle *new) + const MtkRectangle *orig, + MtkRectangle *new) { MetaMonitorManager *monitor_manager = meta_backend_get_monitor_manager (backend); @@ -419,8 +419,8 @@ setup_constraint_info (MetaBackend *backend, placement_rule = meta_window_get_placement_rule (window); if (placement_rule) { - MetaRectangle rect; - MetaRectangle parent_rect; + MtkRectangle rect; + MtkRectangle parent_rect; rect = placement_rule->anchor_rect; @@ -517,7 +517,7 @@ setup_constraint_info (MetaBackend *backend, info->entire_monitor.width, info->entire_monitor.height); } -static MetaRectangle * +static MtkRectangle * get_start_rect_for_resize (MetaWindow *window, ConstraintInfo *info) { @@ -548,12 +548,12 @@ place_window_if_needed(MetaWindow *window, { MetaMonitorManager *monitor_manager = meta_backend_get_monitor_manager (info->backend); - MetaRectangle orig_rect; - MetaRectangle placed_rect; + MtkRectangle orig_rect; + MtkRectangle placed_rect; MetaWorkspace *cur_workspace; MetaLogicalMonitor *logical_monitor; - placed_rect = (MetaRectangle) { + placed_rect = (MtkRectangle) { .x = window->rect.x, .y = window->rect.y, .width = info->current.width, @@ -711,7 +711,7 @@ update_onscreen_requirements (MetaWindow *window, */ if (window->frame && window->decorated) { - MetaRectangle titlebar_rect, frame_rect; + MtkRectangle titlebar_rect, frame_rect; meta_window_get_titlebar_rect (window, &titlebar_rect); meta_window_get_frame_rect (window, &frame_rect); @@ -733,11 +733,11 @@ update_onscreen_requirements (MetaWindow *window, } static inline void -get_size_limits (MetaWindow *window, - MetaRectangle *min_size, - MetaRectangle *max_size) +get_size_limits (MetaWindow *window, + MtkRectangle *min_size, + MtkRectangle *max_size) { - /* We pack the results into MetaRectangle structs just for convenience; we + /* We pack the results into MtkRectangle structs just for convenience; we * don't actually use the position of those rects. */ min_size->x = min_size->y = max_size->x = max_size->y = 0; @@ -809,14 +809,14 @@ try_flip_window_position (MetaWindow *window, MetaPlacementConstraintAdjustment constraint_adjustment, int parent_x, int parent_y, - MetaRectangle *rect, + MtkRectangle *rect, int *rel_x, int *rel_y, - MetaRectangle *intersection) + MtkRectangle *intersection) { MetaPlacementRule flipped_rule = *placement_rule; - MetaRectangle flipped_rect; - MetaRectangle flipped_intersection; + MtkRectangle flipped_rect; + MtkRectangle flipped_intersection; int flipped_rel_x; int flipped_rel_y; @@ -855,9 +855,9 @@ try_flip_window_position (MetaWindow *window, } static gboolean -is_custom_rule_satisfied (MetaRectangle *rect, +is_custom_rule_satisfied (MtkRectangle *rect, MetaPlacementRule *placement_rule, - MetaRectangle *intersection) + MtkRectangle *intersection) { uint32_t x_constrain_actions, y_constrain_actions; @@ -881,10 +881,10 @@ constrain_custom_rule (MetaWindow *window, gboolean check_only) { MetaPlacementRule *placement_rule; - MetaRectangle intersection; + MtkRectangle intersection; gboolean constraint_satisfied; - MetaRectangle temporary_rect; - MetaRectangle adjusted_unconstrained; + MtkRectangle temporary_rect; + MtkRectangle adjusted_unconstrained; int adjusted_rel_x; int adjusted_rel_y; MetaPlacementRule current_rule; @@ -925,7 +925,7 @@ constrain_custom_rule (MetaWindow *window, case META_PLACEMENT_STATE_CONSTRAINED_PENDING: case META_PLACEMENT_STATE_CONSTRAINED_FINISHED: case META_PLACEMENT_STATE_INVALIDATED: - temporary_rect = (MetaRectangle) { + temporary_rect = (MtkRectangle) { .x = parent->rect.x + window->placement.current.rel_x, .y = parent->rect.y + window->placement.current.rel_y, .width = info->current.width, @@ -1147,7 +1147,7 @@ constrain_modal_dialog (MetaWindow *window, { int x, y; MetaWindow *parent = meta_window_get_transient_for (window); - MetaRectangle child_rect, parent_rect; + MtkRectangle child_rect, parent_rect; gboolean constraint_already_satisfied; if (!parent || @@ -1192,8 +1192,8 @@ constrain_maximization (MetaWindow *window, gboolean check_only) { MetaWorkspaceManager *workspace_manager = window->display->workspace_manager; - MetaRectangle target_size; - MetaRectangle min_size, max_size; + MtkRectangle target_size; + MtkRectangle min_size, max_size; gboolean hminbad, vminbad; gboolean horiz_equal, vert_equal; gboolean constraint_already_satisfied; @@ -1280,8 +1280,8 @@ constrain_tiling (MetaWindow *window, ConstraintPriority priority, gboolean check_only) { - MetaRectangle target_size; - MetaRectangle min_size, max_size; + MtkRectangle target_size; + MtkRectangle min_size, max_size; gboolean hminbad, vminbad; gboolean horiz_equal, vert_equal; gboolean constraint_already_satisfied; @@ -1332,7 +1332,7 @@ constrain_fullscreen (MetaWindow *window, ConstraintPriority priority, gboolean check_only) { - MetaRectangle min_size, max_size, monitor; + MtkRectangle min_size, max_size, monitor; gboolean too_big, too_small, constraint_already_satisfied; if (priority > PRIORITY_FULLSCREEN) @@ -1370,8 +1370,8 @@ constrain_size_increments (MetaWindow *window, int bh, hi, bw, wi, extra_height, extra_width; int new_width, new_height; gboolean constraint_already_satisfied; - MetaRectangle *start_rect; - MetaRectangle client_rect; + MtkRectangle *start_rect; + MtkRectangle client_rect; if (priority > PRIORITY_SIZE_HINTS_INCREMENTS) return TRUE; @@ -1441,10 +1441,10 @@ constrain_size_limits (MetaWindow *window, ConstraintPriority priority, gboolean check_only) { - MetaRectangle min_size, max_size; + MtkRectangle min_size, max_size; gboolean too_big, too_small, constraint_already_satisfied; int new_width, new_height; - MetaRectangle *start_rect; + MtkRectangle *start_rect; if (priority > PRIORITY_SIZE_HINTS_LIMITS) return TRUE; @@ -1495,8 +1495,8 @@ constrain_aspect_ratio (MetaWindow *window, int fudge, new_width, new_height; double best_width, best_height; double alt_width, alt_height; - MetaRectangle *start_rect; - MetaRectangle client_rect; + MtkRectangle *start_rect; + MtkRectangle client_rect; if (priority > PRIORITY_ASPECT_RATIO) return TRUE; @@ -1633,7 +1633,7 @@ do_screen_and_monitor_relative_constraints ( gboolean check_only) { gboolean exit_early = FALSE, constraint_satisfied; - MetaRectangle how_far_it_can_be_smushed, min_size, max_size; + MtkRectangle how_far_it_can_be_smushed, min_size, max_size; #ifdef WITH_VERBOSE_MODE if (meta_is_verbose ()) diff --git a/src/core/constraints.h b/src/core/constraints.h index 80fe83081..0ee0cb1f0 100644 --- a/src/core/constraints.h +++ b/src/core/constraints.h @@ -29,8 +29,8 @@ void meta_window_constrain (MetaWindow *window, MetaMoveResizeFlags flags, MetaGravity resize_gravity, - const MetaRectangle *orig, - MetaRectangle *new, - MetaRectangle *intermediate, + const MtkRectangle *orig, + MtkRectangle *new, + MtkRectangle *intermediate, int *rel_x, int *rel_y); diff --git a/src/core/display-private.h b/src/core/display-private.h index e847e40e6..21a4b1959 100644 --- a/src/core/display-private.h +++ b/src/core/display-private.h @@ -284,11 +284,11 @@ gboolean meta_display_show_restart_message (MetaDisplay *display, const char *message); gboolean meta_display_request_restart (MetaDisplay *display); -gboolean meta_display_show_resize_popup (MetaDisplay *display, - gboolean show, - MetaRectangle *rect, - int display_w, - int display_h); +gboolean meta_display_show_resize_popup (MetaDisplay *display, + gboolean show, + MtkRectangle *rect, + int display_w, + int display_h); void meta_set_is_restart (gboolean whether); diff --git a/src/core/display.c b/src/core/display.c index d7baee597..28204b1a4 100644 --- a/src/core/display.c +++ b/src/core/display.c @@ -456,7 +456,7 @@ meta_display_class_init (MetaDisplayClass *klass) g_signal_accumulator_true_handled, NULL, NULL, G_TYPE_BOOLEAN, 4, - G_TYPE_BOOLEAN, META_TYPE_RECTANGLE, G_TYPE_INT, G_TYPE_INT); + G_TYPE_BOOLEAN, MTK_TYPE_RECTANGLE, G_TYPE_INT, G_TYPE_INT); display_signals[GL_VIDEO_MEMORY_PURGED] = g_signal_new ("gl-video-memory-purged", @@ -2703,11 +2703,11 @@ meta_display_request_restart (MetaDisplay *display) } gboolean -meta_display_show_resize_popup (MetaDisplay *display, - gboolean show, - MetaRectangle *rect, - int display_w, - int display_h) +meta_display_show_resize_popup (MetaDisplay *display, + gboolean show, + MtkRectangle *rect, + int display_w, + int display_h) { gboolean result = FALSE; @@ -3234,7 +3234,7 @@ check_fullscreen_func (gpointer data) if (covers_monitors) { - MetaRectangle window_rect; + MtkRectangle window_rect; meta_window_get_frame_rect (window, &window_rect); @@ -3300,8 +3300,8 @@ meta_display_queue_check_fullscreen (MetaDisplay *display) } int -meta_display_get_monitor_index_for_rect (MetaDisplay *display, - MetaRectangle *rect) +meta_display_get_monitor_index_for_rect (MetaDisplay *display, + MtkRectangle *rect) { MetaBackend *backend = backend_from_display (display); MetaMonitorManager *monitor_manager = @@ -3414,9 +3414,9 @@ meta_display_get_primary_monitor (MetaDisplay *display) * Stores the location and size of the indicated @monitor in @geometry. */ void -meta_display_get_monitor_geometry (MetaDisplay *display, - int monitor, - MetaRectangle *geometry) +meta_display_get_monitor_geometry (MetaDisplay *display, + int monitor, + MtkRectangle *geometry) { MetaBackend *backend = backend_from_display (display); MetaMonitorManager *monitor_manager = diff --git a/src/core/frame.c b/src/core/frame.c index 9ccae57a0..694a870d3 100644 --- a/src/core/frame.c +++ b/src/core/frame.c @@ -418,9 +418,9 @@ meta_frame_get_frame_bounds (MetaFrame *frame) } void -meta_frame_get_mask (MetaFrame *frame, - MtkRectangle *frame_rect, - cairo_t *cr) +meta_frame_get_mask (MetaFrame *frame, + MtkRectangle *frame_rect, + cairo_t *cr) { MetaFrameBorders borders; diff --git a/src/core/frame.h b/src/core/frame.h index 6c484b8a5..c134433ad 100644 --- a/src/core/frame.h +++ b/src/core/frame.h @@ -36,7 +36,7 @@ struct _MetaFrame /* This rect is trusted info from where we put the * frame, not the result of ConfigureNotify */ - MetaRectangle rect; + MtkRectangle rect; MetaFrameBorders cached_borders; /* valid if borders_cached is set */ @@ -69,9 +69,9 @@ void meta_frame_clear_cached_borders (MetaFrame *frame); cairo_region_t *meta_frame_get_frame_bounds (MetaFrame *frame); -void meta_frame_get_mask (MetaFrame *frame, - MtkRectangle *frame_rect, - cairo_t *cr); +void meta_frame_get_mask (MetaFrame *frame, + MtkRectangle *frame_rect, + cairo_t *cr); gboolean meta_frame_handle_xevent (MetaFrame *frame, XEvent *event); diff --git a/src/core/keybindings.c b/src/core/keybindings.c index d186dcdc6..43b549444 100644 --- a/src/core/keybindings.c +++ b/src/core/keybindings.c @@ -2376,8 +2376,8 @@ handle_move_to_corner_backend (MetaDisplay *display, MetaWindow *window, MetaGravity gravity) { - MetaRectangle work_area; - MetaRectangle frame_rect; + MtkRectangle work_area; + MtkRectangle frame_rect; int new_x, new_y; if (!window->monitor) @@ -2519,8 +2519,8 @@ handle_move_to_center (MetaDisplay *display, MetaKeyBinding *binding, gpointer user_data) { - MetaRectangle work_area; - MetaRectangle frame_rect; + MtkRectangle work_area; + MtkRectangle frame_rect; meta_window_get_work_area_current_monitor (window, &work_area); meta_window_get_frame_rect (window, &frame_rect); @@ -2564,7 +2564,7 @@ handle_activate_window_menu (MetaDisplay *display, if (display->focus_window) { int x, y; - MetaRectangle frame_rect; + MtkRectangle frame_rect; MtkRectangle child_rect; meta_window_get_frame_rect (display->focus_window, &frame_rect); @@ -2926,7 +2926,7 @@ handle_raise_or_lower (MetaDisplay *display, while (above) { - MetaRectangle tmp, win_rect, above_rect; + MtkRectangle tmp, win_rect, above_rect; if (above->mapped && meta_window_should_be_showing (above)) { diff --git a/src/core/place.c b/src/core/place.c index a9d326482..6eae1a9a7 100644 --- a/src/core/place.c +++ b/src/core/place.c @@ -50,8 +50,8 @@ northwest_cmp (gconstpointer a, { MetaWindow *aw = (gpointer) a; MetaWindow *bw = (gpointer) b; - MetaRectangle a_frame; - MetaRectangle b_frame; + MtkRectangle a_frame; + MtkRectangle b_frame; int from_origin_a; int from_origin_b; int ax, ay, bx, by; @@ -82,9 +82,9 @@ northeast_cmp (gconstpointer a, { MetaWindow *aw = (gpointer) a; MetaWindow *bw = (gpointer) b; - MetaRectangle *area = user_data; - MetaRectangle a_frame; - MetaRectangle b_frame; + MtkRectangle *area = user_data; + MtkRectangle a_frame; + MtkRectangle b_frame; int from_origin_a; int from_origin_b; int ax, ay, bx, by; @@ -123,12 +123,12 @@ find_next_cascade (MetaWindow *window, GList *tmp; GList *sorted; int cascade_origin_x, cascade_x, cascade_y; - MetaRectangle titlebar_rect; + MtkRectangle titlebar_rect; int x_threshold, y_threshold; - MetaRectangle frame_rect; + MtkRectangle frame_rect; int window_width, window_height; int cascade_stage; - MetaRectangle work_area; + MtkRectangle work_area; MetaLogicalMonitor *current; gboolean ltr = meta_get_locale_direction () == META_LOCALE_DIRECTION_LTR; @@ -177,7 +177,7 @@ find_next_cascade (MetaWindow *window, while (tmp != NULL) { MetaWindow *w; - MetaRectangle w_frame_rect; + MtkRectangle w_frame_rect; int wx, ww, wy; gboolean nearby; @@ -272,9 +272,9 @@ find_most_freespace (MetaWindow *window, int max_area; int max_width, max_height, left, right, top, bottom; int left_space, right_space, top_space, bottom_space; - MetaRectangle work_area; - MetaRectangle avoid; - MetaRectangle frame_rect; + MtkRectangle work_area; + MtkRectangle avoid; + MtkRectangle frame_rect; meta_window_get_work_area_current_monitor (focus_window, &work_area); meta_window_get_frame_rect (focus_window, &avoid); @@ -356,7 +356,7 @@ static gboolean window_overlaps_focus_window (MetaWindow *window) { MetaWindow *focus_window; - MetaRectangle window_frame, focus_frame, overlap; + MtkRectangle window_frame, focus_frame, overlap; focus_window = window->display->focus_window; if (focus_window == NULL) @@ -423,17 +423,17 @@ avoid_being_obscured_as_second_modal_dialog (MetaWindow *window, } static gboolean -rectangle_overlaps_some_window (MetaRectangle *rect, - GList *windows) +rectangle_overlaps_some_window (MtkRectangle *rect, + GList *windows) { GList *tmp; - MetaRectangle dest; + MtkRectangle dest; tmp = windows; while (tmp != NULL) { MetaWindow *other = tmp->data; - MetaRectangle other_rect; + MtkRectangle other_rect; switch (other->type) { @@ -474,8 +474,8 @@ leftmost_cmp (gconstpointer a, gconstpointer b) { MetaWindow *aw = (gpointer) a; MetaWindow *bw = (gpointer) b; - MetaRectangle a_frame; - MetaRectangle b_frame; + MtkRectangle a_frame; + MtkRectangle b_frame; int ax, bx; meta_window_get_frame_rect (aw, &a_frame); @@ -503,8 +503,8 @@ topmost_cmp (gconstpointer a, gconstpointer b) { MetaWindow *aw = (gpointer) a; MetaWindow *bw = (gpointer) b; - MetaRectangle a_frame; - MetaRectangle b_frame; + MtkRectangle a_frame; + MtkRectangle b_frame; int ay, by; meta_window_get_frame_rect (aw, &a_frame); @@ -521,8 +521,8 @@ topmost_cmp (gconstpointer a, gconstpointer b) } static void -center_tile_rect_in_area (MetaRectangle *rect, - MetaRectangle *work_area) +center_tile_rect_in_area (MtkRectangle *rect, + MtkRectangle *work_area) { int fluff; @@ -570,8 +570,8 @@ find_first_fit (MetaWindow *window, GList *below_sorted; GList *end_sorted; GList *tmp; - MetaRectangle rect; - MetaRectangle work_area; + MtkRectangle rect; + MtkRectangle work_area; gboolean ltr = meta_get_locale_direction () == META_LOCALE_DIRECTION_LTR; retval = FALSE; @@ -622,7 +622,7 @@ find_first_fit (MetaWindow *window, while (tmp != NULL) { MetaWindow *w = tmp->data; - MetaRectangle frame_rect; + MtkRectangle frame_rect; meta_window_get_frame_rect (w, &frame_rect); @@ -648,7 +648,7 @@ find_first_fit (MetaWindow *window, while (tmp != NULL) { MetaWindow *w = tmp->data; - MetaRectangle frame_rect; + MtkRectangle frame_rect; meta_window_get_frame_rect (w, &frame_rect); @@ -684,7 +684,7 @@ meta_window_process_placement (MetaWindow *window, int *rel_x, int *rel_y) { - MetaRectangle anchor_rect; + MtkRectangle anchor_rect; int window_width, window_height; int x, y; @@ -843,7 +843,7 @@ meta_window_place (MetaWindow *window, if (parent) { - MetaRectangle frame_rect, parent_frame_rect; + MtkRectangle frame_rect, parent_frame_rect; meta_window_get_frame_rect (window, &frame_rect); meta_window_get_frame_rect (parent, &parent_frame_rect); @@ -877,8 +877,8 @@ meta_window_place (MetaWindow *window, if (window_place_centered (window)) { /* Center on current monitor */ - MetaRectangle work_area; - MetaRectangle frame_rect; + MtkRectangle work_area; + MtkRectangle frame_rect; /* Warning, this function is a round trip! */ logical_monitor = meta_backend_get_current_logical_monitor (backend); @@ -933,8 +933,8 @@ meta_window_place (MetaWindow *window, if (window->has_maximize_func && window->decorated && !window->fullscreen) { - MetaRectangle workarea; - MetaRectangle frame_rect; + MtkRectangle workarea; + MtkRectangle frame_rect; meta_window_get_work_area_for_logical_monitor (window, logical_monitor, diff --git a/src/core/window-private.h b/src/core/window-private.h index f3300a977..fc5fac832 100644 --- a/src/core/window-private.h +++ b/src/core/window-private.h @@ -128,7 +128,7 @@ typedef enum _MetaWindowSuspendState typedef struct _MetaPlacementRule { - MetaRectangle anchor_rect; + MtkRectangle anchor_rect; MetaPlacementGravity gravity; MetaPlacementAnchor anchor; MetaPlacementConstraintAdjustment constraint_adjustment; @@ -139,7 +139,7 @@ typedef struct _MetaPlacementRule gboolean is_reactive; - MetaRectangle parent_rect; + MtkRectangle parent_rect; } MetaPlacementRule; typedef enum _MetaPlacementState @@ -292,20 +292,20 @@ struct _MetaWindow * information. */ /* The current window geometry of the window. */ - MetaRectangle rect; + MtkRectangle rect; /* The geometry to restore when we unmaximize. */ - MetaRectangle saved_rect; + MtkRectangle saved_rect; /* The geometry to restore when we unfullscreen. */ - MetaRectangle saved_rect_fullscreen; + MtkRectangle saved_rect_fullscreen; /* This is the geometry the window will have if no constraints have * applied. We use this whenever we are moving implicitly (for example, * if we move to avoid a panel, we can snap back to this position if * the panel moves again). */ - MetaRectangle unconstrained_rect; + MtkRectangle unconstrained_rect; /* The rectangle of the "server-side" geometry of the buffer, * in root coordinates. @@ -316,10 +316,10 @@ struct _MetaWindow * surface associated with shell surface (xdg_surface, etc.) * The size matches the size surface size as displayed in the stage. */ - MetaRectangle buffer_rect; + MtkRectangle buffer_rect; /* Cached net_wm_icon_geometry */ - MetaRectangle icon_geometry; + MtkRectangle icon_geometry; /* x/y/w/h here get filled with ConfigureRequest values */ XSizeHints size_hints; @@ -571,9 +571,9 @@ struct _MetaWindowClass void (*current_workspace_changed) (MetaWindow *window); void (*move_resize_internal) (MetaWindow *window, MetaGravity gravity, - MetaRectangle unconstrained_rect, - MetaRectangle constrained_rect, - MetaRectangle temporary_rect, + MtkRectangle unconstrained_rect, + MtkRectangle constrained_rect, + MtkRectangle temporary_rect, int rel_x, int rel_y, MetaMoveResizeFlags flags, @@ -592,7 +592,7 @@ struct _MetaWindowClass void (*main_monitor_changed) (MetaWindow *window, const MetaLogicalMonitor *old); void (*adjust_fullscreen_monitor_rect) (MetaWindow *window, - MetaRectangle *monitor_rect); + MtkRectangle *monitor_rect); void (*force_restore_shortcuts) (MetaWindow *window, ClutterInputDevice *source); gboolean (*shortcuts_inhibited) (MetaWindow *window, @@ -656,7 +656,7 @@ void meta_window_restore_tile (MetaWindow *window, int height); void meta_window_maximize_internal (MetaWindow *window, MetaMaximizeFlags directions, - MetaRectangle *saved_rect); + MtkRectangle *saved_rect); void meta_window_make_fullscreen_internal (MetaWindow *window); void meta_window_update_fullscreen_monitors (MetaWindow *window, @@ -668,7 +668,7 @@ void meta_window_update_fullscreen_monitors (MetaWindow *window, gboolean meta_window_has_fullscreen_monitors (MetaWindow *window); void meta_window_adjust_fullscreen_monitor_rect (MetaWindow *window, - MetaRectangle *monitor_rect); + MtkRectangle *monitor_rect); void meta_window_resize_frame_with_gravity (MetaWindow *window, gboolean user_op, @@ -731,12 +731,12 @@ GList* meta_window_get_workspaces (MetaWindow *window); void meta_window_get_work_area_for_logical_monitor (MetaWindow *window, MetaLogicalMonitor *logical_monitor, - MetaRectangle *area); + MtkRectangle *area); int meta_window_get_current_tile_monitor_number (MetaWindow *window); void meta_window_get_tile_area (MetaWindow *window, MetaTileMode mode, - MetaRectangle *tile_area); + MtkRectangle *tile_area); gboolean meta_window_same_application (MetaWindow *window, @@ -815,10 +815,10 @@ void meta_window_handle_leave (MetaWindow *window); void meta_window_handle_ungrabbed_event (MetaWindow *window, const ClutterEvent *event); -void meta_window_get_client_area_rect (const MetaWindow *window, - MtkRectangle *rect); -void meta_window_get_titlebar_rect (MetaWindow *window, - MetaRectangle *titlebar_rect); +void meta_window_get_client_area_rect (const MetaWindow *window, + MtkRectangle *rect); +void meta_window_get_titlebar_rect (MetaWindow *window, + MtkRectangle *titlebar_rect); void meta_window_activate_full (MetaWindow *window, guint32 timestamp, @@ -845,7 +845,7 @@ void meta_window_set_urgent (MetaWindow *window, void meta_window_move_resize_internal (MetaWindow *window, MetaMoveResizeFlags flags, MetaGravity gravity, - MetaRectangle frame_rect); + MtkRectangle frame_rect); void meta_window_grab_op_began (MetaWindow *window, MetaGrabOp op); void meta_window_grab_op_ended (MetaWindow *window, MetaGrabOp op); @@ -892,8 +892,8 @@ gboolean meta_window_calculate_bounds (MetaWindow *window, void meta_window_set_frame_xwindow (MetaWindow *window, Window xframe); -void meta_window_maybe_apply_size_hints (MetaWindow *window, - MetaRectangle *target_rect); +void meta_window_maybe_apply_size_hints (MetaWindow *window, + MtkRectangle *target_rect); void meta_window_inhibit_suspend_state (MetaWindow *window); diff --git a/src/core/window.c b/src/core/window.c index 520ba36f1..8a5dd4222 100644 --- a/src/core/window.c +++ b/src/core/window.c @@ -149,8 +149,8 @@ static gboolean queue_calc_showing_func (MetaWindow *window, static void meta_window_move_between_rects (MetaWindow *window, MetaMoveResizeFlags move_resize_flags, - const MetaRectangle *old_area, - const MetaRectangle *new_area); + const MtkRectangle *old_area, + const MtkRectangle *new_area); static void unmaximize_window_before_freeing (MetaWindow *window); static void unminimize_window_and_all_transient_parents (MetaWindow *window); @@ -987,7 +987,7 @@ meta_window_find_monitor_from_frame_rect (MetaWindow *window) MetaBackend *backend = backend_from_window (window); MetaMonitorManager *monitor_manager = meta_backend_get_monitor_manager (backend); - MetaRectangle window_rect; + MtkRectangle window_rect; meta_window_get_frame_rect (window, &window_rect); return meta_monitor_manager_get_logical_monitor_from_rect (monitor_manager, @@ -1000,7 +1000,7 @@ meta_window_find_highest_scale_monitor_from_frame_rect (MetaWindow *window) MetaBackend *backend = backend_from_window (window); MetaMonitorManager *monitor_manager = meta_backend_get_monitor_manager (backend); - MetaRectangle window_rect; + MtkRectangle window_rect; meta_window_get_frame_rect (window, &window_rect); return meta_monitor_manager_get_highest_scale_monitor_from_rect (monitor_manager, @@ -2018,7 +2018,7 @@ window_state_on_map (MetaWindow *window, static gboolean windows_overlap (const MetaWindow *w1, const MetaWindow *w2) { - MetaRectangle w1rect, w2rect; + MtkRectangle w1rect, w2rect; meta_window_get_frame_rect (w1, &w1rect); meta_window_get_frame_rect (w2, &w2rect); return mtk_rectangle_overlap (&w1rect, &w2rect); @@ -2247,7 +2247,7 @@ meta_window_show (MetaWindow *window) window->showing_for_first_time && window->has_maximize_func) { - MetaRectangle work_area; + MtkRectangle work_area; meta_window_get_work_area_for_monitor (window, window->monitor->number, &work_area); /* Automaximize windows that map with a size > MAX_UNMAXIMIZED_WINDOW_AREA of the work area */ if (window->rect.width * window->rect.height > work_area.width * work_area.height * MAX_UNMAXIMIZED_WINDOW_AREA) @@ -2574,7 +2574,7 @@ meta_window_unminimize (MetaWindow *window) } static void -ensure_size_hints_satisfied (MetaRectangle *rect, +ensure_size_hints_satisfied (MtkRectangle *rect, const XSizeHints *size_hints) { int minw, minh, maxw, maxh; /* min/max width/height */ @@ -2628,7 +2628,7 @@ meta_window_save_rect (MetaWindow *window) void meta_window_maximize_internal (MetaWindow *window, MetaMaximizeFlags directions, - MetaRectangle *saved_rect) + MtkRectangle *saved_rect) { /* At least one of the two directions ought to be set */ gboolean maximize_horizontally, maximize_vertically; @@ -2675,7 +2675,7 @@ void meta_window_maximize (MetaWindow *window, MetaMaximizeFlags directions) { - MetaRectangle *saved_rect = NULL; + MtkRectangle *saved_rect = NULL; gboolean maximize_horizontally, maximize_vertically; g_return_if_fail (META_IS_WINDOW (window)); @@ -2717,7 +2717,7 @@ meta_window_maximize (MetaWindow *window, directions, saved_rect); - MetaRectangle old_frame_rect, old_buffer_rect; + MtkRectangle old_frame_rect, old_buffer_rect; meta_window_get_frame_rect (window, &old_frame_rect); meta_window_get_buffer_rect (window, &old_buffer_rect); @@ -2774,7 +2774,7 @@ meta_window_is_fullscreen (MetaWindow *window) gboolean meta_window_is_screen_sized (MetaWindow *window) { - MetaRectangle window_rect; + MtkRectangle window_rect; int screen_width, screen_height; meta_display_get_size (window->display, &screen_width, &screen_height); @@ -2808,7 +2808,7 @@ meta_window_is_monitor_sized (MetaWindow *window) if (window->override_redirect) { - MetaRectangle window_rect, monitor_rect; + MtkRectangle window_rect, monitor_rect; meta_window_get_frame_rect (window, &window_rect); meta_display_get_monitor_geometry (window->display, window->monitor->number, &monitor_rect); @@ -2869,7 +2869,7 @@ meta_window_update_tile_fraction (MetaWindow *window, int new_h) { MetaWindow *tile_match = window->tile_match; - MetaRectangle work_area; + MtkRectangle work_area; MetaWindowDrag *window_drag; if (!META_WINDOW_TILED_SIDE_BY_SIDE (window)) @@ -3001,7 +3001,7 @@ meta_window_tile (MetaWindow *window, !window_drag || window->tile_match != meta_window_drag_get_window (window_drag)) { - MetaRectangle old_frame_rect, old_buffer_rect; + MtkRectangle old_frame_rect, old_buffer_rect; meta_window_get_frame_rect (window, &old_frame_rect); meta_window_get_buffer_rect (window, &old_buffer_rect); @@ -3046,8 +3046,8 @@ gboolean meta_window_can_tile_side_by_side (MetaWindow *window) { int monitor; - MetaRectangle tile_area; - MetaRectangle client_rect; + MtkRectangle tile_area; + MtkRectangle client_rect; if (!meta_window_can_tile_maximized (window)) return FALSE; @@ -3102,8 +3102,8 @@ unmaximize_window_before_freeing (MetaWindow *window) } void -meta_window_maybe_apply_size_hints (MetaWindow *window, - MetaRectangle *target_rect) +meta_window_maybe_apply_size_hints (MetaWindow *window, + MtkRectangle *target_rect) { meta_window_frame_rect_to_client_rect (window, target_rect, target_rect); ensure_size_hints_satisfied (target_rect, &window->size_hints); @@ -3133,10 +3133,10 @@ meta_window_unmaximize (MetaWindow *window, if ((unmaximize_horizontally && window->maximized_horizontally) || (unmaximize_vertically && window->maximized_vertically)) { - MetaRectangle *desired_rect; - MetaRectangle target_rect; - MetaRectangle work_area; - MetaRectangle old_frame_rect, old_buffer_rect; + MtkRectangle *desired_rect; + MtkRectangle target_rect; + MtkRectangle work_area; + MtkRectangle old_frame_rect, old_buffer_rect; gboolean has_target_size; meta_window_get_work_area_for_monitor (window, window->monitor->number, &work_area); @@ -3306,7 +3306,7 @@ meta_window_make_fullscreen (MetaWindow *window) if (!window->fullscreen) { - MetaRectangle old_frame_rect, old_buffer_rect; + MtkRectangle old_frame_rect, old_buffer_rect; meta_window_get_frame_rect (window, &old_frame_rect); meta_window_get_buffer_rect (window, &old_buffer_rect); @@ -3334,7 +3334,7 @@ meta_window_unmake_fullscreen (MetaWindow *window) if (window->fullscreen) { - MetaRectangle old_frame_rect, old_buffer_rect, target_rect; + MtkRectangle old_frame_rect, old_buffer_rect, target_rect; gboolean has_target_size; meta_topic (META_DEBUG_WINDOW_OPS, @@ -3419,8 +3419,8 @@ meta_window_has_fullscreen_monitors (MetaWindow *window) } void -meta_window_adjust_fullscreen_monitor_rect (MetaWindow *window, - MetaRectangle *monitor_rect) +meta_window_adjust_fullscreen_monitor_rect (MetaWindow *window, + MtkRectangle *monitor_rect) { MetaWindowClass *window_class = META_WINDOW_GET_CLASS (window); @@ -3777,7 +3777,7 @@ void meta_window_move_resize_internal (MetaWindow *window, MetaMoveResizeFlags flags, MetaGravity gravity, - MetaRectangle frame_rect) + MtkRectangle frame_rect) { /* The rectangle here that's passed in *always* in "frame rect" * coordinates. That means the position of the frame's visible bounds, @@ -3800,9 +3800,9 @@ meta_window_move_resize_internal (MetaWindow *window, MetaWorkspaceManager *workspace_manager = window->display->workspace_manager; gboolean did_placement; - MetaRectangle unconstrained_rect; - MetaRectangle constrained_rect; - MetaRectangle temporary_rect; + MtkRectangle unconstrained_rect; + MtkRectangle constrained_rect; + MtkRectangle temporary_rect; int rel_x = 0; int rel_y = 0; MetaMoveResizeResultFlags result = 0; @@ -3862,7 +3862,7 @@ meta_window_move_resize_internal (MetaWindow *window, temporary_rect = window->rect; if (flags & META_MOVE_RESIZE_CONSTRAIN && window->monitor) { - MetaRectangle old_rect; + MtkRectangle old_rect; meta_window_get_frame_rect (window, &old_rect); meta_window_constrain (window, @@ -3988,7 +3988,7 @@ meta_window_move_frame (MetaWindow *window, int root_y_nw) { MetaMoveResizeFlags flags; - MetaRectangle rect = { root_x_nw, root_y_nw, 0, 0 }; + MtkRectangle rect = { root_x_nw, root_y_nw, 0, 0 }; g_return_if_fail (!window->override_redirect); @@ -4001,8 +4001,8 @@ meta_window_move_frame (MetaWindow *window, static void meta_window_move_between_rects (MetaWindow *window, MetaMoveResizeFlags move_resize_flags, - const MetaRectangle *old_area, - const MetaRectangle *new_area) + const MtkRectangle *old_area, + const MtkRectangle *new_area) { double rel_x, rel_y; int new_x, new_y; @@ -4080,7 +4080,7 @@ meta_window_move_resize_frame (MetaWindow *window, int h) { MetaMoveResizeFlags flags; - MetaRectangle rect = { root_x_nw, root_y_nw, w, h }; + MtkRectangle rect = { root_x_nw, root_y_nw, w, h }; g_return_if_fail (!window->override_redirect); @@ -4104,7 +4104,7 @@ void meta_window_move_to_monitor (MetaWindow *window, int monitor) { - MetaRectangle old_area, new_area; + MtkRectangle old_area, new_area; if (window->tile_mode != META_TILE_NONE) window->tile_monitor_number = monitor; @@ -4124,7 +4124,7 @@ meta_window_move_to_monitor (MetaWindow *window, } else { - MetaRectangle old_frame_rect, old_buffer_rect; + MtkRectangle old_frame_rect, old_buffer_rect; if (monitor == window->monitor->number) return; @@ -4150,7 +4150,7 @@ adjust_size_for_tile_match (MetaWindow *window, int *new_w, int *new_h) { - MetaRectangle work_area, rect; + MtkRectangle work_area, rect; MetaWindow *tile_match = window->tile_match; if (!META_WINDOW_TILED_SIDE_BY_SIDE (window) || !tile_match) @@ -4181,7 +4181,7 @@ meta_window_resize_frame_with_gravity (MetaWindow *window, MetaGravity gravity) { MetaMoveResizeFlags flags; - MetaRectangle rect; + MtkRectangle rect; rect.width = w; rect.height = h; @@ -4224,7 +4224,7 @@ meta_window_get_gravity_position (MetaWindow *window, int *root_x, int *root_y) { - MetaRectangle frame_extents; + MtkRectangle frame_extents; int w, h; int x, y; @@ -4322,7 +4322,7 @@ meta_window_get_session_geometry (MetaWindow *window, /** * meta_window_get_buffer_rect: * @window: a #MetaWindow - * @rect: (out): pointer to an allocated #MetaRectangle + * @rect: (out): pointer to an allocated #MtkRectangle * * Gets the rectangle that the pixmap or buffer of @window occupies. * @@ -4334,7 +4334,7 @@ meta_window_get_session_geometry (MetaWindow *window, */ void meta_window_get_buffer_rect (const MetaWindow *window, - MetaRectangle *rect) + MtkRectangle *rect) { *rect = window->buffer_rect; } @@ -4349,9 +4349,9 @@ meta_window_get_buffer_rect (const MetaWindow *window, * of the window frame (excluding invisible borders and client side shadows.) */ void -meta_window_client_rect_to_frame_rect (MetaWindow *window, - MetaRectangle *client_rect, - MetaRectangle *frame_rect) +meta_window_client_rect_to_frame_rect (MetaWindow *window, + MtkRectangle *client_rect, + MtkRectangle *frame_rect) { if (!frame_rect) return; @@ -4396,9 +4396,9 @@ meta_window_client_rect_to_frame_rect (MetaWindow *window, * window. */ void -meta_window_frame_rect_to_client_rect (MetaWindow *window, - MetaRectangle *frame_rect, - MetaRectangle *client_rect) +meta_window_frame_rect_to_client_rect (MetaWindow *window, + MtkRectangle *frame_rect, + MtkRectangle *client_rect) { if (!client_rect) return; @@ -4428,7 +4428,7 @@ meta_window_frame_rect_to_client_rect (MetaWindow *window, /** * meta_window_get_frame_rect: * @window: a #MetaWindow - * @rect: (out): pointer to an allocated #MetaRectangle + * @rect: (out): pointer to an allocated #MtkRectangle * * Gets the rectangle that bounds @window that is what the user thinks of * as the edge of the window. @@ -4438,7 +4438,7 @@ meta_window_frame_rect_to_client_rect (MetaWindow *window, */ void meta_window_get_frame_rect (const MetaWindow *window, - MetaRectangle *rect) + MtkRectangle *rect) { *rect = window->rect; } @@ -4452,8 +4452,8 @@ meta_window_get_frame_rect (const MetaWindow *window, * to the buffer rect. */ void -meta_window_get_client_area_rect (const MetaWindow *window, - MtkRectangle *rect) +meta_window_get_client_area_rect (const MetaWindow *window, + MtkRectangle *rect) { MetaFrameBorders borders; @@ -4467,8 +4467,8 @@ meta_window_get_client_area_rect (const MetaWindow *window, } void -meta_window_get_titlebar_rect (MetaWindow *window, - MetaRectangle *rect) +meta_window_get_titlebar_rect (MetaWindow *window, + MtkRectangle *rect) { meta_window_get_frame_rect (window, rect); @@ -5325,8 +5325,8 @@ meta_window_set_focused_internal (MetaWindow *window, * Return value: %TRUE if the icon geometry was successfully retrieved. */ gboolean -meta_window_get_icon_geometry (MetaWindow *window, - MetaRectangle *rect) +meta_window_get_icon_geometry (MetaWindow *window, + MtkRectangle *rect) { g_return_val_if_fail (!window->override_redirect, FALSE); @@ -5352,8 +5352,8 @@ meta_window_get_icon_geometry (MetaWindow *window, * interface element displaying the icon, and is relative to the root window. */ void -meta_window_set_icon_geometry (MetaWindow *window, - MetaRectangle *rect) +meta_window_set_icon_geometry (MetaWindow *window, + MtkRectangle *rect) { if (rect) { @@ -5621,7 +5621,7 @@ meta_window_recalc_features (MetaWindow *window) if (!window->has_resize_func) { window->has_maximize_func = FALSE; - MetaRectangle display_rect = { 0 }; + MtkRectangle display_rect = { 0 }; meta_display_get_size (window->display, &display_rect.width, &display_rect.height); @@ -5654,7 +5654,7 @@ meta_window_recalc_features (MetaWindow *window) if (window->has_maximize_func && window->monitor) { - MetaRectangle work_area, client_rect; + MtkRectangle work_area, client_rect; meta_window_get_work_area_current_monitor (window, &work_area); meta_window_frame_rect_to_client_rect (window, &work_area, &client_rect); @@ -5729,7 +5729,7 @@ void meta_window_shove_titlebar_onscreen (MetaWindow *window) { MetaWorkspaceManager *workspace_manager = window->display->workspace_manager; - MetaRectangle frame_rect; + MtkRectangle frame_rect; GList *onscreen_region; int horiz_amount, vert_amount; @@ -5770,7 +5770,7 @@ gboolean meta_window_titlebar_is_onscreen (MetaWindow *window) { MetaWorkspaceManager *workspace_manager = window->display->workspace_manager; - MetaRectangle titlebar_rect, frame_rect; + MtkRectangle titlebar_rect, frame_rect; GList *onscreen_region; gboolean is_onscreen; @@ -5797,8 +5797,8 @@ meta_window_titlebar_is_onscreen (MetaWindow *window) onscreen_region = workspace_manager->active_workspace->screen_region; while (onscreen_region) { - MetaRectangle *spanning_rect = onscreen_region->data; - MetaRectangle overlap; + MtkRectangle *spanning_rect = onscreen_region->data; + MtkRectangle overlap; mtk_rectangle_intersect (&titlebar_rect, spanning_rect, &overlap); if (overlap.height > MIN (titlebar_rect.height, min_height_needed) && @@ -5818,7 +5818,7 @@ meta_window_titlebar_is_onscreen (MetaWindow *window) void meta_window_get_work_area_for_logical_monitor (MetaWindow *window, MetaLogicalMonitor *logical_monitor, - MetaRectangle *area) + MtkRectangle *area) { GList *tmp; @@ -5830,7 +5830,7 @@ meta_window_get_work_area_for_logical_monitor (MetaWindow *window, tmp = meta_window_get_workspaces (window); while (tmp != NULL) { - MetaRectangle workspace_work_area; + MtkRectangle workspace_work_area; meta_workspace_get_work_area_for_logical_monitor (tmp->data, logical_monitor, &workspace_work_area); @@ -5854,8 +5854,8 @@ meta_window_get_work_area_for_logical_monitor (MetaWindow *window, * Get the work area for the monitor @window is currently on. */ void -meta_window_get_work_area_current_monitor (MetaWindow *window, - MetaRectangle *area) +meta_window_get_work_area_current_monitor (MetaWindow *window, + MtkRectangle *area) { meta_window_get_work_area_for_monitor (window, window->monitor->number, @@ -5872,9 +5872,9 @@ meta_window_get_work_area_current_monitor (MetaWindow *window, * @which_monitor. */ void -meta_window_get_work_area_for_monitor (MetaWindow *window, - int which_monitor, - MetaRectangle *area) +meta_window_get_work_area_for_monitor (MetaWindow *window, + int which_monitor, + MtkRectangle *area) { MetaBackend *backend = backend_from_window (window); MetaMonitorManager *monitor_manager = meta_backend_get_monitor_manager (backend); @@ -5897,11 +5897,11 @@ meta_window_get_work_area_for_monitor (MetaWindow *window, * Get the work area for all monitors for @window. */ void -meta_window_get_work_area_all_monitors (MetaWindow *window, - MetaRectangle *area) +meta_window_get_work_area_all_monitors (MetaWindow *window, + MtkRectangle *area) { GList *tmp; - MetaRectangle display_rect = { 0 }; + MtkRectangle display_rect = { 0 }; meta_display_get_size (window->display, &display_rect.width, @@ -5913,7 +5913,7 @@ meta_window_get_work_area_all_monitors (MetaWindow *window, tmp = meta_window_get_workspaces (window); while (tmp != NULL) { - MetaRectangle workspace_work_area; + MtkRectangle workspace_work_area; meta_workspace_get_work_area_all_monitors (tmp->data, &workspace_work_area); mtk_rectangle_intersect (area, @@ -5942,11 +5942,11 @@ meta_window_get_current_tile_monitor_number (MetaWindow *window) } void -meta_window_get_tile_area (MetaWindow *window, - MetaTileMode tile_mode, - MetaRectangle *tile_area) +meta_window_get_tile_area (MetaWindow *window, + MetaTileMode tile_mode, + MtkRectangle *tile_area) { - MetaRectangle work_area; + MtkRectangle work_area; int tile_monitor_number; double fraction; @@ -6345,7 +6345,7 @@ void meta_window_set_demands_attention (MetaWindow *window) { MetaWorkspaceManager *workspace_manager = window->display->workspace_manager; - MetaRectangle candidate_rect, other_rect; + MtkRectangle candidate_rect, other_rect; GList *stack = window->display->stack->sorted; MetaWindow *other_window; gboolean obscured = FALSE; @@ -7166,7 +7166,7 @@ meta_window_find_tile_match (MetaWindow *window, if (match) { MetaWindow *above, *bottommost, *topmost; - MetaRectangle above_rect, bottommost_rect, topmost_rect; + MtkRectangle above_rect, bottommost_rect, topmost_rect; MetaWindowDrag *window_drag; if (meta_stack_windows_cmp (window->display->stack, match, window) > 0) @@ -7704,7 +7704,7 @@ meta_window_handle_ungrabbed_event (MetaWindow *window, { gboolean north, south; gboolean west, east; - MetaRectangle frame_rect; + MtkRectangle frame_rect; MetaGrabOp op = META_GRAB_OP_WINDOW_BASE; meta_window_get_frame_rect (window, &frame_rect); @@ -7987,7 +7987,7 @@ meta_window_calculate_bounds (MetaWindow *window, main_monitor = meta_window_get_main_logical_monitor (window); if (main_monitor) { - MetaRectangle work_area; + MtkRectangle work_area; meta_window_get_work_area_for_logical_monitor (window, main_monitor, diff --git a/src/core/workspace-private.h b/src/core/workspace-private.h index 49faf19a0..43767c310 100644 --- a/src/core/workspace-private.h +++ b/src/core/workspace-private.h @@ -56,7 +56,7 @@ struct _MetaWorkspace GHashTable *logical_monitor_data; - MetaRectangle work_area_screen; + MtkRectangle work_area_screen; GList *screen_region; GList *screen_edges; GList *monitor_edges; @@ -83,7 +83,7 @@ void meta_workspace_relocate_windows (MetaWorkspace *workspace, void meta_workspace_get_work_area_for_logical_monitor (MetaWorkspace *workspace, MetaLogicalMonitor *logical_monitor, - MetaRectangle *area); + MtkRectangle *area); void meta_workspace_invalidate_work_area (MetaWorkspace *workspace); diff --git a/src/core/workspace.c b/src/core/workspace.c index a89946a7f..bdcc2c560 100644 --- a/src/core/workspace.c +++ b/src/core/workspace.c @@ -84,7 +84,7 @@ static guint signals[LAST_SIGNAL] = { 0 }; typedef struct _MetaWorkspaceLogicalMonitorData { GList *logical_monitor_region; - MetaRectangle logical_monitor_work_area; + MtkRectangle logical_monitor_work_area; } MetaWorkspaceLogicalMonitorData; typedef struct _MetaWorkspaceFocusableAncestorData @@ -838,8 +838,8 @@ ensure_work_areas_validated (MetaWorkspace *workspace) GList *windows; GList *tmp; GList *logical_monitors, *l; - MetaRectangle display_rect = { 0 }; - MetaRectangle work_area; + MtkRectangle display_rect = { 0 }; + MtkRectangle work_area; if (!workspace->work_areas_invalid) return; @@ -994,8 +994,8 @@ ensure_work_areas_validated (MetaWorkspace *workspace) */ if (workspace->screen_region == NULL) { - MetaRectangle *nonempty_region; - nonempty_region = g_new (MetaRectangle, 1); + MtkRectangle *nonempty_region; + nonempty_region = g_new (MtkRectangle, 1); *nonempty_region = workspace->work_area_screen; workspace->screen_region = g_list_prepend (NULL, nonempty_region); } @@ -1057,7 +1057,7 @@ meta_workspace_set_builtin_struts (MetaWorkspace *workspace, MetaMonitorManager *monitor_manager = meta_backend_get_monitor_manager (backend); MetaDisplay *display = workspace->display; - MetaRectangle display_rect = { 0 }; + MtkRectangle display_rect = { 0 }; GSList *l; meta_display_get_size (display, &display_rect.width, &display_rect.height); @@ -1125,7 +1125,7 @@ meta_workspace_set_builtin_struts (MetaWorkspace *workspace, void meta_workspace_get_work_area_for_logical_monitor (MetaWorkspace *workspace, MetaLogicalMonitor *logical_monitor, - MetaRectangle *area) + MtkRectangle *area) { meta_workspace_get_work_area_for_monitor (workspace, logical_monitor->number, @@ -1144,7 +1144,7 @@ meta_workspace_get_work_area_for_logical_monitor (MetaWorkspace *workspace, void meta_workspace_get_work_area_for_monitor (MetaWorkspace *workspace, int which_monitor, - MetaRectangle *area) + MtkRectangle *area) { MetaContext *context = meta_display_get_context (workspace->display); MetaBackend *backend = meta_context_get_backend (context); @@ -1175,7 +1175,7 @@ meta_workspace_get_work_area_for_monitor (MetaWorkspace *workspace, */ void meta_workspace_get_work_area_all_monitors (MetaWorkspace *workspace, - MetaRectangle *area) + MtkRectangle *area) { ensure_work_areas_validated (workspace); @@ -1426,7 +1426,7 @@ window_contains_point (MetaWindow *window, int root_x, int root_y) { - MetaRectangle rect; + MtkRectangle rect; meta_window_get_frame_rect (window, &rect); diff --git a/src/meta/boxes.h b/src/meta/boxes.h index 0990227f7..8446f5c25 100644 --- a/src/meta/boxes.h +++ b/src/meta/boxes.h @@ -24,44 +24,15 @@ #include #include -#define META_TYPE_RECTANGLE (meta_rectangle_get_type ()) - -/** - * MetaRectangle: - * @x: X coordinate of the top-left corner - * @y: Y coordinate of the top-left corner - * @width: Width of the rectangle - * @height: Height of the rectangle - */ -#ifdef __GI_SCANNER__ -/* The introspection scanner is currently unable to lookup how - * cairo_rectangle_int_t is actually defined. This prevents - * introspection data for the GdkRectangle type to include fields - * descriptions. To workaround this issue, we define it with the same - * content as cairo_rectangle_int_t, but only under the introspection - * define. - */ -struct _MetaRectangle -{ - int x; - int y; - int width; - int height; -}; -typedef struct _MetaRectangle MetaRectangle; -#else -typedef cairo_rectangle_int_t MetaRectangle; -#endif - /** * MetaStrut: - * @rect: #MetaRectangle the #MetaStrut is on + * @rect: #MtkRectangle the #MetaStrut is on * @side: #MetaSide the #MetaStrut is on */ typedef struct _MetaStrut MetaStrut; struct _MetaStrut { - MetaRectangle rect; + MtkRectangle rect; MetaSide side; }; @@ -80,23 +51,14 @@ typedef enum /** * MetaEdge: - * @rect: #MetaRectangle with the bounds of the edge + * @rect: #MtkRectangle with the bounds of the edge * @side_type: Side * @edge_type: To what belongs the edge */ typedef struct _MetaEdge MetaEdge; struct _MetaEdge { - MetaRectangle rect; /* width or height should be 1 */ + MtkRectangle rect; /* width or height should be 1 */ MetaSide side_type; MetaEdgeType edge_type; }; - -META_EXPORT -GType meta_rectangle_get_type (void); - -META_EXPORT -MetaRectangle *meta_rectangle_copy (const MetaRectangle *rect); - -META_EXPORT -void meta_rectangle_free (MetaRectangle *rect); diff --git a/src/meta/display.h b/src/meta/display.h index 0c19f7d77..12542782d 100644 --- a/src/meta/display.h +++ b/src/meta/display.h @@ -244,9 +244,9 @@ META_EXPORT int meta_display_get_current_monitor (MetaDisplay *display); META_EXPORT -void meta_display_get_monitor_geometry (MetaDisplay *display, - int monitor, - MetaRectangle *geometry); +void meta_display_get_monitor_geometry (MetaDisplay *display, + int monitor, + MtkRectangle *geometry); META_EXPORT float meta_display_get_monitor_scale (MetaDisplay *display, @@ -257,8 +257,8 @@ gboolean meta_display_get_monitor_in_fullscreen (MetaDisplay *display, int monitor); META_EXPORT -int meta_display_get_monitor_index_for_rect (MetaDisplay *display, - MetaRectangle *rect); +int meta_display_get_monitor_index_for_rect (MetaDisplay *display, + MtkRectangle *rect); META_EXPORT int meta_display_get_monitor_neighbor_index (MetaDisplay *display, diff --git a/src/meta/meta-plugin.h b/src/meta/meta-plugin.h index 24abbd3e7..f522673b9 100644 --- a/src/meta/meta-plugin.h +++ b/src/meta/meta-plugin.h @@ -95,8 +95,8 @@ struct _MetaPluginClass void (*size_change) (MetaPlugin *plugin, MetaWindowActor *actor, MetaSizeChange which_change, - MetaRectangle *old_frame_rect, - MetaRectangle *old_buffer_rect); + MtkRectangle *old_frame_rect, + MtkRectangle *old_buffer_rect); /** * MetaPluginClass::map: @@ -131,7 +131,7 @@ struct _MetaPluginClass void (*show_tile_preview) (MetaPlugin *plugin, MetaWindow *window, - MetaRectangle *tile_rect, + MtkRectangle *tile_rect, int tile_monitor_number); void (*hide_tile_preview) (MetaPlugin *plugin); @@ -142,9 +142,9 @@ struct _MetaPluginClass int y); void (*show_window_menu_for_rect) (MetaPlugin *plugin, - MetaWindow *window, - MetaWindowMenuType menu, - MetaRectangle *rect); + MetaWindow *window, + MetaWindowMenuType menu, + MtkRectangle *rect); /** * MetaPluginClass::kill_window_effects: diff --git a/src/meta/meta-shadow-factory.h b/src/meta/meta-shadow-factory.h index 74946ddb0..722b001ab 100644 --- a/src/meta/meta-shadow-factory.h +++ b/src/meta/meta-shadow-factory.h @@ -116,12 +116,12 @@ void meta_shadow_paint (MetaShadow *shadow, gboolean clip_strictly); META_EXPORT -void meta_shadow_get_bounds (MetaShadow *shadow, - int window_x, - int window_y, - int window_width, - int window_height, - MtkRectangle *bounds); +void meta_shadow_get_bounds (MetaShadow *shadow, + int window_x, + int window_y, + int window_width, + int window_height, + MtkRectangle *bounds); META_EXPORT MetaShadowFactory *meta_shadow_factory_new (void); diff --git a/src/meta/meta-shaped-texture.h b/src/meta/meta-shaped-texture.h index f804454eb..9957394b0 100644 --- a/src/meta/meta-shaped-texture.h +++ b/src/meta/meta-shaped-texture.h @@ -52,7 +52,7 @@ void meta_shaped_texture_set_mask_texture (MetaShapedTexture *stex, CoglTexture *mask_texture); META_EXPORT -cairo_surface_t * meta_shaped_texture_get_image (MetaShapedTexture *stex, - MtkRectangle *clip); +cairo_surface_t * meta_shaped_texture_get_image (MetaShapedTexture *stex, + MtkRectangle *clip); G_END_DECLS diff --git a/src/meta/meta-window-actor.h b/src/meta/meta-window-actor.h index c03f664dd..5f129cd73 100644 --- a/src/meta/meta-window-actor.h +++ b/src/meta/meta-window-actor.h @@ -47,12 +47,12 @@ META_EXPORT gboolean meta_window_actor_is_destroyed (MetaWindowActor *self); META_EXPORT -cairo_surface_t * meta_window_actor_get_image (MetaWindowActor *self, - MtkRectangle *clip); +cairo_surface_t * meta_window_actor_get_image (MetaWindowActor *self, + MtkRectangle *clip); META_EXPORT ClutterContent * meta_window_actor_paint_to_content (MetaWindowActor *self, - MetaRectangle *clip, + MtkRectangle *clip, GError **error); META_EXPORT diff --git a/src/meta/window.h b/src/meta/window.h index b57634ae5..42fedfadd 100644 --- a/src/meta/window.h +++ b/src/meta/window.h @@ -121,20 +121,22 @@ META_EXPORT gboolean meta_window_is_skip_taskbar (MetaWindow *window); META_EXPORT -void meta_window_get_buffer_rect (const MetaWindow *window, MetaRectangle *rect); +void meta_window_get_buffer_rect (const MetaWindow *window, + MtkRectangle *rect); META_EXPORT -void meta_window_get_frame_rect (const MetaWindow *window, MetaRectangle *rect); +void meta_window_get_frame_rect (const MetaWindow *window, + MtkRectangle *rect); META_EXPORT -void meta_window_client_rect_to_frame_rect (MetaWindow *window, - MetaRectangle *client_rect, - MetaRectangle *frame_rect); +void meta_window_client_rect_to_frame_rect (MetaWindow *window, + MtkRectangle *client_rect, + MtkRectangle *frame_rect); META_EXPORT -void meta_window_frame_rect_to_client_rect (MetaWindow *window, - MetaRectangle *frame_rect, - MetaRectangle *client_rect); +void meta_window_frame_rect_to_client_rect (MetaWindow *window, + MtkRectangle *frame_rect, + MtkRectangle *client_rect); META_EXPORT MetaDisplay *meta_window_get_display (MetaWindow *window); @@ -280,12 +282,12 @@ META_EXPORT gboolean meta_window_is_on_primary_monitor (MetaWindow *window); META_EXPORT -gboolean meta_window_get_icon_geometry (MetaWindow *window, - MetaRectangle *rect); +gboolean meta_window_get_icon_geometry (MetaWindow *window, + MtkRectangle *rect); META_EXPORT -void meta_window_set_icon_geometry (MetaWindow *window, - MetaRectangle *rect); +void meta_window_set_icon_geometry (MetaWindow *window, + MtkRectangle *rect); META_EXPORT void meta_window_maximize (MetaWindow *window, @@ -387,17 +389,17 @@ void meta_window_check_alive (MetaWindow *window, guint32 timestamp); META_EXPORT -void meta_window_get_work_area_current_monitor (MetaWindow *window, - MetaRectangle *area); +void meta_window_get_work_area_current_monitor (MetaWindow *window, + MtkRectangle *area); META_EXPORT -void meta_window_get_work_area_for_monitor (MetaWindow *window, - int which_monitor, - MetaRectangle *area); +void meta_window_get_work_area_for_monitor (MetaWindow *window, + int which_monitor, + MtkRectangle *area); META_EXPORT -void meta_window_get_work_area_all_monitors (MetaWindow *window, - MetaRectangle *area); +void meta_window_get_work_area_all_monitors (MetaWindow *window, + MtkRectangle *area); META_EXPORT gboolean meta_window_begin_grab_op (MetaWindow *window, diff --git a/src/meta/workspace.h b/src/meta/workspace.h index 96ebeb6c9..d9b7365a7 100644 --- a/src/meta/workspace.h +++ b/src/meta/workspace.h @@ -47,11 +47,11 @@ GList* meta_workspace_list_windows (MetaWorkspace *workspace); META_EXPORT void meta_workspace_get_work_area_for_monitor (MetaWorkspace *workspace, int which_monitor, - MetaRectangle *area); + MtkRectangle *area); META_EXPORT void meta_workspace_get_work_area_all_monitors (MetaWorkspace *workspace, - MetaRectangle *area); + MtkRectangle *area); META_EXPORT void meta_workspace_activate (MetaWorkspace *workspace, guint32 timestamp); diff --git a/src/tests/boxes-tests.c b/src/tests/boxes-tests.c index 82f94b2a1..b2904a286 100644 --- a/src/tests/boxes-tests.c +++ b/src/tests/boxes-tests.c @@ -41,7 +41,7 @@ init_random_ness (void) } static void -get_random_rect (MetaRectangle *rect) +get_random_rect (MtkRectangle *rect) { rect->x = rand () % 1600; rect->y = rand () % 1200; @@ -93,7 +93,7 @@ new_monitor_edge (int x, int y, int width, int height, int side_type) static void test_init_rect (void) { - MetaRectangle rect; + MtkRectangle rect; rect = MTK_RECTANGLE_INIT (1, 2, 3, 4); g_assert_cmpint (rect.x, ==, 1); @@ -105,7 +105,7 @@ test_init_rect (void) static void test_area (void) { - MetaRectangle temp; + MtkRectangle temp; int i; for (i = 0; i < NUM_RANDOM_RUNS; i++) { @@ -120,13 +120,13 @@ test_area (void) static void test_intersect (void) { - MetaRectangle a = {100, 200, 50, 40}; - MetaRectangle b = { 0, 50, 110, 152}; - MetaRectangle c = { 0, 0, 10, 10}; - MetaRectangle d = {100, 100, 50, 50}; - MetaRectangle b_intersect_d = {100, 100, 10, 50}; - MetaRectangle temp; - MetaRectangle temp2; + MtkRectangle a = {100, 200, 50, 40}; + MtkRectangle b = { 0, 50, 110, 152}; + MtkRectangle c = { 0, 0, 10, 10}; + MtkRectangle d = {100, 100, 50, 50}; + MtkRectangle b_intersect_d = {100, 100, 10, 50}; + MtkRectangle temp; + MtkRectangle temp2; mtk_rectangle_intersect (&a, &b, &temp); temp2 = MTK_RECTANGLE_INIT (100, 200, 10, 2); @@ -146,12 +146,12 @@ test_intersect (void) static void test_equal (void) { - MetaRectangle a = {10, 12, 4, 18}; - MetaRectangle b = a; - MetaRectangle c = {10, 12, 4, 19}; - MetaRectangle d = {10, 12, 7, 18}; - MetaRectangle e = {10, 62, 4, 18}; - MetaRectangle f = {27, 12, 4, 18}; + MtkRectangle a = {10, 12, 4, 18}; + MtkRectangle b = a; + MtkRectangle c = {10, 12, 4, 19}; + MtkRectangle d = {10, 12, 7, 18}; + MtkRectangle e = {10, 62, 4, 18}; + MtkRectangle f = {27, 12, 4, 18}; g_assert ( mtk_rectangle_equal (&a, &b)); g_assert (!mtk_rectangle_equal (&a, &c)); @@ -163,7 +163,7 @@ test_equal (void) static void test_overlap_funcs (void) { - MetaRectangle temp1, temp2; + MtkRectangle temp1, temp2; int i; for (i = 0; i < NUM_RANDOM_RUNS; i++) { @@ -184,7 +184,7 @@ test_overlap_funcs (void) static void test_basic_fitting (void) { - MetaRectangle temp1, temp2, temp3; + MtkRectangle temp1, temp2, temp3; int i; /* Four cases: * case temp1 fits temp2 temp1 could fit temp2 @@ -274,7 +274,7 @@ get_screen_region (int which) { GList *ret; GSList *struts; - MetaRectangle basic_rect; + MtkRectangle basic_rect; basic_rect = MTK_RECTANGLE_INIT (0, 0, 1600, 1200); ret = NULL; @@ -291,7 +291,7 @@ get_screen_edges (int which) { GList *ret; GSList *struts; - MetaRectangle basic_rect; + MtkRectangle basic_rect; basic_rect = MTK_RECTANGLE_INIT (0, 0, 1600, 1200); ret = NULL; @@ -382,14 +382,14 @@ test_merge_regions (void) while (compare && compare->next) { - MetaRectangle *a = compare->data; + MtkRectangle *a = compare->data; GList *other = compare->next; g_assert (a->width > 0 && a->height > 0); while (other) { - MetaRectangle *b = other->data; + MtkRectangle *b = other->data; GList *delete_me = NULL; g_assert (b->width > 0 && b->height > 0); @@ -469,7 +469,7 @@ test_merge_regions (void) if (delete_me != NULL) { #ifdef PRINT_DEBUG - MetaRectangle *bla = delete_me->data; + MtkRectangle *bla = delete_me->data; printf (" Deleting rect %s\n", meta_rectangle_to_string (bla, rect1)); #endif @@ -525,8 +525,8 @@ verify_lists_are_equal (GList *code, GList *answer) while (code && answer) { - MetaRectangle *a = code->data; - MetaRectangle *b = answer->data; + MtkRectangle *a = code->data; + MtkRectangle *b = answer->data; if (a->x != b->x || a->y != b->y || @@ -549,7 +549,7 @@ verify_lists_are_equal (GList *code, GList *answer) /* Ought to be at the end of both lists; check if we aren't */ if (code) { - MetaRectangle *tmp = code->data; + MtkRectangle *tmp = code->data; g_error ("code list longer than answer list by %d items; " "first extra item: %d,%d +%d,%d\n", g_list_length (code), @@ -558,7 +558,7 @@ verify_lists_are_equal (GList *code, GList *answer) if (answer) { - MetaRectangle *tmp = answer->data; + MtkRectangle *tmp = answer->data; g_error ("answer list longer than code list by %d items; " "first extra item: %d,%d +%d,%d\n", g_list_length (answer), @@ -656,7 +656,7 @@ static void test_region_fitting (void) { GList *region; - MetaRectangle rect; + MtkRectangle rect; /* See test_basic_fitting() for how/why these automated random tests work */ int i; @@ -698,8 +698,8 @@ static void test_clamping_to_region (void) { GList *region; - MetaRectangle rect; - MetaRectangle min_size; + MtkRectangle rect; + MtkRectangle min_size; FixedDirections fixed_directions; int i; @@ -709,7 +709,7 @@ test_clamping_to_region (void) region = get_screen_region (3); for (i = 0; i < NUM_RANDOM_RUNS; i++) { - MetaRectangle temp; + MtkRectangle temp; get_random_rect (&rect); temp = rect; meta_rectangle_clamp_to_fit_into_region (region, @@ -796,7 +796,7 @@ test_clamping_to_region (void) static gboolean rect_overlaps_region (const GList *spanning_rects, - const MetaRectangle *rect) + const MtkRectangle *rect) { /* FIXME: Should I move this to boxes.[ch]? */ const GList *temp; @@ -819,7 +819,7 @@ static void test_clipping_to_region (void) { GList *region; - MetaRectangle rect, temp; + MtkRectangle rect, temp; FixedDirections fixed_directions = 0; int i; @@ -879,7 +879,7 @@ static void test_shoving_into_region (void) { GList *region; - MetaRectangle rect, temp; + MtkRectangle rect, temp; FixedDirections fixed_directions = 0; int i; @@ -1211,7 +1211,7 @@ test_find_nonintersected_monitor_edges (void) static void test_gravity_resize (void) { - MetaRectangle oldrect, rect, temp; + MtkRectangle oldrect, rect, temp; rect.x = -500; /* Some random amount not equal to oldrect.x to ensure that * the resize is done with respect to oldrect instead of rect diff --git a/src/tests/meta-kms-test-utils.c b/src/tests/meta-kms-test-utils.c index f304072cd..2077e96fe 100644 --- a/src/tests/meta-kms-test-utils.c +++ b/src/tests/meta-kms-test-utils.c @@ -121,7 +121,7 @@ meta_get_mode_fixed_rect_16 (MetaKmsMode *mode) meta_kms_mode_get_height (mode)); } -MetaRectangle +MtkRectangle meta_get_mode_rect (MetaKmsMode *mode) { return MTK_RECTANGLE_INIT (0, 0, diff --git a/src/tests/meta-kms-test-utils.h b/src/tests/meta-kms-test-utils.h index 85ef242dd..d77063aa2 100644 --- a/src/tests/meta-kms-test-utils.h +++ b/src/tests/meta-kms-test-utils.h @@ -38,4 +38,4 @@ MetaDrmBuffer * meta_create_test_mode_dumb_buffer (MetaKmsDevice *device, MetaFixed16Rectangle meta_get_mode_fixed_rect_16 (MetaKmsMode *mode); -MetaRectangle meta_get_mode_rect (MetaKmsMode *mode); +MtkRectangle meta_get_mode_rect (MetaKmsMode *mode); diff --git a/src/tests/meta-monitor-test-utils.c b/src/tests/meta-monitor-test-utils.c index 70a29fd38..1555a5f87 100644 --- a/src/tests/meta-monitor-test-utils.c +++ b/src/tests/meta-monitor-test-utils.c @@ -208,7 +208,7 @@ check_current_monitor_mode (MetaMonitor *monitor, static MetaLogicalMonitor * logical_monitor_from_layout (MetaMonitorManager *monitor_manager, - MetaRectangle *layout) + MtkRectangle *layout) { GList *l; diff --git a/src/tests/meta-monitor-test-utils.h b/src/tests/meta-monitor-test-utils.h index 1039f99d5..6d2c00189 100644 --- a/src/tests/meta-monitor-test-utils.h +++ b/src/tests/meta-monitor-test-utils.h @@ -165,7 +165,7 @@ typedef struct _MonitorTestCaseMonitor typedef struct _MonitorTestCaseLogicalMonitor { - MetaRectangle layout; + MtkRectangle layout; float scale; int monitors[MAX_N_MONITORS]; int n_monitors; diff --git a/src/tests/meta-ref-test.c b/src/tests/meta-ref-test.c index 53e086f78..ef2ae321e 100644 --- a/src/tests/meta-ref-test.c +++ b/src/tests/meta-ref-test.c @@ -221,7 +221,7 @@ assert_software_rendered (ClutterStageView *stage_view) static void capture_view_into (ClutterStageView *view, - MetaRectangle *rect, + MtkRectangle *rect, uint8_t *buffer, int stride) { @@ -277,7 +277,7 @@ on_after_paint (MetaStage *stage, gpointer user_data) { CaptureViewData *data = user_data; - MetaRectangle rect; + MtkRectangle rect; float view_scale; int texture_width, texture_height; cairo_surface_t *image; diff --git a/src/tests/meta-test-shell.c b/src/tests/meta-test-shell.c index 5d692dccd..a58a70bca 100644 --- a/src/tests/meta-test-shell.c +++ b/src/tests/meta-test-shell.c @@ -92,7 +92,7 @@ typedef struct _DisplayTilePreview { ClutterActor *actor; - MetaRectangle tile_rect; + MtkRectangle tile_rect; } DisplayTilePreview; G_DEFINE_TYPE (MetaTestShell, meta_test_shell, META_TYPE_PLUGIN) @@ -262,7 +262,7 @@ on_monitors_changed (MetaMonitorManager *monitor_manager, { MetaBackgroundContent *background_content; ClutterContent *content; - MetaRectangle rect; + MtkRectangle rect; ClutterActor *background_actor; MetaBackground *background; uint8_t red; @@ -720,7 +720,7 @@ get_display_tile_preview (MetaDisplay *display) static void meta_test_shell_show_tile_preview (MetaPlugin *plugin, MetaWindow *window, - MetaRectangle *tile_rect, + MtkRectangle *tile_rect, int tile_monitor_number) { MetaDisplay *display = meta_plugin_get_display (plugin); diff --git a/src/tests/monitor-store-unit-tests.c b/src/tests/monitor-store-unit-tests.c index 99e88d307..d6ed7665c 100644 --- a/src/tests/monitor-store-unit-tests.c +++ b/src/tests/monitor-store-unit-tests.c @@ -53,7 +53,7 @@ typedef struct _MonitorStoreTestCaseMonitor typedef struct _MonitorStoreTestCaseLogicalMonitor { - MetaRectangle layout; + MtkRectangle layout; float scale; MetaMonitorTransform transform; gboolean is_primary; diff --git a/src/tests/monitor-unit-tests.c b/src/tests/monitor-unit-tests.c index 99355f6fe..a95767283 100644 --- a/src/tests/monitor-unit-tests.c +++ b/src/tests/monitor-unit-tests.c @@ -7968,7 +7968,7 @@ meta_test_monitor_custom_lid_switch_config (void) test_case.expect.crtcs[1].x = 1024; test_case.expect.crtcs[1].transform = META_MONITOR_TRANSFORM_270; test_case.expect.logical_monitors[0].layout = - (MetaRectangle) { .width = 1024, .height = 768 }; + (MtkRectangle) { .width = 1024, .height = 768 }; test_case.expect.logical_monitors[0].transform = META_MONITOR_TRANSFORM_NORMAL; test_case.expect.logical_monitors[1].transform = META_MONITOR_TRANSFORM_270; test_case.expect.n_logical_monitors = 2; @@ -7990,7 +7990,7 @@ meta_test_monitor_custom_lid_switch_config (void) test_case.expect.crtcs[1].x = 0; test_case.expect.monitors[0].current_mode = -1; test_case.expect.logical_monitors[0].layout = - (MetaRectangle) { .width = 768, .height = 1024 }; + (MtkRectangle) { .width = 768, .height = 1024 }; test_case.expect.logical_monitors[0].monitors[0] = 1; test_case.expect.logical_monitors[0].transform = META_MONITOR_TRANSFORM_90; test_case.expect.n_logical_monitors = 1; @@ -8015,7 +8015,7 @@ meta_test_monitor_custom_lid_switch_config (void) test_case.expect.crtcs[1].x = 1024; test_case.expect.monitors[0].current_mode = 0; test_case.expect.logical_monitors[0].layout = - (MetaRectangle) { .width = 1024, .height = 768 }; + (MtkRectangle) { .width = 1024, .height = 768 }; test_case.expect.logical_monitors[0].monitors[0] = 0; test_case.expect.logical_monitors[0].transform = META_MONITOR_TRANSFORM_NORMAL; test_case.expect.logical_monitors[1].transform = META_MONITOR_TRANSFORM_270; diff --git a/src/tests/native-kms-device.c b/src/tests/native-kms-device.c index 640c1917d..d47e0cb3b 100644 --- a/src/tests/native-kms-device.c +++ b/src/tests/native-kms-device.c @@ -264,7 +264,7 @@ meta_test_kms_device_mode_set (void) g_autoptr (MetaDrmBuffer) primary_buffer = NULL; MetaKmsCrtcState crtc_state; MetaKmsConnectorState connector_state; - MetaRectangle mode_rect; + MtkRectangle mode_rect; MetaKmsFeedback *feedback; device = meta_get_test_kms_device (test_context); diff --git a/src/tests/native-kms-headless-start.c b/src/tests/native-kms-headless-start.c index b934457b2..194839b6c 100644 --- a/src/tests/native-kms-headless-start.c +++ b/src/tests/native-kms-headless-start.c @@ -64,7 +64,7 @@ meta_test_headless_monitor_getters (void) display = meta_context_get_display (test_context); index = meta_display_get_monitor_index_for_rect (display, - &(MetaRectangle) { 0 }); + &(MtkRectangle) { 0 }); g_assert_cmpint (index, ==, -1); } @@ -78,7 +78,7 @@ meta_test_headless_monitor_connect (void) g_autolist (GObject) udev_devices = NULL; GList *logical_monitors; MetaLogicalMonitor *logical_monitor; - MetaRectangle monitor_layout; + MtkRectangle monitor_layout; ClutterActor *stage; g_autoptr (GError) error = NULL; diff --git a/src/tests/native-kms-hotplug.c b/src/tests/native-kms-hotplug.c index 8fec8d48e..be1eee3da 100644 --- a/src/tests/native-kms-hotplug.c +++ b/src/tests/native-kms-hotplug.c @@ -245,7 +245,7 @@ meta_test_switch_config (void) g_autoptr (ClutterVirtualInputDevice) virtual_keyboard = NULL; g_autoptr (MetaVirtualMonitor) virtual_monitor = NULL; GList *logical_monitors; - MetaRectangle logical_monitor_layout; + MtkRectangle logical_monitor_layout; gulong after_paint_handler_id; gulong presented_handler_id; gboolean monitors_changed; diff --git a/src/tests/native-kms-render.c b/src/tests/native-kms-render.c index c487d9b4a..31e74a9a4 100644 --- a/src/tests/native-kms-render.c +++ b/src/tests/native-kms-render.c @@ -229,8 +229,8 @@ meta_test_kms_render_client_scanout (void) gulong paint_view_handler_id; gulong presented_handler_id; MetaWindow *window; - MetaRectangle view_rect; - MetaRectangle buffer_rect; + MtkRectangle view_rect; + MtkRectangle buffer_rect; test_driver = meta_wayland_test_driver_new (wayland_compositor); meta_wayland_test_driver_set_property (test_driver, diff --git a/src/tests/native-persistent-virtual-monitor.c b/src/tests/native-persistent-virtual-monitor.c index 5a5844ab9..793b29140 100644 --- a/src/tests/native-persistent-virtual-monitor.c +++ b/src/tests/native-persistent-virtual-monitor.c @@ -39,7 +39,7 @@ wait_for_paint (gpointer user_data) GList *monitors; GList *logical_monitors; MetaLogicalMonitor *logical_monitor; - MetaRectangle layout; + MtkRectangle layout; loop = g_main_loop_new (NULL, FALSE); g_signal_connect_swapped (stage, "presented", diff --git a/src/tests/test-runner.c b/src/tests/test-runner.c index 5aeeaeaf6..19df1d8f3 100644 --- a/src/tests/test-runner.c +++ b/src/tests/test-runner.c @@ -350,7 +350,7 @@ test_case_assert_size (TestCase *test, int expected_height, GError **error) { - MetaRectangle frame_rect; + MtkRectangle frame_rect; meta_window_get_frame_rect (window, &frame_rect); @@ -449,7 +449,7 @@ parse_window_size (MetaWindow *window, const char *size_str) { MetaLogicalMonitor *logical_monitor; - MetaRectangle logical_monitor_layout; + MtkRectangle logical_monitor_layout; int value; logical_monitor = meta_window_find_monitor_from_frame_rect (window); @@ -889,7 +889,7 @@ test_case_do (TestCase *test, MetaDisplay *display = meta_context_get_display (test->context); MetaWorkspaceManager *workspace_manager = meta_display_get_workspace_manager (display); - MetaRectangle rect = { x, y, width, height }; + MtkRectangle rect = { x, y, width, height }; MetaStrut strut = { rect, side }; GSList *struts = g_slist_append (NULL, &strut); GList *workspaces = @@ -999,7 +999,7 @@ test_case_do (TestCase *test, if (!window) return FALSE; - MetaRectangle frame_rect; + MtkRectangle frame_rect; meta_window_get_frame_rect (window, &frame_rect); int x = atoi (argv[2]); int y = atoi (argv[3]); diff --git a/src/tests/unit-tests.c b/src/tests/unit-tests.c index ff0516fe6..f565d8687 100644 --- a/src/tests/unit-tests.c +++ b/src/tests/unit-tests.c @@ -202,8 +202,8 @@ meta_test_util_later_schedule_from_later (void) static void meta_test_adjacent_to (void) { - MetaRectangle base = { .x = 10, .y = 10, .width = 10, .height = 10 }; - MetaRectangle adjacent[] = { + MtkRectangle base = { .x = 10, .y = 10, .width = 10, .height = 10 }; + MtkRectangle adjacent[] = { { .x = 20, .y = 10, .width = 10, .height = 10 }, { .x = 0, .y = 10, .width = 10, .height = 10 }, { .x = 0, .y = 1, .width = 10, .height = 10 }, @@ -211,7 +211,7 @@ meta_test_adjacent_to (void) { .x = 10, .y = 20, .width = 10, .height = 10 }, { .x = 10, .y = 0, .width = 10, .height = 10 }, }; - MetaRectangle not_adjacent[] = { + MtkRectangle not_adjacent[] = { { .x = 0, .y = 0, .width = 10, .height = 10 }, { .x = 20, .y = 20, .width = 10, .height = 10 }, { .x = 21, .y = 10, .width = 10, .height = 10 }, diff --git a/src/tests/wayland-fractional-scale-test.c b/src/tests/wayland-fractional-scale-test.c index 77b6d217d..7ae4f5613 100644 --- a/src/tests/wayland-fractional-scale-test.c +++ b/src/tests/wayland-fractional-scale-test.c @@ -65,7 +65,7 @@ fractional_scale (void) MetaMonitorManager *monitor_manager = meta_backend_get_monitor_manager (backend); MetaLogicalMonitor *logical_monitor; - MetaRectangle layout; + MtkRectangle layout; wait_for_sync_point (0); assert_wayland_surface_size (test_window, 1920, 1080); diff --git a/src/tests/wayland-fullscreen-test.c b/src/tests/wayland-fullscreen-test.c index fc94535f2..4fc17f860 100644 --- a/src/tests/wayland-fullscreen-test.c +++ b/src/tests/wayland-fullscreen-test.c @@ -105,7 +105,7 @@ wait_for_window_added (MetaWindow *window) static void toplevel_fullscreen (void) { - MetaRectangle rect; + MtkRectangle rect; wait_for_first_frame (test_window); @@ -121,7 +121,7 @@ static void toplevel_fullscreen_ref_test (void) { MetaWindowWayland *wl_window = META_WINDOW_WAYLAND (test_window); - MetaRectangle rect; + MtkRectangle rect; wait_for_window_added (test_window); assert_wayland_surface_size (test_window, 10, 10); diff --git a/src/tests/wayland-unit-tests.c b/src/tests/wayland-unit-tests.c index ab5b8a54f..606f4aeb6 100644 --- a/src/tests/wayland-unit-tests.c +++ b/src/tests/wayland-unit-tests.c @@ -148,7 +148,7 @@ on_effects_completed_idle (gpointer user_data) MetaBackend *backend = meta_context_get_backend (test_context); ClutterActor *stage = meta_backend_get_stage (backend); MetaWindow *window = meta_window_actor_get_meta_window (actor); - MetaRectangle buffer_rect; + MtkRectangle buffer_rect; /* Move the window to a known position and perform a mouse click, allowing a * popup to be mapped. */ @@ -244,7 +244,7 @@ on_unmap_sync_point (MetaWaylandTestDriver *test_driver, ClutterActor *actor = CLUTTER_ACTOR (meta_wayland_surface_get_actor (surface)); MetaWindowActor *window_actor = meta_window_actor_from_actor (actor); MetaWindow *window = meta_window_actor_get_meta_window (window_actor); - MetaRectangle buffer_rect; + MtkRectangle buffer_rect; /* Click inside the window to allow mapping a popup. */ @@ -424,7 +424,7 @@ wait_until_after_paint (void) } static void -set_struts (MetaRectangle rect, +set_struts (MtkRectangle rect, MetaSide side) { MetaDisplay *display = meta_context_get_display (test_context); @@ -465,7 +465,7 @@ clear_struts (void) } } -static MetaRectangle +static MtkRectangle get_primary_logical_monitor_layout (void) { MetaBackend *backend = meta_context_get_backend (test_context); @@ -483,8 +483,8 @@ toplevel_bounds_struts (void) { MetaWaylandTestClient *wayland_test_client; MetaWindow *window; - MetaRectangle logical_monitor_layout; - MetaRectangle work_area; + MtkRectangle logical_monitor_layout; + MtkRectangle work_area; /* * This test case makes sure that setting and changing struts result in the @@ -492,7 +492,7 @@ toplevel_bounds_struts (void) */ logical_monitor_layout = get_primary_logical_monitor_layout (); - set_struts ((MetaRectangle) { + set_struts ((MtkRectangle) { .x = 0, .y = 0, .width = logical_monitor_layout.width, @@ -566,8 +566,8 @@ toplevel_bounds_monitors (void) ClutterSeat *seat; g_autoptr (MetaVirtualMonitor) second_virtual_monitor = NULL; MetaWaylandTestClient *wayland_test_client; - MetaRectangle logical_monitor_layout; - MetaRectangle work_area; + MtkRectangle logical_monitor_layout; + MtkRectangle work_area; MetaWindow *window; /* @@ -584,7 +584,7 @@ toplevel_bounds_monitors (void) 300, 200, 60.0); logical_monitor_layout = get_primary_logical_monitor_layout (); - set_struts ((MetaRectangle) { + set_struts ((MtkRectangle) { .x = 0, .y = 0, .width = logical_monitor_layout.width, diff --git a/src/wayland/meta-wayland-actor-surface.c b/src/wayland/meta-wayland-actor-surface.c index 8dcaac17b..34fd83ec3 100644 --- a/src/wayland/meta-wayland-actor-surface.c +++ b/src/wayland/meta-wayland-actor-surface.c @@ -334,7 +334,7 @@ meta_wayland_actor_surface_is_on_logical_monitor (MetaWaylandSurfaceRole *surfac MetaBackend *backend = meta_context_get_backend (context); MetaRenderer *renderer = meta_backend_get_renderer (backend); ClutterActor *actor = CLUTTER_ACTOR (priv->actor); - MetaRectangle logical_monitor_layout; + MtkRectangle logical_monitor_layout; GList *l; logical_monitor_layout = meta_logical_monitor_get_layout (logical_monitor); @@ -342,7 +342,7 @@ meta_wayland_actor_surface_is_on_logical_monitor (MetaWaylandSurfaceRole *surfac for (l = meta_renderer_get_views (renderer); l; l = l->next) { ClutterStageView *stage_view = l->data; - MetaRectangle view_layout; + MtkRectangle view_layout; clutter_stage_view_get_layout (stage_view, &view_layout); diff --git a/src/wayland/meta-wayland-outputs.c b/src/wayland/meta-wayland-outputs.c index 9fe12ecd6..f7a56f2f2 100644 --- a/src/wayland/meta-wayland-outputs.c +++ b/src/wayland/meta-wayland-outputs.c @@ -608,7 +608,7 @@ send_xdg_output_events (struct wl_resource *resource, gboolean need_all_events, gboolean *pending_done_event) { - MetaRectangle layout; + MtkRectangle layout; MetaLogicalMonitor *logical_monitor; int version; diff --git a/src/wayland/meta-wayland-shell-surface.c b/src/wayland/meta-wayland-shell-surface.c index 33662ddfb..e341da79f 100644 --- a/src/wayland/meta-wayland-shell-surface.c +++ b/src/wayland/meta-wayland-shell-surface.c @@ -44,16 +44,16 @@ G_DEFINE_ABSTRACT_TYPE_WITH_PRIVATE (MetaWaylandShellSurface, void meta_wayland_shell_surface_calculate_geometry (MetaWaylandShellSurface *shell_surface, - MetaRectangle *out_geometry) + MtkRectangle *out_geometry) { MetaWaylandSurfaceRole *surface_role = META_WAYLAND_SURFACE_ROLE (shell_surface); MetaWaylandSurface *surface = meta_wayland_surface_role_get_surface (surface_role); - MetaRectangle geometry; + MtkRectangle geometry; MetaWaylandSurface *subsurface_surface; - geometry = (MetaRectangle) { + geometry = (MtkRectangle) { .width = meta_wayland_surface_get_width (surface), .height = meta_wayland_surface_get_height (surface), }; @@ -74,11 +74,11 @@ meta_wayland_shell_surface_calculate_geometry (MetaWaylandShellSurface *shell_su void meta_wayland_shell_surface_determine_geometry (MetaWaylandShellSurface *shell_surface, - MetaRectangle *set_geometry, - MetaRectangle *out_geometry) + MtkRectangle *set_geometry, + MtkRectangle *out_geometry) { - MetaRectangle bounding_geometry = { 0 }; - MetaRectangle intersected_geometry = { 0 }; + MtkRectangle bounding_geometry = { 0 }; + MtkRectangle intersected_geometry = { 0 }; meta_wayland_shell_surface_calculate_geometry (shell_surface, &bounding_geometry); diff --git a/src/wayland/meta-wayland-shell-surface.h b/src/wayland/meta-wayland-shell-surface.h index 7a6170f91..43dd657a4 100644 --- a/src/wayland/meta-wayland-shell-surface.h +++ b/src/wayland/meta-wayland-shell-surface.h @@ -51,11 +51,11 @@ void meta_wayland_shell_surface_managed (MetaWaylandShellSurface *shell_surface, MetaWindow *window); void meta_wayland_shell_surface_calculate_geometry (MetaWaylandShellSurface *shell_surface, - MetaRectangle *out_geometry); + MtkRectangle *out_geometry); void meta_wayland_shell_surface_determine_geometry (MetaWaylandShellSurface *shell_surface, - MetaRectangle *set_geometry, - MetaRectangle *out_geometry); + MtkRectangle *set_geometry, + MtkRectangle *out_geometry); void meta_wayland_shell_surface_set_window (MetaWaylandShellSurface *shell_surface, MetaWindow *window); diff --git a/src/wayland/meta-wayland-subsurface.c b/src/wayland/meta-wayland-subsurface.c index c34156678..f4aa04959 100644 --- a/src/wayland/meta-wayland-subsurface.c +++ b/src/wayland/meta-wayland-subsurface.c @@ -111,15 +111,15 @@ void meta_wayland_subsurface_union_geometry (MetaWaylandSubsurface *subsurface, int parent_x, int parent_y, - MetaRectangle *out_geometry) + MtkRectangle *out_geometry) { MetaWaylandSurfaceRole *surface_role = META_WAYLAND_SURFACE_ROLE (subsurface); MetaWaylandSurface *surface = meta_wayland_surface_role_get_surface (surface_role); - MetaRectangle geometry; + MtkRectangle geometry; MetaWaylandSurface *subsurface_surface; - geometry = (MetaRectangle) { + geometry = (MtkRectangle) { .x = surface->offset_x + surface->sub.x, .y = surface->offset_y + surface->sub.y, .width = meta_wayland_surface_get_width (surface), diff --git a/src/wayland/meta-wayland-subsurface.h b/src/wayland/meta-wayland-subsurface.h index 7039e1a7c..b4401b9ba 100644 --- a/src/wayland/meta-wayland-subsurface.h +++ b/src/wayland/meta-wayland-subsurface.h @@ -42,7 +42,7 @@ typedef struct void meta_wayland_subsurface_union_geometry (MetaWaylandSubsurface *subsurface, int parent_x, int parent_y, - MetaRectangle *out_geometry); + MtkRectangle *out_geometry); void meta_wayland_subsurface_parent_destroyed (MetaWaylandSurface *surface); diff --git a/src/wayland/meta-wayland-surface.c b/src/wayland/meta-wayland-surface.c index 3c9b47a84..0da270aee 100644 --- a/src/wayland/meta-wayland-surface.c +++ b/src/wayland/meta-wayland-surface.c @@ -2272,7 +2272,7 @@ meta_wayland_surface_can_scanout_untransformed (MetaWaylandSurface *surface, if (surface->viewport.has_dst_size) { - MetaRectangle view_layout; + MtkRectangle view_layout; float view_scale; float untransformed_layout_width; float untransformed_layout_height; diff --git a/src/wayland/meta-wayland-surface.h b/src/wayland/meta-wayland-surface.h index 05db8f84e..d3942edea 100644 --- a/src/wayland/meta-wayland-surface.h +++ b/src/wayland/meta-wayland-surface.h @@ -100,7 +100,7 @@ struct _MetaWaylandSurfaceState /* wl_surface.frame */ struct wl_list frame_callback_list; - MetaRectangle new_geometry; + MtkRectangle new_geometry; gboolean has_new_geometry; gboolean has_acked_configure_serial; diff --git a/src/wayland/meta-wayland-window-configuration.c b/src/wayland/meta-wayland-window-configuration.c index 11aa6b9a0..4298d1eec 100644 --- a/src/wayland/meta-wayland-window-configuration.c +++ b/src/wayland/meta-wayland-window-configuration.c @@ -25,7 +25,7 @@ static uint32_t global_serial_counter = 0; MetaWaylandWindowConfiguration * meta_wayland_window_configuration_new (MetaWindow *window, - MetaRectangle rect, + MtkRectangle rect, int bounds_width, int bounds_height, int scale, diff --git a/src/wayland/meta-wayland-window-configuration.h b/src/wayland/meta-wayland-window-configuration.h index f60cbe792..064e73ea1 100644 --- a/src/wayland/meta-wayland-window-configuration.h +++ b/src/wayland/meta-wayland-window-configuration.h @@ -53,7 +53,7 @@ struct _MetaWaylandWindowConfiguration }; MetaWaylandWindowConfiguration * meta_wayland_window_configuration_new (MetaWindow *window, - MetaRectangle rect, + MtkRectangle rect, int max_width, int max_height, int scale, diff --git a/src/wayland/meta-wayland-xdg-shell.c b/src/wayland/meta-wayland-xdg-shell.c index efe12afc8..a1c8803f7 100644 --- a/src/wayland/meta-wayland-xdg-shell.c +++ b/src/wayland/meta-wayland-xdg-shell.c @@ -59,7 +59,7 @@ typedef struct _MetaWaylandXdgShellClient struct _MetaWaylandXdgPositioner { - MetaRectangle anchor_rect; + MtkRectangle anchor_rect; int32_t width; int32_t height; uint32_t gravity; @@ -89,7 +89,7 @@ typedef struct _MetaWaylandXdgSurfacePrivate { struct wl_resource *resource; MetaWaylandXdgShellClient *shell_client; - MetaRectangle geometry; + MtkRectangle geometry; guint configure_sent : 1; guint first_buffer_attached : 1; @@ -153,7 +153,7 @@ meta_wayland_xdg_positioner_to_placement (MetaWaylandXdgPositioner *xdg_position static struct wl_resource * meta_wayland_xdg_surface_get_wm_base_resource (MetaWaylandXdgSurface *xdg_surface); -static MetaRectangle +static MtkRectangle meta_wayland_xdg_surface_get_window_geometry (MetaWaylandXdgSurface *xdg_surface); static void @@ -891,8 +891,8 @@ meta_wayland_xdg_toplevel_post_apply_state (MetaWaylandSurfaceRole *surface_rol meta_wayland_surface_role_get_surface (surface_role); MetaWaylandSurfaceRoleClass *surface_role_class; MetaWindow *window; - MetaRectangle old_geometry; - MetaRectangle window_geometry; + MtkRectangle old_geometry; + MtkRectangle window_geometry; gboolean geometry_changed; @@ -1334,10 +1334,10 @@ meta_wayland_xdg_popup_post_apply_state (MetaWaylandSurfaceRole *surface_role, META_WAYLAND_SURFACE_ROLE_CLASS (meta_wayland_xdg_popup_parent_class); MetaWindow *window; MetaWindow *parent_window; - MetaRectangle old_geometry; - MetaRectangle window_geometry; - MetaRectangle buffer_rect; - MetaRectangle parent_buffer_rect; + MtkRectangle old_geometry; + MtkRectangle window_geometry; + MtkRectangle buffer_rect; + MtkRectangle parent_buffer_rect; window = meta_wayland_surface_get_window (surface); if (!window) @@ -1570,7 +1570,7 @@ meta_wayland_xdg_surface_get_wm_base_resource (MetaWaylandXdgSurface *xdg_surfac return priv->shell_client->resource; } -static MetaRectangle +static MtkRectangle meta_wayland_xdg_surface_get_window_geometry (MetaWaylandXdgSurface *xdg_surface) { MetaWaylandXdgSurfacePrivate *priv = @@ -1739,7 +1739,7 @@ meta_wayland_xdg_surface_real_reset (MetaWaylandXdgSurface *xdg_surface) priv->first_buffer_attached = FALSE; priv->configure_sent = FALSE; - priv->geometry = (MetaRectangle) { 0 }; + priv->geometry = (MtkRectangle) { 0 }; priv->has_set_geometry = FALSE; } @@ -1798,7 +1798,7 @@ meta_wayland_xdg_surface_post_apply_state (MetaWaylandSurfaceRole *surface_role } else if (!priv->has_set_geometry) { - MetaRectangle new_geometry = { 0 }; + MtkRectangle new_geometry = { 0 }; /* If the surface has never set any geometry, calculate * a default one unioning the surface and all subsurfaces together. */ @@ -2230,7 +2230,7 @@ static MetaPlacementRule meta_wayland_xdg_positioner_to_placement (MetaWaylandXdgPositioner *xdg_positioner, MetaWindow *parent_window) { - MetaRectangle parent_rect; + MtkRectangle parent_rect; meta_window_get_frame_rect (parent_window, &parent_rect); @@ -2339,7 +2339,7 @@ xdg_positioner_set_anchor_rect (struct wl_client *client, return; } - positioner->anchor_rect = (MetaRectangle) { + positioner->anchor_rect = (MtkRectangle) { .x = x, .y = y, .width = width, diff --git a/src/wayland/meta-window-wayland.c b/src/wayland/meta-window-wayland.c index 456ccb356..79a0f0a9a 100644 --- a/src/wayland/meta-window-wayland.c +++ b/src/wayland/meta-window-wayland.c @@ -66,7 +66,7 @@ struct _MetaWindowWayland gboolean has_pending_state_change; gboolean has_last_sent_configuration; - MetaRectangle last_sent_rect; + MtkRectangle last_sent_rect; int last_sent_rel_x; int last_sent_rel_y; int last_sent_geometry_scale; @@ -254,9 +254,9 @@ meta_window_wayland_grab_op_ended (MetaWindow *window, static void meta_window_wayland_move_resize_internal (MetaWindow *window, MetaGravity gravity, - MetaRectangle unconstrained_rect, - MetaRectangle constrained_rect, - MetaRectangle temporary_rect, + MtkRectangle unconstrained_rect, + MtkRectangle constrained_rect, + MtkRectangle temporary_rect, int rel_x, int rel_y, MetaMoveResizeFlags flags, @@ -264,7 +264,7 @@ meta_window_wayland_move_resize_internal (MetaWindow *window, { MetaWindowWayland *wl_window = META_WINDOW_WAYLAND (window); gboolean can_move_now = FALSE; - MetaRectangle configured_rect; + MtkRectangle configured_rect; int geometry_scale; int new_x; int new_y; @@ -498,7 +498,7 @@ scale_size (int *width, } static void -scale_rect_size (MetaRectangle *rect, +scale_rect_size (MtkRectangle *rect, float scale) { scale_size (&rect->width, &rect->height, scale); @@ -520,7 +520,7 @@ meta_window_wayland_update_main_monitor (MetaWindow *window, MetaLogicalMonitor *scaled_new; float from_scale, to_scale; float scale; - MetaRectangle rect; + MtkRectangle rect; from = window->monitor; @@ -1091,8 +1091,8 @@ meta_window_wayland_get_geometry_scale (MetaWindow *window) static void calculate_position (MetaWaylandWindowConfiguration *configuration, - MetaRectangle *geometry, - MetaRectangle *rect) + MtkRectangle *geometry, + MtkRectangle *rect) { int offset_x; int offset_y; @@ -1128,7 +1128,7 @@ calculate_position (MetaWaylandWindowConfiguration *configuration, */ void meta_window_wayland_finish_move_resize (MetaWindow *window, - MetaRectangle new_geom, + MtkRectangle new_geom, MetaWaylandSurfaceState *pending) { MetaWindowWayland *wl_window = META_WINDOW_WAYLAND (window); @@ -1137,7 +1137,7 @@ meta_window_wayland_finish_move_resize (MetaWindow *window, int dx, dy; int geometry_scale; MetaGravity gravity; - MetaRectangle rect; + MtkRectangle rect; MetaMoveResizeFlags flags; MetaWaylandWindowConfiguration *acked_configuration; gboolean is_window_being_resized; @@ -1194,7 +1194,7 @@ meta_window_wayland_finish_move_resize (MetaWindow *window, meta_grab_op_is_resizing (meta_window_drag_get_grab_op (window_drag)) && meta_window_drag_get_window (window_drag) == window); - rect = (MetaRectangle) { + rect = (MtkRectangle) { .x = window->rect.x, .y = window->rect.y, .width = new_geom.width, diff --git a/src/wayland/meta-window-wayland.h b/src/wayland/meta-window-wayland.h index 7c92767ed..a02224e55 100644 --- a/src/wayland/meta-window-wayland.h +++ b/src/wayland/meta-window-wayland.h @@ -38,7 +38,7 @@ MetaWindow * meta_window_wayland_new (MetaDisplay *display, MetaWaylandSurface *surface); void meta_window_wayland_finish_move_resize (MetaWindow *window, - MetaRectangle new_geom, + MtkRectangle new_geom, MetaWaylandSurfaceState *pending); int meta_window_wayland_get_geometry_scale (MetaWindow *window); diff --git a/src/wayland/meta-window-xwayland.c b/src/wayland/meta-window-xwayland.c index 5cb72d756..ed3c679f1 100644 --- a/src/wayland/meta-window-xwayland.c +++ b/src/wayland/meta-window-xwayland.c @@ -104,11 +104,11 @@ meta_window_xwayland_init (MetaWindowXwayland *window_xwayland) * resolution sized window cover the full actual monitor resolution. */ static void -meta_window_xwayland_adjust_fullscreen_monitor_rect (MetaWindow *window, - MetaRectangle *fs_monitor_rect) +meta_window_xwayland_adjust_fullscreen_monitor_rect (MetaWindow *window, + MtkRectangle *fs_monitor_rect) { MetaX11Display *x11_display = window->display->x11_display; - MetaRectangle win_monitor_rect; + MtkRectangle win_monitor_rect; MtkRectangle *rects; uint32_t *list = NULL; int i, n_items = 0; diff --git a/src/wayland/meta-xwayland-surface.c b/src/wayland/meta-xwayland-surface.c index a5af04e2f..8fa1c72a9 100644 --- a/src/wayland/meta-xwayland-surface.c +++ b/src/wayland/meta-xwayland-surface.c @@ -163,7 +163,7 @@ meta_xwayland_surface_get_relative_coordinates (MetaWaylandSurfaceRole *surface_ float *out_sy) { MetaXwaylandSurface *xwayland_surface = META_XWAYLAND_SURFACE (surface_role); - MetaRectangle window_rect = { 0 }; + MtkRectangle window_rect = { 0 }; if (xwayland_surface->window) meta_window_get_buffer_rect (xwayland_surface->window, &window_rect); diff --git a/src/wayland/meta-xwayland.c b/src/wayland/meta-xwayland.c index 7eece31fb..e95ca5640 100644 --- a/src/wayland/meta-xwayland.c +++ b/src/wayland/meta-xwayland.c @@ -1226,7 +1226,7 @@ meta_xwayland_set_primary_output (MetaX11Display *x11_display) RROutput output_id = resources->outputs[i]; XRROutputInfo *xrandr_output; XRRCrtcInfo *crtc_info = NULL; - MetaRectangle crtc_geometry; + MtkRectangle crtc_geometry; xrandr_output = XRRGetOutputInfo (xdisplay, resources, output_id); if (!xrandr_output) diff --git a/src/x11/meta-x11-display.c b/src/x11/meta-x11-display.c index 952148859..2f97e33b9 100644 --- a/src/x11/meta-x11-display.c +++ b/src/x11/meta-x11-display.c @@ -966,7 +966,7 @@ set_workspace_work_area_hint (MetaWorkspace *workspace, for (l = logical_monitors; l; l = l->next) { - MetaRectangle area; + MtkRectangle area; meta_workspace_get_work_area_for_logical_monitor (workspace, l->data, &area); @@ -1002,7 +1002,7 @@ set_work_area_hint (MetaDisplay *display, int num_workspaces; GList *l; unsigned long *data, *tmp; - MetaRectangle area; + MtkRectangle area; num_workspaces = meta_workspace_manager_get_n_workspaces (workspace_manager); data = g_new (unsigned long, num_workspaces * 4); diff --git a/src/x11/session.h b/src/x11/session.h index 64c839957..b312e7cba 100644 --- a/src/x11/session.h +++ b/src/x11/session.h @@ -55,8 +55,8 @@ struct _MetaWindowSessionInfo * window size/pos, even if fonts/themes change, etc. */ MetaGravity gravity; - MetaRectangle rect; - MetaRectangle saved_rect; + MtkRectangle rect; + MtkRectangle saved_rect; guint on_all_workspaces : 1; guint minimized : 1; guint maximized : 1; diff --git a/src/x11/window-props.c b/src/x11/window-props.c index 5baa92f9f..6fbcf1ae6 100644 --- a/src/x11/window-props.c +++ b/src/x11/window-props.c @@ -329,7 +329,7 @@ reload_icon_geometry (MetaWindow *window, } else { - MetaRectangle geometry; + MtkRectangle geometry; geometry.x = (int)value->v.cardinal_list.cardinals[0]; geometry.y = (int)value->v.cardinal_list.cardinals[1]; diff --git a/src/x11/window-x11-private.h b/src/x11/window-x11-private.h index 993c8fd98..024c580ea 100644 --- a/src/x11/window-x11-private.h +++ b/src/x11/window-x11-private.h @@ -68,7 +68,7 @@ struct _MetaWindowX11Private /* These are in server coordinates. If we have a frame, it's * relative to the frame. */ - MetaRectangle client_rect; + MtkRectangle client_rect; MetaIconCache icon_cache; Pixmap wm_hints_pixmap; diff --git a/src/x11/window-x11.c b/src/x11/window-x11.c index 2aa76eef2..70879ef59 100644 --- a/src/x11/window-x11.c +++ b/src/x11/window-x11.c @@ -288,10 +288,10 @@ send_configure_notify (MetaWindow *window) } static void -adjust_for_gravity (MetaWindow *window, - gboolean coords_assume_border, - MetaGravity gravity, - MetaRectangle *rect) +adjust_for_gravity (MetaWindow *window, + gboolean coords_assume_border, + MetaGravity gravity, + MtkRectangle *rect) { MetaWindowX11 *window_x11 = META_WINDOW_X11 (window); MetaWindowX11Private *priv = meta_window_x11_get_instance_private (window_x11); @@ -512,7 +512,7 @@ meta_window_apply_session_info (MetaWindow *window, if (info->geometry_set) { - MetaRectangle rect; + MtkRectangle rect; MetaMoveResizeFlags flags; MetaGravity gravity; @@ -599,7 +599,7 @@ meta_window_x11_initialize_state (MetaWindow *window) if (!window->override_redirect) { - MetaRectangle rect; + MtkRectangle rect; MetaMoveResizeFlags flags; MetaGravity gravity = window->size_hints.win_gravity; @@ -1048,8 +1048,8 @@ meta_window_x11_focus (MetaWindow *window, } static void -meta_window_get_client_root_coords (MetaWindow *window, - MetaRectangle *rect) +meta_window_get_client_root_coords (MetaWindow *window, + MtkRectangle *rect) { MetaWindowX11 *window_x11 = META_WINDOW_X11 (window); MetaWindowX11Private *priv = meta_window_x11_get_instance_private (window_x11); @@ -1071,7 +1071,7 @@ meta_window_refresh_resize_popup (MetaWindow *window) if (priv->showing_resize_popup) { - MetaRectangle rect; + MtkRectangle rect; int display_w, display_h; meta_window_get_client_root_coords (window, &rect); @@ -1288,9 +1288,9 @@ meta_window_x11_can_freeze_commits (MetaWindow *window) static void meta_window_x11_move_resize_internal (MetaWindow *window, MetaGravity gravity, - MetaRectangle unconstrained_rect, - MetaRectangle constrained_rect, - MetaRectangle intermediate_rect, + MtkRectangle unconstrained_rect, + MtkRectangle constrained_rect, + MtkRectangle intermediate_rect, int rel_x, int rel_y, MetaMoveResizeFlags flags, @@ -1299,7 +1299,7 @@ meta_window_x11_move_resize_internal (MetaWindow *window, MetaWindowX11 *window_x11 = META_WINDOW_X11 (window); MetaWindowX11Private *priv = meta_window_x11_get_instance_private (window_x11); MetaFrameBorders borders; - MetaRectangle client_rect; + MtkRectangle client_rect; int size_dx, size_dy; XWindowChanges values; unsigned int mask; @@ -2644,7 +2644,7 @@ meta_window_move_resize_request (MetaWindow *window, gboolean allow_position_change; gboolean in_grab_op; MetaMoveResizeFlags flags; - MetaRectangle buffer_rect; + MtkRectangle buffer_rect; MetaWindowDrag *window_drag; /* We ignore configure requests while the user is moving/resizing @@ -2773,7 +2773,7 @@ meta_window_move_resize_request (MetaWindow *window, if (flags & (META_MOVE_RESIZE_MOVE_ACTION | META_MOVE_RESIZE_RESIZE_ACTION)) { - MetaRectangle rect; + MtkRectangle rect; rect.x = x; rect.y = y; @@ -2782,7 +2782,7 @@ meta_window_move_resize_request (MetaWindow *window, if (window->monitor) { - MetaRectangle monitor_rect; + MtkRectangle monitor_rect; meta_display_get_monitor_geometry (window->display, window->monitor->number, @@ -4183,9 +4183,9 @@ meta_window_x11_always_update_shape (MetaWindow *window) } void -meta_window_x11_surface_rect_to_frame_rect (MetaWindow *window, - MetaRectangle *surface_rect, - MetaRectangle *frame_rect) +meta_window_x11_surface_rect_to_frame_rect (MetaWindow *window, + MtkRectangle *surface_rect, + MtkRectangle *frame_rect) { MetaFrameBorders borders; @@ -4202,9 +4202,9 @@ meta_window_x11_surface_rect_to_frame_rect (MetaWindow *window, } void -meta_window_x11_surface_rect_to_client_rect (MetaWindow *window, - MetaRectangle *surface_rect, - MetaRectangle *client_rect) +meta_window_x11_surface_rect_to_client_rect (MetaWindow *window, + MtkRectangle *surface_rect, + MtkRectangle *client_rect) { MetaFrameBorders borders; @@ -4217,7 +4217,7 @@ meta_window_x11_surface_rect_to_client_rect (MetaWindow *window, client_rect->height -= borders.total.top + borders.total.bottom; } -MetaRectangle +MtkRectangle meta_window_x11_get_client_rect (MetaWindowX11 *window_x11) { MetaWindowX11Private *priv = meta_window_x11_get_instance_private (window_x11); @@ -4258,8 +4258,8 @@ meta_window_x11_can_unredirect (MetaWindowX11 *window_x11) if (window->override_redirect) { - MetaRectangle window_rect; - MetaRectangle logical_monitor_layout; + MtkRectangle window_rect; + MtkRectangle logical_monitor_layout; MetaLogicalMonitor *logical_monitor = window->monitor; meta_window_get_frame_rect (window, &window_rect); diff --git a/src/x11/window-x11.h b/src/x11/window-x11.h index 4977aa9c0..cdb475ef1 100644 --- a/src/x11/window-x11.h +++ b/src/x11/window-x11.h @@ -91,14 +91,14 @@ void meta_window_x11_set_thaw_after_paint (MetaWindow *window, gboolean meta_window_x11_should_thaw_after_paint (MetaWindow *window); gboolean meta_window_x11_always_update_shape (MetaWindow *window); -void meta_window_x11_surface_rect_to_frame_rect (MetaWindow *window, - MetaRectangle *surface_rect, - MetaRectangle *frame_rect); -void meta_window_x11_surface_rect_to_client_rect (MetaWindow *window, - MetaRectangle *surface_rect, - MetaRectangle *client_rect); +void meta_window_x11_surface_rect_to_frame_rect (MetaWindow *window, + MtkRectangle *surface_rect, + MtkRectangle *frame_rect); +void meta_window_x11_surface_rect_to_client_rect (MetaWindow *window, + MtkRectangle *surface_rect, + MtkRectangle *client_rect); -MetaRectangle meta_window_x11_get_client_rect (MetaWindowX11 *window_x11); +MtkRectangle meta_window_x11_get_client_rect (MetaWindowX11 *window_x11); gboolean meta_window_x11_can_unredirect (MetaWindowX11 *window_x11);