All Downloads are FREE. Search and download functionalities are using the official Maven repository.

jogamp.nativewindow.jawt.JAWT_DrawingSurfaceInfo Maven / Gradle / Ivy

The newest version!
/* !---- DO NOT EDIT: This file autogenerated by com/jogamp/gluegen/JavaEmitter.java on Sat Oct 10 03:10:51 CEST 2015 ----! */


package jogamp.nativewindow.jawt;

import java.nio.*;

import com.jogamp.gluegen.runtime.*;
import com.jogamp.common.os.*;
import com.jogamp.common.nio.*;
import jogamp.common.os.MachineDataInfoRuntime;

import java.security.*;
import jogamp.nativewindow.jawt.*;
import com.jogamp.common.os.Platform;
import com.jogamp.common.util.VersionNumber;

public class JAWT_DrawingSurfaceInfo {

  StructAccessor accessor;

  private static final int mdIdx = MachineDataInfoRuntime.getStatic().ordinal();
  private final MachineDataInfo md;

  private static final int[] JAWT_DrawingSurfaceInfo_size = new int[] { 32 /* ARM_MIPS_32 */, 32 /* X86_32_UNIX */, 32 /* X86_32_MACOS */, 32 /* PPC_32_UNIX */, 32 /* SPARC_32_SUNOS */, 32 /* X86_32_WINDOWS */, 48 /* LP64_UNIX */, 48 /* X86_64_WINDOWS */  };
  private static final int[] ds_offset = new int[] { 4 /* ARM_MIPS_32 */, 4 /* X86_32_UNIX */, 4 /* X86_32_MACOS */, 4 /* PPC_32_UNIX */, 4 /* SPARC_32_SUNOS */, 4 /* X86_32_WINDOWS */, 8 /* LP64_UNIX */, 8 /* X86_64_WINDOWS */ };
//private static final int[] ds_size = new int[] { 4 /* ARM_MIPS_32 */, 4 /* X86_32_UNIX */, 4 /* X86_32_MACOS */, 4 /* PPC_32_UNIX */, 4 /* SPARC_32_SUNOS */, 4 /* X86_32_WINDOWS */, 8 /* LP64_UNIX */, 8 /* X86_64_WINDOWS */  };// JType[JAWT_DrawingSurface / 'JAWT_DrawingSurface', is[compound, ], descriptor 'LJAWT_DrawingSurface;']
  private static final int[] bounds_offset = new int[] { 8 /* ARM_MIPS_32 */, 8 /* X86_32_UNIX */, 8 /* X86_32_MACOS */, 8 /* PPC_32_UNIX */, 8 /* SPARC_32_SUNOS */, 8 /* X86_32_WINDOWS */, 16 /* LP64_UNIX */, 16 /* X86_64_WINDOWS */ };
  private static final int[] bounds_size = new int[] { 16 /* ARM_MIPS_32 */, 16 /* X86_32_UNIX */, 16 /* X86_32_MACOS */, 16 /* PPC_32_UNIX */, 16 /* SPARC_32_SUNOS */, 16 /* X86_32_WINDOWS */, 16 /* LP64_UNIX */, 16 /* X86_64_WINDOWS */  };
  private static final int[] clipSize_offset = new int[] { 24 /* ARM_MIPS_32 */, 24 /* X86_32_UNIX */, 24 /* X86_32_MACOS */, 24 /* PPC_32_UNIX */, 24 /* SPARC_32_SUNOS */, 24 /* X86_32_WINDOWS */, 32 /* LP64_UNIX */, 32 /* X86_64_WINDOWS */ };
//private static final int[] clipSize_size = new int[] { 4 /* ARM_MIPS_32 */, 4 /* X86_32_UNIX */, 4 /* X86_32_MACOS */, 4 /* PPC_32_UNIX */, 4 /* SPARC_32_SUNOS */, 4 /* X86_32_WINDOWS */, 4 /* LP64_UNIX */, 4 /* X86_64_WINDOWS */  };
  private static final int[] clip_offset = new int[] { 28 /* ARM_MIPS_32 */, 28 /* X86_32_UNIX */, 28 /* X86_32_MACOS */, 28 /* PPC_32_UNIX */, 28 /* SPARC_32_SUNOS */, 28 /* X86_32_WINDOWS */, 40 /* LP64_UNIX */, 40 /* X86_64_WINDOWS */ };
//private static final int[] clip_size = new int[] { 4 /* ARM_MIPS_32 */, 4 /* X86_32_UNIX */, 4 /* X86_32_MACOS */, 4 /* PPC_32_UNIX */, 4 /* SPARC_32_SUNOS */, 4 /* X86_32_WINDOWS */, 8 /* LP64_UNIX */, 8 /* X86_64_WINDOWS */  };// JType[JAWT_Rectangle / 'JAWT_Rectangle', is[compound, ], descriptor 'LJAWT_Rectangle;']

