summaryrefslogtreecommitdiff
path: root/src/VBox/Additions/linux/xclient/seamless-glue.h
blob: cf802eba36bf815cf6f7e86d84bcd39593176dce (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
/** @file
 *
 * Guest client: seamless mode
 * Proxy between the guest and host components
 */

/*
 * Copyright (C) 2006-2007 innotek GmbH
 *
 * innotek GmbH confidential
 * All rights reserved
 */

#ifndef __Additions_client_seamless_glue_h
# define __Additions_client_seamless_glue_h

#if 0

#include "seamless-host.h"
#include "seamless-guest.h"

#endif

class VBoxGuestSeamlessObserver
{
public:
    virtual void notify(void) = 0;
    virtual ~VBoxGuestSeamlessObserver() {}
};

#if 0
/**
 * Observer to connect the guest and the host parts of the seamless guest client.
 * It starts the host part when the guest reports that it supports seamless mode and
 * stops it when the guest no longer supports seamless.  It also proxies enter and
 * exit seamless mode requests from the host part to the guest and informs the host
 * part when the guest's visible area changes.
 */
class VBoxGuestSeamlessGlue
{
private:
    VBoxGuestSeamlessHost *mHost;
    VBoxGuestSeamlessGuestImpl *mGuest;

public:
    VBoxGuestSeamlessGlue(VBoxGuestSeamlessHost *pHost, VBoxGuestSeamlessGuestImpl *pGuest)
            : mHost(pHost), mGuest(pGuest) {}
    ~VBoxGuestSeamlessGlue();

    /** State change notification callback for the guest. */
    void guestNotify(VBoxGuestSeamlessGuest::meEvent event)
    {
        switch(event)
        {
            case VBoxGuestSeamlessGuest::CAPABLE:
                mHost->start();
                break;
            case VBoxGuestSeamlessGuest::INCAPABLE:
                mHost->stop();
                break;
            case VBoxGuestSeamlessGuest::UPDATE:
                mHost->updateRects(mGuest->getRects());
                break;
            default:
                break;
        }
    }

    /** State change notification callback for the host. */
    void hostNotify(VBoxGuestSeamlessHost::meEvent event)
    {
        switch(event)
        {
            case VBoxGuestSeamlessHost::ENABLE:
                mGuest->start();
                break;
            case VBoxGuestSeamlessHost::DISABLE:
                mGuest->stop();
                break;
            default:
                break;
        }
    }
};
#endif /* 0 */

#endif /* __Additions_client_seamless_glue_h not defined */