DISTRHO Plugin Framework
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

Base.hpp 2.9KB

8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
7 years ago
7 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. /*
  2. * DISTRHO Plugin Framework (DPF)
  3. * Copyright (C) 2012-2019 Filipe Coelho <falktx@falktx.com>
  4. *
  5. * Permission to use, copy, modify, and/or distribute this software for any purpose with
  6. * or without fee is hereby granted, provided that the above copyright notice and this
  7. * permission notice appear in all copies.
  8. *
  9. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD
  10. * TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN
  11. * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
  12. * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER
  13. * IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
  14. * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  15. */
  16. #ifndef DGL_BASE_HPP_INCLUDED
  17. #define DGL_BASE_HPP_INCLUDED
  18. #include "../distrho/extra/LeakDetector.hpp"
  19. #include "../distrho/extra/ScopedPointer.hpp"
  20. // -----------------------------------------------------------------------
  21. // Define namespace
  22. #ifndef DGL_NAMESPACE
  23. # define DGL_NAMESPACE DGL
  24. #endif
  25. #define START_NAMESPACE_DGL namespace DGL_NAMESPACE {
  26. #define END_NAMESPACE_DGL }
  27. #define USE_NAMESPACE_DGL using namespace DGL_NAMESPACE;
  28. START_NAMESPACE_DGL
  29. // -----------------------------------------------------------------------
  30. // Base DGL enums
  31. /**
  32. Convenience symbols for ASCII control characters.
  33. */
  34. enum Char {
  35. kCharBackspace = 0x08,
  36. kCharEscape = 0x1B,
  37. kCharDelete = 0x7F
  38. };
  39. /**
  40. Keyboard modifier flags.
  41. */
  42. enum Modifier {
  43. kModifierShift = 1 << 0, /**< Shift key */
  44. kModifierControl = 1 << 1, /**< Control key */
  45. kModifierAlt = 1 << 2, /**< Alt/Option key */
  46. kModifierSuper = 1 << 3 /**< Mod4/Command/Windows key */
  47. };
  48. /**
  49. Special (non-Unicode) keyboard keys.
  50. */
  51. enum Key {
  52. kKeyF1 = 1,
  53. kKeyF2,
  54. kKeyF3,
  55. kKeyF4,
  56. kKeyF5,
  57. kKeyF6,
  58. kKeyF7,
  59. kKeyF8,
  60. kKeyF9,
  61. kKeyF10,
  62. kKeyF11,
  63. kKeyF12,
  64. kKeyLeft,
  65. kKeyUp,
  66. kKeyRight,
  67. kKeyDown,
  68. kKeyPageUp,
  69. kKeyPageDown,
  70. kKeyHome,
  71. kKeyEnd,
  72. kKeyInsert,
  73. kKeyShift,
  74. kKeyControl,
  75. kKeyAlt,
  76. kKeySuper
  77. };
  78. // -----------------------------------------------------------------------
  79. // Base DGL classes
  80. /**
  81. Graphics context, definition depends on build type.
  82. */
  83. struct GraphicsContext;
  84. /**
  85. Idle callback.
  86. */
  87. class IdleCallback
  88. {
  89. public:
  90. virtual ~IdleCallback() {}
  91. virtual void idleCallback() = 0;
  92. };
  93. // -----------------------------------------------------------------------
  94. END_NAMESPACE_DGL
  95. #ifndef DONT_SET_USING_DGL_NAMESPACE
  96. // If your code uses a lot of DGL classes, then this will obviously save you
  97. // a lot of typing, but can be disabled by setting DONT_SET_USING_DGL_NAMESPACE.
  98. using namespace DGL_NAMESPACE;
  99. #endif
  100. // -----------------------------------------------------------------------
  101. #endif // DGL_BASE_HPP_INCLUDED