summaryrefslogtreecommitdiff
path: root/src/backends/meta-screen-cast-window.c
blob: b9c0df867ee47ce9d13e1fc379bfaed6559b2439 (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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
/*
 * Copyright (C) 2018 Red Hat Inc.
 *
 * 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.
 *
 */

#include "config.h"

#include "backends/meta-screen-cast-window.h"

G_DEFINE_INTERFACE (MetaScreenCastWindow, meta_screen_cast_window, G_TYPE_OBJECT)

static void
meta_screen_cast_window_default_init (MetaScreenCastWindowInterface *iface)
{
}

void
meta_screen_cast_window_get_buffer_bounds (MetaScreenCastWindow *screen_cast_window,
                                           MetaRectangle        *bounds)
{
  META_SCREEN_CAST_WINDOW_GET_IFACE (screen_cast_window)->get_buffer_bounds (screen_cast_window,
                                                                             bounds);
}

void
meta_screen_cast_window_transform_relative_position (MetaScreenCastWindow *screen_cast_window,
                                                     double                x,
                                                     double                y,
                                                     double               *x_out,
                                                     double               *y_out)
{
  META_SCREEN_CAST_WINDOW_GET_IFACE (screen_cast_window)->transform_relative_position (screen_cast_window,
                                                                                       x,
                                                                                       y,
                                                                                       x_out,
                                                                                       y_out);
}

gboolean
meta_screen_cast_window_transform_cursor_position (MetaScreenCastWindow *screen_cast_window,
                                                   MetaCursorSprite     *cursor_sprite,
                                                   graphene_point_t     *cursor_position,
                                                   float                *out_cursor_scale,
                                                   MetaMonitorTransform *out_cursor_transform,
                                                   graphene_point_t     *out_relative_cursor_position)
{
  MetaScreenCastWindowInterface *iface =
    META_SCREEN_CAST_WINDOW_GET_IFACE (screen_cast_window);

  return iface->transform_cursor_position (screen_cast_window,
                                           cursor_sprite,
                                           cursor_position,
                                           out_cursor_scale,
                                           out_cursor_transform,
                                           out_relative_cursor_position);
}

void
meta_screen_cast_window_capture_into (MetaScreenCastWindow *screen_cast_window,
                                      MetaRectangle        *bounds,
                                      uint8_t              *data)
{
  META_SCREEN_CAST_WINDOW_GET_IFACE (screen_cast_window)->capture_into (screen_cast_window,
                                                                        bounds,
                                                                        data);
}

gboolean
meta_screen_cast_window_blit_to_framebuffer (MetaScreenCastWindow *screen_cast_window,
                                             MetaRectangle        *bounds,
                                             CoglFramebuffer      *framebuffer)
{
  MetaScreenCastWindowInterface *iface =
    META_SCREEN_CAST_WINDOW_GET_IFACE (screen_cast_window);

  return iface->blit_to_framebuffer (screen_cast_window, bounds, framebuffer);
}

gboolean
meta_screen_cast_window_has_damage (MetaScreenCastWindow *screen_cast_window)
{
  MetaScreenCastWindowInterface *iface =
    META_SCREEN_CAST_WINDOW_GET_IFACE (screen_cast_window);

  return iface->has_damage (screen_cast_window);
}