juce_graphics.cpp 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179
  1. /*
  2. ==============================================================================
  3. This file is part of the JUCE library.
  4. Copyright (c) 2015 - ROLI Ltd.
  5. Permission is granted to use this software under the terms of either:
  6. a) the GPL v2 (or any later version)
  7. b) the Affero GPL v3
  8. Details of these licenses can be found at: www.gnu.org/licenses
  9. JUCE is distributed in the hope that it will be useful, but WITHOUT ANY
  10. WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
  11. A PARTICULAR PURPOSE. See the GNU General Public License for more details.
  12. ------------------------------------------------------------------------------
  13. To release a closed-source product which uses JUCE, commercial licenses are
  14. available: visit www.juce.com for more information.
  15. ==============================================================================
  16. */
  17. #ifdef JUCE_GRAPHICS_H_INCLUDED
  18. /* When you add this cpp file to your project, you mustn't include it in a file where you've
  19. already included any other headers - just put it inside a file on its own, possibly with your config
  20. flags preceding it, but don't include anything else. That also includes avoiding any automatic prefix
  21. header files that the compiler may be using.
  22. */
  23. #error "Incorrect use of JUCE cpp file"
  24. #endif
  25. #define JUCE_CORE_INCLUDE_OBJC_HELPERS 1
  26. #define JUCE_CORE_INCLUDE_COM_SMART_PTR 1
  27. #define JUCE_CORE_INCLUDE_JNI_HELPERS 1
  28. #define JUCE_CORE_INCLUDE_NATIVE_HEADERS 1
  29. #define JUCE_GRAPHICS_INCLUDE_COREGRAPHICS_HELPERS 1
  30. #include "juce_graphics.h"
  31. //==============================================================================
  32. #if JUCE_MAC
  33. #import <QuartzCore/QuartzCore.h>
  34. #elif JUCE_WINDOWS
  35. // get rid of some warnings in Window's own headers
  36. #ifdef JUCE_MSVC
  37. #pragma warning (push)
  38. #pragma warning (disable : 4458)
  39. #endif
  40. #if JUCE_MINGW && JUCE_USE_DIRECTWRITE
  41. #warning "DirectWrite not currently implemented with mingw..."
  42. #undef JUCE_USE_DIRECTWRITE
  43. #endif
  44. #if JUCE_USE_DIRECTWRITE
  45. /* If you hit a compile error trying to include these files, you may need to update
  46. your version of the Windows SDK to the latest one. The DirectWrite and Direct2D
  47. headers are in the version 7 SDKs.
  48. */
  49. #include <d2d1.h>
  50. #include <dwrite.h>
  51. #endif
  52. #if JUCE_MINGW
  53. #include <malloc.h>
  54. #endif
  55. #ifdef JUCE_MSVC
  56. #pragma warning (pop)
  57. #endif
  58. #elif JUCE_IOS
  59. #import <QuartzCore/QuartzCore.h>
  60. #import <CoreText/CoreText.h>
  61. #if __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_3_2
  62. #error "JUCE no longer supports targets earlier than iOS 3.2"
  63. #endif
  64. #elif JUCE_LINUX
  65. #ifndef JUCE_USE_FREETYPE
  66. #define JUCE_USE_FREETYPE 1
  67. #endif
  68. #endif
  69. #if JUCE_USE_FREETYPE
  70. #if JUCE_USE_FREETYPE_AMALGAMATED
  71. #include "native/freetype/FreeTypeAmalgam.h"
  72. #else
  73. #include <ft2build.h>
  74. #include FT_FREETYPE_H
  75. #endif
  76. #endif
  77. #undef SIZEOF
  78. #if (JUCE_MAC || JUCE_IOS) && USE_COREGRAPHICS_RENDERING && JUCE_USE_COREIMAGE_LOADER
  79. #define JUCE_USING_COREIMAGE_LOADER 1
  80. #else
  81. #define JUCE_USING_COREIMAGE_LOADER 0
  82. #endif
  83. //==============================================================================
  84. namespace juce
  85. {
  86. #include "colour/juce_Colour.cpp"
  87. #include "colour/juce_ColourGradient.cpp"
  88. #include "colour/juce_Colours.cpp"
  89. #include "colour/juce_FillType.cpp"
  90. #include "geometry/juce_AffineTransform.cpp"
  91. #include "geometry/juce_EdgeTable.cpp"
  92. #include "geometry/juce_Path.cpp"
  93. #include "geometry/juce_PathIterator.cpp"
  94. #include "geometry/juce_PathStrokeType.cpp"
  95. #include "placement/juce_RectanglePlacement.cpp"
  96. #include "contexts/juce_GraphicsContext.cpp"
  97. #include "contexts/juce_LowLevelGraphicsPostScriptRenderer.cpp"
  98. #include "contexts/juce_LowLevelGraphicsSoftwareRenderer.cpp"
  99. #include "images/juce_Image.cpp"
  100. #include "images/juce_ImageCache.cpp"
  101. #include "images/juce_ImageConvolutionKernel.cpp"
  102. #include "images/juce_ImageFileFormat.cpp"
  103. #include "image_formats/juce_GIFLoader.cpp"
  104. #include "image_formats/juce_JPEGLoader.cpp"
  105. #include "image_formats/juce_PNGLoader.cpp"
  106. #include "fonts/juce_AttributedString.cpp"
  107. #include "fonts/juce_Typeface.cpp"
  108. #include "fonts/juce_CustomTypeface.cpp"
  109. #include "fonts/juce_Font.cpp"
  110. #include "fonts/juce_GlyphArrangement.cpp"
  111. #include "fonts/juce_TextLayout.cpp"
  112. #include "effects/juce_DropShadowEffect.cpp"
  113. #include "effects/juce_GlowEffect.cpp"
  114. #if JUCE_USE_FREETYPE
  115. #include "native/juce_freetype_Fonts.cpp"
  116. #endif
  117. //==============================================================================
  118. #if JUCE_MAC || JUCE_IOS
  119. #include "native/juce_mac_Fonts.mm"
  120. #include "native/juce_mac_CoreGraphicsContext.mm"
  121. #elif JUCE_WINDOWS
  122. #include "native/juce_win32_DirectWriteTypeface.cpp"
  123. #include "native/juce_win32_DirectWriteTypeLayout.cpp"
  124. #include "native/juce_win32_Fonts.cpp"
  125. #if JUCE_DIRECT2D
  126. #include "native/juce_win32_Direct2DGraphicsContext.cpp"
  127. #endif
  128. #elif JUCE_LINUX
  129. #include "native/juce_linux_Fonts.cpp"
  130. #elif JUCE_ANDROID
  131. #include "native/juce_android_GraphicsContext.cpp"
  132. #include "native/juce_android_Fonts.cpp"
  133. #endif
  134. }
  135. //==============================================================================
  136. #if JUCE_USE_FREETYPE && JUCE_USE_FREETYPE_AMALGAMATED
  137. #undef PIXEL_MASK
  138. #undef ZLIB_VERSION
  139. #undef Z_ASCII
  140. #undef ZEXTERN
  141. #undef ZEXPORT
  142. extern "C"
  143. {
  144. #include "native/freetype/FreeTypeAmalgam.c"
  145. }
  146. #endif