Skip to content

Commit 73b1137

Browse files
committed
fix some struct binding
1 parent 3f692af commit 73b1137

File tree

659 files changed

+1758
-1974
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

659 files changed

+1758
-1974
lines changed

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule "runtime/robovm-bro-gen"]
2+
path = runtime/robovm-bro-gen
3+
url = [email protected]:neocxi/robovm-bro-gen.git

runtime/Makefile

Lines changed: 31 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,12 @@ J2OBJC_ROOT = ..
1919

2020
include ../make/common.mk
2121
include ../make/j2objc_deps.mk
22-
include classes.mk
22+
include ../java_deps/jars.mk
23+
24+
JAVA_SOURCES = \
25+
com/google/j2objc/runtime/*.java \
26+
com/google/j2objc/runtime/**/*.java \
27+
apple/**/*.java
2328

2429
JAR_NAME = runtime.jar
2530
JAR = $(BUILD_DIR)/$(JAR_NAME)
@@ -33,7 +38,7 @@ CLASSPATH = $(CLASS_DIR):$(JAR_DEPS_PATH)
3338
CLASSES_DIR = $(BUILD_DIR)/classes
3439
JAVA_SOURCE_DIR = src/main/java
3540

36-
SOURCE_JAVA_FULL = $(ANNOTATION_SOURCE_JAVA:%=$(JAVA_SOURCE_DIR)/%)
41+
SOURCE_JAVA_FULL = $(JAVA_SOURCES:%=$(JAVA_SOURCE_DIR)/%)
3742

3843
$(BUILD_DIR) $(CLASSES_DIR) $(DIST_JAR_DIR):
3944
@mkdir -p $@
@@ -47,8 +52,30 @@ $(JAR): $(SOURCE_JAVA_FULL) | $(BUILD_DIR) $(CLASSES_DIR) annotations_dist
4752
$(DIST_JAR): $(JAR) | $(DIST_JAR_DIR)
4853
@install -m 0644 $< $@
4954

55+
TRANSLATE_JAVA_FULL = $(JAVA_SOURCES)
56+
TRANSLATE_JAVA_RELATIVE = $(JAVA_SOURCES:$(SRC_DIR)/%=%)
57+
TRANSLATE_ARGS = --segmented-headers --extract-unsequenced --batch-translate-max=300 \
58+
-cp $(CLASSPATH) -sourcepath $(SOURCEPATH) -encoding UTF-8 -J-Xmx2G \
59+
--hide-private-members --final-methods-as-functions -q
60+
include ../make/translate.mk
61+
62+
FAT_LIB_NAME = runtime
63+
FAT_LIB_SOURCES_RELATIVE = $(TRANSLATE_SOURCES:$(GEN_OBJC_DIR)/%=%)
64+
FAT_LIB_SOURCE_DIRS = $(GEN_OBJC_DIR)
65+
FAT_LIB_COMPILE = $(J2OBJCC)
66+
include ../make/fat_lib.mk
67+
68+
DIST_LIBRARY = $(ARCH_LIB_DIR)/runtime.a
69+
70+
fat_lib_dependencies: annotations_dist
71+
5072
dist: $(DIST_JAR)
51-
@:
73+
@(cd $(GEN_OBJC_DIR) && tar cf - $(TRANSLATE_HEADERS:$(GEN_OBJC_DIR)/%=%)) \
74+
| (cd $(ARCH_INCLUDE_DIR); tar xfp -)
5275

5376
clean:
54-
@rm -rf $(BUILD_DIR) $(DIST_JAR)
77+
@rm -rf $(BUILD_DIR) $(DIST_JAR) $(DIST_LIBRARY)
78+
79+
$(DIST_LIBRARY): $(FAT_LIB_LIBRARY) | $(ARCH_LIB_DIR)
80+
install -m 0644 $< $@
81+

