head 1.2; access; symbols; locks; strict; comment @ * @; 1.2 date 2005.08.19.20.37.33; author behdad; state Exp; branches; next 1.1; commitid 68a54306430a4567; 1.1 date 2005.07.01.19.49.07; author cworth; state Exp; branches; next ; commitid 3eec42c59e334567; desc @@ 1.2 log @2005-08-19 Behdad Esfahbod * Updated to latest Cairo interface. Patch from Mauricio Piacentini. @ text @#ifndef QKAPOW_H #define QKAPOW_H #include "qcairowidget.h" #include #include typedef struct _cairo cairo_t; class QRect; class QKapow : public QCairoWidget { Q_OBJECT public: QKapow( QWidget *parent ); virtual QSize sizeHint () const; void setText( const QString &text ) { m_text = text; } int first() const { return m_first; } void setFirst( int i ) { m_first = i; } cairo_t *cr() const { return m_cr; } void bend_it (double *x, double *y); protected: virtual void cairoPaint( cairo_t *cr, const QRect &rect ); protected: void make_text_path (cairo_t *cr, double x, double y, const char *text); void make_star_path(cairo_t *cr); private: QString m_text; QSize m_defaultSize; int m_first; cairo_t *m_cr; }; #endif @ 1.1 log @ From 2005-01-25 Zack Rusin : * .cvsignore: * controlwidgetbase.ui: * mainwindow.cpp: * mainwindow.h: * qcairo.cpp: * qcairo.h: * qcairo.pro: * qcairowidget.cpp: * qcairowidget.h: * qkapow.cpp: * qkapow.h: 1) I created a QCairoWidget which has a virtual void cairoPaint(cairo_t *) method which essentially replaces the QWidget::paintEvent. It's done essentially to enable people to just take the widget, stick it in their app and just use Cairo (either duble-buffered or not). 2) Instead of the old demo code it uses now kapow. It's a little bit more attractive and nicely shows how to use QCairoWidget. @ text @d37 1 a37 1 void bend_it(double x, double y, double *new_x, double *new_y); @