Ignore:
Timestamp:
Nov 16, 2005, 8:36:46 PM (20 years ago)
Author:
dmik
Message:

Transferred Qt for OS/2 version 3.3.1-rc5 sources from the CVS

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/kernel/qfontengine_p.h

    r7 r8  
    4040#endif
    4141
     42#ifdef Q_WS_PM
     43#include "qt_os2.h"
     44#endif
     45
    4246#include "qtextengine_p.h"
    4347
    4448class QPaintDevice;
    4549
    46 struct glyph_metrics_t;
    47 class QChar;
    48 typedef unsigned short glyph_t;
    49 struct qoffset_t;
    50 typedef int advance_t;
    51 class QOpenType;
     50//@@TODO (dmik): these all are defined in the included "qtextengine_p.h",
     51//  what do we need it here for?
     52//struct glyph_metrics_t;
     53//class QChar;
     54//typedef unsigned short glyph_t;
     55//struct qoffset_t;
     56//typedef int advance_t;
     57//class QOpenType;
    5258struct TransformedFont;
    5359
    54 #if defined( Q_WS_X11 ) || defined( Q_WS_WIN) || defined( Q_WS_MAC )
     60#if defined( Q_WS_X11 ) || defined( Q_WS_WIN) || defined( Q_WS_PM) || defined( Q_WS_MAC )
    5561class QFontEngine : public QShared
    5662{
     
    7177        Win,
    7278        Uniscribe,
     79
     80        // OS/2 types
     81        PM,
    7382
    7483        // Apple MacOS types
     
    151160    short rbearing;
    152161#endif // Q_WS_WIN
     162#ifdef Q_WS_PM
     163    HPS ps() const;
     164    void selectTo( HPS ps ) const;
     165   
     166    HPS hps;
     167    FATTRS fa;
     168    PFONTMETRICS pfm;
     169#endif
    153170#ifdef Q_WS_X11
    154171    TransformedFont *transformed_fonts;
     
    605622#endif
    606623
    607 #endif // Q_WS_WIN
    608 
    609 #endif
     624#elif defined( Q_WS_PM )
     625
     626class QFontEnginePM : public QFontEngine
     627{
     628public:
     629    QFontEnginePM( HPS ps, PFATTRS pfa, int pixelSize, int pointSize );
     630    virtual ~QFontEnginePM() { delete[] widthCache; }
     631
     632    Error stringToCMap( const QChar *str, int len, glyph_t *glyphs, advance_t *advances, int *nglyphs, bool mirrored ) const;
     633
     634    void draw( QPainter *p, int x, int y, const QTextEngine *engine, const QScriptItem *si, int textFlags );
     635
     636    glyph_metrics_t boundingBox( const glyph_t *glyphs,
     637                               const advance_t *advances, const qoffset_t *offsets, int numGlyphs );
     638    glyph_metrics_t boundingBox( glyph_t glyph );
     639
     640    int ascent() const;
     641    int descent() const;
     642    int leading() const;
     643    int maxCharWidth() const;
     644    int minLeftBearing() const;
     645    int minRightBearing() const;
     646
     647//@@TODO (dmik): need other implementation?   
     648    const char *name() const { return 0; }
     649
     650    bool canRender( const QChar *string,  int len );
     651
     652    Type type() const;
     653
     654//@@TODO (dmik): the current implementation of font-related code does not
     655//  support true unicode (chars and strings are converted using
     656//  QString::local8bit), so 256 is enough. It will be changed later (when,
     657//  for example, ft2lib will be used). See also stringToCMap() implementation.       
     658    enum { widthCacheSize = 256 };
     659    unsigned char *widthCache;
     660};
     661
     662#endif
     663
     664#endif
Note: See TracChangeset for help on using the changeset viewer.