runtime/gen_binding.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
ruby robovm-bro-gen/bro-gen.rb ./src/main/java/ robovm-bro-gen/bro-gen/*.yaml

runtime/robovm-bro-gen

Submodule robovm-bro-gen added at ff5e941

runtime/src/main/java/apple/accounts/ACAccountStore.java

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -43,23 +43,8 @@ public ACAccountStore() {}
4343
@Mapping("accountWithIdentifier:")
4444
public native ACAccount getAccount(String identifier);
4545
@Mapping("accountTypeWithAccountTypeIdentifier:")
46-
public native ACAccountType getAccountType(ACAccountTypeIdentifier typeIdentifier);
46+
public native ACAccountType getAccountType(String typeIdentifier);
4747
@Mapping("accountsWithAccountType:")
4848
public native NSArray<ACAccount> getAccounts(ACAccountType accountType);
49-
@Mapping("saveAccount:withCompletionHandler:")
50-
public native void saveAccount(ACAccount account, @Block VoidBlock2<Boolean, NSError> completionHandler);
51-
/**
52-
* @since Available in iOS 5.0 and later.
53-
* @deprecated Deprecated in iOS 6.0.
54-
*/
55-
@Deprecated
56-
@Mapping("requestAccessToAccountsWithType:withCompletionHandler:")
57-
public native void requestAccessToAccounts(ACAccountType accountType, @Block VoidBlock2<Boolean, NSError> handler);
58-
@Mapping("requestAccessToAccountsWithType:options:completion:")
59-
protected native void requestAccessToAccounts(ACAccountType accountType, NSDictionary<NSString, ?> options, @Block VoidBlock2<Boolean, NSError> completion);
60-
@Mapping("renewCredentialsForAccount:completion:")
61-
public native void renewCredentials(ACAccount account, @Block VoidBlock2<ACAccountCredentialRenewResult, NSError> completionHandler);
62-
@Mapping("removeAccount:withCompletionHandler:")
63-
public native void removeAccount(ACAccount account, @Block VoidBlock2<Boolean, NSError> completionHandler);
6449

6550
}

runtime/src/main/java/apple/addressbook/ABAddressBook.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public class ABAddressBook
3535
* @since Available in iOS 6.0 and later.
3636
*/
3737
@GlobalFunction("ABAddressBookCreateWithOptions")
38-
protected static native ABAddressBook create(NSDictionary<NSString, ?> options, Todo error);
38+
protected static native ABAddressBook create(NSDictionary<?, ?> options, Todo error);
3939
/**
4040
* @since Available in iOS 2.0 and later.
4141
* @deprecated Deprecated in iOS 6.0.
@@ -59,9 +59,9 @@ public class ABAddressBook
5959
@GlobalFunction("ABAddressBookCopyLocalizedLabel")
6060
public static native String getLocalizedLabel(String label);
6161
@GlobalFunction("ABAddressBookRegisterExternalChangeCallback")
62-
protected native void registerExternalChangeCallback(FunctionPtr callback, @Pointer long context);
62+
protected native void registerExternalChangeCallback(FunctionPtr callback, Todo context);
6363
@GlobalFunction("ABAddressBookUnregisterExternalChangeCallback")
64-
protected native void unregisterExternalChangeCallback(FunctionPtr callback, @Pointer long context);
64+
protected native void unregisterExternalChangeCallback(FunctionPtr callback, Todo context);
6565
@GlobalFunction("ABAddressBookRevert")
6666
public native void revert();
6767
/**

runtime/src/main/java/apple/addressbook/ABGroup.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,14 @@ public class ABGroup
3737
* @since Available in iOS 4.0 and later.
3838
*/
3939
@GlobalFunction("ABGroupCopySource")
40-
public native ABRecord source();
40+
public static native ABRecord source(ABRecord group);
4141
@GlobalFunction("ABGroupCopyArrayOfAllMembers")
42-
public native List<ABPerson> getAllMembers();
42+
public static native List<ABPerson> getAllMembers(ABRecord group);
4343
@GlobalFunction("ABGroupCopyArrayOfAllMembersWithSortOrdering")
44-
public native List<ABPerson> getAllMembers(ABPersonSortOrdering sortOrdering);
44+
public static native List<ABPerson> getAllMembers(ABRecord group, ABPersonSortOrdering sortOrdering);
4545
@GlobalFunction("ABGroupAddMember")
46-
protected native boolean addMember(ABPerson person, Todo error);
46+
protected static native boolean addMember(ABRecord group, ABRecord person, Todo error);
4747
@GlobalFunction("ABGroupRemoveMember")
48-
protected native boolean removeMember(ABPerson member, Todo error);
48+
protected static native boolean removeMember(ABRecord group, ABRecord member, Todo error);
4949

5050
}

