1 | /** @file
|
---|
2 | *
|
---|
3 | * Guest client: seamless mode
|
---|
4 | * Abstract class for interacting with the guest system
|
---|
5 | */
|
---|
6 |
|
---|
7 | /*
|
---|
8 | * Copyright (C) 2006-2007 innotek GmbH
|
---|
9 | *
|
---|
10 | * This file is part of VirtualBox Open Source Edition (OSE), as
|
---|
11 | * available from http://www.virtualbox.org. This file is free software;
|
---|
12 | * you can redistribute it and/or modify it under the terms of the GNU
|
---|
13 | * General Public License (GPL) as published by the Free Software
|
---|
14 | * Foundation, in version 2 as it comes in the "COPYING" file of the
|
---|
15 | * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
|
---|
16 | * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
|
---|
17 | */
|
---|
18 |
|
---|
19 | #ifndef __Additions_client_seamless_guest_h
|
---|
20 | # define __Additions_client_seamless_guest_h
|
---|
21 |
|
---|
22 | #include <memory> /* for auto_ptr */
|
---|
23 | #include <vector> /* for vector */
|
---|
24 |
|
---|
25 | #include <iprt/types.h> /* for RTRECT */
|
---|
26 |
|
---|
27 | #include "seamless-glue.h"
|
---|
28 |
|
---|
29 | /**
|
---|
30 | * Observable to monitor the state of the guest windows. This abstract class definition
|
---|
31 | * serves as a template (in the linguistic sense, not the C++ sense) for creating
|
---|
32 | * platform-specific child classes.
|
---|
33 | */
|
---|
34 | class VBoxGuestSeamlessGuest
|
---|
35 | {
|
---|
36 | public:
|
---|
37 | /** Events which can be reported by this class */
|
---|
38 | enum meEvent
|
---|
39 | {
|
---|
40 | /** Empty event */
|
---|
41 | NONE,
|
---|
42 | /** Seamless mode is now supported */
|
---|
43 | CAPABLE,
|
---|
44 | /** Seamless mode is no longer supported */
|
---|
45 | INCAPABLE
|
---|
46 | };
|
---|
47 |
|
---|
48 | /**
|
---|
49 | * Initialise the guest and ensure that it is capable of handling seamless mode
|
---|
50 | *
|
---|
51 | * @param pObserver An observer object to which to report changes in state and events
|
---|
52 | * by calling its notify() method. A state change to CAPABLE also
|
---|
53 | * signals new seamless data.
|
---|
54 | * @returns iprt status code
|
---|
55 | */
|
---|
56 | int init(VBoxGuestSeamlessObserver *pObserver);
|
---|
57 |
|
---|
58 | /**
|
---|
59 | * Shutdown seamless event monitoring.
|
---|
60 | */
|
---|
61 | void uninit(void);
|
---|
62 |
|
---|
63 | /**
|
---|
64 | * Initialise seamless event reporting in the guest.
|
---|
65 | *
|
---|
66 | * @returns IPRT status code
|
---|
67 | */
|
---|
68 | int start(void);
|
---|
69 | /** Stop reporting seamless events. */
|
---|
70 | void stop(void);
|
---|
71 | /** Get the current state of the guest (capable or incapable of seamless mode). */
|
---|
72 | // meEvent getState(void);
|
---|
73 | /** Get the current list of visible rectangles. */
|
---|
74 | std::auto_ptr<std::vector<RTRECT> > getRects(void);
|
---|
75 | /** Process next event in the guest event queue - called by the event thread. */
|
---|
76 | void nextEvent(void);
|
---|
77 | /** Wake up the event thread if it is waiting for an event so that it can exit. */
|
---|
78 | bool interruptEvent(void);
|
---|
79 | };
|
---|
80 |
|
---|
81 | #if defined(RT_OS_LINUX) || defined(RT_OS_SOLARIS)
|
---|
82 | # include "seamless-x11.h" /* for VBoxGuestSeamlessGuestImpl */
|
---|
83 | #else
|
---|
84 | # error Port me
|
---|
85 | #endif
|
---|
86 |
|
---|
87 | #endif /* __Additions_client_seamless_guest_h not defined */
|
---|