diff options
| author | Manolo Gouy <Manolo> | 2016-04-02 07:29:09 +0000 |
|---|---|---|
| committer | Manolo Gouy <Manolo> | 2016-04-02 07:29:09 +0000 |
| commit | 4d4b43a6bcbcd3926b3dc1fc220c3e4b5b7a8c94 (patch) | |
| tree | 8bd21216a86f56cfa2694244b0c6abb9b48e9b85 | |
| parent | 77e5a5c11ae4d00a6ffe96c3334ea9906fc0fc78 (diff) | |
Move function Fl_X::calc_mac_os_version() to class Fl_Darwin_System_Driver
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11502 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
| -rw-r--r-- | FL/mac.H | 1 | ||||
| -rw-r--r-- | src/Fl_cocoa.mm | 4 | ||||
| -rw-r--r-- | src/drivers/Cocoa/Fl_Cocoa_Screen_Driver.cxx | 1 | ||||
| -rw-r--r-- | src/drivers/Darwin/Fl_Darwin_System_Driver.H | 1 | ||||
| -rw-r--r-- | src/drivers/Darwin/Fl_Darwin_System_Driver.cxx | 8 | ||||
| -rw-r--r-- | src/drivers/Quartz/Fl_Quartz_Graphics_Driver_font.cxx | 3 |
6 files changed, 9 insertions, 9 deletions
@@ -171,7 +171,6 @@ public: static int next_marked_length; // next length of marked text after current marked text will have been replaced static const int CoreText_threshold; // Mac OS version from which the Core Text API is used to display text static Fl_Fontdesc* calc_fl_fonts(void); // computes the fl_fonts global variable - static int calc_mac_os_version(void); // computes the fl_mac_os_version global variable static void clip_to_rounded_corners(CGContextRef gc, int w, int h); static void complete_copy_pdf_and_tiff(CGContextRef gc, CFMutableDataRef pdfdata); static void draw_layer_to_context(CALayer *layer, CGContextRef gc, int w, int h); diff --git a/src/Fl_cocoa.mm b/src/Fl_cocoa.mm index f73d90062..d857e9d6b 100644 --- a/src/Fl_cocoa.mm +++ b/src/Fl_cocoa.mm @@ -87,7 +87,7 @@ static void clipboard_check(void); static unsigned make_current_counts = 0; // if > 0, then Fl_Window::make_current() can be called only once static NSBitmapImageRep* rect_to_NSBitmapImageRep(Fl_Window *win, int x, int y, int w, int h); -int fl_mac_os_version = Fl_X::calc_mac_os_version(); // the version number of the running Mac OS X (e.g., 100604 for 10.6.4) +int fl_mac_os_version = Fl_Darwin_System_Driver::calc_mac_os_version(); // the version number of the running Mac OS X (e.g., 100604 for 10.6.4) // public variables void *fl_capture = 0; // (NSWindow*) we need this to compensate for a missing(?) mouse capture @@ -4333,7 +4333,7 @@ void Fl_Cocoa_Window_Driver::capture_titlebar_and_borders(Fl_Shared_Image*& top, /* Returns the version of the running Mac OS as an int such as 100802 for 10.8.2 */ -int Fl_X::calc_mac_os_version() { +int Fl_Darwin_System_Driver::calc_mac_os_version() { if (fl_mac_os_version) return fl_mac_os_version; int M, m, b = 0; NSAutoreleasePool *localPool = [[NSAutoreleasePool alloc] init]; diff --git a/src/drivers/Cocoa/Fl_Cocoa_Screen_Driver.cxx b/src/drivers/Cocoa/Fl_Cocoa_Screen_Driver.cxx index 6f616cb56..a048bb4b2 100644 --- a/src/drivers/Cocoa/Fl_Cocoa_Screen_Driver.cxx +++ b/src/drivers/Cocoa/Fl_Cocoa_Screen_Driver.cxx @@ -31,6 +31,7 @@ extern "C" void NSBeep(void); extern double fl_mac_flush_and_wait(double time_to_wait); extern int fl_ready(); +int Fl_X::next_marked_length = 0; /** Creates a driver that manages all screen and display related calls. diff --git a/src/drivers/Darwin/Fl_Darwin_System_Driver.H b/src/drivers/Darwin/Fl_Darwin_System_Driver.H index ab99c54d0..633e56dc6 100644 --- a/src/drivers/Darwin/Fl_Darwin_System_Driver.H +++ b/src/drivers/Darwin/Fl_Darwin_System_Driver.H @@ -64,6 +64,7 @@ public: virtual int rename(const char* f, const char *n) {return ::rename(f, n);} virtual int clocale_printf(FILE *output, const char *format, va_list args); static void *get_carbon_function(const char *name); + static int calc_mac_os_version(); // computes the fl_mac_os_version global variable }; #endif // FL_DARWIN_SYSTEM_DRIVER_H diff --git a/src/drivers/Darwin/Fl_Darwin_System_Driver.cxx b/src/drivers/Darwin/Fl_Darwin_System_Driver.cxx index 450857652..2f6d52fc6 100644 --- a/src/drivers/Darwin/Fl_Darwin_System_Driver.cxx +++ b/src/drivers/Darwin/Fl_Darwin_System_Driver.cxx @@ -20,17 +20,15 @@ #include "../../config_lib.h" #include "Fl_Darwin_System_Driver.H" #include <FL/Fl.H> -#include <FL/x.H> #include <string.h> #if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4 #include <xlocale.h> -#else -#include <locale.h> #endif +#include <locale.h> #include <stdio.h> #include <dlfcn.h> -int Fl_X::next_marked_length = 0; +extern int fl_mac_os_version; // the version number of the running Mac OS X //const char* fl_local_alt = "\xe2\x8c\xa5\\"; // U+2325 (option key) const char* fl_local_alt = "⌥\\"; // U+2325 (option key) @@ -53,7 +51,7 @@ Fl_System_Driver *Fl_System_Driver::newSystemDriver() } Fl_Darwin_System_Driver::Fl_Darwin_System_Driver() { - if (fl_mac_os_version == 0) fl_mac_os_version = Fl_X::calc_mac_os_version(); + if (fl_mac_os_version == 0) fl_mac_os_version = calc_mac_os_version(); } int Fl_Darwin_System_Driver::single_arg(const char *arg) { diff --git a/src/drivers/Quartz/Fl_Quartz_Graphics_Driver_font.cxx b/src/drivers/Quartz/Fl_Quartz_Graphics_Driver_font.cxx index 8840d4a4f..c01de98d3 100644 --- a/src/drivers/Quartz/Fl_Quartz_Graphics_Driver_font.cxx +++ b/src/drivers/Quartz/Fl_Quartz_Graphics_Driver_font.cxx @@ -20,6 +20,7 @@ #ifdef FL_CFG_GFX_QUARTZ #include "Fl_Quartz_Graphics_Driver.h" +#include "../Darwin/Fl_Darwin_System_Driver.H" #include <math.h> #include <FL/Fl.H> #include <FL/x.H> @@ -417,7 +418,7 @@ static UniChar *mac_Utf8_to_Utf16(const char *txt, int len, int *new_len) Fl_Fontdesc* Fl_X::calc_fl_fonts(void) { - if (!fl_mac_os_version) fl_mac_os_version = calc_mac_os_version(); + if (!fl_mac_os_version) fl_mac_os_version = Fl_Darwin_System_Driver::calc_mac_os_version(); #if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5 return (fl_mac_os_version >= Fl_X::CoreText_threshold ? built_in_table_PS : built_in_table_full); #else |
