public static /*<name>*/CTFontAttribute/*</name>*/ valueOf(/*<type>*/CFString/*</type>*/ value) { for (/*<name>*/CTFontAttribute/*</name>*/ v : values) { if (v.value().equals(value)) { return v; } } throw new IllegalArgumentException("No constant with value " + value + " found in " + /*<name>*/CTFontAttribute/*</name>*/.class.getName()); }
@MarshalsPointer public static CTFontAttribute toObject(Class<CTFontAttribute> cls, long handle, long flags) { CFString o = (CFString) CFType.Marshaler.toObject(CFString.class, handle, flags); if (o == null) { return null; } return CTFontAttribute.valueOf(o); } @MarshalsPointer
public CTFontAttributes set(CTFontAttribute key, NativeObject value) { data.put(key.value(), value); return this; }
@MarshalsPointer public static List<CTFontAttribute> 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<CTFontAttribute> list = new ArrayList<>(); for (int i = 0; i < o.size(); i++) { list.add(CTFontAttribute.valueOf(o.get(i, CFString.class))); } return list; } @MarshalsPointer
public boolean has(CTFontAttribute key) { return data.containsKey(key.value()); } public <T extends NativeObject> T get(CTFontAttribute key, Class<T> type) {
@MarshalsPointer public static CTFontAttribute toObject(Class<CTFontAttribute> cls, long handle, long flags) { CFString o = (CFString) CFType.Marshaler.toObject(CFString.class, handle, flags); if (o == null) { return null; } return CTFontAttribute.valueOf(o); } @MarshalsPointer
@MarshalsPointer public static long toNative(CTFontAttribute o, long flags) { if (o == null) { return 0L; } return CFType.Marshaler.toNative(o.value(), flags); } }
@MarshalsPointer public static CTFontAttribute toObject(Class<CTFontAttribute> cls, long handle, long flags) { CFString o = (CFString) CFType.Marshaler.toObject(CFString.class, handle, flags); if (o == null) { return null; } return CTFontAttribute.valueOf(o); } @MarshalsPointer
public <T extends NativeObject> T get(CTFontAttribute key, Class<T> type) { if (has(key)) { return data.get(key.value(), type); } return null; } public CTFontAttributes set(CTFontAttribute key, NativeObject value) {
@MarshalsPointer public static List<CTFontAttribute> 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<CTFontAttribute> list = new ArrayList<>(); for (int i = 0; i < o.size(); i++) { list.add(CTFontAttribute.valueOf(o.get(i, CFString.class))); } return list; } @MarshalsPointer
/** * @since Available in iOS 3.2 and later. */ public CTFontDescriptor createMatchingFontDescriptor(List<CTFontAttribute> mandatoryAttributes) { CFSet set = CFMutableSet.create(); for (CTFontAttribute attr : mandatoryAttributes) { set.add(attr.value()); } return createMatchingFontDescriptor(set); } /**
@MarshalsPointer public static List<CTFontAttribute> 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<CTFontAttribute> list = new ArrayList<>(); for (int i = 0; i < o.size(); i++) { list.add(CTFontAttribute.valueOf(o.get(i, CFString.class))); } return list; } @MarshalsPointer
@MarshalsPointer public static long toNative(List<CTFontAttribute> l, long flags) { if (l == null) { return 0L; } CFArray array = CFMutableArray.create(); for (CTFontAttribute o : l) { array.add(o.value()); } return CFType.Marshaler.toNative(array, flags); } }
/** * @since Available in iOS 3.2 and later. */ public List<CTFontDescriptor> createMatchingFontDescriptors(List<CTFontAttribute> mandatoryAttributes) { CFSet set = CFMutableSet.create(); for (CTFontAttribute attr : mandatoryAttributes) { set.add(attr.value()); } return createMatchingFontDescriptors(set).toList(CTFontDescriptor.class); } /**
/** * @since Available in iOS 6.0 and later. */ public static boolean matchFontDescriptors(List<CTFontDescriptor> descriptors, List<CTFontAttribute> mandatoryAttributes, ProgressHandler progressHandler) { CTFontDescriptor.progressHandler = progressHandler; CFSet set = CFMutableSet.create(); for (CTFontAttribute attr : mandatoryAttributes) { set.add(attr.value()); } return matchFontDescriptors(CFArray.create(descriptors), set, new FunctionPtr(cbProgress)); } /**
public static /*<name>*/CTFontAttribute/*</name>*/ valueOf(/*<type>*/CFString/*</type>*/ value) { for (/*<name>*/CTFontAttribute/*</name>*/ v : values) { if (v.value().equals(value)) { return v; } } throw new IllegalArgumentException("No constant with value " + value + " found in " + /*<name>*/CTFontAttribute/*</name>*/.class.getName()); }
public static /*<name>*/CTFontAttribute/*</name>*/ valueOf(/*<type>*/CFString/*</type>*/ value) { for (/*<name>*/CTFontAttribute/*</name>*/ v : values) { if (v.value().equals(value)) { return v; } } throw new IllegalArgumentException("No constant with value " + value + " found in " + /*<name>*/CTFontAttribute/*</name>*/.class.getName()); }
public CTFontAttributes set(CTFontAttribute key, NativeObject value) { data.put(key.value(), value); return this; }
public boolean has(CTFontAttribute key) { return data.containsKey(key.value()); } public <T extends NativeObject> T get(CTFontAttribute key, Class<T> type) {
public CTFontAttributes set(CTFontAttribute key, NativeObject value) { data.put(key.value(), value); return this; }