Example #1
0
 @MarshalsPointer
 public static List<?> toObject(Class<? extends CFType> cls, long handle, long flags) {
   CFArray o = (CFArray) CFType.Marshaler.toObject(cls, handle, flags);
   if (o == null) {
     return null;
   }
   return o.toList(CFBundle.class);
 }
 @MarshalsPointer
 public static long toNative(List<CFURLUbiquitousItemDownloadingStatus> l, long flags) {
   if (l == null) {
     return 0L;
   }
   CFArray array = CFMutableArray.create();
   for (CFURLUbiquitousItemDownloadingStatus o : l) {
     array.add(o.value());
   }
   return CFType.Marshaler.toNative(array, flags);
 }
Example #3
0
 @MarshalsPointer
 public static long toNative(List<CVBufferAttributes> l, long flags) {
   if (l == null) {
     return 0L;
   }
   CFArray array = CFMutableArray.create();
   for (CVBufferAttributes i : l) {
     array.add(i.getDictionary());
   }
   return CFType.Marshaler.toNative(array, flags);
 }
 @MarshalsPointer
 public static long toNative(List<CMImageDescriptionFlavor> l, long flags) {
   if (l == null) {
     return 0L;
   }
   CFArray array = CFMutableArray.create();
   for (CMImageDescriptionFlavor o : l) {
     array.add(o.value());
   }
   return CFType.Marshaler.toNative(array, flags);
 }
 @MarshalsPointer
 public static long toNative(List<CGImageDestinationCopySourceOptions> l, long flags) {
   if (l == null) {
     return 0L;
   }
   CFArray array = CFMutableArray.create();
   for (CGImageDestinationCopySourceOptions i : l) {
     array.add(i.getDictionary());
   }
   return CFType.Marshaler.toNative(array, flags);
 }
 @MarshalsPointer
 public static long toNative(List<CMFormatDescriptionExtension> l, long flags) {
   if (l == null) {
     return 0L;
   }
   CFArray array = CFMutableArray.create();
   for (CMFormatDescriptionExtension i : l) {
     array.add(i.getDictionary());
   }
   return CFType.Marshaler.toNative(array, flags);
 }
 @MarshalsPointer
 public static long toNative(List<CFStreamSocketSOCKSVersion> l, long flags) {
   if (l == null) {
     return 0L;
   }
   CFArray array = CFMutableArray.create();
   for (CFStreamSocketSOCKSVersion i : l) {
     array.add(i.value());
   }
   return CFType.Marshaler.toNative(array, flags);
 }
Example #8
0
 @MarshalsPointer
 public static long toNative(List<CGImagePropertyGIF> l, long flags) {
   if (l == null) {
     return 0L;
   }
   CFArray array = CFMutableArray.create();
   for (CGImagePropertyGIF o : l) {
     array.add(o.value());
   }
   return CFType.Marshaler.toNative(array, flags);
 }
 @MarshalsPointer
 public static long toNative(List<CMMetadataKeySpace> l, long flags) {
   if (l == null) {
     return 0L;
   }
   CFArray array = CFMutableArray.create();
   for (CMMetadataKeySpace o : l) {
     array.add(o.value());
   }
   return CFType.Marshaler.toNative(array, flags);
 }
Example #10
0
 @MarshalsPointer
 public static long toNative(List<CTFrameClippingPath> l, long flags) {
   if (l == null) {
     return 0L;
   }
   CFArray array = CFMutableArray.create();
   for (CTFrameClippingPath i : l) {
     array.add(i.getDictionary());
   }
   return CFType.Marshaler.toNative(array, flags);
 }
Example #11
0
 @MarshalsPointer
 public static long toNative(List<ABSource> l, long flags) {
   if (l == null) {
     return 0L;
   }
   CFArray array = CFMutableArray.create();
   for (ABSource i : l) {
     array.add(i);
   }
   return CFType.Marshaler.toNative(array, flags);
 }
