Revert D4386906: [YogaKit] Improved the objective-c and swift api

Summary: This reverts commit 05ac0e571ef3a8ff0be31469e449a7b23f102218

Differential Revision: D4386906

fbshipit-source-id: adac0d8e71ce9f3442f3bfd14b5157f88367c998
This commit is contained in:
Ben Holcomb
2017-01-07 10:23:02 -08:00
committed by Facebook Github Bot
parent 70a4221b9e
commit e2a7938b26
13 changed files with 609 additions and 767 deletions

View File

@@ -119,21 +119,21 @@ def to_java_upper(symbol):
root = os.path.dirname(os.path.abspath(__file__))
# write out C & Objective-C headers
# write out 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 YG_ENUM_BEGIN(YG%s) {\n' % name)
f.write('#define YG%sCount %s\n' % (name, len(values)))
f.write('typedef enum 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_ENUM_END(YG%s);\n' % name)
f.write('} YG%s;\n' % name)
f.write('\n')
f.write('YG_EXTERN_C_END\n')