webui-dev / webui

Use any web browser or WebView as GUI, with your preferred language in the backend and HTML5 in the frontend, all in a lightweight portable lib.
https://webui.me
MIT License
2.35k stars 144 forks source link

Use singular form for enum names #387

Closed ttytm closed 1 month ago

ttytm commented 1 month ago

The PR is mainly about making signatures more expressive.

While the C enum names are used in the public function signatures to indicate types, there is no direct "outside" usage of the actual C enum names. So, afaik, this change shouldn't cause any breaks for one of the wrappers and should just improve expressiveness.

hassandraga commented 1 month ago

Updating the return type of webui_get_best_browser to webui_browser instead of size_t

Actually, WebUI is designed to use size_t in APIs as much as possible to make creating wrappers easy, standard, and straightforward. Otherwise we should make it a type def, and wrappers should either have same data type, or cast it to size_t. I prefer to keep it explicitly size_t.

config/browser instead of configs/browsers this change shouldn't cause any breaks for one of the wrappers

Fair enough, I'm okay with that.

ttytm commented 1 month ago

I see, and good points. I would paddel back on the first point and also prefer to keep it the size_t to not require API changes in the wrappers.

I'd remove the first of the commits then and just keep the name changes if that's fine.

ttytm commented 1 month ago

At the current updated state the updates would include a break. Changing webui_config to webui_set_config to remove a conflict in names. Alternatively, using as a different enum name would work without breaking changes.

Since webui_config is a freshly introduced function it could be okay to fine tune it before the next release, it would match with other function names that _set_. Let me know your preference please.

hassandraga commented 1 month ago

LGTM.