4 * Copyright (C) 2008 Adam Williams <broadcast at earthling dot net>
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
25 #include "bcwindowbase.inc"
30 #include <X11/Xatom.h>
33 // The primary selection is filled by highlighting a region
34 #define PRIMARY_SELECTION 0
35 // The secondary selection is filled by copying
36 #define SECONDARY_SELECTION 1
39 // Storage for guicast only
40 // The secondary selection has never been reliable either in Cinelerra
41 // or anything else. We just use the guaranteed solution for any data not
42 // intended for use outside Cinelerra.
43 #define BC_PRIMARY_SELECTION 2
47 class BC_Clipboard : public Thread
50 BC_Clipboard(const char *display_name);
53 int start_clipboard();
56 long clipboard_len(int clipboard_num);
57 int to_clipboard(const char *data, long len, int clipboard_num);
58 int from_clipboard(char *data, long maxlen, int clipboard_num);
61 void handle_selectionrequest(XSelectionRequestEvent *request);
62 int handle_request_string(XSelectionRequestEvent *request);
63 int handle_request_targets(XSelectionRequestEvent *request);
65 Display *in_display, *out_display;
66 Atom completion_atom, primary, secondary;
69 Window in_win, out_win;
72 char display_name[BCTEXTLEN];