runtime/src/main/java/apple/addressbook/ABMutableMultiValue.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,14 @@ public class ABMutableMultiValue
3131
@GlobalFunction("ABMultiValueCreateMutableCopy")
3232
public static native ABMutableMultiValue create(ABMultiValue multiValue);
3333
@GlobalFunction("ABMultiValueAddValueAndLabel")
34-
protected native boolean addValueAndLabel(CFType value, CFString label, Todo outIdentifier);
34+
protected native boolean addValueAndLabel(CFType value, String label, Todo outIdentifier);
3535
@GlobalFunction("ABMultiValueInsertValueAndLabelAtIndex")
36-
protected native boolean insertValueAndLabel(CFType value, CFString label, @MachineSizedSInt long index, Todo outIdentifier);
36+
protected native boolean insertValueAndLabel(CFType value, String label, @MachineSizedSInt long index, Todo outIdentifier);
3737
@GlobalFunction("ABMultiValueRemoveValueAndLabelAtIndex")
3838
public native boolean removeValueAndLabel(@MachineSizedSInt long index);
3939
@GlobalFunction("ABMultiValueReplaceValueAtIndex")
4040
public native boolean replaceValue(CFType value, @MachineSizedSInt long index);
4141
@GlobalFunction("ABMultiValueReplaceLabelAtIndex")
42-
protected native boolean replaceLabel(CFString label, @MachineSizedSInt long index);
42+
protected native boolean replaceLabel(String label, @MachineSizedSInt long index);
4343

4444
}

runtime/src/main/java/apple/addressbook/ABPerson.java

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,12 @@ public class ABPerson
3737
* @since Available in iOS 4.0 and later.
3838
*/
3939
@GlobalFunction("ABPersonCopySource")
40-
public native ABRecord getSource();
40+
public static native ABRecord getSource(ABRecord person);
4141
/**
4242
* @since Available in iOS 4.0 and later.
4343
*/
4444
@GlobalFunction("ABPersonCopyArrayOfAllLinkedPeople")
45-
public native List<ABPerson> getAllLinkedPeople();
45+
public static native List<ABPerson> getAllLinkedPeople(ABRecord person);
4646
@GlobalFunction("ABPersonGetSortOrdering")
4747
public static native ABPersonSortOrdering getSortOrdering();
4848
/**
@@ -56,27 +56,27 @@ public class ABPerson
5656
* @since Available in iOS 7.0 and later.
5757
*/
5858
@GlobalFunction("ABPersonGetCompositeNameFormatForRecord")
59-
public native ABPersonCompositeNameFormat getCompositeNameFormat();
59+
public static native ABPersonCompositeNameFormat getCompositeNameFormat(ABRecord record);
6060
/**
6161
* @since Available in iOS 7.0 and later.
6262
*/
6363
@GlobalFunction("ABPersonCopyCompositeNameDelimiterForRecord")
64-
public native String getCompositeNameDelimiter();
64+
public static native String getCompositeNameDelimiter(ABRecord record);
6565
@GlobalFunction("ABPersonSetImageData")
66-
protected native boolean setImageData(NSData imageData, Todo error);
66+
protected static native boolean setImageData(ABRecord person, NSData imageData, Todo error);
6767
@GlobalFunction("ABPersonCopyImageData")
68-
public native NSData getImageData();
68+
public static native NSData getImageData(ABRecord person);
6969
/**
7070
* @since Available in iOS 4.1 and later.
7171
*/
7272
@GlobalFunction("ABPersonCopyImageDataWithFormat")
73-
public native NSData getImageData(ABPersonImageFormat format);
73+
public static native NSData getImageData(ABRecord person, ABPersonImageFormat format);
7474
@GlobalFunction("ABPersonHasImageData")
75-
public native boolean hasImageData();
75+
public static native boolean hasImageData(ABRecord person);
7676
@GlobalFunction("ABPersonRemoveImageData")
77-
protected native boolean removeImageData(Todo error);
77+
protected static native boolean removeImageData(ABRecord person, Todo error);
7878
@GlobalFunction("ABPersonComparePeopleByName")
79-
public native CFComparisonResult compareTo(ABRecord person2, ABPersonSortOrdering ordering);
79+
public static native CFComparisonResult compareTo(ABRecord person1, ABRecord person2, ABPersonSortOrdering ordering);
8080
/**
8181
* @since Available in iOS 5.0 and later.
8282
*/
@@ -86,6 +86,6 @@ public class ABPerson
8686
* @since Available in iOS 5.0 and later.
8787
*/
8888
@GlobalFunction("ABPersonCreateVCardRepresentationWithPeople")
89-
public static native NSData createVCardRepresentation(List<ABPerson> people);
89+
public static native NSData createVCardRepresentation(NSArray<?> people);
9090

9191
}

runtime/src/main/java/apple/addressbookui/ABAddressFormating.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,6 @@ public class ABAddressFormating
2929

3030

3131
@GlobalFunction("ABCreateStringWithAddressDictionary")
32-
public static native String createString(CFDictionary address, boolean addCountryName);
32+
public static native String createString(NSDictionary<?, ?> address, boolean addCountryName);
3333

3434
}

0 commit comments

Comments
 (0)