2017-01-09 06:31:18 +00: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
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
|
|
|
|
* 02111-1307, USA.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef META_MONITOR_CONFIG_MANAGER_H
|
|
|
|
#define META_MONITOR_CONFIG_MANAGER_H
|
|
|
|
|
|
|
|
#include "backends/meta-monitor.h"
|
|
|
|
#include "backends/meta-monitor-manager-private.h"
|
|
|
|
|
|
|
|
#define META_TYPE_MONITOR_CONFIG_MANAGER (meta_monitor_config_manager_get_type ())
|
|
|
|
G_DECLARE_FINAL_TYPE (MetaMonitorConfigManager, meta_monitor_config_manager,
|
|
|
|
META, MONITOR_CONFIG_MANAGER, GObject)
|
|
|
|
|
|
|
|
typedef struct _MetaMonitorConfig
|
|
|
|
{
|
|
|
|
MetaMonitorSpec *monitor_spec;
|
|
|
|
MetaMonitorModeSpec *mode_spec;
|
2017-02-14 10:19:09 +00:00
|
|
|
gboolean enable_underscanning;
|
2017-01-09 06:31:18 +00:00
|
|
|
} MetaMonitorConfig;
|
|
|
|
|
|
|
|
typedef struct _MetaLogicalMonitorConfig
|
|
|
|
{
|
|
|
|
MetaRectangle layout;
|
|
|
|
GList *monitor_configs;
|
2017-03-21 06:17:18 +00:00
|
|
|
MetaMonitorTransform transform;
|
2017-05-25 08:12:51 +00:00
|
|
|
float scale;
|
2017-01-09 06:31:18 +00:00
|
|
|
gboolean is_primary;
|
|
|
|
gboolean is_presentation;
|
|
|
|
} MetaLogicalMonitorConfig;
|
|
|
|
|
2017-01-12 08:13:48 +00:00
|
|
|
typedef struct _MetaMonitorsConfigKey
|
|
|
|
{
|
|
|
|
GList *monitor_specs;
|
|
|
|
} MetaMonitorsConfigKey;
|
|
|
|
|
2017-08-10 07:12:41 +00:00
|
|
|
typedef enum _MetaMonitorsConfigFlag
|
|
|
|
{
|
|
|
|
META_MONITORS_CONFIG_FLAG_NONE = 0,
|
|
|
|
META_MONITORS_CONFIG_FLAG_MIGRATED = (1 << 0),
|
2018-10-05 16:52:03 +00:00
|
|
|
META_MONITORS_CONFIG_FLAG_SYSTEM_CONFIG = (1 << 1),
|
2017-08-10 07:12:41 +00:00
|
|
|
} MetaMonitorsConfigFlag;
|
|
|
|
|
2017-01-09 06:31:18 +00:00
|
|
|
struct _MetaMonitorsConfig
|
|
|
|
{
|
|
|
|
GObject parent;
|
|
|
|
|
2017-01-12 08:13:48 +00:00
|
|
|
MetaMonitorsConfigKey *key;
|
2017-01-09 06:31:18 +00:00
|
|
|
GList *logical_monitor_configs;
|
2017-02-24 10:10:52 +00:00
|
|
|
|
2017-09-28 15:34:33 +00:00
|
|
|
GList *disabled_monitor_specs;
|
|
|
|
|
2017-08-10 07:12:41 +00:00
|
|
|
MetaMonitorsConfigFlag flags;
|
|
|
|
|
2017-02-24 10:10:52 +00:00
|
|
|
MetaLogicalMonitorLayoutMode layout_mode;
|
2018-08-30 00:34:53 +00:00
|
|
|
|
|
|
|
MetaMonitorSwitchConfigType switch_config;
|
2017-01-09 06:31:18 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#define META_TYPE_MONITORS_CONFIG (meta_monitors_config_get_type ())
|
|
|
|
G_DECLARE_FINAL_TYPE (MetaMonitorsConfig, meta_monitors_config,
|
|
|
|
META, MONITORS_CONFIG, GObject)
|
|
|
|
|
2019-01-23 02:25:35 +00:00
|
|
|
META_EXPORT_TEST
|
2017-01-09 06:31:18 +00:00
|
|
|
MetaMonitorConfigManager * meta_monitor_config_manager_new (MetaMonitorManager *monitor_manager);
|
|
|
|
|
2019-01-23 02:25:35 +00:00
|
|
|
META_EXPORT_TEST
|
2017-01-12 08:13:48 +00:00
|
|
|
MetaMonitorConfigStore * meta_monitor_config_manager_get_store (MetaMonitorConfigManager *config_manager);
|
|
|
|
|
2019-01-23 02:25:35 +00:00
|
|
|
META_EXPORT_TEST
|
2017-01-09 06:31:18 +00:00
|
|
|
gboolean meta_monitor_config_manager_assign (MetaMonitorManager *manager,
|
|
|
|
MetaMonitorsConfig *config,
|
2020-02-25 19:30:46 +00:00
|
|
|
GPtrArray **crtc_assignments,
|
|
|
|
GPtrArray **output_assignments,
|
2017-01-09 06:31:18 +00:00
|
|
|
GError **error);
|
|
|
|
|
2019-01-23 02:25:35 +00:00
|
|
|
META_EXPORT_TEST
|
2017-01-13 03:01:27 +00:00
|
|
|
MetaMonitorsConfig * meta_monitor_config_manager_get_stored (MetaMonitorConfigManager *config_manager);
|
|
|
|
|
2019-01-23 02:25:35 +00:00
|
|
|
META_EXPORT_TEST
|
2017-01-09 06:31:18 +00:00
|
|
|
MetaMonitorsConfig * meta_monitor_config_manager_create_linear (MetaMonitorConfigManager *config_manager);
|
|
|
|
|
2019-01-23 02:25:35 +00:00
|
|
|
META_EXPORT_TEST
|
2017-01-09 06:31:18 +00:00
|
|
|
MetaMonitorsConfig * meta_monitor_config_manager_create_fallback (MetaMonitorConfigManager *config_manager);
|
|
|
|
|
2019-01-23 02:25:35 +00:00
|
|
|
META_EXPORT_TEST
|
2017-01-09 07:38:17 +00:00
|
|
|
MetaMonitorsConfig * meta_monitor_config_manager_create_suggested (MetaMonitorConfigManager *config_manager);
|
|
|
|
|
2019-01-23 02:25:35 +00:00
|
|
|
META_EXPORT_TEST
|
2017-04-28 15:56:18 +00:00
|
|
|
MetaMonitorsConfig * meta_monitor_config_manager_create_for_orientation (MetaMonitorConfigManager *config_manager,
|
|
|
|
MetaMonitorTransform transform);
|
|
|
|
|
2019-01-23 02:25:35 +00:00
|
|
|
META_EXPORT_TEST
|
2017-04-28 15:56:18 +00:00
|
|
|
MetaMonitorsConfig * meta_monitor_config_manager_create_for_rotate_monitor (MetaMonitorConfigManager *config_manager);
|
|
|
|
|
2019-01-23 02:25:35 +00:00
|
|
|
META_EXPORT_TEST
|
2017-06-07 16:38:10 +00:00
|
|
|
MetaMonitorsConfig * meta_monitor_config_manager_create_for_switch_config (MetaMonitorConfigManager *config_manager,
|
|
|
|
MetaMonitorSwitchConfigType config_type);
|
|
|
|
|
2019-01-23 02:25:35 +00:00
|
|
|
META_EXPORT_TEST
|
2017-01-09 06:31:18 +00:00
|
|
|
void meta_monitor_config_manager_set_current (MetaMonitorConfigManager *config_manager,
|
|
|
|
MetaMonitorsConfig *config);
|
|
|
|
|
2019-01-23 02:25:35 +00:00
|
|
|
META_EXPORT_TEST
|
2017-01-09 06:31:18 +00:00
|
|
|
MetaMonitorsConfig * meta_monitor_config_manager_get_current (MetaMonitorConfigManager *config_manager);
|
|
|
|
|
2019-01-23 02:25:35 +00:00
|
|
|
META_EXPORT_TEST
|
2017-08-11 07:16:15 +00:00
|
|
|
MetaMonitorsConfig * meta_monitor_config_manager_pop_previous (MetaMonitorConfigManager *config_manager);
|
|
|
|
|
2019-01-23 02:25:35 +00:00
|
|
|
META_EXPORT_TEST
|
2017-03-23 09:20:07 +00:00
|
|
|
MetaMonitorsConfig * meta_monitor_config_manager_get_previous (MetaMonitorConfigManager *config_manager);
|
|
|
|
|
2019-01-23 02:25:35 +00:00
|
|
|
META_EXPORT_TEST
|
2017-08-11 07:16:15 +00:00
|
|
|
void meta_monitor_config_manager_clear_history (MetaMonitorConfigManager *config_manager);
|
|
|
|
|
2019-01-23 02:25:35 +00:00
|
|
|
META_EXPORT_TEST
|
2017-03-23 09:20:07 +00:00
|
|
|
void meta_monitor_config_manager_save_current (MetaMonitorConfigManager *config_manager);
|
|
|
|
|
2019-01-23 02:25:35 +00:00
|
|
|
META_EXPORT_TEST
|
2017-09-28 15:34:33 +00:00
|
|
|
MetaMonitorsConfig * meta_monitors_config_new_full (GList *logical_monitor_configs,
|
|
|
|
GList *disabled_monitors,
|
|
|
|
MetaLogicalMonitorLayoutMode layout_mode,
|
|
|
|
MetaMonitorsConfigFlag flags);
|
|
|
|
|
2019-01-23 02:25:35 +00:00
|
|
|
META_EXPORT_TEST
|
2017-09-28 15:34:33 +00:00
|
|
|
MetaMonitorsConfig * meta_monitors_config_new (MetaMonitorManager *monitor_manager,
|
|
|
|
GList *logical_monitor_configs,
|
|
|
|
MetaLogicalMonitorLayoutMode layout_mode,
|
|
|
|
MetaMonitorsConfigFlag flags);
|
2017-01-11 04:13:39 +00:00
|
|
|
|
2019-01-23 02:25:35 +00:00
|
|
|
META_EXPORT_TEST
|
2018-08-30 00:34:53 +00:00
|
|
|
MetaMonitorSwitchConfigType meta_monitors_config_get_switch_config (MetaMonitorsConfig *config);
|
|
|
|
|
2019-01-23 02:25:35 +00:00
|
|
|
META_EXPORT_TEST
|
2018-08-30 00:34:53 +00:00
|
|
|
void meta_monitors_config_set_switch_config (MetaMonitorsConfig *config,
|
|
|
|
MetaMonitorSwitchConfigType switch_config);
|
|
|
|
|
2019-01-23 02:25:35 +00:00
|
|
|
META_EXPORT_TEST
|
2017-01-12 08:13:48 +00:00
|
|
|
unsigned int meta_monitors_config_key_hash (gconstpointer config_key);
|
|
|
|
|
2019-01-23 02:25:35 +00:00
|
|
|
META_EXPORT_TEST
|
2017-01-12 08:13:48 +00:00
|
|
|
gboolean meta_monitors_config_key_equal (gconstpointer config_key_a,
|
|
|
|
gconstpointer config_key_b);
|
|
|
|
|
2019-01-23 02:25:35 +00:00
|
|
|
META_EXPORT_TEST
|
2017-01-12 08:13:48 +00:00
|
|
|
void meta_monitors_config_key_free (MetaMonitorsConfigKey *config_key);
|
|
|
|
|
2019-01-23 02:25:35 +00:00
|
|
|
META_EXPORT_TEST
|
2017-01-12 08:13:48 +00:00
|
|
|
void meta_logical_monitor_config_free (MetaLogicalMonitorConfig *logical_monitor_config);
|
|
|
|
|
2019-01-23 02:25:35 +00:00
|
|
|
META_EXPORT_TEST
|
2017-01-12 08:13:48 +00:00
|
|
|
void meta_monitor_config_free (MetaMonitorConfig *monitor_config);
|
|
|
|
|
2019-01-23 02:25:35 +00:00
|
|
|
META_EXPORT_TEST
|
2017-11-03 08:03:23 +00:00
|
|
|
MetaMonitorsConfigKey * meta_create_monitors_config_key_for_current_state (MetaMonitorManager *monitor_manager);
|
|
|
|
|
2019-01-23 02:25:35 +00:00
|
|
|
META_EXPORT_TEST
|
2017-09-28 15:34:33 +00:00
|
|
|
gboolean meta_logical_monitor_configs_have_monitor (GList *logical_monitor_configs,
|
|
|
|
MetaMonitorSpec *monitor_spec);
|
|
|
|
|
2019-01-23 02:25:35 +00:00
|
|
|
META_EXPORT_TEST
|
2017-02-08 02:31:32 +00:00
|
|
|
gboolean meta_verify_monitor_mode_spec (MetaMonitorModeSpec *monitor_mode_spec,
|
|
|
|
GError **error);
|
|
|
|
|
2019-01-23 02:25:35 +00:00
|
|
|
META_EXPORT_TEST
|
2017-02-08 02:31:32 +00:00
|
|
|
gboolean meta_verify_monitor_spec (MetaMonitorSpec *monitor_spec,
|
|
|
|
GError **error);
|
|
|
|
|
2019-01-23 02:25:35 +00:00
|
|
|
META_EXPORT_TEST
|
2017-02-08 02:31:32 +00:00
|
|
|
gboolean meta_verify_monitor_config (MetaMonitorConfig *monitor_config,
|
|
|
|
GError **error);
|
|
|
|
|
2019-01-23 02:25:35 +00:00
|
|
|
META_EXPORT_TEST
|
2017-02-24 10:10:52 +00:00
|
|
|
gboolean meta_verify_logical_monitor_config (MetaLogicalMonitorConfig *logical_monitor_config,
|
|
|
|
MetaLogicalMonitorLayoutMode layout_mode,
|
2017-05-25 09:20:59 +00:00
|
|
|
MetaMonitorManager *monitor_manager,
|
2017-02-24 10:10:52 +00:00
|
|
|
GError **error);
|
2017-02-08 02:31:32 +00:00
|
|
|
|
2019-01-23 02:25:35 +00:00
|
|
|
META_EXPORT_TEST
|
2017-02-08 02:31:32 +00:00
|
|
|
gboolean meta_verify_monitors_config (MetaMonitorsConfig *config,
|
2017-04-21 10:01:15 +00:00
|
|
|
MetaMonitorManager *monitor_manager,
|
2017-02-08 02:31:32 +00:00
|
|
|
GError **error);
|
|
|
|
|
2017-01-09 06:31:18 +00:00
|
|
|
#endif /* META_MONITOR_CONFIG_MANAGER_H */
|