javalikescript / webview-c

A tiny cross-platform webview C library to build modern cross-platform GUIs
Other
62 stars 9 forks source link

Use enums instead of defines #5

Closed edubart closed 3 years ago

edubart commented 3 years ago

The following piece of code could be converted to an enum, the advantage is to make the library more friendly to generate bindings for other programming languages such Zig, Nelua, Odin.

#define WEBVIEW_DIALOG_FLAG_FILE (0 << 0)
#define WEBVIEW_DIALOG_FLAG_DIRECTORY (1 << 0)

#define WEBVIEW_DIALOG_FLAG_INFO (1 << 1)
#define WEBVIEW_DIALOG_FLAG_WARNING (2 << 1)
#define WEBVIEW_DIALOG_FLAG_ERROR (3 << 1)
#define WEBVIEW_DIALOG_FLAG_ALERT_MASK (3 << 1)