keysym-case-mapping.h 738 B

123456789101112131415161718192021222324252627282930
  1. // WARNING: This file is automatically generated by: scripts/update-keysyms-case-mappings.py
  2. #pragma once
  3. #include "config.h"
  4. #include <stdint.h>
  5. #include <unicode/uchar.h>
  6. /* Unicode code points used in case mapping exceptions */
  7. #define LATIN_SMALL_LETTER_SHARP_S 0x00df // ß
  8. #define LATIN_CAPITAL_LETTER_SHARP_S 0x1e9e // ẞ
  9. static inline uint32_t
  10. to_simple_lower(uint32_t cp)
  11. {
  12. return (uint32_t)u_tolower((UChar32) cp);
  13. }
  14. static inline uint32_t
  15. to_simple_upper(uint32_t cp)
  16. {
  17. switch (cp) {
  18. /* Some exceptions */
  19. case LATIN_SMALL_LETTER_SHARP_S:
  20. return LATIN_CAPITAL_LETTER_SHARP_S;
  21. /* Default to the Unicode simple mapping */
  22. default:
  23. return (uint32_t)u_toupper((UChar32) cp);
  24. }
  25. }