Ignore:
Timestamp:
Feb 17, 2010, 8:53:20 PM (15 years ago)
Author:
Dmitry A. Kuminov
Message:

gui: Implemented support for printing through CUPS on OS/2.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/gui/painting/qcups.cpp

    r561 r573  
    5050
    5151QT_BEGIN_NAMESPACE
     52
     53#ifndef Q_WS_PM
    5254
    5355typedef int (*CupsGetDests)(cups_dest_t **dests);
     
    8688static CupsPrintFile _cupsPrintFile = 0;
    8789
     90#else // ifndef Q_WS_PM
     91
     92// On OS/2, we link to libcups statically
     93
     94static bool cupsLoaded = false;
     95static int qt_cups_num_printers = 0;
     96
     97#define _cupsGetDests cupsGetDests
     98#define _cupsFreeDests cupsFreeDests
     99#define _cupsGetPPD cupsGetPPD
     100#define _cupsLangGet cupsLangGet
     101#define _cupsLangEncoding cupsLangEncoding
     102#define _ppdOpenFile ppdOpenFile
     103#define _ppdMarkDefaults ppdMarkDefaults
     104#define _ppdClose ppdClose
     105#define _cupsMarkOptions cupsMarkOptions
     106#define _ppdMarkOption ppdMarkOption
     107#define _cupsFreeOptions cupsFreeOptions
     108#define _cupsSetDests cupsSetDests
     109#define _cupsAddOption cupsAddOption
     110#define _cupsTempFd cupsTempFd
     111#define _cupsPrintFile cupsPrintFile
     112
     113#endif // ifndef Q_WS_PM
     114
    88115static void resolveCups()
    89116{
     117#ifndef Q_WS_PM
    90118    QLibrary cupsLib(QLatin1String("cups"), 2);
    91119    if(cupsLib.load()) {
     
    107135
    108136        if (_cupsGetDests && _cupsFreeDests) {
     137#endif
    109138            cups_dest_t *printers;
    110139            int num_printers = _cupsGetDests(&printers);
     
    112141                _cupsFreeDests(num_printers, printers);
    113142            qt_cups_num_printers = num_printers;
    114         }
    115     }
     143#ifndef Q_WS_PM
     144        }
     145    }
     146#endif
    116147    cupsLoaded = true;
    117148}
     
    218249        resolveCups();
    219250
    220     return _cupsGetDests &&
     251    return
     252#ifndef Q_WS_PM
     253        _cupsGetDests &&
    221254        _cupsFreeDests &&
    222255        _cupsGetPPD &&
     
    231264        _cupsLangEncoding &&
    232265        _cupsAddOption &&
     266#endif
    233267        (qt_cups_num_printers > 0);
    234268}
Note: See TracChangeset for help on using the changeset viewer.