prefs_define.h 3.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. /* prefs_define.h
  2. *
  3. * Copyright (C) 2013,2015-2018 Paul Boersma
  4. *
  5. * This code is free software; you can redistribute it and/or modify
  6. * it under the terms of the GNU General Public License as published by
  7. * the Free Software Foundation; either version 2 of the License, or (at
  8. * your option) any later version.
  9. *
  10. * This code is distributed in the hope that it will be useful, but
  11. * WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  13. * See the GNU General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU General Public License
  16. * along with this work. If not, see <http://www.gnu.org/licenses/>.
  17. */
  18. /* for C++ files; see prefs.h */
  19. #undef prefs_begin
  20. #undef prefs_add_int
  21. #undef prefs_add_int_with_data
  22. #undef prefs_override_int
  23. #undef prefs_add_integer
  24. #undef prefs_add_integer_with_data
  25. #undef prefs_override_integer
  26. #undef prefs_add_bool
  27. #undef prefs_add_bool_with_data
  28. #undef prefs_override_bool
  29. #undef prefs_add_double
  30. #undef prefs_add_double_with_data
  31. #undef prefs_override_double
  32. #undef prefs_add_enum
  33. #undef prefs_add_enum_with_data
  34. #undef prefs_override_enum
  35. #undef prefs_add_string
  36. #undef prefs_add_string_with_data
  37. #undef prefs_override_string
  38. #undef prefs_end
  39. #define prefs_begin(Klas)
  40. #define prefs_add_int(Klas,name,version,default) \
  41. int struct##Klas :: s_##name; \
  42. conststring32 struct##Klas :: sdefault_##name = default;
  43. #define prefs_add_int_with_data(Klas,name,version,default) prefs_add_int (Klas, name, version, default)
  44. #define prefs_override_int(Klas,name,version,default) \
  45. int struct##Klas :: s_##name; \
  46. conststring32 struct##Klas :: sdefault_##name = default;
  47. #define prefs_add_integer(Klas,name,version,default) \
  48. integer struct##Klas :: s_##name; \
  49. conststring32 struct##Klas :: sdefault_##name = default;
  50. #define prefs_add_integer_with_data(Klas,name,version,default) prefs_add_integer (Klas, name, version, default)
  51. #define prefs_override_integer(Klas,name,version,default) \
  52. integer struct##Klas :: s_##name; \
  53. conststring32 struct##Klas :: sdefault_##name = default;
  54. #define prefs_add_bool(Klas,name,version,default) \
  55. bool struct##Klas :: s_##name; \
  56. bool struct##Klas :: sdefault_##name = default;
  57. #define prefs_add_bool_with_data(Klas,name,version,default) prefs_add_bool (Klas, name, version, default)
  58. #define prefs_override_bool(Klas,name,version,default) \
  59. bool struct##Klas :: s_##name; \
  60. bool struct##Klas :: sdefault_##name = default;
  61. #define prefs_add_double(Klas,name,version,default) \
  62. double struct##Klas :: s_##name; \
  63. conststring32 struct##Klas :: sdefault_##name = default;
  64. #define prefs_add_double_with_data(Klas,name,version,default) prefs_add_double (Klas, name, version, default)
  65. #define prefs_override_double(Klas,name,version,default) \
  66. double struct##Klas :: s_##name; \
  67. conststring32 struct##Klas :: sdefault_##name = default;
  68. #define prefs_add_enum(Klas,name,version,enumerated,default) \
  69. enum enumerated struct##Klas :: s_##name; \
  70. enum enumerated struct##Klas :: sdefault_##name = enumerated :: default;
  71. #define prefs_add_enum_with_data(Klas,name,version,enumerated,default) prefs_add_enum (Klas, name, version, enumerated, default)
  72. #define prefs_override_enum(Klas,name,version,enumerated,default) \
  73. enum enumerated struct##Klas :: s_##name; \
  74. enum enumerated struct##Klas :: sdefault_##name = enumerated :: default;
  75. #define prefs_add_string(Klas,name,version,default) \
  76. char32 struct##Klas :: s_##name [Preferences_STRING_BUFFER_SIZE]; \
  77. conststring32 struct##Klas :: sdefault_##name = default;
  78. #define prefs_add_string_with_data(Klas,name,version,default) prefs_add_string (Klas, name, version, default)
  79. #define prefs_override_string(Klas,name,version,default) \
  80. char32 struct##Klas :: s_##name [Preferences_STRING_BUFFER_SIZE]; \
  81. conststring32 struct##Klas :: sdefault_##name = default;
  82. #define prefs_end(Klas)
  83. /* End of file prefs_define.h */