Example #12
0
 @MarshalsPointer
 public static List<CVBufferAttributes> toObject(
     Class<? extends CFType> cls, long handle, long flags) {
   CFArray o = (CFArray) CFType.Marshaler.toObject(CFArray.class, handle, flags);
   if (o == null) {
     return null;
   }
   List<CVBufferAttributes> list = new ArrayList<>();
   for (int i = 0; i < o.size(); i++) {
     list.add(new CVBufferAttributes(o.get(i, CFDictionary.class)));
   }
   return list;
 }
 @MarshalsPointer
 public static List<CMFormatDescriptionExtension> toObject(
     Class<? extends CFType> cls, long handle, long flags) {
   CFArray o = (CFArray) CFType.Marshaler.toObject(cls, handle, flags);
   if (o == null) {
     return null;
   }
   List<CMFormatDescriptionExtension> list = new ArrayList<>();
   for (int i = 0; i < o.size(); i++) {
     list.add(new CMFormatDescriptionExtension(o.get(i, CFDictionary.class)));
   }
   return list;
 }
 @MarshalsPointer
 public static List<CFStreamSocketSOCKSVersion> toObject(
     Class<? extends CFType> cls, long handle, long flags) {
   CFArray o = (CFArray) CFType.Marshaler.toObject(cls, handle, flags);
   if (o == null) {
     return null;
   }
   List<CFStreamSocketSOCKSVersion> list = new ArrayList<>();
   for (int i = 0; i < o.size(); i++) {
     list.add(CFStreamSocketSOCKSVersion.valueOf(o.get(i, CFString.class)));
   }
   return list;
 }
Example #15
0
 @MarshalsPointer
 public static List<CGImagePropertyGIF> toObject(
     Class<? extends CFType> cls, long handle, long flags) {
   CFArray o = (CFArray) CFType.Marshaler.toObject(CFArray.class, handle, flags);
   if (o == null) {
     return null;
   }
   List<CGImagePropertyGIF> list = new ArrayList<>();
   for (int i = 0; i < o.size(); i++) {
     list.add(CGImagePropertyGIF.valueOf(o.get(i, CFString.class)));
   }
   return list;
 }
 @MarshalsPointer
 public static List<CFURLUbiquitousItemDownloadingStatus> toObject(
     Class<? extends CFType> cls, long handle, long flags) {
   CFArray o = (CFArray) CFType.Marshaler.toObject(CFArray.class, handle, flags);
   if (o == null) {
     return null;
   }
   List<CFURLUbiquitousItemDownloadingStatus> list = new ArrayList<>();
   for (int i = 0; i < o.size(); i++) {
     list.add(CFURLUbiquitousItemDownloadingStatus.valueOf(o.get(i, CFString.class)));
   }
   return list;
 }
Example #17
0
 @MarshalsPointer
 public static List<ABSource> toObject(Class<? extends CFType> cls, long handle, long flags) {
   CFArray o = (CFArray) CFType.Marshaler.toObject(cls, handle, flags);
   if (o == null) {
     return null;
   }
   List<ABSource> list = new ArrayList<>();
   for (long i = 0, n = o.size(); i < n; i++) {
     ABRecord record = o.get(i, ABRecord.class);
     list.add(
         (ABSource) NativeObject.Marshaler.toObject(ABSource.class, record.getHandle(), flags));
   }
   return list;
 }
Example #18
0
 @MarshalsPointer
 public static long toNative(List<? extends CFType> l, long flags) {
   if (l == null) {
     return 0L;
   }
   CFArray o = null;
   if (l instanceof CFArray) {
     o = (CFArray) l;
   } else {
     o = CFArray.create((List<? extends CFType>) l);
   }
   return CFType.Marshaler.toNative(o, flags);
 }
Example #19
0
 private static CGGradient create(CGColorSpace space, CGColor[] colors, Object locations) {
   if (colors == null) {
     throw new NullPointerException("colors");
   }
   try (CFArray colorsArray = CFArray.create(colors)) {
     return create(
         space,
         colorsArray,
         locations != null
             ? VM.getArrayValuesAddress(CoreGraphics.toMachineSizedFloatArray(locations))
             : 0);
   }
 }