summaryrefslogtreecommitdiff
path: root/src/drivers/Darwin/Fl_Darwin_System_Driver.cxx
diff options
context:
space:
mode:
authorManolo Gouy <Manolo>2016-04-02 07:03:18 +0000
committerManolo Gouy <Manolo>2016-04-02 07:03:18 +0000
commit77e5a5c11ae4d00a6ffe96c3334ea9906fc0fc78 (patch)
tree1783f6107ae77959f482a1c5459c6eef4783ddcc /src/drivers/Darwin/Fl_Darwin_System_Driver.cxx
parent7b37960d9520861bb53fdfcaa310bb509d346368 (diff)
Move get_carbon_function() to the Fl_Darwin_System_Driver class where it belongs.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11501 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src/drivers/Darwin/Fl_Darwin_System_Driver.cxx')
-rw-r--r--src/drivers/Darwin/Fl_Darwin_System_Driver.cxx11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/drivers/Darwin/Fl_Darwin_System_Driver.cxx b/src/drivers/Darwin/Fl_Darwin_System_Driver.cxx
index 3740e55cf..450857652 100644
--- a/src/drivers/Darwin/Fl_Darwin_System_Driver.cxx
+++ b/src/drivers/Darwin/Fl_Darwin_System_Driver.cxx
@@ -28,6 +28,7 @@
#include <locale.h>
#endif
#include <stdio.h>
+#include <dlfcn.h>
int Fl_X::next_marked_length = 0;
@@ -79,6 +80,16 @@ int Fl_Darwin_System_Driver::clocale_printf(FILE *output, const char *format, va
return retval;
}
+/* Returns the address of a Carbon function after dynamically loading the Carbon library if needed.
+ Supports old Mac OS X versions that may use a couple of Carbon calls:
+ GetKeys used by OS X 10.3 or before (in Fl::get_key())
+ PMSessionPageSetupDialog and PMSessionPrintDialog used by 10.4 or before (in Fl_Printer::start_job())
+ */
+void *Fl_Darwin_System_Driver::get_carbon_function(const char *function_name) {
+ static void *carbon = dlopen("/System/Library/Frameworks/Carbon.framework/Carbon", RTLD_LAZY);
+ return (carbon ? dlsym(carbon, function_name) : NULL);
+}
+
//
// End of "$Id$".
//