01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one or more
03: * contributor license agreements. See the NOTICE file distributed with
04: * this work for additional information regarding copyright ownership.
05: * The ASF licenses this file to You under the Apache License, Version 2.0
06: * (the "License"); you may not use this file except in compliance with
07: * the License. You may obtain a copy of the License at
08: *
09: * http://www.apache.org/licenses/LICENSE-2.0
10: *
11: * Unless required by applicable law or agreed to in writing, software
12: * distributed under the License is distributed on an "AS IS" BASIS,
13: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14: * See the License for the specific language governing permissions and
15: * limitations under the License.
16: */
17: /**
18: * @author Michael Danilov
19: * @version $Revision$
20: */package org.apache.harmony.awt.datatransfer.linux;
21:
22: import org.apache.harmony.awt.ContextStorage;
23: import org.apache.harmony.awt.datatransfer.NativeClipboard;
24: import org.apache.harmony.awt.nativebridge.linux.X11.XEvent;
25: import org.apache.harmony.awt.wtk.linux.LinuxEventQueue;
26: import org.apache.harmony.awt.wtk.linux.LinuxWindowFactory;
27:
28: public final class LinuxSelection extends NativeClipboard implements
29: LinuxEventQueue.Preprocessor {
30:
31: private final LinuxWindowFactory factory;
32:
33: private final long xaSelection;
34: private final long xaTargets;
35: private final long xaMultiple;
36: private final long xaText;
37: private final long xaUTF8;
38: private final long xaSTRING;
39:
40: public LinuxSelection(String selection) {
41: super ("System"); //$NON-NLS-1$
42:
43: factory = (LinuxWindowFactory) ContextStorage
44: .getWindowFactory();
45:
46: xaSelection = factory.internAtom(selection);
47: xaTargets = factory.internAtom("TARGETS"); //$NON-NLS-1$
48: xaMultiple = factory.internAtom("MULTIPLE"); //$NON-NLS-1$
49: xaText = factory.internAtom("TEXT"); //$NON-NLS-1$
50: xaUTF8 = factory.internAtom("UTF8_STRING"); //$NON-NLS-1$
51: xaSTRING = factory.internAtom("STRING"); //$NON-NLS-1$
52: }
53:
54: public boolean preprocess(XEvent event) {
55: return false;
56: }
57:
58: }
|