  public static int size() {
    return JAWT_DrawingSurfaceInfo_size[mdIdx];
  }

  public static JAWT_DrawingSurfaceInfo create() {
    return create(Buffers.newDirectByteBuffer(size()));
  }

  public static JAWT_DrawingSurfaceInfo create(java.nio.ByteBuffer buf) {
      return new JAWT_DrawingSurfaceInfo(buf);
  }

  JAWT_DrawingSurfaceInfo(java.nio.ByteBuffer buf) {
    md = MachineDataInfo.StaticConfig.values()[mdIdx].md;
    accessor = new StructAccessor(buf);
  }

  public java.nio.ByteBuffer getBuffer() {
    return accessor.getBuffer();
  }

  // SKIP unsized array in struct: JAWT_DrawingSurfaceInfo.ds: CType[(PointerType) 'jawt_DrawingSurface *' -> (JAWT_DrawingSurface) * , size [fixed false, lnx64 8], [const[false], pointer*1]]

  /** Getter for native field bounds: CType[(StructType) typedef 'JAWT_Rectangle', size [fixed false, lnx64 16], [const[false], struct{jawt_Rectangle: 4, }]] */
  public JAWT_Rectangle getBounds() {
    return JAWT_Rectangle.create( accessor.slice( bounds_offset[mdIdx], bounds_size[mdIdx] ) );
 }

  /** Setter for native field clipSize: CType[(IntType) typedef 'jint', size [fixed true, lnx64 4], [const[false], int]] */
  public JAWT_DrawingSurfaceInfo setClipSize(int val) {
    accessor.setIntAt(clipSize_offset[mdIdx], val);
    return this;
  }

  /** Getter for native field clipSize: CType[(IntType) typedef 'jint', size [fixed true, lnx64 4], [const[false], int]] */
  public int getClipSize() {
    return accessor.getIntAt(clipSize_offset[mdIdx]);
  }

  // SKIP unsized array in struct: JAWT_DrawingSurfaceInfo.clip: CType[(PointerType) 'JAWT_Rectangle *' -> (JAWT_Rectangle) * , size [fixed false, lnx64 8], [const[false], pointer*1]]

  // --- Begin CustomJavaCode .cfg declarations
  public JAWT_PlatformInfo platformInfo(final JAWT jawt) {
    return newPlatformInfo(jawt, platformInfo0(getBuffer()));
  }
  
  private native ByteBuffer platformInfo0(Buffer jthis0);
  
  private static java.lang.reflect.Method platformInfoFactoryMethod;
  
  private static JAWT_PlatformInfo newPlatformInfo(JAWT jawt, ByteBuffer buf) {
    if (platformInfoFactoryMethod == null) {
      try {
          Class factoryClass;
          if (Platform.OS_TYPE == Platform.OSType.WINDOWS) {
            factoryClass = Class.forName("jogamp.nativewindow.jawt.windows.JAWT_Win32DrawingSurfaceInfo");
          } else if (Platform.OS_TYPE == Platform.OSType.MACOS) {
            if( 0 != ( jawt.getCachedVersion() & JAWTUtil.JAWT_MACOSX_USE_CALAYER ) ) {
                factoryClass = Class.forName("jogamp.nativewindow.jawt.macosx.JAWT_SurfaceLayers");
            } else {
                factoryClass = Class.forName("jogamp.nativewindow.jawt.macosx.JAWT_MacOSXDrawingSurfaceInfo");
            }
          } else {
            // Assume Linux, Solaris, etc. Should probably test for these explicitly.
            factoryClass = Class.forName("jogamp.nativewindow.jawt.x11.JAWT_X11DrawingSurfaceInfo");
          }
          platformInfoFactoryMethod = factoryClass.getMethod("create",
                                                             new Class[] { ByteBuffer.class });
      } catch (Exception e) {
        throw new RuntimeException(e);
      }
    }
    try {
      return (JAWT_PlatformInfo)
        platformInfoFactoryMethod.invoke(null, new Object[] { buf });
    } catch (Exception e) {
      throw new RuntimeException(e);
    }
  }
  // ---- End CustomJavaCode .cfg declarations


}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy