From 77e5a5c11ae4d00a6ffe96c3334ea9906fc0fc78 Mon Sep 17 00:00:00 2001 From: Manolo Gouy Date: Sat, 2 Apr 2016 07:03:18 +0000 Subject: 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 --- src/Fl_cocoa.mm | 21 +++++---------------- 1 file changed, 5 insertions(+), 16 deletions(-) (limited to 'src/Fl_cocoa.mm') diff --git a/src/Fl_cocoa.mm b/src/Fl_cocoa.mm index baf4d9825..f73d90062 100644 --- a/src/Fl_cocoa.mm +++ b/src/Fl_cocoa.mm @@ -1813,13 +1813,13 @@ static int input_method_startup() if (retval == -1) { fl_open_display(); if (fl_mac_os_version >= 100500) { - TSMGetActiveDocument = (TSMGetActiveDocument_type)Fl_X::get_carbon_function("TSMGetActiveDocument"); - TSMSetDocumentProperty = (TSMSetDocumentProperty_type)Fl_X::get_carbon_function("TSMSetDocumentProperty"); - TSMRemoveDocumentProperty = (TSMRemoveDocumentProperty_type)Fl_X::get_carbon_function("TSMRemoveDocumentProperty"); - TISCreateASCIICapableInputSourceList = (TISCreateASCIICapableInputSourceList_type)Fl_X::get_carbon_function("TISCreateASCIICapableInputSourceList"); + TSMGetActiveDocument = (TSMGetActiveDocument_type)Fl_Darwin_System_Driver::get_carbon_function("TSMGetActiveDocument"); + TSMSetDocumentProperty = (TSMSetDocumentProperty_type)Fl_Darwin_System_Driver::get_carbon_function("TSMSetDocumentProperty"); + TSMRemoveDocumentProperty = (TSMRemoveDocumentProperty_type)Fl_Darwin_System_Driver::get_carbon_function("TSMRemoveDocumentProperty"); + TISCreateASCIICapableInputSourceList = (TISCreateASCIICapableInputSourceList_type)Fl_Darwin_System_Driver::get_carbon_function("TISCreateASCIICapableInputSourceList"); retval = (TSMGetActiveDocument && TSMSetDocumentProperty && TSMRemoveDocumentProperty && TISCreateASCIICapableInputSourceList ? 1 : 0); } else { - KeyScript = (KeyScript_type)Fl_X::get_carbon_function("KeyScript"); + KeyScript = (KeyScript_type)Fl_Darwin_System_Driver::get_carbon_function("KeyScript"); retval = (KeyScript? 1 : 0); } } @@ -4331,17 +4331,6 @@ void Fl_Cocoa_Window_Driver::capture_titlebar_and_borders(Fl_Shared_Image*& top, CGContextRelease(auxgc); } - -/* 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_X::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); -} - /* 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() { -- cgit v1.2.3