VirtualBox

source: vbox/trunk/src/VBox/HostServices/SharedClipboard/VBoxClipboard.h@ 3806

Last change on this file since 3806 was 3344, checked in by vboxsync, 18 years ago

Export to OSE.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 3.1 KB
Line 
1/** @file
2 *
3 * Shared Clipboard
4 */
5
6/*
7 * Copyright (C) 2006-2007 innotek GmbH
8 *
9 * This file is part of VirtualBox Open Source Edition (OSE), as
10 * available from http://www.virtualbox.org. This file is free software;
11 * you can redistribute it and/or modify it under the terms of the GNU
12 * General Public License as published by the Free Software Foundation,
13 * in version 2 as it comes in the "COPYING" file of the VirtualBox OSE
14 * distribution. VirtualBox OSE is distributed in the hope that it will
15 * be useful, but WITHOUT ANY WARRANTY of any kind.
16 *
17 * If you received this file as part of a commercial VirtualBox
18 * distribution, then only the terms of your commercial VirtualBox
19 * license agreement apply instead of the previous paragraph.
20 */
21
22#ifndef __VBOXCLIPBOARD__H
23#define __VBOXCLIPBOARD__H
24
25#define LOG_GROUP LOG_GROUP_HGCM
26#include <VBox/log.h>
27
28/** Constants needed for string conversions done by the Linux clipboard code. */
29enum {
30 /** In Linux, lines end with a linefeed character. */
31 LINEFEED = 0xa,
32 /** In Windows, lines end with a carriage return and a linefeed character. */
33 CARRIAGERETURN = 0xd,
34 /** Little endian "real" Utf16 strings start with this marker. */
35 UTF16LEMARKER = 0xfeff,
36 /** Big endian "real" Utf16 strings start with this marker. */
37 UTF16BEMARKER = 0xfffe
38};
39
40enum {
41 /** The number of milliseconds before the clipboard times out. */
42 CLIPBOARDTIMEOUT = 2000
43};
44
45struct _VBOXCLIPBOARDCONTEXT;
46typedef struct _VBOXCLIPBOARDCONTEXT VBOXCLIPBOARDCONTEXT;
47
48
49typedef struct _VBOXCLIPBOARDCLIENTDATA
50{
51 struct _VBOXCLIPBOARDCLIENTDATA *pNext;
52 struct _VBOXCLIPBOARDCLIENTDATA *pPrev;
53
54 VBOXCLIPBOARDCONTEXT *pCtx;
55
56 uint32_t u32ClientID;
57
58 bool fAsync: 1; /* Guest is waiting for a message. */
59
60 bool fMsgQuit: 1;
61 bool fMsgReadData: 1;
62 bool fMsgFormats: 1;
63
64 struct {
65 VBOXHGCMCALLHANDLE callHandle;
66 VBOXHGCMSVCPARM *paParms;
67 } async;
68
69 struct {
70 void *pv;
71 uint32_t cb;
72 uint32_t u32Format;
73 } data;
74
75 uint32_t u32AvailableFormats;
76 uint32_t u32RequestedFormat;
77
78} VBOXCLIPBOARDCLIENTDATA;
79
80/*
81 * The service functions. Locking is between the service thread and the platform dependedn windows thread.
82 */
83bool vboxSvcClipboardLock (void);
84void vboxSvcClipboardUnlock (void);
85
86void vboxSvcClipboardReportMsg (VBOXCLIPBOARDCLIENTDATA *pClient, uint32_t u32Msg, uint32_t u32Formats);
87
88
89/*
90 * Platform dependent functions.
91 */
92int vboxClipboardInit (void);
93void vboxClipboardDestroy (void);
94
95int vboxClipboardConnect (VBOXCLIPBOARDCLIENTDATA *pClient);
96void vboxClipboardDisconnect (VBOXCLIPBOARDCLIENTDATA *pClient);
97
98void vboxClipboardFormatAnnounce (VBOXCLIPBOARDCLIENTDATA *pClient, uint32_t u32Formats);
99
100int vboxClipboardReadData (VBOXCLIPBOARDCLIENTDATA *pClient, uint32_t u32Format, void *pv, uint32_t cb, uint32_t *pcbActual);
101
102void vboxClipboardWriteData (VBOXCLIPBOARDCLIENTDATA *pClient, void *pv, uint32_t cb, uint32_t u32Format);
103
104int vboxClipboardSync (VBOXCLIPBOARDCLIENTDATA *pClient);
105
106#endif /* __VBOXCLIPBOARD__H */
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette