Exemple #1
0
 @MarshalsPointer
 public static List<?> toObject(Class<? extends CFType> cls, long handle, long flags) {
   CFArray o = (CFArray) CFType.Marshaler.toObject(CFArray.class, handle, flags);
   if (o == null) {
     return null;
   }
   return o.toList(CTLine.class);
 }
 @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);
 }
 @MarshalsPointer
 public static List<CTFrameClippingPath> toObject(
     Class<? extends CFType> cls, long handle, long flags) {
   CFArray o = (CFArray) CFType.Marshaler.toObject(cls, handle, flags);
   if (o == null) {
     return null;
   }
   List<CTFrameClippingPath> list = new ArrayList<>();
   for (int i = 0; i < o.size(); i++) {
     list.add(new CTFrameClippingPath(o.get(i, CFDictionary.class)));
   }
   return list;
 }
Exemple #4
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);
   }
 }
Exemple #5
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);
 }