Improved the objective-c and swift api
Summary: Compared to what was planned, I added the `overflow` value which seemed missing. I had to modify the implementation a bit for all values which are backed by a `YGValue`, but we should probably enable the pixel dimensions in Objective-C and Swift somehow later. Closes https://github.com/facebook/yoga/pull/322 Reviewed By: dshahidehpour Differential Revision: D4386906 Pulled By: emilsjolander fbshipit-source-id: 05ac0e571ef3a8ff0be31469e449a7b23f102218
This commit is contained in:
committed by
Facebook Github Bot
parent
c169a98be6
commit
8d320ceac2
8
enums.py
8
enums.py
@@ -119,21 +119,21 @@ def to_java_upper(symbol):
|
||||
|
||||
root = os.path.dirname(os.path.abspath(__file__))
|
||||
|
||||
# write out C headers
|
||||
# write out C & Objective-C headers
|
||||
with open(root + '/yoga/YGEnums.h', 'w') as f:
|
||||
f.write(LICENSE)
|
||||
f.write('#pragma once\n\n')
|
||||
f.write('#include "YGMacros.h"\n\n')
|
||||
f.write('YG_EXTERN_C_BEGIN\n\n')
|
||||
for name, values in ENUMS.items():
|
||||
f.write('#define YG%sCount %s\n' % (name, len(values)))
|
||||
f.write('typedef enum YG%s {\n' % name)
|
||||
f.write('#define YG%sCount %s\n' % (name, len(values)))
|
||||
f.write('typedef YG_ENUM_BEGIN(YG%s) {\n' % name)
|
||||
for value in values:
|
||||
if isinstance(value, tuple):
|
||||
f.write(' YG%s%s = %d,\n' % (name, value[0], value[1]))
|
||||
else:
|
||||
f.write(' YG%s%s,\n' % (name, value))
|
||||
f.write('} YG%s;\n' % name)
|
||||
f.write('} YG_ENUM_END(YG%s);\n' % name)
|
||||
f.write('\n')
|
||||
f.write('YG_EXTERN_C_END\n')
|
||||
|
||||
|
Reference in New Issue
Block a user