2016-12-12 21:37:11 -05:00
|
|
|
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Copyright (C) 2016 Red Hat
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License as
|
|
|
|
* published by the Free Software Foundation; either version 2 of the
|
|
|
|
* License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful, but
|
|
|
|
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
2023-08-07 05:50:23 -04:00
|
|
|
* along with this program; if not, see <http://www.gnu.org/licenses/>.
|
2016-12-12 21:37:11 -05:00
|
|
|
*/
|
|
|
|
|
2023-07-21 09:37:20 -04:00
|
|
|
#pragma once
|
2016-12-12 21:37:11 -05:00
|
|
|
|
|
|
|
#include <glib-object.h>
|
|
|
|
|
2016-12-12 22:03:22 -05:00
|
|
|
#include "backends/meta-monitor.h"
|
2017-03-06 23:34:38 -05:00
|
|
|
#include "backends/meta-monitor-config-manager.h"
|
2016-12-12 21:37:11 -05:00
|
|
|
#include "backends/meta-monitor-manager-private.h"
|
2019-01-22 21:25:35 -05:00
|
|
|
#include "core/util-private.h"
|
2016-12-12 21:37:11 -05:00
|
|
|
#include "meta/boxes.h"
|
|
|
|
|
|
|
|
#define META_MAX_OUTPUTS_PER_MONITOR 4
|
|
|
|
|
|
|
|
struct _MetaLogicalMonitor
|
|
|
|
{
|
|
|
|
GObject parent;
|
|
|
|
|
|
|
|
int number;
|
2023-07-19 19:46:15 -04:00
|
|
|
MtkRectangle rect;
|
2016-12-12 21:37:11 -05:00
|
|
|
gboolean is_primary;
|
|
|
|
gboolean is_presentation; /* XXX: not yet used */
|
|
|
|
gboolean in_fullscreen;
|
2017-05-25 04:12:51 -04:00
|
|
|
float scale;
|
2017-03-17 04:33:18 -04:00
|
|
|
MetaMonitorTransform transform;
|
2016-12-12 21:37:11 -05:00
|
|
|
|
|
|
|
/* The primary or first output for this monitor, 0 if we can't figure out.
|
|
|
|
It can be matched to a winsys_id of a MetaOutput.
|
|
|
|
|
|
|
|
This is used as an opaque token on reconfiguration when switching from
|
2020-08-26 05:49:50 -04:00
|
|
|
clone to extended, to decide on what output the windows should go next
|
2016-12-12 21:37:11 -05:00
|
|
|
(it's an attempt to keep windows on the same monitor, and preferably on
|
|
|
|
the primary one).
|
|
|
|
*/
|
2018-10-17 10:55:18 -04:00
|
|
|
uint64_t winsys_id;
|
2016-12-12 21:37:11 -05:00
|
|
|
|
2016-12-12 22:03:22 -05:00
|
|
|
GList *monitors;
|
2016-12-12 21:37:11 -05:00
|
|
|
};
|
|
|
|
|
|
|
|
#define META_TYPE_LOGICAL_MONITOR (meta_logical_monitor_get_type ())
|
|
|
|
G_DECLARE_FINAL_TYPE (MetaLogicalMonitor, meta_logical_monitor,
|
|
|
|
META, LOGICAL_MONITOR,
|
|
|
|
GObject)
|
|
|
|
|
2017-03-27 11:45:28 -04:00
|
|
|
typedef void (* MetaLogicalMonitorCrtcFunc) (MetaLogicalMonitor *logical_monitor,
|
2020-01-15 11:17:33 -05:00
|
|
|
MetaMonitor *monitor,
|
2019-04-04 12:43:09 -04:00
|
|
|
MetaOutput *output,
|
2017-03-27 11:45:28 -04:00
|
|
|
MetaCrtc *crtc,
|
|
|
|
gpointer user_data);
|
|
|
|
|
2017-02-24 05:10:52 -05:00
|
|
|
MetaLogicalMonitor * meta_logical_monitor_new (MetaMonitorManager *monitor_manager,
|
|
|
|
MetaLogicalMonitorConfig *logical_monitor_config,
|
|
|
|
int monitor_number);
|
2017-03-06 23:34:38 -05:00
|
|
|
|
|
|
|
MetaLogicalMonitor * meta_logical_monitor_new_derived (MetaMonitorManager *monitor_manager,
|
|
|
|
MetaMonitor *monitor,
|
2023-07-19 19:46:15 -04:00
|
|
|
MtkRectangle *layout,
|
2017-05-25 04:12:51 -04:00
|
|
|
float scale,
|
2017-03-06 23:34:38 -05:00
|
|
|
int monitor_number);
|
2016-12-12 22:03:22 -05:00
|
|
|
|
|
|
|
void meta_logical_monitor_add_monitor (MetaLogicalMonitor *logical_monitor,
|
|
|
|
MetaMonitor *monitor);
|
|
|
|
|
2019-01-22 21:25:35 -05:00
|
|
|
META_EXPORT_TEST
|
2016-12-12 22:03:22 -05:00
|
|
|
gboolean meta_logical_monitor_is_primary (MetaLogicalMonitor *logical_monitor);
|
|
|
|
|
|
|
|
void meta_logical_monitor_make_primary (MetaLogicalMonitor *logical_monitor);
|
|
|
|
|
2017-05-25 04:12:51 -04:00
|
|
|
float meta_logical_monitor_get_scale (MetaLogicalMonitor *logical_monitor);
|
2016-12-22 02:24:02 -05:00
|
|
|
|
2017-08-11 03:02:43 -04:00
|
|
|
MetaMonitorTransform meta_logical_monitor_get_transform (MetaLogicalMonitor *logical_monitor);
|
|
|
|
|
2020-04-02 10:11:09 -04:00
|
|
|
META_EXPORT_TEST
|
2023-07-19 19:46:15 -04:00
|
|
|
MtkRectangle meta_logical_monitor_get_layout (MetaLogicalMonitor *logical_monitor);
|
2017-08-11 03:02:43 -04:00
|
|
|
|
2019-01-22 21:25:35 -05:00
|
|
|
META_EXPORT_TEST
|
2016-12-13 08:44:16 -05:00
|
|
|
GList * meta_logical_monitor_get_monitors (MetaLogicalMonitor *logical_monitor);
|
|
|
|
|
2017-08-26 15:22:34 -04:00
|
|
|
gboolean meta_logical_monitor_has_neighbor (MetaLogicalMonitor *logical_monitor,
|
|
|
|
MetaLogicalMonitor *neighbor,
|
|
|
|
MetaDisplayDirection neighbor_dir);
|
2017-03-24 10:46:32 -04:00
|
|
|
|
2017-03-27 11:45:28 -04:00
|
|
|
void meta_logical_monitor_foreach_crtc (MetaLogicalMonitor *logical_monitor,
|
|
|
|
MetaLogicalMonitorCrtcFunc func,
|
|
|
|
gpointer user_data);
|