Refine search
public void setValue(NativeLong value) { getPointer().setNativeLong(0, value); }
public NativeLongByReference(NativeLong value) { super(NativeLong.SIZE); setValue(value); }
public void hover() { HWNDByReference hwnd = new HWNDByReference(); NativeLongByReference x = new NativeLongByReference(); NativeLongByReference y = new NativeLongByReference(); NativeLongByReference width = new NativeLongByReference(); NativeLongByReference height = new NativeLongByReference(); int result = lib.wdeGetDetailsOnceScrolledOnToScreen(element, hwnd, x, y, width, height); errors.verifyErrorCode(result, "hover"); long midX = x.getValue().longValue() + (width.getValue().longValue() / 2); long midY = y.getValue().longValue() + (height.getValue().longValue() / 2); result = lib.wdeMouseMoveTo(hwnd.getValue(), new NativeLong(100), new NativeLong(0), new NativeLong(0), new NativeLong(midX), new NativeLong(midY)); errors.verifyErrorCode(result, "hover mouse move"); }
public void set(int v) { getValue().setValue(new NativeLong(v)); } public void set(long v) {
public Point getLocationOnScreenOnceScrolledIntoView() { HWNDByReference hwnd = new HWNDByReference(); NativeLongByReference x = new NativeLongByReference(); NativeLongByReference y = new NativeLongByReference(); NativeLongByReference width = new NativeLongByReference(); NativeLongByReference height = new NativeLongByReference(); if (lib.wdeGetDetailsOnceScrolledOnToScreen(element, hwnd, x, y, width, height) != 0) { return null; } return new Point(x.getValue().intValue(), y.getValue().intValue()); }
EdsError err = EdsError.EDS_ERR_OK; NativeLongByReference number = new NativeLongByReference( new NativeLong( EdsEvfOutputDevice.kEdsEvfOutputDevice_TFT.value() ) ); Pointer data = number.getPointer(); err = CanonUtils.setPropertyData( camera, EdsPropertyID.kEdsPropID_Evf_OutputDevice, 0, NativeLong.SIZE, data ); if ( err != EdsError.EDS_ERR_OK ) { number = new NativeLongByReference( new NativeLong( 0 ) ); data = number.getPointer(); err = CanonUtils.setPropertyData( camera, EdsPropertyID.kEdsPropID_Evf_Mode, 0, NativeLong.SIZE, data ); if ( err != EdsError.EDS_ERR_OK ) {
/** * Returns the data type of a specified property * * @param ref Reference to the camera * @param property Property id * @param param Name of the parameter * @return The data type, or null if the parameter isn't supported, or unknown if something else goes wrong. */ public static EdsDataType getPropertyType( final EdsBaseRef ref, final EdsPropertyID property, final long param ) { final int bufferSize = 1; final IntBuffer type = IntBuffer.allocate( bufferSize ); final NativeLongByReference number = new NativeLongByReference( new NativeLong( bufferSize ) ); final EdsError err = CanonUtils.toEdsError( CanonCamera.EDSDK.EdsGetPropertySize( ref, new NativeLong( property.value() ), new NativeLong( param ), type, number ) ); if ( err == EdsError.EDS_ERR_OK ) { final EdsDataType edsDataType = EdsDataType.enumOfValue( type.get( 0 ) ); if ( edsDataType != null ) { //System.out.println( " > property type = " + edsDataType.value() + " : " + edsDataType.name() + " : " + edsDataType.description() ); return edsDataType; } } else if( err == EdsError.EDS_ERR_NOT_SUPPORTED ){ return null; } return EdsDataType.kEdsDataType_Unknown; }
@Test public void testDifftime() throws Exception { // Pointer to hold the times NativeLongByReference ref = new NativeLongByReference(); // time() returns -1 on error. NativeLong err = new NativeLong(-1L); LibC.time(ref); NativeLong time0 = ref.getValue(); Assert.assertNotSame(time0, err, "Time 0 returned an error (-1)."); Thread.sleep(5000L); LibC.time(ref); NativeLong time1 = ref.getValue(); Assert.assertNotSame(time1, err, "Time 1 returned an error (-1)."); Assert.assertNotSame(time1, time0, "Time 1 returned same time as Time 0."); double diff = LibC.difftime(time1, time0); Assert.assertTrue(diff >= 5, "Time difference was not greater than 5 seconds: " + diff); } }
NativeLongByReference sizep = new NativeLongByReference(); IntByReference baseType = new IntByReference(); NativeLongByReference nfieldsp = new NativeLongByReference(); IntByReference classp = new IntByReference(); int utype = classp.getValue(); if (debug) System.out.printf(" user type id=%d name=%s size=%d baseType=%d nfields=%d class=%d%n", typeid, name, sizep.getValue().longValue(), baseType.getValue(), nfieldsp.getValue().longValue(), utype); UserType ut = new UserType(grpid, typeid, name, sizep.getValue().longValue(), baseType.getValue(), nfieldsp.getValue().longValue(), utype); userTypes.put(typeid, ut); NativeLongByReference sizep2 = new NativeLongByReference(); ret = nc4.nc_inq_opaque(grpid, typeid, nameo, sizep2); if (ret != 0) throw new IOException(ret + ": " + nc4.nc_strerror(ret));
public NativeLong get() { return getValue().getValue(); } public void set(int v) {
public void dragAndDropBy(int moveRightBy, int moveDownBy) { HWNDByReference hwnd = new HWNDByReference(); NativeLongByReference x = new NativeLongByReference(); NativeLongByReference y = new NativeLongByReference(); NativeLongByReference width = new NativeLongByReference(); NativeLongByReference height = new NativeLongByReference(); int result = lib.wdeGetDetailsOnceScrolledOnToScreen(element, hwnd, x, y, width, height); errors.verifyErrorCode(result, "Unable to determine location once scrolled on to screen"); lib.wdeMouseDownAt(hwnd.getValue(), x.getValue(), y.getValue()); long endX = x.getValue().longValue() + moveRightBy; long endY = y.getValue().longValue() + moveDownBy; int duration = parent.manage().getSpeed().getTimeOut(); lib.wdeMouseMoveTo(hwnd.getValue(), new NativeLong(duration), x.getValue(), y.getValue(), new NativeLong(endX), new NativeLong(endY)); lib.wdeMouseUpAt(hwnd.getValue(), new NativeLong(endX), new NativeLong(endY)); }
public void set(int v) { getValue().setValue(new NativeLong(v)); } public void set(long v) {
public Point getLocation() { NativeLongByReference x = new NativeLongByReference(); NativeLongByReference y = new NativeLongByReference(); int result = lib.wdeGetLocation(element, x, y); errors.verifyErrorCode(result, "Unable to get location of element"); return new Point(x.getValue().intValue(), y.getValue().intValue()); }
EdsError err = EdsError.EDS_ERR_OK; NativeLongByReference number = new NativeLongByReference( new NativeLong( 1 ) ); Pointer data = number.getPointer(); err = CanonUtils.setPropertyData( camera, EdsPropertyID.kEdsPropID_Evf_Mode, 0, NativeLong.SIZE, data ); if ( err != EdsError.EDS_ERR_OK ) { number = new NativeLongByReference( new NativeLong( EdsEvfOutputDevice.kEdsEvfOutputDevice_PC.value() ) ); data = number.getPointer(); err = CanonUtils.setPropertyData( camera, EdsPropertyID.kEdsPropID_Evf_OutputDevice, 0, NativeLong.SIZE, data ); if ( err != EdsError.EDS_ERR_OK ) {
NativeLongByReference value = new NativeLongByReference(); result = lib.wdGetNumberScriptResult(scriptResult, value); errors.verifyErrorCode(result, "Cannot extract number result"); toReturn = value.getValue().longValue(); break;
public NativeLong get() { return getValue().getValue(); } public void set(int v) {
public void dragAndDropOn(RenderedWebElement toElement) { HWNDByReference hwnd = new HWNDByReference(); NativeLongByReference x = new NativeLongByReference(); NativeLongByReference y = new NativeLongByReference(); NativeLongByReference width = new NativeLongByReference(); NativeLongByReference height = new NativeLongByReference(); int result = lib.wdeGetDetailsOnceScrolledOnToScreen(element, hwnd, x, y, width, height); errors.verifyErrorCode(result, "Unable to determine location once scrolled on to screen"); NativeLong startX = new NativeLong(x.getValue().longValue() + (width.getValue().longValue() / 2)); NativeLong startY = new NativeLong(y.getValue().longValue() + (height.getValue().longValue() / 2)); lib.wdeMouseDownAt(hwnd.getValue(), startX, startY); Pointer other = ((InternetExplorerElement) toElement).element; result = lib.wdeGetDetailsOnceScrolledOnToScreen(other, hwnd, x, y, width, height); errors.verifyErrorCode(result, "Unable to determine location of target once scrolled on to screen"); NativeLong endX = new NativeLong(x.getValue().longValue() + (width.getValue().longValue() / 2)); NativeLong endY = new NativeLong(y.getValue().longValue() + (height.getValue().longValue() / 2)); int duration = parent.manage().getSpeed().getTimeOut(); lib.wdeMouseMoveTo(hwnd.getValue(), new NativeLong(duration), startX, startY, endX, endY); lib.wdeMouseUpAt(hwnd.getValue(), endX, endY); }
public void set(long v) { getValue().setValue(new NativeLong(v)); } public void set(NativeLong v) {
public Dimension getSize() { NativeLongByReference width = new NativeLongByReference(); NativeLongByReference height = new NativeLongByReference(); int result = lib.wdeGetSize(element, width, height); errors.verifyErrorCode(result, "Unable to get element size"); return new Dimension(width.getValue().intValue(), height.getValue().intValue()); }
public NativeLong getValue() { return getPointer().getNativeLong(0); } }