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 Oleg V. Khaschansky
19: * @version $Revision$
20: */package org.apache.harmony.awt.gl.linux;
21:
22: import org.apache.harmony.awt.nativebridge.NativeBridge;
23: import org.apache.harmony.awt.nativebridge.linux.X11;
24: import org.apache.harmony.awt.nativebridge.linux.X11Defs;
25: import org.apache.harmony.misc.accessors.LockedArray;
26:
27: import java.awt.image.*;
28: import java.awt.geom.Rectangle2D;
29:
30: import org.apache.harmony.awt.gl.*;
31:
32: public class XSurface extends Surface {
33:
34: XSurface(XGraphics2D g2d, int width, int height) {
35: surfaceDataPtr = createSurfData(g2d.display, g2d.drawable,
36: g2d.imageGC, g2d.xConfig.info.lock(), width, height);
37: g2d.xConfig.info.unlock();
38: this .width = width;
39: this .height = height;
40: }
41:
42: @Override
43: public void dispose() {
44: if (surfaceDataPtr == 0) {
45: return;
46: }
47:
48: dispose(surfaceDataPtr);
49: surfaceDataPtr = 0;
50: }
51:
52: @Override
53: public long lock() {
54: return 0;
55: }
56:
57: @Override
58: public void unlock() {
59:
60: }
61:
62: @Override
63: public ColorModel getColorModel() {
64: return null;
65: }
66:
67: @Override
68: public WritableRaster getRaster() {
69: return null;
70: }
71:
72: @Override
73: public int getSurfaceType() {
74: return 0;
75: }
76:
77: @Override
78: public Surface getImageSurface() {
79: return this ;
80: }
81:
82: private native long createSurfData(long display, long drawable,
83: long gc, long visual_info, int width, int height);
84:
85: private native void dispose(long structPtr);
86:
87: }
|