prefs_copyToInstance.h 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. /* prefs_copyToInstance.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. void struct##Klas :: v_copyPreferencesToInstance () { \
  41. Klas##_Parent :: v_copyPreferencesToInstance ();
  42. #define prefs_add_int(Klas,name,version,default)
  43. #define prefs_add_int_with_data(Klas,name,version,default) p_##name = pref_##name ();
  44. #define prefs_override_int(Klas,name,version,default)
  45. #define prefs_add_integer(Klas,name,version,default)
  46. #define prefs_add_integer_with_data(Klas,name,version,default) p_##name = pref_##name ();
  47. #define prefs_override_integer(Klas,name,version,default)
  48. #define prefs_add_bool(Klas,name,version,default)
  49. #define prefs_add_bool_with_data(Klas,name,version,default) p_##name = pref_##name ();
  50. #define prefs_override_bool(Klas,name,version,default)
  51. #define prefs_add_double(Klas,name,version,default)
  52. #define prefs_add_double_with_data(Klas,name,version,default) p_##name = pref_##name ();
  53. #define prefs_override_double(Klas,name,version,default)
  54. #define prefs_add_enum(Klas,name,version,enumerated,default)
  55. #define prefs_add_enum_with_data(Klas,name,version,enumerated,default) p_##name = pref_##name ();
  56. #define prefs_override_enum(Klas,name,version,enumerated,default)
  57. #define prefs_add_string(Klas,name,version,default)
  58. #define prefs_add_string_with_data(Klas,name,version,default) str32cpy (& p_##name [0], pref_##name ());
  59. #define prefs_override_string(Klas,name,version,default)
  60. #define prefs_end(Klas) \
  61. }
  62. /* End of file prefs_copyToInstance.h */