mac.H 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  1. //
  2. // "$Id: mac.H 12575 2017-12-02 16:20:30Z manolo $"
  3. //
  4. // Mac header file for the Fast Light Tool Kit (FLTK).
  5. //
  6. // Copyright 1998-2017 by Bill Spitzak and others.
  7. //
  8. // This library is free software. Distribution and use rights are outlined in
  9. // the file "COPYING" which should have been included with this file. If this
  10. // file is missing or damaged, see the license at:
  11. //
  12. // http://www.fltk.org/COPYING.php
  13. //
  14. // Please report all bugs and problems on the following page:
  15. //
  16. // http://www.fltk.org/str.php
  17. //
  18. // Do not directly include this file, instead use <FL/x.H>. It will
  19. // include this file if "__APPLE__" is defined. This is to encourage
  20. // portability of even the system-specific code...
  21. #ifndef FL_DOXYGEN
  22. #if !defined(Fl_X_H)
  23. # error "Never use <FL/mac.H> directly; include <FL/x.H> instead."
  24. #endif // !Fl_X_H
  25. #ifdef __OBJC__
  26. @class FLWindow; // a subclass of the NSWindow Cocoa class
  27. typedef FLWindow *Window;
  28. #else
  29. typedef class FLWindow *Window; // pointer to the FLWindow objective-c class
  30. #endif // __OBJC__
  31. #include <FL/Fl_Widget.H> // for Fl_Callback
  32. #if (defined(FL_LIBRARY) || defined(FL_INTERNALS)) // this part must be compiled when building the FLTK libraries
  33. // Standard MacOS C/C++ includes...
  34. #include <ApplicationServices/ApplicationServices.h>
  35. #undef check // because of Fl::check()
  36. #ifndef MAC_OS_X_VERSION_10_4
  37. #define MAC_OS_X_VERSION_10_4 1040
  38. #endif
  39. #ifndef MAC_OS_X_VERSION_10_5
  40. #define MAC_OS_X_VERSION_10_5 1050
  41. #endif
  42. #ifndef MAC_OS_X_VERSION_10_6
  43. #define MAC_OS_X_VERSION_10_6 1060
  44. #endif
  45. #ifndef MAC_OS_X_VERSION_10_7
  46. #define MAC_OS_X_VERSION_10_7 1070
  47. #endif
  48. #ifndef MAC_OS_X_VERSION_10_8
  49. #define MAC_OS_X_VERSION_10_8 1080
  50. #endif
  51. #ifndef MAC_OS_X_VERSION_10_9
  52. #define MAC_OS_X_VERSION_10_9 1090
  53. #endif
  54. #ifndef MAC_OS_X_VERSION_10_10
  55. #define MAC_OS_X_VERSION_10_10 101000
  56. #endif
  57. #ifndef MAC_OS_X_VERSION_10_11
  58. #define MAC_OS_X_VERSION_10_11 101100
  59. #endif
  60. #ifndef MAC_OS_X_VERSION_10_12
  61. #define MAC_OS_X_VERSION_10_12 101200
  62. #endif
  63. #ifndef NSINTEGER_DEFINED // appears with 10.5 in NSObjCRuntime.h
  64. #if defined(__LP64__) && __LP64__
  65. typedef long NSInteger;
  66. typedef unsigned long NSUInteger;
  67. #else
  68. typedef int NSInteger;
  69. typedef unsigned int NSUInteger;
  70. #endif
  71. #endif
  72. #if MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_4
  73. typedef CGImageAlphaInfo CGBitmapInfo;
  74. #endif
  75. struct flCocoaRegion {
  76. int count;
  77. CGRect *rects;
  78. }; // a region is the union of a series of rectangles
  79. #ifndef CGFLOAT_DEFINED //appears with 10.5 in CGBase.h
  80. #if defined(__LP64__) && __LP64__
  81. typedef double CGFloat;
  82. #else
  83. typedef float CGFloat;
  84. #endif
  85. #endif // CGFLOAT_DEFINED
  86. #else
  87. typedef struct CGContext* CGContextRef;
  88. #endif // FL_LIBRARY || FL_INTERNALS
  89. extern CGContextRef fl_gc;
  90. #endif // FL_DOXYGEN
  91. /** \file
  92. Mac OS X-specific symbols.
  93. */
  94. /** \defgroup group_macosx Mac OS X-specific symbols
  95. Mac OS X-specific symbols declared in <FL/x.H> or <FL/gl.h>
  96. \sa \ref osissues_macos
  97. @{ */
  98. /** \brief The version number of the running Mac OS X (e.g., 100604 for 10.6.4)
  99. */
  100. extern int fl_mac_os_version;
  101. /** The system menu bar.
  102. */
  103. //extern class Fl_Sys_Menu_Bar *fl_sys_menu_bar;
  104. struct Fl_Menu_Item;
  105. class Fl_Mac_App_Menu {
  106. public:
  107. /** Localizable text for the "About xxx" application menu item */
  108. static const char *about;
  109. /** Localizable text for the "Print Front Window" application menu item.
  110. This menu item won't be displayed if Fl_Mac_App_Menu::print
  111. is set to an empty string.
  112. */
  113. static const char *print;
  114. /** Localizable text for the "Services" application menu item */
  115. static const char *services;
  116. /** Localizable text for the "Hide xxx" application menu item */
  117. static const char *hide;
  118. /** Localizable text for the "Hide Others" application menu item */
  119. static const char *hide_others;
  120. /** Localizable text for the "Show All" application menu item */
  121. static const char *show;
  122. /** Localizable text for the "Quit xxx" application menu item */
  123. static const char *quit;
  124. static void custom_application_menu_items(const Fl_Menu_Item *m);
  125. };
  126. /** @} */
  127. //
  128. // End of "$Id: mac.H 12575 2017-12-02 16:20:30Z manolo $".
  129. //