moaxcp / x11

An x11 protocol implementation and client for the jvm
MIT License
18 stars 3 forks source link

Enums should be suggested values #8

Closed moaxcp closed 3 years ago

moaxcp commented 3 years ago

The protocol sends enums as a primative type (byte, short). The java classes currently have members for the java enum rather than this protocol type. This makes it impossible to set values that are not defined in the enum. This is a good general practice in java but not in this case.

One proble is supporting altenums for the field. The other issie is when an X11 extension adds new possible values for an enum field.

Remove the use of enum member fields and replace them with their primative type.

Add builder methods for setting the member based on an enum or alt enum.