View | Details | Raw Unified | Return to bug 5272
Collapse All | Expand All

(-)fltk-1.3.4-2/src/Fl_cocoa.mm.macos_im (-6 / +20 lines)
Lines 135-142 typedef OSStatus (*TSMSetDocumentPropert Link Here
135
static TSMSetDocumentProperty_type TSMSetDocumentProperty;
135
static TSMSetDocumentProperty_type TSMSetDocumentProperty;
136
typedef OSStatus (*TSMRemoveDocumentProperty_type)(TSMDocumentID, OSType);
136
typedef OSStatus (*TSMRemoveDocumentProperty_type)(TSMDocumentID, OSType);
137
static TSMRemoveDocumentProperty_type TSMRemoveDocumentProperty;
137
static TSMRemoveDocumentProperty_type TSMRemoveDocumentProperty;
138
typedef CFArrayRef (*TISCreateASCIICapableInputSourceList_type)(void);
138
typedef CFArrayRef (*TISCreateInputSourceList_type)(CFDictionaryRef, Boolean);
139
static TISCreateASCIICapableInputSourceList_type TISCreateASCIICapableInputSourceList;
139
static TISCreateInputSourceList_type TISCreateInputSourceList;
140
141
static CFStringRef kTISTypeKeyboardLayout;
142
static CFStringRef kTISPropertyInputSourceType;
140
143
141
typedef void (*KeyScript_type)(short);
144
typedef void (*KeyScript_type)(short);
142
static KeyScript_type KeyScript;
145
static KeyScript_type KeyScript;
Lines 1568-1576 static FLWindowDelegate *flwindowdelegat Link Here
1568
      if (im_enabled)
1571
      if (im_enabled)
1569
        TSMRemoveDocumentProperty(doc, kTSMDocumentEnabledInputSourcesPropertyTag);
1572
        TSMRemoveDocumentProperty(doc, kTSMDocumentEnabledInputSourcesPropertyTag);
1570
      else {
1573
      else {
1574
        CFDictionaryRef filter;
1571
        CFArrayRef inputSources;
1575
        CFArrayRef inputSources;
1572
        
1576
1573
        inputSources = TISCreateASCIICapableInputSourceList();
1577
        // Browsers like to use TISCreateASCIICapableInputSourceList(),
1578
        // which mostly hits the mark. But it excludes things like Greek
1579
        // and Cyrillic keyboards. So let's be more explicit.
1580
        filter = CFDictionaryCreate(NULL, 
1581
                                    (const void **)kTISPropertyInputSourceType, 
1582
                                    (const void **)kTISTypeKeyboardLayout,
1583
                                    1, NULL, NULL);
1584
        inputSources = TISCreateInputSourceList(filter, false);
1585
        CFRelease(filter);
1574
        TSMSetDocumentProperty(doc, kTSMDocumentEnabledInputSourcesPropertyTag,
1586
        TSMSetDocumentProperty(doc, kTSMDocumentEnabledInputSourcesPropertyTag,
1575
                               sizeof(CFArrayRef), &inputSources);
1587
                               sizeof(CFArrayRef), &inputSources);
1576
        CFRelease(inputSources);
1588
        CFRelease(inputSources);
Lines 1829-1836 static int input_method_startup() Link Here
1829
      TSMGetActiveDocument = (TSMGetActiveDocument_type)Fl_X::get_carbon_function("TSMGetActiveDocument");
1841
      TSMGetActiveDocument = (TSMGetActiveDocument_type)Fl_X::get_carbon_function("TSMGetActiveDocument");
1830
      TSMSetDocumentProperty = (TSMSetDocumentProperty_type)Fl_X::get_carbon_function("TSMSetDocumentProperty");
1842
      TSMSetDocumentProperty = (TSMSetDocumentProperty_type)Fl_X::get_carbon_function("TSMSetDocumentProperty");
1831
      TSMRemoveDocumentProperty = (TSMRemoveDocumentProperty_type)Fl_X::get_carbon_function("TSMRemoveDocumentProperty");
1843
      TSMRemoveDocumentProperty = (TSMRemoveDocumentProperty_type)Fl_X::get_carbon_function("TSMRemoveDocumentProperty");
1832
      TISCreateASCIICapableInputSourceList = (TISCreateASCIICapableInputSourceList_type)Fl_X::get_carbon_function("TISCreateASCIICapableInputSourceList");
1844
      TISCreateInputSourceList = (TISCreateInputSourceList_type)Fl_X::get_carbon_function("TISCreateInputSourceList");
1833
      retval = (TSMGetActiveDocument && TSMSetDocumentProperty && TSMRemoveDocumentProperty && TISCreateASCIICapableInputSourceList ? 1 : 0);
1845
      kTISTypeKeyboardLayout = (CFStringRef)Fl_X::get_carbon_function("kTISTypeKeyboardLayout");
1846
      kTISPropertyInputSourceType = (CFStringRef)Fl_X::get_carbon_function("kTISPropertyInputSourceType");
1847
      retval = (TSMGetActiveDocument && TSMSetDocumentProperty && TSMRemoveDocumentProperty && TISCreateInputSourceList && kTISTypeKeyboardLayout && kTISPropertyInputSourceType ? 1 : 0);
1834
    } else {
1848
    } else {
1835
      KeyScript = (KeyScript_type)Fl_X::get_carbon_function("KeyScript");
1849
      KeyScript = (KeyScript_type)Fl_X::get_carbon_function("KeyScript");
1836
      retval = (KeyScript? 1 : 0);
1850
      retval = (KeyScript? 1 : 0);

Return to bug 5272