-
-
Notifications
You must be signed in to change notification settings - Fork 27
api.json
Improvements
#116
New issue
H 8000 ave a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Thanks for volunteering! ;) I generally like your points here, just a couple remarks: Improvements:
Proposals:
I'll comment on the organizational changes shortly! |
Generally the concept of "modules" in the api.json is more a way of organizing the API docs, than a code organization thing (we don't really have "code modules" other than in a loose sense of grouping anyways). If you find that it is confusing we could think of a way to reorganize api.json and indicate docs "chapters" in another way (or just find a better name). Let me know what you think! |
On the organizational changes:
Ah that makes much more sense! I was assuming the latter case. Is that distinction advertised anywhere?
I'm fine with keeping
Sounds good. I think reparenting
I see what you mean. I was thinking they'd belong to the graphics module directly instead of being children. That said I'm fine with leaving them in |
The only usage in
What do you think of this? {
"kind": "const",
"name": "OC_UNICODE_BASIC_LATIN",
"type": {
"kind": "namedType",
"name": "oc_unicode_range"
},
"init": {
"kind": "struct",
"value": {
"firstCodePoint": 0,
"count": 127,
}
}
} I'm pretty sure this can handle all the types in the API. Bindings generators should have enough information to parse the I'm curious to know of any other projects that have solved this problem.
Sure. By marking |
Ah I remember why I put this as an enum instead of a const, it's because MSVC doesn't support using a
Yes this looks good! Maybe we could have some shorthand for initializing |
Uh oh!
There was an error while loading. Please reload this page.
This is a list of changes to
api.json
I compiled while working on the Zig bindings. I've split them into two categories: "Improvements" for straightforward fixes, and "Proposals" for bigger changes I'd like feedback on. Also, I'm preemptively volunteering myself to do all the work accepted in this issue.Improvements
Change modulebrief
field todoc
for consistencyconst
kind insteadOC_UNICODE_RANGE
valuesOC_UI_THEME
s.oc_clock
APIoc_window
APIoc_window
typename is referenced in the API but not declared.oc_mat2x3 oc_mat2x3_scale(f32 x, f32 y)
Proposals
api.json
#117*_enum
types with their "parents"oc_file_perm
into an enum type and removeoc_file_perm_enum
. This simplifies the API surface while still allowing consumers to separate them if desired. It would also prevent the backing integer of the enum straying from the "parent" integer type, as is the case withoc_file_perm
(though that issue can be resolved regardless of this proposal).The rest of these are organizational changes to modules and their contents. They're more nitpick-y but IMO feel more natural. I don't expect them to break anyone's code.
Remove Utility module and move it's children into the rootUtility is a poor name due to it's vagueness and redundancy (all code in the API has utility, or else it wouldn't be included). This is already reflected in function names, as none have them have anoc_util_
prefix. The name "utility" usually also implies the contents are small helpers for the main API, yet it encompasses half the API surface.ui/input_state.h
intoapp/
as well.oc_font
(+ metrics),oc_color
, andoc_image
(+ region and atlas) types and functions into the Graphics moduleoc_set_color
oroc_image_draw
) should remain in Canvas.The text was updated successfully, but these errors were encountered: