/[classpath]/classpath/native/jni/qt-peer/qtgraphics.cpp
ViewVC logotype

Diff of /classpath/native/jni/qt-peer/qtgraphics.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.2.2.1 by gnu_andrew, Tue Aug 16 16:22:39 2005 UTC revision 1.2.2.2 by gnu_andrew, Sat Sep 10 15:32:04 2005 UTC
# Line 35  this exception to your version of the li Line 35  this exception to your version of the li
35  obligated to do so.  If you do not wish to do so, delete this  obligated to do so.  If you do not wish to do so, delete this
36  exception statement from your version. */  exception statement from your version. */
37    
38    #include <assert.h>
39  #include <jni.h>  #include <jni.h>
40  #include <QPainter>  #include <QPainter>
41  #include <QBrush>  #include <QBrush>
# Line 112  JNIEXPORT void JNICALL Java_gnu_java_awt Line 113  JNIEXPORT void JNICALL Java_gnu_java_awt
113  (JNIEnv *env, jobject obj, jobject image)  (JNIEnv *env, jobject obj, jobject image)
114  {  {
115    QImage *im = getQtImage( env, image );    QImage *im = getQtImage( env, image );
116      assert( im );
117    QPainter *painter = new GraphicsPainter( im );    QPainter *painter = new GraphicsPainter( im );
118    assert( painter );    assert( painter );
119    setNativePtr(env, obj, painter);    setNativePtr(env, obj, painter);
120    painter->setRenderHint(QPainter::TextAntialiasing);    painter->setRenderHint(QPainter::TextAntialiasing);
121      painter->setRenderHint(QPainter::Antialiasing);
122      painter->setRenderHint(QPainter::SmoothPixmapTransform);
123  }  }
124    
125    /*
126     * Start of JNI methods
127     */
128    JNIEXPORT void JNICALL Java_gnu_java_awt_peer_qt_QtGraphics_initVolatileImage
129    (JNIEnv *env, jobject obj, jobject image)
130    {
131      QPixmap *im = getQtVolatileImage( env, image );
132      assert( im );
133      QPainter *painter = new GraphicsPainter( im );
134      assert( painter );
135      setNativePtr(env, obj, painter);
136      painter->setRenderHint(QPainter::TextAntialiasing);
137      painter->setRenderHint(QPainter::Antialiasing);
138      painter->setRenderHint(QPainter::SmoothPixmapTransform);
139    }
140    
141    /**
142     * Deletes the QPainter
143     */
144  JNIEXPORT void JNICALL Java_gnu_java_awt_peer_qt_QtGraphics_delete  JNIEXPORT void JNICALL Java_gnu_java_awt_peer_qt_QtGraphics_delete
145  (JNIEnv *env, jobject obj)  (JNIEnv *env, jobject obj)
146  {  {
# Line 131  JNIEXPORT void JNICALL Java_gnu_java_awt Line 154  JNIEXPORT void JNICALL Java_gnu_java_awt
154      }      }
155  }  }
156    
 JNIEXPORT void JNICALL Java_gnu_java_awt_peer_qt_QtGraphics_dispose  
 (JNIEnv *env, jobject obj)  
 {  
 //   GraphicsPainter *painter = (GraphicsPainter *)getPainter( env, obj );  
 //   setNativePtr( env, obj, NULL );  
 //   if( painter )  
 //     {  
 //       if( painter->isActive() )  
 //      painter->end();  
 //       delete painter;  
 //     }  
 }  
   
157  ///////////////////////////////////////////////////////////  ///////////////////////////////////////////////////////////
158  /*  /*
159   * Sets the clip to a path.   * Sets the clip to a path.
# Line 220  JNIEXPORT jobject JNICALL Java_gnu_java_ Line 230  JNIEXPORT jobject JNICALL Java_gnu_java_
230  {  {
231    QPainter *painter = getPainter( env, obj );    QPainter *painter = getPainter( env, obj );
232    assert( painter );    assert( painter );
   
233    qreal x, y, w, h;    qreal x, y, w, h;
234    painter->clipPath().boundingRect().getRect(&x, &y, &w, &h);        painter->clipPath().boundingRect().getRect(&x, &y, &w, &h);    
235    
# Line 411  JNIEXPORT void JNICALL Java_gnu_java_awt Line 420  JNIEXPORT void JNICALL Java_gnu_java_awt
420    painter->setCompositionMode( mode );    painter->setCompositionMode( mode );
421  }  }
422    
 JNIEXPORT jobject JNICALL Java_gnu_java_awt_peer_qt_QtGraphics_getFontMetrics  
 (JNIEnv *env, jobject obj, jobject font)  
 {  
 }  
   
423  /**  /**
424   * Sets the current brush to a linear gradient.   * Sets the current brush to a linear gradient.
425   */   */

Legend:
Removed from v.1.2.2.1  
changed lines
  Added in v.1.2.2.2

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26