gnome-rr-private.h 2.58 KB
Newer Older
1 2 3
#ifndef GNOME_RR_PRIVATE_H
#define GNOME_RR_PRIVATE_H

4 5 6 7 8 9 10 11 12 13 14 15 16 17
#ifdef GDK_WINDOWING_WAYLAND
#include <gdk/gdkwayland.h>
#else
enum wl_output_transform {
  WL_OUTPUT_TRANSFORM_NORMAL,
  WL_OUTPUT_TRANSFORM_90,
  WL_OUTPUT_TRANSFORM_180,
  WL_OUTPUT_TRANSFORM_270,
  WL_OUTPUT_TRANSFORM_FLIPPED,
  WL_OUTPUT_TRANSFORM_FLIPPED_90,
  WL_OUTPUT_TRANSFORM_FLIPPED_180,
  WL_OUTPUT_TRANSFORM_FLIPPED_270
};
#endif
18

19 20
#include "meta-xrandr-shared.h"
#include "meta-dbus-xrandr.h"
21

22 23 24 25 26 27 28 29 30
typedef struct ScreenInfo ScreenInfo;

struct ScreenInfo
{
    int			min_width;
    int			max_width;
    int			min_height;
    int			max_height;

31
    guint               serial;
32 33 34 35 36 37 38 39
    
    GnomeRROutput **	outputs;
    GnomeRRCrtc **	crtcs;
    GnomeRRMode **	modes;
    
    GnomeRRScreen *	screen;

    GnomeRRMode **	clone_modes;
40

41
    GnomeRROutput *     primary;
42 43
};

44
struct GnomeRRScreenPrivate
45 46 47 48
{
    GdkScreen *			gdk_screen;
    GdkWindow *			gdk_root;
    ScreenInfo *		info;
49

50
    int                         init_name_watch_id;
51
    MetaDBusDisplayConfig      *proxy;
52 53
};

54 55 56 57 58 59 60 61 62 63 64 65 66 67
#define UNDEFINED_GROUP_ID 0
struct GnomeRRTile {
  guint group_id;
  guint flags;
  guint max_horiz_tiles;
  guint max_vert_tiles;
  guint loc_horiz;
  guint loc_vert;
  guint width;
  guint height;
};

typedef struct GnomeRRTile GnomeRRTile;

68
struct _GnomeRROutputInfoPrivate
69 70 71 72 73 74 75 76 77 78
{
    char *		name;

    gboolean		on;
    int			width;
    int			height;
    int			rate;
    int			x;
    int			y;
    GnomeRRRotation	rotation;
79
    GnomeRRRotation	available_rotations;
80 81

    gboolean		connected;
82 83 84
    char *		vendor;
    char *		product;
    char *		serial;
85 86 87 88 89
    double		aspect;
    int			pref_width;
    int			pref_height;
    char *		display_name;
    gboolean            primary;
90
    gboolean            underscanning;
91 92 93 94 95 96 97 98

    gboolean            is_tiled;
    GnomeRRTile         tile;

    int                 total_tiled_width;
    int                 total_tiled_height;
    /* ptr back to info */
    GnomeRRConfig       *config;
99 100
};

101
struct _GnomeRRConfigPrivate
102 103 104 105 106 107
{
  gboolean clone;
  GnomeRRScreen *screen;
  GnomeRROutputInfo **outputs;
};

108
gboolean _gnome_rr_output_name_is_builtin_display (const char *name);
109

110 111 112 113 114 115
gboolean _gnome_rr_screen_apply_configuration (GnomeRRScreen  *screen,
					       gboolean        persistent,
					       GVariant       *crtcs,
					       GVariant       *outputs,
					       GError        **error);

116 117 118 119 120 121 122

gboolean    _gnome_rr_output_get_tile_info      (GnomeRROutput         *output,
						GnomeRRTile *tile);
gboolean    _gnome_rr_output_get_tiled_display_size (GnomeRROutput *output,
						     int *tile_w, int *tile_h,
						     int *width, int *height);

123
#endif