Author: manolo
Date: 2011-03-04 08:48:10 -0800 (Fri, 04 Mar 2011)
New Revision: 8504
Log:
Mac OS: modified the definition of the fl_mac_os_version global variable to
allow v 10.10.10
Modified:
branches/branch-1.3/src/Fl.cxx
branches/branch-1.3/src/Fl_Device.cxx
branches/branch-1.3/src/Fl_cocoa.mm
branches/branch-1.3/src/fl_font_mac.cxx
branches/branch-1.3/src/fl_set_fonts_mac.cxx
Modified: branches/branch-1.3/src/Fl.cxx
===================================================================
--- branches/branch-1.3/src/Fl.cxx 2011-03-04 15:10:42 UTC (rev 8503)
+++ branches/branch-1.3/src/Fl.cxx 2011-03-04 16:48:10 UTC (rev 8504)
@@ -1140,7 +1140,7 @@
{ int ret;
Fl_Widget* pbm = belowmouse();
#ifdef __APPLE__
- if (fl_mac_os_version < 0x1050) {
+ if (fl_mac_os_version < 100500) {
// before 10.5, mouse moved events aren't sent to borderless windows
such as tooltips
Fl_Window *tooltip = Fl_Tooltip::current_window();
int inside = 0;
Modified: branches/branch-1.3/src/Fl_Device.cxx
===================================================================
--- branches/branch-1.3/src/Fl_Device.cxx 2011-03-04 15:10:42 UTC (rev
8503)
+++ branches/branch-1.3/src/Fl_Device.cxx 2011-03-04 16:48:10 UTC (rev
8504)
@@ -74,9 +74,13 @@
Fl_Display_Device::Fl_Display_Device(Fl_Graphics_Driver *graphics_driver) :
Fl_Surface_Device( graphics_driver) {
#ifdef __APPLE__
- SInt32 version;
- Gestalt(gestaltSystemVersion, &version);
- fl_mac_os_version = (int)version;
+ SInt32 versionMajor = 0;
+ SInt32 versionMinor = 0;
+ SInt32 versionBugFix = 0;
+ Gestalt( gestaltSystemVersionMajor, &versionMajor );
+ Gestalt( gestaltSystemVersionMinor, &versionMinor );
+ Gestalt( gestaltSystemVersionBugFix, &versionBugFix );
+ fl_mac_os_version = versionMajor * 10000 + versionMinor * 100 +
versionBugFix;
#endif
};
Modified: branches/branch-1.3/src/Fl_cocoa.mm
===================================================================
--- branches/branch-1.3/src/Fl_cocoa.mm 2011-03-04 15:10:42 UTC (rev 8503)
+++ branches/branch-1.3/src/Fl_cocoa.mm 2011-03-04 16:48:10 UTC (rev 8504)
@@ -113,7 +113,7 @@
//int fl_disable_transient_for; // secret method of removing
TRANSIENT_FOR
Window fl_window;
Fl_Window *Fl_Window::current_;
-int fl_mac_os_version = 0; // the version number of the running
Mac OS X (e.g., 0x1064 for 10.6.4)
+int fl_mac_os_version = 0; // the version number of the running
Mac OS X (e.g., 100604 for 10.6.4)
// forward declarations of variables in this file
static int got_events = 0;
@@ -2868,7 +2868,7 @@
[menuItem setSubmenu:appleMenu];
mainmenu = [[NSMenu alloc] initWithTitle:@""];
[mainmenu addItem:menuItem];
- if (fl_mac_os_version < 0x1060) {
+ if (fl_mac_os_version < 100600) {
// [NSApp setAppleMenu:appleMenu];
// to avoid compiler warning raised by use of undocumented setAppleMenu
:
[NSApp performSelector:@selector(setAppleMenu:) withObject:appleMenu];
@@ -3228,7 +3228,7 @@
win = win->window();
}
CGFloat epsilon = 0;
- if (fl_mac_os_version >= 0x1060) epsilon = 0.001;
+ if (fl_mac_os_version >= 100600) epsilon = 0.001;
// The epsilon offset is absolutely necessary under 10.6. Without it, the
top pixel row and
// left pixel column are not read, and bitmap is read shifted by one pixel
in both directions.
// Under 10.5, we want no offset.
Modified: branches/branch-1.3/src/fl_font_mac.cxx
===================================================================
--- branches/branch-1.3/src/fl_font_mac.cxx 2011-03-04 15:10:42 UTC (rev
8503)
+++ branches/branch-1.3/src/fl_font_mac.cxx 2011-03-04 16:48:10 UTC (rev
8504)
@@ -46,7 +46,7 @@
q_name = strdup(name);
size = Size;
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5
-if (fl_mac_os_version >= 0x1050) {//unfortunately, CTFontCreateWithName !=
NULL on 10.4 also!
+if (fl_mac_os_version >= 100500) {//unfortunately, CTFontCreateWithName !=
NULL on 10.4 also!
CFStringRef str = CFStringCreateWithCString(NULL, name,
kCFStringEncodingUTF8);
fontref = CTFontCreateWithName(str, size, NULL);
CGGlyph glyph[2];
@@ -174,7 +174,7 @@
*/
if (this == fl_graphics_driver->font_descriptor())
fl_graphics_driver->font_descriptor(NULL);
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5
- if (fl_mac_os_version >= 0x1050) {
+ if (fl_mac_os_version >= 100500) {
CFRelease(fontref);
for (unsigned i = 0; i < sizeof(width)/sizeof(float*); i++) {
if (width[i]) free(width[i]);
@@ -278,7 +278,7 @@
static double fl_mac_width(const UniChar* txt, int n, Fl_Font_Descriptor
*fl_fontsize) {
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5
-if (fl_mac_os_version >= 0x1050) {
+if (fl_mac_os_version >= 100500) {
double retval = 0;
UniChar uni;
int i;
@@ -373,7 +373,7 @@
if (!font_descriptor()) font(FL_HELVETICA, FL_NORMAL_SIZE);
Fl_Font_Descriptor *fl_fontsize = font_descriptor();
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5
-if (fl_mac_os_version >= 0x1050) {
+if (fl_mac_os_version >= 100500) {
CFStringRef str16 = CFStringCreateWithBytes(NULL, (const UInt8*)str8, n,
kCFStringEncodingUTF8, false);
CFDictionarySetValue (attributes, kCTFontAttributeName,
fl_fontsize->fontref);
CFAttributedStringRef mastr = CFAttributedStringCreate(kCFAllocatorDefault,
str16, attributes);
@@ -442,7 +442,7 @@
// convert to UTF-16 first
UniChar *uniStr = mac_Utf8_to_Utf16(str, n, &n);
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5
- if (fl_mac_os_version >= 0x1050) {
+ if (fl_mac_os_version >= 100500) {
CFStringRef str16 = CFStringCreateWithCharactersNoCopy(NULL, uniStr, n,
kCFAllocatorNull);
if (str16 == NULL) return; // shd not happen
CGColorRef color = flcolortocgcolor(driver->color());
Modified: branches/branch-1.3/src/fl_set_fonts_mac.cxx
===================================================================
--- branches/branch-1.3/src/fl_set_fonts_mac.cxx 2011-03-04 15:10:42 UTC
(rev 8503)
+++ branches/branch-1.3/src/fl_set_fonts_mac.cxx 2011-03-04 16:48:10 UTC
(rev 8504)
@@ -70,7 +70,7 @@
if (fl_free_font > FL_FREE_FONT) return (Fl_Font)fl_free_font; // if already
called
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5
-if(fl_mac_os_version >= 0x1050) {
+if(fl_mac_os_version >= 100500) {
//if(CTFontCreateWithFontDescriptor != NULL) {//
CTFontCreateWithFontDescriptor != NULL on 10.4 also!
int value[1] = {1};
CFDictionaryRef dict = CFDictionaryCreate(NULL,
_______________________________________________
fltk-commit mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-commit