summaryrefslogtreecommitdiff
path: root/src/backends/x11/meta-crtc-xrandr.h
blob: dbf5da0c6f52ebd2e93af714194a6b6e467a95af (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */

/*
 * Copyright (C) 2017 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_CRTC_XRANDR_H
#define META_CRTC_XRANDR_H

#include <X11/extensions/Xrandr.h>
#include <xcb/randr.h>

#include "backends/meta-crtc.h"
#include "backends/x11/meta-gpu-xrandr.h"

#define META_TYPE_CRTC_XRANDR (meta_crtc_xrandr_get_type ())
G_DECLARE_FINAL_TYPE (MetaCrtcXrandr, meta_crtc_xrandr,
                      META, CRTC_XRANDR,
                      MetaCrtc)

gboolean meta_crtc_xrandr_set_config (MetaCrtcXrandr      *crtc_xrandr,
                                      xcb_randr_crtc_t     xrandr_crtc,
                                      xcb_timestamp_t      timestamp,
                                      int                  x,
                                      int                  y,
                                      xcb_randr_mode_t     mode,
                                      xcb_randr_rotation_t rotation,
                                      xcb_randr_output_t  *outputs,
                                      int                  n_outputs,
                                      xcb_timestamp_t     *out_timestamp);

gboolean meta_crtc_xrandr_is_assignment_changed (MetaCrtcXrandr     *crtc_xrandr,
                                                 MetaCrtcAssignment *crtc_assignment);

MetaCrtcMode * meta_crtc_xrandr_get_current_mode (MetaCrtcXrandr *crtc_xrandr);

MetaCrtcXrandr * meta_crtc_xrandr_new (MetaGpuXrandr      *gpu_xrandr,
                                       XRRCrtcInfo        *xrandr_crtc,
                                       RRCrtc              crtc_id,
                                       XRRScreenResources *resources);

#endif /* META_CRTC_XRANDR_H */